From 79dcd259dc38e49d514ecfe78aed31f5dd3a77f8 Mon Sep 17 00:00:00 2001 From: Tobias Ottenweller Date: Sun, 19 May 2013 12:01:18 +0200 Subject: [PATCH] Always use block locations when creating SimpleLocations to prevent offsets when comparing player and block locations. --- src/de/craftinc/gates/util/SimpleLocation.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/de/craftinc/gates/util/SimpleLocation.java b/src/de/craftinc/gates/util/SimpleLocation.java index 3a99cf5..d80f61e 100644 --- a/src/de/craftinc/gates/util/SimpleLocation.java +++ b/src/de/craftinc/gates/util/SimpleLocation.java @@ -13,9 +13,12 @@ public class SimpleLocation public SimpleLocation(Location l) { this.world = l.getWorld().getName(); - this.x = (int)l.getX(); - this.y = (int)l.getY(); - this.z = (int)l.getZ(); + + // Using Block coordinates makes it possible to compare block locations with player locations. + // There might be an offset of 1 otherwise. + this.x = l.getBlockX(); + this.y = l.getBlockY(); + this.z = l.getBlockZ(); }