Arionas_MC Posted July 18, 2017 Posted July 18, 2017 Hello guys! I am currently coding a mod with a lot of new biomes, but I cannot find them! I register every biome like this: @EventHandler public void preInit(FMLPreInitializationEvent event) { BiomeDictionary.registerBiomeType(exampleForest, Type.FOREST); BiomeManager.addSpawnBiome(exampleForest); } Do I register them correctly? (I am using MinecraftForge 1.8-11.14.2.1427) Quote
Jacky2611 Posted July 18, 2017 Posted July 18, 2017 That brings back memories... I used BiomeManager.addBiome() in 1.8 I THINK that addSpawnBiome only means that it is possible that the world spawn is inside the specified Biome. 1 Quote Here could be your advertisement!
Arionas_MC Posted July 18, 2017 Author Posted July 18, 2017 On 7/18/2017 at 3:19 PM, Jacky2611 said: That brings back memories... I used BiomeManager.addBiome() in 1.8 I THINK that addSpawnBiome only means that it is possible that the world spawn is inside the specified Biome. Expand Is there any way to see if my biome has been spawned? Quote
Jacky2611 Posted July 18, 2017 Posted July 18, 2017 (edited) You could try to use this: https://takahikokawasaki.github.io/minecraft-resources/javadoc/forge/1.8-11.14.1.1320/net/minecraftforge/event/terraingen/package-summary.html Or just use BiomeProvider findBiomePosition. silly me Edited July 18, 2017 by Jacky2611 1 Quote Here could be your advertisement!
Arionas_MC Posted July 18, 2017 Author Posted July 18, 2017 On 7/18/2017 at 3:28 PM, Jacky2611 said: You could try to use this: https://takahikokawasaki.github.io/minecraft-resources/javadoc/forge/1.8-11.14.1.1320/net/minecraftforge/event/terraingen/package-summary.html Or just use BiomeProvider findBiomePosition. silly me Expand I cannot find any 'BiomeProvider' class... Quote
Jacky2611 Posted July 18, 2017 Posted July 18, 2017 Ähm, give me a moment. I am digging through my old code. Could you try to look inside the WorldChunkManager? 1 Quote Here could be your advertisement!
Jacky2611 Posted July 18, 2017 Posted July 18, 2017 It might be WorldChunkManager.a(int i, int j, int k, List<Biome> list, Random random) BiomeProvider might be a renamed WorldChunkManager in 1.9. 1 Quote Here could be your advertisement!
Arionas_MC Posted July 18, 2017 Author Posted July 18, 2017 On 7/18/2017 at 3:45 PM, Jacky2611 said: It might be WorldChunkManager.a(int i, int j, int k, List<Biome> list, Random random) BiomeProvider might be a renamed WorldChunkManager in 1.9. Expand Hey, whenever I register my biome with BiomeManager.addBiome, the Minecraft world doesn't start! Quote
Jacky2611 Posted July 18, 2017 Posted July 18, 2017 log? And hey, crashes are definitely better than nothing. And show us your current code. 1 Quote Here could be your advertisement!
Arionas_MC Posted July 18, 2017 Author Posted July 18, 2017 When I start a new world with that line of code it prints this: [18:53:16] [Server thread/INFO]: Starting integrated minecraft server version 1.8 [18:53:16] [Server thread/INFO]: Generating keypair [18:53:16] [Server thread/INFO]: Converting map! [18:53:16] [Server thread/INFO]: Scanning folders... [18:53:16] [Server thread/INFO]: Total conversion count is 0 [18:53:16] [Server thread/INFO] [FML]: Injecting existing block and item data into this server instance [18:53:16] [Server thread/INFO] [FML]: Applying holder lookups [18:53:16] [Server thread/INFO] [FML]: Holder lookups applied [18:53:16] [Server thread/INFO] [FML]: Loading dimension 0 (New World2) (net.minecraft.server.integrated.IntegratedServer@2bd0b9f) [18:53:17] [Server thread/INFO] [FML]: Loading dimension 1 (New World2) (net.minecraft.server.integrated.IntegratedServer@2bd0b9f) [18:53:17] [Server thread/INFO] [FML]: Loading dimension -1 (New World2) (net.minecraft.server.integrated.IntegratedServer@2bd0b9f) [18:53:17] [Server thread/INFO]: Preparing start region for level 0 [18:53:18] [Server thread/INFO]: Preparing spawn area: 6% [18:53:19] [Server thread/INFO]: Preparing spawn area: 10% [18:53:20] [Server thread/INFO]: Preparing spawn area: 14% [18:53:21] [Server thread/INFO]: Preparing spawn area: 20% [18:53:22] [Server thread/INFO]: Preparing spawn area: 27% [18:53:23] [Server thread/INFO]: Preparing spawn area: 35% [18:53:24] [Server thread/INFO]: Preparing spawn area: 44% [18:53:25] [Server thread/INFO]: Preparing spawn area: 54% [18:53:26] [Server thread/INFO]: Preparing spawn area: 64% [18:53:27] [Server thread/INFO]: Preparing spawn area: 75% And it stops at 75% My Code: Biome Class: Reveal hidden contents public class BiomeGenWoods extends BiomeGenBase { public BiomeGenWoods(int par1) { super(par1); this.spawnableCreatureList.clear(); this.topBlock = Blocks.grass.getDefaultState(); this.fillerBlock = Blocks.dirt.getDefaultState(); this.spawnableCreatureList.clear(); this.spawnableMonsterList.clear(); this.spawnableWaterCreatureList.clear(); this.setHeight(height_LowPlains); } @Override public void decorate(World par1World, Random par2Random, BlockPos pos) { super.decorate(par1World, par2Random, pos); for(int i = 0; i < par2Random.nextInt(30); i++) { int x = par2Random.nextInt(16) + 8; int z = par2Random.nextInt(16) + 8; int y = par2Random.nextInt(par1World.getHorizon(pos.add(x, 0, z)).getY() + 32); WorldGenDiamondTree worldGenDiamondTree = new WorldGenDiamondTree(); worldGenDiamondTree.generate(par1World, par2Random, pos.add(x,y,z)); } } } Diamond Tree Class: Reveal hidden contents public class WorldGenDiamondTree extends WorldGenerator{ int height; IBlockState wood = Blocks.diamond_block.getDefaultState(); IBlockState leaf = Blocks.emerald_block.getDefaultState(); public boolean generate(World world, Random random, BlockPos pos) { while (world.isAirBlock(pos.down()) && pos.getY() > 55) { pos.subtract(new Vec3i(0, 1, 0)); } if (!world.isAirBlock(pos)) return false; height = 5 + random.nextInt(5); for (int i = 0; i < height; i++) { world.setBlockState(pos.up(i), wood); } int top = 1 + random.nextInt(3); int left = 2 + random.nextInt(3); int right = 2 + random.nextInt(3); int front = 2 + random.nextInt(3); int back = 2 + random.nextInt(3); for (int i = 0; i < top; i++) { setBlock(world, pos.getX(), pos.getY() + i, pos.getZ(), wood); if (i > 0) { setBlock(world, pos.getX() + 1, pos.getY() + i, pos.getZ(), leaf); setBlock(world, pos.getX() - 1, pos.getY() + i, pos.getZ(), leaf); setBlock(world, pos.getX(), pos.getY() + i, pos.getZ() + 1, leaf); setBlock(world, pos.getX(), pos.getY() + i, pos.getZ() - 1, leaf); setBlock(world, pos.getX(), pos.getY() + i + 1, pos.getZ(), leaf); } } for (int i = 0; i < left; i++) { setBlock(world, pos.getX() + i, pos.getY(), pos.getZ(), wood); setBlock(world, pos.getX() + i, pos.getY() + 1, pos.getZ(), leaf); if (i > 0) { setBlock(world, pos.getX() + i, pos.getY(), pos.getZ() + 1, leaf); setBlock(world, pos.getX() + i, pos.getY(), pos.getZ() - 1, leaf); } } for (int i = 0; i < right; i++) { setBlock(world, pos.getX() - i, pos.getY(), pos.getZ(), wood); setBlock(world, pos.getX() - i, pos.getY() + 1, pos.getZ(), leaf); if (i > 0) { setBlock(world, pos.getX() - i, pos.getY(), pos.getZ() + 1, leaf); setBlock(world, pos.getX() - i, pos.getY(), pos.getZ() - 1, leaf); } } for (int i = 0; i < front; i++) { setBlock(world, pos.getX(), pos.getY(), pos.getZ() + i, wood); setBlock(world, pos.getX(), pos.getY() + 1, pos.getZ() + i, leaf); if (i > 0) { setBlock(world, pos.getX() - 1, pos.getY(), pos.getZ() + i, leaf); setBlock(world, pos.getX() + 1, pos.getY(), pos.getZ() + i, leaf); } } for (int i = 0; i < back; i++) { setBlock(world, pos.getX(), pos.getY(), pos.getZ() - i, wood); setBlock(world, pos.getX(), pos.getY() + 1, pos.getZ() - i, leaf); if (i > 0) { setBlock(world, pos.getX() - 1, pos.getY(), pos.getZ() - i, leaf); setBlock(world, pos.getX() + 1, pos.getY(), pos.getZ() - i, leaf); } } setBlock(world, pos.getX() + left, pos.getY(), pos.getZ(), leaf); setBlock(world, pos.getX() - right, pos.getY(), pos.getZ(), leaf); setBlock(world, pos.getX(), pos.getY(), pos.getZ() + front, leaf); setBlock(world, pos.getX(), pos.getY(), pos.getZ() - back, leaf); return true; } public void setBlock(World world, int x, int y, int z, IBlockState block) { world.setBlockState(new BlockPos(x, y + height, z), block); } } Main Class(register code): Reveal hidden contents public static BiomeGenBase diamondWoods = new BiomeGenWoods(52).setBiomeName("DiamondWoods"); @EventHandler public void preInit(FMLPreInitializationEvent event) { // BiomeDictionary.registerBiomeType(diamondWoods, Type.FOREST); // BiomeManager.addSpawnBiome(diamondWoods); BiomeManager.addBiome(BiomeType.COOL, new BiomeEntry(diamondWoods, 10)); } Quote
Animefan8888 Posted July 18, 2017 Posted July 18, 2017 On 7/18/2017 at 3:58 PM, Arionas_MC said: When I start a new world with that line of code it prints this: Expand Good news your Biome is generating. Bad news you are generating to many trees. On 7/18/2017 at 3:58 PM, Arionas_MC said: for(int i = 0; i < par2Random.nextInt(30); i++) { Expand 30 possible trees per chunk is a little to much. 1 Quote VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
Arionas_MC Posted July 18, 2017 Author Posted July 18, 2017 On 7/18/2017 at 4:01 PM, Animefan8888 said: Good news your Biome is generating. Bad news you are generating to many trees. 30 possible trees per chunk is a little to much. Expand Thanks, the world starts now! But I cannot find my biome again! Quote
Animefan8888 Posted July 18, 2017 Posted July 18, 2017 On 7/18/2017 at 4:04 PM, Arionas_MC said: Thanks, the world starts now! But I cannot find my biome again! Expand In your decorate method print out the BlockPos argument to find the position. Quote VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
Arionas_MC Posted July 18, 2017 Author Posted July 18, 2017 On 7/18/2017 at 4:06 PM, Animefan8888 said: In your decorate method print out the BlockPos argument to find the position. Expand When does it print the position? Quote
Animefan8888 Posted July 18, 2017 Posted July 18, 2017 On 7/18/2017 at 4:10 PM, Arionas_MC said: When does it print the position? Expand What do you mean? If you do System.out.println(pos) it will print out the BlockPos and you will have coordinates for where your Biome is being decorated. Quote VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
Jacky2611 Posted July 18, 2017 Posted July 18, 2017 (edited) It will print the position whenever your biome get decorated. However, that would require your biome to be generated first. I would instead somehow (e.g. on item right click) run WorldChunkManager.a(int i, int j, int k, List<Biome> list, Random random) and print the result. If this really is the findBiome function it should work even if your biome hasn't been generated yet. Just make sure that the range is big enough. Edited July 18, 2017 by Jacky2611 1 Quote Here could be your advertisement!
Arionas_MC Posted July 18, 2017 Author Posted July 18, 2017 On 7/18/2017 at 4:11 PM, Animefan8888 said: What do you mean? If you do System.out.println(pos) it will print out the BlockPos and you will have coordinates for where your Biome is being decorated. Expand Well after 5 minutes of exploring the world, it printed the position but Minecraft stopped responding! Quote
Animefan8888 Posted July 18, 2017 Posted July 18, 2017 On 7/18/2017 at 4:13 PM, Arionas_MC said: Well after 5 minutes of exploring the world, it printed the position but Minecraft stopped responding! Expand Post your Biome code again. Quote VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
Jacky2611 Posted July 18, 2017 Posted July 18, 2017 (edited) Your biome might still be taking up too many resources. How much power does your device have and how much are you generating? Can you give us a github link? Edited July 18, 2017 by Jacky2611 1 Quote Here could be your advertisement!
Arionas_MC Posted July 18, 2017 Author Posted July 18, 2017 On 7/18/2017 at 4:14 PM, Animefan8888 said: Post your Biome code again. Expand I changed the number of trees which are being generated from random.nextInt(30) to random.nextInt(7)+1 Quote
Jacky2611 Posted July 18, 2017 Posted July 18, 2017 Do you have your project on github? Would make it a lot easier to have a look at it. 1 Quote Here could be your advertisement!
Arionas_MC Posted July 18, 2017 Author Posted July 18, 2017 On 7/18/2017 at 4:15 PM, Jacky2611 said: Your biome might still be taking up too many resources. How much power does your device have and how much are you generating? Expand [19:14:25] [Client thread/INFO] [STDOUT]: [net.minecraftforge.fml.client.SplashProgress:start:235]: ---- Minecraft Crash Report ---- // I let you down. Sorry :( Time: 7/18/17 7:14 PM Description: Loading screen debug info This is just a prompt for computer specs to be printed. THIS IS NOT A ERROR A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.8 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.8.0_77, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 719523512 bytes (686 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: Loaded coremods (and transformers): GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 361.43' Renderer: 'GeForce GTS 450/PCIe/SSE2' Quote
Arionas_MC Posted July 18, 2017 Author Posted July 18, 2017 On 7/18/2017 at 4:17 PM, Jacky2611 said: Do you have your project on github? Would make it a lot easier to have a look at it. Expand No sorry Quote
Animefan8888 Posted July 18, 2017 Posted July 18, 2017 (edited) On 7/18/2017 at 4:17 PM, Arionas_MC said: I changed the number of trees which are being generated from random.nextInt(30) to random.nextInt(7)+1 Expand How big are your trees? If they are near vanilla size you shouldn't be generating much more than 3-4 per chunk, also there is Runaway Chunk Generation. Which is a huge problem in world gen. If your generation passes over into another chunk then that chunk will be forced to generate and so on and so forth if it is your Biome it will call your decorate method and lead to more chunks being loaded. Edit: You will want to apply an offset to your generation so it doesn't load other chunks. Edited July 18, 2017 by Animefan8888 Quote VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
Arionas_MC Posted July 18, 2017 Author Posted July 18, 2017 On 7/18/2017 at 4:21 PM, Animefan8888 said: How big are your trees? If they are near vanilla size you shouldn't be generating much more than 3-4 per chunk, also there is Runaway Chunk Generation. Which is a huge problem in world gen. If your generation passes over into another chunk then that chunk will be forced to generate and so on and so forth if it is your Biome it will call your decorate method and lead to more chunks being loaded. Expand Their height is 5+random.nextInt(5) Quote
Recommended Posts
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.