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