From 599dec16019174939f34b6ca414f9924806ee64c Mon Sep 17 00:00:00 2001 From: Fenn Date: Mon, 15 Sep 2014 11:36:29 +0100 Subject: [PATCH] This -should- fix the limestone generation, i dunno, im tired ._. --- .../info/jbcs/minecraft/chisel/Chisel.java | 6 ++- .../chisel/world/GeneratorLimestone.java | 39 +++++++++++++++++++ .../GeneratorMarble.java} | 7 ++-- 3 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 src/main/java/info/jbcs/minecraft/chisel/world/GeneratorLimestone.java rename src/main/java/info/jbcs/minecraft/chisel/{ChiselWorldGenerator.java => world/GeneratorMarble.java} (78%) diff --git a/src/main/java/info/jbcs/minecraft/chisel/Chisel.java b/src/main/java/info/jbcs/minecraft/chisel/Chisel.java index abaccda4..35817ed4 100644 --- a/src/main/java/info/jbcs/minecraft/chisel/Chisel.java +++ b/src/main/java/info/jbcs/minecraft/chisel/Chisel.java @@ -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); diff --git a/src/main/java/info/jbcs/minecraft/chisel/world/GeneratorLimestone.java b/src/main/java/info/jbcs/minecraft/chisel/world/GeneratorLimestone.java new file mode 100644 index 00000000..246388c4 --- /dev/null +++ b/src/main/java/info/jbcs/minecraft/chisel/world/GeneratorLimestone.java @@ -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); + } +} + diff --git a/src/main/java/info/jbcs/minecraft/chisel/ChiselWorldGenerator.java b/src/main/java/info/jbcs/minecraft/chisel/world/GeneratorMarble.java similarity index 78% rename from src/main/java/info/jbcs/minecraft/chisel/ChiselWorldGenerator.java rename to src/main/java/info/jbcs/minecraft/chisel/world/GeneratorMarble.java index 50c599f5..52393b8f 100644 --- a/src/main/java/info/jbcs/minecraft/chisel/ChiselWorldGenerator.java +++ b/src/main/java/info/jbcs/minecraft/chisel/world/GeneratorMarble.java @@ -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);