From 7bac86ed41e9a046ab155547656acca2d67795d0 Mon Sep 17 00:00:00 2001 From: Melledy <52122272+Melledy@users.noreply.github.com> Date: Mon, 18 Apr 2022 09:59:21 -0700 Subject: [PATCH] Add !changescene command --- .../emu/grasscutter/commands/PlayerCommands.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/java/emu/grasscutter/commands/PlayerCommands.java b/src/main/java/emu/grasscutter/commands/PlayerCommands.java index 0bd700356..31f820136 100644 --- a/src/main/java/emu/grasscutter/commands/PlayerCommands.java +++ b/src/main/java/emu/grasscutter/commands/PlayerCommands.java @@ -325,4 +325,20 @@ public class PlayerCommands { player.getInventory().removeItems(toRemove); } } + + @Command(aliases = {"scene"}, helpText = "/Changescene [Scene id]") + public static class ChangeScene extends PlayerCommand { + @Override + public void execute(GenshinPlayer player, String raw) { + int sceneId = 0; + + try { + sceneId = Integer.parseInt(raw); + } catch (Exception e) { + return; + } + + player.getWorld().transferPlayerToScene(player, sceneId, player.getPos()); + } + } }