Get rid of a second stack overflow

This commit is contained in:
fullwall 2023-02-14 00:46:30 +08:00
parent f64e28f2e8
commit bd50e42c52
755 changed files with 667 additions and 1195 deletions

View File

@ -128,7 +128,7 @@ public class BatController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -125,7 +125,7 @@ public class BlazeController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -150,17 +150,7 @@ public class CaveSpiderController extends MobEntityController {
@Override
public boolean isLeashed() {
if (npc == null) {
return super.isLeashed();
}
boolean protectedDefault = npc.isProtected();
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault)) {
return super.isLeashed();
}
if (super.isLeashed()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -161,7 +161,7 @@ public class ChickenController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -176,7 +176,7 @@ public class CowController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -160,7 +160,7 @@ public class CreeperController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -124,7 +124,7 @@ public class EnderDragonController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -149,7 +149,7 @@ public class EndermanController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -149,7 +149,7 @@ public class EndermiteController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -116,7 +116,7 @@ public class GhastController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -135,7 +135,7 @@ public class GiantController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -136,7 +136,7 @@ public class GuardianController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -166,7 +166,7 @@ public class HorseController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -135,7 +135,7 @@ public class IronGolemController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -148,7 +148,7 @@ public class MagmaCubeController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -157,7 +157,7 @@ public class MushroomCowController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -153,7 +153,7 @@ public class OcelotController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -156,7 +156,7 @@ public class PigController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -136,7 +136,7 @@ public class PigZombieController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -122,7 +122,7 @@ public class PolarBearController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -153,7 +153,7 @@ public class RabbitController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -146,7 +146,7 @@ public class SheepController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -136,7 +136,7 @@ public class ShulkerController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -135,7 +135,7 @@ public class SilverfishController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -135,7 +135,7 @@ public class SkeletonController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -149,7 +149,7 @@ public class SlimeController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -135,7 +135,7 @@ public class SnowmanController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -135,7 +135,7 @@ public class SpiderController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -135,7 +135,7 @@ public class SquidController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -169,7 +169,7 @@ public class VillagerController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -135,7 +135,7 @@ public class WitchController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -116,7 +116,7 @@ public class WitherController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -149,7 +149,7 @@ public class WolfController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -135,7 +135,7 @@ public class ZombieController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -16,6 +16,7 @@ import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.function.Consumer;
import java.util.function.Supplier;
import org.bukkit.Bukkit;
import org.bukkit.Location;
@ -1801,8 +1802,8 @@ public class NMSImpl implements NMSBridge {
}
}
public static boolean isLeashed(NPC npc, EntityInsentient entity) {
return NMS.isLeashed(npc, entity::isLeashed, () -> entity.unleash(true, false));
public static boolean isLeashed(NPC npc, Supplier<Boolean> isLeashed, EntityInsentient entity) {
return NMS.isLeashed(npc, isLeashed, () -> entity.unleash(true, false));
}
public static boolean isNavigationFinished(NavigationAbstract navigation) {

View File

@ -129,16 +129,7 @@ public class BatController extends MobEntityController {
@Override
public boolean isLeashed() {
if (npc == null) {
return super.isLeashed();
}
boolean protectedDefault = npc.isProtected();
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
return super.isLeashed();
if (super.isLeashed()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -126,7 +126,7 @@ public class BlazeController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -151,17 +151,7 @@ public class CaveSpiderController extends MobEntityController {
@Override
public boolean isLeashed() {
if (npc == null) {
return super.isLeashed();
}
boolean protectedDefault = npc.isProtected();
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault)) {
return super.isLeashed();
}
if (super.isLeashed()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -162,7 +162,7 @@ public class ChickenController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -177,7 +177,7 @@ public class CowController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -153,7 +153,7 @@ public class CreeperController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -125,7 +125,7 @@ public class EnderDragonController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -150,7 +150,7 @@ public class EndermanController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -150,7 +150,7 @@ public class EndermiteController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -137,7 +137,7 @@ public class EvokerController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -117,7 +117,7 @@ public class GhastController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -136,7 +136,7 @@ public class GiantController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -137,7 +137,7 @@ public class GuardianController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -137,7 +137,7 @@ public class GuardianElderController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -159,7 +159,7 @@ public class HorseController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -159,7 +159,7 @@ public class HorseDonkeyController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -159,7 +159,7 @@ public class HorseMuleController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -160,7 +160,7 @@ public class HorseSkeletonController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -160,7 +160,7 @@ public class HorseZombieController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -136,7 +136,7 @@ public class IronGolemController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -159,7 +159,7 @@ public class LlamaController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -157,7 +157,7 @@ public class MagmaCubeController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -157,7 +157,7 @@ public class MushroomCowController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -154,7 +154,7 @@ public class OcelotController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -155,7 +155,7 @@ public class PigController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -137,7 +137,7 @@ public class PigZombieController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -123,16 +123,7 @@ public class PolarBearController extends MobEntityController {
@Override
public boolean isLeashed() {
if (npc == null) {
return super.isLeashed();
}
boolean protectedDefault = npc.isProtected();
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
return super.isLeashed();
if (super.isLeashed()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -154,7 +154,7 @@ public class RabbitController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -147,7 +147,7 @@ public class SheepController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -146,7 +146,7 @@ public class ShulkerController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -135,7 +135,7 @@ public class SilverfishController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -135,7 +135,7 @@ public class SkeletonController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -135,7 +135,7 @@ public class SkeletonStrayController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -135,7 +135,7 @@ public class SkeletonWitherController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -157,7 +157,7 @@ public class SlimeController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -135,7 +135,7 @@ public class SnowmanController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -135,7 +135,7 @@ public class SpiderController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -135,7 +135,7 @@ public class SquidController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -114,16 +114,7 @@ public class VexController extends MobEntityController {
@Override
public boolean isLeashed() {
if (npc == null) {
return super.isLeashed();
}
boolean protectedDefault = npc.isProtected();
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
return super.isLeashed();
if (super.isLeashed()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -176,7 +176,7 @@ public class VillagerController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -147,7 +147,7 @@ public class VindicatorController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -135,7 +135,7 @@ public class WitchController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -116,7 +116,7 @@ public class WitherController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -149,7 +149,7 @@ public class WolfController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -135,7 +135,7 @@ public class ZombieController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -135,7 +135,7 @@ public class ZombieHuskController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -135,7 +135,7 @@ public class ZombieVillagerController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -16,6 +16,7 @@ import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.function.Consumer;
import java.util.function.Supplier;
import org.bukkit.Bukkit;
import org.bukkit.Location;
@ -1867,8 +1868,8 @@ public class NMSImpl implements NMSBridge {
}
}
public static boolean isLeashed(NPC npc, EntityInsentient entity) {
return NMS.isLeashed(npc, entity::isLeashed, () -> entity.unleash(true, false));
public static boolean isLeashed(NPC npc, Supplier<Boolean> isLeashed, EntityInsentient entity) {
return NMS.isLeashed(npc, isLeashed, () -> entity.unleash(true, false));
}
public static boolean isNavigationFinished(NavigationAbstract navigation) {

View File

@ -130,16 +130,7 @@ public class BatController extends MobEntityController {
@Override
public boolean isLeashed() {
if (npc == null) {
return super.isLeashed();
}
boolean protectedDefault = npc.isProtected();
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
return super.isLeashed();
if (super.isLeashed()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -127,7 +127,7 @@ public class BlazeController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -152,17 +152,7 @@ public class CaveSpiderController extends MobEntityController {
@Override
public boolean isLeashed() {
if (npc == null) {
return super.isLeashed();
}
boolean protectedDefault = npc.isProtected();
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault)) {
return super.isLeashed();
}
if (super.isLeashed()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -163,7 +163,7 @@ public class ChickenController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -178,7 +178,7 @@ public class CowController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -154,7 +154,7 @@ public class CreeperController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -126,7 +126,7 @@ public class EnderDragonController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -151,7 +151,7 @@ public class EndermanController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -151,7 +151,7 @@ public class EndermiteController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -138,7 +138,7 @@ public class EvokerController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -118,7 +118,7 @@ public class GhastController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -137,7 +137,7 @@ public class GiantController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -138,7 +138,7 @@ public class GuardianController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -138,7 +138,7 @@ public class GuardianElderController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -175,7 +175,7 @@ public class HorseController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -175,7 +175,7 @@ public class HorseDonkeyController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

View File

@ -175,7 +175,7 @@ public class HorseMuleController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMSImpl.isLeashed(npc, this);
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override

Some files were not shown because too many files have changed in this diff Show More