mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-22 17:51:53 +00:00
Format code [skip actions]
This commit is contained in:
parent
43db7eba8f
commit
7f5059cb8f
@ -1,7 +1,6 @@
|
|||||||
package emu.grasscutter.command;
|
package emu.grasscutter.command;
|
||||||
|
|
||||||
import emu.grasscutter.game.world.Position;
|
import emu.grasscutter.game.world.Position;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.BiConsumer;
|
import java.util.function.BiConsumer;
|
||||||
import java.util.regex.*;
|
import java.util.regex.*;
|
||||||
@ -68,7 +67,8 @@ public class CommandHelpers {
|
|||||||
return current;
|
return current;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Position parsePosition(String inputX, String inputY, String inputZ, Position curPos, Position curRot) {
|
public static Position parsePosition(
|
||||||
|
String inputX, String inputY, String inputZ, Position curPos, Position curRot) {
|
||||||
Position offset = new Position();
|
Position offset = new Position();
|
||||||
Position target = new Position(curPos);
|
Position target = new Position(curPos);
|
||||||
if (inputX.contains("~")) { // Relative
|
if (inputX.contains("~")) { // Relative
|
||||||
@ -121,8 +121,12 @@ public class CommandHelpers {
|
|||||||
|
|
||||||
// Calculate offset based on current position and rotation
|
// Calculate offset based on current position and rotation
|
||||||
return new Position(
|
return new Position(
|
||||||
pos.getX() + offset.getZ() * (float)Math.sin(angleZ) + offset.getX() * (float)Math.sin(angleX),
|
pos.getX()
|
||||||
pos.getY() + offset.getY(),
|
+ offset.getZ() * (float) Math.sin(angleZ)
|
||||||
pos.getZ() + offset.getZ() * (float)Math.cos(angleZ) + offset.getX() * (float)Math.cos(angleX));
|
+ offset.getX() * (float) Math.sin(angleX),
|
||||||
|
pos.getY() + offset.getY(),
|
||||||
|
pos.getZ()
|
||||||
|
+ offset.getZ() * (float) Math.cos(angleZ)
|
||||||
|
+ offset.getX() * (float) Math.cos(angleX));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,8 +6,6 @@ import emu.grasscutter.command.*;
|
|||||||
import emu.grasscutter.game.player.Player;
|
import emu.grasscutter.game.player.Player;
|
||||||
import emu.grasscutter.game.world.Position;
|
import emu.grasscutter.game.world.Position;
|
||||||
import emu.grasscutter.server.event.player.PlayerTeleportEvent.TeleportType;
|
import emu.grasscutter.server.event.player.PlayerTeleportEvent.TeleportType;
|
||||||
import emu.grasscutter.server.packet.send.PacketSceneEntityAppearNotify;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Command(
|
@Command(
|
||||||
@ -54,11 +52,15 @@ public final class TeleportCommand implements CommandHandler {
|
|||||||
CommandHandler.sendMessage(sender, translate(sender, "commands.teleport.exists_error"));
|
CommandHandler.sendMessage(sender, translate(sender, "commands.teleport.exists_error"));
|
||||||
} else {
|
} else {
|
||||||
CommandHandler.sendMessage(
|
CommandHandler.sendMessage(
|
||||||
sender,
|
|
||||||
translate(
|
|
||||||
sender,
|
sender,
|
||||||
"commands.teleport.success",
|
translate(
|
||||||
targetPlayer.getNickname(), pos.getX(), pos.getY(), pos.getZ(), sceneId));
|
sender,
|
||||||
|
"commands.teleport.success",
|
||||||
|
targetPlayer.getNickname(),
|
||||||
|
pos.getX(),
|
||||||
|
pos.getY(),
|
||||||
|
pos.getZ(),
|
||||||
|
sceneId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user