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

Howdy,

 

Is this alright or is there a better way?

 

@SubscribeEvent(priority = EventPriority.LOWEST)
public void onSomeEventWithResultLate(SomeEventWithResult event) {
  if (ModConfig.COMPATIBILITY.runLatest) {
    // do stuff as late as possible so hopefully our result is the one that counts
  }
}

@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onSomeEventWithResultEarly(SomeEventWithResult event) {
  if (!ModConfig.COMPATIBILITY.runLatest) {
    // do stuff as soon as possible to let other mod events override it if they want
  }
}

 

Obviously the idea is to let the user decide whether they want this aspect of a mod to be more important to less important than other mods.

 

I may also have logic in the LOWEST priority to react differently depending on an existing result, if any, but that's neither here nor there.

Edited by CosmicDan
Method names

Windows software, Android hacking, and other curios

Yeah, I think that should work except that if other mods set their priority to highest then you you're not guaranteed to have yours go before theirs (I assume the order is based on mod loading or modID alphabetical) and if other mods set their priority to lowest then you're not guaranteed to have yours go after thiers. In fact, one or the other will not fully work because if you're first in order for the highest then you'll be first in order for the lowest, and vice versa. But at least you can say you tried. And it should work for mods where they leave the priority at default (normal).

Edited by jabelar

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.