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

I've made an ASM transformer to transform a method in the CommandBase class when I used it in the dev environment it worked fine but when I compiled it, it crashed. I tested both on MultiMC and the normal minecraft client both end up with the same result.

 

Right now I have it stripped down to a minimal transformation, so I could see where the fault lies, but I can't find it.

 

crash: https://paste.ee/p/nP0is

log: https://paste.ee/p/BEpYD

Transformer: https://gist.github.com/karelmikie3/f26a6ccc1495678f7c897d359e2961b7

Loader: https://gist.github.com/karelmikie3/e1f5fe78e49f3dbbfecc64c9bc9d4a57

jar: http://puu.sh/rHPtD.jar

  • Author

I am Transforming the CommandBase.checkPermission method so I can run the permission check through custom checks of my mod that includes setting custom permission requirements for the commands themselves. I first had one of methods injected into it but it crashed so to eliminate any possible coding error I removed it and made it simply return true.

 

PS. I know about the CommandEvent in CommandHandler.executeCommand but that doesn't reach every call to the method such as the /help command checks if the player can use the command and so does auto tab completion.

Can't you override ALL the commans with custom command?

I mean, you copy list of all registered commands and then clear the orginal one. Now for each of those commands, you register your command "handler" instantiated with the command.

In your command "handler", you implement command and redirect all method calls to original command, except for the method you want to change...

 

This will work in 97% of the cases. If you want to get additional 3%, you can go for dynamic class generation of subclass of command with overriden methods. Though if you're not experienced enough with ASM, this is not recommended.

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.