1.12.2; not well tested; book integration still broken

This commit is contained in:
2018-02-08 19:37:21 +01:00
parent 1c07cfc5ee
commit 17ae55c359
58 changed files with 612 additions and 340 deletions

View File

@@ -10,7 +10,7 @@ buildscript {
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath 'gradle.plugin.com.matthewprenger:CurseGradle:1.0.8'
}
}
@@ -64,9 +64,9 @@ task buildInfo {
version = project.buildInfo.revision
minecraft {
version = "1.11.2-13.20.1.2386"
version = "1.12.2-14.23.2.2611"
runDir = "run"
mappings = "snapshot_20170612"
mappings = "snapshot_20170801"
replace '@VERSION@', project.version
}
@@ -78,10 +78,10 @@ dependencies {
//deobfCompile "codechicken:CodeChickenLib:1.9.4-2.0.2.39:deobf"
//deobfCompile "codechicken:CodeChickenCore:1.9.4-2.0.3.65:deobf"
//deobfCompile "codechicken:NotEnoughItems:1.9-${nei_version}:dev"
deobfCompile "slimeknights.mantle:Mantle:1.10.2-1.1.+:deobf"
deobfCompile "slimeknights.mantle:Mantle:1.12-1.3.+:deobf"
//Old: deobfCompile "slimeknights.mantle:Mantle:1.9-0.10.0.jenkins132:deobf"
deobfCompile "mezz.jei:jei_1.11.2:4.+"
deobfCompile "slimeknights:TConstruct:1.11.2-2.7.+:deobf"
deobfCompile "mezz.jei:jei_1.12.2:4.+"
deobfCompile "slimeknights:TConstruct:1.12.2-2.9.+:deobf"
//compile files('libs/TConstruct-1.9-2.3.1.DEV.1d4c1de-deobf.jar')
//compile group: 'com.google.guava', name: 'guava', version: '20.0'
}

View File

@@ -13,34 +13,63 @@ public class Alloys {
* Registers alloying in the smeltery
*/
public static void register() {
registerTinkerAlloy(new FluidStack(terraxFluid, 2), new FluidStack(karmesineFluid, 1), new FluidStack(oviumFluid, 1), new FluidStack(jauxumFluid, 1));
registerTinkerAlloy(new FluidStack(triberiumFluid, 1), new FluidStack(tiberiumFluid, 5), new FluidStack(basaltFluid, 1));
registerTinkerAlloy(new FluidStack(triberiumFluid, 1), new FluidStack(tiberiumFluid, 5), new FluidStack(dilithiumFluid, 2));
registerTinkerAlloy(new FluidStack(fractumFluid, 2), new FluidStack(triberiumFluid, 3), new FluidStack(TinkerFluids.obsidian, 3), new FluidStack(abyssumFluid, 1));
registerTinkerAlloy(new FluidStack(violiumFluid, 2), new FluidStack(auroriumFluid, 3), new FluidStack(TinkerFluids.ardite, 2));
registerTinkerAlloy(new FluidStack(proxiiFluid, 3), new FluidStack(prometheumFluid, 3), new FluidStack(palladiumFluid, 3), new FluidStack(eezoFluid, 1));
registerTinkerAlloy(new FluidStack(tritoniteFluid, 2), new FluidStack(TinkerFluids.cobalt, 3), new FluidStack(terraxFluid, 2));
registerTinkerAlloy(new FluidStack(ignitzFluid, 2), new FluidStack(TinkerFluids.ardite, 2), new FluidStack(terraxFluid, 2), new FluidStack(osramFluid, 1));
registerTinkerAlloy(new FluidStack(imperomiteFluid, 2), new FluidStack(duraniteFluid, 3), new FluidStack(prometheumFluid, 1), new FluidStack(abyssumFluid, 1));
registerTinkerAlloy(new FluidStack(solariumFluid, 2), new FluidStack(valyriumFluid, 2), new FluidStack(uruFluid, 2), new FluidStack(nucleumFluid, 1));
registerTinkerAlloy(new FluidStack(adamantFluid, 3), new FluidStack(vibraniumFluid, 1), new FluidStack(solariumFluid, 1), new FluidStack(ioxFluid, 3));
registerTinkerAlloy(new FluidStack(nihiliteFluid, 1), new FluidStack(vibraniumFluid, 1), new FluidStack(solariumFluid, 1));
registerTinkerAlloy(new FluidStack(seismumFluid, 4), new FluidStack(TinkerFluids.obsidian, 4), new FluidStack(triberiumFluid, 2), new FluidStack(eezoFluid, 1));
registerTinkerAlloy(new FluidStack(astriumFluid, 2), new FluidStack(terraxFluid, 3), new FluidStack(auroriumFluid, 2));
registerTinkerAlloy(new FluidStack(niobFluid, 3), new FluidStack(palladiumFluid, 3), new FluidStack(duraniteFluid, 1), new FluidStack(osramFluid, 1));
registerTinkerAlloy(new FluidStack(yrdeenFluid, 3), new FluidStack(uruFluid, 3), new FluidStack(valyriumFluid, 3), new FluidStack(osramFluid, 1));
registerTinkerAlloy(new FluidStack(yrdeenFluid, 3), new FluidStack(uruFluid, 3), new FluidStack(valyriumFluid, 3), new FluidStack(eezoFluid, 1));
registerTinkerAlloy(new FluidStack(yrdeenFluid, 3), new FluidStack(uruFluid, 3), new FluidStack(valyriumFluid, 3), new FluidStack(abyssumFluid, 1));
registerTinkerAlloy(new FluidStack(ioxFluid, 1), new FluidStack(eezoFluid, 2), new FluidStack(abyssumFluid, 2), new FluidStack(osramFluid, 2), new FluidStack(obsidioriteFluid, 9));
registerTinkerAlloy(new FluidStack(ioxFluid, 1), new FluidStack(eezoFluid, 2), new FluidStack(abyssumFluid, 2), new FluidStack(osramFluid, 2), new FluidStack(meteoriteFluid, 9), new FluidStack(TinkerFluids.obsidian, 9));
registerTinkerAlloy(new FluidStack(lumixFluid, 1), new FluidStack(palladiumFluid, 1), new FluidStack(terraxFluid, 1));
registerTinkerAlloy(new FluidStack(obsidioriteFluid, 1), new FluidStack(meteoriteFluid, 1), new FluidStack(TinkerFluids.obsidian, 1));
registerTinkerAlloy(new FluidStack(nucleumFluid, 3), new FluidStack(proxiiFluid, 3), new FluidStack(abyssumFluid, 1), new FluidStack(osramFluid, 1));
registerTinkerAlloy(new FluidStack(nucleumFluid, 3), new FluidStack(imperomiteFluid, 3), new FluidStack(osramFluid, 1), new FluidStack(eezoFluid, 1));
registerTinkerAlloy(new FluidStack(nucleumFluid, 3), new FluidStack(niobFluid, 3), new FluidStack(eezoFluid, 1), new FluidStack(abyssumFluid, 1));
registerTinkerAlloy(new FluidStack(dyoniteFluid, 3), new FluidStack(triberiumFluid, 3), new FluidStack(fractumFluid, 1), new FluidStack(seismumFluid, 1), new FluidStack(osramFluid, 1));
registerTinkerAlloy(new FluidStack(dyoniteFluid, 3), new FluidStack(tiberiumFluid, 12), new FluidStack(fractumFluid, 1), new FluidStack(seismumFluid, 1), new FluidStack(osramFluid, 1));
registerTinkerAlloy(new FluidStack(nitroniteFluid, 6), new FluidStack(magmaFluid, 6), new FluidStack(osramFluid, 1));
registerTinkerAlloy(new FluidStack(terraxFluid, 2), new FluidStack(karmesineFluid, 1), new FluidStack
(oviumFluid, 1), new FluidStack(jauxumFluid, 1));
registerTinkerAlloy(new FluidStack(triberiumFluid, 1), new FluidStack(tiberiumFluid, 5), new FluidStack
(basaltFluid, 1));
registerTinkerAlloy(new FluidStack(triberiumFluid, 1), new FluidStack(tiberiumFluid, 5), new FluidStack
(dilithiumFluid, 2));
registerTinkerAlloy(new FluidStack(fractumFluid, 2), new FluidStack(triberiumFluid, 3), new FluidStack
(TinkerFluids.obsidian, 3), new FluidStack(abyssumFluid, 1));
registerTinkerAlloy(new FluidStack(violiumFluid, 2), new FluidStack(auroriumFluid, 3), new FluidStack
(TinkerFluids.ardite, 2));
registerTinkerAlloy(new FluidStack(proxiiFluid, 3), new FluidStack(prometheumFluid, 3), new FluidStack
(palladiumFluid, 3), new FluidStack(eezoFluid, 1));
registerTinkerAlloy(new FluidStack(tritoniteFluid, 2), new FluidStack(TinkerFluids.cobalt, 3), new FluidStack
(terraxFluid, 2));
registerTinkerAlloy(new FluidStack(ignitzFluid, 2), new FluidStack(TinkerFluids.ardite, 2), new FluidStack
(terraxFluid, 2), new FluidStack(osramFluid, 1));
registerTinkerAlloy(new FluidStack(imperomiteFluid, 2), new FluidStack(duraniteFluid, 3), new FluidStack
(prometheumFluid, 1), new FluidStack(abyssumFluid, 1));
registerTinkerAlloy(new FluidStack(solariumFluid, 2), new FluidStack(valyriumFluid, 2), new FluidStack
(uruFluid, 2), new FluidStack(nucleumFluid, 1));
registerTinkerAlloy(new FluidStack(adamantFluid, 3), new FluidStack(vibraniumFluid, 1), new FluidStack
(solariumFluid, 1), new FluidStack(ioxFluid, 3));
registerTinkerAlloy(new FluidStack(nihiliteFluid, 1), new FluidStack(vibraniumFluid, 1), new FluidStack
(solariumFluid, 1));
registerTinkerAlloy(new FluidStack(seismumFluid, 4), new FluidStack(TinkerFluids.obsidian, 4), new FluidStack
(triberiumFluid, 2), new FluidStack(eezoFluid, 1));
registerTinkerAlloy(new FluidStack(astriumFluid, 2), new FluidStack(terraxFluid, 3), new FluidStack
(auroriumFluid, 2));
registerTinkerAlloy(new FluidStack(niobFluid, 3), new FluidStack(palladiumFluid, 3), new FluidStack
(duraniteFluid, 1), new FluidStack(osramFluid, 1));
registerTinkerAlloy(new FluidStack(yrdeenFluid, 3), new FluidStack(uruFluid, 3), new FluidStack
(valyriumFluid, 3), new FluidStack(osramFluid, 1));
registerTinkerAlloy(new FluidStack(yrdeenFluid, 3), new FluidStack(uruFluid, 3), new FluidStack
(valyriumFluid, 3), new FluidStack(eezoFluid, 1));
registerTinkerAlloy(new FluidStack(yrdeenFluid, 3), new FluidStack(uruFluid, 3), new FluidStack
(valyriumFluid, 3), new FluidStack(abyssumFluid, 1));
registerTinkerAlloy(new FluidStack(ioxFluid, 1), new FluidStack(eezoFluid, 2), new FluidStack(abyssumFluid,
2), new FluidStack(osramFluid, 2), new FluidStack(obsidioriteFluid, 9));
registerTinkerAlloy(new FluidStack(ioxFluid, 1), new FluidStack(eezoFluid, 2), new FluidStack(abyssumFluid,
2), new FluidStack(osramFluid, 2), new FluidStack(meteoriteFluid, 9), new FluidStack(TinkerFluids
.obsidian, 9));
registerTinkerAlloy(new FluidStack(lumixFluid, 1), new FluidStack(palladiumFluid, 1), new FluidStack
(terraxFluid, 1));
registerTinkerAlloy(new FluidStack(obsidioriteFluid, 1), new FluidStack(meteoriteFluid, 1), new FluidStack
(TinkerFluids.obsidian, 1));
registerTinkerAlloy(new FluidStack(nucleumFluid, 3), new FluidStack(proxiiFluid, 3), new FluidStack
(abyssumFluid, 1), new FluidStack(osramFluid, 1));
registerTinkerAlloy(new FluidStack(nucleumFluid, 3), new FluidStack(imperomiteFluid, 3), new FluidStack
(osramFluid, 1), new FluidStack(eezoFluid, 1));
registerTinkerAlloy(new FluidStack(nucleumFluid, 3), new FluidStack(niobFluid, 3), new FluidStack(eezoFluid,
1), new FluidStack(abyssumFluid, 1));
registerTinkerAlloy(new FluidStack(dyoniteFluid, 3), new FluidStack(triberiumFluid, 3), new FluidStack
(fractumFluid, 1), new FluidStack(seismumFluid, 1), new FluidStack(osramFluid, 1));
registerTinkerAlloy(new FluidStack(dyoniteFluid, 3), new FluidStack(tiberiumFluid, 12), new FluidStack
(fractumFluid, 1), new FluidStack(seismumFluid, 1), new FluidStack(osramFluid, 1));
registerTinkerAlloy(new FluidStack(nitroniteFluid, 6), new FluidStack(magmaFluid, 6), new FluidStack
(osramFluid, 1));
}
}

View File

@@ -6,9 +6,11 @@ import com.sosnitzka.taiga.blocks.BlockMeteoriteRock;
import com.sosnitzka.taiga.blocks.BlockTiberium;
import com.sosnitzka.taiga.generic.BasicBlock;
import com.sosnitzka.taiga.generic.BlockOre;
import com.sosnitzka.taiga.util.Utils;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.ItemBlock;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import net.minecraftforge.oredict.OreDictionary;
import org.apache.commons.lang3.StringUtils;
@@ -26,49 +28,69 @@ public class Blocks {
// blocks and ores spawned via worldgen
public static Block basaltBlock = new BasicBlock("basalt_block", Material.ROCK, 20.0f, 35.0f, IRON, PREFIX_BLOCK);
public static Block tiberiumOre = new BlockTiberium();
public static Block auroriumOre = new BasicBlock("aurorium_ore", Material.ROCK, 15.0f, 12f, COBALT, 0.2f, PREFIX_ORE);
public static Block prometheumOre = new BasicBlock("prometheum_ore", Material.ROCK, 20.0f, 12f, DURANITE, 0.4f, PREFIX_ORE);
public static Block auroriumOre = new BasicBlock("aurorium_ore", Material.ROCK, 15.0f, 12f, COBALT, 0.2f,
PREFIX_ORE);
public static Block prometheumOre = new BasicBlock("prometheum_ore", Material.ROCK, 20.0f, 12f, DURANITE, 0.4f,
PREFIX_ORE);
public static Block duraniteOre = new BasicBlock("duranite_ore", Material.ROCK, 25.0f, 1000f, DURANITE, PREFIX_ORE);
public static Block valyriumOre = new BasicBlock("valyrium_ore", Material.ROCK, 35.0f, 2000f, VALYRIUM, PREFIX_ORE);
public static Block vibraniumOre = new BasicBlock("vibranium_ore", Material.ROCK, 40.0f, 3000f, VIBRANIUM, PREFIX_ORE);
public static Block vibraniumOre = new BasicBlock("vibranium_ore", Material.ROCK, 40.0f, 3000f, VIBRANIUM,
PREFIX_ORE);
public static Block karmesineOre = new BasicBlock("karmesine_ore", Material.ROCK, 10.0f, 10f, COBALT, PREFIX_ORE);
public static Block oviumOre = new BasicBlock("ovium_ore", Material.ROCK, 10.0f, 10f, COBALT, PREFIX_ORE);
public static Block jauxumOre = new BasicBlock("jauxum_ore", Material.ROCK, 10.0f, 10f, COBALT, PREFIX_ORE);
public static Block palladiumOre = new BasicBlock("palladium_ore", Material.ROCK, 25.0f, 150f, DURANITE, 0.4f, PREFIX_ORE);
public static Block palladiumOre = new BasicBlock("palladium_ore", Material.ROCK, 25.0f, 150f, DURANITE, 0.4f,
PREFIX_ORE);
public static Block uruOre = new BasicBlock("uru_ore", Material.ROCK, 35.0f, 500f, VALYRIUM, PREFIX_ORE);
public static Block osramOre = new BasicBlock("osram_ore", Material.ROCK, 15.0f, 35.0f, COBALT, PREFIX_ORE);
public static Block eezoOre = new BasicBlock("eezo_ore", Material.ROCK, 50.0f, 50000.0f, COBALT, PREFIX_ORE);
public static Block abyssumOre = new BasicBlock("abyssum_ore", Material.ROCK, 15.0f, 35.0f, COBALT, PREFIX_ORE);
// Ore Castsee
public static Block tiberiumBlock = new BasicBlock("tiberium_block", Material.GLASS, 10.0f, 15f, STONE, 1f, PREFIX_BLOCK);
public static Block auroriumBlock = new BasicBlock("aurorium_block", Material.ROCK, 15.0f, 15f, COBALT, PREFIX_BLOCK);
public static Block prometheumBlock = new BasicBlock("prometheum_block", Material.ROCK, 20.0f, 15f, DURANITE, 0.5f, PREFIX_BLOCK);
public static Block duraniteBlock = new BasicBlock("duranite_block", Material.ROCK, 20.0f, 800f, DURANITE, PREFIX_BLOCK);
public static Block valyriumBlock = new BasicBlock("valyrium_block", Material.ROCK, 20.0f, 1500f, VALYRIUM, PREFIX_BLOCK);
public static Block vibraniumBlock = new BasicBlock("vibranium_block", Material.ROCK, 20.0f, 3000f, VIBRANIUM, PREFIX_BLOCK);
public static Block karmesineBlock = new BasicBlock("karmesine_block", Material.ROCK, 10.0f, 12f, COBALT, PREFIX_BLOCK);
public static Block tiberiumBlock = new BasicBlock("tiberium_block", Material.GLASS, 10.0f, 15f, STONE, 1f,
PREFIX_BLOCK);
public static Block auroriumBlock = new BasicBlock("aurorium_block", Material.ROCK, 15.0f, 15f, COBALT,
PREFIX_BLOCK);
public static Block prometheumBlock = new BasicBlock("prometheum_block", Material.ROCK, 20.0f, 15f, DURANITE,
0.5f, PREFIX_BLOCK);
public static Block duraniteBlock = new BasicBlock("duranite_block", Material.ROCK, 20.0f, 800f, DURANITE,
PREFIX_BLOCK);
public static Block valyriumBlock = new BasicBlock("valyrium_block", Material.ROCK, 20.0f, 1500f, VALYRIUM,
PREFIX_BLOCK);
public static Block vibraniumBlock = new BasicBlock("vibranium_block", Material.ROCK, 20.0f, 3000f, VIBRANIUM,
PREFIX_BLOCK);
public static Block karmesineBlock = new BasicBlock("karmesine_block", Material.ROCK, 10.0f, 12f, COBALT,
PREFIX_BLOCK);
public static Block oviumBlock = new BasicBlock("ovium_block", Material.ROCK, 10.0f, 12f, COBALT, PREFIX_BLOCK);
public static Block jauxumBlock = new BasicBlock("jauxum_block", Material.ROCK, 10.0f, 12f, COBALT, PREFIX_BLOCK);
public static Block palladiumBlock = new BasicBlock("palladium_block", Material.ROCK, 25.0f, 150f, DURANITE, 0.5f, PREFIX_BLOCK);
public static Block palladiumBlock = new BasicBlock("palladium_block", Material.ROCK, 25.0f, 150f, DURANITE,
0.5f, PREFIX_BLOCK);
public static Block uruBlock = new BasicBlock("uru_block", Material.ROCK, 30.0f, 500f, VALYRIUM, PREFIX_BLOCK);
public static Block osramBlock = new BasicBlock("osram_block", Material.ROCK, 15.0f, 12f, COBALT, PREFIX_BLOCK);
public static Block abyssumBlock = new BasicBlock("abyssum_block", Material.ROCK, 15.0f, 35f, COBALT, PREFIX_BLOCK);
public static Block eezoBlock = new BasicBlock("eezo_block", Material.ROCK, 20.0f, 1000f, COBALT, PREFIX_BLOCK);
public static Block terraxBlock = new BasicBlock("terrax_block", Material.ROCK, 10.0f, 15f, COBALT, PREFIX_BLOCK);
public static Block triberiumBlock = new BasicBlock("triberium_block", Material.ROCK, 15.0f, 15f, OBSIDIAN, 1f, PREFIX_BLOCK);
public static Block triberiumBlock = new BasicBlock("triberium_block", Material.ROCK, 15.0f, 15f, OBSIDIAN, 1f,
PREFIX_BLOCK);
public static Block fractumBlock = new BasicBlock("fractum_block", Material.ROCK, 15.0f, 25f, COBALT, PREFIX_BLOCK);
public static Block violiumBlock = new BasicBlock("violium_block", Material.ROCK, 15.0f, 25f, COBALT, PREFIX_BLOCK);
public static Block proxiiBlock = new BasicBlock("proxii_block", Material.ROCK, 15.0f, 25f, DURANITE, PREFIX_BLOCK);
public static Block tritoniteBlock = new BasicBlock("tritonite_block", Material.ROCK, 15.0f, 25f, COBALT, PREFIX_BLOCK);
public static Block tritoniteBlock = new BasicBlock("tritonite_block", Material.ROCK, 15.0f, 25f, COBALT,
PREFIX_BLOCK);
public static Block ignitzBlock = new BasicBlock("ignitz_block", Material.ROCK, 20.0f, 20f, COBALT, PREFIX_BLOCK);
public static Block imperomiteBlock = new BasicBlock("imperomite_block", Material.ROCK, 20.0f, 25f, DURANITE, PREFIX_BLOCK);
public static Block solariumBlock = new BasicBlock("solarium_block", Material.ROCK, 25.0f, 25f, VIBRANIUM, PREFIX_BLOCK);
public static Block nihiliteBlock = new BasicBlock("nihilite_block", Material.ROCK, 10.0f, 25f, VALYRIUM, PREFIX_BLOCK);
public static Block adamantBlock = new BasicBlock("adamant_block", Material.ROCK, 25.0f, 25f, VIBRANIUM, PREFIX_BLOCK);
public static Block dyoniteBlock = new BasicBlock("dyonite_block", Material.ROCK, 10.0f, 25f, DURANITE, PREFIX_BLOCK);
public static Block nucleumBlock = new BasicBlock("nucleum_block", Material.ROCK, 10.0f, 25f, VALYRIUM, PREFIX_BLOCK);
public static Block imperomiteBlock = new BasicBlock("imperomite_block", Material.ROCK, 20.0f, 25f, DURANITE,
PREFIX_BLOCK);
public static Block solariumBlock = new BasicBlock("solarium_block", Material.ROCK, 25.0f, 25f, VIBRANIUM,
PREFIX_BLOCK);
public static Block nihiliteBlock = new BasicBlock("nihilite_block", Material.ROCK, 10.0f, 25f, VALYRIUM,
PREFIX_BLOCK);
public static Block adamantBlock = new BasicBlock("adamant_block", Material.ROCK, 25.0f, 25f, VIBRANIUM,
PREFIX_BLOCK);
public static Block dyoniteBlock = new BasicBlock("dyonite_block", Material.ROCK, 10.0f, 25f, DURANITE,
PREFIX_BLOCK);
public static Block nucleumBlock = new BasicBlock("nucleum_block", Material.ROCK, 10.0f, 25f, VALYRIUM,
PREFIX_BLOCK);
public static Block lumixBlock = new BasicBlock("lumix_block", Material.ROCK, 15.0f, 25f, COBALT, PREFIX_BLOCK);
public static Block seismumBlock = new BasicBlock("seismum_block", Material.ROCK, 15.0f, 25f, COBALT, PREFIX_BLOCK);
public static Block astriumBlock = new BasicBlock("astrium_block", Material.ROCK, 15.0f, 25f, COBALT, PREFIX_BLOCK);
@@ -77,15 +99,22 @@ public class Blocks {
public static Block ioxBlock = new BasicBlock("iox_block", Material.ROCK, 20.0f, 25f, DURANITE, PREFIX_BLOCK);
public static Block blockMeteoriteCobble = new BlockCobble("meteoritecobble_block", Material.ROCK, 20f, 10f, COBALT, 0.075f, PREFIX_BLOCK);
public static Block blockObsidioriteCobble = new BlockCobble("obsidioritecobble_block", Material.ROCK, 25f, 20f, DURANITE, 0.035f, PREFIX_BLOCK);
public static Block blockMeteorite = new BlockMeteoriteRock("meteorite_block", Material.ROCK, 40f, 2000f, COBALT, 0.15f, PREFIX_BLOCK, blockMeteoriteCobble.getDefaultState());
public static Block blockObsidiorite = new BlockMeteoriteRock("obsidiorite_block", Material.ROCK, 50f, 4000f, DURANITE, 0.2f, PREFIX_BLOCK, blockObsidioriteCobble.getDefaultState());
public static Block blockMeteoriteCobble = new BlockCobble("meteoritecobble_block", Material.ROCK, 20f, 10f,
COBALT, 0.075f, PREFIX_BLOCK);
public static Block blockObsidioriteCobble = new BlockCobble("obsidioritecobble_block", Material.ROCK, 25f, 20f,
DURANITE, 0.035f, PREFIX_BLOCK);
public static Block blockMeteorite = new BlockMeteoriteRock("meteorite_block", Material.ROCK, 40f, 2000f, COBALT,
0.15f, PREFIX_BLOCK, blockMeteoriteCobble.getDefaultState());
public static Block blockObsidiorite = new BlockMeteoriteRock("obsidiorite_block", Material.ROCK, 50f, 4000f,
DURANITE, 0.2f, PREFIX_BLOCK, blockObsidioriteCobble.getDefaultState());
// Community
public static Block dilithiumOre = new BlockOre("dilithium_ore", Material.GLASS, 18f, 18f, DIAMOND, 0.73f, Items.dilithiumCrystal, 3, 10);
public static Block dilithiumBlock = new BasicBlock("dilithium_block", Material.GLASS, 18f, 18f, DIAMOND, 0.73f, PREFIX_ORE);
public static Block dilithiumOre = new BlockOre("dilithium_ore", Material.GLASS, 18f, 18f, DIAMOND, 0.73f, Items
.dilithiumCrystal, 3, 10);
public static Block dilithiumBlock = new BasicBlock("dilithium_block", Material.GLASS, 18f, 18f, DIAMOND, 0.73f,
PREFIX_ORE);
/**
* Registers all materials' ingots and nuggets <br>
@@ -93,26 +122,32 @@ public class Blocks {
* Gets the ingots declared in the class (fields and reflection) and iterates through them: <br>
* Checks that the field is static, registers the field (item), and adds an oreDict entry if needed
*/
public static void register() {
@SubscribeEvent
public static void register(boolean oreDict) {
Field[] declaredFields = Blocks.class.getDeclaredFields(); // Gets the fields (ingots) declared above
for (Field field : declaredFields) { // Iterates through the fields declared above
if (java.lang.reflect.Modifier.isStatic(field.getModifiers())) { // Checks that the fields are static
Class<?> targetType = field.getType();
try {
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
if (block instanceof BasicBlock) { // Checks that the block is a BasicBlock
if (((BasicBlock) block).isOreDict()) { // Checks that the block has an oreDict entry
String oreDictName;
String[] nameParts = block.getUnlocalizedName().replace("tile.", "").split("_");
Block block = (Block) field.get(targetType);
if (!oreDict) {
block.setCreativeTab(CreativeTab.tabTaigaBlock);
ForgeRegistries.BLOCKS.register(block); // Registers block and its item
} else {
if (block instanceof BasicBlock) { // Checks that the block is a BasicBlock
if (((BasicBlock) block).isOreDict()) { // Checks that the block has an oreDict entry
String oreDictName;
String[] nameParts = block.getUnlocalizedName().replace("tile.", "").split("_");
if (nameParts.length > 2) {
oreDictName = Joiner.on("_").join(Arrays.copyOfRange(nameParts, 0, nameParts.length - 1));
} else {
oreDictName = nameParts[0];
if (nameParts.length > 2) {
oreDictName = Joiner.on("_").join(Arrays.copyOfRange(nameParts, 0, nameParts
.length - 1));
} else {
oreDictName = nameParts[0];
}
OreDictionary.registerOre(((BasicBlock) block).getOreDictPrefix() + StringUtils
.capitalize(oreDictName), block); // Registers the block's oreDict
}
OreDictionary.registerOre(((BasicBlock) block).getOreDictPrefix() + StringUtils.capitalize(oreDictName), block); // Registers the block's oreDict
}
}
} catch (IllegalAccessException e) {
@@ -121,4 +156,21 @@ public class Blocks {
}
}
}
@SubscribeEvent
public static void registerItems() {
Field[] declaredFields = Blocks.class.getDeclaredFields(); // Gets the fields (ingots) declared above
for (Field field : declaredFields) { // Iterates through the fields declared above
if (java.lang.reflect.Modifier.isStatic(field.getModifiers())) { // Checks that the fields are static
Class<?> targetType = field.getType();
try {
Block block = (Block) field.get(targetType); // Gets the field as a BasicBlock which is then
// casted to an Block
ForgeRegistries.ITEMS.register(new ItemBlock(block).setRegistryName(block.getRegistryName()));
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
}
}
}

View File

@@ -3,6 +3,7 @@ package com.sosnitzka.taiga;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import static com.sosnitzka.taiga.Blocks.adamantBlock;
import static com.sosnitzka.taiga.Items.solariumIngot;
@@ -12,15 +13,15 @@ public class CreativeTab {
public static final CreativeTabs tabTaigaBlock = new CreativeTabs("taiga_block") {
@Override
public Item getTabIconItem() {
return Item.getItemFromBlock(adamantBlock);
public ItemStack getTabIconItem() {
return new ItemStack(Item.getItemFromBlock(adamantBlock));
}
};
public static final CreativeTabs tabTaigaItem = new CreativeTabs("taiga_item") {
@Override
public Item getTabIconItem() {
return solariumIngot;
public ItemStack getTabIconItem() {
return new ItemStack(solariumIngot);
}
};
}

View File

@@ -2,8 +2,9 @@ package com.sosnitzka.taiga;
import com.sosnitzka.taiga.generic.BasicTinkerFluid;
import com.sosnitzka.taiga.util.Utils;
import net.minecraft.item.ItemBlock;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import slimeknights.tconstruct.library.TinkerRegistry;
import slimeknights.tconstruct.smeltery.block.BlockMolten;
@@ -16,10 +17,12 @@ public class Fluids {
public static BasicTinkerFluid basaltFluid = new BasicTinkerFluid("basalt_fluid", 0xFFe4ddc3, 550, 10, 6000);
public static BasicTinkerFluid tiberiumFluid = new BasicTinkerFluid("tiberium_fluid", 0xFFd4ff00, 400, 10, 8000);
public static BasicTinkerFluid auroriumFluid = new BasicTinkerFluid("aurorium_fluid", 0xFFefae94, 750, 10, 10000);
public static BasicTinkerFluid prometheumFluid = new BasicTinkerFluid("prometheum_fluid", 0xFF372c49, 850, 10, 10000);
public static BasicTinkerFluid prometheumFluid = new BasicTinkerFluid("prometheum_fluid", 0xFF372c49, 850, 10,
10000);
public static BasicTinkerFluid duraniteFluid = new BasicTinkerFluid("duranite_fluid", 0xFFacddeb, 1400, 10, 10000);
public static BasicTinkerFluid valyriumFluid = new BasicTinkerFluid("valyrium_fluid", 0xFFe85c31, 1915, 10, 10000);
public static BasicTinkerFluid vibraniumFluid = new BasicTinkerFluid("vibranium_fluid", 0xFFbad2d9, 3050, 10, 10000);
public static BasicTinkerFluid vibraniumFluid = new BasicTinkerFluid("vibranium_fluid", 0xFFbad2d9, 3050, 10,
10000);
public static BasicTinkerFluid karmesineFluid = new BasicTinkerFluid("karmesine_fluid", 0xFFeb484a, 750, 10, 9000);
public static BasicTinkerFluid jauxumFluid = new BasicTinkerFluid("jauxum_fluid", 0xFF68c663, 750, 10, 9000);
public static BasicTinkerFluid oviumFluid = new BasicTinkerFluid("ovium_fluid", 0xFF7d77c3, 750, 10, 9000);
@@ -35,7 +38,8 @@ public class Fluids {
public static BasicTinkerFluid proxiiFluid = new BasicTinkerFluid("proxii_fluid", 0xFFcefde1, 750, 10, 10000);
public static BasicTinkerFluid tritoniteFluid = new BasicTinkerFluid("tritonite_fluid", 0xFF8edeff, 550, 10, 10000);
public static BasicTinkerFluid ignitzFluid = new BasicTinkerFluid("ignitz_fluid", 0xFFff284b, 950, 10, 6000);
public static BasicTinkerFluid imperomiteFluid = new BasicTinkerFluid("imperomite_fluid", 0xFF7fefa0, 900, 10, 10000);
public static BasicTinkerFluid imperomiteFluid = new BasicTinkerFluid("imperomite_fluid", 0xFF7fefa0, 900, 10,
10000);
public static BasicTinkerFluid solariumFluid = new BasicTinkerFluid("solarium_fluid", 0xFFfef864, 1500, 10, 2000);
public static BasicTinkerFluid nihiliteFluid = new BasicTinkerFluid("nihilite_fluid", 0xFF6645ba, 580, 10, 10000);
public static BasicTinkerFluid adamantFluid = new BasicTinkerFluid("adamant_fluid", 0xFFff8efe, 1650, 10, 10000);
@@ -48,7 +52,8 @@ public class Fluids {
public static BasicTinkerFluid yrdeenFluid = new BasicTinkerFluid("yrdeen_fluid", 0xFF8f385f, 710, 10, 10000);
public static BasicTinkerFluid ioxFluid = new BasicTinkerFluid("iox_fluid", 0xFF99323c, 900, 10, 10000);
public static BasicTinkerFluid meteoriteFluid = new BasicTinkerFluid("meteorite_fluid", 0xFF374f3d, 950, 10, 7000);
public static BasicTinkerFluid obsidioriteFluid = new BasicTinkerFluid("obsidiorite_fluid", 0xFF224853, 1050, 10, 7000);
public static BasicTinkerFluid obsidioriteFluid = new BasicTinkerFluid("obsidiorite_fluid", 0xFF224853, 1050, 10,
7000);
public static BasicTinkerFluid magmaFluid = new BasicTinkerFluid("magma_fluid", 0xFFffc000, 2000, 10, 5000);
public static BasicTinkerFluid nitroniteFluid = new BasicTinkerFluid("nitronite_fluid", 0xFFCCFF00, 3100, 10, 5000);
@@ -68,16 +73,18 @@ public class Fluids {
if (java.lang.reflect.Modifier.isStatic(field.getModifiers())) { // Checks that the fields are static
Class<?> targetType = field.getType();
try {
BasicTinkerFluid fluid = (BasicTinkerFluid) field.get(targetType); // Gets the field as a BasicTinkerFluid
BasicTinkerFluid fluid = (BasicTinkerFluid) field.get(targetType); // Gets the field as a
// BasicTinkerFluid
registerFluid(fluid); // Registers the fluid into the game along wit its bucket
BlockMolten block = new BlockMolten(fluid);
// Sets names
block.setUnlocalizedName("molten_" + fluid.getName());
block.setRegistryName(TAIGA.MODID, "molten_" + fluid.getName());
// Registers the fluid in its block form and its corresponding item (block/fluid as item in inventory)
Utils.registerBlockWithItem(block);
// Registers the fluid's model but only on the client side
// Registers the fluid in its block form and its corresponding item (block/fluid as item in
// inventory)
ForgeRegistries.BLOCKS.register(block);
ForgeRegistries.ITEMS.register(new ItemBlock(block).setRegistryName(block.getRegistryName()));
TAIGA.proxy.registerFluidModels(fluid);
} catch (IllegalAccessException e) {
e.printStackTrace();

View File

@@ -4,7 +4,8 @@ package com.sosnitzka.taiga;
import com.google.common.base.Joiner;
import com.sosnitzka.taiga.generic.BasicItem;
import net.minecraft.item.Item;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import net.minecraftforge.oredict.OreDictionary;
import org.apache.commons.lang3.StringUtils;
@@ -173,32 +174,36 @@ public class Items {
* Gets the ingots declared in the class (fields and reflection) and iterates through them: <br>
* Checks that the field is static, registers the field (item), and adds an oreDict entry if needed
*/
@SubscribeEvent
public static void register() {
Field[] declaredFields = Items.class.getDeclaredFields(); // Gets the fields (ingots) declared above
for (Field field : declaredFields) { // Iterates through the fields declared above
if (java.lang.reflect.Modifier.isStatic(field.getModifiers())) { // Checks that the fields are static
Class<?> targetType = field.getType();
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(ironNugget) && 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
ForgeRegistries.ITEMS.register(item); // Registers the item into the game
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
String oreDictName;
String[] nameParts = item.getUnlocalizedName().replace("item.", "").split("_");
if (nameParts.length > 2) {
oreDictName = Joiner.on("_").join(Arrays.copyOfRange(nameParts, 0, nameParts.length - 1));
oreDictName = Joiner.on("_").join(Arrays.copyOfRange(nameParts, 0, nameParts.length -
1));
} else {
oreDictName = nameParts[0];
}
OreDictionary.registerOre(((BasicItem) item).getOreDictPrefix() + StringUtils.capitalize(oreDictName), item); // Registers into oreDict
OreDictionary.registerOre(((BasicItem) item).getOreDictPrefix() + StringUtils.capitalize
(oreDictName), item); // Registers into oreDict
}
}
} catch (IllegalAccessException e) {

View File

@@ -73,10 +73,12 @@ public class MaterialTraits {
public static Material tiberium = new Material("tiberium", TextFormatting.GREEN).addTrait(instable);
public static Material aurorium = new Material("aurorium", TextFormatting.RED).addTrait(arcane);
public static Material prometheum = new Material("prometheum", TextFormatting.DARK_PURPLE).addTrait(blind, MaterialTypes.HANDLE).addTrait(catcher);
public static Material prometheum = new Material("prometheum", TextFormatting.DARK_PURPLE).addTrait(blind,
MaterialTypes.HANDLE).addTrait(catcher);
public static Material duranite = new Material("duranite", TextFormatting.YELLOW).addTrait(analysing);
public static Material valyrium = new Material("valyrium", TextFormatting.DARK_GRAY).addTrait(congenial);
public static Material vibranium = new Material("vibranium", TextFormatting.GRAY).addTrait(resonance, MaterialTypes.HANDLE).addTrait(heroic, MaterialTypes.HEAD);
public static Material vibranium = new Material("vibranium", TextFormatting.GRAY).addTrait(resonance,
MaterialTypes.HANDLE).addTrait(heroic, MaterialTypes.HEAD);
public static Material terrax = new Material("terrax", TextFormatting.DARK_GRAY).addTrait(slaughtering);
public static Material palladium = new Material("palladium", TextFormatting.GOLD).addTrait(dark).addTrait(cursed);
public static Material uru = new Material("uru", TextFormatting.DARK_RED).addTrait(diffuse);
@@ -87,19 +89,23 @@ public class MaterialTraits {
public static Material violium = new Material("violium", TextFormatting.DARK_PURPLE).addTrait(arcane);
public static Material proxii = new Material("proxii", TextFormatting.LIGHT_PURPLE).addTrait(curvature);
public static Material tritonite = new Material("tritonite", TextFormatting.GOLD).addTrait(whirl);
public static Material ignitz = new Material("ignitz", TextFormatting.RED).addTrait(melting).addTrait(garishly, MaterialTypes.HANDLE);
public static Material ignitz = new Material("ignitz", TextFormatting.RED).addTrait(melting).addTrait(garishly,
MaterialTypes.HANDLE);
public static Material imperomite = new Material("imperomite", TextFormatting.DARK_RED).addTrait(hollow);
public static Material solarium = new Material("solarium", TextFormatting.YELLOW).addTrait(superheavy).addTrait(crushing);
public static Material solarium = new Material("solarium", TextFormatting.YELLOW).addTrait(superheavy).addTrait
(crushing);
public static Material nihilite = new Material("nihilite", TextFormatting.DARK_GRAY).addTrait(souleater);
public static Material adamant = new Material("adamant", TextFormatting.GOLD).addTrait(berserk);
public static Material dyonite = new Material("dyonite", TextFormatting.GREEN).addTrait(tantrum);
public static Material nucleum = new Material("nucleum", TextFormatting.YELLOW).addTrait(decay).addTrait(mutate);
public static Material lumix = new Material("lumix", TextFormatting.YELLOW).addTrait(bright, MaterialTypes.HANDLE).addTrait(glimmer, MaterialTypes.HEAD);
public static Material lumix = new Material("lumix", TextFormatting.YELLOW).addTrait(bright, MaterialTypes
.HANDLE).addTrait(glimmer, MaterialTypes.HEAD);
public static Material seismum = new Material("seismum", TextFormatting.GREEN).addTrait(cascade);
public static Material astrium = new Material("astrium", TextFormatting.DARK_PURPLE).addTrait(ported);
public static Material niob = new Material("niob", TextFormatting.RED).addTrait(reviving);
public static Material yrdeen = new Material("yrdeen", TextFormatting.RED).addTrait(naturebound);
public static Material meteorite = new Material("meteorite", TextFormatting.DARK_GREEN).addTrait(crumbling, MaterialTypes.HEAD).addTrait(pulverizing);
public static Material meteorite = new Material("meteorite", TextFormatting.DARK_GREEN).addTrait(crumbling,
MaterialTypes.HEAD).addTrait(pulverizing);
public static Material obsidiorite = new Material("obsidiorite", obsidioriteFluid.getColor()).addTrait(alien);
public static Material osram = new Material("osram", TextFormatting.GOLD);

View File

@@ -14,7 +14,6 @@ import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import slimeknights.tconstruct.library.MaterialIntegration;
import slimeknights.tconstruct.library.materials.BowMaterialStats;
@@ -27,47 +26,58 @@ import static com.sosnitzka.taiga.util.Utils.integrateMaterial;
import static com.sosnitzka.taiga.util.Utils.integrateOre;
import static slimeknights.tconstruct.library.utils.HarvestLevels.*;
@Mod(modid = TAIGA.MODID, version = TAIGA.VERSION, guiFactory = TAIGA.GUIFACTORY, dependencies = "required-after:tconstruct@[1.10.2-2.5.0,);" + "required-after:mantle@[1.10.2-1.0.0,)")
@Mod(modid = TAIGA.MODID, version = TAIGA.VERSION, guiFactory = TAIGA.GUIFACTORY, dependencies =
"required-after:tconstruct@[1.10.2-2.5.0,);" + "required-after:mantle@[1.10.2-1.0.0,)")
public class TAIGA {
public static final String MODID = "taiga";
public static final String VERSION = "@VERSION@";
public static final String GUIFACTORY = "com.sosnitzka.taiga.TAIGAGuiFactory";
public static final Logger logger = LogManager.getLogger("TAIGA");
public static Logger logger;
@SidedProxy(clientSide = "com.sosnitzka.taiga.proxy.ClientProxy", serverSide = "com.sosnitzka.taiga.proxy.CommonProxy")
@SidedProxy(clientSide = "com.sosnitzka.taiga.proxy.ClientProxy", serverSide = "com.sosnitzka.taiga.proxy" +
".CommonProxy")
public static CommonProxy proxy;
public static List<MaterialIntegration> integrateList = Lists.newArrayList(); // List of materials needed to be integrated
@EventHandler
public void preInit(FMLPreInitializationEvent e) {
logger = e.getModLog();
Fluids.register();
Blocks.register(false);
Blocks.registerItems();
Items.register();
proxy.initConfig();
Items.register(); // Registers items and its oreDict
Blocks.register(); // Registers blocks and its items form a long with its oreDict
Fluids.register(); // Registers all fluids and its buckets
Fluids.registerfromItem(); // Registers some special smeltery recipes (not alloying)
Alloys.register(); // Registers alloying recipes
registerTinkerMaterials(); // Registers materials and associated fluids and stats into tconstruct
registerTinkerMaterials();
}
@EventHandler
public void init(FMLInitializationEvent e) {
proxy.registerModels(); // Registers models on the client side
Fluids.registerfromItem(); // Registers some special smeltery recipes (not alloying)
GameRegistry.registerWorldGenerator(WorldGen.getInstance(), 100); // Generates ores
// GameRegistry.registerFuelHandler(new FuelHandler()); Registeres fuels' burn times
SmeltingRegistry.register(); // Registers smelting recipes
CraftingRegistry.register(); // Registers crafting recipes
// Adds new harvest levels' names
harvestLevelNames.put(DURANITE, TextFormatting.DARK_GREEN + "Duranite");
harvestLevelNames.put(VALYRIUM, TextFormatting.GOLD + "Valyrium");
harvestLevelNames.put(VIBRANIUM, TextFormatting.DARK_PURPLE + "Vibranium");
Blocks.register(true);
Alloys.register(); // Registers alloying recipes
registerTinkerMaterials(); // Registers materials and associated fluids and stats into tconstruct
SmeltingRegistry.register(); // Registers smelting recipes
CraftingRegistry.register(); // Registers crafting recipes
for (MaterialIntegration m : integrateList) {
m.integrateRecipes();
m.integrate();
}
}
@@ -88,26 +98,35 @@ public class TAIGA {
private void registerTinkerMaterials() {
BowMaterialStats shitty = new BowMaterialStats(0.2f, 0.4f, -1f);
integrateMaterial("Tiberium", tiberium, tiberiumFluid, 80, 3.3f, 4f, 0.7f, -25, 50, DIAMOND, shitty, true, false);
integrateMaterial("Tiberium", tiberium, tiberiumFluid, 80, 3.3f, 4f, 0.7f, -25, 50, DIAMOND, shitty, true,
false);
integrateMaterial("Aurorium", aurorium, auroriumFluid, 750, 3.6f, 3.78f, 0.77f, 25, 130, COBALT, 0.45f, 1f, 1);
integrateMaterial("Prometheum", prometheum, prometheumFluid, 844, 4.75f, 6.6f, 1.2f, 25, 50, DURANITE, 0.2f, 0.6f, 3);
integrateMaterial("Duranite", duranite, duraniteFluid, 1550, 3.2f, 3.2f, 1.16f, 100, 100, DURANITE, 0.3f, 1.4f, 2);
integrateMaterial("Valyrium", valyrium, valyriumFluid, 1111, 5.37f, 4.8f, 1.30f, 100, 100, VALYRIUM, 1.1f, 1.2f, 4);
integrateMaterial("Vibranium", vibranium, vibraniumFluid, 1235, 7.62f, 8.1f, 1.3f, 100, 100, VIBRANIUM, 1.1f, 1.8f, 4);
integrateMaterial("Prometheum", prometheum, prometheumFluid, 844, 4.75f, 6.6f, 1.2f, 25, 50, DURANITE, 0.2f,
0.6f, 3);
integrateMaterial("Duranite", duranite, duraniteFluid, 1550, 3.2f, 3.2f, 1.16f, 100, 100, DURANITE, 0.3f,
1.4f, 2);
integrateMaterial("Valyrium", valyrium, valyriumFluid, 1111, 5.37f, 4.8f, 1.30f, 100, 100, VALYRIUM, 1.1f,
1.2f, 4);
integrateMaterial("Vibranium", vibranium, vibraniumFluid, 1235, 7.62f, 8.1f, 1.3f, 100, 100, VIBRANIUM, 1.1f,
1.8f, 4);
integrateMaterial("Terrax", terrax, terraxFluid, 444, 4.77f, 2.9f, 0.8f, 100, 50, COBALT, shitty, true, true);
integrateMaterial("Palladium", palladium, palladiumFluid, 797, 4.35f, 6.8f, 1.3f, 130, -50, DURANITE, .5f, .2f, 3);
integrateMaterial("Palladium", palladium, palladiumFluid, 797, 4.35f, 6.8f, 1.3f, 130, -50, DURANITE, .5f,
.2f, 3);
integrateMaterial("Uru", uru, uruFluid, 877, 2f, 7.2f, 1.5f, -50, 175, VALYRIUM, 1.3f, 0.8f, 6);
integrateMaterial("Eezo", eezo, eezoFluid, 50, 23f, 3.5f, .1f, 10, 10, COBALT, shitty, true, false);
integrateMaterial("Basalt", basalt, basaltFluid, 200, 3, 2.5f, 0.5f, -25, 25, STONE, shitty, true, false);
integrateMaterial("Triberium", triberium, triberiumFluid, 223, 6.2f, 8.35f, 0.63f, 50, 50, DIAMOND, shitty, true, true);
integrateMaterial("Triberium", triberium, triberiumFluid, 223, 6.2f, 8.35f, 0.63f, 50, 50, DIAMOND, shitty,
true, true);
integrateMaterial("Fractum", fractum, fractumFluid, 538, 5.71f, 6.93f, 0.88f, 58, 117, DIAMOND, shitty);
integrateMaterial("Violium", violium, violiumFluid, 925, 3.8f, 3.75f, .90f, 175, 50, COBALT, .45f, .95f, 1);
integrateMaterial("Proxii", proxii, proxiiFluid, 625, 6.8f, 4.21f, 1.25f, 80, 25, DURANITE, .35f, .5f, 3);
integrateMaterial("Tritonite", tritonite, tritoniteFluid, 780, 8f, 3.3f, 1.45f, -25, 150, COBALT, shitty);
integrateMaterial("Ignitz", ignitz, ignitzFluid, 350, 2f, 6.66f, .85f, 150, 250, COBALT, .8f, .8f, 3);
integrateMaterial("Imperomite", imperomite, imperomiteFluid, 1350, 4.65f, 5.9f, 1.15f, -100, 150, DURANITE, 1.2f, 1.8f, 2);
integrateMaterial("Imperomite", imperomite, imperomiteFluid, 1350, 4.65f, 5.9f, 1.15f, -100, 150, DURANITE,
1.2f, 1.8f, 2);
integrateMaterial("Solarium", solarium, solariumFluid, 1100, 24f, 7f, 1.25f, 150, 150, VIBRANIUM, .8f, 1.5f, 5);
integrateMaterial("Nihilite", nihilite, nihiliteFluid, 400, 2.8f, 4.50f, .77f, 350, 155, VALYRIUM, 1.5f, .8f, 3);
integrateMaterial("Nihilite", nihilite, nihiliteFluid, 400, 2.8f, 4.50f, .77f, 350, 155, VALYRIUM, 1.5f, .8f,
3);
integrateMaterial("Adamant", adamant, adamantFluid, 1750, 6f, 6f, 2f, 0, 0, VIBRANIUM, .35f, 1.85f, 8);
integrateMaterial("Dyonite", dyonite, dyoniteFluid, 900, 6.45f, 5f, 0.66f, -50, 250, DURANITE, 2, .9f, -1);
integrateMaterial("Nucleum", nucleum, nucleumFluid, 505, 17.5f, 9.5f, 1.05f, 100, 125, VALYRIUM, shitty);

View File

@@ -80,10 +80,6 @@ public class TAIGAConfiguration {
syncConfig(false, true);
}
public static void syncFromFields() {
syncConfig(false, false);
}
private static void syncConfig(boolean loadConfigFromFile, boolean readFieldsFromConfig) {
if (loadConfigFromFile) {
config.load();
@@ -122,7 +118,8 @@ public class TAIGAConfiguration {
/*
Stuff which probably gonna come back
Property durabilityFactorGeneralProp = config.get(CATEGORY_NAME_GENERAL, "Durability factor", RESFAC_DEFAULT_VALUE,
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);
@@ -141,39 +138,56 @@ public class TAIGAConfiguration {
*/
Property ironValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Iron", IRON_DEFAULT, "generation count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
Property ironValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Iron", IRON_DEFAULT, "generation count per " +
"chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
ironValueProp.setLanguageKey("gui.taiga_configuration.iron_multiplier");
Property basaltValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Basalt", BASALT_DEFAULT, "generation count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
Property basaltValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Basalt", BASALT_DEFAULT, "generation count per " +
"chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
basaltValueProp.setLanguageKey("gui.taiga_configuration.basalt_multiplier");
Property tiberiumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Tiberium", TIBERIUM_DEFAULT, "generation count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
Property tiberiumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Tiberium", TIBERIUM_DEFAULT, "generation " +
"count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
tiberiumValueProp.setLanguageKey("gui.taiga_configuration.tiberium_multiplier");
Property auroriumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Aurorium", AURORIUM_DEFAULT, "generation count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
Property auroriumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Aurorium", AURORIUM_DEFAULT, "generation " +
"count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
auroriumValueProp.setLanguageKey("gui.taiga_configuration.aurorium_multiplier");
Property prometheumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Prometheum", PROMETHEUM_DEFAULT, "generation count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
Property prometheumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Prometheum", PROMETHEUM_DEFAULT,
"generation count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
prometheumValueProp.setLanguageKey("gui.taiga_configuration.prometheum_multiplier");
Property duraniteValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Duranite", DURANITE_DEFAULT, "generation count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
Property duraniteValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Duranite", DURANITE_DEFAULT, "generation " +
"count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
duraniteValueProp.setLanguageKey("gui.taiga_configuration.duranite_multiplier");
Property valyriumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Valyrium", VALYRIUM_DEFAULT, "generation count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
Property valyriumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Valyrium", VALYRIUM_DEFAULT, "generation " +
"count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
valyriumValueProp.setLanguageKey("gui.taiga_configuration.valyrium_multiplier");
Property vibraniumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Vibranium", VIBRANIUM_DEFAULT, "generation count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
Property vibraniumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Vibranium", VIBRANIUM_DEFAULT, "generation " +
"count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
vibraniumValueProp.setLanguageKey("gui.taiga_configuration.vibranium_multiplier");
Property dilithiumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Dilithium", DILITHIUM_DEFAULT, "generation count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
Property dilithiumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Dilithium", DILITHIUM_DEFAULT, "generation " +
"count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
dilithiumValueProp.setLanguageKey("gui.taiga_configuration.dilithium_multiplier");
Property karmesineValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Karmesine", KARMESINE_DEFAULT, "generation count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
Property karmesineValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Karmesine", KARMESINE_DEFAULT, "generation " +
"count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
karmesineValueProp.setLanguageKey("gui.taiga_configuration.karmesine_multiplier");
Property oviumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Ovium", OVIUM_DEFAULT, "generation count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
Property oviumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Ovium", OVIUM_DEFAULT, "generation count per " +
"chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
oviumValueProp.setLanguageKey("gui.taiga_configuration.ovium_multiplier");
Property jauxumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Jauxum", JAUXUM_DEFAULT, "generation count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
Property jauxumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Jauxum", JAUXUM_DEFAULT, "generation count per " +
"chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
jauxumValueProp.setLanguageKey("gui.taiga_configuration.jauxum_multiplier");
Property palladiumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Palladium", PALLADIUM_DEFAULT, "generation count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
Property palladiumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Palladium", PALLADIUM_DEFAULT, "generation " +
"count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
palladiumValueProp.setLanguageKey("gui.taiga_configuration.palladium_multiplier");
Property uruValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Uru", URU_DEFAULT, "generation count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
Property uruValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Uru", URU_DEFAULT, "generation count per chunk",
RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
uruValueProp.setLanguageKey("gui.taiga_configuration.uru_multiplier");
Property osramValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Osram", OSRAM_DEFAULT, "generation count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
Property osramValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Osram", OSRAM_DEFAULT, "generation count per " +
"chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
osramValueProp.setLanguageKey("gui.taiga_configuration.osram_multiplier");
Property abyssumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Abyssum", ABYSSUM_DEFAULT, "generation count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
Property abyssumValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Abyssum", ABYSSUM_DEFAULT, "generation count " +
"per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
abyssumValueProp.setLanguageKey("gui.taiga_configuration.abyssum_multiplier");
Property eezoValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Eezo", EEZO_DEFAULT, "generation count per chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
Property eezoValueProp = config.get(CATEGORY_NAME_ORE_GEN, "Eezo", EEZO_DEFAULT, "generation count per " +
"chunk", RESFAC_MIN_VALUE, RESFAC_MAX_VALUE);
eezoValueProp.setLanguageKey("gui.taiga_configuration.eezo_multiplier");
@@ -301,7 +315,8 @@ public class TAIGAConfiguration {
@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)) {
if (event.getConfigID().equals(CATEGORY_NAME_GENERAL) || event.getConfigID().equals
(CATEGORY_NAME_ORE_GEN)) {
syncFromGUI();
}
}

View File

@@ -11,7 +11,6 @@ import net.minecraftforge.fml.client.config.GuiConfig;
import net.minecraftforge.fml.client.config.GuiConfigEntries;
import net.minecraftforge.fml.client.config.IConfigElement;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
@@ -31,32 +30,24 @@ public class TAIGAGuiFactory implements IModGuiFactory {
return new TAIGAConfigGui(parentScreen);
}
@Override
public Class<? extends GuiScreen> mainConfigGuiClass() {
return TAIGAConfigGui.class;
}
@Override
public Set<RuntimeOptionCategoryElement> runtimeGuiCategories() {
return null;
}
@Nullable
@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"));
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("Basic configuration", "gui.taiga_configuration.ctgy.general", CategoryEntryGeneral.class));
list.add(new DummyConfigElement.DummyCategoryElement("Ore specific settings", "gui.taiga_configuration.ctgy.oregen", CategoryEntryOreGen.class));
list.add(new DummyConfigElement.DummyCategoryElement("Basic configuration", "gui.taiga_configuration.ctgy" +
".general", CategoryEntryGeneral.class));
list.add(new DummyConfigElement.DummyCategoryElement("Ore specific settings", "gui.taiga_configuration" +
".ctgy.oregen", CategoryEntryOreGen.class));
return list;
}
@@ -68,11 +59,15 @@ public class TAIGAGuiFactory implements IModGuiFactory {
@Override
protected GuiScreen buildChildScreen() {
Configuration configuration = TAIGAConfiguration.getConfig();
ConfigElement cat_general = new ConfigElement(configuration.getCategory(TAIGAConfiguration.CATEGORY_NAME_GENERAL));
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);
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);
}
}
@@ -84,11 +79,15 @@ public class TAIGAGuiFactory implements IModGuiFactory {
@Override
protected GuiScreen buildChildScreen() {
Configuration configuration = TAIGAConfiguration.getConfig();
ConfigElement cat_general = new ConfigElement(configuration.getCategory(TAIGAConfiguration.CATEGORY_NAME_ORE_GEN));
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);
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);
}
}
}

View File

@@ -11,7 +11,8 @@ import static slimeknights.tconstruct.TConstruct.random;
public class BlockCobble extends BasicBlock {
public BlockCobble(String name, Material material, float hardness, float resistance, int harvestlevel, float light, String oreDictPrefix) {
public BlockCobble(String name, Material material, float hardness, float resistance, int harvestlevel, float
light, String oreDictPrefix) {
super(name, material, hardness, resistance, harvestlevel, light, oreDictPrefix);
MinecraftForge.EVENT_BUS.register(this);
}
@@ -24,7 +25,8 @@ public class BlockCobble extends BasicBlock {
if (random.nextBoolean()) {
e.getWorld().setBlockState(e.getPos(), Blocks.LAVA.getDefaultState());
} else {
e.getWorld().newExplosion(null, e.getPos().getX(), e.getPos().getY() + 1 / 16f, e.getPos().getZ(), 0.5f + random.nextFloat() * 1.5f, false, true);
e.getWorld().newExplosion(null, e.getPos().getX(), e.getPos().getY() + 1 / 16f, e.getPos().getZ()
, 0.5f + random.nextFloat() * 1.5f, false, true);
}
}
}

View File

@@ -3,15 +3,13 @@ package com.sosnitzka.taiga.blocks;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.NonNullList;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import slimeknights.mantle.block.EnumBlock;
import javax.annotation.Nonnull;
import java.util.List;
import java.util.Locale;
public class BlockMetal extends EnumBlock<BlockMetal.MetalTypes> {
@@ -24,7 +22,7 @@ public class BlockMetal extends EnumBlock<BlockMetal.MetalTypes> {
@SideOnly(Side.CLIENT)
@Override
public void getSubBlocks(@Nonnull Item itemIn, CreativeTabs tab, List<ItemStack> list) {
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) {
for (MetalTypes type : MetalTypes.values()) {
list.add(new ItemStack(this, 1, type.getMeta()));
}

View File

@@ -13,7 +13,8 @@ public class BlockMeteoriteRock extends BasicBlock {
private IBlockState cobbblestate;
public BlockMeteoriteRock(String name, Material material, float hardness, float resistance, int harvestlevel, float light, String oreDictPrefix, IBlockState cobble) {
public BlockMeteoriteRock(String name, Material material, float hardness, float resistance, int harvestlevel,
float light, String oreDictPrefix, IBlockState cobble) {
super(name, material, hardness, resistance, harvestlevel, light, oreDictPrefix);
MinecraftForge.EVENT_BUS.register(this);
this.cobbblestate = cobble;

View File

@@ -46,7 +46,8 @@ public class BlockTiberium extends BasicBlock {
public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn) {
if (!worldIn.isRemote) {
if (random.nextFloat() < 0.5) {
worldIn.newExplosion(null, pos.getX(), pos.getY(), pos.getZ(), random.nextFloat() * 2f + 1.5f, true, true);
worldIn.newExplosion(null, pos.getX(), pos.getY(), pos.getZ(), random.nextFloat() * 2f + 1.5f, true,
true);
}
}
}

View File

@@ -22,7 +22,7 @@ public class ContentOre extends TinkerPage {
public static final transient float ITEM_SCALE = 1.5F;
public String title = "Ore";
public String title;
public int r, g, b;
public ItemStackData input;
@@ -31,8 +31,6 @@ public class ContentOre extends TinkerPage {
@Override
public void build(BookData book, ArrayList<BookElement> list, boolean rightSide) {
TextData tdTitle = new TextData(title);
tdTitle.underlined = true;
@@ -47,7 +45,7 @@ public class ContentOre extends TinkerPage {
}
int h = GuiBook.PAGE_WIDTH / 3 - 10;
if (informations.length > 0) {
if (informations != null && informations.length > 0) {
TextData head = new TextData(parent.translate("modifier.informations"));
head.underlined = true;
list.add(new ElementText(10, 20 + h, GuiBook.PAGE_WIDTH / 2 - 5, GuiBook.PAGE_HEIGHT - h - 20, head));

View File

@@ -6,7 +6,8 @@ import net.minecraft.block.material.Material;
public class BasicBlock extends Block {
private String oreDictPrefix;
public BasicBlock(String name, Material material, float hardness, float resistance, int harvest, float lightLevel, String oreDictPrefix) {
public BasicBlock(String name, Material material, float hardness, float resistance, int harvest, float
lightLevel, String oreDictPrefix) {
super(material);
setUnlocalizedName(name);
setRegistryName(name);
@@ -25,7 +26,8 @@ public class BasicBlock extends Block {
this(name, material, hardness, resistance, harvest, lightLevel, null);
}
public BasicBlock(String name, Material material, float hardness, float resistance, int harvest, String oreDictPrefix) {
public BasicBlock(String name, Material material, float hardness, float resistance, int harvest, String
oreDictPrefix) {
this(name, material, hardness, resistance, harvest, 0.0F, oreDictPrefix);
}

View File

@@ -13,7 +13,8 @@ public class BasicTinkerFluid extends FluidMolten {
public BasicTinkerFluid(String fluidName, int color, int temp, int lumen, int visk) {
// Constructs the FluidMolten with textures and color
super(fluidName, color, new ResourceLocation("tconstruct:blocks/fluids/molten_metal"), new ResourceLocation("tconstruct:blocks/fluids/molten_metal_flow"));
super(fluidName, color, new ResourceLocation("tconstruct:blocks/fluids/molten_metal"), new ResourceLocation
("tconstruct:blocks/fluids/molten_metal_flow"));
//Settings
this.setUnlocalizedName(Util.prefix(fluidName));
this.setTemperature(temp);

View File

@@ -20,7 +20,8 @@ public class BlockOre extends Block {
private int itemAmount;
private int xpAmount;
public BlockOre(String name, Material material, float hardness, float resistance, int harvest, float lightLevel, Item item, int amount, int xp) {
public BlockOre(String name, Material material, float hardness, float resistance, int harvest, float lightLevel,
Item item, int amount, int xp) {
super(material);
setUnlocalizedName(name);
setRegistryName(name);
@@ -55,7 +56,8 @@ public class BlockOre extends Block {
public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn) {
if (!worldIn.isRemote) {
if (random.nextFloat() < 0.5) {
worldIn.newExplosion(null, pos.getX(), pos.getY(), pos.getZ(), random.nextFloat() * 4f + 1.5f, true, true);
worldIn.newExplosion(null, pos.getX(), pos.getY(), pos.getZ(), random.nextFloat() * 4f + 1.5f, true,
true);
}
}
}

View File

@@ -39,7 +39,6 @@ public class ClientProxy extends CommonProxy {
private static void registerItemModel(Item item) {
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
}
@Override
@@ -86,15 +85,18 @@ public class ClientProxy extends CommonProxy {
else if (material.equals(vibranium)) metalRender(material, vibraniumFluid.getColor(), 0.6f, .8f, 1f);
else if (material.equals(valyrium)) metalRender(material, valyriumFluid.getColor(), .8f, 1.5f, -0.1f);
else {
material.setRenderInfo(new MaterialRenderInfo.BlockTexture("taiga:blocks/block/" + material.getIdentifier()));
material.setRenderInfo(new MaterialRenderInfo.BlockTexture(new ResourceLocation("taiga:blocks/block/" +
material.getIdentifier())));
}
}
private void metalRender(final Material material, final int f, final float shine, final float brightness, final float hueshift) {
private void metalRender(final Material material, final int f, final float shine, final float brightness, final
float hueshift) {
material.setRenderInfo(new MaterialRenderInfo.AbstractMaterialRenderInfo() {
@Override
public TextureAtlasSprite getTexture(TextureAtlasSprite baseTexture, String location) {
return new MetalTextureTexture("taiga:materials/" + material.getIdentifier(), baseTexture, location, f, shine, brightness, hueshift);
public TextureAtlasSprite getTexture(ResourceLocation baseTexture, String location) {
return new MetalTextureTexture(new ResourceLocation("taiga:materials/" + material.getIdentifier()),
baseTexture, location, f, shine, brightness, hueshift);
}
});
}
@@ -127,13 +129,11 @@ public class ClientProxy extends CommonProxy {
@Override
public void registerBookPages() {
TinkerBook.INSTANCE.addRepository(new FileRepository("taiga:book"));
registerPageType("taigaore", ContentOre.class);
}
public static class FluidStateMapper extends StateMapperBase implements ItemMeshDefinition {
public final Fluid fluid;
public final ModelResourceLocation location;
@@ -141,7 +141,8 @@ public class ClientProxy extends CommonProxy {
this.fluid = fluid;
// have each block hold its fluid per nbt? hm
this.location = new ModelResourceLocation(new ResourceLocation(TAIGA.MODID, "fluid_block"), fluid.getName());
this.location = new ModelResourceLocation(new ResourceLocation(TAIGA.MODID, "fluid_block"), fluid.getName
());
}
@Nonnull

View File

@@ -2,10 +2,12 @@ package com.sosnitzka.taiga.recipes;
import com.sosnitzka.taiga.Blocks;
import com.sosnitzka.taiga.Items;
import com.sosnitzka.taiga.TAIGA;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.oredict.ShapedOreRecipe;
public class CraftingRegistry {
@@ -51,10 +53,15 @@ public class CraftingRegistry {
}
public static void convertion(Item block, Item ingot, Item nugget) {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(block), "###", "###", "###", '#', new ItemStack(ingot)));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ingot), "###", "###", "###", '#', new ItemStack(nugget)));
GameRegistry.addShapelessRecipe(new ItemStack(ingot, 9), new ItemStack(block));
GameRegistry.addShapelessRecipe(new ItemStack(nugget, 9), new ItemStack(ingot));
//GameData.register_impl(new ShapedOreRecipe());
//GameData.register_impl(new ShapedOreRecipe(new ResourceLocation(""), new ItemStack(ingot), "###", "###",
// "###", '#', new ItemStack(nugget)));
//GameRegistry.addShapedRecipe(new ResourceLocation(TAIGA.MODID + ":recipe_ingot_from_block_" + block.getUnlocalizedName()), new ResourceLocation(""), new ItemStack(block), "###", "###", "###", '#', new ItemStack(ingot));
GameRegistry.addShapelessRecipe(new ResourceLocation(TAIGA.MODID + ":recipe_ingot_from_block_" + block
.getUnlocalizedName()), new ResourceLocation(""), new ItemStack(ingot, 9), Ingredient.fromStacks(new
ItemStack(block)));
GameRegistry.addShapelessRecipe(new ResourceLocation(TAIGA.MODID + ":recipe_ingot_from_nugget_" + block
.getUnlocalizedName()), new ResourceLocation(""), new ItemStack(nugget, 9), Ingredient.fromStacks(new
ItemStack(ingot)));
}
}

View File

@@ -29,7 +29,8 @@ public class TraitAnalysing extends AbstractTrait {
@SubscribeEvent
public void onXpDrop(LivingExperienceDropEvent event) {
EntityPlayer player = event.getAttackingPlayer();
if (player != null && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), this.identifier) && event.getDroppedExperience() > 0) {
if (player != null && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), this.identifier)
&& event.getDroppedExperience() > 0) {
event.setDroppedExperience(this.getUpdateXP(event.getDroppedExperience()));
}
}
@@ -37,7 +38,8 @@ public class TraitAnalysing extends AbstractTrait {
@SubscribeEvent
public void onBlockBreak(BlockEvent.BreakEvent event) {
EntityPlayer player = event.getPlayer();
if (!event.getWorld().isRemote && player != null && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), this.identifier) && event.getExpToDrop() > 0) {
if (!event.getWorld().isRemote && player != null && TinkerUtil.hasTrait(TagUtil.getTagSafe(player
.getHeldItemMainhand()), this.identifier) && event.getExpToDrop() > 0) {
event.setExpToDrop(this.getUpdateXP(event.getExpToDrop()));
}
}
@@ -47,14 +49,16 @@ public class TraitAnalysing extends AbstractTrait {
World w = event.getEntity().getEntityWorld();
if (random.nextFloat() < .1f && event.getSource().getTrueSource() instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) event.getSource().getTrueSource();
if (!w.isRemote && event.getEntity() instanceof EntityMob && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), identifier)) {
if (!w.isRemote && event.getEntity() instanceof EntityMob && TinkerUtil.hasTrait(TagUtil.getTagSafe
(player.getHeldItemMainhand()), identifier)) {
event.getDrops().clear();
}
}
}
private int getUpdateXP(int xp) {
float exp = random.nextFloat() * random.nextFloat() * random.nextFloat() * (xp + random.nextInt(xp) * (1 + random.nextFloat()));
float exp = random.nextFloat() * random.nextFloat() * random.nextFloat() * (xp + random.nextInt(xp) * (1 +
random.nextFloat()));
return Math.round(exp);
}

View File

@@ -30,7 +30,8 @@ public class TraitArcane extends AbstractTrait {
}
@Override
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase player, boolean wasEffective) {
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase
player, boolean wasEffective) {
int time = (int) world.getWorldTime();
if (random.nextFloat() <= 0.05 && isNight(time)) {
ToolHelper.healTool(tool, random.nextInt(8) + 1, null);
@@ -38,7 +39,8 @@ public class TraitArcane extends AbstractTrait {
}
@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) {
int time = (int) player.getEntityWorld().getWorldTime();
if (random.nextFloat() <= 0.05 && isNight(time)) {
ToolHelper.healTool(tool, random.nextInt(8) + 1, null);
@@ -52,7 +54,8 @@ public class TraitArcane extends AbstractTrait {
if (!w.isRemote && e.getSource().getTrueSource() != null) {
if (e.getSource().getTrueSource() instanceof EntityPlayer && e.getEntity() instanceof EntityCreature) {
ItemStack tool = ((EntityPlayer) e.getSource().getTrueSource()).getHeldItemMainhand();
if (isNight((int) w.getWorldTime()) && random.nextFloat() < 0.1 && TinkerUtil.hasTrait(TagUtil.getTagSafe(tool), identifier)) {
if (isNight((int) w.getWorldTime()) && random.nextFloat() < 0.1 && TinkerUtil.hasTrait(TagUtil
.getTagSafe(tool), identifier)) {
ToolHelper.healTool(tool, random.nextInt(16), null);
}
}

View File

@@ -39,7 +39,8 @@ public class TraitBerserk extends TraitProgressiveStats {
}
@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) {
NBTTagCompound tag = TagUtil.getExtraTag(tool);
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
if (!data.active) return newDamage;

View File

@@ -23,7 +23,8 @@ public class TraitBlind extends AbstractTrait {
}
@Override
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase player, boolean wasEffective) {
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase
player, boolean wasEffective) {
int time = (int) world.getWorldTime();
if (random.nextFloat() <= 0.01 || (random.nextFloat() <= 0.03 && isNight(time))) {
if (random.nextBoolean())
@@ -34,7 +35,8 @@ public class TraitBlind extends AbstractTrait {
}
@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) {
int time = (int) player.getEntityWorld().getWorldTime();
if (random.nextFloat() <= 0.01 || (random.nextFloat() <= 0.03 && isNight(time))) {
if (random.nextBoolean())

View File

@@ -26,7 +26,8 @@ public class TraitBright extends AbstractTrait {
}
@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();
if (!isNight(time)) {
newDamage = damage * (1 + random.nextFloat() / 2f);
@@ -36,7 +37,8 @@ public class TraitBright extends AbstractTrait {
@Override
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase player, boolean wasEffective) {
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase
player, boolean wasEffective) {
if (random.nextFloat() >= chance) {
player.addPotionEffect(new PotionEffect(GLOWING, 200));
}

View File

@@ -21,7 +21,8 @@ public class TraitCarousel extends AbstractTrait {
}
@Override
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase player, boolean wasEffective) {
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase
player, boolean wasEffective) {
}

View File

@@ -20,14 +20,16 @@ public class TraitCascade extends AbstractTrait {
}
@Override
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase player, boolean wasEffective) {
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase
player, boolean wasEffective) {
float f = random.nextFloat();
if (!world.isRemote && tool.canHarvestBlock(state) && f <= 0.1) {
double x, y, z, sx, sy, sz;
sx = x = pos.getX();
sy = y = pos.getY();
sz = z = pos.getZ();
int i = random.nextInt((int) Math.min(300f * (float) ToolHelper.getCurrentDurability(tool) / ToolHelper.getMaxDurability(tool), 50f));
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 d = random.nextBoolean() ? 1 : -1;

View File

@@ -102,7 +102,8 @@ public class TraitCatcher extends AbstractTrait {
data.mobName = "";
data.write(tag);
TagUtil.setExtraTag(tool, tag);
ToolHelper.damageTool(tool, random.nextInt((int) (ToolHelper.getCurrentDurability(tool) * costMulti)), event.getEntityPlayer());
ToolHelper.damageTool(tool, random.nextInt((int) (ToolHelper.getCurrentDurability(tool) *
costMulti)), event.getEntityPlayer());
}
}
}
@@ -116,7 +117,8 @@ public class TraitCatcher extends AbstractTrait {
NBTTagCompound tag = TagUtil.getExtraTag(tool);
Data data = Data.read(tag);
if (!data.mobClass.isEmpty())
e.getToolTip().add(TextFormatting.DARK_PURPLE + "Captured: " + TextFormatting.LIGHT_PURPLE + data.mobName);
e.getToolTip().add(TextFormatting.DARK_PURPLE + "Captured: " + TextFormatting.LIGHT_PURPLE + data
.mobName);
}
}

View File

@@ -31,8 +31,10 @@ public class TraitCongenial extends AbstractTrait {
@SubscribeEvent
public void onEntityKill(LivingDeathEvent e) {
if (e.getSource().getTrueSource() instanceof EntityPlayer && !e.getSource().getTrueSource().world.isRemote && e.getEntity() instanceof EntityCreature) {
if (TinkerUtil.hasTrait(TagUtil.getTagSafe(((EntityPlayer) e.getSource().getTrueSource()).getHeldItemMainhand()), identifier)) {
if (e.getSource().getTrueSource() instanceof EntityPlayer && !e.getSource().getTrueSource().world.isRemote &&
e.getEntity() instanceof EntityCreature) {
if (TinkerUtil.hasTrait(TagUtil.getTagSafe(((EntityPlayer) e.getSource().getTrueSource())
.getHeldItemMainhand()), identifier)) {
ItemStack tool = ((EntityPlayer) e.getSource().getTrueSource()).getHeldItemMainhand();
String name = e.getEntity().getName();
NBTTagCompound tag = TagUtil.getExtraTag(tool);
@@ -48,7 +50,8 @@ public class TraitCongenial extends AbstractTrait {
}
@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) {
World w = player.getEntityWorld();
if (!w.isRemote) {
NBTTagCompound tag = TagUtil.getExtraTag(tool);

View File

@@ -36,7 +36,8 @@ public class TraitCursed extends AbstractTrait {
if (random.nextInt((chance + data.curse) / (data.curse + 1)) == 1) {
if (isSelected) data.curse += 10;
else data.curse++;
entity.attackEntityFrom(new DamageSource("Curse"), random.nextFloat() * ((EntityPlayer) entity).getHealth() / 2);
entity.attackEntityFrom(new DamageSource("Curse"), random.nextFloat() * ((EntityPlayer) entity).getHealth
() / 2);
}
data.write(tag);

View File

@@ -41,7 +41,9 @@ public class TraitCurvature extends AbstractTrait {
@Override
public void blockHarvestDrops(ItemStack tool, BlockEvent.HarvestDropsEvent event) {
if (!event.getWorld().isRemote && random.nextFloat() < 0.05) {
List<IBlockState> blockstates = Lists.newArrayList(Blocks.STONE.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), Blocks.END_STONE.getDefaultState(), Blocks.AIR.getDefaultState(), Blocks.DIRT.getDefaultState());
List<IBlockState> blockstates = Lists.newArrayList(Blocks.STONE.getDefaultState(), Blocks.NETHERRACK
.getDefaultState(), Blocks.END_STONE.getDefaultState(), Blocks.AIR.getDefaultState(), Blocks.DIRT
.getDefaultState());
IBlockState mainstate = event.getState();
if (blockstates.contains(mainstate)) return;
for (int i = 0; i < chance; i++) {
@@ -54,7 +56,8 @@ public class TraitCurvature extends AbstractTrait {
event.getDrops().clear();
event.getWorld().setBlockState(cPos, mainstate);
event.getHarvester().playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F);
event.getHarvester().sendStatusMessage(new TextComponentString("Teleported to: " + x + " " + y + " " + z), false);
event.getHarvester().sendStatusMessage(new TextComponentString("Teleported to: " + x + " " + y +
" " + z), false);
return;
}
}
@@ -62,7 +65,8 @@ public class TraitCurvature extends AbstractTrait {
}
@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) {
if (random.nextFloat() <= 0.15) {
target.playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F);
changePos(player, target);
@@ -74,9 +78,11 @@ public class TraitCurvature extends AbstractTrait {
World w = event.getEntity().getEntityWorld();
if (!w.isRemote && event.getSource().getTrueSource() instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) event.getSource().getTrueSource();
if (event.getEntity() instanceof EntityMob && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), identifier)) {
if (event.getEntity() instanceof EntityMob && TinkerUtil.hasTrait(TagUtil.getTagSafe(player
.getHeldItemMainhand()), identifier)) {
ItemStack i = new ItemStack(Items.ENDER_PEARL, random.nextInt(2));
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));
}
}
}

View File

@@ -19,7 +19,8 @@ public class TraitDark extends AbstractTrait {
}
@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();
if (isNight(time)) {
newDamage = damage * (1 + random.nextFloat() / 2f);

View File

@@ -28,7 +28,8 @@ public class TraitDevelopement extends AbstractTrait {
public void onBreak(BlockEvent.BreakEvent e) {
IBlockState state = e.getState();
ItemStack tool = e.getPlayer().getHeldItemMainhand();
if (state.getBlock().equals(net.minecraft.init.Blocks.STONE) && TinkerUtil.hasTrait(TagUtil.getTagSafe(tool), identifier))
if (state.getBlock().equals(net.minecraft.init.Blocks.STONE) && TinkerUtil.hasTrait(TagUtil.getTagSafe(tool),
identifier))
System.out.println("State.Variant: " + state.getValue(BlockStone.VARIANT));
}

View File

@@ -28,7 +28,8 @@ public class TraitDiffuse extends AbstractTrait {
@SubscribeEvent
public void onBlockBreak(BlockEvent.BreakEvent event) {
EntityPlayer player = event.getPlayer();
if (!player.getEntityWorld().isRemote && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), this.identifier)) {
if (!player.getEntityWorld().isRemote && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand())
, this.identifier)) {
event.setExpToDrop((int) this.getUpdateXP(event.getExpToDrop()));
}
}
@@ -38,7 +39,8 @@ public class TraitDiffuse extends AbstractTrait {
World w = event.getEntity().getEntityWorld();
if (!w.isRemote && event.getSource().getTrueSource() instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) event.getSource().getTrueSource();
if (event.getEntity() instanceof EntityCreature && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), identifier)) {
if (event.getEntity() instanceof EntityCreature && TinkerUtil.hasTrait(TagUtil.getTagSafe(player
.getHeldItemMainhand()), identifier)) {
event.getDrops().clear();
}
}

View File

@@ -29,7 +29,8 @@ public class TraitDissolving extends AbstractTrait {
if (!event.getEntity().getEntityWorld().isRemote) {
EntityPlayer player = event.getAttackingPlayer();
float r = random.nextFloat();
if (player != null && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), this.identifier)) {
if (player != null && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), this
.identifier)) {
if (r <= 0.80) {
event.setDroppedExperience(0);
} else {

View File

@@ -24,7 +24,8 @@ public class TraitFracture extends AbstractTrait {
}
@Override
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase player, boolean wasEffective) {
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase
player, boolean wasEffective) {
float f = random.nextFloat();
float b = 0.99F * calcBonus(tool);
if (!world.isRemote && tool.canHarvestBlock(state) && f <= b) {
@@ -34,32 +35,38 @@ public class TraitFracture extends AbstractTrait {
switch (mop.sideHit) {
case UP:
BlockPos next1 = new BlockPos(pos.getX(), pos.getY() - i, pos.getZ());
if (tool.canHarvestBlock(world.getBlockState(next1)) && !world.getBlockState(next1).equals(Blocks.BEDROCK.getDefaultState()))
if (tool.canHarvestBlock(world.getBlockState(next1)) && !world.getBlockState(next1)
.equals(Blocks.BEDROCK.getDefaultState()))
world.destroyBlock(next1, true);
break;
case DOWN:
BlockPos next2 = new BlockPos(pos.getX(), pos.getY() + i, pos.getZ());
if (tool.canHarvestBlock(world.getBlockState(next2)) && !world.getBlockState(next2).equals(Blocks.BEDROCK.getDefaultState()))
if (tool.canHarvestBlock(world.getBlockState(next2)) && !world.getBlockState(next2)
.equals(Blocks.BEDROCK.getDefaultState()))
world.destroyBlock(next2, true);
break;
case WEST:
BlockPos next3 = new BlockPos(pos.getX() + i, pos.getY(), pos.getZ());
if (tool.canHarvestBlock(world.getBlockState(next3)) && !world.getBlockState(next3).equals(Blocks.BEDROCK.getDefaultState()))
if (tool.canHarvestBlock(world.getBlockState(next3)) && !world.getBlockState(next3)
.equals(Blocks.BEDROCK.getDefaultState()))
world.destroyBlock(next3, true);
break;
case EAST:
BlockPos next4 = new BlockPos(pos.getX() - i, pos.getY(), pos.getZ());
if (tool.canHarvestBlock(world.getBlockState(next4)) && !world.getBlockState(next4).equals(Blocks.BEDROCK.getDefaultState()))
if (tool.canHarvestBlock(world.getBlockState(next4)) && !world.getBlockState(next4)
.equals(Blocks.BEDROCK.getDefaultState()))
world.destroyBlock(next4, true);
break;
case SOUTH:
BlockPos next5 = new BlockPos(pos.getX(), pos.getY(), pos.getZ() - i);
if (tool.canHarvestBlock(world.getBlockState(next5)) && !world.getBlockState(next5).equals(Blocks.BEDROCK.getDefaultState()))
if (tool.canHarvestBlock(world.getBlockState(next5)) && !world.getBlockState(next5)
.equals(Blocks.BEDROCK.getDefaultState()))
world.destroyBlock(next5, true);
break;
case NORTH:
BlockPos next6 = new BlockPos(pos.getX(), pos.getY() - i, pos.getZ() + i);
if (tool.canHarvestBlock(world.getBlockState(next6)) && !world.getBlockState(next6).equals(Blocks.BEDROCK.getDefaultState()))
if (tool.canHarvestBlock(world.getBlockState(next6)) && !world.getBlockState(next6)
.equals(Blocks.BEDROCK.getDefaultState()))
world.destroyBlock(next6, true);
break;
}

View File

@@ -22,7 +22,8 @@ public class TraitFragile extends AbstractTrait {
}
@Override
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase player, boolean wasEffective) {
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase
player, boolean wasEffective) {
if (random.nextBoolean()) {
float f = random.nextFloat();
float b = 0.99F * calcBonus(tool);

View File

@@ -34,7 +34,8 @@ public class TraitGarishly extends AbstractTrait {
World w = event.getEntity().getEntityWorld();
if (!w.isRemote && event.getSource().getTrueSource() instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) event.getSource().getTrueSource();
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(2);
ItemStack i = null;
@@ -50,7 +51,8 @@ public class TraitGarishly extends AbstractTrait {
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));
}
}
}
@@ -60,7 +62,8 @@ public class TraitGarishly extends AbstractTrait {
float r = random.nextFloat();
if (random.nextBoolean()) event.getDrops().clear();
else if (r < 0.25 && event.getWorld().getBlockState(event.getPos()).getMaterial() == Material.ROCK) {
@SuppressWarnings("ConstantConditions") 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);
ToolHelper.damageTool(tool, random.nextInt(6) + 1, event.getHarvester());
}

View File

@@ -37,14 +37,16 @@ public class TraitGlimmer extends AbstractTrait {
}
@Override
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase player, boolean wasEffective) {
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase
player, boolean wasEffective) {
if (random.nextFloat() <= 0.05) {
player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, random.nextInt(600) + 300));
}
}
@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) {
if (random.nextFloat() <= 0.05) {
player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, random.nextInt(600) + 300));
}

View File

@@ -17,7 +17,8 @@ public class TraitHeroic extends AbstractTrait {
}
@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 durability = ToolHelper.getCurrentDurability(tool);
int durabilitymax = ToolHelper.getMaxDurability(tool);
int safeDenominator = durabilitymax - durability - 1;
@@ -30,7 +31,8 @@ public class TraitHeroic extends AbstractTrait {
} else {
calc = newDamage + (newDamage / 2) / ((durability * durabilitymax / safeDenominator) + 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);
} else return super.damage(tool, player, target, damage, newDamage * 0.9f, isCritical);
}

View File

@@ -30,7 +30,8 @@ public class TraitHollow extends AbstractTrait {
@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) {
int time = (int) player.getEntityWorld().getWorldTime();
if (random.nextFloat() <= 0.01 || (random.nextFloat() <= 0.03 && isNight(time))) {
((EntityLiving) target).setNoAI(true);
@@ -46,7 +47,8 @@ public class TraitHollow extends AbstractTrait {
World w = event.getEntity().getEntityWorld();
if (!w.isRemote && event.getSource().getTrueSource() instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) event.getSource().getTrueSource();
if (random.nextFloat() <= 0.9 && event.getEntity() instanceof EntityMob && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), identifier)) {
if (random.nextFloat() <= 0.9 && event.getEntity() instanceof EntityMob && TinkerUtil.hasTrait(TagUtil
.getTagSafe(player.getHeldItemMainhand()), identifier)) {
event.getDrops().clear();
}
}

View File

@@ -31,7 +31,8 @@ public class TraitInstable extends AbstractTrait {
}
@Override
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase player, boolean wasEffective) {
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase
player, boolean wasEffective) {
if (random.nextFloat() <= 0.03) {
if (!world.isRemote) {
if (random.nextBoolean()) {
@@ -43,7 +44,8 @@ public class TraitInstable extends AbstractTrait {
}
@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) {
BlockPos pos = target.getPosition();
if (random.nextFloat() <= 0.04) {
if (!player.getEntityWorld().isRemote) {
@@ -60,9 +62,11 @@ public class TraitInstable extends AbstractTrait {
World w = event.getEntity().getEntityWorld();
if (random.nextFloat() < 0.05 && !w.isRemote && event.getSource().getTrueSource() instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) event.getSource().getTrueSource();
if (event.getEntity() instanceof EntityMob && TinkerUtil.hasTrait(TagUtil.getTagSafe(player.getHeldItemMainhand()), identifier)) {
if (event.getEntity() instanceof EntityMob && TinkerUtil.hasTrait(TagUtil.getTagSafe(player
.getHeldItemMainhand()), identifier)) {
ItemStack i = new ItemStack(Items.GUNPOWDER, random.nextInt(2));
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));
}
}
}

View File

@@ -28,7 +28,8 @@ public class TraitMelting extends AbstractTrait {
public void blockbreak(BlockEvent.BreakEvent e) {
Block b = e.getWorld().getBlockState(e.getPos()).getBlock();
if (TinkerUtil.hasTrait(TagUtil.getTagSafe(e.getPlayer().getHeldItemMainhand()), identifier)) {
if (!e.getWorld().isRemote && random.nextFloat() <= 0.025 && (b == Blocks.STONE || b == Blocks.COBBLESTONE || b == Blocks.NETHERRACK || b == Blocks.OBSIDIAN)) {
if (!e.getWorld().isRemote && random.nextFloat() <= 0.025 && (b == Blocks.STONE || b == Blocks
.COBBLESTONE || b == Blocks.NETHERRACK || b == Blocks.OBSIDIAN)) {
e.setCanceled(true);
e.getWorld().setBlockState(e.getPos(), Blocks.LAVA.getDefaultState());
}

View File

@@ -29,7 +29,9 @@ public class TraitMutate extends AbstractTrait {
public void beforeBlockBreak(ItemStack tool, BlockEvent.BreakEvent event) {
if (!event.getWorld().isRemote && random.nextFloat() > 0.95) {
IBlockState state = event.getState();
List<Block> blist = newArrayList(Blocks.STONE, Blocks.COBBLESTONE, Blocks.DIRT, Blocks.SAND, Blocks.GRASS, Blocks.CLAY, Blocks.NETHERRACK, Blocks.ICE, Blocks.SNOW, Blocks.BONE_BLOCK, Blocks.LAVA, Blocks.WATER, Blocks.WHEAT);
List<Block> blist = newArrayList(Blocks.STONE, Blocks.COBBLESTONE, Blocks.DIRT, Blocks.SAND, Blocks
.GRASS, Blocks.CLAY, Blocks.NETHERRACK, Blocks.ICE, Blocks.SNOW, Blocks.BONE_BLOCK, Blocks.LAVA,
Blocks.WATER, Blocks.WHEAT);
if (blist.contains(state.getBlock())) {
Block newBlock = blist.get(random.nextInt(blist.size()));
IBlockState newState = newBlock.getDefaultState();

View File

@@ -37,7 +37,8 @@ public class TraitPorted extends AbstractTrait {
}
@Override
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase player, boolean wasEffective) {
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase
player, boolean wasEffective) {
if (random.nextFloat() <= 0.005) {
player.playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F);
teleport(player, world);
@@ -46,7 +47,8 @@ public class TraitPorted extends AbstractTrait {
@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) {
if (random.nextFloat() <= 0.005) {
target.playSound(SoundEvents.ENTITY_ENDERMEN_TELEPORT, 1.0F, 1.0F);
teleport(player, player.getEntityWorld());
@@ -66,7 +68,8 @@ public class TraitPorted extends AbstractTrait {
return;
}
e.setPosition(tPos.getX(), tPos.getY(), tPos.getZ());
ToolHelper.damageTool(e.getHeldItemMainhand(), ToolHelper.getCurrentDurability(e.getHeldItemMainhand()) / 2 + 1, e);
ToolHelper.damageTool(e.getHeldItemMainhand(), ToolHelper.getCurrentDurability(e.getHeldItemMainhand()) / 2 +
1, e);
}
@Override

View File

@@ -19,9 +19,11 @@ public class TraitResonance extends AbstractTrait {
}
@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) {
if (random.nextFloat() <= chance) {
target.knockBack(target, random.nextFloat() * random.nextFloat() * 10, player.posX - target.posX, player.posZ - target.posZ);
target.knockBack(target, random.nextFloat() * random.nextFloat() * 10, player.posX - target.posX, player
.posZ - target.posZ);
}
}

View File

@@ -37,7 +37,8 @@ public class TraitReviving extends AbstractTrait {
World w = e.getEntity().getEntityWorld();
if (!w.isRemote && e.getSource().getTrueSource() != null) {
if (e.getSource().getTrueSource() instanceof EntityPlayer && e.getEntity() instanceof EntityCreature) {
if (random.nextFloat() <= chance && TinkerUtil.hasTrait(TagUtil.getTagSafe(((EntityPlayer) e.getSource().getTrueSource()).getHeldItemMainhand()), identifier)) {
if (random.nextFloat() <= chance && TinkerUtil.hasTrait(TagUtil.getTagSafe(((EntityPlayer) e
.getSource().getTrueSource()).getHeldItemMainhand()), identifier)) {
int id = e.getEntity().getEntityId();
Entity ent = EntityList.createEntityByID(id, w);
if (ent != null) {

View File

@@ -30,9 +30,13 @@ public class TraitSlaughtering extends AbstractTrait {
World w = event.getEntity().getEntityWorld();
if (event.getSource().getTrueSource() instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) event.getSource().getTrueSource();
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)) {
ItemStack i = event.getDrops().get(random.nextInt(event.getDrops().size())).getItem();
event.getDrops().add(new EntityItem(w, event.getEntity().posX, event.getEntity().posY, event.getEntity().posZ, new ItemStack(i.getItem(), random.nextInt(4) + 1, i.getMetadata(), i.getTagCompound())));
event.getDrops().add(new EntityItem(w, event.getEntity().posX, event.getEntity().posY, event
.getEntity().posZ, new ItemStack(i.getItem(), random.nextInt(4) + 1, i.getMetadata(), i
.getTagCompound())));
}
}
}

View File

@@ -51,7 +51,8 @@ public class TraitSoulEater extends AbstractTrait {
}
@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) {
NBTTagCompound tag = TagUtil.getExtraTag(tool);
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
float bonus = data.bonus;

View File

@@ -37,11 +37,13 @@ public class TraitSuperHeavy extends TraitProgressiveStats {
NBTTagCompound tag = TagUtil.getExtraTag(tool);
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
if (data.brokenblocks == 0) return;
event.setNewSpeed(Math.max(event.getNewSpeed() - data.brokenblocks * event.getOriginalSpeed() / blockcount, 0.35f));
event.setNewSpeed(Math.max(event.getNewSpeed() - data.brokenblocks * event.getOriginalSpeed() / blockcount,
0.35f));
}
@Override
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase player, boolean wasEffective) {
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase
player, boolean wasEffective) {
NBTTagCompound tag = TagUtil.getExtraTag(tool);
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
data.brokenblocks += 1;

View File

@@ -52,7 +52,8 @@ public class TraitTantrum extends AbstractTrait {
if (data.amount >= max_charges) {
TagUtil.setEnchantEffect(tool, true);
if (event.getHarvester() instanceof EntityPlayerMP) {
Sounds.PlaySoundForPlayer(event.getHarvester(), Sounds.shocking_discharge, 1f, 0.8f + .2f * random.nextFloat());
Sounds.PlaySoundForPlayer(event.getHarvester(), Sounds.shocking_discharge, 1f, 0.8f + .2f *
random.nextFloat());
}
}
data.write(tag);
@@ -71,7 +72,8 @@ public class TraitTantrum extends AbstractTrait {
Data data = Data.read(tag);
if (data.amount > 1f) {
double d = Math.min(Utils.round2(random.nextDouble() * data.amount), max_power);
w.newExplosion(event.getEntityPlayer(), pos.getX(), pos.getY(), pos.getZ(), (float) Math.pow((double) 1.2f, d), false, true);
w.newExplosion(event.getEntityPlayer(), pos.getX(), pos.getY(), pos.getZ(), (float) Math.pow((double)
1.2f, d), false, true);
data.amount -= d;
data.write(tag);
TagUtil.setExtraTag(tool, tag);

View File

@@ -29,8 +29,10 @@ public class TraitTraditional extends AbstractTrait {
@SubscribeEvent
public void onEntityKill(LivingDeathEvent e) {
World w = e.getEntity().getEntityWorld();
if (!w.isRemote && e.getSource().getTrueSource() instanceof EntityPlayer && e.getEntity() instanceof EntityCreature) {
if (TinkerUtil.hasTrait(TagUtil.getTagSafe(((EntityPlayer) e.getSource().getTrueSource()).getHeldItemMainhand()), identifier)) {
if (!w.isRemote && e.getSource().getTrueSource() instanceof EntityPlayer && e.getEntity() instanceof
EntityCreature) {
if (TinkerUtil.hasTrait(TagUtil.getTagSafe(((EntityPlayer) e.getSource().getTrueSource())
.getHeldItemMainhand()), identifier)) {
String name = EntityList.getEntityString(e.getEntity());
}
}

View File

@@ -68,8 +68,11 @@ public class TraitWhirl extends AbstractTrait {
if (MathHelper.sqrt(x * x + y * y + z * z) > r) {
continue;
}
BlockPos nPos = new BlockPos(event.getPos().getX() + x, event.getPos().getY() + y, event.getPos().getZ() + z);
if (!(event.getWorld().getBlockState(nPos).equals(Blocks.WATER.getDefaultState()) || event.getWorld().getBlockState(nPos).equals(Blocks.FLOWING_WATER.getDefaultState())))
BlockPos nPos = new BlockPos(event.getPos().getX() + x, event.getPos().getY() + y, event
.getPos().getZ() + z);
if (!(event.getWorld().getBlockState(nPos).equals(Blocks.WATER.getDefaultState()) ||
event.getWorld().getBlockState(nPos).equals(Blocks.FLOWING_WATER.getDefaultState
())))
continue;
event.getWorld().destroyBlock(nPos, false);
}
@@ -93,7 +96,8 @@ public class TraitWhirl extends AbstractTrait {
NBTTagCompound tag = TagUtil.getExtraTag(tool);
Utils.GeneralNBTData data = Utils.GeneralNBTData.read(tag);
if (data.radius > 0) {
e.getToolTip().add(TextFormatting.BLUE + "Actual Radius: " + TextFormatting.WHITE + Math.round(data.radius * 100) / 100);
e.getToolTip().add(TextFormatting.BLUE + "Actual Radius: " + TextFormatting.WHITE + Math.round(data
.radius * 100) / 100);
}
}
}

View File

@@ -25,15 +25,22 @@ import static com.sosnitzka.taiga.util.Utils.nextInt;
public class Generator {
public static void generateOre(IBlockState newState, IBlockState oldState, Random random, int chunkX, int chunkZ, World world, int count, int minY, int maxY, int minSize, int maxSize) {
generateOre(newState, oldState, null, null, random, chunkX, chunkZ, world, count, 100, minY, maxY, minSize, maxSize, null);
public static void generateOre(IBlockState newState, IBlockState oldState, Random random, int chunkX, int chunkZ,
World world, int count, int minY, int maxY, int minSize, int maxSize) {
generateOre(newState, oldState, null, null, random, chunkX, chunkZ, world, count, 100, minY, maxY, minSize,
maxSize, null);
}
public static void generateOre(IBlockState newState, IBlockState oldState, Random random, int chunkX, int chunkZ, World world, int count, int chance, int minY, int maxY, int minSize, int maxSize, List<Biome> biome) {
generateOre(newState, oldState, null, null, random, chunkX, chunkZ, world, count, chance, minY, maxY, minSize, maxSize, biome);
public static void generateOre(IBlockState newState, IBlockState oldState, Random random, int chunkX, int chunkZ,
World world, int count, int chance, int minY, int maxY, int minSize, int maxSize,
List<Biome> biome) {
generateOre(newState, oldState, null, null, random, chunkX, chunkZ, world, count, chance, minY, maxY,
minSize, maxSize, biome);
}
public static void generateOre(IBlockState newState, IBlockState oldState, IProperty property, Comparable comparable, Random random, int chunkX, int chunkZ, World world, int count, int chance, int minY, int maxY, int minSize, int maxSize, List<Biome> biome) {
public static void generateOre(IBlockState newState, IBlockState oldState, IProperty property, Comparable
comparable, Random random, int chunkX, int chunkZ, World world, int count, int chance, int minY, int
maxY, int minSize, int maxSize, List<Biome> biome) {
int size = minSize + random.nextInt(maxSize - minSize);
int height = maxY - minY;
for (int i = 0; i < count; i++) {
@@ -43,28 +50,33 @@ public class Generator {
int posZ = chunkZ + random.nextInt(16);
BlockPos cPos = new BlockPos(posX, posY, posZ);
if (biome == null || biome.contains(world.getBiome(cPos))) {
new WorldGenMinable(newState, size, StateMatcher.forState(oldState, property, comparable)).generate(world, random, new BlockPos(posX, posY, posZ));
new WorldGenMinable(newState, size, StateMatcher.forState(oldState, property, comparable))
.generate(world, random, new BlockPos(posX, posY, posZ));
}
}
}
}
public static void generateOre(List<IBlockState> replaceBlockList, IBlockState replacementBlock, Random random, int chunkX, int chunkZ, World world, int count, int minY, int maxY, int chance) {
public static void generateOre(List<IBlockState> replaceBlockList, IBlockState replacementBlock, Random random,
int chunkX, int chunkZ, World world, int count, int minY, int maxY, int chance) {
if (random.nextFloat() < (float) (0.01 * chance))
generateOreDescending(replaceBlockList, replacementBlock, random, chunkX, chunkZ, world, count, minY, maxY);
}
public static void generateOreDescending(List<IBlockState> replaceBlockList, IBlockState replacementBlock, Random random, int chunkX, int chunkZ, World world, int count, int minY, int maxY) {
public static void generateOreDescending(List<IBlockState> replaceBlockList, IBlockState replacementBlock, Random
random, int chunkX, int chunkZ, World world, int count, int minY, int maxY) {
for (int i = 0; i < count; i++) {
int posX = chunkX + random.nextInt(16);
int posZ = chunkZ + random.nextInt(16);
BlockPos cPos = new BlockPos(posX, maxY, posZ);
if (replaceBlockList.contains(world.getBlockState(cPos)) && replaceBlockList.contains(world.getBlockState(cPos.up()))) {
if (replaceBlockList.contains(world.getBlockState(cPos)) && replaceBlockList.contains(world.getBlockState
(cPos.up()))) {
continue;
}
if (replaceBlockList.contains(world.getBlockState(cPos)) && !replaceBlockList.contains(world.getBlockState(cPos.up())))
if (replaceBlockList.contains(world.getBlockState(cPos)) && !replaceBlockList.contains(world
.getBlockState(cPos.up())))
world.setBlockState(cPos, replacementBlock);
while (!replaceBlockList.contains(world.getBlockState(cPos.down())) && cPos.getY() > minY) {
cPos = cPos.down();
@@ -74,7 +86,8 @@ public class Generator {
}
}
public static void generateOreStoneVariant(IBlockState newState, BlockStone.EnumType type, Random random, int chunkX, int chunkZ, World world, int count) {
public static void generateOreStoneVariant(IBlockState newState, BlockStone.EnumType type, Random random, int
chunkX, int chunkZ, World world, int count) {
List<BlockStone.EnumType> list = newArrayList(type);
for (int i = 0; i < count; i += 2) {
int posX = chunkX + random.nextInt(16);
@@ -118,7 +131,8 @@ public class Generator {
}
}
public static void generateOreBottom(IBlockState oldState, IBlockState newState, Random random, int chunkX, int chunkZ, World world, int chance, int spread, int maxY) {
public static void generateOreBottom(IBlockState oldState, IBlockState newState, Random random, int chunkX, int
chunkZ, World world, int chance, int spread, int maxY) {
for (int i = 0; i < chance; i++) {
int posX = chunkX + random.nextInt(16);
int posY = 0;
@@ -135,7 +149,8 @@ public class Generator {
}
}
public static void generateCube(boolean fly, IBlockState centerBlock, IBlockState hullBlock, Random random, int chunkX, int chunkZ, World world, int count, int chance, int minY, int maxY, int maxS) {
public static void generateCube(boolean fly, IBlockState centerBlock, IBlockState hullBlock, Random random, int
chunkX, int chunkZ, World world, int count, int chance, int minY, int maxY, int maxS) {
for (int i = 0; i < count; i++) {
if (random.nextFloat() < 0.01 * chance) {
int outer = nextInt(random, 1, maxS);
@@ -145,7 +160,8 @@ public class Generator {
int posZ = chunkZ + random.nextInt(16);
BlockPos cPos = new BlockPos(posX, posY, posZ);
if (!fly) {
if (world.getBlockState(cPos).equals(Blocks.AIR.getDefaultState()) && world.getBlockState(cPos.down()).equals(Blocks.AIR.getDefaultState())) {
if (world.getBlockState(cPos).equals(Blocks.AIR.getDefaultState()) && world.getBlockState(cPos
.down()).equals(Blocks.AIR.getDefaultState())) {
// we are in mid air, go down
while (world.getBlockState(cPos.down()).equals(Blocks.AIR.getDefaultState())) {
cPos = cPos.down();
@@ -158,7 +174,8 @@ public class Generator {
for (int z = -inner; z <= inner; z++) {
if (!world.getBlockState(cPos).equals(Blocks.AIR.getDefaultState()))
continue;
world.setBlockState(new BlockPos(cPos.getX() + x, cPos.getY() + y, cPos.getZ() + z), centerBlock);
world.setBlockState(new BlockPos(cPos.getX() + x, cPos.getY() + y, cPos.getZ() + z),
centerBlock);
}
}
}
@@ -166,7 +183,8 @@ public class Generator {
for (int y = -outer; y <= outer; y++) {
for (int z = -outer; z <= outer; z++) {
BlockPos nPos = new BlockPos(cPos.getX() + x, cPos.getY() + y, cPos.getZ() + z);
if (world.getBlockState(nPos).equals(centerBlock) || !world.getBlockState(nPos).equals(Blocks.AIR.getDefaultState()))
if (world.getBlockState(nPos).equals(centerBlock) || !world.getBlockState(nPos).equals
(Blocks.AIR.getDefaultState()))
continue;
world.setBlockState(nPos, hullBlock);
}
@@ -178,9 +196,11 @@ public class Generator {
}
public static int generateMeteor(IBlockState centerBlock, IBlockState hullBlock, Random random, int chunkX, int chunkZ, World world, int count, int chance, int minY, int maxY) {
public static int generateMeteor(IBlockState centerBlock, IBlockState hullBlock, Random random, int chunkX, int
chunkZ, World world, int count, int chance, int minY, int maxY) {
Set<Item> validSurface = new HashSet<Item>();
List<String> oredictentries = Lists.newArrayList("dirt", "grass", "stone", "sand", "gravel", "cobblestone", "sandstone");
List<String> oredictentries = Lists.newArrayList("dirt", "grass", "stone", "sand", "gravel", "cobblestone",
"sandstone");
for (String e : oredictentries) {
for (ItemStack stack : OreDictionary.getOres(e)) {
validSurface.add(stack.getItem());
@@ -196,7 +216,8 @@ public class Generator {
int posY = nextInt(random, minY, maxY);
int posZ = chunkZ + random.nextInt(16);
BlockPos cPos = new BlockPos(posX, posY, posZ);
if (world.getBlockState(cPos).equals(Blocks.AIR.getDefaultState()) && world.getBlockState(cPos.down()).equals(Blocks.AIR.getDefaultState())) {
if (world.getBlockState(cPos).equals(Blocks.AIR.getDefaultState()) && world.getBlockState(cPos.down()
).equals(Blocks.AIR.getDefaultState())) {
// we are in mid air, go down
while (world.getBlockState(cPos.down()).equals(Blocks.AIR.getDefaultState())) {
cPos = cPos.down();
@@ -223,7 +244,8 @@ public class Generator {
if (MathHelper.sqrt(x * x + y * y + z * z) > t) {
continue;
}
world.setBlockState(new BlockPos(cPos.getX() + x, cPos.getY() + y, cPos.getZ() + z), centerBlock);
world.setBlockState(new BlockPos(cPos.getX() + x, cPos.getY() + y, cPos.getZ() + z),
centerBlock);
}
}
}

View File

@@ -3,14 +3,11 @@ package com.sosnitzka.taiga.util;
import com.sosnitzka.taiga.Items;
import com.sosnitzka.taiga.TAIGA;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.common.registry.GameRegistry;
import org.apache.commons.lang3.StringUtils;
import slimeknights.tconstruct.library.MaterialIntegration;
import slimeknights.tconstruct.library.TinkerRegistry;
@@ -30,16 +27,6 @@ public class Utils {
public static String PREFIX_DUST = "dust";
public static String PREFIX_CRYSTAL = "crystal";
/**
* Registers the block and its corresponding item (block as item in inventory)
*
* @param block the associated block
*/
public static void registerBlockWithItem(Block block) {
GameRegistry.register(block);
GameRegistry.register(new ItemBlock(block).setRegistryName(block.getRegistryName()));
}
/**
* Registers the fluid and its bucket item
*
@@ -65,8 +52,11 @@ public class Utils {
return (Math.round(d * 100.0) / 100.0);
}
public static void integrateMaterial(String oreSuffix, @Nullable Material material, Fluid fluid, int headDura, float headSpeed, float headAttack, float handleMod, int handleDura, int extra, int headLevel, float draw, float range, int bdamage) {
integrateMaterial(oreSuffix, material, fluid, headDura, headSpeed, headAttack, handleMod, handleDura, extra, headLevel, new BowMaterialStats(draw, range, bdamage), false, true);
public static void integrateMaterial(String oreSuffix, @Nullable Material material, Fluid fluid, int headDura,
float headSpeed, float headAttack, float handleMod, int handleDura, int
extra, int headLevel, float draw, float range, int bdamage) {
integrateMaterial(oreSuffix, material, fluid, headDura, headSpeed, headAttack, handleMod, handleDura, extra,
headLevel, new BowMaterialStats(draw, range, bdamage), false, true);
}
public static void integrateMaterial(String oreSuffix, @Nullable Material material, Fluid fluid, int headDura, float headSpeed, float headAttack, float handleMod, int handleDura, int extra, int headLevel, BowMaterialStats bowstats) {
@@ -78,7 +68,8 @@ public class Utils {
if (TinkerRegistry.getMaterial(material.identifier) != Material.UNKNOWN)
return;
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 ExtraMaterialStats(extra));
TinkerRegistry.addMaterialStats(material, bowstats);
@@ -103,12 +94,13 @@ public class Utils {
}
MaterialIntegration integration = new MaterialIntegration(material, fluid, oreSuffix);
integration.integrate();
integration.preInit();
TAIGA.integrateList.add(integration);
}
public static void integrateOre(String oreSuffix, Fluid fluid) {
integrateMaterial(oreSuffix, null, fluid, -1, -1, -1, -1, -1, -1, -1, new BowMaterialStats(0.1f, 0.1f, -1f), true, true);
integrateMaterial(oreSuffix, null, fluid, -1, -1, -1, -1, -1, -1, -1, new BowMaterialStats(0.1f, 0.1f, -1f),
true, true);
}
public static int nextInt(Random random, int min, int max) {

View File

@@ -5,8 +5,8 @@ import com.google.gson.Gson;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.WorldSavedData;
import net.minecraft.world.storage.MapStorage;
import net.minecraft.world.storage.WorldSavedData;
import java.util.ArrayList;
import java.util.List;
@@ -28,7 +28,8 @@ public class MeteorWorldSaveData extends WorldSavedData {
public static MeteorWorldSaveData getForWorld(World world) {
MapStorage storage = world.getPerWorldStorage();
MeteorWorldSaveData instance = (MeteorWorldSaveData) storage.getOrLoadData(MeteorWorldSaveData.class, DATA_NAME);
MeteorWorldSaveData instance = (MeteorWorldSaveData) storage.getOrLoadData(MeteorWorldSaveData.class,
DATA_NAME);
if (instance == null) {
instance = new MeteorWorldSaveData();

View File

@@ -7,8 +7,8 @@ import net.minecraft.block.BlockStone;
import net.minecraft.init.Biomes;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkGenerator;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.IChunkGenerator;
import net.minecraftforge.fml.common.IWorldGenerator;
import java.util.*;
@@ -32,10 +32,14 @@ public class WorldGen implements IWorldGenerator {
}
private void nether(Random random, int x, int z, World world) {
Generator.generateOre(tiberiumOre.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), random, x, z, world, TIBERIUM_VAL, 32, 128, 10, 35);
Generator.generateOre(prometheumOre.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), random, x, z, world, PROMETHEUM_VAL, 0, 32, 2, 4);
Generator.generateOre(valyriumOre.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), random, x, z, world, VALYRIUM_VAL, 0, 128, 2, 4);
Generator.generateOre(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA.getDefaultState()), osramOre.getDefaultState(), random, x, z, world, OSRAM_VAL, 0, 64, 15);
Generator.generateOre(tiberiumOre.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), random, x, z,
world, TIBERIUM_VAL, 32, 128, 10, 35);
Generator.generateOre(prometheumOre.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), random, x, z,
world, PROMETHEUM_VAL, 0, 32, 2, 4);
Generator.generateOre(valyriumOre.getDefaultState(), Blocks.NETHERRACK.getDefaultState(), random, x, z,
world, VALYRIUM_VAL, 0, 128, 2, 4);
Generator.generateOre(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA.getDefaultState()),
osramOre.getDefaultState(), random, x, z, world, OSRAM_VAL, 0, 64, 15);
}
private void other(Random random, int x, int z, World world) {
@@ -47,17 +51,29 @@ public class WorldGen implements IWorldGenerator {
meteorChunkStats.put(dim, 0);
meteorChunkStats.put(dim, meteorChunkStats.get(dim) + 1);
meteorGenStats.put(meteorGenStats.get(dim), meteorGenStats.get(dim) + Generator.generateMeteor(duraniteOre.getDefaultState(), blockMeteorite.getDefaultState(), random, x, z, world, DURANITE_VAL, 6, 16, 112));
Generator.generateOreDescending(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA.getDefaultState()), basaltBlock.getDefaultState(), random, x, z, world, BASALT_VAL, 0, 64);
Generator.generateOreDescending(newArrayList(Blocks.BEDROCK.getDefaultState()), eezoOre.getDefaultState(), random, x, z, world, EEZO_VAL, 0, 10);
Generator.generateOreStoneVariant(karmesineOre.getDefaultState(), BlockStone.EnumType.ANDESITE, random, x, z, world, KARMESINE_VAL);
Generator.generateOreStoneVariant(oviumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z, world, OVIUM_VAL);
Generator.generateOreStoneVariant(jauxumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z, world, JAUXUM_VAL);
Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, VIBRANIUM_VAL, 100, 0, 64, 2, 6, newArrayList(Biomes.DESERT_HILLS, Biomes.EXTREME_HILLS, Biomes.EXTREME_HILLS_EDGE, Biomes.EXTREME_HILLS_WITH_TREES, Biomes.DESERT));
Generator.generateOre(dilithiumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, DILITHIUM_VAL, 100, 0, 64, 2, 8, newArrayList(Biomes.DESERT, Biomes.DESERT_HILLS, Biomes.MUTATED_DESERT, Biomes.OCEAN, Biomes.DEEP_OCEAN, Biomes.FROZEN_OCEAN, Biomes.BEACH));
Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, 1, 15, 0, 128, 1, 5, null);
meteorGenStats.put(meteorGenStats.get(dim), meteorGenStats.get(dim) + Generator.generateMeteor(duraniteOre
.getDefaultState(), blockMeteorite.getDefaultState(), random, x, z, world, DURANITE_VAL, 6, 16, 112));
Generator.generateOreDescending(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA
.getDefaultState()), basaltBlock.getDefaultState(), random, x, z, world, BASALT_VAL, 0, 64);
Generator.generateOreDescending(newArrayList(Blocks.BEDROCK.getDefaultState()), eezoOre.getDefaultState(),
random, x, z, world, EEZO_VAL, 0, 10);
Generator.generateOreStoneVariant(karmesineOre.getDefaultState(), BlockStone.EnumType.ANDESITE, random, x, z,
world, KARMESINE_VAL);
Generator.generateOreStoneVariant(oviumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z,
world, OVIUM_VAL);
Generator.generateOreStoneVariant(jauxumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z,
world, JAUXUM_VAL);
Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world,
VIBRANIUM_VAL, 100, 0, 64, 2, 6, newArrayList(Biomes.DESERT_HILLS, Biomes.EXTREME_HILLS, Biomes
.EXTREME_HILLS_EDGE, Biomes.EXTREME_HILLS_WITH_TREES, Biomes.DESERT));
Generator.generateOre(dilithiumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world,
DILITHIUM_VAL, 100, 0, 64, 2, 8, newArrayList(Biomes.DESERT, Biomes.DESERT_HILLS, Biomes
.MUTATED_DESERT, Biomes.OCEAN, Biomes.DEEP_OCEAN, Biomes.FROZEN_OCEAN, Biomes.BEACH));
Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, 1,
15, 0, 128, 1, 5, null);
if (ironGen) {
Generator.generateOre(Blocks.IRON_ORE.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, IRON_VAL, 0, 32, 2, 8);
Generator.generateOre(Blocks.IRON_ORE.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z,
world, IRON_VAL, 0, 32, 2, 8);
}
if (meteorChunkStats.get(dim) > 100 && meteorGenStats.get(dim) == 0) {
@@ -67,31 +83,49 @@ public class WorldGen implements IWorldGenerator {
}
private void world(Random random, int x, int z, World world) {
Generator.generateMeteor(duraniteOre.getDefaultState(), blockMeteorite.getDefaultState(), random, x, z, world, DURANITE_VAL, 6, 16, 112);
Generator.generateOreDescending(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA.getDefaultState()), basaltBlock.getDefaultState(), random, x, z, world, BASALT_VAL, 0, 64);
Generator.generateOreDescending(newArrayList(Blocks.BEDROCK.getDefaultState()), eezoOre.getDefaultState(), random, x, z, world, EEZO_VAL, 0, 10);
Generator.generateOreStoneVariant(karmesineOre.getDefaultState(), BlockStone.EnumType.ANDESITE, random, x, z, world, KARMESINE_VAL);
Generator.generateOreStoneVariant(oviumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z, world, OVIUM_VAL);
Generator.generateOreStoneVariant(jauxumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z, world, JAUXUM_VAL);
Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, VIBRANIUM_VAL, 100, 0, 64, 2, 6, newArrayList(Biomes.DESERT_HILLS, Biomes.EXTREME_HILLS, Biomes.EXTREME_HILLS_EDGE, Biomes.EXTREME_HILLS_WITH_TREES, Biomes.DESERT));
Generator.generateOre(dilithiumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, DILITHIUM_VAL, 100, 0, 64, 2, 8, newArrayList(Biomes.DESERT, Biomes.DESERT_HILLS, Biomes.MUTATED_DESERT, Biomes.OCEAN, Biomes.DEEP_OCEAN, Biomes.FROZEN_OCEAN, Biomes.BEACH));
Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, 1, 15, 0, 128, 1, 5, null);
Generator.generateMeteor(duraniteOre.getDefaultState(), blockMeteorite.getDefaultState(), random, x, z,
world, DURANITE_VAL, 6, 16, 112);
Generator.generateOreDescending(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA
.getDefaultState()), basaltBlock.getDefaultState(), random, x, z, world, BASALT_VAL, 0, 64);
Generator.generateOreDescending(newArrayList(Blocks.BEDROCK.getDefaultState()), eezoOre.getDefaultState(),
random, x, z, world, EEZO_VAL, 0, 10);
Generator.generateOreStoneVariant(karmesineOre.getDefaultState(), BlockStone.EnumType.ANDESITE, random, x, z,
world, KARMESINE_VAL);
Generator.generateOreStoneVariant(oviumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z,
world, OVIUM_VAL);
Generator.generateOreStoneVariant(jauxumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z,
world, JAUXUM_VAL);
Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world,
VIBRANIUM_VAL, 100, 0, 64, 2, 6, newArrayList(Biomes.DESERT_HILLS, Biomes.EXTREME_HILLS, Biomes
.EXTREME_HILLS_EDGE, Biomes.EXTREME_HILLS_WITH_TREES, Biomes.DESERT));
Generator.generateOre(dilithiumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world,
DILITHIUM_VAL, 100, 0, 64, 2, 8, newArrayList(Biomes.DESERT, Biomes.DESERT_HILLS, Biomes
.MUTATED_DESERT, Biomes.OCEAN, Biomes.DEEP_OCEAN, Biomes.FROZEN_OCEAN, Biomes.BEACH));
Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, 1,
15, 0, 128, 1, 5, null);
if (ironGen) {
Generator.generateOre(Blocks.IRON_ORE.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, IRON_VAL, 0, 32, 2, 8);
Generator.generateOre(Blocks.IRON_ORE.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z,
world, IRON_VAL, 0, 32, 2, 8);
}
}
private void end(Random random, int x, int z, World world) {
Generator.generateCube(true, uruOre.getDefaultState(), blockObsidiorite.getDefaultState(), random, x, z, world, URU_VAL, 2, 0, 96, 3);
Generator.generateCube(true, uruOre.getDefaultState(), blockObsidiorite.getDefaultState(), random, x, z,
world, URU_VAL, 2, 0, 96, 3);
if (endGen)
Generator.generateOre(Blocks.AIR.getDefaultState(), Blocks.END_STONE.getDefaultState(), null, null, random, x, z, world, 1, 100, 3, 64, 3, 8, null);
Generator.generateOre(auroriumOre.getDefaultState(), Blocks.END_STONE.getDefaultState(), random, x, z, world, AURORIUM_VAL, 32, 48, 2, 4);
Generator.generateOre(palladiumOre.getDefaultState(), Blocks.END_STONE.getDefaultState(), random, x, z, world, PALLADIUM_VAL, 48, 64, 2, 4);
Generator.generateOreBottom(Blocks.END_STONE.getDefaultState(), abyssumOre.getDefaultState(), random, x, z, world, ABYSSUM_VAL, 4, 64);
Generator.generateOre(Blocks.AIR.getDefaultState(), Blocks.END_STONE.getDefaultState(), null, null,
random, x, z, world, 1, 100, 3, 64, 3, 8, null);
Generator.generateOre(auroriumOre.getDefaultState(), Blocks.END_STONE.getDefaultState(), random, x, z, world,
AURORIUM_VAL, 32, 48, 2, 4);
Generator.generateOre(palladiumOre.getDefaultState(), Blocks.END_STONE.getDefaultState(), random, x, z,
world, PALLADIUM_VAL, 48, 64, 2, 4);
Generator.generateOreBottom(Blocks.END_STONE.getDefaultState(), abyssumOre.getDefaultState(), random, x, z,
world, ABYSSUM_VAL, 4, 64);
}
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator,
IChunkProvider chunkProvider) {
int x = chunkX * 16;
int z = chunkZ * 16;
switch (world.provider.getDimension()) {

View File

@@ -1,6 +1,5 @@
package com.sosnitzka.taiga.world;
import com.google.common.base.Predicate;
import com.sosnitzka.taiga.util.StateMatcher;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.state.pattern.BlockMatcher;
@@ -11,6 +10,7 @@ import net.minecraft.world.World;
import javax.annotation.ParametersAreNonnullByDefault;
import java.util.Random;
import java.util.function.Predicate;
public class WorldGenMinable extends net.minecraft.world.gen.feature.WorldGenMinable {
private final IBlockState oreBlock;
@@ -25,7 +25,7 @@ public class WorldGenMinable extends net.minecraft.world.gen.feature.WorldGenMin
}
public WorldGenMinable(IBlockState state, int blockCount, Predicate<IBlockState> predicate) {
super(state, blockCount, predicate);
super(state, blockCount, predicate::test);
this.oreBlock = state;
this.numberOfBlocks = blockCount;
this.predicate = predicate;