Jump to content

jredfox

Members
  • Posts

    660
  • Joined

  • Last visited

Everything posted by jredfox

  1. What about this it's seems simple and clean with it unloading the chunk from the world or whatever as soon as I fetch it then it will re-load it when necessary if tile entities are read and update properly because if it's dormant it will do it if it's not it won't public static Chunk getPopulatedChunk(World w, int x, int z,boolean dormant) { Chunk c = null; if(!dormant) w.getChunkProvider().getLoadedChunk(x, z); if(c == null) { long pos = ChunkPos.asLong(x, z); c = net.minecraftforge.common.ForgeChunkManager.fetchDormantChunk(pos, w); if(c == null) return null; c.onUnload();//if dormant chunk isn't null unload after fetching } if(c.isPopulated()) return c; else return null; }
  2. Well if I comment out the lines about getting using the method you don't like it turns into a blaze spawener again. So what's the issue it loads it into ram how do I unload it because I physically need to scan this or maybe I should be using player tick on server side? So what should I be unloading or should I let the game do that really confused right now because, if I don't use that method then it doesn't do it's job with the wither skele spawners https://github.com/jredfox/dungeontweeks public static Chunk getLoadedOrPopulatedChunk(World w, int x, int z) { Chunk c = w.getChunkProvider().getLoadedChunk(x, z); if(c == null) c = getPopulatedChunk(w,x,z,true); return c; } public static Chunk getPopulatedChunk(World w, int x, int z,boolean dormant) { Chunk c = null; if(!dormant) w.getChunkProvider().getLoadedChunk(x, z); if(c == null) { long pos = ChunkPos.asLong(x, z); c = net.minecraftforge.common.ForgeChunkManager.fetchDormantChunk(pos, w); if(c == null) return null; } if(c.isPopulated()) return c; else return null; }
  3. Ok how do I get an unloaded chunk without loading it into memory via the world? Then once I determine if it's populated then I should load it into the world temporary then at end of the method unload so it sync's?
  4. why what does it do?
  5. One last quest will using cause any breakage since I don't call chunk.load or populate? I only use it when the loaded chunk is null long pos = ChunkPos.asLong(x, z); c = net.minecraftforge.common.ForgeChunkManager.fetchDormantChunk(pos, w);
  6. Got this working scan chunks radius of 1 if loaded grab else grab dormant populated chunks. Now I just need to finish setting up what choonster said to identify what dungeon is what via entity id. And also setup tile entity properties for has scanned
  7. Question would calling this ever cause an index out of bounds exception if the chunk is not loaded? Chunk c = w.getChunkProvider().getLoadedChunk(x, z);
  8. Got it working had to check both loaded and populated chunks. If loaded is null check dormant populated chunks
  9. maybe equivalent but, mine will also grab the chunks he considers rarely happens so.
  10. Actually I could simply create my own method I found some codessss https://bukkit.org/threads/how-do-you-determine-if-a-chunk-has-been-loaded-and-populated.216667/ Chunk c = w.getChunkProvider().getLoadedChunk(x, z); if(c.isPopulated()) There is also forge fetch dormant chunk then I could check if it is populated already which should return true else do nothing
  11. https://github.com/jredfox/dungeontweeks Here I don't know the best way to scan for radius in chunks yet that won't cause forge to freak out
  12. public boolean isChunkGeneratedAt(int x, int z) { return this.isChunkLoaded(x, z, false) ? true : this.chunkProvider.isChunkGeneratedAt(x, z); } it's checking for both the is generated and is loaded. Forge is saying o no the chunks are loading before we expect them to. I was saying if I use reflection to call world.isChunkLoaded(x,z,false); instead of simply world.isChunkGeneratedAt(x,z) will it cause issues with the spawner I am scanning for not to show up sometimes?
  13. Well if I only can loaded chunks and scan for only generated will it cause any issues with the spawners or does it need those extra chunks?
  14. doesn't happen one only the default chunk was added the current chunk. if(w.isChunkGeneratedAt(x, z)); doesn't seem to be causing it the code causing it has to be chunks.add(w.getChunkFromChunkCoords(x, z));
  15. because when scanning for an already scanned chunk from my mod such as the blaze spawner going to an already loaded chunk scan radius of 1 to newer chunk and bam find the blaze spawner that is why I am scanning in the radius. yes loaded into ram My code specified only if chunk wasn't loaded to add it to the arraylist what is wrong with vanilla that simply doing that loads the chunk anyways?
  16. I actually saw loaded chunks in one of the classes so there is a way to determine that part. And I might have seen stuff with does exists on disk. I just need to know when chunks are written to disk one they are unloaded? So if it's not written to disk and if it's not loaded I should ignore that chunk. So vanilla keeps track of loaded chunks I might have to do some manual reflection method to determine if it exists on the disk if if not loaded or not on disk return null maybe then the messege would go away. Or would forge still be spamming that console if I loaded a chunk that was already to the disk. If I load a chunk is it forever loaded or does an entity/tile entity need to keep loading it? If so I am not worried about loading unloaded chunks that have been populated and exist on disk but, not loaded into memory
  17. Thanks for your work but, I had already replaced the vanilla dungeon I am working on supporting modded dungeons which in my definition is any dungeon that isn't the dungeon including the nether fortress. The scanning chunks I am still working on because, I want it working with essence of the gods AoA battle towers etc...
  18. I don't want an ify of only scan these chunks I want a radius that will get any loaded chunks already and maybe also ones that doe exists (on disk) but, are dormant
  19. you need to insert <= not < as I painted a radius of pixels around a middle pixel and it didn't work without the <= . So your not scanning the entire radius but, thanks for that equation couldn't think off the top of my head how this is done without 500 lines of code that will probably mess up
  20. ok is this also in 1.7 since I backport all mods once done in newest to 1.7 eventually till I revert the combat system Ok I did the chunk radius thing but, the issue described on the chunk radius form is manually loading chunks during a forge event that's loading chunks what method should I be using to get the chunks that haven't been populated yet? So yeah no blaze issue but, the issue now is it's recursively calling load chunk help? Seriously one thing after the other hopefully this is the last fix for a fix then I can actually verify overrides and start coding in the config system
  21. isn't solved I got this warning [17:32:12] [Server thread/WARN] [FML]: Dungeon Tweeks loaded a new chunk (-14, 6 Dimension: -1) during chunk population, causing cascading worldgen lag. Please report this to the mod's issue tracker. This log can be disabled in the Forge config. Also I noticed that this might not work with negitive chunks is this correct? What should I do instead math.abs then what?
  22. Would this make recursion I am trying to avoid it when trying to get chunk radius otherwise it would lag very bad seconds per chunk /** * Get chunks from center radius intention is to ignores chunks that haven't been populated yet? */ public static ArrayList<Chunk> getRadiusChunks(World w, int chunkPosX, int chunkPosZ,int radius) { ArrayList<Chunk> chunks = new ArrayList(); for (int x = chunkPosX - radius; x <= chunkPosX + radius; x++) { for (int z = chunkPosZ - radius; z <= chunkPosZ + radius; z++) { if(w.isChunkGeneratedAt(x, z)) chunks.add(w.getChunkFromChunkCoords(x, z)); } } return chunks; }
  23. radius is normally in circle style this is radius in mc style radius of 1. circle style has 4 points cube style has more then that depending on the radius xxx xyx xxx I am mostly confused on how to get chunks without creating them if it's null. I think I found the equation of getting radius in chunks though from this post. How does one get chunks and expect null if not loaded already so it doesn't become recursion and lag everything. I don't want to populate or generate it if it doesn't exist
  24. I got chunk x but, I need to get chunks in a cubed mc style radius around it how do I do this manually I can't think of a way?
×
×
  • Create New...

Important Information

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