mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-15 23:26:21 +01:00
remove undefined type
This commit is contained in:
parent
d6221ab212
commit
0793ccefc8
@ -46,7 +46,7 @@ abstract class ArgumentRelativeVec extends Argument<RelativeVec> {
|
||||
|
||||
double[] coordinates = new double[split.length];
|
||||
boolean[] isRelative = new boolean[split.length];
|
||||
var type = UNDEFINED;
|
||||
RelativeVec.CoordinateType type = null;
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
final String element = split[i];
|
||||
try {
|
||||
@ -54,7 +54,7 @@ abstract class ArgumentRelativeVec extends Argument<RelativeVec> {
|
||||
if (MODIFIER_CHARS.contains(modifierChar)) {
|
||||
isRelative[i] = true;
|
||||
|
||||
if (type == UNDEFINED) {
|
||||
if (type == null) {
|
||||
type = modifierChar == LOCAL_CHAR ? LOCAL : RELATIVE;
|
||||
} else if (type != (modifierChar == LOCAL_CHAR ? LOCAL : RELATIVE)) {
|
||||
throw new ArgumentSyntaxException("Cannot mix world & local coordinates (everything must either use ^ or not)", input, MIXED_TYPE_ERROR);
|
||||
@ -65,7 +65,7 @@ abstract class ArgumentRelativeVec extends Argument<RelativeVec> {
|
||||
coordinates[i] = getRelativeNumberParser().apply(potentialNumber).doubleValue();
|
||||
}
|
||||
} else {
|
||||
if (type == UNDEFINED) {
|
||||
if (type == null) {
|
||||
type = ABSOLUTE;
|
||||
} else if (type == LOCAL) {
|
||||
throw new ArgumentSyntaxException("Cannot mix world & local coordinates (everything must either use ^ or not)", input, MIXED_TYPE_ERROR);
|
||||
|
@ -128,8 +128,7 @@ public final class RelativeVec {
|
||||
double double18 = dna11.z() * local.z() + dna12.z() * local.y() + dna13.z() * local.x();
|
||||
return new Vec(double14 + origin.x(),double16 + origin.y(),double18 + origin.z());
|
||||
}),
|
||||
ABSOLUTE(((vec, origin, relativeX1, relativeY1, relativeZ1) -> vec)),
|
||||
UNDEFINED((vec, origin, relativeX, relativeY, relativeZ) -> Vec.ZERO);
|
||||
ABSOLUTE(((vec, origin, relativeX1, relativeY1, relativeZ1) -> vec));
|
||||
|
||||
private final CoordinateConverter converter;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user