10 Commits
1.0.4 ... 1.1

Author SHA1 Message Date
Robert Sosnitzka
e15a07bdb8 Added creative tabs for blocks and items and associated language entries. Added check for iron nugget, to prevent double registry. 2016-07-28 14:59:08 +02:00
Robert Sosnitzka
e6f95908d7 Removed dev block helper. Fixed trait cascade not to break whole mountains. 2016-07-28 13:08:55 +02:00
Robert Sosnitzka
195b6a25dc Removed unused configuration menu. Fixed misspelled menu entry. 2016-07-28 11:56:02 +02:00
Robert Sosnitzka
b539f986f8 Fixed a lot of minor issues. Added configuration for ore values and ore generation. 2016-07-28 11:50:50 +02:00
ccf8c75b37 some minor fixes 2016-07-27 12:01:23 +02:00
faa70ed224 general code cleanup
try and add changes generation back into gradle again
2016-07-27 11:29:58 +02:00
Robert Sosnitzka
e8976365a2 Added integration for non-vanilla dimensions.
Fixed some config basics.
2016-07-26 16:31:42 +02:00
f8984bec16 removed debug out 2016-07-25 23:07:52 +02:00
bfb3c3902e fixed config init is not called on client side 2016-07-25 23:00:58 +02:00
bb9bc335ff first attempt ti implement a config file, does not function atm 2016-07-25 15:23:49 +02:00
48 changed files with 723 additions and 325 deletions

1
.gitignore vendored
View File

@@ -175,3 +175,4 @@ gradle-app.setting
# Forge # Forge
run/ run/
src/main/java/com/sosnitzka/taiga/dev

View File

@@ -47,10 +47,14 @@ task buildInfo {
ext.buildNum = System.getenv().BUILD_NUMBER ext.buildNum = System.getenv().BUILD_NUMBER
} }
if (System.getenv().TAIGA_CHANGES != null) {
ext.changes = System.getenv().TAIGA_CHANGES def cmd = "git log \$(git tag --sort=-refname | sed -n '2p')..\$(git tag --sort=-refname | sed -n '1p') --oneline"
def proc = cmd.execute()
proc.waitFor()
if (proc.exitValue() == 0) {
ext.changes = proc.text.trim()
} else { } else {
ext.changes = "" ext.changes = "N/A"
} }
} }
@@ -71,6 +75,7 @@ minecraft {
replace "${version}", project.version replace "${version}", project.version
} }
//noinspection GroovyAssignabilityCheck
ext.mc_version = project.minecraft.version.split('-')[0] ext.mc_version = project.minecraft.version.split('-')[0]
version = "${mc_version}-${project.buildInfo.revision}" version = "${mc_version}-${project.buildInfo.revision}"
@@ -142,84 +147,3 @@ curseforge {
} }
} }
} }
/* FOR AUTO JSON
ext.args = [:]
ext.requireArgument = {String property, String displayValue ->
def value = args[property]
if (value == null) {
throw new InvalidUserDataException("$property must be set with \'$property=$displayValue\'")
}
return value
}
tasks.addRule("Pattern: <property>=<value>: Passes arguments to the scripts") { String taskName ->
def match = taskName =~ /(.*?)=(.*?$)/
if (match) {
def property = match[0][1]
def value = match[0][2]
ext.args[property] = value;
task(taskName) << {
println "Passes value \'$value\' to args[\'$property\']"
}
}
}
import org.apache.tools.ant.filters.FixCrLfFilter
class CopyJsonTemplate extends DefaultTask {
@Input
def template
@Input
def arguments
@Input
def jsonRename
@TaskAction
def build() {
def args = arguments()
project.copy {
from("templates/${template}") {
expand(args)
filter(FixCrLfFilter, eol: FixCrLfFilter.CrLf.newInstance('crlf'))
}
into 'src/main/resources'
rename { String filename ->
def match = filename =~ /(.*)\.json/
if (match) {
def prevFilename = match[0][1]
def newFilename = jsonRename.call(prevFilename)
return "${newFilename}.json"
}
else {
return filename
}
}
}
}
}
task generateBlockModel(type: CopyJsonTemplate) {
template 'block'
arguments {
def blockName = requireArgument('blockName', 'block_name')
return ['modid':archivesBaseName, 'block_name':blockName]
}
jsonRename {
return args['blockName']
}
}
task generateItemModel(type: CopyJsonTemplate) {
template 'item'
arguments {
def itemName = requireArgument('itemName', 'item_name')
return ['modid':archivesBaseName, 'item_name':itemName]
}
jsonRename {
return args['itemName']
}
}*/

View File

@@ -105,8 +105,8 @@ public class Blocks {
Class<?> targetType = field.getType(); Class<?> targetType = field.getType();
try { try {
Block block = (Block) field.get(targetType); // Gets the field as a BasicBlock which is then casted to an Block Block block = (Block) field.get(targetType); // Gets the field as a BasicBlock which is then casted to an Block
block.setCreativeTab(CreativeTab.tabTaigaBlock);
Utils.registerBlockWithItem(block); // Registers block and its item Utils.registerBlockWithItem(block); // Registers block and its item
if (block instanceof BasicBlock) { // Checks that the block is a BasicBlock if (block instanceof BasicBlock) { // Checks that the block is a BasicBlock
if (((BasicBlock) block).isOreDict()) { // Checks that the block has an oreDict entry if (((BasicBlock) block).isOreDict()) { // Checks that the block has an oreDict entry
String oreDictName; String oreDictName;

View File

@@ -0,0 +1,27 @@
package com.sosnitzka.taiga;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import static com.sosnitzka.taiga.Blocks.adamantiteBlock;
import static com.sosnitzka.taiga.Items.noctunyxIngot;
public class CreativeTab {
public static final CreativeTabs tabTaigaBlock = new CreativeTabs("taiga_block") {
@Override
public Item getTabIconItem() {
return Item.getItemFromBlock(adamantiteBlock);
}
};
public static final CreativeTabs tabTaigaItem = new CreativeTabs("taiga_item") {
@Override
public Item getTabIconItem() {
return noctunyxIngot;
}
};
}

View File

@@ -38,7 +38,7 @@ public class Fluids {
public static BasicTinkerFluid nitroniteFluid = new BasicTinkerFluid("nitronite", 0xFFdfe553, true, 680, 10, 2185); public static BasicTinkerFluid nitroniteFluid = new BasicTinkerFluid("nitronite", 0xFFdfe553, true, 680, 10, 2185);
public static BasicTinkerFluid proxideumFluid = new BasicTinkerFluid("proxideum", 0xFF2f7177, true, 700, 9, 3859); public static BasicTinkerFluid proxideumFluid = new BasicTinkerFluid("proxideum", 0xFF2f7177, true, 700, 9, 3859);
public static BasicTinkerFluid noctunyxFluid = new BasicTinkerFluid("noctunyx", 0xFF5f5081, true, 712, 8, 3983); public static BasicTinkerFluid noctunyxFluid = new BasicTinkerFluid("noctunyx", 0xFF5f5081, true, 712, 8, 3983);
public static BasicTinkerFluid imperomiteFluid = new BasicTinkerFluid("imperomite", 0xFFff6642, true, 510, 10, 2353); public static BasicTinkerFluid imperomiteFluid = new BasicTinkerFluid("imperomite", 0xFF5cc96b, true, 510, 10, 2353);
public static BasicTinkerFluid cryptogenFluid = new BasicTinkerFluid("cryptogen", 0xFF9f8a4a, true, 560, 10, 3243); public static BasicTinkerFluid cryptogenFluid = new BasicTinkerFluid("cryptogen", 0xFF9f8a4a, true, 560, 10, 3243);
public static BasicTinkerFluid fractoryteFluid = new BasicTinkerFluid("fractoryte", 0xFF983f11, true, 670, 8, 3805); public static BasicTinkerFluid fractoryteFluid = new BasicTinkerFluid("fractoryte", 0xFF983f11, true, 670, 8, 3805);
public static BasicTinkerFluid seismodiumFluid = new BasicTinkerFluid("seismodium", 0xFF46131D, true, 831, 10, 1837); public static BasicTinkerFluid seismodiumFluid = new BasicTinkerFluid("seismodium", 0xFF46131D, true, 831, 10, 1837);
@@ -105,9 +105,10 @@ public class Fluids {
registerMelting(Blocks.OBSIDIAN, FluidRegistry.LAVA, 432); registerMelting(Blocks.OBSIDIAN, FluidRegistry.LAVA, 432);
registerMelting(Blocks.NETHERRACK, FluidRegistry.LAVA, 48); registerMelting(Blocks.NETHERRACK, FluidRegistry.LAVA, 48);
registerMelting(Blocks.STONE, FluidRegistry.LAVA, 144); registerMelting(Blocks.STONE, FluidRegistry.LAVA, 144);
registerMelting(slaggoldOre, TinkerFluids.gold, 16);
registerMelting(slagironOre, TinkerFluids.iron, 16); registerMelting(slagironOre, TinkerFluids.iron, 16);
registerMelting(slagironIngot, TinkerFluids.iron, 24); registerMelting(slagironIngot, TinkerFluids.iron, 24);
registerMelting(slaggoldOre, TinkerFluids.gold, 16);
registerMelting(slaggoldIngot, TinkerFluids.gold, 24); registerMelting(slaggoldIngot, TinkerFluids.gold, 24);
} }
} }

View File

@@ -116,6 +116,11 @@ public class Items {
Class<?> targetType = field.getType(); Class<?> targetType = field.getType();
try { try {
Item item = (Item) field.get(targetType); // Gets the field as a BasicItem which is then casted to an Item Item item = (Item) field.get(targetType); // Gets the field as a BasicItem which is then casted to an Item
if (item.equals(iron_nugget) && OreDictionary.doesOreNameExist("nuggetIron")) {
System.out.println("TAIGA: Skipped registration of nuggetIron which already exists.");
continue;
}
item.setCreativeTab(CreativeTab.tabTaigaItem);
GameRegistry.register(item); // Registers the item into the game GameRegistry.register(item); // Registers the item into the game
if (item instanceof BasicItem) { // Checks that the item is a BasicItem if (item instanceof BasicItem) { // Checks that the item is a BasicItem
if (((BasicItem) item).isOreDict()) { // Checks if this item should be registered into the oreDict and registers it if (((BasicItem) item).isOreDict()) { // Checks if this item should be registered into the oreDict and registers it

View File

@@ -1,9 +1,9 @@
package com.sosnitzka.taiga; package com.sosnitzka.taiga;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.sosnitzka.taiga.proxy.ServerProxy; import com.sosnitzka.taiga.proxy.CommonProxy;
import com.sosnitzka.taiga.recipes.Crafting; import com.sosnitzka.taiga.recipes.CraftingRegistry;
import com.sosnitzka.taiga.recipes.Smelting; import com.sosnitzka.taiga.recipes.SmeltingRegistry;
import com.sosnitzka.taiga.util.FuelHandler; import com.sosnitzka.taiga.util.FuelHandler;
import com.sosnitzka.taiga.world.ZWorldGen; import com.sosnitzka.taiga.world.ZWorldGen;
import net.minecraft.item.Item; import net.minecraft.item.Item;
@@ -29,21 +29,25 @@ import java.util.List;
import static com.sosnitzka.taiga.Fluids.*; import static com.sosnitzka.taiga.Fluids.*;
import static com.sosnitzka.taiga.MaterialTraits.*; import static com.sosnitzka.taiga.MaterialTraits.*;
import static com.sosnitzka.taiga.TAIGAConfiguration.*;
import static slimeknights.tconstruct.library.utils.HarvestLevels.*; import static slimeknights.tconstruct.library.utils.HarvestLevels.*;
@Mod(modid = TAIGA.MODID, version = TAIGA.VERSION, dependencies = "required-after:tconstruct@[1.10-2.3.3,);" + "required-after:mantle@[1.10-0.10.3,)") @Mod(modid = TAIGA.MODID, version = TAIGA.VERSION, guiFactory = TAIGA.GUIFACTORY, dependencies = "required-after:tconstruct@[1.10-2.3.3,);" + "required-after:mantle@[1.10-0.10.3,)")
public class TAIGA { public class TAIGA {
public static final String MODID = "taiga"; public static final String MODID = "taiga";
public static final String VERSION = "${version}"; public static final String VERSION = "${version}";
public static final String GUIFACTORY = "com.sosnitzka.taiga.TAIGAGuiFactory";
@SidedProxy(clientSide = "com.sosnitzka.taiga.proxy.ClientProxy", serverSide = "com.sosnitzka.taiga.proxy.ServerProxy") @SidedProxy(clientSide = "com.sosnitzka.taiga.proxy.ClientProxy", serverSide = "com.sosnitzka.taiga.proxy.CommonProxy")
public static ServerProxy proxy; public static CommonProxy proxy;
private List<MaterialIntegration> integrateList = Lists.newArrayList(); // List of materials needed to be integrated private List<MaterialIntegration> integrateList = Lists.newArrayList(); // List of materials needed to be integrated
@EventHandler @EventHandler
public void preInit(FMLPreInitializationEvent e) { public void preInit(FMLPreInitializationEvent e) {
proxy.initConfig();
Items.register(); // Registers items and its oreDict Items.register(); // Registers items and its oreDict
Blocks.register(); // Registers blocks and its items form a long with its oreDict Blocks.register(); // Registers blocks and its items form a long with its oreDict
Fluids.register(); // Registers all fluids and its buckets Fluids.register(); // Registers all fluids and its buckets
@@ -58,8 +62,8 @@ public class TAIGA {
proxy.registerModels(); // Registers models on the client side proxy.registerModels(); // Registers models on the client side
GameRegistry.registerWorldGenerator(new ZWorldGen(), 100); // Generates ores GameRegistry.registerWorldGenerator(new ZWorldGen(), 100); // Generates ores
GameRegistry.registerFuelHandler(new FuelHandler()); // Registeres fuels' burn times GameRegistry.registerFuelHandler(new FuelHandler()); // Registeres fuels' burn times
Smelting.register(); // Registers smelting recipes SmeltingRegistry.register(); // Registers smelting recipes
Crafting.register(); // Registers crafting recipes CraftingRegistry.register(); // Registers crafting recipes
// Adds new harvest levels' names // Adds new harvest levels' names
harvestLevelNames.put(METEORITE, TinkerMaterials.bone.getTextColor() + "Meteorite"); harvestLevelNames.put(METEORITE, TinkerMaterials.bone.getTextColor() + "Meteorite");
@@ -70,8 +74,6 @@ public class TAIGA {
for (MaterialIntegration m : integrateList) { for (MaterialIntegration m : integrateList) {
m.integrateRecipes(); m.integrateRecipes();
} }
} }
@EventHandler @EventHandler
@@ -93,7 +95,6 @@ public class TAIGA {
* @param craft Can craft parts in part builder * @param craft Can craft parts in part builder
* @param cast Can craft parts by casting with fluid (smeltery) * @param cast Can craft parts by casting with fluid (smeltery)
*/ */
private void registerTinkerMaterial(String oreSuffix, Material material, Fluid fluid, int headDura, float headSpeed, float headAttack, float handleMod, int handleDura, int extra, int headLevel, boolean craft, boolean cast) { private void registerTinkerMaterial(String oreSuffix, Material material, Fluid fluid, int headDura, float headSpeed, float headAttack, float handleMod, int handleDura, int extra, int headLevel, boolean craft, boolean cast) {
TinkerRegistry.addMaterialStats(material, new HeadMaterialStats(headDura, headSpeed, headAttack, headLevel)); TinkerRegistry.addMaterialStats(material, new HeadMaterialStats(headDura, headSpeed, headAttack, headLevel));
TinkerRegistry.addMaterialStats(material, new HandleMaterialStats(handleMod, handleDura)); TinkerRegistry.addMaterialStats(material, new HandleMaterialStats(handleMod, handleDura));
@@ -127,42 +128,50 @@ public class TAIGA {
* Registers materials and associated fluids and stats into tconstruct * Registers materials and associated fluids and stats into tconstruct
*/ */
private void registerTinkerMaterials() { private void registerTinkerMaterials() {
double d = durabilityFactorGeneral;
System.out.println("DURABILITY FACTOR" + d);
float s = (float) speedFactorGeneral;
System.out.println("SPEED FACTOR" + s);
float a = (float) attackFactorGeneral;
System.out.println("ATTACK FACTOR" + a);
// ARCANE ORES // ARCANE ORES
registerTinkerMaterial("Tiberium", tiberium, tiberiumFluid, 223, 6.2f, 8.35f, 0.63f, 50, 50, OBSIDIAN, false, true); registerTinkerMaterial("Tiberium", tiberium, tiberiumFluid, (int) (223 * d), 6.2f * s, 8.35f * a, 0.63f, 50, 50, OBSIDIAN, false, true);
registerTinkerMaterial("Rubium", rubium, rubiumFluid, 351, 5.15f, 7.00f, 1.05f, -100, 250, COBALT, false, true); registerTinkerMaterial("Rubium", rubium, rubiumFluid, (int) (351 * d), 5.15f * s, 7.00f * a, 1.05f, -100, 250, COBALT, false, true);
registerTinkerMaterial("Prometheum", prometheum, prometheumFluid, 539, 3.6f, 6.60f, 0.90f, 0, 150, TITANITE, false, true); registerTinkerMaterial("Prometheum", prometheum, prometheumFluid, (int) (539 * d), 3.6f * s, 6.60f, 0.90f, 0, 150, TITANITE, false, true);
registerTinkerMaterial("Arcanite", arcanite, arcaniteFluid, 698, 4.3f, 7.88f, 0.85f, -50, 150, METEORITE, false, true); registerTinkerMaterial("Arcanite", arcanite, arcaniteFluid, (int) (698 * d), 4.3f * s, 7.88f * a, 0.85f, -50, 150, METEORITE, false, true);
// SOLIDE ORES // SOLIDE ORES
registerTinkerMaterial("Titanite", titanite, titaniteFluid, 811, 4.8f, 6.40f, 1.00f, -50, 150, TITANITE, false, true); registerTinkerMaterial("Titanite", titanite, titaniteFluid, (int) (811 * d), 4.8f * s, 6.40f * a, 1.00f, -50, 150, TITANITE, false, true);
registerTinkerMaterial("Meteorite", meteorite, meteoriteFluid, 823, 6.1f, 6.83f, 1.20f, -50, 200, METEORITE, false, true); registerTinkerMaterial("Meteorite", meteorite, meteoriteFluid, (int) (823 * d), 6.1f * s, 6.83f * a, 1.20f, -50, 200, METEORITE, false, true);
registerTinkerMaterial("Vibranium", vibranium, vibraniumFluid, 917, 7.45f, 7.17f, 1.15f, 50, 150, VIBRANIUM, false, true); registerTinkerMaterial("Vibranium", vibranium, vibraniumFluid, (int) (917 * d), 7.45f * s, 7.17f * a, 1.15f, 50, 150, VIBRANIUM, false, true);
registerTinkerMaterial("Adamantite", adamantite, adamantiteFluid, 981, 8.9f, 9.11f, 1.20f, -200, 300, ADAMANTITE, false, true); registerTinkerMaterial("Adamantite", adamantite, adamantiteFluid, (int) (981 * d), 8.9f * s, 9.11f * a, 1.20f, -200, 300, ADAMANTITE, false, true);
// ETHERE ORES // ETHERE ORES
registerTinkerMaterial("Eternite", eternite, eterniteFluid, 592, 7.35f, 1.95f, 1.10f, 150, 150, COBALT, false, true); registerTinkerMaterial("Eternite", eternite, eterniteFluid, (int) (592 * d), 7.35f * s, 1.95f * a, 1.10f, 150, 150, COBALT, false, true);
registerTinkerMaterial("Mythril", mythril, mythrilFluid, 552, 8.75f, 2.87f, 0.98f, -100, 200, TITANITE, false, true); registerTinkerMaterial("Mythril", mythril, mythrilFluid, (int) (552 * d), 8.75f * s, 2.87f * a, 0.98f, -100, 200, TITANITE, false, true);
registerTinkerMaterial("Palladium", palladium, palladiumFluid, 578, 10.4f, 3.13f, 1.09f, 0, 100, METEORITE, false, true); registerTinkerMaterial("Palladium", palladium, palladiumFluid, (int) (578 * d), 10.4f * s, 3.13f * a, 1.09f, 0, 100, METEORITE, false, true);
registerTinkerMaterial("Ignitite", ignitite, ignititeFluid, 673, 12.1f, 4.10f, 1.15f, -50, 150, VIBRANIUM, false, true); registerTinkerMaterial("Ignitite", ignitite, ignititeFluid, (int) (673 * d), 12.1f * s, 4.10f * a, 1.15f, -50, 150, VIBRANIUM, false, true);
// RATIO ORES // RATIO ORES
registerTinkerMaterial("Bismuth", bismuth, bismuthFluid, 235, 5.33f, 3.80f, 1.15f, 17, 117, OBSIDIAN, false, true); registerTinkerMaterial("Bismuth", bismuth, bismuthFluid, (int) (235 * d), 5.33f * s, 3.80f * a, 1.15f, 17, 117, OBSIDIAN, false, true);
registerTinkerMaterial("Violium", violium, violiumFluid, 427, 4.2f, 3.30f, 1.00f, 133, 150, COBALT, false, true); registerTinkerMaterial("Violium", violium, violiumFluid, (int) (427 * d), 4.2f * s, 3.30f * a, 1.00f, 133, 150, COBALT, false, true);
registerTinkerMaterial("Mindorite", mindorite, mindoriteFluid, 458, 6.41f, 4.40f, 0.90f, 83, 100, TITANITE, false, true); registerTinkerMaterial("Mindorite", mindorite, mindoriteFluid, (int) (458 * d), 6.41f * s, 4.40f * a, 0.90f, 83, 100, TITANITE, false, true);
registerTinkerMaterial("Karmesine", karmesine, karmesineFluid, 627, 6.75f, 5.10f, 0.99f, 0, 200, METEORITE, false, true); registerTinkerMaterial("Karmesine", karmesine, karmesineFluid, (int) (627 * d), 6.75f * s, 5.10f * a, 0.99f, 0, 200, METEORITE, false, true);
// Material from alloys // Material from alloys
registerTinkerMaterial("Nitronite", nitronite, nitroniteFluid, 745, 6.74f, 8.74f, 0.85f, 75, 93, TITANITE, false, true); registerTinkerMaterial("Nitronite", nitronite, nitroniteFluid, (int) (745 * d), 6.74f * s, 8.74f * a, 0.85f, 75, 93, TITANITE, false, true);
registerTinkerMaterial("Bysmuid", bysmuid, bysmuidFluid, 305, 5.22f, 6.47f, 1.09f, -80, 197, COBALT, false, true); registerTinkerMaterial("Bysmuid", bysmuid, bysmuidFluid, (int) (305 * d), 5.22f * s, 6.47f * a, 1.09f, -80, 197, COBALT, false, true);
registerTinkerMaterial("Ultranite", ultranite, ultraniteFluid, 1016, 5.72f, 6.76f, 1.02f, -120, 210, VIBRANIUM, false, true); registerTinkerMaterial("Ultranite", ultranite, ultraniteFluid, (int) (1016 * d), 5.72f * s, 6.76f * a, 1.02f, -120, 210, VIBRANIUM, false, true);
registerTinkerMaterial("Astrium", astrium, astriumFluid, 670, 5.28f, 9.14f, 0.91f, -45, 170, VIBRANIUM, false, true); registerTinkerMaterial("Astrium", astrium, astriumFluid, (int) (670 * d), 5.28f * s, 9.14f * a, 0.91f, -45, 170, VIBRANIUM, false, true);
registerTinkerMaterial("Imperomite", imperomite, imperomiteFluid, 770, 11.60f, 3.57f, 1.05f, -38, 125, METEORITE, false, true); registerTinkerMaterial("Imperomite", imperomite, imperomiteFluid, (int) (770 * d), 11.60f * s, 3.57f * a, 1.05f, -38, 125, METEORITE, false, true);
registerTinkerMaterial("Dyonite", dyonite, dyoniteFluid, 733, 6.14f, 7.69f, 0.97f, -15, 140, TITANITE, false, true); registerTinkerMaterial("Dyonite", dyonite, dyoniteFluid, (int) (733 * d), 6.14f * s, 7.69f * a, 0.97f, -15, 140, TITANITE, false, true);
registerTinkerMaterial("Solarium", solarium, solariumFluid, 1020, 13.78f, 4.64f, 1.15f, 0, 150, ADAMANTITE, false, true); registerTinkerMaterial("Solarium", solarium, solariumFluid, (int) (1020 * d), 13.78f * s, 4.64f * a, 1.15f, 0, 150, ADAMANTITE, false, true);
registerTinkerMaterial("Fractoryte", fractoryte, fractoryteFluid, 1071, 7.65f, 7.75f, 1.15f, -250, 283, METEORITE, false, true); registerTinkerMaterial("Fractoryte", fractoryte, fractoryteFluid, (int) (1071 * d), 7.65f * s, 7.75f * a, 1.15f, -250, 283, METEORITE, false, true);
registerTinkerMaterial("Aegisalt", aegisalt, aegisaltFluid, 355, 8.88f, 3.18f, 1.00f, 175, 125, TITANITE, false, true); registerTinkerMaterial("Aegisalt", aegisalt, aegisaltFluid, (int) (355 * d), 8.88f * s, 3.18f * a, 1.00f, 175, 125, TITANITE, false, true);
registerTinkerMaterial("Noctunyx", noctunyx, noctunyxFluid, 713, 10.43f, 3.25f, 0.99f, -125, 183, METEORITE, false, true); registerTinkerMaterial("Noctunyx", noctunyx, noctunyxFluid, (int) (713 * d), 10.43f * s, 3.25f * a, 0.99f, -125, 183, METEORITE, false, true);
registerTinkerMaterial("Nucleum", nucleum, nucleumFluid, 503, 11.30f, 3.22f, 1.05f, 100, 125, TITANITE, false, true); registerTinkerMaterial("Nucleum", nucleum, nucleumFluid, (int) (503 * d), 11.30f * s, 3.22f * a, 1.05f, 100, 125, TITANITE, false, true);
registerTinkerMaterial("Seismodium", seismodium, seismodiumFluid, 879, 13.85f, 4.19f, 1.17f, -75, 169, VIBRANIUM, false, true); registerTinkerMaterial("Seismodium", seismodium, seismodiumFluid, (int) (879 * d), 13.85f * s, 4.19f * a, 1.17f, -75, 169, VIBRANIUM, false, true);
registerTinkerMaterial("Lumixyl", lumixyl, lumixylFluid, 357, 4.64f, 5.92f, 1.05f, 15, 130, COBALT, false, true); registerTinkerMaterial("Lumixyl", lumixyl, lumixylFluid, (int) (357 * d), 4.64f * s, 5.92f * a, 1.05f, 15, 130, COBALT, false, true);
registerTinkerMaterial("Terramite", terramite, terramiteFluid, 482, 7.25f, 2.85f, 1.03f, 208, 150, TITANITE, false, true); registerTinkerMaterial("Terramite", terramite, terramiteFluid, (int) (482 * d), 7.25f * s, 2.85f * a, 1.03f, 208, 150, TITANITE, false, true);
registerTinkerMaterial("Cryptogen", cryptogen, cryptogenFluid, 538, 5.71f, 6.93f, 0.88f, 58, 117, METEORITE, false, true); registerTinkerMaterial("Cryptogen", cryptogen, cryptogenFluid, (int) (538 * d), 5.71f * s, 6.93f * a, 0.88f, 58, 117, METEORITE, false, true);
registerTinkerMaterial("Proxideum", proxideum, proxideumFluid, 597, 10.55f, 4.21f, 0.99f, -60, 200, METEORITE, false, true); registerTinkerMaterial("Proxideum", proxideum, proxideumFluid, (int) (597 * d), 10.55f * s, 4.21f * a, 0.99f, -60, 200, METEORITE, false, true);
} }
} }

View File

@@ -0,0 +1,387 @@
package com.sosnitzka.taiga;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
import net.minecraftforge.fml.client.event.ConfigChangedEvent;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
public class TAIGAConfiguration {
public static final String CATEGORY_NAME_GENERAL = "category_general";
public static final String CATEGORY_NAME_ORE_GEN = "category_ore_gen";
public static final String CATEGORY_NAME_ORE_VAL = "category_ore_val";
public static double oreFactorGeneral;
public static double speedFactorGeneral;
public static double attackFactorGeneral;
public static double durabilityFactorGeneral;
public static double ironFactor;
public static double slagironFactor;
public static double slaggoldFactor;
public static double titaniteFactor;
public static double adamantiteFactor;
public static double arcaniteFactor;
public static double violiumFactor;
public static double bismuthFactor;
public static double eterniteFactor;
public static double ignititeFactor;
public static double karmesineFactor;
public static double meteoriteFactor;
public static double mindoriteFactor;
public static double mythrilFactor;
public static double palladiumFactor;
public static double prometheumFactor;
public static double tiberiumFactor;
public static double vibraniumFactor;
public static double rubiumFactor;
public static double basaltFactor;
public static double rottengroundFactor;
public static double ligniteFactor;
public static boolean slagIronGen;
public static boolean slagGoldGen;
public static boolean ironGen;
private static Configuration config = null;
public static void preInit() {
File configFile = new File(Loader.instance().getConfigDir(), "TAIGA.cfg");
config = new Configuration(configFile);
syncFromFile();
}
public static void clientPreInit() {
MinecraftForge.EVENT_BUS.register(new ConfigEventHandler());
}
public static Configuration getConfig() {
return config;
}
public static void syncFromFile() {
syncConfig(true, true);
}
public static void syncFromGUI() {
syncConfig(false, true);
}
public static void syncFromFields() {
syncConfig(false, false);
}
private static void syncConfig(boolean loadConfigFromFile, boolean readFieldsFromConfig) {
if (loadConfigFromFile) {
config.load();
}
/**
* Declaration of general ore generation values: <br>
* Activation of additional ores (iron/gold) <br>
* Ore generation chance multiplier
*/
final boolean GENERATION_DEFAULT_VALUE = true;
final double RESFAC_MIN_VALUE = 0;
final double RESFAC_MAX_VALUE = 9999;
final double RESFAC_DEFAULT_VALUE = 1.0;
Property slagIronSwitch = config.get(CATEGORY_NAME_GENERAL, "SlagIron Switch", GENERATION_DEFAULT_VALUE);
slagIronSwitch.setComment("Switch ore on/off");
slagIronSwitch.setLanguageKey("gui.taiga_configuration.gen_slagiron");
Property slagGoldSwitch = config.get(CATEGORY_NAME_GENERAL, "SlagGold Switch", GENERATION_DEFAULT_VALUE);
slagGoldSwitch.setComment("Switch ore on/off");
slagGoldSwitch.setLanguageKey("gui.taiga_configuration.gen_slaggold");
Property ironSwitch = config.get(CATEGORY_NAME_GENERAL, "Extra Iron Switch", GENERATION_DEFAULT_VALUE);
ironSwitch.setComment("Switch ore on/off");
ironSwitch.setLanguageKey("gui.taiga_configuration.gen_iron");
Property oreFactorGeneralProp = config.get(CATEGORY_NAME_GENERAL, "Ore factor", RESFAC_DEFAULT_VALUE,
"General multiplier for all TAIGA ores at once", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
oreFactorGeneralProp.setLanguageKey("gui.taiga_configuration.ore_multiplier");
Property durabilityFactorGeneralProp = config.get(CATEGORY_NAME_GENERAL, "Durability factor", RESFAC_DEFAULT_VALUE,
"General multiplier for all TAIGA materials", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
durabilityFactorGeneralProp.setLanguageKey("gui.taiga_configuration.durability_multiplier");
durabilityFactorGeneralProp.setRequiresMcRestart(true);
Property speedFactorGeneralProp = config.get(CATEGORY_NAME_GENERAL, "Speed factor", RESFAC_DEFAULT_VALUE,
"General multiplier for all TAIGA materials", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
speedFactorGeneralProp.setLanguageKey("gui.taiga_configuration.speed_multiplier");
speedFactorGeneralProp.setRequiresMcRestart(true);
Property attackFactorGeneralProp = config.get(CATEGORY_NAME_GENERAL, "Attack factor", RESFAC_DEFAULT_VALUE,
"General multiplier for all TAIGA materials", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
attackFactorGeneralProp.setLanguageKey("gui.taiga_configuration.attack_multiplier");
attackFactorGeneralProp.setRequiresMcRestart(true);
List<String> propOrderGeneral = new ArrayList<String>();
propOrderGeneral.add(ironSwitch.getName());
propOrderGeneral.add(slagIronSwitch.getName());
propOrderGeneral.add(slagGoldSwitch.getName());
propOrderGeneral.add(oreFactorGeneralProp.getName());
propOrderGeneral.add(durabilityFactorGeneralProp.getName());
propOrderGeneral.add(speedFactorGeneralProp.getName());
propOrderGeneral.add(attackFactorGeneralProp.getName());
config.setCategoryPropertyOrder(CATEGORY_NAME_GENERAL, propOrderGeneral);
/**
* Declaration of specific ore generation values: <br>
* Generation chance multiplier
*/
Property ironFactorProp = config.get(CATEGORY_NAME_ORE_GEN, "Iron factor", RESFAC_DEFAULT_VALUE,
"specific generation multiplier", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
ironFactorProp.setLanguageKey("gui.taiga_configuration.titanite_multiplier");
Property slagironFactorProp = config.get(CATEGORY_NAME_ORE_GEN, "Slagiorn factor", RESFAC_DEFAULT_VALUE,
"specific generation multiplier", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
slagironFactorProp.setLanguageKey("gui.taiga_configuration.titanite_multiplier");
Property slaggoldFactorProp = config.get(CATEGORY_NAME_ORE_GEN, "Slaggold factor", RESFAC_DEFAULT_VALUE,
"specific generation multiplier", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
slaggoldFactorProp.setLanguageKey("gui.taiga_configuration.titanite_multiplier");
Property titaniteFactorProp = config.get(CATEGORY_NAME_ORE_GEN, "Titanite factor", RESFAC_DEFAULT_VALUE,
"specific generation multiplier", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
titaniteFactorProp.setLanguageKey("gui.taiga_configuration.titanite_multiplier");
Property adamantiteFactorProp = config.get(CATEGORY_NAME_ORE_GEN, "Adamantite factor", RESFAC_DEFAULT_VALUE,
"specific generation multiplier", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
adamantiteFactorProp.setLanguageKey("gui.taiga_configuration.adamantite_multiplier");
Property arcaniteFactorProp = config.get(CATEGORY_NAME_ORE_GEN, "Arcanite factor", RESFAC_DEFAULT_VALUE,
"specific generation multiplier", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
arcaniteFactorProp.setLanguageKey("gui.taiga_configuration.arcanite_multiplier");
Property violiumFactorProp = config.get(CATEGORY_NAME_ORE_GEN, "Violium factor", RESFAC_DEFAULT_VALUE,
"specific generation multiplier", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
violiumFactorProp.setLanguageKey("gui.taiga_configuration.violium_multiplier");
Property bismuthFactorProp = config.get(CATEGORY_NAME_ORE_GEN, "Bismuth factor", RESFAC_DEFAULT_VALUE,
"specific generation multiplier", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
bismuthFactorProp.setLanguageKey("gui.taiga_configuration.bismuth_multiplier");
Property eterniteFactorProp = config.get(CATEGORY_NAME_ORE_GEN, "Eternite factor", RESFAC_DEFAULT_VALUE,
"specific generation multiplier", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
eterniteFactorProp.setLanguageKey("gui.taiga_configuration.eternite_multiplier");
Property ignititeFactorProp = config.get(CATEGORY_NAME_ORE_GEN, "Ignitite factor", RESFAC_DEFAULT_VALUE,
"specific generation multiplier", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
ignititeFactorProp.setLanguageKey("gui.taiga_configuration.ignitite_multiplier");
Property karmesineFactorProp = config.get(CATEGORY_NAME_ORE_GEN, "Karmesine factor", RESFAC_DEFAULT_VALUE,
"specific generation multiplier", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
karmesineFactorProp.setLanguageKey("gui.taiga_configuration.karmesine_multiplier");
Property meteoriteFactorProp = config.get(CATEGORY_NAME_ORE_GEN, "Meteorite factor", RESFAC_DEFAULT_VALUE,
"specific generation multiplier", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
meteoriteFactorProp.setLanguageKey("gui.taiga_configuration.meteorite_multiplier");
Property mindoriteFactorProp = config.get(CATEGORY_NAME_ORE_GEN, "Mindorite factor", RESFAC_DEFAULT_VALUE,
"specific generation multiplier", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
mindoriteFactorProp.setLanguageKey("gui.taiga_configuration.mindorite_multiplier");
Property mythrilFactorProp = config.get(CATEGORY_NAME_ORE_GEN, "Mythril factor", RESFAC_DEFAULT_VALUE,
"specific generation multiplier", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
mythrilFactorProp.setLanguageKey("gui.taiga_configuration.mythril_multiplier");
Property palladiumFactorProp = config.get(CATEGORY_NAME_ORE_GEN, "Palladium factor", RESFAC_DEFAULT_VALUE,
"specific generation multiplier", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
palladiumFactorProp.setLanguageKey("gui.taiga_configuration.palladium_multiplier");
Property prometheumFactorProp = config.get(CATEGORY_NAME_ORE_GEN, "Prometheum factor", RESFAC_DEFAULT_VALUE,
"specific generation multiplier", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
prometheumFactorProp.setLanguageKey("gui.taiga_configuration.prometheum_multiplier");
Property tiberiumFactorProp = config.get(CATEGORY_NAME_ORE_GEN, "Tiberium factor", RESFAC_DEFAULT_VALUE,
"specific generation multiplier", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
tiberiumFactorProp.setLanguageKey("gui.taiga_configuration.tiberium_multiplier");
Property vibraniumFactorProp = config.get(CATEGORY_NAME_ORE_GEN, "Vibranium factor", RESFAC_DEFAULT_VALUE,
"specific generation multiplier", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
vibraniumFactorProp.setLanguageKey("gui.taiga_configuration.vibranium_multiplier");
Property rubiumFactorProp = config.get(CATEGORY_NAME_ORE_GEN, "Rubium factor", RESFAC_DEFAULT_VALUE,
"specific generation multiplier", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
rubiumFactorProp.setLanguageKey("gui.taiga_configuration.rubium_multiplier");
// RottenGround + Basalt
Property basaltFactorProp = config.get(CATEGORY_NAME_ORE_GEN, "Basalt factor", RESFAC_DEFAULT_VALUE,
"specific generation multiplier", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
basaltFactorProp.setLanguageKey("gui.taiga_configuration.basalt_multiplier");
Property rottengroundFactorProp = config.get(CATEGORY_NAME_ORE_GEN, "RottenGround factor", RESFAC_DEFAULT_VALUE,
"specific generation multiplier", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
rottengroundFactorProp.setLanguageKey("gui.taiga_configuration.rottenground_multiplier");
Property ligniteFactorProp = config.get(CATEGORY_NAME_ORE_GEN, "Lignite factor", RESFAC_DEFAULT_VALUE,
"specific generation multiplier", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
ligniteFactorProp.setLanguageKey("gui.taiga_configuration.lignite_multiplier");
List<String> propOrderOreGen = new ArrayList<String>();
propOrderOreGen.add(ironFactorProp.getName());
propOrderOreGen.add(slagironFactorProp.getName());
propOrderOreGen.add(slaggoldFactorProp.getName());
propOrderOreGen.add(ligniteFactorProp.getName());
propOrderOreGen.add(basaltFactorProp.getName());
propOrderOreGen.add(rottengroundFactorProp.getName());
propOrderOreGen.add(titaniteFactorProp.getName());
propOrderOreGen.add(adamantiteFactorProp.getName());
propOrderOreGen.add(arcaniteFactorProp.getName());
propOrderOreGen.add(violiumFactorProp.getName());
propOrderOreGen.add(bismuthFactorProp.getName());
propOrderOreGen.add(eterniteFactorProp.getName());
propOrderOreGen.add(ignititeFactorProp.getName());
propOrderOreGen.add(karmesineFactorProp.getName());
propOrderOreGen.add(meteoriteFactorProp.getName());
propOrderOreGen.add(mindoriteFactorProp.getName());
propOrderOreGen.add(mythrilFactorProp.getName());
propOrderOreGen.add(palladiumFactorProp.getName());
propOrderOreGen.add(prometheumFactorProp.getName());
propOrderOreGen.add(tiberiumFactorProp.getName());
propOrderOreGen.add(vibraniumFactorProp.getName());
propOrderOreGen.add(rubiumFactorProp.getName());
config.setCategoryPropertyOrder(CATEGORY_NAME_ORE_GEN, propOrderOreGen);
List<String> propOrderOreVal = new ArrayList<String>();
config.setCategoryPropertyOrder(CATEGORY_NAME_ORE_VAL, propOrderOreVal);
if (readFieldsFromConfig) {
oreFactorGeneral = oreFactorGeneralProp.getDouble(RESFAC_DEFAULT_VALUE);
if (oreFactorGeneral > RESFAC_MAX_VALUE || oreFactorGeneral < RESFAC_MIN_VALUE) {
oreFactorGeneral = RESFAC_DEFAULT_VALUE;
}
durabilityFactorGeneral = durabilityFactorGeneralProp.getDouble(RESFAC_DEFAULT_VALUE);
if (durabilityFactorGeneral > RESFAC_MAX_VALUE || durabilityFactorGeneral < RESFAC_MIN_VALUE) {
durabilityFactorGeneral = RESFAC_DEFAULT_VALUE;
}
speedFactorGeneral = speedFactorGeneralProp.getDouble(RESFAC_DEFAULT_VALUE);
if (speedFactorGeneral > RESFAC_MAX_VALUE || speedFactorGeneral < RESFAC_MIN_VALUE) {
speedFactorGeneral = RESFAC_DEFAULT_VALUE;
}
attackFactorGeneral = attackFactorGeneralProp.getDouble(RESFAC_DEFAULT_VALUE);
if (attackFactorGeneral > RESFAC_MAX_VALUE || attackFactorGeneral < RESFAC_MIN_VALUE) {
attackFactorGeneral = RESFAC_DEFAULT_VALUE;
}
ironGen = ironSwitch.getBoolean(GENERATION_DEFAULT_VALUE);
slagIronGen = slagIronSwitch.getBoolean(GENERATION_DEFAULT_VALUE);
slagGoldGen = slagGoldSwitch.getBoolean(GENERATION_DEFAULT_VALUE);
ironFactor = ironFactorProp.getDouble(RESFAC_DEFAULT_VALUE);
if (ironFactor > RESFAC_MAX_VALUE || ironFactor < RESFAC_MIN_VALUE) {
ironFactor = RESFAC_DEFAULT_VALUE;
}
slagironFactor = slagironFactorProp.getDouble(RESFAC_DEFAULT_VALUE);
if (slagironFactor > RESFAC_MAX_VALUE || slagironFactor < RESFAC_MIN_VALUE) {
slagironFactor = RESFAC_DEFAULT_VALUE;
}
slaggoldFactor = slaggoldFactorProp.getDouble(RESFAC_DEFAULT_VALUE);
if (slaggoldFactor > RESFAC_MAX_VALUE || slaggoldFactor < RESFAC_MIN_VALUE) {
slaggoldFactor = RESFAC_DEFAULT_VALUE;
}
titaniteFactor = titaniteFactorProp.getDouble(RESFAC_DEFAULT_VALUE);
if (titaniteFactor > RESFAC_MAX_VALUE || titaniteFactor < RESFAC_MIN_VALUE) {
titaniteFactor = RESFAC_DEFAULT_VALUE;
}
adamantiteFactor = adamantiteFactorProp.getDouble(RESFAC_DEFAULT_VALUE);
if (adamantiteFactor > RESFAC_MAX_VALUE || adamantiteFactor < RESFAC_MIN_VALUE) {
adamantiteFactor = RESFAC_DEFAULT_VALUE;
}
arcaniteFactor = arcaniteFactorProp.getDouble(RESFAC_DEFAULT_VALUE);
if (arcaniteFactor > RESFAC_MAX_VALUE || arcaniteFactor < RESFAC_MIN_VALUE) {
arcaniteFactor = RESFAC_DEFAULT_VALUE;
}
violiumFactor = violiumFactorProp.getDouble(RESFAC_DEFAULT_VALUE);
if (violiumFactor > RESFAC_MAX_VALUE || violiumFactor < RESFAC_MIN_VALUE) {
violiumFactor = RESFAC_DEFAULT_VALUE;
}
bismuthFactor = bismuthFactorProp.getDouble(RESFAC_DEFAULT_VALUE);
if (bismuthFactor > RESFAC_MAX_VALUE || bismuthFactor < RESFAC_MIN_VALUE) {
bismuthFactor = RESFAC_DEFAULT_VALUE;
}
eterniteFactor = eterniteFactorProp.getDouble(RESFAC_DEFAULT_VALUE);
if (eterniteFactor > RESFAC_MAX_VALUE || eterniteFactor < RESFAC_MIN_VALUE) {
eterniteFactor = RESFAC_DEFAULT_VALUE;
}
ignititeFactor = ignititeFactorProp.getDouble(RESFAC_DEFAULT_VALUE);
if (ignititeFactor > RESFAC_MAX_VALUE || ignititeFactor < RESFAC_MIN_VALUE) {
ignititeFactor = RESFAC_DEFAULT_VALUE;
}
karmesineFactor = karmesineFactorProp.getDouble(RESFAC_DEFAULT_VALUE);
if (karmesineFactor > RESFAC_MAX_VALUE || karmesineFactor < RESFAC_MIN_VALUE) {
karmesineFactor = RESFAC_DEFAULT_VALUE;
}
meteoriteFactor = meteoriteFactorProp.getDouble(RESFAC_DEFAULT_VALUE);
if (meteoriteFactor > RESFAC_MAX_VALUE || meteoriteFactor < RESFAC_MIN_VALUE) {
meteoriteFactor = RESFAC_DEFAULT_VALUE;
}
mindoriteFactor = mindoriteFactorProp.getDouble(RESFAC_DEFAULT_VALUE);
if (mindoriteFactor > RESFAC_MAX_VALUE || mindoriteFactor < RESFAC_MIN_VALUE) {
mindoriteFactor = RESFAC_DEFAULT_VALUE;
}
mythrilFactor = mythrilFactorProp.getDouble(RESFAC_DEFAULT_VALUE);
if (mythrilFactor > RESFAC_MAX_VALUE || mythrilFactor < RESFAC_MIN_VALUE) {
mythrilFactor = RESFAC_DEFAULT_VALUE;
}
palladiumFactor = palladiumFactorProp.getDouble(RESFAC_DEFAULT_VALUE);
if (palladiumFactor > RESFAC_MAX_VALUE || palladiumFactor < RESFAC_MIN_VALUE) {
palladiumFactor = RESFAC_DEFAULT_VALUE;
}
prometheumFactor = prometheumFactorProp.getDouble(RESFAC_DEFAULT_VALUE);
if (prometheumFactor > RESFAC_MAX_VALUE || prometheumFactor < RESFAC_MIN_VALUE) {
prometheumFactor = RESFAC_DEFAULT_VALUE;
}
tiberiumFactor = tiberiumFactorProp.getDouble(RESFAC_DEFAULT_VALUE);
if (tiberiumFactor > RESFAC_MAX_VALUE || tiberiumFactor < RESFAC_MIN_VALUE) {
tiberiumFactor = RESFAC_DEFAULT_VALUE;
}
vibraniumFactor = vibraniumFactorProp.getDouble(RESFAC_DEFAULT_VALUE);
if (vibraniumFactor > RESFAC_MAX_VALUE || vibraniumFactor < RESFAC_MIN_VALUE) {
vibraniumFactor = RESFAC_DEFAULT_VALUE;
}
rubiumFactor = rubiumFactorProp.getDouble(RESFAC_DEFAULT_VALUE);
if (rubiumFactor > RESFAC_MAX_VALUE || rubiumFactor < RESFAC_MIN_VALUE) {
rubiumFactor = RESFAC_DEFAULT_VALUE;
}
basaltFactor = basaltFactorProp.getDouble(RESFAC_DEFAULT_VALUE);
if (basaltFactor > RESFAC_MAX_VALUE || basaltFactor < RESFAC_MIN_VALUE) {
basaltFactor = RESFAC_DEFAULT_VALUE;
}
rottengroundFactor = rottengroundFactorProp.getDouble(RESFAC_DEFAULT_VALUE);
if (rottengroundFactor > RESFAC_MAX_VALUE || rottengroundFactor < RESFAC_MIN_VALUE) {
rottengroundFactor = RESFAC_DEFAULT_VALUE;
}
ligniteFactor = ligniteFactorProp.getDouble(RESFAC_DEFAULT_VALUE);
if (ligniteFactor > RESFAC_MAX_VALUE || ligniteFactor < RESFAC_MIN_VALUE) {
ligniteFactor = RESFAC_DEFAULT_VALUE;
}
}
ironSwitch.set(ironGen);
slagIronSwitch.set(slagIronGen);
slagGoldSwitch.set(slagGoldGen);
oreFactorGeneralProp.set(oreFactorGeneral);
durabilityFactorGeneralProp.set(durabilityFactorGeneral);
speedFactorGeneralProp.set(speedFactorGeneral);
attackFactorGeneralProp.set(attackFactorGeneral);
titaniteFactorProp.set(titaniteFactor);
adamantiteFactorProp.set(adamantiteFactor);
arcaniteFactorProp.set(arcaniteFactor);
violiumFactorProp.set(violiumFactor);
bismuthFactorProp.set(bismuthFactor);
eterniteFactorProp.set(eterniteFactor);
ignititeFactorProp.set(ignititeFactor);
karmesineFactorProp.set(karmesineFactor);
meteoriteFactorProp.set(meteoriteFactor);
mindoriteFactorProp.set(mindoriteFactor);
mythrilFactorProp.set(mythrilFactor);
palladiumFactorProp.set(palladiumFactor);
prometheumFactorProp.set(prometheumFactor);
tiberiumFactorProp.set(tiberiumFactor);
vibraniumFactorProp.set(vibraniumFactor);
rubiumFactorProp.set(rubiumFactor);
basaltFactorProp.set(basaltFactor);
rottengroundFactorProp.set(rottengroundFactor);
ligniteFactorProp.set(ligniteFactor);
if (config.hasChanged()) {
config.save();
}
}
public static class ConfigEventHandler {
@SubscribeEvent(priority = EventPriority.NORMAL)
public void onEvent(ConfigChangedEvent.OnConfigChangedEvent event) {
if (TAIGA.MODID.equals(event.getModID()) && !event.isWorldRunning()) {
if (event.getConfigID().equals(CATEGORY_NAME_GENERAL) || event.getConfigID().equals(CATEGORY_NAME_ORE_GEN) || event.getConfigID().equals(CATEGORY_NAME_ORE_VAL)) {
syncFromGUI();
}
}
}
}
}

View File

@@ -0,0 +1,100 @@
package com.sosnitzka.taiga;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.resources.I18n;
import net.minecraftforge.common.config.ConfigElement;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.fml.client.IModGuiFactory;
import net.minecraftforge.fml.client.config.DummyConfigElement;
import net.minecraftforge.fml.client.config.GuiConfig;
import net.minecraftforge.fml.client.config.GuiConfigEntries;
import net.minecraftforge.fml.client.config.IConfigElement;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
public class TAIGAGuiFactory implements IModGuiFactory {
@Override
public void initialize(Minecraft minecraftInstance) {
}
@Override
public Class<? extends GuiScreen> mainConfigGuiClass() {
return TAIGAConfigGui.class;
}
@Override
public Set<RuntimeOptionCategoryElement> runtimeGuiCategories() {
return null;
}
@Override
public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) {
return null;
}
public static class TAIGAConfigGui extends GuiConfig {
public TAIGAConfigGui(GuiScreen parentScreen) {
super(parentScreen, getConfigElements(), TAIGA.MODID, false, false, I18n.format("gui.taiga_configuration.mainTitle"));
}
private static List<IConfigElement> getConfigElements() {
List<IConfigElement> list = new ArrayList<IConfigElement>();
list.add(new DummyConfigElement.DummyCategoryElement("Basics configuration", "gui.taiga_configuration.ctgy.general", CategoryEntryGeneral.class));
list.add(new DummyConfigElement.DummyCategoryElement("Specific ore generation", "gui.taiga_configuration.ctgy.oregen", CategoryEntryOreGen.class));
//list.add(new DummyConfigElement.DummyCategoryElement("Specific ore values", "gui.taiga_configuration.ctgy.oreval", CategoryEntryOreVal.class));
return list;
}
public static class CategoryEntryGeneral extends GuiConfigEntries.CategoryEntry {
public CategoryEntryGeneral(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement prop) {
super(owningScreen, owningEntryList, prop);
}
@Override
protected GuiScreen buildChildScreen() {
Configuration configuration = TAIGAConfiguration.getConfig();
ConfigElement cat_general = new ConfigElement(configuration.getCategory(TAIGAConfiguration.CATEGORY_NAME_GENERAL));
List<IConfigElement> propertiesOnThisScreen = cat_general.getChildElements();
String windowTitle = configuration.toString();
return new GuiConfig(this.owningScreen, propertiesOnThisScreen, this.owningScreen.modID, TAIGAConfiguration.CATEGORY_NAME_GENERAL, this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart, this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart, windowTitle);
}
}
public static class CategoryEntryOreGen extends GuiConfigEntries.CategoryEntry {
public CategoryEntryOreGen(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement prop) {
super(owningScreen, owningEntryList, prop);
}
@Override
protected GuiScreen buildChildScreen() {
Configuration configuration = TAIGAConfiguration.getConfig();
ConfigElement cat_general = new ConfigElement(configuration.getCategory(TAIGAConfiguration.CATEGORY_NAME_ORE_GEN));
List<IConfigElement> propertiesOnThisScreen = cat_general.getChildElements();
String windowTitle = configuration.toString();
return new GuiConfig(this.owningScreen, propertiesOnThisScreen, this.owningScreen.modID, TAIGAConfiguration.CATEGORY_NAME_ORE_GEN, this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart, this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart, windowTitle);
}
}
public static class CategoryEntryOreVal extends GuiConfigEntries.CategoryEntry {
public CategoryEntryOreVal(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement prop) {
super(owningScreen, owningEntryList, prop);
}
@Override
protected GuiScreen buildChildScreen() {
Configuration configuration = TAIGAConfiguration.getConfig();
ConfigElement cat_general = new ConfigElement(configuration.getCategory(TAIGAConfiguration.CATEGORY_NAME_ORE_VAL));
List<IConfigElement> propertiesOnThisScreen = cat_general.getChildElements();
String windowTitle = configuration.toString();
return new GuiConfig(this.owningScreen, propertiesOnThisScreen, this.owningScreen.modID, TAIGAConfiguration.CATEGORY_NAME_ORE_VAL, this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart, this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart, windowTitle);
}
}
}
}

View File

@@ -9,6 +9,7 @@ import net.minecraft.util.math.MathHelper;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import javax.annotation.ParametersAreNonnullByDefault;
import java.util.Random; import java.util.Random;
import static com.sosnitzka.taiga.Items.lignite; import static com.sosnitzka.taiga.Items.lignite;
@@ -29,8 +30,9 @@ public class BlockLignite extends BasicBlock {
} }
@Override @Override
@ParametersAreNonnullByDefault
public int quantityDropped(IBlockState state, int fortune, Random random) { public int quantityDropped(IBlockState state, int fortune, Random random) {
return MathHelper.getRandomIntegerInRange(random, 1, 3 + fortune); return random.nextInt(3) + 1 + fortune;
} }
@Override @Override

View File

@@ -11,6 +11,7 @@ import net.minecraft.world.Explosion;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import javax.annotation.ParametersAreNonnullByDefault;
import java.util.Random; import java.util.Random;
import static com.sosnitzka.taiga.util.Utils.PREFIX_ORE; import static com.sosnitzka.taiga.util.Utils.PREFIX_ORE;
@@ -25,13 +26,13 @@ public class BlockTiberium extends BasicBlock {
@Override @Override
public int getExpDrop(IBlockState state, IBlockAccess world, BlockPos pos, int fortune) { public int getExpDrop(IBlockState state, IBlockAccess world, BlockPos pos, int fortune) {
Random rand = world instanceof World ? ((World) world).rand : new Random();
if (random.nextBoolean()) { if (random.nextBoolean()) {
return random.nextInt(10) + fortune; return random.nextInt(10) + fortune;
} else return 0; } else return 0;
} }
@Override @Override
@ParametersAreNonnullByDefault
public int quantityDropped(IBlockState state, int fortune, Random random) { public int quantityDropped(IBlockState state, int fortune, Random random) {
return (random.nextInt(3 + fortune) + 1); return (random.nextInt(3 + fortune) + 1);
} }
@@ -58,5 +59,4 @@ public class BlockTiberium extends BasicBlock {
} }
} }
} }
} }

View File

@@ -36,5 +36,4 @@ public class BasicBlock extends Block {
public String getOreDictPrefix() { public String getOreDictPrefix() {
return this.oreDictPrefix; return this.oreDictPrefix;
} }
} }

View File

@@ -3,6 +3,7 @@ package com.sosnitzka.taiga.proxy;
import com.sosnitzka.taiga.Blocks; import com.sosnitzka.taiga.Blocks;
import com.sosnitzka.taiga.Items; import com.sosnitzka.taiga.Items;
import com.sosnitzka.taiga.TAIGA; import com.sosnitzka.taiga.TAIGA;
import com.sosnitzka.taiga.TAIGAConfiguration;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
@@ -24,7 +25,7 @@ import java.lang.reflect.Field;
import static com.sosnitzka.taiga.MaterialTraits.*; import static com.sosnitzka.taiga.MaterialTraits.*;
public class ClientProxy extends ServerProxy { public class ClientProxy extends CommonProxy {
private static void registerBlockModel(Block block) { private static void registerBlockModel(Block block) {
registerItemModel(Item.getItemFromBlock(block)); registerItemModel(Item.getItemFromBlock(block));
@@ -112,6 +113,12 @@ public class ClientProxy extends ServerProxy {
} }
} }
@Override
public void initConfig() {
super.initConfig();
TAIGAConfiguration.clientPreInit();
}
public static class FluidStateMapper extends StateMapperBase implements ItemMeshDefinition { public static class FluidStateMapper extends StateMapperBase implements ItemMeshDefinition {
public final Fluid fluid; public final Fluid fluid;

View File

@@ -1,9 +1,10 @@
package com.sosnitzka.taiga.proxy; package com.sosnitzka.taiga.proxy;
import com.sosnitzka.taiga.TAIGAConfiguration;
import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.Fluid;
import slimeknights.tconstruct.library.materials.Material; import slimeknights.tconstruct.library.materials.Material;
public class ServerProxy { public class CommonProxy {
public void registerModels() { public void registerModels() {
@@ -15,4 +16,8 @@ public class ServerProxy {
public void registerFluidModels(Fluid fluid) { public void registerFluidModels(Fluid fluid) {
} }
public void initConfig() {
TAIGAConfiguration.preInit();
}
} }

View File

@@ -8,7 +8,7 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
import static com.sosnitzka.taiga.Items.*; import static com.sosnitzka.taiga.Items.*;
import static slimeknights.tconstruct.shared.TinkerCommons.matNecroticBone; import static slimeknights.tconstruct.shared.TinkerCommons.matNecroticBone;
public class Crafting { public class CraftingRegistry {
public static void register() { public static void register() {
GameRegistry.addShapelessRecipe(new ItemStack(fuel_brick), Items.COAL, Items.COAL, Items.COAL, lignite, lignite, lignite); GameRegistry.addShapelessRecipe(new ItemStack(fuel_brick), Items.COAL, Items.COAL, Items.COAL, lignite, lignite, lignite);
@@ -26,7 +26,5 @@ public class Crafting {
GameRegistry.addShapelessRecipe(new ItemStack(nitro_brick), fuel_brick, Items.GUNPOWDER, Items.BLAZE_POWDER); GameRegistry.addShapelessRecipe(new ItemStack(nitro_brick), fuel_brick, Items.GUNPOWDER, Items.BLAZE_POWDER);
GameRegistry.addShapelessRecipe(new ItemStack(anthracite_dust), matNecroticBone, Items.COAL, Items.GUNPOWDER); GameRegistry.addShapelessRecipe(new ItemStack(anthracite_dust), matNecroticBone, Items.COAL, Items.GUNPOWDER);
GameRegistry.addShapelessRecipe(new ItemStack(spectrum_dust), matNecroticBone, glimmerstone_dust); GameRegistry.addShapelessRecipe(new ItemStack(spectrum_dust), matNecroticBone, glimmerstone_dust);
} }
} }

View File

@@ -1,39 +0,0 @@
package com.sosnitzka.taiga.recipes;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.registry.GameRegistry;
import static com.sosnitzka.taiga.Blocks.*;
import static com.sosnitzka.taiga.Items.*;
public class Smelting {
public static void register() {
GameRegistry.addSmelting(slagironOre, new ItemStack(slagironIngot), 1.0F);
GameRegistry.addSmelting(slaggoldOre, new ItemStack(slaggoldIngot), 1.0F);
GameRegistry.addSmelting(slagironIngot, new ItemStack(iron_nugget), 0);
GameRegistry.addSmelting(slaggoldIngot, new ItemStack(Items.GOLD_NUGGET), 0);
GameRegistry.addSmelting(tiberiumOre, new ItemStack(tiberiumShardInstable, 6), (2F));
GameRegistry.addSmelting(tiberiumShardInstable, new ItemStack(tiberiumIngot), (.1F));
// Removed until TiC put its own ores back in.
/* GameRegistry.addSmelting(titaniteOre, new ItemStack(titaniteIngot), RandomUtils.nextFloat(0F, 2F));
GameRegistry.addSmelting(arcaniteOre, new ItemStack(arcaniteIngot), RandomUtils.nextFloat(0F, 2F));
GameRegistry.addSmelting(adamantiteOre, new ItemStack(adamantiteIngot), RandomUtils.nextFloat(0F, 2F));
GameRegistry.addSmelting(violiumOre, new ItemStack(violiumIngot), RandomUtils.nextFloat(0F, 2F));
GameRegistry.addSmelting(bismuthOre, new ItemStack(bismuthIngot), RandomUtils.nextFloat(0F, 2F));
GameRegistry.addSmelting(eterniteOre, new ItemStack(eterniteIngot), RandomUtils.nextFloat(0F, 2F));
GameRegistry.addSmelting(ignititeOre, new ItemStack(ignititeIngot), RandomUtils.nextFloat(0F, 2F));
GameRegistry.addSmelting(karmesineOre, new ItemStack(karmesineIngot), RandomUtils.nextFloat(0F, 2F));
GameRegistry.addSmelting(meteoriteOre, new ItemStack(meteoriteIngot), RandomUtils.nextFloat(0F, 2F));
GameRegistry.addSmelting(mindoriteOre, new ItemStack(mindoriteIngot), RandomUtils.nextFloat(0F, 2F));
GameRegistry.addSmelting(mythrilOre, new ItemStack(mythrilIngot), RandomUtils.nextFloat(0F, 2F));
GameRegistry.addSmelting(palladiumOre, new ItemStack(palladiumIngot), RandomUtils.nextFloat(0F, 2F));
GameRegistry.addSmelting(prometheumOre, new ItemStack(prometheumIngot), RandomUtils.nextFloat(0F, 2F));
GameRegistry.addSmelting(vibraniumOre, new ItemStack(vibraniumIngot), RandomUtils.nextFloat(0F, 2F));
GameRegistry.addSmelting(rubiumOre, new ItemStack(rubiumIngot), RandomUtils.nextFloat(0F, 2F));
*/
}
}

View File

@@ -0,0 +1,20 @@
package com.sosnitzka.taiga.recipes;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.registry.GameRegistry;
import static com.sosnitzka.taiga.Blocks.*;
import static com.sosnitzka.taiga.Items.*;
public class SmeltingRegistry {
public static void register() {
GameRegistry.addSmelting(slagironOre, new ItemStack(slagironIngot), 1.0F);
GameRegistry.addSmelting(slagironIngot, new ItemStack(iron_nugget), 0);
GameRegistry.addSmelting(slaggoldIngot, new ItemStack(Items.GOLD_NUGGET), 0);
GameRegistry.addSmelting(slaggoldOre, new ItemStack(slaggoldIngot), 1.0F);
GameRegistry.addSmelting(tiberiumOre, new ItemStack(tiberiumShardInstable, 6), (2F));
GameRegistry.addSmelting(tiberiumShardInstable, new ItemStack(tiberiumIngot), (.1F));
}
}

View File

@@ -52,7 +52,7 @@ public class TraitAnalysing extends AbstractTrait {
} }
private int getUpdateXP(int xp) { private int getUpdateXP(int xp) {
float exp = (float) random.nextFloat() * random.nextFloat() * random.nextFloat() * (xp + 18) * 50; float exp = random.nextFloat() * random.nextFloat() * random.nextFloat() * (xp + 18) * 50;
return Math.round(exp); return Math.round(exp);
} }
@@ -62,5 +62,4 @@ public class TraitAnalysing extends AbstractTrait {
event.getDrops().clear(); event.getDrops().clear();
} }
} }
} }

View File

@@ -9,6 +9,8 @@ import net.minecraft.world.World;
import slimeknights.tconstruct.library.traits.AbstractTrait; import slimeknights.tconstruct.library.traits.AbstractTrait;
import slimeknights.tconstruct.library.utils.ToolHelper; import slimeknights.tconstruct.library.utils.ToolHelper;
import static com.sosnitzka.taiga.util.Utils.isNight;
public class TraitArcane extends AbstractTrait { public class TraitArcane extends AbstractTrait {
public TraitArcane() { public TraitArcane() {
@@ -30,13 +32,4 @@ public class TraitArcane extends AbstractTrait {
ToolHelper.healTool(tool, random.nextInt(15) + 1, null); ToolHelper.healTool(tool, random.nextInt(15) + 1, null);
} }
} }
public boolean isNight(int time) {
if (time > 12500) {
return true;
} else {
return false;
}
}
} }

View File

@@ -10,6 +10,8 @@ import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World; import net.minecraft.world.World;
import slimeknights.tconstruct.library.traits.AbstractTrait; import slimeknights.tconstruct.library.traits.AbstractTrait;
import static com.sosnitzka.taiga.util.Utils.isNight;
public class TraitBlind extends AbstractTrait { public class TraitBlind extends AbstractTrait {
public TraitBlind() { public TraitBlind() {
@@ -37,12 +39,4 @@ public class TraitBlind extends AbstractTrait {
player.addPotionEffect(new PotionEffect(MobEffects.WEAKNESS, random.nextInt(400) + 200)); player.addPotionEffect(new PotionEffect(MobEffects.WEAKNESS, random.nextInt(400) + 200));
} }
} }
public boolean isNight(int time) {
if (time > 12500) {
return true;
} else {
return false;
}
}
} }

View File

@@ -12,6 +12,8 @@ import slimeknights.tconstruct.library.traits.AbstractTrait;
import slimeknights.tconstruct.library.utils.TagUtil; import slimeknights.tconstruct.library.utils.TagUtil;
import slimeknights.tconstruct.library.utils.TinkerUtil; import slimeknights.tconstruct.library.utils.TinkerUtil;
import static com.sosnitzka.taiga.util.Utils.isNight;
public class TraitBright extends AbstractTrait { public class TraitBright extends AbstractTrait {
@@ -22,7 +24,7 @@ public class TraitBright extends AbstractTrait {
@Override @Override
public float damage(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, float newDamage, boolean isCritical) { public float damage(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, float newDamage, boolean isCritical) {
int time = (int) target.getEntityWorld().getWorldTime(); int time = (int) target.getEntityWorld().getWorldTime();
if (isDay(time)) { if (!isNight(time)) {
newDamage += damage / 2f; newDamage += damage / 2f;
} }
return super.damage(tool, player, target, damage, newDamage, isCritical); return super.damage(tool, player, target, damage, newDamage, isCritical);
@@ -37,14 +39,5 @@ public class TraitBright extends AbstractTrait {
e.addPotionEffect(new PotionEffect(MobEffects.GLOWING, 100)); e.addPotionEffect(new PotionEffect(MobEffects.GLOWING, 100));
} }
} }
}
public boolean isDay(int time) {
if (time < 12500) {
return true;
} else {
return false;
}
} }
} }

View File

@@ -23,7 +23,8 @@ public class TraitCascade extends AbstractTrait {
sx = x = pos.getX(); sx = x = pos.getX();
sy = y = pos.getY(); sy = y = pos.getY();
sz = z = pos.getZ(); sz = z = pos.getZ();
for (int i = random.nextInt((int) (ToolHelper.getCurrentDurability(tool) * 1.5f)); i > 0; i--) { // TODO: limit to 100 int i = random.nextInt((int) Math.min(300f * (float) ToolHelper.getCurrentDurability(tool) / ToolHelper.getMaxDurability(tool), 50f));
for (int a = i; a > 0; a--) {
int r = random.nextInt(3); int r = random.nextInt(3);
int d = random.nextBoolean() ? 1 : -1; int d = random.nextBoolean() ? 1 : -1;
if (r == 0) x += d; if (r == 0) x += d;

View File

@@ -21,10 +21,6 @@ import slimeknights.tconstruct.library.utils.TinkerUtil;
public class TraitCurvature extends AbstractTrait { public class TraitCurvature extends AbstractTrait {
private static BlockPos pos = new BlockPos(0, 0, 0);
public TraitCurvature() { public TraitCurvature() {
super("curvature", TextFormatting.BLACK); super("curvature", TextFormatting.BLACK);
MinecraftForge.EVENT_BUS.register(this); MinecraftForge.EVENT_BUS.register(this);
@@ -36,7 +32,7 @@ public class TraitCurvature extends AbstractTrait {
return; return;
} }
if (random.nextFloat() <= 0.01 && world.provider.getDimension() != -1) { if (random.nextFloat() <= 0.01 && world.provider.getDimension() != -1) {
teleport(player, world, 5); teleport(player, world);
player.playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F); player.playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F);
} }
} }
@@ -44,10 +40,9 @@ public class TraitCurvature extends AbstractTrait {
@Override @Override
public void afterHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean wasCritical, boolean wasHit) { public void afterHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean wasCritical, boolean wasHit) {
World w = player.getEntityWorld();
if (random.nextFloat() <= 0.3) { if (random.nextFloat() <= 0.3) {
target.playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F); target.playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F);
changepos(player, target); changePos(player, target);
} }
} }
@@ -64,7 +59,7 @@ public class TraitCurvature extends AbstractTrait {
} }
} }
private void teleport(EntityLivingBase e, World w, int max) { private void teleport(EntityLivingBase e, World w) {
int x = e.getPosition().getX() + random.nextInt(250) - 125; int x = e.getPosition().getX() + random.nextInt(250) - 125;
int y = e.getPosition().getY(); int y = e.getPosition().getY();
int z = e.getPosition().getZ() + random.nextInt(250) - 125; int z = e.getPosition().getZ() + random.nextInt(250) - 125;
@@ -78,11 +73,10 @@ public class TraitCurvature extends AbstractTrait {
e.setPosition(x, y, z); e.setPosition(x, y, z);
} }
private void changepos(EntityLivingBase player, EntityLivingBase target) { private void changePos(EntityLivingBase player, EntityLivingBase target) {
BlockPos pp = new BlockPos(player.getPosition()); BlockPos pp = new BlockPos(player.getPosition());
BlockPos tp = new BlockPos(target.getPosition()); BlockPos tp = new BlockPos(target.getPosition());
player.setPosition(tp.getX(), tp.getY(), tp.getZ()); player.setPosition(tp.getX(), tp.getY(), tp.getZ());
target.setPosition(pp.getX(), pp.getY(), pp.getZ()); target.setPosition(pp.getX(), pp.getY(), pp.getZ());
} }
} }

View File

@@ -5,6 +5,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TextFormatting;
import slimeknights.tconstruct.library.traits.AbstractTrait; import slimeknights.tconstruct.library.traits.AbstractTrait;
import static com.sosnitzka.taiga.util.Utils.isNight;
public class TraitDark extends AbstractTrait { public class TraitDark extends AbstractTrait {
@@ -21,12 +23,4 @@ public class TraitDark extends AbstractTrait {
return super.damage(tool, player, target, damage, newDamage, isCritical); return super.damage(tool, player, target, damage, newDamage, isCritical);
} }
public boolean isNight(int time) {
if (time > 12500) {
return true;
} else {
return false;
}
}
} }

View File

@@ -33,10 +33,9 @@ public class TraitDiffuse extends AbstractTrait {
@SubscribeEvent @SubscribeEvent
public void onBlockBreak(BlockEvent.BreakEvent event) { public void onBlockBreak(BlockEvent.BreakEvent event) {
EntityPlayer player = event.getPlayer(); EntityPlayer player = event.getPlayer();
if (!player.getEntityWorld().isRemote && player != null && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), this.identifier)) { if (!player.getEntityWorld().isRemote && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), this.identifier)) {
event.setExpToDrop(this.getUpdateXP(event.getExpToDrop())); event.setExpToDrop(this.getUpdateXP(event.getExpToDrop()));
} }
} }
@SubscribeEvent @SubscribeEvent
@@ -51,7 +50,7 @@ public class TraitDiffuse extends AbstractTrait {
} }
private int getUpdateXP(int xp) { private int getUpdateXP(int xp) {
float exp = (float) random.nextFloat() * random.nextFloat() * random.nextFloat() * (xp + random.nextInt(10)); float exp = random.nextFloat() * random.nextFloat() * random.nextFloat() * (xp + random.nextInt(10));
if (random.nextBoolean()) if (random.nextBoolean())
return Math.round(exp); return Math.round(exp);
else return 0; else return 0;
@@ -63,5 +62,4 @@ public class TraitDiffuse extends AbstractTrait {
event.getDrops().clear(); event.getDrops().clear();
} }
} }
} }

View File

@@ -24,7 +24,6 @@ public class TraitFracture extends AbstractTrait {
float b = 0.99F * calcBonus(tool); float b = 0.99F * calcBonus(tool);
if (!world.isRemote && tool.canHarvestBlock(state) && f <= b) { if (!world.isRemote && tool.canHarvestBlock(state) && f <= b) {
RayTraceResult mop = ((ToolCore) tool.getItem()).rayTrace(world, (EntityPlayer) player, false); RayTraceResult mop = ((ToolCore) tool.getItem()).rayTrace(world, (EntityPlayer) player, false);
if (mop == null) return;
for (int i = random.nextInt(9) + 1; i >= 0; i--) { for (int i = random.nextInt(9) + 1; i >= 0; i--) {
switch (mop.sideHit) { switch (mop.sideHit) {
case UP: case UP:

View File

@@ -40,7 +40,6 @@ public class TraitFragile extends AbstractTrait {
if (r == 1) y += d; if (r == 1) y += d;
if (r == 2) z += d; if (r == 2) z += d;
BlockPos nextBlock = new BlockPos(x, y, z); BlockPos nextBlock = new BlockPos(x, y, z);
int tn = (int) world.getWorldTime() + 5;
if (world.getBlockState(nextBlock) == world.getBlockState(pos)) { if (world.getBlockState(nextBlock) == world.getBlockState(pos)) {
Block block = Blocks.STONE; Block block = Blocks.STONE;
int ib = random.nextInt(3); int ib = random.nextInt(3);
@@ -78,7 +77,6 @@ public class TraitFragile extends AbstractTrait {
} }
} }
private float calcBonus(ItemStack tool) { private float calcBonus(ItemStack tool) {
int durability = ToolHelper.getCurrentDurability(tool); int durability = ToolHelper.getCurrentDurability(tool);
int maxDurability = ToolHelper.getMaxDurability(tool); int maxDurability = ToolHelper.getMaxDurability(tool);

View File

@@ -34,7 +34,7 @@ public class TraitGarishly extends AbstractTrait {
EntityPlayer player = (EntityPlayer) event.getSource().getEntity(); EntityPlayer player = (EntityPlayer) event.getSource().getEntity();
if (event.getEntity() instanceof EntityMob && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), identifier)) { if (event.getEntity() instanceof EntityMob && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), identifier)) {
int r = random.nextInt(5); int r = random.nextInt(6);
ItemStack i = null; ItemStack i = null;
switch (r) { switch (r) {
case 0: case 0:
@@ -56,7 +56,7 @@ public class TraitGarishly extends AbstractTrait {
i = new ItemStack(lignite, random.nextInt(3)); i = new ItemStack(lignite, random.nextInt(3));
break; break;
} }
assert i != null;
event.getDrops().add(0, new EntityItem(w, event.getEntity().posX, event.getEntity().posY, event.getEntity().posZ, i)); event.getDrops().add(0, new EntityItem(w, event.getEntity().posX, event.getEntity().posY, event.getEntity().posZ, i));
} }
} }
@@ -67,7 +67,7 @@ public class TraitGarishly extends AbstractTrait {
float r = random.nextFloat(); float r = random.nextFloat();
if (r > 0.5f) event.getDrops().clear(); if (r > 0.5f) event.getDrops().clear();
else if (r < 0.1 && event.getWorld().getBlockState(event.getPos()).getMaterial() == Material.ROCK) { else if (r < 0.1 && event.getWorld().getBlockState(event.getPos()).getMaterial() == Material.ROCK) {
ItemStack stack = new ItemStack(Item.getItemFromBlock(event.getWorld().getBlockState(event.getPos()).getBlock()), random.nextInt(3)); @SuppressWarnings("ConstantConditions") ItemStack stack = new ItemStack(Item.getItemFromBlock(event.getWorld().getBlockState(event.getPos()).getBlock()), random.nextInt(3));
event.getDrops().add(0, stack); event.getDrops().add(0, stack);
ToolHelper.damageTool(tool, random.nextInt(6) + 1, event.getHarvester()); ToolHelper.damageTool(tool, random.nextInt(6) + 1, event.getHarvester());
} }

View File

@@ -11,6 +11,8 @@ import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
import slimeknights.tconstruct.library.traits.AbstractTrait; import slimeknights.tconstruct.library.traits.AbstractTrait;
import static com.sosnitzka.taiga.util.Utils.isNight;
public class TraitHaunted extends AbstractTrait { public class TraitHaunted extends AbstractTrait {
public TraitHaunted() { public TraitHaunted() {
@@ -18,7 +20,6 @@ public class TraitHaunted extends AbstractTrait {
MinecraftForge.EVENT_BUS.register(this); MinecraftForge.EVENT_BUS.register(this);
} }
// Just several tested Vanilla-Mobs, e.g. no ghasts, bats or skeletons // Just several tested Vanilla-Mobs, e.g. no ghasts, bats or skeletons
@Override @Override
public void onHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean isCritical) { public void onHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean isCritical) {
@@ -33,12 +34,4 @@ public class TraitHaunted extends AbstractTrait {
} }
} }
public boolean isNight(int time) {
if (time > 12500) {
return true;
} else {
return false;
}
}
} }

View File

@@ -16,7 +16,7 @@ public class TraitHeroic extends AbstractTrait {
public float damage(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, float newDamage, boolean isCritical) { public float damage(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, float newDamage, boolean isCritical) {
int durability = ToolHelper.getCurrentDurability(tool); int durability = ToolHelper.getCurrentDurability(tool);
int durabilitymax = ToolHelper.getMaxDurability(tool); int durabilitymax = ToolHelper.getMaxDurability(tool);
float calc = (float) (newDamage + (newDamage / 2) / (durability * durabilitymax / (durabilitymax - durability - 1))); float calc = newDamage + (newDamage / 2) / (durability * durabilitymax / (durabilitymax - durability - 1));
if ((float) durability < (float) (0.10 * durabilitymax) || player.getHealth() < player.getMaxHealth() / 8 || (target.getHealth() == target.getMaxHealth() && random.nextFloat() > 0.8)) { if ((float) durability < (float) (0.10 * durabilitymax) || player.getHealth() < player.getMaxHealth() / 8 || (target.getHealth() == target.getMaxHealth() && random.nextFloat() > 0.8)) {
return super.damage(tool, player, target, damage, calc, isCritical); return super.damage(tool, player, target, damage, calc, isCritical);
} else return super.damage(tool, player, target, damage, newDamage, isCritical); } else return super.damage(tool, player, target, damage, newDamage, isCritical);

View File

@@ -15,6 +15,8 @@ import slimeknights.tconstruct.library.traits.AbstractTrait;
import slimeknights.tconstruct.library.utils.TagUtil; import slimeknights.tconstruct.library.utils.TagUtil;
import slimeknights.tconstruct.library.utils.TinkerUtil; import slimeknights.tconstruct.library.utils.TinkerUtil;
import static com.sosnitzka.taiga.util.Utils.isNight;
public class TraitHollow extends AbstractTrait { public class TraitHollow extends AbstractTrait {
public TraitHollow() { public TraitHollow() {
@@ -45,12 +47,4 @@ public class TraitHollow extends AbstractTrait {
} }
} }
} }
public boolean isNight(int time) {
if (time > 12500) {
return true;
} else {
return false;
}
}
} }

View File

@@ -7,9 +7,7 @@ import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.event.world.BlockEvent;
import slimeknights.tconstruct.library.traits.AbstractTrait; import slimeknights.tconstruct.library.traits.AbstractTrait;
/**
* Created by Robert on 03.06.2016.
*/
public class TraitMelting extends AbstractTrait { public class TraitMelting extends AbstractTrait {
public TraitMelting() { public TraitMelting() {
@@ -24,8 +22,6 @@ public class TraitMelting extends AbstractTrait {
event.getWorld().setBlockState(event.getPos(), Blocks.LAVA.getDefaultState()); event.getWorld().setBlockState(event.getPos(), Blocks.LAVA.getDefaultState());
} }
} }
} }

View File

@@ -6,7 +6,6 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.init.SoundEvents; import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
@@ -19,8 +18,6 @@ import slimeknights.tconstruct.library.utils.ToolHelper;
public class TraitNatureBound extends AbstractTrait { public class TraitNatureBound extends AbstractTrait {
public static DamageSource splinter = new DamageSource("splinter").setDamageBypassesArmor();
private static int chance = 20;
public TraitNatureBound() { public TraitNatureBound() {
super("naturebound", TextFormatting.GREEN); super("naturebound", TextFormatting.GREEN);
@@ -36,6 +33,7 @@ public class TraitNatureBound extends AbstractTrait {
@Override @Override
public void onUpdate(ItemStack tool, World world, Entity entity, int itemSlot, boolean isSelected) { public void onUpdate(ItemStack tool, World world, Entity entity, int itemSlot, boolean isSelected) {
// *20 because 20 ticks in a second // *20 because 20 ticks in a second
int chance = 20;
if (!world.isRemote && entity instanceof EntityLivingBase && random.nextInt(30 * chance) == 0) { if (!world.isRemote && entity instanceof EntityLivingBase && random.nextInt(30 * chance) == 0) {
ToolHelper.healTool(tool, random.nextInt(9) + 1, (EntityLivingBase) entity); ToolHelper.healTool(tool, random.nextInt(9) + 1, (EntityLivingBase) entity);
} }
@@ -50,9 +48,4 @@ public class TraitNatureBound extends AbstractTrait {
e.getPlayer().playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F); e.getPlayer().playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F);
} }
} }
} }

View File

@@ -28,12 +28,10 @@ public class TraitPulverizing extends AbstractTrait {
return speed * (maxDurability - maxDurability / 10) / (durability); return speed * (maxDurability - maxDurability / 10) / (durability);
} }
@Override @Override
public void blockHarvestDrops(ItemStack tool, BlockEvent.HarvestDropsEvent event) { public void blockHarvestDrops(ItemStack tool, BlockEvent.HarvestDropsEvent event) {
if (random.nextFloat() < 0.9) { if (random.nextFloat() < 0.9) {
event.getDrops().clear(); event.getDrops().clear();
} }
} }
} }

View File

@@ -31,7 +31,7 @@ public class TraitRandomize extends AbstractTrait {
@Override @Override
public void miningSpeed(ItemStack tool, PlayerEvent.BreakSpeed event) { public void miningSpeed(ItemStack tool, PlayerEvent.BreakSpeed event) {
if (ToolHelper.isToolEffective2(tool, event.getState())) { if (ToolHelper.isToolEffective2(tool, event.getState())) {
event.setNewSpeed((float) (event.getNewSpeed() + random.nextFloat() * 2)); event.setNewSpeed(event.getNewSpeed() + random.nextFloat() * 2);
} }
} }
@@ -113,6 +113,7 @@ public class TraitRandomize extends AbstractTrait {
} }
e.setPosition(target.getPosition().getX(), target.getPosition().getY() + 0.1f, target.getPosition().getZ()); e.setPosition(target.getPosition().getX(), target.getPosition().getY() + 0.1f, target.getPosition().getZ());
e.setCustomNameTag("Missingno"); e.setCustomNameTag("Missingno");
if (e instanceof EntityLiving)
((EntityLiving) e).setHealth(((EntityLiving) e).getHealth() * (random.nextInt(5) + 1)); ((EntityLiving) e).setHealth(((EntityLiving) e).getHealth() * (random.nextInt(5) + 1));
w.spawnEntityInWorld(e); w.spawnEntityInWorld(e);
target.setDead(); target.setDead();
@@ -120,6 +121,7 @@ public class TraitRandomize extends AbstractTrait {
} }
} }
@SuppressWarnings("ConstantConditions")
@Override @Override
public void blockHarvestDrops(ItemStack tool, BlockEvent.HarvestDropsEvent event) { public void blockHarvestDrops(ItemStack tool, BlockEvent.HarvestDropsEvent event) {
float r = random.nextFloat(); float r = random.nextFloat();

View File

@@ -18,8 +18,6 @@ public class TraitResonance extends AbstractTrait {
target.knockBack(target, random.nextFloat() * random.nextFloat() * 12, player.posX - target.posX, player.posZ - target.posZ); target.knockBack(target, random.nextFloat() * random.nextFloat() * 12, player.posX - target.posX, player.posZ - target.posZ);
} }
} }
} }

View File

@@ -18,10 +18,9 @@ import slimeknights.tconstruct.library.utils.TagUtil;
import slimeknights.tconstruct.library.utils.TinkerUtil; import slimeknights.tconstruct.library.utils.TinkerUtil;
import slimeknights.tconstruct.library.utils.ToolHelper; import slimeknights.tconstruct.library.utils.ToolHelper;
import static com.sosnitzka.taiga.util.Utils.isNight;
/**
* Created by Robert on 03.06.2016.
*/
public class TraitReviving extends AbstractTrait { public class TraitReviving extends AbstractTrait {
public TraitReviving() { public TraitReviving() {
@@ -38,6 +37,7 @@ public class TraitReviving extends AbstractTrait {
if (isNight((int) w.getWorldTime()) && random.nextFloat() > 0.85 && TinkerUtil.hasTrait(TagUtil.getTagSafe(((EntityPlayer) e.getSource().getEntity()).getHeldItemMainhand()), identifier)) { if (isNight((int) w.getWorldTime()) && random.nextFloat() > 0.85 && TinkerUtil.hasTrait(TagUtil.getTagSafe(((EntityPlayer) e.getSource().getEntity()).getHeldItemMainhand()), identifier)) {
String name = EntityList.getEntityString(e.getEntity()); String name = EntityList.getEntityString(e.getEntity());
Entity ent = EntityList.createEntityByName(name, w); Entity ent = EntityList.createEntityByName(name, w);
assert ent != null;
ent.setPosition(pos.getX(), pos.getY(), pos.getZ()); ent.setPosition(pos.getX(), pos.getY(), pos.getZ());
w.spawnEntityInWorld(ent); w.spawnEntityInWorld(ent);
} }
@@ -60,13 +60,4 @@ public class TraitReviving extends AbstractTrait {
ToolHelper.healTool(tool, random.nextInt(15) + 1, null); ToolHelper.healTool(tool, random.nextInt(15) + 1, null);
} }
} }
public boolean isNight(int time) {
if (time > 12500) {
return true;
} else {
return false;
}
}
} }

View File

@@ -29,11 +29,8 @@ public class TraitSlaughtering extends AbstractTrait {
EntityPlayer player = (EntityPlayer) event.getSource().getEntity(); EntityPlayer player = (EntityPlayer) event.getSource().getEntity();
if (!w.isRemote && event.getEntity() instanceof EntityLiving && !(event.getEntity() instanceof EntityPlayer) && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), identifier)) { if (!w.isRemote && event.getEntity() instanceof EntityLiving && !(event.getEntity() instanceof EntityPlayer) && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), identifier)) {
Item i = event.getDrops().get(random.nextInt(event.getDrops().size())).getEntityItem().getItem(); Item i = event.getDrops().get(random.nextInt(event.getDrops().size())).getEntityItem().getItem();
if (i != null) {
event.getDrops().add(new EntityItem(event.getEntity().getEntityWorld(), event.getEntity().posX, event.getEntity().posY, event.getEntity().posZ, new ItemStack(i, random.nextInt(4) + 1))); event.getDrops().add(new EntityItem(event.getEntity().getEntityWorld(), event.getEntity().posX, event.getEntity().posY, event.getEntity().posZ, new ItemStack(i, random.nextInt(4) + 1)));
} }
} }
} }
} }
}

View File

@@ -11,6 +11,4 @@ public class TraitTraditional extends AbstractTrait {
super("traditional", TextFormatting.GREEN); super("traditional", TextFormatting.GREEN);
MinecraftForge.EVENT_BUS.register(this); MinecraftForge.EVENT_BUS.register(this);
} }
} }

View File

@@ -13,7 +13,7 @@ import net.minecraft.world.World;
public class EntityAIPermanentPanic extends EntityAIBase { public class EntityAIPermanentPanic extends EntityAIBase {
private EntityCreature theEntityCreature; private EntityCreature theEntityCreature;
protected double speed; private double speed;
private double randPosX; private double randPosX;
private double randPosY; private double randPosY;
private double randPosZ; private double randPosZ;

View File

@@ -21,5 +21,4 @@ public class FuelHandler implements IFuelHandler {
} }
return 0; return 0;
} }
} }

View File

@@ -18,7 +18,7 @@ public class StateMatcher implements Predicate<IBlockState> {
this.value = value; this.value = value;
} }
public static StateMatcher forState(IBlockState state, IProperty property, Comparable value) { static StateMatcher forState(IBlockState state, IProperty property, Comparable value) {
return new StateMatcher(state, property, value); return new StateMatcher(state, property, value);
} }

View File

@@ -78,4 +78,8 @@ public class Utils {
message.setTag("alloy", tagList); message.setTag("alloy", tagList);
FMLInterModComms.sendMessage("tconstruct", "alloy", message); FMLInterModComms.sendMessage("tconstruct", "alloy", message);
} }
public static boolean isNight(int time) {
return time > 12500;
}
} }

View File

@@ -11,46 +11,55 @@ import net.minecraftforge.fml.common.IWorldGenerator;
import java.util.Random; import java.util.Random;
import static com.sosnitzka.taiga.Blocks.*; import static com.sosnitzka.taiga.Blocks.*;
import static com.sosnitzka.taiga.TAIGAConfiguration.*;
public class ZWorldGen implements IWorldGenerator { public class ZWorldGen implements IWorldGenerator {
private void nether(Random random, int x, int z, World world) { private void nether(Random random, int x, int z, World world) {
Generator.generateNetherOre(titaniteOre.getDefaultState(), random, x, z, world, 30, 1, 64, 2, 12); Generator.generateNetherOre(titaniteOre.getDefaultState(), random, x, z, world, (int) (35 * titaniteFactor * oreFactorGeneral), 1, 64, 2, 12);
Generator.generateNetherOre(tiberiumOre.getDefaultState(), random, x, z, world, 30, 1, 128, 7, 15); Generator.generateNetherOre(tiberiumOre.getDefaultState(), random, x, z, world, (int) (30 * tiberiumFactor * oreFactorGeneral), 0, 128, 2, 15);
Generator.generateNetherOre(palladiumOre.getDefaultState(), random, x, z, world, 30, 32, 64, 2, 7); Generator.generateNetherOre(palladiumOre.getDefaultState(), random, x, z, world, (int) (35 * palladiumFactor * oreFactorGeneral), 32, 64, 2, 6);
Generator.generateNetherOre(prometheumOre.getDefaultState(), random, x, z, world, 30, 64, 128, 2, 6); Generator.generateNetherOre(prometheumOre.getDefaultState(), random, x, z, world, (int) (35 * prometheumFactor * oreFactorGeneral), 64, 128, 2, 6);
} }
private void world(Random random, int x, int z, World world) { private void world(Random random, int x, int z, World world) {
Generator.generateOre(slagironOre.getDefaultState(), random, x, z, world, 45, 8, 96, 5, 12);
Generator.generateOre(slaggoldOre.getDefaultState(), random, x, z, world, 30, 8, 48, 4, 8);
Generator.generateOre(ligniteOre.getDefaultState(), random, x, z, world, 30, 8, 96, 5, 12);
Generator.generateOre(Blocks.IRON_ORE.getDefaultState(), random, x, z, world, 40, 8, 96, 2, 8);
Generator.generateOre(basalt.getDefaultState(), Blocks.LAVA.getDefaultState(), random, x, z, world, 100, 8, 24, 2, 5);
Generator.generateOre(rottenGround.getDefaultState(), Blocks.DIRT.getDefaultState(), random, x, z, world, 25, 50, 70, 2, 15);
Generator.generateOre(vibraniumOre.getDefaultState(), random, x, z, world, 30, 48, 64, 2, 8); // Optional
Generator.generateOre(karmesineOre.getDefaultState(), random, x, z, world, 35, 16, 48, 2, 7); if (slagIronGen) {
Generator.generateOre(bismuthOre.getDefaultState(), random, x, z, world, 60, 50, 130, 2, 4); Generator.generateOre(slagironOre.getDefaultState(), random, x, z, world, (int) (45 * slagironFactor * oreFactorGeneral), 0, 128, 2, 12);
Generator.generateOre(mythrilOre.getDefaultState(), random, x, z, world, 33, 16, 32, 2, 8); }
Generator.generateOre(meteoriteOre.getDefaultState(), random, x, z, world, 10, 0, 32, 2, 25); if (slagGoldGen) {
Generator.generateOre(mindoriteOre.getDefaultState(), Blocks.STONE.getDefaultState(), BlockStone.VARIANT, BlockStone.EnumType.DIORITE, random, x, z, world, 150, 16, 96, 2, 8); Generator.generateOre(slaggoldOre.getDefaultState(), random, x, z, world, (int) (20 * slaggoldFactor * oreFactorGeneral), 0, 32, 2, 12);
Generator.generateOre(arcaniteOre.getDefaultState(), Blocks.STONE.getDefaultState(), BlockStone.VARIANT, BlockStone.EnumType.GRANITE, random, x, z, world, 150, 16, 96, 2, 8); }
Generator.generateOre(eterniteOre.getDefaultState(), Blocks.STONE.getDefaultState(), BlockStone.VARIANT, BlockStone.EnumType.ANDESITE, random, x, z, world, 150, 16, 96, 2, 8); if (ironGen) {
Generator.generateOre(Blocks.IRON_ORE.getDefaultState(), random, x, z, world, (int) (30 * ironFactor * oreFactorGeneral), 0, 128, 1, 9);
}
// to be integrated mod specific
Generator.generateOre(basalt.getDefaultState(), Blocks.LAVA.getDefaultState(), random, x, z, world, (int) (125 * basaltFactor * oreFactorGeneral), 0, 28, 2, 4);
Generator.generateOre(rottenGround.getDefaultState(), Blocks.DIRT.getDefaultState(), random, x, z, world, (int) (25 * rottengroundFactor * oreFactorGeneral), 50, 70, 2, 15);
Generator.generateOre(ligniteOre.getDefaultState(), random, x, z, world, (int) (30 * ligniteFactor * oreFactorGeneral), 8, 96, 2, 12);
Generator.generateOre(vibraniumOre.getDefaultState(), random, x, z, world, (int) (30 * vibraniumFactor * oreFactorGeneral), 48, 64, 2, 8);
Generator.generateOre(karmesineOre.getDefaultState(), random, x, z, world, (int) (35 * karmesineFactor * oreFactorGeneral), 16, 48, 2, 8);
Generator.generateOre(bismuthOre.getDefaultState(), random, x, z, world, (int) (40 * bismuthFactor * oreFactorGeneral), 50, 130, 2, 4);
Generator.generateOre(mythrilOre.getDefaultState(), random, x, z, world, (int) (34 * mythrilFactor * oreFactorGeneral), 16, 32, 2, 8);
Generator.generateOre(meteoriteOre.getDefaultState(), random, x, z, world, (int) (10 * meteoriteFactor * oreFactorGeneral), 0, 32, 2, 25);
Generator.generateOre(mindoriteOre.getDefaultState(), Blocks.STONE.getDefaultState(), BlockStone.VARIANT, BlockStone.EnumType.DIORITE, random, x, z, world, (int) (120 * mindoriteFactor * oreFactorGeneral), 16, 96, 2, 8);
Generator.generateOre(arcaniteOre.getDefaultState(), Blocks.STONE.getDefaultState(), BlockStone.VARIANT, BlockStone.EnumType.GRANITE, random, x, z, world, (int) (120 * arcaniteFactor * oreFactorGeneral), 16, 96, 2, 8);
Generator.generateOre(eterniteOre.getDefaultState(), Blocks.STONE.getDefaultState(), BlockStone.VARIANT, BlockStone.EnumType.ANDESITE, random, x, z, world, (int) (120 * eterniteFactor * oreFactorGeneral), 16, 96, 2, 8);
} }
private void end(Random random, int x, int z, World world) { private void end(Random random, int x, int z, World world) {
Generator.generateEndOre(adamantiteOre.getDefaultState(), random, x, z, world, 15, 10, 35, 2, 8); Generator.generateEndOre(adamantiteOre.getDefaultState(), random, x, z, world, (int) (15 * adamantiteFactor * oreFactorGeneral), 10, 35, 2, 8);
Generator.generateEndOre(rubiumOre.getDefaultState(), random, x, z, world, 15, 10, 65, 2, 8); Generator.generateEndOre(rubiumOre.getDefaultState(), random, x, z, world, (int) (15 * rubiumFactor * oreFactorGeneral), 10, 65, 2, 8);
Generator.generateEndOre(ignititeOre.getDefaultState(), random, x, z, world, 15, 10, 45, 2, 8); Generator.generateEndOre(ignititeOre.getDefaultState(), random, x, z, world, (int) (15 * ignititeFactor * oreFactorGeneral), 10, 45, 2, 8);
Generator.generateEndOre(violiumOre.getDefaultState(), random, x, z, world, 15, 10, 55, 2, 8); Generator.generateEndOre(violiumOre.getDefaultState(), random, x, z, world, (int) (15 * violiumFactor * oreFactorGeneral), 10, 55, 2, 8);
} }
@Override @Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
IChunkProvider chunkProvider) {
int x = chunkX * 16; int x = chunkX * 16;
int z = chunkZ * 16; int z = chunkZ * 16;
switch (world.provider.getDimension()) { switch (world.provider.getDimension()) {
@@ -63,6 +72,9 @@ public class ZWorldGen implements IWorldGenerator {
case 1: case 1:
end(random, x, z, world); end(random, x, z, world);
break; break;
default:
world(random, x, z, world);
break;
} }
} }
} }

View File

@@ -10,6 +10,7 @@ import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraft.world.gen.feature.WorldGenMinable;
import javax.annotation.ParametersAreNonnullByDefault;
import java.util.Random; import java.util.Random;
public class ZWorldGenMinable extends WorldGenMinable { public class ZWorldGenMinable extends WorldGenMinable {
@@ -32,6 +33,7 @@ public class ZWorldGenMinable extends WorldGenMinable {
} }
@Override @Override
@ParametersAreNonnullByDefault
public boolean generate(World worldIn, Random rand, BlockPos position) { public boolean generate(World worldIn, Random rand, BlockPos position) {
float f = rand.nextFloat() * (float) Math.PI; float f = rand.nextFloat() * (float) Math.PI;
double d0 = (double) ((float) (position.getX() + 8) + MathHelper.sin(f) * (float) this.numberOfBlocks / 8.0F); double d0 = (double) ((float) (position.getX() + 8) + MathHelper.sin(f) * (float) this.numberOfBlocks / 8.0F);

View File

@@ -267,3 +267,7 @@ item.tiberium_shard_instable.name=Instabile Tiberiumscherbe
item.tiberium_nugget.name=Tiberium Nugget item.tiberium_nugget.name=Tiberium Nugget
item.radiant_pearl.name=Radiumperle item.radiant_pearl.name=Radiumperle
item.luminar_dust.name=Luminarstaub item.luminar_dust.name=Luminarstaub
gui.taiga_configuration.mainTitle=TAIGA Configuration
itemGroup.taiga_block=TAIGA Blocks
itemGroup.taiga_item=TAIGA Items

View File

@@ -267,3 +267,7 @@ item.tiberium_shard_instable.name=Unstable Tiberium Shard
item.tiberium_nugget.name=Tiberium Nugget item.tiberium_nugget.name=Tiberium Nugget
item.radiant_pearl.name=Radiant Pearl item.radiant_pearl.name=Radiant Pearl
item.luminar_dust.name=Luminar Dust item.luminar_dust.name=Luminar Dust
gui.taiga_configuration.mainTitle=TAIGA Configuration
itemGroup.taiga_block=TAIGA Blocks
itemGroup.taiga_item=TAIGA Items

View File

@@ -267,3 +267,7 @@ item.tiberium_shard_instable.name=不稳定泰伯利亚碎片
item.tiberium_nugget.name=泰伯利亚粒 item.tiberium_nugget.name=泰伯利亚粒
item.radiant_pearl.name=辐射珍珠 item.radiant_pearl.name=辐射珍珠
item.luminar_dust.name=流明粉 item.luminar_dust.name=流明粉
gui.taiga_configuration.mainTitle=TAIGA 组态
itemGroup.taiga_block=TAIGA 块
itemGroup.taiga_item=TAIGA 对象