mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2026-05-18 17:09:50 +08:00
Add rotation to /spawn (#2372)
This commit is contained in:
committed by
GitHub
Unverified
parent
92bd09eeed
commit
5f5e6c38b1
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user