Some light cleaning

This commit is contained in:
CmdrKittens
2020-03-18 19:22:49 -04:00
parent 0272e20d60
commit c3473b1c81
6 changed files with 17 additions and 21 deletions
@@ -127,7 +127,7 @@ public class Serialization {
entry.setValue(serialize((ConfigurationSerializable) entry.getValue()));
} else if (entry.getValue() instanceof Iterable<?>) {
List<Object> newList = new ArrayList<>();
for (Object object : ((Iterable) entry.getValue())) {
for (Object object : ((Iterable<?>) entry.getValue())) {
if (object instanceof ConfigurationSerializable) {
object = serialize((ConfigurationSerializable) object);
}
@@ -167,7 +167,7 @@ public class Serialization {
if (object instanceof Map) {
object = deserialize((Map<String, Object>) object);
} else if (object instanceof List) {
object = convertIterable((Iterable) object);
object = convertIterable((Iterable<?>) object);
} else if (object instanceof Number) {
object = convertNumber((Number) object);
}
@@ -79,7 +79,7 @@ public class UUIDVaultManager {
}
}
List<String> list = Serialization.toString(inventory);
String[] ser = list.toArray(new String[list.size()]);
String[] ser = list.toArray(new String[0]);
for (int x = 0; x < ser.length; x++) {
if (!ser[x].equalsIgnoreCase("null")) {
yaml.set("vault" + number + "." + x, ser[x]);
@@ -27,7 +27,7 @@ import org.bukkit.inventory.InventoryHolder;
public class VaultHolder implements InventoryHolder {
private Inventory inventory;
private int vaultNumber = 0;
private int vaultNumber;
/**
* Creates a new vault holder
@@ -220,7 +220,7 @@ public class VaultManager {
for (String s : file.getKeys(false)) {
try {
// vault%
int number = Integer.valueOf(s.substring(4));
int number = Integer.parseInt(s.substring(4));
vaults.add(number);
} catch (NumberFormatException e) {
// silent
@@ -285,7 +285,6 @@ public class VaultManager {
YamlConfiguration config = this.loadPlayerVaultFile(holder, false);
if (config != null) {
this.cachedVaultFiles.put(holder, config);
} else {
}
}