From 48883bb75fb7ab579fb153c45c881f872bf57237 Mon Sep 17 00:00:00 2001 From: tastybento Date: Fri, 3 Aug 2018 08:24:40 -0700 Subject: [PATCH] Removed constants class for now. It's not needed. --- .../bentobox/api/addons/AddonClassLoader.java | 1 - .../bentobox/api/commands/CompositeCommand.java | 15 +++++++++------ .../bentobox/managers/IslandsManager.java | 5 +++-- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/main/java/world/bentobox/bentobox/api/addons/AddonClassLoader.java b/src/main/java/world/bentobox/bentobox/api/addons/AddonClassLoader.java index f8696177b..b9819df77 100644 --- a/src/main/java/world/bentobox/bentobox/api/addons/AddonClassLoader.java +++ b/src/main/java/world/bentobox/bentobox/api/addons/AddonClassLoader.java @@ -48,7 +48,6 @@ public class AddonClassLoader extends URLClassLoader { throw new InvalidAddonFormatException("Packages declaration cannot start with 'world.bentobox'"); } } catch (Exception e) { - e.printStackTrace(); throw new InvalidDescriptionException("Could not load '" + path.getName() + "' in folder '" + path.getParent() + "' - " + e.getMessage()); } diff --git a/src/main/java/world/bentobox/bentobox/api/commands/CompositeCommand.java b/src/main/java/world/bentobox/bentobox/api/commands/CompositeCommand.java index eb21b499a..6265d51b6 100644 --- a/src/main/java/world/bentobox/bentobox/api/commands/CompositeCommand.java +++ b/src/main/java/world/bentobox/bentobox/api/commands/CompositeCommand.java @@ -120,8 +120,8 @@ public abstract class CompositeCommand extends Command implements PluginIdentifi plugin.getCommandsManager().registerCommand(this); } // Default references to description and parameters - ///setDescription("commands." + label + ".description"); - //setParameters("commands." + label + ".parameters"); + setDescription("commands." + label + ".description"); + setParameters("commands." + label + ".parameters"); setup(); if (!getSubCommand("help").isPresent() && !label.equals("help")) { new DefaultHelpCommand(this); @@ -164,15 +164,18 @@ public abstract class CompositeCommand extends Command implements PluginIdentifi // Inherit world this.world = parent.getWorld(); // Default references to description and parameters + + StringBuilder reference = new StringBuilder(); + reference.append("commands"); /* - String reference = ""; - for (CompositeCommand p = this ; p != null ; p = getParent()) { + for (CompositeCommand p = this ; p != null && p != this; p = getParent()) { reference = "." + p.getLabel() + reference; } - reference = "commands" + reference; + */ + setDescription(reference + ".description"); setParameters(reference + ".parameters"); - */ + setup(); // If this command does not define its own help class, then use the default help command if (!getSubCommand("help").isPresent() && !label.equals("help")) { diff --git a/src/main/java/world/bentobox/bentobox/managers/IslandsManager.java b/src/main/java/world/bentobox/bentobox/managers/IslandsManager.java index 1d04950ba..cb17fb5f2 100644 --- a/src/main/java/world/bentobox/bentobox/managers/IslandsManager.java +++ b/src/main/java/world/bentobox/bentobox/managers/IslandsManager.java @@ -25,7 +25,6 @@ import org.bukkit.material.TrapDoor; import org.bukkit.util.Vector; import world.bentobox.bentobox.BentoBox; -import world.bentobox.bentobox.Constants; import world.bentobox.bentobox.api.user.User; import world.bentobox.bentobox.database.BSBDatabase; import world.bentobox.bentobox.database.objects.Island; @@ -43,6 +42,8 @@ import world.bentobox.bentobox.util.teleport.SafeTeleportBuilder; */ public class IslandsManager { + private static final String SPAWNCOMMAND = "spawn"; + private BentoBox plugin; /** @@ -680,7 +681,7 @@ public class IslandsManager { // go to island spawn player.teleport(spawn.get(island.getWorld()).getSpawnPoint(island.getWorld().getEnvironment())); } else { - if (!player.performCommand(Constants.SPAWNCOMMAND)) { + if (!player.performCommand(SPAWNCOMMAND)) { plugin.logWarning("During island deletion player " + player.getName() + " could not be sent to spawn so was dropped, sorry."); } }