Initial update to MC 1.7.5

This commit is contained in:
fullwall 2014-03-23 17:34:02 +08:00
parent 1a8a9d1d6e
commit 8d14e90ef6
77 changed files with 1123 additions and 1089 deletions

View File

@ -6,13 +6,13 @@
<groupId>net.citizensnpcs</groupId>
<artifactId>citizens</artifactId>
<version>2.0.11-SNAPSHOT</version>
<version>2.0.12-SNAPSHOT</version>
<name>Citizens</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<craftbukkit.version>1.7.2-R0.1-SNAPSHOT</craftbukkit.version>
<citizensapi.version>2.0.11-SNAPSHOT</citizensapi.version>
<craftbukkit.version>1.7.5-R0.1-SNAPSHOT</craftbukkit.version>
<citizensapi.version>2.0.12-SNAPSHOT</citizensapi.version>
<vault.version>1.2.19-SNAPSHOT</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.7.2";
private static final String COMPATIBLE_MC_VERSION = "1.7.5";
}

View File

@ -23,11 +23,11 @@ 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_7_R1.PacketPlayOutEntityTeleport;
import net.minecraft.server.v1_7_R2.PacketPlayOutEntityTeleport;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
@ -160,7 +160,7 @@ public class CitizensNPC extends AbstractNPC {
at = at.clone();
entityController.spawn(at, this);
net.minecraft.server.v1_7_R1.Entity mcEntity = ((CraftEntity) getEntity()).getHandle();
net.minecraft.server.v1_7_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_7_R1.World;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Location;
import org.bukkit.block.BlockFace;
import org.bukkit.craftbukkit.v1_7_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_7_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_7_R1.Entity entity = createEntityFromClass(((CraftWorld) at.getWorld()).getHandle(),
net.minecraft.server.v1_7_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_7_R1.Entity createEntityFromClass(Object... args) {
private net.minecraft.server.v1_7_R2.Entity createEntityFromClass(Object... args) {
try {
return (net.minecraft.server.v1_7_R1.Entity) constructor.newInstance(args);
return (net.minecraft.server.v1_7_R2.Entity) constructor.newInstance(args);
} catch (Exception ex) {
ex.printStackTrace();
return null;

View File

@ -68,7 +68,7 @@ public class AStarNavigationStrategy extends AbstractPathStrategy {
}
vector = plan.getCurrentVector();
}
net.minecraft.server.v1_7_R1.Entity handle = NMS.getHandle(npc.getEntity());
net.minecraft.server.v1_7_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,19 +5,19 @@ 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_7_R1.Block;
import net.minecraft.server.v1_7_R1.Blocks;
import net.minecraft.server.v1_7_R1.Enchantment;
import net.minecraft.server.v1_7_R1.EnchantmentManager;
import net.minecraft.server.v1_7_R1.EntityLiving;
import net.minecraft.server.v1_7_R1.EntityPlayer;
import net.minecraft.server.v1_7_R1.ItemStack;
import net.minecraft.server.v1_7_R1.Material;
import net.minecraft.server.v1_7_R1.MobEffectList;
import net.minecraft.server.v1_7_R2.Block;
import net.minecraft.server.v1_7_R2.Blocks;
import net.minecraft.server.v1_7_R2.Enchantment;
import net.minecraft.server.v1_7_R2.EnchantmentManager;
import net.minecraft.server.v1_7_R2.EntityLiving;
import net.minecraft.server.v1_7_R2.EntityPlayer;
import net.minecraft.server.v1_7_R2.ItemStack;
import net.minecraft.server.v1_7_R2.Material;
import net.minecraft.server.v1_7_R2.MobEffectList;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftLivingEntity;
import org.bukkit.craftbukkit.v1_7_R1.inventory.CraftItemStack;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftLivingEntity;
import org.bukkit.craftbukkit.v1_7_R2.inventory.CraftItemStack;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
@ -45,7 +45,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_7_R1.ItemStack getCurrentItem() {
private net.minecraft.server.v1_7_R2.ItemStack getCurrentItem() {
return configuration.item() != null ? CraftItemStack.asNMSCopy(configuration.item()) : entity.getEquipment(0);
}

View File

@ -12,7 +12,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_7_R1.MathHelper;
import net.minecraft.server.v1_7_R2.MathHelper;
import org.bukkit.Location;
import org.bukkit.util.Vector;

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_7_R1.EntityLiving;
import net.minecraft.server.v1_7_R1.Navigation;
import net.minecraft.server.v1_7_R2.EntityLiving;
import net.minecraft.server.v1_7_R2.Navigation;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftLivingEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftLivingEntity;
public class MCNavigationStrategy extends AbstractPathStrategy {
private final Navigation navigation;

View File

@ -11,15 +11,15 @@ import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.PlayerAnimation;
import net.citizensnpcs.util.nms.PlayerNavigation;
import net.minecraft.server.v1_7_R1.AttributeInstance;
import net.minecraft.server.v1_7_R1.Entity;
import net.minecraft.server.v1_7_R1.EntityLiving;
import net.minecraft.server.v1_7_R1.EntityPlayer;
import net.minecraft.server.v1_7_R1.Navigation;
import net.minecraft.server.v1_7_R1.PathEntity;
import net.minecraft.server.v1_7_R2.AttributeInstance;
import net.minecraft.server.v1_7_R2.Entity;
import net.minecraft.server.v1_7_R2.EntityLiving;
import net.minecraft.server.v1_7_R2.EntityPlayer;
import net.minecraft.server.v1_7_R2.Navigation;
import net.minecraft.server.v1_7_R2.PathEntity;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.entity.LivingEntity;
public class MCTargetStrategy implements PathStrategy, EntityTarget {

View File

@ -7,13 +7,13 @@ 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_7_R1.EntityBat;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityBat;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftBat;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftBat;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.entity.Bat;
import org.bukkit.util.Vector;
@ -57,34 +57,20 @@ public class BatController extends MobEntityController {
}
}
@Override
protected String aS() {
return npc == null ? super.aS() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aS());
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
public boolean bL() {
public void bm() {
if (npc == null) {
return super.bL();
}
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.bL();
if (super.bL()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void bn() {
if (npc == null) {
super.bn();
super.bm();
} else {
NMS.updateAI(this);
npc.update();
@ -92,7 +78,21 @@ public class BatController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public boolean bN() {
if (npc == null) {
return super.bN();
}
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.bN();
if (super.bN()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_7_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -143,12 +143,12 @@ public class BatController extends MobEntityController {
}
public void setFlying(boolean flying) {
a(flying);
setStartled(flying);
}
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
return npc == null ? super.aS() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
@Override

View File

@ -7,13 +7,13 @@ 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_7_R1.EntityBlaze;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityBlaze;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftBlaze;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftBlaze;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.entity.Blaze;
import org.bukkit.util.Vector;
@ -56,41 +56,41 @@ public class BlazeController extends MobEntityController {
}
}
@Override
protected String aS() {
return npc == null ? super.aS() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aS());
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
public boolean bL() {
public boolean bN() {
if (npc == null)
return super.bL();
return super.bN();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.bL();
if (super.bL()) {
return super.bN();
if (super.bN()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void bq() {
public void bp() {
if (npc != null) {
NMS.updateAI(this);
npc.update();
} else {
super.bq();
super.bp();
}
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -135,7 +135,7 @@ public class BlazeController extends MobEntityController {
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
return npc == null ? super.aS() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
@Override

View File

@ -7,13 +7,13 @@ 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_7_R1.EntityCaveSpider;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityCaveSpider;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftCaveSpider;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftCaveSpider;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.entity.CaveSpider;
import org.bukkit.util.Vector;
@ -64,13 +64,13 @@ public class CaveSpiderController extends MobEntityController {
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
protected String aS() {
return npc == null ? super.aS() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aS());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aT());
}
@Override
@ -81,32 +81,32 @@ public class CaveSpiderController extends MobEntityController {
}
@Override
public boolean bL() {
public boolean bN() {
if (npc == null) {
return super.bL();
return super.bN();
}
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault)) {
return super.bL();
return super.bN();
}
if (super.bL()) {
if (super.bN()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void bn() {
super.bn();
public void bm() {
super.bm();
if (npc != null) {
npc.update();
}
}
@Override
public void bq() {
public void bp() {
if (npc == null) {
super.bq();
super.bp();
} else {
NMS.updateAI(this);
npc.update();
@ -114,7 +114,7 @@ public class CaveSpiderController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -177,7 +177,7 @@ public class CaveSpiderController extends MobEntityController {
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
return npc == null ? super.aS() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
@Override

View File

@ -7,13 +7,13 @@ 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_7_R1.EntityChicken;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityChicken;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftChicken;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftChicken;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.entity.Chicken;
import org.bukkit.util.Vector;
@ -75,13 +75,13 @@ public class ChickenController extends MobEntityController {
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
protected String aS() {
return npc == null ? super.aS() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aS());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aT());
}
@Override
@ -92,27 +92,27 @@ public class ChickenController extends MobEntityController {
}
@Override
public boolean bL() {
public boolean bN() {
if (npc == null)
return super.bL();
return super.bN();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.bL();
if (super.bL()) {
return super.bN();
if (super.bN()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void bn() {
super.bn();
public void bm() {
super.bm();
if (npc != null)
npc.update();
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -183,7 +183,7 @@ public class ChickenController extends MobEntityController {
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
return npc == null ? super.aS() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
@Override

View File

@ -7,13 +7,13 @@ 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_7_R1.EntityCow;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityCow;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftCow;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftCow;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.entity.Cow;
import org.bukkit.util.Vector;
@ -76,13 +76,13 @@ public class CowController extends MobEntityController {
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
protected String aS() {
return npc == null ? super.aS() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aS());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aT());
}
@Override
@ -93,28 +93,28 @@ public class CowController extends MobEntityController {
}
@Override
public boolean bL() {
public boolean bN() {
if (npc == null)
return super.bL();
return super.bN();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.bL();
if (super.bL()) {
return super.bN();
if (super.bN()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void bn() {
super.bn();
public void bm() {
super.bm();
if (npc != null) {
npc.update();
}
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -177,7 +177,7 @@ public class CowController extends MobEntityController {
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
return npc == null ? super.aS() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
@Override

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_7_R1.EntityCreeper;
import net.minecraft.server.v1_7_R1.EntityLightning;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityCreeper;
import net.minecraft.server.v1_7_R2.EntityLightning;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftCreeper;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftCreeper;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.entity.Creeper;
import org.bukkit.util.Vector;
@ -72,13 +72,13 @@ public class CreeperController extends MobEntityController {
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
protected String aS() {
return npc == null ? super.aS() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aS());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aT());
}
@Override
@ -89,28 +89,28 @@ public class CreeperController extends MobEntityController {
}
@Override
public boolean bL() {
public boolean bN() {
if (npc == null)
return super.bL();
return super.bN();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.bL();
if (super.bL()) {
return super.bN();
if (super.bN()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void bn() {
super.bn();
public void bm() {
super.bm();
if (npc != null) {
npc.update();
}
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -176,7 +176,7 @@ public class CreeperController extends MobEntityController {
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
return npc == null ? super.aS() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
@Override

View File

@ -7,13 +7,13 @@ 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_7_R1.EntityEnderDragon;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityEnderDragon;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEnderDragon;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEnderDragon;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.entity.EnderDragon;
import org.bukkit.util.Vector;
@ -56,38 +56,38 @@ public class EnderDragonController extends MobEntityController {
}
}
@Override
protected String aS() {
return npc == null ? super.aS() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aS());
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
public boolean bL() {
public boolean bN() {
if (npc == null)
return super.bL();
return super.bN();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.bL();
if (super.bL()) {
return super.bN();
if (super.bN()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void bq() {
public void bp() {
if (npc == null) {
super.bq();
super.bp();
}
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -156,7 +156,7 @@ public class EnderDragonController extends MobEntityController {
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
return npc == null ? super.aS() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
@Override

View File

@ -7,13 +7,13 @@ 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_7_R1.EntityEnderman;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityEnderman;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEnderman;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEnderman;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.entity.Enderman;
import org.bukkit.util.Vector;
@ -65,13 +65,13 @@ public class EndermanController extends MobEntityController {
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
protected String aS() {
return npc == null ? super.aS() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aS());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aT());
}
@Override
@ -82,29 +82,29 @@ public class EndermanController extends MobEntityController {
}
@Override
public boolean bL() {
public void bm() {
super.bm();
if (npc != null)
npc.update();
}
@Override
public boolean bN() {
if (npc == null)
return super.bL();
return super.bN();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.bL();
if (super.bL()) {
return super.bN();
if (super.bN()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void bn() {
super.bn();
if (npc != null)
npc.update();
}
@Override
public void bq() {
public void bp() {
if (npc == null)
super.bq();
super.bp();
else {
NMS.updateAI(this);
npc.update();
@ -112,7 +112,7 @@ public class EndermanController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -192,28 +192,28 @@ public class EndermanController extends MobEntityController {
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
return npc == null ? super.aS() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
private void updateAIWithMovement() {
NMS.updateAI(this);
// taken from EntityLiving update method
if (bd) {
if (bc) {
/* boolean inLiquid = H() || J();
if (inLiquid) {
motY += 0.04;
} else //(handled elsewhere)*/
if (onGround && jumpTicks == 0) {
bj();
bi();
jumpTicks = 10;
}
} else {
jumpTicks = 0;
}
bd *= 0.98F;
be *= 0.98F;
bf *= 0.98F;
bg *= 0.9F;
e(be, bf); // movement method
bf *= 0.9F;
e(bd, be); // movement method
NMS.setHeadYaw(this, yaw);
if (jumpTicks > 0) {
jumpTicks--;

View File

@ -18,27 +18,27 @@ 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_7_R1.AttributeInstance;
import net.minecraft.server.v1_7_R1.Entity;
import net.minecraft.server.v1_7_R1.EntityPlayer;
import net.minecraft.server.v1_7_R1.EnumGamemode;
import net.minecraft.server.v1_7_R1.GenericAttributes;
import net.minecraft.server.v1_7_R1.MathHelper;
import net.minecraft.server.v1_7_R1.MinecraftServer;
import net.minecraft.server.v1_7_R1.Navigation;
import net.minecraft.server.v1_7_R1.NetworkManager;
import net.minecraft.server.v1_7_R1.Packet;
import net.minecraft.server.v1_7_R1.PacketPlayOutEntityEquipment;
import net.minecraft.server.v1_7_R1.PacketPlayOutEntityHeadRotation;
import net.minecraft.server.v1_7_R1.PacketPlayOutPlayerInfo;
import net.minecraft.server.v1_7_R1.PlayerInteractManager;
import net.minecraft.server.v1_7_R1.WorldServer;
import net.minecraft.server.v1_7_R2.AttributeInstance;
import net.minecraft.server.v1_7_R2.Entity;
import net.minecraft.server.v1_7_R2.EntityPlayer;
import net.minecraft.server.v1_7_R2.EnumGamemode;
import net.minecraft.server.v1_7_R2.GenericAttributes;
import net.minecraft.server.v1_7_R2.MathHelper;
import net.minecraft.server.v1_7_R2.MinecraftServer;
import net.minecraft.server.v1_7_R2.Navigation;
import net.minecraft.server.v1_7_R2.NetworkManager;
import net.minecraft.server.v1_7_R2.Packet;
import net.minecraft.server.v1_7_R2.PacketPlayOutEntityEquipment;
import net.minecraft.server.v1_7_R2.PacketPlayOutEntityHeadRotation;
import net.minecraft.server.v1_7_R2.PacketPlayOutPlayerInfo;
import net.minecraft.server.v1_7_R2.PlayerInteractManager;
import net.minecraft.server.v1_7_R2.WorldServer;
import net.minecraft.util.com.mojang.authlib.GameProfile;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftPlayer;
import org.bukkit.metadata.MetadataValue;
import org.bukkit.plugin.Plugin;
import org.bukkit.util.Vector;
@ -80,7 +80,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -205,7 +205,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
AttributeInstance range = this.getAttributeInstance(GenericAttributes.b);
if (range == null) {
range = this.bc().b(GenericAttributes.b);
range = this.bb().b(GenericAttributes.b);
}
range.setValue(Setting.DEFAULT_PATHFINDING_RANGE.asDouble());
controllerJump = new PlayerControllerJump(this);
@ -220,18 +220,18 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
private void moveOnCurrentHeading() {
NMS.updateAI(this);
if (bd) {
if (bc) {
if (onGround && jumpTicks == 0) {
bj();
bi();
jumpTicks = 10;
}
} else {
jumpTicks = 0;
}
bd *= 0.98F;
be *= 0.98F;
bf *= 0.98F;
bg *= 0.9F;
e(be, bf); // movement method
bf *= 0.9F;
e(bd, be); // movement method
NMS.setHeadYaw(this, yaw);
if (jumpTicks > 0) {
jumpTicks--;

View File

@ -7,13 +7,13 @@ 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_7_R1.EntityGhast;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityGhast;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftGhast;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftGhast;
import org.bukkit.entity.Ghast;
import org.bukkit.util.Vector;
@ -42,39 +42,39 @@ public class GhastController extends MobEntityController {
}
}
@Override
protected String aS() {
return npc == null ? super.aS() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aS());
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
public boolean bL() {
public boolean bN() {
if (npc == null)
return super.bL();
return super.bN();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.bL();
if (super.bL()) {
return super.bN();
if (super.bN()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void bq() {
public void bp() {
if (npc != null) {
npc.update();
} else
super.bq();
super.bp();
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_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 GhastController extends MobEntityController {
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
return npc == null ? super.aS() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
@Override

View File

@ -7,13 +7,13 @@ 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_7_R1.EntityGiantZombie;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityGiantZombie;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftGiant;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftGiant;
import org.bukkit.entity.Giant;
import org.bukkit.util.Vector;
@ -50,13 +50,13 @@ public class GiantController extends MobEntityController {
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
protected String aS() {
return npc == null ? super.aS() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aS());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aT());
}
@Override
@ -67,22 +67,22 @@ public class GiantController extends MobEntityController {
}
@Override
public boolean bL() {
public boolean bN() {
if (npc == null)
return super.bL();
return super.bN();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.bL();
if (super.bL()) {
return super.bN();
if (super.bN()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void bq() {
public void bp() {
if (npc == null) {
super.bq();
super.bp();
} else {
NMS.updateAI(this);
npc.update();
@ -90,7 +90,7 @@ public class GiantController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -152,7 +152,7 @@ public class GiantController extends MobEntityController {
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
return npc == null ? super.aS() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
@Override

View File

@ -8,14 +8,14 @@ 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_7_R1.EntityHorse;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityHorse;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftHorse;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftHorse;
import org.bukkit.entity.Horse;
import org.bukkit.util.Vector;
@ -71,13 +71,13 @@ public class HorseController extends MobEntityController {
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
protected String aS() {
return npc == null ? super.aS() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aS());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aT());
}
@Override
@ -88,20 +88,20 @@ public class HorseController extends MobEntityController {
}
@Override
public boolean bL() {
public boolean bN() {
if (npc == null)
return super.bL();
return super.bN();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.bL();
if (super.bL()) {
return super.bN();
if (super.bN()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -175,29 +175,29 @@ public class HorseController extends MobEntityController {
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
return npc == null ? super.aS() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
private void updateAIWithMovement() {
NMS.updateAI(this);
// taken from EntityLiving update method
if (bd) {
if (bc) {
/* boolean inLiquid = H() || J();
if (inLiquid) {
motY += 0.04;
} else //(handled elsewhere)*/
if (onGround && jumpTicks == 0) {
bj();
bi();
jumpTicks = 10;
}
} else {
jumpTicks = 0;
}
bd *= 0.98F;
be *= 0.98F;
bf *= 0.98F;
bg *= 0.9F;
bf *= 0.9F;
e(be, bf); // movement method
e(bd, be); // movement method
NMS.setHeadYaw(this, yaw);
if (jumpTicks > 0) {
jumpTicks--;

View File

@ -8,13 +8,13 @@ import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.api.util.Colorizer;
import net.citizensnpcs.npc.AbstractEntityController;
import net.citizensnpcs.util.NMS;
import net.minecraft.server.v1_7_R1.PlayerInteractManager;
import net.minecraft.server.v1_7_R1.WorldServer;
import net.minecraft.server.v1_7_R2.PlayerInteractManager;
import net.minecraft.server.v1_7_R2.WorldServer;
import net.minecraft.util.com.mojang.authlib.GameProfile;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_7_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_7_R2.CraftWorld;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;

View File

@ -7,13 +7,13 @@ 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_7_R1.EntityIronGolem;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityIronGolem;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftIronGolem;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftIronGolem;
import org.bukkit.entity.IronGolem;
import org.bukkit.util.Vector;
@ -50,13 +50,13 @@ public class IronGolemController extends MobEntityController {
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
protected String aS() {
return npc == null ? super.aS() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aS());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aT());
}
@Override
@ -67,27 +67,27 @@ public class IronGolemController extends MobEntityController {
}
@Override
public boolean bL() {
public boolean bN() {
if (npc == null)
return super.bL();
return super.bN();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.bL();
if (super.bL()) {
return super.bN();
if (super.bN()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void bn() {
super.bn();
public void bm() {
super.bm();
if (npc != null)
npc.update();
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -149,7 +149,7 @@ public class IronGolemController extends MobEntityController {
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
return npc == null ? super.aS() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
@Override

View File

@ -7,13 +7,13 @@ 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_7_R1.EntityMagmaCube;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityMagmaCube;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftMagmaCube;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftMagmaCube;
import org.bukkit.entity.MagmaCube;
import org.bukkit.util.Vector;
@ -51,13 +51,13 @@ public class MagmaCubeController extends MobEntityController {
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
protected String aS() {
return npc == null ? super.aS() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aS());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aT());
}
@Override
@ -68,29 +68,29 @@ public class MagmaCubeController extends MobEntityController {
}
@Override
public boolean bL() {
public boolean bN() {
if (npc == null)
return super.bL();
return super.bN();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.bL();
if (super.bL()) {
return super.bN();
if (super.bN()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void bn() {
super.bn();
public void bm() {
super.bm();
if (npc != null)
npc.update();
}
@Override
public void bq() {
public void bp() {
if (npc == null)
super.bq();
super.bp();
else {
NMS.updateAI(this);
npc.update();
@ -98,7 +98,7 @@ public class MagmaCubeController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -160,7 +160,7 @@ public class MagmaCubeController extends MobEntityController {
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
return npc == null ? super.aS() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
@Override

View File

@ -7,13 +7,13 @@ 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_7_R1.EntityMushroomCow;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityMushroomCow;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftMushroomCow;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftMushroomCow;
import org.bukkit.entity.MushroomCow;
import org.bukkit.util.Vector;
@ -62,13 +62,13 @@ public class MushroomCowController extends MobEntityController {
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
protected String aS() {
return npc == null ? super.aS() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aS());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aT());
}
@Override
@ -79,27 +79,27 @@ public class MushroomCowController extends MobEntityController {
}
@Override
public boolean bL() {
public boolean bN() {
if (npc == null)
return super.bL();
return super.bN();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.bL();
if (super.bL()) {
return super.bN();
if (super.bN()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void bn() {
super.bn();
public void bm() {
super.bm();
if (npc != null)
npc.update();
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -161,7 +161,7 @@ public class MushroomCowController extends MobEntityController {
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
return npc == null ? super.aS() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
@Override

View File

@ -7,13 +7,13 @@ 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_7_R1.EntityOcelot;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityOcelot;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftOcelot;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftOcelot;
import org.bukkit.entity.Ocelot;
import org.bukkit.util.Vector;
@ -61,13 +61,13 @@ public class OcelotController extends MobEntityController {
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
protected String aS() {
return npc == null ? super.aS() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aS());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aT());
}
@Override
@ -78,27 +78,27 @@ public class OcelotController extends MobEntityController {
}
@Override
public boolean bL() {
public boolean bN() {
if (npc == null)
return super.bL();
return super.bN();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.bL();
if (super.bL()) {
return super.bN();
if (super.bN()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void bn() {
super.bn();
public void bm() {
super.bm();
if (npc != null)
npc.update();
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -160,7 +160,7 @@ public class OcelotController extends MobEntityController {
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
return npc == null ? super.aS() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
@Override

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_7_R1.EntityLightning;
import net.minecraft.server.v1_7_R1.EntityPig;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityLightning;
import net.minecraft.server.v1_7_R2.EntityPig;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPig;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftPig;
import org.bukkit.entity.Pig;
import org.bukkit.util.Vector;
@ -68,13 +68,13 @@ public class PigController extends MobEntityController {
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
protected String aS() {
return npc == null ? super.aS() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aS());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aT());
}
@Override
@ -85,27 +85,27 @@ public class PigController extends MobEntityController {
}
@Override
public boolean bL() {
public boolean bN() {
if (npc == null)
return super.bL();
return super.bN();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.bL();
if (super.bL()) {
return super.bN();
if (super.bN()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void bn() {
super.bn();
public void bm() {
super.bm();
if (npc != null)
npc.update();
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -167,7 +167,7 @@ public class PigController extends MobEntityController {
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
return npc == null ? super.aS() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
@Override

View File

@ -7,13 +7,13 @@ 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_7_R1.EntityPigZombie;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityPigZombie;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPigZombie;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftPigZombie;
import org.bukkit.entity.PigZombie;
import org.bukkit.util.Vector;
@ -51,13 +51,13 @@ public class PigZombieController extends MobEntityController {
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
protected String aS() {
return npc == null ? super.aS() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aS());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aT());
}
@Override
@ -68,29 +68,29 @@ public class PigZombieController extends MobEntityController {
}
@Override
public boolean bL() {
public boolean bN() {
if (npc == null)
return super.bL();
return super.bN();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.bL();
if (super.bL()) {
return super.bN();
if (super.bN()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void bn() {
super.bn();
public void bm() {
super.bm();
if (npc != null)
npc.update();
}
@Override
public void bq() {
public void bp() {
if (npc == null) {
super.bq();
super.bp();
} else {
NMS.updateAI(this);
npc.update();
@ -98,7 +98,7 @@ public class PigZombieController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -160,7 +160,7 @@ public class PigZombieController extends MobEntityController {
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
return npc == null ? super.aS() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
@Override

View File

@ -7,13 +7,13 @@ 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_7_R1.EntitySheep;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntitySheep;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftSheep;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftSheep;
import org.bukkit.entity.Sheep;
import org.bukkit.util.Vector;
@ -61,13 +61,13 @@ public class SheepController extends MobEntityController {
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
protected String aS() {
return npc == null ? super.aS() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aS());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aT());
}
@Override
@ -78,27 +78,27 @@ public class SheepController extends MobEntityController {
}
@Override
public boolean bL() {
public boolean bN() {
if (npc == null)
return super.bL();
return super.bN();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.bL();
if (super.bL()) {
return super.bN();
if (super.bN()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void bn() {
super.bn();
public void bm() {
super.bm();
if (npc != null)
npc.update();
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -160,7 +160,7 @@ public class SheepController extends MobEntityController {
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
return npc == null ? super.aS() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
@Override

View File

@ -7,13 +7,13 @@ 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_7_R1.EntitySilverfish;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntitySilverfish;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftSilverfish;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftSilverfish;
import org.bukkit.entity.Silverfish;
import org.bukkit.util.Vector;
@ -50,13 +50,13 @@ public class SilverfishController extends MobEntityController {
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
protected String aS() {
return npc == null ? super.aS() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aS());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aT());
}
@Override
@ -67,29 +67,29 @@ public class SilverfishController extends MobEntityController {
}
@Override
public boolean bL() {
public boolean bN() {
if (npc == null)
return super.bL();
return super.bN();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.bL();
if (super.bL()) {
return super.bN();
if (super.bN()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void bn() {
super.bn();
public void bm() {
super.bm();
if (npc != null)
npc.update();
}
@Override
public void bq() {
public void bp() {
if (npc == null) {
super.bq();
super.bp();
} else {
NMS.updateAI(this);
npc.update();
@ -97,7 +97,7 @@ public class SilverfishController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -159,7 +159,7 @@ public class SilverfishController extends MobEntityController {
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
return npc == null ? super.aS() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
@Override

View File

@ -7,13 +7,13 @@ 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_7_R1.EntitySkeleton;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntitySkeleton;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftSkeleton;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftSkeleton;
import org.bukkit.entity.Skeleton;
import org.bukkit.util.Vector;
@ -50,13 +50,13 @@ public class SkeletonController extends MobEntityController {
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
protected String aS() {
return npc == null ? super.aS() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aS());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aT());
}
@Override
@ -67,27 +67,27 @@ public class SkeletonController extends MobEntityController {
}
@Override
public boolean bL() {
public boolean bN() {
if (npc == null)
return super.bL();
return super.bN();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.bL();
if (super.bL()) {
return super.bN();
if (super.bN()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void bn() {
super.bn();
public void bm() {
super.bm();
if (npc != null)
npc.update();
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -149,7 +149,7 @@ public class SkeletonController extends MobEntityController {
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
return npc == null ? super.aS() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
@Override

View File

@ -7,13 +7,13 @@ 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_7_R1.EntitySlime;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntitySlime;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftSlime;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftSlime;
import org.bukkit.entity.Slime;
import org.bukkit.util.Vector;
@ -52,13 +52,13 @@ public class SlimeController extends MobEntityController {
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
protected String aS() {
return npc == null ? super.aS() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aS());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aT());
}
@Override
@ -69,29 +69,29 @@ public class SlimeController extends MobEntityController {
}
@Override
public boolean bL() {
public boolean bN() {
if (npc == null)
return super.bL();
return super.bN();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.bL();
if (super.bL()) {
return super.bN();
if (super.bN()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void bn() {
super.bn();
public void bm() {
super.bm();
if (npc != null)
npc.update();
}
@Override
public void bq() {
public void bp() {
if (npc == null) {
super.bq();
super.bp();
} else {
npc.update();
NMS.updateAI(this);
@ -99,7 +99,7 @@ public class SlimeController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -161,7 +161,7 @@ public class SlimeController extends MobEntityController {
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
return npc == null ? super.aS() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
@Override

View File

@ -7,13 +7,13 @@ 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_7_R1.EntitySnowman;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntitySnowman;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftSnowman;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftSnowman;
import org.bukkit.entity.Snowman;
import org.bukkit.util.Vector;
@ -50,13 +50,13 @@ public class SnowmanController extends MobEntityController {
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
protected String aS() {
return npc == null ? super.aS() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aS());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aT());
}
@Override
@ -67,27 +67,27 @@ public class SnowmanController extends MobEntityController {
}
@Override
public boolean bL() {
public boolean bN() {
if (npc == null)
return super.bL();
return super.bN();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.bL();
if (super.bL()) {
return super.bN();
if (super.bN()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void bn() {
super.bn();
public void bm() {
super.bm();
if (npc != null)
npc.update();
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -149,7 +149,7 @@ public class SnowmanController extends MobEntityController {
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
return npc == null ? super.aS() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
@Override

View File

@ -7,13 +7,13 @@ 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_7_R1.EntitySpider;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntitySpider;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftSpider;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftSpider;
import org.bukkit.entity.Spider;
import org.bukkit.util.Vector;
@ -50,13 +50,13 @@ public class SpiderController extends MobEntityController {
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
protected String aS() {
return npc == null ? super.aS() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aS());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aT());
}
@Override
@ -67,29 +67,29 @@ public class SpiderController extends MobEntityController {
}
@Override
public boolean bL() {
public boolean bN() {
if (npc == null)
return super.bL();
return super.bN();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.bL();
if (super.bL()) {
return super.bN();
if (super.bN()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void bn() {
super.bn();
public void bm() {
super.bm();
if (npc != null)
npc.update();
}
@Override
public void bq() {
public void bp() {
if (npc == null)
super.bq();
super.bp();
else {
NMS.updateAI(this);
npc.update();
@ -97,7 +97,7 @@ public class SpiderController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -159,7 +159,7 @@ public class SpiderController extends MobEntityController {
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
return npc == null ? super.aS() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
@Override

View File

@ -7,13 +7,13 @@ 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_7_R1.EntitySquid;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntitySquid;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftSquid;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftSquid;
import org.bukkit.entity.Squid;
import org.bukkit.util.Vector;
@ -50,13 +50,13 @@ public class SquidController extends MobEntityController {
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
protected String aS() {
return npc == null ? super.aS() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aS());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aT());
}
@Override
@ -67,28 +67,28 @@ public class SquidController extends MobEntityController {
}
@Override
public boolean bL() {
public boolean bN() {
if (npc == null)
return super.bL();
return super.bN();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.bL();
if (super.bL()) {
return super.bN();
if (super.bN()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void bq() {
public void bp() {
if (npc != null) {
npc.update();
} else
super.bq();
super.bp();
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -150,7 +150,7 @@ public class SquidController extends MobEntityController {
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
return npc == null ? super.aS() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
@Override

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_7_R1.EntityHuman;
import net.minecraft.server.v1_7_R1.EntityVillager;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityHuman;
import net.minecraft.server.v1_7_R2.EntityVillager;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftVillager;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftVillager;
import org.bukkit.entity.Villager;
import org.bukkit.util.Vector;
@ -69,13 +69,13 @@ public class VillagerController extends MobEntityController {
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
protected String aS() {
return npc == null ? super.aS() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aS());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aT());
}
@Override
@ -86,28 +86,28 @@ public class VillagerController extends MobEntityController {
}
@Override
public boolean bL() {
public boolean bN() {
if (npc == null)
return super.bL();
return super.bN();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.bL();
if (super.bL()) {
return super.bN();
if (super.bN()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void bn() {
super.bn();
public void bm() {
super.bm();
if (npc != null) {
npc.update();
}
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -178,7 +178,7 @@ public class VillagerController extends MobEntityController {
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
return npc == null ? super.aS() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
@Override

View File

@ -7,13 +7,13 @@ 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_7_R1.EntityWitch;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityWitch;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftWitch;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftWitch;
import org.bukkit.entity.Witch;
import org.bukkit.util.Vector;
@ -50,13 +50,13 @@ public class WitchController extends MobEntityController {
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
protected String aS() {
return npc == null ? super.aS() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aS());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aT());
}
@Override
@ -67,27 +67,27 @@ public class WitchController extends MobEntityController {
}
@Override
public boolean bL() {
public boolean bN() {
if (npc == null)
return super.bL();
return super.bN();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.bL();
if (super.bL()) {
return super.bN();
if (super.bN()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void bn() {
super.bn();
public void bm() {
super.bm();
if (npc != null)
npc.update();
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -149,7 +149,7 @@ public class WitchController extends MobEntityController {
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
return npc == null ? super.aS() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
@Override

View File

@ -7,13 +7,13 @@ 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_7_R1.EntityWither;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityWither;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftWither;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftWither;
import org.bukkit.entity.Wither;
import org.bukkit.util.Vector;
@ -43,39 +43,39 @@ public class WitherController extends MobEntityController {
}
}
@Override
protected String aS() {
return npc == null ? super.aS() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aS());
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aT());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
}
@Override
public boolean bL() {
if (npc == null)
return super.bL();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.bL();
if (super.bL()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void bn() {
super.bn();
public void bm() {
super.bm();
if (npc != null) {
npc.update();
}
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public boolean bN() {
if (npc == null)
return super.bN();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.bN();
if (super.bN()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void collide(net.minecraft.server.v1_7_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -128,29 +128,29 @@ public class WitherController extends MobEntityController {
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
return npc == null ? super.aS() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
private void updateAIWithMovement() {
NMS.updateAI(this);
// taken from EntityLiving update method
if (bd) {
if (bc) {
/* boolean inLiquid = H() || J();
if (inLiquid) {
motY += 0.04;
} else //(handled elsewhere)*/
if (onGround && jumpTicks == 0) {
bj();
bi();
jumpTicks = 10;
}
} else {
jumpTicks = 0;
}
bd *= 0.98F;
be *= 0.98F;
bf *= 0.98F;
bg *= 0.9F;
bf *= 0.9F;
e(be, bf); // movement method
e(bd, be); // movement method
NMS.setHeadYaw(this, yaw);
if (jumpTicks > 0) {
jumpTicks--;

View File

@ -7,13 +7,13 @@ 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_7_R1.EntityWolf;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityWolf;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftWolf;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftWolf;
import org.bukkit.entity.Wolf;
import org.bukkit.util.Vector;
@ -61,13 +61,13 @@ public class WolfController extends MobEntityController {
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
protected String aS() {
return npc == null ? super.aS() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aS());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aT());
}
@Override
@ -78,28 +78,28 @@ public class WolfController extends MobEntityController {
}
@Override
public boolean bL() {
public boolean bN() {
if (npc == null)
return super.bL();
return super.bN();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.bL();
if (super.bL()) {
return super.bN();
if (super.bN()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void bn() {
super.bn();
public void bm() {
super.bm();
if (npc != null) {
npc.update();
}
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -162,7 +162,7 @@ public class WolfController extends MobEntityController {
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
return npc == null ? super.aS() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
@Override

View File

@ -7,13 +7,13 @@ 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_7_R1.EntityZombie;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityZombie;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftZombie;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftZombie;
import org.bukkit.entity.Zombie;
import org.bukkit.util.Vector;
@ -50,13 +50,13 @@ public class ZombieController extends MobEntityController {
}
@Override
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aT());
protected String aS() {
return npc == null ? super.aS() : npc.data().get(NPC.HURT_SOUND_METADATA, super.aS());
}
@Override
protected String aU() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aU());
protected String aT() {
return npc == null ? super.aT() : npc.data().get(NPC.DEATH_SOUND_METADATA, super.aT());
}
@Override
@ -67,28 +67,28 @@ public class ZombieController extends MobEntityController {
}
@Override
public boolean bL() {
public boolean bN() {
if (npc == null)
return super.bL();
return super.bN();
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
return super.bL();
if (super.bL()) {
return super.bN();
if (super.bN()) {
unleash(true, false); // clearLeash with client update
}
return false; // shouldLeash
}
@Override
public void bn() {
super.bn();
public void bm() {
super.bm();
if (npc != null) {
npc.update();
}
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_R2.Entity entity) {
// this method is called by both the entities involved - cancelling
// it will not stop the NPC from moving.
super.collide(entity);
@ -150,7 +150,7 @@ public class ZombieController extends MobEntityController {
@Override
protected String t() {
return npc == null ? super.aT() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
return npc == null ? super.aS() : npc.data().get(NPC.AMBIENT_SOUND_METADATA, super.t());
}
@Override

View File

@ -6,13 +6,13 @@ 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_7_R1.EntityArrow;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityArrow;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftArrow;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftArrow;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.entity.Arrow;
import org.bukkit.util.Vector;
@ -53,7 +53,7 @@ public class ArrowController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_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

@ -6,13 +6,13 @@ 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_7_R1.EntityBoat;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityBoat;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftBoat;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftBoat;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.entity.Boat;
import org.bukkit.util.Vector;
@ -53,7 +53,7 @@ public class BoatController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_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

@ -6,16 +6,16 @@ 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_7_R1.EntityEgg;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R1.WorldServer;
import net.minecraft.server.v1_7_R2.EntityEgg;
import net.minecraft.server.v1_7_R2.World;
import net.minecraft.server.v1_7_R2.WorldServer;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEgg;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.CraftWorld;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEgg;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.entity.Egg;
import org.bukkit.entity.Entity;
import org.bukkit.util.Vector;
@ -69,7 +69,7 @@ public class EggController extends AbstractEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_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

@ -6,13 +6,13 @@ 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_7_R1.EntityEnderCrystal;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityEnderCrystal;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEnderCrystal;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEnderCrystal;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.entity.EnderCrystal;
import org.bukkit.util.Vector;
@ -53,7 +53,7 @@ public class EnderCrystalController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_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

@ -6,13 +6,13 @@ 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_7_R1.EntityEnderPearl;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityEnderPearl;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEnderPearl;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEnderPearl;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.entity.EnderPearl;
import org.bukkit.util.Vector;
@ -53,7 +53,7 @@ public class EnderPearlController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_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

@ -6,13 +6,13 @@ 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_7_R1.EntityEnderSignal;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityEnderSignal;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEnderSignal;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEnderSignal;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.entity.EnderSignal;
import org.bukkit.util.Vector;
@ -53,7 +53,7 @@ public class EnderSignalController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_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

@ -6,13 +6,13 @@ 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_7_R1.EntityExperienceOrb;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityExperienceOrb;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftExperienceOrb;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftExperienceOrb;
import org.bukkit.entity.ExperienceOrb;
import org.bukkit.util.Vector;
@ -39,7 +39,7 @@ public class ExperienceOrbController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_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

@ -6,20 +6,20 @@ 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_7_R1.Block;
import net.minecraft.server.v1_7_R1.Blocks;
import net.minecraft.server.v1_7_R1.EntityFallingBlock;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R1.WorldServer;
import net.minecraft.server.v1_7_R2.Block;
import net.minecraft.server.v1_7_R2.Blocks;
import net.minecraft.server.v1_7_R2.EntityFallingBlock;
import net.minecraft.server.v1_7_R2.World;
import net.minecraft.server.v1_7_R2.WorldServer;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftFallingSand;
import org.bukkit.craftbukkit.v1_7_R1.util.CraftMagicNumbers;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.CraftWorld;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftFallingSand;
import org.bukkit.craftbukkit.v1_7_R2.util.CraftMagicNumbers;
import org.bukkit.entity.Entity;
import org.bukkit.entity.FallingBlock;
import org.bukkit.util.Vector;
@ -64,7 +64,7 @@ public class FallingBlockController extends AbstractEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_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

@ -6,13 +6,13 @@ 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_7_R1.EntityFireworks;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityFireworks;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftFirework;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftFirework;
import org.bukkit.entity.Firework;
import org.bukkit.util.Vector;
@ -39,7 +39,7 @@ public class FireworkController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_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

@ -6,13 +6,13 @@ 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_7_R1.EntityFishingHook;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityFishingHook;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftFish;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftFish;
import org.bukkit.entity.Fish;
import org.bukkit.util.Vector;
@ -39,7 +39,7 @@ public class FishingHookController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_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

@ -6,20 +6,20 @@ 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_7_R1.EntityHuman;
import net.minecraft.server.v1_7_R1.EntityItem;
import net.minecraft.server.v1_7_R1.ItemStack;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R1.WorldServer;
import net.minecraft.server.v1_7_R2.EntityHuman;
import net.minecraft.server.v1_7_R2.EntityItem;
import net.minecraft.server.v1_7_R2.ItemStack;
import net.minecraft.server.v1_7_R2.World;
import net.minecraft.server.v1_7_R2.WorldServer;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftItem;
import org.bukkit.craftbukkit.v1_7_R1.inventory.CraftItemStack;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.CraftWorld;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftItem;
import org.bukkit.craftbukkit.v1_7_R2.inventory.CraftItemStack;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Item;
import org.bukkit.util.Vector;
@ -63,7 +63,7 @@ public class ItemController extends AbstractEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_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

@ -6,13 +6,13 @@ 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_7_R1.EntityItemFrame;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityItemFrame;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftItemFrame;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftItemFrame;
import org.bukkit.entity.ItemFrame;
import org.bukkit.util.Vector;
@ -42,7 +42,7 @@ public class ItemFrameController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_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

@ -6,13 +6,13 @@ 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_7_R1.EntityLargeFireball;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityLargeFireball;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftLargeFireball;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftLargeFireball;
import org.bukkit.entity.LargeFireball;
import org.bukkit.util.Vector;
@ -39,7 +39,7 @@ public class LargeFireballController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_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

@ -6,13 +6,13 @@ 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_7_R1.EntityLeash;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityLeash;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftLeash;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftLeash;
import org.bukkit.entity.LeashHitch;
import org.bukkit.util.Vector;
@ -39,7 +39,7 @@ public class LeashController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_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,13 +7,13 @@ 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_7_R1.EntityMinecartChest;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityMinecartChest;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftMinecartChest;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftMinecartChest;
import org.bukkit.entity.Minecart;
import org.bukkit.util.Vector;
@ -40,7 +40,7 @@ public class MinecartChestController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_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,13 +7,13 @@ 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_7_R1.EntityMinecartCommandBlock;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityMinecartCommandBlock;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftMinecartCommand;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftMinecartCommand;
import org.bukkit.entity.Minecart;
import org.bukkit.util.Vector;
@ -40,7 +40,7 @@ public class MinecartCommandController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_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,13 +7,13 @@ 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_7_R1.EntityMinecartFurnace;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityMinecartFurnace;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftMinecartFurnace;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftMinecartFurnace;
import org.bukkit.entity.Minecart;
import org.bukkit.util.Vector;
@ -40,7 +40,7 @@ public class MinecartFurnaceController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_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,8 +7,8 @@ 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_7_R1.EntityMinecartHopper;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityMinecartHopper;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.entity.Minecart;
import org.bukkit.util.Vector;
@ -36,7 +36,7 @@ public class MinecartHopperController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_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,13 +7,13 @@ 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_7_R1.EntityMinecartRideable;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityMinecartRideable;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftMinecartRideable;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftMinecartRideable;
import org.bukkit.entity.Minecart;
import org.bukkit.util.Vector;
@ -40,7 +40,7 @@ public class MinecartRideableController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_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,8 +7,8 @@ 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_7_R1.EntityMinecartMobSpawner;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityMinecartMobSpawner;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.entity.Minecart;
import org.bukkit.util.Vector;
@ -36,7 +36,7 @@ public class MinecartSpawnerController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_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,8 +7,8 @@ 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_7_R1.EntityMinecartTNT;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityMinecartTNT;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.entity.Minecart;
import org.bukkit.util.Vector;
@ -36,7 +36,7 @@ public class MinecartTNTController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_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

@ -6,13 +6,13 @@ 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_7_R1.EntityPainting;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityPainting;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPainting;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftPainting;
import org.bukkit.entity.Painting;
import org.bukkit.util.Vector;
@ -39,7 +39,7 @@ public class PaintingController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_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

@ -6,13 +6,13 @@ 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_7_R1.EntitySmallFireball;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntitySmallFireball;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftSmallFireball;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftSmallFireball;
import org.bukkit.entity.SmallFireball;
import org.bukkit.util.Vector;
@ -39,7 +39,7 @@ public class SmallFireballController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_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

@ -6,13 +6,13 @@ 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_7_R1.EntitySnowball;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntitySnowball;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftSnowball;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftSnowball;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.entity.Snowball;
import org.bukkit.util.Vector;
@ -53,7 +53,7 @@ public class SnowballController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_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

@ -6,13 +6,13 @@ 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_7_R1.EntityTNTPrimed;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityTNTPrimed;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftTNTPrimed;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftTNTPrimed;
import org.bukkit.entity.TNTPrimed;
import org.bukkit.util.Vector;
@ -39,7 +39,7 @@ public class TNTPrimedController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_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

@ -6,13 +6,13 @@ 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_7_R1.EntityThrownExpBottle;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityThrownExpBottle;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftThrownExpBottle;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftThrownExpBottle;
import org.bukkit.entity.ThrownExpBottle;
import org.bukkit.util.Vector;
@ -39,7 +39,7 @@ public class ThrownExpBottleController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_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

@ -6,13 +6,13 @@ 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_7_R1.EntityPotion;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityPotion;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftThrownPotion;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftThrownPotion;
import org.bukkit.entity.ThrownPotion;
import org.bukkit.util.Vector;
@ -39,7 +39,7 @@ public class ThrownPotionController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_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

@ -6,13 +6,13 @@ 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_7_R1.EntityWitherSkull;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.EntityWitherSkull;
import net.minecraft.server.v1_7_R2.World;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftWitherSkull;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftWitherSkull;
import org.bukkit.entity.WitherSkull;
import org.bukkit.util.Vector;
@ -39,7 +39,7 @@ public class WitherSkullController extends MobEntityController {
}
@Override
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
public void collide(net.minecraft.server.v1_7_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

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

View File

@ -3,7 +3,7 @@ package net.citizensnpcs.npc.network;
import java.io.IOException;
import net.citizensnpcs.util.NMS;
import net.minecraft.server.v1_7_R1.NetworkManager;
import net.minecraft.server.v1_7_R2.NetworkManager;
public class EmptyNetworkManager extends NetworkManager {
public EmptyNetworkManager(boolean flag) throws IOException {

View File

@ -14,12 +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_7_R1.EntityEnderDragon;
import net.minecraft.server.v1_7_R1.EntityLiving;
import net.minecraft.server.v1_7_R1.EntityPlayer;
import net.minecraft.server.v1_7_R2.EntityEnderDragon;
import net.minecraft.server.v1_7_R2.EntityLiving;
import net.minecraft.server.v1_7_R2.EntityPlayer;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftPlayer;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
@ -76,8 +75,8 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab
}
}
private net.minecraft.server.v1_7_R1.Entity getHandle() {
return ((CraftEntity) npc.getEntity()).getHandle();
private net.minecraft.server.v1_7_R2.Entity getHandle() {
return NMS.getHandle(npc.getEntity());
}
public boolean isEnabled() {
@ -182,7 +181,7 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab
return enabled;
}
private void setMountedYaw(net.minecraft.server.v1_7_R1.Entity handle) {
private void setMountedYaw(net.minecraft.server.v1_7_R2.Entity handle) {
if (handle instanceof EntityEnderDragon || !Setting.USE_BOAT_CONTROLS.asBoolean())
return; // EnderDragon handles this separately
double tX = handle.locX + handle.motX;
@ -204,9 +203,9 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab
return enabled;
}
private double updateHorizontalSpeed(net.minecraft.server.v1_7_R1.Entity handle, double speed, float speedMod) {
private double updateHorizontalSpeed(net.minecraft.server.v1_7_R2.Entity handle, double speed, float speedMod) {
double oldSpeed = Math.sqrt(handle.motX * handle.motX + handle.motZ * handle.motZ);
double horizontal = ((EntityLiving) handle.passenger).bf;
double horizontal = ((EntityLiving) handle.passenger).be;
if (horizontal > 0.0D) {
double dXcos = -Math.sin(handle.passenger.yaw * Math.PI / 180.0F);
double dXsin = Math.cos(handle.passenger.yaw * Math.PI / 180.0F);
@ -250,7 +249,7 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab
@Override
public void run(Player rider) {
net.minecraft.server.v1_7_R1.Entity handle = getHandle();
net.minecraft.server.v1_7_R2.Entity handle = getHandle();
boolean onGround = handle.onGround;
float speedMod = npc.getNavigator().getDefaultParameters()
.modifiedSpeed((onGround ? GROUND_SPEED : AIR_SPEED));
@ -301,7 +300,7 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab
}
Vector dir = rider.getEyeLocation().getDirection();
dir.multiply(npc.getNavigator().getDefaultParameters().speedModifier());
net.minecraft.server.v1_7_R1.Entity handle = getHandle();
net.minecraft.server.v1_7_R2.Entity handle = getHandle();
handle.motX = dir.getX();
handle.motY = dir.getY();
handle.motZ = dir.getZ();
@ -344,7 +343,7 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab
getHandle().motY = 0.001;
return;
}
net.minecraft.server.v1_7_R1.Entity handle = getHandle();
net.minecraft.server.v1_7_R2.Entity handle = getHandle();
this.speed = updateHorizontalSpeed(handle, this.speed, 1F);
boolean shouldJump = NMS.shouldJump(handle.passenger);
if (shouldJump) {

View File

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

View File

@ -16,38 +16,38 @@ import net.citizensnpcs.api.util.Messaging;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.npc.entity.EntityHumanNPC;
import net.citizensnpcs.npc.network.EmptyChannel;
import net.minecraft.server.v1_7_R1.AttributeInstance;
import net.minecraft.server.v1_7_R1.ControllerJump;
import net.minecraft.server.v1_7_R1.DamageSource;
import net.minecraft.server.v1_7_R1.EnchantmentManager;
import net.minecraft.server.v1_7_R1.Entity;
import net.minecraft.server.v1_7_R1.EntityHorse;
import net.minecraft.server.v1_7_R1.EntityHuman;
import net.minecraft.server.v1_7_R1.EntityInsentient;
import net.minecraft.server.v1_7_R1.EntityLiving;
import net.minecraft.server.v1_7_R1.EntityMinecartAbstract;
import net.minecraft.server.v1_7_R1.EntityPlayer;
import net.minecraft.server.v1_7_R1.EntityTypes;
import net.minecraft.server.v1_7_R1.GenericAttributes;
import net.minecraft.server.v1_7_R1.MathHelper;
import net.minecraft.server.v1_7_R1.MobEffectList;
import net.minecraft.server.v1_7_R1.Navigation;
import net.minecraft.server.v1_7_R1.NetworkManager;
import net.minecraft.server.v1_7_R1.Packet;
import net.minecraft.server.v1_7_R1.PathfinderGoalSelector;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.AttributeInstance;
import net.minecraft.server.v1_7_R2.ControllerJump;
import net.minecraft.server.v1_7_R2.DamageSource;
import net.minecraft.server.v1_7_R2.EnchantmentManager;
import net.minecraft.server.v1_7_R2.Entity;
import net.minecraft.server.v1_7_R2.EntityHorse;
import net.minecraft.server.v1_7_R2.EntityHuman;
import net.minecraft.server.v1_7_R2.EntityInsentient;
import net.minecraft.server.v1_7_R2.EntityLiving;
import net.minecraft.server.v1_7_R2.EntityMinecartAbstract;
import net.minecraft.server.v1_7_R2.EntityPlayer;
import net.minecraft.server.v1_7_R2.EntityTypes;
import net.minecraft.server.v1_7_R2.GenericAttributes;
import net.minecraft.server.v1_7_R2.MathHelper;
import net.minecraft.server.v1_7_R2.MobEffectList;
import net.minecraft.server.v1_7_R2.Navigation;
import net.minecraft.server.v1_7_R2.NetworkManager;
import net.minecraft.server.v1_7_R2.Packet;
import net.minecraft.server.v1_7_R2.PathfinderGoalSelector;
import net.minecraft.server.v1_7_R2.World;
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_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.CraftSound;
import org.bukkit.craftbukkit.v1_7_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftLivingEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_7_R2.CraftServer;
import org.bukkit.craftbukkit.v1_7_R2.CraftSound;
import org.bukkit.craftbukkit.v1_7_R2.CraftWorld;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftLivingEntity;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftPlayer;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Horse;
import org.bukkit.entity.LivingEntity;
@ -128,13 +128,13 @@ public class NMS {
}
public static void flyingMoveLogic(EntityLiving entity, float f, float f1) {
if (entity.M()) {
if (entity.L()) {
entity.a(f, f1, 0.02F);
entity.move(entity.motX, entity.motY, entity.motZ);
entity.motX *= 0.800000011920929D;
entity.motY *= 0.800000011920929D;
entity.motZ *= 0.800000011920929D;
} else if (entity.P()) {
} else if (entity.O()) {
entity.a(f, f1, 0.02F);
entity.move(entity.motX, entity.motY, entity.motZ);
entity.motX *= 0.5D;
@ -163,7 +163,7 @@ public class NMS {
entity.motZ *= f2;
}
entity.aF = entity.aG;
entity.aE = entity.aF;
double d0 = entity.locX - entity.lastX;
double d1 = entity.locZ - entity.lastZ;
float f4 = MathHelper.sqrt(d0 * d0 + d1 * d1) * 4.0F;
@ -172,12 +172,13 @@ public class NMS {
f4 = 1.0F;
}
entity.aG += (f4 - entity.aG) * 0.4F;
entity.aH += entity.aG;
entity.aF += (f4 - entity.aF) * 0.4F;
entity.aG += entity.aF;
}
@SuppressWarnings("deprecation")
private static Constructor<?> getCustomEntityConstructor(Class<?> clazz, EntityType type) throws SecurityException,
NoSuchMethodException {
NoSuchMethodException {
Constructor<?> constructor = ENTITY_CONSTRUCTOR_CACHE.get(clazz);
if (constructor == null) {
constructor = clazz.getConstructor(World.class);
@ -205,12 +206,12 @@ public class NMS {
return ((CraftLivingEntity) entity).getHandle();
}
public static net.minecraft.server.v1_7_R1.Entity getHandle(org.bukkit.entity.Entity entity) {
public static net.minecraft.server.v1_7_R2.Entity getHandle(org.bukkit.entity.Entity entity) {
return ((CraftEntity) entity).getHandle();
}
public static float getHeadYaw(EntityLiving handle) {
return handle.aP;
return handle.aO;
}
public static Navigation getNavigation(Entity handle) {
@ -239,7 +240,7 @@ public class NMS {
}
public static float getStepHeight(LivingEntity entity) {
return NMS.getHandle(entity).X;
return NMS.getHandle(entity).W;
}
public static void initNetworkManager(NetworkManager network) {
@ -259,7 +260,7 @@ public class NMS {
public static boolean inWater(org.bukkit.entity.Entity entity) {
Entity mcEntity = getHandle(entity);
return mcEntity.M() || mcEntity.P();
return mcEntity.L() || mcEntity.O();
}
public static boolean isNavigationFinished(Navigation navigation) {
@ -272,7 +273,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).x());
((EntityInsentient) handle).getControllerLook().a(target, 10.0F, ((EntityInsentient) handle).bv());
} else if (handle instanceof EntityHumanNPC) {
((EntityHumanNPC) handle).setTargetLook(target, 10F, 40F);
}
@ -405,10 +406,10 @@ public class NMS {
while (yaw >= 180.0F) {
yaw -= 360.0F;
}
handle.aP = yaw;
handle.aO = yaw;
if (!(handle instanceof EntityHuman))
handle.aN = yaw;
handle.aQ = yaw;
handle.aM = yaw;
handle.aP = yaw;
}
public static void setShouldJump(org.bukkit.entity.Entity entity) {
@ -422,17 +423,17 @@ public class NMS {
}
public static void setStepHeight(EntityLiving entity, float height) {
entity.X = height;
entity.W = height;
}
public static void setVerticalMovement(org.bukkit.entity.Entity bukkitEntity, double d) {
if (!bukkitEntity.getType().isAlive())
return;
EntityLiving handle = NMS.getHandle((LivingEntity) bukkitEntity);
handle.bf = (float) d;
handle.be = (float) d;
}
public static boolean shouldJump(net.minecraft.server.v1_7_R1.Entity entity) {
public static boolean shouldJump(net.minecraft.server.v1_7_R2.Entity entity) {
if (JUMP_FIELD == null || !(entity instanceof EntityLiving))
return false;
try {
@ -538,16 +539,15 @@ public class NMS {
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, "bd");
private static final Field JUMP_FIELD = getField(EntityLiving.class, "bc");
private static Map<Class<?>, Integer> MC_ENTITY_CLASS_TO_INT = null;
private static Map<Integer, Class<?>> MC_ENTITY_INT_TO_CLASS = null;
private static Field NAVIGATION_WORLD_FIELD = getField(Navigation.class, "b");
private static Field NETWORK_ADDRESS = getField(NetworkManager.class, "l");
private static Field NETWORK_CHANNEL = getField(NetworkManager.class, "k");
private static Field NETWORK_ADDRESS = getField(NetworkManager.class, "n");
private static Field NETWORK_CHANNEL = getField(NetworkManager.class, "m");
private static final Location PACKET_CACHE_LOCATION = new Location(null, 0, 0, 0);
private static Field PATHFINDING_RANGE = getField(Navigation.class, "e");
private static final Random RANDOM = Util.getFastRandom();
// true field above false and three synchronised lists
static {
try {

View File

@ -2,13 +2,13 @@ package net.citizensnpcs.util;
import java.util.Arrays;
import net.minecraft.server.v1_7_R1.EntityPlayer;
import net.minecraft.server.v1_7_R1.Packet;
import net.minecraft.server.v1_7_R1.PacketPlayOutAnimation;
import net.minecraft.server.v1_7_R1.PacketPlayOutBed;
import net.minecraft.server.v1_7_R1.PacketPlayOutEntityMetadata;
import net.minecraft.server.v1_7_R2.EntityPlayer;
import net.minecraft.server.v1_7_R2.Packet;
import net.minecraft.server.v1_7_R2.PacketPlayOutAnimation;
import net.minecraft.server.v1_7_R2.PacketPlayOutBed;
import net.minecraft.server.v1_7_R2.PacketPlayOutEntityMetadata;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_7_R2.entity.CraftPlayer;
import org.bukkit.entity.Player;
public enum PlayerAnimation {

View File

@ -1,9 +1,9 @@
package net.citizensnpcs.util.nms;
import net.citizensnpcs.npc.entity.EntityHumanNPC;
import net.minecraft.server.v1_7_R1.Entity;
import net.minecraft.server.v1_7_R1.EntityLiving;
import net.minecraft.server.v1_7_R1.MathHelper;
import net.minecraft.server.v1_7_R2.Entity;
import net.minecraft.server.v1_7_R2.EntityLiving;
import net.minecraft.server.v1_7_R2.MathHelper;
public class PlayerControllerLook {
private final EntityHumanNPC a;

View File

@ -2,9 +2,9 @@ package net.citizensnpcs.util.nms;
import net.citizensnpcs.npc.entity.EntityHumanNPC;
import net.citizensnpcs.util.NMS;
import net.minecraft.server.v1_7_R1.AttributeInstance;
import net.minecraft.server.v1_7_R1.GenericAttributes;
import net.minecraft.server.v1_7_R1.MathHelper;
import net.minecraft.server.v1_7_R2.AttributeInstance;
import net.minecraft.server.v1_7_R2.GenericAttributes;
import net.minecraft.server.v1_7_R2.MathHelper;
public class PlayerControllerMove {
private final EntityHumanNPC a;
@ -52,7 +52,7 @@ public class PlayerControllerMove {
}
public void c() {
this.a.bf = 0;
this.a.be = 0;
if (this.f) {
this.f = false;
int i = MathHelper.floor(this.a.boundingBox.b + 0.5D);
@ -69,7 +69,7 @@ public class PlayerControllerMove {
speed.setValue(0.1D * this.e);
float movement = (float) (this.e * speed.getValue()) * 10;
this.a.i(movement);
this.a.bf = movement;
this.a.be = movement;
if (d2 > 0.0D && d0 * d0 + d1 * d1 < 1.0D) {
this.a.getControllerJump().a();
}

View File

@ -1,21 +1,23 @@
package net.citizensnpcs.util.nms;
import net.citizensnpcs.npc.entity.EntityHumanNPC;
import net.minecraft.server.v1_7_R1.AttributeInstance;
import net.minecraft.server.v1_7_R1.Block;
import net.minecraft.server.v1_7_R1.Blocks;
import net.minecraft.server.v1_7_R1.Entity;
import net.minecraft.server.v1_7_R1.EntityInsentient;
import net.minecraft.server.v1_7_R1.GenericAttributes;
import net.minecraft.server.v1_7_R1.Material;
import net.minecraft.server.v1_7_R1.MathHelper;
import net.minecraft.server.v1_7_R1.Navigation;
import net.minecraft.server.v1_7_R1.PathEntity;
import net.minecraft.server.v1_7_R1.PathPoint;
import net.minecraft.server.v1_7_R1.Vec3D;
import net.minecraft.server.v1_7_R1.World;
import net.minecraft.server.v1_7_R2.AttributeInstance;
import net.minecraft.server.v1_7_R2.Block;
import net.minecraft.server.v1_7_R2.Blocks;
import net.minecraft.server.v1_7_R2.Entity;
import net.minecraft.server.v1_7_R2.EntityChicken;
import net.minecraft.server.v1_7_R2.EntityInsentient;
import net.minecraft.server.v1_7_R2.GenericAttributes;
import net.minecraft.server.v1_7_R2.Material;
import net.minecraft.server.v1_7_R2.MathHelper;
import net.minecraft.server.v1_7_R2.Navigation;
import net.minecraft.server.v1_7_R2.PathEntity;
import net.minecraft.server.v1_7_R2.PathPoint;
import net.minecraft.server.v1_7_R2.Vec3D;
import net.minecraft.server.v1_7_R2.World;
public class PlayerNavigation extends Navigation {
private final EntityHumanNPC a;
private final World b;
private PathEntity c;
@ -25,7 +27,6 @@ public class PlayerNavigation extends Navigation {
private int g;
private int h;
private final Vec3D i = Vec3D.a(0.0D, 0.0D, 0.0D);
private boolean j = true;
private boolean k;
private boolean l;
@ -45,169 +46,191 @@ public class PlayerNavigation extends Navigation {
}
@Override
public void a(boolean paramBoolean) {
this.l = paramBoolean;
public void a(boolean flag) {
this.l = flag;
}
@Override
public void a(double paramDouble) {
this.d = paramDouble;
public void a(double d0) {
this.d = d0;
}
@Override
public PathEntity a(double paramDouble1, double paramDouble2, double paramDouble3) {
if (!l())
return null;
return this.b.a(this.a, MathHelper.floor(paramDouble1), (int) paramDouble2, MathHelper.floor(paramDouble3),
d(), this.j, this.k, this.l, this.m);
public PathEntity a(double d0, double d1, double d2) {
return !this.l() ? null : this.b.a(this.a, MathHelper.floor(d0), (int) d1, MathHelper.floor(d2), this.d(),
this.j, this.k, this.l, this.m);
}
@Override
public boolean a(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4) {
PathEntity localPathEntity = a(MathHelper.floor(paramDouble1), (int) paramDouble2,
MathHelper.floor(paramDouble3));
return a(localPathEntity, paramDouble4);
public boolean a(double d0, double d1, double d2, double d3) {
PathEntity pathentity = this.a(MathHelper.floor(d0), ((int) d1), MathHelper.floor(d2));
return this.a(pathentity, d3);
}
@Override
public PathEntity a(Entity paramEntity) {
if (!l())
return null;
return this.b.findPath(this.a, paramEntity, d(), this.j, this.k, this.l, this.m);
public PathEntity a(Entity entity) {
return !this.l() ? null : this.b.findPath(this.a, entity, this.d(), this.j, this.k, this.l, this.m);
}
@Override
public boolean a(Entity paramEntity, double paramDouble) {
PathEntity localPathEntity = a(paramEntity);
if (localPathEntity != null)
return a(localPathEntity, paramDouble);
return false;
public boolean a(Entity entity, double d0) {
PathEntity pathentity = this.a(entity);
return pathentity != null ? this.a(pathentity, d0) : false;
}
private boolean a(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6,
Vec3D paramVec3D, double paramDouble1, double paramDouble2) {
int n = paramInt1 - paramInt4 / 2;
int i1 = paramInt3 - paramInt6 / 2;
private boolean a(int i, int j, int k, int l, int i1, int j1, Vec3D vec3d, double d0, double d1) {
int k1 = i - l / 2;
int l1 = k - j1 / 2;
if (!b(n, paramInt2, i1, paramInt4, paramInt5, paramInt6, paramVec3D, paramDouble1, paramDouble2))
if (!this.b(k1, j, l1, l, i1, j1, vec3d, d0, d1)) {
return false;
} else {
for (int i2 = k1; i2 < k1 + l; ++i2) {
for (int j2 = l1; j2 < l1 + j1; ++j2) {
double d2 = i2 + 0.5D - vec3d.a;
double d3 = j2 + 0.5D - vec3d.c;
for (int i2 = n; i2 < n + paramInt4; i2++) {
for (int i3 = i1; i3 < i1 + paramInt6; i3++) {
double d1 = i2 + 0.5D - paramVec3D.c;
double d2 = i3 + 0.5D - paramVec3D.e;
if (d1 * paramDouble1 + d2 * paramDouble2 >= 0.0D) {
Block localBlock = this.b.getType(i2, paramInt2 - 1, i3);
Material localMaterial = localBlock.getMaterial();
if (localMaterial == Material.AIR)
return false;
if ((localMaterial == Material.WATER) && (!this.a.M()))
return false;
if (localMaterial == Material.LAVA)
return false;
}
}
}
return true;
}
if (d2 * d0 + d3 * d1 >= 0.0D) {
Block block = this.b.getType(i2, j - 1, j2);
Material material = block.getMaterial();
@Override
public boolean a(PathEntity paramPathEntity, double paramDouble) {
if (paramPathEntity == null) {
this.c = null;
return false;
}
if (!paramPathEntity.a(this.c))
this.c = paramPathEntity;
if (this.f)
n();
if (this.c.d() == 0)
return false;
this.d = paramDouble;
Vec3D localVec3D = j();
this.h = this.g;
this.i.c = localVec3D.c;
this.i.d = localVec3D.d;
this.i.e = localVec3D.e;
return true;
}
private boolean a(Vec3D paramVec3D1, Vec3D paramVec3D2, int paramInt1, int paramInt2, int paramInt3) {
int n = MathHelper.floor(paramVec3D1.c);
int i1 = MathHelper.floor(paramVec3D1.e);
double d1 = paramVec3D2.c - paramVec3D1.c;
double d2 = paramVec3D2.e - paramVec3D1.e;
double d3 = d1 * d1 + d2 * d2;
if (d3 < 1.0E-008D)
return false;
double d4 = 1.0D / Math.sqrt(d3);
d1 *= d4;
d2 *= d4;
paramInt1 += 2;
paramInt3 += 2;
if (!a(n, (int) paramVec3D1.d, i1, paramInt1, paramInt2, paramInt3, paramVec3D1, d1, d2))
return false;
paramInt1 -= 2;
paramInt3 -= 2;
double d5 = 1.0D / Math.abs(d1);
double d6 = 1.0D / Math.abs(d2);
double d7 = n * 1 - paramVec3D1.c;
double d8 = i1 * 1 - paramVec3D1.e;
if (d1 >= 0.0D)
d7 += 1.0D;
if (d2 >= 0.0D)
d8 += 1.0D;
d7 /= d1;
d8 /= d2;
int i2 = d1 < 0.0D ? -1 : 1;
int i3 = d2 < 0.0D ? -1 : 1;
int i4 = MathHelper.floor(paramVec3D2.c);
int i5 = MathHelper.floor(paramVec3D2.e);
int i6 = i4 - n;
int i7 = i5 - i1;
while ((i6 * i2 > 0) || (i7 * i3 > 0)) {
if (d7 < d8) {
d7 += d5;
n += i2;
i6 = i4 - n;
} else {
d8 += d6;
i1 += i3;
i7 = i5 - i1;
}
if (!a(n, (int) paramVec3D1.d, i1, paramInt1, paramInt2, paramInt3, paramVec3D1, d1, d2))
return false;
}
return true;
}
@Override
public void b(boolean paramBoolean) {
this.k = paramBoolean;
}
private boolean b(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6,
Vec3D paramVec3D, double paramDouble1, double paramDouble2) {
for (int n = paramInt1; n < paramInt1 + paramInt4; n++) {
for (int i1 = paramInt2; i1 < paramInt2 + paramInt5; i1++)
for (int i2 = paramInt3; i2 < paramInt3 + paramInt6; i2++) {
double d1 = n + 0.5D - paramVec3D.c;
double d2 = i2 + 0.5D - paramVec3D.e;
if (d1 * paramDouble1 + d2 * paramDouble2 >= 0.0D) {
Block localBlock = this.b.getType(n, i1, i2);
if (!localBlock.b(this.b, n, i1, i2))
if (material == Material.AIR) {
return false;
}
if (material == Material.WATER && !this.a.L()) {
return false;
}
if (material == Material.LAVA) {
return false;
}
}
}
}
return true;
}
}
@Override
public boolean a(PathEntity pathentity, double d0) {
if (pathentity == null) {
this.c = null;
return false;
} else {
if (!pathentity.a(this.c)) {
this.c = pathentity;
}
if (this.f) {
this.n();
}
if (this.c.d() == 0) {
return false;
} else {
this.d = d0;
Vec3D vec3d = this.j();
this.h = this.g;
this.i.a = vec3d.a;
this.i.b = vec3d.b;
this.i.c = vec3d.c;
return true;
}
}
}
private boolean a(Vec3D vec3d, Vec3D vec3d1, int i, int j, int k) {
int l = MathHelper.floor(vec3d.a);
int i1 = MathHelper.floor(vec3d.c);
double d0 = vec3d1.a - vec3d.a;
double d1 = vec3d1.c - vec3d.c;
double d2 = d0 * d0 + d1 * d1;
if (d2 < 1.0E-8D) {
return false;
} else {
double d3 = 1.0D / Math.sqrt(d2);
d0 *= d3;
d1 *= d3;
i += 2;
k += 2;
if (!this.a(l, (int) vec3d.b, i1, i, j, k, vec3d, d0, d1)) {
return false;
} else {
i -= 2;
k -= 2;
double d4 = 1.0D / Math.abs(d0);
double d5 = 1.0D / Math.abs(d1);
double d6 = l * 1 - vec3d.a;
double d7 = i1 * 1 - vec3d.c;
if (d0 >= 0.0D) {
++d6;
}
if (d1 >= 0.0D) {
++d7;
}
d6 /= d0;
d7 /= d1;
int j1 = d0 < 0.0D ? -1 : 1;
int k1 = d1 < 0.0D ? -1 : 1;
int l1 = MathHelper.floor(vec3d1.a);
int i2 = MathHelper.floor(vec3d1.c);
int j2 = l1 - l;
int k2 = i2 - i1;
do {
if (j2 * j1 <= 0 && k2 * k1 <= 0) {
return true;
}
if (d6 < d7) {
d6 += d4;
l += j1;
j2 = l1 - l;
} else {
d7 += d5;
i1 += k1;
k2 = i2 - i1;
}
} while (this.a(l, (int) vec3d.b, i1, i, j, k, vec3d, d0, d1));
return false;
}
}
}
@Override
public void b(boolean flag) {
this.k = flag;
}
private boolean b(int i, int j, int k, int l, int i1, int j1, Vec3D vec3d, double d0, double d1) {
for (int k1 = i; k1 < i + l; ++k1) {
for (int l1 = j; l1 < j + i1; ++l1) {
for (int i2 = k; i2 < k + j1; ++i2) {
double d2 = k1 + 0.5D - vec3d.a;
double d3 = i2 + 0.5D - vec3d.c;
if (d2 * d0 + d3 * d1 >= 0.0D) {
Block block = this.b.getType(k1, l1, i2);
if (!block.b(this.b, k1, l1, i2)) {
return false;
}
}
}
}
}
return true;
}
@ -217,8 +240,8 @@ public class PlayerNavigation extends Navigation {
}
@Override
public void c(boolean paramBoolean) {
this.j = paramBoolean;
public void c(boolean flag) {
this.j = flag;
}
@Override
@ -227,8 +250,8 @@ public class PlayerNavigation extends Navigation {
}
@Override
public void d(boolean paramBoolean) {
this.f = paramBoolean;
public void d(boolean flag) {
this.f = flag;
}
@Override
@ -237,30 +260,31 @@ public class PlayerNavigation extends Navigation {
}
@Override
public void e(boolean paramBoolean) {
this.m = paramBoolean;
public void e(boolean flag) {
this.m = flag;
}
@Override
public void f() {
this.g += 1;
if (g())
return;
++this.g;
if (!this.g()) {
if (this.l()) {
this.i();
}
if (l())
i();
if (!this.g()) {
Vec3D vec3d = this.c.a(this.a);
if (g())
return;
Vec3D localVec3D = this.c.a(this.a);
if (localVec3D == null)
return;
this.a.setMoveDestination(localVec3D.c, localVec3D.d, localVec3D.e, this.d);
if (vec3d != null) {
this.a.setMoveDestination(vec3d.a, vec3d.b, vec3d.c, this.d);
}
}
}
}
@Override
public boolean g() {
return (this.c == null) || (this.c.b());
return this.c == null || this.c.b();
}
@Override
@ -269,83 +293,93 @@ public class PlayerNavigation extends Navigation {
}
private void i() {
Vec3D localVec3D = j();
Vec3D vec3d = this.j();
int i = this.c.d();
int n = this.c.d();
for (int i1 = this.c.e(); i1 < this.c.d(); i1++) {
if (this.c.a(i1).b != (int) localVec3D.d) {
n = i1;
for (int j = this.c.e(); j < this.c.d(); ++j) {
if (this.c.a(j).b != (int) vec3d.b) {
i = j;
break;
}
}
float f1 = this.a.width * this.a.width;
for (int i2 = this.c.e(); i2 < n; i2++) {
if (localVec3D.distanceSquared(this.c.a(this.a, i2)) < f1) {
this.c.c(i2 + 1);
float f = this.a.width * this.a.width;
int k;
for (k = this.c.e(); k < i; ++k) {
if (vec3d.distanceSquared(this.c.a(this.a, k)) < f) {
this.c.c(k + 1);
}
}
int i3 = (int) this.a.length + 1;
int i4 = MathHelper.f(this.a.width);
for (int i5 = n - 1; i5 >= this.c.e(); i5--) {
if (a(localVec3D, this.c.a(this.a, i5), i4, i3, i4)) {
this.c.c(i5);
k = MathHelper.f(this.a.width);
int l = (int) this.a.length + 1;
int i1 = k;
for (int j1 = i - 1; j1 >= this.c.e(); --j1) {
if (this.a(vec3d, this.c.a(this.a, j1), k, l, i1)) {
this.c.c(j1);
break;
}
}
if (this.g - this.h > 100) {
if (localVec3D.distanceSquared(this.i) < 2.25D)
h();
if (vec3d.distanceSquared(this.i) < 2.25D) {
this.h();
}
this.h = this.g;
this.i.c = localVec3D.c;
this.i.d = localVec3D.d;
this.i.e = localVec3D.e;
this.i.a = vec3d.a;
this.i.b = vec3d.b;
this.i.c = vec3d.c;
}
}
private Vec3D j() {
return this.b.getVec3DPool().create(this.a.locX, k(), this.a.locZ);
return Vec3D.a(this.a.locX, this.k(), this.a.locZ);
}
private int k() {
if ((!this.a.M()) || (!this.m))
return (int) (this.a.boundingBox.b + 0.5D);
if (this.a.L() && this.m) {
int i = (int) this.a.boundingBox.b;
Block block = this.b.getType(MathHelper.floor(this.a.locX), i, MathHelper.floor(this.a.locZ));
int j = 0;
int n = (int) this.a.boundingBox.b;
Block localBlock = this.b.getType(MathHelper.floor(this.a.locX), n, MathHelper.floor(this.a.locZ));
int i1 = 0;
while ((localBlock == Blocks.WATER) || (localBlock == Blocks.STATIONARY_WATER)) {
n++;
localBlock = this.b.getType(MathHelper.floor(this.a.locX), n, MathHelper.floor(this.a.locZ));
i1++;
if (i1 > 16)
return (int) this.a.boundingBox.b;
do {
if (block != Blocks.WATER && block != Blocks.STATIONARY_WATER) {
return i;
}
++i;
block = this.b.getType(MathHelper.floor(this.a.locX), i, MathHelper.floor(this.a.locZ));
++j;
} while (j <= 16);
return (int) this.a.boundingBox.b;
} else {
return (int) (this.a.boundingBox.b + 0.5D);
}
return n;
}
private boolean l() {
return (this.a.onGround) || ((this.m) && (m()));
return this.a.onGround || this.m && this.m() || this.a.al() && this.a.vehicle instanceof EntityChicken;
}
private boolean m() {
return (this.a.M()) || (this.a.P());
return this.a.L() || this.a.O();
}
private void n() {
if (this.b.i(MathHelper.floor(this.a.locX), (int) (this.a.boundingBox.b + 0.5D), MathHelper.floor(this.a.locZ)))
return;
if (!this.b
.i(MathHelper.floor(this.a.locX), (int) (this.a.boundingBox.b + 0.5D), MathHelper.floor(this.a.locZ))) {
for (int i = 0; i < this.c.d(); ++i) {
PathPoint pathpoint = this.c.a(i);
for (int n = 0; n < this.c.d(); n++) {
PathPoint localPathPoint = this.c.a(n);
if (this.b.i(localPathPoint.a, localPathPoint.b, localPathPoint.c)) {
this.c.b(n - 1);
return;
if (this.b.i(pathpoint.a, pathpoint.b, pathpoint.c)) {
this.c.b(i - 1);
return;
}
}
}
}
@ -358,4 +392,5 @@ public class PlayerNavigation extends Navigation {
return new EntityInsentient(null) {
};
}
}