Jump to content

Error when compiling classes...


Davidee

Recommended Posts

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).

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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)

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.