This -should- fix the limestone generation, i dunno, im tired ._.

This commit is contained in:
Fenn committed 2014-09-15 11:36:29 +01:00
1 parent fca1a06eca
commit 599dec1601
3 files changed
+46 -6

No files matched your search

@@ -26,6 +26,8 @@ import info.jbcs.minecraft.chisel.item.ItemBallOMoss;
import info.jbcs.minecraft.chisel.item.ItemChisel;
import info.jbcs.minecraft.chisel.item.ItemCloudInABottle;
import info.jbcs.minecraft.chisel.item.ItemSmashingRock;
import info.jbcs.minecraft.chisel.world.GeneratorLimestone;
import info.jbcs.minecraft.chisel.world.GeneratorMarble;
import info.jbcs.minecraft.utilities.General;
import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
@@ -187,8 +189,8 @@ public class Chisel
});
GameRegistry.registerWorldGenerator(new ChiselWorldGenerator(ChiselBlocks.blockMarble, 32, Configurations.marbleAmount), 1000);
GameRegistry.registerWorldGenerator(new ChiselWorldGenerator(ChiselBlocks.blockLimestone, 32, Configurations.limestoneAmount), 1000);
GameRegistry.registerWorldGenerator(new GeneratorMarble(ChiselBlocks.blockMarble, 32, Configurations.marbleAmount), 1000);
GameRegistry.registerWorldGenerator(new GeneratorLimestone(ChiselBlocks.blockLimestone, 32, Configurations.limestoneAmount), 1000);
proxy.init();
MinecraftForge.EVENT_BUS.register(this);
@@ -0,0 +1,39 @@
package info.jbcs.minecraft.chisel.world;
import cpw.mods.fml.common.IWorldGenerator;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import java.util.Random;
public class GeneratorLimestone implements IWorldGenerator
{
WorldGenMinable gen;
int amount;
public GeneratorLimestone(Block block, int count, int am)
{
gen = new WorldGenMinable(block, count);
amount = am;
}
protected void genStandardOre1(World world, Random random, int x, int z, int bot, int top)
{
for(int l = 0; l < amount; ++l)
{
int i1 = x + random.nextInt(15);
int j1 = bot + random.nextInt(top - bot);
int k1 = z + random.nextInt(15);
gen.generate(world, random, i1, j1, k1);
}
}
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
genStandardOre1(world, random, chunkX * 16, chunkZ * 16, 40, 128);
}
}
@@ -1,4 +1,4 @@
package info.jbcs.minecraft.chisel;
package info.jbcs.minecraft.chisel.world;
import cpw.mods.fml.common.IWorldGenerator;
import net.minecraft.block.Block;
@@ -8,12 +8,12 @@ import net.minecraft.world.gen.feature.WorldGenMinable;
import java.util.Random;
public class ChiselWorldGenerator implements IWorldGenerator
public class GeneratorMarble implements IWorldGenerator
{
WorldGenMinable gen;
int amount;
public ChiselWorldGenerator(Block block, int count, int am)
public GeneratorMarble(Block block, int count, int am)
{
gen = new WorldGenMinable(block, count);
amount = am;
@@ -23,7 +23,6 @@ public class ChiselWorldGenerator implements IWorldGenerator
{
for(int l = 0; l < amount; ++l)
{
//TODO change the values if its marble or limestone, thanks to tahg for finding all of this.
int i1 = x + random.nextInt(16);
int j1 = bot + random.nextInt(top - bot);
int k1 = z + random.nextInt(16);