Removed constants class for now. It's not needed.

This commit is contained in:
tastybento 2018-08-03 08:24:40 -07:00
parent 4d4c8da912
commit 48883bb75f
3 changed files with 12 additions and 9 deletions

View File

@ -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());
}

View File

@ -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")) {

View File

@ -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.");
}
}