diff --git a/bukkit/src/main/java/net/william278/huskhomes/BukkitHuskHomes.java b/bukkit/src/main/java/net/william278/huskhomes/BukkitHuskHomes.java index 30de584af..42c928128 100644 --- a/bukkit/src/main/java/net/william278/huskhomes/BukkitHuskHomes.java +++ b/bukkit/src/main/java/net/william278/huskhomes/BukkitHuskHomes.java @@ -164,7 +164,7 @@ public void onEnable() { initialize("hooks", (plugin) -> { this.registerHooks(); - if (hooks.size() > 0) { + if (!hooks.isEmpty()) { hooks.forEach(hook -> { try { hook.initialize(); diff --git a/bukkit/src/main/java/net/william278/huskhomes/command/BrigadierUtil.java b/bukkit/src/main/java/net/william278/huskhomes/command/BrigadierUtil.java index a026d1835..05d695ed3 100644 --- a/bukkit/src/main/java/net/william278/huskhomes/command/BrigadierUtil.java +++ b/bukkit/src/main/java/net/william278/huskhomes/command/BrigadierUtil.java @@ -41,7 +41,7 @@ protected static void registerCommodore(@NotNull BukkitHuskHomes plugin, @NotNull org.bukkit.command.Command bukkitCommand, @NotNull Command command) { final InputStream commodoreFile = plugin.getResource( - "commodore/" + bukkitCommand.getName() + ".commodore" + String.format("commodore/%s.commodore", bukkitCommand.getName()) ); if (commodoreFile == null) { return; diff --git a/common/src/main/java/net/william278/huskhomes/command/Command.java b/common/src/main/java/net/william278/huskhomes/command/Command.java index 07fe574cb..c948a13ac 100644 --- a/common/src/main/java/net/william278/huskhomes/command/Command.java +++ b/common/src/main/java/net/william278/huskhomes/command/Command.java @@ -68,7 +68,7 @@ public final String getRawUsage() { @NotNull public final String getUsage() { - return "/" + getName() + " " + getRawUsage(); + return String.format("/%s %s", getName(), getRawUsage()); } public final void addAdditionalPermissions(@NotNull Map permissions) { diff --git a/paper/src/main/java/net/william278/huskhomes/PaperHuskHomes.java b/paper/src/main/java/net/william278/huskhomes/PaperHuskHomes.java index 17ad2d721..083372cd2 100644 --- a/paper/src/main/java/net/william278/huskhomes/PaperHuskHomes.java +++ b/paper/src/main/java/net/william278/huskhomes/PaperHuskHomes.java @@ -26,7 +26,8 @@ public class PaperHuskHomes extends BukkitHuskHomes { @Override - protected @NotNull EventListener registerListener() { + @NotNull + protected EventListener registerListener() { return new PaperEventListener(this); } diff --git a/paper/src/main/java/net/william278/huskhomes/PaperHuskHomesLoader.java b/paper/src/main/java/net/william278/huskhomes/PaperHuskHomesLoader.java index e0c409302..b9993beb8 100644 --- a/paper/src/main/java/net/william278/huskhomes/PaperHuskHomesLoader.java +++ b/paper/src/main/java/net/william278/huskhomes/PaperHuskHomesLoader.java @@ -57,7 +57,7 @@ private static List resolveLibraries(@NotNull PluginClasspathBuilder cla try (InputStream input = getLibraryListFile()) { return Annotaml.create(PaperLibraries.class, Objects.requireNonNull(input)).get().libraries; } catch (Exception e) { - e.printStackTrace(); + classpathBuilder.getContext().getLogger().error("Failed to resolve libraries", e); } return List.of(); }