Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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 Generationhttp://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2524489

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.

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

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/

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.