Code size reduction

This commit is contained in:
fullwall 2023-02-13 21:25:26 +08:00
parent 3ae6c29493
commit ad218261ff
607 changed files with 641 additions and 867 deletions

View File

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

View File

@ -125,15 +125,7 @@ public class BlazeController 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, this);
}
@Override

View File

@ -161,15 +161,7 @@ public class ChickenController 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, this);
}
@Override

View File

@ -176,15 +176,7 @@ public class CowController 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, this);
}
@Override

View File

@ -160,15 +160,7 @@ public class CreeperController 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, this);
}
@Override

View File

@ -124,15 +124,7 @@ public class EnderDragonController 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, this);
}
@Override

View File

@ -149,15 +149,7 @@ public class EndermanController 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, this);
}
@Override

View File

@ -149,15 +149,7 @@ public class EndermiteController 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, this);
}
@Override

View File

@ -116,15 +116,7 @@ public class GhastController 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, this);
}
@Override

View File

@ -135,15 +135,7 @@ public class GiantController 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, this);
}
@Override

View File

@ -136,15 +136,7 @@ public class GuardianController 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, this);
}
@Override

View File

@ -166,15 +166,7 @@ public class HorseController 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, this);
}
@Override

View File

@ -135,15 +135,7 @@ public class IronGolemController 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, this);
}
@Override

View File

@ -148,15 +148,7 @@ public class MagmaCubeController 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, this);
}
@Override

View File

@ -157,15 +157,7 @@ public class MushroomCowController 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, this);
}
@Override

View File

@ -153,15 +153,7 @@ public class OcelotController 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, this);
}
@Override

View File

@ -156,15 +156,7 @@ public class PigController 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, this);
}
@Override

View File

@ -136,15 +136,7 @@ public class PigZombieController 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, this);
}
@Override

View File

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

View File

@ -153,15 +153,7 @@ public class RabbitController 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, this);
}
@Override

View File

@ -146,15 +146,7 @@ public class SheepController 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, this);
}
@Override

View File

@ -136,15 +136,7 @@ public class ShulkerController 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, this);
}
@Override

View File

@ -135,15 +135,7 @@ public class SilverfishController 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, this);
}
@Override

View File

@ -135,15 +135,7 @@ public class SkeletonController 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, this);
}
@Override

View File

@ -149,15 +149,7 @@ public class SlimeController 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, this);
}
@Override

View File

@ -135,15 +135,7 @@ public class SnowmanController 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, this);
}
@Override

View File

@ -135,15 +135,7 @@ public class SpiderController 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, this);
}
@Override

View File

@ -135,15 +135,7 @@ public class SquidController 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, this);
}
@Override

View File

@ -39,7 +39,6 @@ public class VillagerController extends MobEntityController {
public static class EntityVillagerNPC extends EntityVillager implements NPCHolder {
private boolean blockingATrade;
private final CitizensNPC npc;
public EntityVillagerNPC(World world) {
@ -170,15 +169,7 @@ public class VillagerController 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, this);
}
@Override

View File

@ -135,15 +135,7 @@ public class WitchController 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, this);
}
@Override

View File

@ -116,15 +116,7 @@ public class WitherController 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, this);
}
@Override

View File

@ -149,15 +149,7 @@ public class WolfController 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, this);
}
@Override

View File

@ -135,15 +135,7 @@ public class ZombieController 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, this);
}
@Override

View File

@ -1801,6 +1801,10 @@ 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 isNavigationFinished(NavigationAbstract navigation) {
return navigation.n();
}
@ -1915,6 +1919,7 @@ public class NMSImpl implements NMSBridge {
private static Field SKULL_PROFILE_FIELD;
private static MethodHandle TEAM_FIELD;
private static Field TRACKED_ENTITY_SET = NMS.getField(EntityTracker.class, "c");
private static final Field WITHER_BOSS_BAR_FIELD = NMS.getField(EntityWither.class, "bG");
static {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1867,6 +1867,10 @@ 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 isNavigationFinished(NavigationAbstract navigation) {
return navigation.n();
}
@ -1978,11 +1982,8 @@ public class NMSImpl implements NMSBridge {
private static final MethodHandle REPAIR_INVENTORY = NMS.getGetter(ContainerAnvil.class, "h");
private static final MethodHandle RESULT_INVENTORY = NMS.getGetter(ContainerAnvil.class, "g");
private static Field SKULL_PROFILE_FIELD;
private static MethodHandle TEAM_FIELD;
private static Field TRACKED_ENTITY_SET = NMS.getField(EntityTracker.class, "c");
private static final Field WITHER_BOSS_BAR_FIELD = NMS.getField(EntityWither.class, "bF");
static {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -176,7 +176,7 @@ public class HorseSkeletonController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
return NMSImpl.isLeashed(npc, this);
}
@Override

View File

@ -176,7 +176,7 @@ public class HorseZombieController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
return NMSImpl.isLeashed(npc, this);
}
@Override

View File

@ -137,7 +137,7 @@ public class IllusionerController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
return NMSImpl.isLeashed(npc, this);
}
@Override

View File

@ -137,7 +137,7 @@ public class IronGolemController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
return NMSImpl.isLeashed(npc, this);
}
@Override

View File

@ -160,7 +160,7 @@ public class LlamaController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
return NMSImpl.isLeashed(npc, this);
}
@Override

View File

@ -158,7 +158,7 @@ public class MagmaCubeController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
return NMSImpl.isLeashed(npc, this);
}
@Override

View File

@ -158,7 +158,7 @@ public class MushroomCowController extends MobEntityController {
@Override
public boolean isLeashed() {
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
return NMSImpl.isLeashed(npc, this);
}
@Override

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