3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-23 14:50:08 +01:00
Paper/nms-patches/EntityDolphin.patch

52 Zeilen
2.4 KiB
Diff

--- a/net/minecraft/server/EntityDolphin.java
+++ b/net/minecraft/server/EntityDolphin.java
2020-08-11 23:00:00 +02:00
@@ -109,7 +109,7 @@
2019-04-23 04:00:00 +02:00
this.goalSelector.a(8, new EntityDolphin.d());
this.goalSelector.a(8, new PathfinderGoalFollowBoat(this));
this.goalSelector.a(9, new PathfinderGoalAvoidTarget<>(this, EntityGuardian.class, 8.0F, 1.0D, 1.0D));
2019-05-27 22:30:00 +02:00
- this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityGuardian.class})).a());
+ this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityGuardian.class})).a(new Class[0])); // CraftBukkit - decompile error
2019-04-23 04:00:00 +02:00
}
2020-08-11 23:00:00 +02:00
public static AttributeProvider.Builder eM() {
@@ -176,6 +176,12 @@
ItemStack itemstack = entityitem.getItemStack();
2020-06-25 02:00:00 +02:00
if (this.canPickup(itemstack)) {
+ // CraftBukkit start - call EntityPickupItemEvent
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(this, entityitem, 0, false).isCancelled()) {
+ return;
+ }
+ itemstack = entityitem.getItemStack(); // update ItemStack from event
+ // CraftBukkit end
2020-06-25 02:00:00 +02:00
this.a(entityitem);
this.setSlot(EnumItemSlot.MAINHAND, itemstack);
this.dropChanceHand[EnumItemSlot.MAINHAND.b()] = 2.0F;
@@ -323,7 +329,7 @@
@Override
public boolean a() {
2020-06-25 02:00:00 +02:00
- return this.a.gotFish() && this.a.getAirTicks() >= 100;
+ return this.a.gotFish() && this.a.getAirTicks() >= 100 && this.a.world.getWorld().canGenerateStructures(); // MC-151364, SPIGOT-5494: hangs if generate-structures=false
}
@Override
@@ -432,7 +438,7 @@
2019-04-23 04:00:00 +02:00
@Override
public void c() {
- this.c.addEffect(new MobEffect(MobEffects.DOLPHINS_GRACE, 100));
+ this.c.addEffect(new MobEffect(MobEffects.DOLPHINS_GRACE, 100), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.DOLPHIN); // CraftBukkit
}
2019-04-23 04:00:00 +02:00
@Override
@@ -451,7 +457,7 @@
}
2018-07-22 04:00:00 +02:00
if (this.c.isSwimming() && this.c.world.random.nextInt(6) == 0) {
- this.c.addEffect(new MobEffect(MobEffects.DOLPHINS_GRACE, 100));
+ this.c.addEffect(new MobEffect(MobEffects.DOLPHINS_GRACE, 100), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.DOLPHIN); // CraftBukkit
}
}