diff --git a/common/src/main/java/io/github/flemmli97/flan/commands/CommandClaim.java b/common/src/main/java/io/github/flemmli97/flan/commands/CommandClaim.java index 5bd0103..a74a8be 100644 --- a/common/src/main/java/io/github/flemmli97/flan/commands/CommandClaim.java +++ b/common/src/main/java/io/github/flemmli97/flan/commands/CommandClaim.java @@ -126,6 +126,7 @@ public class CommandClaim { builder.then(CommandManager.literal("help").executes(ctx -> CommandHelp.helpMessage(ctx, 0, builder.getArguments())) .then(CommandManager.argument("page", IntegerArgumentType.integer()).executes(ctx -> CommandHelp.helpMessage(ctx, builder.getArguments()))) .then(CommandManager.literal("cmd").then(CommandManager.argument("command", StringArgumentType.word()).suggests((ctx, sb) -> CommandSource.suggestMatching(CommandHelp.registeredCommands(ctx, builder.getArguments()), sb)).executes(CommandHelp::helpCmd)))); + builder.then(CommandManager.literal("?").executes(ctx -> CommandHelp.helpCmd(ctx, "help"))); dispatcher.register(builder); } diff --git a/common/src/main/java/io/github/flemmli97/flan/commands/CommandHelp.java b/common/src/main/java/io/github/flemmli97/flan/commands/CommandHelp.java index 136b494..92cd3f8 100644 --- a/common/src/main/java/io/github/flemmli97/flan/commands/CommandHelp.java +++ b/common/src/main/java/io/github/flemmli97/flan/commands/CommandHelp.java @@ -26,6 +26,7 @@ public class CommandHelp { public static int helpMessage(CommandContext context, int page, Collection> nodes) { List subCommands = registeredCommands(context, nodes); + subCommands.remove("?"); int max = subCommands.size() / 8; if (page > max) page = max; @@ -52,6 +53,10 @@ public class CommandHelp { public static int helpCmd(CommandContext context) { String command = StringArgumentType.getString(context, "command"); + return helpCmd(context, command); + } + + public static int helpCmd(CommandContext context, String command) { String[] cmdHelp = ConfigHandler.lang.cmdLang.getCommandHelp(command); context.getSource().sendFeedback(PermHelper.simpleColoredText(ConfigHandler.lang.helpCmdHeader, Formatting.DARK_GREEN), false); for (int i = 0; i < cmdHelp.length; i++) { @@ -62,6 +67,12 @@ public class CommandHelp { context.getSource().sendFeedback(PermHelper.simpleColoredText(cmdHelp[i], Formatting.GOLD), false); } } + if (command.equals("help")) { + context.getSource().sendFeedback(PermHelper.simpleColoredText(ConfigHandler.lang.wiki, Formatting.GOLD), false); + MutableText wiki = PermHelper.simpleColoredText("https://github.com/Flemmli97/Flan/wiki", Formatting.GREEN); + wiki.setStyle(wiki.getStyle().withClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://github.com/Flemmli97/Flan/wiki"))); + context.getSource().sendFeedback(wiki, false); + } return Command.SINGLE_SUCCESS; } diff --git a/common/src/main/java/io/github/flemmli97/flan/config/Config.java b/common/src/main/java/io/github/flemmli97/flan/config/Config.java index d021a5d..7e3cf1c 100644 --- a/common/src/main/java/io/github/flemmli97/flan/config/Config.java +++ b/common/src/main/java/io/github/flemmli97/flan/config/Config.java @@ -36,7 +36,8 @@ public class Config { public boolean lenientBlockEntityCheck; public List ignoredBlocks = new ArrayList<>(); public List blockEntityTagIgnore = Lists.newArrayList( - "IsDeathChest" //vanilla death chest + "IsDeathChest", //vanilla death chest + "gunpowder.owner" //gunpowder ); public List entityTagIgnore = Lists.newArrayList( "graves.marker" //vanilla tweaks diff --git a/common/src/main/java/io/github/flemmli97/flan/config/LangConfig.java b/common/src/main/java/io/github/flemmli97/flan/config/LangConfig.java index d77ee28..296d504 100644 --- a/common/src/main/java/io/github/flemmli97/flan/config/LangConfig.java +++ b/common/src/main/java/io/github/flemmli97/flan/config/LangConfig.java @@ -140,6 +140,8 @@ public class LangConfig { public String teleportHome = "Teleporting to claim home. Don't move for 5 seconds"; public String teleportHomeFail = "Teleport already happening"; + public String wiki = "For more info check out the wiki:"; + public LangCommands cmdLang = new LangCommands(); public LangConfig(MinecraftServer server) {