diff options
author | feildmaster <admin@feildmaster.com> | 2012-07-29 02:33:13 -0500 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2012-08-02 04:58:50 -0500 |
commit | a43d621c0138110d2ec362b2eaa8f938f241bb49 (patch) | |
tree | d2ebc0d7a4a969d3257b1b958236428a24117eb1 /src/main/java/net/minecraft/server/ItemBlock.java | |
parent | 08e2923bd4282579ca0cf7af0e6207cba0591e5c (diff) | |
download | craftbukkit-a43d621c0138110d2ec362b2eaa8f938f241bb49.tar craftbukkit-a43d621c0138110d2ec362b2eaa8f938f241bb49.tar.gz craftbukkit-a43d621c0138110d2ec362b2eaa8f938f241bb49.tar.lz craftbukkit-a43d621c0138110d2ec362b2eaa8f938f241bb49.tar.xz craftbukkit-a43d621c0138110d2ec362b2eaa8f938f241bb49.zip |
Update CraftBukkit to Minecraft 1.3.1
Diffstat (limited to 'src/main/java/net/minecraft/server/ItemBlock.java')
-rw-r--r-- | src/main/java/net/minecraft/server/ItemBlock.java | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/src/main/java/net/minecraft/server/ItemBlock.java b/src/main/java/net/minecraft/server/ItemBlock.java index 5545c011..c2b9d54f 100644 --- a/src/main/java/net/minecraft/server/ItemBlock.java +++ b/src/main/java/net/minecraft/server/ItemBlock.java @@ -9,14 +9,14 @@ public class ItemBlock extends Item { public ItemBlock(int i) { super(i); this.id = i + 256; - this.d(Block.byId[i + 256].a(2)); + this.c(Block.byId[i + 256].a(2)); } - public int a() { + public int f() { return this.id; } - public boolean interactWith(ItemStack itemstack, EntityHuman entityhuman, World world, int i, int j, int k, int l) { + public boolean interactWith(ItemStack itemstack, EntityHuman entityhuman, World world, int i, int j, int k, int l, float f, float f1, float f2) { int clickedX = i, clickedY = j, clickedZ = k; // CraftBukkit int i1 = world.getTypeId(i, j, k); @@ -50,14 +50,23 @@ public class ItemBlock extends Item { if (itemstack.count == 0) { return false; - } else if (!entityhuman.d(i, j, k)) { + } else if (!entityhuman.e(i, j, k)) { return false; } else if (j == 255 && Block.byId[this.id].material.isBuildable()) { return false; + // CraftBukkit start } - // CraftBukkit start - int id = (l == -1 && itemstack.getItem() instanceof ItemStep) ? Block.DOUBLE_STEP.id : this.id; - if (id != this.id || world.mayPlace(this.id, i, j, k, false, l)) { + + int id = this.id; + if (l == -1 && itemstack.getItem() instanceof ItemStep) { + if (this.id == Block.STEP.id) { + id = Block.DOUBLE_STEP.id; + } else if (this.id == Block.WOOD_STEP.id) { + id = Block.WOOD_DOUBLE_STEP.id; + } + } + + if (id != this.id || world.mayPlace(this.id, i, j, k, false, l, entityhuman)) { Block block = Block.byId[id]; CraftBlockState replacedBlockState = CraftBlockState.getBlockState(world, i, j, k); @@ -73,10 +82,9 @@ public class ItemBlock extends Item { if (event.isCancelled() || !event.canBuild()) { return true; } - if (world.setTypeIdAndData(i, j, k, id, data)) { if (world.getTypeId(i, j, k) == id && Block.byId[id] != null) { - Block.byId[id].postPlace(world, i, j, k, l); + Block.byId[id].postPlace(world, i, j, k, l, f, f1, f2); Block.byId[id].postPlace(world, i, j, k, entityhuman); // CraftBukkit end } @@ -91,11 +99,11 @@ public class ItemBlock extends Item { } } - public String a(ItemStack itemstack) { - return Block.byId[this.id].q(); + public String c(ItemStack itemstack) { + return Block.byId[this.id].a(); } public String getName() { - return Block.byId[this.id].q(); + return Block.byId[this.id].a(); } } |