Skip to content

Commit

Permalink
remove custom argument type
Browse files Browse the repository at this point in the history
  • Loading branch information
tristankechlo committed Oct 17, 2024
1 parent cdc5405 commit 46a324a
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 88 deletions.
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

### Version 1.21.1 - 2.1.3

- remove custom argument type, which caused some incompatibilities with other mods

### Version 1.21.1 - 2.1.2

- fix advancements unlocking all recipes at world start
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ public final class LivingThingsCommand {

public static void register(CommandDispatcher<CommandSourceStack> dispatcher) {
LiteralArgumentBuilder<CommandSourceStack> command = literal(LivingThings.MOD_ID)
.then(argument("type", ProjectLinksArgumentType.get()).executes(LivingThingsCommand::execute));
.then(literal("github").executes((context) -> display(context, ProjectLinks.GITHUB)))
.then(literal("issue").executes((context) -> display(context, ProjectLinks.GITHUB_ISSUES)))
.then(literal("wiki").executes((context) -> display(context, ProjectLinks.GITHUB_WIKI)))
.then(literal("discord").executes((context) -> display(context, ProjectLinks.DISCORD)))
.then(literal("curseforge").executes((context) -> display(context, ProjectLinks.CURSEFORGE)))
.then(literal("modrinth").executes((context) -> display(context, ProjectLinks.MODRINTH)));
dispatcher.register(command);
LivingThings.LOGGER.info("Command '/{}' registered", LivingThings.MOD_ID);
}

private static int execute(CommandContext<CommandSourceStack> context) {
ProjectLinks type = context.getArgument("type", ProjectLinks.class);
private static int display(CommandContext<CommandSourceStack> context, ProjectLinks type) {
CommandSourceStack source = context.getSource();
Component link = clickableLink(type.getUrl());
Component message = Component.literal(type.getMessage()).withStyle(ChatFormatting.WHITE).append(link);
Expand Down

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion common/src/main/resources/livingthings.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"compatibilityLevel": "JAVA_17",
"minVersion": "0.8",
"mixins": [
"ArgumentTypesMixin",
"PlayerMixin",
"SpawnPlacementsInvoker",
"entity.MobAccessor",
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ neoforge_range=[21,)
mod_name=LivingThings
mod_author=Buecher_wurm
mod_id=livingthings
mod_version=2.1.2
mod_version=2.1.3
# Other Mods
modmenu_version=11.0.2
patchouli_version=1.21-87
Expand Down

0 comments on commit 46a324a

Please sign in to comment.