2013-05-31 08:17:05 +02:00
|
|
|
package StevenDimDoors.mod_pocketDim;
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
2013-06-16 15:57:51 +02:00
|
|
|
import StevenDimDoors.mod_pocketDim.world.LimboGenerator;
|
|
|
|
|
2013-05-31 08:17:05 +02:00
|
|
|
import net.minecraftforge.common.Configuration;
|
|
|
|
|
2013-06-13 06:48:21 +02:00
|
|
|
public class DDProperties
|
2013-05-31 08:17:05 +02:00
|
|
|
{
|
|
|
|
/**
|
2013-06-14 01:01:54 +02:00
|
|
|
* Block IDs
|
2013-05-31 08:17:05 +02:00
|
|
|
*/
|
2013-06-13 04:49:45 +02:00
|
|
|
|
2013-06-14 01:01:54 +02:00
|
|
|
public final int UnstableDoorID;
|
|
|
|
public final int DimensionalDoorID;
|
|
|
|
public final int WarpDoorID;
|
|
|
|
public final int TransTrapdoorID;
|
|
|
|
public final int TransientDoorID;
|
|
|
|
public final int FabricBlockID;
|
|
|
|
public final int RiftBlockID;
|
2013-06-13 04:49:45 +02:00
|
|
|
|
2013-05-31 08:17:05 +02:00
|
|
|
/**
|
2013-06-14 01:01:54 +02:00
|
|
|
* World Generation Block IDs
|
2013-05-31 08:17:05 +02:00
|
|
|
*/
|
|
|
|
|
2013-06-14 01:01:54 +02:00
|
|
|
public final int LimboBlockID;
|
|
|
|
public final int PermaFabricBlockID;
|
2013-06-13 04:49:45 +02:00
|
|
|
|
2013-05-31 08:17:05 +02:00
|
|
|
/**
|
2013-06-14 01:01:54 +02:00
|
|
|
* Item IDs
|
2013-05-31 08:17:05 +02:00
|
|
|
*/
|
2013-06-13 04:49:45 +02:00
|
|
|
|
2013-06-14 01:01:54 +02:00
|
|
|
public final int RiftBladeItemID;
|
|
|
|
public final int RiftSignatureItemID;
|
|
|
|
public final int RiftRemoverItemID;
|
|
|
|
public final int StableFabricItemID;
|
|
|
|
public final int StabilizedRiftSignatureItemID;
|
|
|
|
public final int DimensionalDoorItemID;
|
|
|
|
public final int UnstableDoorItemID;
|
|
|
|
public final int WarpDoorItemID;
|
2013-06-13 04:49:45 +02:00
|
|
|
|
2013-05-31 08:17:05 +02:00
|
|
|
/**
|
|
|
|
* Other IDs
|
|
|
|
*/
|
2013-06-13 04:49:45 +02:00
|
|
|
|
2013-06-14 01:01:54 +02:00
|
|
|
public final int LimboBiomeID;
|
|
|
|
public final int PocketBiomeID;
|
|
|
|
public final int LimboDimensionID;
|
|
|
|
public final int LimboProviderID;
|
|
|
|
public final int PocketProviderID;
|
|
|
|
public final int DoorRenderEntityID;
|
|
|
|
public final int MonolithEntityID;
|
2013-05-31 08:17:05 +02:00
|
|
|
|
|
|
|
/**
|
2013-06-14 01:01:54 +02:00
|
|
|
* Crafting Flags
|
2013-05-31 08:17:05 +02:00
|
|
|
*/
|
2013-06-14 01:01:54 +02:00
|
|
|
|
|
|
|
public final boolean CraftingDimensionaDoorAllowed;
|
|
|
|
public final boolean CraftingWarpDoorAllowed;
|
|
|
|
public final boolean CraftingRiftSignatureAllowed;
|
|
|
|
public final boolean CraftingRiftRemoverAllowed;
|
|
|
|
public final boolean CraftingUnstableDoorAllowed;
|
|
|
|
public final boolean CraftingRiftBladeAllowed;
|
|
|
|
public final boolean CraftingTransTrapdoorAllowed;
|
|
|
|
public final boolean CraftingStabilizedRiftSignatureAllowed;
|
|
|
|
public final boolean CraftingStableFabricAllowed;
|
2013-06-14 19:12:39 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Loot Flags
|
|
|
|
*/
|
|
|
|
|
|
|
|
public final boolean DimensionalDoorLootEnabled;
|
|
|
|
public final boolean WarpDoorLootEnabled;
|
|
|
|
public final boolean UnstableDoorLootEnabled;
|
|
|
|
public final boolean TransTrapdoorLootEnabled;
|
|
|
|
public final boolean RiftSignatureLootEnabled;
|
2013-06-14 21:22:22 +02:00
|
|
|
public final boolean RiftRemoverLootEnabled;
|
2013-06-14 19:12:39 +02:00
|
|
|
public final boolean StabilizedRiftSignatureLootEnabled;
|
|
|
|
public final boolean RiftBladeLootEnabled;
|
|
|
|
public final boolean StableFabricLootEnabled;
|
|
|
|
public final boolean FabricOfRealityLootEnabled;
|
2013-05-31 08:17:05 +02:00
|
|
|
|
|
|
|
/**
|
2013-06-14 01:01:54 +02:00
|
|
|
* Other Flags
|
2013-05-31 08:17:05 +02:00
|
|
|
*/
|
2013-06-13 04:49:45 +02:00
|
|
|
|
2013-06-14 01:01:54 +02:00
|
|
|
public final boolean WorldRiftGenerationEnabled;
|
|
|
|
public final boolean RiftSpreadEnabled;
|
|
|
|
public final boolean RiftGriefingEnabled;
|
|
|
|
public final boolean RiftsSpawnEndermenEnabled;
|
|
|
|
public final boolean LimboEnabled;
|
|
|
|
public final boolean HardcoreLimboEnabled;
|
|
|
|
public final boolean LimboReturnsInventoryEnabled;
|
|
|
|
public final boolean DoorRenderingEnabled;
|
|
|
|
public final boolean TNFREAKINGT_Enabled;
|
2013-06-19 05:04:36 +02:00
|
|
|
public final boolean RiftBladeRiftCreationEnabled;
|
2013-06-13 04:49:45 +02:00
|
|
|
|
2013-05-31 08:17:05 +02:00
|
|
|
/**
|
|
|
|
* Other
|
|
|
|
*/
|
|
|
|
|
2013-06-14 01:01:54 +02:00
|
|
|
public final int NonTntWeight;
|
|
|
|
public final int RiftSpreadModifier;
|
2013-06-16 15:57:51 +02:00
|
|
|
public final int ClusterGenerationChance;
|
|
|
|
public final int GatewayGenerationChance;
|
|
|
|
public final int MonolithSpawningChance;
|
2013-06-14 01:01:54 +02:00
|
|
|
public final int LimboReturnRange;
|
|
|
|
public final String CustomSchematicDirectory;
|
|
|
|
|
|
|
|
//Singleton instance
|
|
|
|
private static DDProperties instance = null;
|
|
|
|
//Path for custom dungeons within configuration directory
|
|
|
|
private final String CUSTOM_SCHEMATIC_SUBDIRECTORY = "/DimDoors_Custom_schematics";
|
|
|
|
//Names of categories
|
|
|
|
private final String CATEGORY_CRAFTING = "crafting";
|
|
|
|
private final String CATEGORY_ENTITY = "entity";
|
|
|
|
private final String CATEGORY_DIMENSION = "dimension";
|
|
|
|
private final String CATEGORY_PROVIDER = "provider";
|
|
|
|
private final String CATEGORY_BIOME = "biome";
|
2013-06-15 02:09:37 +02:00
|
|
|
private final String CATEGORY_LOOT = "loot";
|
2013-06-14 01:01:54 +02:00
|
|
|
|
|
|
|
private DDProperties(File configFile)
|
2013-05-31 08:17:05 +02:00
|
|
|
{
|
2013-06-14 01:01:54 +02:00
|
|
|
//Load the configuration. This must be done in the constructor, even though I'd rather have a separate
|
|
|
|
//function, because "blank final" variables must be initialized within the constructor.
|
|
|
|
|
|
|
|
CustomSchematicDirectory = configFile.getParent() + CUSTOM_SCHEMATIC_SUBDIRECTORY;
|
2013-05-31 08:17:05 +02:00
|
|
|
Configuration config = new Configuration(configFile);
|
2013-06-13 04:49:45 +02:00
|
|
|
config.load();
|
|
|
|
|
2013-06-14 19:12:39 +02:00
|
|
|
CraftingDimensionaDoorAllowed = config.get(CATEGORY_CRAFTING, "Allow Crafting Dimensional Door", true).getBoolean(true);
|
2013-06-14 01:01:54 +02:00
|
|
|
CraftingWarpDoorAllowed = config.get(CATEGORY_CRAFTING, "Allow Crafting Warp Door", true).getBoolean(true);
|
2013-06-14 19:12:39 +02:00
|
|
|
CraftingUnstableDoorAllowed = config.get(CATEGORY_CRAFTING, "Allow Crafting Unstable Door", true).getBoolean(true);
|
2013-06-14 01:01:54 +02:00
|
|
|
CraftingTransTrapdoorAllowed = config.get(CATEGORY_CRAFTING, "Allow Crafting Transdimensional Trapdoor", true).getBoolean(true);
|
|
|
|
CraftingRiftSignatureAllowed = config.get(CATEGORY_CRAFTING, "Allow Crafting Rift Signature", true).getBoolean(true);
|
|
|
|
CraftingRiftRemoverAllowed = config.get(CATEGORY_CRAFTING, "Allow Crafting Rift Remover", true).getBoolean(true);
|
|
|
|
CraftingStabilizedRiftSignatureAllowed = config.get(CATEGORY_CRAFTING, "Allow Crafting Stabilized Rift Signature", true).getBoolean(true);
|
|
|
|
CraftingRiftBladeAllowed = config.get(CATEGORY_CRAFTING, "Allow Crafting Rift Blade", true).getBoolean(true);
|
|
|
|
CraftingStableFabricAllowed = config.get(CATEGORY_CRAFTING, "Allow Crafting Stable Fabric", true).getBoolean(true);
|
2013-06-14 19:12:39 +02:00
|
|
|
|
2013-06-15 02:09:37 +02:00
|
|
|
DimensionalDoorLootEnabled = config.get(CATEGORY_LOOT, "Enable Dimensional Door Loot", true).getBoolean(true);
|
|
|
|
WarpDoorLootEnabled = config.get(CATEGORY_LOOT, "Enable Warp Door Loot", false).getBoolean(false);
|
|
|
|
UnstableDoorLootEnabled = config.get(CATEGORY_LOOT, "Enable Unstable Door Loot", false).getBoolean(false);
|
|
|
|
TransTrapdoorLootEnabled = config.get(CATEGORY_LOOT, "Enable Transdimensional Trapdoor Loot", false).getBoolean(false);
|
|
|
|
RiftSignatureLootEnabled = config.get(CATEGORY_LOOT, "Enable Rift Signature Loot", true).getBoolean(true);
|
|
|
|
RiftRemoverLootEnabled = config.get(CATEGORY_LOOT, "Enable Rift Remover Loot", true).getBoolean(true);
|
|
|
|
StabilizedRiftSignatureLootEnabled = config.get(CATEGORY_LOOT, "Enable Stabilized Rift Signature Loot", false).getBoolean(false);
|
|
|
|
RiftBladeLootEnabled = config.get(CATEGORY_LOOT, "Enable Rift Blade Loot", true).getBoolean(true);
|
|
|
|
StableFabricLootEnabled = config.get(CATEGORY_LOOT, "Enable Stable Fabric Loot", false).getBoolean(false);
|
|
|
|
FabricOfRealityLootEnabled = config.get(CATEGORY_LOOT, "Enable Fabric of Reality Loot", true).getBoolean(true);
|
2013-06-14 01:01:54 +02:00
|
|
|
|
|
|
|
RiftGriefingEnabled = config.get(Configuration.CATEGORY_GENERAL, "Enable Rift Griefing", true,
|
|
|
|
"Sets whether rifts destroy blocks around them or not").getBoolean(true);
|
|
|
|
RiftSpreadEnabled = config.get(Configuration.CATEGORY_GENERAL, "Enable Rift Spread", true,
|
|
|
|
"Sets whether rifts create more rifts when they are near other rifts").getBoolean(true);
|
|
|
|
RiftsSpawnEndermenEnabled = config.get(Configuration.CATEGORY_GENERAL, "Enable Endermen Spawning from Rifts", true,
|
|
|
|
"Sets whether groups of connected rifts will spawn Endermen").getBoolean(true);
|
|
|
|
|
|
|
|
LimboEnabled = config.get(Configuration.CATEGORY_GENERAL, "Enable Limbo", true,
|
|
|
|
"Sets whether the Limbo dimension is activated").getBoolean(true);
|
|
|
|
LimboReturnsInventoryEnabled = config.get(Configuration.CATEGORY_GENERAL, "Enable Limbo Returns Inventory", true,
|
|
|
|
"Sets whether players keep their inventories upon dying and respawning in Limbo").getBoolean(true);
|
|
|
|
HardcoreLimboEnabled = config.get(Configuration.CATEGORY_GENERAL, "Enable Hardcore Limbo", false,
|
|
|
|
"Sets whether players that die in Limbo will respawn there").getBoolean(false);
|
|
|
|
LimboReturnRange = config.get(Configuration.CATEGORY_GENERAL, "Limbo Return Range", 500,
|
|
|
|
"Sets the farthest distance that Limbo can send you upon returning to the Overworld").getInt();
|
|
|
|
DoorRenderingEnabled = config.get(Configuration.CATEGORY_GENERAL, "Enable Door Rendering", true).getBoolean(true);
|
2013-06-19 05:04:36 +02:00
|
|
|
RiftBladeRiftCreationEnabled = config.get(Configuration.CATEGORY_GENERAL, "Enable Rift Creation with Rift Blade", true,
|
|
|
|
"Sets whether Rift Blades can create new rifts. If set to false, " +
|
|
|
|
"they will only be able to create transient doors on existing rifts.").getBoolean(true);
|
2013-06-14 01:01:54 +02:00
|
|
|
|
|
|
|
TNFREAKINGT_Enabled = config.get(Configuration.CATEGORY_GENERAL, "EXPLOSIONS!!???!!!?!?!!", false).getBoolean(false);
|
|
|
|
NonTntWeight = config.get(Configuration.CATEGORY_GENERAL, "HOWMUCHTNT", 25,
|
|
|
|
"Weighs the chance that a block will not be TNT. Must be greater than or equal to 0. " +
|
|
|
|
"EXPLOSIONS must be set to true for this to have any effect.").getInt();
|
|
|
|
|
|
|
|
DoorRenderEntityID=config.get(CATEGORY_ENTITY, "Door Render Entity ID", 89).getInt();
|
|
|
|
MonolithEntityID = config.get(CATEGORY_ENTITY, "Monolith Entity ID", 125).getInt();
|
|
|
|
|
|
|
|
DimensionalDoorID = config.getBlock("Dimensional Door Block ID", 1970).getInt();
|
|
|
|
TransTrapdoorID = config.getBlock("Transdimensional Trapdoor Block ID", 1971).getInt();
|
|
|
|
FabricBlockID =config.getBlock("Fabric Of Reality Block ID", 1973).getInt();
|
|
|
|
WarpDoorID = config.getBlock("Warp Door Block ID", 1975).getInt();
|
|
|
|
RiftBlockID = config.getBlock("Rift Block ID", 1977).getInt();
|
|
|
|
UnstableDoorID = config.getBlock("Unstable Door Block ID", 1978).getInt();
|
|
|
|
TransientDoorID = config.getBlock("Transient Door Block ID", 1979).getInt();
|
|
|
|
|
|
|
|
WarpDoorItemID = config.getItem("Warp Door Item ID", 5670).getInt();
|
|
|
|
RiftRemoverItemID = config.getItem("Rift Remover Item ID", 5671).getInt();
|
|
|
|
StableFabricItemID = config.getItem("Stable Fabric Item ID", 5672).getInt();
|
|
|
|
UnstableDoorItemID = config.getItem("Unstable Door Item ID", 5673).getInt();
|
|
|
|
DimensionalDoorItemID = config.getItem("Dimensional Door Item ID", 5674).getInt();
|
|
|
|
RiftSignatureItemID = config.getItem("Rift Signature Item ID", 5675).getInt();
|
|
|
|
RiftBladeItemID = config.getItem("Rift Blade Item ID", 5676).getInt();
|
|
|
|
StabilizedRiftSignatureItemID = config.getItem("Stabilized Rift Signature Item ID", 5677).getInt();
|
|
|
|
|
|
|
|
LimboBlockID = config.getTerrainBlock("World Generation Block IDs - must be less than 256", "Limbo Block ID", 217,
|
|
|
|
"Blocks used for the terrain in Limbo").getInt();
|
|
|
|
PermaFabricBlockID = config.getTerrainBlock("World Generation Block IDs - must be less than 256",
|
|
|
|
"Perma Fabric Block ID", 220, "Blocks used for enclosing pocket dimensions").getInt();
|
|
|
|
|
|
|
|
LimboDimensionID = config.get(CATEGORY_DIMENSION, "Limbo Dimension ID", -23).getInt();
|
|
|
|
PocketProviderID = config.get(CATEGORY_PROVIDER, "Pocket Provider ID", 24).getInt();
|
|
|
|
LimboProviderID = config.get(CATEGORY_PROVIDER, "Limbo Provider ID", 13).getInt();
|
|
|
|
|
|
|
|
WorldRiftGenerationEnabled = config.get(Configuration.CATEGORY_GENERAL, "Enable Rift World Generation", true,
|
|
|
|
"Sets whether dungeon rifts generate in dimensions other than Limbo").getBoolean(true);
|
2013-06-16 08:59:02 +02:00
|
|
|
|
2013-06-16 15:57:51 +02:00
|
|
|
MonolithSpawningChance = config.get(Configuration.CATEGORY_GENERAL, "Monolith Spawning Chance", 28,
|
|
|
|
"Sets the chance (out of " + LimboGenerator.MAX_MONOLITH_SPAWNING_CHANCE + ") that Monoliths will " +
|
|
|
|
"spawn in a given Limbo chunk. The default chance is 28.").getInt();
|
2013-06-16 08:59:02 +02:00
|
|
|
|
2013-06-16 15:57:51 +02:00
|
|
|
ClusterGenerationChance = config.get(Configuration.CATEGORY_GENERAL, "Cluster Generation Chance", 3,
|
|
|
|
"Sets the chance (out of " + RiftGenerator.MAX_CLUSTER_GENERATION_CHANCE + ") that a cluster of rifts will " +
|
|
|
|
"generate in a given chunk. The default chance is 3.").getInt();
|
2013-06-14 01:01:54 +02:00
|
|
|
|
2013-06-16 15:57:51 +02:00
|
|
|
GatewayGenerationChance = config.get(Configuration.CATEGORY_GENERAL, "Gateway Generation Chance", 40,
|
|
|
|
"Sets the chance (out of " + RiftGenerator.MAX_GATEWAY_GENERATION_CHANCE + ") that a Rift Gateway will " +
|
|
|
|
"generate in a given chunk. The default chance is 40.").getInt();
|
|
|
|
|
2013-06-14 01:01:54 +02:00
|
|
|
RiftSpreadModifier = config.get(Configuration.CATEGORY_GENERAL, "Rift Spread Modifier", 3,
|
|
|
|
"Sets the number of times a rift can spread. 0 prevents rifts from spreading at all. " +
|
|
|
|
"A value greater than 5 is not recommended as the growth is exponential.").getInt();
|
|
|
|
|
|
|
|
LimboBiomeID = config.get(CATEGORY_BIOME, "Limbo Biome ID", 251).getInt();
|
|
|
|
PocketBiomeID = config.get(CATEGORY_BIOME, "Pocket Biome ID", 250).getInt();
|
2013-06-13 04:49:45 +02:00
|
|
|
|
2013-05-31 08:17:05 +02:00
|
|
|
config.save();
|
2013-06-13 04:49:45 +02:00
|
|
|
}
|
2013-06-14 01:01:54 +02:00
|
|
|
|
2013-06-16 18:06:21 +02:00
|
|
|
public static DDProperties initialize(File configFile)
|
2013-06-14 01:01:54 +02:00
|
|
|
{
|
|
|
|
if (instance == null)
|
|
|
|
instance = new DDProperties(configFile);
|
|
|
|
else
|
2013-06-16 18:06:21 +02:00
|
|
|
throw new IllegalStateException("Cannot initialize DDProperties twice");
|
2013-06-14 01:01:54 +02:00
|
|
|
|
|
|
|
return instance;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static DDProperties instance()
|
|
|
|
{
|
|
|
|
if (instance == null)
|
|
|
|
{
|
|
|
|
//This is to prevent some frustrating bugs that could arise when classes
|
|
|
|
//are loaded in the wrong order. Trust me, I had to squash a few...
|
2013-06-16 18:06:21 +02:00
|
|
|
throw new IllegalStateException("Instance of DDProperties requested before initialization");
|
2013-06-14 01:01:54 +02:00
|
|
|
}
|
|
|
|
return instance;
|
|
|
|
}
|
2013-05-31 08:17:05 +02:00
|
|
|
}
|