jredfox
Members-
Posts
660 -
Joined
-
Last visited
Everything posted by jredfox
-
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; }
-
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; }
-
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?
-
why what does it do?
-
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);
-
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
-
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);
-
Got it working had to check both loaded and populated chunks. If loaded is null check dormant populated chunks
-
maybe equivalent but, mine will also grab the chunks he considers rarely happens so.
-
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
-
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
-
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?
-
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?
-
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));
-
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?
-
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
-
PopulateChunkEvent.Post Never Fires Every Chunk In Nether
jredfox replied to jredfox's topic in Modder Support
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... -
PopulateChunkEvent.Post Never Fires Every Chunk In Nether
jredfox replied to jredfox's topic in Modder Support
Ok thanks -
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
-
Look for block from entity in very large radius [256x256x256]
jredfox replied to MSpace-Dev's topic in Modder Support
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 -
PopulateChunkEvent.Post Never Fires Every Chunk In Nether
jredfox replied to jredfox's topic in Modder Support
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 -
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?
-
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; }
-
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
-
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?