Paper/nms-patches/EntityPanda.patch
2020-06-25 10:00:00 +10:00

42 lines
1.9 KiB
Diff

--- a/net/minecraft/server/EntityPanda.java
+++ b/net/minecraft/server/EntityPanda.java
@@ -9,6 +9,8 @@
import java.util.function.Predicate;
import javax.annotation.Nullable;
+import org.bukkit.event.entity.EntityTargetEvent; // CraftBukkit
+
public class EntityPanda extends EntityAnimal {
private static final DataWatcherObject<Integer> bw = DataWatcher.a(EntityPanda.class, DataWatcherRegistry.b);
@@ -445,7 +447,7 @@
@Override
protected void b(EntityItem entityitem) {
- if (this.getEquipment(EnumItemSlot.MAINHAND).isEmpty() && EntityPanda.PICKUP_PREDICATE.test(entityitem)) {
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(this, entityitem, 0, !(this.getEquipment(EnumItemSlot.MAINHAND).isEmpty() && EntityPanda.PICKUP_PREDICATE.test(entityitem))).isCancelled()) { // CraftBukkit
this.a(entityitem);
ItemStack itemstack = entityitem.getItemStack();
@@ -667,7 +669,7 @@
@Override
protected void a(EntityInsentient entityinsentient, EntityLiving entityliving) {
if (entityinsentient instanceof EntityPanda && ((EntityPanda) entityinsentient).isAggressive()) {
- entityinsentient.setGoalTarget(entityliving);
+ entityinsentient.setGoalTarget(entityliving, EntityTargetEvent.TargetReason.TARGET_ATTACKED_ENTITY, true); // CraftBukkit
}
}
@@ -771,9 +773,9 @@
private final EntityPanda i;
public c(EntityPanda entitypanda, Class<T> oclass, float f, double d0, double d1) {
- Predicate predicate = IEntitySelector.g;
+ // Predicate predicate = IEntitySelector.g; // CraftBukkit - decompile error
- super(entitypanda, oclass, f, d0, d1, predicate::test);
+ super(entitypanda, oclass, f, d0, d1, IEntitySelector.g::test); // CraftBukkit - decompile error
this.i = entitypanda;
}