Jump to content

[1.10.2]Generation


Mightydanp

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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());

}

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.