forked from TAIGA/TAIGA
small generator fix, not ready yet
This commit is contained in:
@@ -51,6 +51,7 @@ public class MaterialTraits {
|
||||
public static final AbstractTrait ported = new TraitPorted();
|
||||
public static final AbstractTrait decay = new TraitDecay();
|
||||
public static final AbstractTrait whirl = new TraitWhirl();
|
||||
public static final AbstractTrait dev = new TraitDevelopement();
|
||||
|
||||
/**
|
||||
* Assign traits to related materials. <br>
|
||||
@@ -80,7 +81,10 @@ public class MaterialTraits {
|
||||
public static Material imperomite = new Material("imperomite", TextFormatting.DARK_RED).addTrait(hollow);
|
||||
public static Material solarium = new Material("solarium", TextFormatting.YELLOW).addTrait(pulverizing);
|
||||
public static Material nihilite = new Material("nihilite", TextFormatting.BLACK).addTrait(souleater);
|
||||
public static Material adamant = new Material("adamant", TextFormatting.GOLD);
|
||||
/**
|
||||
* With Dev
|
||||
**/
|
||||
public static Material adamant = new Material("adamant", TextFormatting.GOLD).addTrait(dev);
|
||||
public static Material dyonite = new Material("dyonite", TextFormatting.GREEN).addTrait(tantrum);
|
||||
public static Material nucleum = new Material("nucleum", TextFormatting.YELLOW).addTrait(decay);
|
||||
public static Material lumix = new Material("lumix", TextFormatting.YELLOW).addTrait(bright, MaterialTypes.HANDLE).addTrait(glimmer, MaterialTypes.HEAD);
|
||||
|
@@ -0,0 +1,28 @@
|
||||
package com.sosnitzka.taiga.traits;
|
||||
|
||||
import net.minecraft.block.BlockStone;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import slimeknights.tconstruct.library.traits.AbstractTrait;
|
||||
|
||||
|
||||
public class TraitDevelopement extends AbstractTrait {
|
||||
|
||||
|
||||
public TraitDevelopement() {
|
||||
super(TraitDevelopement.class.getSimpleName().toLowerCase().substring(5), TextFormatting.RED);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBreak(BlockEvent.BreakEvent e) {
|
||||
IBlockState state = e.getState();
|
||||
if (state.getBlock().equals(net.minecraft.init.Blocks.STONE))
|
||||
System.out.println("State.Variant: " + state.getValue(BlockStone.VARIANT));
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -25,7 +25,6 @@ import static com.sosnitzka.taiga.util.Utils.nextInt;
|
||||
public class Generator {
|
||||
|
||||
public static void generateOre(IBlockState state, IBlockState replace, Random random, int chunkX, int chunkZ, World world, int chance, int minY, int maxY, int minSize, int maxSize) {
|
||||
if (replace == Blocks.IRON_ORE.getDefaultState()) System.out.println(" HIER ");
|
||||
generateOre(state, replace, null, null, random, chunkX, chunkZ, world, chance, minY, maxY, minSize, maxSize, null);
|
||||
}
|
||||
|
||||
@@ -33,11 +32,11 @@ public class Generator {
|
||||
generateOre(oldState, newState, property, comparable, random, chunkX, chunkZ, world, chance, minY, maxY, minSize, maxSize, null);
|
||||
}
|
||||
|
||||
public static void generateOre(IBlockState state, IBlockState replace, Random random, int chunkX, int chunkZ, World world, int chance, int minY, int maxY, int minSize, int maxSize, List<Biome> biome) {
|
||||
generateOre(state, replace, null, null, random, chunkX, chunkZ, world, chance, minY, maxY, minSize, maxSize, null);
|
||||
public static void generateOre(IBlockState oldState, IBlockState newState, Random random, int chunkX, int chunkZ, World world, int chance, int minY, int maxY, int minSize, int maxSize, List<Biome> biome) {
|
||||
generateOre(oldState, newState, null, null, random, chunkX, chunkZ, world, chance, minY, maxY, minSize, maxSize, null);
|
||||
}
|
||||
|
||||
public static void generateOre(IBlockState state, IBlockState replace, IProperty property, Comparable comparable, Random random, int chunkX, int chunkZ, World world, int chance, int minY, int maxY, int minSize, int maxSize, List<Biome> biome) {
|
||||
public static void generateOre(IBlockState oldState, IBlockState newState, IProperty property, Comparable comparable, Random random, int chunkX, int chunkZ, World world, 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 < chance; i++) {
|
||||
@@ -46,7 +45,7 @@ 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(state, size, StateMatcher.forState(replace, property, comparable)).generate(world, random, new BlockPos(posX, posY, posZ));
|
||||
new WorldGenMinable(oldState, size, StateMatcher.forState(newState, property, comparable)).generate(world, random, new BlockPos(posX, posY, posZ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -75,23 +74,30 @@ public class Generator {
|
||||
}
|
||||
}
|
||||
|
||||
public static void generateOreDescending(IBlockState oldState, IBlockState newState, IProperty property, Comparable comparable, Random random, int chunkX, int chunkZ, World world, int count) {
|
||||
public static void generateOreDescending(IBlockState oldState, IBlockState newState, IProperty property, List<BlockStone.EnumType> comparable, Random random, int chunkX, int chunkZ, World world, int count) {
|
||||
for (int i = 0; i < count; i++) {
|
||||
int posX = chunkX + random.nextInt(16);
|
||||
int posZ = chunkZ + random.nextInt(16);
|
||||
BlockPos cPos = new BlockPos(posX, random.nextInt(93) + 3, posZ);
|
||||
BlockPos cPos = new BlockPos(posX, random.nextInt(64) + 16, posZ);
|
||||
IBlockState state = world.getBlockState(cPos);
|
||||
if (oldState.getBlock().equals(state.getBlock()) && state.getBlock() instanceof BlockStone && comparable.equals(state.getValue(property))) {
|
||||
|
||||
world.setBlockState(cPos, newState);
|
||||
|
||||
continue;
|
||||
}
|
||||
while (!(state.getBlock() instanceof BlockStone) && !oldState.getBlock().equals(state.getBlock()) && !comparable.equals(state.getValue(property)) && cPos.getY() > 5) {
|
||||
cPos = cPos.down();
|
||||
}
|
||||
if (state.getBlock() instanceof BlockStone && oldState.getBlock().equals(state.getBlock()) && comparable.equals(state.getValue(property))) {
|
||||
world.setBlockState(cPos, newState);
|
||||
if (state.getBlock().equals(oldState.getBlock())) {
|
||||
if (comparable.contains(state.getValue(property))) {
|
||||
System.out.println("Yes, a variant");
|
||||
world.setBlockState(cPos, newState);
|
||||
}
|
||||
} else {
|
||||
while (cPos.getY() > 4) {
|
||||
cPos = cPos.down();
|
||||
if (state.getBlock().equals(oldState.getBlock())) {
|
||||
if (comparable.contains(state.getValue(property))) {
|
||||
System.out.println("Yes!! a variant");
|
||||
world.setBlockState(cPos, newState);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (random.nextBoolean())
|
||||
i--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -35,7 +35,7 @@ public class WorldGen implements IWorldGenerator {
|
||||
Generator.generateOreDescendingTopLayer(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA.getDefaultState()), basaltBlock.getDefaultState(), random, x, z, world, BASALT_VAL, 0, 64);
|
||||
Generator.generateOreDescendingTopLayer(newArrayList(Blocks.BEDROCK.getDefaultState()), eezoOre.getDefaultState(), random, x, z, world, EEZO_VAL, 0, 10);
|
||||
|
||||
Generator.generateOreDescending(Blocks.STONE.getDefaultState(), karmesineOre.getDefaultState(), BlockStone.VARIANT, BlockStone.EnumType.DIORITE, random, x, z, world, KARMESINE_VAL);
|
||||
Generator.generateOreDescending(Blocks.STONE.getDefaultState(), karmesineOre.getDefaultState(), BlockStone.VARIANT, newArrayList(BlockStone.EnumType.DIORITE, BlockStone.EnumType.GRANITE, BlockStone.EnumType.ANDESITE), random, x, z, world, KARMESINE_VAL);
|
||||
|
||||
Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, VIBRANIUM_VAL, 0, 64, 2, 12, newArrayList(Biomes.DESERT_HILLS, Biomes.EXTREME_HILLS, Biomes.EXTREME_HILLS_EDGE, Biomes.EXTREME_HILLS_WITH_TREES, Biomes.DESERT));
|
||||
Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, 1, 0, 128, 1, 3, null);
|
||||
|
Reference in New Issue
Block a user