This commit is contained in:
Jesse Boyd
2019-07-30 07:39:18 +10:00
parent 02d5f3e8d5
commit 7967ef4db4
25 changed files with 74 additions and 90 deletions

View File

@ -54,6 +54,7 @@ public class BlockVector2 {
}
public static BlockVector2 at(int x, int z) {
/* unnecessary
switch (x) {
case 0:
if (z == 0) {
@ -66,11 +67,14 @@ public class BlockVector2 {
}
break;
}
*/
return new BlockVector2(x, z);
}
protected int x, z;
protected BlockVector2(){}
/**
* Construct an instance.
*

View File

@ -48,6 +48,7 @@ public abstract class BlockVector3 {
}
public static BlockVector3 at(int x, int y, int z) {
/* unnecessary
// switch for efficiency on typical cases
// in MC y is rarely 0/1 on selections
switch (y) {
@ -62,6 +63,7 @@ public abstract class BlockVector3 {
}
break;
}
*/
return new BlockVector3Imp(x, y, z);
}

View File

@ -33,6 +33,7 @@ public class Vector2 {
public static final Vector2 ONE = new Vector2(1, 1);
public static Vector2 at(double x, double z) {
/* Unnecessary
int xTrunc = (int) x;
switch (xTrunc) {
case 0:
@ -46,6 +47,7 @@ public class Vector2 {
}
break;
}
*/
return new Vector2(x, z);
}

View File

@ -39,6 +39,7 @@ public abstract class Vector3 {
public static final Vector3 ONE = Vector3.at(1, 1, 1);
public static Vector3 at(double x, double y, double z) {
/* Unnecessary
// switch for efficiency on typical cases
// in MC y is rarely 0/1 on selections
int yTrunc = (int) y;
@ -54,6 +55,7 @@ public abstract class Vector3 {
}
break;
}
*/
return new Vector3Impl(x, y, z);
}