Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

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.

  • Author

i am calling it in my core file that handles everything in the FMLInitializationEvent

        GameRegistry.registerWorldGenerator(new WorldGenTwigs(), 1);

 

  • 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.

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

}

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.

  • 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.

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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.