Moved undergroundbiomes to seperate file

This commit is contained in:
Francesco Macagno 2015-09-08 10:56:57 -07:00
parent f4b81c24a0
commit 3a2005c436
3 changed files with 190 additions and 213 deletions

View file

@ -37,11 +37,11 @@ public class WarpDriveConfig {
private static DocumentBuilder xmlDocumentBuilder;
private static final String[] defaultXMLfilenames = {
// fillers
"filler-default.xml", "filler-netherores.xml",
"filler-default.xml", "filler-netherores.xml", "filler-undergroundbiomes.xml",
// structures
"structures-default.xml", "structures-netherores.xml",
};
/*
* The variables which store whether or not individual mods are loaded
*/
@ -53,22 +53,22 @@ public class WarpDriveConfig {
public static boolean isComputerCraftLoaded = false;
public static boolean isOpenComputersLoaded = false;
public static boolean isThermalExpansionLoaded = false;
// ForgeMultipart (microblocks) support
public static Method forgeMultipart_helper_createTileFromNBT = null;
public static Method forgeMultipart_helper_sendDescPacket = null;
public static Method forgeMultipart_tileMultipart_onChunkLoad = null;
public static ItemStack IC2_compressedAir;
public static ItemStack IC2_emptyCell;
public static Block IC2_rubberWood;
public static ItemStack IC2_Resin;
public static Block CC_Computer, CC_peripheral, CCT_Turtle, CCT_Expanded, CCT_Advanced;
public static ItemStack GT_Ores, GT_Granite, GT_Machine;
public static int AS_Turbine, AS_deuteriumCell;
public static int ICBM_Machine, ICBM_Missile, ICBM_Explosive;
// Mod configuration (see loadWarpDriveConfig() for comments/definitions)
// General
public static int G_SPACE_BIOME_ID = 95;
@ -81,19 +81,19 @@ public class WarpDriveConfig {
public static int G_ENTITY_SPHERE_GENERATOR_ID = 241;
public static int G_ENTITY_STAR_CORE_ID = 242;
public static int G_ENTITY_CAMERA_ID = 243;
public static final int LUA_SCRIPTS_NONE = 0;
public static final int LUA_SCRIPTS_TEMPLATES = 1;
public static final int LUA_SCRIPTS_ALL = 2;
public static int G_LUA_SCRIPTS = LUA_SCRIPTS_ALL;
public static String G_SCHEMALOCATION = "warpDrive_schematics";
public static int G_BLOCKS_PER_TICK = 3500;
public static boolean RECIPES_ENABLE_IC2 = true;
public static boolean RECIPES_ENABLE_HARD_IC2 = false;
public static boolean RECIPES_ENABLE_VANILLA = false;
public static boolean RECIPES_ENABLE_MIXED = false;
// Logging
public static boolean LOGGING_JUMP = false;
public static boolean LOGGING_JUMPBLOCKS = false;
@ -112,10 +112,10 @@ public class WarpDriveConfig {
public static boolean LOGGING_BREATHING = false;
public static boolean LOGGING_WORLDGEN = false;
public static boolean LOGGING_PROFILING = true;
// Planets
public static Planet[] PLANETS = null;
// Ship
public static int SHIP_MAX_ENERGY_STORED = 100000000;
public static int SHIP_NORMALJUMP_ENERGY_PER_BLOCK = 10;
@ -138,12 +138,12 @@ public class WarpDriveConfig {
public static int SHIP_CORE_ISOLATION_UPDATE_INTERVAL_SECONDS = 10;
public static String[] SHIP_VOLUME_UNLIMITED_PLAYERNAMES = { "notch", "someone" };
public static boolean SHIP_WARMUP_SICKNESS = true;
// Tagged blocks and entities (loaded from configuration file at PreInit, parsed at PostInit)
private static HashMap<String, String> taggedBlocks = null;
private static HashMap<String, String> taggedEntities = null;
private static HashMap<String, String> taggedItems = null;
// Blocks dictionary
public static HashSet<Block> BLOCKS_ORES;
public static HashSet<Block> BLOCKS_LOGS;
@ -155,18 +155,18 @@ public class WarpDriveConfig {
public static HashSet<Block> BLOCKS_MINING = null;
public static HashSet<Block> BLOCKS_NOMINING = null;
public static HashMap<Block, Integer> BLOCKS_PLACE = null;
// Entities dictionary
public static HashSet<String> ENTITIES_ANCHOR = null;
public static HashSet<String> ENTITIES_NOMASS = null;
public static HashSet<String> ENTITIES_LEFTBEHIND = null;
public static HashSet<String> ENTITIES_NONLIVINGTARGET = null;
// Items dictionary
public static HashSet<Item> ITEMS_FLYINSPACE = null;
public static HashSet<Item> ITEMS_NOFALLDAMAGE = null;
public static HashSet<Item> ITEMS_BREATHINGIC2 = null;
// Radar
public static int RADAR_MAX_ENERGY_STORED = 100000000; // 100kk eU
public static int RADAR_MAX_ISOLATION_RANGE = 2;
@ -174,46 +174,46 @@ public class WarpDriveConfig {
public static int RADAR_MAX_ISOLATION_BLOCKS = 132;
public static double RADAR_MIN_ISOLATION_EFFECT = 0.12;
public static double RADAR_MAX_ISOLATION_EFFECT = 1.00;
// Ship Scanner
public static int SS_MAX_ENERGY_STORED = 500000000;
public static int SS_ENERGY_PER_BLOCK_SCAN = 100; // eU per block of ship volume
// (including air)
public static int SS_ENERGY_PER_BLOCK_DEPLOY = 5000;
public static int SS_MAX_DEPLOY_RADIUS_BLOCKS = 50;
// Laser medium
public static int LASER_MEDIUM_MAX_ENERGY_STORED = 100000;
// Laser Emitter
public static int LASER_CANNON_MAX_MEDIUMS_COUNT = 10;
public static int LASER_CANNON_MAX_LASER_ENERGY = 4000000;
public static int LASER_CANNON_EMIT_FIRE_DELAY_TICKS = 5;
public static int LASER_CANNON_EMIT_SCAN_DELAY_TICKS = 1;
public static double LASER_CANNON_BOOSTER_BEAM_ENERGY_EFFICIENCY = 0.60D;
public static int LASER_CANNON_RANGE_ENERGY_PER_BLOCK = 5000;
public static int LASER_CANNON_RANGE_MAX = 500;
public static int LASER_CANNON_ENERGY_LOSS_PER_BLOCK = 500;
public static int LASER_CANNON_ENTITY_HIT_SET_ON_FIRE_SECONDS = 20;
public static int LASER_CANNON_ENTITY_HIT_ENERGY = 15000;
public static int LASER_CANNON_ENTITY_HIT_BASE_DAMAGE = 3;
public static int LASER_CANNON_ENTITY_HIT_ENERGY_PER_DAMAGE = 30000;
public static int LASER_CANNON_ENTITY_HIT_MAX_DAMAGE = 100;
public static int LASER_CANNON_ENTITY_HIT_ENERGY_THRESHOLD_FOR_EXPLOSION = 1000000;
public static float LASER_CANNON_ENTITY_HIT_EXPLOSION_BASE_STRENGTH = 4.0F;
public static int LASER_CANNON_ENTITY_HIT_EXPLOSION_ENERGY_PER_STRENGTH = 125000;
public static float LASER_CANNON_ENTITY_HIT_EXPLOSION_MAX_STRENGTH = 4.0F;
public static int LASER_CANNON_BLOCK_HIT_ENERGY = 70000;
public static int LASER_CANNON_BLOCK_HIT_ENERGY_PER_BLOCK_RESISTANCE = 1000;
public static double LASER_CANNON_BLOCK_HIT_EXPLOSION_RESISTANCE_THRESHOLD = 1200.0D; // obsidian is 2000 * 3 / 5 = 1200
public static float LASER_CANNON_BLOCK_HIT_EXPLOSION_BASE_STRENGTH = 8.0F;
public static int LASER_CANNON_BLOCK_HIT_EXPLOSION_ENERGY_PER_STRENGTH = 125000;
public static float LASER_CANNON_BLOCK_HIT_EXPLOSION_MAX_STRENGTH = 100F;
// Mining laser
// BuildCraft quarry values for reference
// - harvesting one block is 60 MJ/block = 600 RF/block = ~145 EU/block
@ -241,11 +241,11 @@ public class WarpDriveConfig {
public static double MINING_LASER_SILKTOUCH_ENERGY_FACTOR = 1.5;
public static double MINING_LASER_SILKTOUCH_DEUTERIUM_L = 1.0;
public static double MINING_LASER_FORTUNE_ENERGY_FACTOR = 1.5;
// Tree farm
public static int TREE_FARM_MIN_RADIUS = 5;
public static int TREE_FARM_MAX_RADIUS = 16;
// Cloaking
public static int CLOAKING_MAX_ENERGY_STORED = 500000000;
public static int CLOAKING_COIL_CAPTURE_BLOCKS = 5;
@ -253,43 +253,43 @@ public class WarpDriveConfig {
public static int CLOAKING_TIER1_ENERGY_PER_BLOCK = 32;
public static int CLOAKING_TIER2_ENERGY_PER_BLOCK = 128;
public static int CLOAKING_FIELD_REFRESH_INTERVAL_SECONDS = 3;
// Air generator
public static int AIRGEN_ENERGY_PER_CANISTER = 20;
public static int AIRGEN_ENERGY_PER_NEWAIRBLOCK = 12;
public static int AIRGEN_ENERGY_PER_EXISTINGAIRBLOCK = 4;
public static int AIRGEN_MAX_ENERGY_STORED = 4000;
public static int AIRGEN_AIR_GENERATION_TICKS = 40;
// IC2 Reactor monitor
public static int IC2_REACTOR_MAX_ENERGY_STORED = 1000000;
public static double IC2_REACTOR_ENERGY_PER_HEAT = 2;
public static int IC2_REACTOR_COOLING_INTERVAL_TICKS = 10;
// Transporter
public static int TRANSPORTER_MAX_ENERGY = 1000000;
public static boolean TRANSPORTER_USE_RELATIVE_COORDS = true;
public static double TRANSPORTER_ENERGY_PER_BLOCK = 100.0;
public static double TRANSPORTER_MAX_BOOST_MUL = 4.0;
// Enantiomorphic power reactor
public static int ENAN_REACTOR_MAX_ENERGY_STORED = 100000000;
public static int ENAN_REACTOR_UPDATE_INTERVAL_TICKS = 5;
public static int ENAN_REACTOR_MAX_LASERS_PER_SECOND = 6;
// Power store
public static int ENERGY_BANK_MAX_ENERGY_STORED = 1000000;
// Laser lift
public static int LIFT_MAX_ENERGY_STORED = 2400;
public static int LIFT_ENERGY_PER_ENTITY = 800;
public static int LIFT_UPDATE_INTERVAL_TICKS = 10;
// Chunk loader
public static int CL_MAX_ENERGY = 1000000;
public static int CL_MAX_DISTANCE = 2;
public static int CL_RF_PER_CHUNKTICK = 320;
public static Block getModBlock(final String mod, final String id) {
try {
return GameRegistry.findBlock(mod, id);
@ -299,7 +299,7 @@ public class WarpDriveConfig {
}
return null;
}
public static ItemStack getModItemStack(final String mod, final String id, final int meta) {
try {
ItemStack item = new ItemStack((Item) Item.itemRegistry.getObject(mod + ":" + id));
@ -311,8 +311,8 @@ public class WarpDriveConfig {
WarpDrive.logger.info("Failed to get mod item for " + mod + ":" + id + "@" + meta);
}
return null;
}
}
public static void onFMLpreInitialization(final String stringConfigDirectory) {
// create mod folder
configDirectory = new File(stringConfigDirectory, WarpDrive.MODID);
@ -320,15 +320,15 @@ public class WarpDriveConfig {
if (!configDirectory.isDirectory()) {
throw new RuntimeException("Unable to create config directory " + configDirectory);
}
// read configuration file
loadWarpDriveConfig(new File(configDirectory, WarpDrive.MODID + ".cfg"));
}
public static void loadWarpDriveConfig(File file) {
Configuration config = new Configuration(file);
config.load();
// General
G_SPACE_BIOME_ID = clamp(Integer.MIN_VALUE, Integer.MAX_VALUE,
config.get("general", "space_biome_id", G_SPACE_BIOME_ID, "Space biome ID").getInt());
@ -343,7 +343,7 @@ public class WarpDriveConfig {
G_SPACE_WORLDBORDER_BLOCKS = clamp(0, 3000000,
config.get("general", "space_worldborder_blocks", G_SPACE_WORLDBORDER_BLOCKS,
"World border applied to hyperspace & space, set to 0 to disable it").getInt());
G_ENTITY_JUMP_ID = clamp(Integer.MIN_VALUE, Integer.MAX_VALUE,
config.get("general", "entity_jump_id", G_ENTITY_JUMP_ID, "Entity jump ID").getInt());
G_ENTITY_SPHERE_GENERATOR_ID = clamp(Integer.MIN_VALUE, Integer.MAX_VALUE,
@ -352,7 +352,7 @@ public class WarpDriveConfig {
config.get("general", "entity_star_core_id", G_ENTITY_STAR_CORE_ID, "Entity star core ID").getInt());
G_ENTITY_CAMERA_ID = clamp(Integer.MIN_VALUE, Integer.MAX_VALUE,
config.get("general", "entity_camera_id", G_ENTITY_CAMERA_ID, "Entity camera ID").getInt());
G_LUA_SCRIPTS = clamp(0, 2,
config.get("general", "lua_scripts", G_LUA_SCRIPTS,
"LUA scripts to load when connecting machines: 0 = none, 1 = templates in a subfolder, 2 = ready to roll (templates are still provided)").getInt());
@ -360,14 +360,14 @@ public class WarpDriveConfig {
G_BLOCKS_PER_TICK = clamp(100, 100000,
config.get("general", "blocks_per_tick", G_BLOCKS_PER_TICK,
"Number of blocks to move per ticks, too high will cause lag spikes on ship jumping or deployment, too low may break the ship wirings").getInt());
// Recipes
RECIPES_ENABLE_VANILLA = config.get("recipes", "enable_vanilla", RECIPES_ENABLE_VANILLA, "Vanilla recipes by DarkholmeTenk").getBoolean(false);
RECIPES_ENABLE_IC2 = config.get("recipes", "enable_ic2", RECIPES_ENABLE_IC2, "Original recipes based on IndustrialCrat2 by Cr0s").getBoolean(true);
RECIPES_ENABLE_HARD_IC2 = config.get("recipes", "enable_hard_ic2", RECIPES_ENABLE_HARD_IC2, "Harder recipes based on IC2 by YuRaNnNzZZ").getBoolean(false);
RECIPES_ENABLE_MIXED = config.get("recipes", "enable_mixed", RECIPES_ENABLE_MIXED,
"Mixed recipes for Lem'ADEC's packs (currently requires at least AppliedEnergistics, Extracells, AtomicScience, IndustrialCraft2, GraviSuite and ThermalExpansion").getBoolean(false);
// Logging
LOGGING_JUMP = config.get("logging", "enable_jump_logs", LOGGING_JUMP, "Basic jump logs, should always be enabled").getBoolean(true);
LOGGING_JUMPBLOCKS = config.get("logging", "enable_jumpblocks_logs", LOGGING_JUMPBLOCKS, "Detailled jump logs to help debug the mod, will spam your logs...").getBoolean(false);
@ -393,19 +393,19 @@ public class WarpDriveConfig {
LOGGING_BREATHING = config.get("logging", "enable_breathing_logs", LOGGING_BREATHING, "Detailled breathing logs to help debug the mod, enable it before reporting a bug").getBoolean(false);
LOGGING_WORLDGEN = config.get("logging", "enable_worldgen_logs", LOGGING_WORLDGEN, "Detailled world generation logs to help debug the mod, enable it before reporting a bug").getBoolean(false);
LOGGING_PROFILING = config.get("logging", "enable_profiling_logs", LOGGING_PROFILING, "Profiling logs, enable it to check for lag").getBoolean(true);
// Planets
{
config.addCustomCategoryComment("planets",
"Planets are other dimensions connected through the Space dimension. Default is overworld with 100k radius.\n"
+ "Each planet orbit is square shaped and defined as a list of 7 integers (all measured in blocks).");
ConfigCategory categoryPlanets = config.getCategory("planets");
String[] planetsName = categoryPlanets.getValues().keySet().toArray(new String[0]);
if (planetsName.length == 0) {
planetsName = new String[] { "overworld" };
}
int[] defaultPlanet = { 0, 0, 0, 100000, 100000, 0, 0 }; // 30000000 is Minecraft limit for SetBlock
PLANETS = new Planet[planetsName.length];
int index = 0;
@ -424,7 +424,7 @@ public class WarpDriveConfig {
// FIXME: check planets aren't overlapping
// We're not checking invalid dimension id, so they can be pre-allocated (see MystCraft)
}
// Ship
SHIP_MAX_ENERGY_STORED = clamp(0, Integer.MAX_VALUE,
config.get("ship", "max_energy_stored", SHIP_MAX_ENERGY_STORED, "Maximum energy storage").getInt());
@ -438,10 +438,10 @@ public class WarpDriveConfig {
config.get("ship", "hyperjump_energy_per_block", SHIP_HYPERJUMP_ENERGY_PER_BLOCK).getInt());
SHIP_TELEPORT_ENERGY_PER_ENTITY = clamp(0, Integer.MAX_VALUE,
config.get("ship", "teleport_energy_per_entity", SHIP_TELEPORT_ENERGY_PER_ENTITY).getInt());
SHIP_MAX_JUMP_DISTANCE = clamp(0, 30000000,
config.get("ship", "max_jump_distance", SHIP_MAX_JUMP_DISTANCE, "Maximum jump length value in blocks").getInt());
SHIP_VOLUME_MAX_ON_PLANET_SURFACE = clamp(0, 10000000,
config.get("ship", "volume_max_on_planet_surface", SHIP_VOLUME_MAX_ON_PLANET_SURFACE,
"Maximum ship mass (in blocks) to jump on earth").getInt());
@ -450,14 +450,14 @@ public class WarpDriveConfig {
"Minimum ship mass (in blocks) to enter or exit hyperspace without a jumpgate").getInt());
SHIP_VOLUME_UNLIMITED_PLAYERNAMES = config.get("ship", "volume_unlimited_playernames", SHIP_VOLUME_UNLIMITED_PLAYERNAMES,
"List of player names which have unlimited block counts to their ship").getStringList();
SHIP_MAX_SIDE_SIZE = clamp(0, 30000000,
config.get("ship", "max_side_size", SHIP_MAX_SIDE_SIZE, "Maximum ship size on each axis in blocks").getInt());
SHIP_COLLISION_TOLERANCE_BLOCKS = clamp(0, 30000000,
config.get("ship", "collision_tolerance_blocks", SHIP_COLLISION_TOLERANCE_BLOCKS, "Tolerance in block in case of collision before causing damages...").getInt());
SHIP_COOLDOWN_INTERVAL_SECONDS = clamp(0, 3600,
config.get("ship", "cooldown_interval_seconds", SHIP_COOLDOWN_INTERVAL_SECONDS, "Cooldown seconds to wait after jumping").getInt());
SHIP_SHORTJUMP_THRESHOLD_BLOCKS = clamp(0, 30000000,
config.get("ship", "shortjump_threhold_blocs", SHIP_SHORTJUMP_THRESHOLD_BLOCKS, "Short jump definition").getInt());
SHIP_SHORTJUMP_WARMUP_SECONDS = clamp(0, 3600,
@ -467,35 +467,35 @@ public class WarpDriveConfig {
SHIP_WARMUP_RANDOM_TICKS = clamp(10, 200,
config.get("ship", "warmup_random_ticks", SHIP_WARMUP_RANDOM_TICKS, "Random variation added to warmup (measured in ticks)").getInt());
SHIP_WARMUP_SICKNESS = config.get("ship", "warmup_sickness", true, "Enable warp sickness during warmup").getBoolean(true);
SHIP_CORE_REGISTRY_UPDATE_INTERVAL_SECONDS = clamp(0, 300,
config.get("ship", "core_registry_update_interval", SHIP_CORE_REGISTRY_UPDATE_INTERVAL_SECONDS, "(measured in seconds)").getInt());
SHIP_CORE_ISOLATION_UPDATE_INTERVAL_SECONDS = clamp(0, 300,
config.get("ship", "core_isolation_update_interval", SHIP_CORE_ISOLATION_UPDATE_INTERVAL_SECONDS, "(measured in seconds)").getInt());
SHIP_CONTROLLER_UPDATE_INTERVAL_SECONDS = clamp(0, 300,
config.get("ship", "controller_update_interval", SHIP_CONTROLLER_UPDATE_INTERVAL_SECONDS, "(measured in seconds)").getInt());
// Block dictionary
{
config.addCustomCategoryComment("block_tags",
"Use this section to enable special behavior on blocks using tags.\n"
+ "Most blocks are already supported automatically. Only modify this section when something doesn't work!\n"
+ "\n"
+ "Tags shall be separated by at least one space, comma or tabulation.\n"
+ "Invalid tags will be ignored silently. Tags and block names are case sensitive.\n"
+ "In case of conflicts, the latest tag overwrite the previous ones.\n"
+ "- Anchor: ship can't move with this block aboard (default: bedrock and assimilated).\n"
+ "- NoMass: this block doesn't count when calculating ship volume/mass (default: leaves, all 'air' blocks).\n"
+ "- LeftBehind: this block won't move with your ship (default: RailCraft heat, WarpDrive gases).\n"
+ "- Expandable: this block will be squished/ignored in case of collision.\n"
+ "- Mining: this block is mineable (default: all 'ore' blocks from the ore dictionnary).\n"
+ "- NoMining: this block is non-mineable (default: forcefields).\n"
+ "- PlaceEarliest: this block will be removed last and placed first (default: ship hull and projectors).\n"
+ "- PlaceEarlier: this block will be placed fairly soon (default: forcefield blocks).\n"
+ "- PlaceNormal: this block will be removed and placed with non-tile entities.\n"
+ "- PlaceLater: this block will be placed fairly late (default: IC2 Reactor core).\n"
+ "- PlaceLatest: this block will be removed first and placed last (default: IC2 Reactor chamber).");
"Use this section to enable special behavior on blocks using tags.\n"
+ "Most blocks are already supported automatically. Only modify this section when something doesn't work!\n"
+ "\n"
+ "Tags shall be separated by at least one space, comma or tabulation.\n"
+ "Invalid tags will be ignored silently. Tags and block names are case sensitive.\n"
+ "In case of conflicts, the latest tag overwrite the previous ones.\n"
+ "- Anchor: ship can't move with this block aboard (default: bedrock and assimilated).\n"
+ "- NoMass: this block doesn't count when calculating ship volume/mass (default: leaves, all 'air' blocks).\n"
+ "- LeftBehind: this block won't move with your ship (default: RailCraft heat, WarpDrive gases).\n"
+ "- Expandable: this block will be squished/ignored in case of collision.\n"
+ "- Mining: this block is mineable (default: all 'ore' blocks from the ore dictionnary).\n"
+ "- NoMining: this block is non-mineable (default: forcefields).\n"
+ "- PlaceEarliest: this block will be removed last and placed first (default: ship hull and projectors).\n"
+ "- PlaceEarlier: this block will be placed fairly soon (default: forcefield blocks).\n"
+ "- PlaceNormal: this block will be removed and placed with non-tile entities.\n"
+ "- PlaceLater: this block will be placed fairly late (default: IC2 Reactor core).\n"
+ "- PlaceLatest: this block will be removed first and placed last (default: IC2 Reactor chamber).");
ConfigCategory categoryBlockTags = config.getCategory("block_tags");
String[] taggedBlocksName = categoryBlockTags.getValues().keySet().toArray(new String[0]);
if (taggedBlocksName.length == 0) {
@ -505,7 +505,7 @@ public class WarpDriveConfig {
config.get("block_tags", "Artifacts:invisible_bedrock" , "Anchor NoMining" ).getString();
config.get("block_tags", "Artifacts:anti_anti_builder_stone", "Anchor NoMining" ).getString();
config.get("block_tags", "Artifacts:anti_builder" , "Anchor NoMining" ).getString();
// placement priorities
config.get("block_tags", "IC2:blockReinforcedFoam" , "PlaceEarliest NoMining" ).getString();
config.get("block_tags", "IC2:blockAlloy" , "PlaceEarliest NoMining" ).getString();
@ -515,20 +515,20 @@ public class WarpDriveConfig {
// FIXME config.get("block_tags", "MFFS:field" , "PlaceEarlier NoMining" ).getString();
config.get("block_tags", "IC2:blockGenerator" , "PlaceLater" ).getString();
config.get("block_tags", "IC2:blockReactorChamber" , "PlaceLatest" ).getString();
// expandables, a.k.a. "don't blow my ship with this..."
config.get("block_tags", "WarpDrive:blockGas" , "LeftBehind Expandable" ).getString();
config.get("block_tags", "Railcraft:residual.heat" , "LeftBehind Expandable" ).getString();
config.get("block_tags", "InvisibLights:blockLightSource" , "NoMass Expandable" ).getString();
config.get("block_tags", "WarpDrive:blockAir" , "NoMass Expandable PlaceLatest" ).getString();
// mining a mineshaft...
config.get("block_tags", "minecraft:web" , "Mining" ).getString();
config.get("block_tags", "minecraft:fence" , "Mining" ).getString();
config.get("block_tags", "minecraft:torch" , "Mining" ).getString();
config.get("block_tags", "minecraft:glowstone" , "Mining" ).getString();
config.get("block_tags", "minecraft:redstone_block" , "Mining" ).getString();
// mining an 'end' moon
config.get("block_tags", "WarpDrive:blockIridium" , "Mining" ).getString(); // stronger than obsidian but can still be mined (see ender moon)
taggedBlocksName = categoryBlockTags.getValues().keySet().toArray(new String[0]);
@ -539,21 +539,21 @@ public class WarpDriveConfig {
taggedBlocks.put(name, tags);
}
}
// Entity dictionary
{
config.addCustomCategoryComment("entity_tags",
"Use this section to enable special behavior on entities using tags.\n"
+ "Most entities are already supported automatically. Only modify this section when something doesn't work!\n"
+ "\n"
+ "Tags shall be separated by at least one space, comma or tabulation.\n"
+ "Invalid tags will be ignored silently. Tags and block names are case sensitive.\n"
+ "In case of conflicts, the latest tag overwrite the previous ones.\n"
+ "- Anchor: ship can't move with this entity aboard (default: none).\n"
+ "- NoMass: this entity doesn't count when calculating ship volume/mass (default: Galacticraft air bubble).\n"
+ "- LeftBehind: this entity won't move with your ship (default: Galacticraft air bubble).\n"
+ "- NonLivingTarget: this non-living entity can be targeted/removed by weapons (default: ItemFrame, Painting).");
"Use this section to enable special behavior on entities using tags.\n"
+ "Most entities are already supported automatically. Only modify this section when something doesn't work!\n"
+ "\n"
+ "Tags shall be separated by at least one space, comma or tabulation.\n"
+ "Invalid tags will be ignored silently. Tags and block names are case sensitive.\n"
+ "In case of conflicts, the latest tag overwrite the previous ones.\n"
+ "- Anchor: ship can't move with this entity aboard (default: none).\n"
+ "- NoMass: this entity doesn't count when calculating ship volume/mass (default: Galacticraft air bubble).\n"
+ "- LeftBehind: this entity won't move with your ship (default: Galacticraft air bubble).\n"
+ "- NonLivingTarget: this non-living entity can be targeted/removed by weapons (default: ItemFrame, Painting).");
ConfigCategory categoryEntityTags = config.getCategory("entity_tags");
String[] taggedEntitiesName = categoryEntityTags.getValues().keySet().toArray(new String[0]);
if (taggedEntitiesName.length == 0) {
@ -569,7 +569,7 @@ public class WarpDriveConfig {
config.get("entity_tags", "MinecartHopper" , "NoMass NonLivingTarget" ).getString();
config.get("entity_tags", "MinecartSpawner" , "NoMass NonLivingTarget" ).getString();
config.get("entity_tags", "EnderCrystal" , "NoMass NonLivingTarget" ).getString();
config.get("entity_tags", "IC2.BoatCarbon" , "NoMass NonLivingTarget" ).getString();
config.get("entity_tags", "IC2.BoatRubber" , "NoMass NonLivingTarget" ).getString();
config.get("entity_tags", "IC2.BoatElectric" , "NoMass NonLivingTarget" ).getString();
@ -585,20 +585,20 @@ public class WarpDriveConfig {
taggedEntities.put(name, tags);
}
}
// Item dictionary
{
config.addCustomCategoryComment("item_tags",
"Use this section to enable special behavior on items using tags.\n"
+ "Most items are already supported automatically. Only modify this section when something doesn't work!\n"
+ "\n"
+ "Tags shall be separated by at least one space, comma or tabulation.\n"
+ "Invalid tags will be ignored silently. Tags and block names are case sensitive.\n"
+ "In case of conflicts, the latest tag overwrite the previous ones.\n"
+ "- FlyInSpace: player can move without gravity effect while wearing this item (default: jetpacks).\n"
+ "- NoFallDamage: player doesn't take fall damage while wearing this armor item (default: IC2 rubber boots).\n"
+ "- BreathingIC2: player can breath IC2 compressed air while wearing this armor item (default: IC2 nano helmet and Cie).\n");
"Use this section to enable special behavior on items using tags.\n"
+ "Most items are already supported automatically. Only modify this section when something doesn't work!\n"
+ "\n"
+ "Tags shall be separated by at least one space, comma or tabulation.\n"
+ "Invalid tags will be ignored silently. Tags and block names are case sensitive.\n"
+ "In case of conflicts, the latest tag overwrite the previous ones.\n"
+ "- FlyInSpace: player can move without gravity effect while wearing this item (default: jetpacks).\n"
+ "- NoFallDamage: player doesn't take fall damage while wearing this armor item (default: IC2 rubber boots).\n"
+ "- BreathingIC2: player can breath IC2 compressed air while wearing this armor item (default: IC2 nano helmet and Cie).\n");
ConfigCategory categoryItemTags = config.getCategory("item_tags");
String[] taggedItemsName = categoryItemTags.getValues().keySet().toArray(new String[0]);
if (taggedItemsName.length == 0) {
@ -609,13 +609,13 @@ public class WarpDriveConfig {
config.get("item_tags", "AdvancedSolarPanel:advanced_solar_helmet" , "BreathingIC2" ).getString();
config.get("item_tags", "AdvancedSolarPanel:hybrid_solar_helmet" , "BreathingIC2" ).getString();
config.get("item_tags", "AdvancedSolarPanel:ultimate_solar_helmet" , "BreathingIC2" ).getString();
config.get("item_tags", "IC2:itemArmorJetpack" , "FlyInSpace NoFallDamage" ).getString();
config.get("item_tags", "IC2:itemArmorJetpackElectric" , "FlyInSpace NoFallDamage" ).getString();
config.get("item_tags", "GraviSuite:advJetpack" , "FlyInSpace NoFallDamage" ).getString();
config.get("item_tags", "GraviSuite:advNanoChestPlate" , "FlyInSpace NoFallDamage" ).getString();
config.get("item_tags", "GraviSuite:graviChestPlate" , "FlyInSpace NoFallDamage" ).getString();
config.get("item_tags", "IC2:itemArmorRubBoots" , "NoFallDamage" ).getString();
config.get("item_tags", "IC2:itemArmorQuantumBoots" , "NoFallDamage" ).getString();
taggedItemsName = categoryItemTags.getValues().keySet().toArray(new String[0]);
@ -626,46 +626,46 @@ public class WarpDriveConfig {
taggedItems.put(name, tags);
}
}
// Radar
RADAR_MAX_ENERGY_STORED = clamp(0, Integer.MAX_VALUE,
config.get("radar", "max_energy_stored", RADAR_MAX_ENERGY_STORED).getInt());
RADAR_MAX_ISOLATION_RANGE = clamp(2, 8,
config.get("radar", "max_isolation_range", RADAR_MAX_ISOLATION_RANGE, "radius around core where isolation blocks count (2 to 8), higher is lagger").getInt());
RADAR_MIN_ISOLATION_BLOCKS = clamp(0, 20,
config.get("radar", "min_isolation_blocks", RADAR_MIN_ISOLATION_BLOCKS, "number of isolation blocks required to get some isolation (0 to 20)").getInt());
RADAR_MAX_ISOLATION_BLOCKS = clamp(5, 100,
config.get("radar", "max_isolation_blocks", RADAR_MAX_ISOLATION_BLOCKS, "number of isolation blocks required to reach maximum effect (5 to 100)").getInt());
RADAR_MIN_ISOLATION_EFFECT = clamp(0.01D, 0.95D,
config.get("radar", "min_isolation_effect", RADAR_MIN_ISOLATION_EFFECT, "isolation effect achieved with min number of isolation blocks (0.01 to 0.95)").getDouble(0.12D));
RADAR_MAX_ISOLATION_EFFECT = clamp(0.01D, 1.0D,
config.get("radar", "max_isolation_effect", RADAR_MAX_ISOLATION_EFFECT, "isolation effect achieved with max number of isolation blocks (0.01 to 1.00)").getDouble(1.00D));
// Ship Scanner
SS_MAX_ENERGY_STORED = clamp(1, Integer.MAX_VALUE,
config.get("ship_scanner", "max_energy_stored", SS_MAX_ENERGY_STORED, "Maximum energy storage").getInt());
SS_ENERGY_PER_BLOCK_SCAN = config.get("ship_scanner", "energy_per_block_when_scanning", SS_ENERGY_PER_BLOCK_SCAN,
"Energy consummed per block when scanning a ship (use -1 to consume everything)").getInt();
if (SS_ENERGY_PER_BLOCK_SCAN != -1) {
SS_ENERGY_PER_BLOCK_SCAN = clamp(1, SS_MAX_ENERGY_STORED, SS_ENERGY_PER_BLOCK_SCAN);
}
SS_ENERGY_PER_BLOCK_DEPLOY = config.get("ship_scanner", "energy_per_block_when_deploying", SS_ENERGY_PER_BLOCK_DEPLOY,
"Energy consummed per block when deploying a ship (use -1 to consume everything)").getInt();
if (SS_ENERGY_PER_BLOCK_DEPLOY != -1) {
SS_ENERGY_PER_BLOCK_DEPLOY = clamp(1, SS_MAX_ENERGY_STORED, SS_ENERGY_PER_BLOCK_DEPLOY);
}
SS_MAX_DEPLOY_RADIUS_BLOCKS = clamp(5, 150,
config.get("ship_scanner", "max_deploy_radius_blocks", SS_MAX_DEPLOY_RADIUS_BLOCKS, "Max distance from ship scanner to ship core, measured in blocks (5-150)").getInt());
// Laser medium
LASER_MEDIUM_MAX_ENERGY_STORED = clamp(1, Integer.MAX_VALUE,
config.get("laser_medium", "max_energy_stored", LASER_MEDIUM_MAX_ENERGY_STORED).getInt());
// Laser cannon
LASER_CANNON_MAX_MEDIUMS_COUNT = clamp(1, 64,
config.get("laser_cannon", "max_mediums_count", LASER_CANNON_MAX_MEDIUMS_COUNT).getInt());
@ -675,7 +675,7 @@ public class WarpDriveConfig {
config.get("laser_cannon", "emit_fire_delay_ticks", LASER_CANNON_EMIT_FIRE_DELAY_TICKS, "Delay while booster beams are accepted, before actually shooting").getInt());
LASER_CANNON_EMIT_SCAN_DELAY_TICKS = clamp(1, 100,
config.get("laser_cannon", "emit_scan_delay_ticks", LASER_CANNON_EMIT_SCAN_DELAY_TICKS, "Delay while booster beams are accepted, before actually scanning").getInt());
LASER_CANNON_BOOSTER_BEAM_ENERGY_EFFICIENCY = clamp(0.01D, 10.0D,
config.get("laser_cannon", "booster_beam_energy_efficiency", LASER_CANNON_BOOSTER_BEAM_ENERGY_EFFICIENCY).getDouble(0.6D));
LASER_CANNON_RANGE_ENERGY_PER_BLOCK = clamp(1, LASER_CANNON_MAX_LASER_ENERGY / 10,
@ -684,10 +684,10 @@ public class WarpDriveConfig {
config.get("laser_cannon", "range_max", LASER_CANNON_RANGE_MAX, "Maximum distance travelled").getInt());
LASER_CANNON_ENERGY_LOSS_PER_BLOCK = clamp(0, Integer.MAX_VALUE,
config.get("laser_cannon", "energy_loss_per_block", LASER_CANNON_ENERGY_LOSS_PER_BLOCK, "Energy consummed per distance travelled").getInt());
LASER_CANNON_ENTITY_HIT_SET_ON_FIRE_SECONDS = clamp(0, 300,
config.get("laser_cannon", "entity_hit_set_on_fire_seconds", LASER_CANNON_ENTITY_HIT_SET_ON_FIRE_SECONDS, "Duration of fire effect on entity hit (in seconds)").getInt());
LASER_CANNON_ENTITY_HIT_ENERGY = clamp(0, LASER_CANNON_MAX_LASER_ENERGY,
config.get("laser_cannon", "entity_hit_energy", LASER_CANNON_ENTITY_HIT_ENERGY, "Base energy consumed from hitting an entity").getInt());
LASER_CANNON_ENTITY_HIT_BASE_DAMAGE = clamp(0, LASER_CANNON_MAX_LASER_ENERGY,
@ -696,7 +696,7 @@ public class WarpDriveConfig {
config.get("laser_cannon", "entity_hit_energy_per_damage", LASER_CANNON_ENTITY_HIT_ENERGY_PER_DAMAGE, "Energy required by additional hit point (won't be consummed)").getInt());
LASER_CANNON_ENTITY_HIT_MAX_DAMAGE = clamp(0, Integer.MAX_VALUE,
config.get("laser_cannon", "entity_hit_max_damage", LASER_CANNON_ENTITY_HIT_MAX_DAMAGE, "Maximum damage to entity hit, set to 0 to disable damage completly").getInt());
LASER_CANNON_ENTITY_HIT_ENERGY_THRESHOLD_FOR_EXPLOSION = clamp(0, Integer.MAX_VALUE,
config.get("laser_cannon", "entity_hit_energy_threshold_for_explosion", LASER_CANNON_ENTITY_HIT_ENERGY_THRESHOLD_FOR_EXPLOSION, "Minimum energy to cause explosion effect").getInt());
LASER_CANNON_ENTITY_HIT_EXPLOSION_BASE_STRENGTH = (float) clamp(0.0D, 100.0D,
@ -705,12 +705,12 @@ public class WarpDriveConfig {
config.get("laser_cannon", "entity_hit_explosion_energy_per_strength", LASER_CANNON_ENTITY_HIT_EXPLOSION_ENERGY_PER_STRENGTH, "Energy per added explosion strength").getInt());
LASER_CANNON_ENTITY_HIT_EXPLOSION_MAX_STRENGTH = (float) clamp(0.0D, 1000.0D,
config.get("laser_cannon", "entity_hit_explosion_max_strength", LASER_CANNON_ENTITY_HIT_EXPLOSION_MAX_STRENGTH, "Maximum explosion strength, set to 0 to disable explosion completly").getDouble());
LASER_CANNON_BLOCK_HIT_ENERGY = clamp(0, Integer.MAX_VALUE,
config.get("laser_cannon", "block_hit_energy", LASER_CANNON_BLOCK_HIT_ENERGY, "Base energy consummed from hitting a block").getInt());
LASER_CANNON_BLOCK_HIT_ENERGY_PER_BLOCK_RESISTANCE = clamp(0, Integer.MAX_VALUE,
config.get("laser_cannon", "block_hit_energy_per_block_resistance", LASER_CANNON_BLOCK_HIT_ENERGY_PER_BLOCK_RESISTANCE, "Energy consummed per explosive resistance points").getInt());
LASER_CANNON_BLOCK_HIT_EXPLOSION_RESISTANCE_THRESHOLD = clamp(0.0D, 1000000.0D,
config.get("laser_cannon", "block_hit_explosion_resistance_threshold", LASER_CANNON_BLOCK_HIT_EXPLOSION_RESISTANCE_THRESHOLD, "Block explosion resistance threshold to cause an explosion").getDouble());
LASER_CANNON_BLOCK_HIT_EXPLOSION_BASE_STRENGTH = (float) clamp(0.0D, 1000.0D,
@ -719,20 +719,20 @@ public class WarpDriveConfig {
config.get("laser_cannon", "block_hit_explosion_energy_per_strength", LASER_CANNON_BLOCK_HIT_EXPLOSION_ENERGY_PER_STRENGTH, "Energy per added explosion strength").getInt());
LASER_CANNON_BLOCK_HIT_EXPLOSION_MAX_STRENGTH = (float) clamp(0.0D, 1000.0D,
config.get("laser_cannon", "block_hit_explosion_max_strength", LASER_CANNON_BLOCK_HIT_EXPLOSION_MAX_STRENGTH, "Maximum explosion strength, set to 0 to disable explosion completly").getDouble());
// Mining Laser
MINING_LASER_MAX_MEDIUMS_COUNT = clamp(1, 64,
config.get("mining_laser", "max_mediums_count", MINING_LASER_MAX_MEDIUMS_COUNT).getInt());
MINING_LASER_RADIUS_BLOCKS = clamp(1, 64,
config.get("mining_laser", "radius_blocks", MINING_LASER_RADIUS_BLOCKS).getInt());
MINING_LASER_WARMUP_DELAY_TICKS = clamp(1, 300,
config.get("mining_laser", "warmup_delay_ticks", MINING_LASER_WARMUP_DELAY_TICKS).getInt());
MINING_LASER_SCAN_DELAY_TICKS = clamp(1, 300,
config.get("mining_laser", "scan_delay_ticks", MINING_LASER_SCAN_DELAY_TICKS).getInt());
MINING_LASER_MINE_DELAY_TICKS = clamp(1, 300,
config.get("mining_laser", "mine_delay_ticks", MINING_LASER_MINE_DELAY_TICKS).getInt());
MINING_LASER_PLANET_ENERGY_PER_LAYER = clamp(1, Integer.MAX_VALUE,
config.get("mining_laser", "planet_energy_per_layer", MINING_LASER_PLANET_ENERGY_PER_LAYER).getInt());
MINING_LASER_PLANET_ENERGY_PER_BLOCK = clamp(1, Integer.MAX_VALUE,
@ -741,7 +741,7 @@ public class WarpDriveConfig {
config.get("mining_laser", "space_energy_per_layer", MINING_LASER_SPACE_ENERGY_PER_LAYER).getInt());
MINING_LASER_SPACE_ENERGY_PER_BLOCK = clamp(1, Integer.MAX_VALUE,
config.get("mining_laser", "space_energy_per_block", MINING_LASER_SPACE_ENERGY_PER_BLOCK).getInt());
MINING_LASER_ORESONLY_ENERGY_FACTOR = clamp(0.01D, 1000.0D,
config.get("mining_laser", "oresonly_energy_factor", MINING_LASER_ORESONLY_ENERGY_FACTOR).getDouble(4.0D));
MINING_LASER_SILKTOUCH_ENERGY_FACTOR = clamp(0.01D, 1000.0D,
@ -750,13 +750,13 @@ public class WarpDriveConfig {
config.get("mining_laser", "silktouch_deuterium_l", MINING_LASER_SILKTOUCH_DEUTERIUM_L).getDouble(1.0D));
MINING_LASER_FORTUNE_ENERGY_FACTOR = clamp(0.01D, 1000.0D,
config.get("mining_laser", "fortune_energy_factor", MINING_LASER_FORTUNE_ENERGY_FACTOR).getDouble(2.5D));
// Tree Farm
TREE_FARM_MIN_RADIUS = clamp(1, 30,
config.get("tree_farm", "min_radius", TREE_FARM_MIN_RADIUS, "Minimum radius on X and Z axis, measured in blocks").getInt());
TREE_FARM_MAX_RADIUS = clamp(TREE_FARM_MIN_RADIUS, 30,
config.get("tree_farm", "max_radius", TREE_FARM_MAX_RADIUS, "Maximum radius on X and Z axis, measured in blocks").getInt());
// Cloaking
CLOAKING_MAX_ENERGY_STORED = clamp(1, Integer.MAX_VALUE,
config.get("cloaking", "max_energy_stored", CLOAKING_MAX_ENERGY_STORED, "Maximum energy storage").getInt());
@ -770,7 +770,7 @@ public class WarpDriveConfig {
config.get("cloaking", "tier2_energy_per_block", CLOAKING_TIER2_ENERGY_PER_BLOCK).getInt());
CLOAKING_FIELD_REFRESH_INTERVAL_SECONDS = clamp(1, 30,
config.get("cloaking", "field_refresh_interval_seconds", CLOAKING_FIELD_REFRESH_INTERVAL_SECONDS).getInt());
// Air generator
AIRGEN_MAX_ENERGY_STORED = clamp(1, Integer.MAX_VALUE,
config.get("air_generator", "max_energy_stored", AIRGEN_MAX_ENERGY_STORED).getInt());
@ -782,7 +782,7 @@ public class WarpDriveConfig {
config.get("air_generator", "energy_per_existing_air_block", AIRGEN_ENERGY_PER_EXISTINGAIRBLOCK).getInt());
AIRGEN_AIR_GENERATION_TICKS = clamp(1, 300,
config.get("air_generator", "air_generation_ticks", AIRGEN_AIR_GENERATION_TICKS).getInt());
// Reactor monitor
IC2_REACTOR_MAX_ENERGY_STORED = clamp(1, Integer.MAX_VALUE,
config.get("ic2_reactor_laser", "max_energy_stored", IC2_REACTOR_MAX_ENERGY_STORED).getInt());
@ -790,7 +790,7 @@ public class WarpDriveConfig {
config.get("ic2_reactor_laser", "energy_per_heat", IC2_REACTOR_ENERGY_PER_HEAT).getDouble(2));
IC2_REACTOR_COOLING_INTERVAL_TICKS = clamp(0, 1200,
config.get("ic2_reactor_laser", "cooling_interval_ticks", IC2_REACTOR_COOLING_INTERVAL_TICKS).getInt());
// Transporter
TRANSPORTER_MAX_ENERGY = clamp(1, Integer.MAX_VALUE,
config.get("transporter", "max_energy", TRANSPORTER_MAX_ENERGY).getInt());
@ -799,7 +799,7 @@ public class WarpDriveConfig {
config.get("transporter", "energy_per_block", TRANSPORTER_ENERGY_PER_BLOCK).getDouble(100.0D));
TRANSPORTER_MAX_BOOST_MUL = clamp(1.0D, 1000.0D,
config.get("transporter", "max_boost", TRANSPORTER_MAX_BOOST_MUL).getDouble(4.0));
// Enantiomorphic reactor
ENAN_REACTOR_MAX_ENERGY_STORED = clamp(1, Integer.MAX_VALUE,
config.get("enantiomorphic_reactor", "max_energy_stored", ENAN_REACTOR_MAX_ENERGY_STORED).getInt());
@ -807,10 +807,10 @@ public class WarpDriveConfig {
config.get("enantiomorphic_reactor", "update_interval_ticks", ENAN_REACTOR_UPDATE_INTERVAL_TICKS).getInt());
ENAN_REACTOR_MAX_LASERS_PER_SECOND = clamp(4, 80,
config.get("enantiomorphic_reactor", "max_lasers", ENAN_REACTOR_MAX_LASERS_PER_SECOND, "Maximum number of stabiliation laser shots per seconds before loosing effiency").getInt());
// Energy bank
ENERGY_BANK_MAX_ENERGY_STORED = config.get("energy_bank", "max_energy_stored", ENERGY_BANK_MAX_ENERGY_STORED).getInt();
// Lift
LIFT_MAX_ENERGY_STORED = clamp(1, Integer.MAX_VALUE,
config.get("lift", "max_energy_stored", LIFT_MAX_ENERGY_STORED).getInt());
@ -818,40 +818,40 @@ public class WarpDriveConfig {
config.get("lift", "energy_per_entity", LIFT_ENERGY_PER_ENTITY, "Energy consummed per entity moved").getInt());
LIFT_UPDATE_INTERVAL_TICKS = clamp(1, 60,
config.get("lift", "update_interval_ticks", LIFT_UPDATE_INTERVAL_TICKS).getInt());
config.save();
}
public static int clamp(final int min, final int max, final int value) {
return Math.min(max, Math.max(value, min));
}
public static double clamp(final double min, final double max, final double value) {
return Math.min(max, Math.max(value, min));
}
public static void onFMLInitialization() {
isForgeMultipartLoaded = Loader.isModLoaded("ForgeMultipart");
if (isForgeMultipartLoaded) {
loadForgeMultipart();
}
isIndustrialCraft2loaded = Loader.isModLoaded("IC2");
if (isIndustrialCraft2loaded) {
loadIC2();
}
isComputerCraftLoaded = Loader.isModLoaded("ComputerCraft");
if (isComputerCraftLoaded) {
loadCC();
}
isAdvancedSolarPanelLoaded = Loader.isModLoaded("AdvancedSolarPanel");
isThermalExpansionLoaded = Loader.isModLoaded("ThermalExpansion");
isAppliedEnergistics2Loaded = Loader.isModLoaded("appliedenergistics2");
isOpenComputersLoaded = Loader.isModLoaded("OpenComputers");
}
public static void onFMLPostInitialization() {
// read XML files
File[] files = configDirectory.listFiles(new FilenameFilter() {
@ -865,15 +865,15 @@ public class WarpDriveConfig {
unpackResourceToFolder(defaultXMLfilename, "config", configDirectory);
}
}
FillerManager.loadOres(configDirectory);
StructureManager.loadStructures(configDirectory);
loadDictionnary();
FillerManager.finishLoading();
}
private static void loadDictionnary() {
// get default settings from parsing ore dictionary
BLOCKS_ORES = new HashSet<Block>();
@ -904,7 +904,7 @@ public class WarpDriveConfig {
}
}
}
// translate tagged blocks
BLOCKS_ANCHOR = new HashSet(taggedBlocks.size());
BLOCKS_NOMASS = new HashSet(taggedBlocks.size() + BLOCKS_LEAVES.size());
@ -951,7 +951,7 @@ public class WarpDriveConfig {
WarpDrive.logger.info("- " + BLOCKS_MINING.size() + " with Mining tag: " + getHashMessage(BLOCKS_MINING));
WarpDrive.logger.info("- " + BLOCKS_NOMINING.size() + " with NoMining tag: " + getHashMessage(BLOCKS_NOMINING));
WarpDrive.logger.info("- " + BLOCKS_PLACE.size() + " with Placement priority: " + getHashMessage(BLOCKS_PLACE));
// translate tagged entities
ENTITIES_ANCHOR = new HashSet(taggedEntities.size());
ENTITIES_NOMASS = new HashSet(taggedEntities.size());
@ -982,14 +982,14 @@ public class WarpDriveConfig {
WarpDrive.logger.info("- " + ENTITIES_NOMASS.size() + " with NoMass tag: " + getHashMessage(ENTITIES_NOMASS));
WarpDrive.logger.info("- " + ENTITIES_LEFTBEHIND.size() + " with LeftBehind tag: " + getHashMessage(ENTITIES_LEFTBEHIND));
WarpDrive.logger.info("- " + ENTITIES_NONLIVINGTARGET.size() + " with NonLivingTarget tag: " + getHashMessage(ENTITIES_NONLIVINGTARGET));
// translate tagged items
ITEMS_FLYINSPACE = new HashSet(taggedItems.size());
ITEMS_NOFALLDAMAGE = new HashSet(taggedItems.size());
ITEMS_BREATHINGIC2 = new HashSet(taggedItems.size());
for (Entry<String, String> taggedItem : taggedItems.entrySet()) {
String itemId = taggedItem.getKey();
Item item = GameData.getItemRegistry().getObject(itemId);
Item item = GameData.getItemRegistry().getObject(itemId);
if (item == null) {
WarpDrive.logger.info("Ignoring missing item " + itemId);
continue;
@ -1010,7 +1010,7 @@ public class WarpDriveConfig {
WarpDrive.logger.info("- " + ITEMS_NOFALLDAMAGE.size() + " absorbing fall damages: " + getHashMessage(ITEMS_NOFALLDAMAGE));
WarpDrive.logger.info("- " + ITEMS_BREATHINGIC2.size() + " allowing breathing compressed air: " + getHashMessage(ITEMS_BREATHINGIC2));
}
private static String getHashMessage(HashSet hashSet) {
String message = "";
for (Object object : hashSet) {
@ -1024,11 +1024,11 @@ public class WarpDriveConfig {
} else {
message += object;
}
}
return message;
}
private static String getHashMessage(HashMap<Block, Integer> hashMap) {
String message = "";
for (Entry<Block, Integer> entry : hashMap.entrySet()) {
@ -1039,7 +1039,7 @@ public class WarpDriveConfig {
}
return message;
}
private static void loadForgeMultipart() {
try {
Class forgeMultipart_helper = Class.forName("codechicken.multipart.MultipartHelper");
@ -1053,12 +1053,12 @@ public class WarpDriveConfig {
exception.printStackTrace();
}
}
private static void loadIC2() {
try {
IC2_emptyCell = getModItemStack("IC2", "itemCellEmpty", -1);
IC2_compressedAir = getModItemStack("IC2", "itemCellEmpty", 5);
IC2_rubberWood = getModBlock("IC2", "blockRubWood");
IC2_Resin = getModItemStack("IC2", "itemHarz", -1);
} catch (Exception exception) {
@ -1066,7 +1066,7 @@ public class WarpDriveConfig {
exception.printStackTrace();
}
}
private static void loadCC() {
try {
CC_Computer = getModBlock("ComputerCraft", "CC-Computer");
@ -1079,7 +1079,7 @@ public class WarpDriveConfig {
exception.printStackTrace();
}
}
public static DocumentBuilder getXmlDocumentBuilder() {
if (xmlDocumentBuilder == null) {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
@ -1091,30 +1091,30 @@ public class WarpDriveConfig {
exception.printStackTrace();
}
}
return xmlDocumentBuilder;
}
/*
* Copy a default configuration file from the mod's resources to the specified configuration folder
*/
public static void unpackResourceToFolder(final String filename, final String sourceResourcePath, File targetFolder) {
// targetFolder is already created by caller
String resourceName = sourceResourcePath + "/" + filename;
File destination = new File(targetFolder, filename);
try {
InputStream inputStream = WarpDrive.class.getClassLoader().getResourceAsStream(resourceName);
BufferedOutputStream outputStream = new BufferedOutputStream(new FileOutputStream(destination));
byte[] byteBuffer = new byte[Math.max(8192, inputStream.available())];
int bytesRead;
while ((bytesRead = inputStream.read(byteBuffer)) >= 0) {
outputStream.write(byteBuffer, 0, bytesRead);
}
inputStream.close();
outputStream.close();
} catch (Exception exception) {

View file

@ -32,59 +32,6 @@
<filler block="minecraft:bedrock" ratio=".001" />
</FillerSet>
<FillerSet group="igneous_ores">
<filler block="UndergroundBiomes:igneous_oreCoal" ratio=".001" />
<filler block="UndergroundBiomes:igneous_oreDiamond" ratio=".001" />
<filler block="UndergroundBiomes:igneous_oreEmerald" ratio=".001" />
<filler block="UndergroundBiomes:igneous_oreGold" ratio=".001" />
<filler block="UndergroundBiomes:igneous_oreIron" ratio=".001" />
<filler block="UndergroundBiomes:igneous_oreLapis" ratio=".001" />
<filler block="UndergroundBiomes:igneous_oreRedstone" ratio=".001" />
</FillerSet>
<FillerSet group="metamorphic_ores">
<filler block="UndergroundBiomes:metamorphic_oreCoal" ratio=".001" />
<filler block="UndergroundBiomes:metamorphic_oreDiamond" ratio=".001" />
<filler block="UndergroundBiomes:metamorphic_oreEmerald" ratio=".001" />
<filler block="UndergroundBiomes:metamorphic_oreGold" ratio=".001" />
<filler block="UndergroundBiomes:metamorphic_oreIron" ratio=".001" />
<filler block="UndergroundBiomes:metamorphic_oreLapis" ratio=".001" />
<filler block="UndergroundBiomes:metamorphic_oreRedstone" ratio=".001" />
</FillerSet>
<FillerSet group="sedimentary_ores">
<filler block="UndergroundBiomes:sedimentary_oreCoal" ratio=".001" />
<filler block="UndergroundBiomes:sedimentary_oreDiamond" ratio=".001" />
<filler block="UndergroundBiomes:sedimentary_oreEmerald" ratio=".001" />
<filler block="UndergroundBiomes:sedimentary_oreGold" ratio=".001" />
<filler block="UndergroundBiomes:sedimentary_oreIron" ratio=".001" />
<filler block="UndergroundBiomes:sedimentary_oreLapis" ratio=".001" />
<filler block="UndergroundBiomes:sedimentary_oreRedstone" ratio=".001" />
</FillerSet>
<for variable="type" in="igneous,metamorphic,sedimentary">
<for variable="metadata" from="0" to="7">
<FillerSet group="%type%_ores@%metadata%.normal" fillerSets="%type%_ores@%metadata%">
<filler block="UndergroundBiomes:%type%Stone" metadata="%metadata%" weight="10" />
</FillerSet>
<FillerSet group="%type%_ores@%metadata%.corrupted" fillerSets="%type%_ores@%metadata%">
<filler block="UndergroundBiomes:%type%Cobblestone" metadata="%metadata%" weight="10" />
</FillerSet>
<FillerSet group="%type%_ores@%metadata%">
<filler block="UndergroundBiomes:%type%_oreCoal" metadata="%metadata%" ratio=".001" />
<filler block="UndergroundBiomes:%type%_oreDiamond" metadata="%metadata%" ratio=".001" />
<filler block="UndergroundBiomes:%type%_oreEmerald" metadata="%metadata%" ratio=".001" />
<filler block="UndergroundBiomes:%type%_oreGold" metadata="%metadata%" ratio=".001" />
<filler block="UndergroundBiomes:%type%_oreIron" metadata="%metadata%" ratio=".001" />
<filler block="UndergroundBiomes:%type%_oreLapis" metadata="%metadata%" ratio=".001" />
<filler block="UndergroundBiomes:%type%_oreRedstone" metadata="%metadata%" ratio=".001" />
</FillerSet>
</for>
</for>
<FillerSet group="commonOres">
<filler block="minecraft:coal_ore" ratio=".08" />
<filler block="minecraft:iron_ore" ratio=".05" />

View file

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE warpdriveWorldGeneration>
<warpdriveWorldGeneration version="1" mods="UndergroundBiomes">
<for variable="type" in="igneous,metamorphic,sedimentary">
<for variable="metadata" from="0" to="7">
<FillerSet group="%type%_ores@%metadata%.normal" fillerSets="%type%_ores@%metadata%">
<filler block="UndergroundBiomes:%type%Stone" metadata="%metadata%" weight="10" />
</FillerSet>
<FillerSet group="%type%_ores@%metadata%.corrupted" fillerSets="%type%_ores@%metadata%">
<filler block="UndergroundBiomes:%type%Cobblestone" metadata="%metadata%" weight="10" />
</FillerSet>
<FillerSet group="%type%_ores@%metadata%">
<filler block="UndergroundBiomes:%type%_oreCoal" metadata="%metadata%" ratio=".001" />
<filler block="UndergroundBiomes:%type%_oreDiamond" metadata="%metadata%" ratio=".001" />
<filler block="UndergroundBiomes:%type%_oreEmerald" metadata="%metadata%" ratio=".001" />
<filler block="UndergroundBiomes:%type%_oreGold" metadata="%metadata%" ratio=".001" />
<filler block="UndergroundBiomes:%type%_oreIron" metadata="%metadata%" ratio=".001" />
<filler block="UndergroundBiomes:%type%_oreLapis" metadata="%metadata%" ratio=".001" />
<filler block="UndergroundBiomes:%type%_oreRedstone" metadata="%metadata%" ratio=".001" />
</FillerSet>
</for>
</for>
</warpdriveWorldGeneration>