mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-25 14:04:08 +00:00
Attempt to fix the teleport
command.
This commit is contained in:
parent
818bfb8c5b
commit
41ec2316e4
@ -55,10 +55,15 @@ public final class TeleportCommand implements CommandHandler {
|
||||
|
||||
Position target_pos = new Position(x, y, z);
|
||||
PlayerTeleportEvent event = new PlayerTeleportEvent(targetPlayer, PlayerTeleportEvent.TeleportType.COMMAND,
|
||||
targetPlayer.getPos(), target_pos);
|
||||
targetPlayer.getPosition(), target_pos);
|
||||
event.call();
|
||||
|
||||
boolean result = !event.isCanceled() || targetPlayer.getWorld().transferPlayerToScene(targetPlayer, sceneId, event.getDestination());
|
||||
// Return if event was cancelled.
|
||||
if(event.isCanceled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean result = targetPlayer.getWorld().transferPlayerToScene(targetPlayer, sceneId, event.getDestination());
|
||||
if (!result) {
|
||||
CommandHandler.sendMessage(sender, translate(sender, "commands.teleport.exists_error"));
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user