@@ -1,9 +1,9 @@
|
||||
--- a/net/minecraft/server/ItemBucket.java
|
||||
+++ b/net/minecraft/server/ItemBucket.java
|
||||
@@ -1,6 +1,13 @@
|
||||
package net.minecraft.server;
|
||||
@@ -2,6 +2,14 @@
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
@@ -11,10 +11,11 @@
|
||||
+import org.bukkit.event.player.PlayerBucketEmptyEvent;
|
||||
+import org.bukkit.event.player.PlayerBucketFillEvent;
|
||||
+// CraftBukkit end
|
||||
|
||||
+
|
||||
public class ItemBucket extends Item {
|
||||
|
||||
@@ -32,12 +39,22 @@
|
||||
public final FluidType fluidType;
|
||||
@@ -32,12 +40,22 @@
|
||||
if (this.fluidType == FluidTypes.EMPTY) {
|
||||
iblockdata = world.getType(blockposition);
|
||||
if (iblockdata.getBlock() instanceof IFluidSource) {
|
||||
@@ -38,7 +39,7 @@
|
||||
|
||||
if (!world.isClientSide) {
|
||||
CriterionTriggers.j.a((EntityPlayer) entityhuman, new ItemStack(fluidtype.a()));
|
||||
@@ -52,7 +69,7 @@
|
||||
@@ -52,7 +70,7 @@
|
||||
iblockdata = world.getType(blockposition);
|
||||
BlockPosition blockposition2 = iblockdata.getBlock() instanceof IFluidContainer && this.fluidType == FluidTypes.WATER ? blockposition : blockposition1;
|
||||
|
||||
@@ -47,7 +48,7 @@
|
||||
this.a(world, itemstack, blockposition2);
|
||||
if (entityhuman instanceof EntityPlayer) {
|
||||
CriterionTriggers.y.a((EntityPlayer) entityhuman, blockposition2, itemstack);
|
||||
@@ -77,6 +94,11 @@
|
||||
@@ -77,6 +95,11 @@
|
||||
public void a(World world, ItemStack itemstack, BlockPosition blockposition) {}
|
||||
|
||||
public boolean a(@Nullable EntityHuman entityhuman, World world, BlockPosition blockposition, @Nullable MovingObjectPositionBlock movingobjectpositionblock) {
|
||||
@@ -59,7 +60,7 @@
|
||||
if (!(this.fluidType instanceof FluidTypeFlowing)) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -86,8 +108,18 @@
|
||||
@@ -86,8 +109,18 @@
|
||||
boolean flag = iblockdata.a(this.fluidType);
|
||||
boolean flag1 = iblockdata.isAir() || flag || block instanceof IFluidContainer && ((IFluidContainer) block).canPlace(world, blockposition, iblockdata, this.fluidType);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user