add ward enchantment

This commit is contained in:
2025-05-13 23:45:45 +02:00
parent 9a9bef2068
commit eb3f7888ea
5 changed files with 267 additions and 0 deletions
@@ -72,6 +72,9 @@ public class EnchantioConfig {
ConfigurationSection volleySection = getConfigSection(enchantsSection, "volley");
VolleyEnchant.create(volleySection);
ConfigurationSection wardSection = getConfigSection(enchantsSection, "ward");
WardEnchant.create(wardSection);
ConfigurationSection cursesSection = getConfigSection(configuration, "curses");
ConfigurationSection panicSection = getConfigSection(cursesSection, "panic");
@@ -95,6 +98,15 @@ public class EnchantioConfig {
return list;
}
public static String getString(ConfigurationSection section, String key, String defaultValue) {
String value = section.contains(key) ? section.getString(key) : null;
if (value == null) {
section.set(key, defaultValue);
return defaultValue;
}
return value;
}
public static int getInt(ConfigurationSection section, String key, int defaultValue) {
int value = section.contains(key) ? section.getInt(key) : -1;
if (value == -1) {