Update to Minecraft 1.11

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2016-11-17 12:41:03 +11:00
parent 49bc1c57f9
commit 4e412ab4e3
279 changed files with 3722 additions and 2992 deletions

View File

@@ -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);