From c8e379e564d60bc96ee0bf5e74e7dc934279df09 Mon Sep 17 00:00:00 2001 From: Jkibbels Date: Sun, 19 Jan 2025 02:56:17 -0500 Subject: [PATCH] [factions-banking] Huge amount of unrelated fixes with null checks + a new faction skill in the works (beacon effect). Fixed bad listener code in flight code! --- .../AttributeMgr/AttributeMgr.java | 23 +++++++++ .../AttributeNodes/AbstractNode.java | 5 +- .../AttributeNodes/AttributeMetalJacket.java | 2 +- .../FactionNodes/FactionBeacon.java | 50 +++++++++++++++++++ .../FactionNodes/FactionFlight.java | 11 ++-- .../AttributeMgr/AttributeTree.java | 28 ++++++----- .../Commands/AttributeCommands.java | 3 -- .../keeblarcraft/ConfigMgr/ConfigManager.java | 10 +++- .../keeblarcraft/ConfigMgr/GeneralConfig.java | 2 +- .../keeblarcraft/ConfigMgr/SQLConfig.java | 20 ++++---- .../BlockEntities/FactionBlockEntity.java | 6 +++ .../EventMgr/PlayerJoinListener.java | 3 +- .../java/jesse/keeblarcraft/Utils/Setup.java | 28 +++++------ 13 files changed, 136 insertions(+), 55 deletions(-) create mode 100644 src/main/java/jesse/keeblarcraft/AttributeMgr/AttributeNodes/FactionNodes/FactionBeacon.java diff --git a/src/main/java/jesse/keeblarcraft/AttributeMgr/AttributeMgr.java b/src/main/java/jesse/keeblarcraft/AttributeMgr/AttributeMgr.java index 91713b4..cb69a5a 100644 --- a/src/main/java/jesse/keeblarcraft/AttributeMgr/AttributeMgr.java +++ b/src/main/java/jesse/keeblarcraft/AttributeMgr/AttributeMgr.java @@ -10,10 +10,12 @@ package jesse.keeblarcraft.AttributeMgr; import java.util.HashMap; +import java.util.Set; import jesse.keeblarcraft.Keeblarcraft; import jesse.keeblarcraft.AttributeMgr.AttributeNodes.AbstractNode; import jesse.keeblarcraft.AttributeMgr.AttributeNodes.AttributeMetalJacket; +import jesse.keeblarcraft.AttributeMgr.AttributeNodes.FactionNodes.FactionBeacon; import jesse.keeblarcraft.AttributeMgr.AttributeNodes.FactionNodes.FactionFlight; import jesse.keeblarcraft.ConfigMgr.ConfigManager; @@ -68,6 +70,19 @@ public class AttributeMgr { @SuppressWarnings("deprecation") public static String ApplyAttribute(String uuid, String attributeName) { String msg = ""; + // System.out.println("ApplyAttribute debug. UUID - NAME: " + uuid + " - " + attributeName); + + // Set keys = attributes.keySet(); + // for (String key : keys) { + // System.out.println("ATTRI: " + key); + // } + + // System.out.println("ACTIVE TREES: "); + // Set names = activeTrees.keySet(); + // for (String name : names) { + // System.out.println("N: " + name); + // } + if (attributes.containsKey(attributeName)) { AttributeTree playerTree = activeTrees.get(uuid); AbstractNode node = null; @@ -77,6 +92,13 @@ public class AttributeMgr { Keeblarcraft.LOGGER.error("Could not successfully apply attribute. String of attribute name could not be successfully cast to actual java object"); } + // System.out.println("Is player tree null: " + (playerTree == null ? "YES" : "NO")); + // System.out.println("Is player node null: " + (node == null ? "YES" : "NO")); + + // if (playerTree != null) { + // System.out.println("Does player have skill: " + (playerTree.ContainsAttribute(attributeName) ? "YES" : "NO")); + // } + // Ensure player tree isn't null; node isn't null; and the player doesn't already have this attribute if (playerTree != null && node != null && !playerTree.ContainsAttribute(attributeName)) { /////////// @@ -125,6 +147,7 @@ public class AttributeMgr { /// hint: make it an API for other modders to add to RegisterAttributeClass(AttributeMetalJacket.class); + RegisterAttributeClass(FactionBeacon.class); RegisterAttributeClass(FactionFlight.class); } } diff --git a/src/main/java/jesse/keeblarcraft/AttributeMgr/AttributeNodes/AbstractNode.java b/src/main/java/jesse/keeblarcraft/AttributeMgr/AttributeNodes/AbstractNode.java index 4484912..45e4f93 100644 --- a/src/main/java/jesse/keeblarcraft/AttributeMgr/AttributeNodes/AbstractNode.java +++ b/src/main/java/jesse/keeblarcraft/AttributeMgr/AttributeNodes/AbstractNode.java @@ -12,9 +12,6 @@ package jesse.keeblarcraft.AttributeMgr.AttributeNodes; import java.util.HashMap; import java.util.List; -import net.minecraft.server.network.ServerPlayerEntity; -import net.minecraft.server.world.ServerWorld; - abstract public class AbstractNode { ///////////////////////////////////////////////////////////////////////////// /// @fn GetNodeTitle @@ -50,5 +47,5 @@ abstract public class AbstractNode { /// @brief If your node has responsive callbacks; then this is the area /// you will register your callbacks for everything ///////////////////////////////////////////////////////////////////////////// - public abstract void RegisterCallbacks(ServerPlayerEntity player, ServerWorld world); + public abstract void RegisterCallbacks(); } diff --git a/src/main/java/jesse/keeblarcraft/AttributeMgr/AttributeNodes/AttributeMetalJacket.java b/src/main/java/jesse/keeblarcraft/AttributeMgr/AttributeNodes/AttributeMetalJacket.java index da70882..77647a1 100644 --- a/src/main/java/jesse/keeblarcraft/AttributeMgr/AttributeNodes/AttributeMetalJacket.java +++ b/src/main/java/jesse/keeblarcraft/AttributeMgr/AttributeNodes/AttributeMetalJacket.java @@ -53,6 +53,6 @@ public final class AttributeMetalJacket extends AbstractNode { } @Override - public void RegisterCallbacks(ServerPlayerEntity player, ServerWorld world) { + public void RegisterCallbacks() { } } diff --git a/src/main/java/jesse/keeblarcraft/AttributeMgr/AttributeNodes/FactionNodes/FactionBeacon.java b/src/main/java/jesse/keeblarcraft/AttributeMgr/AttributeNodes/FactionNodes/FactionBeacon.java new file mode 100644 index 0000000..f431184 --- /dev/null +++ b/src/main/java/jesse/keeblarcraft/AttributeMgr/AttributeNodes/FactionNodes/FactionBeacon.java @@ -0,0 +1,50 @@ +package jesse.keeblarcraft.AttributeMgr.AttributeNodes.FactionNodes; + +import java.util.HashMap; +import java.util.List; + +import jesse.keeblarcraft.AttributeMgr.AttributeNodes.AbstractNode; +import jesse.keeblarcraft.FactionMgr.Callbacks.PlayerInBaseCallback; +import net.minecraft.entity.effect.StatusEffectInstance; +import net.minecraft.entity.effect.StatusEffects; +import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.util.ActionResult; + +public class FactionBeacon extends AbstractNode { + private int beaconStrength = 1; // Increases with faction power; 1 is default + private float absorptionAmnt = 0.2f * beaconStrength; + @Override + public String GetNodeTitle() { + return "faction_beacon"; + } + + @Override + public String GetNodeDescription() { + return "This is a great unlockable for any faction to have and is leveled up with higher faction power. Gives beacon-like abilities + more!"; + } + + @Override + public HashMap> GetDetails() { + HashMap> ret = new HashMap>(); + ret.put("Faction Beacon", List.of("Grants a ton of beacon-like effects on faction members inside the radius of the faction block")); + return ret; + } + + private void ApplyEffects(ServerPlayerEntity player) { + // player.setAbsorptionAmount(absorptionAmnt); + StatusEffectInstance sei = new StatusEffectInstance(StatusEffects.REGENERATION, 1000, 1, true, true, true); + player.addStatusEffect(sei); + } + + @Override + public void RegisterCallbacks() { + System.out.println("REGISTER CALLBACKS FOR FACTION BEACON CALLED"); + PlayerInBaseCallback.EVENT.register((player, world) -> { + // Make sure player can fly while inside the border. We don't ever want to run this more than once! + // player.sendMessage(Text.of("Applying effects")); + ApplyEffects((ServerPlayerEntity) player); + return ActionResult.SUCCESS; + }); + } + +} diff --git a/src/main/java/jesse/keeblarcraft/AttributeMgr/AttributeNodes/FactionNodes/FactionFlight.java b/src/main/java/jesse/keeblarcraft/AttributeMgr/AttributeNodes/FactionNodes/FactionFlight.java index acb267e..e100074 100644 --- a/src/main/java/jesse/keeblarcraft/AttributeMgr/AttributeNodes/FactionNodes/FactionFlight.java +++ b/src/main/java/jesse/keeblarcraft/AttributeMgr/AttributeNodes/FactionNodes/FactionFlight.java @@ -12,7 +12,6 @@ import jesse.keeblarcraft.FactionMgr.Callbacks.PlayerExitedBaseCallback; import jesse.keeblarcraft.FactionMgr.Callbacks.PlayerInBaseCallback; import net.minecraft.entity.player.PlayerAbilities; import net.minecraft.server.network.ServerPlayerEntity; -import net.minecraft.server.world.ServerWorld; import net.minecraft.text.Text; import net.minecraft.util.ActionResult; @@ -78,7 +77,7 @@ public class FactionFlight extends AbstractNode { } @Override - public void RegisterCallbacks(ServerPlayerEntity playerObj, ServerWorld worldObj) { + public void RegisterCallbacks() { PlayerEnteredBaseCallback.EVENT.register((player, world) -> { player.sendMessage(Text.of("Faction flight enabled")); canFly = true; @@ -86,7 +85,7 @@ public class FactionFlight extends AbstractNode { // Toggle flight TurnOnFlight(serverPlayer); - return ActionResult.SUCCESS; + return ActionResult.PASS; }); PlayerInBaseCallback.EVENT.register((player, world) -> { @@ -98,7 +97,7 @@ public class FactionFlight extends AbstractNode { ServerPlayerEntity serverPlayer = (ServerPlayerEntity) player; TurnOnFlight(serverPlayer); } - return ActionResult.SUCCESS; + return ActionResult.PASS; }); PlayerCommandFlightCallback.EVENT.register((player, world) -> { @@ -122,7 +121,7 @@ public class FactionFlight extends AbstractNode { // Means player is not in fly-zone serverPlayer.sendMessage(Text.of("You can only fly within the bounds of your faction base!")); } - return ActionResult.SUCCESS; + return ActionResult.PASS; }); PlayerExitedBaseCallback.EVENT.register((player, world) -> { @@ -142,7 +141,7 @@ public class FactionFlight extends AbstractNode { } }, leaveTimerMs); - return ActionResult.SUCCESS; + return ActionResult.PASS; }); } diff --git a/src/main/java/jesse/keeblarcraft/AttributeMgr/AttributeTree.java b/src/main/java/jesse/keeblarcraft/AttributeMgr/AttributeTree.java index 28b766a..ccc9c10 100644 --- a/src/main/java/jesse/keeblarcraft/AttributeMgr/AttributeTree.java +++ b/src/main/java/jesse/keeblarcraft/AttributeMgr/AttributeTree.java @@ -18,7 +18,6 @@ import jesse.keeblarcraft.Keeblarcraft; import jesse.keeblarcraft.AttributeMgr.AttributeNodes.AbstractNode; import jesse.keeblarcraft.ConfigMgr.ConfigManager; import net.minecraft.server.network.ServerPlayerEntity; -import net.minecraft.server.world.ServerWorld; public class AttributeTree { @@ -33,7 +32,7 @@ public class AttributeTree { /// @brief This is an individual node that goes within the larger /// PlayerTree class object ///////////////////////////////////////////////////////////////////////////// - private class TreeNode { + public class TreeNode { public TreeNode(AbstractNode node, Integer maxLevel, List parents, List children) { thisNode = node; parentNodes = parents; @@ -42,15 +41,15 @@ public class AttributeTree { currentNodeLevel = 1; } - AbstractNode thisNode; - Integer currentNodeLevel; - Integer maxNodeLevel; + public AbstractNode thisNode; + public Integer currentNodeLevel; + public Integer maxNodeLevel; // Store the names of the parent and children nodes; this lets a node have any number of parents and children // NOTE TO DEVELOPERS: Be aware! The more nodes the harrier the tree will look in the GUI!!! Always test your // code before just adding stuff willy-nilly! - List parentNodes; - List childrenNodes; + public List parentNodes; + public List childrenNodes; } ///////////////////////////////////////////////////////////////////////////// @@ -61,10 +60,10 @@ public class AttributeTree { /// stored inside the AttributeMgr class ///////////////////////////////////////////////////////////////////////////// private class PlayerTree { - String uuid; + public String uuid; // Key = name of AbstractNode // Val = The attribute itself - HashMap tree = new HashMap(); + public HashMap tree = new HashMap(); } ///////////////////////////////////////////////////////////////////////////// @@ -94,7 +93,7 @@ public class AttributeTree { } @Override - public void RegisterCallbacks(ServerPlayerEntity player, ServerWorld world) { + public void RegisterCallbacks() { } } @@ -112,7 +111,7 @@ public class AttributeTree { // the callback registration process has already happened if (tree.getValue().thisNode == null) { System.out.println("REGISTERACTIVECALLBACKS - NULL NODE"); - tree.getValue().thisNode.RegisterCallbacks(player, player.getServerWorld()); + tree.getValue().thisNode.RegisterCallbacks(); } else { System.out.println("REGISTERACTIVECALLBACKS - NOT NULL NODE"); } @@ -172,9 +171,11 @@ public class AttributeTree { playerAttributeTree.tree.put(newNode.GetNodeTitle(), new TreeNode(newNode, maxNodeLevel, parents, children)); // if the new nodes level is not 0 we need to manually register the callbacks + System.out.println("Node title: " + newNode.GetNodeTitle() + " has power level " + + playerAttributeTree.tree.get(newNode.GetNodeTitle()).currentNodeLevel); if (playerAttributeTree.tree.get(newNode.GetNodeTitle()).currentNodeLevel != 0) { System.out.println("Registering new callback for new node"); - playerAttributeTree.tree.get(newNode.GetNodeTitle()).thisNode.RegisterCallbacks(player, player.getServerWorld()); + playerAttributeTree.tree.get(newNode.GetNodeTitle()).thisNode.RegisterCallbacks(); } } else { // Some fancy error handling for console log @@ -323,6 +324,7 @@ public class AttributeTree { /// @brief Flashes the config to the disk ///////////////////////////////////////////////////////////////////////////// public void FlashConfig() { - config.WriteToJsonFile("attributes/" + playerAttributeTree.uuid + ".json", playerAttributeTree); + /// TODO: This is broken because of a 'java.util.Option#value it cannot write. Idk, fix soon' + // config.WriteToJsonFile("attributes/" + playerAttributeTree.uuid + ".json", playerAttributeTree); } } diff --git a/src/main/java/jesse/keeblarcraft/Commands/AttributeCommands.java b/src/main/java/jesse/keeblarcraft/Commands/AttributeCommands.java index 612c0b1..5f13cf0 100644 --- a/src/main/java/jesse/keeblarcraft/Commands/AttributeCommands.java +++ b/src/main/java/jesse/keeblarcraft/Commands/AttributeCommands.java @@ -75,10 +75,7 @@ public class AttributeCommands { public int ApplyAttribute(ServerPlayerEntity targetPlayer, String attributeName, CommandContext context) { int ret = -1; - - System.out.println("Applying attribute"); if (context.getSource().isExecutedByPlayer()) { - System.out.println("Executed by player"); String result = AttributeMgr.ApplyAttribute(targetPlayer.getUuidAsString(), attributeName); Keeblarcraft.LOGGER.info("[ApplyAttribute] -> " + result); context.getSource().getPlayer().sendMessage(Text.of(result)); diff --git a/src/main/java/jesse/keeblarcraft/ConfigMgr/ConfigManager.java b/src/main/java/jesse/keeblarcraft/ConfigMgr/ConfigManager.java index e568f74..469d853 100644 --- a/src/main/java/jesse/keeblarcraft/ConfigMgr/ConfigManager.java +++ b/src/main/java/jesse/keeblarcraft/ConfigMgr/ConfigManager.java @@ -15,6 +15,7 @@ import java.io.FileWriter; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; +import java.nio.file.Paths; import com.google.common.base.Charsets; import com.google.common.io.Files; @@ -46,6 +47,7 @@ public class ConfigManager { File file = null; System.out.println("Get file called for " + GLOBAL_CONFIG + confFile); try { + System.out.println("GetFile Cur Dir: " + Paths.get("").toAbsolutePath().toString()); file = new File(GLOBAL_CONFIG + confFile); } catch (Exception e) {} return file; @@ -69,6 +71,8 @@ public class ConfigManager { } } } + + System.out.println("PathOfFile: " + pathToFile); return pathToFile; } @@ -145,7 +149,7 @@ public class ConfigManager { /// @brief Writes NbtList data to disk ///////////////////////////////////////////////////////////////////////////// public void WriteNbtListToFile(String fileName, String key, NbtList data) { - fileName = "config/keeblarcraft/" + fileName; + // fileName = "config/keeblarcraft/" + fileName; File file = GetFile(fileName); if (!file.exists()) { @@ -176,7 +180,7 @@ public class ConfigManager { ///////////////////////////////////////////////////////////////////////////// public HashMap ReadAllNbtListFromDirectory(String dir, int listType) { HashMap list = new HashMap(); - dir = "config/keeblarcraft/" + dir; + // dir = "config/keeblarcraft/" + dir; File directory = GetFile(dir); @@ -275,6 +279,7 @@ public class ConfigManager { writer.close(); } catch (JsonIOException | IOException e) { Keeblarcraft.LOGGER.error("Could not successfully write to json file ["+fileName+"]"); + e.printStackTrace(); } } @@ -291,6 +296,7 @@ public class ConfigManager { File file = GetFile(fileName); ret = FileUtils.readFileToString(file, "UTF-8"); } catch (Exception e) { + e.printStackTrace(); System.out.println("Caught an exception in retrieving JSON Object from file " + fileName); // throw new JsonSyntaxException(""); } diff --git a/src/main/java/jesse/keeblarcraft/ConfigMgr/GeneralConfig.java b/src/main/java/jesse/keeblarcraft/ConfigMgr/GeneralConfig.java index a5b3019..801ccf4 100644 --- a/src/main/java/jesse/keeblarcraft/ConfigMgr/GeneralConfig.java +++ b/src/main/java/jesse/keeblarcraft/ConfigMgr/GeneralConfig.java @@ -4,7 +4,6 @@ import java.util.ArrayList; import java.util.List; import jesse.keeblarcraft.Utils.DirectionalVec; -import jesse.keeblarcraft.Utils.CustomExceptions.FILE_WRITE_EXCEPTION; public class GeneralConfig { private static GeneralConfig static_inst; @@ -118,6 +117,7 @@ public class GeneralConfig { /// @return True if player is new, false if not ///////////////////////////////////////////////////////////////////////////// public Boolean IsNewPlayer(String uuid) { + System.out.println("Is config null? " + (config == null ? "YES" : "NO")); System.out.println("IsNewPlayer called. List has: " + config.playerList); Boolean isNew = !config.playerList.contains(uuid); diff --git a/src/main/java/jesse/keeblarcraft/ConfigMgr/SQLConfig.java b/src/main/java/jesse/keeblarcraft/ConfigMgr/SQLConfig.java index d743d79..ea5bbfc 100644 --- a/src/main/java/jesse/keeblarcraft/ConfigMgr/SQLConfig.java +++ b/src/main/java/jesse/keeblarcraft/ConfigMgr/SQLConfig.java @@ -116,15 +116,17 @@ public class SQLConfig { // The case is converted to upper case automatically to be case insensitive public Boolean DoesTableExist(String name) { boolean tableExists = false; - try (ResultSet rs = conn.getMetaData().getTables(null, null, name, null)) { - while (rs.next()) { - String tName = rs.getString("TABLE_NAME"); - if (tName != null && tName.equals(name)) { - tableExists = true; - break; + if (conn != null) { + try (ResultSet rs = conn.getMetaData().getTables(null, null, name, null)) { + while (rs.next()) { + String tName = rs.getString("TABLE_NAME"); + if (tName != null && tName.equals(name)) { + tableExists = true; + break; + } } - } - } catch (SQLException e) {} + } catch (SQLException e) {} + } return tableExists; } @@ -160,7 +162,7 @@ public class SQLConfig { public Boolean CreateTable(String tableName, Pair... columnPairs) { Boolean success = false; - if (!DoesTableExist(tableName.toUpperCase())) { + if (conn != null && !DoesTableExist(tableName.toUpperCase())) { String sqlCommand = "CREATE TABLE " + tableName.toUpperCase() + "("; for (Pair colPair : columnPairs) { sqlCommand = sqlCommand + " " + colPair.GetKey() + " " + SQLTypeSupport.GetSqlStrForType(colPair.GetValue()) + ","; diff --git a/src/main/java/jesse/keeblarcraft/CustomBlocks/BlockEntities/FactionBlockEntity.java b/src/main/java/jesse/keeblarcraft/CustomBlocks/BlockEntities/FactionBlockEntity.java index c42ba72..847ebe9 100644 --- a/src/main/java/jesse/keeblarcraft/CustomBlocks/BlockEntities/FactionBlockEntity.java +++ b/src/main/java/jesse/keeblarcraft/CustomBlocks/BlockEntities/FactionBlockEntity.java @@ -37,6 +37,7 @@ public class FactionBlockEntity extends BlockEntity implements ExtendedScreenHan private static int factionPower = 0; Boolean stopMobSpawn = true; Boolean hasBuildFlight = true; + Boolean hasSuperBeacon = true; private ArrayList playersInRadius = new ArrayList<>(); protected final PropertyDelegate propertyDelegate; @@ -142,6 +143,11 @@ public class FactionBlockEntity extends BlockEntity implements ExtendedScreenHan AttributeMgr.ApplyAttribute(player.getUuidAsString(), "faction_flight"); ActionResult result = PlayerInBaseCallback.EVENT.invoker().interact(player, world); } + + if (hasSuperBeacon) { + AttributeMgr.ApplyAttribute(player.getUuidAsString(), "faction_beacon"); + // ActionResult result = PlayerInBaseCallback.EVENT.invoker().interact(player, world); + } } else if (!isPlayerInFactionRadius && playersInRadius.contains(player.getUuidAsString())) { playersInRadius.remove(player.getUuidAsString()); ActionResult result = PlayerExitedBaseCallback.EVENT.invoker().interact(player, world); diff --git a/src/main/java/jesse/keeblarcraft/EventMgr/PlayerJoinListener.java b/src/main/java/jesse/keeblarcraft/EventMgr/PlayerJoinListener.java index 8a2f3e1..e6680c9 100644 --- a/src/main/java/jesse/keeblarcraft/EventMgr/PlayerJoinListener.java +++ b/src/main/java/jesse/keeblarcraft/EventMgr/PlayerJoinListener.java @@ -38,13 +38,14 @@ public class PlayerJoinListener { try { cachedPlayerConfig = config.GetJsonObjectFromFile(CACHED_PLAYER_LOGIN_CONFIG, CachedUUIDConfig.class); - existingFile = true; + existingFile = cachedPlayerConfig != null; } catch (Exception e) { // intentionally empty } if (!existingFile) { try { + cachedPlayerConfig = new CachedUUIDConfig(); config.CreateFile(CACHED_PLAYER_LOGIN_CONFIG); FlashCachedConfig(); } catch (Exception e) { diff --git a/src/main/java/jesse/keeblarcraft/Utils/Setup.java b/src/main/java/jesse/keeblarcraft/Utils/Setup.java index a3bdfc0..1983469 100644 --- a/src/main/java/jesse/keeblarcraft/Utils/Setup.java +++ b/src/main/java/jesse/keeblarcraft/Utils/Setup.java @@ -16,7 +16,6 @@ import java.util.ArrayList; import jesse.keeblarcraft.Keeblarcraft; import jesse.keeblarcraft.ConfigMgr.ConfigManager; -import jesse.keeblarcraft.ChatStuff.ChatMsg; import jesse.keeblarcraft.Utils.CustomExceptions.SETUP_FAILED_EXCEPTION; // Singleton class is designed to help the mod set itself up and create all the important things. It does two things: @@ -49,24 +48,23 @@ public final class Setup { // First time setup variables private static final List DIRECTORY_LIST = new ArrayList() {{ - add(GLOBAL_CONFIG); // inside config dir - add(GLOBAL_CONFIG + "notes"); // Expect 1 file per player! - add(GLOBAL_CONFIG + "factions"); // Expect 1 file per faction! - add(GLOBAL_CONFIG + "story"); // Expect 1 file per story chapter! - add(GLOBAL_CONFIG + "commands"); // Expect 1 file per command that's configurable! - add(GLOBAL_CONFIG + "events"); // Expect 1 file per event that is configurable! - add(GLOBAL_CONFIG + "bank"); - add(GLOBAL_CONFIG + "attributes"); - add(GLOBAL_CONFIG + "misc"); + add("notes"); // Expect 1 file per player! + add("factions"); // Expect 1 file per faction! + add("story"); // Expect 1 file per story chapter! + add("commands"); // Expect 1 file per command that's configurable! + add("events"); // Expect 1 file per event that is configurable! + add("bank"); + add("attributes"); + add("misc"); }}; // These will be top-level config files above the directories this mod creates private static final List FILE_LIST = new ArrayList() {{ - add(GLOBAL_CONFIG + "story/general_story_config.json"); // Big config file, determines when players can do certain things at different story levels - add(GLOBAL_CONFIG + "factions/general_factions_config.json"); // General configuration file for factions stuff - add(GLOBAL_CONFIG + "events/general_event_config.json"); // General configuration file for story events! - add(GLOBAL_CONFIG + "general.json"); // The super general configuration file! (May be removed) - add(GLOBAL_CONFIG + "attributes/general_attribute_config.json"); + add("story/general_story_config.json"); // Big config file, determines when players can do certain things at different story levels + add("factions/general_factions_config.json"); // General configuration file for factions stuff + add("events/general_event_config.json"); // General configuration file for story events! + add("general.json"); // The super general configuration file! (May be removed) + add("attributes/general_attribute_config.json"); }}; // RunChecks()