2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/entity/animal/EntityDolphin.java
|
|
|
|
+++ b/net/minecraft/world/entity/animal/EntityDolphin.java
|
2021-06-11 07:00:00 +02:00
|
|
|
@@ -176,7 +176,7 @@
|
|
|
|
this.goalSelector.a(8, new EntityDolphin.c());
|
2019-04-23 04:00:00 +02:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2021-06-11 07:00:00 +02:00
|
|
|
public static AttributeProvider.Builder fv() {
|
|
|
|
@@ -243,6 +243,12 @@
|
2019-05-17 23:19:52 +02:00
|
|
|
ItemStack itemstack = entityitem.getItemStack();
|
|
|
|
|
2020-06-25 02:00:00 +02:00
|
|
|
if (this.canPickup(itemstack)) {
|
2019-05-17 23:19:52 +02:00
|
|
|
+ // CraftBukkit start - call EntityPickupItemEvent
|
|
|
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(this, entityitem, 0, false).isCancelled()) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
2020-08-21 10:46:42 +02:00
|
|
|
+ itemstack = entityitem.getItemStack(); // update ItemStack from event
|
2019-05-17 23:19:52 +02:00
|
|
|
+ // CraftBukkit end
|
2020-06-25 02:00:00 +02:00
|
|
|
this.a(entityitem);
|
2019-05-17 23:19:52 +02:00
|
|
|
this.setSlot(EnumItemSlot.MAINHAND, itemstack);
|
2021-06-11 07:00:00 +02:00
|
|
|
this.handDropChances[EnumItemSlot.MAINHAND.b()] = 2.0F;
|
|
|
|
@@ -411,7 +417,7 @@
|
2020-01-03 06:56:58 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean a() {
|
2021-06-11 07:00:00 +02:00
|
|
|
- return this.dolphin.gotFish() && this.dolphin.getAirTicks() >= 100;
|
|
|
|
+ return this.dolphin.gotFish() && this.dolphin.getAirTicks() >= 100 && this.dolphin.level.getWorld().canGenerateStructures(); // MC-151364, SPIGOT-5494: hangs if generate-structures=false
|
2020-01-03 06:56:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2021-06-11 07:00:00 +02:00
|
|
|
@@ -520,7 +526,7 @@
|
2018-07-20 08:04:37 +02:00
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
@Override
|
2018-07-20 08:04:37 +02:00
|
|
|
public void c() {
|
2021-06-11 07:00:00 +02:00
|
|
|
- this.player.addEffect(new MobEffect(MobEffects.DOLPHINS_GRACE, 100), this.dolphin);
|
|
|
|
+ this.player.addEffect(new MobEffect(MobEffects.DOLPHINS_GRACE, 100), this.dolphin, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.DOLPHIN); // CraftBukkit
|
2018-07-20 08:04:37 +02:00
|
|
|
}
|
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
@Override
|
2021-06-11 07:00:00 +02:00
|
|
|
@@ -539,7 +545,7 @@
|
2018-07-20 08:04:37 +02:00
|
|
|
}
|
|
|
|
|
2021-06-11 07:00:00 +02:00
|
|
|
if (this.player.isSwimming() && this.player.level.random.nextInt(6) == 0) {
|
|
|
|
- this.player.addEffect(new MobEffect(MobEffects.DOLPHINS_GRACE, 100), this.dolphin);
|
|
|
|
+ this.player.addEffect(new MobEffect(MobEffects.DOLPHINS_GRACE, 100), this.dolphin, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.DOLPHIN); // CraftBukkit
|
2018-07-20 08:04:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|