Better config comments

- Updated Forge version
- Updated Mappings version
- Reverted to using config field names that actually match with the in-code field names, because describing the purpose of config fields is really the task of the comment, not the field name itself
- Added central default, minimum and maximum config values where needed.
- Improved config comments
- Renamed some of the config values, as their names were way too long and specific
This commit is contained in:
Robijnvogel 2018-02-28 02:43:02 +01:00
parent ccb3f5e85b
commit 41a126e7c0
6 changed files with 125 additions and 79 deletions

View file

@ -25,8 +25,8 @@ String baseversion = "3.0" // Set beta to 0 after changing this
int beta = 7 // Set this to 0 for a non-beta release
int betaSub = 1
ext.mcversion = "1.12.2"
ext.forgeversion = "14.23.2.2618"
String mcpversion = "snapshot_20180219"
ext.forgeversion = "14.23.2.2623"
String mcpversion = "snapshot_20180227"
String suffix = ""
String shortSuffix = ""

View file

@ -9,7 +9,7 @@ import org.dimdev.dimdoors.DimDoors;
import static net.minecraftforge.common.config.Config.*;
@Config(modid = DimDoors.MODID, name = DimDoors.MODID, category="")
@Config(modid = DimDoors.MODID, name = DimDoors.MODID, category = "")
@Mod.EventBusSubscriber(modid = DimDoors.MODID)
public final class ModConfig { // TODO: localize the rest
@ -20,102 +20,148 @@ 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("Base Dimension ID")
@Name("baseDimensionID")
@Comment({"Dimension ID of the first Dimensional Doors dimension. Other dimensions will use consecutive IDs.",
"It strongly recommendended to leave this to the default value."})
"It is strongly recommendended not to change this value. Only change it if it conflicts with other mods.",
"Default: " + BASE_DIMENSION_ID_DEF})
@RequiresWorldRestart
public int baseDimensionID = 684;
public int baseDimensionID = BASE_DIMENSION_ID_DEF;
@Name("Status Bar Messages")
@Comment("Use the status bar to send status messages rather than the chat.")
public boolean useStatusBar = true;
@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("Players Close Doors Behind Them")
@Comment({"This options allows Dimensional Doors to automatically close the door once the player steps through.",
"Setting this to true automatically closes the doors, false allows doors to remain open once entered.",
"Default: true"})
public boolean closeDoorBehind = 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;
}
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("Pocket Grid Size")
@Comment("Sets how many chunks apart all pockets in pocket dimensions should be placed.")
@RangeInt(min=4)
public int pocketGridSize = 32;
@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;
@Name("Max Pocket Size")
@Comment("Sets how large a pocket can be.")
@RangeInt(min=0)
public int maxPocketSize = 15;
@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;
@Name("Private Pocket Size")
@Comment("Sets how large a personal pocket is when initially created.")
@RangeInt(min = 0, max = 7)
public int initialPrivatePocketSize = 2;
@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;
@Name("Public Pocket Size")
@Comment({"Sets how deep a public pocket created in the overworld will be on average.",
"Pockets created at a deeper depth will have larger sizes."})
public int basePublicPocketSize = 1;
@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;
@Name("Load All Schematics")
@Comment({"Forces all available pocket schematics to load on game-start even if the configured maximum sizes mean that these",
"schematics will never be placed in any naturally generated pockets. This is meant for testing purposes,",
"because the /pocket command can be used to force generate these pockets."})
public boolean loadAllSchematics = true;
@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;
}
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("Rift Cluster Generation Chance")
@Comment("Sets the chance (out of 1.0) that a cluster of rifts will generate in a given chunk.")
@RangeDouble(min=0, max=1)
public double clusterGenerationChance = 0.0002;
@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;
@Name("Rift Cluster Dimension Type Blacklist")
@Comment({"Dimension Type Blacklist for the generation of Rift Clusters. Add a dimension ID here to prevent",
"generation in these dimensions."})
public int[] riftClusterDimensionTypeBlacklist = {};
@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;
@Name("Gateway Generation Chance")
@Comment("Sets the chance (out of 1.0) that a Rift Gateway will generate in a given chunk.")
@RangeDouble(min=0, max=1)
public double gatewayGenerationChance = 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: []"})
public int[] clusterDimBlacklist = {};
@Name("Gateway Dimension Type Blacklist")
@Comment({"Dimension Blacklist for the generation of Dimensional Gateways. Add a dimension ID here to prevent",
"generation in these dimensions."})
public int[] gatewayDimensionTypeBlacklist = {};
@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: []"})
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("Maximum Dungeon Depth")
@Comment("The depth at which limbo is located.")
@RangeInt(min = 1)
public int maxDungeonDepth = 100;
@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;
}
private final static boolean DANGEROUS_LIMBO_MONOLITHS_DEF = false;
private final static boolean MONOLITH_TELEPORTATION_DEF = true;
public static class Monoliths {
@Name("Dangerous Monoliths")
@Comment("Are Monoliths in Limbo Dangerous?")
public boolean dangerousLimboMonolithsEnabled = false;
@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;
@Name("Monolith Teleportation")
@Comment("Is Monolith Teleportation enabled?")
public boolean monolithTeleportationEnabled = true;
@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;
}
private final static boolean UNIVERSAL_LIMBO_DEF = false;
private final static boolean HARDCORE_LIMBO_DEF = false;
public static class Limbo {
@Name("Universal Limbo")
@Comment({"Sets whether players are teleported to Limbo when they die in any dimension (except Limbo).",
"Normally, players only go to Limbo if they die in a pocket dimension. This setting will not",
"affect deaths in Limbo, which can be set with the Hardcore Limbo option."})
public boolean universalLimboEnabled = false;
@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;
@Name("Hardcore Limbo")
@Comment({"Whether a player dying in limbo should respawn in limbo, making eternal fluid or gold dimensional doors",
"the only way to get out"})
public boolean hardcoreLimboEnabled = 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;
}
@SubscribeEvent

View file

@ -52,7 +52,7 @@ public class EntityMonolith extends EntityFlying implements IMob {
}
public boolean isDangerous() {
return ModConfig.monoliths.monolithTeleportationEnabled && (world.provider instanceof WorldProviderLimbo || ModConfig.monoliths.dangerousLimboMonolithsEnabled);
return ModConfig.monoliths.monolithTeleportation && (world.provider instanceof WorldProviderLimbo || ModConfig.monoliths.dangerousLimboMonoliths);
}
@Override
@ -146,7 +146,7 @@ public class EntityMonolith extends EntityFlying implements IMob {
}
// Teleport the target player if various conditions are met
if (aggro >= MAX_AGGRO && !world.isRemote && ModConfig.monoliths.monolithTeleportationEnabled && !player.isCreative() && isDangerous()) {
if (aggro >= MAX_AGGRO && !world.isRemote && ModConfig.monoliths.monolithTeleportation && !player.isCreative() && isDangerous()) {
aggro = 0;
Location destination = WorldProviderLimbo.getLimboSkySpawn(player);
TeleportUtils.teleport(player, destination, 0, 0);

View file

@ -270,11 +270,11 @@ public class SchematicHandler { // TODO: parts of this should be moved to the or
}
public PocketTemplate getPersonalPocketTemplate() {
return getRandomTemplate("private", -1, ModConfig.pockets.initialPrivatePocketSize, true);
return getRandomTemplate("private", -1, ModConfig.pockets.privatePocketSize, true);
}
public PocketTemplate getPublicPocketTemplate() {
return getRandomTemplate("public", -1, ModConfig.pockets.basePublicPocketSize, true);
return getRandomTemplate("public", -1, ModConfig.pockets.publicPocketSize, true);
}
public static void saveSchematic(Schematic schematic, String id) {

View file

@ -52,8 +52,8 @@ public class GatewayGenerator implements IWorldGenerator {
// Check if we're allowed to generate rift clusters in this dimension.
// If so, randomly decide whether to one.
boolean clusterGenerated = false;
if (Arrays.binarySearch(ModConfig.world.riftClusterDimensionTypeBlacklist, world.provider.getDimensionType().getId()) == -1) {
double clusterGenChance = ModConfig.world.clusterGenerationChance;
if (Arrays.binarySearch(ModConfig.world.clusterDimBlacklist, world.provider.getDimensionType().getId()) == -1) {
double clusterGenChance = ModConfig.world.clusterGenChance;
while (clusterGenChance > 0.0) {
if (random.nextDouble() < clusterGenChance) {
do {
@ -82,8 +82,8 @@ public class GatewayGenerator implements IWorldGenerator {
// Check if we can place a Rift Gateway in this dimension, then randomly decide whether to place one.
// This only happens if a rift cluster was NOT generated.
if (!clusterGenerated && Arrays.binarySearch(ModConfig.world.gatewayDimensionTypeBlacklist, world.provider.getDimensionType().getId()) == -1) {
double gatewayGenChance = ModConfig.world.gatewayGenerationChance;
if (!clusterGenerated && Arrays.binarySearch(ModConfig.world.gatewayDimBlacklist, world.provider.getDimensionType().getId()) == -1) {
double gatewayGenChance = ModConfig.world.gatewayGenChance;
while (gatewayGenChance > 0.0) {
if (random.nextDouble() < gatewayGenChance) {
valid = false;

View file

@ -42,7 +42,7 @@ public class WorldProviderLimbo extends WorldProvider {
@Override
public boolean canRespawnHere() {
return ModConfig.limbo.hardcoreLimboEnabled;
return ModConfig.limbo.hardcoreLimbo;
}
@Override