From f022139292ce0b0d996cd2b2794eedd406d2e361 Mon Sep 17 00:00:00 2001 From: Harry Zhou Date: Mon, 27 Jun 2022 23:20:30 -0500 Subject: [PATCH] Added $useVanillaCommands and $useEssentialsCommands --- .../songplayer/CommandProcessor.java | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/src/main/java/com/github/hhhzzzsss/songplayer/CommandProcessor.java b/src/main/java/com/github/hhhzzzsss/songplayer/CommandProcessor.java index ed4de80..afac1f2 100644 --- a/src/main/java/com/github/hhhzzzsss/songplayer/CommandProcessor.java +++ b/src/main/java/com/github/hhhzzzsss/songplayer/CommandProcessor.java @@ -23,6 +23,8 @@ public class CommandProcessor { commands.add(new songsCommand()); commands.add(new setCreativeCommandCommand()); commands.add(new setSurvivalCommandCommand()); + commands.add(new useEssentialsCommandsCommand()); + commands.add(new useVanillaCommandsCommand()); commands.add(new toggleFakePlayerCommand()); } @@ -329,6 +331,52 @@ public class CommandProcessor { } } } + + private static class useEssentialsCommandsCommand extends Command { + public String getName() { + return "useEssentialsCommands"; + } + public String getSyntax() { + return "$useEssentialsCommands"; + } + public String getDescription() { + return "Switches to using essentials gamemode commands"; + } + public boolean processCommand(String args) { + if (args.length() == 0) { + SongPlayer.creativeCommand = "gmc"; + SongPlayer.survivalCommand = "gms"; + SongPlayer.addChatMessage("§6Now using essentials gamemode commands"); + return true; + } + else { + return false; + } + } + } + + private static class useVanillaCommandsCommand extends Command { + public String getName() { + return "useVanillaCommands"; + } + public String getSyntax() { + return "$useVanillaCommands"; + } + public String getDescription() { + return "Switches to using vanilla gamemode commands"; + } + public boolean processCommand(String args) { + if (args.length() == 0) { + SongPlayer.creativeCommand = "gamemode creative"; + SongPlayer.survivalCommand = "gamemode survival"; + SongPlayer.addChatMessage("§6Now using vanilla gamemode commands"); + return true; + } + else { + return false; + } + } + } private static class toggleFakePlayerCommand extends Command { public String getName() {