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

Hello!

 

I've been making a mod that seeks to change how chat is displayed, allowing for a better chat screen.

 

I've got to the point using reflection where the game uses my NewChatGUI rather than vanilla's one, but still I need to reuse a lot of the functionality from the existing NewChatGUI, such as the rendering, meaning I have to copy some of the read-only Minecraft code. Some methods will change but some will stay exactly the same (jibberish names and all)

 

Is that bad? If I'm redistributing code that I didn't write (though edited large parts of it), is this against the ethos of modding? Is this frowned upon by modders?

 

Note, I'm not able to render over the existing chat GUI, it's gotta be fundamentally changed.

 

Hopefully this makes sense, if not I should be able to put the code onto github

Why don't extend NewChatGui and use accesstransformer to make the needed fields/methods public.

 

And don't use reflections if you can use forge's events.

 

Cancel InitGuiEvent.Pre when the chat should be opened and open your own on InitGuiEvent.Post

  • Author

Thank you for your guidance! Took me a little while to figure out the access transformers but got there in the end. This thread really helped:

but took me a while to work out I had to DM the MCPBot http://mcpbot.bspk.rs/help and have it tell me what line to put into the accesstransformers.cfg

 

However, is that enough? What I mean is that when I want to override a certain function, like rendering or the one that splits up the line, after changing it to protected I still have to copy the entire method to perhaps only make a change to like one line, keeping every other line in the function just a copy of Mojang's code.

 

Is this still ok? I suppose there's not much else I can do so I hope so haha

  • Author

oops it posted again

Edited by SamMan
oops it posted again

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.