From 028bff252f0005b45869b69e4d870f84ab9058bf Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Fri, 26 Jun 2020 15:54:39 -0700 Subject: [PATCH] fix recursion for leashing an abstract horse --- .../0063-Undead-horse-leashing.patch | 17 +++++++---------- ...Implement-EntityKnockbackByEntityEvent.patch | 4 ++-- .../0302-Add-sun-related-API.patch | 4 ++-- .../0324-Add-more-Zombie-API.patch | 4 ++-- 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/Spigot-Server-Patches/0063-Undead-horse-leashing.patch b/Spigot-Server-Patches/0063-Undead-horse-leashing.patch index 6ee9eccf47..b9bb06206b 100644 --- a/Spigot-Server-Patches/0063-Undead-horse-leashing.patch +++ b/Spigot-Server-Patches/0063-Undead-horse-leashing.patch @@ -20,7 +20,7 @@ index 04430aae52205ee167662004e45c145b9d2e8bed..dd21221534542d0265fa7d2178ab69c2 + } } diff --git a/src/main/java/net/minecraft/server/EntityHorseAbstract.java b/src/main/java/net/minecraft/server/EntityHorseAbstract.java -index 364697e0155012c300219ad94a3995809e6c2f8f..8afefd8ab17188e542e067ac255634d396405fac 100644 +index 364697e0155012c300219ad94a3995809e6c2f8f..d45d025fa74a5ff53f0828f51639e19613e30186 100644 --- a/src/main/java/net/minecraft/server/EntityHorseAbstract.java +++ b/src/main/java/net/minecraft/server/EntityHorseAbstract.java @@ -106,6 +106,13 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven @@ -29,7 +29,7 @@ index 364697e0155012c300219ad94a3995809e6c2f8f..8afefd8ab17188e542e067ac255634d3 + // 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 @@ -38,18 +38,15 @@ index 364697e0155012c300219ad94a3995809e6c2f8f..8afefd8ab17188e542e067ac255634d3 protected void t(float f) { if (f > 6.0F && this.fa()) { diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 9715f10c790c0210435622ab9997ac40f98da185..f2cd6824790d7e76f8f10e2630bcd5ebbf2a4238 100644 +index 9715f10c790c0210435622ab9997ac40f98da185..2f85d9799d67d3fb1d340179d8dbd03771467329 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -1283,6 +1283,11 @@ public abstract class EntityInsentient extends EntityLiving { +@@ -1282,7 +1282,7 @@ 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); } diff --git a/Spigot-Server-Patches/0232-Implement-EntityKnockbackByEntityEvent.patch b/Spigot-Server-Patches/0232-Implement-EntityKnockbackByEntityEvent.patch index 1d7c7cf31d..f95ced4cfa 100644 --- a/Spigot-Server-Patches/0232-Implement-EntityKnockbackByEntityEvent.patch +++ b/Spigot-Server-Patches/0232-Implement-EntityKnockbackByEntityEvent.patch @@ -28,10 +28,10 @@ index a1cfa610eb3cc368b9641feeab709a4f5985ffbe..08141147f9795546e9397abed95834ed // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 3997dc6d979bf5a027861397b948aa4e8486fc58..75dca66206ecab6bcea32a05e33a638316786692 100644 +index e434e23bf5b22a623ed7b915711bdb31b7e90b61..424157dcf536527e80faf5428f18f7e66d4216b6 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -1479,7 +1479,7 @@ public abstract class EntityInsentient extends EntityLiving { +@@ -1474,7 +1474,7 @@ public abstract class EntityInsentient extends EntityLiving { if (flag) { if (f1 > 0.0F && entity instanceof EntityLiving) { diff --git a/Spigot-Server-Patches/0302-Add-sun-related-API.patch b/Spigot-Server-Patches/0302-Add-sun-related-API.patch index a4e0a0c7c7..f2a4068ec2 100644 --- a/Spigot-Server-Patches/0302-Add-sun-related-API.patch +++ b/Spigot-Server-Patches/0302-Add-sun-related-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add sun related API diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 7a49e69bcc805330adbae7ec886f666e2b7e8310..4b196b031c382aa665520b46ebc146f6f6e830e4 100644 +index c23e634dca6aab051b432a5fee2756afa80fb776..5a61167999f7d2fc271659762de9f4e861564542 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -1509,6 +1509,7 @@ public abstract class EntityInsentient extends EntityLiving { +@@ -1504,6 +1504,7 @@ public abstract class EntityInsentient extends EntityLiving { } diff --git a/Spigot-Server-Patches/0324-Add-more-Zombie-API.patch b/Spigot-Server-Patches/0324-Add-more-Zombie-API.patch index 56e5ab6168..27cb3458af 100644 --- a/Spigot-Server-Patches/0324-Add-more-Zombie-API.patch +++ b/Spigot-Server-Patches/0324-Add-more-Zombie-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add more Zombie API diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 7c9b437d950623a978ca3d45c8ca57b39a897179..dbd7850df45fb9ee550ce33f97bdfe9cf5bfcd34 100644 +index 5a61167999f7d2fc271659762de9f4e861564542..513c987a56e8d2bda0bda8771285c7c8d5ca88e1 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -1423,6 +1423,8 @@ public abstract class EntityInsentient extends EntityLiving { +@@ -1418,6 +1418,8 @@ public abstract class EntityInsentient extends EntityLiving { this.datawatcher.set(EntityInsentient.b, flag ? (byte) (b0 | 2) : (byte) (b0 & -3)); }