Make Citizens version independent (bump version to 2.0.20 due to API breakages)

This commit is contained in:
fullwall 2016-07-13 22:38:24 +08:00
parent 986a94674a
commit f595dd0d85
104 changed files with 2090 additions and 1960 deletions

View File

@ -55,7 +55,7 @@
<version>${craftbukkit.version}</version> <version>${craftbukkit.version}</version>
<type>jar</type> <type>jar</type>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.citizensnpcs</groupId> <groupId>net.citizensnpcs</groupId>
<artifactId>citizensapi</artifactId> <artifactId>citizensapi</artifactId>

View File

@ -259,8 +259,14 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
config = new Settings(getDataFolder()); config = new Settings(getDataFolder());
// Disable if the server is not using the compatible Minecraft version // Disable if the server is not using the compatible Minecraft version
String mcVersion = Util.getMinecraftRevision(); String mcVersion = Util.getMinecraftRevision();
compatible = COMPATIBLE_MC_REVISION.equals(mcVersion); compatible = true;
if (Setting.CHECK_MINECRAFT_VERSION.asBoolean() && !compatible) { try {
NMS.loadBridge(mcVersion);
} catch (Exception e) {
compatible = false;
if (Messaging.isDebugging()) {
e.printStackTrace();
}
Messaging.severeTr(Messages.CITIZENS_INCOMPATIBLE, getDescription().getVersion(), mcVersion); Messaging.severeTr(Messages.CITIZENS_INCOMPATIBLE, getDescription().getVersion(), mcVersion);
getServer().getPluginManager().disablePlugin(this); getServer().getPluginManager().disablePlugin(this);
return; return;
@ -461,6 +467,4 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
} }
return false; return false;
} }
private static final String COMPATIBLE_MC_REVISION = "1_10_R1";
} }

View File

@ -71,9 +71,6 @@ import net.citizensnpcs.api.util.Paginator;
import net.citizensnpcs.npc.EntityControllers; import net.citizensnpcs.npc.EntityControllers;
import net.citizensnpcs.npc.NPCSelector; import net.citizensnpcs.npc.NPCSelector;
import net.citizensnpcs.npc.Template; import net.citizensnpcs.npc.Template;
import net.citizensnpcs.npc.entity.nonliving.FallingBlockController.FallingBlockNPC;
import net.citizensnpcs.npc.entity.nonliving.ItemController.ItemNPC;
import net.citizensnpcs.npc.entity.nonliving.ItemFrameController.ItemFrameNPC;
import net.citizensnpcs.npc.skin.SkinnableEntity; import net.citizensnpcs.npc.skin.SkinnableEntity;
import net.citizensnpcs.trait.Age; import net.citizensnpcs.trait.Age;
import net.citizensnpcs.trait.Anchors; import net.citizensnpcs.trait.Anchors;
@ -745,21 +742,22 @@ public class NPCCommands {
if (mat == null) if (mat == null)
throw new CommandException(Messages.UNKNOWN_MATERIAL); throw new CommandException(Messages.UNKNOWN_MATERIAL);
int data = args.getInteger(2, 0); int data = args.getInteger(2, 0);
npc.data().setPersistent(NPC.ITEM_ID_METADATA, mat.name());
npc.data().setPersistent(NPC.ITEM_DATA_METADATA, data);
switch (npc.getEntity().getType()) { switch (npc.getEntity().getType()) {
case DROPPED_ITEM: case DROPPED_ITEM:
((org.bukkit.entity.Item) npc.getEntity()).getItemStack().setType(mat); ((org.bukkit.entity.Item) npc.getEntity()).getItemStack().setType(mat);
((ItemNPC) npc.getEntity()).setType(mat, data);
break; break;
case ITEM_FRAME: case ITEM_FRAME:
((ItemFrame) npc.getEntity()).getItem().setType(mat); ((ItemFrame) npc.getEntity()).getItem().setType(mat);
((ItemFrameNPC) npc.getEntity()).setType(mat, data);
break;
case FALLING_BLOCK:
((FallingBlockNPC) npc.getEntity()).setType(mat, data);
break; break;
default: default:
break; break;
} }
if (npc.isSpawned()) {
npc.despawn();
npc.spawn(npc.getStoredLocation());
}
Messaging.sendTr(sender, Messages.ITEM_SET, Util.prettyEnum(mat)); Messaging.sendTr(sender, Messages.ITEM_SET, Util.prettyEnum(mat));
} }
@ -1518,7 +1516,8 @@ public class NPCCommands {
Messaging.sendTr(sender, Messages.SKIN_SET, npc.getName(), skinName); Messaging.sendTr(sender, Messages.SKIN_SET, npc.getName(), skinName);
if (npc.isSpawned()) { if (npc.isSpawned()) {
SkinnableEntity skinnable = NMS.getSkinnable(npc.getEntity()); SkinnableEntity skinnable = npc.getEntity() instanceof SkinnableEntity ? (SkinnableEntity) npc.getEntity()
: null;
if (skinnable != null) { if (skinnable != null) {
skinnable.setSkinName(skinName, args.hasFlag('p')); skinnable.setSkinName(skinName, args.hasFlag('p'));
} }

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,10 +10,9 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.EntityBat; import net.minecraft.server.v1_10_R1.EntityBat;
import net.minecraft.server.v1_10_R1.NBTTagCompound; import net.minecraft.server.v1_10_R1.NBTTagCompound;
@ -55,19 +54,19 @@ public class BatController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
setFlying(false); setFlying(false);
} }
} }
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -120,7 +119,7 @@ public class BatController extends MobEntityController {
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override
@ -161,7 +160,7 @@ public class BatController extends MobEntityController {
if (npc == null) { if (npc == null) {
super.M(); super.M();
} else { } else {
NMS.updateAI(this); NMSImpl.updateAI(this);
npc.update(); npc.update();
} }
} }

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,10 +10,9 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.EntityBlaze; import net.minecraft.server.v1_10_R1.EntityBlaze;
import net.minecraft.server.v1_10_R1.NBTTagCompound; import net.minecraft.server.v1_10_R1.NBTTagCompound;
@ -55,18 +54,18 @@ public class BlazeController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
} }
} }
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -119,7 +118,7 @@ public class BlazeController extends MobEntityController {
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,10 +10,9 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.BlockPosition; import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.EntityCaveSpider; import net.minecraft.server.v1_10_R1.EntityCaveSpider;
@ -57,7 +56,7 @@ public class CaveSpiderController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
} }
} }
@ -70,12 +69,12 @@ public class CaveSpiderController extends MobEntityController {
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -138,13 +137,13 @@ public class CaveSpiderController extends MobEntityController {
if (npc == null || !npc.isFlyable()) { if (npc == null || !npc.isFlyable()) {
super.g(f, f1); super.g(f, f1);
} else { } else {
NMS.flyingMoveLogic(this, f, f1); NMSImpl.flyingMoveLogic(this, f, f1);
} }
} }
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override
@ -203,7 +202,7 @@ public class CaveSpiderController extends MobEntityController {
if (npc == null) { if (npc == null) {
super.setSize(f, f1); super.setSize(f, f1);
} else { } else {
NMS.setSize(this, f, f1, justCreated); NMSImpl.setSize(this, f, f1, justCreated);
} }
} }
} }

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,10 +10,9 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.BlockPosition; import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.EntityChicken; import net.minecraft.server.v1_10_R1.EntityChicken;
@ -57,7 +56,7 @@ public class ChickenController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
} }
} }
@ -81,12 +80,12 @@ public class ChickenController extends MobEntityController {
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -149,13 +148,13 @@ public class ChickenController extends MobEntityController {
if (npc == null || !npc.isFlyable()) { if (npc == null || !npc.isFlyable()) {
super.g(f, f1); super.g(f, f1);
} else { } else {
NMS.flyingMoveLogic(this, f, f1); NMSImpl.flyingMoveLogic(this, f, f1);
} }
} }
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,10 +10,9 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.BlockPosition; import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.EntityCow; import net.minecraft.server.v1_10_R1.EntityCow;
@ -57,7 +56,7 @@ public class CowController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
} }
} }
@ -82,12 +81,12 @@ public class CowController extends MobEntityController {
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -150,13 +149,13 @@ public class CowController extends MobEntityController {
if (npc == null || !npc.isFlyable()) { if (npc == null || !npc.isFlyable()) {
super.g(f, f1); super.g(f, f1);
} else { } else {
NMS.flyingMoveLogic(this, f, f1); NMSImpl.flyingMoveLogic(this, f, f1);
} }
} }
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,10 +10,9 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.BlockPosition; import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.EntityCreeper; import net.minecraft.server.v1_10_R1.EntityCreeper;
@ -62,7 +61,7 @@ public class CreeperController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
} }
} }
@ -81,12 +80,12 @@ public class CreeperController extends MobEntityController {
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -149,13 +148,13 @@ public class CreeperController extends MobEntityController {
if (npc == null || !npc.isFlyable()) { if (npc == null || !npc.isFlyable()) {
super.g(f, f1); super.g(f, f1);
} else { } else {
NMS.flyingMoveLogic(this, f, f1); NMSImpl.flyingMoveLogic(this, f, f1);
} }
} }
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override
@ -223,7 +222,7 @@ public class CreeperController extends MobEntityController {
if (npc == null) { if (npc == null) {
super.setSize(f, f1); super.setSize(f, f1);
} else { } else {
NMS.setSize(this, f, f1, justCreated); NMSImpl.setSize(this, f, f1, justCreated);
} }
} }
} }

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,10 +10,9 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.EntityEnderDragon; import net.minecraft.server.v1_10_R1.EntityEnderDragon;
import net.minecraft.server.v1_10_R1.NBTTagCompound; import net.minecraft.server.v1_10_R1.NBTTagCompound;
@ -55,18 +54,18 @@ public class EnderDragonController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
} }
} }
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -118,7 +117,7 @@ public class EnderDragonController extends MobEntityController {
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,10 +10,9 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.BlockPosition; import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.EntityEnderman; import net.minecraft.server.v1_10_R1.EntityEnderman;
@ -57,7 +56,7 @@ public class EndermanController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
} }
} }
@ -70,12 +69,12 @@ public class EndermanController extends MobEntityController {
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -137,13 +136,13 @@ public class EndermanController extends MobEntityController {
if (npc == null || !npc.isFlyable()) { if (npc == null || !npc.isFlyable()) {
super.g(f, f1); super.g(f, f1);
} else { } else {
NMS.flyingMoveLogic(this, f, f1); NMSImpl.flyingMoveLogic(this, f, f1);
} }
} }
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override
@ -208,7 +207,7 @@ public class EndermanController extends MobEntityController {
if (npc == null) { if (npc == null) {
super.setSize(f, f1); super.setSize(f, f1);
} else { } else {
NMS.setSize(this, f, f1, justCreated); NMSImpl.setSize(this, f, f1, justCreated);
} }
} }
} }

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,10 +10,9 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.BlockPosition; import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.EntityEndermite; import net.minecraft.server.v1_10_R1.EntityEndermite;
@ -57,7 +56,7 @@ public class EndermiteController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
} }
} }
@ -70,12 +69,12 @@ public class EndermiteController extends MobEntityController {
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -137,13 +136,13 @@ public class EndermiteController extends MobEntityController {
if (npc == null || !npc.isFlyable()) { if (npc == null || !npc.isFlyable()) {
super.g(f, f1); super.g(f, f1);
} else { } else {
NMS.flyingMoveLogic(this, f, f1); NMSImpl.flyingMoveLogic(this, f, f1);
} }
} }
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override
@ -199,7 +198,7 @@ public class EndermiteController extends MobEntityController {
if (npc == null) { if (npc == null) {
super.setSize(f, f1); super.setSize(f, f1);
} else { } else {
NMS.setSize(this, f, f1, justCreated); NMSImpl.setSize(this, f, f1, justCreated);
} }
} }
} }

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import java.io.IOException; import java.io.IOException;
import java.net.Socket; import java.net.Socket;
@ -26,19 +26,21 @@ import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.MetadataStore; import net.citizensnpcs.api.npc.MetadataStore;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.api.trait.trait.Inventory; import net.citizensnpcs.api.trait.trait.Inventory;
import net.citizensnpcs.nms.v1_10_R1.network.EmptyNetHandler;
import net.citizensnpcs.nms.v1_10_R1.network.EmptyNetworkManager;
import net.citizensnpcs.nms.v1_10_R1.network.EmptySocket;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.nms.v1_10_R1.util.PlayerControllerJump;
import net.citizensnpcs.nms.v1_10_R1.util.PlayerControllerLook;
import net.citizensnpcs.nms.v1_10_R1.util.PlayerControllerMove;
import net.citizensnpcs.nms.v1_10_R1.util.PlayerNavigation;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.npc.network.EmptyNetHandler;
import net.citizensnpcs.npc.network.EmptyNetworkManager;
import net.citizensnpcs.npc.network.EmptySocket;
import net.citizensnpcs.npc.skin.SkinPacketTracker; import net.citizensnpcs.npc.skin.SkinPacketTracker;
import net.citizensnpcs.npc.skin.SkinnableEntity; import net.citizensnpcs.npc.skin.SkinnableEntity;
import net.citizensnpcs.trait.Gravity;
import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.citizensnpcs.util.nms.PlayerControllerJump;
import net.citizensnpcs.util.nms.PlayerControllerLook;
import net.citizensnpcs.util.nms.PlayerControllerMove;
import net.citizensnpcs.util.nms.PlayerNavigation;
import net.minecraft.server.v1_10_R1.AttributeInstance; import net.minecraft.server.v1_10_R1.AttributeInstance;
import net.minecraft.server.v1_10_R1.BlockPosition; import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.DamageSource; import net.minecraft.server.v1_10_R1.DamageSource;
@ -66,7 +68,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
private PlayerControllerJump controllerJump; private PlayerControllerJump controllerJump;
private PlayerControllerLook controllerLook; private PlayerControllerLook controllerLook;
private PlayerControllerMove controllerMove; private PlayerControllerMove controllerMove;
private boolean gravity = true;
private int jumpTicks = 0; private int jumpTicks = 0;
private PlayerNavigation navigation; private PlayerNavigation navigation;
private final CitizensNPC npc; private final CitizensNPC npc;
@ -193,7 +194,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
if (npc == null || !npc.isFlyable()) { if (npc == null || !npc.isFlyable()) {
super.g(f, f1); super.g(f, f1);
} else { } else {
NMS.flyingMoveLogic(this, f, f1); NMSImpl.flyingMoveLogic(this, f, f1);
} }
} }
@ -260,7 +261,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
controllerLook = new PlayerControllerLook(this); controllerLook = new PlayerControllerLook(this);
controllerMove = new PlayerControllerMove(this); controllerMove = new PlayerControllerMove(this);
navigation = new PlayerNavigation(this, world); navigation = new PlayerNavigation(this, world);
NMS.setStepHeight(this, 1); // the default (0) breaks step climbing NMS.setStepHeight(getBukkitEntity(), 1); // the default (0) breaks step climbing
setSkinFlags((byte) 0xFF); setSkinFlags((byte) 0xFF);
} }
@ -286,7 +287,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
boolean navigating = npc.getNavigator().isNavigating(); boolean navigating = npc.getNavigator().isNavigating();
updatePackets(navigating); updatePackets(navigating);
if (gravity && !navigating && getBukkitEntity() != null if (npc.getTrait(Gravity.class).hasGravity() && !navigating && getBukkitEntity() != null
&& Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION))) { && Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION))) {
g(0, 0); g(0, 0);
} }
@ -295,8 +296,8 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
motX = motY = motZ = 0; motX = motY = motZ = 0;
} }
if (navigating) { if (navigating) {
if (!NMS.isNavigationFinished(navigation)) { if (!NMSImpl.isNavigationFinished(navigation)) {
NMS.updateNavigation(navigation); NMSImpl.updateNavigation(navigation);
} }
moveOnCurrentHeading(); moveOnCurrentHeading();
} }
@ -318,7 +319,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
} }
private void moveOnCurrentHeading() { private void moveOnCurrentHeading() {
NMS.updateAI(this); NMSImpl.updateAI(this);
if (be) { if (be) {
if (onGround && jumpTicks == 0) { if (onGround && jumpTicks == 0) {
cl(); cl();
@ -331,7 +332,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
bg *= 0.98F; bg *= 0.98F;
bh *= 0.9F; bh *= 0.9F;
g(bf, bg); // movement method g(bf, bg); // movement method
NMS.setHeadYaw(this, yaw); NMS.setHeadYaw(getBukkitEntity(), yaw);
if (jumpTicks > 0) { if (jumpTicks > 0) {
jumpTicks--; jumpTicks--;
} }
@ -382,13 +383,13 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
: EnumItemSlot.values().length + 1]; : EnumItemSlot.values().length + 1];
if (!navigating) { if (!navigating) {
packets[5] = new PacketPlayOutEntityHeadRotation(this, packets[5] = new PacketPlayOutEntityHeadRotation(this,
(byte) MathHelper.d(NMS.getHeadYaw(this) * 256.0F / 360.0F)); (byte) MathHelper.d(NMSImpl.getHeadYaw(this) * 256.0F / 360.0F));
} }
int i = 0; int i = 0;
for (EnumItemSlot slot : EnumItemSlot.values()) { for (EnumItemSlot slot : EnumItemSlot.values()) {
packets[i++] = new PacketPlayOutEntityEquipment(getId(), slot, getEquipment(slot)); packets[i++] = new PacketPlayOutEntityEquipment(getId(), slot, getEquipment(slot));
} }
NMS.sendPacketsNearby(getBukkitEntity(), current, packets); NMSImpl.sendPacketsNearby(getBukkitEntity(), current, packets);
} }
} }
@ -447,10 +448,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
cserver.getEntityMetadata().removeMetadata(this, metadataKey, owningPlugin); cserver.getEntityMetadata().removeMetadata(this, metadataKey, owningPlugin);
} }
public void setGravityEnabled(boolean enabled) {
getHandle().gravity = enabled;
}
@Override @Override
public void setMetadata(String metadataKey, MetadataValue newMetadataValue) { public void setMetadata(String metadataKey, MetadataValue newMetadataValue) {
cserver.getEntityMetadata().setMetadata(this, metadataKey, newMetadataValue); cserver.getEntityMetadata().setMetadata(this, metadataKey, newMetadataValue);

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,10 +10,9 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.EntityGhast; import net.minecraft.server.v1_10_R1.EntityGhast;
import net.minecraft.server.v1_10_R1.NBTTagCompound; import net.minecraft.server.v1_10_R1.NBTTagCompound;
@ -41,18 +40,18 @@ public class GhastController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
} }
} }
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -110,7 +109,7 @@ public class GhastController extends MobEntityController {
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,10 +10,9 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.BlockPosition; import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.EntityGiantZombie; import net.minecraft.server.v1_10_R1.EntityGiantZombie;
@ -43,7 +42,7 @@ public class GiantController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
} }
} }
@ -56,12 +55,12 @@ public class GiantController extends MobEntityController {
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -123,13 +122,13 @@ public class GiantController extends MobEntityController {
if (npc == null || !npc.isFlyable()) { if (npc == null || !npc.isFlyable()) {
super.g(f, f1); super.g(f, f1);
} else { } else {
NMS.flyingMoveLogic(this, f, f1); NMSImpl.flyingMoveLogic(this, f, f1);
} }
} }
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override
@ -186,7 +185,7 @@ public class GiantController extends MobEntityController {
if (npc == null) { if (npc == null) {
super.setSize(f, f1); super.setSize(f, f1);
} else { } else {
NMS.setSize(this, f, f1, justCreated); NMSImpl.setSize(this, f, f1, justCreated);
} }
} }
} }
@ -204,5 +203,4 @@ public class GiantController extends MobEntityController {
return npc; return npc;
} }
} }
} }

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,10 +10,9 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.BlockPosition; import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.EntityGuardian; import net.minecraft.server.v1_10_R1.EntityGuardian;
@ -43,7 +42,7 @@ public class GuardianController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
} }
} }
@ -56,12 +55,12 @@ public class GuardianController extends MobEntityController {
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -124,13 +123,13 @@ public class GuardianController extends MobEntityController {
if (npc == null || !npc.isFlyable()) { if (npc == null || !npc.isFlyable()) {
super.g(f, f1); super.g(f, f1);
} else { } else {
NMS.flyingMoveLogic(this, f, f1); NMSImpl.flyingMoveLogic(this, f, f1);
} }
} }
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override
@ -199,7 +198,7 @@ public class GuardianController extends MobEntityController {
if (npc == null) { if (npc == null) {
super.setSize(f, f1); super.setSize(f, f1);
} else { } else {
NMS.setSize(this, f, f1, justCreated); NMSImpl.setSize(this, f, f1, justCreated);
} }
} }
} }

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
@ -11,8 +11,8 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.trait.HorseModifiers; import net.citizensnpcs.trait.HorseModifiers;
import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.NMS;
@ -51,7 +51,7 @@ public class HorseController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
((Horse) getBukkitEntity()).setDomestication(((Horse) getBukkitEntity()).getMaxDomestication()); ((Horse) getBukkitEntity()).setDomestication(((Horse) getBukkitEntity()).getMaxDomestication());
} }
} }
@ -76,12 +76,12 @@ public class HorseController extends MobEntityController {
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -152,13 +152,13 @@ public class HorseController extends MobEntityController {
if (npc == null || !npc.isFlyable()) { if (npc == null || !npc.isFlyable()) {
super.g(f, f1); super.g(f, f1);
} else { } else {
NMS.flyingMoveLogic(this, f, f1); NMSImpl.flyingMoveLogic(this, f, f1);
} }
} }
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override
@ -198,7 +198,7 @@ public class HorseController extends MobEntityController {
if (npc == null) { if (npc == null) {
super.M(); super.M();
} else { } else {
NMS.setStepHeight(this, 1); NMS.setStepHeight(getBukkitEntity(), 1);
npc.update(); npc.update();
} }
} }

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import java.util.UUID; import java.util.UUID;
import java.util.regex.Pattern; import java.util.regex.Pattern;
@ -132,7 +132,7 @@ public class HumanController extends AbstractEntityController {
Player entity = getBukkitEntity(); Player entity = getBukkitEntity();
if (entity != null) { if (entity != null) {
NMS.removeFromWorld(entity); NMS.removeFromWorld(entity);
SkinnableEntity npc = NMS.getSkinnable(entity); SkinnableEntity npc = entity instanceof SkinnableEntity ? (SkinnableEntity) entity : null;
npc.getSkinTracker().onRemoveNPC(); npc.getSkinTracker().onRemoveNPC();
} }
super.remove(); super.remove();

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,10 +10,9 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.BlockPosition; import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.EntityIronGolem; import net.minecraft.server.v1_10_R1.EntityIronGolem;
@ -43,7 +42,7 @@ public class IronGolemController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
} }
} }
@ -56,12 +55,12 @@ public class IronGolemController extends MobEntityController {
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -123,13 +122,13 @@ public class IronGolemController extends MobEntityController {
if (npc == null || !npc.isFlyable()) { if (npc == null || !npc.isFlyable()) {
super.g(f, f1); super.g(f, f1);
} else { } else {
NMS.flyingMoveLogic(this, f, f1); NMSImpl.flyingMoveLogic(this, f, f1);
} }
} }
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override
@ -186,7 +185,7 @@ public class IronGolemController extends MobEntityController {
if (npc == null) { if (npc == null) {
super.setSize(f, f1); super.setSize(f, f1);
} else { } else {
NMS.setSize(this, f, f1, justCreated); NMSImpl.setSize(this, f, f1, justCreated);
} }
} }
} }

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,12 +10,11 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.nms.v1_10_R1.util.PlayerControllerMove;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.citizensnpcs.util.nms.PlayerControllerMove;
import net.minecraft.server.v1_10_R1.BlockPosition; import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.EntityMagmaCube; import net.minecraft.server.v1_10_R1.EntityMagmaCube;
import net.minecraft.server.v1_10_R1.IBlockData; import net.minecraft.server.v1_10_R1.IBlockData;
@ -45,7 +44,7 @@ public class MagmaCubeController extends MobEntityController {
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
setSize(3); setSize(3);
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
this.moveController = new PlayerControllerMove(this); this.moveController = new PlayerControllerMove(this);
} }
} }
@ -59,12 +58,12 @@ public class MagmaCubeController extends MobEntityController {
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -126,13 +125,13 @@ public class MagmaCubeController extends MobEntityController {
if (npc == null || !npc.isFlyable()) { if (npc == null || !npc.isFlyable()) {
super.g(f, f1); super.g(f, f1);
} else { } else {
NMS.flyingMoveLogic(this, f, f1); NMSImpl.flyingMoveLogic(this, f, f1);
} }
} }
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override
@ -189,7 +188,7 @@ public class MagmaCubeController extends MobEntityController {
if (npc == null) { if (npc == null) {
super.setSize(f, f1); super.setSize(f, f1);
} else { } else {
NMS.setSize(this, f, f1, justCreated); NMSImpl.setSize(this, f, f1, justCreated);
} }
} }
} }

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc; package net.citizensnpcs.nms.v1_10_R1.entity;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import java.util.Map; import java.util.Map;
@ -11,6 +11,7 @@ import org.bukkit.entity.Entity;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.npc.AbstractEntityController;
import net.minecraft.server.v1_10_R1.World; import net.minecraft.server.v1_10_R1.World;
public abstract class MobEntityController extends AbstractEntityController { public abstract class MobEntityController extends AbstractEntityController {

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,10 +10,9 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.BlockPosition; import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.EntityMushroomCow; import net.minecraft.server.v1_10_R1.EntityMushroomCow;
@ -44,7 +43,7 @@ public class MushroomCowController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
} }
} }
@ -68,12 +67,12 @@ public class MushroomCowController extends MobEntityController {
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -135,13 +134,13 @@ public class MushroomCowController extends MobEntityController {
if (npc == null || !npc.isFlyable()) { if (npc == null || !npc.isFlyable()) {
super.g(f, f1); super.g(f, f1);
} else { } else {
NMS.flyingMoveLogic(this, f, f1); NMSImpl.flyingMoveLogic(this, f, f1);
} }
} }
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,10 +10,9 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.BlockPosition; import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.EntityOcelot; import net.minecraft.server.v1_10_R1.EntityOcelot;
@ -43,7 +42,7 @@ public class OcelotController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
} }
} }
@ -67,12 +66,12 @@ public class OcelotController extends MobEntityController {
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -134,13 +133,13 @@ public class OcelotController extends MobEntityController {
if (npc == null || !npc.isFlyable()) { if (npc == null || !npc.isFlyable()) {
super.g(f, f1); super.g(f, f1);
} else { } else {
NMS.flyingMoveLogic(this, f, f1); NMSImpl.flyingMoveLogic(this, f, f1);
} }
} }
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,10 +10,9 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.BlockPosition; import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.EntityLightning; import net.minecraft.server.v1_10_R1.EntityLightning;
@ -44,7 +43,7 @@ public class PigController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
} }
} }
@ -68,12 +67,12 @@ public class PigController extends MobEntityController {
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -136,13 +135,13 @@ public class PigController extends MobEntityController {
if (npc == null || !npc.isFlyable()) { if (npc == null || !npc.isFlyable()) {
super.g(f, f1); super.g(f, f1);
} else { } else {
NMS.flyingMoveLogic(this, f, f1); NMSImpl.flyingMoveLogic(this, f, f1);
} }
} }
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,10 +10,9 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.BlockPosition; import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.EntityPigZombie; import net.minecraft.server.v1_10_R1.EntityPigZombie;
@ -44,7 +43,7 @@ public class PigZombieController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
} }
} }
@ -57,12 +56,12 @@ public class PigZombieController extends MobEntityController {
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -125,13 +124,13 @@ public class PigZombieController extends MobEntityController {
if (npc == null || !npc.isFlyable()) { if (npc == null || !npc.isFlyable()) {
super.g(f, f1); super.g(f, f1);
} else { } else {
NMS.flyingMoveLogic(this, f, f1); NMSImpl.flyingMoveLogic(this, f, f1);
} }
} }
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,10 +10,9 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.EntityPolarBear; import net.minecraft.server.v1_10_R1.EntityPolarBear;
import net.minecraft.server.v1_10_R1.NBTTagCompound; import net.minecraft.server.v1_10_R1.NBTTagCompound;
@ -41,18 +40,18 @@ public class PolarBearController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
} }
} }
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -105,7 +104,7 @@ public class PolarBearController extends MobEntityController {
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override
@ -145,7 +144,7 @@ public class PolarBearController extends MobEntityController {
public void m() { public void m() {
super.m(); super.m();
if (npc != null) { if (npc != null) {
NMS.updateAI(this); NMSImpl.updateAI(this);
npc.update(); npc.update();
} }
} }

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,10 +10,9 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.BlockPosition; import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.EntityLiving; import net.minecraft.server.v1_10_R1.EntityLiving;
@ -44,7 +43,7 @@ public class RabbitController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
} }
} }
@ -68,12 +67,12 @@ public class RabbitController extends MobEntityController {
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -136,13 +135,13 @@ public class RabbitController extends MobEntityController {
if (npc == null || !npc.isFlyable()) { if (npc == null || !npc.isFlyable()) {
super.g(f, f1); super.g(f, f1);
} else { } else {
NMS.flyingMoveLogic(this, f, f1); NMSImpl.flyingMoveLogic(this, f, f1);
} }
} }
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override
@ -204,9 +203,9 @@ public class RabbitController extends MobEntityController {
@Override @Override
public void setRabbitType(int i) { public void setRabbitType(int i) {
if (npc != null) { if (npc != null) {
if (NMS.getRabbitTypeField() == null) if (NMSImpl.getRabbitTypeField() == null)
return; return;
this.datawatcher.set(NMS.getRabbitTypeField(), i); this.datawatcher.set(NMSImpl.getRabbitTypeField(), i);
return; return;
} }
super.setRabbitType(i); super.setRabbitType(i);

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,10 +10,9 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.BlockPosition; import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.EntitySheep; import net.minecraft.server.v1_10_R1.EntitySheep;
@ -43,7 +42,7 @@ public class SheepController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
} }
} }
@ -67,12 +66,12 @@ public class SheepController extends MobEntityController {
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -134,13 +133,13 @@ public class SheepController extends MobEntityController {
if (npc == null || !npc.isFlyable()) { if (npc == null || !npc.isFlyable()) {
super.g(f, f1); super.g(f, f1);
} else { } else {
NMS.flyingMoveLogic(this, f, f1); NMSImpl.flyingMoveLogic(this, f, f1);
} }
} }
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,10 +10,9 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.BlockPosition; import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.EntityAIBodyControl; import net.minecraft.server.v1_10_R1.EntityAIBodyControl;
@ -44,7 +43,7 @@ public class ShulkerController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
} }
} }
@ -57,12 +56,12 @@ public class ShulkerController extends MobEntityController {
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -124,13 +123,13 @@ public class ShulkerController extends MobEntityController {
if (npc == null || !npc.isFlyable()) { if (npc == null || !npc.isFlyable()) {
super.g(f, f1); super.g(f, f1);
} else { } else {
NMS.flyingMoveLogic(this, f, f1); NMSImpl.flyingMoveLogic(this, f, f1);
} }
} }
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override
@ -200,7 +199,7 @@ public class ShulkerController extends MobEntityController {
if (npc == null) { if (npc == null) {
super.setSize(f, f1); super.setSize(f, f1);
} else { } else {
NMS.setSize(this, f, f1, justCreated); NMSImpl.setSize(this, f, f1, justCreated);
} }
} }
} }

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,10 +10,9 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.BlockPosition; import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.EntitySilverfish; import net.minecraft.server.v1_10_R1.EntitySilverfish;
@ -43,7 +42,7 @@ public class SilverfishController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
} }
} }
@ -56,12 +55,12 @@ public class SilverfishController extends MobEntityController {
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -123,13 +122,13 @@ public class SilverfishController extends MobEntityController {
if (npc == null || !npc.isFlyable()) { if (npc == null || !npc.isFlyable()) {
super.g(f, f1); super.g(f, f1);
} else { } else {
NMS.flyingMoveLogic(this, f, f1); NMSImpl.flyingMoveLogic(this, f, f1);
} }
} }
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override
@ -185,7 +184,7 @@ public class SilverfishController extends MobEntityController {
if (npc == null) { if (npc == null) {
super.setSize(f, f1); super.setSize(f, f1);
} else { } else {
NMS.setSize(this, f, f1, justCreated); NMSImpl.setSize(this, f, f1, justCreated);
} }
} }
} }

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,10 +10,9 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.BlockPosition; import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.EntitySkeleton; import net.minecraft.server.v1_10_R1.EntitySkeleton;
@ -43,7 +42,7 @@ public class SkeletonController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
} }
} }
@ -56,12 +55,12 @@ public class SkeletonController extends MobEntityController {
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -123,13 +122,13 @@ public class SkeletonController extends MobEntityController {
if (npc == null || !npc.isFlyable()) { if (npc == null || !npc.isFlyable()) {
super.g(f, f1); super.g(f, f1);
} else { } else {
NMS.flyingMoveLogic(this, f, f1); NMSImpl.flyingMoveLogic(this, f, f1);
} }
} }
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override
@ -186,7 +185,7 @@ public class SkeletonController extends MobEntityController {
if (npc == null) { if (npc == null) {
super.setSize(f, f1); super.setSize(f, f1);
} else { } else {
NMS.setSize(this, f, f1, justCreated); NMSImpl.setSize(this, f, f1, justCreated);
} }
} }
} }

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,12 +10,11 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.nms.v1_10_R1.util.PlayerControllerMove;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.citizensnpcs.util.nms.PlayerControllerMove;
import net.minecraft.server.v1_10_R1.BlockPosition; import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.EntityHuman; import net.minecraft.server.v1_10_R1.EntityHuman;
import net.minecraft.server.v1_10_R1.EntitySlime; import net.minecraft.server.v1_10_R1.EntitySlime;
@ -46,7 +45,7 @@ public class SlimeController extends MobEntityController {
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
setSize(3); setSize(3);
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
this.moveController = new PlayerControllerMove(this); this.moveController = new PlayerControllerMove(this);
} }
} }
@ -60,12 +59,12 @@ public class SlimeController extends MobEntityController {
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -135,13 +134,13 @@ public class SlimeController extends MobEntityController {
if (npc == null || !npc.isFlyable()) { if (npc == null || !npc.isFlyable()) {
super.g(f, f1); super.g(f, f1);
} else { } else {
NMS.flyingMoveLogic(this, f, f1); NMSImpl.flyingMoveLogic(this, f, f1);
} }
} }
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override
@ -198,7 +197,7 @@ public class SlimeController extends MobEntityController {
if (npc == null) { if (npc == null) {
super.setSize(f, f1); super.setSize(f, f1);
} else { } else {
NMS.setSize(this, f, f1, justCreated); NMSImpl.setSize(this, f, f1, justCreated);
} }
} }
} }

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,10 +10,9 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.BlockPosition; import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.EntitySnowman; import net.minecraft.server.v1_10_R1.EntitySnowman;
@ -43,7 +42,7 @@ public class SnowmanController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
} }
} }
@ -56,12 +55,12 @@ public class SnowmanController extends MobEntityController {
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -123,13 +122,13 @@ public class SnowmanController extends MobEntityController {
if (npc == null || !npc.isFlyable()) { if (npc == null || !npc.isFlyable()) {
super.g(f, f1); super.g(f, f1);
} else { } else {
NMS.flyingMoveLogic(this, f, f1); NMSImpl.flyingMoveLogic(this, f, f1);
} }
} }
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override
@ -186,7 +185,7 @@ public class SnowmanController extends MobEntityController {
if (npc == null) { if (npc == null) {
super.setSize(f, f1); super.setSize(f, f1);
} else { } else {
NMS.setSize(this, f, f1, justCreated); NMSImpl.setSize(this, f, f1, justCreated);
} }
} }
} }

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,10 +10,9 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.BlockPosition; import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.EntitySpider; import net.minecraft.server.v1_10_R1.EntitySpider;
@ -43,7 +42,7 @@ public class SpiderController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
} }
} }
@ -56,12 +55,12 @@ public class SpiderController extends MobEntityController {
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -123,13 +122,13 @@ public class SpiderController extends MobEntityController {
if (npc == null || !npc.isFlyable()) { if (npc == null || !npc.isFlyable()) {
super.g(f, f1); super.g(f, f1);
} else { } else {
NMS.flyingMoveLogic(this, f, f1); NMSImpl.flyingMoveLogic(this, f, f1);
} }
} }
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override
@ -185,7 +184,7 @@ public class SpiderController extends MobEntityController {
if (npc == null) { if (npc == null) {
super.setSize(f, f1); super.setSize(f, f1);
} else { } else {
NMS.setSize(this, f, f1, justCreated); NMSImpl.setSize(this, f, f1, justCreated);
} }
} }

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,10 +10,9 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.BlockPosition; import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.EntitySquid; import net.minecraft.server.v1_10_R1.EntitySquid;
@ -43,7 +42,7 @@ public class SquidController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
} }
} }
@ -56,12 +55,12 @@ public class SquidController extends MobEntityController {
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -123,13 +122,13 @@ public class SquidController extends MobEntityController {
if (npc == null || !npc.isFlyable()) { if (npc == null || !npc.isFlyable()) {
super.g(f, f1); super.g(f, f1);
} else { } else {
NMS.flyingMoveLogic(this, f, f1); NMSImpl.flyingMoveLogic(this, f, f1);
} }
} }
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override
@ -178,7 +177,7 @@ public class SquidController extends MobEntityController {
if (npc == null) { if (npc == null) {
super.setSize(f, f1); super.setSize(f, f1);
} else { } else {
NMS.setSize(this, f, f1, justCreated); NMSImpl.setSize(this, f, f1, justCreated);
} }
} }
} }

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,8 +10,8 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
@ -47,7 +47,7 @@ public class VillagerController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
} }
} }
@ -76,12 +76,12 @@ public class VillagerController extends MobEntityController {
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -144,13 +144,13 @@ public class VillagerController extends MobEntityController {
if (npc == null || !npc.isFlyable()) { if (npc == null || !npc.isFlyable()) {
super.g(f, f1); super.g(f, f1);
} else { } else {
NMS.flyingMoveLogic(this, f, f1); NMSImpl.flyingMoveLogic(this, f, f1);
} }
} }
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override
@ -193,7 +193,7 @@ public class VillagerController extends MobEntityController {
public void M() { public void M() {
super.M(); super.M();
if (npc != null) { if (npc != null) {
NMS.setHeadYaw(this, yaw); NMS.setHeadYaw(getBukkitEntity(), yaw);
npc.update(); npc.update();
} }
} }

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,10 +10,9 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.BlockPosition; import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.EntityWitch; import net.minecraft.server.v1_10_R1.EntityWitch;
@ -43,7 +42,7 @@ public class WitchController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
} }
} }
@ -56,12 +55,12 @@ public class WitchController extends MobEntityController {
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -123,13 +122,13 @@ public class WitchController extends MobEntityController {
if (npc == null || !npc.isFlyable()) { if (npc == null || !npc.isFlyable()) {
super.g(f, f1); super.g(f, f1);
} else { } else {
NMS.flyingMoveLogic(this, f, f1); NMSImpl.flyingMoveLogic(this, f, f1);
} }
} }
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override
@ -185,7 +184,7 @@ public class WitchController extends MobEntityController {
if (npc == null) { if (npc == null) {
super.setSize(f, f1); super.setSize(f, f1);
} else { } else {
NMS.setSize(this, f, f1, justCreated); NMSImpl.setSize(this, f, f1, justCreated);
} }
} }
} }

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,10 +10,9 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.EntityWither; import net.minecraft.server.v1_10_R1.EntityWither;
import net.minecraft.server.v1_10_R1.NBTTagCompound; import net.minecraft.server.v1_10_R1.NBTTagCompound;
@ -41,18 +40,18 @@ public class WitherController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
} }
} }
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -104,7 +103,7 @@ public class WitherController extends MobEntityController {
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,10 +10,9 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.BlockPosition; import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.EntityWolf; import net.minecraft.server.v1_10_R1.EntityWolf;
@ -43,7 +42,7 @@ public class WolfController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
} }
} }
@ -67,12 +66,12 @@ public class WolfController extends MobEntityController {
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -135,13 +134,13 @@ public class WolfController extends MobEntityController {
if (npc == null || !npc.isFlyable()) { if (npc == null || !npc.isFlyable()) {
super.g(f, f1); super.g(f, f1);
} else { } else {
NMS.flyingMoveLogic(this, f, f1); NMSImpl.flyingMoveLogic(this, f, f1);
} }
} }
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity; package net.citizensnpcs.nms.v1_10_R1.entity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -10,10 +10,9 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCEnderTeleportEvent; import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.BlockPosition; import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.EntityZombie; import net.minecraft.server.v1_10_R1.EntityZombie;
@ -43,7 +42,7 @@ public class ZombieController extends MobEntityController {
super(world); super(world);
this.npc = (CitizensNPC) npc; this.npc = (CitizensNPC) npc;
if (npc != null) { if (npc != null) {
NMS.clearGoals(goalSelector, targetSelector); NMSImpl.clearGoals(goalSelector, targetSelector);
} }
} }
@ -56,12 +55,12 @@ public class ZombieController extends MobEntityController {
@Override @Override
protected SoundEffect bV() { protected SoundEffect bV() {
return NMS.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
} }
@Override @Override
protected SoundEffect bW() { protected SoundEffect bW() {
return NMS.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
} }
@Override @Override
@ -123,13 +122,13 @@ public class ZombieController extends MobEntityController {
if (npc == null || !npc.isFlyable()) { if (npc == null || !npc.isFlyable()) {
super.g(f, f1); super.g(f, f1);
} else { } else {
NMS.flyingMoveLogic(this, f, f1); NMSImpl.flyingMoveLogic(this, f, f1);
} }
} }
@Override @Override
protected SoundEffect G() { protected SoundEffect G() {
return NMS.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA); return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
} }
@Override @Override

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -9,8 +9,8 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.EntityAreaEffectCloud; import net.minecraft.server.v1_10_R1.EntityAreaEffectCloud;

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -11,10 +11,10 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.EntityArmorStand; import net.minecraft.server.v1_10_R1.EntityArmorStand;
import net.minecraft.server.v1_10_R1.EntityHuman; import net.minecraft.server.v1_10_R1.EntityHuman;
@ -135,7 +135,7 @@ public class ArmorStandController extends MobEntityController {
if (npc == null) { if (npc == null) {
super.setSize(f, f1); super.setSize(f, f1);
} else { } else {
NMS.setSize(this, f, f1, justCreated); NMSImpl.setSize(this, f, f1, justCreated);
} }
} }
} }

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -9,10 +9,10 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.EntityBoat; import net.minecraft.server.v1_10_R1.EntityBoat;
import net.minecraft.server.v1_10_R1.NBTTagCompound; import net.minecraft.server.v1_10_R1.NBTTagCompound;
@ -109,7 +109,7 @@ public class BoatController extends MobEntityController {
if (npc == null) { if (npc == null) {
super.setSize(f, f1); super.setSize(f, f1);
} else { } else {
NMS.setSize(this, f, f1, justCreated); NMSImpl.setSize(this, f, f1, justCreated);
} }
} }

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -9,10 +9,10 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.EntityDragonFireball; import net.minecraft.server.v1_10_R1.EntityDragonFireball;
import net.minecraft.server.v1_10_R1.NBTTagCompound; import net.minecraft.server.v1_10_R1.NBTTagCompound;
@ -121,7 +121,7 @@ public class DragonFireballController extends MobEntityController {
if (npc == null) { if (npc == null) {
super.setSize(f, f1); super.setSize(f, f1);
} else { } else {
NMS.setSize(this, f, f1, justCreated); NMSImpl.setSize(this, f, f1, justCreated);
} }
} }
} }

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;

View File

@ -1,9 +1,9 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.EntityEnderCrystal; import net.minecraft.server.v1_10_R1.EntityEnderCrystal;

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -9,8 +9,8 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.EntityEnderPearl; import net.minecraft.server.v1_10_R1.EntityEnderPearl;

View File

@ -1,9 +1,9 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.EntityEnderSignal; import net.minecraft.server.v1_10_R1.EntityEnderSignal;

View File

@ -1,9 +1,9 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.EntityExperienceOrb; import net.minecraft.server.v1_10_R1.EntityExperienceOrb;

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
@ -14,10 +14,10 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.AbstractEntityController; import net.citizensnpcs.npc.AbstractEntityController;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.Block; import net.minecraft.server.v1_10_R1.Block;
import net.minecraft.server.v1_10_R1.Blocks; import net.minecraft.server.v1_10_R1.Blocks;
@ -123,7 +123,7 @@ public class FallingBlockController extends AbstractEntityController {
if (npc == null) { if (npc == null) {
super.setSize(f, f1); super.setSize(f, f1);
} else { } else {
NMS.setSize(this, f, f1, justCreated); NMSImpl.setSize(this, f, f1, justCreated);
} }
} }

View File

@ -1,9 +1,9 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.EntityFireworks; import net.minecraft.server.v1_10_R1.EntityFireworks;

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -9,8 +9,8 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.EntityFishingHook; import net.minecraft.server.v1_10_R1.EntityFishingHook;

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
@ -12,8 +12,8 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.BlockPosition; import net.minecraft.server.v1_10_R1.BlockPosition;

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -9,10 +9,10 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.EntityLargeFireball; import net.minecraft.server.v1_10_R1.EntityLargeFireball;
import net.minecraft.server.v1_10_R1.NBTTagCompound; import net.minecraft.server.v1_10_R1.NBTTagCompound;
@ -95,7 +95,7 @@ public class LargeFireballController extends MobEntityController {
if (npc == null) { if (npc == null) {
super.setSize(f, f1); super.setSize(f, f1);
} else { } else {
NMS.setSize(this, f, f1, justCreated); NMSImpl.setSize(this, f, f1, justCreated);
} }
} }

View File

@ -1,9 +1,9 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.EntityLeash; import net.minecraft.server.v1_10_R1.EntityLeash;

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -9,10 +9,10 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.DamageSource; import net.minecraft.server.v1_10_R1.DamageSource;
import net.minecraft.server.v1_10_R1.EntityMinecartChest; import net.minecraft.server.v1_10_R1.EntityMinecartChest;
@ -102,7 +102,7 @@ public class MinecartChestController extends MobEntityController {
public void m() { public void m() {
if (npc != null) { if (npc != null) {
npc.update(); npc.update();
NMS.minecartItemLogic(this); NMSImpl.minecartItemLogic(this);
} else { } else {
super.m(); super.m();
} }

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -9,10 +9,10 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.DamageSource; import net.minecraft.server.v1_10_R1.DamageSource;
import net.minecraft.server.v1_10_R1.EntityMinecartCommandBlock; import net.minecraft.server.v1_10_R1.EntityMinecartCommandBlock;
@ -102,7 +102,7 @@ public class MinecartCommandController extends MobEntityController {
public void m() { public void m() {
if (npc != null) { if (npc != null) {
npc.update(); npc.update();
NMS.minecartItemLogic(this); NMSImpl.minecartItemLogic(this);
} else { } else {
super.m(); super.m();
} }

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -9,10 +9,10 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.DamageSource; import net.minecraft.server.v1_10_R1.DamageSource;
import net.minecraft.server.v1_10_R1.EntityMinecartFurnace; import net.minecraft.server.v1_10_R1.EntityMinecartFurnace;
@ -102,7 +102,7 @@ public class MinecartFurnaceController extends MobEntityController {
public void m() { public void m() {
if (npc != null) { if (npc != null) {
npc.update(); npc.update();
NMS.minecartItemLogic(this); NMSImpl.minecartItemLogic(this);
} else { } else {
super.m(); super.m();
} }

View File

@ -1,14 +1,14 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import org.bukkit.entity.Minecart; import org.bukkit.entity.Minecart;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.DamageSource; import net.minecraft.server.v1_10_R1.DamageSource;
import net.minecraft.server.v1_10_R1.EntityMinecartHopper; import net.minecraft.server.v1_10_R1.EntityMinecartHopper;
@ -90,7 +90,7 @@ public class MinecartHopperController extends MobEntityController {
public void m() { public void m() {
if (npc != null) { if (npc != null) {
npc.update(); npc.update();
NMS.minecartItemLogic(this); NMSImpl.minecartItemLogic(this);
} else { } else {
super.m(); super.m();
} }

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -9,10 +9,10 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.DamageSource; import net.minecraft.server.v1_10_R1.DamageSource;
import net.minecraft.server.v1_10_R1.EntityMinecartRideable; import net.minecraft.server.v1_10_R1.EntityMinecartRideable;
@ -102,7 +102,7 @@ public class MinecartRideableController extends MobEntityController {
public void m() { public void m() {
if (npc != null) { if (npc != null) {
npc.update(); npc.update();
NMS.minecartItemLogic(this); NMSImpl.minecartItemLogic(this);
} else { } else {
super.m(); super.m();
} }

View File

@ -1,14 +1,14 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import org.bukkit.entity.Minecart; import org.bukkit.entity.Minecart;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.DamageSource; import net.minecraft.server.v1_10_R1.DamageSource;
import net.minecraft.server.v1_10_R1.EntityMinecartMobSpawner; import net.minecraft.server.v1_10_R1.EntityMinecartMobSpawner;
@ -90,7 +90,7 @@ public class MinecartSpawnerController extends MobEntityController {
public void m() { public void m() {
if (npc != null) { if (npc != null) {
npc.update(); npc.update();
NMS.minecartItemLogic(this); NMSImpl.minecartItemLogic(this);
} else { } else {
super.m(); super.m();
} }

View File

@ -1,14 +1,14 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import org.bukkit.entity.Minecart; import org.bukkit.entity.Minecart;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.DamageSource; import net.minecraft.server.v1_10_R1.DamageSource;
import net.minecraft.server.v1_10_R1.EntityMinecartTNT; import net.minecraft.server.v1_10_R1.EntityMinecartTNT;
@ -90,7 +90,7 @@ public class MinecartTNTController extends MobEntityController {
public void m() { public void m() {
if (npc != null) { if (npc != null) {
npc.update(); npc.update();
NMS.minecartItemLogic(this); NMSImpl.minecartItemLogic(this);
} else { } else {
super.m(); super.m();
} }

View File

@ -1,9 +1,9 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.EntityPainting; import net.minecraft.server.v1_10_R1.EntityPainting;

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -9,8 +9,8 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.EntityShulkerBullet; import net.minecraft.server.v1_10_R1.EntityShulkerBullet;

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -9,8 +9,8 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.EntitySmallFireball; import net.minecraft.server.v1_10_R1.EntitySmallFireball;

View File

@ -1,9 +1,9 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.EntitySnowball; import net.minecraft.server.v1_10_R1.EntitySnowball;

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -9,8 +9,8 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.EntitySpectralArrow; import net.minecraft.server.v1_10_R1.EntitySpectralArrow;

View File

@ -1,9 +1,9 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.EntityTNTPrimed; import net.minecraft.server.v1_10_R1.EntityTNTPrimed;

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -9,8 +9,8 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.EntityThrownExpBottle; import net.minecraft.server.v1_10_R1.EntityThrownExpBottle;

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -9,8 +9,8 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.EntityPotion; import net.minecraft.server.v1_10_R1.EntityPotion;

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.CraftServer; import org.bukkit.craftbukkit.v1_10_R1.CraftServer;
@ -9,8 +9,8 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.EntityTippedArrow; import net.minecraft.server.v1_10_R1.EntityTippedArrow;

View File

@ -1,9 +1,9 @@
package net.citizensnpcs.npc.entity.nonliving; package net.citizensnpcs.nms.v1_10_R1.entity.nonliving;
import net.citizensnpcs.api.event.NPCPushEvent; import net.citizensnpcs.api.event.NPCPushEvent;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util; import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.EntityWitherSkull; import net.minecraft.server.v1_10_R1.EntityWitherSkull;

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.network; package net.citizensnpcs.nms.v1_10_R1.network;
import io.netty.channel.AbstractChannel; import io.netty.channel.AbstractChannel;
import io.netty.channel.Channel; import io.netty.channel.Channel;

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.network; package net.citizensnpcs.nms.v1_10_R1.network;
import net.minecraft.server.v1_10_R1.EntityPlayer; import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.MinecraftServer; import net.minecraft.server.v1_10_R1.MinecraftServer;

View File

@ -1,15 +1,15 @@
package net.citizensnpcs.npc.network; package net.citizensnpcs.nms.v1_10_R1.network;
import java.io.IOException; import java.io.IOException;
import net.citizensnpcs.util.NMS; import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.minecraft.server.v1_10_R1.EnumProtocolDirection; import net.minecraft.server.v1_10_R1.EnumProtocolDirection;
import net.minecraft.server.v1_10_R1.NetworkManager; import net.minecraft.server.v1_10_R1.NetworkManager;
public class EmptyNetworkManager extends NetworkManager { public class EmptyNetworkManager extends NetworkManager {
public EmptyNetworkManager(EnumProtocolDirection flag) throws IOException { public EmptyNetworkManager(EnumProtocolDirection flag) throws IOException {
super(flag); super(flag);
NMS.initNetworkManager(this); NMSImpl.initNetworkManager(this);
} }
@Override @Override

View File

@ -1,4 +1,4 @@
package net.citizensnpcs.npc.network; package net.citizensnpcs.nms.v1_10_R1.network;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,135 @@
package net.citizensnpcs.nms.v1_10_R1.util;
import java.util.EnumMap;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.metadata.FixedMetadataValue;
import org.bukkit.scheduler.BukkitRunnable;
import com.google.common.collect.Maps;
import net.citizensnpcs.api.CitizensAPI;
import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.trait.ArmorStandTrait;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.PlayerAnimation;
import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.EnumHand;
import net.minecraft.server.v1_10_R1.Packet;
import net.minecraft.server.v1_10_R1.PacketPlayOutAnimation;
import net.minecraft.server.v1_10_R1.PacketPlayOutBed;
import net.minecraft.server.v1_10_R1.PacketPlayOutEntityMetadata;
public class PlayerAnimationImpl {
public static void play(PlayerAnimation animation, Player bplayer, int radius) {
// TODO: this is pretty gross
final EntityPlayer player = (EntityPlayer) NMSImpl.getHandle(bplayer);
if (DEFAULTS.containsKey(animation)) {
playDefaultAnimation(player, radius, DEFAULTS.get(animation));
return;
}
switch (animation) {
case SIT:
player.getBukkitEntity().setMetadata("citizens.sitting",
new FixedMetadataValue(CitizensAPI.getPlugin(), true));
final NPC holder = CitizensAPI.getNPCRegistry().createNPC(EntityType.ARMOR_STAND, "");
holder.spawn(player.getBukkitEntity().getLocation());
ArmorStandTrait trait = holder.getTrait(ArmorStandTrait.class);
trait.setGravity(false);
trait.setHasArms(false);
trait.setHasBaseplate(false);
trait.setSmall(true);
trait.setMarker(true);
trait.setVisible(false);
holder.getTrait(ArmorStandTrait.class).setVisible(false);
holder.data().set(NPC.NAMEPLATE_VISIBLE_METADATA, false);
holder.data().set(NPC.DEFAULT_PROTECTED_METADATA, true);
new BukkitRunnable() {
@Override
public void cancel() {
super.cancel();
holder.destroy();
}
@Override
public void run() {
if (player.dead || !player.valid
|| !player.getBukkitEntity().getMetadata("citizens.sitting").get(0).asBoolean()) {
cancel();
return;
}
if (player instanceof NPCHolder && !((NPCHolder) player).getNPC().isSpawned()) {
cancel();
return;
}
if (!NMS.getPassengers(holder.getEntity()).contains(player.getBukkitEntity())) {
NMS.mount(holder.getEntity(), player.getBukkitEntity());
}
}
}.runTaskTimer(CitizensAPI.getPlugin(), 0, 1);
break;
case SLEEP:
PacketPlayOutBed packet = new PacketPlayOutBed(player,
new BlockPosition((int) player.locX, (int) player.locY, (int) player.locZ));
sendPacketNearby(packet, player, radius);
break;
case SNEAK:
player.getBukkitEntity().setSneaking(true);
sendPacketNearby(new PacketPlayOutEntityMetadata(player.getId(), player.getDataWatcher(), true), player,
radius);
break;
case START_USE_MAINHAND_ITEM:
player.c(EnumHand.MAIN_HAND);
sendPacketNearby(new PacketPlayOutEntityMetadata(player.getId(), player.getDataWatcher(), true), player,
radius);
break;
case START_USE_OFFHAND_ITEM:
player.c(EnumHand.OFF_HAND);
sendPacketNearby(new PacketPlayOutEntityMetadata(player.getId(), player.getDataWatcher(), true), player,
radius);
break;
case STOP_SITTING:
player.getBukkitEntity().setMetadata("citizens.sitting",
new FixedMetadataValue(CitizensAPI.getPlugin(), false));
NMS.mount(player.getBukkitEntity(), null);
break;
case STOP_SLEEPING:
playDefaultAnimation(player, radius, 2);
break;
case STOP_SNEAKING:
player.getBukkitEntity().setSneaking(false);
sendPacketNearby(new PacketPlayOutEntityMetadata(player.getId(), player.getDataWatcher(), true), player,
radius);
break;
case STOP_USE_ITEM:
player.cA();
sendPacketNearby(new PacketPlayOutEntityMetadata(player.getId(), player.getDataWatcher(), true), player,
radius);
break;
default:
break;
}
}
protected static void playDefaultAnimation(EntityPlayer player, int radius, int code) {
PacketPlayOutAnimation packet = new PacketPlayOutAnimation(player, code);
sendPacketNearby(packet, player, radius);
}
protected static void sendPacketNearby(Packet<?> packet, EntityPlayer player, int radius) {
NMSImpl.sendPacketNearby(player.getBukkitEntity(), player.getBukkitEntity().getLocation(), packet, radius);
}
private static EnumMap<PlayerAnimation, Integer> DEFAULTS = Maps.newEnumMap(PlayerAnimation.class);
static {
DEFAULTS.put(PlayerAnimation.ARM_SWING, 0);
DEFAULTS.put(PlayerAnimation.HURT, 1);
DEFAULTS.put(PlayerAnimation.EAT_FOOD, 2);
DEFAULTS.put(PlayerAnimation.ARM_SWING_OFFHAND, 3);
DEFAULTS.put(PlayerAnimation.CRIT, 4);
DEFAULTS.put(PlayerAnimation.MAGIC_CRIT, 5);
}
}

View File

@ -1,6 +1,6 @@
package net.citizensnpcs.util.nms; package net.citizensnpcs.nms.v1_10_R1.util;
import net.citizensnpcs.npc.entity.EntityHumanNPC; import net.citizensnpcs.nms.v1_10_R1.entity.EntityHumanNPC;
public class PlayerControllerJump { public class PlayerControllerJump {
private final EntityHumanNPC a; private final EntityHumanNPC a;

View File

@ -1,6 +1,6 @@
package net.citizensnpcs.util.nms; package net.citizensnpcs.nms.v1_10_R1.util;
import net.citizensnpcs.npc.entity.EntityHumanNPC; import net.citizensnpcs.nms.v1_10_R1.entity.EntityHumanNPC;
import net.minecraft.server.v1_10_R1.Entity; import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityLiving; import net.minecraft.server.v1_10_R1.EntityLiving;
import net.minecraft.server.v1_10_R1.MathHelper; import net.minecraft.server.v1_10_R1.MathHelper;

View File

@ -1,8 +1,8 @@
package net.citizensnpcs.util.nms; package net.citizensnpcs.nms.v1_10_R1.util;
import java.util.Random; import java.util.Random;
import net.citizensnpcs.npc.entity.EntityHumanNPC; import net.citizensnpcs.nms.v1_10_R1.entity.EntityHumanNPC;
import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.NMS;
import net.minecraft.server.v1_10_R1.AttributeInstance; import net.minecraft.server.v1_10_R1.AttributeInstance;
import net.minecraft.server.v1_10_R1.ControllerMove; import net.minecraft.server.v1_10_R1.ControllerMove;
@ -86,7 +86,7 @@ public class PlayerControllerMove extends ControllerMove {
return; return;
float f = (float) Math.toDegrees(Math.atan2(d1, d0)) - 90.0F; float f = (float) Math.toDegrees(Math.atan2(d1, d0)) - 90.0F;
this.a.yaw = a(this.a.yaw, f, 30.0F); this.a.yaw = a(this.a.yaw, f, 30.0F);
NMS.setHeadYaw(a, this.a.yaw); NMS.setHeadYaw(a.getBukkitEntity(), this.a.yaw);
AttributeInstance speed = this.a.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED); AttributeInstance speed = this.a.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
speed.setValue(0.1D * this.e); speed.setValue(0.1D * this.e);
float movement = (float) (this.e * speed.getValue()) * 10; float movement = (float) (this.e * speed.getValue()) * 10;

View File

@ -1,6 +1,6 @@
package net.citizensnpcs.util.nms; package net.citizensnpcs.nms.v1_10_R1.util;
import net.citizensnpcs.npc.entity.EntityHumanNPC; import net.citizensnpcs.nms.v1_10_R1.entity.EntityHumanNPC;
import net.minecraft.server.v1_10_R1.AttributeInstance; import net.minecraft.server.v1_10_R1.AttributeInstance;
import net.minecraft.server.v1_10_R1.AxisAlignedBB; import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.Block; import net.minecraft.server.v1_10_R1.Block;

View File

@ -1,9 +1,9 @@
package net.citizensnpcs.util.nms; package net.citizensnpcs.nms.v1_10_R1.util;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import net.citizensnpcs.npc.entity.EntityHumanNPC; import net.citizensnpcs.nms.v1_10_R1.entity.EntityHumanNPC;
import net.minecraft.server.v1_10_R1.BlockPosition; import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.Entity; import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.IBlockAccess; import net.minecraft.server.v1_10_R1.IBlockAccess;

View File

@ -1,6 +1,6 @@
package net.citizensnpcs.util.nms; package net.citizensnpcs.nms.v1_10_R1.util;
import net.citizensnpcs.npc.entity.EntityHumanNPC; import net.citizensnpcs.nms.v1_10_R1.entity.EntityHumanNPC;
import net.minecraft.server.v1_10_R1.EntityInsentient; import net.minecraft.server.v1_10_R1.EntityInsentient;
import net.minecraft.server.v1_10_R1.IBlockAccess; import net.minecraft.server.v1_10_R1.IBlockAccess;
import net.minecraft.server.v1_10_R1.MathHelper; import net.minecraft.server.v1_10_R1.MathHelper;

View File

@ -1,9 +1,9 @@
package net.citizensnpcs.util.nms; package net.citizensnpcs.nms.v1_10_R1.util;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.HashSet; import java.util.HashSet;
import net.citizensnpcs.npc.entity.EntityHumanNPC; import net.citizensnpcs.nms.v1_10_R1.entity.EntityHumanNPC;
import net.minecraft.server.v1_10_R1.AxisAlignedBB; import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.Block; import net.minecraft.server.v1_10_R1.Block;
import net.minecraft.server.v1_10_R1.BlockCobbleWall; import net.minecraft.server.v1_10_R1.BlockCobbleWall;

View File

@ -1,10 +1,10 @@
package net.citizensnpcs.util.nms; package net.citizensnpcs.nms.v1_10_R1.util;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import net.citizensnpcs.npc.entity.EntityHumanNPC; import net.citizensnpcs.nms.v1_10_R1.entity.EntityHumanNPC;
import net.citizensnpcs.npc.skin.SkinnableEntity; import net.citizensnpcs.npc.skin.SkinnableEntity;
import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.NMS;
import net.minecraft.server.v1_10_R1.Entity; import net.minecraft.server.v1_10_R1.Entity;

View File

@ -2,6 +2,7 @@ package net.citizensnpcs.npc;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.NMS;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;

View File

@ -200,7 +200,7 @@ public class CitizensNPC extends AbstractNPC {
// send skin packets, if applicable, before other NMS packets are sent // send skin packets, if applicable, before other NMS packets are sent
if (couldSpawn) { if (couldSpawn) {
SkinnableEntity skinnable = NMS.getSkinnable(getEntity()); SkinnableEntity skinnable = getEntity() instanceof SkinnableEntity ? ((SkinnableEntity) getEntity()) : null;
if (skinnable != null) { if (skinnable != null) {
skinnable.getSkinTracker().onSpawnNPC(); skinnable.getSkinTracker().onSpawnNPC();
} }
@ -254,7 +254,7 @@ public class CitizensNPC extends AbstractNPC {
entity.setRemoveWhenFarAway(false); entity.setRemoveWhenFarAway(false);
if (NMS.getStepHeight(entity) < 1) { if (NMS.getStepHeight(entity) < 1) {
NMS.setStepHeight(NMS.getHandle(entity), 1); NMS.setStepHeight(entity, 1);
} }
if (getEntity() instanceof Player) { if (getEntity() instanceof Player) {

View File

@ -123,8 +123,7 @@ public class CitizensNPCRegistry implements NPCRegistry {
return null; return null;
if (entity instanceof NPCHolder) if (entity instanceof NPCHolder)
return ((NPCHolder) entity).getNPC(); return ((NPCHolder) entity).getNPC();
Object handle = NMS.getHandle(entity); return NMS.getNPC(entity);
return handle instanceof NPCHolder ? ((NPCHolder) handle).getNPC() : null;
} }
@Override @Override

View File

@ -7,73 +7,6 @@ import org.bukkit.entity.EntityType;
import com.google.common.base.Throwables; import com.google.common.base.Throwables;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import net.citizensnpcs.npc.entity.BatController;
import net.citizensnpcs.npc.entity.BlazeController;
import net.citizensnpcs.npc.entity.CaveSpiderController;
import net.citizensnpcs.npc.entity.ChickenController;
import net.citizensnpcs.npc.entity.CowController;
import net.citizensnpcs.npc.entity.CreeperController;
import net.citizensnpcs.npc.entity.EnderDragonController;
import net.citizensnpcs.npc.entity.EndermanController;
import net.citizensnpcs.npc.entity.EndermiteController;
import net.citizensnpcs.npc.entity.GhastController;
import net.citizensnpcs.npc.entity.GiantController;
import net.citizensnpcs.npc.entity.GuardianController;
import net.citizensnpcs.npc.entity.HorseController;
import net.citizensnpcs.npc.entity.HumanController;
import net.citizensnpcs.npc.entity.IronGolemController;
import net.citizensnpcs.npc.entity.MagmaCubeController;
import net.citizensnpcs.npc.entity.MushroomCowController;
import net.citizensnpcs.npc.entity.OcelotController;
import net.citizensnpcs.npc.entity.PigController;
import net.citizensnpcs.npc.entity.PigZombieController;
import net.citizensnpcs.npc.entity.PolarBearController;
import net.citizensnpcs.npc.entity.RabbitController;
import net.citizensnpcs.npc.entity.SheepController;
import net.citizensnpcs.npc.entity.ShulkerController;
import net.citizensnpcs.npc.entity.SilverfishController;
import net.citizensnpcs.npc.entity.SkeletonController;
import net.citizensnpcs.npc.entity.SlimeController;
import net.citizensnpcs.npc.entity.SnowmanController;
import net.citizensnpcs.npc.entity.SpiderController;
import net.citizensnpcs.npc.entity.SquidController;
import net.citizensnpcs.npc.entity.VillagerController;
import net.citizensnpcs.npc.entity.WitchController;
import net.citizensnpcs.npc.entity.WitherController;
import net.citizensnpcs.npc.entity.WolfController;
import net.citizensnpcs.npc.entity.ZombieController;
import net.citizensnpcs.npc.entity.nonliving.AreaEffectCloudController;
import net.citizensnpcs.npc.entity.nonliving.ArmorStandController;
import net.citizensnpcs.npc.entity.nonliving.BoatController;
import net.citizensnpcs.npc.entity.nonliving.DragonFireballController;
import net.citizensnpcs.npc.entity.nonliving.EggController;
import net.citizensnpcs.npc.entity.nonliving.EnderCrystalController;
import net.citizensnpcs.npc.entity.nonliving.EnderPearlController;
import net.citizensnpcs.npc.entity.nonliving.EnderSignalController;
import net.citizensnpcs.npc.entity.nonliving.FallingBlockController;
import net.citizensnpcs.npc.entity.nonliving.FireworkController;
import net.citizensnpcs.npc.entity.nonliving.FishingHookController;
import net.citizensnpcs.npc.entity.nonliving.ItemController;
import net.citizensnpcs.npc.entity.nonliving.ItemFrameController;
import net.citizensnpcs.npc.entity.nonliving.LargeFireballController;
import net.citizensnpcs.npc.entity.nonliving.LeashController;
import net.citizensnpcs.npc.entity.nonliving.MinecartChestController;
import net.citizensnpcs.npc.entity.nonliving.MinecartCommandController;
import net.citizensnpcs.npc.entity.nonliving.MinecartFurnaceController;
import net.citizensnpcs.npc.entity.nonliving.MinecartHopperController;
import net.citizensnpcs.npc.entity.nonliving.MinecartRideableController;
import net.citizensnpcs.npc.entity.nonliving.MinecartTNTController;
import net.citizensnpcs.npc.entity.nonliving.PaintingController;
import net.citizensnpcs.npc.entity.nonliving.ShulkerBulletController;
import net.citizensnpcs.npc.entity.nonliving.SmallFireballController;
import net.citizensnpcs.npc.entity.nonliving.SnowballController;
import net.citizensnpcs.npc.entity.nonliving.SpectralArrowController;
import net.citizensnpcs.npc.entity.nonliving.TNTPrimedController;
import net.citizensnpcs.npc.entity.nonliving.ThrownExpBottleController;
import net.citizensnpcs.npc.entity.nonliving.ThrownPotionController;
import net.citizensnpcs.npc.entity.nonliving.TippedArrowController;
import net.citizensnpcs.npc.entity.nonliving.WitherSkullController;
public class EntityControllers { public class EntityControllers {
public static boolean controllerExistsForType(EntityType type) { public static boolean controllerExistsForType(EntityType type) {
return TYPES.containsKey(type); return TYPES.containsKey(type);
@ -96,75 +29,4 @@ public class EntityControllers {
} }
private static final Map<EntityType, Class<? extends EntityController>> TYPES = Maps.newEnumMap(EntityType.class); private static final Map<EntityType, Class<? extends EntityController>> TYPES = Maps.newEnumMap(EntityType.class);
static {
TYPES.put(EntityType.AREA_EFFECT_CLOUD, AreaEffectCloudController.class);
TYPES.put(EntityType.ARROW, TippedArrowController.class);
TYPES.put(EntityType.ARMOR_STAND, ArmorStandController.class);
TYPES.put(EntityType.BAT, BatController.class);
TYPES.put(EntityType.BLAZE, BlazeController.class);
TYPES.put(EntityType.BOAT, BoatController.class);
TYPES.put(EntityType.CAVE_SPIDER, CaveSpiderController.class);
TYPES.put(EntityType.CHICKEN, ChickenController.class);
TYPES.put(EntityType.COW, CowController.class);
TYPES.put(EntityType.CREEPER, CreeperController.class);
TYPES.put(EntityType.DRAGON_FIREBALL, DragonFireballController.class);
TYPES.put(EntityType.DROPPED_ITEM, ItemController.class);
TYPES.put(EntityType.EGG, EggController.class);
TYPES.put(EntityType.ENDER_CRYSTAL, EnderCrystalController.class);
TYPES.put(EntityType.ENDER_DRAGON, EnderDragonController.class);
TYPES.put(EntityType.ENDER_PEARL, EnderPearlController.class);
TYPES.put(EntityType.ENDER_SIGNAL, EnderSignalController.class);
TYPES.put(EntityType.ENDERMAN, EndermanController.class);
TYPES.put(EntityType.ENDERMITE, EndermiteController.class);
TYPES.put(EntityType.FALLING_BLOCK, FallingBlockController.class);
TYPES.put(EntityType.FIREWORK, FireworkController.class);
TYPES.put(EntityType.FIREBALL, LargeFireballController.class);
TYPES.put(EntityType.FISHING_HOOK, FishingHookController.class);
TYPES.put(EntityType.GHAST, GhastController.class);
TYPES.put(EntityType.GIANT, GiantController.class);
TYPES.put(EntityType.GUARDIAN, GuardianController.class);
TYPES.put(EntityType.HORSE, HorseController.class);
TYPES.put(EntityType.IRON_GOLEM, IronGolemController.class);
TYPES.put(EntityType.ITEM_FRAME, ItemFrameController.class);
TYPES.put(EntityType.LEASH_HITCH, LeashController.class);
TYPES.put(EntityType.LINGERING_POTION, ThrownPotionController.class);
TYPES.put(EntityType.MAGMA_CUBE, MagmaCubeController.class);
TYPES.put(EntityType.MINECART, MinecartRideableController.class);
TYPES.put(EntityType.MINECART_CHEST, MinecartChestController.class);
TYPES.put(EntityType.MINECART_COMMAND, MinecartCommandController.class);
TYPES.put(EntityType.MINECART_FURNACE, MinecartFurnaceController.class);
TYPES.put(EntityType.MINECART_HOPPER, MinecartHopperController.class);
TYPES.put(EntityType.MINECART_TNT, MinecartTNTController.class);
TYPES.put(EntityType.MUSHROOM_COW, MushroomCowController.class);
TYPES.put(EntityType.OCELOT, OcelotController.class);
TYPES.put(EntityType.PAINTING, PaintingController.class);
TYPES.put(EntityType.PIG, PigController.class);
TYPES.put(EntityType.PIG_ZOMBIE, PigZombieController.class);
TYPES.put(EntityType.POLAR_BEAR, PolarBearController.class);
TYPES.put(EntityType.PLAYER, HumanController.class);
TYPES.put(EntityType.RABBIT, RabbitController.class);
TYPES.put(EntityType.SHEEP, SheepController.class);
TYPES.put(EntityType.SHULKER, ShulkerController.class);
TYPES.put(EntityType.SHULKER_BULLET, ShulkerBulletController.class);
TYPES.put(EntityType.SILVERFISH, SilverfishController.class);
TYPES.put(EntityType.SKELETON, SkeletonController.class);
TYPES.put(EntityType.SLIME, SlimeController.class);
TYPES.put(EntityType.SMALL_FIREBALL, SmallFireballController.class);
TYPES.put(EntityType.SNOWBALL, SnowballController.class);
TYPES.put(EntityType.SNOWMAN, SnowmanController.class);
TYPES.put(EntityType.SPECTRAL_ARROW, SpectralArrowController.class);
TYPES.put(EntityType.SPIDER, SpiderController.class);
TYPES.put(EntityType.SPLASH_POTION, ThrownPotionController.class);
TYPES.put(EntityType.SQUID, SquidController.class);
TYPES.put(EntityType.TIPPED_ARROW, TippedArrowController.class);
TYPES.put(EntityType.THROWN_EXP_BOTTLE, ThrownExpBottleController.class);
TYPES.put(EntityType.PRIMED_TNT, TNTPrimedController.class);
TYPES.put(EntityType.VILLAGER, VillagerController.class);
TYPES.put(EntityType.WOLF, WolfController.class);
TYPES.put(EntityType.WITCH, WitchController.class);
TYPES.put(EntityType.WITHER, WitherController.class);
TYPES.put(EntityType.WITHER_SKULL, WitherSkullController.class);
TYPES.put(EntityType.ZOMBIE, ZombieController.class);
}
} }

View File

@ -279,7 +279,7 @@ public class CitizensNavigator implements Navigator, Runnable {
private void updateMountedStatus() { private void updateMountedStatus() {
if (!isNavigating()) if (!isNavigating())
return; return;
Entity vehicle = NMS.getBukkitVehicle(npc.getEntity()); Entity vehicle = NMS.getVehicle(npc.getEntity());
if (!(vehicle instanceof NPCHolder)) if (!(vehicle instanceof NPCHolder))
return; return;
NPC mount = ((NPCHolder) vehicle).getNPC(); NPC mount = ((NPCHolder) vehicle).getNPC();

View File

@ -2,6 +2,7 @@ package net.citizensnpcs.npc.ai;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import net.citizensnpcs.Settings.Setting; import net.citizensnpcs.Settings.Setting;
@ -16,7 +17,7 @@ import net.citizensnpcs.api.astar.pathfinder.Path;
import net.citizensnpcs.api.astar.pathfinder.VectorGoal; import net.citizensnpcs.api.astar.pathfinder.VectorGoal;
import net.citizensnpcs.api.astar.pathfinder.VectorNode; import net.citizensnpcs.api.astar.pathfinder.VectorNode;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.NMS;
public class FlyingAStarNavigationStrategy extends AbstractPathStrategy { public class FlyingAStarNavigationStrategy extends AbstractPathStrategy {
private final NPC npc; private final NPC npc;
@ -93,13 +94,13 @@ public class FlyingAStarNavigationStrategy extends AbstractPathStrategy {
motY += (Math.signum(d1) * 0.7D - motY) * 0.1; motY += (Math.signum(d1) * 0.7D - motY) * 0.1;
motZ += (Math.signum(d2) * 0.5D - motZ) * 0.1; motZ += (Math.signum(d2) * 0.5D - motZ) * 0.1;
float targetYaw = (float) (Math.atan2(motZ, motX) * 180.0D / Math.PI) - 90.0F; float targetYaw = (float) (Math.atan2(motZ, motX) * 180.0D / Math.PI) - 90.0F;
float normalisedTargetYaw = (targetYaw - current.getYaw()) % 360; float normalisedTargetYaw = (targetYaw - current.getYaw()) % 360;
if (normalisedTargetYaw >= 180.0F) { if (normalisedTargetYaw >= 180.0F) {
normalisedTargetYaw -= 360.0F; normalisedTargetYaw -= 360.0F;
} }
if (normalisedTargetYaw < -180.0F) { if (normalisedTargetYaw < -180.0F) {
normalisedTargetYaw += 360.0F; normalisedTargetYaw += 360.0F;
} }
velocity.setX(motX).setY(motY).setZ(motZ).multiply(parameters.speed()); velocity.setX(motX).setY(motY).setZ(motZ).multiply(parameters.speed());
npc.getEntity().setVelocity(velocity); npc.getEntity().setVelocity(velocity);
@ -107,8 +108,9 @@ public class FlyingAStarNavigationStrategy extends AbstractPathStrategy {
NMS.setVerticalMovement(npc.getEntity(), 0.5); NMS.setVerticalMovement(npc.getEntity(), 0.5);
if (npc.getEntity().getType() != EntityType.ENDER_DRAGON) { if (npc.getEntity().getType() != EntityType.ENDER_DRAGON) {
float newYaw = current.getYaw() + normalisedTargetYaw; float newYaw = current.getYaw() + normalisedTargetYaw;
NMS.setHeadYaw(NMS.getHandle(npc.getEntity()), newYaw); current.setYaw(newYaw);
NMS.getHandle(npc.getEntity()).yaw = newYaw; NMS.setHeadYaw(npc.getEntity(), newYaw);
npc.teleport(current, TeleportCause.PLUGIN);
} }
parameters.run(); parameters.run();
plan.run(npc); plan.run(npc);

View File

@ -7,15 +7,11 @@ import net.citizensnpcs.api.ai.NavigatorParameters;
import net.citizensnpcs.api.ai.TargetType; import net.citizensnpcs.api.ai.TargetType;
import net.citizensnpcs.api.ai.event.CancelReason; import net.citizensnpcs.api.ai.event.CancelReason;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.api.util.Messaging;
import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.NMS;
import net.minecraft.server.v1_10_R1.EntityHorse;
import net.minecraft.server.v1_10_R1.NavigationAbstract;
public class MCNavigationStrategy extends AbstractPathStrategy { public class MCNavigationStrategy extends AbstractPathStrategy {
private final Entity handle; private final Entity handle;
private float lastSpeed; private final MCNavigator navigator;
private final NavigationAbstract navigation;
private final NavigatorParameters parameters; private final NavigatorParameters parameters;
private final Location target; private final Location target;
@ -23,24 +19,8 @@ public class MCNavigationStrategy extends AbstractPathStrategy {
super(TargetType.LOCATION); super(TargetType.LOCATION);
this.target = dest; this.target = dest;
this.parameters = params; this.parameters = params;
this.lastSpeed = parameters.speed();
handle = npc.getEntity(); handle = npc.getEntity();
net.minecraft.server.v1_10_R1.Entity raw = NMS.getHandle(handle); this.navigator = NMS.getTargetNavigator(npc.getEntity(), dest, params);
raw.onGround = true;
// not sure of a better way around this - if onGround is false, then
// navigation won't execute, and calling entity.move doesn't
// entirely fix the problem.
navigation = NMS.getNavigation(npc.getEntity());
float oldWidth = raw.width;
if (raw instanceof EntityHorse) {
raw.width = Math.min(0.99f, oldWidth);
}
navigation.a(dest.getX(), dest.getY(), dest.getZ(), parameters.speed());
raw.width = oldWidth; // minecraft requires that an entity fit onto both blocks if width >= 1f, but we'd
// prefer to make it just fit on 1 so hack around it a bit.
if (NMS.isNavigationFinished(navigation)) {
setCancelReason(CancelReason.STUCK);
}
} }
private double distanceSquared() { private double distanceSquared() {
@ -59,7 +39,7 @@ public class MCNavigationStrategy extends AbstractPathStrategy {
@Override @Override
public void stop() { public void stop() {
NMS.stopNavigation(navigation); navigator.stop();
} }
@Override @Override
@ -69,20 +49,26 @@ public class MCNavigationStrategy extends AbstractPathStrategy {
@Override @Override
public boolean update() { public boolean update() {
if (navigator.getCancelReason() != null) {
setCancelReason(navigator.getCancelReason());
}
if (getCancelReason() != null) if (getCancelReason() != null)
return true; return true;
if (parameters.speed() != lastSpeed) { boolean wasFinished = navigator.update();
Messaging.debug("Repathfinding " + ((NPCHolder) handle).getNPC().getId() + " due to speed change");
navigation.a(target.getX(), target.getY(), target.getZ(), parameters.speed());
lastSpeed = parameters.speed();
}
navigation.a(parameters.speed());
parameters.run(); parameters.run();
if (distanceSquared() < parameters.distanceMargin()) { if (distanceSquared() < parameters.distanceMargin()) {
stop(); stop();
return true; return true;
} }
return NMS.isNavigationFinished(navigation); return wasFinished;
}
public static interface MCNavigator {
CancelReason getCancelReason();
void stop();
boolean update();
} }
private static final Location HANDLE_LOCATION = new Location(null, 0, 0, 0); private static final Location HANDLE_LOCATION = new Location(null, 0, 0, 0);

View File

@ -12,7 +12,6 @@ import net.citizensnpcs.api.ai.event.CancelReason;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.util.BoundingBox; import net.citizensnpcs.util.BoundingBox;
import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.NMS;
import net.minecraft.server.v1_10_R1.NavigationAbstract;
public class MCTargetStrategy implements PathStrategy, EntityTarget { public class MCTargetStrategy implements PathStrategy, EntityTarget {
private final boolean aggro; private final boolean aggro;
@ -30,9 +29,8 @@ public class MCTargetStrategy implements PathStrategy, EntityTarget {
this.parameters = params; this.parameters = params;
this.handle = npc.getEntity(); this.handle = npc.getEntity();
this.target = target; this.target = target;
NavigationAbstract nav = NMS.getNavigation(npc.getEntity()); TargetNavigator nav = NMS.getTargetNavigator(npc.getEntity(), target, params);
this.targetNavigator = nav != null && !params.useNewPathfinder() ? new NavigationFieldWrapper(nav) this.targetNavigator = nav != null && !params.useNewPathfinder() ? nav : new AStarTargeter();
: new AStarTargeter();
this.aggro = aggro; this.aggro = aggro;
} }
@ -174,37 +172,7 @@ public class MCTargetStrategy implements PathStrategy, EntityTarget {
} }
} }
private class NavigationFieldWrapper implements TargetNavigator { public static interface TargetNavigator {
private final NavigationAbstract navigation;
private NavigationFieldWrapper(NavigationAbstract navigation) {
this.navigation = navigation;
}
@Override
public void setPath() {
Location location = parameters.entityTargetLocationMapper().apply(target);
if (location == null) {
throw new IllegalStateException("mapper should not return null");
}
Location oldLoc = target.getLocation(HANDLE_LOCATION);
target.teleport(location);
NMS.setNavigationTarget(handle, target, parameters.speed());
target.teleport(oldLoc);
}
@Override
public void stop() {
NMS.stopNavigation(navigation);
}
@Override
public void update() {
NMS.updateNavigation(navigation);
}
}
private static interface TargetNavigator {
void setPath(); void setPath();
void stop(); void stop();

View File

@ -28,7 +28,7 @@ import net.citizensnpcs.Settings;
import net.citizensnpcs.api.CitizensAPI; import net.citizensnpcs.api.CitizensAPI;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.api.npc.NPCRegistry; import net.citizensnpcs.api.npc.NPCRegistry;
import net.citizensnpcs.util.NMS; import net.citizensnpcs.util.Util;
/** /**
* Tracks skin updates for players. * Tracks skin updates for players.
@ -90,10 +90,10 @@ public class SkinUpdateTracker {
double deltaX = skinLoc.getX() - playerLoc.getX(); double deltaX = skinLoc.getX() - playerLoc.getX();
double deltaZ = skinLoc.getZ() - playerLoc.getZ(); double deltaZ = skinLoc.getZ() - playerLoc.getZ();
double angle = Math.atan2(deltaX, deltaZ); double angle = Math.atan2(deltaX, deltaZ);
float skinYaw = NMS.clampYaw(-(float) Math.toDegrees(angle)); float skinYaw = Util.clampYaw(-(float) Math.toDegrees(angle));
float playerYaw = NMS.clampYaw(playerLoc.getYaw()); float playerYaw = Util.clampYaw(playerLoc.getYaw());
float upperBound = NMS.clampYaw(playerYaw + FIELD_OF_VIEW); float upperBound = Util.clampYaw(playerYaw + FIELD_OF_VIEW);
float lowerBound = NMS.clampYaw(playerYaw - FIELD_OF_VIEW); float lowerBound = Util.clampYaw(playerYaw - FIELD_OF_VIEW);
if (upperBound == -180.0 && playerYaw > 0) { if (upperBound == -180.0 && playerYaw > 0) {
upperBound = 0; upperBound = 0;
} }
@ -156,7 +156,7 @@ public class SkinUpdateTracker {
if (entity == null) if (entity == null)
return null; return null;
return NMS.getSkinnable(entity); return entity instanceof SkinnableEntity ? (SkinnableEntity) entity : null;
} }
// get a players tracker, create new one if not exists. // get a players tracker, create new one if not exists.
@ -411,10 +411,10 @@ public class SkinUpdateTracker {
player.getLocation(this.location); player.getLocation(this.location);
if (rotationCount < 3) { if (rotationCount < 3) {
float rotationDegrees = Settings.Setting.NPC_SKIN_ROTATION_UPDATE_DEGREES.asFloat(); float rotationDegrees = Settings.Setting.NPC_SKIN_ROTATION_UPDATE_DEGREES.asFloat();
float yaw = NMS.clampYaw(this.location.getYaw()); float yaw = Util.clampYaw(this.location.getYaw());
this.startYaw = yaw; this.startYaw = yaw;
this.upperBound = NMS.clampYaw(yaw + rotationDegrees); this.upperBound = Util.clampYaw(yaw + rotationDegrees);
this.lowerBound = NMS.clampYaw(yaw - rotationDegrees); this.lowerBound = Util.clampYaw(yaw - rotationDegrees);
if (upperBound == -180.0 && startYaw > 0) { if (upperBound == -180.0 && startYaw > 0) {
upperBound = 0; upperBound = 0;
} }
@ -430,7 +430,7 @@ public class SkinUpdateTracker {
} }
if (rotationCount < 3) { if (rotationCount < 3) {
float yaw = NMS.clampYaw(currentLoc.getYaw()); float yaw = Util.clampYaw(currentLoc.getYaw());
boolean hasRotated; boolean hasRotated;
if (startYaw - 90 < -180 || startYaw + 90 > 180) { if (startYaw - 90 < -180 || startYaw + 90 > 180) {
hasRotated = yaw > lowerBound && yaw < upperBound; hasRotated = yaw > lowerBound && yaw < upperBound;

View File

@ -6,7 +6,6 @@ import org.bukkit.util.Vector;
import net.citizensnpcs.api.persistence.Persist; import net.citizensnpcs.api.persistence.Persist;
import net.citizensnpcs.api.trait.Trait; import net.citizensnpcs.api.trait.Trait;
import net.citizensnpcs.api.trait.TraitName; import net.citizensnpcs.api.trait.TraitName;
import net.citizensnpcs.npc.entity.EntityHumanNPC.PlayerNPC;
@TraitName("gravity") @TraitName("gravity")
public class Gravity extends Trait implements Toggleable { public class Gravity extends Trait implements Toggleable {
@ -21,12 +20,15 @@ public class Gravity extends Trait implements Toggleable {
enabled = gravitate; enabled = gravitate;
} }
public boolean hasGravity() {
return enabled;
}
@Override @Override
public void run() { public void run() {
if (!npc.isSpawned()) if (!npc.isSpawned())
return; return;
if (npc.getEntity() instanceof Player) { if (npc.getEntity() instanceof Player) {
((PlayerNPC) npc.getEntity()).setGravityEnabled(!enabled);
return; return;
} }
if (!enabled || npc.getNavigator().isNavigating()) if (!enabled || npc.getNavigator().isNavigating())

View File

@ -4,7 +4,6 @@ import net.citizensnpcs.api.persistence.Persist;
import net.citizensnpcs.api.trait.Trait; import net.citizensnpcs.api.trait.Trait;
import net.citizensnpcs.api.trait.TraitName; import net.citizensnpcs.api.trait.TraitName;
import net.citizensnpcs.npc.skin.SkinnableEntity; import net.citizensnpcs.npc.skin.SkinnableEntity;
import net.citizensnpcs.util.NMS;
@TraitName("skinlayers") @TraitName("skinlayers")
public class SkinLayers extends Trait { public class SkinLayers extends Trait {
@ -130,7 +129,8 @@ public class SkinLayers extends Trait {
if (!npc.isSpawned()) if (!npc.isSpawned())
return; return;
SkinnableEntity skinnable = NMS.getSkinnable(npc.getEntity()); SkinnableEntity skinnable = npc.getEntity() instanceof SkinnableEntity ? (SkinnableEntity) npc.getEntity()
: null;
if (skinnable == null) if (skinnable == null)
return; return;

View File

@ -1,213 +0,0 @@
package net.citizensnpcs.util;
import java.util.Arrays;
import java.util.ConcurrentModificationException;
import java.util.Iterator;
import java.util.NoSuchElementException;
@Deprecated
public class ByIdArray<T> implements Iterable<T> {
private final int capacity;
private Object[] elementData;
private int highest = Integer.MIN_VALUE;
private int lowest = Integer.MAX_VALUE;
private int modCount;
private int size;
public ByIdArray() {
this(100);
}
public ByIdArray(int capacity) {
if (capacity < 0)
throw new IllegalArgumentException("Capacity cannot be less than 0.");
this.capacity = capacity;
elementData = new Object[capacity];
}
public int add(T t) {
int index = 0;
if (elementData[0] == null) {
put(index, t);
return index;
}
while (elementData[index++] != null) {
if (index >= elementData.length) {
ensureCapacity(elementData.length + 1);
index = elementData.length - 1;
}
}
put(index, t);
return index;
}
public void clear() {
modCount = highest = size = lowest = 0;
elementData = new Object[capacity];
}
public boolean contains(int index) {
return elementData.length > index && elementData[index] != null;
}
public void ensureCapacity(int minCapacity) { // from ArrayList
int oldCapacity = elementData.length;
if (minCapacity > oldCapacity) {
int newCapacity = (oldCapacity * 3) / 2 + 1;
if (newCapacity < minCapacity)
newCapacity = minCapacity;
elementData = Arrays.copyOf(elementData, newCapacity);
}
}
private void fastRemove(int index) {
++modCount;
if (index == highest)
recalcHighest();
if (index == lowest)
recalcLowest();
elementData[index] = null;
--size;
}
@SuppressWarnings("unchecked")
public T get(int index) {
if (index >= elementData.length)
return null;
return (T) elementData[index];
}
@Override
public Iterator<T> iterator() {
return new Itr2();
}
public void put(int index, T t) {
if (t == null)
throw new IllegalArgumentException("can't insert a null object");
++modCount;
if (index > highest) {
highest = index;
}
if (index < lowest) {
lowest = index;
}
ensureCapacity(index + 2);
elementData[index] = t;
++size;
}
private void recalcHighest() {
highest = elementData.length - 1;
while (highest != 0 && elementData[--highest] == null) {
;
}
}
private void recalcLowest() {
lowest = 0;
while (elementData.length > lowest && elementData[lowest++] == null) {
;
}
}
public T remove(int index) {
if (index > elementData.length || elementData[index] == null) {
return null;
}
@SuppressWarnings("unchecked")
T prev = (T) elementData[index];
elementData[index] = null;
--size;
++modCount;
if (index >= highest) {
recalcHighest();
}
if (index <= lowest) {
recalcLowest();
}
return prev;
}
public int size() {
return size;
}
public void trimToSize() {
if (elementData.length > highest) {
elementData = Arrays.copyOf(elementData, highest + 1);
}
}
private class Itr2 implements Iterator<T> {
int cursor;
int expectedModCount = modCount;
int lastRet = -1;
public Itr2() {
if (size > 0) {
if (lowest > highest || highest == Integer.MIN_VALUE || highest >= elementData.length
|| elementData[highest] == null) {
recalcHighest();
}
if (lowest > highest || lowest >= elementData.length || elementData[lowest] == null) {
recalcLowest();
}
cursor = lowest;
}
}
private void advance() {
do {
cursor++;
} while (cursor != highest + 1 && elementData[cursor] == null);
}
final void checkForComodification() {
if (modCount != expectedModCount)
throw new ConcurrentModificationException();
}
@Override
public boolean hasNext() {
return size > 0 && highest >= cursor;
}
@Override
@SuppressWarnings("unchecked")
public T next() {
checkForComodification();
int i = cursor;
if (cursor > highest)
throw new NoSuchElementException();
Object[] elementData = ByIdArray.this.elementData;
if (i >= elementData.length)
throw new ConcurrentModificationException();
advance();
return (T) elementData[lastRet = i];
}
@Override
public void remove() {
if (lastRet < 0)
throw new IllegalStateException();
checkForComodification();
try {
ByIdArray.this.fastRemove(lastRet);
cursor = lastRet;
lastRet = -1;
expectedModCount = modCount;
} catch (IndexOutOfBoundsException ex) {
throw new ConcurrentModificationException();
}
}
}
public static <T> ByIdArray<T> create() {
return new ByIdArray<T>();
}
}

File diff suppressed because it is too large Load Diff

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