diff options
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Cat.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Cat.java.patch | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Cat.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Cat.java.patch new file mode 100644 index 0000000000..b0c0ac3937 --- /dev/null +++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Cat.java.patch @@ -0,0 +1,39 @@ +--- a/net/minecraft/world/entity/animal/Cat.java ++++ b/net/minecraft/world/entity/animal/Cat.java +@@ -430,8 +412,8 @@ + } + } + } else if (this.isFood(itemstack)) { +- this.usePlayerItem(player, interactionhand, itemstack); +- if (this.random.nextInt(3) == 0) { ++ this.usePlayerItem(player, hand, itemstack); ++ if (this.random.nextInt(3) == 0 && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, player).isCancelled()) { // CraftBukkit + this.tame(player); + this.setOrderedToSit(true); + this.level().broadcastEntityEvent(this, (byte) 7); +@@ -499,7 +475,7 @@ + private static class CatTemptGoal extends TemptGoal { + + @Nullable +- private Player selectedPlayer; ++ private LivingEntity selectedPlayer; // CraftBukkit + private final Cat cat; + + public CatTemptGoal(Cat cat, double d0, Ingredient ingredient, boolean flag) { +@@ -647,7 +616,15 @@ + while (iterator.hasNext()) { + ItemStack itemstack = (ItemStack) iterator.next(); + +- this.cat.level().addFreshEntity(new ItemEntity(this.cat.level(), (double) blockpos_mutableblockpos.getX() - (double) Mth.sin(this.cat.yBodyRot * 0.017453292F), (double) blockpos_mutableblockpos.getY(), (double) blockpos_mutableblockpos.getZ() + (double) Mth.cos(this.cat.yBodyRot * 0.017453292F), itemstack)); ++ // CraftBukkit start ++ ItemEntity entityitem = new ItemEntity(this.cat.level(), (double) blockposition_mutableblockposition.getX() - (double) Mth.sin(this.cat.yBodyRot * 0.017453292F), (double) blockposition_mutableblockposition.getY(), (double) blockposition_mutableblockposition.getZ() + (double) Mth.cos(this.cat.yBodyRot * 0.017453292F), itemstack); ++ org.bukkit.event.entity.EntityDropItemEvent event = new org.bukkit.event.entity.EntityDropItemEvent(this.cat.getBukkitEntity(), (org.bukkit.entity.Item) entityitem.getBukkitEntity()); ++ entityitem.level().getCraftServer().getPluginManager().callEvent(event); ++ if (event.isCancelled()) { ++ continue; ++ } ++ this.cat.level().addFreshEntity(entityitem); ++ // CraftBukkit end + } + + } |