Merge pull request #620 from Dynious/aludelfix

Fixes Aludel problem of #618
This commit is contained in:
pahimar 2014-02-05 15:16:33 -05:00
commit 8f32e2380d
2 changed files with 17 additions and 2 deletions

View file

@ -130,10 +130,21 @@ public class BlockAludelBase extends BlockEE implements ITileEntityProvider
tileGlassBell.setInventorySlotContents(TileGlassBell.DISPLAY_SLOT_INVENTORY_INDEX, null);
tileAludel.setInventorySlotContents(TileAludel.INPUT_INVENTORY_INDEX, itemStackGlassBell);
tileAludel.hasGlassBell = true;
}
}
}
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, int blockID)
{
TileAludel aludel = (TileAludel)world.getBlockTileEntity(x, y, z);
aludel.hasGlassBell = world.getBlockTileEntity(x, y + 1, z) instanceof TileGlassBell;
super.onNeighborBlockChange(world, x, y, z, blockID);
}
@Override
public int getLightValue(IBlockAccess world, int x, int y, int z)
{

View file

@ -43,6 +43,8 @@ public class TileAludel extends TileEE implements IInventory
public ItemStack outputItemStack;
public boolean hasGlassBell = false;
public TileAludel()
{
inventory = new ItemStack[INVENTORY_SIZE];
@ -164,6 +166,7 @@ public class TileAludel extends TileEE implements IInventory
deviceCookTime = nbtTagCompound.getInteger("deviceCookTime");
fuelBurnTime = nbtTagCompound.getInteger("fuelBurnTime");
itemCookTime = nbtTagCompound.getInteger("itemCookTime");
hasGlassBell = nbtTagCompound.getBoolean("hasGlassBell");
}
@Override
@ -187,6 +190,7 @@ public class TileAludel extends TileEE implements IInventory
nbtTagCompound.setInteger("deviceCookTime", deviceCookTime);
nbtTagCompound.setInteger("fuelBurnTime", fuelBurnTime);
nbtTagCompound.setInteger("itemCookTime", itemCookTime);
nbtTagCompound.setBoolean("hasGlassBell", hasGlassBell);
}
@Override
@ -288,7 +292,7 @@ public class TileAludel extends TileEE implements IInventory
private boolean canInfuse()
{
if (inventory[INPUT_INVENTORY_INDEX] == null || inventory[DUST_INVENTORY_INDEX] == null)
if (!hasGlassBell || inventory[INPUT_INVENTORY_INDEX] == null || inventory[DUST_INVENTORY_INDEX] == null)
{
return false;
}
@ -362,7 +366,7 @@ public class TileAludel extends TileEE implements IInventory
worldObj.updateAllLightTypes(xCoord, yCoord, zCoord);
if (worldObj.getBlockTileEntity(xCoord, yCoord + 1, zCoord) instanceof TileGlassBell)
if (hasGlassBell)
{
worldObj.updateAllLightTypes(xCoord, yCoord + 1, zCoord);
}