Posted June 28, 20205 yr 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
June 28, 20205 yr 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 Vampirism
June 29, 20205 yr 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
June 29, 20205 yr Author oops it posted again Edited June 29, 20205 yr by SamMan oops it posted again
June 30, 20205 yr i don't think there is any better way, then copy & replace. Edited June 30, 20205 yr by cheaterpaul Vampirism
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.