mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-16 04:33:56 -07:00
Update for 1.4_00_01 -- if you bypassed Bukkit, you will most likely break.
This commit is contained in:
@@ -25,21 +25,21 @@ public class ItemBucket extends Item {
|
||||
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.b(d0, d1, d2);
|
||||
float f3 = MathHelper.b(-f2 * 0.017453292F - 3.1415927F);
|
||||
float f4 = MathHelper.a(-f2 * 0.017453292F - 3.1415927F);
|
||||
float f5 = -MathHelper.b(-f1 * 0.017453292F);
|
||||
float f6 = MathHelper.a(-f1 * 0.017453292F);
|
||||
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.c((double) f7 * d3, (double) f6 * d3, (double) f8 * d3);
|
||||
MovingObjectPosition movingobjectposition = world.a(vec3d, vec3d1, this.a == 0);
|
||||
Vec3D vec3d1 = vec3d.add((double) f7 * d3, (double) f6 * d3, (double) f8 * d3);
|
||||
MovingObjectPosition movingobjectposition = world.rayTrace(vec3d, vec3d1, this.a == 0);
|
||||
|
||||
if (movingobjectposition == null) {
|
||||
return itemstack;
|
||||
} else {
|
||||
if (movingobjectposition.a == EnumMovingObjectType.TILE) {
|
||||
if (movingobjectposition.type == EnumMovingObjectType.TILE) {
|
||||
int i = movingobjectposition.b;
|
||||
int j = movingobjectposition.c;
|
||||
int k = movingobjectposition.d;
|
||||
@@ -61,7 +61,7 @@ public class ItemBucket extends Item {
|
||||
byte data = itemInHand.getData() == null ? (byte) 0 : itemInHand.getData().getData();
|
||||
// CraftBukkit end
|
||||
|
||||
world.e(i, j, k, 0);
|
||||
world.setTypeId(i, j, k, 0);
|
||||
return new ItemStack(itemInHand.getTypeId(), itemInHand.getAmount(), data); // CraftBukkit
|
||||
}
|
||||
|
||||
@@ -77,13 +77,13 @@ public class ItemBucket extends Item {
|
||||
byte data = itemInHand.getData() == null ? (byte) 0 : itemInHand.getData().getData();
|
||||
// CraftBukkit end
|
||||
|
||||
world.e(i, j, k, 0);
|
||||
world.setTypeId(i, j, k, 0);
|
||||
return new ItemStack(itemInHand.getTypeId(), itemInHand.getAmount(), data ); // CraftBukkit
|
||||
}
|
||||
} else {
|
||||
if (this.a < 0) {
|
||||
// CraftBukkit start
|
||||
PlayerBucketEmptyEvent event = CraftEventFactory.callPlayerBucketEmptyEvent(entityhuman, i, j, k, movingobjectposition.e, itemstack);
|
||||
PlayerBucketEmptyEvent event = CraftEventFactory.callPlayerBucketEmptyEvent(entityhuman, i, j, k, movingobjectposition.face, itemstack);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
return itemstack;
|
||||
@@ -96,47 +96,47 @@ public class ItemBucket extends Item {
|
||||
}
|
||||
int clickedX = i, clickedY = j, clickedZ = k; // CraftBukkit
|
||||
|
||||
if (movingobjectposition.e == 0) {
|
||||
if (movingobjectposition.face == 0) {
|
||||
--j;
|
||||
}
|
||||
|
||||
if (movingobjectposition.e == 1) {
|
||||
if (movingobjectposition.face == 1) {
|
||||
++j;
|
||||
}
|
||||
|
||||
if (movingobjectposition.e == 2) {
|
||||
if (movingobjectposition.face == 2) {
|
||||
--k;
|
||||
}
|
||||
|
||||
if (movingobjectposition.e == 3) {
|
||||
if (movingobjectposition.face == 3) {
|
||||
++k;
|
||||
}
|
||||
|
||||
if (movingobjectposition.e == 4) {
|
||||
if (movingobjectposition.face == 4) {
|
||||
--i;
|
||||
}
|
||||
|
||||
if (movingobjectposition.e == 5) {
|
||||
if (movingobjectposition.face == 5) {
|
||||
++i;
|
||||
}
|
||||
|
||||
if (world.isEmpty(i, j, k) || !world.getMaterial(i, j, k).isBuildable()) {
|
||||
// CraftBukkit start
|
||||
PlayerBucketEmptyEvent event = CraftEventFactory.callPlayerBucketEmptyEvent(entityhuman, clickedX, clickedY, clickedZ, movingobjectposition.e, itemstack);
|
||||
PlayerBucketEmptyEvent event = CraftEventFactory.callPlayerBucketEmptyEvent(entityhuman, clickedX, clickedY, clickedZ, movingobjectposition.face, itemstack);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
return itemstack;
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
if (world.m.d && this.a == Block.WATER.id) {
|
||||
world.a(d0 + 0.5D, d1 + 0.5D, d2 + 0.5D, "random.fizz", 0.5F, 2.6F + (world.k.nextFloat() - world.k.nextFloat()) * 0.8F);
|
||||
if (world.worldProvider.d && this.a == Block.WATER.id) {
|
||||
world.makeSound(d0 + 0.5D, d1 + 0.5D, d2 + 0.5D, "random.fizz", 0.5F, 2.6F + (world.random.nextFloat() - world.random.nextFloat()) * 0.8F);
|
||||
|
||||
for (int l = 0; l < 8; ++l) {
|
||||
world.a("largesmoke", (double) i + Math.random(), (double) j + Math.random(), (double) k + Math.random(), 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
} else {
|
||||
world.b(i, j, k, this.a, 0);
|
||||
world.setTypeIdAndData(i, j, k, this.a, 0);
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -146,9 +146,9 @@ public class ItemBucket extends Item {
|
||||
// CraftBukkit end
|
||||
}
|
||||
}
|
||||
} else if (this.a == 0 && movingobjectposition.g instanceof EntityCow) {
|
||||
} else if (this.a == 0 && movingobjectposition.entity instanceof EntityCow) {
|
||||
// CraftBukkit start -- This codepath seems to be *NEVER* called
|
||||
Location loc = movingobjectposition.g.getBukkitEntity().getLocation();
|
||||
Location loc = movingobjectposition.entity.getBukkitEntity().getLocation();
|
||||
PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent(entityhuman, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), -1, itemstack, Item.MILK_BUCKET);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
|
Reference in New Issue
Block a user