diff options
Diffstat (limited to 'src/main/java/net/minecraft/server/ItemBucket.java')
-rw-r--r-- | src/main/java/net/minecraft/server/ItemBucket.java | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/main/java/net/minecraft/server/ItemBucket.java b/src/main/java/net/minecraft/server/ItemBucket.java index ee348ac9..2eb6104d 100644 --- a/src/main/java/net/minecraft/server/ItemBucket.java +++ b/src/main/java/net/minecraft/server/ItemBucket.java @@ -20,21 +20,11 @@ public class ItemBucket extends Item { public ItemStack a(ItemStack itemstack, World world, EntityHuman entityhuman) { float f = 1.0F; - float f1 = entityhuman.lastPitch + (entityhuman.pitch - entityhuman.lastPitch) * f; - float f2 = entityhuman.lastYaw + (entityhuman.yaw - entityhuman.lastYaw) * f; double d0 = entityhuman.lastX + (entityhuman.locX - entityhuman.lastX) * (double) f; double d1 = entityhuman.lastY + (entityhuman.locY - entityhuman.lastY) * (double) f + 1.62D - (double) entityhuman.height; double d2 = entityhuman.lastZ + (entityhuman.locZ - entityhuman.lastZ) * (double) f; - Vec3D vec3d = Vec3D.create(d0, d1, d2); - float f3 = MathHelper.cos(-f2 * 0.017453292F - 3.1415927F); - float f4 = MathHelper.sin(-f2 * 0.017453292F - 3.1415927F); - float f5 = -MathHelper.cos(-f1 * 0.017453292F); - float f6 = MathHelper.sin(-f1 * 0.017453292F); - float f7 = f4 * f5; - float f8 = f3 * f5; - double d3 = 5.0D; - Vec3D vec3d1 = vec3d.add((double) f7 * d3, (double) f6 * d3, (double) f8 * d3); - MovingObjectPosition movingobjectposition = world.rayTrace(vec3d, vec3d1, this.a == 0); + boolean flag = this.a == 0; + MovingObjectPosition movingobjectposition = this.a(world, entityhuman, flag); if (movingobjectposition == null) { return itemstack; @@ -49,7 +39,7 @@ public class ItemBucket extends Item { } if (this.a == 0) { - if (!entityhuman.c(i, j, k)) { + if (!entityhuman.d(i, j, k)) { return itemstack; } @@ -61,6 +51,10 @@ public class ItemBucket extends Item { return itemstack; } + if (entityhuman.abilities.canInstantlyBuild) { + return itemstack; + } + CraftItemStack itemInHand = (CraftItemStack) event.getItemStack(); byte data = itemInHand.getData() == null ? (byte) 0 : itemInHand.getData().getData(); // CraftBukkit end @@ -77,6 +71,10 @@ public class ItemBucket extends Item { return itemstack; } + if (entityhuman.abilities.canInstantlyBuild) { + return itemstack; + } + CraftItemStack itemInHand = (CraftItemStack) event.getItemStack(); byte data = itemInHand.getData() == null ? (byte) 0 : itemInHand.getData().getData(); // CraftBukkit end @@ -125,7 +123,7 @@ public class ItemBucket extends Item { ++i; } - if (!entityhuman.c(i, j, k)) { + if (!entityhuman.d(i, j, k)) { return itemstack; } |