Posted June 7, 20169 yr So i have made marble generate in the world, which does fine. I wanted to add granite, andesite and diorite to 1.7.10, but its not behaving right... My marble generates in stone, and when i had these set to stone only, they didnt spawn much(compared to marble) package com.vanityblocks.WorldGen; import java.util.Random; import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; import com.vanityblocks.Storageprops; import com.vanityblocks.Registrations.VanityBlocksRegistration; import cpw.mods.fml.common.IWorldGenerator; public class GADWorldGen implements IWorldGenerator { public GADWorldGen(int par1) { Granite = new WorldGenMinable( VanityBlocksRegistration.VanityWorldGraniteblock, 0, (Storageprops.gadvein), Blocks.stone); Granite = new WorldGenMinable( VanityBlocksRegistration.VanityWorldGraniteblock, 0, (Storageprops.gadvein), Blocks.dirt); Granite = new WorldGenMinable( VanityBlocksRegistration.VanityWorldGraniteblock, 0, (Storageprops.gadvein), Blocks.gravel); Diorite = new WorldGenMinable( VanityBlocksRegistration.VanityWorldDioriteblock, 0, (Storageprops.gadvein), Blocks.stone); Diorite = new WorldGenMinable( VanityBlocksRegistration.VanityWorldDioriteblock, 0, (Storageprops.gadvein), Blocks.dirt); Diorite = new WorldGenMinable( VanityBlocksRegistration.VanityWorldDioriteblock, 0, (Storageprops.gadvein), Blocks.sand); Andesite = new WorldGenMinable( VanityBlocksRegistration.VanityWorldAndesiteblock, 0, (Storageprops.gadvein), Blocks.stone); Andesite = new WorldGenMinable( VanityBlocksRegistration.VanityWorldAndesiteblock, 0, (Storageprops.gadvein), Blocks.dirt); Andesite = new WorldGenMinable( VanityBlocksRegistration.VanityWorldAndesiteblock, 0, (Storageprops.gadvein), Blocks.gravel); } public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { if (Storageprops.enablediorite) { if (world.provider.dimensionId == 0) generateGraniteSurface(random, chunkX * 16, chunkZ * 16, world); generateDioriteSurface(random, chunkX * 16, chunkZ * 16, world); generateAndesiteSurface(random, chunkX * 16, chunkZ * 16, world); } } void generateGraniteSurface(Random random, int xChunk, int zChunk, World world) { int heightBand; int xPos, yPos, zPos; if (Storageprops.enablediorite) { for (int q = 0; q < (Storageprops.gadrarity); q++) { xPos = xChunk + random.nextInt(16); yPos = (Storageprops.gadheight) + random.nextInt(Storageprops.gadrange); zPos = zChunk + random.nextInt(16); Granite.generate(world, random, xPos, yPos, zPos); } } } void generateDioriteSurface(Random random, int xChunk, int zChunk, World world) { int heightBand; int xPos, yPos, zPos; if (Storageprops.enablediorite) { for (int q = 0; q < (Storageprops.gadrarity); q++) { xPos = xChunk + random.nextInt(16); yPos = (Storageprops.gadheight) + random.nextInt(Storageprops.gadrange); zPos = zChunk + random.nextInt(16); Diorite.generate(world, random, xPos, yPos, zPos); } } } void generateAndesiteSurface(Random random, int xChunk, int zChunk, World world) { int heightBand; int xPos, yPos, zPos; if (Storageprops.enablediorite) { for (int q = 0; q < (Storageprops.gadrarity); q++) { xPos = xChunk + random.nextInt(16); yPos = (Storageprops.gadheight) + random.nextInt(Storageprops.gadrange); zPos = zChunk + random.nextInt(16); Andesite.generate(world, random, xPos, yPos, zPos); } } } WorldGenMinable Granite; WorldGenMinable Diorite; WorldGenMinable Andesite; } // } So i thought to make them spawn in the other blocks(sand, stone, gravel, dirt). Is there something im doing wrong with it, cause they dont spawn much
June 7, 20169 yr Author so what? each one should have its own class to generate from? oh god, i get it, its from me using WorldGenMinable repeated over and over
June 7, 20169 yr Author Learning, two, i need to split the files up dont i then, its gonna use the same varible of WorldGenMineable cause thats a base mc class no?
June 7, 20169 yr Author Probbally but i have no interest in java outside of mc modding. Ok then explain better, i understand the first point, its just resetting over it, so how do i fix it, give each block its own generate block?
June 7, 20169 yr Author True but regardless i do this for fun, not money otherwise i would learn full java List, thanks ill look into that
June 7, 20169 yr I have an even better idea: Just generate in stone. Don't even worry about dirt and gravel. If your generator is written correctly, then whenever it runs into something it can't replace, it can reroll the randomizer and try again. Oh, and what D7 said about programming is correct. While I could come to MC modding with about 30 years programming xp with no Java, I don't think anyone can jump in with zero programming. You need to learn the essential concepts so you can even understand the words used to offer you help. This forum is not here to teaching beginning programming. It's not here to teach Java. It's here to teach the idiosyncrasies of decompiled Minecraft code and the Forge wrapper written to mod it. As an analogy, this ain't a high school study hall, and it isn't even a undergrad college lab. It expects people to arrive with that knowledge, ready to learn an advanced specialization that builds thereon at a post-graduate level. The web has other resources to help you become ready. Go find them. The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.