добавлен тест для Location
This commit is contained in:
@@ -50,15 +50,15 @@ public class Location implements Cloneable {
|
||||
}
|
||||
|
||||
public int getBlockX() {
|
||||
return (int) x;
|
||||
return Double.valueOf(Math.floor(x)).intValue();
|
||||
}
|
||||
|
||||
public int getBlockY() {
|
||||
return (int) y;
|
||||
return Double.valueOf(Math.floor(y)).intValue();
|
||||
}
|
||||
|
||||
public int getBlockZ() {
|
||||
return (int) z;
|
||||
return Double.valueOf(Math.floor(z)).intValue();
|
||||
}
|
||||
|
||||
public Chunk getChunk() {
|
||||
@@ -66,7 +66,7 @@ public class Location implements Cloneable {
|
||||
if (world == null) {
|
||||
return null;
|
||||
} else {
|
||||
return world.getChunk((int)(x / 16), (int)(z / 16));
|
||||
return world.getChunk(getBlockX() >> 4, getBlockZ() >> 4);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ public class Location implements Cloneable {
|
||||
if (chunk == null) {
|
||||
return null;
|
||||
} else {
|
||||
return chunk.getChunkSection((int)(y / 16));
|
||||
return chunk.getChunkSection(getBlockY() >> 4);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user