Merge remote-tracking branch 'origin/develop' into command_ranks

This commit is contained in:
tastybento 2018-08-12 07:59:13 -07:00
commit 686b4398bc
5 changed files with 14 additions and 24 deletions

View File

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

View File

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

View File

@ -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<String> 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;

View File

@ -23,7 +23,7 @@ public class BentoBoxVersionCommand extends CompositeCommand {
@Override
public void setup() {
// Useless : this command uses the default values.
}
@Override

View File

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