Fixed minor code smells

This commit is contained in:
Florian CUNY 2018-08-12 11:28:36 +02:00
parent 20116ff287
commit 5b7502d83f
3 changed files with 9 additions and 19 deletions

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