Posted April 25, 20178 yr This may sound like a really basic question, but I can't seem to find anything with google searches, multiple different keywords going several pages deeper then I care to admit. In short, how do I change the games base terrain generation? I would like to change the ore spawn frequency and vein size. My first issue is I can not seem to find how to interact with that code via forge. I feel what I want to do is straight forward and shouldn't be too hard once I know how to interact with the ore generation code; or am I just being extremely naive? Thanks!
April 25, 20178 yr 3 hours ago, splatterdodge said: ...how to interact with the ore generation Did you Google minecraft forge ore generation? 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.
April 25, 20178 yr One question: Is this for your own ores, or for vanilla/other modded ores? If the latter: If you want to influence other's ores, look at the GenerateMinable event. It passes the WorldGenerator, which you can cast to WorldGenMinable, and get the state, number and predicate from. Also previously known as eAndPi. "Pi, is there a station coming up where we can board your train of thought?" -Kronnn Published Mods: Underworld Handy links: Vic_'s Forge events Own WIP Tutorials.
April 25, 20178 yr Author 5 hours ago, jeffryfisher said: Did you Google minecraft forge ore generation? I might just be stupid 3 hours ago, Matryoshika said: If you want to influence other's ores, look at the GenerateMinable event. It passes the WorldGenerator, which you can cast to WorldGenMinable, and get the state, number and predicate from. I am trying to hastily ask this question before class, but from a few quick google searches these functions will allow me to change vein size, if they appear in a chunk, and how many veins appear in a chunk, correct?
April 26, 20178 yr Author OK, so I managed to do everything I wanted to do, for the most part. I am generating Iron in large single veins. Now I would like to be able to tell the terrain generator to skip certain chunks and to not generate a resource type in every chunk, maybe more like one in every sixty-four chunks public class oreWorldGen implements IWorldGenerator { private WorldGenerator gen_iron; @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkprovider){ switch (world.provider.getDimension()){ case 0: //Overworld this.runGenerator(this.gen_iron, world, random, chunkX, chunkZ, 1, 10, 50); break; case -1: //nether break; case 1: //end break; } } public oreWorldGen(){ this.gen_iron = new WorldGenMinable(Blocks.IRON_ORE.getDefaultState(), 64); } private void runGenerator(WorldGenerator generator, World world, Random rand, int chunk_X, int chunk_Z, int chancesToSpawn, int minHeight, int maxHeight){ if (minHeight < 0 || maxHeight > 256 || minHeight > maxHeight) throw new IllegalArgumentException("Illegal Height Arguments for WorldGenerator"); int heightdiff = maxHeight - minHeight +1; for (int i=0; i<chancesToSpawn; i++){ int x =chunk_X * 16 +rand.nextInt(16); int y = minHeight + rand.nextInt(heightdiff); int z = chunk_Z * 16 + rand.nextInt(16); generator.generate(world, rand, new BlockPos(x, y, z)); } } } This is the code I have so far. Thoughts?
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.