@@ -15,18 +15,18 @@
|
||||
@@ -82,8 +87,16 @@
|
||||
ItemStack itemstack = entityhuman.b(enumhand);
|
||||
|
||||
if (itemstack.getItem() == Items.BUCKET && !this.isBaby()) {
|
||||
if (itemstack.a(Items.BUCKET) && !this.isBaby()) {
|
||||
+ // CraftBukkit start - Got milk?
|
||||
+ org.bukkit.event.player.PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent((WorldServer) entityhuman.world, entityhuman, this.getChunkCoordinates(), this.getChunkCoordinates(), null, itemstack, Items.MILK_BUCKET);
|
||||
+ org.bukkit.event.player.PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent((WorldServer) entityhuman.level, entityhuman, this.getChunkCoordinates(), this.getChunkCoordinates(), null, itemstack, Items.MILK_BUCKET);
|
||||
+
|
||||
+ if (event.isCancelled()) {
|
||||
+ return EnumInteractionResult.PASS;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
entityhuman.playSound(SoundEffects.ENTITY_COW_MILK, 1.0F, 1.0F);
|
||||
entityhuman.playSound(SoundEffects.COW_MILK, 1.0F, 1.0F);
|
||||
- ItemStack itemstack1 = ItemLiquidUtil.a(itemstack, entityhuman, Items.MILK_BUCKET.createItemStack());
|
||||
+ ItemStack itemstack1 = ItemLiquidUtil.a(itemstack, entityhuman, CraftItemStack.asNMSCopy(event.getItemStack())); // CraftBukkit
|
||||
|
||||
entityhuman.a(enumhand, itemstack1);
|
||||
return EnumInteractionResult.a(this.world.isClientSide);
|
||||
return EnumInteractionResult.a(this.level.isClientSide);
|
||||
|
||||
Reference in New Issue
Block a user