Posted December 3, 20168 yr 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
December 4, 20168 yr Author Does it have something to do with template.addBlocksToWorld(worldIn, position, placementsettings, 20);? Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
December 5, 20168 yr Author bump Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
December 6, 20168 yr Author please? Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
December 7, 20168 yr 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/
December 9, 20168 yr 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.
January 5, 20178 yr Author They are sometimes updated, sometimes not, didn't see patterns for rotation... Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
January 6, 20178 yr Author How can i update the lights of the chunk? Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
January 7, 20178 yr Author bump Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
January 9, 20178 yr Author bump Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
January 9, 20178 yr Author How can I do that? Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
January 9, 20178 yr world.markBlocksDirtyVertical(); //Wil have 6 int positions as parameters to define the area.
January 9, 20178 yr Author Doesn't work as well Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
January 9, 20178 yr Author I also tried world.markChunkDirty or something like that but that didn't work Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
January 14, 20178 yr Author Bump Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
January 14, 20178 yr Author This is not only happening for the structure, also lava light isn't updated, and from my village the lights aren't either... Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
January 15, 20178 yr Author bump Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
January 15, 20178 yr Author 20 is used in vanilla as well... Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
January 15, 20178 yr Author But what about all the other lights not updating in my dimension/biome Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
January 16, 20178 yr Author In my biome all the other lights (lava, other structures etc.) are also not loading (when they are first loaded)... Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
January 27, 20178 yr Author Bump Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
January 30, 20178 yr Author Guess noone knows what to do? Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
January 30, 20178 yr 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 -blue lighter is the color of the lighter btw. not white
January 30, 20178 yr 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 -blue lighter is the color of the lighter btw. not white 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.