mirror of
https://github.com/songoda/EpicFarming.git
synced 2024-10-02 08:37:33 +02:00
placedBy null support.
This commit is contained in:
parent
22bd0a4e27
commit
bfa4297cb4
@ -134,9 +134,9 @@ public class EpicFarming extends SongodaPlugin {
|
|||||||
items = configItems;
|
items = configItems;
|
||||||
}
|
}
|
||||||
UUID placedBY = null;
|
UUID placedBY = null;
|
||||||
String configPlacedBY = row.get("placedby").asString();
|
String configPlacedBy = row.get("placedby").asString();
|
||||||
if (configPlacedBY != null) {
|
if (configPlacedBy != null) {
|
||||||
placedBY = UUID.fromString(configPlacedBY);
|
placedBY = UUID.fromString(configPlacedBy);
|
||||||
}
|
}
|
||||||
Farm farm = new Farm(location, levelManager.getLevel(level), placedBY);
|
Farm farm = new Farm(location, levelManager.getLevel(level), placedBY);
|
||||||
farm.setItems(items);
|
farm.setItems(items);
|
||||||
@ -215,7 +215,7 @@ public class EpicFarming extends SongodaPlugin {
|
|||||||
for (String levelName : levelsFile.getKeys(false)) {
|
for (String levelName : levelsFile.getKeys(false)) {
|
||||||
ConfigurationSection levels = levelsFile.getConfigurationSection(levelName);
|
ConfigurationSection levels = levelsFile.getConfigurationSection(levelName);
|
||||||
|
|
||||||
int level = Integer.valueOf(levelName.split("-")[1]);
|
int level = Integer.parseInt(levelName.split("-")[1]);
|
||||||
int costExperiance = levels.getInt("Cost-xp");
|
int costExperiance = levels.getInt("Cost-xp");
|
||||||
int costEconomy = levels.getInt("Cost-eco");
|
int costEconomy = levels.getInt("Cost-eco");
|
||||||
int radius = levels.getInt("Radius");
|
int radius = levels.getInt("Radius");
|
||||||
|
@ -35,7 +35,7 @@ public abstract class Storage {
|
|||||||
String locstr = Methods.serializeLocation(farm.getLocation());
|
String locstr = Methods.serializeLocation(farm.getLocation());
|
||||||
prepareSaveItem("farms", new StorageItem("location", locstr),
|
prepareSaveItem("farms", new StorageItem("location", locstr),
|
||||||
new StorageItem("level", farm.getLevel().getLevel()),
|
new StorageItem("level", farm.getLevel().getLevel()),
|
||||||
new StorageItem("placedby", farm.getPlacedBy().toString()),
|
new StorageItem("placedby", farm.getPlacedBy() == null ? null : farm.getPlacedBy().toString()),
|
||||||
new StorageItem("contents", farm.getItems()));
|
new StorageItem("contents", farm.getItems()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user