[1.2] Material rework (#60)

* 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
This commit is contained in:
Giovanni Harting
2016-12-05 20:34:02 +01:00
committed by GitHub
parent 9554b56931
commit 826ab1cf3a
625 changed files with 3540 additions and 3279 deletions

View File

@@ -0,0 +1,33 @@
package com.sosnitzka.taiga.blocks;
import com.sosnitzka.taiga.generic.BasicBlock;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.world.BlockEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
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) {
super(name, material, hardness, resistance, harvestlevel, light, oreDictPrefix);
MinecraftForge.EVENT_BUS.register(this);
}
@SubscribeEvent
public void breakMoonRock(BlockEvent.BreakEvent e) {
if (e.getWorld().getBlockState(e.getPos()).getBlock().equals(this)) {
if (!e.getWorld().isRemote && random.nextFloat() > .9) {
e.setCanceled(true);
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);
}
}
}
}
}

View File

@@ -3,7 +3,6 @@ package com.sosnitzka.taiga.blocks;
import com.sosnitzka.taiga.generic.BasicBlock;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.Item;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.IBlockAccess;
@@ -12,8 +11,6 @@ import net.minecraft.world.World;
import javax.annotation.ParametersAreNonnullByDefault;
import java.util.Random;
import static com.sosnitzka.taiga.Items.lignite;
public class BlockLignite extends BasicBlock {
public BlockLignite() {
@@ -34,9 +31,4 @@ public class BlockLignite extends BasicBlock {
public int quantityDropped(IBlockState state, int fortune, Random random) {
return random.nextInt(3) + 1 + fortune;
}
@Override
public Item getItemDropped(IBlockState state, Random rand, int fortune) {
return lignite;
}
}

View File

@@ -0,0 +1,70 @@
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.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> {
public static final PropertyEnum<MetalTypes> TYPE = PropertyEnum.create("type", MetalTypes.class);
public BlockMetal() {
super(Material.IRON, TYPE, MetalTypes.class);
}
@SideOnly(Side.CLIENT)
@Override
public void getSubBlocks(@Nonnull Item itemIn, CreativeTabs tab, List<ItemStack> list) {
for (MetalTypes type : MetalTypes.values()) {
list.add(new ItemStack(this, 1, type.getMeta()));
}
}
public enum MetalTypes implements IStringSerializable, EnumBlock.IEnumMeta {
TIBERIUM,
AURODIUM,
PROMETHEUM,
ARCANITE,
TITANITE,
MYTHRIL,
URU,
VIBRANIUM,
ETERNITE,
FRACTORYTE,
PALLADIUM,
IGNITITE,
BISMUTH,
JAUXITE,
VIOLIUM,
KARMESINE;
public final int meta;
MetalTypes() {
meta = ordinal();
}
@Override
public String getName() {
return this.toString().toLowerCase(Locale.US);
}
@Override
public int getMeta() {
return meta;
}
}
}

View File

@@ -0,0 +1,33 @@
package com.sosnitzka.taiga.blocks;
import com.sosnitzka.taiga.generic.BasicBlock;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.world.BlockEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import static slimeknights.tconstruct.TConstruct.random;
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) {
super(name, material, hardness, resistance, harvestlevel, light, oreDictPrefix);
MinecraftForge.EVENT_BUS.register(this);
this.cobbblestate = cobble;
}
@SubscribeEvent
public void breakMoonRock(BlockEvent.BreakEvent e) {
if (e.getWorld().getBlockState(e.getPos()).getBlock().equals(this)) {
if (!e.getWorld().isRemote && random.nextFloat() > .25) {
e.setCanceled(true);
e.getWorld().setBlockState(e.getPos(), cobbblestate);
}
}
}
}

View File

@@ -0,0 +1,68 @@
package com.sosnitzka.taiga.blocks;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.IStringSerializable;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import slimeknights.mantle.block.EnumBlock;
import javax.annotation.Nonnull;
import java.util.Locale;
public class BlockOre extends EnumBlock<BlockOre.OreTypes> {
public static final PropertyEnum<OreTypes> TYPE = PropertyEnum.create("type", OreTypes.class);
public BlockOre() {
this(Material.ROCK);
}
public BlockOre(Material material) {
super(material, TYPE, OreTypes.class);
}
@Nonnull
@Override
@SideOnly(Side.CLIENT)
public BlockRenderLayer getBlockLayer() {
return BlockRenderLayer.CUTOUT_MIPPED;
}
public enum OreTypes implements IStringSerializable, EnumBlock.IEnumMeta {
TIBERIUM,
AURODIUM,
PROMETHEUM,
ARCANITE,
TITANITE,
MYTHRIL,
URU,
VIBRANIUM,
ETERNITE,
FRACTORYTE,
PALLADIUM,
IGNITITE,
BISMUTH,
JAUXITE,
VIOLIUM,
KARMESINE;
public final int meta;
OreTypes() {
meta = ordinal();
}
@Override
public String getName() {
return this.toString().toLowerCase(Locale.US);
}
@Override
public int getMeta() {
return meta;
}
}
}

View File

@@ -4,9 +4,9 @@ import com.sosnitzka.taiga.Items;
import com.sosnitzka.taiga.generic.BasicBlock;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.Explosion;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
@@ -16,12 +16,12 @@ import java.util.Random;
import static com.sosnitzka.taiga.util.Utils.PREFIX_ORE;
import static slimeknights.tconstruct.TConstruct.random;
import static slimeknights.tconstruct.library.utils.HarvestLevels.OBSIDIAN;
import static slimeknights.tconstruct.library.utils.HarvestLevels.STONE;
public class BlockTiberium extends BasicBlock {
public BlockTiberium() {
super("tiberium_ore", Material.ROCK, 15.0f, 2.0f, OBSIDIAN, 1.0F, PREFIX_ORE);
super("tiberium_ore", Material.ROCK, 15.0f, 2.0f, STONE, 1.0F, PREFIX_ORE);
}
@Override
@@ -39,23 +39,23 @@ public class BlockTiberium extends BasicBlock {
@Override
public Item getItemDropped(IBlockState state, Random rand, int fortune) {
return Items.tiberiumShardInstable;
return Items.tiberiumDust;
}
@Override
public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn) {
if (!worldIn.isRemote) {
if (MathHelper.getRandomIntegerInRange(random, 1, 15) > 10) {
worldIn.newExplosion(null, pos.getX(), pos.getY(), pos.getZ(), 1.6f, true, true);
if (random.nextFloat() < 0.5) {
worldIn.newExplosion(null, pos.getX(), pos.getY(), pos.getZ(), random.nextFloat() * 2f + 1.5f, true, true);
}
}
}
@Override
public void onBlockDestroyedByPlayer(World worldIn, BlockPos pos, IBlockState state) {
if (MathHelper.getRandomIntegerInRange(random, 1, 30) < 3) {
public void onBlockHarvested(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player) {
if (random.nextFloat() < 0.1) {
if (!worldIn.isRemote) {
worldIn.newExplosion(null, pos.getX(), pos.getY() + 1 / 16f, pos.getZ(), 1.1f, true, true);
worldIn.newExplosion(null, pos.getX(), pos.getY() + 1 / 16f, pos.getZ(), 1.5f, true, true);
}
}
}