TerraForged / tracker

Technical issue tracker
1 stars 0 forks source link

WorldEvent.CreateSpawnPosition not fired for TerraForged world type #198

Closed ricksouth closed 1 year ago

ricksouth commented 1 year ago

Hi,

I'm currently attempting to make my mod compatible with TerraForged, which sets a new spawn point in the world. I've added multiple debug lines, and the event in forge I'm using (WorldEvent.CreateSpawnPosition) doesn't seem to fire when the custom world type is set.

If firing the event is not possible, or if there's another way to add compatibility, please let me know.

The code and event I'm currently using: https://github.com/ricksouth/serilum-mc-mods/blob/master/sources/Village%20Spawn%20Point/src/main/java/com/natamus/villagespawnpoint/events/VillageSpawnEvent.java

The code is for 1.19, but aside from the renaming of the event (LevelEvent.CreateSpawnPosition) it's pretty much the same as 1.16. Appreciate the help.

Kind regards, Rick

ricksouth commented 1 year ago

For reference: https://github.com/ricksouth/serilum-mc-mods/issues/559

Won-Ton commented 1 year ago

Hi. TerraForged uses the same event to make sure you spawn on land or at the centre of a continent. It won't be that forge isn't firing the event but that TerraForged's handler is just running before yours.

Check out the docs on "event priorities" (https://docs.minecraftforge.net/en/1.14.x/events/intro/#priority). TerraForged is on the default NORMAL priority so anything higher will get to run first. Hope that helps

Edit: or alternatively it looks like you can set the receiveCanceled flag on your SubscribeEvent annotation

ricksouth commented 1 year ago

Thank you!

ricksouth commented 1 year ago

Works like a charm, appreciate it!

Won-Ton commented 1 year ago

Nice! :]