Added ArsMagica2 detection

This commit is contained in:
LemADEC 2015-09-24 01:08:36 +02:00
parent a5606731c2
commit 32612054f5

View file

@ -40,6 +40,7 @@ public class WarpDriveConfig {
"filler-default.xml", "filler-netherores.xml", "filler-undergroundbiomes.xml",
// structures
"structures-default.xml", "structures-netherores.xml",
// done
};
/*
@ -53,6 +54,7 @@ public class WarpDriveConfig {
public static boolean isComputerCraftLoaded = false;
public static boolean isOpenComputersLoaded = false;
public static boolean isThermalExpansionLoaded = false;
public static boolean isArsMagica2loaded = false;
// ForgeMultipart (microblocks) support
public static Method forgeMultipart_helper_createTileFromNBT = null;
@ -341,8 +343,7 @@ public class WarpDriveConfig {
G_HYPERSPACE_DIMENSION_ID = clamp(Integer.MIN_VALUE, Integer.MAX_VALUE,
config.get("general", "hyperspace_dimension_id", G_HYPERSPACE_DIMENSION_ID, "Hyperspace dimension world ID").getInt());
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());
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());
@ -410,8 +411,7 @@ public class WarpDriveConfig {
PLANETS = new Planet[planetsName.length];
int index = 0;
for (String name : planetsName) {
int[] planetInts = config.get("planets", name, defaultPlanet,
"dimensionId, dimensionCenterX, dimensionCenterZ, radiusX, radiusZ, spaceCenterX, spaceCenterZ").getIntList();
int[] planetInts = config.get("planets", name, defaultPlanet, "dimensionId, dimensionCenterX, dimensionCenterZ, radiusX, radiusZ, spaceCenterX, spaceCenterZ").getIntList();
if (planetInts.length != 7) {
WarpDrive.logger.warn("Invalid planet definition '" + name + "' (exactly 7 integers are expected), using default instead");
planetInts = defaultPlanet.clone();
@ -443,11 +443,9 @@ public class WarpDriveConfig {
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());
config.get("ship", "volume_max_on_planet_surface", SHIP_VOLUME_MAX_ON_PLANET_SURFACE, "Maximum ship mass (in blocks) to jump on earth").getInt());
SHIP_VOLUME_MIN_FOR_HYPERSPACE = clamp(0, 10000000,
config.get("ship", "volume_min_for_hyperspace", SHIP_VOLUME_MIN_FOR_HYPERSPACE,
"Minimum ship mass (in blocks) to enter or exit hyperspace without a jumpgate").getInt());
config.get("ship", "volume_min_for_hyperspace", SHIP_VOLUME_MIN_FOR_HYPERSPACE, "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();
@ -479,20 +477,14 @@ public class WarpDriveConfig {
{
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"
+ "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"
+ "- 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"
+ "- 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).");
@ -500,37 +492,37 @@ public class WarpDriveConfig {
String[] taggedBlocksName = categoryBlockTags.getValues().keySet().toArray(new String[0]);
if (taggedBlocksName.length == 0) {
// anchors
config.get("block_tags", "minecraft:bedrock" , "Anchor NoMining" ).getString();
config.get("block_tags", "Artifacts:invisible_bedrock" , "Anchor NoMining" ).getString();
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();
config.get("block_tags", "minecraft:bedrock" , "Anchor NoMining").getString();
config.get("block_tags", "Artifacts:invisible_bedrock" , "Anchor NoMining").getString();
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();
config.get("block_tags", "IC2:blockAlloyGlass" , "PlaceEarliest NoMining" ).getString();
config.get("block_tags", "minecraft:obsidian" , "PlaceEarliest Mining" ).getString();
config.get("block_tags", "AdvancedRepulsionSystems:field" , "PlaceEarlier NoMining" ).getString();
config.get("block_tags", "IC2:blockReinforcedFoam" , "PlaceEarliest NoMining").getString();
config.get("block_tags", "IC2:blockAlloy" , "PlaceEarliest NoMining").getString();
config.get("block_tags", "IC2:blockAlloyGlass" , "PlaceEarliest NoMining").getString();
config.get("block_tags", "minecraft:obsidian" , "PlaceEarliest Mining").getString();
config.get("block_tags", "AdvancedRepulsionSystems:field" , "PlaceEarlier NoMining").getString();
// 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();
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();
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();
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)
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]);
}
taggedBlocks = new HashMap(taggedBlocksName.length);
@ -544,12 +536,9 @@ public class WarpDriveConfig {
{
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"
+ "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).");
@ -557,26 +546,26 @@ public class WarpDriveConfig {
ConfigCategory categoryEntityTags = config.getCategory("entity_tags");
String[] taggedEntitiesName = categoryEntityTags.getValues().keySet().toArray(new String[0]);
if (taggedEntitiesName.length == 0) {
config.get("entity_tags", "GalacticraftCore.OxygenBubble" , "NoMass LeftBehind" ).getString();
config.get("entity_tags", "ItemFrame" , "NoMass NonLivingTarget" ).getString();
config.get("entity_tags", "Painting" , "NoMass NonLivingTarget" ).getString();
config.get("entity_tags", "LeashKnot" , "NoMass NonLivingTarget" ).getString();
config.get("entity_tags", "Boat" , "NoMass NonLivingTarget" ).getString();
config.get("entity_tags", "MinecartRideable" , "NoMass NonLivingTarget" ).getString();
config.get("entity_tags", "MinecartChest" , "NoMass NonLivingTarget" ).getString();
config.get("entity_tags", "MinecartFurnace" , "NoMass NonLivingTarget" ).getString();
config.get("entity_tags", "MinecartTNT" , "NoMass NonLivingTarget" ).getString();
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", "GalacticraftCore.OxygenBubble", "NoMass LeftBehind").getString();
config.get("entity_tags", "ItemFrame" , "NoMass NonLivingTarget").getString();
config.get("entity_tags", "Painting" , "NoMass NonLivingTarget").getString();
config.get("entity_tags", "LeashKnot" , "NoMass NonLivingTarget").getString();
config.get("entity_tags", "Boat" , "NoMass NonLivingTarget").getString();
config.get("entity_tags", "MinecartRideable" , "NoMass NonLivingTarget").getString();
config.get("entity_tags", "MinecartChest" , "NoMass NonLivingTarget").getString();
config.get("entity_tags", "MinecartFurnace" , "NoMass NonLivingTarget").getString();
config.get("entity_tags", "MinecartTNT" , "NoMass NonLivingTarget").getString();
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();
config.get("entity_tags", "IC2.Nuke" , "NoMass NonLivingTarget" ).getString();
config.get("entity_tags", "IC2.Itnt" , "NoMass NonLivingTarget" ).getString();
config.get("entity_tags", "IC2.StickyDynamite" , "NoMass NonLivingTarget" ).getString();
config.get("entity_tags", "IC2.Dynamite" , "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();
config.get("entity_tags", "IC2.Nuke" , "NoMass NonLivingTarget").getString();
config.get("entity_tags", "IC2.Itnt" , "NoMass NonLivingTarget").getString();
config.get("entity_tags", "IC2.StickyDynamite" , "NoMass NonLivingTarget").getString();
config.get("entity_tags", "IC2.Dynamite" , "NoMass NonLivingTarget").getString();
taggedEntitiesName = categoryEntityTags.getValues().keySet().toArray(new String[0]);
}
taggedEntities = new HashMap(taggedEntitiesName.length);
@ -588,36 +577,32 @@ public class WarpDriveConfig {
// 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"
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");
ConfigCategory categoryItemTags = config.getCategory("item_tags");
String[] taggedItemsName = categoryItemTags.getValues().keySet().toArray(new String[0]);
if (taggedItemsName.length == 0) {
config.get("item_tags", "IC2:itemArmorHazmatHelmet" , "BreathingIC2" ).getString();
config.get("item_tags", "IC2:itemSolarHelmet" , "BreathingIC2" ).getString();
config.get("item_tags", "IC2:itemArmorNanoHelmet" , "BreathingIC2" ).getString();
config.get("item_tags", "IC2:itemArmorQuantumHelmet" , "BreathingIC2" ).getString();
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:itemArmorHazmatHelmet", "BreathingIC2").getString();
config.get("item_tags", "IC2:itemSolarHelmet", "BreathingIC2").getString();
config.get("item_tags", "IC2:itemArmorNanoHelmet", "BreathingIC2").getString();
config.get("item_tags", "IC2:itemArmorQuantumHelmet", "BreathingIC2").getString();
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: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();
config.get("item_tags", "IC2:itemArmorRubBoots", "NoFallDamage").getString();
config.get("item_tags", "IC2:itemArmorQuantumBoots", "NoFallDamage").getString();
taggedItemsName = categoryItemTags.getValues().keySet().toArray(new String[0]);
}
taggedItems = new HashMap(taggedItemsName.length);
@ -712,7 +697,8 @@ public class WarpDriveConfig {
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());
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,
config.get("laser_cannon", "block_hit_explosion_base_strength", LASER_CANNON_BLOCK_HIT_EXPLOSION_BASE_STRENGTH, "Explosion base strength, 4 is Vanilla TNT").getDouble());
LASER_CANNON_BLOCK_HIT_EXPLOSION_ENERGY_PER_STRENGTH = clamp(1, Integer.MAX_VALUE,
@ -783,7 +769,7 @@ public class WarpDriveConfig {
AIRGEN_AIR_GENERATION_TICKS = clamp(1, 300,
config.get("air_generator", "air_generation_ticks", AIRGEN_AIR_GENERATION_TICKS).getInt());
// Reactor monitor
// IC2 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());
IC2_REACTOR_ENERGY_PER_HEAT = clamp(2.0D, 100000.0D,
@ -850,6 +836,7 @@ public class WarpDriveConfig {
isThermalExpansionLoaded = Loader.isModLoaded("ThermalExpansion");
isAppliedEnergistics2Loaded = Loader.isModLoaded("appliedenergistics2");
isOpenComputersLoaded = Loader.isModLoaded("OpenComputers");
isArsMagica2loaded = Loader.isModLoaded("arsmagica2");
}
public static void onFMLPostInitialization() {
@ -861,7 +848,7 @@ public class WarpDriveConfig {
}
});
if (files.length == 0) {
for(String defaultXMLfilename : defaultXMLfilenames) {
for (String defaultXMLfilename : defaultXMLfilenames) {
unpackResourceToFolder(defaultXMLfilename, "config", configDirectory);
}
}
@ -1018,9 +1005,9 @@ public class WarpDriveConfig {
message += ", ";
}
if (object instanceof Block) {
message += GameRegistry.findUniqueIdentifierFor((Block)object);
message += GameRegistry.findUniqueIdentifierFor((Block) object);
} else if (object instanceof String) {
message += (String)object;
message += (String) object;
} else {
message += object;
}