Add rotation to /spawn (#2372)

This commit is contained in:
jie65535
2023-09-17 10:55:25 +08:00
committed by GitHub
Unverified
parent 92bd09eeed
commit 5f5e6c38b1
11 changed files with 52 additions and 47 deletions
@@ -54,4 +54,15 @@ public class CommandHelpers {
});
return args;
}
public static float parseRelative(String input, Float current) {
if (input.contains("~")) { // Relative
if (!input.equals("~")) { // Relative with offset
current += Float.parseFloat(input.replace("~", ""));
} // Else no offset, no modification
} else { // Absolute
current = Float.parseFloat(input);
}
return current;
}
}