forked from TAIGA/TAIGA
* Developement tests for nbt data in traits * Lot of trait changes and better balancing * Traits reworked a bit, new traits added. * First correction of NBT Data in Trait (Soulbound). Is shown twice. Still needs corrections. * Few fixes in traits and new trait "catcher" * Small fix, needs workaround * fixed some catch issues * Fixed Catcher and Reviving Traits, new Trait: Souleater. Updated build.gradle for new TiC Version. * Splitted SoulEater to get the bad touch to an extra trait "Cursed". Added method for using nbt more easily. Changed declaration names of fluids * Some minor changes in Traits, Registry and Utils. * Iron_nugget is replaced with oreDict Item when not loaded via TAIGA. * Beginning of new material integration. Lot of names changed, lot more work to do here. Many null pointer exceptions and no changes of values up to now. * Some Small changes in names, registry and recipes * Some weird stuff I don't remember :D * fixed some things I missed while merging * Rollback to something * More Stuff * fixed some merging stuff * Fixed some misspelled names. Actually working with lots of restrictions. * Rearranged alloys, tried to add blocks / ingots for non-tinker-materials, but they won't work. * Again tried to fix the melting issue, but non-tinker materials still are not able to be casted as a block, ingot or nugget... * Fixed integration of materials without tools. * changed IMC to direct lib calls * removed more IMC, removed redundant code * some reformatting * Alloy integration reworked, needs to be balanced. * updated deps, renamed some func's, added duplicate material check * some more renaming * some reformatting, fixed wrong import, fixed string cmp's * Added images for blocks, ingots, nuggets and dust. Json changes do not work yet. * some reformatting * Removed old json files. Placeholder needed. * Fixed block json, items not working yet. * Fixed my own derp (missing json files) * Reduced materials to ensure unique traits for most of them. Still 30 though, but reduced by 20 more :'( RIP * Changed some generator stuff, not working properly right now! * rewrote offset generation, added some debug command, fixed some stuff * fixed on-surface-generation, made dependencies more flexible * reverted gen-weight back to its normal value * Meteor generator implemented. * fixed generating on ground * optimized a thing * Replaced Uru with Osram, replaced Meteorite with Uru, added Meteorite again for Hull-Material and late game alloy. * Some changes in generation of ores, not ready yet. * Added Cobble Meteorite. Added debug command. Implemented rest of ore generation. Some minor fixes left for generation including balancing. * Some changes for ore generation. Added 2 separate Generic Blocks for meteorite and their cobble variant. * some cleanup in Generator class, added meteor world save handler * Added Textures. Added blockstates and item models. Fixed fluid rendering. * renamed world save data file to be little more specific, removed a unused method * some preps for the upcoming release * First attempt of well balancing material stats. Renamed TiberiumX to Triberium. * Final changes... ready for beta testing * Added missing alloys. * Corrected balancing of ore generation. Still WIP * removed some last debug out * one last reformat
115 lines
8.6 KiB
Java
115 lines
8.6 KiB
Java
package com.sosnitzka.taiga;
|
|
|
|
import com.google.common.base.Joiner;
|
|
import com.sosnitzka.taiga.blocks.BlockCobble;
|
|
import com.sosnitzka.taiga.blocks.BlockMeteoriteRock;
|
|
import com.sosnitzka.taiga.blocks.BlockTiberium;
|
|
import com.sosnitzka.taiga.generic.BasicBlock;
|
|
import com.sosnitzka.taiga.util.Utils;
|
|
import net.minecraft.block.Block;
|
|
import net.minecraft.block.material.Material;
|
|
import net.minecraftforge.oredict.OreDictionary;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import java.lang.reflect.Field;
|
|
import java.util.Arrays;
|
|
|
|
import static com.sosnitzka.taiga.MaterialTraits.*;
|
|
import static com.sosnitzka.taiga.util.Utils.PREFIX_BLOCK;
|
|
import static com.sosnitzka.taiga.util.Utils.PREFIX_ORE;
|
|
import static slimeknights.tconstruct.library.utils.HarvestLevels.*;
|
|
|
|
public class Blocks {
|
|
|
|
|
|
// blocks and ores spawned via worldgen
|
|
public static Block basaltBlock = new BasicBlock("basalt_block", Material.ROCK, 45.0f, 35.0f, DIAMOND, PREFIX_BLOCK);
|
|
public static Block tiberiumOre = new BlockTiberium();
|
|
public static Block auroriumOre = new BasicBlock("aurorium_ore", Material.ROCK, 13.0f, 12f, COBALT, 0.2f, PREFIX_ORE);
|
|
public static Block prometheumOre = new BasicBlock("prometheum_ore", Material.ROCK, 35.0f, 12f, DURANITE, 0.4f, PREFIX_ORE);
|
|
public static Block duraniteOre = new BasicBlock("duranite_ore", Material.ROCK, 80.0f, 70f, DURANITE, PREFIX_ORE);
|
|
public static Block valyriumOre = new BasicBlock("valyrium_ore", Material.ROCK, 60.0f, 50f, VALYRIUM, PREFIX_ORE);
|
|
public static Block vibraniumOre = new BasicBlock("vibranium_ore", Material.ROCK, 70.0f, 60f, VIBRANIUM, PREFIX_ORE);
|
|
public static Block karmesineOre = new BasicBlock("karmesine_ore", Material.ROCK, 13.0f, 10f, COBALT, PREFIX_ORE);
|
|
public static Block palladiumOre = new BasicBlock("palladium_ore", Material.ROCK, 25.0f, 15f, DURANITE, 0.4f, PREFIX_ORE);
|
|
public static Block uruOre = new BasicBlock("uru_ore", Material.ROCK, 25.0f, 15f, VALYRIUM, PREFIX_ORE);
|
|
public static Block osramOre = new BasicBlock("osram_ore", Material.ROCK, 45.0f, 35.0f, COBALT, PREFIX_ORE);
|
|
public static Block eezoOre = new BasicBlock("eezo_ore", Material.ROCK, 45.0f, 35.0f, COBALT, PREFIX_ORE);
|
|
public static Block abyssumOre = new BasicBlock("abyssum_ore", Material.ROCK, 45.0f, 35.0f, COBALT, PREFIX_ORE);
|
|
|
|
// Ore Casts
|
|
public static Block tiberiumBlock = new BasicBlock("tiberium_block", Material.ROCK, 30.0f, 15f, STONE, 1f, PREFIX_BLOCK);
|
|
public static Block auroriumBlock = new BasicBlock("aurorium_block", Material.ROCK, 13.0f, 15f, COBALT, PREFIX_BLOCK);
|
|
public static Block prometheumBlock = new BasicBlock("prometheum_block", Material.ROCK, 35.0f, 15f, DURANITE, 0.5f, PREFIX_BLOCK);
|
|
public static Block duraniteBlock = new BasicBlock("duranite_block", Material.ROCK, 60.0f, 60f, DURANITE, PREFIX_BLOCK);
|
|
public static Block valyriumBlock = new BasicBlock("valyrium_block", Material.ROCK, 70.0f, 70f, VALYRIUM, PREFIX_BLOCK);
|
|
public static Block vibraniumBlock = new BasicBlock("vibranium_block", Material.ROCK, 80.0f, 80f, VIBRANIUM, PREFIX_BLOCK);
|
|
public static Block karmesineBlock = new BasicBlock("karmesine_block", Material.ROCK, 13.0f, 12f, COBALT, PREFIX_BLOCK);
|
|
public static Block palladiumBlock = new BasicBlock("palladium_block", Material.ROCK, 25.0f, 20f, DURANITE, 0.5f, PREFIX_BLOCK);
|
|
public static Block uruBlock = new BasicBlock("uru_block", Material.ROCK, 25.0f, 20f, VALYRIUM, PREFIX_BLOCK);
|
|
public static Block osramBlock = new BasicBlock("osram_block", Material.ROCK, 13.0f, 12f, COBALT, PREFIX_BLOCK);
|
|
public static Block abyssumBlock = new BasicBlock("abyssum_block", Material.ROCK, 13.0f, 12f, COBALT, PREFIX_BLOCK);
|
|
public static Block eezoBlock = new BasicBlock("eezo_block", Material.ROCK, 13.0f, 12f, COBALT, PREFIX_BLOCK);
|
|
|
|
public static Block triberiumBlock = new BasicBlock("triberium_block", Material.ROCK, 30.0f, 15f, OBSIDIAN, 1f, PREFIX_BLOCK);
|
|
public static Block fractumBlock = new BasicBlock("fractum_block", Material.ROCK, 25.0f, 25f, COBALT, PREFIX_BLOCK);
|
|
public static Block violiumBlock = new BasicBlock("violium_block", Material.ROCK, 25.0f, 25f, COBALT, PREFIX_BLOCK);
|
|
public static Block proxiiBlock = new BasicBlock("proxii_block", Material.ROCK, 25.0f, 25f, DURANITE, PREFIX_BLOCK);
|
|
public static Block tritoniteBlock = new BasicBlock("tritonite_block", Material.ROCK, 25.0f, 25f, COBALT, PREFIX_BLOCK);
|
|
public static Block ignitzBlock = new BasicBlock("ignitz_block", Material.ROCK, 23.0f, 20f, COBALT, PREFIX_BLOCK);
|
|
public static Block imperomiteBlock = new BasicBlock("imperomite_block", Material.ROCK, 25.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, 25.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, 25.0f, 25f, DURANITE, PREFIX_BLOCK);
|
|
public static Block nucleumBlock = new BasicBlock("nucleum_block", Material.ROCK, 25.0f, 25f, VALYRIUM, PREFIX_BLOCK);
|
|
public static Block lumixBlock = new BasicBlock("lumix_block", Material.ROCK, 25.0f, 25f, COBALT, PREFIX_BLOCK);
|
|
public static Block seismumBlock = new BasicBlock("seismum_block", Material.ROCK, 25.0f, 25f, COBALT, PREFIX_BLOCK);
|
|
public static Block astriumBlock = new BasicBlock("astrium_block", Material.ROCK, 25.0f, 25f, COBALT, PREFIX_BLOCK);
|
|
public static Block niobBlock = new BasicBlock("niob_block", Material.ROCK, 25.0f, 25f, DURANITE, PREFIX_BLOCK);
|
|
public static Block yrdeenBlock = new BasicBlock("yrdeen_block", Material.ROCK, 25.0f, 25f, VALYRIUM, PREFIX_BLOCK);
|
|
public static Block ioxBlock = new BasicBlock("iox_block", Material.ROCK, 25.0f, 25f, DURANITE, PREFIX_BLOCK);
|
|
|
|
|
|
public static Block blockMeteoriteCobble = new BlockCobble("meteoritecobble_block", Material.ROCK, 35f, 10f, COBALT, 0.075f, PREFIX_BLOCK);
|
|
public static Block blockObsidioriteCobble = new BlockCobble("obsidioritecobble_block", Material.ROCK, 60f, 20f, DURANITE, 0.035f, PREFIX_BLOCK);
|
|
public static Block blockMeteorite = new BlockMeteoriteRock("meteorite_block", Material.ROCK, 70f, 2000f, COBALT, 0.15f, PREFIX_BLOCK, blockMeteoriteCobble.getDefaultState());
|
|
public static Block blockObsidiorite = new BlockMeteoriteRock("obsidiorite_block", Material.ROCK, 120f, 4000f, DURANITE, 0.2f, PREFIX_BLOCK, blockObsidioriteCobble.getDefaultState());
|
|
|
|
|
|
/**
|
|
* Registers all materials' ingots and nuggets <br>
|
|
* Detailed summary: <br>
|
|
* 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() {
|
|
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("_");
|
|
|
|
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
|
|
}
|
|
}
|
|
} catch (IllegalAccessException e) {
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|