Jump to content

jredfox

Members
  • Posts

    660
  • Joined

  • Last visited

Everything posted by jredfox

  1. Ok I think I know how I am going to do things now there is no current way without bugs to create such dynamic support without a forge update forcing people with tile entities to have tag called scanned boolean true/false 0 1 on the disk. Edit: I could asm the tile entity class to have such a variable for read and write would this be a better solution "dungeontweeksScanned:0" either way it will have a detection system for mods. Edit Edit: I need to use detection nbt for has detected true/false write and readfromNBT() for mod support I will be updating the core mod for asm utils to implement this because if mod user defines squirrel spawner as nbt and in their list has squirrel for chance to be default then it will get overridden via the next chunk has tile entity so yeah going to need that scanning boolean. My other options are writing and loading every single pos and never deleting them which is a terrible idea of doing it So I am going to replace vanilla worldgen but, in order to remain dynamic my thing is going to scan on the event for x entity id if entity id is minecraft:blank_dugenonName or any other defined dungeon override it by scanning radius of 1 that way stuff like battle towers could add support for my mod by simply if my mod exists set entity id basically to blank_battletowers and then client defines name as dungoen then it's compatible. That's how I am going to add support for stuff. doing what choonster originally said just a bit more advanced. Yes vanilla world gen and any world gen that adds comparability would have to add the blank thing to be fully supported. Of course name defiinitions would only work per dimension thus making further compatibility.
  2. Well and array list of scanned poses would work but, I need a second check a check for if player exits game goes back how do they know if it's been checked or not because, new scan radius of one then the chunk that had already been there on the edge just got overriden because, the chunk next to it has a spawner in say a mineshaft and previous was dungon. So what would I check for if the chunk is on the disk? But, you said it already was a loaded chunk that got modified? what would be a good solution can the dynamic and just hard code replace vanilla? Then how am I suppose to support mods same manual replacing of structures?
  3. I don't think it could generate the same dungeon twice always because the random variable .getnexRandom() wouldn't be the same it would have to get modified the same ways before I could call it for my structure replacing the structure would be better idea as it would do the same thing non laggy I am more or less liking scanning chunks via radius ever chunk load
  4. Well I thought of adding a hashmap of spawners and positions the issue with that is exit the world go back hash map is cleared get's overriden all over again on chunk populate for loading a new chunk right next to that. I would need booleans if the chunk is on the disk and if it's already scanned. I could simply hard code pig in for everything but, that might run stuff. I would have to write a list of spawners to the disk and that would get really big real fast and laggy if you go exploring for 3000 chunks. The solution has to be in memory only I could try adding a tag to the tile entity under the entity part but, that's kind of cheating. {SpawnData:{isScanned:true} } so I don't like that idea because, in the future I plan on supporting other tile entities once silk spanwer and the core get a major update or two replacing the structures I am trying not to do this if there is any other way predicting where the chunks are going to layed out sounds like to much math for something that fires for every new chunk I would rather replace the structures. I replaced the dungeon because there was no hook properly into this and I also wanted to alter the floor based on what type of entity it is. My dungeon detector for mob spawners runs in post after everything else the issue is structure placed spawner into a chunk that was already scanned.
  5. So how do I have a boolean of whether or not I modified the spawner? A hashmap of <points(xzchunk),tileentity> and then lets say I scan chunks that have already been loaded how do I know whether or not that chunk has already been written to the disk and re-loaded or something I could be overwriting spawners that have already existed with other entities? Does this happen in any of the other structures again what is a proper solution that involves checks for this? So confused don't want to replace every structure that just happens to be out of a chunk for initial spawn
  6. Sounds cool but, I thought this populate chunk event was suppose to be firing ever chunk load what event fires every chunk load after everything has been populated? Or I need a method boolean to detect if a chunk hasn't existed before but, never fired upon Note: it has to be a chunk event only when generating new chunks because, if I scan a radius then I might override existing spawners and it's no guarantee that it will always only be one chunk away
  7. it's up with build.gradle https://github.com/jredfox/dungeontweeks Still should have to run "/gradlew setupdDecompWorkspace eclipse" after setting up a new mdk
  8. edited out for irrelevant information
  9. Edit: ok misread this can't upload full files past 100 but, did give you the build.gradle Edit: look at bottom comment
  10. why do you need build.gradle that's simply going to have to be re-run anyways once you setup it to your path
  11. Ok tell me why everything isn't wither skeletons in the new event the top one I hard coded regardless if tile entity is mob spanwer fire event with type fortress meaning it will set to wither skele and it's not printing there or anywhere for me. Both the hard coded test and printlines have failed It's not firing for me I registered both on terrain bus and regular I am on the forge recommended build should I be higher? https://github.com/jredfox/dungeontweeks
  12. Don't know how went to nether after firing the event teleported nothing no printlines I will post video. I said it doesn't fire every chunk never said it never fired
  13. Doesn't print in ever chunk not even if the tile entity map is null. Is this the case with the overworld as well What event should I be using? I need it after everything occurs every chunk @SubscribeEvent public void dungeonDetectNether(PopulateChunkEvent.Post e) { World w = e.getWorld(); if(w.isRemote || !w.provider.isNether()) return; Chunk chunk = w.getChunkFromChunkCoords(e.getChunkX(), e.getChunkZ() ); Map<BlockPos, TileEntity> map = chunk.getTileEntityMap(); IChunkGenerator gen = e.getGenerator(); if(map == null) System.out.println(e.getChunkX() + ", " + e.getChunkZ()); Iterator<Map.Entry<BlockPos, TileEntity>> it = map.entrySet().iterator(); while(it.hasNext() ) { Map.Entry<BlockPos, TileEntity> pair = it.next(); BlockPos pos = pair.getKey(); TileEntity tile = pair.getValue(); if(tile instanceof TileEntityMobSpawner) { System.out.println("Spawner:" + pos); EventDungeon d = new EventDungeon.Post(tile,pos, Type.NETHERFORTRESS); MinecraftForge.EVENT_BUS.post(d); } } } Console: [02:42:33] [Server thread/INFO]: Player622 has made the advancement [We Need to Go Deeper] [02:42:33] [main/INFO]: [CHAT] Player622 has made the advancement [We Need to Go Deeper] [02:42:33] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 11636ms behind, skipping 232 tick(s) [02:42:34] [main/INFO]: Loaded 17 advancements [02:42:46] [Server thread/INFO]: [Player622: Teleported Player622 to -141.5, 70.0, 41.5] [02:42:46] [main/INFO]: [CHAT] Teleported Player622 to -141.5, 70.0, 41.5 [02:42:50] [Server thread/INFO]: Player622 has made the advancement [A Terrible Fortress] [02:42:50] [main/INFO]: [CHAT] Player622 has made the advancement [A Terrible Fortress] [02:42:50] [main/INFO]: Loaded 19 advancements Steps to reproduce create world seed: "2" go to nether /tp -142 70 41 observer no printlines from code yet then fly for about 30 chunks around then it will call populate post event Issue caused by this: because it's not firing when it needs to the blaze room in the nether fortress isn't wither skeleton if it was firing every chunk it would become a wither skeleton
  14. It's not firing at all in every chunk submitted new topic
  15. I did if you read it's not firing at all when it should be I said print all tile entities if w.provider.isHell . Either A: it's not firing at all or B: the tile entity map isn't returning everything it should be. As you can see nothing prints when you do the steps to reproduce the bug. It's not overriding a specific room in the nether bridge and I don't know why @SubscribeEvent public void dungeonDetectNether(PopulateChunkEvent.Post e) { World w = e.getWorld(); if(w.isRemote || !w.provider.isNether()) return; Chunk chunk = w.getChunkFromChunkCoords(e.getChunkX(), e.getChunkZ() ); Map<BlockPos, TileEntity> map = chunk.getTileEntityMap(); IChunkGenerator gen = e.getGenerator(); if(map == null) return; Iterator<Map.Entry<BlockPos, TileEntity>> it = map.entrySet().iterator(); if(map == null) System.out.println(e.getChunkX() + ", " + e.getChunkZ()); while(it.hasNext() ) { Map.Entry<BlockPos, TileEntity> pair = it.next(); BlockPos pos = pair.getKey(); TileEntity tile = pair.getValue(); if(tile instanceof TileEntityMobSpawner) System.out.println("Spawner:" + pos); EventDungeon d = new EventDungeon.Post(tile,pos, Type.NETHERFORTRESS); MinecraftForge.EVENT_BUS.post(d); } } [02:42:33] [Server thread/INFO]: Player622 has made the advancement [We Need to Go Deeper] [02:42:33] [main/INFO]: [CHAT] Player622 has made the advancement [We Need to Go Deeper] [02:42:33] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 11636ms behind, skipping 232 tick(s) [02:42:34] [main/INFO]: Loaded 17 advancements [02:42:46] [Server thread/INFO]: [Player622: Teleported Player622 to -141.5, 70.0, 41.5] [02:42:46] [main/INFO]: [CHAT] Teleported Player622 to -141.5, 70.0, 41.5 [02:42:50] [Server thread/INFO]: Player622 has made the advancement [A Terrible Fortress] [02:42:50] [main/INFO]: [CHAT] Player622 has made the advancement [A Terrible Fortress] [02:42:50] [main/INFO]: Loaded 19 advancements However if you go out to the actual bridge area and not the blaze dungon room it prints but, never working for the actual blaze room inside the fortress at -142 70 41 Spawner:BlockPos{x=-162, y=70, z=145}
  16. Ok I got everything working except for nether spawners some work some don't please help I don't know why it's not working all the other structures works and the nether spawners works if it's on the bridge is the a is pos in structure bug returning false when it should be true? Edit: debug the print line not even firing chunk populate post what is going on here? Sometimes it does other times it don't Steps to reproduce: create world seed of 2 go to nether /tp -142 70 41 and see blaze spawner when all the other spawners in the nether I encountered was wither skeleton spawners. I hard coded the spawners if type enum == nether to be wither skeleton. It doesn't print the nbt unless the spawner does work so I know it's in the chunk populate that is causing the error I just don't know why or how that is My custom forge event implementation @SubscribeEvent public void dungeonHandler(EventDungeon.Post e) { NBTTagCompound nbt = new NBTTagCompound(); e.tile.writeToNBT(nbt); NBTTagCompound data = nbt.getCompoundTag("SpawnData"); if(e.type == Type.DUNGEON) { data.setString("id", "sheep"); data.setInteger("Color", 1); } if(e.type == Type.MINESHAFT) { data.setString("id", "sheep"); data.setInteger("Color", 2); } if(e.type == Type.STRONGHOLD) { data.setString("id", "sheep"); data.setInteger("Color", 3); } if(e.type == Type.MANSION) { data.setString("id", "sheep"); data.setInteger("Color", 6); } if(e.type == Type.NETHERFORTRESS) { data.setString("id", "wither_skeleton"); System.out.println(nbt); } nbt.removeTag("SpawnPotentials"); e.tile.readFromNBT(nbt); e.tile.markDirty(); } My actual forge event to fire dungeon event /** * For everything except default dungeon * @param e */ @SubscribeEvent public void dungeonDetect(PopulateChunkEvent.Post e) { World w = e.getWorld(); if(w.isRemote) return; Chunk chunk = w.getChunkFromChunkCoords(e.getChunkX(), e.getChunkZ() ); Map<BlockPos, TileEntity> map = chunk.getTileEntityMap(); IChunkGenerator gen = e.getGenerator(); if(map == null) return; Iterator<Map.Entry<BlockPos, TileEntity>> it = map.entrySet().iterator(); while(it.hasNext() ) { Map.Entry<BlockPos, TileEntity> pair = it.next(); BlockPos pos = pair.getKey(); TileEntity tile = pair.getValue(); boolean mineshaft = false; boolean stronghold = false; boolean netherfortress = false; boolean mansion = false;//has spawner in secret room here if(gen instanceof ChunkGeneratorOverworld) { ChunkGeneratorOverworld gen2 = (ChunkGeneratorOverworld)gen; mineshaft = gen2.isInsideStructure(w, "Mineshaft", pos); stronghold = gen2.isInsideStructure(w, "Stronghold", pos); mansion = gen2.isInsideStructure(w, "Mansion", pos); } else if(gen instanceof ChunkGeneratorHell) { ChunkGeneratorHell gen3 = (ChunkGeneratorHell)gen; netherfortress = gen3.isInsideStructure(w, "Fortress", pos); } if(!mineshaft && !stronghold && !mansion &&!netherfortress) return; if(tile instanceof TileEntityMobSpawner) { EventDungeon.Type type = mineshaft ? EventDungeon.Type.MINESHAFT : stronghold ? EventDungeon.Type.STRONGHOLD : netherfortress ? EventDungeon.Type.NETHERFORTRESS : mansion ? EventDungeon.Type.MANSION : null; System.out.println(type + " " + pos); EventDungeon.Post d = new EventDungeon.Post(tile,pos,type); MinecraftForge.EVENT_BUS.post(d); } } }
  17. Actually how do I use that method isInsideStructure() without scanning through every block of the chunk? Also should I be using isPositionInStructure() instead which is much smaller but, I don't know what the differences are.
  18. Well I could scan for if I am inside of a structure and if isn't null scan for tile entities. Question is that method in versions < 1.12 I like to backport mods and if so what version were they added I am thinking 1.8.9 ish
  19. Where and when does InitMapGenEvent occur pre or post? Regardless whether pre or post how do you know whether or not that it's been generated there? I don't know if that event just occurs always every chunk or what is going on with that. With the other I understand it If you answer what I think you answer pre and it is being generated then I can flag this and use chunk populate post to do my spawner overrides.
  20. So I am able to flag dungeon as boolean for next chunk post event if it's dungeon. What events fire for mineshaft, nether fortress and stronghold? I could try what the very first comment says and If I can't identify might as well just replace everything
  21. Dungeon Hooks no can do in a backport I will do will have support for wither skeletons for 1.7 sub mobs didn't have their own string. Another reason no dungeon hooks is what if people wanted jockie or pink sheeps not possible via current forge now if forge had the ability for nbt entries yes I would use it but, I made a class similar and much better then forges already. I have already improted all dungeon hooks into my array for support but, That still doesn't solve anything Per entity dection to = dungeon type I had thought about but, it doesn't always work for example install battle towers mod well woops it's now overriden battle towers because, skeletons spiders and zombie spawners turned into whatever user configures in default dungeon. This is a good idea but, not for the vanilla dungeon types. I am going to post a pull for forge soon about proper spawner definitions. block isSpawner will return boolean and modders will be told to use the spawner interface to return nessary tag data such as, entity id,entity properties and mountins. As for dungeon tweeks I think they should have proper forge event fired and encourage modders to implement an interface as well to fire pre and post tile entity spawner events Scanning only for event type . dungeon isn't good enough. A: it fires before spawners are built, B: I need to identify not just the dungeon mineshaft , stronghold and nether fortress
  22. I need to flag what dungeon is what before I modify it. Otherwise by just instantly saying spawner here in chunk override all spawners in other dungeons , strongholds, mineshaft, nether dungeons everything. I have different arraylists for different dungeons I need to know which one is what so I can switch which arraylist to use and don't use any if not specified
  23. Ok got the nbt working but, I need to know how to identify what dungeon is what so I don't override other dungeons with another arraylist if(tile instanceof TileEntityMobSpawner) { IBlockState old = w.getBlockState(pos); NBTTagCompound compound = new NBTTagCompound(); tile.writeToNBT(compound); NBTTagCompound data = new NBTTagCompound(); data.setString("id", "minecraft:creeper"); data.setInteger("powered", 100); compound.setTag("SpawnData", data); compound.removeTag("SpawnPotentials"); tile.readFromNBT(compound); tile.markDirty(); }
  24. I got this part working could you help me on the other forum again the wither skeletons are not spawner just blank spawners with that code
  25. yes switching the event bus did make it fire wonder why nobody thought of that first I am noob
×
×
  • Create New...

Important Information

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