diff options
Diffstat (limited to 'src/main/java/me/Danker/commands/DisplayCommand.java')
-rw-r--r-- | src/main/java/me/Danker/commands/DisplayCommand.java | 40 |
1 files changed, 33 insertions, 7 deletions
diff --git a/src/main/java/me/Danker/commands/DisplayCommand.java b/src/main/java/me/Danker/commands/DisplayCommand.java index 2f7690d..b96ab2b 100644 --- a/src/main/java/me/Danker/commands/DisplayCommand.java +++ b/src/main/java/me/Danker/commands/DisplayCommand.java @@ -13,6 +13,7 @@ import net.minecraft.util.EnumChatFormatting; public class DisplayCommand extends CommandBase { public static String display; + public static boolean auto; @Override public String getCommandName() { @@ -21,7 +22,7 @@ public class DisplayCommand extends CommandBase { @Override public String getCommandUsage(ICommandSender arg0) { - return getCommandName() + " <zombie/spider/wolf/fishing/catacombs/off> [winter/session/f(1-4)]"; + return "/" + getCommandName() + " <zombie/spider/wolf/fishing/catacombs/auto/off> [winter/festival/session/f(1-6)]"; } @Override @@ -32,11 +33,11 @@ public class DisplayCommand extends CommandBase { @Override public List<String> addTabCompletionOptions(ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { - return getListOfStringsMatchingLastWord(args, "wolf", "spider", "zombie", "fishing", "catacombs", "off"); + return getListOfStringsMatchingLastWord(args, "wolf", "spider", "zombie", "fishing", "catacombs", "auto", "off"); } else if (args.length == 2 && args[0].equalsIgnoreCase("fishing")) { - return getListOfStringsMatchingLastWord(args, "winter", "session"); + return getListOfStringsMatchingLastWord(args, "winter", "festival", "session"); } else if (args.length == 2 && args[0].equalsIgnoreCase("catacombs")) { - return getListOfStringsMatchingLastWord(args, "f1", "floor1", "f2", "floor2", "f3", "floor3", "f4", "floor4"); + return getListOfStringsMatchingLastWord(args, "f1", "floor1", "f2", "floor2", "f3", "floor3", "f4", "floor4", "f5", "floor5", "f6", "floor6"); } else if (args.length > 1 || (args.length == 3 && args[0].equalsIgnoreCase("fishing") && args[1].equalsIgnoreCase("winter"))) { return getListOfStringsMatchingLastWord(args, "session"); } @@ -48,7 +49,7 @@ public class DisplayCommand extends CommandBase { final EntityPlayer player = (EntityPlayer) arg0; if (arg1.length == 0) { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: <zombie/spider/wolf/fishing/catacombs/off> [winter/session/f(1-4)]")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: " + getCommandUsage(arg0))); return; } @@ -82,6 +83,12 @@ public class DisplayCommand extends CommandBase { } else { display = "fishing_winter"; } + } else if (arg1.length > 1 && arg1[1].equalsIgnoreCase("festival")) { + if (showSession) { + display = "fishing_festival_session"; + } else { + display = "fishing_festival"; + } } else { if (showSession) { display = "fishing_session"; @@ -118,17 +125,36 @@ public class DisplayCommand extends CommandBase { } else { display = "catacombs_floor_four"; } + } else if (arg1[1].equalsIgnoreCase("f5") || arg1[1].equalsIgnoreCase("floor5")) { + if (showSession) { + display = "catacombs_floor_five_session"; + } else { + display = "catacombs_floor_five"; + } + } else if (arg1[1].equalsIgnoreCase("f6") || arg1[1].equalsIgnoreCase("floor6")) { + if (showSession) { + display = "catacombs_floor_six_session"; + } else { + display = "catacombs_floor_six"; + } } else { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /display catacombs <f1/f2/f3/f4>")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: /display catacombs <f1/f2/f3/f4/f5/f6>")); return; } + } else if (arg1[0].equalsIgnoreCase("auto")) { + auto = true; + player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Display set to " + EnumChatFormatting.DARK_GREEN + "auto" + EnumChatFormatting.GREEN + ".")); + cf.writeBooleanConfig("misc", "autoDisplay", true); + return; } else if (arg1[0].equalsIgnoreCase("off")) { display = "off"; } else { - player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: <zombie/spider/wolf/fishing/catacombs/off> [winter/session/f(1-4)]")); + player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Usage: " + getCommandUsage(arg0))); return; } + auto = false; player.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Display set to " + EnumChatFormatting.DARK_GREEN + display + EnumChatFormatting.GREEN + ".")); + cf.writeBooleanConfig("misc", "autoDisplay", false); cf.writeStringConfig("misc", "display", display); } |