Some light cleaning
This commit is contained in:
@@ -29,10 +29,10 @@
|
|||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>2.3.2</version>
|
<version>3.8.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>1.7</source>
|
<source>1.8</source>
|
||||||
<target>1.7</target>
|
<target>1.8</target>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
<artifactId>spigot-api</artifactId>
|
<artifactId>spigot-api</artifactId>
|
||||||
<version>1.14.1-R0.1-SNAPSHOT</version>
|
<version>1.13.1-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -62,9 +62,7 @@ public class ConvertCommand implements CommandExecutor {
|
|||||||
} else {
|
} else {
|
||||||
// Fork into background
|
// Fork into background
|
||||||
sender.sendMessage(Lang.TITLE + Lang.CONVERT_BACKGROUND.toString());
|
sender.sendMessage(Lang.TITLE + Lang.CONVERT_BACKGROUND.toString());
|
||||||
PlayerVaults.getInstance().getServer().getScheduler().runTaskLaterAsynchronously(PlayerVaults.getInstance(), new Runnable() {
|
PlayerVaults.getInstance().getServer().getScheduler().runTaskLaterAsynchronously(PlayerVaults.getInstance(), () -> {
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
int converted = 0;
|
int converted = 0;
|
||||||
VaultOperations.setLocked(true);
|
VaultOperations.setLocked(true);
|
||||||
for (Converter converter : applicableConverters) {
|
for (Converter converter : applicableConverters) {
|
||||||
@@ -74,7 +72,6 @@ public class ConvertCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
VaultOperations.setLocked(false);
|
VaultOperations.setLocked(false);
|
||||||
sender.sendMessage(Lang.TITLE + Lang.CONVERT_COMPLETE.toString().replace("%converted", converted + ""));
|
sender.sendMessage(Lang.TITLE + Lang.CONVERT_COMPLETE.toString().replace("%converted", converted + ""));
|
||||||
}
|
|
||||||
}, 5);
|
}, 5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ public class Serialization {
|
|||||||
entry.setValue(serialize((ConfigurationSerializable) entry.getValue()));
|
entry.setValue(serialize((ConfigurationSerializable) entry.getValue()));
|
||||||
} else if (entry.getValue() instanceof Iterable<?>) {
|
} else if (entry.getValue() instanceof Iterable<?>) {
|
||||||
List<Object> newList = new ArrayList<>();
|
List<Object> newList = new ArrayList<>();
|
||||||
for (Object object : ((Iterable) entry.getValue())) {
|
for (Object object : ((Iterable<?>) entry.getValue())) {
|
||||||
if (object instanceof ConfigurationSerializable) {
|
if (object instanceof ConfigurationSerializable) {
|
||||||
object = serialize((ConfigurationSerializable) object);
|
object = serialize((ConfigurationSerializable) object);
|
||||||
}
|
}
|
||||||
@@ -167,7 +167,7 @@ public class Serialization {
|
|||||||
if (object instanceof Map) {
|
if (object instanceof Map) {
|
||||||
object = deserialize((Map<String, Object>) object);
|
object = deserialize((Map<String, Object>) object);
|
||||||
} else if (object instanceof List) {
|
} else if (object instanceof List) {
|
||||||
object = convertIterable((Iterable) object);
|
object = convertIterable((Iterable<?>) object);
|
||||||
} else if (object instanceof Number) {
|
} else if (object instanceof Number) {
|
||||||
object = convertNumber((Number) object);
|
object = convertNumber((Number) object);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ public class UUIDVaultManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<String> list = Serialization.toString(inventory);
|
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++) {
|
for (int x = 0; x < ser.length; x++) {
|
||||||
if (!ser[x].equalsIgnoreCase("null")) {
|
if (!ser[x].equalsIgnoreCase("null")) {
|
||||||
yaml.set("vault" + number + "." + x, ser[x]);
|
yaml.set("vault" + number + "." + x, ser[x]);
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import org.bukkit.inventory.InventoryHolder;
|
|||||||
public class VaultHolder implements InventoryHolder {
|
public class VaultHolder implements InventoryHolder {
|
||||||
|
|
||||||
private Inventory inventory;
|
private Inventory inventory;
|
||||||
private int vaultNumber = 0;
|
private int vaultNumber;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new vault holder
|
* Creates a new vault holder
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ public class VaultManager {
|
|||||||
for (String s : file.getKeys(false)) {
|
for (String s : file.getKeys(false)) {
|
||||||
try {
|
try {
|
||||||
// vault%
|
// vault%
|
||||||
int number = Integer.valueOf(s.substring(4));
|
int number = Integer.parseInt(s.substring(4));
|
||||||
vaults.add(number);
|
vaults.add(number);
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
// silent
|
// silent
|
||||||
@@ -285,7 +285,6 @@ public class VaultManager {
|
|||||||
YamlConfiguration config = this.loadPlayerVaultFile(holder, false);
|
YamlConfiguration config = this.loadPlayerVaultFile(holder, false);
|
||||||
if (config != null) {
|
if (config != null) {
|
||||||
this.cachedVaultFiles.put(holder, config);
|
this.cachedVaultFiles.put(holder, config);
|
||||||
} else {
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user