Jump to content

Recommended Posts

Posted

I don't seem any people using this, but, even in your own code you could easily expand this array to whatever you want.

If your mod uses ids that are > then the current size, resize and preserve the array.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

I don't seem any people using this, but, even in your own code you could easily expand this array to whatever you want.

If your mod uses ids that are > then the current size, resize and preserve the array.

 

Yes but that counts as modifying base files which is not really a good way to do it...

 

Correct me if I am wrong, but what you are telling me to do is to change Potion.potionTypes[32] into [4096]? Or do you mean something else? I can't change the array because it is public static FINAL so it's not replaceable...

Posted

What Lex means is that through reflection you can resize it if it is too small for your use, without base edits.

 

Thank you. Now that was actually helpful :) I didn't know what reflection was until you mentioned it.

Reflection is one of the black magics of java (the other being custom classloaders).  It can bypass security restrictions, change the unchangeable, and easily make you incompatible with other things that use reflection on similar things if not careful.  ;)

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.