Trial teleporting players directly without calling PlayerTeleportEvent

This commit is contained in:
fullwall 2023-02-21 22:56:50 +08:00
parent 679873c7d4
commit d35dcb8ae7
350 changed files with 2156 additions and 2071 deletions

View File

@ -30,6 +30,7 @@ import net.citizensnpcs.api.astar.pathfinder.SwimmingExaminer;
import net.citizensnpcs.api.event.DespawnReason;
import net.citizensnpcs.api.event.NPCDespawnEvent;
import net.citizensnpcs.api.event.NPCSpawnEvent;
import net.citizensnpcs.api.event.NPCTeleportEvent;
import net.citizensnpcs.api.event.SpawnReason;
import net.citizensnpcs.api.npc.AbstractNPC;
import net.citizensnpcs.api.npc.BlockBreaker;
@ -437,8 +438,19 @@ public class CitizensNPC extends AbstractNPC {
getOrAddTrait(SitTrait.class).setSitting(location);
}
Location npcLoc = getEntity().getLocation(CACHE_LOCATION);
if (isSpawned() && npcLoc.getWorld() == location.getWorld() && npcLoc.distance(location) < 1) {
NMS.setHeadYaw(getEntity(), location.getYaw());
if (isSpawned() && npcLoc.getWorld() == location.getWorld()) {
if (npcLoc.distance(location) < 1) {
NMS.setHeadYaw(getEntity(), location.getYaw());
}
if (getEntity().getType() == EntityType.PLAYER && !getEntity().isInsideVehicle()
&& NMS.getPassengers(getEntity()).size() == 0) {
NPCTeleportEvent event = new NPCTeleportEvent(this, location);
Bukkit.getPluginManager().callEvent(event);
if (event.isCancelled())
return;
NMS.setLocationDirectly(getEntity(), location);
return;
}
}
super.teleport(location, reason);
}

View File

@ -636,6 +636,10 @@ public class NMS {
BRIDGE.setKnockbackResistance(entity, d);
}
public static void setLocationDirectly(Entity entity, Location location) {
BRIDGE.setLocationDirectly(entity, location);
}
public static void setLyingDown(Entity cat, boolean lying) {
BRIDGE.setLyingDown(cat, lying);
}

View File

@ -192,6 +192,8 @@ public interface NMSBridge {
public void setKnockbackResistance(LivingEntity entity, double d);
public void setLocationDirectly(Entity entity, Location location);
public default void setLyingDown(Entity cat, boolean lying) {
throw new UnsupportedOperationException();
}

View File

@ -1191,6 +1191,12 @@ public class NMSImpl implements NMSBridge {
handle.getAttributeInstance(GenericAttributes.c).setValue(d);
}
@Override
public void setLocationDirectly(org.bukkit.entity.Entity entity, Location location) {
getHandle(entity).setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(),
location.getPitch());
}
@Override
public void setNavigationTarget(org.bukkit.entity.Entity handle, org.bukkit.entity.Entity target, float speed) {
NMSImpl.getNavigation(handle).a(NMSImpl.getHandle(target), speed);

View File

@ -1251,6 +1251,12 @@ public class NMSImpl implements NMSBridge {
handle.getAttributeInstance(GenericAttributes.c).setValue(d);
}
@Override
public void setLocationDirectly(org.bukkit.entity.Entity entity, Location location) {
getHandle(entity).setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(),
location.getPitch());
}
@Override
public void setNavigationTarget(org.bukkit.entity.Entity handle, org.bukkit.entity.Entity target, float speed) {
NMSImpl.getNavigation(handle).a(NMSImpl.getHandle(target), speed);

View File

@ -1258,6 +1258,12 @@ public class NMSImpl implements NMSBridge {
handle.getAttributeInstance(GenericAttributes.c).setValue(d);
}
@Override
public void setLocationDirectly(org.bukkit.entity.Entity entity, Location location) {
getHandle(entity).setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(),
location.getPitch());
}
@Override
public void setNavigationTarget(org.bukkit.entity.Entity handle, org.bukkit.entity.Entity target, float speed) {
NMSImpl.getNavigation(handle).a(NMSImpl.getHandle(target), speed);

View File

@ -1298,6 +1298,12 @@ public class NMSImpl implements NMSBridge {
handle.getAttributeInstance(GenericAttributes.c).setValue(d);
}
@Override
public void setLocationDirectly(org.bukkit.entity.Entity entity, Location location) {
getHandle(entity).setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(),
location.getPitch());
}
@Override
public void setNavigationTarget(org.bukkit.entity.Entity handle, org.bukkit.entity.Entity target, float speed) {
NMSImpl.getNavigation(handle).a(NMSImpl.getHandle(target), speed);

View File

@ -1335,6 +1335,12 @@ public class NMSImpl implements NMSBridge {
handle.getAttributeInstance(GenericAttributes.KNOCKBACK_RESISTANCE).setValue(d);
}
@Override
public void setLocationDirectly(org.bukkit.entity.Entity entity, Location location) {
getHandle(entity).setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(),
location.getPitch());
}
@Override
public void setLyingDown(org.bukkit.entity.Entity cat, boolean lying) {
((EntityCat) getHandle(cat)).u(lying);

View File

@ -1353,6 +1353,12 @@ public class NMSImpl implements NMSBridge {
handle.getAttributeInstance(GenericAttributes.KNOCKBACK_RESISTANCE).setValue(d);
}
@Override
public void setLocationDirectly(org.bukkit.entity.Entity entity, Location location) {
getHandle(entity).setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(),
location.getPitch());
}
@Override
public void setLyingDown(org.bukkit.entity.Entity cat, boolean lying) {
((EntityCat) getHandle(cat)).u(lying);

View File

@ -1376,6 +1376,12 @@ public class NMSImpl implements NMSBridge {
handle.getAttributeInstance(GenericAttributes.KNOCKBACK_RESISTANCE).setValue(d);
}
@Override
public void setLocationDirectly(org.bukkit.entity.Entity entity, Location location) {
getHandle(entity).setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(),
location.getPitch());
}
@Override
public void setLyingDown(org.bukkit.entity.Entity cat, boolean lying) {
((EntityCat) getHandle(cat)).x(lying);

View File

@ -58,12 +58,6 @@ public class AxolotlController extends MobEntityController {
}
public static class EntityAxolotlNPC extends Axolotl implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
private MoveControl oldMoveController;
@ -151,6 +145,12 @@ public class AxolotlController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -44,12 +44,6 @@ public class BatController extends MobEntityController {
}
public static class EntityBatNPC extends Bat implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityBatNPC(EntityType<? extends Bat> types, Level level) {
@ -130,6 +124,12 @@ public class BatController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -44,12 +44,6 @@ public class BeeController extends MobEntityController {
}
public static class EntityBeeNPC extends Bee implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityBeeNPC(EntityType<? extends Bee> types, Level level) {
@ -127,6 +121,12 @@ public class BeeController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -44,12 +44,6 @@ public class BlazeController extends MobEntityController {
}
public static class EntityBlazeNPC extends Blaze implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityBlazeNPC(EntityType<? extends Blaze> types, Level level) {
@ -122,6 +116,12 @@ public class BlazeController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -48,12 +48,6 @@ public class CatController extends MobEntityController {
}
public static class EntityCatNPC extends Cat implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
boolean calledNMSHeight = false;
private final CitizensNPC npc;
@ -144,6 +138,12 @@ public class CatController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -47,12 +47,6 @@ public class CaveSpiderController extends MobEntityController {
}
public static class EntityCaveSpiderNPC extends CaveSpider implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityCaveSpiderNPC(EntityType<? extends CaveSpider> types, Level level) {
@ -141,6 +135,12 @@ public class CaveSpiderController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -48,12 +48,6 @@ public class ChickenController extends MobEntityController {
}
public static class EntityChickenNPC extends Chicken implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
boolean calledNMSHeight = false;
private final CitizensNPC npc;
@ -152,6 +146,12 @@ public class ChickenController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -54,12 +54,6 @@ public class CodController extends MobEntityController {
}
public static class EntityCodNPC extends Cod implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
private MoveControl oldMoveController;
@ -177,6 +171,12 @@ public class CodController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -53,12 +53,6 @@ public class CowController extends MobEntityController {
}
public static class EntityCowNPC extends Cow implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
boolean calledNMSHeight = false;
private final CitizensNPC npc;
@ -149,6 +143,12 @@ public class CowController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -49,12 +49,6 @@ public class CreeperController extends MobEntityController {
}
public static class EntityCreeperNPC extends Creeper implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private boolean allowPowered;
private final CitizensNPC npc;
@ -145,6 +139,12 @@ public class CreeperController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -50,17 +50,11 @@ public class DolphinController extends MobEntityController {
}
public static class EntityDolphinNPC extends Dolphin implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private boolean inProtectedTick;
private final CitizensNPC npc;
private MoveControl oldMoveController;
private MoveControl oldMoveController;
public EntityDolphinNPC(EntityType<? extends Dolphin> types, Level level) {
this(types, level, null);
}
@ -149,6 +143,12 @@ public class DolphinController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -47,12 +47,6 @@ public class DrownedController extends MobEntityController {
}
public static class EntityDrownedNPC extends Drowned implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityDrownedNPC(EntityType<? extends Drowned> types, Level level) {
@ -141,6 +135,12 @@ public class DrownedController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -45,12 +45,6 @@ public class EnderDragonController extends MobEntityController {
}
public static class EntityEnderDragonNPC extends EnderDragon implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityEnderDragonNPC(EntityType<? extends EnderDragon> types, Level level) {
@ -139,6 +133,12 @@ public class EnderDragonController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -50,12 +50,6 @@ public class EndermanController extends MobEntityController {
}
public static class EntityEndermanNPC extends EnderMan implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityEndermanNPC(EntityType<? extends EnderMan> types, Level level) {
@ -148,6 +142,12 @@ public class EndermanController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -47,12 +47,6 @@ public class EndermiteController extends MobEntityController {
}
public static class EntityEndermiteNPC extends Endermite implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityEndermiteNPC(EntityType<? extends Endermite> types, Level level) {
@ -141,6 +135,12 @@ public class EndermiteController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -41,12 +41,6 @@ public class EvokerController extends MobEntityController {
}
public static class EntityEvokerNPC extends Evoker implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityEvokerNPC(EntityType<? extends Evoker> types, Level level) {
@ -135,6 +129,12 @@ public class EvokerController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -42,12 +42,6 @@ public class FoxController extends MobEntityController {
}
public static class EntityFoxNPC extends Fox implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
boolean calledNMSHeight = false;
private final CitizensNPC npc;
@ -138,6 +132,12 @@ public class FoxController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -38,12 +38,6 @@ public class GhastController extends MobEntityController {
}
public static class EntityGhastNPC extends Ghast implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityGhastNPC(EntityType<? extends Ghast> types, Level level) {
@ -122,6 +116,12 @@ public class GhastController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -41,12 +41,6 @@ public class GiantController extends MobEntityController {
}
public static class EntityGiantNPC extends Giant implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityGiantNPC(EntityType<? extends Giant> types, Level level) {
@ -135,6 +129,12 @@ public class GiantController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -41,12 +41,6 @@ public class GlowSquidController extends MobEntityController {
}
public static class EntityGlowSquidNPC extends GlowSquid implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityGlowSquidNPC(EntityType<? extends GlowSquid> types, Level level) {
@ -135,6 +129,12 @@ public class GlowSquidController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -42,12 +42,6 @@ public class GoatController extends MobEntityController {
}
public static class EntityGoatNPC extends Goat implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
boolean calledNMSHeight = false;
private final CitizensNPC npc;
@ -138,6 +132,12 @@ public class GoatController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -41,12 +41,6 @@ public class GuardianController extends MobEntityController {
}
public static class EntityGuardianNPC extends Guardian implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityGuardianNPC(EntityType<? extends Guardian> types, Level level) {
@ -141,6 +135,12 @@ public class GuardianController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -41,12 +41,6 @@ public class GuardianElderController extends MobEntityController {
}
public static class EntityGuardianElderNPC extends ElderGuardian implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityGuardianElderNPC(EntityType<? extends ElderGuardian> types, Level level) {
@ -141,6 +135,12 @@ public class GuardianElderController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -41,12 +41,6 @@ public class HoglinController extends MobEntityController {
}
public static class EntityHoglinNPC extends Hoglin implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityHoglinNPC(EntityType<? extends Hoglin> types, Level level) {
@ -138,6 +132,12 @@ public class HoglinController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -52,12 +52,6 @@ public class HorseController extends MobEntityController {
}
public static class EntityHorseNPC extends Horse implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private double baseMovementSpeed;
private boolean calledNMSHeight = false;
@ -186,6 +180,12 @@ public class HorseController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -52,17 +52,11 @@ public class HorseDonkeyController extends MobEntityController {
}
public static class EntityHorseDonkeyNPC extends Donkey implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private double baseMovementSpeed;
boolean calledNMSHeight = false;
private final CitizensNPC npc;
private boolean riding;
public EntityHorseDonkeyNPC(EntityType<? extends Donkey> types, Level level) {
this(types, level, null);
}
@ -182,6 +176,12 @@ public class HorseDonkeyController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -52,12 +52,6 @@ public class HorseMuleController extends MobEntityController {
}
public static class EntityHorseMuleNPC extends Mule implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private double baseMovementSpeed;
boolean calledNMSHeight = false;
@ -185,6 +179,12 @@ public class HorseMuleController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -52,12 +52,6 @@ public class HorseSkeletonController extends MobEntityController {
}
public static class EntityHorseSkeletonNPC extends SkeletonHorse implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private double baseMovementSpeed;
boolean calledNMSHeight = false;
@ -185,6 +179,12 @@ public class HorseSkeletonController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -52,12 +52,6 @@ public class HorseZombieController extends MobEntityController {
}
public static class EntityHorseZombieNPC extends ZombieHorse implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private double baseMovementSpeed;
boolean calledNMSHeight = false;
@ -185,6 +179,12 @@ public class HorseZombieController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -41,12 +41,6 @@ public class IllusionerController extends MobEntityController {
}
public static class EntityIllusionerNPC extends Illusioner implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityIllusionerNPC(EntityType<? extends Illusioner> types, Level level) {
@ -135,6 +129,12 @@ public class IllusionerController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -41,12 +41,6 @@ public class IronGolemController extends MobEntityController {
}
public static class EntityIronGolemNPC extends IronGolem implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityIronGolemNPC(EntityType<? extends IronGolem> types, Level level) {
@ -135,6 +129,12 @@ public class IronGolemController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -50,12 +50,6 @@ public class LlamaController extends MobEntityController {
}
public static class EntityLlamaNPC extends Llama implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
boolean calledNMSHeight = false;
private final CitizensNPC npc;
@ -155,6 +149,12 @@ public class LlamaController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -44,12 +44,6 @@ public class MagmaCubeController extends MobEntityController {
}
public static class EntityMagmaCubeNPC extends MagmaCube implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
private MoveControl oldMoveController;
@ -136,6 +130,12 @@ public class MagmaCubeController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -45,12 +45,6 @@ public class MushroomCowController extends MobEntityController {
}
public static class EntityMushroomCowNPC extends MushroomCow implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
boolean calledNMSHeight = false;
private final CitizensNPC npc;
@ -141,6 +135,12 @@ public class MushroomCowController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -43,12 +43,6 @@ public class OcelotController extends MobEntityController {
}
public static class EntityOcelotNPC extends Ocelot implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
boolean calledNMSHeight = false;
private final CitizensNPC npc;
@ -144,6 +138,12 @@ public class OcelotController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -42,12 +42,6 @@ public class PandaController extends MobEntityController {
}
public static class EntityPandaNPC extends Panda implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
boolean calledNMSHeight = false;
private final CitizensNPC npc;
@ -138,6 +132,12 @@ public class PandaController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -41,12 +41,6 @@ public class ParrotController extends MobEntityController {
}
public static class EntityParrotNPC extends Parrot implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityParrotNPC(EntityType<? extends Parrot> types, Level level) {
@ -126,6 +120,12 @@ public class ParrotController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -45,12 +45,6 @@ public class PhantomController extends MobEntityController {
}
public static class EntityPhantomNPC extends Phantom implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
boolean calledNMSHeight = false;
private final CitizensNPC npc;
@ -163,6 +157,12 @@ public class PhantomController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public boolean isSunBurnTick() {
if (npc == null || !npc.isProtected())

View File

@ -44,12 +44,6 @@ public class PigController extends MobEntityController {
}
public static class EntityPigNPC extends Pig implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
boolean calledNMSHeight = false;
private final CitizensNPC npc;
@ -146,6 +140,12 @@ public class PigController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -42,12 +42,6 @@ public class PigZombieController extends MobEntityController {
}
public static class EntityPigZombieNPC extends ZombifiedPiglin implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityPigZombieNPC(EntityType<? extends ZombifiedPiglin> types, Level level) {
@ -136,6 +130,12 @@ public class PigZombieController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -41,12 +41,6 @@ public class PiglinBruteController extends MobEntityController {
}
public static class EntityPiglinBruteNPC extends PiglinBrute implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityPiglinBruteNPC(EntityType<? extends PiglinBrute> types, Level level) {
@ -138,6 +132,12 @@ public class PiglinBruteController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -41,12 +41,6 @@ public class PiglinController extends MobEntityController {
}
public static class EntityPiglinNPC extends Piglin implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityPiglinNPC(EntityType<? extends Piglin> types, Level level) {
@ -138,6 +132,12 @@ public class PiglinController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -42,12 +42,6 @@ public class PillagerController extends MobEntityController {
}
public static class EntityPillagerNPC extends Pillager implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
boolean calledNMSHeight = false;
private final CitizensNPC npc;
@ -138,6 +132,12 @@ public class PillagerController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -39,12 +39,6 @@ public class PolarBearController extends MobEntityController {
}
public static class EntityPolarBearNPC extends PolarBear implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
boolean calledNMSHeight = false;
private final CitizensNPC npc;
@ -120,6 +114,12 @@ public class PolarBearController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -51,12 +51,6 @@ public class PufferFishController extends MobEntityController {
}
public static class EntityPufferFishNPC extends Pufferfish implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
private MoveControl oldMoveController;
@ -180,6 +174,12 @@ public class PufferFishController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -43,12 +43,6 @@ public class RabbitController extends MobEntityController {
}
public static class EntityRabbitNPC extends Rabbit implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
boolean calledNMSHeight = false;
private final CitizensNPC npc;
@ -147,6 +141,12 @@ public class RabbitController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -42,12 +42,6 @@ public class RavagerController extends MobEntityController {
}
public static class EntityRavagerNPC extends Ravager implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
boolean calledNMSHeight = false;
private final CitizensNPC npc;
@ -138,6 +132,12 @@ public class RavagerController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -48,12 +48,6 @@ public class SalmonController extends MobEntityController {
}
public static class EntitySalmonNPC extends Salmon implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
private MoveControl oldMoveController;
@ -169,6 +163,12 @@ public class SalmonController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -42,12 +42,6 @@ public class SheepController extends MobEntityController {
}
public static class EntitySheepNPC extends Sheep implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
boolean calledNMSHeight = false;
private final CitizensNPC npc;
@ -138,6 +132,12 @@ public class SheepController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -42,12 +42,6 @@ public class ShulkerController extends MobEntityController {
}
public static class EntityShulkerNPC extends Shulker implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityShulkerNPC(EntityType<? extends Shulker> types, Level level) {
@ -139,6 +133,12 @@ public class ShulkerController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -42,12 +42,6 @@ public class SilverfishController extends MobEntityController {
}
public static class EntitySilverfishNPC extends Silverfish implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntitySilverfishNPC(EntityType<? extends Silverfish> types, Level level) {
@ -142,6 +136,12 @@ public class SilverfishController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -41,12 +41,6 @@ public class SkeletonController extends MobEntityController {
}
public static class EntitySkeletonNPC extends Skeleton implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntitySkeletonNPC(EntityType<? extends Skeleton> types, Level level) {
@ -135,6 +129,12 @@ public class SkeletonController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -41,12 +41,6 @@ public class SkeletonStrayController extends MobEntityController {
}
public static class EntityStrayNPC extends Stray implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityStrayNPC(EntityType<? extends Stray> types, Level level) {
@ -135,6 +129,12 @@ public class SkeletonStrayController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -41,12 +41,6 @@ public class SkeletonWitherController extends MobEntityController {
}
public static class EntitySkeletonWitherNPC extends WitherSkeleton implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntitySkeletonWitherNPC(EntityType<? extends WitherSkeleton> types, Level level) {
@ -135,6 +129,12 @@ public class SkeletonWitherController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -44,12 +44,6 @@ public class SlimeController extends MobEntityController {
}
public static class EntitySlimeNPC extends Slime implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
private MoveControl oldMoveController;
@ -136,6 +130,12 @@ public class SlimeController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -41,12 +41,6 @@ public class SnowmanController extends MobEntityController {
}
public static class EntitySnowmanNPC extends SnowGolem implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntitySnowmanNPC(EntityType<? extends SnowGolem> types, Level level) {
@ -135,6 +129,12 @@ public class SnowmanController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -41,12 +41,6 @@ public class SpiderController extends MobEntityController {
}
public static class EntitySpiderNPC extends Spider implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntitySpiderNPC(EntityType<? extends Spider> types, Level level) {
@ -135,6 +129,12 @@ public class SpiderController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -41,12 +41,6 @@ public class SquidController extends MobEntityController {
}
public static class EntitySquidNPC extends Squid implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntitySquidNPC(EntityType<? extends Squid> types, Level level) {
@ -135,6 +129,12 @@ public class SquidController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -41,12 +41,6 @@ public class StriderController extends MobEntityController {
}
public static class EntityStriderNPC extends Strider implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityStriderNPC(EntityType<? extends Strider> types, Level level) {
@ -135,6 +129,12 @@ public class StriderController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -50,12 +50,6 @@ public class TraderLlamaController extends MobEntityController {
}
public static class EntityTraderLlamaNPC extends TraderLlama implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
boolean calledNMSHeight = false;
private final CitizensNPC npc;
@ -156,6 +150,12 @@ public class TraderLlamaController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -48,12 +48,6 @@ public class TropicalFishController extends MobEntityController {
}
public static class EntityTropicalFishNPC extends TropicalFish implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
private MoveControl oldMoveController;
@ -171,6 +165,12 @@ public class TropicalFishController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -45,12 +45,6 @@ public class TurtleController extends MobEntityController {
}
public static class EntityTurtleNPC extends Turtle implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
private JumpControl oldJumpController;
@ -157,6 +151,12 @@ public class TurtleController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -38,12 +38,6 @@ public class VexController extends MobEntityController {
}
public static class EntityVexNPC extends Vex implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityVexNPC(EntityType<? extends Vex> types, Level level) {
@ -120,6 +114,12 @@ public class VexController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -49,12 +49,6 @@ public class VillagerController extends MobEntityController {
}
public static class EntityVillagerNPC extends Villager implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private boolean blockingATrade;
boolean calledNMSHeight = false;
@ -152,6 +146,12 @@ public class VillagerController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public boolean isTrading() {
if (blockingATrade) {

View File

@ -42,12 +42,6 @@ public class VindicatorController extends MobEntityController {
}
public static class EntityVindicatorNPC extends Vindicator implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
boolean calledNMSHeight = false;
private final CitizensNPC npc;
@ -138,6 +132,12 @@ public class VindicatorController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -48,12 +48,6 @@ public class WanderingTraderController extends MobEntityController {
}
public static class EntityWanderingTraderNPC extends WanderingTrader implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private boolean blockingATrade;
private boolean blockTrades = true;
@ -155,6 +149,12 @@ public class WanderingTraderController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public boolean isTrading() {
if (blockingATrade) {

View File

@ -41,12 +41,6 @@ public class WitchController extends MobEntityController {
}
public static class EntityWitchNPC extends Witch implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityWitchNPC(EntityType<? extends Witch> types, Level level) {
@ -135,6 +129,12 @@ public class WitchController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -38,12 +38,6 @@ public class WitherController extends MobEntityController {
}
public static class EntityWitherNPC extends WitherBoss implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityWitherNPC(EntityType<? extends WitherBoss> types, Level level) {
@ -132,6 +126,12 @@ public class WitherController extends MobEntityController {
: npc.data().get("wither-arrow-shield");
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -44,12 +44,6 @@ public class WolfController extends MobEntityController {
}
public static class EntityWolfNPC extends Wolf implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
boolean calledNMSHeight = false;
private final CitizensNPC npc;
@ -140,6 +134,12 @@ public class WolfController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -41,12 +41,6 @@ public class ZoglinController extends MobEntityController {
}
public static class EntityZoglinNPC extends Zoglin implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityZoglinNPC(EntityType<? extends Zoglin> types, Level level) {
@ -137,6 +131,12 @@ public class ZoglinController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -41,12 +41,6 @@ public class ZombieController extends MobEntityController {
}
public static class EntityZombieNPC extends Zombie implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityZombieNPC(EntityType<? extends Zombie> types, Level level) {
@ -135,6 +129,12 @@ public class ZombieController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -41,12 +41,6 @@ public class ZombieHuskController extends MobEntityController {
}
public static class EntityZombieHuskNPC extends Husk implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityZombieHuskNPC(EntityType<? extends Husk> types, Level level) {
@ -135,6 +129,12 @@ public class ZombieHuskController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -41,12 +41,6 @@ public class ZombieVillagerController extends MobEntityController {
}
public static class EntityZombieVillagerNPC extends ZombieVillager implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityZombieVillagerNPC(EntityType<? extends ZombieVillager> types, Level level) {
@ -135,6 +129,12 @@ public class ZombieVillagerController extends MobEntityController {
return NMSImpl.isLeashed(npc, super::isLeashed, this);
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
public void knockback(double strength, double dx, double dz) {
NMS.callKnockbackEvent(npc, (float) strength, dx, dz, (evt) -> super.knockback((float) evt.getStrength(),

View File

@ -40,12 +40,6 @@ public class AreaEffectCloudController extends MobEntityController {
}
public static class EntityAreaEffectCloudNPC extends AreaEffectCloud implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityAreaEffectCloudNPC(EntityType<? extends AreaEffectCloud> types, Level level) {
@ -70,6 +64,12 @@ public class AreaEffectCloudController extends MobEntityController {
return npc;
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
protected AABB makeBoundingBox() {
return NMSBoundingBox.makeBB(npc, super.makeBoundingBox());

View File

@ -45,12 +45,6 @@ public class ArmorStandController extends MobEntityController {
}
public static class EntityArmorStandNPC extends ArmorStand implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityArmorStandNPC(EntityType<? extends ArmorStand> types, Level level) {
@ -86,6 +80,12 @@ public class ArmorStandController extends MobEntityController {
return event.isCancelled() ? InteractionResult.FAIL : InteractionResult.SUCCESS;
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
protected AABB makeBoundingBox() {
return NMSBoundingBox.makeBB(npc, super.makeBoundingBox());

View File

@ -47,22 +47,16 @@ public class BoatController extends MobEntityController {
}
public static class EntityBoatNPC extends Boat implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private double aC;
private float aD;
private Status aE;
private Status aF;
private double ap;
private double ar;
private final CitizensNPC npc;
public EntityBoatNPC(EntityType<? extends Boat> types, Level level) {
this(types, level, null);
}
@ -101,6 +95,12 @@ public class BoatController extends MobEntityController {
return Status.IN_AIR;
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
protected AABB makeBoundingBox() {
return NMSBoundingBox.makeBB(npc, super.makeBoundingBox());

View File

@ -40,12 +40,6 @@ public class DragonFireballController extends MobEntityController {
}
public static class EntityDragonFireballNPC extends DragonFireball implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityDragonFireballNPC(EntityType<? extends DragonFireball> types, Level level) {
@ -70,6 +64,12 @@ public class DragonFireballController extends MobEntityController {
return npc;
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
protected AABB makeBoundingBox() {
return NMSBoundingBox.makeBB(npc, super.makeBoundingBox());

View File

@ -50,12 +50,6 @@ public class EggController extends AbstractEntityController {
}
public static class EntityEggNPC extends ThrownEgg implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityEggNPC(EntityType<? extends ThrownEgg> types, Level level) {
@ -85,6 +79,12 @@ public class EggController extends AbstractEntityController {
return npc;
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
protected AABB makeBoundingBox() {
return NMSBoundingBox.makeBB(npc, super.makeBoundingBox());

View File

@ -40,12 +40,6 @@ public class EnderCrystalController extends MobEntityController {
}
public static class EntityEnderCrystalNPC extends EndCrystal implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityEnderCrystalNPC(EntityType<? extends EndCrystal> types, Level level) {
@ -70,6 +64,12 @@ public class EnderCrystalController extends MobEntityController {
return npc;
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
protected AABB makeBoundingBox() {
return NMSBoundingBox.makeBB(npc, super.makeBoundingBox());

View File

@ -41,12 +41,6 @@ public class EnderPearlController extends MobEntityController {
}
public static class EntityEnderPearlNPC extends ThrownEnderpearl implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityEnderPearlNPC(EntityType<? extends ThrownEnderpearl> types, Level level) {
@ -71,6 +65,12 @@ public class EnderPearlController extends MobEntityController {
return npc;
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
protected AABB makeBoundingBox() {
return NMSBoundingBox.makeBB(npc, super.makeBoundingBox());

View File

@ -41,12 +41,6 @@ public class EnderSignalController extends MobEntityController {
}
public static class EntityEnderSignalNPC extends EyeOfEnder implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityEnderSignalNPC(EntityType<? extends EyeOfEnder> types, Level level) {
@ -71,6 +65,12 @@ public class EnderSignalController extends MobEntityController {
return npc;
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
protected AABB makeBoundingBox() {
return NMSBoundingBox.makeBB(npc, super.makeBoundingBox());

View File

@ -39,12 +39,6 @@ public class EvokerFangsController extends MobEntityController {
}
public static class EntityEvokerFangsNPC extends EvokerFangs implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityEvokerFangsNPC(EntityType<? extends EvokerFangs> types, Level level) {
@ -80,6 +74,12 @@ public class EvokerFangsController extends MobEntityController {
return event.isCancelled() ? InteractionResult.FAIL : InteractionResult.SUCCESS;
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
protected AABB makeBoundingBox() {
return NMSBoundingBox.makeBB(npc, super.makeBoundingBox());

View File

@ -34,12 +34,6 @@ public class ExperienceOrbController extends MobEntityController {
}
public static class EntityExperienceOrbNPC extends ExperienceOrb implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityExperienceOrbNPC(EntityType<? extends ExperienceOrb> types, Level level) {
@ -64,6 +58,12 @@ public class ExperienceOrbController extends MobEntityController {
return npc;
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
protected AABB makeBoundingBox() {
return NMSBoundingBox.makeBB(npc, super.makeBoundingBox());

View File

@ -51,12 +51,6 @@ public class FallingBlockController extends AbstractEntityController {
}
public static class EntityFallingBlockNPC extends FallingBlockEntity implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityFallingBlockNPC(EntityType<? extends FallingBlockEntity> types, Level level) {
@ -86,6 +80,12 @@ public class FallingBlockController extends AbstractEntityController {
return npc;
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
protected AABB makeBoundingBox() {
return NMSBoundingBox.makeBB(npc, super.makeBoundingBox());

View File

@ -35,12 +35,6 @@ public class FireworkController extends MobEntityController {
}
public static class EntityFireworkNPC extends FireworkRocketEntity implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityFireworkNPC(EntityType<? extends FireworkRocketEntity> types, Level level) {
@ -65,6 +59,12 @@ public class FireworkController extends MobEntityController {
return npc;
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
protected AABB makeBoundingBox() {
return NMSBoundingBox.makeBB(npc, super.makeBoundingBox());

View File

@ -44,12 +44,6 @@ public class FishingHookController extends MobEntityController {
}
public static class EntityFishingHookNPC extends FishingHook implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityFishingHookNPC(EntityType<? extends FishingHook> types, Level level) {
@ -84,6 +78,12 @@ public class FishingHookController extends MobEntityController {
return npc;
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
protected AABB makeBoundingBox() {
return NMSBoundingBox.makeBB(npc, super.makeBoundingBox());

View File

@ -46,12 +46,6 @@ public class GlowItemFrameController extends MobEntityController {
}
public static class EntityGlowItemFrameNPC extends GlowItemFrame implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityGlowItemFrameNPC(EntityType<? extends GlowItemFrame> types, Level level) {
@ -76,6 +70,12 @@ public class GlowItemFrameController extends MobEntityController {
return npc;
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
protected AABB makeBoundingBox() {
return NMSBoundingBox.makeBB(npc, super.makeBoundingBox());

View File

@ -46,12 +46,6 @@ public class ItemController extends AbstractEntityController {
}
public static class EntityItemNPC extends ItemEntity implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityItemNPC(EntityType<? extends ItemEntity> types, Level level) {
@ -77,6 +71,12 @@ public class ItemController extends AbstractEntityController {
return npc;
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
protected AABB makeBoundingBox() {
return NMSBoundingBox.makeBB(npc, super.makeBoundingBox());

View File

@ -45,12 +45,6 @@ public class ItemFrameController extends MobEntityController {
}
public static class EntityItemFrameNPC extends ItemFrame implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityItemFrameNPC(EntityType<? extends ItemFrame> types, Level level) {
@ -75,6 +69,12 @@ public class ItemFrameController extends MobEntityController {
return npc;
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
protected AABB makeBoundingBox() {
return NMSBoundingBox.makeBB(npc, super.makeBoundingBox());

View File

@ -34,12 +34,6 @@ public class LargeFireballController extends MobEntityController {
}
public static class EntityLargeFireballNPC extends LargeFireball implements NPCHolder {
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
private final CitizensNPC npc;
public EntityLargeFireballNPC(EntityType<? extends LargeFireball> types, Level level) {
@ -64,6 +58,12 @@ public class LargeFireballController extends MobEntityController {
return npc;
}
@Override
public boolean isPushable() {
return npc == null ? super.isPushable()
: npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected());
}
@Override
protected AABB makeBoundingBox() {
return NMSBoundingBox.makeBB(npc, super.makeBoundingBox());

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