Jump to content

Potion


calclavia

Recommended Posts

I noticed the potionTypes array has a limited amount (32) of potions a mod can add. Can Forge increase this array to a number big like 4096 so there won't be potion ID conflicts? I currently have two potion effects and 2/32 is a lot (not counting the vanilla potions).

 

I could do a pull request if you want.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

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.