From 8cd3b8606c2817ffd94c56f4fcb040f4ce55917b Mon Sep 17 00:00:00 2001 From: Runemoro Date: Mon, 26 Mar 2018 20:41:16 -0400 Subject: [PATCH] Fix duplicate config defaults * Remove defaults from config strings, forge adds these automatically * Inline default options constatns to make changing the defaults easier * Reformat config --- .../org/dimdev/dimdoors/shared/ModConfig.java | 140 ++++++------------ 1 file changed, 47 insertions(+), 93 deletions(-) diff --git a/src/main/java/org/dimdev/dimdoors/shared/ModConfig.java b/src/main/java/org/dimdev/dimdoors/shared/ModConfig.java index c1a17d65..e1bd3d20 100644 --- a/src/main/java/org/dimdev/dimdoors/shared/ModConfig.java +++ b/src/main/java/org/dimdev/dimdoors/shared/ModConfig.java @@ -20,27 +20,20 @@ public final class ModConfig { // TODO: localize the rest public static Monoliths monoliths = new Monoliths(); public static Limbo limbo = new Limbo(); - private final static int BASE_DIMENSION_ID_DEF = 684; - private final static boolean USE_STATUS_BAR_DEF = true; - private final static boolean CLOSE_DOOR_BEHIND_DEF = true; - public static class General { - @Name("baseDimensionID") + @Name("baseDimensionID") @Comment({"Dimension ID of the first Dimensional Doors dimension. Other dimensions will use consecutive IDs.", - "It is strongly recommendended not to change this value. Only change it if it conflicts with other mods.", - "Default: " + BASE_DIMENSION_ID_DEF}) + "It is strongly recommendended not to change this value. Only change it if it conflicts with other mods."}) @RequiresWorldRestart - public int baseDimensionID = BASE_DIMENSION_ID_DEF; + public int baseDimensionID = 684; - @Name("useStatusBar") - @Comment({"When true, the status bar is used to relay status messages to the player, instead of the chat.", - "Default: " + USE_STATUS_BAR_DEF}) - public boolean useStatusBar = USE_STATUS_BAR_DEF; + @Name("useStatusBar") + @Comment("When true, the status bar is used to relay status messages to the player, instead of the chat.") + public boolean useStatusBar = true; - @Name("closeDoorBehind") - @Comment({"When true, Dimensional Doors will automatically close when the player enters their portal.", - "Default: " + CLOSE_DOOR_BEHIND_DEF}) - public boolean closeDoorBehind = CLOSE_DOOR_BEHIND_DEF; + @Name("closeDoorBehind") + @Comment("When true, Dimensional Doors will automatically close when the player enters their portal.") + public boolean closeDoorBehind = true; @Name("closeDoorBehind") @Comment("Distance in blocks to teleport the player in front of the dimensional door.") @@ -48,125 +41,86 @@ public final class ModConfig { // TODO: localize the rest public double teleportOffset = 1; } - private final static int POCKET_GRID_SIZE_MIN = 4; - private final static int POCKET_GRID_SIZE_DEF = 32; - private final static int MAX_POCKET_SIZE_MIN = 0; - private final static int MAX_POCKET_SIZE_DEF = 15; - private final static int PRIVATE_POCKET_SIZE_MIN = 0; - private final static int PRIVATE_POCKET_SIZE_MAX = 7; - private final static int PRIVATE_POCKET_SIZE_DEF = 2; - private final static int PUBLIC_POCKET_SIZE_MIN = 0; - private final static int PUBLIC_POCKET_SIZE_DEF = 1; - private final static boolean LOAD_ALL_SCHEMATICS_DEF = false; - public static class Pocket { @Name("A_pocketGridSize") - @Comment({"Sets how many chunks apart all pockets in any pocket dimensions should be placed.", - "Default: " + POCKET_GRID_SIZE_DEF}) - @RangeInt(min = POCKET_GRID_SIZE_MIN) - public int pocketGridSize = POCKET_GRID_SIZE_DEF; + @Comment("Sets how many chunks apart all pockets in any pocket dimensions should be placed.") + @RangeInt(min = 4) + public int pocketGridSize = 32; @Name("B_maxPocketSize") @Comment({"Sets the maximum size of any pocket. A 'maxPocketSize' of 'x' will allow for pockets up to (x + 1) * (x + 1) chunks.", - "If this is set to any value bigger than 'pocketGridSize / 2', the value of 'pocketGridSize / 2' will be used instead.", - "Default: " + MAX_POCKET_SIZE_DEF}) - @RangeInt(min = MAX_POCKET_SIZE_MIN) - public int maxPocketSize = MAX_POCKET_SIZE_DEF; + "If this is set to any value bigger than 'pocketGridSize / 2', the value of 'pocketGridSize / 2' will be used instead."}) + @RangeInt(min = 0) + public int maxPocketSize = 15; @Name("C_privatePocketSize") @Comment({"Sets the minimum size of a newly created Private Pocket.", - "If this is set to any value bigger than 'maxPocketSize', the value of 'maxPocketSize' will be used instead.", - "Default: " + PRIVATE_POCKET_SIZE_DEF}) - @RangeInt(min = PRIVATE_POCKET_SIZE_MIN, max = PRIVATE_POCKET_SIZE_MAX) - public int privatePocketSize = PRIVATE_POCKET_SIZE_DEF; + "If this is set to any value bigger than 'maxPocketSize', the value of 'maxPocketSize' will be used instead."}) + @RangeInt(min = 0, max = 7) + public int privatePocketSize = 2; - @Name("D_publicPocketSize") + @Name("D_publicPocketSize") @Comment({"Sets the minimum size of a newly created Public Pocket.", - "If this is set to any value bigger than 'privatePocketSize', the value of 'privatePocketSize' will be used instead.", - "Default: " + PUBLIC_POCKET_SIZE_DEF}) - @RangeInt(min = PUBLIC_POCKET_SIZE_MIN) - public int publicPocketSize = PUBLIC_POCKET_SIZE_DEF; + "If this is set to any value bigger than 'privatePocketSize', the value of 'privatePocketSize' will be used instead."}) + @RangeInt(min = 0) + public int publicPocketSize = 1; - @Name("Z_loadAllSchematics") + @Name("Z_loadAllSchematics") @Comment({"When true, all available Pocket Schematics will be loaded on game-start, even if the gridSize and pocketSize ", - "configuration fields would exclude these schematics from being used in 'naturally generated' pockets.", - "The /pocket command can be used to force-generate these pockets for dungeon building- or testing-purposes.", - "Default: " + LOAD_ALL_SCHEMATICS_DEF}) - public boolean loadAllSchematics = LOAD_ALL_SCHEMATICS_DEF; + "configuration fields would exclude these schematics from being used in 'naturally generated' pockets.", + "The /pocket command can be used to force-generate these pockets for dungeon building- or testing-purposes."}) + public boolean loadAllSchematics = false; } - - private final static double CLUSTER_GEN_CHANCE_MIN = 0.0; - private final static double CLUSTER_GEN_CHANCE_MAX = 1.0; - private final static double CLUSTER_GEN_CHANCE_DEF = 0.0002; - private final static double GATEWAY_GEN_CHANCE_MIN = 0.0; - private final static double GATEWAY_GEN_CHANCE_MAX = 1.0; - private final static double GATEWAY_GEN_CHANCE_DEF = 0.0015; public static class World { @Name("A_clusterGenChance") - @Comment({"Sets the chance (out of 1.0) that a cluster of Rift Scars will generate in a given chunk.", - "Default: " + CLUSTER_GEN_CHANCE_DEF}) - @RangeDouble(min = CLUSTER_GEN_CHANCE_MIN, max = CLUSTER_GEN_CHANCE_MAX) - public double clusterGenChance = CLUSTER_GEN_CHANCE_DEF; + @Comment("Sets the chance (out of 1.0) that a cluster of Rift Scars will generate in a given chunk.") + @RangeDouble(min = 0.0, max = 1.0) + public double clusterGenChance = 0.0002; @Name("A_gatewayGenChance") - @Comment({"Sets the chance (out of 1.0) that a Transient Portal gateway will generate in a given chunk.", - "Default: " + GATEWAY_GEN_CHANCE_DEF}) - @RangeDouble(min = GATEWAY_GEN_CHANCE_MIN, max = GATEWAY_GEN_CHANCE_MAX) - public double gatewayGenChance = GATEWAY_GEN_CHANCE_DEF; + @Comment("Sets the chance (out of 1.0) that a Transient Portal gateway will generate in a given chunk.") + @RangeDouble(min = 0.0, max = 1.0) + public double gatewayGenChance = 0.0015; @Name("B_clusterDimBlacklist") @Comment({"Dimension Blacklist for the generation of Rift Scar clusters. Add a dimension ID here to prevent generation in certain dimensions.", - "Default: []"}) + "Default: []"}) public int[] clusterDimBlacklist = {}; @Name("B_gatewayDimBlacklist") @Comment({"Dimension Blacklist for the generation of Transient Portal gateways. Add a dimension ID here to prevent generation in certain dimensions.", - "Default: []"}) + "Default: []"}) public int[] gatewayDimBlacklist = {}; } - private final static int MAX_DUNGEON_DEPTH_DEF = 2000; - private final static int MAX_DUNGEON_DEPTH_MIN = 100; - public static class Dungeons { @Name("maxDungeonDepth") @Comment({"The depth at which limbo is located. If a Rift reaches any deeper than this while searching for a new ", - "destination, the player trying to enter the Rift will be sent straight to Limbo.", - "Default: " + MAX_DUNGEON_DEPTH_DEF}) - @RangeInt(min = MAX_DUNGEON_DEPTH_MIN) - public int maxDungeonDepth = MAX_DUNGEON_DEPTH_DEF; + "destination, the player trying to enter the Rift will be sent straight to Limbo."}) + @RangeInt(min = 100) + public int maxDungeonDepth = 2000; } - - private final static boolean DANGEROUS_LIMBO_MONOLITHS_DEF = false; - private final static boolean MONOLITH_TELEPORTATION_DEF = true; public static class Monoliths { @Name("dangerousLimboMonoliths") - @Comment({"When true, Monoliths in Limbo attack the player and deal damage.", - "Default: " + DANGEROUS_LIMBO_MONOLITHS_DEF}) - public boolean dangerousLimboMonoliths = DANGEROUS_LIMBO_MONOLITHS_DEF; + @Comment("When true, Monoliths in Limbo attack the player and deal damage.") + public boolean dangerousLimboMonoliths = false; @Name("monolithTeleportation") - @Comment({"When true, being exposed to the gaze of Monoliths for too long, will cause the player to be teleported to the void above Limbo.", - "Default: " + MONOLITH_TELEPORTATION_DEF}) - public boolean monolithTeleportation = MONOLITH_TELEPORTATION_DEF; + @Comment("When true, being exposed to the gaze of Monoliths for too long, will cause the player to be teleported to the void above Limbo.") + public boolean monolithTeleportation = true; } - - private final static boolean UNIVERSAL_LIMBO_DEF = false; - private final static boolean HARDCORE_LIMBO_DEF = false; public static class Limbo { - @Name("universalLimbo") + @Name("universalLimbo") @Comment({"When true, players are also teleported to Limbo when they die in any non-Pocket Dimension (except Limbo itself).", - "Otherwise, players only go to Limbo if they die in a Pocket Dimension.", - "Default: " + UNIVERSAL_LIMBO_DEF}) - public boolean universalLimbo = UNIVERSAL_LIMBO_DEF; + "Otherwise, players only go to Limbo if they die in a Pocket Dimension."}) + public boolean universalLimbo = false; - @Name("hardcoreLimbo") - @Comment({"When true, a player dying in Limbo will respawn in Limbo, making Eternal Fluid or Golden Dimensional Doors the only way to escape Limbo.", - "Default: " + HARDCORE_LIMBO_DEF}) - public boolean hardcoreLimbo = HARDCORE_LIMBO_DEF; + @Name("hardcoreLimbo") + @Comment("When true, a player dying in Limbo will respawn in Limbo, making Eternal Fluid or Golden Dimensional Doors the only way to escape Limbo.") + public boolean hardcoreLimbo = false; } @SubscribeEvent