diff options
author | EvilSeph <evilseph@gmail.com> | 2012-01-07 22:06:41 -0500 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-01-07 22:06:41 -0500 |
commit | 93aed40c4f82a2fb1cf4436c7a75c5622197d539 (patch) | |
tree | af31964ac74982518b62ba1686ee818bc19aeb24 /src/main | |
parent | 13470ccf79072e40e548b615b2ff19f6b60d634f (diff) | |
download | craftbukkit-93aed40c4f82a2fb1cf4436c7a75c5622197d539.tar craftbukkit-93aed40c4f82a2fb1cf4436c7a75c5622197d539.tar.gz craftbukkit-93aed40c4f82a2fb1cf4436c7a75c5622197d539.tar.lz craftbukkit-93aed40c4f82a2fb1cf4436c7a75c5622197d539.tar.xz craftbukkit-93aed40c4f82a2fb1cf4436c7a75c5622197d539.zip |
Fixed filled bottles not appearing in inventory. Fixes BUKKIT-325. Thanks
md-5!
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/net/minecraft/server/BlockCauldron.java | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/BlockCauldron.java b/src/main/java/net/minecraft/server/BlockCauldron.java new file mode 100644 index 00000000..dc5a658f --- /dev/null +++ b/src/main/java/net/minecraft/server/BlockCauldron.java @@ -0,0 +1,97 @@ +package net.minecraft.server; + +import java.util.ArrayList; +import java.util.Random; + +public class BlockCauldron extends Block { + + public BlockCauldron(int i) { + super(i, Material.ORE); + this.textureId = 154; + } + + public int a(int i, int j) { + return i == 1 ? 138 : (i == 0 ? 155 : 154); + } + + public void a(World world, int i, int j, int k, AxisAlignedBB axisalignedbb, ArrayList arraylist) { + this.a(0.0F, 0.0F, 0.0F, 1.0F, 0.3125F, 1.0F); + super.a(world, i, j, k, axisalignedbb, arraylist); + float f = 0.125F; + + this.a(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); + super.a(world, i, j, k, axisalignedbb, arraylist); + this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); + super.a(world, i, j, k, axisalignedbb, arraylist); + this.a(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + super.a(world, i, j, k, axisalignedbb, arraylist); + this.a(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); + super.a(world, i, j, k, axisalignedbb, arraylist); + this.f(); + } + + public void f() { + this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + public boolean a() { + return false; + } + + public int c() { + return 24; + } + + public boolean b() { + return false; + } + + public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman) { + if (world.isStatic) { + return true; + } else { + ItemStack itemstack = entityhuman.inventory.getItemInHand(); + + if (itemstack == null) { + return true; + } else { + int l = world.getData(i, j, k); + + if (itemstack.id == Item.WATER_BUCKET.id) { + if (l < 3) { + if (!entityhuman.abilities.canInstantlyBuild) { + entityhuman.inventory.setItem(entityhuman.inventory.itemInHandIndex, new ItemStack(Item.BUCKET)); + } + + world.setData(i, j, k, 3); + } + + return true; + } else { + if (itemstack.id == Item.GLASS_BOTTLE.id && l > 0) { + ItemStack itemstack1 = new ItemStack(Item.POTION, 1, 0); + + if (!entityhuman.inventory.pickup(itemstack1)) { + world.addEntity(new EntityItem(world, (double) i + 0.5D, (double) j + 1.5D, (double) k + 0.5D, itemstack1)); + } else if (entityhuman instanceof EntityPlayer) { //CraftBukkit + ((EntityPlayer) entityhuman).updateInventory(entityhuman.defaultContainer); // CraftBukkit + } + + --itemstack.count; + if (itemstack.count <= 0) { + entityhuman.inventory.setItem(entityhuman.inventory.itemInHandIndex, (ItemStack) null); + } + + world.setData(i, j, k, l - 1); + } + + return true; + } + } + } + } + + public int getDropType(int i, Random random, int j) { + return Item.CAULDRON.id; + } +}
\ No newline at end of file |