mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-06-27 23:15:08 +02:00
Initial untested 1.7.2 update
This commit is contained in:
parent
e25df6cd47
commit
38cec9d3f3
6
pom.xml
6
pom.xml
|
@ -6,13 +6,13 @@
|
||||||
|
|
||||||
<groupId>net.citizensnpcs</groupId>
|
<groupId>net.citizensnpcs</groupId>
|
||||||
<artifactId>citizens</artifactId>
|
<artifactId>citizens</artifactId>
|
||||||
<version>2.0.10-SNAPSHOT</version>
|
<version>2.0.11-SNAPSHOT</version>
|
||||||
<name>Citizens</name>
|
<name>Citizens</name>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<craftbukkit.version>LATEST</craftbukkit.version>
|
<craftbukkit.version>1.7.2-R0.1-SNAPSHOT</craftbukkit.version>
|
||||||
<citizensapi.version>2.0.10-SNAPSHOT</citizensapi.version>
|
<citizensapi.version>2.0.11-SNAPSHOT</citizensapi.version>
|
||||||
<vault.version>1.2.19-SNAPSHOT</vault.version>
|
<vault.version>1.2.19-SNAPSHOT</vault.version>
|
||||||
<powermock.version>1.4.12</powermock.version>
|
<powermock.version>1.4.12</powermock.version>
|
||||||
<build.number>Unknown</build.number>
|
<build.number>Unknown</build.number>
|
||||||
|
|
|
@ -408,8 +408,9 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
|
||||||
public void storeNPCs() {
|
public void storeNPCs() {
|
||||||
if (saves == null)
|
if (saves == null)
|
||||||
return;
|
return;
|
||||||
for (NPC npc : npcRegistry)
|
for (NPC npc : npcRegistry) {
|
||||||
saves.store(npc);
|
saves.store(npc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void storeNPCs(CommandContext args) {
|
public void storeNPCs(CommandContext args) {
|
||||||
|
@ -431,5 +432,5 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final String COMPATIBLE_MC_VERSION = "1.6.4";
|
private static final String COMPATIBLE_MC_VERSION = "1.7.2";
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,11 +22,11 @@ import net.citizensnpcs.trait.CurrentLocation;
|
||||||
import net.citizensnpcs.util.Messages;
|
import net.citizensnpcs.util.Messages;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.Packet34EntityTeleport;
|
import net.minecraft.server.v1_7_R1.PacketPlayOutEntityTeleport;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
@ -159,7 +159,7 @@ public class CitizensNPC extends AbstractNPC {
|
||||||
|
|
||||||
at = at.clone();
|
at = at.clone();
|
||||||
entityController.spawn(at, this);
|
entityController.spawn(at, this);
|
||||||
net.minecraft.server.v1_6_R3.Entity mcEntity = ((CraftEntity) getEntity()).getHandle();
|
net.minecraft.server.v1_7_R1.Entity mcEntity = ((CraftEntity) getEntity()).getHandle();
|
||||||
boolean couldSpawn = !Util.isLoaded(at) ? false : mcEntity.world.addEntity(mcEntity, SpawnReason.CUSTOM);
|
boolean couldSpawn = !Util.isLoaded(at) ? false : mcEntity.world.addEntity(mcEntity, SpawnReason.CUSTOM);
|
||||||
mcEntity.setPositionRotation(at.getX(), at.getY(), at.getZ(), at.getYaw(), at.getPitch());
|
mcEntity.setPositionRotation(at.getX(), at.getY(), at.getZ(), at.getYaw(), at.getPitch());
|
||||||
if (!couldSpawn) {
|
if (!couldSpawn) {
|
||||||
|
@ -218,7 +218,7 @@ public class CitizensNPC extends AbstractNPC {
|
||||||
if (++packetUpdateCount > 30) {
|
if (++packetUpdateCount > 30) {
|
||||||
if (!getNavigator().isNavigating()) {
|
if (!getNavigator().isNavigating()) {
|
||||||
NMS.sendPacketNearby(getStoredLocation(),
|
NMS.sendPacketNearby(getStoredLocation(),
|
||||||
new Packet34EntityTeleport(NMS.getHandle(getEntity())));
|
new PacketPlayOutEntityTeleport(NMS.getHandle(getEntity())));
|
||||||
}
|
}
|
||||||
packetUpdateCount = 0;
|
packetUpdateCount = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,11 +5,11 @@ import java.util.Map;
|
||||||
|
|
||||||
import net.citizensnpcs.api.npc.NPC;
|
import net.citizensnpcs.api.npc.NPC;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftWorld;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftWorld;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
@ -24,7 +24,7 @@ public abstract class MobEntityController extends AbstractEntityController {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Entity createEntity(Location at, NPC npc) {
|
protected Entity createEntity(Location at, NPC npc) {
|
||||||
net.minecraft.server.v1_6_R3.Entity entity = createEntityFromClass(((CraftWorld) at.getWorld()).getHandle(),
|
net.minecraft.server.v1_7_R1.Entity entity = createEntityFromClass(((CraftWorld) at.getWorld()).getHandle(),
|
||||||
npc);
|
npc);
|
||||||
entity.setPositionRotation(at.getX(), at.getY(), at.getZ(), at.getYaw(), at.getPitch());
|
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();
|
return entity.getBukkitEntity();
|
||||||
}
|
}
|
||||||
|
|
||||||
private net.minecraft.server.v1_6_R3.Entity createEntityFromClass(Object... args) {
|
private net.minecraft.server.v1_7_R1.Entity createEntityFromClass(Object... args) {
|
||||||
try {
|
try {
|
||||||
return (net.minecraft.server.v1_6_R3.Entity) constructor.newInstance(args);
|
return (net.minecraft.server.v1_7_R1.Entity) constructor.newInstance(args);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -61,7 +61,7 @@ public class AStarNavigationStrategy extends AbstractPathStrategy {
|
||||||
}
|
}
|
||||||
vector = plan.getCurrentVector();
|
vector = plan.getCurrentVector();
|
||||||
}
|
}
|
||||||
net.minecraft.server.v1_6_R3.Entity handle = NMS.getHandle(npc.getEntity());
|
net.minecraft.server.v1_7_R1.Entity handle = NMS.getHandle(npc.getEntity());
|
||||||
double dX = vector.getBlockX() - handle.locX;
|
double dX = vector.getBlockX() - handle.locX;
|
||||||
double dZ = vector.getBlockZ() - handle.locZ;
|
double dZ = vector.getBlockZ() - handle.locZ;
|
||||||
double dY = vector.getY() - handle.locY;
|
double dY = vector.getY() - handle.locY;
|
||||||
|
|
|
@ -3,17 +3,18 @@ package net.citizensnpcs.npc.ai;
|
||||||
import net.citizensnpcs.api.ai.tree.BehaviorGoalAdapter;
|
import net.citizensnpcs.api.ai.tree.BehaviorGoalAdapter;
|
||||||
import net.citizensnpcs.api.ai.tree.BehaviorStatus;
|
import net.citizensnpcs.api.ai.tree.BehaviorStatus;
|
||||||
import net.citizensnpcs.util.PlayerAnimation;
|
import net.citizensnpcs.util.PlayerAnimation;
|
||||||
import net.minecraft.server.v1_6_R3.Block;
|
import net.minecraft.server.v1_7_R1.Block;
|
||||||
import net.minecraft.server.v1_6_R3.Enchantment;
|
import net.minecraft.server.v1_7_R1.Blocks;
|
||||||
import net.minecraft.server.v1_6_R3.EnchantmentManager;
|
import net.minecraft.server.v1_7_R1.Enchantment;
|
||||||
import net.minecraft.server.v1_6_R3.EntityLiving;
|
import net.minecraft.server.v1_7_R1.EnchantmentManager;
|
||||||
import net.minecraft.server.v1_6_R3.EntityPlayer;
|
import net.minecraft.server.v1_7_R1.EntityLiving;
|
||||||
import net.minecraft.server.v1_6_R3.ItemStack;
|
import net.minecraft.server.v1_7_R1.EntityPlayer;
|
||||||
import net.minecraft.server.v1_6_R3.Material;
|
import net.minecraft.server.v1_7_R1.ItemStack;
|
||||||
import net.minecraft.server.v1_6_R3.MobEffectList;
|
import net.minecraft.server.v1_7_R1.Material;
|
||||||
|
import net.minecraft.server.v1_7_R1.MobEffectList;
|
||||||
|
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftLivingEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftLivingEntity;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.inventory.CraftItemStack;
|
import org.bukkit.craftbukkit.v1_7_R1.inventory.CraftItemStack;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
@ -39,17 +40,17 @@ public class BlockBreaker extends BehaviorGoalAdapter {
|
||||||
return Math.pow(entity.locX - x, 2) + Math.pow(entity.locY - y, 2) + Math.pow(entity.locZ - z, 2);
|
return Math.pow(entity.locX - x, 2) + Math.pow(entity.locY - y, 2) + Math.pow(entity.locZ - z, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
private net.minecraft.server.v1_6_R3.ItemStack getCurrentItem() {
|
private net.minecraft.server.v1_7_R1.ItemStack getCurrentItem() {
|
||||||
return configuration.item() != null ? CraftItemStack.asNMSCopy(configuration.item()) : entity.getEquipment(0);
|
return configuration.item() != null ? CraftItemStack.asNMSCopy(configuration.item()) : entity.getEquipment(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private float getStrength(Block block) {
|
private float getStrength(Block block) {
|
||||||
float base = block.l(null, 0, 0, 0);
|
float base = block.f(null, 0, 0, 0);
|
||||||
return base < 0.0F ? 0.0F : (!isDestroyable(block) ? 1.0F / base / 100.0F : strengthMod(block) / base / 30.0F);
|
return base < 0.0F ? 0.0F : (!isDestroyable(block) ? 1.0F / base / 100.0F : strengthMod(block) / base / 30.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isDestroyable(Block block) {
|
private boolean isDestroyable(Block block) {
|
||||||
if (block.material.isAlwaysDestroyable()) {
|
if (block.getMaterial().isAlwaysDestroyable()) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
ItemStack current = getCurrentItem();
|
ItemStack current = getCurrentItem();
|
||||||
|
@ -83,7 +84,7 @@ public class BlockBreaker extends BehaviorGoalAdapter {
|
||||||
}
|
}
|
||||||
if (entity instanceof EntityPlayer)
|
if (entity instanceof EntityPlayer)
|
||||||
PlayerAnimation.ARM_SWING.play((Player) entity.getBukkitEntity());
|
PlayerAnimation.ARM_SWING.play((Player) entity.getBukkitEntity());
|
||||||
Block block = Block.byId[entity.world.getTypeId(x, y, z)];
|
Block block = entity.world.getType(x, y, z);
|
||||||
if (block == null) {
|
if (block == null) {
|
||||||
return BehaviorStatus.SUCCESS;
|
return BehaviorStatus.SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
|
@ -104,12 +105,12 @@ public class BlockBreaker extends BehaviorGoalAdapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setBlockDamage(int modifiedDamage) {
|
private void setBlockDamage(int modifiedDamage) {
|
||||||
entity.world.f(entity.id, x, y, z, modifiedDamage);
|
entity.world.d(entity.getId(), x, y, z, modifiedDamage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldExecute() {
|
public boolean shouldExecute() {
|
||||||
return entity.world.getTypeId(x, y, z) > 0;
|
return entity.world.getType(x, y, z) != Blocks.AIR;
|
||||||
}
|
}
|
||||||
|
|
||||||
private float strengthMod(Block block) {
|
private float strengthMod(Block block) {
|
||||||
|
|
|
@ -11,7 +11,7 @@ import net.citizensnpcs.api.astar.pathfinder.VectorNode;
|
||||||
import net.citizensnpcs.api.npc.NPC;
|
import net.citizensnpcs.api.npc.NPC;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.MathHelper;
|
import net.minecraft.server.v1_7_R1.MathHelper;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
|
@ -5,11 +5,11 @@ import net.citizensnpcs.api.ai.TargetType;
|
||||||
import net.citizensnpcs.api.ai.event.CancelReason;
|
import net.citizensnpcs.api.ai.event.CancelReason;
|
||||||
import net.citizensnpcs.api.npc.NPC;
|
import net.citizensnpcs.api.npc.NPC;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.minecraft.server.v1_6_R3.EntityLiving;
|
import net.minecraft.server.v1_7_R1.EntityLiving;
|
||||||
import net.minecraft.server.v1_6_R3.Navigation;
|
import net.minecraft.server.v1_7_R1.Navigation;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftLivingEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftLivingEntity;
|
||||||
|
|
||||||
public class MCNavigationStrategy extends AbstractPathStrategy {
|
public class MCNavigationStrategy extends AbstractPathStrategy {
|
||||||
private final Navigation navigation;
|
private final Navigation navigation;
|
||||||
|
|
|
@ -12,16 +12,16 @@ import net.citizensnpcs.api.npc.NPC;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.PlayerAnimation;
|
import net.citizensnpcs.util.PlayerAnimation;
|
||||||
import net.citizensnpcs.util.nms.PlayerNavigation;
|
import net.citizensnpcs.util.nms.PlayerNavigation;
|
||||||
import net.minecraft.server.v1_6_R3.AttributeInstance;
|
import net.minecraft.server.v1_7_R1.AttributeInstance;
|
||||||
import net.minecraft.server.v1_6_R3.Entity;
|
import net.minecraft.server.v1_7_R1.Entity;
|
||||||
import net.minecraft.server.v1_6_R3.EntityLiving;
|
import net.minecraft.server.v1_7_R1.EntityLiving;
|
||||||
import net.minecraft.server.v1_6_R3.EntityPlayer;
|
import net.minecraft.server.v1_7_R1.EntityPlayer;
|
||||||
import net.minecraft.server.v1_6_R3.Navigation;
|
import net.minecraft.server.v1_7_R1.Navigation;
|
||||||
import net.minecraft.server.v1_6_R3.PathEntity;
|
import net.minecraft.server.v1_7_R1.PathEntity;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftLivingEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftLivingEntity;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
|
||||||
public class MCTargetStrategy implements PathStrategy, EntityTarget {
|
public class MCTargetStrategy implements PathStrategy, EntityTarget {
|
||||||
|
|
|
@ -7,13 +7,13 @@ import net.citizensnpcs.npc.MobEntityController;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.EntityBat;
|
import net.minecraft.server.v1_7_R1.EntityBat;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftBat;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftBat;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.entity.Bat;
|
import org.bukkit.entity.Bat;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
@ -58,23 +58,23 @@ public class BatController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean bH() {
|
public boolean bL() {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
return super.bH();
|
return super.bL();
|
||||||
}
|
}
|
||||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||||
return super.bH();
|
return super.bL();
|
||||||
if (super.bH()) {
|
if (super.bL()) {
|
||||||
unleash(true, false); // clearLeash with client update
|
unleash(true, false); // clearLeash with client update
|
||||||
}
|
}
|
||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bi() {
|
public void bn() {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
super.bi();
|
super.bn();
|
||||||
} else {
|
} else {
|
||||||
NMS.updateAI(this);
|
NMS.updateAI(this);
|
||||||
npc.update();
|
npc.update();
|
||||||
|
@ -82,7 +82,7 @@ public class BatController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
|
@ -125,8 +125,8 @@ public class BatController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void l_() {
|
public void h() {
|
||||||
super.l_();
|
super.h();
|
||||||
if (npc != null) {
|
if (npc != null) {
|
||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +7,13 @@ import net.citizensnpcs.npc.MobEntityController;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.EntityBlaze;
|
import net.minecraft.server.v1_7_R1.EntityBlaze;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftBlaze;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftBlaze;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.entity.Blaze;
|
import org.bukkit.entity.Blaze;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
@ -57,30 +57,30 @@ public class BlazeController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean bH() {
|
public boolean bL() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return super.bH();
|
return super.bL();
|
||||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||||
return super.bH();
|
return super.bL();
|
||||||
if (super.bH()) {
|
if (super.bL()) {
|
||||||
unleash(true, false); // clearLeash with client update
|
unleash(true, false); // clearLeash with client update
|
||||||
}
|
}
|
||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bl() {
|
public void bq() {
|
||||||
if (npc != null) {
|
if (npc != null) {
|
||||||
NMS.updateAI(this);
|
NMS.updateAI(this);
|
||||||
npc.update();
|
npc.update();
|
||||||
} else {
|
} else {
|
||||||
super.bl();
|
super.bq();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
|
|
|
@ -7,13 +7,13 @@ import net.citizensnpcs.npc.MobEntityController;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.EntityCaveSpider;
|
import net.minecraft.server.v1_7_R1.EntityCaveSpider;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftCaveSpider;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftCaveSpider;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.entity.CaveSpider;
|
import org.bukkit.entity.CaveSpider;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
@ -72,32 +72,32 @@ public class CaveSpiderController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean bH() {
|
public boolean bL() {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
return super.bH();
|
return super.bL();
|
||||||
}
|
}
|
||||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault)) {
|
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault)) {
|
||||||
return super.bH();
|
return super.bL();
|
||||||
}
|
}
|
||||||
if (super.bH()) {
|
if (super.bL()) {
|
||||||
unleash(true, false); // clearLeash with client update
|
unleash(true, false); // clearLeash with client update
|
||||||
}
|
}
|
||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bi() {
|
public void bn() {
|
||||||
super.bi();
|
super.bn();
|
||||||
if (npc != null) {
|
if (npc != null) {
|
||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bl() {
|
public void bq() {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
super.bl();
|
super.bq();
|
||||||
} else {
|
} else {
|
||||||
NMS.updateAI(this);
|
NMS.updateAI(this);
|
||||||
npc.update();
|
npc.update();
|
||||||
|
@ -105,7 +105,7 @@ public class CaveSpiderController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
|
@ -114,15 +114,6 @@ public class CaveSpiderController extends MobEntityController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean e() {
|
|
||||||
if (npc == null || !npc.isFlyable()) {
|
|
||||||
return super.e();
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void e(float f, float f1) {
|
public void e(float f, float f1) {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
@ -165,5 +156,14 @@ public class CaveSpiderController extends MobEntityController {
|
||||||
public NPC getNPC() {
|
public NPC getNPC() {
|
||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean h_() {
|
||||||
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
return super.h_();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -7,13 +7,13 @@ import net.citizensnpcs.npc.MobEntityController;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.EntityChicken;
|
import net.minecraft.server.v1_7_R1.EntityChicken;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftChicken;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftChicken;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.entity.Chicken;
|
import org.bukkit.entity.Chicken;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
@ -71,27 +71,27 @@ public class ChickenController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean bH() {
|
public boolean bL() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return super.bH();
|
return super.bL();
|
||||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||||
return super.bH();
|
return super.bL();
|
||||||
if (super.bH()) {
|
if (super.bL()) {
|
||||||
unleash(true, false); // clearLeash with client update
|
unleash(true, false); // clearLeash with client update
|
||||||
}
|
}
|
||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bi() {
|
public void bn() {
|
||||||
super.bi();
|
super.bn();
|
||||||
if (npc != null)
|
if (npc != null)
|
||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
|
@ -99,15 +99,6 @@ public class ChickenController extends MobEntityController {
|
||||||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean e() {
|
|
||||||
if (npc == null || !npc.isFlyable()) {
|
|
||||||
return super.e();
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void e(float f, float f1) {
|
public void e(float f, float f1) {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
@ -150,5 +141,14 @@ public class ChickenController extends MobEntityController {
|
||||||
public NPC getNPC() {
|
public NPC getNPC() {
|
||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean h_() {
|
||||||
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
return super.h_();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -7,13 +7,13 @@ import net.citizensnpcs.npc.MobEntityController;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.EntityCow;
|
import net.minecraft.server.v1_7_R1.EntityCow;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftCow;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftCow;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.entity.Cow;
|
import org.bukkit.entity.Cow;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
@ -72,28 +72,28 @@ public class CowController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean bH() {
|
public boolean bL() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return super.bH();
|
return super.bL();
|
||||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||||
return super.bH();
|
return super.bL();
|
||||||
if (super.bH()) {
|
if (super.bL()) {
|
||||||
unleash(true, false); // clearLeash with client update
|
unleash(true, false); // clearLeash with client update
|
||||||
}
|
}
|
||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bi() {
|
public void bn() {
|
||||||
super.bi();
|
super.bn();
|
||||||
if (npc != null) {
|
if (npc != null) {
|
||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
|
@ -102,15 +102,6 @@ public class CowController extends MobEntityController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean e() {
|
|
||||||
if (npc == null || !npc.isFlyable()) {
|
|
||||||
return super.e();
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void e(float f, float f1) {
|
public void e(float f, float f1) {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
@ -153,5 +144,14 @@ public class CowController extends MobEntityController {
|
||||||
public NPC getNPC() {
|
public NPC getNPC() {
|
||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean h_() {
|
||||||
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
return super.h_();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -7,14 +7,14 @@ import net.citizensnpcs.npc.MobEntityController;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.EntityCreeper;
|
import net.minecraft.server.v1_7_R1.EntityCreeper;
|
||||||
import net.minecraft.server.v1_6_R3.EntityLightning;
|
import net.minecraft.server.v1_7_R1.EntityLightning;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftCreeper;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftCreeper;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.entity.Creeper;
|
import org.bukkit.entity.Creeper;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
@ -79,28 +79,28 @@ public class CreeperController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean bH() {
|
public boolean bL() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return super.bH();
|
return super.bL();
|
||||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||||
return super.bH();
|
return super.bL();
|
||||||
if (super.bH()) {
|
if (super.bL()) {
|
||||||
unleash(true, false); // clearLeash with client update
|
unleash(true, false); // clearLeash with client update
|
||||||
}
|
}
|
||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bi() {
|
public void bn() {
|
||||||
super.bi();
|
super.bn();
|
||||||
if (npc != null) {
|
if (npc != null) {
|
||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
|
@ -109,9 +109,9 @@ public class CreeperController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean e() {
|
public boolean h_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
return super.e();
|
return super.h_();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +7,13 @@ import net.citizensnpcs.npc.MobEntityController;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.EntityEnderDragon;
|
import net.minecraft.server.v1_7_R1.EntityEnderDragon;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEnderDragon;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEnderDragon;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.entity.EnderDragon;
|
import org.bukkit.entity.EnderDragon;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
@ -57,27 +57,36 @@ public class EnderDragonController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean bH() {
|
public boolean bL() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return super.bH();
|
return super.bL();
|
||||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||||
return super.bH();
|
return super.bL();
|
||||||
if (super.bH()) {
|
if (super.bL()) {
|
||||||
unleash(true, false); // clearLeash with client update
|
unleash(true, false); // clearLeash with client update
|
||||||
}
|
}
|
||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bl() {
|
public void bq() {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
super.bl();
|
super.bq();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void c() {
|
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
|
||||||
|
// this method is called by both the entities involved - cancelling
|
||||||
|
// it will not stop the NPC from moving.
|
||||||
|
super.collide(entity);
|
||||||
|
if (npc != null)
|
||||||
|
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void e() {
|
||||||
if (npc != null) {
|
if (npc != null) {
|
||||||
npc.update();
|
npc.update();
|
||||||
if (motX != 0 || motY != 0 || motZ != 0) {
|
if (motX != 0 || motY != 0 || motZ != 0) {
|
||||||
|
@ -87,17 +96,9 @@ public class EnderDragonController extends MobEntityController {
|
||||||
yaw = getCorrectYaw(locX + motX, locZ + motZ);
|
yaw = getCorrectYaw(locX + motX, locZ + motZ);
|
||||||
setPosition(locX + motX, locY + motY, locZ + motZ);
|
setPosition(locX + motX, locY + motY, locZ + motZ);
|
||||||
}
|
}
|
||||||
} else
|
} else {
|
||||||
super.c();
|
super.e();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
|
||||||
// this method is called by both the entities involved - cancelling
|
|
||||||
// it will not stop the NPC from moving.
|
|
||||||
super.collide(entity);
|
|
||||||
if (npc != null)
|
|
||||||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -7,13 +7,13 @@ import net.citizensnpcs.npc.MobEntityController;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.EntityEnderman;
|
import net.minecraft.server.v1_7_R1.EntityEnderman;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEnderman;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEnderman;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.entity.Enderman;
|
import org.bukkit.entity.Enderman;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
@ -72,29 +72,29 @@ public class EndermanController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean bH() {
|
public boolean bL() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return super.bH();
|
return super.bL();
|
||||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||||
return super.bH();
|
return super.bL();
|
||||||
if (super.bH()) {
|
if (super.bL()) {
|
||||||
unleash(true, false); // clearLeash with client update
|
unleash(true, false); // clearLeash with client update
|
||||||
}
|
}
|
||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bi() {
|
public void bn() {
|
||||||
super.bi();
|
super.bn();
|
||||||
if (npc != null)
|
if (npc != null)
|
||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bl() {
|
public void bq() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
super.bl();
|
super.bq();
|
||||||
else {
|
else {
|
||||||
NMS.updateAI(this);
|
NMS.updateAI(this);
|
||||||
npc.update();
|
npc.update();
|
||||||
|
@ -102,17 +102,7 @@ public class EndermanController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void c() {
|
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
|
||||||
if (npc == null)
|
|
||||||
super.c();
|
|
||||||
else {
|
|
||||||
updateAIWithMovement();
|
|
||||||
npc.update();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
|
@ -121,11 +111,12 @@ public class EndermanController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean e() {
|
public void e() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null)
|
||||||
return super.e();
|
super.e();
|
||||||
} else {
|
else {
|
||||||
return false;
|
updateAIWithMovement();
|
||||||
|
npc.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,7 +164,16 @@ public class EndermanController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean j(double d1, double d2, double d3) {
|
public boolean h_() {
|
||||||
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
return super.h_();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean k(double d1, double d2, double d3) {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
return super.j(d1, d2, d3);
|
return super.j(d1, d2, d3);
|
||||||
}
|
}
|
||||||
|
@ -189,7 +189,7 @@ public class EndermanController extends MobEntityController {
|
||||||
motY += 0.04;
|
motY += 0.04;
|
||||||
} else //(handled elsewhere)*/
|
} else //(handled elsewhere)*/
|
||||||
if (onGround && jumpTicks == 0) {
|
if (onGround && jumpTicks == 0) {
|
||||||
be();
|
bj();
|
||||||
jumpTicks = 10;
|
jumpTicks = 10;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -18,27 +18,27 @@ import net.citizensnpcs.util.nms.PlayerControllerJump;
|
||||||
import net.citizensnpcs.util.nms.PlayerControllerLook;
|
import net.citizensnpcs.util.nms.PlayerControllerLook;
|
||||||
import net.citizensnpcs.util.nms.PlayerControllerMove;
|
import net.citizensnpcs.util.nms.PlayerControllerMove;
|
||||||
import net.citizensnpcs.util.nms.PlayerNavigation;
|
import net.citizensnpcs.util.nms.PlayerNavigation;
|
||||||
import net.minecraft.server.v1_6_R3.AttributeInstance;
|
import net.minecraft.server.v1_7_R1.AttributeInstance;
|
||||||
import net.minecraft.server.v1_6_R3.Connection;
|
import net.minecraft.server.v1_7_R1.Entity;
|
||||||
import net.minecraft.server.v1_6_R3.Entity;
|
import net.minecraft.server.v1_7_R1.EntityPlayer;
|
||||||
import net.minecraft.server.v1_6_R3.EntityPlayer;
|
import net.minecraft.server.v1_7_R1.EnumGamemode;
|
||||||
import net.minecraft.server.v1_6_R3.EnumGamemode;
|
import net.minecraft.server.v1_7_R1.GenericAttributes;
|
||||||
import net.minecraft.server.v1_6_R3.GenericAttributes;
|
import net.minecraft.server.v1_7_R1.MathHelper;
|
||||||
import net.minecraft.server.v1_6_R3.MathHelper;
|
import net.minecraft.server.v1_7_R1.MinecraftServer;
|
||||||
import net.minecraft.server.v1_6_R3.MinecraftServer;
|
import net.minecraft.server.v1_7_R1.Navigation;
|
||||||
import net.minecraft.server.v1_6_R3.Navigation;
|
import net.minecraft.server.v1_7_R1.NetworkManager;
|
||||||
import net.minecraft.server.v1_6_R3.NetworkManager;
|
import net.minecraft.server.v1_7_R1.Packet;
|
||||||
import net.minecraft.server.v1_6_R3.Packet;
|
import net.minecraft.server.v1_7_R1.PacketPlayOutEntityEquipment;
|
||||||
import net.minecraft.server.v1_6_R3.Packet201PlayerInfo;
|
import net.minecraft.server.v1_7_R1.PacketPlayOutEntityHeadRotation;
|
||||||
import net.minecraft.server.v1_6_R3.Packet35EntityHeadRotation;
|
import net.minecraft.server.v1_7_R1.PacketPlayOutPlayerInfo;
|
||||||
import net.minecraft.server.v1_6_R3.Packet5EntityEquipment;
|
import net.minecraft.server.v1_7_R1.PlayerInteractManager;
|
||||||
import net.minecraft.server.v1_6_R3.PlayerInteractManager;
|
import net.minecraft.server.v1_7_R1.WorldServer;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.util.com.mojang.authlib.GameProfile;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer;
|
||||||
import org.bukkit.metadata.MetadataValue;
|
import org.bukkit.metadata.MetadataValue;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
@ -55,9 +55,9 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
|
||||||
private int packetUpdateCount;
|
private int packetUpdateCount;
|
||||||
private int useListName = -1;
|
private int useListName = -1;
|
||||||
|
|
||||||
public EntityHumanNPC(MinecraftServer minecraftServer, World world, String string,
|
public EntityHumanNPC(MinecraftServer minecraftServer, WorldServer world, GameProfile gameProfile,
|
||||||
PlayerInteractManager playerInteractManager, NPC npc) {
|
PlayerInteractManager playerInteractManager, NPC npc) {
|
||||||
super(minecraftServer, world, string, playerInteractManager);
|
super(minecraftServer, world, gameProfile, playerInteractManager);
|
||||||
playerInteractManager.setGameMode(EnumGamemode.SURVIVAL);
|
playerInteractManager.setGameMode(EnumGamemode.SURVIVAL);
|
||||||
|
|
||||||
this.npc = (CitizensNPC) npc;
|
this.npc = (CitizensNPC) npc;
|
||||||
|
@ -81,7 +81,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
|
@ -90,15 +90,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean e() {
|
|
||||||
if (npc == null || !npc.isFlyable()) {
|
|
||||||
return super.e();
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void e(float f, float f1) {
|
public void e(float f, float f1) {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
@ -150,48 +141,9 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
|
||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initialise(MinecraftServer minecraftServer) {
|
|
||||||
Socket socket = new EmptySocket();
|
|
||||||
NetworkManager conn = null;
|
|
||||||
try {
|
|
||||||
conn = new EmptyNetworkManager(minecraftServer.getLogger(), socket, "npc mgr", new Connection() {
|
|
||||||
@Override
|
|
||||||
public boolean a() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}, minecraftServer.H().getPrivate());
|
|
||||||
playerConnection = new EmptyNetHandler(minecraftServer, conn, this);
|
|
||||||
conn.a(playerConnection);
|
|
||||||
} catch (IOException e) {
|
|
||||||
// swallow
|
|
||||||
}
|
|
||||||
|
|
||||||
NMS.setStepHeight(this, 1);// stepHeight - must not stay as the default
|
|
||||||
// 0 (breaks steps).
|
|
||||||
|
|
||||||
try {
|
|
||||||
socket.close();
|
|
||||||
} catch (IOException ex) {
|
|
||||||
// swallow
|
|
||||||
}
|
|
||||||
AttributeInstance range = this.getAttributeInstance(GenericAttributes.b);
|
|
||||||
if (range == null) {
|
|
||||||
range = this.aX().b(GenericAttributes.b);
|
|
||||||
}
|
|
||||||
range.setValue(Setting.DEFAULT_PATHFINDING_RANGE.asDouble());
|
|
||||||
controllerJump = new PlayerControllerJump(this);
|
|
||||||
controllerLook = new PlayerControllerLook(this);
|
|
||||||
controllerMove = new PlayerControllerMove(this);
|
|
||||||
navigation = new PlayerNavigation(this, world);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isNavigating() {
|
|
||||||
return npc.getNavigator().isNavigating();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void l_() {
|
public void h() {
|
||||||
super.l_();
|
super.h();
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return;
|
return;
|
||||||
boolean navigating = npc.getNavigator().isNavigating();
|
boolean navigating = npc.getNavigator().isNavigating();
|
||||||
|
@ -203,7 +155,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
|
||||||
// (onGround is normally updated by the client)
|
// (onGround is normally updated by the client)
|
||||||
}
|
}
|
||||||
if (!npc.data().get("removefromplayerlist", Setting.REMOVE_PLAYERS_FROM_PLAYER_LIST.asBoolean())) {
|
if (!npc.data().get("removefromplayerlist", Setting.REMOVE_PLAYERS_FROM_PLAYER_LIST.asBoolean())) {
|
||||||
h();
|
// h(); TODO
|
||||||
}
|
}
|
||||||
if (Math.abs(motX) < EPSILON && Math.abs(motY) < EPSILON && Math.abs(motZ) < EPSILON)
|
if (Math.abs(motX) < EPSILON && Math.abs(motY) < EPSILON && Math.abs(motZ) < EPSILON)
|
||||||
motX = motY = motZ = 0;
|
motX = motY = motZ = 0;
|
||||||
|
@ -224,6 +176,50 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
|
||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean h_() {
|
||||||
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
return super.h_();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initialise(MinecraftServer minecraftServer) {
|
||||||
|
Socket socket = new EmptySocket();
|
||||||
|
NetworkManager conn = null;
|
||||||
|
try {
|
||||||
|
conn = new EmptyNetworkManager(false);
|
||||||
|
playerConnection = new EmptyNetHandler(minecraftServer, conn, this);
|
||||||
|
conn.a(playerConnection);
|
||||||
|
} catch (IOException e) {
|
||||||
|
// swallow
|
||||||
|
}
|
||||||
|
|
||||||
|
NMS.setStepHeight(this, 1);// stepHeight - must not stay as the default
|
||||||
|
// 0 (breaks steps).
|
||||||
|
|
||||||
|
try {
|
||||||
|
socket.close();
|
||||||
|
} catch (IOException ex) {
|
||||||
|
// swallow
|
||||||
|
}
|
||||||
|
|
||||||
|
AttributeInstance range = this.getAttributeInstance(GenericAttributes.b);
|
||||||
|
if (range == null) {
|
||||||
|
range = this.bc().b(GenericAttributes.b);
|
||||||
|
}
|
||||||
|
range.setValue(Setting.DEFAULT_PATHFINDING_RANGE.asDouble());
|
||||||
|
controllerJump = new PlayerControllerJump(this);
|
||||||
|
controllerLook = new PlayerControllerLook(this);
|
||||||
|
controllerMove = new PlayerControllerMove(this);
|
||||||
|
navigation = new PlayerNavigation(this, world);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isNavigating() {
|
||||||
|
return npc.getNavigator().isNavigating();
|
||||||
|
}
|
||||||
|
|
||||||
private void moveOnCurrentHeading() {
|
private void moveOnCurrentHeading() {
|
||||||
NMS.updateAI(this);
|
NMS.updateAI(this);
|
||||||
// taken from EntityLiving update method
|
// taken from EntityLiving update method
|
||||||
|
@ -233,7 +229,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
|
||||||
motY += 0.04;
|
motY += 0.04;
|
||||||
} else //(handled elsewhere)*/
|
} else //(handled elsewhere)*/
|
||||||
if (onGround && jumpTicks == 0) {
|
if (onGround && jumpTicks == 0) {
|
||||||
be();
|
bj();
|
||||||
jumpTicks = 10;
|
jumpTicks = 10;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -250,7 +246,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMoveDestination(double x, double y, double z, float speed) {
|
public void setMoveDestination(double x, double y, double z, double speed) {
|
||||||
controllerMove.a(x, y, z, speed);
|
controllerMove.a(x, y, z, speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -273,11 +269,11 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
|
||||||
Location current = getBukkitEntity().getLocation(packetLocationCache);
|
Location current = getBukkitEntity().getLocation(packetLocationCache);
|
||||||
Packet[] packets = new Packet[navigating ? 6 : 7];
|
Packet[] packets = new Packet[navigating ? 6 : 7];
|
||||||
if (!navigating) {
|
if (!navigating) {
|
||||||
packets[6] = new Packet35EntityHeadRotation(id,
|
packets[6] = new PacketPlayOutEntityHeadRotation(this,
|
||||||
(byte) MathHelper.d(NMS.getHeadYaw(this) * 256.0F / 360.0F));
|
(byte) MathHelper.d(NMS.getHeadYaw(this) * 256.0F / 360.0F));
|
||||||
}
|
}
|
||||||
for (int i = 0; i < 5; i++) {
|
for (int i = 0; i < 5; i++) {
|
||||||
packets[i] = new Packet5EntityEquipment(id, i, getEquipment(i));
|
packets[i] = new PacketPlayOutEntityEquipment(getId(), i, getEquipment(i));
|
||||||
}
|
}
|
||||||
boolean removeFromPlayerList = Setting.REMOVE_PLAYERS_FROM_PLAYER_LIST.asBoolean();
|
boolean removeFromPlayerList = Setting.REMOVE_PLAYERS_FROM_PLAYER_LIST.asBoolean();
|
||||||
NMS.addOrRemoveFromPlayerList(getBukkitEntity(),
|
NMS.addOrRemoveFromPlayerList(getBukkitEntity(),
|
||||||
|
@ -285,7 +281,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
|
||||||
int useListName = removeFromPlayerList ? 0 : 1;
|
int useListName = removeFromPlayerList ? 0 : 1;
|
||||||
if (useListName != this.useListName || this.useListName == -1) {
|
if (useListName != this.useListName || this.useListName == -1) {
|
||||||
this.useListName = useListName;
|
this.useListName = useListName;
|
||||||
packets[5] = new Packet201PlayerInfo(getBukkitEntity().getPlayerListName(), !removeFromPlayerList,
|
packets[5] = new PacketPlayOutPlayerInfo(getBukkitEntity().getPlayerListName(), !removeFromPlayerList,
|
||||||
removeFromPlayerList ? 9999 : ping);
|
removeFromPlayerList ? 9999 : ping);
|
||||||
}
|
}
|
||||||
NMS.sendPacketsNearby(current, packets);
|
NMS.sendPacketsNearby(current, packets);
|
||||||
|
|
|
@ -7,13 +7,13 @@ import net.citizensnpcs.npc.MobEntityController;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.EntityGhast;
|
import net.minecraft.server.v1_7_R1.EntityGhast;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftGhast;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftGhast;
|
||||||
import org.bukkit.entity.Ghast;
|
import org.bukkit.entity.Ghast;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
@ -43,28 +43,28 @@ public class GhastController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean bH() {
|
public boolean bL() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return super.bH();
|
return super.bL();
|
||||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||||
return super.bH();
|
return super.bL();
|
||||||
if (super.bH()) {
|
if (super.bL()) {
|
||||||
unleash(true, false); // clearLeash with client update
|
unleash(true, false); // clearLeash with client update
|
||||||
}
|
}
|
||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bl() {
|
public void bq() {
|
||||||
if (npc != null) {
|
if (npc != null) {
|
||||||
npc.update();
|
npc.update();
|
||||||
} else
|
} else
|
||||||
super.bl();
|
super.bq();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
|
|
|
@ -7,13 +7,13 @@ import net.citizensnpcs.npc.MobEntityController;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.EntityGiantZombie;
|
import net.minecraft.server.v1_7_R1.EntityGiantZombie;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftGiant;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftGiant;
|
||||||
import org.bukkit.entity.Giant;
|
import org.bukkit.entity.Giant;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
@ -57,22 +57,22 @@ public class GiantController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean bH() {
|
public boolean bL() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return super.bH();
|
return super.bL();
|
||||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||||
return super.bH();
|
return super.bL();
|
||||||
if (super.bH()) {
|
if (super.bL()) {
|
||||||
unleash(true, false); // clearLeash with client update
|
unleash(true, false); // clearLeash with client update
|
||||||
}
|
}
|
||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bl() {
|
public void bq() {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
super.bl();
|
super.bq();
|
||||||
} else {
|
} else {
|
||||||
NMS.updateAI(this);
|
NMS.updateAI(this);
|
||||||
npc.update();
|
npc.update();
|
||||||
|
@ -80,7 +80,7 @@ public class GiantController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
|
@ -89,9 +89,9 @@ public class GiantController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean e() {
|
public boolean h_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
return super.e();
|
return super.h_();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,14 +8,14 @@ import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.trait.HorseModifiers;
|
import net.citizensnpcs.trait.HorseModifiers;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.EntityHorse;
|
import net.minecraft.server.v1_7_R1.EntityHorse;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftHorse;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftHorse;
|
||||||
import org.bukkit.entity.Horse;
|
import org.bukkit.entity.Horse;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
@ -67,31 +67,20 @@ public class HorseController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean bH() {
|
public boolean bL() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return super.bH();
|
return super.bL();
|
||||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||||
return super.bH();
|
return super.bL();
|
||||||
if (super.bH()) {
|
if (super.bL()) {
|
||||||
unleash(true, false); // clearLeash with client update
|
unleash(true, false); // clearLeash with client update
|
||||||
}
|
}
|
||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void c() {
|
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
|
||||||
if (npc == null) {
|
|
||||||
super.c();
|
|
||||||
} else {
|
|
||||||
NMS.setStepHeight(this, 1);
|
|
||||||
updateAIWithMovement();
|
|
||||||
npc.update();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
|
@ -101,11 +90,13 @@ public class HorseController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean e() {
|
public void e() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null) {
|
||||||
return super.e();
|
super.e();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
NMS.setStepHeight(this, 1);
|
||||||
|
updateAIWithMovement();
|
||||||
|
npc.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,6 +143,15 @@ public class HorseController extends MobEntityController {
|
||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean h_() {
|
||||||
|
if (npc == null || !npc.isFlyable()) {
|
||||||
|
return super.h_();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void updateAIWithMovement() {
|
private void updateAIWithMovement() {
|
||||||
NMS.updateAI(this);
|
NMS.updateAI(this);
|
||||||
// taken from EntityLiving update method
|
// taken from EntityLiving update method
|
||||||
|
@ -161,7 +161,7 @@ public class HorseController extends MobEntityController {
|
||||||
motY += 0.04;
|
motY += 0.04;
|
||||||
} else //(handled elsewhere)*/
|
} else //(handled elsewhere)*/
|
||||||
if (onGround && jumpTicks == 0) {
|
if (onGround && jumpTicks == 0) {
|
||||||
be();
|
bj();
|
||||||
jumpTicks = 10;
|
jumpTicks = 10;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,26 +1,29 @@
|
||||||
package net.citizensnpcs.npc.entity;
|
package net.citizensnpcs.npc.entity;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
import net.citizensnpcs.Settings.Setting;
|
import net.citizensnpcs.Settings.Setting;
|
||||||
import net.citizensnpcs.api.CitizensAPI;
|
import net.citizensnpcs.api.CitizensAPI;
|
||||||
import net.citizensnpcs.api.npc.NPC;
|
import net.citizensnpcs.api.npc.NPC;
|
||||||
import net.citizensnpcs.api.util.Colorizer;
|
import net.citizensnpcs.api.util.Colorizer;
|
||||||
import net.citizensnpcs.npc.AbstractEntityController;
|
import net.citizensnpcs.npc.AbstractEntityController;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.minecraft.server.v1_6_R3.PlayerInteractManager;
|
import net.minecraft.server.v1_7_R1.PlayerInteractManager;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.WorldServer;
|
||||||
|
import net.minecraft.util.com.mojang.authlib.GameProfile;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftWorld;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftWorld;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public class HumanController extends AbstractEntityController {
|
public class HumanController extends AbstractEntityController {
|
||||||
@Override
|
@Override
|
||||||
protected Entity createEntity(final Location at, final NPC npc) {
|
protected Entity createEntity(final Location at, final NPC npc) {
|
||||||
World ws = ((CraftWorld) at.getWorld()).getHandle();
|
WorldServer ws = ((CraftWorld) at.getWorld()).getHandle();
|
||||||
final EntityHumanNPC handle = new EntityHumanNPC(ws.getServer().getServer(), ws, Colorizer.parseColors(npc
|
final EntityHumanNPC handle = new EntityHumanNPC(ws.getServer().getServer(), ws, new GameProfile(UUID
|
||||||
.getFullName()), new PlayerInteractManager(ws), npc);
|
.randomUUID().toString(), Colorizer.parseColors(npc.getFullName())), new PlayerInteractManager(ws), npc);
|
||||||
handle.setPositionRotation(at.getX(), at.getY(), at.getZ(), at.getYaw(), at.getPitch());
|
handle.setPositionRotation(at.getX(), at.getY(), at.getZ(), at.getYaw(), at.getPitch());
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), new Runnable() {
|
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -7,13 +7,13 @@ import net.citizensnpcs.npc.MobEntityController;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.EntityIronGolem;
|
import net.minecraft.server.v1_7_R1.EntityIronGolem;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftIronGolem;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftIronGolem;
|
||||||
import org.bukkit.entity.IronGolem;
|
import org.bukkit.entity.IronGolem;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
@ -57,27 +57,27 @@ public class IronGolemController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean bH() {
|
public boolean bL() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return super.bH();
|
return super.bL();
|
||||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||||
return super.bH();
|
return super.bL();
|
||||||
if (super.bH()) {
|
if (super.bL()) {
|
||||||
unleash(true, false); // clearLeash with client update
|
unleash(true, false); // clearLeash with client update
|
||||||
}
|
}
|
||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bi() {
|
public void bn() {
|
||||||
super.bi();
|
super.bn();
|
||||||
if (npc != null)
|
if (npc != null)
|
||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
|
@ -86,9 +86,9 @@ public class IronGolemController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean e() {
|
public boolean h_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
return super.e();
|
return super.h_();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +7,13 @@ import net.citizensnpcs.npc.MobEntityController;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.EntityMagmaCube;
|
import net.minecraft.server.v1_7_R1.EntityMagmaCube;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftMagmaCube;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftMagmaCube;
|
||||||
import org.bukkit.entity.MagmaCube;
|
import org.bukkit.entity.MagmaCube;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
@ -58,29 +58,29 @@ public class MagmaCubeController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean bH() {
|
public boolean bL() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return super.bH();
|
return super.bL();
|
||||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||||
return super.bH();
|
return super.bL();
|
||||||
if (super.bH()) {
|
if (super.bL()) {
|
||||||
unleash(true, false); // clearLeash with client update
|
unleash(true, false); // clearLeash with client update
|
||||||
}
|
}
|
||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bi() {
|
public void bn() {
|
||||||
super.bi();
|
super.bn();
|
||||||
if (npc != null)
|
if (npc != null)
|
||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bl() {
|
public void bq() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
super.bl();
|
super.bq();
|
||||||
else {
|
else {
|
||||||
NMS.updateAI(this);
|
NMS.updateAI(this);
|
||||||
npc.update();
|
npc.update();
|
||||||
|
@ -88,7 +88,7 @@ public class MagmaCubeController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
|
@ -97,9 +97,9 @@ public class MagmaCubeController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean e() {
|
public boolean h_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
return super.e();
|
return super.h_();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +7,13 @@ import net.citizensnpcs.npc.MobEntityController;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.EntityMushroomCow;
|
import net.minecraft.server.v1_7_R1.EntityMushroomCow;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftMushroomCow;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftMushroomCow;
|
||||||
import org.bukkit.entity.MushroomCow;
|
import org.bukkit.entity.MushroomCow;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
@ -58,27 +58,27 @@ public class MushroomCowController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean bH() {
|
public boolean bL() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return super.bH();
|
return super.bL();
|
||||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||||
return super.bH();
|
return super.bL();
|
||||||
if (super.bH()) {
|
if (super.bL()) {
|
||||||
unleash(true, false); // clearLeash with client update
|
unleash(true, false); // clearLeash with client update
|
||||||
}
|
}
|
||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bi() {
|
public void bn() {
|
||||||
super.bi();
|
super.bn();
|
||||||
if (npc != null)
|
if (npc != null)
|
||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
|
@ -87,9 +87,9 @@ public class MushroomCowController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean e() {
|
public boolean h_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
return super.e();
|
return super.h_();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +7,13 @@ import net.citizensnpcs.npc.MobEntityController;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.EntityOcelot;
|
import net.minecraft.server.v1_7_R1.EntityOcelot;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftOcelot;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftOcelot;
|
||||||
import org.bukkit.entity.Ocelot;
|
import org.bukkit.entity.Ocelot;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
@ -58,27 +58,27 @@ public class OcelotController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean bH() {
|
public boolean bL() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return super.bH();
|
return super.bL();
|
||||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||||
return super.bH();
|
return super.bL();
|
||||||
if (super.bH()) {
|
if (super.bL()) {
|
||||||
unleash(true, false); // clearLeash with client update
|
unleash(true, false); // clearLeash with client update
|
||||||
}
|
}
|
||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bi() {
|
public void bn() {
|
||||||
super.bi();
|
super.bn();
|
||||||
if (npc != null)
|
if (npc != null)
|
||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
|
@ -87,9 +87,9 @@ public class OcelotController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean e() {
|
public boolean h_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
return super.e();
|
return super.h_();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,14 +7,14 @@ import net.citizensnpcs.npc.MobEntityController;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.EntityLightning;
|
import net.minecraft.server.v1_7_R1.EntityLightning;
|
||||||
import net.minecraft.server.v1_6_R3.EntityPig;
|
import net.minecraft.server.v1_7_R1.EntityPig;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftPig;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPig;
|
||||||
import org.bukkit.entity.Pig;
|
import org.bukkit.entity.Pig;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
@ -64,27 +64,27 @@ public class PigController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean bH() {
|
public boolean bL() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return super.bH();
|
return super.bL();
|
||||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||||
return super.bH();
|
return super.bL();
|
||||||
if (super.bH()) {
|
if (super.bL()) {
|
||||||
unleash(true, false); // clearLeash with client update
|
unleash(true, false); // clearLeash with client update
|
||||||
}
|
}
|
||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bi() {
|
public void bn() {
|
||||||
super.bi();
|
super.bn();
|
||||||
if (npc != null)
|
if (npc != null)
|
||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
|
@ -93,9 +93,9 @@ public class PigController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean e() {
|
public boolean h_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
return super.e();
|
return super.h_();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +7,13 @@ import net.citizensnpcs.npc.MobEntityController;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.EntityPigZombie;
|
import net.minecraft.server.v1_7_R1.EntityPigZombie;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftPigZombie;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPigZombie;
|
||||||
import org.bukkit.entity.PigZombie;
|
import org.bukkit.entity.PigZombie;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
@ -58,29 +58,29 @@ public class PigZombieController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean bH() {
|
public boolean bL() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return super.bH();
|
return super.bL();
|
||||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||||
return super.bH();
|
return super.bL();
|
||||||
if (super.bH()) {
|
if (super.bL()) {
|
||||||
unleash(true, false); // clearLeash with client update
|
unleash(true, false); // clearLeash with client update
|
||||||
}
|
}
|
||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bi() {
|
public void bn() {
|
||||||
super.bi();
|
super.bn();
|
||||||
if (npc != null)
|
if (npc != null)
|
||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bl() {
|
public void bq() {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
super.bl();
|
super.bq();
|
||||||
} else {
|
} else {
|
||||||
NMS.updateAI(this);
|
NMS.updateAI(this);
|
||||||
npc.update();
|
npc.update();
|
||||||
|
@ -88,7 +88,7 @@ public class PigZombieController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
|
@ -97,9 +97,9 @@ public class PigZombieController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean e() {
|
public boolean h_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
return super.e();
|
return super.h_();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +7,13 @@ import net.citizensnpcs.npc.MobEntityController;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.EntitySheep;
|
import net.minecraft.server.v1_7_R1.EntitySheep;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftSheep;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftSheep;
|
||||||
import org.bukkit.entity.Sheep;
|
import org.bukkit.entity.Sheep;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
@ -58,27 +58,27 @@ public class SheepController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean bH() {
|
public boolean bL() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return super.bH();
|
return super.bL();
|
||||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||||
return super.bH();
|
return super.bL();
|
||||||
if (super.bH()) {
|
if (super.bL()) {
|
||||||
unleash(true, false); // clearLeash with client update
|
unleash(true, false); // clearLeash with client update
|
||||||
}
|
}
|
||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bi() {
|
public void bn() {
|
||||||
super.bi();
|
super.bn();
|
||||||
if (npc != null)
|
if (npc != null)
|
||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
|
@ -87,9 +87,9 @@ public class SheepController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean e() {
|
public boolean h_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
return super.e();
|
return super.h_();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +7,13 @@ import net.citizensnpcs.npc.MobEntityController;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.EntitySilverfish;
|
import net.minecraft.server.v1_7_R1.EntitySilverfish;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftSilverfish;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftSilverfish;
|
||||||
import org.bukkit.entity.Silverfish;
|
import org.bukkit.entity.Silverfish;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
@ -57,29 +57,29 @@ public class SilverfishController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean bH() {
|
public boolean bL() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return super.bH();
|
return super.bL();
|
||||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||||
return super.bH();
|
return super.bL();
|
||||||
if (super.bH()) {
|
if (super.bL()) {
|
||||||
unleash(true, false); // clearLeash with client update
|
unleash(true, false); // clearLeash with client update
|
||||||
}
|
}
|
||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bi() {
|
public void bn() {
|
||||||
super.bi();
|
super.bn();
|
||||||
if (npc != null)
|
if (npc != null)
|
||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bl() {
|
public void bq() {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
super.bl();
|
super.bq();
|
||||||
} else {
|
} else {
|
||||||
NMS.updateAI(this);
|
NMS.updateAI(this);
|
||||||
npc.update();
|
npc.update();
|
||||||
|
@ -87,7 +87,7 @@ public class SilverfishController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
|
@ -96,9 +96,9 @@ public class SilverfishController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean e() {
|
public boolean h_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
return super.e();
|
return super.h_();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +7,13 @@ import net.citizensnpcs.npc.MobEntityController;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.EntitySkeleton;
|
import net.minecraft.server.v1_7_R1.EntitySkeleton;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftSkeleton;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftSkeleton;
|
||||||
import org.bukkit.entity.Skeleton;
|
import org.bukkit.entity.Skeleton;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
@ -57,27 +57,27 @@ public class SkeletonController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean bH() {
|
public boolean bL() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return super.bH();
|
return super.bL();
|
||||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||||
return super.bH();
|
return super.bL();
|
||||||
if (super.bH()) {
|
if (super.bL()) {
|
||||||
unleash(true, false); // clearLeash with client update
|
unleash(true, false); // clearLeash with client update
|
||||||
}
|
}
|
||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bi() {
|
public void bn() {
|
||||||
super.bi();
|
super.bn();
|
||||||
if (npc != null)
|
if (npc != null)
|
||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
|
@ -86,9 +86,9 @@ public class SkeletonController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean e() {
|
public boolean h_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
return super.e();
|
return super.h_();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +7,13 @@ import net.citizensnpcs.npc.MobEntityController;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.EntitySlime;
|
import net.minecraft.server.v1_7_R1.EntitySlime;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftSlime;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftSlime;
|
||||||
import org.bukkit.entity.Slime;
|
import org.bukkit.entity.Slime;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
@ -59,29 +59,29 @@ public class SlimeController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean bH() {
|
public boolean bL() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return super.bH();
|
return super.bL();
|
||||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||||
return super.bH();
|
return super.bL();
|
||||||
if (super.bH()) {
|
if (super.bL()) {
|
||||||
unleash(true, false); // clearLeash with client update
|
unleash(true, false); // clearLeash with client update
|
||||||
}
|
}
|
||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bi() {
|
public void bn() {
|
||||||
super.bi();
|
super.bn();
|
||||||
if (npc != null)
|
if (npc != null)
|
||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bl() {
|
public void bq() {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
super.bl();
|
super.bq();
|
||||||
} else {
|
} else {
|
||||||
npc.update();
|
npc.update();
|
||||||
NMS.updateAI(this);
|
NMS.updateAI(this);
|
||||||
|
@ -89,7 +89,7 @@ public class SlimeController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
|
@ -98,9 +98,9 @@ public class SlimeController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean e() {
|
public boolean h_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
return super.e();
|
return super.h_();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +7,13 @@ import net.citizensnpcs.npc.MobEntityController;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.EntitySnowman;
|
import net.minecraft.server.v1_7_R1.EntitySnowman;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftSnowman;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftSnowman;
|
||||||
import org.bukkit.entity.Snowman;
|
import org.bukkit.entity.Snowman;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
@ -57,27 +57,27 @@ public class SnowmanController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean bH() {
|
public boolean bL() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return super.bH();
|
return super.bL();
|
||||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||||
return super.bH();
|
return super.bL();
|
||||||
if (super.bH()) {
|
if (super.bL()) {
|
||||||
unleash(true, false); // clearLeash with client update
|
unleash(true, false); // clearLeash with client update
|
||||||
}
|
}
|
||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bi() {
|
public void bn() {
|
||||||
super.bi();
|
super.bn();
|
||||||
if (npc != null)
|
if (npc != null)
|
||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
|
@ -86,9 +86,9 @@ public class SnowmanController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean e() {
|
public boolean h_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
return super.e();
|
return super.h_();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +7,13 @@ import net.citizensnpcs.npc.MobEntityController;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.EntitySpider;
|
import net.minecraft.server.v1_7_R1.EntitySpider;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftSpider;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftSpider;
|
||||||
import org.bukkit.entity.Spider;
|
import org.bukkit.entity.Spider;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
@ -57,29 +57,29 @@ public class SpiderController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean bH() {
|
public boolean bL() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return super.bH();
|
return super.bL();
|
||||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||||
return super.bH();
|
return super.bL();
|
||||||
if (super.bH()) {
|
if (super.bL()) {
|
||||||
unleash(true, false); // clearLeash with client update
|
unleash(true, false); // clearLeash with client update
|
||||||
}
|
}
|
||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bi() {
|
public void bn() {
|
||||||
super.bi();
|
super.bn();
|
||||||
if (npc != null)
|
if (npc != null)
|
||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bl() {
|
public void bq() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
super.bl();
|
super.bq();
|
||||||
else {
|
else {
|
||||||
NMS.updateAI(this);
|
NMS.updateAI(this);
|
||||||
npc.update();
|
npc.update();
|
||||||
|
@ -87,7 +87,7 @@ public class SpiderController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
|
@ -96,9 +96,9 @@ public class SpiderController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean e() {
|
public boolean h_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
return super.e();
|
return super.h_();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +7,13 @@ import net.citizensnpcs.npc.MobEntityController;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.EntitySquid;
|
import net.minecraft.server.v1_7_R1.EntitySquid;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftSquid;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftSquid;
|
||||||
import org.bukkit.entity.Squid;
|
import org.bukkit.entity.Squid;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
@ -57,28 +57,28 @@ public class SquidController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean bH() {
|
public boolean bL() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return super.bH();
|
return super.bL();
|
||||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||||
return super.bH();
|
return super.bL();
|
||||||
if (super.bH()) {
|
if (super.bL()) {
|
||||||
unleash(true, false); // clearLeash with client update
|
unleash(true, false); // clearLeash with client update
|
||||||
}
|
}
|
||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bl() {
|
public void bq() {
|
||||||
if (npc != null) {
|
if (npc != null) {
|
||||||
npc.update();
|
npc.update();
|
||||||
} else
|
} else
|
||||||
super.bl();
|
super.bq();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
|
@ -87,9 +87,9 @@ public class SquidController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean e() {
|
public boolean h_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
return super.e();
|
return super.h_();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,14 +7,14 @@ import net.citizensnpcs.npc.MobEntityController;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.EntityHuman;
|
import net.minecraft.server.v1_7_R1.EntityHuman;
|
||||||
import net.minecraft.server.v1_6_R3.EntityVillager;
|
import net.minecraft.server.v1_7_R1.EntityVillager;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftVillager;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftVillager;
|
||||||
import org.bukkit.entity.Villager;
|
import org.bukkit.entity.Villager;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
@ -65,27 +65,27 @@ public class VillagerController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean bH() {
|
public boolean bL() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return super.bH();
|
return super.bL();
|
||||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||||
return super.bH();
|
return super.bL();
|
||||||
if (super.bH()) {
|
if (super.bL()) {
|
||||||
unleash(true, false); // clearLeash with client update
|
unleash(true, false); // clearLeash with client update
|
||||||
}
|
}
|
||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bi() {
|
public void bn() {
|
||||||
super.bi();
|
super.bn();
|
||||||
if (npc != null)
|
if (npc != null)
|
||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
|
@ -94,9 +94,9 @@ public class VillagerController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean e() {
|
public boolean h_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
return super.e();
|
return super.h_();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +7,13 @@ import net.citizensnpcs.npc.MobEntityController;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.EntityWitch;
|
import net.minecraft.server.v1_7_R1.EntityWitch;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftWitch;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftWitch;
|
||||||
import org.bukkit.entity.Witch;
|
import org.bukkit.entity.Witch;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
@ -57,27 +57,27 @@ public class WitchController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean bH() {
|
public boolean bL() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return super.bH();
|
return super.bL();
|
||||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||||
return super.bH();
|
return super.bL();
|
||||||
if (super.bH()) {
|
if (super.bL()) {
|
||||||
unleash(true, false); // clearLeash with client update
|
unleash(true, false); // clearLeash with client update
|
||||||
}
|
}
|
||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bi() {
|
public void bn() {
|
||||||
super.bi();
|
super.bn();
|
||||||
if (npc != null)
|
if (npc != null)
|
||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
|
@ -86,9 +86,9 @@ public class WitchController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean e() {
|
public boolean h_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
return super.e();
|
return super.h_();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +7,13 @@ import net.citizensnpcs.npc.MobEntityController;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.EntityWither;
|
import net.minecraft.server.v1_7_R1.EntityWither;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftWither;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftWither;
|
||||||
import org.bukkit.entity.Wither;
|
import org.bukkit.entity.Wither;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
@ -44,37 +44,28 @@ public class WitherController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean bH() {
|
public boolean bL() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return super.bH();
|
return super.bL();
|
||||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||||
return super.bH();
|
return super.bL();
|
||||||
if (super.bH()) {
|
if (super.bL()) {
|
||||||
unleash(true, false); // clearLeash with client update
|
unleash(true, false); // clearLeash with client update
|
||||||
}
|
}
|
||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bi() {
|
public void bn() {
|
||||||
super.bi();
|
super.bn();
|
||||||
if (npc != null) {
|
if (npc != null) {
|
||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void c() {
|
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
|
||||||
if (npc == null) {
|
|
||||||
super.c();
|
|
||||||
} else {
|
|
||||||
updateAIWithMovement();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
|
@ -82,6 +73,15 @@ public class WitherController extends MobEntityController {
|
||||||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void e() {
|
||||||
|
if (npc == null) {
|
||||||
|
super.e();
|
||||||
|
} else {
|
||||||
|
updateAIWithMovement();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void g(double x, double y, double z) {
|
public void g(double x, double y, double z) {
|
||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
|
@ -125,7 +125,7 @@ public class WitherController extends MobEntityController {
|
||||||
motY += 0.04;
|
motY += 0.04;
|
||||||
} else //(handled elsewhere)*/
|
} else //(handled elsewhere)*/
|
||||||
if (onGround && jumpTicks == 0) {
|
if (onGround && jumpTicks == 0) {
|
||||||
be();
|
bj();
|
||||||
jumpTicks = 10;
|
jumpTicks = 10;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -7,13 +7,13 @@ import net.citizensnpcs.npc.MobEntityController;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.EntityWolf;
|
import net.minecraft.server.v1_7_R1.EntityWolf;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftWolf;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftWolf;
|
||||||
import org.bukkit.entity.Wolf;
|
import org.bukkit.entity.Wolf;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
@ -57,28 +57,28 @@ public class WolfController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean bH() {
|
public boolean bL() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return super.bH();
|
return super.bL();
|
||||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||||
return super.bH();
|
return super.bL();
|
||||||
if (super.bH()) {
|
if (super.bL()) {
|
||||||
unleash(true, false); // clearLeash with client update
|
unleash(true, false); // clearLeash with client update
|
||||||
}
|
}
|
||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bi() {
|
public void bn() {
|
||||||
super.bi();
|
super.bn();
|
||||||
if (npc != null) {
|
if (npc != null) {
|
||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
|
@ -87,9 +87,9 @@ public class WolfController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean e() {
|
public boolean h_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
return super.e();
|
return super.h_();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +7,13 @@ import net.citizensnpcs.npc.MobEntityController;
|
||||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.EntityZombie;
|
import net.minecraft.server.v1_7_R1.EntityZombie;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftZombie;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftZombie;
|
||||||
import org.bukkit.entity.Zombie;
|
import org.bukkit.entity.Zombie;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
@ -57,28 +57,28 @@ public class ZombieController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean bH() {
|
public boolean bL() {
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
return super.bH();
|
return super.bL();
|
||||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||||
return super.bH();
|
return super.bL();
|
||||||
if (super.bH()) {
|
if (super.bL()) {
|
||||||
unleash(true, false); // clearLeash with client update
|
unleash(true, false); // clearLeash with client update
|
||||||
}
|
}
|
||||||
return false; // shouldLeash
|
return false; // shouldLeash
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bi() {
|
public void bn() {
|
||||||
super.bi();
|
super.bn();
|
||||||
if (npc != null) {
|
if (npc != null) {
|
||||||
npc.update();
|
npc.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collide(net.minecraft.server.v1_6_R3.Entity entity) {
|
public void collide(net.minecraft.server.v1_7_R1.Entity entity) {
|
||||||
// this method is called by both the entities involved - cancelling
|
// this method is called by both the entities involved - cancelling
|
||||||
// it will not stop the NPC from moving.
|
// it will not stop the NPC from moving.
|
||||||
super.collide(entity);
|
super.collide(entity);
|
||||||
|
@ -87,9 +87,9 @@ public class ZombieController extends MobEntityController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean e() {
|
public boolean h_() {
|
||||||
if (npc == null || !npc.isFlyable()) {
|
if (npc == null || !npc.isFlyable()) {
|
||||||
return super.e();
|
return super.h_();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,75 +1,16 @@
|
||||||
package net.citizensnpcs.npc.network;
|
package net.citizensnpcs.npc.network;
|
||||||
|
|
||||||
import net.minecraft.server.v1_6_R3.EntityPlayer;
|
import net.minecraft.server.v1_7_R1.EntityPlayer;
|
||||||
import net.minecraft.server.v1_6_R3.MinecraftServer;
|
import net.minecraft.server.v1_7_R1.MinecraftServer;
|
||||||
import net.minecraft.server.v1_6_R3.NetworkManager;
|
import net.minecraft.server.v1_7_R1.NetworkManager;
|
||||||
import net.minecraft.server.v1_6_R3.Packet;
|
import net.minecraft.server.v1_7_R1.Packet;
|
||||||
import net.minecraft.server.v1_6_R3.Packet102WindowClick;
|
import net.minecraft.server.v1_7_R1.PlayerConnection;
|
||||||
import net.minecraft.server.v1_6_R3.Packet106Transaction;
|
|
||||||
import net.minecraft.server.v1_6_R3.Packet10Flying;
|
|
||||||
import net.minecraft.server.v1_6_R3.Packet130UpdateSign;
|
|
||||||
import net.minecraft.server.v1_6_R3.Packet14BlockDig;
|
|
||||||
import net.minecraft.server.v1_6_R3.Packet15Place;
|
|
||||||
import net.minecraft.server.v1_6_R3.Packet16BlockItemSwitch;
|
|
||||||
import net.minecraft.server.v1_6_R3.Packet255KickDisconnect;
|
|
||||||
import net.minecraft.server.v1_6_R3.Packet28EntityVelocity;
|
|
||||||
import net.minecraft.server.v1_6_R3.Packet3Chat;
|
|
||||||
import net.minecraft.server.v1_6_R3.Packet51MapChunk;
|
|
||||||
import net.minecraft.server.v1_6_R3.PlayerConnection;
|
|
||||||
|
|
||||||
public class EmptyNetHandler extends PlayerConnection {
|
public class EmptyNetHandler extends PlayerConnection {
|
||||||
public EmptyNetHandler(MinecraftServer minecraftServer, NetworkManager networkManager, EntityPlayer entityPlayer) {
|
public EmptyNetHandler(MinecraftServer minecraftServer, NetworkManager networkManager, EntityPlayer entityPlayer) {
|
||||||
super(minecraftServer, networkManager, entityPlayer);
|
super(minecraftServer, networkManager, entityPlayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void a(Packet102WindowClick packet) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void a(Packet106Transaction packet) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void a(Packet10Flying packet) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void a(Packet130UpdateSign packet) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void a(Packet14BlockDig packet) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void a(Packet15Place packet) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void a(Packet16BlockItemSwitch packet) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void a(Packet255KickDisconnect packet) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void a(Packet28EntityVelocity packet) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void a(Packet3Chat packet) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void a(Packet51MapChunk packet) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void a(String string, Object[] objects) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendPacket(Packet packet) {
|
public void sendPacket(Packet packet) {
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,48 +1,13 @@
|
||||||
package net.citizensnpcs.npc.network;
|
package net.citizensnpcs.npc.network;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.Socket;
|
|
||||||
import java.security.PrivateKey;
|
|
||||||
|
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.minecraft.server.v1_6_R3.Connection;
|
import net.minecraft.server.v1_7_R1.NetworkManager;
|
||||||
import net.minecraft.server.v1_6_R3.IConsoleLogManager;
|
|
||||||
import net.minecraft.server.v1_6_R3.NetworkManager;
|
|
||||||
import net.minecraft.server.v1_6_R3.Packet;
|
|
||||||
|
|
||||||
public class EmptyNetworkManager extends NetworkManager {
|
public class EmptyNetworkManager extends NetworkManager {
|
||||||
public EmptyNetworkManager(IConsoleLogManager logManager, Socket socket, String string, Connection conn,
|
public EmptyNetworkManager(boolean flag) throws IOException {
|
||||||
PrivateKey key) throws IOException {
|
super(flag);
|
||||||
super(logManager, socket, string, conn, key);
|
|
||||||
NMS.stopNetworkThreads(this);
|
NMS.stopNetworkThreads(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void a() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void a(Connection conn) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void a(String s, Object... objects) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void b() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void d() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int e() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void queue(Packet packet) {
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -14,12 +14,12 @@ import net.citizensnpcs.api.trait.trait.Owner;
|
||||||
import net.citizensnpcs.api.util.DataKey;
|
import net.citizensnpcs.api.util.DataKey;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.citizensnpcs.util.Util;
|
import net.citizensnpcs.util.Util;
|
||||||
import net.minecraft.server.v1_6_R3.EntityEnderDragon;
|
import net.minecraft.server.v1_7_R1.EntityEnderDragon;
|
||||||
import net.minecraft.server.v1_6_R3.EntityLiving;
|
import net.minecraft.server.v1_7_R1.EntityLiving;
|
||||||
import net.minecraft.server.v1_6_R3.EntityPlayer;
|
import net.minecraft.server.v1_7_R1.EntityPlayer;
|
||||||
|
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
@ -76,7 +76,7 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private net.minecraft.server.v1_6_R3.Entity getHandle() {
|
private net.minecraft.server.v1_7_R1.Entity getHandle() {
|
||||||
return ((CraftEntity) npc.getEntity()).getHandle();
|
return ((CraftEntity) npc.getEntity()).getHandle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,7 +182,7 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab
|
||||||
return enabled;
|
return enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setMountedYaw(net.minecraft.server.v1_6_R3.Entity handle) {
|
private void setMountedYaw(net.minecraft.server.v1_7_R1.Entity handle) {
|
||||||
if (handle instanceof EntityEnderDragon || !Setting.USE_BOAT_CONTROLS.asBoolean())
|
if (handle instanceof EntityEnderDragon || !Setting.USE_BOAT_CONTROLS.asBoolean())
|
||||||
return; // EnderDragon handles this separately
|
return; // EnderDragon handles this separately
|
||||||
double tX = handle.locX + handle.motX;
|
double tX = handle.locX + handle.motX;
|
||||||
|
@ -204,7 +204,7 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab
|
||||||
return enabled;
|
return enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
private double updateHorizontalSpeed(net.minecraft.server.v1_6_R3.Entity handle, double speed, float speedMod) {
|
private double updateHorizontalSpeed(net.minecraft.server.v1_7_R1.Entity handle, double speed, float speedMod) {
|
||||||
double oldSpeed = Math.sqrt(handle.motX * handle.motX + handle.motZ * handle.motZ);
|
double oldSpeed = Math.sqrt(handle.motX * handle.motX + handle.motZ * handle.motZ);
|
||||||
double horizontal = ((EntityLiving) handle.passenger).bf;
|
double horizontal = ((EntityLiving) handle.passenger).bf;
|
||||||
if (horizontal > 0.0D) {
|
if (horizontal > 0.0D) {
|
||||||
|
@ -250,7 +250,7 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(Player rider) {
|
public void run(Player rider) {
|
||||||
net.minecraft.server.v1_6_R3.Entity handle = getHandle();
|
net.minecraft.server.v1_7_R1.Entity handle = getHandle();
|
||||||
boolean onGround = handle.onGround;
|
boolean onGround = handle.onGround;
|
||||||
float speedMod = npc.getNavigator().getDefaultParameters()
|
float speedMod = npc.getNavigator().getDefaultParameters()
|
||||||
.modifiedSpeed((onGround ? GROUND_SPEED : AIR_SPEED));
|
.modifiedSpeed((onGround ? GROUND_SPEED : AIR_SPEED));
|
||||||
|
@ -301,7 +301,7 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab
|
||||||
}
|
}
|
||||||
Vector dir = rider.getEyeLocation().getDirection();
|
Vector dir = rider.getEyeLocation().getDirection();
|
||||||
dir.multiply(npc.getNavigator().getDefaultParameters().speedModifier());
|
dir.multiply(npc.getNavigator().getDefaultParameters().speedModifier());
|
||||||
net.minecraft.server.v1_6_R3.Entity handle = getHandle();
|
net.minecraft.server.v1_7_R1.Entity handle = getHandle();
|
||||||
handle.motX = dir.getX();
|
handle.motX = dir.getX();
|
||||||
handle.motY = dir.getY();
|
handle.motY = dir.getY();
|
||||||
handle.motZ = dir.getZ();
|
handle.motZ = dir.getZ();
|
||||||
|
@ -344,7 +344,7 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab
|
||||||
getHandle().motY = 0.001;
|
getHandle().motY = 0.001;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
net.minecraft.server.v1_6_R3.Entity handle = getHandle();
|
net.minecraft.server.v1_7_R1.Entity handle = getHandle();
|
||||||
this.speed = updateHorizontalSpeed(handle, this.speed, 1F);
|
this.speed = updateHorizontalSpeed(handle, this.speed, 1F);
|
||||||
boolean shouldJump = NMS.shouldJump(handle.passenger);
|
boolean shouldJump = NMS.shouldJump(handle.passenger);
|
||||||
if (shouldJump) {
|
if (shouldJump) {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package net.citizensnpcs.trait.waypoint;
|
package net.citizensnpcs.trait.waypoint;
|
||||||
|
|
||||||
import net.minecraft.server.v1_6_R3.DamageSource;
|
import net.minecraft.server.v1_7_R1.DamageSource;
|
||||||
import net.minecraft.server.v1_6_R3.EntityEnderSignal;
|
import net.minecraft.server.v1_7_R1.EntityEnderSignal;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
public class EntityEnderSignalMarker extends EntityEnderSignal {
|
public class EntityEnderSignalMarker extends EntityEnderSignal {
|
||||||
public EntityEnderSignalMarker(World world) {
|
public EntityEnderSignalMarker(World world) {
|
||||||
|
@ -19,6 +19,6 @@ public class EntityEnderSignalMarker extends EntityEnderSignal {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void l_() {
|
public void h() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,35 +12,35 @@ import java.util.WeakHashMap;
|
||||||
import net.citizensnpcs.api.npc.NPC;
|
import net.citizensnpcs.api.npc.NPC;
|
||||||
import net.citizensnpcs.api.util.Messaging;
|
import net.citizensnpcs.api.util.Messaging;
|
||||||
import net.citizensnpcs.npc.entity.EntityHumanNPC;
|
import net.citizensnpcs.npc.entity.EntityHumanNPC;
|
||||||
import net.minecraft.server.v1_6_R3.AttributeInstance;
|
import net.minecraft.server.v1_7_R1.AttributeInstance;
|
||||||
import net.minecraft.server.v1_6_R3.Block;
|
import net.minecraft.server.v1_7_R1.ControllerJump;
|
||||||
import net.minecraft.server.v1_6_R3.ControllerJump;
|
import net.minecraft.server.v1_7_R1.DamageSource;
|
||||||
import net.minecraft.server.v1_6_R3.DamageSource;
|
import net.minecraft.server.v1_7_R1.EnchantmentManager;
|
||||||
import net.minecraft.server.v1_6_R3.EnchantmentManager;
|
import net.minecraft.server.v1_7_R1.Entity;
|
||||||
import net.minecraft.server.v1_6_R3.Entity;
|
import net.minecraft.server.v1_7_R1.EntityHorse;
|
||||||
import net.minecraft.server.v1_6_R3.EntityHorse;
|
import net.minecraft.server.v1_7_R1.EntityHuman;
|
||||||
import net.minecraft.server.v1_6_R3.EntityHuman;
|
import net.minecraft.server.v1_7_R1.EntityInsentient;
|
||||||
import net.minecraft.server.v1_6_R3.EntityInsentient;
|
import net.minecraft.server.v1_7_R1.EntityLiving;
|
||||||
import net.minecraft.server.v1_6_R3.EntityLiving;
|
import net.minecraft.server.v1_7_R1.EntityPlayer;
|
||||||
import net.minecraft.server.v1_6_R3.EntityPlayer;
|
import net.minecraft.server.v1_7_R1.EntityTypes;
|
||||||
import net.minecraft.server.v1_6_R3.EntityTypes;
|
import net.minecraft.server.v1_7_R1.GenericAttributes;
|
||||||
import net.minecraft.server.v1_6_R3.GenericAttributes;
|
import net.minecraft.server.v1_7_R1.MathHelper;
|
||||||
import net.minecraft.server.v1_6_R3.MathHelper;
|
import net.minecraft.server.v1_7_R1.MobEffectList;
|
||||||
import net.minecraft.server.v1_6_R3.MobEffectList;
|
import net.minecraft.server.v1_7_R1.Navigation;
|
||||||
import net.minecraft.server.v1_6_R3.Navigation;
|
import net.minecraft.server.v1_7_R1.NetworkManager;
|
||||||
import net.minecraft.server.v1_6_R3.NetworkManager;
|
import net.minecraft.server.v1_7_R1.Packet;
|
||||||
import net.minecraft.server.v1_6_R3.Packet;
|
import net.minecraft.server.v1_7_R1.PathfinderGoalSelector;
|
||||||
import net.minecraft.server.v1_6_R3.PathfinderGoalSelector;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.util.io.netty.channel.Channel;
|
||||||
|
|
||||||
import org.apache.commons.lang.Validate;
|
import org.apache.commons.lang.Validate;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.CraftWorld;
|
import org.bukkit.craftbukkit.v1_7_R1.CraftWorld;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftLivingEntity;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftLivingEntity;
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.Horse;
|
import org.bukkit.entity.Horse;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
@ -121,13 +121,13 @@ public class NMS {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void flyingMoveLogic(EntityLiving entity, float f, float f1) {
|
public static void flyingMoveLogic(EntityLiving entity, float f, float f1) {
|
||||||
if (entity.G()) {
|
if (entity.M()) {
|
||||||
entity.a(f, f1, 0.02F);
|
entity.a(f, f1, 0.02F);
|
||||||
entity.move(entity.motX, entity.motY, entity.motZ);
|
entity.move(entity.motX, entity.motY, entity.motZ);
|
||||||
entity.motX *= 0.800000011920929D;
|
entity.motX *= 0.800000011920929D;
|
||||||
entity.motY *= 0.800000011920929D;
|
entity.motY *= 0.800000011920929D;
|
||||||
entity.motZ *= 0.800000011920929D;
|
entity.motZ *= 0.800000011920929D;
|
||||||
} else if (entity.I()) {
|
} else if (entity.P()) {
|
||||||
entity.a(f, f1, 0.02F);
|
entity.a(f, f1, 0.02F);
|
||||||
entity.move(entity.motX, entity.motY, entity.motZ);
|
entity.move(entity.motX, entity.motY, entity.motZ);
|
||||||
entity.motX *= 0.5D;
|
entity.motX *= 0.5D;
|
||||||
|
@ -137,13 +137,8 @@ public class NMS {
|
||||||
float f2 = 0.91F;
|
float f2 = 0.91F;
|
||||||
|
|
||||||
if (entity.onGround) {
|
if (entity.onGround) {
|
||||||
f2 = 0.54600006F;
|
f2 = entity.world.getType(MathHelper.floor(entity.locX), MathHelper.floor(entity.boundingBox.b) - 1,
|
||||||
int i = entity.world.getTypeId(MathHelper.floor(entity.locX),
|
MathHelper.floor(entity.locZ)).frictionFactor * 0.91F;
|
||||||
MathHelper.floor(entity.boundingBox.b) - 1, MathHelper.floor(entity.locZ));
|
|
||||||
|
|
||||||
if (i > 0) {
|
|
||||||
f2 = Block.byId[i].frictionFactor * 0.91F;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float f3 = 0.16277136F / (f2 * f2 * f2);
|
float f3 = 0.16277136F / (f2 * f2 * f2);
|
||||||
|
@ -151,13 +146,8 @@ public class NMS {
|
||||||
entity.a(f, f1, entity.onGround ? 0.1F * f3 : 0.02F);
|
entity.a(f, f1, entity.onGround ? 0.1F * f3 : 0.02F);
|
||||||
f2 = 0.91F;
|
f2 = 0.91F;
|
||||||
if (entity.onGround) {
|
if (entity.onGround) {
|
||||||
f2 = 0.54600006F;
|
f2 = entity.world.getType(MathHelper.floor(entity.locX), MathHelper.floor(entity.boundingBox.b) - 1,
|
||||||
int j = entity.world.getTypeId(MathHelper.floor(entity.locX),
|
MathHelper.floor(entity.locZ)).frictionFactor * 0.91F;
|
||||||
MathHelper.floor(entity.boundingBox.b) - 1, MathHelper.floor(entity.locZ));
|
|
||||||
|
|
||||||
if (j > 0) {
|
|
||||||
f2 = Block.byId[j].frictionFactor * 0.91F;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
entity.move(entity.motX, entity.motY, entity.motZ);
|
entity.move(entity.motX, entity.motY, entity.motZ);
|
||||||
|
@ -208,7 +198,7 @@ public class NMS {
|
||||||
return ((CraftLivingEntity) entity).getHandle();
|
return ((CraftLivingEntity) entity).getHandle();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static net.minecraft.server.v1_6_R3.Entity getHandle(org.bukkit.entity.Entity entity) {
|
public static net.minecraft.server.v1_7_R1.Entity getHandle(org.bukkit.entity.Entity entity) {
|
||||||
return ((CraftEntity) entity).getHandle();
|
return ((CraftEntity) entity).getHandle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,7 +222,7 @@ public class NMS {
|
||||||
|
|
||||||
public static boolean inWater(org.bukkit.entity.Entity entity) {
|
public static boolean inWater(org.bukkit.entity.Entity entity) {
|
||||||
Entity mcEntity = getHandle(entity);
|
Entity mcEntity = getHandle(entity);
|
||||||
return mcEntity.H() || mcEntity.J();
|
return mcEntity.M() || mcEntity.P();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isNavigationFinished(Navigation navigation) {
|
public static boolean isNavigationFinished(Navigation navigation) {
|
||||||
|
@ -245,7 +235,7 @@ public class NMS {
|
||||||
|
|
||||||
public static void look(EntityLiving handle, Entity target) {
|
public static void look(EntityLiving handle, Entity target) {
|
||||||
if (handle instanceof EntityInsentient) {
|
if (handle instanceof EntityInsentient) {
|
||||||
((EntityInsentient) handle).getControllerLook().a(target, 10.0F, ((EntityInsentient) handle).bp());
|
((EntityInsentient) handle).getControllerLook().a(target, 10.0F, ((EntityInsentient) handle).x());
|
||||||
} else if (handle instanceof EntityHumanNPC) {
|
} else if (handle instanceof EntityHumanNPC) {
|
||||||
((EntityHumanNPC) handle).setTargetLook(target, 10F, 40);
|
((EntityHumanNPC) handle).setTargetLook(target, 10F, 40);
|
||||||
}
|
}
|
||||||
|
@ -376,7 +366,7 @@ public class NMS {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setStepHeight(EntityLiving entity, float height) {
|
public static void setStepHeight(EntityLiving entity, float height) {
|
||||||
entity.Y = height;
|
entity.X = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setVerticalMovement(org.bukkit.entity.Entity bukkitEntity, double d) {
|
public static void setVerticalMovement(org.bukkit.entity.Entity bukkitEntity, double d) {
|
||||||
|
@ -386,7 +376,7 @@ public class NMS {
|
||||||
handle.bf = (float) d;
|
handle.bf = (float) d;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean shouldJump(net.minecraft.server.v1_6_R3.Entity entity) {
|
public static boolean shouldJump(net.minecraft.server.v1_7_R1.Entity entity) {
|
||||||
if (JUMP_FIELD == null || !(entity instanceof EntityLiving))
|
if (JUMP_FIELD == null || !(entity instanceof EntityLiving))
|
||||||
return false;
|
return false;
|
||||||
try {
|
try {
|
||||||
|
@ -424,8 +414,8 @@ public class NMS {
|
||||||
if (THREAD_STOPPER == null)
|
if (THREAD_STOPPER == null)
|
||||||
return;
|
return;
|
||||||
try {
|
try {
|
||||||
THREAD_STOPPER.set(manager, false);
|
Channel channel = (Channel) THREAD_STOPPER.get(manager);
|
||||||
THREAD_STOPPER_2.set(manager, true);
|
channel.close();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Messaging.logTr(Messages.ERROR_STOPPING_NETWORK_THREADS, e.getMessage());
|
Messaging.logTr(Messages.ERROR_STOPPING_NETWORK_THREADS, e.getMessage());
|
||||||
}
|
}
|
||||||
|
@ -502,7 +492,7 @@ public class NMS {
|
||||||
private static Map<Class<?>, Integer> ENTITY_CLASS_TO_INT;
|
private static Map<Class<?>, Integer> ENTITY_CLASS_TO_INT;
|
||||||
private static final Map<Class<?>, Constructor<?>> ENTITY_CONSTRUCTOR_CACHE = new WeakHashMap<Class<?>, Constructor<?>>();
|
private static final Map<Class<?>, Constructor<?>> ENTITY_CONSTRUCTOR_CACHE = new WeakHashMap<Class<?>, Constructor<?>>();
|
||||||
private static Map<Integer, Class<?>> ENTITY_INT_TO_CLASS;
|
private static Map<Integer, Class<?>> ENTITY_INT_TO_CLASS;
|
||||||
private static Field GOAL_FIELD = getField(PathfinderGoalSelector.class, "a");
|
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, "bd");
|
||||||
private static Map<Class<?>, Integer> MC_ENTITY_CLASS_TO_INT = null;
|
private static Map<Class<?>, Integer> MC_ENTITY_CLASS_TO_INT = null;
|
||||||
private static Map<Integer, Class<?>> MC_ENTITY_INT_TO_CLASS = null;
|
private static Map<Integer, Class<?>> MC_ENTITY_INT_TO_CLASS = null;
|
||||||
|
@ -510,8 +500,7 @@ public class NMS {
|
||||||
private static final Location PACKET_CACHE_LOCATION = new Location(null, 0, 0, 0);
|
private static final Location PACKET_CACHE_LOCATION = new Location(null, 0, 0, 0);
|
||||||
private static Field PATHFINDING_RANGE = getField(Navigation.class, "e");
|
private static Field PATHFINDING_RANGE = getField(Navigation.class, "e");
|
||||||
private static final Random RANDOM = Util.getFastRandom();
|
private static final Random RANDOM = Util.getFastRandom();
|
||||||
private static Field THREAD_STOPPER = getField(NetworkManager.class, "n");
|
private static Field THREAD_STOPPER = getField(NetworkManager.class, "k");
|
||||||
private static Field THREAD_STOPPER_2 = getField(NetworkManager.class, "t");
|
|
||||||
// true field above false and three synchronised lists
|
// true field above false and three synchronised lists
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
|
|
@ -2,41 +2,41 @@ package net.citizensnpcs.util;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
import net.minecraft.server.v1_6_R3.EntityPlayer;
|
import net.minecraft.server.v1_7_R1.EntityPlayer;
|
||||||
import net.minecraft.server.v1_6_R3.Packet;
|
import net.minecraft.server.v1_7_R1.Packet;
|
||||||
import net.minecraft.server.v1_6_R3.Packet17EntityLocationAction;
|
import net.minecraft.server.v1_7_R1.PacketPlayOutAnimation;
|
||||||
import net.minecraft.server.v1_6_R3.Packet18ArmAnimation;
|
import net.minecraft.server.v1_7_R1.PacketPlayOutBed;
|
||||||
import net.minecraft.server.v1_6_R3.Packet40EntityMetadata;
|
import net.minecraft.server.v1_7_R1.PacketPlayOutEntityMetadata;
|
||||||
|
|
||||||
import org.bukkit.craftbukkit.v1_6_R3.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public enum PlayerAnimation {
|
public enum PlayerAnimation {
|
||||||
ARM_SWING {
|
ARM_SWING {
|
||||||
@Override
|
@Override
|
||||||
protected void playAnimation(EntityPlayer player, int radius) {
|
protected void playAnimation(EntityPlayer player, int radius) {
|
||||||
Packet18ArmAnimation packet = new Packet18ArmAnimation(player, 1);
|
PacketPlayOutAnimation packet = new PacketPlayOutAnimation(player, 1);
|
||||||
sendPacketNearby(packet, player, radius);
|
sendPacketNearby(packet, player, radius);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
CRIT {
|
CRIT {
|
||||||
@Override
|
@Override
|
||||||
protected void playAnimation(EntityPlayer player, int radius) {
|
protected void playAnimation(EntityPlayer player, int radius) {
|
||||||
Packet18ArmAnimation packet = new Packet18ArmAnimation(player, 6);
|
PacketPlayOutAnimation packet = new PacketPlayOutAnimation(player, 6);
|
||||||
sendPacketNearby(packet, player, radius);
|
sendPacketNearby(packet, player, radius);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
HURT {
|
HURT {
|
||||||
@Override
|
@Override
|
||||||
protected void playAnimation(EntityPlayer player, int radius) {
|
protected void playAnimation(EntityPlayer player, int radius) {
|
||||||
Packet18ArmAnimation packet = new Packet18ArmAnimation(player, 2);
|
PacketPlayOutAnimation packet = new PacketPlayOutAnimation(player, 2);
|
||||||
sendPacketNearby(packet, player, radius);
|
sendPacketNearby(packet, player, radius);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
MAGIC_CRIT {
|
MAGIC_CRIT {
|
||||||
@Override
|
@Override
|
||||||
protected void playAnimation(EntityPlayer player, int radius) {
|
protected void playAnimation(EntityPlayer player, int radius) {
|
||||||
Packet18ArmAnimation packet = new Packet18ArmAnimation(player, 7);
|
PacketPlayOutAnimation packet = new PacketPlayOutAnimation(player, 7);
|
||||||
sendPacketNearby(packet, player, radius);
|
sendPacketNearby(packet, player, radius);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -49,8 +49,8 @@ public enum PlayerAnimation {
|
||||||
SLEEP {
|
SLEEP {
|
||||||
@Override
|
@Override
|
||||||
protected void playAnimation(EntityPlayer player, int radius) {
|
protected void playAnimation(EntityPlayer player, int radius) {
|
||||||
Packet17EntityLocationAction packet = new Packet17EntityLocationAction(player, 0, (int) player.locX,
|
PacketPlayOutBed packet = new PacketPlayOutBed(player, (int) player.locX, (int) player.locY,
|
||||||
(int) player.locY, (int) player.locZ);
|
(int) player.locZ);
|
||||||
sendPacketNearby(packet, player, radius);
|
sendPacketNearby(packet, player, radius);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -58,7 +58,8 @@ public enum PlayerAnimation {
|
||||||
@Override
|
@Override
|
||||||
protected void playAnimation(EntityPlayer player, int radius) {
|
protected void playAnimation(EntityPlayer player, int radius) {
|
||||||
player.getBukkitEntity().setSneaking(true);
|
player.getBukkitEntity().setSneaking(true);
|
||||||
sendPacketNearby(new Packet40EntityMetadata(player.id, player.getDataWatcher(), true), player, radius);
|
sendPacketNearby(new PacketPlayOutEntityMetadata(player.getId(), player.getDataWatcher(), true), player,
|
||||||
|
radius);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
STOP_SITTING {
|
STOP_SITTING {
|
||||||
|
@ -70,7 +71,7 @@ public enum PlayerAnimation {
|
||||||
STOP_SLEEPING {
|
STOP_SLEEPING {
|
||||||
@Override
|
@Override
|
||||||
protected void playAnimation(EntityPlayer player, int radius) {
|
protected void playAnimation(EntityPlayer player, int radius) {
|
||||||
Packet18ArmAnimation packet = new Packet18ArmAnimation(player, 3);
|
PacketPlayOutAnimation packet = new PacketPlayOutAnimation(player, 3);
|
||||||
sendPacketNearby(packet, player, radius);
|
sendPacketNearby(packet, player, radius);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -78,7 +79,8 @@ public enum PlayerAnimation {
|
||||||
@Override
|
@Override
|
||||||
protected void playAnimation(EntityPlayer player, int radius) {
|
protected void playAnimation(EntityPlayer player, int radius) {
|
||||||
player.getBukkitEntity().setSneaking(false);
|
player.getBukkitEntity().setSneaking(false);
|
||||||
sendPacketNearby(new Packet40EntityMetadata(player.id, player.getDataWatcher(), true), player, radius);
|
sendPacketNearby(new PacketPlayOutEntityMetadata(player.getId(), player.getDataWatcher(), true), player,
|
||||||
|
radius);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package net.citizensnpcs.util.nms;
|
package net.citizensnpcs.util.nms;
|
||||||
|
|
||||||
import net.citizensnpcs.npc.entity.EntityHumanNPC;
|
import net.citizensnpcs.npc.entity.EntityHumanNPC;
|
||||||
import net.minecraft.server.v1_6_R3.Entity;
|
import net.minecraft.server.v1_7_R1.Entity;
|
||||||
import net.minecraft.server.v1_6_R3.EntityLiving;
|
import net.minecraft.server.v1_7_R1.EntityLiving;
|
||||||
import net.minecraft.server.v1_6_R3.MathHelper;
|
import net.minecraft.server.v1_7_R1.MathHelper;
|
||||||
|
|
||||||
public class PlayerControllerLook {
|
public class PlayerControllerLook {
|
||||||
private final EntityHumanNPC a;
|
private final EntityHumanNPC a;
|
||||||
|
|
|
@ -2,9 +2,9 @@ package net.citizensnpcs.util.nms;
|
||||||
|
|
||||||
import net.citizensnpcs.npc.entity.EntityHumanNPC;
|
import net.citizensnpcs.npc.entity.EntityHumanNPC;
|
||||||
import net.citizensnpcs.util.NMS;
|
import net.citizensnpcs.util.NMS;
|
||||||
import net.minecraft.server.v1_6_R3.AttributeInstance;
|
import net.minecraft.server.v1_7_R1.AttributeInstance;
|
||||||
import net.minecraft.server.v1_6_R3.GenericAttributes;
|
import net.minecraft.server.v1_7_R1.GenericAttributes;
|
||||||
import net.minecraft.server.v1_6_R3.MathHelper;
|
import net.minecraft.server.v1_7_R1.MathHelper;
|
||||||
|
|
||||||
public class PlayerControllerMove {
|
public class PlayerControllerMove {
|
||||||
private final EntityHumanNPC a;
|
private final EntityHumanNPC a;
|
||||||
|
@ -61,8 +61,8 @@ public class PlayerControllerMove {
|
||||||
double d2 = this.c - i;
|
double d2 = this.c - i;
|
||||||
double d3 = d0 * d0 + d2 * d2 + d1 * d1;
|
double d3 = d0 * d0 + d2 * d2 + d1 * d1;
|
||||||
|
|
||||||
if (d3 >= 2.500000277905201E-7D) {
|
if (d3 >= 2.5D) {
|
||||||
float f = (float) (Math.atan2(d1, d0) * 180.0D / 3.1415927410125732D) - 90.0F;
|
float f = (float) (Math.atan2(d1, d0) * 180.0D / Math.PI) - 90.0F;
|
||||||
|
|
||||||
this.a.yaw = this.a(this.a.yaw, f, 30.0F);
|
this.a.yaw = this.a(this.a.yaw, f, 30.0F);
|
||||||
NMS.setHeadYaw(a, this.a.yaw);
|
NMS.setHeadYaw(a, this.a.yaw);
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
package net.citizensnpcs.util.nms;
|
package net.citizensnpcs.util.nms;
|
||||||
|
|
||||||
import net.citizensnpcs.npc.entity.EntityHumanNPC;
|
import net.citizensnpcs.npc.entity.EntityHumanNPC;
|
||||||
import net.minecraft.server.v1_6_R3.AttributeInstance;
|
import net.minecraft.server.v1_7_R1.AttributeInstance;
|
||||||
import net.minecraft.server.v1_6_R3.Block;
|
import net.minecraft.server.v1_7_R1.Block;
|
||||||
import net.minecraft.server.v1_6_R3.Entity;
|
import net.minecraft.server.v1_7_R1.Blocks;
|
||||||
import net.minecraft.server.v1_6_R3.EntityInsentient;
|
import net.minecraft.server.v1_7_R1.Entity;
|
||||||
import net.minecraft.server.v1_6_R3.GenericAttributes;
|
import net.minecraft.server.v1_7_R1.EntityInsentient;
|
||||||
import net.minecraft.server.v1_6_R3.IBlockAccess;
|
import net.minecraft.server.v1_7_R1.GenericAttributes;
|
||||||
import net.minecraft.server.v1_6_R3.Material;
|
import net.minecraft.server.v1_7_R1.Material;
|
||||||
import net.minecraft.server.v1_6_R3.MathHelper;
|
import net.minecraft.server.v1_7_R1.MathHelper;
|
||||||
import net.minecraft.server.v1_6_R3.Navigation;
|
import net.minecraft.server.v1_7_R1.Navigation;
|
||||||
import net.minecraft.server.v1_6_R3.PathEntity;
|
import net.minecraft.server.v1_7_R1.PathEntity;
|
||||||
import net.minecraft.server.v1_6_R3.PathPoint;
|
import net.minecraft.server.v1_7_R1.PathPoint;
|
||||||
import net.minecraft.server.v1_6_R3.Vec3D;
|
import net.minecraft.server.v1_7_R1.Vec3D;
|
||||||
import net.minecraft.server.v1_6_R3.World;
|
import net.minecraft.server.v1_7_R1.World;
|
||||||
|
|
||||||
public class PlayerNavigation extends Navigation {
|
public class PlayerNavigation extends Navigation {
|
||||||
private final EntityHumanNPC a;
|
private final EntityHumanNPC a;
|
||||||
|
@ -25,6 +25,7 @@ public class PlayerNavigation extends Navigation {
|
||||||
private int g;
|
private int g;
|
||||||
private int h;
|
private int h;
|
||||||
private final Vec3D i = Vec3D.a(0.0D, 0.0D, 0.0D);
|
private final Vec3D i = Vec3D.a(0.0D, 0.0D, 0.0D);
|
||||||
|
|
||||||
private boolean j = true;
|
private boolean j = true;
|
||||||
private boolean k;
|
private boolean k;
|
||||||
private boolean l;
|
private boolean l;
|
||||||
|
@ -43,192 +44,169 @@ public class PlayerNavigation extends Navigation {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void a(boolean flag) {
|
public void a(boolean paramBoolean) {
|
||||||
this.l = flag;
|
this.l = paramBoolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void a(double d0) {
|
public void a(double paramDouble) {
|
||||||
this.d = d0;
|
this.d = paramDouble;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PathEntity a(double d0, double d1, double d2) {
|
public PathEntity a(double paramDouble1, double paramDouble2, double paramDouble3) {
|
||||||
return !this.l() ? null : this.b.a(this.a, MathHelper.floor(d0), (int) d1, MathHelper.floor(d2), this.d(),
|
if (!l())
|
||||||
this.j, this.k, this.l, this.m);
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean a(double d0, double d1, double d2, double d3) {
|
public boolean a(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4) {
|
||||||
PathEntity pathentity = this.a(MathHelper.floor(d0), ((int) d1), MathHelper.floor(d2));
|
PathEntity localPathEntity = a(MathHelper.floor(paramDouble1), (int) paramDouble2,
|
||||||
|
MathHelper.floor(paramDouble3));
|
||||||
return this.a(pathentity, d3);
|
return a(localPathEntity, paramDouble4);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PathEntity a(Entity entity) {
|
public PathEntity a(Entity paramEntity) {
|
||||||
return !this.l() ? null : this.b.findPath(this.a, entity, this.d(), this.j, this.k, this.l, this.m);
|
if (!l())
|
||||||
|
return null;
|
||||||
|
return this.b.findPath(this.a, paramEntity, d(), this.j, this.k, this.l, this.m);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean a(Entity entity, double d0) {
|
public boolean a(Entity paramEntity, double paramDouble) {
|
||||||
PathEntity pathentity = this.a(entity);
|
PathEntity localPathEntity = a(paramEntity);
|
||||||
|
if (localPathEntity != null)
|
||||||
return pathentity != null ? this.a(pathentity, d0) : false;
|
return a(localPathEntity, paramDouble);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean a(int i, int j, int k, int l, int i1, int j1, Vec3D vec3d, double d0, double d1) {
|
private boolean a(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6,
|
||||||
int k1 = i - l / 2;
|
Vec3D paramVec3D, double paramDouble1, double paramDouble2) {
|
||||||
int l1 = k - j1 / 2;
|
int n = paramInt1 - paramInt4 / 2;
|
||||||
|
int i1 = paramInt3 - paramInt6 / 2;
|
||||||
|
|
||||||
if (!this.b(k1, j, l1, l, i1, j1, vec3d, d0, d1)) {
|
if (!b(n, paramInt2, i1, paramInt4, paramInt5, paramInt6, paramVec3D, paramDouble1, paramDouble2))
|
||||||
return false;
|
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.c;
|
|
||||||
double d3 = j2 + 0.5D - vec3d.e;
|
|
||||||
|
|
||||||
if (d2 * d0 + d3 * d1 >= 0.0D) {
|
for (int i2 = n; i2 < n + paramInt4; i2++) {
|
||||||
int k2 = this.b.getTypeId(i2, j - 1, j2);
|
for (int i3 = i1; i3 < i1 + paramInt6; i3++) {
|
||||||
|
double d1 = i2 + 0.5D - paramVec3D.c;
|
||||||
if (k2 <= 0) {
|
double d2 = i3 + 0.5D - paramVec3D.e;
|
||||||
return false;
|
if (d1 * paramDouble1 + d2 * paramDouble2 >= 0.0D) {
|
||||||
}
|
Block localBlock = this.b.getType(i2, paramInt2 - 1, i3);
|
||||||
|
Material localMaterial = localBlock.getMaterial();
|
||||||
Material material = Block.byId[k2].material;
|
if (localMaterial == Material.AIR)
|
||||||
|
return false;
|
||||||
if (material == Material.WATER && !this.a.H()) {
|
if ((localMaterial == Material.WATER) && (!this.a.M()))
|
||||||
return false;
|
return false;
|
||||||
}
|
if (localMaterial == Material.LAVA)
|
||||||
|
return false;
|
||||||
if (material == Material.LAVA) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean a(PathEntity pathentity, double d0) {
|
public boolean a(PathEntity paramPathEntity, double paramDouble) {
|
||||||
if (pathentity == null) {
|
if (paramPathEntity == null) {
|
||||||
this.c = null;
|
this.c = null;
|
||||||
return false;
|
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.c = vec3d.c;
|
|
||||||
this.i.d = vec3d.d;
|
|
||||||
this.i.e = vec3d.e;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
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 vec3d, Vec3D vec3d1, int i, int j, int k) {
|
private boolean a(Vec3D paramVec3D1, Vec3D paramVec3D2, int paramInt1, int paramInt2, int paramInt3) {
|
||||||
int l = MathHelper.floor(vec3d.c);
|
int n = MathHelper.floor(paramVec3D1.c);
|
||||||
int i1 = MathHelper.floor(vec3d.e);
|
int i1 = MathHelper.floor(paramVec3D1.e);
|
||||||
double d0 = vec3d1.c - vec3d.c;
|
|
||||||
double d1 = vec3d1.e - vec3d.e;
|
|
||||||
double d2 = d0 * d0 + d1 * d1;
|
|
||||||
|
|
||||||
if (d2 < 1.0E-8D) {
|
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;
|
return false;
|
||||||
} else {
|
|
||||||
double d3 = 1.0D / Math.sqrt(d2);
|
|
||||||
|
|
||||||
d0 *= d3;
|
double d4 = 1.0D / Math.sqrt(d3);
|
||||||
d1 *= d3;
|
d1 *= d4;
|
||||||
i += 2;
|
d2 *= d4;
|
||||||
k += 2;
|
|
||||||
if (!this.a(l, (int) vec3d.d, i1, i, j, k, vec3d, d0, d1)) {
|
paramInt1 += 2;
|
||||||
return false;
|
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 {
|
} else {
|
||||||
i -= 2;
|
d8 += d6;
|
||||||
k -= 2;
|
i1 += i3;
|
||||||
double d4 = 1.0D / Math.abs(d0);
|
i7 = i5 - i1;
|
||||||
double d5 = 1.0D / Math.abs(d1);
|
|
||||||
double d6 = l * 1 - vec3d.c;
|
|
||||||
double d7 = i1 * 1 - vec3d.e;
|
|
||||||
|
|
||||||
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.c);
|
|
||||||
int i2 = MathHelper.floor(vec3d1.e);
|
|
||||||
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.d, i1, i, j, k, vec3d, d0, d1));
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!a(n, (int) paramVec3D1.d, i1, paramInt1, paramInt2, paramInt3, paramVec3D1, d1, d2))
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void b(boolean flag) {
|
public void b(boolean paramBoolean) {
|
||||||
this.k = flag;
|
this.k = paramBoolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean b(int i, int j, int k, int l, int i1, int j1, Vec3D vec3d, double d0, double d1) {
|
private boolean b(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6,
|
||||||
for (int k1 = i; k1 < i + l; ++k1) {
|
Vec3D paramVec3D, double paramDouble1, double paramDouble2) {
|
||||||
for (int l1 = j; l1 < j + i1; ++l1) {
|
for (int n = paramInt1; n < paramInt1 + paramInt4; n++) {
|
||||||
for (int i2 = k; i2 < k + j1; ++i2) {
|
for (int i1 = paramInt2; i1 < paramInt2 + paramInt5; i1++)
|
||||||
double d2 = k1 + 0.5D - vec3d.c;
|
for (int i2 = paramInt3; i2 < paramInt3 + paramInt6; i2++) {
|
||||||
double d3 = i2 + 0.5D - vec3d.e;
|
double d1 = n + 0.5D - paramVec3D.c;
|
||||||
|
double d2 = i2 + 0.5D - paramVec3D.e;
|
||||||
if (d2 * d0 + d3 * d1 >= 0.0D) {
|
if (d1 * paramDouble1 + d2 * paramDouble2 >= 0.0D) {
|
||||||
int j2 = this.b.getTypeId(k1, l1, i2);
|
Block localBlock = this.b.getType(n, i1, i2);
|
||||||
|
if (!localBlock.b(this.b, n, i1, i2))
|
||||||
if (j2 > 0 && !Block.byId[j2].b((IBlockAccess) this.b, k1, l1, i2)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -238,8 +216,8 @@ public class PlayerNavigation extends Navigation {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void c(boolean flag) {
|
public void c(boolean paramBoolean) {
|
||||||
this.j = flag;
|
this.j = paramBoolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -248,8 +226,8 @@ public class PlayerNavigation extends Navigation {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void d(boolean flag) {
|
public void d(boolean paramBoolean) {
|
||||||
this.f = flag;
|
this.f = paramBoolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -258,31 +236,31 @@ public class PlayerNavigation extends Navigation {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void e(boolean flag) {
|
public void e(boolean paramBoolean) {
|
||||||
this.m = flag;
|
this.m = paramBoolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void f() {
|
public void f() {
|
||||||
++this.g;
|
this.g += 1;
|
||||||
if (!this.g()) {
|
if (g())
|
||||||
if (this.l()) {
|
return;
|
||||||
this.i();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.g()) {
|
if (l())
|
||||||
Vec3D vec3d = this.c.a(this.a);
|
i();
|
||||||
|
|
||||||
if (vec3d != null) {
|
if (g())
|
||||||
this.a.setMoveDestination(vec3d.c, vec3d.d, vec3d.e, (float) this.d);
|
return;
|
||||||
}
|
Vec3D localVec3D = this.c.a(this.a);
|
||||||
}
|
if (localVec3D == null)
|
||||||
}
|
return;
|
||||||
|
|
||||||
|
this.a.setMoveDestination(localVec3D.c, localVec3D.d, localVec3D.e, this.d);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean g() {
|
public boolean g() {
|
||||||
return this.c == null || this.c.b();
|
return (this.c == null) || (this.c.b());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -291,105 +269,93 @@ public class PlayerNavigation extends Navigation {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void i() {
|
private void i() {
|
||||||
Vec3D vec3d = this.j();
|
Vec3D localVec3D = j();
|
||||||
int i = this.c.d();
|
|
||||||
|
|
||||||
for (int j = this.c.e(); j < this.c.d(); ++j) {
|
int n = this.c.d();
|
||||||
if (this.c.a(j).b != (int) vec3d.d) {
|
for (int i1 = this.c.e(); i1 < this.c.d(); i1++) {
|
||||||
i = j;
|
if (this.c.a(i1).b != (int) localVec3D.d) {
|
||||||
|
n = i1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float f = this.a.width * this.a.width;
|
float f1 = this.a.width * this.a.width;
|
||||||
|
for (int i2 = this.c.e(); i2 < n; i2++) {
|
||||||
int k;
|
if (localVec3D.distanceSquared(this.c.a(this.a, i2)) < f1) {
|
||||||
|
this.c.c(i2 + 1);
|
||||||
for (k = this.c.e(); k < i; ++k) {
|
|
||||||
if (vec3d.distanceSquared(this.c.a(this.a, k)) < f) {
|
|
||||||
this.c.c(k + 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
k = MathHelper.f(this.a.width);
|
int i3 = (int) this.a.length + 1;
|
||||||
int l = (int) this.a.length + 1;
|
int i4 = MathHelper.f(this.a.width);
|
||||||
int i1 = k;
|
for (int i5 = n - 1; i5 >= this.c.e(); i5--) {
|
||||||
|
if (a(localVec3D, this.c.a(this.a, i5), i4, i3, i4)) {
|
||||||
for (int j1 = i - 1; j1 >= this.c.e(); --j1) {
|
this.c.c(i5);
|
||||||
if (this.a(vec3d, this.c.a(this.a, j1), k, l, i1)) {
|
|
||||||
this.c.c(j1);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.g - this.h > 100) {
|
if (this.g - this.h > 100) {
|
||||||
if (vec3d.distanceSquared(this.i) < 2.25D) {
|
if (localVec3D.distanceSquared(this.i) < 2.25D)
|
||||||
this.h();
|
h();
|
||||||
}
|
|
||||||
|
|
||||||
this.h = this.g;
|
this.h = this.g;
|
||||||
this.i.c = vec3d.c;
|
this.i.c = localVec3D.c;
|
||||||
this.i.d = vec3d.d;
|
this.i.d = localVec3D.d;
|
||||||
this.i.e = vec3d.e;
|
this.i.e = localVec3D.e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Vec3D j() {
|
private Vec3D j() {
|
||||||
return this.b.getVec3DPool().create(this.a.locX, this.k(), this.a.locZ);
|
return this.b.getVec3DPool().create(this.a.locX, k(), this.a.locZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
private int k() {
|
private int k() {
|
||||||
if (this.a.H() && this.m) {
|
if ((!this.a.M()) || (!this.m))
|
||||||
int i = (int) this.a.boundingBox.b;
|
|
||||||
int j = this.b.getTypeId(MathHelper.floor(this.a.locX), i, MathHelper.floor(this.a.locZ));
|
|
||||||
int k = 0;
|
|
||||||
|
|
||||||
do {
|
|
||||||
if (j != Block.WATER.id && j != Block.STATIONARY_WATER.id) {
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
|
|
||||||
++i;
|
|
||||||
j = this.b.getTypeId(MathHelper.floor(this.a.locX), i, MathHelper.floor(this.a.locZ));
|
|
||||||
++k;
|
|
||||||
} while (k <= 16);
|
|
||||||
|
|
||||||
return (int) this.a.boundingBox.b;
|
|
||||||
} else {
|
|
||||||
return (int) (this.a.boundingBox.b + 0.5D);
|
return (int) (this.a.boundingBox.b + 0.5D);
|
||||||
|
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean l() {
|
private boolean l() {
|
||||||
return this.a.onGround || this.m && this.m();
|
return (this.a.onGround) || ((this.m) && (m()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean m() {
|
private boolean m() {
|
||||||
return this.a.H() || this.a.J();
|
return (this.a.M()) || (this.a.P());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void n() {
|
private void n() {
|
||||||
if (!this.b
|
if (this.b.i(MathHelper.floor(this.a.locX), (int) (this.a.boundingBox.b + 0.5D), MathHelper.floor(this.a.locZ)))
|
||||||
.l(MathHelper.floor(this.a.locX), (int) (this.a.boundingBox.b + 0.5D), MathHelper.floor(this.a.locZ))) {
|
return;
|
||||||
for (int i = 0; i < this.c.d(); ++i) {
|
|
||||||
PathPoint pathpoint = this.c.a(i);
|
|
||||||
|
|
||||||
if (this.b.l(pathpoint.a, pathpoint.b, pathpoint.c)) {
|
for (int n = 0; n < this.c.d(); n++) {
|
||||||
this.c.b(i - 1);
|
PathPoint localPathPoint = this.c.a(n);
|
||||||
return;
|
if (this.b.i(localPathPoint.a, localPathPoint.b, localPathPoint.c)) {
|
||||||
}
|
this.c.b(n - 1);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRange(float pathfindingRange) {
|
public void setRange(float pathfindingRange) {
|
||||||
if (this.e != null) {
|
this.e.setValue(pathfindingRange);
|
||||||
this.e.setValue(pathfindingRange);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static EntityInsentient getDummyInsentient(EntityHumanNPC from) {
|
private static EntityInsentient getDummyInsentient(EntityHumanNPC from) {
|
||||||
return new EntityInsentient(null) {
|
return new EntityInsentient(null) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user