aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Panda.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Panda.java.patch')
-rw-r--r--patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Panda.java.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Panda.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Panda.java.patch
new file mode 100644
index 0000000000..5d027ce3c7
--- /dev/null
+++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Panda.java.patch
@@ -0,0 +1,39 @@
+--- a/net/minecraft/world/entity/animal/Panda.java
++++ b/net/minecraft/world/entity/animal/Panda.java
+@@ -67,6 +67,11 @@
+ import net.minecraft.world.phys.Vec3;
+ import org.joml.Vector3f;
+
++// CraftBukkit start;
++import org.bukkit.craftbukkit.event.CraftEventFactory;
++import org.bukkit.event.entity.EntityTargetEvent;
++// CraftBukkit end
++
+ public class Panda extends Animal {
+
+ private static final EntityDataAccessor<Integer> UNHAPPY_COUNTER = SynchedEntityData.defineId(Panda.class, EntityDataSerializers.INT);
+@@ -543,11 +538,10 @@
+ }
+
+ @Override
+- @Override
+- protected void pickUpItem(ItemEntity itementity) {
+- if (this.getItemBySlot(EquipmentSlot.MAINHAND).isEmpty() && Panda.PANDA_ITEMS.test(itementity)) {
+- this.onItemPickup(itementity);
+- ItemStack itemstack = itementity.getItem();
++ protected void pickUpItem(ItemEntity itemEntity) {
++ if (!CraftEventFactory.callEntityPickupItemEvent(this, itemEntity, 0, !(this.getItemBySlot(EquipmentSlot.MAINHAND).isEmpty() && Panda.PANDA_ITEMS.test(itemEntity))).isCancelled()) { // CraftBukkit
++ this.onItemPickup(itemEntity);
++ ItemStack itemstack = itemEntity.getItem();
+
+ this.setItemSlot(EquipmentSlot.MAINHAND, itemstack);
+ this.setGuaranteedDrop(EquipmentSlot.MAINHAND);
+@@ -1160,7 +1117,7 @@
+ @Override
+ protected void alertOther(Mob mob, LivingEntity livingentity) {
+ if (mob instanceof Panda && mob.isAggressive()) {
+- mob.setTarget(livingentity);
++ mob.setTarget(target, EntityTargetEvent.TargetReason.TARGET_ATTACKED_ENTITY, true); // CraftBukkit
+ }
+
+ }