Skip to content

Commit

Permalink
Fix teleport bugging
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mcmonkey4eva committed Dec 9, 2014
1 parent 8ec41f1 commit 544f443
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/main/java/net/citizensnpcs/EventListen.java
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,8 @@ private void respawnAllFromCoord(ChunkCoord coord) {
}

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) {
Expand Down

0 comments on commit 544f443

Please sign in to comment.