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 8e8d15ca3..60be2cccb 100644 --- a/src/main/java/world/bentobox/bentobox/api/addons/AddonClassLoader.java +++ b/src/main/java/world/bentobox/bentobox/api/addons/AddonClassLoader.java @@ -44,8 +44,8 @@ public class AddonClassLoader extends URLClassLoader { try { String mainClass = data.getString("main"); javaClass = Class.forName(mainClass, true, this); - if(mainClass.startsWith("world.bentobox")){ - throw new InvalidAddonFormatException("Packages declaration cannot start with 'world.bentobox'"); + if(mainClass.startsWith("world.bentobox.bentobox")){ + throw new InvalidAddonFormatException("Packages declaration cannot start with 'world.bentobox.bentobox'"); } } catch (Exception e) { throw new InvalidDescriptionException("Could not load '" + path.getName() + "' in folder '" + path.getParent() + "' - " + e.getMessage()); @@ -103,7 +103,7 @@ public class AddonClassLoader extends URLClassLoader { * @return Class - class if found */ public Class findClass(String name, boolean checkGlobal) { - if (name.startsWith("world.bentobox.")) { + if (name.startsWith("world.bentobox.bentobox")) { return null; } 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 198ad8958..b079ee47f 100644 --- a/src/main/java/world/bentobox/bentobox/api/commands/CompositeCommand.java +++ b/src/main/java/world/bentobox/bentobox/api/commands/CompositeCommand.java @@ -217,8 +217,8 @@ public abstract class CompositeCommand extends Command implements PluginIdentifi p = p.getParent(); index++; } - setDescription(reference.toString() + ".description"); - setParametersHelp(reference.toString() + ".parameters"); + setDescription("commands." + reference.toString() + ".description"); + setParametersHelp("commands." + reference.toString() + ".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/commands/BentoBoxAboutCommand.java b/src/main/java/world/bentobox/bentobox/commands/BentoBoxAboutCommand.java index a597f04ca..3f63c4da2 100644 --- a/src/main/java/world/bentobox/bentobox/commands/BentoBoxAboutCommand.java +++ b/src/main/java/world/bentobox/bentobox/commands/BentoBoxAboutCommand.java @@ -22,16 +22,12 @@ public class BentoBoxAboutCommand extends CompositeCommand { @Override public void setup() { - + // Useless : this command uses the default values. } @Override public boolean execute(User user, String label, List args) { - user.sendRawMessage("About " + BentoBox - .getInstance() - .getDescription() - .getName() + " v" + - BentoBox.getInstance().getDescription().getVersion() + ":"); + user.sendRawMessage("About " + BentoBox.getInstance().getDescription().getName() + " v" + BentoBox.getInstance().getDescription().getVersion() + ":"); user.sendRawMessage("Copyright (c) 2017 - 2018 Tastybento, Poslovitch"); user.sendRawMessage("See https://www.eclipse.org/legal/epl-2.0/ for license information."); return true; diff --git a/src/main/java/world/bentobox/bentobox/commands/BentoBoxVersionCommand.java b/src/main/java/world/bentobox/bentobox/commands/BentoBoxVersionCommand.java index a1872e80d..d86fb54c7 100644 --- a/src/main/java/world/bentobox/bentobox/commands/BentoBoxVersionCommand.java +++ b/src/main/java/world/bentobox/bentobox/commands/BentoBoxVersionCommand.java @@ -23,7 +23,7 @@ public class BentoBoxVersionCommand extends CompositeCommand { @Override public void setup() { - + // Useless : this command uses the default values. } @Override diff --git a/src/main/java/world/bentobox/bentobox/schems/Clipboard.java b/src/main/java/world/bentobox/bentobox/schems/Clipboard.java index ae23b8017..0f04b2688 100644 --- a/src/main/java/world/bentobox/bentobox/schems/Clipboard.java +++ b/src/main/java/world/bentobox/bentobox/schems/Clipboard.java @@ -49,21 +49,19 @@ import world.bentobox.bentobox.api.user.User; import world.bentobox.bentobox.database.objects.Island; import world.bentobox.bentobox.util.Util; +/** + * @author tastybento + */ public class Clipboard { + // Commonly used texts along this class. private static final String ATTACHED = "attached"; - private static final String BLOCK = "blocks"; - - private static final String LOAD_ERROR = "Could not load schems file - does not exist : "; - private static final String BEDROCK = "bedrock"; - private static final String INVENTORY = "inventory"; - private static final String ENTITY = "entity"; - private static final String COLOR = "color"; + private static final String LOAD_ERROR = "Could not load schems file - does not exist : "; private YamlConfiguration blockConfig = new YamlConfiguration(); private Location pos1; @@ -289,14 +287,10 @@ public class Clipboard { } } if (e instanceof AbstractHorse) { - AbstractHorse horse = (AbstractHorse)e; + Horse horse = (Horse)e; horse.setDomestication(ent.getInt("domestication")); ConfigurationSection inv = ent.getConfigurationSection(INVENTORY); inv.getKeys(false).forEach(i -> horse.getInventory().setItem(Integer.valueOf(i), (ItemStack)inv.get(i))); - } - - if (e instanceof AbstractHorse) { - Horse horse = (Horse)e; horse.setStyle(Horse.Style.valueOf(ent.getString("style", "NONE"))); } });