winnetrie Posted March 17, 2018 Posted March 17, 2018 (edited) On my git i saw someone reporting a crash that happens only server sided: java.lang.NoSuchMethodError: net.minecraft.world.biome.Biome.func_185359_l()Ljava/lang/String; Is this maybe a clientside only method? The function is getBiomeName() What should i use instead? Edited March 17, 2018 by winnetrie Quote Try out my new Modpack for MC 1.15.2 https://www.curseforge.com/minecraft/modpacks/terran-civilization
winnetrie Posted March 17, 2018 Author Posted March 17, 2018 (edited) I have changed it to this: public void generateOverworld(World world, Random rand, int x, int z){ int XX = x * 16; int ZZ = z * 16; BlockPos pos = new BlockPos(XX, 70, ZZ); String biome = world.getBiome(pos).getRegistryName().toString().toLowerCase(); System.out.println("Trying to generate in: "+ biome); if (ConfigHandler.enable_limestone_gen == true) { if (biome.contains("river")) { generateOre(BlockInit.LIMESTONE.getDefaultState(), world, rand, 0, x, z, 25, 33, ConfigHandler.limestone_gen_chance * 2, 45, 65, BlockMatcher.forBlock(Blocks.STONE)); } if (biome.contains("ocean")) { generateOre(BlockInit.LIMESTONE.getDefaultState(), world, rand, 0, x, z, 15, 33, ConfigHandler.limestone_gen_chance, 10, 50, BlockMatcher.forBlock(Blocks.STONE)); } } if ((ConfigHandler.enable_marblestone_gen == true) && ((biome.contains("hills")) || (biome.contains("mountain")))) { generateOre(BlockInit.MARBLESTONE.getDefaultState(), world, rand, 0, x, z, 25, 33, ConfigHandler.marblestone_gen_chance, 65, 256, BlockMatcher.forBlock(Blocks.STONE)); } } Maybe not the best way. because the var biome contains also the mod id or in this case it has "minecraft:biomename" Edited March 17, 2018 by winnetrie Quote Try out my new Modpack for MC 1.15.2 https://www.curseforge.com/minecraft/modpacks/terran-civilization
winnetrie Posted March 17, 2018 Author Posted March 17, 2018 I added this line: biome = biome.replace("minecraft:", ""); Keeping this for now Quote Try out my new Modpack for MC 1.15.2 https://www.curseforge.com/minecraft/modpacks/terran-civilization
winnetrie Posted March 17, 2018 Author Posted March 17, 2018 3 minutes ago, diesieben07 said: You should be using BiomeDictionary instead of random string checks. Oh yes ofcourse i totally forgot about that! Quote Try out my new Modpack for MC 1.15.2 https://www.curseforge.com/minecraft/modpacks/terran-civilization
winnetrie Posted March 17, 2018 Author Posted March 17, 2018 I hope i'm doing this right. I changed the code and tested it. Everything is working fine. I even have a feeling it's working better (more accurately). public void generateOverworld(World world, Random rand, int x, int z){ int XX = x * 16; int ZZ = z * 16; BlockPos pos = new BlockPos(XX, 70, ZZ); Biome biome = world.getBiome(pos); if (ConfigHandler.enable_limestone_gen == true) { if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.RIVER)) { generateOre(BlockInit.LIMESTONE.getDefaultState(), world, rand, 0, x, z, 25, 33, ConfigHandler.limestone_gen_chance * 2, 45, 65, BlockMatcher.forBlock(Blocks.STONE)); } if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.OCEAN)) { generateOre(BlockInit.LIMESTONE.getDefaultState(), world, rand, 0, x, z, 15, 33, ConfigHandler.limestone_gen_chance, 10, 50, BlockMatcher.forBlock(Blocks.STONE)); } } if ((ConfigHandler.enable_marblestone_gen == true) && (BiomeDictionary.hasType(biome, BiomeDictionary.Type.HILLS)) || (BiomeDictionary.hasType(biome, BiomeDictionary.Type.MOUNTAIN))) { generateOre(BlockInit.MARBLESTONE.getDefaultState(), world, rand, 0, x, z, 25, 33, ConfigHandler.marblestone_gen_chance, 65, 256, BlockMatcher.forBlock(Blocks.STONE)); } } Please don't say this is wrong.....:-) Quote Try out my new Modpack for MC 1.15.2 https://www.curseforge.com/minecraft/modpacks/terran-civilization
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.