Posted December 21, 201212 yr In previous versions, new classes in "net.minecraft.src" would have their package stripped upon recompilation (like other minecraft classes). However, in the newer version, new classes in a specific minecraft package (i.e. "net.minecraft.nbt") will keep their packages upon recompilation, possibly causing errors (especially when using these classes to access protected methods and fields).
December 21, 201212 yr Short answer, if you're putting ANY of your code into net.minecraft.* you're doing it wrong, as we will not support you. I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
December 21, 201212 yr And if you need to access protected stuff, AT is your friend. Read the EAQ before posting! OR ELSE! This isn't building better software, its trying to grab a place in the commit list of a highly visible github project. www.forgeessentials.com Don't PM me, I don't check this account unless I have to.
December 21, 201212 yr Author It's just to access protected methods/fields... Why write a access transformer to change the visibility of three methods? And reflection is even uglier. Is there any easy way to add an access transformer to an existing mod?
December 21, 201212 yr Typically, if you need to access package private things, you're doing it wrong. If you absolutly MUST access package private things you should use reflection. If you ABSOLUTLY MUST access package private things repeatidly and you think that it is something other modders would like to have access to, submit a PR to get it on the official AT list in forge, or write your own coremod. But, in reality, 99% of the time when a modder thinks they need to do something stupid like that, they are wrong. Explain what you are doing and someone will probably point you in the right direction. I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
December 21, 201212 yr Author Alright, so I use this functionality in a couple of mods to access protected methods - NBTEdit mod - call write, load, and get the Tag map (can probably use some vanilla methods + 1 reflection call here) Mob Spawn Controls - access the spawn list fields in order to modify vanilla spawning (only option here is reflection or AT)
December 21, 201212 yr Mob Spawn Controls - access the spawn list fields in order to modify vanilla spawning (only option here is reflection or AT) or, you know use the functionality fml preovides... I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
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.