forked from PaperMC/paperweight-test-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add set language command with language arguments
- Loading branch information
1 parent
38d2362
commit 7044bf8
Showing
2 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/net/slqmy/template_paper_plugin/commands/SetLanguageCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package net.slqmy.template_paper_plugin.commands; | ||
|
||
import dev.jorel.commandapi.CommandAPICommand; | ||
import dev.jorel.commandapi.arguments.MultiLiteralArgument; | ||
|
||
import java.util.stream.Stream; | ||
|
||
import net.slqmy.template_paper_plugin.TemplatePaperPlugin; | ||
import net.slqmy.template_paper_plugin.language.Language; | ||
import net.slqmy.template_paper_plugin.language.LanguageData; | ||
|
||
public class SetLanguageCommand extends CommandAPICommand { | ||
|
||
public SetLanguageCommand(TemplatePaperPlugin plugin) { | ||
super("set-language"); | ||
|
||
withArguments(new MultiLiteralArgument("language", Stream.of(Language.values()).map((language) -> { | ||
LanguageData data = plugin.getLanguageManager().getLanguageData(language); | ||
|
||
return data.getName(); | ||
}).toArray(String[]::new))); | ||
|
||
executes((sender, arguments) -> { | ||
|
||
}); | ||
|
||
register(plugin); | ||
} | ||
} |