From 674bb602876c11c0bdfdbd4a16fe4171b5ff7e15 Mon Sep 17 00:00:00 2001 From: mcmonkey Date: Tue, 9 Dec 2014 14:46:12 -0800 Subject: [PATCH 1/2] Fix teleport bugging Teleporting forcibly rounds locations because @fullwall edited the roundLocation function to return the original, now modified location, rather than clone it as is necessary to avoid trouble. This restores the original roundLocation which will avoid that error. --- src/main/java/net/citizensnpcs/EventListen.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/citizensnpcs/EventListen.java b/src/main/java/net/citizensnpcs/EventListen.java index 0a1681024..0ab64fec6 100644 --- a/src/main/java/net/citizensnpcs/EventListen.java +++ b/src/main/java/net/citizensnpcs/EventListen.java @@ -408,10 +408,8 @@ public class EventListen implements Listener { } private Location roundLocation(Location input) { - input.setX(input.getBlockX()); - input.setY(input.getBlockY()); - input.setZ(input.getBlockZ()); - return input; + return new Location(input.getWorld(), Math.floor(input.getX()), + Math.floor(input.getY()), Math.floor(input.getZ())); } private boolean spawn(NPC npc) { From 2ecddf6f87d8192a6d2104de1c213ff1fdc3426f Mon Sep 17 00:00:00 2001 From: mcmonkey4eva Date: Thu, 11 Dec 2014 15:56:10 -0800 Subject: [PATCH 2/2] Improve NPC pseudo-respawning In initial testing, longer periods were better. However, that was before a lot of recoding... shorter periods are now superior and keeping significantly more NPCs visible (When dealing with batches so large that the system fails to load them all) --- src/main/java/net/citizensnpcs/npc/entity/HumanController.java | 2 +- src/main/java/net/citizensnpcs/util/NMS.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/citizensnpcs/npc/entity/HumanController.java b/src/main/java/net/citizensnpcs/npc/entity/HumanController.java index b04e4c48a..4674813ef 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/HumanController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/HumanController.java @@ -93,7 +93,7 @@ public class HumanController extends AbstractEntityController { NMS.sendPlayerlistPacket(false, null, npc); } } - }, 60); + }, 2); return handle.getBukkitEntity(); } diff --git a/src/main/java/net/citizensnpcs/util/NMS.java b/src/main/java/net/citizensnpcs/util/NMS.java index a2fff250d..1ab25d698 100644 --- a/src/main/java/net/citizensnpcs/util/NMS.java +++ b/src/main/java/net/citizensnpcs/util/NMS.java @@ -512,7 +512,7 @@ public class NMS { sendPlayerlistPacket(false, player, npc); } } - }, 61); + }, 2); } public static org.bukkit.entity.Entity spawnCustomEntity(org.bukkit.World world, Location at,