Skip to content

✨ Allow for more easily using translatable components with MinecraftHelp#197

Merged
jpenilla merged 2 commits into1.4.0-devfrom
features/1.4.0/minecrafthelp-enhancements
Jan 4, 2021
Merged

✨ Allow for more easily using translatable components with MinecraftHelp#197
jpenilla merged 2 commits into1.4.0-devfrom
features/1.4.0/minecrafthelp-enhancements

Conversation

@jpenilla
Copy link
Copy Markdown
Member

@jpenilla jpenilla commented Jan 3, 2021

These changes allow for more easily using adventure's translation system with MinecraftHelp.

final MinecraftHelp<CommandSender> help = new MinecraftHelp<>(
  "/example help",
  audiences::sender,
  commandManager
);

help.messageProvider((sender, key, args) ->
  Component.translatable(
    "example.help." + key,
    Arrays.stream(args).map(Component::text).collect(Collectors.toList())
  )
);

help.descriptionDecorator(Component::translatable);

@jpenilla jpenilla merged commit 2233390 into 1.4.0-dev Jan 4, 2021
@jpenilla jpenilla deleted the features/1.4.0/minecrafthelp-enhancements branch January 4, 2021 06:19
@Citymonstret Citymonstret added this to the 1.4.0 milestone Jan 12, 2021
Citymonstret pushed a commit that referenced this pull request Jan 14, 2021
…elp (#197)

* ✨ Allow for more easily using translatable components with MinecraftHelp

* Add missing Javadoc
Citymonstret pushed a commit that referenced this pull request Jan 16, 2021
…elp (#197)

* ✨ Allow for more easily using translatable components with MinecraftHelp

* Add missing Javadoc
broccolai pushed a commit to broccolai/cloud that referenced this pull request Mar 29, 2021
…elp (Incendo#197)

* ✨ Allow for more easily using translatable components with MinecraftHelp

* Add missing Javadoc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants