Added comparator override to the petal apothecary.

This commit is contained in:
Vasco Lavos committed 2014-03-21 20:30:38 +00:00
1 parent 862e8a764b
commit 5014a7e404
2 files changed
+13

No files matched your search

@@ -68,6 +68,7 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
if(!par5EntityPlayer.capabilities.isCreativeMode)
par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, new ItemStack(Item.bucketEmpty));
tile.hasWater = true;
par1World.func_96440_m(par2, par3, par4, blockID);
PacketDispatcher.sendPacketToAllInDimension(tile.getDescriptionPacket(), par1World.provider.dimensionId);
}
@@ -139,6 +140,16 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
super.breakBlock(par1World, par2, par3, par4, par5, par6);
}
@Override
public boolean hasComparatorInputOverride() {
return true;
}
public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) {
TileAltar altar = (TileAltar) par1World.getBlockTileEntity(par2, par3, par4);
return altar.hasWater ? 15 : 0;
}
@Override
public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) {
return LexiconData.apothecary;
@@ -41,6 +41,7 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory {
if(!hasWater) {
if(stack.itemID == Item.bucketWater.itemID) {
hasWater = true;
worldObj.func_96440_m(xCoord, yCoord, zCoord, worldObj.getBlockId(xCoord, yCoord, zCoord));
stack.itemID = Item.bucketEmpty.itemID;
PacketDispatcher.sendPacketToAllInDimension(getDescriptionPacket(), worldObj.provider.dimensionId);
} else return false;
@@ -84,6 +85,7 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory {
craftingFanciness();
hasWater = false;
worldObj.func_96440_m(xCoord, yCoord, zCoord, worldObj.getBlockId(xCoord, yCoord, zCoord));
didChange = true;
break;
}