Posted November 20, 20159 yr How does Forge handle nested Pre/Post events? For example: MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(worldObj, rand, worldX, worldZ)); ... lots of code ... MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(worldObj, rand, worldX, worldZ)); ... more code ... MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(worldObj, rand, worldX, worldZ)); ... lots of code ... MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(worldObj, rand, worldX, worldZ)); Does the first DecorateBiomeEvent.Post() cancel both of the Pre()'s? Or are events not bound to each other like that? Is it common to see nested events like this, or is it something that should be triggering alarm bells? [1.7.10] [1.8.9] RTG — Realistic Terrain Generation — http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2524489
November 20, 20159 yr If several or one mod uses same event several times, event handlers will honor: 1. Priority (HIGHEST, HIGH, NORMAL, LOW, LOWEST) 2. Order of adding (registering) (and loading is dependent to mod-loading process, so also mod-dependency order) In this order. 1.7.10 is no longer supported by forge, you are on your own.
November 20, 20159 yr Pre and Post events are not bound together like that. Canceling a Post event will do nothing to the Pre, as it's already run. there is no way to 'rewind' events. I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
November 20, 20159 yr The events are not really "nested" in the sense you think. An event is simply an event, meaning a singular point in time/execution of the code. The PRE event is basically saying I'm starting something, and the POST is saying its finishing something, but there is no real relationship except hopefully the code fires each at the right point. There is nothing weird about starting a bunch of things before finishing the first thing. Check out my tutorials here: http://jabelarminecraft.blogspot.com/
November 20, 20159 yr Author Awesome, thanks for the insight guys. [1.7.10] [1.8.9] RTG — Realistic Terrain Generation — http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2524489
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.