mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-07-01 00:44:50 +02:00
Code size reduction
This commit is contained in:
parent
3ae6c29493
commit
ad218261ff
|
@ -128,7 +128,7 @@ public class BatController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -125,15 +125,7 @@ public class BlazeController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
return NMSImpl.isLeashed(npc, this);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -161,15 +161,7 @@ public class ChickenController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
return NMSImpl.isLeashed(npc, this);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -176,15 +176,7 @@ public class CowController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
return NMSImpl.isLeashed(npc, this);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -160,15 +160,7 @@ public class CreeperController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
return NMSImpl.isLeashed(npc, this);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -124,15 +124,7 @@ public class EnderDragonController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
return NMSImpl.isLeashed(npc, this);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -149,15 +149,7 @@ public class EndermanController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
return NMSImpl.isLeashed(npc, this);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -149,15 +149,7 @@ public class EndermiteController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
return NMSImpl.isLeashed(npc, this);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -116,15 +116,7 @@ public class GhastController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
return NMSImpl.isLeashed(npc, this);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -135,15 +135,7 @@ public class GiantController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
return NMSImpl.isLeashed(npc, this);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -136,15 +136,7 @@ public class GuardianController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
return NMSImpl.isLeashed(npc, this);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -166,15 +166,7 @@ public class HorseController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
return NMSImpl.isLeashed(npc, this);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -135,15 +135,7 @@ public class IronGolemController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
return NMSImpl.isLeashed(npc, this);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -148,15 +148,7 @@ public class MagmaCubeController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
return NMSImpl.isLeashed(npc, this);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -157,15 +157,7 @@ public class MushroomCowController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
return NMSImpl.isLeashed(npc, this);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -153,15 +153,7 @@ public class OcelotController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
return NMSImpl.isLeashed(npc, this);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -156,15 +156,7 @@ public class PigController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
return NMSImpl.isLeashed(npc, this);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -136,15 +136,7 @@ public class PigZombieController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
return NMSImpl.isLeashed(npc, this);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -122,7 +122,7 @@ public class PolarBearController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -153,15 +153,7 @@ public class RabbitController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
return NMSImpl.isLeashed(npc, this);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -146,15 +146,7 @@ public class SheepController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
return NMSImpl.isLeashed(npc, this);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -136,15 +136,7 @@ public class ShulkerController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
return NMSImpl.isLeashed(npc, this);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -135,15 +135,7 @@ public class SilverfishController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
return NMSImpl.isLeashed(npc, this);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -135,15 +135,7 @@ public class SkeletonController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
return NMSImpl.isLeashed(npc, this);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -149,15 +149,7 @@ public class SlimeController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
return NMSImpl.isLeashed(npc, this);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -135,15 +135,7 @@ public class SnowmanController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
return NMSImpl.isLeashed(npc, this);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -135,15 +135,7 @@ public class SpiderController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
return NMSImpl.isLeashed(npc, this);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -135,15 +135,7 @@ public class SquidController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
return NMSImpl.isLeashed(npc, this);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -39,7 +39,6 @@ public class VillagerController extends MobEntityController {
|
||||||
|
|
||||||
public static class EntityVillagerNPC extends EntityVillager implements NPCHolder {
|
public static class EntityVillagerNPC extends EntityVillager implements NPCHolder {
|
||||||
private boolean blockingATrade;
|
private boolean blockingATrade;
|
||||||
|
|
||||||
private final CitizensNPC npc;
|
private final CitizensNPC npc;
|
||||||
|
|
||||||
public EntityVillagerNPC(World world) {
|
public EntityVillagerNPC(World world) {
|
||||||
|
@ -170,15 +169,7 @@ public class VillagerController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
return NMSImpl.isLeashed(npc, this);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -135,15 +135,7 @@ public class WitchController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
return NMSImpl.isLeashed(npc, this);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -116,15 +116,7 @@ public class WitherController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
return NMSImpl.isLeashed(npc, this);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -149,15 +149,7 @@ public class WolfController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
return NMSImpl.isLeashed(npc, this);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -135,15 +135,7 @@ public class ZombieController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
if (npc == null)
|
return NMSImpl.isLeashed(npc, this);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -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) {
|
public static boolean isNavigationFinished(NavigationAbstract navigation) {
|
||||||
return navigation.n();
|
return navigation.n();
|
||||||
}
|
}
|
||||||
|
@ -1915,6 +1919,7 @@ public class NMSImpl implements NMSBridge {
|
||||||
private static Field SKULL_PROFILE_FIELD;
|
private static Field SKULL_PROFILE_FIELD;
|
||||||
private static MethodHandle TEAM_FIELD;
|
private static MethodHandle TEAM_FIELD;
|
||||||
private static Field TRACKED_ENTITY_SET = NMS.getField(EntityTracker.class, "c");
|
private static Field TRACKED_ENTITY_SET = NMS.getField(EntityTracker.class, "c");
|
||||||
|
|
||||||
private static final Field WITHER_BOSS_BAR_FIELD = NMS.getField(EntityWither.class, "bG");
|
private static final Field WITHER_BOSS_BAR_FIELD = NMS.getField(EntityWither.class, "bG");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
|
|
@ -126,7 +126,7 @@ public class BlazeController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -162,7 +162,7 @@ public class ChickenController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -177,7 +177,7 @@ public class CowController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -153,7 +153,7 @@ public class CreeperController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -125,7 +125,7 @@ public class EnderDragonController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -150,7 +150,7 @@ public class EndermanController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -150,7 +150,7 @@ public class EndermiteController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -137,7 +137,7 @@ public class EvokerController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -117,7 +117,7 @@ public class GhastController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -136,7 +136,7 @@ public class GiantController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -137,7 +137,7 @@ public class GuardianController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -137,7 +137,7 @@ public class GuardianElderController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -159,7 +159,7 @@ public class HorseController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -159,7 +159,7 @@ public class HorseDonkeyController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -159,7 +159,7 @@ public class HorseMuleController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -160,7 +160,7 @@ public class HorseSkeletonController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -160,7 +160,7 @@ public class HorseZombieController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -136,7 +136,7 @@ public class IronGolemController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -159,7 +159,7 @@ public class LlamaController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -157,7 +157,7 @@ public class MagmaCubeController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -157,7 +157,7 @@ public class MushroomCowController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -154,7 +154,7 @@ public class OcelotController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -155,7 +155,7 @@ public class PigController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -137,7 +137,7 @@ public class PigZombieController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -154,7 +154,7 @@ public class RabbitController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -147,7 +147,7 @@ public class SheepController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -146,7 +146,7 @@ public class ShulkerController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -135,7 +135,7 @@ public class SilverfishController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -135,7 +135,7 @@ public class SkeletonController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -135,7 +135,7 @@ public class SkeletonStrayController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -135,7 +135,7 @@ public class SkeletonWitherController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -157,7 +157,7 @@ public class SlimeController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -135,7 +135,7 @@ public class SnowmanController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -135,7 +135,7 @@ public class SpiderController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -135,7 +135,7 @@ public class SquidController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -176,7 +176,7 @@ public class VillagerController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -147,7 +147,7 @@ public class VindicatorController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -135,7 +135,7 @@ public class WitchController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -116,7 +116,7 @@ public class WitherController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -149,7 +149,7 @@ public class WolfController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -135,7 +135,7 @@ public class ZombieController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -135,7 +135,7 @@ public class ZombieHuskController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -135,7 +135,7 @@ public class ZombieVillagerController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -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) {
|
public static boolean isNavigationFinished(NavigationAbstract navigation) {
|
||||||
return navigation.n();
|
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 REPAIR_INVENTORY = NMS.getGetter(ContainerAnvil.class, "h");
|
||||||
private static final MethodHandle RESULT_INVENTORY = NMS.getGetter(ContainerAnvil.class, "g");
|
private static final MethodHandle RESULT_INVENTORY = NMS.getGetter(ContainerAnvil.class, "g");
|
||||||
private static Field SKULL_PROFILE_FIELD;
|
private static Field SKULL_PROFILE_FIELD;
|
||||||
|
|
||||||
private static MethodHandle TEAM_FIELD;
|
private static MethodHandle TEAM_FIELD;
|
||||||
|
|
||||||
private static Field TRACKED_ENTITY_SET = NMS.getField(EntityTracker.class, "c");
|
private static Field TRACKED_ENTITY_SET = NMS.getField(EntityTracker.class, "c");
|
||||||
|
|
||||||
private static final Field WITHER_BOSS_BAR_FIELD = NMS.getField(EntityWither.class, "bF");
|
private static final Field WITHER_BOSS_BAR_FIELD = NMS.getField(EntityWither.class, "bF");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
|
|
@ -127,7 +127,7 @@ public class BlazeController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -163,7 +163,7 @@ public class ChickenController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -178,7 +178,7 @@ public class CowController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -154,7 +154,7 @@ public class CreeperController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -126,7 +126,7 @@ public class EnderDragonController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -151,7 +151,7 @@ public class EndermanController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -151,7 +151,7 @@ public class EndermiteController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -138,7 +138,7 @@ public class EvokerController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -118,7 +118,7 @@ public class GhastController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -137,7 +137,7 @@ public class GiantController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -138,7 +138,7 @@ public class GuardianController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -138,7 +138,7 @@ public class GuardianElderController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -175,7 +175,7 @@ public class HorseController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -175,7 +175,7 @@ public class HorseDonkeyController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -175,7 +175,7 @@ public class HorseMuleController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -176,7 +176,7 @@ public class HorseSkeletonController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -176,7 +176,7 @@ public class HorseZombieController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -137,7 +137,7 @@ public class IllusionerController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -137,7 +137,7 @@ public class IronGolemController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -160,7 +160,7 @@ public class LlamaController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -158,7 +158,7 @@ public class MagmaCubeController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -158,7 +158,7 @@ public class MushroomCowController extends MobEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLeashed() {
|
public boolean isLeashed() {
|
||||||
return NMS.isLeashed(npc, super::isLeashed, () -> unleash(true, false));
|
return NMSImpl.isLeashed(npc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user