mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2026-05-16 16:32:40 +08:00
Update position parameters to support rotation-based offsets (#2374)
This commit is contained in:
committed by
GitHub
Unverified
parent
047feaf4aa
commit
ff6a51db30
@@ -54,8 +54,8 @@ public final class SpawnCommand implements CommandHandler {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
Position pos = targetPlayer.getPosition();
|
||||
Position rot = targetPlayer.getRotation();
|
||||
Position pos = new Position(targetPlayer.getPosition());
|
||||
Position rot = new Position(targetPlayer.getRotation());
|
||||
|
||||
switch (args.size()) {
|
||||
case 7:
|
||||
@@ -69,9 +69,7 @@ public final class SpawnCommand implements CommandHandler {
|
||||
} // Fallthrough
|
||||
case 4:
|
||||
try {
|
||||
pos.setX(CommandHelpers.parseRelative(args.get(1), pos.getX()));
|
||||
pos.setY(CommandHelpers.parseRelative(args.get(2), pos.getY()));
|
||||
pos.setZ(CommandHelpers.parseRelative(args.get(3), pos.getZ()));
|
||||
pos = CommandHelpers.parsePosition(args.get(1), args.get(2), args.get(3), pos, rot);
|
||||
} catch (NumberFormatException ignored) {
|
||||
CommandHandler.sendMessage(
|
||||
sender, translate(sender, "commands.execution.argument_error"));
|
||||
|
||||
Reference in New Issue
Block a user