Changed alcohol calculation

This commit is contained in:
Sn0wStorm
2013-05-10 00:01:28 +02:00
parent 43824e80a6
commit 5c82b08028
6 changed files with 40 additions and 23 deletions
+6 -4
View File
@@ -151,7 +151,7 @@ public class Barrel {
}
// Saves all data
public static void save(ConfigurationSection config, ConfigurationSection oldConfig) {
public static void save(ConfigurationSection config, ConfigurationSection oldData) {
int id = 0;
for (Barrel barrel : barrels) {
// barrels are sorted in worldUUID.randomId
@@ -187,9 +187,11 @@ public class Barrel {
id++;
}
// also save barrels that are not loaded
for (String uuid : oldConfig.getKeys(false)) {
if (!config.contains(uuid)) {
config.set(uuid, oldConfig.get(uuid));
if (oldData != null){
for (String uuid : oldData.getKeys(false)) {
if (!config.contains(uuid)) {
config.set(uuid, oldData.get(uuid));
}
}
}
}