@@ -11,10 +11,10 @@
|
||||
|
||||
public class EntityCow extends EntityAnimal {
|
||||
|
||||
@@ -57,12 +61,22 @@
|
||||
@@ -59,13 +63,23 @@
|
||||
ItemStack itemstack = entityhuman.b(enumhand);
|
||||
|
||||
public boolean a(EntityHuman entityhuman, EnumHand enumhand, @Nullable ItemStack itemstack) {
|
||||
if (itemstack != null && itemstack.getItem() == Items.BUCKET && !entityhuman.abilities.canInstantlyBuild && !this.isBaby()) {
|
||||
if (itemstack.getItem() == Items.BUCKET && !entityhuman.abilities.canInstantlyBuild && !this.isBaby()) {
|
||||
+ // CraftBukkit start - Got milk?
|
||||
+ org.bukkit.Location loc = this.getBukkitEntity().getLocation();
|
||||
+ org.bukkit.event.player.PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent(entityhuman, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), null, itemstack, Items.MILK_BUCKET);
|
||||
@@ -24,12 +24,12 @@
|
||||
+ }
|
||||
+
|
||||
+ ItemStack result = CraftItemStack.asNMSCopy(event.getItemStack());
|
||||
entityhuman.a(SoundEffects.ap, 1.0F, 1.0F);
|
||||
- if (--itemstack.count == 0) {
|
||||
entityhuman.a(SoundEffects.ar, 1.0F, 1.0F);
|
||||
itemstack.subtract(1);
|
||||
if (itemstack.isEmpty()) {
|
||||
- entityhuman.a(enumhand, new ItemStack(Items.MILK_BUCKET));
|
||||
- } else if (!entityhuman.inventory.pickup(new ItemStack(Items.MILK_BUCKET))) {
|
||||
- entityhuman.drop(new ItemStack(Items.MILK_BUCKET), false);
|
||||
+ if (--itemstack.count <= 0) {
|
||||
+ entityhuman.a(enumhand, result);
|
||||
+ } else if (!entityhuman.inventory.pickup(result)) {
|
||||
+ entityhuman.drop(result, false);
|
||||
|
||||
Reference in New Issue
Block a user