From f3fa8563e603914740f8c839f4f7b060c83561ce Mon Sep 17 00:00:00 2001 From: Teriuihi Date: Fri, 18 Oct 2024 23:46:29 +0200 Subject: [PATCH] build commit --- .../com/alttd/custommobs/config/MobTypes.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/alttd/custommobs/config/MobTypes.java b/src/main/java/com/alttd/custommobs/config/MobTypes.java index 2e1d077..140995e 100644 --- a/src/main/java/com/alttd/custommobs/config/MobTypes.java +++ b/src/main/java/com/alttd/custommobs/config/MobTypes.java @@ -53,31 +53,46 @@ public class MobTypes extends AbstractConfig { @SuppressWarnings("unused") private static void load() { MOB_TYPES.clear(); + log.info("Loading mob types"); ConfigurationSection configurationSection = config.getConfigurationSection(prefix.substring(0, prefix.length() - 1)); if (configurationSection == null) { log.warn("No config section found for {}", prefix.substring(0, prefix.length() - 1)); return; } + log.info("1"); Set keys = configurationSection.getKeys(false); + log.info("2"); keys.forEach(key -> { List abilities = config.getStringList(prefix + key, ".abilities", List.of()).stream() .map(MobTypes.MOB_TYPES::getAbility) .filter(Optional::isPresent) .map(Optional::get) .toList(); + log.info("3"); List entityModifiers = new ArrayList<>(); + log.info("4"); config.getConfigurationSection(prefix + key + ".modifiers").getKeys(false).forEach(modifier -> { + log.info("5"); String attribute = config.getString(prefix + key + ".modifiers." + modifier, "attribute", null); + log.info("6"); if (attribute == null) { + log.info("RETURN (7)"); return; } + log.info("8"); EntityModifier value = getAttribute(attribute, config.getDouble(prefix + key + ".modifiers." + modifier, "value", 1)); + log.info("9"); log.info("{}{}.modifiers.{}", prefix, key, modifier); - if (value == null) + if (value == null) { + log.info("RETURN (10)"); return; + } + log.info("11"); entityModifiers.add(value); }); + log.info("12"); MOB_TYPES.put(key, new MobType(abilities, entityModifiers)); + log.info("13"); }); }