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

Hello, I made a structure for in my dimension but the lights of it aren't updated when it spawns, how can I fix this?

Code:

public class WorldGenCheeseHouse2 extends WorldGenerator {

private static final BlockStateMatcher IS_STONE = BlockStateMatcher.forBlock(CheeseBlocks.CHEESE_STONE);
private final ResourceLocation HOUSE = new ResourceLocation(Reference.MODID + ":cheese_house");

public boolean generate(World worldIn, Random rand, BlockPos position) {
	while (worldIn.isAirBlock(position) && position.getY() > 2) {
		position = position.down();
	}
	if (!IS_STONE.apply(worldIn.getBlockState(position))) {
		return false;
	}
        Random random = worldIn.getChunkFromChunkCoords(position.getX(), position.getZ()).getRandomWithSeed(987234911L);
        Rotation[] arotation = Rotation.values();
        Rotation rotation = arotation[random.nextInt(arotation.length)];
        ChunkPos chunkpos = new ChunkPos(position);
        StructureBoundingBox structureboundingbox = new StructureBoundingBox(chunkpos.getXStart() - 16, 0, chunkpos.getZStart() - 16, chunkpos.getXEnd() + 16, 256, chunkpos.getZEnd() + 16);
        PlacementSettings placementsettings = (new PlacementSettings()).setRotation(rotation).setBoundingBox(structureboundingbox).setRandom(random);
        MinecraftServer minecraftserver = worldIn.getMinecraftServer();
	TemplateManager templatemanager = worldIn.getSaveHandler().getStructureTemplateManager();
        Template template = templatemanager.getTemplate(minecraftserver, HOUSE);
        template.addBlocksToWorld(worldIn, position, placementsettings, 20);
	return true;
}

}

Image: https://i.gyazo.com/3a9a3f8df4d5c9dffebf815899a130bf.png

Classes: 94

Lines of code: 12173

Other files: 206

Github repo: https://github.com/KokkieBeer/DeGeweldigeMod

I'm not sure specifically about 1.11 but in previous versions you need to make sure that when you add the block to world that the lighting is updated. So you should check what your add block to world function is doing.

 

However, having lighting updated after every block placed can slow the generation of the structure, so maybe you should look for a way to update the chunk lighting once at the end of the structure generation.

 

 

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

I didnt get too deep into this but if the lights are spawned in the biome decoration they are fine if they are spawned earlier than that they wont update.

  • 4 weeks later...

world.markBlocksDirtyVertical(); //Wil have 6 int positions as parameters to define the area.

 

 

 

  • 2 weeks later...

Throw a tape deck turntable style at it while the record turns.

The pencils under the table and the lighter in the drawer.

 

-Spiders are funny  :P

 

-blue lighter is the color of the lighter btw. not white  8)

  • Author

Throw a tape deck turntable style at it while the record turns.

The pencils under the table and the lighter in the drawer.

 

-Spiders are funny  :P

 

-blue lighter is the color of the lighter btw. not white  8)

Thanks, now it works!

It didn't

 

Classes: 94

Lines of code: 12173

Other files: 206

Github repo: https://github.com/KokkieBeer/DeGeweldigeMod

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.