1.8.3 first pass

This commit is contained in:
fullwall 2015-03-07 21:07:45 +08:00
parent f290618277
commit f5d302733e
83 changed files with 1414 additions and 1372 deletions

View File

@ -11,8 +11,8 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<craftbukkit.version>1.8-R0.1-SNAPSHOT</craftbukkit.version>
<citizensapi.version>2.0.14-SNAPSHOT</citizensapi.version>
<craftbukkit.version>1.8.3-R0.1-SNAPSHOT</craftbukkit.version>
<citizensapi.version>2.0.15-SNAPSHOT</citizensapi.version>
<vault.version>1.4.1</vault.version>
<powermock.version>1.4.12</powermock.version>
<build.number>Unknown</build.number>

View File

@ -454,5 +454,5 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
return false;
}
private static final String COMPATIBLE_MC_VERSION = "1.8";
private static final String COMPATIBLE_MC_VERSION = "1.8.3";
}

View File

@ -23,12 +23,12 @@ import net.citizensnpcs.trait.CurrentLocation;
import net.citizensnpcs.util.Messages;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.PacketPlayOutEntityTeleport;
import net.minecraft.server.v1_8_R2.PacketPlayOutEntityTeleport;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftLivingEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftLivingEntity;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
@ -169,7 +169,7 @@ public class CitizensNPC extends AbstractNPC {
at = at.clone();
getTrait(CurrentLocation.class).setLocation(at);
entityController.spawn(at, this);
net.minecraft.server.v1_8_R1.Entity mcEntity = ((CraftEntity) getEntity()).getHandle();
net.minecraft.server.v1_8_R2.Entity mcEntity = ((CraftEntity) getEntity()).getHandle();
boolean couldSpawn = !Util.isLoaded(at) ? false : mcEntity.world.addEntity(mcEntity, SpawnReason.CUSTOM);
mcEntity.setPositionRotation(at.getX(), at.getY(), at.getZ(), at.getYaw(), at.getPitch());
if (!couldSpawn) {

View File

@ -4,11 +4,11 @@ import java.lang.reflect.Constructor;
import java.util.Map;
import net.citizensnpcs.api.npc.NPC;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Location;
import org.bukkit.block.BlockFace;
import org.bukkit.craftbukkit.v1_8_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_8_R2.CraftWorld;
import org.bukkit.entity.Entity;
import com.google.common.collect.Maps;
@ -23,7 +23,7 @@ public abstract class MobEntityController extends AbstractEntityController {
@Override
protected Entity createEntity(Location at, NPC npc) {
net.minecraft.server.v1_8_R1.Entity entity = createEntityFromClass(((CraftWorld) at.getWorld()).getHandle(),
net.minecraft.server.v1_8_R2.Entity entity = createEntityFromClass(((CraftWorld) at.getWorld()).getHandle(),
npc);
entity.setPositionRotation(at.getX(), at.getY(), at.getZ(), at.getYaw(), at.getPitch());
@ -36,9 +36,9 @@ public abstract class MobEntityController extends AbstractEntityController {
return entity.getBukkitEntity();
}
private net.minecraft.server.v1_8_R1.Entity createEntityFromClass(Object... args) {
private net.minecraft.server.v1_8_R2.Entity createEntityFromClass(Object... args) {
try {
return (net.minecraft.server.v1_8_R1.Entity) constructor.newInstance(args);
return (net.minecraft.server.v1_8_R2.Entity) constructor.newInstance(args);
} catch (Exception ex) {
ex.printStackTrace();
return null;

View File

@ -69,7 +69,7 @@ public class AStarNavigationStrategy extends AbstractPathStrategy {
}
vector = plan.getCurrentVector();
}
net.minecraft.server.v1_8_R1.Entity handle = NMS.getHandle(npc.getEntity());
net.minecraft.server.v1_8_R2.Entity handle = NMS.getHandle(npc.getEntity());
double dX = vector.getBlockX() - handle.locX;
double dZ = vector.getBlockZ() - handle.locZ;
double dY = vector.getY() - handle.locY;

View File

@ -5,20 +5,20 @@ import net.citizensnpcs.api.ai.tree.BehaviorStatus;
import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.util.PlayerAnimation;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.Blocks;
import net.minecraft.server.v1_8_R1.Enchantment;
import net.minecraft.server.v1_8_R1.EnchantmentManager;
import net.minecraft.server.v1_8_R1.EntityLiving;
import net.minecraft.server.v1_8_R1.EntityPlayer;
import net.minecraft.server.v1_8_R1.ItemStack;
import net.minecraft.server.v1_8_R1.Material;
import net.minecraft.server.v1_8_R1.MobEffectList;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.Blocks;
import net.minecraft.server.v1_8_R2.Enchantment;
import net.minecraft.server.v1_8_R2.EnchantmentManager;
import net.minecraft.server.v1_8_R2.EntityLiving;
import net.minecraft.server.v1_8_R2.EntityPlayer;
import net.minecraft.server.v1_8_R2.ItemStack;
import net.minecraft.server.v1_8_R2.Material;
import net.minecraft.server.v1_8_R2.MobEffectList;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftLivingEntity;
import org.bukkit.craftbukkit.v1_8_R1.inventory.CraftItemStack;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftLivingEntity;
import org.bukkit.craftbukkit.v1_8_R2.inventory.CraftItemStack;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
@ -46,7 +46,7 @@ public class BlockBreaker extends BehaviorGoalAdapter {
return Math.pow(entity.locX - x, 2) + Math.pow(entity.locY - y, 2) + Math.pow(entity.locZ - z, 2);
}
private net.minecraft.server.v1_8_R1.ItemStack getCurrentItem() {
private net.minecraft.server.v1_8_R2.ItemStack getCurrentItem() {
return configuration.item() != null ? CraftItemStack.asNMSCopy(configuration.item()) : entity.getEquipment(0);
}

View File

@ -14,7 +14,7 @@ import net.citizensnpcs.api.astar.pathfinder.VectorNode;
import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.MathHelper;
import net.minecraft.server.v1_8_R2.MathHelper;
import org.bukkit.Location;
import org.bukkit.entity.EntityType;

View File

@ -5,11 +5,11 @@ import net.citizensnpcs.api.ai.TargetType;
import net.citizensnpcs.api.ai.event.CancelReason;
import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.util.NMS;
import net.minecraft.server.v1_8_R1.EntityLiving;
import net.minecraft.server.v1_8_R1.NavigationAbstract;
import net.minecraft.server.v1_8_R2.EntityLiving;
import net.minecraft.server.v1_8_R2.NavigationAbstract;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftLivingEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftLivingEntity;
public class MCNavigationStrategy extends AbstractPathStrategy {
private final NavigationAbstract navigation;

View File

@ -8,13 +8,13 @@ import net.citizensnpcs.api.ai.event.CancelReason;
import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.PlayerAnimation;
import net.minecraft.server.v1_8_R1.Entity;
import net.minecraft.server.v1_8_R1.EntityLiving;
import net.minecraft.server.v1_8_R1.EntityPlayer;
import net.minecraft.server.v1_8_R1.NavigationAbstract;
import net.minecraft.server.v1_8_R2.Entity;
import net.minecraft.server.v1_8_R2.EntityLiving;
import net.minecraft.server.v1_8_R2.EntityPlayer;
import net.minecraft.server.v1_8_R2.NavigationAbstract;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.entity.LivingEntity;
public class MCTargetStrategy implements PathStrategy, EntityTarget {

View File

@ -7,14 +7,14 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityBat;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.EntityBat;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftBat;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftBat;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.entity.Bat;
import org.bukkit.util.Vector;
@ -58,39 +58,40 @@ public class BatController extends MobEntityController {
}
}
@Override
protected String bn() {
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bn() : npc.data().get(
NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bo() : npc.data().get(
NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null || !npc.data().has(NPC.HURT_SOUND_METADATA) ? super.bo() : npc.data().get(
NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public boolean cb() {
protected String bp() {
return npc == null || !npc.data().has(NPC.DEATH_SOUND_METADATA) ? super.bp() : npc.data().get(
NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cc() {
if (npc == null) {
return super.cb();
return super.cc();
}
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.cb();
if (super.cb()) {
return super.cc();
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
if (npc != null)
if (npc != null) {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
@ -109,8 +110,7 @@ public class BatController extends MobEntityController {
public void E() {
if (npc == null) {
super.E();
}
else {
} else {
NMS.updateAI(this);
npc.update();
}

View File

@ -7,14 +7,14 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityBlaze;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.EntityBlaze;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftBlaze;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftBlaze;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.entity.Blaze;
import org.bukkit.util.Vector;
@ -57,31 +57,31 @@ public class BlazeController extends MobEntityController {
}
}
@Override
protected String bn() {
return npc == null ? super.bn() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null ? super.bo() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null ? super.bo() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public boolean cb() {
protected String bp() {
return npc == null ? super.bp() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cc() {
if (npc == null)
return super.cb();
return super.cc();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.cb();
if (super.cb()) {
return super.cc();
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -103,7 +103,7 @@ public class BlazeController extends MobEntityController {
}
@Override
public void doTick() {
public void E() {
if (npc != null) {
npc.update();
}

View File

@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.EntityCaveSpider;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.EntityCaveSpider;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftCaveSpider;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftCaveSpider;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.entity.CaveSpider;
import org.bukkit.util.Vector;
@ -66,33 +66,33 @@ public class CaveSpiderController extends MobEntityController {
}
}
@Override
protected String bn() {
return npc == null ? super.bn() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null ? super.bo() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null ? super.bo() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public boolean cb() {
protected String bp() {
return npc == null ? super.bp() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cc() {
if (npc == null) {
return super.cb();
return super.cc();
}
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault)) {
return super.cb();
return super.cc();
}
if (super.cb()) {
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -114,17 +114,17 @@ public class CaveSpiderController extends MobEntityController {
}
@Override
public void doTick() {
super.doTick();
if (npc != null) {
npc.update();
public void e(float f, float f1) {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
public void e(float f, float f1) {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
public void E() {
super.E();
if (npc != null) {
npc.update();
}
}
@ -172,9 +172,9 @@ public class CaveSpiderController extends MobEntityController {
}
@Override
public boolean j_() {
public boolean k_() {
if (npc == null || !npc.isFlyable()) {
return super.j_();
return super.k_();
} else {
return false;
}

View File

@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.EntityChicken;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.EntityChicken;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftChicken;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftChicken;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.entity.Chicken;
import org.bukkit.util.Vector;
@ -77,31 +77,31 @@ public class ChickenController extends MobEntityController {
}
}
@Override
protected String bn() {
return npc == null ? super.bn() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null ? super.bo() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null ? super.bo() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public boolean cb() {
protected String bp() {
return npc == null ? super.bp() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cc() {
if (npc == null)
return super.cb();
return super.cc();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.cb();
if (super.cb()) {
return super.cc();
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -123,17 +123,17 @@ public class ChickenController extends MobEntityController {
}
@Override
public void doTick() {
super.doTick();
if (npc != null) {
npc.update();
public void e(float f, float f1) {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
public void e(float f, float f1) {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
public void E() {
super.E();
if (npc != null) {
npc.update();
}
}
@ -181,9 +181,9 @@ public class ChickenController extends MobEntityController {
}
@Override
public boolean j_() {
public boolean k_() {
if (npc == null || !npc.isFlyable()) {
return super.j_();
return super.k_();
} else {
return false;
}

View File

@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.EntityCow;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.EntityCow;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftCow;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftCow;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.entity.Cow;
import org.bukkit.util.Vector;
@ -78,31 +78,31 @@ public class CowController extends MobEntityController {
}
}
@Override
protected String bn() {
return npc == null ? super.bn() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null ? super.bo() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null ? super.bo() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public boolean cb() {
protected String bp() {
return npc == null ? super.bp() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cc() {
if (npc == null)
return super.cb();
return super.cc();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.cb();
if (super.cb()) {
return super.cc();
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -124,17 +124,17 @@ public class CowController extends MobEntityController {
}
@Override
public void doTick() {
super.doTick();
if (npc != null) {
npc.update();
public void e(float f, float f1) {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
public void e(float f, float f1) {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
public void E() {
super.E();
if (npc != null) {
npc.update();
}
}
@ -182,9 +182,9 @@ public class CowController extends MobEntityController {
}
@Override
public boolean j_() {
public boolean k_() {
if (npc == null || !npc.isFlyable()) {
return super.j_();
return super.k_();
} else {
return false;
}

View File

@ -7,17 +7,17 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.EntityCreeper;
import net.minecraft.server.v1_8_R1.EntityLightning;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.EntityCreeper;
import net.minecraft.server.v1_8_R2.EntityLightning;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftCreeper;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftCreeper;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.entity.Creeper;
import org.bukkit.util.Vector;
@ -68,31 +68,31 @@ public class CreeperController extends MobEntityController {
}
}
@Override
protected String bn() {
return npc == null ? super.bn() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null ? super.bo() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null ? super.bo() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public boolean cb() {
protected String bp() {
return npc == null ? super.bp() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cc() {
if (npc == null)
return super.cb();
return super.cc();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.cb();
if (super.cb()) {
return super.cc();
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -113,17 +113,17 @@ public class CreeperController extends MobEntityController {
}
@Override
public void doTick() {
super.doTick();
if (npc != null) {
npc.update();
public void e(float f, float f1) {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
public void e(float f, float f1) {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
public void E() {
super.E();
if (npc != null) {
npc.update();
}
}
@ -171,9 +171,9 @@ public class CreeperController extends MobEntityController {
}
@Override
public boolean j_() {
public boolean k_() {
if (npc == null || !npc.isFlyable()) {
return super.j_();
return super.k_();
} else {
return false;
}

View File

@ -7,14 +7,14 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityEnderDragon;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.EntityEnderDragon;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEnderDragon;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEnderDragon;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.entity.EnderDragon;
import org.bukkit.util.Vector;
@ -57,30 +57,30 @@ public class EnderDragonController extends MobEntityController {
}
}
@Override
protected String bn() {
return npc == null ? super.bn() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null ? super.bo() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null ? super.bo() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public boolean cb() {
protected String bp() {
return npc == null ? super.bp() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cc() {
if (npc == null)
return super.cb();
return super.cc();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.cb();
if (super.cb()) {
return super.cc();
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);

View File

@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.EntityEnderman;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.EntityEnderman;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEnderman;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEnderman;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.entity.Enderman;
import org.bukkit.util.Vector;
@ -66,31 +66,31 @@ public class EndermanController extends MobEntityController {
}
}
@Override
protected String bn() {
return npc == null ? super.bn() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null ? super.bo() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null ? super.bo() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public boolean cb() {
protected String bp() {
return npc == null ? super.bp() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cc() {
if (npc == null)
return super.cb();
return super.cc();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.cb();
if (super.cb()) {
return super.cc();
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -110,13 +110,6 @@ public class EndermanController extends MobEntityController {
}
}
@Override
public void doTick() {
super.doTick();
if (npc != null)
npc.update();
}
@Override
public void e(float f, float f1) {
if (npc == null || !npc.isFlyable()) {
@ -124,6 +117,13 @@ public class EndermanController extends MobEntityController {
}
}
@Override
public void E() {
super.E();
if (npc != null)
npc.update();
}
@Override
public void g(double x, double y, double z) {
if (npc == null) {
@ -167,15 +167,6 @@ public class EndermanController extends MobEntityController {
return npc;
}
@Override
public boolean j_() {
if (npc == null || !npc.isFlyable()) {
return super.j_();
} else {
return false;
}
}
@Override
protected boolean k(double d1, double d2, double d3) {
if (npc == null) {
@ -184,6 +175,15 @@ public class EndermanController extends MobEntityController {
return false;
}
@Override
public boolean k_() {
if (npc == null || !npc.isFlyable()) {
return super.k_();
} else {
return false;
}
}
@Override
protected String z() {
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.z() : npc.data().get(

View File

@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.EntityEndermite;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.EntityEndermite;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEndermite;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEndermite;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.entity.Endermite;
import org.bukkit.util.Vector;
@ -66,31 +66,31 @@ public class EndermiteController extends MobEntityController {
}
}
@Override
protected String bn() {
return npc == null ? super.bn() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null ? super.bo() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null ? super.bo() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public boolean cb() {
protected String bp() {
return npc == null ? super.bp() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cc() {
if (npc == null)
return super.cb();
return super.cc();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.cb();
if (super.cb()) {
return super.cc();
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -110,13 +110,6 @@ public class EndermiteController extends MobEntityController {
}
}
@Override
public void doTick() {
super.doTick();
if (npc != null)
npc.update();
}
@Override
public void e(float f, float f1) {
if (npc == null || !npc.isFlyable()) {
@ -124,6 +117,13 @@ public class EndermiteController extends MobEntityController {
}
}
@Override
public void E() {
super.E();
if (npc != null)
npc.update();
}
@Override
public void g(double x, double y, double z) {
if (npc == null) {
@ -168,9 +168,9 @@ public class EndermiteController extends MobEntityController {
}
@Override
public boolean j_() {
public boolean k_() {
if (npc == null || !npc.isFlyable()) {
return super.j_();
return super.k_();
} else {
return false;
}

View File

@ -20,29 +20,29 @@ 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_8_R1.AttributeInstance;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.DamageSource;
import net.minecraft.server.v1_8_R1.Entity;
import net.minecraft.server.v1_8_R1.EntityPlayer;
import net.minecraft.server.v1_8_R1.EnumGamemode;
import net.minecraft.server.v1_8_R1.EnumProtocolDirection;
import net.minecraft.server.v1_8_R1.GenericAttributes;
import net.minecraft.server.v1_8_R1.MathHelper;
import net.minecraft.server.v1_8_R1.MinecraftServer;
import net.minecraft.server.v1_8_R1.NavigationAbstract;
import net.minecraft.server.v1_8_R1.NetworkManager;
import net.minecraft.server.v1_8_R1.Packet;
import net.minecraft.server.v1_8_R1.PacketPlayOutEntityEquipment;
import net.minecraft.server.v1_8_R1.PacketPlayOutEntityHeadRotation;
import net.minecraft.server.v1_8_R1.PlayerInteractManager;
import net.minecraft.server.v1_8_R1.WorldServer;
import net.minecraft.server.v1_8_R2.AttributeInstance;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.DamageSource;
import net.minecraft.server.v1_8_R2.Entity;
import net.minecraft.server.v1_8_R2.EntityPlayer;
import net.minecraft.server.v1_8_R2.EnumProtocolDirection;
import net.minecraft.server.v1_8_R2.GenericAttributes;
import net.minecraft.server.v1_8_R2.MathHelper;
import net.minecraft.server.v1_8_R2.MinecraftServer;
import net.minecraft.server.v1_8_R2.NavigationAbstract;
import net.minecraft.server.v1_8_R2.NetworkManager;
import net.minecraft.server.v1_8_R2.Packet;
import net.minecraft.server.v1_8_R2.PacketPlayOutEntityEquipment;
import net.minecraft.server.v1_8_R2.PacketPlayOutEntityHeadRotation;
import net.minecraft.server.v1_8_R2.PlayerInteractManager;
import net.minecraft.server.v1_8_R2.WorldServer;
import net.minecraft.server.v1_8_R2.WorldSettings.EnumGamemode;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer;
import org.bukkit.metadata.MetadataValue;
import org.bukkit.plugin.Plugin;
import org.bukkit.util.Vector;
@ -78,7 +78,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -86,11 +86,12 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
Util.callCollisionEvent(npc, entity.getBukkitEntity());
}
}
@Override
public boolean damageEntity(DamageSource damagesource, float f) {
// knock back velocity is cancelled and sent to client for handling when
// the entity is a player. there is no client so make this happen manually.
// the entity is a player. there is no client so make this happen
// manually.
boolean damaged = super.damageEntity(damagesource, f);
if (damaged && velocityChanged) {
velocityChanged = false;
@ -103,7 +104,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
}
return damaged;
}
@Override
public void die(DamageSource damagesource) {
// players that die are not normally removed from the world. when the
@ -214,9 +215,9 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
}
@Override
public boolean j_() {
public boolean k_() {
if (npc == null || !npc.isFlyable()) {
return super.j_();
return super.k_();
} else {
return false;
}
@ -224,27 +225,39 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
private void moveOnCurrentHeading() {
NMS.updateAI(this);
if (aW) {
if (aY) {
if (onGround && jumpTicks == 0) {
bE();
bF();
jumpTicks = 10;
}
} else {
jumpTicks = 0;
}
aX *= 0.98F;
aY *= 0.98F;
aZ *= 0.9F;
g(aX, aY); // movement method
aZ *= 0.98F;
ba *= 0.98F;
bb *= 0.9F;
g(aZ, ba); // movement method
NMS.setHeadYaw(this, yaw);
if (jumpTicks > 0) {
jumpTicks--;
}
}
public void setMoveDestination(double x, double y, double z, double speed) {
controllerMove.a(x, y, z, speed);
}
public void setShouldJump() {
controllerJump.a();
}
public void setTargetLook(Entity target, float yawOffset, float renderOffset) {
controllerLook.a(target, yawOffset, renderOffset);
}
@Override
public void s_() {
super.s_();
public void t_() {
super.t_();
if (npc == null)
return;
boolean navigating = npc.getNavigator().isNavigating();
@ -276,18 +289,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
npc.update();
}
public void setMoveDestination(double x, double y, double z, double speed) {
controllerMove.a(x, y, z, speed);
}
public void setShouldJump() {
controllerJump.a();
}
public void setTargetLook(Entity target, float yawOffset, float renderOffset) {
controllerLook.a(target, yawOffset, renderOffset);
}
public void updateAI() {
controllerMove.c();
controllerLook.a();
@ -306,7 +307,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
}
Location current = getBukkitEntity().getLocation(packetLocationCache);
Packet[] packets = new Packet[navigating ? 5 : 6];
Packet<?>[] packets = new Packet[navigating ? 5 : 6];
if (!navigating) {
packets[5] = new PacketPlayOutEntityHeadRotation(this,
(byte) MathHelper.d(NMS.getHeadYaw(this) * 256.0F / 360.0F));

View File

@ -7,14 +7,14 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityGhast;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.EntityGhast;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftGhast;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftGhast;
import org.bukkit.entity.Ghast;
import org.bukkit.util.Vector;
@ -43,31 +43,31 @@ public class GhastController extends MobEntityController {
}
}
@Override
protected String bn() {
return npc == null ? super.bn() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null ? super.bo() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null ? super.bo() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public boolean cb() {
protected String bp() {
return npc == null ? super.bp() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cc() {
if (npc == null)
return super.cb();
return super.cc();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.cb();
if (super.cb()) {
return super.cc();
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);

View File

@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.EntityGiantZombie;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.EntityGiantZombie;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftGiant;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftGiant;
import org.bukkit.entity.Giant;
import org.bukkit.util.Vector;
@ -52,31 +52,31 @@ public class GiantController extends MobEntityController {
}
}
@Override
protected String bn() {
return npc == null ? super.bn() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null ? super.bo() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null ? super.bo() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public boolean cb() {
protected String bp() {
return npc == null ? super.bp() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cc() {
if (npc == null)
return super.cb();
return super.cc();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.cb();
if (super.cb()) {
return super.cc();
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -147,9 +147,9 @@ public class GiantController extends MobEntityController {
}
@Override
public boolean j_() {
public boolean k_() {
if (npc == null || !npc.isFlyable()) {
return super.j_();
return super.k_();
} else {
return false;
}

View File

@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.EntityGuardian;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.EntityGuardian;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftGuardian;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftGuardian;
import org.bukkit.entity.Guardian;
import org.bukkit.util.Vector;
@ -64,31 +64,31 @@ public class GuardianController extends MobEntityController {
}
}
@Override
protected String bn() {
return npc == null ? super.bn() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null ? super.bo() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null ? super.bo() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public boolean cb() {
protected String bp() {
return npc == null ? super.bp() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cc() {
if (npc == null)
return super.cb();
return super.cc();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.cb();
if (super.cb()) {
return super.cc();
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -110,17 +110,17 @@ public class GuardianController extends MobEntityController {
}
@Override
public void doTick() {
super.doTick();
if (npc != null) {
npc.update();
public void e(float f, float f1) {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
public void e(float f, float f1) {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
public void E() {
super.E();
if (npc != null) {
npc.update();
}
}
@ -168,9 +168,9 @@ public class GuardianController extends MobEntityController {
}
@Override
public boolean j_() {
public boolean k_() {
if (npc == null || !npc.isFlyable()) {
return super.j_();
return super.k_();
} else {
return false;
}

View File

@ -8,17 +8,17 @@ import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.trait.HorseModifiers;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.EntityHorse;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.EntityHorse;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftHorse;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftHorse;
import org.bukkit.entity.Horse;
import org.bukkit.util.Vector;
@ -72,31 +72,31 @@ public class HorseController extends MobEntityController {
}
}
@Override
protected String bn() {
return npc == null ? super.bn() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null ? super.bo() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null ? super.bo() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public boolean cb() {
protected String bp() {
return npc == null ? super.bp() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cc() {
if (npc == null)
return super.cb();
return super.cc();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.cb();
if (super.cb()) {
return super.cc();
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -118,19 +118,19 @@ public class HorseController extends MobEntityController {
}
@Override
public void doTick() {
if (npc == null) {
super.doTick();
} else {
NMS.setStepHeight(this, 1);
npc.update();
public void e(float f, float f1) {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
public void e(float f, float f1) {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
public void E() {
if (npc == null) {
super.E();
} else {
NMS.setStepHeight(this, 1);
npc.update();
}
}
@ -178,9 +178,9 @@ public class HorseController extends MobEntityController {
}
@Override
public boolean j_() {
public boolean k_() {
if (npc == null || !npc.isFlyable()) {
return super.j_();
return super.k_();
} else {
return false;
}

View File

@ -17,14 +17,14 @@ import net.citizensnpcs.api.util.Colorizer;
import net.citizensnpcs.api.util.Messaging;
import net.citizensnpcs.npc.AbstractEntityController;
import net.citizensnpcs.util.NMS;
import net.minecraft.server.v1_8_R1.PlayerInteractManager;
import net.minecraft.server.v1_8_R1.WorldServer;
import net.minecraft.server.v1_8_R2.PlayerInteractManager;
import net.minecraft.server.v1_8_R2.WorldServer;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.CraftWorld;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
@ -111,7 +111,7 @@ public class HumanController extends AbstractEntityController {
if (cached != null) {
profile.getProperties().put("textures", cached);
} else {
SKIN_THREAD.addRunnable(new SkinFetcher(new UUIDFetcher(skinUUID, npc), nmsWorld.getMinecraftServer().aB(),
SKIN_THREAD.addRunnable(new SkinFetcher(new UUIDFetcher(skinUUID, npc), nmsWorld.getMinecraftServer().aC(),
npc));
}
}
@ -133,8 +133,8 @@ public class HumanController extends AbstractEntityController {
private GameProfile fillProfileProperties(YggdrasilAuthenticationService auth, GameProfile profile,
boolean requireSecure) throws Exception {
URL url = HttpAuthenticationService.constantURL(new StringBuilder()
.append("https://sessionserver.mojang.com/session/minecraft/profile/")
.append(UUIDTypeAdapter.fromUUID(profile.getId())).toString());
.append("https://sessionserver.mojang.com/session/minecraft/profile/")
.append(UUIDTypeAdapter.fromUUID(profile.getId())).toString());
url = HttpAuthenticationService.concatenateURL(url,
new StringBuilder().append("unsigned=").append(!requireSecure).toString());
MinecraftProfilePropertiesResponse response = (MinecraftProfilePropertiesResponse) MAKE_REQUEST.invoke(
@ -161,7 +161,7 @@ public class HumanController extends AbstractEntityController {
if (cached != null) {
if (Messaging.isDebugging()) {
Messaging
.debug("Using cached skin texture for NPC " + npc.getName() + " UUID " + npc.getUniqueId());
.debug("Using cached skin texture for NPC " + npc.getName() + " UUID " + npc.getUniqueId());
}
skinProfile = new GameProfile(UUID.fromString(realUUID), "");
skinProfile.getProperties().put("textures", cached);
@ -173,7 +173,7 @@ public class HumanController extends AbstractEntityController {
} catch (Exception e) {
if ((e.getMessage() != null && e.getMessage().contains("too many requests"))
|| (e.getCause() != null && e.getCause().getMessage() != null && e.getCause().getMessage()
.contains("too many requests"))) {
.contains("too many requests"))) {
SKIN_THREAD.delay();
SKIN_THREAD.addRunnable(this);
}
@ -270,21 +270,21 @@ public class HumanController extends AbstractEntityController {
.getGameProfileRepository();
repo.findProfilesByNames(new String[] { ChatColor.stripColor(reportedUUID) }, Agent.MINECRAFT,
new ProfileLookupCallback() {
@Override
public void onProfileLookupFailed(GameProfile arg0, Exception arg1) {
}
@Override
public void onProfileLookupFailed(GameProfile arg0, Exception arg1) {
}
@Override
public void onProfileLookupSucceeded(final GameProfile profile) {
UUID_CACHE.put(reportedUUID, profile.getId().toString());
if (Messaging.isDebugging()) {
Messaging.debug("Fetched UUID " + profile.getId() + " for NPC " + npc.getName()
+ " UUID " + npc.getUniqueId());
}
npc.data().setPersistent(CACHED_SKIN_UUID_METADATA, profile.getId().toString());
npc.data().setPersistent(CACHED_SKIN_UUID_NAME_METADATA, profile.getName());
}
});
@Override
public void onProfileLookupSucceeded(final GameProfile profile) {
UUID_CACHE.put(reportedUUID, profile.getId().toString());
if (Messaging.isDebugging()) {
Messaging.debug("Fetched UUID " + profile.getId() + " for NPC " + npc.getName()
+ " UUID " + npc.getUniqueId());
}
npc.data().setPersistent(CACHED_SKIN_UUID_METADATA, profile.getId().toString());
npc.data().setPersistent(CACHED_SKIN_UUID_NAME_METADATA, profile.getName());
}
});
return npc.data().get(CACHED_SKIN_UUID_METADATA, reportedUUID);
}
}

View File

@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.EntityIronGolem;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.EntityIronGolem;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftIronGolem;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftIronGolem;
import org.bukkit.entity.IronGolem;
import org.bukkit.util.Vector;
@ -52,31 +52,31 @@ public class IronGolemController extends MobEntityController {
}
}
@Override
protected String bn() {
return npc == null ? super.bn() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null ? super.bo() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null ? super.bo() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public boolean cb() {
protected String bp() {
return npc == null ? super.bp() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cc() {
if (npc == null)
return super.cb();
return super.cc();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.cb();
if (super.cb()) {
return super.cc();
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -90,10 +90,10 @@ public class IronGolemController extends MobEntityController {
}
@Override
public void doTick() {
super.doTick();
if (npc != null)
npc.update();
protected void D() {
if (npc == null) {
super.D();
}
}
@Override
@ -103,6 +103,13 @@ public class IronGolemController extends MobEntityController {
}
}
@Override
public void E() {
super.E();
if (npc != null)
npc.update();
}
@Override
public void g(double x, double y, double z) {
if (npc == null) {
@ -147,9 +154,9 @@ public class IronGolemController extends MobEntityController {
}
@Override
public boolean j_() {
public boolean k_() {
if (npc == null || !npc.isFlyable()) {
return super.j_();
return super.k_();
} else {
return false;
}
@ -160,13 +167,6 @@ public class IronGolemController extends MobEntityController {
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.z() : npc.data().get(
NPC.AMBIENT_SOUND_METADATA, super.z());
}
@Override
protected void D() {
if (npc == null) {
super.D();
}
}
}
public static class IronGolemNPC extends CraftIronGolem implements NPCHolder {

View File

@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.EntityMagmaCube;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.EntityMagmaCube;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftMagmaCube;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftMagmaCube;
import org.bukkit.entity.MagmaCube;
import org.bukkit.util.Vector;
@ -53,31 +53,31 @@ public class MagmaCubeController extends MobEntityController {
}
}
@Override
protected String bn() {
return npc == null ? super.bn() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null ? super.bo() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null ? super.bo() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public boolean cb() {
protected String bp() {
return npc == null ? super.bp() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cc() {
if (npc == null)
return super.cb();
return super.cc();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.cb();
if (super.cb()) {
return super.cc();
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -97,13 +97,6 @@ public class MagmaCubeController extends MobEntityController {
}
}
@Override
public void doTick() {
super.doTick();
if (npc != null)
npc.update();
}
@Override
public void e(float f, float f1) {
if (npc == null || !npc.isFlyable()) {
@ -111,6 +104,13 @@ public class MagmaCubeController extends MobEntityController {
}
}
@Override
public void E() {
super.E();
if (npc != null)
npc.update();
}
@Override
public void g(double x, double y, double z) {
if (npc == null) {
@ -155,9 +155,9 @@ public class MagmaCubeController extends MobEntityController {
}
@Override
public boolean j_() {
public boolean k_() {
if (npc == null || !npc.isFlyable()) {
return super.j_();
return super.k_();
} else {
return false;
}

View File

@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.EntityMushroomCow;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.EntityMushroomCow;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftMushroomCow;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftMushroomCow;
import org.bukkit.entity.MushroomCow;
import org.bukkit.util.Vector;
@ -64,31 +64,31 @@ public class MushroomCowController extends MobEntityController {
}
}
@Override
protected String bn() {
return npc == null ? super.bn() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null ? super.bo() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null ? super.bo() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public boolean cb() {
protected String bp() {
return npc == null ? super.bp() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cc() {
if (npc == null)
return super.cb();
return super.cc();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.cb();
if (super.cb()) {
return super.cc();
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -109,8 +109,8 @@ public class MushroomCowController extends MobEntityController {
}
@Override
public void doTick() {
super.doTick();
public void E() {
super.E();
if (npc != null)
npc.update();
}
@ -166,9 +166,9 @@ public class MushroomCowController extends MobEntityController {
}
@Override
public boolean j_() {
public boolean k_() {
if (npc == null || !npc.isFlyable()) {
return super.j_();
return super.k_();
} else {
return false;
}

View File

@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.EntityOcelot;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.EntityOcelot;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftOcelot;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftOcelot;
import org.bukkit.entity.Ocelot;
import org.bukkit.util.Vector;
@ -63,31 +63,31 @@ public class OcelotController extends MobEntityController {
}
}
@Override
protected String bn() {
return npc == null ? super.bn() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null ? super.bo() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null ? super.bo() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public boolean cb() {
protected String bp() {
return npc == null ? super.bp() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cc() {
if (npc == null)
return super.cb();
return super.cc();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.cb();
if (super.cb()) {
return super.cc();
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -107,13 +107,6 @@ public class OcelotController extends MobEntityController {
}
}
@Override
public void doTick() {
super.doTick();
if (npc != null)
npc.update();
}
@Override
public void e(float f, float f1) {
if (npc == null || !npc.isFlyable()) {
@ -121,6 +114,13 @@ public class OcelotController extends MobEntityController {
}
}
@Override
public void E() {
super.E();
if (npc != null)
npc.update();
}
@Override
public void g(double x, double y, double z) {
if (npc == null) {
@ -165,9 +165,9 @@ public class OcelotController extends MobEntityController {
}
@Override
public boolean j_() {
public boolean k_() {
if (npc == null || !npc.isFlyable()) {
return super.j_();
return super.k_();
} else {
return false;
}

View File

@ -7,17 +7,17 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.EntityLightning;
import net.minecraft.server.v1_8_R1.EntityPig;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.EntityLightning;
import net.minecraft.server.v1_8_R2.EntityPig;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftPig;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPig;
import org.bukkit.entity.Pig;
import org.bukkit.util.Vector;
@ -64,31 +64,31 @@ public class PigController extends MobEntityController {
}
}
@Override
protected String bn() {
return npc == null ? super.bn() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null ? super.bo() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null ? super.bo() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public boolean cb() {
protected String bp() {
return npc == null ? super.bp() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cc() {
if (npc == null)
return super.cb();
return super.cc();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.cb();
if (super.cb()) {
return super.cc();
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -109,13 +109,6 @@ public class PigController extends MobEntityController {
}
}
@Override
public void doTick() {
super.doTick();
if (npc != null)
npc.update();
}
@Override
public void e(float f, float f1) {
if (npc == null || !npc.isFlyable()) {
@ -123,6 +116,13 @@ public class PigController extends MobEntityController {
}
}
@Override
public void E() {
super.E();
if (npc != null)
npc.update();
}
@Override
public void g(double x, double y, double z) {
if (npc == null) {
@ -167,9 +167,9 @@ public class PigController extends MobEntityController {
}
@Override
public boolean j_() {
public boolean k_() {
if (npc == null || !npc.isFlyable()) {
return super.j_();
return super.k_();
} else {
return false;
}

View File

@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.EntityPigZombie;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.EntityPigZombie;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftPigZombie;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPigZombie;
import org.bukkit.entity.PigZombie;
import org.bukkit.util.Vector;
@ -53,31 +53,31 @@ public class PigZombieController extends MobEntityController {
}
}
@Override
protected String bn() {
return npc == null ? super.bn() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null ? super.bo() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null ? super.bo() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public boolean cb() {
protected String bp() {
return npc == null ? super.bp() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cc() {
if (npc == null)
return super.cb();
return super.cc();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.cb();
if (super.cb()) {
return super.cc();
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -98,8 +98,8 @@ public class PigZombieController extends MobEntityController {
}
@Override
public void doTick() {
super.doTick();
public void E() {
super.E();
if (npc != null)
npc.update();
}
@ -156,9 +156,9 @@ public class PigZombieController extends MobEntityController {
}
@Override
public boolean j_() {
public boolean k_() {
if (npc == null || !npc.isFlyable()) {
return super.j_();
return super.k_();
} else {
return false;
}

View File

@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.EntityRabbit;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.EntityRabbit;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftRabbit;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftRabbit;
import org.bukkit.entity.Rabbit;
import org.bukkit.util.Vector;
@ -64,40 +64,31 @@ public class RabbitController extends MobEntityController {
}
}
@Override
protected String bn() {
return npc == null ? super.bn() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null ? super.bo() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null ? super.bo() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public void r(int i) {
if (npc != null) {
this.datawatcher.watch(18, (byte) i);
return;
}
super.r(i);
protected String bp() {
return npc == null ? super.bp() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cb() {
public boolean cc() {
if (npc == null)
return super.cb();
return super.cc();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.cb();
if (super.cb()) {
return super.cc();
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -118,14 +109,6 @@ public class RabbitController extends MobEntityController {
}
}
@Override
public void doTick() {
super.doTick();
if (npc != null) {
npc.update();
}
}
@Override
public void e(float f, float f1) {
if (npc == null || !npc.isFlyable()) {
@ -135,8 +118,8 @@ public class RabbitController extends MobEntityController {
@Override
public void E() {
if (npc == null || !npc.isFlyable()) {
super.E();
if (npc != null || !npc.isFlyable()) {
npc.update();
}
}
@ -184,14 +167,23 @@ public class RabbitController extends MobEntityController {
}
@Override
public boolean j_() {
public boolean k_() {
if (npc == null || !npc.isFlyable()) {
return super.j_();
return super.k_();
} else {
return false;
}
}
@Override
public void setRabbitType(int i) {
if (npc != null) {
this.datawatcher.watch(18, (byte) i);
return;
}
super.setRabbitType(i);
}
@Override
protected String z() {
return npc == null || !npc.data().has(NPC.AMBIENT_SOUND_METADATA) ? super.z() : npc.data().get(

View File

@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.EntitySheep;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.EntitySheep;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftSheep;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftSheep;
import org.bukkit.entity.Sheep;
import org.bukkit.util.Vector;
@ -63,31 +63,31 @@ public class SheepController extends MobEntityController {
}
}
@Override
protected String bn() {
return npc == null ? super.bn() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null ? super.bo() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null ? super.bo() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public boolean cb() {
protected String bp() {
return npc == null ? super.bp() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cc() {
if (npc == null)
return super.cb();
return super.cc();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.cb();
if (super.cb()) {
return super.cc();
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -108,8 +108,8 @@ public class SheepController extends MobEntityController {
}
@Override
public void doTick() {
super.doTick();
public void E() {
super.E();
if (npc != null)
npc.update();
}
@ -165,9 +165,9 @@ public class SheepController extends MobEntityController {
}
@Override
public boolean j_() {
public boolean k_() {
if (npc == null || !npc.isFlyable()) {
return super.j_();
return super.k_();
} else {
return false;
}

View File

@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.EntitySilverfish;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.EntitySilverfish;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftSilverfish;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftSilverfish;
import org.bukkit.entity.Silverfish;
import org.bukkit.util.Vector;
@ -52,31 +52,31 @@ public class SilverfishController extends MobEntityController {
}
}
@Override
protected String bn() {
return npc == null ? super.bn() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null ? super.bo() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null ? super.bo() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public boolean cb() {
protected String bp() {
return npc == null ? super.bp() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cc() {
if (npc == null)
return super.cb();
return super.cc();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.cb();
if (super.cb()) {
return super.cc();
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -97,8 +97,8 @@ public class SilverfishController extends MobEntityController {
}
@Override
public void doTick() {
super.doTick();
public void E() {
super.E();
if (npc != null)
npc.update();
}
@ -154,9 +154,9 @@ public class SilverfishController extends MobEntityController {
}
@Override
public boolean j_() {
public boolean k_() {
if (npc == null || !npc.isFlyable()) {
return super.j_();
return super.k_();
} else {
return false;
}

View File

@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.EntitySkeleton;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.EntitySkeleton;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftSkeleton;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftSkeleton;
import org.bukkit.entity.Skeleton;
import org.bukkit.util.Vector;
@ -52,31 +52,31 @@ public class SkeletonController extends MobEntityController {
}
}
@Override
protected String bn() {
return npc == null ? super.bn() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null ? super.bo() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null ? super.bo() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public boolean cb() {
protected String bp() {
return npc == null ? super.bp() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cc() {
if (npc == null)
return super.cb();
return super.cc();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.cb();
if (super.cb()) {
return super.cc();
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -97,8 +97,8 @@ public class SkeletonController extends MobEntityController {
}
@Override
public void doTick() {
super.doTick();
public void E() {
super.E();
if (npc != null) {
npc.update();
}
@ -155,9 +155,9 @@ public class SkeletonController extends MobEntityController {
}
@Override
public boolean j_() {
public boolean k_() {
if (npc == null || !npc.isFlyable()) {
return super.j_();
return super.k_();
} else {
return false;
}

View File

@ -7,18 +7,18 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.ControllerMove;
import net.minecraft.server.v1_8_R1.EntityHuman;
import net.minecraft.server.v1_8_R1.EntitySlime;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.ControllerMove;
import net.minecraft.server.v1_8_R2.EntityHuman;
import net.minecraft.server.v1_8_R2.EntitySlime;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftSlime;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftSlime;
import org.bukkit.entity.Slime;
import org.bukkit.util.Vector;
@ -57,36 +57,38 @@ public class SlimeController extends MobEntityController {
}
}
@Override
protected String bn() {
return npc == null ? super.bn() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null ? super.bo() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null ? super.bo() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public boolean cb() {
protected String bp() {
return npc == null ? super.bp() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cc() {
if (npc == null)
return super.cb();
return super.cc();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.cb();
if (super.cb()) {
return super.cc();
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void cf() {
public void ch() {
if (npc == null) {
super.ch();
}
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -115,17 +117,17 @@ public class SlimeController extends MobEntityController {
}
@Override
public void doTick() {
super.doTick();
if (npc != null) {
npc.update();
public void e(float f, float f1) {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
}
}
@Override
public void e(float f, float f1) {
if (npc == null || !npc.isFlyable()) {
super.e(f, f1);
public void E() {
super.E();
if (npc != null) {
npc.update();
}
}
@ -173,9 +175,9 @@ public class SlimeController extends MobEntityController {
}
@Override
public boolean j_() {
public boolean k_() {
if (npc == null || !npc.isFlyable()) {
return super.j_();
return super.k_();
} else {
return false;
}

View File

@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.EntitySnowman;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.EntitySnowman;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftSnowman;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftSnowman;
import org.bukkit.entity.Snowman;
import org.bukkit.util.Vector;
@ -52,31 +52,31 @@ public class SnowmanController extends MobEntityController {
}
}
@Override
protected String bn() {
return npc == null ? super.bn() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null ? super.bo() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null ? super.bo() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public boolean cb() {
protected String bp() {
return npc == null ? super.bp() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cc() {
if (npc == null)
return super.cb();
return super.cc();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.cb();
if (super.cb()) {
return super.cc();
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -97,8 +97,8 @@ public class SnowmanController extends MobEntityController {
}
@Override
public void doTick() {
super.doTick();
public void E() {
super.E();
if (npc != null)
npc.update();
}
@ -154,9 +154,9 @@ public class SnowmanController extends MobEntityController {
}
@Override
public boolean j_() {
public boolean k_() {
if (npc == null || !npc.isFlyable()) {
return super.j_();
return super.k_();
} else {
return false;
}

View File

@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.EntitySpider;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.EntitySpider;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftSpider;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftSpider;
import org.bukkit.entity.Spider;
import org.bukkit.util.Vector;
@ -52,31 +52,31 @@ public class SpiderController extends MobEntityController {
}
}
@Override
protected String bn() {
return npc == null ? super.bn() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null ? super.bo() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null ? super.bo() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public boolean cb() {
protected String bp() {
return npc == null ? super.bp() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cc() {
if (npc == null)
return super.cb();
return super.cc();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.cb();
if (super.cb()) {
return super.cc();
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -97,8 +97,8 @@ public class SpiderController extends MobEntityController {
}
@Override
public void doTick() {
super.doTick();
public void E() {
super.E();
if (npc != null)
npc.update();
}
@ -154,9 +154,9 @@ public class SpiderController extends MobEntityController {
}
@Override
public boolean j_() {
public boolean k_() {
if (npc == null || !npc.isFlyable()) {
return super.j_();
return super.k_();
} else {
return false;
}

View File

@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.EntitySquid;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.EntitySquid;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftSquid;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftSquid;
import org.bukkit.entity.Squid;
import org.bukkit.util.Vector;
@ -52,31 +52,31 @@ public class SquidController extends MobEntityController {
}
}
@Override
protected String bn() {
return npc == null ? super.bn() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null ? super.bo() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null ? super.bo() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public boolean cb() {
protected String bp() {
return npc == null ? super.bp() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cc() {
if (npc == null)
return super.cb();
return super.cc();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.cb();
if (super.cb()) {
return super.cc();
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -147,9 +147,9 @@ public class SquidController extends MobEntityController {
}
@Override
public boolean j_() {
public boolean k_() {
if (npc == null || !npc.isFlyable()) {
return super.j_();
return super.k_();
} else {
return false;
}

View File

@ -7,17 +7,17 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.EntityHuman;
import net.minecraft.server.v1_8_R1.EntityVillager;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.EntityHuman;
import net.minecraft.server.v1_8_R2.EntityVillager;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftVillager;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftVillager;
import org.bukkit.entity.Villager;
import org.bukkit.util.Vector;
@ -71,31 +71,31 @@ public class VillagerController extends MobEntityController {
// trades
}
@Override
protected String bn() {
return npc == null ? super.bn() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null ? super.bo() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null ? super.bo() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public boolean cb() {
protected String bp() {
return npc == null ? super.bp() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cc() {
if (npc == null)
return super.cb();
return super.cc();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.cb();
if (super.cb()) {
return super.cc();
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -117,8 +117,8 @@ public class VillagerController extends MobEntityController {
}
@Override
public void doTick() {
super.doTick();
public void E() {
super.E();
if (npc != null) {
npc.update();
}
@ -179,9 +179,9 @@ public class VillagerController extends MobEntityController {
}
@Override
public boolean j_() {
public boolean k_() {
if (npc == null || !npc.isFlyable()) {
return super.j_();
return super.k_();
} else {
return false;
}

View File

@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.EntityWitch;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.EntityWitch;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftWitch;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftWitch;
import org.bukkit.entity.Witch;
import org.bukkit.util.Vector;
@ -52,31 +52,31 @@ public class WitchController extends MobEntityController {
}
}
@Override
protected String bn() {
return npc == null ? super.bn() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null ? super.bo() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null ? super.bo() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public boolean cb() {
protected String bp() {
return npc == null ? super.bp() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cc() {
if (npc == null)
return super.cb();
return super.cc();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.cb();
if (super.cb()) {
return super.cc();
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -97,8 +97,8 @@ public class WitchController extends MobEntityController {
}
@Override
public void doTick() {
super.doTick();
public void E() {
super.E();
if (npc != null)
npc.update();
}
@ -154,9 +154,9 @@ public class WitchController extends MobEntityController {
}
@Override
public boolean j_() {
public boolean k_() {
if (npc == null || !npc.isFlyable()) {
return super.j_();
return super.k_();
} else {
return false;
}

View File

@ -7,14 +7,14 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityWither;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.EntityWither;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftWither;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftWither;
import org.bukkit.entity.Wither;
import org.bukkit.util.Vector;
@ -43,31 +43,31 @@ public class WitherController extends MobEntityController {
}
}
@Override
protected String bn() {
return npc == null ? super.bn() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null ? super.bo() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null ? super.bo() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public boolean cb() {
protected String bp() {
return npc == null ? super.bp() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cc() {
if (npc == null)
return super.cb();
return super.cc();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.cb();
if (super.cb()) {
return super.cc();
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);

View File

@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.EntityWolf;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.EntityWolf;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftWolf;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftWolf;
import org.bukkit.entity.Wolf;
import org.bukkit.util.Vector;
@ -63,31 +63,31 @@ public class WolfController extends MobEntityController {
}
}
@Override
protected String bn() {
return npc == null ? super.bn() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null ? super.bo() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null ? super.bo() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public boolean cb() {
protected String bp() {
return npc == null ? super.bp() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cc() {
if (npc == null)
return super.cb();
return super.cc();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.cb();
if (super.cb()) {
return super.cc();
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -109,8 +109,8 @@ public class WolfController extends MobEntityController {
}
@Override
public void doTick() {
super.doTick();
public void E() {
super.E();
if (npc != null) {
npc.update();
}
@ -167,9 +167,9 @@ public class WolfController extends MobEntityController {
}
@Override
public boolean j_() {
public boolean k_() {
if (npc == null || !npc.isFlyable()) {
return super.j_();
return super.k_();
} else {
return false;
}

View File

@ -7,16 +7,16 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.EntityZombie;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.EntityZombie;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftZombie;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftZombie;
import org.bukkit.entity.Zombie;
import org.bukkit.util.Vector;
@ -52,31 +52,31 @@ public class ZombieController extends MobEntityController {
}
}
@Override
protected String bn() {
return npc == null ? super.bn() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bn());
}
@Override
protected String bo() {
return npc == null ? super.bo() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bo());
return npc == null ? super.bo() : npc.data().get(NPC.HURT_SOUND_METADATA, super.bo());
}
@Override
public boolean cb() {
protected String bp() {
return npc == null ? super.bp() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.bp());
}
@Override
public boolean cc() {
if (npc == null)
return super.cb();
return super.cc();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.cb();
if (super.cb()) {
return super.cc();
if (super.cc()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -97,8 +97,8 @@ public class ZombieController extends MobEntityController {
}
@Override
public void doTick() {
super.doTick();
public void E() {
super.E();
if (npc != null) {
npc.update();
}
@ -155,9 +155,9 @@ public class ZombieController extends MobEntityController {
}
@Override
public boolean j_() {
public boolean k_() {
if (npc == null || !npc.isFlyable()) {
return super.j_();
return super.k_();
} else {
return false;
}

View File

@ -6,16 +6,16 @@ import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityArmorStand;
import net.minecraft.server.v1_8_R1.EntityHuman;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.Vec3D;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.EntityArmorStand;
import net.minecraft.server.v1_8_R2.EntityHuman;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.Vec3D;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftArmorStand;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftArmorStand;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.entity.ArmorStand;
import org.bukkit.util.Vector;
@ -61,7 +61,7 @@ public class ArmorStandController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -111,8 +111,8 @@ public class ArmorStandController extends MobEntityController {
}
@Override
public void s_() {
super.s_();
public void t_() {
super.t_();
if (npc != null) {
npc.update();
}

View File

@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityArrow;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.EntityArrow;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftArrow;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftArrow;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.entity.Arrow;
import org.bukkit.util.Vector;
@ -59,7 +59,7 @@ public class ArrowController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -104,11 +104,11 @@ public class ArrowController extends MobEntityController {
}
@Override
public void s_() {
public void t_() {
if (npc != null) {
npc.update();
} else {
super.s_();
super.t_();
}
}
}

View File

@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityBoat;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.EntityBoat;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftBoat;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftBoat;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.entity.Boat;
import org.bukkit.util.Vector;
@ -59,7 +59,7 @@ public class BoatController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -104,11 +104,11 @@ public class BoatController extends MobEntityController {
}
@Override
public void s_() {
public void t_() {
if (npc != null) {
npc.update();
} else {
super.s_();
super.t_();
}
}
}

View File

@ -6,17 +6,17 @@ import net.citizensnpcs.npc.AbstractEntityController;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityEgg;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R1.WorldServer;
import net.minecraft.server.v1_8_R2.EntityEgg;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import net.minecraft.server.v1_8_R2.WorldServer;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEgg;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.CraftWorld;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEgg;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.entity.Egg;
import org.bukkit.entity.Entity;
import org.bukkit.util.Vector;
@ -75,7 +75,7 @@ public class EggController extends AbstractEntityController {
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -120,11 +120,11 @@ public class EggController extends AbstractEntityController {
}
@Override
public void s_() {
public void t_() {
if (npc != null) {
npc.update();
} else {
super.s_();
super.t_();
}
}
}

View File

@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityEnderCrystal;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.EntityEnderCrystal;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEnderCrystal;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEnderCrystal;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.entity.EnderCrystal;
import org.bukkit.util.Vector;
@ -59,7 +59,7 @@ public class EnderCrystalController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -104,11 +104,11 @@ public class EnderCrystalController extends MobEntityController {
}
@Override
public void s_() {
public void t_() {
if (npc != null) {
npc.update();
} else {
super.s_();
super.t_();
}
}
}

View File

@ -6,15 +6,15 @@ import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityEnderPearl;
import net.minecraft.server.v1_8_R1.EntityLiving;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.EntityEnderPearl;
import net.minecraft.server.v1_8_R2.EntityLiving;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEnderPearl;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEnderPearl;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.entity.EnderPearl;
import org.bukkit.util.Vector;
@ -59,7 +59,7 @@ public class EnderPearlController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -109,11 +109,11 @@ public class EnderPearlController extends MobEntityController {
}
@Override
public void s_() {
public void t_() {
if (npc != null) {
npc.update();
} else {
super.s_();
super.t_();
}
}
}

View File

@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityEnderSignal;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.EntityEnderSignal;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEnderSignal;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEnderSignal;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.entity.EnderSignal;
import org.bukkit.util.Vector;
@ -59,7 +59,7 @@ public class EnderSignalController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -104,11 +104,11 @@ public class EnderSignalController extends MobEntityController {
}
@Override
public void s_() {
public void t_() {
if (npc != null) {
npc.update();
} else {
super.s_();
super.t_();
}
}
}

View File

@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityExperienceOrb;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.EntityExperienceOrb;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftExperienceOrb;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftExperienceOrb;
import org.bukkit.entity.ExperienceOrb;
import org.bukkit.util.Vector;
@ -40,7 +40,7 @@ public class ExperienceOrbController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -90,11 +90,11 @@ public class ExperienceOrbController extends MobEntityController {
}
@Override
public void s_() {
public void t_() {
if (npc != null) {
npc.update();
} else {
super.s_();
super.t_();
}
}
}

View File

@ -6,22 +6,22 @@ import net.citizensnpcs.npc.AbstractEntityController;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.Blocks;
import net.minecraft.server.v1_8_R1.EntityFallingBlock;
import net.minecraft.server.v1_8_R1.IBlockData;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R1.WorldServer;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.Blocks;
import net.minecraft.server.v1_8_R2.EntityFallingBlock;
import net.minecraft.server.v1_8_R2.IBlockData;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import net.minecraft.server.v1_8_R2.WorldServer;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftFallingSand;
import org.bukkit.craftbukkit.v1_8_R1.util.CraftMagicNumbers;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.CraftWorld;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftFallingSand;
import org.bukkit.craftbukkit.v1_8_R2.util.CraftMagicNumbers;
import org.bukkit.entity.Entity;
import org.bukkit.entity.FallingBlock;
import org.bukkit.util.Vector;
@ -68,7 +68,7 @@ public class FallingBlockController extends AbstractEntityController {
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -118,7 +118,7 @@ public class FallingBlockController extends AbstractEntityController {
}
@Override
public void s_() {
public void t_() {
if (npc != null) {
npc.update();
if (Math.abs(motX) > EPSILON || Math.abs(motY) > EPSILON || Math.abs(motZ) > EPSILON) {
@ -128,7 +128,7 @@ public class FallingBlockController extends AbstractEntityController {
move(motX, motY, motZ);
}
} else {
super.s_();
super.t_();
}
}

View File

@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityFireworks;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.EntityFireworks;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftFirework;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftFirework;
import org.bukkit.entity.Firework;
import org.bukkit.util.Vector;
@ -45,7 +45,7 @@ public class FireworkController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -90,11 +90,11 @@ public class FireworkController extends MobEntityController {
}
@Override
public void s_() {
public void t_() {
if (npc != null) {
npc.update();
} else {
super.s_();
super.t_();
}
}
}

View File

@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityFishingHook;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.EntityFishingHook;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftFish;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftFish;
import org.bukkit.entity.Fish;
import org.bukkit.util.Vector;
@ -40,7 +40,7 @@ public class FishingHookController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -90,11 +90,11 @@ public class FishingHookController extends MobEntityController {
}
@Override
public void s_() {
public void t_() {
if (npc != null) {
npc.update();
} else {
super.s_();
super.t_();
}
}
}

View File

@ -6,21 +6,21 @@ import net.citizensnpcs.npc.AbstractEntityController;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityHuman;
import net.minecraft.server.v1_8_R1.EntityItem;
import net.minecraft.server.v1_8_R1.ItemStack;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R1.WorldServer;
import net.minecraft.server.v1_8_R2.EntityHuman;
import net.minecraft.server.v1_8_R2.EntityItem;
import net.minecraft.server.v1_8_R2.ItemStack;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import net.minecraft.server.v1_8_R2.WorldServer;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftItem;
import org.bukkit.craftbukkit.v1_8_R1.inventory.CraftItemStack;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.CraftWorld;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftItem;
import org.bukkit.craftbukkit.v1_8_R2.inventory.CraftItemStack;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Item;
import org.bukkit.util.Vector;
@ -62,7 +62,7 @@ public class ItemController extends AbstractEntityController {
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -119,11 +119,11 @@ public class ItemController extends AbstractEntityController {
}
@Override
public void s_() {
public void t_() {
if (npc != null) {
npc.update();
} else {
super.s_();
super.t_();
}
}
}

View File

@ -6,15 +6,15 @@ import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityItemFrame;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.EntityItemFrame;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftItemFrame;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftItemFrame;
import org.bukkit.entity.ItemFrame;
import org.bukkit.util.Vector;
@ -41,7 +41,7 @@ public class ItemFrameController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -91,11 +91,11 @@ public class ItemFrameController extends MobEntityController {
}
@Override
public void s_() {
public void t_() {
if (npc != null) {
npc.update();
} else {
super.s_();
super.t_();
}
}

View File

@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityLargeFireball;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.EntityLargeFireball;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftLargeFireball;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftLargeFireball;
import org.bukkit.entity.LargeFireball;
import org.bukkit.util.Vector;
@ -45,7 +45,7 @@ public class LargeFireballController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -90,11 +90,11 @@ public class LargeFireballController extends MobEntityController {
}
@Override
public void s_() {
public void t_() {
if (npc != null) {
npc.update();
} else {
super.s_();
super.t_();
}
}
}

View File

@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityLeash;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.EntityLeash;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftLeash;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftLeash;
import org.bukkit.entity.LeashHitch;
import org.bukkit.util.Vector;
@ -40,7 +40,7 @@ public class LeashController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -90,11 +90,11 @@ public class LeashController extends MobEntityController {
}
@Override
public void s_() {
public void t_() {
if (npc != null) {
npc.update();
} else {
super.s_();
super.t_();
}
}

View File

@ -7,14 +7,14 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityMinecartChest;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.EntityMinecartChest;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftMinecartChest;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftMinecartChest;
import org.bukkit.entity.Minecart;
import org.bukkit.util.Vector;
@ -41,7 +41,7 @@ public class MinecartChestController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -91,12 +91,12 @@ public class MinecartChestController extends MobEntityController {
}
@Override
public void s_() {
public void t_() {
if (npc != null) {
npc.update();
NMS.minecartItemLogic(this);
} else {
super.s_();
super.t_();
}
}
}

View File

@ -7,14 +7,14 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityMinecartCommandBlock;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.EntityMinecartCommandBlock;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftMinecartCommand;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftMinecartCommand;
import org.bukkit.entity.Minecart;
import org.bukkit.util.Vector;
@ -46,7 +46,7 @@ public class MinecartCommandController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -91,12 +91,12 @@ public class MinecartCommandController extends MobEntityController {
}
@Override
public void s_() {
public void t_() {
if (npc != null) {
npc.update();
NMS.minecartItemLogic(this);
} else {
super.s_();
super.t_();
}
}
}

View File

@ -7,14 +7,14 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityMinecartFurnace;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.EntityMinecartFurnace;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftMinecartFurnace;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftMinecartFurnace;
import org.bukkit.entity.Minecart;
import org.bukkit.util.Vector;
@ -46,7 +46,7 @@ public class MinecartFurnaceController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -91,12 +91,12 @@ public class MinecartFurnaceController extends MobEntityController {
}
@Override
public void s_() {
public void t_() {
if (npc != null) {
npc.update();
NMS.minecartItemLogic(this);
} else {
super.s_();
super.t_();
}
}
}

View File

@ -7,9 +7,9 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityMinecartHopper;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.EntityMinecartHopper;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.entity.Minecart;
import org.bukkit.util.Vector;
@ -42,7 +42,7 @@ public class MinecartHopperController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -79,12 +79,12 @@ public class MinecartHopperController extends MobEntityController {
}
@Override
public void s_() {
public void t_() {
if (npc != null) {
npc.update();
NMS.minecartItemLogic(this);
} else {
super.s_();
super.t_();
}
}
}

View File

@ -7,14 +7,14 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityMinecartRideable;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.EntityMinecartRideable;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftMinecartRideable;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftMinecartRideable;
import org.bukkit.entity.Minecart;
import org.bukkit.util.Vector;
@ -46,7 +46,7 @@ public class MinecartRideableController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -91,12 +91,12 @@ public class MinecartRideableController extends MobEntityController {
}
@Override
public void s_() {
public void t_() {
if (npc != null) {
npc.update();
NMS.minecartItemLogic(this);
} else {
super.s_();
super.t_();
}
}
}

View File

@ -7,9 +7,9 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityMinecartMobSpawner;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.EntityMinecartMobSpawner;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.entity.Minecart;
import org.bukkit.util.Vector;
@ -42,7 +42,7 @@ public class MinecartSpawnerController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -79,12 +79,12 @@ public class MinecartSpawnerController extends MobEntityController {
}
@Override
public void s_() {
public void t_() {
if (npc != null) {
npc.update();
NMS.minecartItemLogic(this);
} else {
super.s_();
super.t_();
}
}
}

View File

@ -7,9 +7,9 @@ import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityMinecartTNT;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.EntityMinecartTNT;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.entity.Minecart;
import org.bukkit.util.Vector;
@ -42,7 +42,7 @@ public class MinecartTNTController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -79,12 +79,12 @@ public class MinecartTNTController extends MobEntityController {
}
@Override
public void s_() {
public void t_() {
if (npc != null) {
npc.update();
NMS.minecartItemLogic(this);
} else {
super.s_();
super.t_();
}
}
}

View File

@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityPainting;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.EntityPainting;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftPainting;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPainting;
import org.bukkit.entity.Painting;
import org.bukkit.util.Vector;
@ -45,7 +45,7 @@ public class PaintingController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -90,11 +90,11 @@ public class PaintingController extends MobEntityController {
}
@Override
public void s_() {
public void t_() {
if (npc != null) {
npc.update();
} else {
super.s_();
super.t_();
}
}

View File

@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntitySmallFireball;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.EntitySmallFireball;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftSmallFireball;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftSmallFireball;
import org.bukkit.entity.SmallFireball;
import org.bukkit.util.Vector;
@ -45,7 +45,7 @@ public class SmallFireballController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -90,11 +90,11 @@ public class SmallFireballController extends MobEntityController {
}
@Override
public void s_() {
public void t_() {
if (npc != null) {
npc.update();
} else {
super.s_();
super.t_();
}
}
}

View File

@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntitySnowball;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.EntitySnowball;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftSnowball;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftSnowball;
import org.bukkit.entity.Snowball;
import org.bukkit.util.Vector;
@ -59,7 +59,7 @@ public class SnowballController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -104,11 +104,11 @@ public class SnowballController extends MobEntityController {
}
@Override
public void s_() {
public void t_() {
if (npc != null) {
npc.update();
} else {
super.s_();
super.t_();
}
}
}

View File

@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityTNTPrimed;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.EntityTNTPrimed;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftTNTPrimed;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftTNTPrimed;
import org.bukkit.entity.TNTPrimed;
import org.bukkit.util.Vector;
@ -45,7 +45,7 @@ public class TNTPrimedController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -90,11 +90,11 @@ public class TNTPrimedController extends MobEntityController {
}
@Override
public void s_() {
public void t_() {
if (npc != null) {
npc.update();
} else {
super.s_();
super.t_();
}
}
}

View File

@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityThrownExpBottle;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.EntityThrownExpBottle;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftThrownExpBottle;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftThrownExpBottle;
import org.bukkit.entity.ThrownExpBottle;
import org.bukkit.util.Vector;
@ -45,7 +45,7 @@ public class ThrownExpBottleController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -90,11 +90,11 @@ public class ThrownExpBottleController extends MobEntityController {
}
@Override
public void s_() {
public void t_() {
if (npc != null) {
npc.update();
} else {
super.s_();
super.t_();
}
}
}

View File

@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityPotion;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.EntityPotion;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftThrownPotion;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftThrownPotion;
import org.bukkit.entity.ThrownPotion;
import org.bukkit.util.Vector;
@ -45,7 +45,7 @@ public class ThrownPotionController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -90,11 +90,11 @@ public class ThrownPotionController extends MobEntityController {
}
@Override
public void s_() {
public void t_() {
if (npc != null) {
npc.update();
} else {
super.s_();
super.t_();
}
}
}

View File

@ -6,14 +6,14 @@ import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.MobEntityController;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityWitherSkull;
import net.minecraft.server.v1_8_R1.NBTTagCompound;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.EntityWitherSkull;
import net.minecraft.server.v1_8_R2.NBTTagCompound;
import net.minecraft.server.v1_8_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftWitherSkull;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftWitherSkull;
import org.bukkit.entity.WitherSkull;
import org.bukkit.util.Vector;
@ -45,7 +45,7 @@ public class WitherSkullController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_8_R1.Entity entity) {
public void collide(net.minecraft.server.v1_8_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -90,11 +90,11 @@ public class WitherSkullController extends MobEntityController {
}
@Override
public void s_() {
public void t_() {
if (npc != null) {
npc.update();
} else {
super.s_();
super.t_();
}
}
}

View File

@ -1,10 +1,10 @@
package net.citizensnpcs.npc.network;
import net.minecraft.server.v1_8_R1.EntityPlayer;
import net.minecraft.server.v1_8_R1.MinecraftServer;
import net.minecraft.server.v1_8_R1.NetworkManager;
import net.minecraft.server.v1_8_R1.Packet;
import net.minecraft.server.v1_8_R1.PlayerConnection;
import net.minecraft.server.v1_8_R2.EntityPlayer;
import net.minecraft.server.v1_8_R2.MinecraftServer;
import net.minecraft.server.v1_8_R2.NetworkManager;
import net.minecraft.server.v1_8_R2.Packet;
import net.minecraft.server.v1_8_R2.PlayerConnection;
public class EmptyNetHandler extends PlayerConnection {
public EmptyNetHandler(MinecraftServer minecraftServer, NetworkManager networkManager, EntityPlayer entityPlayer) {

View File

@ -3,8 +3,8 @@ package net.citizensnpcs.npc.network;
import java.io.IOException;
import net.citizensnpcs.util.NMS;
import net.minecraft.server.v1_8_R1.EnumProtocolDirection;
import net.minecraft.server.v1_8_R1.NetworkManager;
import net.minecraft.server.v1_8_R2.EnumProtocolDirection;
import net.minecraft.server.v1_8_R2.NetworkManager;
public class EmptyNetworkManager extends NetworkManager {
public EmptyNetworkManager(EnumProtocolDirection flag) throws IOException {

View File

@ -14,11 +14,11 @@ import net.citizensnpcs.api.trait.trait.Owner;
import net.citizensnpcs.api.util.DataKey;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_8_R1.EntityEnderDragon;
import net.minecraft.server.v1_8_R1.EntityLiving;
import net.minecraft.server.v1_8_R1.EntityPlayer;
import net.minecraft.server.v1_8_R2.EntityEnderDragon;
import net.minecraft.server.v1_8_R2.EntityLiving;
import net.minecraft.server.v1_8_R2.EntityPlayer;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
@ -79,7 +79,7 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab
handle.mount(getHandle());
}
private net.minecraft.server.v1_8_R1.Entity getHandle() {
private net.minecraft.server.v1_8_R2.Entity getHandle() {
return NMS.getHandle(npc.getEntity());
}
@ -186,7 +186,7 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab
return enabled;
}
private void setMountedYaw(net.minecraft.server.v1_8_R1.Entity handle) {
private void setMountedYaw(net.minecraft.server.v1_8_R2.Entity handle) {
if (handle instanceof EntityEnderDragon || !Setting.USE_BOAT_CONTROLS.asBoolean())
return; // EnderDragon handles this separately
double tX = handle.locX + handle.motX;
@ -212,10 +212,10 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab
return enabled;
}
private double updateHorizontalSpeed(net.minecraft.server.v1_8_R1.Entity handle,
net.minecraft.server.v1_8_R1.Entity passenger, double speed, float speedMod) {
private double updateHorizontalSpeed(net.minecraft.server.v1_8_R2.Entity handle,
net.minecraft.server.v1_8_R2.Entity passenger, double speed, float speedMod) {
double oldSpeed = Math.sqrt(handle.motX * handle.motX + handle.motZ * handle.motZ);
double horizontal = ((EntityLiving) passenger).aY;
double horizontal = ((EntityLiving) passenger).ba;
if (horizontal > 0.0D) {
double dXcos = -Math.sin(passenger.yaw * Math.PI / 180.0F);
double dXsin = Math.cos(passenger.yaw * Math.PI / 180.0F);
@ -259,8 +259,8 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab
@Override
public void run(Player rider) {
net.minecraft.server.v1_8_R1.Entity handle = getHandle();
net.minecraft.server.v1_8_R1.Entity passenger = ((CraftPlayer) rider).getHandle();
net.minecraft.server.v1_8_R2.Entity handle = getHandle();
net.minecraft.server.v1_8_R2.Entity passenger = ((CraftPlayer) rider).getHandle();
boolean onGround = handle.onGround;
float speedMod = npc.getNavigator().getDefaultParameters()
.modifiedSpeed((onGround ? GROUND_SPEED : AIR_SPEED));
@ -311,7 +311,7 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab
}
Vector dir = rider.getEyeLocation().getDirection();
dir.multiply(npc.getNavigator().getDefaultParameters().speedModifier());
net.minecraft.server.v1_8_R1.Entity handle = getHandle();
net.minecraft.server.v1_8_R2.Entity handle = getHandle();
handle.motX = dir.getX();
handle.motY = dir.getY();
handle.motZ = dir.getZ();
@ -354,8 +354,8 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab
getHandle().motY = 0.001;
return;
}
net.minecraft.server.v1_8_R1.Entity handle = getHandle();
net.minecraft.server.v1_8_R1.Entity passenger = ((CraftPlayer) rider).getHandle();
net.minecraft.server.v1_8_R2.Entity handle = getHandle();
net.minecraft.server.v1_8_R2.Entity passenger = ((CraftPlayer) rider).getHandle();
speed = updateHorizontalSpeed(handle, passenger, speed, 1F);
boolean shouldJump = NMS.shouldJump(passenger);

View File

@ -1,11 +1,10 @@
package net.citizensnpcs.trait;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftRabbit;
import org.bukkit.entity.Rabbit;
import net.citizensnpcs.api.persistence.Persist;
import net.citizensnpcs.api.trait.Trait;
import net.minecraft.server.v1_8_R1.EntityRabbit;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftRabbit;
import org.bukkit.entity.Rabbit;
public class RabbitType extends Trait {
private Rabbit rabbit;
@ -22,24 +21,25 @@ public class RabbitType extends Trait {
setType(type);
}
public void setType(RabbitTypes type) {
public void setType(RabbitTypes type) {
this.type = type;
if (rabbit != null && rabbit.isValid()) {
((EntityRabbit)((CraftRabbit)rabbit).getHandle()).r(type.type);
((CraftRabbit) rabbit).getHandle().setRabbitType(type.type);
}
}
public enum RabbitTypes {
BROWN(0),
WHITE(1),
public enum RabbitTypes {
BLACK(2),
BLACKANDWHITE(3),
BROWN(0),
GOLD(4),
KILLER(99),
SALTANDPEPPER(5),
KILLER(99);
WHITE(1);
public int type;
RabbitTypes (int type) {
this.type = type;
}
RabbitTypes(int type) {
this.type = type;
}
}
}

View File

@ -1,8 +1,8 @@
package net.citizensnpcs.trait.waypoint;
import net.minecraft.server.v1_8_R1.DamageSource;
import net.minecraft.server.v1_8_R1.EntityEnderSignal;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.DamageSource;
import net.minecraft.server.v1_8_R2.EntityEnderSignal;
import net.minecraft.server.v1_8_R2.World;
public class EntityEnderSignalMarker extends EntityEnderSignal {
public EntityEnderSignalMarker(World world) {

View File

@ -18,43 +18,43 @@ import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.npc.entity.EntityHumanNPC;
import net.citizensnpcs.npc.network.EmptyChannel;
import net.citizensnpcs.util.nms.PlayerlistTrackerEntry;
import net.minecraft.server.v1_8_R1.AttributeInstance;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.ControllerJump;
import net.minecraft.server.v1_8_R1.DamageSource;
import net.minecraft.server.v1_8_R1.EnchantmentManager;
import net.minecraft.server.v1_8_R1.Entity;
import net.minecraft.server.v1_8_R1.EntityHorse;
import net.minecraft.server.v1_8_R1.EntityHuman;
import net.minecraft.server.v1_8_R1.EntityInsentient;
import net.minecraft.server.v1_8_R1.EntityLiving;
import net.minecraft.server.v1_8_R1.EntityMinecartAbstract;
import net.minecraft.server.v1_8_R1.EntityPlayer;
import net.minecraft.server.v1_8_R1.EntityTracker;
import net.minecraft.server.v1_8_R1.EntityTrackerEntry;
import net.minecraft.server.v1_8_R1.EntityTypes;
import net.minecraft.server.v1_8_R1.EnumPlayerInfoAction;
import net.minecraft.server.v1_8_R1.GenericAttributes;
import net.minecraft.server.v1_8_R1.MathHelper;
import net.minecraft.server.v1_8_R1.NavigationAbstract;
import net.minecraft.server.v1_8_R1.NetworkManager;
import net.minecraft.server.v1_8_R1.Packet;
import net.minecraft.server.v1_8_R1.PacketPlayOutPlayerInfo;
import net.minecraft.server.v1_8_R1.PathfinderGoalSelector;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R1.WorldServer;
import net.minecraft.server.v1_8_R2.AttributeInstance;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.ControllerJump;
import net.minecraft.server.v1_8_R2.DamageSource;
import net.minecraft.server.v1_8_R2.EnchantmentManager;
import net.minecraft.server.v1_8_R2.Entity;
import net.minecraft.server.v1_8_R2.EntityHorse;
import net.minecraft.server.v1_8_R2.EntityHuman;
import net.minecraft.server.v1_8_R2.EntityInsentient;
import net.minecraft.server.v1_8_R2.EntityLiving;
import net.minecraft.server.v1_8_R2.EntityMinecartAbstract;
import net.minecraft.server.v1_8_R2.EntityPlayer;
import net.minecraft.server.v1_8_R2.EntityTracker;
import net.minecraft.server.v1_8_R2.EntityTrackerEntry;
import net.minecraft.server.v1_8_R2.EntityTypes;
import net.minecraft.server.v1_8_R2.GenericAttributes;
import net.minecraft.server.v1_8_R2.MathHelper;
import net.minecraft.server.v1_8_R2.NavigationAbstract;
import net.minecraft.server.v1_8_R2.NetworkManager;
import net.minecraft.server.v1_8_R2.Packet;
import net.minecraft.server.v1_8_R2.PacketPlayOutPlayerInfo;
import net.minecraft.server.v1_8_R2.PacketPlayOutPlayerInfo.EnumPlayerInfoAction;
import net.minecraft.server.v1_8_R2.PathfinderGoalSelector;
import net.minecraft.server.v1_8_R2.World;
import net.minecraft.server.v1_8_R2.WorldServer;
import org.apache.commons.lang.Validate;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.craftbukkit.v1_8_R1.CraftServer;
import org.bukkit.craftbukkit.v1_8_R1.CraftSound;
import org.bukkit.craftbukkit.v1_8_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_8_R2.CraftServer;
import org.bukkit.craftbukkit.v1_8_R2.CraftSound;
import org.bukkit.craftbukkit.v1_8_R2.CraftWorld;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Horse;
import org.bukkit.entity.LivingEntity;
@ -70,7 +70,7 @@ public class NMS {
public static void addOrRemoveFromPlayerList(org.bukkit.entity.Entity entity, boolean remove) {
if (entity == null)
return;
Entity handle = getHandle(entity);
EntityHuman handle = (EntityHuman) getHandle(entity);
if (handle.world == null)
return;
if (remove) {
@ -86,7 +86,7 @@ public class NMS {
int i = 0;
if (target instanceof EntityLiving) {
f += EnchantmentManager.a(handle.bz(), ((EntityLiving) target).getMonsterType());
f += EnchantmentManager.a(handle.bA(), ((EntityLiving) target).getMonsterType());
i += EnchantmentManager.a(handle);
}
@ -126,54 +126,121 @@ public class NMS {
}
public static void flyingMoveLogic(EntityLiving entity, float f, float f1) {
if (entity.V()) {
entity.a(f, f1, 0.02F);
entity.move(entity.motX, entity.motY, entity.motZ);
if (entity.bM()) {
if (entity.V()) {
double d0 = entity.locY;
float f3 = 0.8F;
float f4 = 0.02F;
float f2 = EnchantmentManager.b(entity);
if (f2 > 3.0F) {
f2 = 3.0F;
}
entity.motX *= 0.800000011920929D;
entity.motY *= 0.800000011920929D;
entity.motZ *= 0.800000011920929D;
} else if (entity.ab()) {
entity.a(f, f1, 0.02F);
entity.move(entity.motX, entity.motY, entity.motZ);
entity.motX *= 0.5D;
entity.motY *= 0.5D;
entity.motZ *= 0.5D;
} else {
float c1 = 0.91F;
if (entity.onGround) {
c1 = entity.world.getType(
new BlockPosition(MathHelper.floor(entity.locX),
MathHelper.floor(entity.getBoundingBox().b) - 1, MathHelper.floor(entity.locZ)))
.getBlock().frictionFactor * 0.91F;
if (!entity.onGround) {
f2 *= 0.5F;
}
if (f2 > 0.0F) {
f3 += (0.5460001F - f3) * f2 / 3.0F;
f4 += (entity.bI() * 1.0F - f4) * f2 / 3.0F;
}
entity.a(f, f1, f4);
entity.move(entity.motX, entity.motY, entity.motZ);
entity.motX *= f3;
entity.motY *= 0.800000011920929D;
entity.motZ *= f3;
entity.motY -= 0.02D;
if ((entity.positionChanged)
&& (entity.c(entity.motX, entity.motY + 0.6000000238418579D - entity.locY + d0, entity.motZ)))
entity.motY = 0.300000011920929D;
} else if (entity.ab()) {
double d0 = entity.locY;
entity.a(f, f1, 0.02F);
entity.move(entity.motX, entity.motY, entity.motZ);
entity.motX *= 0.5D;
entity.motY *= 0.5D;
entity.motZ *= 0.5D;
entity.motY -= 0.02D;
if ((entity.positionChanged)
&& (entity.c(entity.motX, entity.motY + 0.6000000238418579D - entity.locY + d0, entity.motZ)))
entity.motY = 0.300000011920929D;
} else {
float f5 = 0.91F;
if (entity.onGround) {
f5 = entity.world.getType(
new BlockPosition(MathHelper.floor(entity.locX),
MathHelper.floor(entity.getBoundingBox().b) - 1, MathHelper.floor(entity.locZ)))
.getBlock().frictionFactor * 0.91F;
}
float f6 = 0.1627714F / (f5 * f5 * f5);
float f3;
if (entity.onGround)
f3 = entity.bI() * f6;
else {
f3 = entity.aM;
}
entity.a(f, f1, f3);
f5 = 0.91F;
if (entity.onGround) {
f5 = entity.world.getType(
new BlockPosition(MathHelper.floor(entity.locX),
MathHelper.floor(entity.getBoundingBox().b) - 1, MathHelper.floor(entity.locZ)))
.getBlock().frictionFactor * 0.91F;
}
if (entity.k_()) {
float f4 = 0.15F;
entity.motX = MathHelper.a(entity.motX, -f4, f4);
entity.motZ = MathHelper.a(entity.motZ, -f4, f4);
entity.fallDistance = 0.0F;
if (entity.motY < -0.15D) {
entity.motY = -0.15D;
}
boolean flag = (entity.isSneaking()) && ((entity instanceof EntityHuman));
if ((flag) && (entity.motY < 0.0D)) {
entity.motY = 0.0D;
}
}
entity.move(entity.motX, entity.motY, entity.motZ);
if ((entity.positionChanged) && (entity.k_())) {
entity.motY = 0.2D;
}
if ((entity.world.isClientSide)
&& ((!entity.world.isLoaded(new BlockPosition((int) entity.locX, 0, (int) entity.locZ))) || (!entity.world
.getChunkAtWorldCoords(new BlockPosition((int) entity.locX, 0, (int) entity.locZ)).o()))) {
if (entity.locY > 0.0D)
entity.motY = -0.1D;
else
entity.motY = 0.0D;
} else {
entity.motY -= 0.08D;
}
entity.motY *= 0.9800000190734863D;
entity.motX *= f5;
entity.motZ *= f5;
}
float f2 = 0.1627714F / (c1 * c1 * c1);
entity.a(f, f1, entity.onGround ? 0.1F * f2 : 0.02F);
c1 = 0.91F;
if (entity.onGround) {
c1 = entity.world.getType(
new BlockPosition(MathHelper.floor(entity.locX),
MathHelper.floor(entity.getBoundingBox().b) - 1, MathHelper.floor(entity.locZ)))
.getBlock().frictionFactor * 0.91F;
}
entity.move(entity.motX, entity.motY, entity.motZ);
entity.motX *= c1;
entity.motY *= c1;
entity.motZ *= c1;
}
entity.ay = entity.az;
double d1 = entity.locX - entity.lastX;
double d2 = entity.locZ - entity.lastZ;
float f3 = MathHelper.sqrt(d1 * d1 + d2 * d2) * 4.0F;
if (f3 > 1.0F) {
f3 = 1.0F;
entity.aA = entity.aB;
double d0 = entity.locX - entity.lastX;
double d1 = entity.locZ - entity.lastZ;
float f2 = MathHelper.sqrt(d0 * d0 + d1 * d1) * 4.0F;
if (f2 > 1.0F) {
f2 = 1.0F;
}
entity.az += (f3 - entity.az) * 0.4F;
entity.aA += entity.az;
entity.aB += (f2 - entity.aB) * 0.4F;
entity.aC += entity.aB;
}
@SuppressWarnings("deprecation")
@ -279,7 +346,7 @@ public class NMS {
public static void look(Entity handle, Entity target) {
if (handle instanceof EntityInsentient) {
((EntityInsentient) handle).getControllerLook().a(target, 10.0F, ((EntityInsentient) handle).bP());
((EntityInsentient) handle).getControllerLook().a(target, 10.0F, ((EntityInsentient) handle).bQ());
} else if (handle instanceof EntityHumanNPC) {
((EntityHumanNPC) handle).setTargetLook(target, 10F, 40F);
}
@ -304,9 +371,9 @@ public class NMS {
int offset = npc.data().get(NPC.MINECART_OFFSET_METADATA, 0);
minecart.a(mat != null);
if (mat != null) {
minecart.a(Block.getById(mat.getId()).fromLegacyData(data));
minecart.setDisplayBlock(Block.getById(mat.getId()).fromLegacyData(data));
}
minecart.l(offset);
minecart.SetDisplayBlockOffset(offset);
}
public static float modifiedSpeed(float baseSpeed, NPC npc) {
@ -331,10 +398,6 @@ public class NMS {
}
public static void registerEntityClass(Class<?> clazz) {
if (ENTITY_CLASS_TO_INT == null) {
ENTITY_CLASS_TO_INT = MC_ENTITY_CLASS_TO_INT;
ENTITY_INT_TO_CLASS = MC_ENTITY_INT_TO_CLASS;
}
if (ENTITY_CLASS_TO_INT == null || ENTITY_CLASS_TO_INT.containsKey(clazz))
return;
Class<?> search = clazz;
@ -346,7 +409,7 @@ public class NMS {
ENTITY_CLASS_TO_NAME.put(clazz, ENTITY_CLASS_TO_NAME.get(search));
return;
}
throw new IllegalArgumentException("unable to find valid entity superclass");
throw new IllegalArgumentException("unable to find valid entity superclass for class " + clazz.toString());
}
public static void removeFromServerPlayerList(Player player) {
@ -357,7 +420,7 @@ public class NMS {
@SuppressWarnings("rawtypes")
public static void replaceTrackerEntry(Player player) {
WorldServer server = (WorldServer) NMS.getHandle(player).getWorld();
EntityTrackerEntry entry = (EntityTrackerEntry) server.getTracker().trackedEntities.get(player.getEntityId());
EntityTrackerEntry entry = server.getTracker().trackedEntities.get(player.getEntityId());
if (entry == null)
return;
PlayerlistTrackerEntry replace = new PlayerlistTrackerEntry(entry);
@ -448,10 +511,10 @@ public class NMS {
while (yaw >= 180.0F) {
yaw -= 360.0F;
}
handle.aI = yaw;
handle.aK = yaw;
if (!(handle instanceof EntityHuman))
handle.aG = yaw;
handle.aJ = yaw;
handle.aI = yaw;
handle.aL = yaw;
}
public static void setShouldJump(org.bukkit.entity.Entity entity) {
@ -474,10 +537,10 @@ public class NMS {
if (!bukkitEntity.getType().isAlive())
return;
EntityLiving handle = NMS.getHandle((LivingEntity) bukkitEntity);
handle.aY = (float) d;
handle.ba = (float) d;
}
public static boolean shouldJump(net.minecraft.server.v1_8_R1.Entity entity) {
public static boolean shouldJump(net.minecraft.server.v1_8_R2.Entity entity) {
if (JUMP_FIELD == null || !(entity instanceof EntityLiving))
return false;
try {
@ -583,14 +646,11 @@ public class NMS {
private static Map<Class<?>, Integer> ENTITY_CLASS_TO_INT;
private static Map<Class<?>, String> ENTITY_CLASS_TO_NAME;
private static final Map<Class<?>, Constructor<?>> ENTITY_CONSTRUCTOR_CACHE = new WeakHashMap<Class<?>, Constructor<?>>();
private static Map<Integer, Class<?>> ENTITY_INT_TO_CLASS;
private static Field GOAL_FIELD = getField(PathfinderGoalSelector.class, "b");
private static final Field JUMP_FIELD = getField(EntityLiving.class, "aW");
private static Map<Class<?>, Integer> MC_ENTITY_CLASS_TO_INT = null;
private static Map<Integer, Class<?>> MC_ENTITY_INT_TO_CLASS = null;
private static final Field JUMP_FIELD = getField(EntityLiving.class, "aY");
private static Field NAVIGATION_WORLD_FIELD = getField(NavigationAbstract.class, "c");
private static Field NETWORK_ADDRESS = getField(NetworkManager.class, "j");
private static Field NETWORK_CHANNEL = getField(NetworkManager.class, "i");
private static Field NETWORK_ADDRESS = getField(NetworkManager.class, "l");
private static Field NETWORK_CHANNEL = getField(NetworkManager.class, "k");
private static final Location PACKET_CACHE_LOCATION = new Location(null, 0, 0, 0);
private static Field PATHFINDING_RANGE = getField(NavigationAbstract.class, "a");
private static final Random RANDOM = Util.getFastRandom();
@ -598,21 +658,12 @@ public class NMS {
static {
try {
Field field = getField(EntityTypes.class, "e");
ENTITY_INT_TO_CLASS = (Map<Integer, Class<?>>) field.get(null);
field = getField(EntityTypes.class, "f");
Field field = getField(EntityTypes.class, "f");
ENTITY_CLASS_TO_INT = (Map<Class<?>, Integer>) field.get(null);
field = getField(EntityTypes.class, "c");
ENTITY_CLASS_TO_NAME = (Map<Class<?>, String>) field.get(null);
} catch (Exception e) {
Messaging.logTr(Messages.ERROR_GETTING_ID_MAPPING, e.getMessage());
try {
Field field = getField(Class.forName("ns"), "d");
MC_ENTITY_INT_TO_CLASS = (Map<Integer, Class<?>>) field.get(null);
field = getField(Class.forName("ns"), "e");
MC_ENTITY_CLASS_TO_INT = (Map<Class<?>, Integer>) field.get(null);
} catch (Exception e2) {
}
}
}
}

View File

@ -4,14 +4,14 @@ import java.util.Arrays;
import net.citizensnpcs.api.CitizensAPI;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.EntityPlayer;
import net.minecraft.server.v1_8_R1.Packet;
import net.minecraft.server.v1_8_R1.PacketPlayOutAnimation;
import net.minecraft.server.v1_8_R1.PacketPlayOutBed;
import net.minecraft.server.v1_8_R1.PacketPlayOutEntityMetadata;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.EntityPlayer;
import net.minecraft.server.v1_8_R2.Packet;
import net.minecraft.server.v1_8_R2.PacketPlayOutAnimation;
import net.minecraft.server.v1_8_R2.PacketPlayOutBed;
import net.minecraft.server.v1_8_R2.PacketPlayOutEntityMetadata;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.metadata.FixedMetadataValue;
import org.bukkit.scheduler.BukkitRunnable;

View File

@ -1,11 +1,11 @@
package net.citizensnpcs.util.nms;
import net.citizensnpcs.npc.entity.EntityHumanNPC;
import net.minecraft.server.v1_8_R1.Entity;
import net.minecraft.server.v1_8_R1.EntityLiving;
import net.minecraft.server.v1_8_R1.MathHelper;
import net.minecraft.server.v1_8_R2.Entity;
import net.minecraft.server.v1_8_R2.EntityLiving;
import net.minecraft.server.v1_8_R2.MathHelper;
import org.bukkit.craftbukkit.v1_8_R1.TrigMath;
import org.bukkit.craftbukkit.v1_8_R2.TrigMath;
public class PlayerControllerLook {
private final EntityHumanNPC a;

View File

@ -2,11 +2,11 @@ package net.citizensnpcs.util.nms;
import net.citizensnpcs.npc.entity.EntityHumanNPC;
import net.citizensnpcs.util.NMS;
import net.minecraft.server.v1_8_R1.AttributeInstance;
import net.minecraft.server.v1_8_R1.GenericAttributes;
import net.minecraft.server.v1_8_R1.MathHelper;
import net.minecraft.server.v1_8_R2.AttributeInstance;
import net.minecraft.server.v1_8_R2.GenericAttributes;
import net.minecraft.server.v1_8_R2.MathHelper;
import org.bukkit.craftbukkit.v1_8_R1.TrigMath;
import org.bukkit.craftbukkit.v1_8_R2.TrigMath;
public class PlayerControllerMove {
protected EntityHumanNPC a;
@ -62,7 +62,7 @@ public class PlayerControllerMove {
}
public void c() {
this.a.aY = 0F;
this.a.ba = 0F;
if (this.f) {
this.f = false;
int i = MathHelper.floor(this.a.getBoundingBox().b + 0.5D);
@ -79,8 +79,7 @@ public class PlayerControllerMove {
AttributeInstance speed = this.a.getAttributeInstance(GenericAttributes.d);
speed.setValue(0.1D * this.e);
float movement = (float) (this.e * speed.getValue()) * 10;
this.a.j(movement);
this.a.aY = movement;
this.a.ba = movement;
if ((d2 > 0.0D) && (d0 * d0 + d1 * d1 < 1.0D))
this.a.getControllerJump().a();
}

View File

@ -1,24 +1,24 @@
package net.citizensnpcs.util.nms;
import net.citizensnpcs.npc.entity.EntityHumanNPC;
import net.minecraft.server.v1_8_R1.AttributeInstance;
import net.minecraft.server.v1_8_R1.Block;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.Blocks;
import net.minecraft.server.v1_8_R1.ChunkCache;
import net.minecraft.server.v1_8_R1.Entity;
import net.minecraft.server.v1_8_R1.EntityChicken;
import net.minecraft.server.v1_8_R1.EntityInsentient;
import net.minecraft.server.v1_8_R1.GenericAttributes;
import net.minecraft.server.v1_8_R1.Material;
import net.minecraft.server.v1_8_R1.MathHelper;
import net.minecraft.server.v1_8_R1.NavigationAbstract;
import net.minecraft.server.v1_8_R1.PathEntity;
import net.minecraft.server.v1_8_R1.PathPoint;
import net.minecraft.server.v1_8_R1.Pathfinder;
import net.minecraft.server.v1_8_R1.PathfinderNormal;
import net.minecraft.server.v1_8_R1.Vec3D;
import net.minecraft.server.v1_8_R1.World;
import net.minecraft.server.v1_8_R2.AttributeInstance;
import net.minecraft.server.v1_8_R2.Block;
import net.minecraft.server.v1_8_R2.BlockPosition;
import net.minecraft.server.v1_8_R2.Blocks;
import net.minecraft.server.v1_8_R2.ChunkCache;
import net.minecraft.server.v1_8_R2.Entity;
import net.minecraft.server.v1_8_R2.EntityChicken;
import net.minecraft.server.v1_8_R2.EntityInsentient;
import net.minecraft.server.v1_8_R2.GenericAttributes;
import net.minecraft.server.v1_8_R2.Material;
import net.minecraft.server.v1_8_R2.MathHelper;
import net.minecraft.server.v1_8_R2.NavigationAbstract;
import net.minecraft.server.v1_8_R2.PathEntity;
import net.minecraft.server.v1_8_R2.PathPoint;
import net.minecraft.server.v1_8_R2.Pathfinder;
import net.minecraft.server.v1_8_R2.PathfinderNormal;
import net.minecraft.server.v1_8_R2.Vec3D;
import net.minecraft.server.v1_8_R2.World;
public class PlayerNavigation extends NavigationAbstract {
private final AttributeInstance a;
@ -245,19 +245,17 @@ public class PlayerNavigation extends NavigationAbstract {
@Override
protected boolean b() {
return (this.b.onGround) || ((h()) && (o())) || ((this.b.av()) && ((this.b.vehicle instanceof EntityChicken)));
return (this.b.onGround) || ((h()) && (o())) || ((this.b.au()) && ((this.b.vehicle instanceof EntityChicken)));
}
public void b(boolean paramBoolean) {
this.aa.b(paramBoolean);
}
@SuppressWarnings("unchecked")
private boolean b(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6,
Vec3D paramVec3D, double paramDouble1, double paramDouble2) {
for (BlockPosition localBlockPosition : (Iterable<BlockPosition>) BlockPosition.a(new BlockPosition(paramInt1,
paramInt2, paramInt3), new BlockPosition(paramInt1 + paramInt4 - 1, paramInt2 + paramInt5 - 1,
paramInt3 + paramInt6 - 1))) {
for (BlockPosition localBlockPosition : BlockPosition.a(new BlockPosition(paramInt1, paramInt2, paramInt3),
new BlockPosition(paramInt1 + paramInt4 - 1, paramInt2 + paramInt5 - 1, paramInt3 + paramInt6 - 1))) {
double d1 = localBlockPosition.getX() + 0.5D - paramVec3D.a;
double d2 = localBlockPosition.getZ() + 0.5D - paramVec3D.c;
if (d1 * paramDouble1 + d2 * paramDouble2 < 0.0D) {

View File

@ -3,11 +3,10 @@ package net.citizensnpcs.util.nms;
import java.lang.reflect.Field;
import net.citizensnpcs.util.NMS;
import net.minecraft.server.v1_8_R1.Entity;
import net.minecraft.server.v1_8_R1.EntityPlayer;
import net.minecraft.server.v1_8_R1.EntityTrackerEntry;
import net.minecraft.server.v1_8_R1.EnumPlayerInfoAction;
import net.minecraft.server.v1_8_R1.PacketPlayOutPlayerInfo;
import net.minecraft.server.v1_8_R2.Entity;
import net.minecraft.server.v1_8_R2.EntityPlayer;
import net.minecraft.server.v1_8_R2.EntityTrackerEntry;
import net.minecraft.server.v1_8_R2.PacketPlayOutPlayerInfo;
import org.bukkit.entity.Player;
@ -31,7 +30,7 @@ public class PlayerlistTrackerEntry extends EntityTrackerEntry {
return;
}
entityplayer.playerConnection.sendPacket(new PacketPlayOutPlayerInfo(
EnumPlayerInfoAction.ADD_PLAYER, (EntityPlayer) this.tracker));
PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, (EntityPlayer) this.tracker));
}
}
}