Fixed Compost and Reconstructor syncing with hoppers.

Closes #59
This commit is contained in:
Ellpeck 2016-02-01 17:43:14 +01:00
parent 091b6cbfc3
commit c92aebfe0a
3 changed files with 14 additions and 26 deletions

View file

@ -83,7 +83,7 @@ public class BlockCompost extends BlockContainerBase implements IHudDisplay{
if(!player.capabilities.isCreativeMode){ if(!player.capabilities.isCreativeMode){
player.inventory.getCurrentItem().stackSize--; player.inventory.getCurrentItem().stackSize--;
} }
tile.sendUpdate(); tile.markDirty();
} }
//Add Fertilizer to player's inventory //Add Fertilizer to player's inventory
@ -95,7 +95,7 @@ public class BlockCompost extends BlockContainerBase implements IHudDisplay{
player.getCurrentEquippedItem().stackSize += tile.slots[0].stackSize; player.getCurrentEquippedItem().stackSize += tile.slots[0].stackSize;
} }
tile.slots[0] = null; tile.slots[0] = null;
tile.sendUpdate(); tile.markDirty();
} }
} }
return true; return true;

View file

@ -113,6 +113,12 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple
this.storage.writeToNBT(compound); this.storage.writeToNBT(compound);
} }
@Override
public void markDirty(){
super.markDirty();
this.sendUpdate();
}
@Override @Override
public boolean shouldSyncSlots(){ public boolean shouldSyncSlots(){
return true; return true;
@ -125,18 +131,6 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple
this.storage.readFromNBT(compound); this.storage.readFromNBT(compound);
} }
@Override
public void setInventorySlotContents(int i, ItemStack stack){
super.setInventorySlotContents(i, stack);
this.sendUpdate();
}
@Override
public ItemStack decrStackSize(int i, int j){
this.sendUpdate();
return super.decrStackSize(i, j);
}
@Override @Override
public int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate){ public int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate){
return this.storage.receiveEnergy(maxReceive, simulate); return this.storage.receiveEnergy(maxReceive, simulate);

View file

@ -62,18 +62,6 @@ public class TileEntityCompost extends TileEntityInventoryBase{
this.conversionTime = compound.getInteger("ConversionTime"); this.conversionTime = compound.getInteger("ConversionTime");
} }
@Override
public void setInventorySlotContents(int i, ItemStack stack){
super.setInventorySlotContents(i, stack);
this.sendUpdate();
}
@Override
public ItemStack decrStackSize(int i, int j){
this.sendUpdate();
return super.decrStackSize(i, j);
}
@Override @Override
public int getInventoryStackLimit(){ public int getInventoryStackLimit(){
return AMOUNT; return AMOUNT;
@ -93,4 +81,10 @@ public class TileEntityCompost extends TileEntityInventoryBase{
public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){ public boolean canExtractItem(int slot, ItemStack stack, EnumFacing side){
return stack.getItem() instanceof ItemFertilizer; return stack.getItem() instanceof ItemFertilizer;
} }
@Override
public void markDirty(){
super.markDirty();
this.sendUpdate();
}
} }