Minor formatting tweaks

This commit is contained in:
William278 committed 2023-09-10 17:08:20 +03:00
1 parent c1f2b2bcaa
commit 52f9999991
5 files changed
+6 -5

No files matched your search

@@ -164,7 +164,7 @@ public class BukkitHuskHomes extends JavaPlugin implements HuskHomes, BukkitTask
initialize("hooks", (plugin) -> {
this.registerHooks();
if (hooks.size() > 0) {
if (!hooks.isEmpty()) {
hooks.forEach(hook -> {
try {
hook.initialize();
@@ -41,7 +41,7 @@ public class BrigadierUtil {
@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;
@@ -68,7 +68,7 @@ public abstract class Command extends Node {
@NotNull
public final String getUsage() {
return "/" + getName() + " " + getRawUsage();
return String.format("/%s %s", getName(), getRawUsage());
}
public final void addAdditionalPermissions(@NotNull Map<String, Boolean> permissions) {
@@ -26,7 +26,8 @@ import org.jetbrains.annotations.NotNull;
public class PaperHuskHomes extends BukkitHuskHomes {
@Override
protected @NotNull EventListener registerListener() {
@NotNull
protected EventListener registerListener() {
return new PaperEventListener(this);
}
@@ -57,7 +57,7 @@ public class PaperHuskHomesLoader implements PluginLoader {
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();
}