Cleanup SRC

This commit is contained in:
Daniel Mills
2021-07-14 02:34:13 -04:00
parent f29015426f
commit 6ca6fc6989
605 changed files with 53283 additions and 64305 deletions

View File

@@ -5,79 +5,70 @@ import lombok.Data;
import java.util.Objects;
@Data
public class BlockPosition
{
private int x;
private int y;
private int z;
public class BlockPosition {
private int x;
private int y;
private int z;
//Magic numbers
private static final int m1 = 1 + MathHelper.f(MathHelper.c(30000000));
private static final int m2 = 64 - (m1 * 2);
private static final long m3 = m1 + m2;
private static final long m4 = (1L << m1) - 1L;
private static final long m5 = (1L << m2) - 1L;
private static final long m6 = (1L << m1) - 1L;
//Magic numbers
private static final int m1 = 1 + MathHelper.f(MathHelper.c(30000000));
private static final int m2 = 64 - (m1 * 2);
private static final long m3 = m1 + m2;
private static final long m4 = (1L << m1) - 1L;
private static final long m5 = (1L << m2) - 1L;
private static final long m6 = (1L << m1) - 1L;
public BlockPosition(int x, int y, int z)
{
this.x = x;
this.y = y;
this.z = z;
}
public BlockPosition(int x, int y, int z) {
this.x = x;
this.y = y;
this.z = z;
}
@Override
public int hashCode() {
return Objects.hash(x, y, z);
}
@Override
public int hashCode() {
return Objects.hash(x, y, z);
}
public boolean equals(Object o)
{
if(o == null)
{
return false;
}
public boolean equals(Object o) {
if (o == null) {
return false;
}
if(o instanceof BlockPosition)
{
BlockPosition ot = (BlockPosition) o;
if (o instanceof BlockPosition) {
BlockPosition ot = (BlockPosition) o;
return ot.x == x && ot.y == y && ot.z == z;
}
return ot.x == x && ot.y == y && ot.z == z;
}
return false;
}
return false;
}
public int getChunkX()
{
return x >> 4;
}
public int getChunkX() {
return x >> 4;
}
public int getChunkZ()
{
return z >> 4;
}
public int getChunkZ() {
return z >> 4;
}
public boolean is(int x, int z)
{
return this.x == x && this.z == z;
}
public boolean is(int x, int z) {
return this.x == x && this.z == z;
}
public boolean is(int x, int y, int z)
{
return this.x == x && this.y == y && this.z == z;
}
public boolean is(int x, int y, int z) {
return this.x == x && this.y == y && this.z == z;
}
public long asLong() {
return toLong(getX(), getY(), getZ());
}
public long asLong() {
return toLong(getX(), getY(), getZ());
}
public static long toLong(int x, int y, int z) {
long var3 = 0L;
var3 |= (x & m4) << m3;
var3 |= (y & m5) << 0L;
var3 |= (z & m6) << m2;
return var3;
}
public static long toLong(int x, int y, int z) {
long var3 = 0L;
var3 |= (x & m4) << m3;
var3 |= (y & m5) << 0L;
var3 |= (z & m6) << m2;
return var3;
}
}