aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/animal/Panda.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/animal/Panda.java.patch')
-rw-r--r--patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/animal/Panda.java.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/animal/Panda.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/animal/Panda.java.patch
new file mode 100644
index 0000000000..c22cdec6b8
--- /dev/null
+++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/animal/Panda.java.patch
@@ -0,0 +1,43 @@
+--- a/net/minecraft/world/entity/animal/Panda.java
++++ b/net/minecraft/world/entity/animal/Panda.java
+@@ -64,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);
+ private static final EntityDataAccessor<Integer> SNEEZE_COUNTER = SynchedEntityData.defineId(Panda.class, EntityDataSerializers.INT);
+@@ -524,7 +539,7 @@
+
+ @Override
+ protected void pickUpItem(ItemEntity itemEntity) {
+- if (this.getItemBySlot(EquipmentSlot.MAINHAND).isEmpty() && PANDA_ITEMS.test(itemEntity)) {
++ if (!CraftEventFactory.callEntityPickupItemEvent(this, itemEntity, 0, !(this.getItemBySlot(EquipmentSlot.MAINHAND).isEmpty() && Panda.PANDA_ITEMS.test(itemEntity))).isCancelled()) { // CraftBukkit
+ this.onItemPickup(itemEntity);
+ ItemStack item = itemEntity.getItem();
+ this.setItemSlot(EquipmentSlot.MAINHAND, item);
+@@ -1066,16 +1115,9 @@
+ }
+
+ @Override
+- public boolean canContinueToUse() {
+- return !Panda.this.isInWater()
+- && (Panda.this.isLazy() || Panda.this.random.nextInt(reducedTickDelay(600)) != 1)
+- && Panda.this.random.nextInt(reducedTickDelay(2000)) != 1;
+- }
+-
+- @Override
+- public void tick() {
+- if (!Panda.this.isSitting() && !Panda.this.getItemBySlot(EquipmentSlot.MAINHAND).isEmpty()) {
+- Panda.this.tryToSit();
++ protected void alertOther(Mob mob, LivingEntity target) {
++ if (mob instanceof Panda && mob.isAggressive()) {
++ mob.setTarget(target, EntityTargetEvent.TargetReason.TARGET_ATTACKED_ENTITY, true); // CraftBukkit
+ }
+ }
+