mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 06:28:49 +00:00
Add Paper Plugin support, Pl3xMap hook (#332)
This commit is contained in:
1 parent
17af935379
commit
bc421ae3d8
23 files changed
+770
-198
No files matched your search
@@ -3,7 +3,6 @@ package net.william278.huskhomes.command;
|
||||
import me.lucko.commodore.CommodoreProvider;
|
||||
import me.lucko.commodore.file.CommodoreFileReader;
|
||||
import net.william278.huskhomes.BukkitHuskHomes;
|
||||
import org.bukkit.command.PluginCommand;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -16,22 +15,22 @@ public class BrigadierUtil {
|
||||
* Uses commodore to register command completions
|
||||
*
|
||||
* @param plugin instance of the registering Bukkit plugin
|
||||
* @param pluginCommand the Bukkit PluginCommand to register completions for
|
||||
* @param bukkitCommand the Bukkit PluginCommand to register completions for
|
||||
* @param command the {@link Command} to register completions for
|
||||
*/
|
||||
protected static void registerCommodore(@NotNull BukkitHuskHomes plugin, @NotNull PluginCommand pluginCommand,
|
||||
protected static void registerCommodore(@NotNull BukkitHuskHomes plugin, @NotNull org.bukkit.command.Command bukkitCommand,
|
||||
@NotNull Command command) {
|
||||
final InputStream commandCommodore = plugin.getResource("commodore/" + pluginCommand.getName() + ".commodore");
|
||||
final InputStream commandCommodore = plugin.getResource("commodore/" + bukkitCommand.getName() + ".commodore");
|
||||
if (commandCommodore == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
CommodoreProvider.getCommodore(plugin).register(pluginCommand,
|
||||
CommodoreProvider.getCommodore(plugin).register(bukkitCommand,
|
||||
CommodoreFileReader.INSTANCE.parse(commandCommodore),
|
||||
player -> player.hasPermission(command.getPermission()));
|
||||
} catch (IOException e) {
|
||||
plugin.log(Level.SEVERE, "Failed to read command commodore completions for "
|
||||
+ pluginCommand.getName(), e);
|
||||
+ bukkitCommand.getName(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user