Jump to content

PopulateChunkEvent.Post Never Fires Every Chunk In Nether


Recommended Posts

Posted (edited)

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

Edited by jredfox
Posted (edited)
33 minutes ago, diesieben07 said:

Cannot reproduce this. Followed your steps and the event fired before and after the teleport.

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

Edited by jredfox
Posted (edited)
8 minutes ago, diesieben07 said:

If you want me to actually test your code and not just verify that the event works in general, post a working Git repo. I don't care about a video.

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

Edited by jredfox
Posted
2 minutes ago, diesieben07 said:

Your repository is missing the build.gradle so I cannot run your code.

why do you need build.gradle that's simply going to have to be re-run anyways once you setup it to your path

Posted (edited)
14 minutes ago, loordgek said:

you need it to setup the dev environment

Edit: ok misread this 

18 minutes ago, diesieben07 said:

Your repository is missing the build.gradle so I cannot run your code.

can't upload full files past 100 but, did give you the build.gradle

 

Edit: look at bottom comment

Edited by jredfox
Posted (edited)
5 minutes ago, diesieben07 said:

So that I can just clone your repository and it works. Instead of me having to fiddle around with 20 files and downloads.

 

Your issue is that structures can reach across chunks when generating (terrible, but that's how it is). The spawner your teleport command goes to is in chunk -9/2, but the structure it is part of is generated in chunk -10/2. You have to check neighboring chunks in your populate event handler, too, to catch all spawners. How many? I don't know.

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

Edited by jredfox
Posted
2 hours ago, diesieben07 said:

It does. But the spawner in chunk -9/2 is not generated as part of chunk -9/2's population. It is generated as part of chunk -10/2's generation (because structure generation spans multiple chunks).

Here is what happens:

  1. Chunk -9/2 is populated, no structure.
  2. Post populate event for -9/2 fires, you scan -9/2 for spawners and don't find any (because there are no structures).
  3. Chunk -10/2 is populated and a nether fortress decides to spawn, including a blaze spawner. This blaze spawner happens to be in chunk -9/2.
  4. Post populate event for -10/2 fires, you scan -10/2 for spawners and don't find any (because the spawner is in -9/2).

I know. It sucks. But that is how structure generation is implemented in Minecraft.

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

Posted

Honestly, the best way in terms of performance and in terms of logical simplicity and correctness is to replace the structure generators with your own. It really isn't that hard, as you really just copy or extend the existing ones and replace the one line of code for the spawner. Many of the vanilla structure generators have public fields you can assign directly, and dungeons have the event where you can intercept and replace it. I know it sounds heavy-handed but I'm not sure that it is that bad.

 

Secondly, if you continue with your scanning approach you seem really worried about remembering what has been changed and such. It isn't that hard to add a collection (list of spawners) that you have modified and add that to the world save data.

 

Thirdly, another possibility is to predict where the structures will add the parts that go into the next chunks. Basically you would create a copy of the structure generator that takes the same seed and instead of actually generating the structure (remove that part)  just note which additional chunks are affected and scan those.

 

Lastly, while it would take a bit longer you can simply make a PR to add the hooks you need in Forge. For example, I think the current DungeonHooks implementation sort of sucks because it doesn't allow outright replacement of the spawner. So why don't you make a PR for a PlaceSpawnerEvent that gets information on location and which generator type produced it. If you're lucky (and for a simple and useful PR it is quite possible) it will take about a month to get your PR accepted and then you can return to this aspect of your mod.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted

I just thought of another thing. It may be possible to generate the dungeon twice. I think with the same seed it should generate the same way. So why not just have your dungeon generator also run after the vanilla stuff? Of course your version doesn't have to place all the blocks, but should be able to find where the spawner would be. Even if it wasn't perfect due to randomness beyond the seed value, I think it could greatly narrow down the scanning you need to do as you'd know specific area that spawner should/could be.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted (edited)
8 minutes ago, jabelar said:

I just thought of another thing. It may be possible to generate the dungeon twice. I think with the same seed it should generate the same way. So why not just have your dungeon generator also run after the vanilla stuff? Of course your version doesn't have to place all the blocks, but should be able to find where the spawner would be. Even if it wasn't perfect due to randomness beyond the seed value, I think it could greatly narrow down the scanning you need to do as you'd know specific area that spawner should/could be.

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.

Edited by jredfox
Posted

 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

Posted (edited)
4 hours ago, diesieben07 said:

It does. But the spawner in chunk -9/2 is not generated as part of chunk -9/2's population. It is generated as part of chunk -10/2's generation (because structure generation spans multiple chunks).

Here is what happens:

  1. Chunk -9/2 is populated, no structure.
  2. Post populate event for -9/2 fires, you scan -9/2 for spawners and don't find any (because there are no structures).
  3. Chunk -10/2 is populated and a nether fortress decides to spawn, including a blaze spawner. This blaze spawner happens to be in chunk -9/2.
  4. Post populate event for -10/2 fires, you scan -10/2 for spawners and don't find any (because the spawner is in -9/2).

I know. It sucks. But that is how structure generation is implemented in Minecraft.

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?

Edited by jredfox
Posted (edited)

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.

Edited by jredfox
Posted (edited)
3 hours ago, diesieben07 said:

You do not need ASM to store additional data on tile entities. Either you can add a capability to every tile entity you need using AttachCapabilityEvent or you can use TileEntity::getTileData, which is an NBTTagCompound which you can store custom data into (prefix with your mod ID).

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

Edited by jredfox
Posted
1 hour ago, jredfox said:

ok is this also in 1.7

1.7.10 is no longer supported here

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted (edited)

Hey @jredfox, I know you've been working hard with all this scanning stuff, but I was able to get it all working with only 20 lines of new code and about five minutes.  All I had to do was:

 

1) Copied the WorldGenDungeons code into a new class and changed the line for the spawner to make a wither spawner and to add a simple boolean tag to the spawner. See example code: https://github.com/jabelar/ExampleMod-1.12/blob/master/src/main/java/com/blogspot/jabelarminecraft/examplemod/worldgen/WorldGenDungeonsModded.java

 

2) Handle the Populate event and check for dungeon type, then copied the code from the overworld chunk generator's populate() method that calls my dungeon generator. I also set result of the event to Result.DENY to prevent the vanilla dungeon. See example code: https://github.com/jabelar/ExampleMod-1.12/blob/master/src/main/java/com/blogspot/jabelarminecraft/examplemod/TerrainGenEventHandler.java 

 

I could then access the world.getLoadedTileEntities at any time and filter for those with my tag to see what spawners I had modded. To test this I also handled the EntityJoinedWorldEvent, checked for the player, and then printed to console all the tile entities that had my tag.  https://github.com/jabelar/ExampleMod-1.12/blob/master/src/main/java/com/blogspot/jabelarminecraft/examplemod/EventHandler.java#L1096 

 

Here is what the console printed out when I created the new world:

[23:42:40] [Server thread/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.worldgen.WorldGenDungeonsModded:generate:144]: Replacing dungeon mob spawner at BlockPos{x=22, y=58, z=384}
[23:42:40] [Server thread/INFO]: Preparing spawn area: 15%
[23:42:40] [Server thread/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.worldgen.WorldGenDungeonsModded:generate:144]: Replacing dungeon mob spawner at BlockPos{x=45, y=26, z=150}
[23:42:41] [Server thread/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.worldgen.WorldGenDungeonsModded:generate:144]: Replacing dungeon mob spawner at BlockPos{x=61, y=26, z=70}
[23:42:41] [Server thread/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.worldgen.WorldGenDungeonsModded:generate:144]: Replacing dungeon mob spawner at BlockPos{x=61, y=26, z=150}
[23:42:41] [Server thread/INFO]: Preparing spawn area: 28%
[23:42:42] [Server thread/INFO]: Preparing spawn area: 41%
[23:42:43] [Server thread/INFO]: Preparing spawn area: 56%
[23:42:44] [Server thread/INFO]: Preparing spawn area: 73%
[23:42:45] [Server thread/INFO]: Preparing spawn area: 89%
[23:42:46] [Server thread/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.MainMod:serverStarting:175]: Server starting
[23:42:46] [Server thread/INFO]: Changing view distance to 12, from 10
[23:42:46] [Netty Local Client IO #1/INFO] [FML]: Server protocol version 2
[23:42:46] [Netty Server IO #3/INFO] [FML]: Client protocol version 2
[23:42:46] [Netty Server IO #3/INFO] [FML]: Client attempting to join with 5 mods : [email protected],[email protected],[email protected],[email protected],[email protected]
[23:42:46] [Netty Local Client IO #1/INFO] [FML]: [Netty Local Client IO #1] Client side modded connection established
[23:42:47] [Server thread/INFO] [FML]: [Server thread] Server side modded connection established
[23:42:47] [Server thread/INFO]: Player738[local:E:0277a632] logged in with entity id 6503 at (177.5, 75.0, 246.5)
[23:42:47] [Server thread/INFO]: Player738 joined the game
[23:42:47] [Server thread/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.EventHandler:onEvent:1104]: World has modded dungeon spawners [net.minecraft.tileentity.TileEntityMobSpawner@53d837e5, net.minecraft.tileentity.TileEntityMobSpawner@46e1b33f, net.minecraft.tileentity.TileEntityMobSpawner@5a946ae9, net.minecraft.tileentity.TileEntityMobSpawner@78f0523e]

 

You can see that it modded four spawners and that when I joined the world the server could find all four modded tile entities. In game I teleported to the spawner locations and confirmed they were spawning withers.

 

Then I quit and saved and then loaded the same world and the console showed:

[23:42:59] [Server thread/INFO]: Saving and pausing game...
[23:42:59] [Server thread/INFO]: Saving chunks for level 'New World'/overworld
[23:42:59] [Server thread/INFO]: Saving chunks for level 'New World'/the_nether
[23:42:59] [Server thread/INFO]: Saving chunks for level 'New World'/the_end
[23:42:59] [Server thread/INFO]: Saving chunks for level 'New World'/cloud
[23:43:59] [Server thread/INFO]: Stopping server
[23:43:59] [Server thread/INFO]: Saving players
[23:43:59] [Server thread/INFO]: Player738 lost connection: Disconnected
[23:43:59] [Server thread/INFO]: Player738 left the game
[23:43:59] [Server thread/INFO]: Stopping singleplayer server as player logged out
[23:43:59] [Server thread/INFO]: Saving worlds
[23:43:59] [Server thread/INFO]: Saving chunks for level 'New World'/overworld
[23:43:59] [Server thread/INFO]: Saving chunks for level 'New World'/the_nether
[23:43:59] [Server thread/INFO]: Saving chunks for level 'New World'/the_end
[23:43:59] [Server thread/INFO]: Saving chunks for level 'New World'/cloud
[23:43:59] [Server thread/INFO] [FML]: Unloading dimension 0
[23:43:59] [Server thread/INFO] [FML]: Unloading dimension -1
[23:43:59] [Server thread/INFO] [FML]: Unloading dimension 1
[23:43:59] [Server thread/INFO] [FML]: Unloading dimension 2
[23:43:59] [Server thread/INFO] [FML]: Applying holder lookups
[23:43:59] [Server thread/INFO] [FML]: Holder lookups applied
[23:44:06] [Server thread/INFO]: Starting integrated minecraft server version 1.12.2
[23:44:06] [Server thread/INFO]: Generating keypair
[23:44:06] [Server thread/INFO] [FML]: Injecting existing registry data into this server instance
[23:44:06] [Server thread/INFO] [FML]: Applying holder lookups
[23:44:06] [Server thread/INFO] [FML]: Holder lookups applied
[23:44:06] [Server thread/INFO] [FML]: Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@73338cd5)
[23:44:06] [Server thread/INFO]: Loaded 488 advancements
[23:44:06] [Server thread/INFO] [FML]: Loading dimension 2 (New World) (net.minecraft.server.integrated.IntegratedServer@73338cd5)
[23:44:06] [Server thread/INFO] [FML]: Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@73338cd5)
[23:44:06] [Server thread/INFO] [FML]: Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@73338cd5)
[23:44:06] [Server thread/INFO]: Preparing start region for level 0
[23:44:07] [Server thread/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.MainMod:serverStarting:175]: Server starting
[23:44:07] [Server thread/INFO]: Changing view distance to 12, from 10
[23:44:07] [Netty Local Client IO #2/INFO] [FML]: Server protocol version 2
[23:44:07] [Netty Server IO #5/INFO] [FML]: Client protocol version 2
[23:44:07] [Netty Server IO #5/INFO] [FML]: Client attempting to join with 5 mods : [email protected],[email protected],[email protected],[email protected],[email protected]
[23:44:07] [Netty Local Client IO #2/INFO] [FML]: [Netty Local Client IO #2] Client side modded connection established
[23:44:07] [Server thread/INFO] [FML]: [Server thread] Server side modded connection established
[23:44:07] [Server thread/INFO]: Player738[local:E:d39a95e0] logged in with entity id 11287 at (177.5, 75.0, 246.5)
[23:44:07] [Server thread/INFO]: Player738 joined the game
[23:44:07] [Server thread/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.EventHandler:onEvent:1104]: World has modded dungeon spawners [net.minecraft.tileentity.TileEntityMobSpawner@4011b568, net.minecraft.tileentity.TileEntityMobSpawner@453cb458, net.minecraft.tileentity.TileEntityMobSpawner@2ce4226f, net.minecraft.tileentity.TileEntityMobSpawner@56ec5e53]

 

You can see that when I loaded the world it remembered that there were four modded spawners.

 

It is really that simple. It has no perf impact at all and it will perfectly only modify spawners in the dungeon and will perfectly remember all the ones you've modified.

Edited by jabelar

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted
4 hours ago, jabelar said:

Hey @jredfox, I know you've been working hard with all this scanning stuff, but I was able to get it all working with only 20 lines of new code and about five minutes.  All I had to do was:

 

1) Copied the WorldGenDungeons code into a new class and changed the line for the spawner to make a wither spawner and to add a simple boolean tag to the spawner. See example code: https://github.com/jabelar/ExampleMod-1.12/blob/master/src/main/java/com/blogspot/jabelarminecraft/examplemod/worldgen/WorldGenDungeonsModded.java

 

2) Handle the Populate event and check for dungeon type, then copied the code from the overworld chunk generator's populate() method that calls my dungeon generator. I also set result of the event to Result.DENY to prevent the vanilla dungeon. See example code: https://github.com/jabelar/ExampleMod-1.12/blob/master/src/main/java/com/blogspot/jabelarminecraft/examplemod/TerrainGenEventHandler.java 

 

I could then access the world.getLoadedTileEntities at any time and filter for those with my tag to see what spawners I had modded. To test this I also handled the EntityJoinedWorldEvent, checked for the player, and then printed to console all the tile entities that had my tag.  https://github.com/jabelar/ExampleMod-1.12/blob/master/src/main/java/com/blogspot/jabelarminecraft/examplemod/EventHandler.java#L1096 

 

Here is what the console printed out when I created the new world:


[23:42:40] [Server thread/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.worldgen.WorldGenDungeonsModded:generate:144]: Replacing dungeon mob spawner at BlockPos{x=22, y=58, z=384}
[23:42:40] [Server thread/INFO]: Preparing spawn area: 15%
[23:42:40] [Server thread/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.worldgen.WorldGenDungeonsModded:generate:144]: Replacing dungeon mob spawner at BlockPos{x=45, y=26, z=150}
[23:42:41] [Server thread/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.worldgen.WorldGenDungeonsModded:generate:144]: Replacing dungeon mob spawner at BlockPos{x=61, y=26, z=70}
[23:42:41] [Server thread/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.worldgen.WorldGenDungeonsModded:generate:144]: Replacing dungeon mob spawner at BlockPos{x=61, y=26, z=150}
[23:42:41] [Server thread/INFO]: Preparing spawn area: 28%
[23:42:42] [Server thread/INFO]: Preparing spawn area: 41%
[23:42:43] [Server thread/INFO]: Preparing spawn area: 56%
[23:42:44] [Server thread/INFO]: Preparing spawn area: 73%
[23:42:45] [Server thread/INFO]: Preparing spawn area: 89%
[23:42:46] [Server thread/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.MainMod:serverStarting:175]: Server starting
[23:42:46] [Server thread/INFO]: Changing view distance to 12, from 10
[23:42:46] [Netty Local Client IO #1/INFO] [FML]: Server protocol version 2
[23:42:46] [Netty Server IO #3/INFO] [FML]: Client protocol version 2
[23:42:46] [Netty Server IO #3/INFO] [FML]: Client attempting to join with 5 mods : [email protected],[email protected],[email protected],[email protected],[email protected]
[23:42:46] [Netty Local Client IO #1/INFO] [FML]: [Netty Local Client IO #1] Client side modded connection established
[23:42:47] [Server thread/INFO] [FML]: [Server thread] Server side modded connection established
[23:42:47] [Server thread/INFO]: Player738[local:E:0277a632] logged in with entity id 6503 at (177.5, 75.0, 246.5)
[23:42:47] [Server thread/INFO]: Player738 joined the game
[23:42:47] [Server thread/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.EventHandler:onEvent:1104]: World has modded dungeon spawners [net.minecraft.tileentity.TileEntityMobSpawner@53d837e5, net.minecraft.tileentity.TileEntityMobSpawner@46e1b33f, net.minecraft.tileentity.TileEntityMobSpawner@5a946ae9, net.minecraft.tileentity.TileEntityMobSpawner@78f0523e]

 

You can see that it modded four spawners and that when I joined the world the server could find all four modded tile entities. In game I teleported to the spawner locations and confirmed they were spawning withers.

 

Then I quit and saved and then loaded the same world and the console showed:


[23:42:59] [Server thread/INFO]: Saving and pausing game...
[23:42:59] [Server thread/INFO]: Saving chunks for level 'New World'/overworld
[23:42:59] [Server thread/INFO]: Saving chunks for level 'New World'/the_nether
[23:42:59] [Server thread/INFO]: Saving chunks for level 'New World'/the_end
[23:42:59] [Server thread/INFO]: Saving chunks for level 'New World'/cloud
[23:43:59] [Server thread/INFO]: Stopping server
[23:43:59] [Server thread/INFO]: Saving players
[23:43:59] [Server thread/INFO]: Player738 lost connection: Disconnected
[23:43:59] [Server thread/INFO]: Player738 left the game
[23:43:59] [Server thread/INFO]: Stopping singleplayer server as player logged out
[23:43:59] [Server thread/INFO]: Saving worlds
[23:43:59] [Server thread/INFO]: Saving chunks for level 'New World'/overworld
[23:43:59] [Server thread/INFO]: Saving chunks for level 'New World'/the_nether
[23:43:59] [Server thread/INFO]: Saving chunks for level 'New World'/the_end
[23:43:59] [Server thread/INFO]: Saving chunks for level 'New World'/cloud
[23:43:59] [Server thread/INFO] [FML]: Unloading dimension 0
[23:43:59] [Server thread/INFO] [FML]: Unloading dimension -1
[23:43:59] [Server thread/INFO] [FML]: Unloading dimension 1
[23:43:59] [Server thread/INFO] [FML]: Unloading dimension 2
[23:43:59] [Server thread/INFO] [FML]: Applying holder lookups
[23:43:59] [Server thread/INFO] [FML]: Holder lookups applied
[23:44:06] [Server thread/INFO]: Starting integrated minecraft server version 1.12.2
[23:44:06] [Server thread/INFO]: Generating keypair
[23:44:06] [Server thread/INFO] [FML]: Injecting existing registry data into this server instance
[23:44:06] [Server thread/INFO] [FML]: Applying holder lookups
[23:44:06] [Server thread/INFO] [FML]: Holder lookups applied
[23:44:06] [Server thread/INFO] [FML]: Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@73338cd5)
[23:44:06] [Server thread/INFO]: Loaded 488 advancements
[23:44:06] [Server thread/INFO] [FML]: Loading dimension 2 (New World) (net.minecraft.server.integrated.IntegratedServer@73338cd5)
[23:44:06] [Server thread/INFO] [FML]: Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@73338cd5)
[23:44:06] [Server thread/INFO] [FML]: Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@73338cd5)
[23:44:06] [Server thread/INFO]: Preparing start region for level 0
[23:44:07] [Server thread/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.MainMod:serverStarting:175]: Server starting
[23:44:07] [Server thread/INFO]: Changing view distance to 12, from 10
[23:44:07] [Netty Local Client IO #2/INFO] [FML]: Server protocol version 2
[23:44:07] [Netty Server IO #5/INFO] [FML]: Client protocol version 2
[23:44:07] [Netty Server IO #5/INFO] [FML]: Client attempting to join with 5 mods : [email protected],[email protected],[email protected],[email protected],[email protected]
[23:44:07] [Netty Local Client IO #2/INFO] [FML]: [Netty Local Client IO #2] Client side modded connection established
[23:44:07] [Server thread/INFO] [FML]: [Server thread] Server side modded connection established
[23:44:07] [Server thread/INFO]: Player738[local:E:d39a95e0] logged in with entity id 11287 at (177.5, 75.0, 246.5)
[23:44:07] [Server thread/INFO]: Player738 joined the game
[23:44:07] [Server thread/INFO] [STDOUT]: [com.blogspot.jabelarminecraft.examplemod.EventHandler:onEvent:1104]: World has modded dungeon spawners [net.minecraft.tileentity.TileEntityMobSpawner@4011b568, net.minecraft.tileentity.TileEntityMobSpawner@453cb458, net.minecraft.tileentity.TileEntityMobSpawner@2ce4226f, net.minecraft.tileentity.TileEntityMobSpawner@56ec5e53]

 

You can see that when I loaded the world it remembered that there were four modded spawners.

 

It is really that simple. It has no perf impact at all and it will perfectly only modify spawners in the dungeon and will perfectly remember all the ones you've modified.

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...

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • After some time minecraft crashes with an error. Here is the log https://drive.google.com/file/d/1o-2R6KZaC8sxjtLaw5qj0A-GkG_SuoB5/view?usp=sharing
    • The specific issue is that items in my inventory wont stack properly. For instance, if I punch a tree down to collect wood, the first block I collected goes to my hand. So when I punch the second block of wood to collect it, it drops, but instead of stacking with the piece of wood already in my hand, it goes to the second slot in my hotbar instead. Another example is that I'll get some dirt, and then when I'm placing it down later I'll accidentally place a block where I don't want it. When I harvest it again, it doesn't go back to the stack that it came from on my hotbar, where it should have gone, but rather into my inventory. That means that if my inventory is full, then the dirt wont be picked up even though there should be space available in the stack I'm holding. The forge version I'm using is 40.3.0, for java 1.18.2. I'll leave the mods I'm using here, and I'd appreciate it if anybody can point me in the right direction in regards to figuring out how to fix this. I forgot to mention that I think it only happens on my server but I&#39;m not entirely sure. PLEASE HELP ME! LIST OF THE MODS. aaa_particles Adorn AdvancementPlaques AI-Improvements AkashicTome alexsdelight alexsmobs AmbientSounds amwplushies Animalistic another_furniture AppleSkin Aquaculture aquamirae architectury artifacts Atlas-Lib AutoLeveling AutoRegLib auudio balm betterfpsdist biggerstacks biomancy BiomesOPlenty blockui blueprint Bookshelf born_in_chaos Botania braincell BrassAmberBattleTowers brutalbosses camera CasinoCraft cfm (MrCrayfish’s Furniture Mod) chat_heads citadel cloth-config Clumps CMDCam CNB cobweb collective comforts convenientcurioscontainer cookingforblockheads coroutil CosmeticArmorReworked CozyHome CrabbersDelight crashexploitfixer crashutilities Create CreativeCore creeperoverhaul cristellib crittersandcompanions Croptopia CroptopiaAdditions CullLessLeaves curios curiouslanterns curiouslights Curses' Naturals CustomNPCs CyclopsCore dannys_expansion decocraft Decoration Mod DecorationDelightRefurbished Decorative Blocks Disenchanting DistantHorizons doubledoors DramaticDoors drippyloadingscreen durabilitytooltip dynamic-fps dynamiclights DynamicTrees DynamicTreesBOP DynamicTreesPlus Easy Dungeons EasyAnvils EasyMagic easy_npc eatinganimation ecologics effective_fg elevatorid embeddium emotecraft enchantlimiter EnchantmentDescriptions EnderMail engineersdecor entityculling entity_model_features entity_texture_features epicfight EvilCraft exlinefurniture expandability explosiveenhancement factory-blocks fairylights fancymenu FancyVideo FarmersDelight fast-ip-ping FastSuite ferritecore finsandtails FixMySpawnR Forge Middle Ages fossil FpsReducer2 furnish GamingDeco geckolib goblintraders goldenfood goodall H.e.b habitat harvest-with-ease hexerei hole_filler huge-structure-blocks HunterIllager iammusicplayer Iceberg illuminations immersive_paintings incubation infinitybuttons inventoryhud InventoryProfilesNext invocore ItemBorders itemzoom Jade jei (Just Enough Items) JetAndEliasArmors journeymap JRFTL justzoom kiwiboi Kobolds konkrete kotlinforforge lazydfu LegendaryTooltips libIPN lightspeed lmft lodestone LongNbtKiller LuckPerms Lucky77 MagmaMonsters malum ManyIdeasCore ManyIdeasDoors marbledsarsenal marg mcw-furniture mcw-lights mcw-paths mcw-stairs mcw-trapdoors mcw-windows meetyourfight melody memoryleakfix Mimic minecraft-comes-alive MineTraps minibosses MmmMmmMmmMmm MOAdecor (ART, BATH, COOKERY, GARDEN, HOLIDAYS, LIGHTS, SCIENCE) MobCatcher modonomicon mods_optimizer morehitboxes mowziesmobs MutantMonsters mysticalworld naturalist NaturesAura neapolitan NekosEnchantedBooks neoncraft2 nerb nifty NightConfigFixes nightlights nocube's_villagers_sell_animals NoSeeNoTick notenoughanimations obscure_api oculus oresabovediamonds otyacraftengine Paraglider Patchouli physics-mod Pillagers Gun PizzaCraft placeableitems Placebo player-animation-lib pneumaticcraft-repressurized polymorph PrettyPipes Prism projectbrazier Psychadelic-Chemistry PuzzlesLib realmrpg_imps_and_demons RecipesLibrary reeves-furniture RegionsUnexplored restrictedportals revive-me Scary_Mobs_And_Bosses selene shetiphiancore ShoulderSurfing smoothboot
    • Hi everyone, I'm currently developing a Forge 1.21 mod for Minecraft and I want to display a custom HUD overlay for a minigame. My goal: When the game starts, all players should see an item/block icon (from the base game, not a custom texture) plus its name/text in the HUD – similar to how the bossbar overlay works. The HUD should appear centered above the hotbar (or at a similar prominent spot), and update dynamically (icon and name change as the target item changes). What I've tried: I looked at many online tutorials and several GitHub repos (e.g. SeasonHUD, MiniHUD), but most of them use NeoForge or Forge versions <1.20 that provide the IGuiOverlay API (e.g. implements IGuiOverlay, RegisterGuiOverlaysEvent). In Forge 1.21, it seems that neither IGuiOverlay nor RegisterGuiOverlaysEvent exist anymore – at least, I can't import them and they are missing from the docs and code completion. I tried using RenderLevelStageEvent as a workaround but it is probably not intended for custom HUDs. I am not using NeoForge, and switching the project to NeoForge is currently not an option for me. I tried to look at the original minecraft source code to see how elements like hearts, hotbar etc are drawn on the screen but I am too new to Minecraft modding to understand. What I'm looking for: What is the correct way to add a custom HUD element (icon + text) in Forge 1.21, given that the previous overlay API is missing? Is there a new recommended event, callback, or method in Forge 1.21 for custom HUD overlays, or is everyone just using a workaround? Is there a minimal open-source example repo for Forge 1.21 that demonstrates a working HUD overlay without relying on NeoForge or deprecated Forge APIs? My ideal solution: Centered HUD element with an in-game item/block icon (from the base game's assets, e.g. a diamond or any ItemStack / Item) and its name as text, with a transparent background rectangle. It should be visible to the players when the mini game is running. Easy to update the item (e.g. static variable or other method), so it can change dynamically during the game. Any help, code snippets, or up-to-date references would be really appreciated! If this is simply not possible right now in Forge 1.21, it would also help to know that for sure. Thank you very much in advance!
    • The simple answer is there is not an easy way. You would need to know how to program in Java, as well as at least some familiarity with how Forge works so you could port the differences. You would also need the sourcecode for the original mod, and permission from the author to modify it, if they did not use some sort of open source license. So it's not impossible, but it would take some effort, but doing so would open up a whole new world of possibilities for you!
  • Topics

×
×
  • Create New...

Important Information

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