From 674bb602876c11c0bdfdbd4a16fe4171b5ff7e15 Mon Sep 17 00:00:00 2001 From: mcmonkey Date: Tue, 9 Dec 2014 14:46:12 -0800 Subject: [PATCH] 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) {