mirror of
https://github.com/songoda/EpicFarming.git
synced 2024-09-30 23:57:29 +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;
|
||||
}
|
||||
UUID placedBY = null;
|
||||
String configPlacedBY = row.get("placedby").asString();
|
||||
if (configPlacedBY != null) {
|
||||
placedBY = UUID.fromString(configPlacedBY);
|
||||
String configPlacedBy = row.get("placedby").asString();
|
||||
if (configPlacedBy != null) {
|
||||
placedBY = UUID.fromString(configPlacedBy);
|
||||
}
|
||||
Farm farm = new Farm(location, levelManager.getLevel(level), placedBY);
|
||||
farm.setItems(items);
|
||||
@ -215,7 +215,7 @@ public class EpicFarming extends SongodaPlugin {
|
||||
for (String levelName : levelsFile.getKeys(false)) {
|
||||
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 costEconomy = levels.getInt("Cost-eco");
|
||||
int radius = levels.getInt("Radius");
|
||||
|
@ -35,7 +35,7 @@ public abstract class Storage {
|
||||
String locstr = Methods.serializeLocation(farm.getLocation());
|
||||
prepareSaveItem("farms", new StorageItem("location", locstr),
|
||||
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()));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user