Jump to content

MajikalExplosions

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by MajikalExplosions

  1. Here it is: https://github.com/MajikalExplosions/ruins/tree/bambiraptor
  2. Hi, I'm still not quite sure how to solve this problem. Help?
  3. Hi! I'm generating it from a WorldGenerator class, so I'm assuming it's after lighting calculations. My only problem is I'm not sure how to move it to before.
  4. Hi! I'm back. This time it's because of lag again. The game is playable, but really slow. What I'm doing right now is loading templates from .nbt files and then placing them in the world from a worldgenerator. The only problem is that doing so makes world generation around 10 times slower than vanilla Minecraft. My structures are basically houses (they have roofs, glass, doors, and all that). I spawn one house per chunk, which means there are a *lot* of houses and I'm guessing that this is what causes the lag. I have already experimented with this for hours and what I have found (I think) is that having lighting sources slow down world generation. When I remove my sea lanterns, world generation speeds up to around 50-75% of vanilla terrain generation. However, it's still really laggy in-game and the game has to consistently skip ticks in order to catch up. I'm guessing that this in-game lag (and previously world generation before I removed the sea lanterns) is because of the lighting recalculations. Every time I add a template, the game has to recalculate lighting for that chunk (and possibly other chunks as well) because of the roof and "underground areas" underneath them. I have attached a debug profile from without the sea lanterns. I would like to have the sea lanterns back and without lag. I'm okay with removing the skylight if necessary as long as the lag goes away, but I'm not sure how to do that (if I even need to). Let me know if you need any more information. Thanks! profile-results-2019-02-11_09.03.51.txt
  5. Hi, The x and z are chunk coordinates. Also - I was able to solve the problem. I just moved everything to a worldgenerator (which I should have done already). Thanks for the help!
  6. Yes, I have. It's what I meant by "I've tried that before, but it still doesn't work." I found a workaround that does practically the same thing yesterday, so I guess I should mark this as solved. Thank you for trying to help me regardless.
  7. Hi! I have already seen that article on Reddit, but I'm not sure how I should go about carrying out the solution. The Reddit post says: However, I don't know how to add the offset. Do I just rewrite the code to generate buildingGenerator.getBuilding(x, z).addBlocksToWorldChunk(world, new BlockPos(x * 16 - 8, BUILDING_Y_VALUE, z * 16 - 8), ps);//buildingGenerator.getBuilding(x, z) returns an object of class Template that is read from a .nbt file created by a structure block. I've tried that before, but it still doesn't work. It still prints the error, and behaves just like how it was without the change. Hints, maybe? Thank you for taking your time to help me. P.S.: Here's the error in case it helps: [Server thread/WARN] [FML]: Tutorial Dimension loaded a new chunk [33, 20] in dimension 0 (overworld) while populating chunk [35, 22], causing cascading worldgen lag.
  8. Hi! I'm new to MC modding, so I'm not too sure whether the format of this post is correct or not - if it isn't, please let me know how to change it in the future. I'm working on a mod that generates one structure (16*y*16, y is anywhere between 4 and 32) in every chunk(it's supposed to completely fill the chunk on the surface from 0,0 to 16,16), which is why it's 16 blocks wide and 16 blocks long). The structures are in .nbt files that load like they're supposed to and show up in-game - sometimes. However, the structures aren't showing up in every chunk; rather, they show up only close to the chunk 0, 0 and are randomly scattered all over. When I teleport myself over, it says that my mod is causing "cascading worldgen" issues. I'm pretty sure it's because my structures aren't spawning in the chunks like they're supposed to and instead are overlapping into other chunks. My problem is that I don't know why this happens and how to fix it. Below is the code snippet from my ChunkGenerator class (yes, it implements IChunkGenerator). I overrode the generateStructures function and added my own code. I am aware that this is probably a terrible way to do this (it's probably in the wrong function and class), but I'm not sure how to make it better. Can I have some advice? @Override public boolean generateStructures(Chunk chunkIn, int x, int z) {//chunkIn isn't used. PlacementSettings ps = new PlacementSettings().setRotation(BuildingGenerator.getRotation(x, z));//getRotation returns a random Rotation (EX Rotation.NONE, Rotation.CLOCKWISE_90) buildingGenerator.getBuilding(x, z).addBlocksToWorldChunk(world, new BlockPos(x * 16, BUILDING_Y_VALUE, z * 16), ps);//buildingGenerator.getBuilding(x, z) returns an object of class Template that is read from a .nbt file created by a structure block. return false;//It crashes when I return true...? I'm not sure why. } If you need more clarification, I can always provide more information. The crash log is attached. Thanks in advance!
×
×
  • Create New...

Important Information

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