fix recursion for leashing an abstract horse

This commit is contained in:
Spottedleaf 2020-06-26 15:54:39 -07:00
parent cd6b64113f
commit a4f75b1ae0

View file

@ -29,7 +29,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start
+ @Override
+ public boolean canLeash(EntityHuman entityhuman) {
+ public boolean a(EntityHuman entityhuman) {
+ return world.paperConfig.allowLeashingUndeadHorse ? super.a(entityhuman) : super.a(entityhuman) && this.getMonsterType() != EnumMonsterType.UNDEAD; // Paper
+ }
+ // Paper end
@ -42,14 +42,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving {
}
public boolean a(EntityHuman entityhuman) {
+ // Paper start - allow overriding
+ return this.canLeash(entityhuman);
+ }
+ public boolean canLeash(EntityHuman entityhuman) {
+ // Paper end - allow overriding
- public boolean a(EntityHuman entityhuman) {
+ public boolean a(EntityHuman entityhuman) { // Paper - overriden in EntityHorseAbstract
return !this.isLeashed() && !(this instanceof IMonster);
}