Derived settings are also initially setup for the default values now.
This also avoids some code duplication for these default values.master
parent
c193160c51
commit
5499cbdcc7
|
@ -473,22 +473,27 @@ public class Settings {
|
||||||
// Stores derived settings which get setup after loading the config.
|
// Stores derived settings which get setup after loading the config.
|
||||||
public static class DerivedSettings {
|
public static class DerivedSettings {
|
||||||
|
|
||||||
public static ItemData namingItemData = new ItemData(Material.AIR);
|
public static ItemData namingItemData;
|
||||||
|
|
||||||
// Button items:
|
// Button items:
|
||||||
public static ItemData nameButtonItem = new ItemData(Material.AIR);
|
public static ItemData nameButtonItem;
|
||||||
public static ItemData containerButtonItem = new ItemData(Material.AIR);
|
public static ItemData containerButtonItem;
|
||||||
public static ItemData deleteButtonItem = new ItemData(Material.AIR);
|
public static ItemData deleteButtonItem;
|
||||||
public static ItemData hireButtonItem = new ItemData(Material.AIR);
|
public static ItemData hireButtonItem;
|
||||||
|
|
||||||
public static ItemData deleteVillagerButtonItem = new ItemData(Material.AIR);
|
public static ItemData deleteVillagerButtonItem;
|
||||||
public static ItemData villagerInventoryButtonItem = new ItemData(Material.AIR);
|
public static ItemData villagerInventoryButtonItem;
|
||||||
|
|
||||||
public static Pattern shopNamePattern = Pattern.compile("^[A-Za-z0-9 ]{3,32}$");
|
public static Pattern shopNamePattern;
|
||||||
|
|
||||||
// Sorted in descending order:
|
// Sorted in descending order:
|
||||||
public static final List<MaxShopsPermission> maxShopsPermissions = new ArrayList<>();
|
public static final List<MaxShopsPermission> maxShopsPermissions = new ArrayList<>();
|
||||||
|
|
||||||
|
static {
|
||||||
|
// Initial setup of default values:
|
||||||
|
setup();
|
||||||
|
}
|
||||||
|
|
||||||
// Gets called after the config has been loaded:
|
// Gets called after the config has been loaded:
|
||||||
private static void setup() {
|
private static void setup() {
|
||||||
// Ignore display name (which is used for specifying the new shopkeeper name):
|
// Ignore display name (which is used for specifying the new shopkeeper name):
|
||||||
|
@ -530,6 +535,9 @@ public class Settings {
|
||||||
}
|
}
|
||||||
Collections.sort(maxShopsPermissions, Collections.reverseOrder()); // Descending order
|
Collections.sort(maxShopsPermissions, Collections.reverseOrder()); // Descending order
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private DerivedSettings() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shop creation item:
|
// Shop creation item:
|
||||||
|
|
Loading…
Reference in New Issue