Posted September 1, 20169 yr I made a generation class for my twigs.I based it off the WorldGenCactus, but for some reason it still will not work. By that I mean that when i create a new world it gives me a error at net.minecraft.world.World.getChunkFromChunkCoords(World.java:349) ~[World.class:?] at net.minecraft.world.World.getChunkFromBlockCoords(World.java:341) ~[World.class:?] at net.minecraft.world.World.getBlockState(World.java:911) ~[World.class:?] at net.minecraft.world.World.isAirBlock(World.java:266) ~[World.class:?] at com.mightydanp.eot.api.common.world.gen.feature.IWorldGenTwigs.generate(IWorldGenTwigs.java:19) ~[iWorldGenTwigs.class:?] at com.mightydanp.eot.api.common.world.gen.IWorldGen.spawnTwigs(IWorldGen.java:58) ~[iWorldGen.class:?] at com.mightydanp.eot.common.world.gen.WorldGen.generateSurface(WorldGen.java:51) ~[WorldGen.class:?] at com.mightydanp.eot.api.common.world.gen.IWorldGen.generate(IWorldGen.java:29) ~[iWorldGen.class:?] at net.minecraftforge.fml.common.registry.GameRegistry.generateWorld(GameRegistry.java:120) ~[GameRegistry.class:?] at net.minecraft.world.chunk.Chunk.populateChunk(Chunk.java:1070) ~[Chunk.class:?] at net.minecraft.world.chunk.Chunk.populateChunk(Chunk.java:1033) ~[Chunk.class:?] at net.minecraft.world.gen.ChunkProviderServer.provideChunk(ChunkProviderServer.java:160) ~[ChunkProviderServer.class:?] i also get a crash log java.lang.StackOverflowError: Exception in server tick loop at net.minecraft.world.World.notifyBlockOfStateChange(World.java:586) at net.minecraft.world.World.notifyNeighborsOfStateChange(World.java:532) at net.minecraft.world.World.notifyNeighborsRespectDebug(World.java:480) at net.minecraft.world.World.markAndNotifyBlock(World.java:419) at net.minecraft.world.World.setBlockState(World.java:400) at net.minecraft.block.BlockDynamicLiquid.tryFlowInto(BlockDynamicLiquid.java:173) at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:152) at net.minecraft.world.WorldServer.updateBlockTick(WorldServer.java:574) at net.minecraft.world.WorldServer.scheduleUpdate(WorldServer.java:548) at net.minecraft.block.BlockDynamicLiquid.onBlockAdded(BlockDynamicLiquid.java:295) This is my generation class http://pastebin.com/E6RCSu25 Here is the block class for it http://pastebin.com/fCzuzC9X
September 1, 20169 yr Do not extend WorldGenerator directly. Instead, have your class implement IWorldGenerator. You can also seriously improve your method of finding a block-position. Is the twigs supposed to spawn up top, like trees, or can they also spawn in caves? If they only spawn with a clear view of the sky, you can use world#getTopSolidOrLiquidBlock(pos) . You can give it any valid block-pos, and it will ignore the y, and scan from the top of the world, down, for you. I make use of several IWorldGenerators here. Do note, I use a custom WorldProvider, ChunkProvider, etc. Ignore the parts of the code referencing those. 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.
September 1, 20169 yr Author I am having a bit of trouble getting it to spawn. I used your code as reference and couldn't get it to spawn. http://pastebin.com/GzH0WhX9
September 2, 20169 yr Author i am calling it in my core file that handles everything in the FMLInitializationEvent GameRegistry.registerWorldGenerator(new WorldGenTwigs(), 1);
September 2, 20169 yr Author Apperently the generation is not being called. i put in a .logInfoMessage(....... so that i could see if its being called and when i created a new world it didnt display it at all in the console.
September 2, 20169 yr Author in here if (world.isAirBlock(new BlockPos(posX + offset(8, random), posY, posZ + offset(8, random))) && (!world.provider.getHasNoSky() || pos.getY() < 255) && Blocks.WATERLILY.canPlaceBlockAt(world, new BlockPos(posX, posY, posZ))) { EoTLogger.logInfoMessage(Reference.MODID + ":" + "Generating Twigs."); world.setBlockState(pos, ModBlocks.twigs.getDefaultState()); }
September 3, 20169 yr Author The Generation is being called now but i cannot seem to find any of it on the surface.
September 3, 20169 yr Author apparently they are generating in the sky. When i teleport to one its not there. [server thread/INFO] [eot]: eot:Generating Twigs: X:-276 Y:256 Z:-637 http://pastebin.com/VfGkyY3A
September 3, 20169 yr apparently they are generating in the sky. When i teleport to one its not there. [server thread/INFO] [eot]: eot:Generating Twigs: X:-276 Y:256 Z:-637 http://pastebin.com/VfGkyY3A That might have something to do with this line. int posY = (world.getActualHeight()); 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.
September 3, 20169 yr Author i am having one problem. I am using BlockPos getY = new BlockPos(posX + offset(8, random), 0, posZ + offset(8, random)); int posY = (world.getTopSolidOrLiquidBlock(getY).getY()); sometimes the block will generate a block above the block its sepost to spawn on, and sometimes it will be up in the sky.
September 3, 20169 yr i am having one problem. I am using BlockPos getY = new BlockPos(posX + offset(8, random), 0, posZ + offset(8, random)); int posY = (world.getTopSolidOrLiquidBlock(getY).getY()); sometimes the block will generate a block above the block its sepost to spawn on. Use world.getSeaLevel() if it is supposed to spawn on water. 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.
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.