Fix up how the Aludel sends/receives data on how to display the output stack contents in world in its TESR

This commit is contained in:
pahimar 2014-02-01 13:38:08 -05:00
parent 7d46311003
commit 1e67db9399
3 changed files with 13 additions and 9 deletions

View file

@ -13,17 +13,14 @@ import net.minecraft.item.ItemStack;
*/
public class SlotCalcinator extends Slot
{
public SlotCalcinator(IInventory inventory, int x, int y, int z)
{
super(inventory, x, y, z);
}
@Override
public boolean isItemValid(ItemStack par1ItemStack)
{
return false;
}
}

View file

@ -147,10 +147,15 @@ public class ClientProxy extends CommonProxy
}
else if (tileEntity instanceof TileAludel)
{
ItemStack itemStack = new ItemStack(itemID, stackSize, metaData);
if (color != Integer.parseInt(Colours.PURE_WHITE, 16))
ItemStack itemStack = null;
if (itemID != -1)
{
ItemHelper.setColor(itemStack, color);
itemStack = new ItemStack(itemID, stackSize, metaData);
if (color != Integer.parseInt(Colours.PURE_WHITE, 16))
{
ItemHelper.setColor(itemStack, color);
}
}
((TileAludel) tileEntity).outputItemStack = itemStack;

View file

@ -265,7 +265,7 @@ public class TileAludel extends TileEE implements IInventory
this.onInventoryChanged();
this.state = this.deviceCookTime > 0 ? (byte) 1 : (byte) 0;
this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType().blockID, 1, this.state);
PacketDispatcher.sendPacketToAllAround(this.xCoord, this.yCoord, this.zCoord, 128D, this.worldObj.provider.dimensionId, getDescriptionPacket());
PacketDispatcher.sendPacketToAllAround(this.xCoord, this.yCoord, this.zCoord, 128d, this.worldObj.provider.dimensionId, getDescriptionPacket());
this.worldObj.notifyBlockChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType().blockID);
}
}
@ -343,7 +343,7 @@ public class TileAludel extends TileEE implements IInventory
@Override
public Packet getDescriptionPacket()
{
ItemStack itemStack = getStackInSlot(OUTPUT_INVENTORY_INDEX);
ItemStack itemStack = this.inventory[OUTPUT_INVENTORY_INDEX];
if (itemStack != null && itemStack.stackSize > 0)
{
@ -351,13 +351,15 @@ public class TileAludel extends TileEE implements IInventory
}
else
{
return super.getDescriptionPacket();
return PacketTypeHandler.populatePacket(new PacketTileWithItemUpdate(xCoord, yCoord, zCoord, orientation, state, customName, -1, 0, 0, 0));
}
}
@Override
public void onInventoryChanged()
{
PacketDispatcher.sendPacketToAllAround(this.xCoord, this.yCoord, this.zCoord, 128D, this.worldObj.provider.dimensionId, getDescriptionPacket());
worldObj.updateAllLightTypes(xCoord, yCoord, zCoord);
if (worldObj.getBlockTileEntity(xCoord, yCoord + 1, zCoord) instanceof TileGlassBell)