Posted June 21, 201510 yr Hey guys, ive a problem: My worldgen doesn't generate anything... I registred the worldgen like that: I really don't know what I'm doing wrong... Can you please look at the source code and can say me whats wrong? Probably I set an invalid if parameter? Would be reeealy nice if you help me Thanks, have a nice day Legend GameRegistry.registerWorldGenerator(new WorldGeneratorProjectRedExtended(), 0); And here is the worldgenerator where i set how often the tree should be generated if (bgb == BiomeGenBase.jungle || bgb == BiomeGenBase.jungleHills) { for (int i = 0; i < 6; i++) { int x = chunkX * 16 + random.nextInt(16) + 8; int y = random.nextInt(128); int z = chunkZ * 16 + random.nextInt(16) + 8; (new WorldGenRubberTree()).generate(world, random, x, y, z); } } Here's the whole worldgen script: package de.xthelegend.projectredextended; import java.util.Random; import codechicken.lib.vec.Vector3; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; import de.xthelegend.projectredextended.lib.xawpnqf; import de.xthelegend.projectredextended.lib.nawapsk; public class WorldGenRubberTree extends WorldGenerator { public void putLeaves(World var1, int x, int y, int z) { Block var5 = var1.getBlock(x, y, z); var1.setBlock(x, y, z, MainClass.BlockRubberLeaves); } public boolean fillBlock(World var1, int x, int y, int z) { if (y >= 0 && y <= 126) { Block var5 = var1.getBlock(x, y, z); Block var6 = var5;/*Block.blocksList[var5];*/ if (var6 != null && var6.isWood(var1, x, y, z)) { return true; } else if (var6 != null && !var6.isLeaves(var1, x, y, z) && var5 != Blocks.tallgrass && var5 != Blocks.grass && var5 != Blocks.vine) { return false; } else { var1.setBlock(x, y, z, MainClass.BlockRubberWood); this.putLeaves(var1, x, y - 1, z); this.putLeaves(var1, x, y + 1, z); this.putLeaves(var1, x, y, z - 1); this.putLeaves(var1, x, y, z + 1); this.putLeaves(var1, x - 1, y, z); this.putLeaves(var1, x + 1, y, z); return true; } } else { return false; } } @Override public boolean generate(World var1, Random x, int y, int z, int var5) { int var9 = x.nextInt(6) + 25; if (z >= 1 && z + var9 + 2 <= var1.getHeight()) { Block var6; int var7; int var8; for (var7 = -1; var7 <= 1; ++var7) { for (var8 = -1; var8 <= 1; ++var8) { var6 = var1.getBlock(y + var7, z - 1, var5 + var8); if (var6 != Blocks.grass && var6 != Blocks.dirt) { return false; } } } byte var10 = 1; int var11; for (var11 = z; var11 < z + var9; ++var11) { if (var11 > z + 3) { var10 = 5; } for (var7 = y - var10; var7 <= y + var10; ++var7) { for (var8 = var5 - var10; var8 <= var5 + var10; ++var8) { var6 = var1.getBlock(var7, var11, var8); Block var12 = var6; /*Block.blocksList[var6];*/ if (var12 != null && !var12.isLeaves(var1, var7, var11, var8) && !var12.isWood(var1, var7, var11, var8) && var6 != Blocks.tallgrass && var6 != Blocks.grass && var6 != Blocks.vine) { return false; } } } } for (var7 = -1; var7 <= 1; ++var7) { for (var8 = -1; var8 <= 1; ++var8) { var1.setBlock(y + var7, z - 1, var5 + var8, Blocks.dirt); } } for (var11 = 0; var11 <= 6; ++var11) { for (var7 = -1; var7 <= 1; ++var7) { for (var8 = -1; var8 <= 1; ++var8) { var1.setBlock(y + var7, z + var11, var5 + var8, MainClass.BlockRubberWood); } } for (var7 = -1; var7 <= 1; ++var7) { if (x.nextInt(5) == 1 && var1.getBlock(y + var7, z + var11, var5 - 2) == Blocks.air) { var1.setBlock(y + var7, z + var11, var5 - 2, Blocks.vine); var1.setBlockMetadataWithNotify(y + var7, z + var11, var5 - 2, 1, 0); } if (x.nextInt(5) == 1 && var1.getBlock(y + var7, z + var11, var5 + 2) == Blocks.air) { var1.setBlock(y + var7, z + var11, var5 + 2, Blocks.vine); var1.setBlockMetadataWithNotify(y + var7, z + var11, var5 + 2, 4, 0); } } for (var8 = -1; var8 <= 1; ++var8) { if (x.nextInt(5) == 1 && var1.getBlock(y - 2, z + var11, var5 + var8) == Blocks.air) { var1.setBlock(y - 2, z + var11, var5 + var8, Blocks.vine); var1.setBlockMetadataWithNotify(y - 2, z + var11, var5 + var8, 8, 0); } if (x.nextInt(5) == 1 && var1.getBlock(y + 2, z + var11, var5 + var8) == Blocks.air) { var1.setBlock(y + 2, z + var11, var5 + var8, Blocks.vine); var1.setBlockMetadataWithNotify(y + 2, z + var11, var5 + var8, 2, 0); } } } Vector3 x3 = new Vector3(); Vector3 x4 = new Vector3(); int var14 = x.nextInt(100) + 10; int var17 = 0; while (var17 < var14) { x4.set((double)x.nextFloat() - 0.5D, (double)x.nextFloat(), (double)x.nextFloat() - 0.5D); x4.normalize(); double var18 = ((double)var14 / 10.0D + 4.0D) * (double)(1.0F + 1.0F * x.nextFloat()); x4.x *= var18; x4.z *= var18; x4.y = x4.y * (double)(var9 - 15) + (double)var14 / 10.0D; if (var14 < { switch (var14) { case 0: x3.set((double)(y - 1), (double)(z + 6), (double)(var5 - 1)); break; case 1: x3.set((double)(y - 1), (double)(z + 6), (double)var5); break; case 2: x3.set((double)(y - 1), (double)(z + 6), (double)(var5 + 1)); break; case 3: x3.set((double)y, (double)(z + 6), (double)(var5 + 1)); break; case 4: x3.set((double)(y + 1), (double)(z + 6), (double)(var5 + 1)); break; case 5: x3.set((double)(y + 1), (double)(z + 6), (double)var5); break; case 6: x3.set((double)(y + 1), (double)(z + 6), (double)(var5 - 1)); break; default: x3.set((double)y, (double)(z + 6), (double)(var5 - 1)); } } else { x3.set((double)(y + x.nextInt(3) - 1), (double)(z + 6), (double)(var5 + x.nextInt(3) - 1)); } long x0 = x.nextLong(); nawapsk var13 = new nawapsk(x3, x4, x0); while (true) { if (var13.iterate()) { Vector3 x2 = var13.get(); if (this.fillBlock(var1, (int)Math.floor(x2.x), (int)Math.floor(x2.y), (int)Math.floor(x2.z))) { continue; } } ++var17; break; } } return true; } else { return false; } } } Would be really nice if you help me .. im hanging since 5 hours and I dont find a solution
June 21, 201510 yr 1) Post code in code blocks ([ code]code here[ /code] (without spaces)) 2) Wherer&how did you register it? Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
June 21, 201510 yr Author if (bgb == BiomeGenBase.jungle || bgb == BiomeGenBase.jungleHills) { for (int i = 0; i < 6; i++) { int x = chunkX * 16 + random.nextInt(16) + 8; int y = random.nextInt(128); int z = chunkZ * 16 + random.nextInt(16) + 8; (new WorldGenRubberTree()).generate(world, random, x, y, z); } } and in the main class : public static WorldGenerator WorldGeneratorProjectRedExtended; and in the Init part : GameRegistry.registerWorldGenerator(new WorldGeneratorProjectRedExtended(), 0); , so i think it should work youve another idea?
June 21, 201510 yr Check if the actuall block placing method is getting called (console)... Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
June 21, 201510 yr Author no, I dont get any method... it just stays: [20:23:19] [Client thread/INFO]: [CHAT] Player903 has just earned the achievement [Taking Inventory] [20:25:53] [Client thread/INFO]: [CHAT] Saved screenshot as 2015-06-21_20.25.52.png Is it the sapling or the worldgen? Could you probably check the code for mistakes? Would be really nice from you Have a nice day, ~Santa
June 23, 201510 yr Author ok, I did it ... Do you think its acceptable now ? http://minecraftforge.net/forum/Smileys/default/undecided.gif
June 24, 201510 yr Can you post the whole WorldGeneratorProjectRedExtended class, because the code snippets you gave don't give any relevant information on function calls.
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.