MC-151364, SPIGOT-5494: Feeding dolphin hangs if generate-structures=false

This commit is contained in:
md_5 2020-01-03 16:56:58 +11:00
parent 731e819c94
commit 9820cd2db0

View File

@ -21,6 +21,15 @@
this.setSlot(EnumItemSlot.MAINHAND, itemstack); this.setSlot(EnumItemSlot.MAINHAND, itemstack);
this.dropChanceHand[EnumItemSlot.MAINHAND.b()] = 2.0F; this.dropChanceHand[EnumItemSlot.MAINHAND.b()] = 2.0F;
this.receive(entityitem, itemstack.getCount()); this.receive(entityitem, itemstack.getCount());
@@ -317,7 +322,7 @@
@Override
public boolean a() {
- return this.a.eq() && this.a.getAirTicks() >= 100;
+ return this.a.eq() && this.a.getAirTicks() >= 100 && this.a.world.getWorld().canGenerateStructures(); // MC-151364, SPIGOT-5494: hangs if generate-structures=false
}
@Override
@@ -425,7 +430,7 @@ @@ -425,7 +430,7 @@
@Override @Override