Implement new methods, add /npc flyable command, and add some missing messages
This commit is contained in:
parent
7803313e8c
commit
174389cc80
|
@ -420,6 +420,24 @@ public class NPCCommands {
|
|||
Messaging.sendTr(sender, Messages.NPC_DESPAWNED, npc.getName());
|
||||
}
|
||||
|
||||
@Command(
|
||||
aliases = { "npc" },
|
||||
usage = "flyable (true|false)",
|
||||
desc = "Toggles or sets an NPC's flyable status",
|
||||
modifiers = { "flyable" },
|
||||
min = 1,
|
||||
max = 2,
|
||||
permission = "citizens.npc.flyable")
|
||||
@Requirements(selected = true, ownership = true, excludedTypes = { EntityType.BAT, EntityType.BLAZE,
|
||||
EntityType.ENDER_DRAGON, EntityType.GHAST, EntityType.WITHER })
|
||||
public void flyable(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
|
||||
boolean flyable = args.argsLength() == 2 ? args.getString(1).equals("true") : !npc.isFlyable();
|
||||
npc.setFlyable(flyable);
|
||||
flyable = npc.isFlyable(); // may not have applied
|
||||
|
||||
Messaging.sendTr(sender, flyable ? Messages.FLYABLE_SET : Messages.FLYABLE_UNSET);
|
||||
}
|
||||
|
||||
@Command(
|
||||
aliases = { "npc" },
|
||||
usage = "gamemode [gamemode]",
|
||||
|
|
|
@ -10,8 +10,10 @@ import net.citizensnpcs.api.event.DespawnReason;
|
|||
import net.citizensnpcs.api.event.NPCDespawnEvent;
|
||||
import net.citizensnpcs.api.event.NPCSpawnEvent;
|
||||
import net.citizensnpcs.api.npc.AbstractNPC;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.api.npc.NPCRegistry;
|
||||
import net.citizensnpcs.api.trait.Trait;
|
||||
import net.citizensnpcs.api.trait.trait.MobType;
|
||||
import net.citizensnpcs.api.trait.trait.Spawned;
|
||||
import net.citizensnpcs.api.util.DataKey;
|
||||
import net.citizensnpcs.api.util.Messaging;
|
||||
|
@ -20,6 +22,7 @@ import net.citizensnpcs.trait.CurrentLocation;
|
|||
import net.citizensnpcs.util.Messages;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.citizensnpcs.util.nms.FlyingUtil;
|
||||
import net.minecraft.server.v1_6_R3.Packet34EntityTeleport;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
|
@ -97,6 +100,12 @@ public class CitizensNPC extends AbstractNPC {
|
|||
return isSpawned() ? getEntity().getLocation() : getTrait(CurrentLocation.class).getLocation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFlyable() {
|
||||
updateFlyableState();
|
||||
return data().get(NPC.FLYABLE_METADATA, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSpawned() {
|
||||
return getEntity() != null;
|
||||
|
@ -142,6 +151,12 @@ public class CitizensNPC extends AbstractNPC {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFlyable(boolean flyable) {
|
||||
data().setPersistent(NPC.FLYABLE_METADATA, flyable);
|
||||
updateFlyableState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean spawn(Location at) {
|
||||
Preconditions.checkNotNull(at, "location cannot be null");
|
||||
|
@ -250,5 +265,14 @@ public class CitizensNPC extends AbstractNPC {
|
|||
}
|
||||
}
|
||||
|
||||
private void updateFlyableState() {
|
||||
EntityType type = getTrait(MobType.class).getType();
|
||||
if (type == null)
|
||||
return;
|
||||
if (FlyingUtil.isAlwaysFlyable(type)) {
|
||||
data().setPersistent(NPC.FLYABLE_METADATA, true);
|
||||
}
|
||||
}
|
||||
|
||||
private static final String NPC_METADATA_MARKER = "NPC";
|
||||
}
|
|
@ -164,7 +164,9 @@ public class CitizensNavigator implements Navigator, Runnable {
|
|||
localParams = defaultParams.clone();
|
||||
updatePathfindingRange();
|
||||
PathStrategy newStrategy;
|
||||
if (localParams.useNewPathfinder()) {
|
||||
if (npc.isFlyable()) {
|
||||
newStrategy = new FlyingAStarNavigationStrategy(npc, target, localParams);
|
||||
} else if (localParams.useNewPathfinder()) {
|
||||
newStrategy = new AStarNavigationStrategy(npc, target, localParams);
|
||||
} else {
|
||||
newStrategy = new MCNavigationStrategy(npc, target, localParams);
|
||||
|
|
|
@ -7,6 +7,7 @@ import net.citizensnpcs.npc.MobEntityController;
|
|||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.citizensnpcs.util.nms.FlyingUtil;
|
||||
import net.minecraft.server.v1_6_R3.EntityCaveSpider;
|
||||
import net.minecraft.server.v1_6_R3.World;
|
||||
|
||||
|
@ -57,13 +58,29 @@ public class CaveSpiderController extends MobEntityController {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void a(double d0, boolean flag) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.a(d0, flag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void b(float f) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.b(f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean bH() {
|
||||
if (npc == null)
|
||||
if (npc == null) {
|
||||
return super.bH();
|
||||
}
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault)) {
|
||||
return super.bH();
|
||||
}
|
||||
if (super.bH()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
}
|
||||
|
@ -73,15 +90,16 @@ public class CaveSpiderController extends MobEntityController {
|
|||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null)
|
||||
if (npc != null) {
|
||||
npc.update();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bl() {
|
||||
if (npc == null)
|
||||
if (npc == null) {
|
||||
super.bl();
|
||||
else {
|
||||
} else {
|
||||
NMS.updateAI(this);
|
||||
npc.update();
|
||||
}
|
||||
|
@ -92,8 +110,27 @@ public class CaveSpiderController extends MobEntityController {
|
|||
// this method is called by both the entities involved - cancelling
|
||||
// it will not stop the NPC from moving.
|
||||
super.collide(entity);
|
||||
if (npc != null)
|
||||
if (npc != null) {
|
||||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean e() {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
return super.e();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
} else {
|
||||
FlyingUtil.moveLogic(this, f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -7,6 +7,7 @@ import net.citizensnpcs.npc.MobEntityController;
|
|||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.citizensnpcs.util.nms.FlyingUtil;
|
||||
import net.minecraft.server.v1_6_R3.EntityChicken;
|
||||
import net.minecraft.server.v1_6_R3.World;
|
||||
|
||||
|
@ -57,10 +58,17 @@ public class ChickenController extends MobEntityController {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null)
|
||||
npc.update();
|
||||
protected void a(double d0, boolean flag) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.a(d0, flag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void b(float f) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.b(f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -76,6 +84,13 @@ public class ChickenController extends MobEntityController {
|
|||
return false; // shouldLeash
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null)
|
||||
npc.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
||||
// this method is called by both the entities involved - cancelling
|
||||
|
@ -85,6 +100,24 @@ public class ChickenController extends MobEntityController {
|
|||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean e() {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
return super.e();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
} else {
|
||||
FlyingUtil.moveLogic(this, f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
|
|
@ -7,6 +7,7 @@ import net.citizensnpcs.npc.MobEntityController;
|
|||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.citizensnpcs.util.nms.FlyingUtil;
|
||||
import net.minecraft.server.v1_6_R3.EntityCow;
|
||||
import net.minecraft.server.v1_6_R3.World;
|
||||
|
||||
|
@ -58,10 +59,17 @@ public class CowController extends MobEntityController {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null)
|
||||
npc.update();
|
||||
protected void a(double d0, boolean flag) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.a(d0, flag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void b(float f) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.b(f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -77,13 +85,40 @@ public class CowController extends MobEntityController {
|
|||
return false; // shouldLeash
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null) {
|
||||
npc.update();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
||||
// this method is called by both the entities involved - cancelling
|
||||
// it will not stop the NPC from moving.
|
||||
super.collide(entity);
|
||||
if (npc != null)
|
||||
if (npc != null) {
|
||||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean e() {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
return super.e();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
} else {
|
||||
FlyingUtil.moveLogic(this, f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -7,6 +7,7 @@ import net.citizensnpcs.npc.MobEntityController;
|
|||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.citizensnpcs.util.nms.FlyingUtil;
|
||||
import net.minecraft.server.v1_6_R3.EntityCreeper;
|
||||
import net.minecraft.server.v1_6_R3.EntityLightning;
|
||||
import net.minecraft.server.v1_6_R3.World;
|
||||
|
@ -58,6 +59,13 @@ public class CreeperController extends MobEntityController {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void a(double d0, boolean flag) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.a(d0, flag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(EntityLightning entitylightning) {
|
||||
if (npc == null || allowPowered)
|
||||
|
@ -65,10 +73,9 @@ public class CreeperController extends MobEntityController {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null) {
|
||||
npc.update();
|
||||
protected void b(float f) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.b(f);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -85,6 +92,14 @@ public class CreeperController extends MobEntityController {
|
|||
return false; // shouldLeash
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null) {
|
||||
npc.update();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
||||
// this method is called by both the entities involved - cancelling
|
||||
|
@ -94,6 +109,24 @@ public class CreeperController extends MobEntityController {
|
|||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean e() {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
return super.e();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
} else {
|
||||
FlyingUtil.moveLogic(this, f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
|
|
@ -7,6 +7,7 @@ import net.citizensnpcs.npc.MobEntityController;
|
|||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.citizensnpcs.util.nms.FlyingUtil;
|
||||
import net.minecraft.server.v1_6_R3.EntityEnderman;
|
||||
import net.minecraft.server.v1_6_R3.World;
|
||||
|
||||
|
@ -57,6 +58,20 @@ public class EndermanController extends MobEntityController {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void a(double d0, boolean flag) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.a(d0, flag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void b(float f) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.b(f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean bH() {
|
||||
if (npc == null)
|
||||
|
@ -106,6 +121,24 @@ public class EndermanController extends MobEntityController {
|
|||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean e() {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
return super.e();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
} else {
|
||||
FlyingUtil.moveLogic(this, f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
|
|
@ -14,6 +14,7 @@ import net.citizensnpcs.npc.network.EmptyNetworkManager;
|
|||
import net.citizensnpcs.npc.network.EmptySocket;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.citizensnpcs.util.nms.FlyingUtil;
|
||||
import net.citizensnpcs.util.nms.PlayerControllerJump;
|
||||
import net.citizensnpcs.util.nms.PlayerControllerLook;
|
||||
import net.citizensnpcs.util.nms.PlayerControllerMove;
|
||||
|
@ -66,6 +67,20 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void a(double d0, boolean flag) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.a(d0, flag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void b(float f) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.b(f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
||||
// this method is called by both the entities involved - cancelling
|
||||
|
@ -76,6 +91,24 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean e() {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
return super.e();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
} else {
|
||||
FlyingUtil.moveLogic(this, f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
|
|
@ -7,6 +7,7 @@ import net.citizensnpcs.npc.MobEntityController;
|
|||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.citizensnpcs.util.nms.FlyingUtil;
|
||||
import net.minecraft.server.v1_6_R3.EntityGiantZombie;
|
||||
import net.minecraft.server.v1_6_R3.World;
|
||||
|
||||
|
@ -42,6 +43,20 @@ public class GiantController extends MobEntityController {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void a(double d0, boolean flag) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.a(d0, flag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void b(float f) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.b(f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean bH() {
|
||||
if (npc == null)
|
||||
|
@ -74,6 +89,24 @@ public class GiantController extends MobEntityController {
|
|||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean e() {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
return super.e();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
} else {
|
||||
FlyingUtil.moveLogic(this, f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
|
|
@ -8,6 +8,7 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
|||
import net.citizensnpcs.trait.HorseModifiers;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.citizensnpcs.util.nms.FlyingUtil;
|
||||
import net.minecraft.server.v1_6_R3.EntityHorse;
|
||||
import net.minecraft.server.v1_6_R3.World;
|
||||
|
||||
|
@ -52,6 +53,20 @@ public class HorseController extends MobEntityController {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void a(double d0, boolean flag) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.a(d0, flag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void b(float f) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.b(f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean bH() {
|
||||
if (npc == null)
|
||||
|
@ -86,6 +101,24 @@ public class HorseController extends MobEntityController {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean e() {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
return super.e();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
} else {
|
||||
FlyingUtil.moveLogic(this, f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
|
|
@ -7,6 +7,7 @@ import net.citizensnpcs.npc.MobEntityController;
|
|||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.citizensnpcs.util.nms.FlyingUtil;
|
||||
import net.minecraft.server.v1_6_R3.EntityIronGolem;
|
||||
import net.minecraft.server.v1_6_R3.World;
|
||||
|
||||
|
@ -43,10 +44,17 @@ public class IronGolemController extends MobEntityController {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null)
|
||||
npc.update();
|
||||
protected void a(double d0, boolean flag) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.a(d0, flag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void b(float f) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.b(f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -62,6 +70,13 @@ public class IronGolemController extends MobEntityController {
|
|||
return false; // shouldLeash
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null)
|
||||
npc.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
||||
// this method is called by both the entities involved - cancelling
|
||||
|
@ -71,6 +86,24 @@ public class IronGolemController extends MobEntityController {
|
|||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean e() {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
return super.e();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
} else {
|
||||
FlyingUtil.moveLogic(this, f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
|
|
@ -7,6 +7,7 @@ import net.citizensnpcs.npc.MobEntityController;
|
|||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.citizensnpcs.util.nms.FlyingUtil;
|
||||
import net.minecraft.server.v1_6_R3.EntityMagmaCube;
|
||||
import net.minecraft.server.v1_6_R3.World;
|
||||
|
||||
|
@ -44,10 +45,17 @@ public class MagmaCubeController extends MobEntityController {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null)
|
||||
npc.update();
|
||||
protected void a(double d0, boolean flag) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.a(d0, flag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void b(float f) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.b(f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -63,6 +71,13 @@ public class MagmaCubeController extends MobEntityController {
|
|||
return false; // shouldLeash
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null)
|
||||
npc.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bl() {
|
||||
if (npc == null)
|
||||
|
@ -82,6 +97,24 @@ public class MagmaCubeController extends MobEntityController {
|
|||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean e() {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
return super.e();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
} else {
|
||||
FlyingUtil.moveLogic(this, f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
|
|
@ -7,6 +7,7 @@ import net.citizensnpcs.npc.MobEntityController;
|
|||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.citizensnpcs.util.nms.FlyingUtil;
|
||||
import net.minecraft.server.v1_6_R3.EntityMushroomCow;
|
||||
import net.minecraft.server.v1_6_R3.World;
|
||||
|
||||
|
@ -44,10 +45,17 @@ public class MushroomCowController extends MobEntityController {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null)
|
||||
npc.update();
|
||||
protected void a(double d0, boolean flag) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.a(d0, flag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void b(float f) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.b(f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -63,6 +71,13 @@ public class MushroomCowController extends MobEntityController {
|
|||
return false; // shouldLeash
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null)
|
||||
npc.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
||||
// this method is called by both the entities involved - cancelling
|
||||
|
@ -72,6 +87,24 @@ public class MushroomCowController extends MobEntityController {
|
|||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean e() {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
return super.e();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
} else {
|
||||
FlyingUtil.moveLogic(this, f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
|
|
@ -7,6 +7,7 @@ import net.citizensnpcs.npc.MobEntityController;
|
|||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.citizensnpcs.util.nms.FlyingUtil;
|
||||
import net.minecraft.server.v1_6_R3.EntityOcelot;
|
||||
import net.minecraft.server.v1_6_R3.World;
|
||||
|
||||
|
@ -44,10 +45,17 @@ public class OcelotController extends MobEntityController {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null)
|
||||
npc.update();
|
||||
protected void a(double d0, boolean flag) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.a(d0, flag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void b(float f) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.b(f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -63,6 +71,13 @@ public class OcelotController extends MobEntityController {
|
|||
return false; // shouldLeash
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null)
|
||||
npc.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
||||
// this method is called by both the entities involved - cancelling
|
||||
|
@ -72,6 +87,24 @@ public class OcelotController extends MobEntityController {
|
|||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean e() {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
return super.e();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
} else {
|
||||
FlyingUtil.moveLogic(this, f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
|
|
@ -7,6 +7,7 @@ import net.citizensnpcs.npc.MobEntityController;
|
|||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.citizensnpcs.util.nms.FlyingUtil;
|
||||
import net.minecraft.server.v1_6_R3.EntityLightning;
|
||||
import net.minecraft.server.v1_6_R3.EntityPig;
|
||||
import net.minecraft.server.v1_6_R3.World;
|
||||
|
@ -43,12 +44,26 @@ public class PigController extends MobEntityController {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void a(double d0, boolean flag) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.a(d0, flag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(EntityLightning entitylightning) {
|
||||
if (npc == null)
|
||||
super.a(entitylightning);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void b(float f) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.b(f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean bH() {
|
||||
if (npc == null)
|
||||
|
@ -78,6 +93,24 @@ public class PigController extends MobEntityController {
|
|||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean e() {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
return super.e();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
} else {
|
||||
FlyingUtil.moveLogic(this, f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
|
|
@ -7,6 +7,7 @@ import net.citizensnpcs.npc.MobEntityController;
|
|||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.citizensnpcs.util.nms.FlyingUtil;
|
||||
import net.minecraft.server.v1_6_R3.EntityPigZombie;
|
||||
import net.minecraft.server.v1_6_R3.World;
|
||||
|
||||
|
@ -44,10 +45,17 @@ public class PigZombieController extends MobEntityController {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null)
|
||||
npc.update();
|
||||
protected void a(double d0, boolean flag) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.a(d0, flag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void b(float f) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.b(f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -63,6 +71,13 @@ public class PigZombieController extends MobEntityController {
|
|||
return false; // shouldLeash
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null)
|
||||
npc.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bl() {
|
||||
if (npc == null) {
|
||||
|
@ -82,6 +97,24 @@ public class PigZombieController extends MobEntityController {
|
|||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean e() {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
return super.e();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
} else {
|
||||
FlyingUtil.moveLogic(this, f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
|
|
@ -7,6 +7,7 @@ import net.citizensnpcs.npc.MobEntityController;
|
|||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.citizensnpcs.util.nms.FlyingUtil;
|
||||
import net.minecraft.server.v1_6_R3.EntitySheep;
|
||||
import net.minecraft.server.v1_6_R3.World;
|
||||
|
||||
|
@ -44,10 +45,17 @@ public class SheepController extends MobEntityController {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null)
|
||||
npc.update();
|
||||
protected void a(double d0, boolean flag) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.a(d0, flag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void b(float f) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.b(f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -63,6 +71,13 @@ public class SheepController extends MobEntityController {
|
|||
return false; // shouldLeash
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null)
|
||||
npc.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
||||
// this method is called by both the entities involved - cancelling
|
||||
|
@ -72,6 +87,24 @@ public class SheepController extends MobEntityController {
|
|||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean e() {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
return super.e();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
} else {
|
||||
FlyingUtil.moveLogic(this, f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
|
|
@ -7,6 +7,7 @@ import net.citizensnpcs.npc.MobEntityController;
|
|||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.citizensnpcs.util.nms.FlyingUtil;
|
||||
import net.minecraft.server.v1_6_R3.EntitySilverfish;
|
||||
import net.minecraft.server.v1_6_R3.World;
|
||||
|
||||
|
@ -43,10 +44,17 @@ public class SilverfishController extends MobEntityController {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null)
|
||||
npc.update();
|
||||
protected void a(double d0, boolean flag) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.a(d0, flag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void b(float f) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.b(f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -62,6 +70,13 @@ public class SilverfishController extends MobEntityController {
|
|||
return false; // shouldLeash
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null)
|
||||
npc.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bl() {
|
||||
if (npc == null) {
|
||||
|
@ -81,6 +96,24 @@ public class SilverfishController extends MobEntityController {
|
|||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean e() {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
return super.e();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
} else {
|
||||
FlyingUtil.moveLogic(this, f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
|
|
@ -7,6 +7,7 @@ import net.citizensnpcs.npc.MobEntityController;
|
|||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.citizensnpcs.util.nms.FlyingUtil;
|
||||
import net.minecraft.server.v1_6_R3.EntitySkeleton;
|
||||
import net.minecraft.server.v1_6_R3.World;
|
||||
|
||||
|
@ -43,10 +44,17 @@ public class SkeletonController extends MobEntityController {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null)
|
||||
npc.update();
|
||||
protected void a(double d0, boolean flag) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.a(d0, flag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void b(float f) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.b(f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -62,6 +70,13 @@ public class SkeletonController extends MobEntityController {
|
|||
return false; // shouldLeash
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null)
|
||||
npc.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
||||
// this method is called by both the entities involved - cancelling
|
||||
|
@ -71,6 +86,24 @@ public class SkeletonController extends MobEntityController {
|
|||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean e() {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
return super.e();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
} else {
|
||||
FlyingUtil.moveLogic(this, f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
|
|
@ -7,6 +7,7 @@ import net.citizensnpcs.npc.MobEntityController;
|
|||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.citizensnpcs.util.nms.FlyingUtil;
|
||||
import net.minecraft.server.v1_6_R3.EntitySlime;
|
||||
import net.minecraft.server.v1_6_R3.World;
|
||||
|
||||
|
@ -45,10 +46,17 @@ public class SlimeController extends MobEntityController {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null)
|
||||
npc.update();
|
||||
protected void a(double d0, boolean flag) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.a(d0, flag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void b(float f) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.b(f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -64,6 +72,13 @@ public class SlimeController extends MobEntityController {
|
|||
return false; // shouldLeash
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null)
|
||||
npc.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bl() {
|
||||
if (npc == null) {
|
||||
|
@ -83,6 +98,24 @@ public class SlimeController extends MobEntityController {
|
|||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean e() {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
return super.e();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
} else {
|
||||
FlyingUtil.moveLogic(this, f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
|
|
@ -7,6 +7,7 @@ import net.citizensnpcs.npc.MobEntityController;
|
|||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.citizensnpcs.util.nms.FlyingUtil;
|
||||
import net.minecraft.server.v1_6_R3.EntitySnowman;
|
||||
import net.minecraft.server.v1_6_R3.World;
|
||||
|
||||
|
@ -43,10 +44,17 @@ public class SnowmanController extends MobEntityController {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null)
|
||||
npc.update();
|
||||
protected void a(double d0, boolean flag) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.a(d0, flag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void b(float f) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.b(f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -62,6 +70,13 @@ public class SnowmanController extends MobEntityController {
|
|||
return false; // shouldLeash
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null)
|
||||
npc.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
||||
// this method is called by both the entities involved - cancelling
|
||||
|
@ -71,6 +86,24 @@ public class SnowmanController extends MobEntityController {
|
|||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean e() {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
return super.e();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
} else {
|
||||
FlyingUtil.moveLogic(this, f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
|
|
@ -7,6 +7,7 @@ import net.citizensnpcs.npc.MobEntityController;
|
|||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.citizensnpcs.util.nms.FlyingUtil;
|
||||
import net.minecraft.server.v1_6_R3.EntitySpider;
|
||||
import net.minecraft.server.v1_6_R3.World;
|
||||
|
||||
|
@ -43,10 +44,17 @@ public class SpiderController extends MobEntityController {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null)
|
||||
npc.update();
|
||||
protected void a(double d0, boolean flag) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.a(d0, flag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void b(float f) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.b(f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -62,6 +70,13 @@ public class SpiderController extends MobEntityController {
|
|||
return false; // shouldLeash
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null)
|
||||
npc.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bl() {
|
||||
if (npc == null)
|
||||
|
@ -81,6 +96,24 @@ public class SpiderController extends MobEntityController {
|
|||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean e() {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
return super.e();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
} else {
|
||||
FlyingUtil.moveLogic(this, f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
|
|
@ -7,6 +7,7 @@ import net.citizensnpcs.npc.MobEntityController;
|
|||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.citizensnpcs.util.nms.FlyingUtil;
|
||||
import net.minecraft.server.v1_6_R3.EntitySquid;
|
||||
import net.minecraft.server.v1_6_R3.World;
|
||||
|
||||
|
@ -42,6 +43,20 @@ public class SquidController extends MobEntityController {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void a(double d0, boolean flag) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.a(d0, flag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void b(float f) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.b(f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean bH() {
|
||||
if (npc == null)
|
||||
|
@ -72,6 +87,24 @@ public class SquidController extends MobEntityController {
|
|||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean e() {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
return super.e();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
} else {
|
||||
FlyingUtil.moveLogic(this, f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
|
|
@ -7,6 +7,7 @@ import net.citizensnpcs.npc.MobEntityController;
|
|||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.citizensnpcs.util.nms.FlyingUtil;
|
||||
import net.minecraft.server.v1_6_R3.EntityHuman;
|
||||
import net.minecraft.server.v1_6_R3.EntityVillager;
|
||||
import net.minecraft.server.v1_6_R3.World;
|
||||
|
@ -44,6 +45,13 @@ public class VillagerController extends MobEntityController {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void a(double d0, boolean flag) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.a(d0, flag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
return npc == null || !blockTrades ? super.a(entityhuman) : false; // block
|
||||
|
@ -51,10 +59,10 @@ public class VillagerController extends MobEntityController {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null)
|
||||
npc.update();
|
||||
protected void b(float f) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.b(f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -70,6 +78,13 @@ public class VillagerController extends MobEntityController {
|
|||
return false; // shouldLeash
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null)
|
||||
npc.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
||||
// this method is called by both the entities involved - cancelling
|
||||
|
@ -79,6 +94,24 @@ public class VillagerController extends MobEntityController {
|
|||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean e() {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
return super.e();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
} else {
|
||||
FlyingUtil.moveLogic(this, f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
|
|
@ -7,6 +7,7 @@ import net.citizensnpcs.npc.MobEntityController;
|
|||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.citizensnpcs.util.nms.FlyingUtil;
|
||||
import net.minecraft.server.v1_6_R3.EntityWitch;
|
||||
import net.minecraft.server.v1_6_R3.World;
|
||||
|
||||
|
@ -43,10 +44,17 @@ public class WitchController extends MobEntityController {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null)
|
||||
npc.update();
|
||||
protected void a(double d0, boolean flag) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.a(d0, flag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void b(float f) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.b(f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -62,6 +70,13 @@ public class WitchController extends MobEntityController {
|
|||
return false; // shouldLeash
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null)
|
||||
npc.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
||||
// this method is called by both the entities involved - cancelling
|
||||
|
@ -71,6 +86,24 @@ public class WitchController extends MobEntityController {
|
|||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean e() {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
return super.e();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
} else {
|
||||
FlyingUtil.moveLogic(this, f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
|
|
@ -7,6 +7,7 @@ import net.citizensnpcs.npc.MobEntityController;
|
|||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.citizensnpcs.util.nms.FlyingUtil;
|
||||
import net.minecraft.server.v1_6_R3.EntityWolf;
|
||||
import net.minecraft.server.v1_6_R3.World;
|
||||
|
||||
|
@ -43,10 +44,16 @@ public class WolfController extends MobEntityController {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null) {
|
||||
npc.update();
|
||||
protected void a(double d0, boolean flag) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.a(d0, flag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void b(float f) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.b(f);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -63,6 +70,14 @@ public class WolfController extends MobEntityController {
|
|||
return false; // shouldLeash
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null) {
|
||||
npc.update();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
||||
// this method is called by both the entities involved - cancelling
|
||||
|
@ -72,6 +87,24 @@ public class WolfController extends MobEntityController {
|
|||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean e() {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
return super.e();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
} else {
|
||||
FlyingUtil.moveLogic(this, f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
|
|
@ -7,6 +7,7 @@ import net.citizensnpcs.npc.MobEntityController;
|
|||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.citizensnpcs.util.nms.FlyingUtil;
|
||||
import net.minecraft.server.v1_6_R3.EntityZombie;
|
||||
import net.minecraft.server.v1_6_R3.World;
|
||||
|
||||
|
@ -43,10 +44,16 @@ public class ZombieController extends MobEntityController {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null) {
|
||||
npc.update();
|
||||
protected void a(double d0, boolean flag) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.a(d0, flag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void b(float f) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.b(f);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -63,6 +70,14 @@ public class ZombieController extends MobEntityController {
|
|||
return false; // shouldLeash
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bi() {
|
||||
super.bi();
|
||||
if (npc != null) {
|
||||
npc.update();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
||||
// this method is called by both the entities involved - cancelling
|
||||
|
@ -72,6 +87,24 @@ public class ZombieController extends MobEntityController {
|
|||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean e() {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
return super.e();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void e(float f, float f1) {
|
||||
if (npc == null || !npc.isFlyable()) {
|
||||
super.e(f, f1);
|
||||
} else {
|
||||
FlyingUtil.moveLogic(this, f, f1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void g(double x, double y, double z) {
|
||||
if (npc == null) {
|
||||
|
|
|
@ -71,6 +71,8 @@ public class Messages {
|
|||
public static final String FAILED_LOAD_SAVES = "citizens.saves.load-failed";
|
||||
public static final String FAILED_TO_MOUNT_NPC = "citizens.commands.npc.mount.failed";
|
||||
public static final String FAILED_TO_REMOVE = "citizens.commands.trait.failed-to-remove";
|
||||
public static final String FLYABLE_SET = "citizens.commands.npc.flyable.set";
|
||||
public static final String FLYABLE_UNSET = "citizens.commands.npc.flyable.unset";
|
||||
public static final String FROM_ENTITY_NOT_FOUND = "citizens.commands.npc.tpto.from-not-found";
|
||||
public static final String GAMEMODE_DESCRIBE = "citizens.commands.npc.gamemode.describe";
|
||||
public static final String GAMEMODE_INVALID = "citizens.commands.npc.gamemode.invalid";
|
||||
|
|
|
@ -0,0 +1,81 @@
|
|||
package net.citizensnpcs.util.nms;
|
||||
|
||||
import net.minecraft.server.Block;
|
||||
import net.minecraft.server.MathHelper;
|
||||
import net.minecraft.server.v1_6_R3.EntityLiving;
|
||||
|
||||
import org.bukkit.entity.EntityType;
|
||||
|
||||
public class FlyingUtil {
|
||||
public static boolean isAlwaysFlyable(EntityType type) {
|
||||
switch (type) {
|
||||
case BAT:
|
||||
case BLAZE:
|
||||
case GHAST:
|
||||
case ENDER_DRAGON:
|
||||
case WITHER:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static void moveLogic(EntityLiving entity, float f, float f1) {
|
||||
if (entity.G()) {
|
||||
entity.a(f, f1, 0.02F);
|
||||
entity.move(entity.motX, entity.motY, entity.motZ);
|
||||
entity.motX *= 0.800000011920929D;
|
||||
entity.motY *= 0.800000011920929D;
|
||||
entity.motZ *= 0.800000011920929D;
|
||||
} else if (entity.I()) {
|
||||
entity.a(f, f1, 0.02F);
|
||||
entity.move(entity.motX, entity.motY, entity.motZ);
|
||||
entity.motX *= 0.5D;
|
||||
entity.motY *= 0.5D;
|
||||
entity.motZ *= 0.5D;
|
||||
} else {
|
||||
float f2 = 0.91F;
|
||||
|
||||
if (entity.onGround) {
|
||||
f2 = 0.54600006F;
|
||||
int i = entity.world.getTypeId(MathHelper.floor(entity.locX),
|
||||
MathHelper.floor(entity.boundingBox.b) - 1, MathHelper.floor(entity.locZ));
|
||||
|
||||
if (i > 0) {
|
||||
f2 = Block.byId[i].frictionFactor * 0.91F;
|
||||
}
|
||||
}
|
||||
|
||||
float f3 = 0.16277136F / (f2 * f2 * f2);
|
||||
|
||||
entity.a(f, f1, entity.onGround ? 0.1F * f3 : 0.02F);
|
||||
f2 = 0.91F;
|
||||
if (entity.onGround) {
|
||||
f2 = 0.54600006F;
|
||||
int j = entity.world.getTypeId(MathHelper.floor(entity.locX),
|
||||
MathHelper.floor(entity.boundingBox.b) - 1, MathHelper.floor(entity.locZ));
|
||||
|
||||
if (j > 0) {
|
||||
f2 = Block.byId[j].frictionFactor * 0.91F;
|
||||
}
|
||||
}
|
||||
|
||||
entity.move(entity.motX, entity.motY, entity.motZ);
|
||||
entity.motX *= f2;
|
||||
entity.motY *= f2;
|
||||
entity.motZ *= f2;
|
||||
}
|
||||
|
||||
entity.aF = entity.aG;
|
||||
double d0 = entity.locX - entity.lastX;
|
||||
double d1 = entity.locZ - entity.lastZ;
|
||||
float f4 = MathHelper.sqrt(d0 * d0 + d1 * d1) * 4.0F;
|
||||
|
||||
if (f4 > 1.0F) {
|
||||
f4 = 1.0F;
|
||||
}
|
||||
|
||||
entity.aG += (f4 - entity.aG) * 0.4F;
|
||||
entity.aH += entity.aG;
|
||||
}
|
||||
}
|
|
@ -35,6 +35,8 @@ citizens.commands.npc.create.not-living-mobtype={0} is not a living entity type.
|
|||
citizens.commands.npc.create.npc-name-too-long=NPC names cannot be longer than 16 characters. The name has been shortened.
|
||||
citizens.commands.npc.create.no-player-for-spawn=No player could be found by that name to spawn an NPC at.
|
||||
citizens.commands.npc.despawn.despawned=You despawned [[{0}]].
|
||||
citizens.commands.npc.flyable.set=[[{0}]] is now flyable.
|
||||
citizens.commands.npc.flyable.unset=[[{0}]] is no longer flyable.
|
||||
citizens.commands.npc.gamemode.describe={0}''s gamemode is [[{1}]].
|
||||
citizens.commands.npc.gamemode.invalid={0} is not a valid gamemode.
|
||||
citizens.commands.npc.gamemode.set=Gamemode set to [[{0}]].
|
||||
|
@ -63,6 +65,8 @@ citizens.commands.npc.owner.owner=[[{0}]]''s owner is [[{1}]].
|
|||
citizens.commands.npc.owner.set-server=[[The server]] is now the owner of {0}.
|
||||
citizens.commands.npc.owner.set=[[{1}]] is now the owner of {0}.
|
||||
citizens.commands.npc.pathfindingrange.set=Pathfinding range set to [[{0}]].
|
||||
citizens.commands.npc.pathopt.avoid-water-set=[[{0}]] will now avoid water.
|
||||
citizens.commands.npc.pathopt.avoid-water-unset=[[{0}]] will no longer avoid water.
|
||||
citizens.commands.npc.playerlist.added=Added [[{0}]] to the player list.
|
||||
citizens.commands.npc.playerlist.removed=Removed [[{0}]] from the player list.
|
||||
citizens.commands.npc.pose.added=Pose added.
|
||||
|
@ -110,6 +114,7 @@ citizens.commands.npc.zombiemod.baby-set=[[{0}]] is now a baby.
|
|||
citizens.commands.npc.zombiemod.baby-unset=[[{0}]] is no longer a baby.
|
||||
citizens.commands.page-missing=The page [[{0}]] does not exist.
|
||||
citizens.commands.requirements.disallowed-mobtype=The NPC cannot be the mob type {0} to use that command.
|
||||
citizens.commands.requirements.living-entity=The NPC must be a living entity.
|
||||
citizens.commands.requirements.missing-permission=You don't have permission to execute that command.
|
||||
citizens.commands.requirements.missing-required-trait=Missing required trait {0}.
|
||||
citizens.commands.requirements.must-be-ingame=You must be ingame to use that command.
|
||||
|
|
Loading…
Reference in New Issue