aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/djtheredstoner/perspectivemod/PerspectiveModCommand.java
diff options
context:
space:
mode:
authorDJtheRedstoner <52044242+DJtheRedstoner@users.noreply.github.com>2020-08-31 16:55:56 -0400
committerGitHub <noreply@github.com>2020-08-31 16:55:56 -0400
commit2dd36367ec1ea8e18a0e6bc5cafbd65ac5383bde (patch)
tree7648e103ffa817262fed18cba00360f9b53a10ac /src/main/java/me/djtheredstoner/perspectivemod/PerspectiveModCommand.java
parentf0e754871b6464a5c852f7b2b2d99b53b21f3896 (diff)
parentc5b101efe2ed6aed5338d304acce2cd13b369725 (diff)
downloadPerspectiveModv4-2dd36367ec1ea8e18a0e6bc5cafbd65ac5383bde.tar.gz
PerspectiveModv4-2dd36367ec1ea8e18a0e6bc5cafbd65ac5383bde.tar.bz2
PerspectiveModv4-2dd36367ec1ea8e18a0e6bc5cafbd65ac5383bde.zip
Merge pull request #1 from asbyth/master
detect canelex's perspective mod and die
Diffstat (limited to 'src/main/java/me/djtheredstoner/perspectivemod/PerspectiveModCommand.java')
-rw-r--r--src/main/java/me/djtheredstoner/perspectivemod/PerspectiveModCommand.java28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/main/java/me/djtheredstoner/perspectivemod/PerspectiveModCommand.java b/src/main/java/me/djtheredstoner/perspectivemod/PerspectiveModCommand.java
index c19c81c..3eae96a 100644
--- a/src/main/java/me/djtheredstoner/perspectivemod/PerspectiveModCommand.java
+++ b/src/main/java/me/djtheredstoner/perspectivemod/PerspectiveModCommand.java
@@ -5,7 +5,7 @@ import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.util.ChatComponentText;
-import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
public class PerspectiveModCommand extends CommandBase {
@@ -19,39 +19,37 @@ public class PerspectiveModCommand extends CommandBase {
@Override
public List<String> getCommandAliases() {
- List<String> aliases = new ArrayList<>();
- aliases.add("pmod");
- return aliases;
+ return Collections.singletonList("pmod");
}
@Override
public String getCommandUsage(ICommandSender sender) {
- return "§6Perspective Mod Help\n" +
- "§b/pmod <enable|disable> §7- Enables or disables the mod.\n" +
- "§b/pmod mode <hold|toggle> §7- Changes the mode.\n" +
- "§7Edit the keybind in the minecraft controls menu.";
+ return "§6Perspective Mod Help\n" +
+ "§b/pmod <enable|disable> §7- Enables or disables the mod.\n" +
+ "§b/pmod mode <hold|toggle> §7- Changes the mode.\n" +
+ "§7Edit the keybind in the minecraft controls menu.";
}
@Override
public void processCommand(ICommandSender sender, String[] args) throws CommandException {
- if(args.length > 0 && args.length < 3) {
+ if (args.length > 0 && args.length < 3) {
String arg = args[0];
- if(arg.equalsIgnoreCase("enable")) {
+ if (arg.equalsIgnoreCase("enable")) {
PerspectiveMod.config.modEnabled = true;
sendMessage(sender, "§bMod §aEnabled§b.");
- } else if(arg.equalsIgnoreCase("disable")) {
+ } else if (arg.equalsIgnoreCase("disable")) {
PerspectiveMod.config.modEnabled = false;
sendMessage(sender, "§bMod §cDisabled§b.");
- } else if(arg.equalsIgnoreCase("mode")) {
- if(args.length == 2) {
+ } else if (arg.equalsIgnoreCase("mode")) {
+ if (args.length == 2) {
String mode = args[1];
- if(mode.equalsIgnoreCase("hold")) {
+ if (mode.equalsIgnoreCase("hold")) {
PerspectiveMod.config.holdMode = true;
sendMessage(sender, "§bMode set to hold.");
- } else if(mode.equalsIgnoreCase("toggle")) {
+ } else if (mode.equalsIgnoreCase("toggle")) {
PerspectiveMod.config.holdMode = false;
sendMessage(sender, "§bMode set to toggle.");