calclavia Posted June 24, 2012 Posted June 24, 2012 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. Quote http://calclavia.com/uploads/banner.png[/img]
LexManos Posted June 24, 2012 Posted June 24, 2012 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. Quote I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
calclavia Posted June 25, 2012 Author Posted June 25, 2012 On 6/24/2012 at 10:02 PM, LexManos said: 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... Quote http://calclavia.com/uploads/banner.png[/img]
LexManos Posted June 25, 2012 Posted June 25, 2012 It is totally replaceable, go learn how! Quote I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
calclavia Posted June 25, 2012 Author Posted June 25, 2012 On 6/25/2012 at 12:22 AM, LexManos said: It is totally replaceable, go learn how! That might defeat the purpose then because other mods who wants to use potions would be overwritten by my potion replacement... Quote http://calclavia.com/uploads/banner.png[/img]
LexManos Posted June 25, 2012 Posted June 25, 2012 Not unless you're a moron. Quote I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
calclavia Posted June 25, 2012 Author Posted June 25, 2012 On 6/25/2012 at 1:39 AM, LexManos said: Not unless you're a moron. I am pretty much on potions. But thanks for your help anyway. I will look into it. It was very helpful. Quote http://calclavia.com/uploads/banner.png[/img]
OvermindDL1 Posted June 25, 2012 Posted June 25, 2012 What Lex means is that through reflection you can resize it if it is too small for your use, without base edits. Quote
calclavia Posted June 25, 2012 Author Posted June 25, 2012 On 6/25/2012 at 4:23 AM, OvermindDL1 said: 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. Quote http://calclavia.com/uploads/banner.png[/img]
OvermindDL1 Posted June 25, 2012 Posted June 25, 2012 On 6/25/2012 at 1:01 PM, calclavia said: Quote 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. Quote
Recommended Posts
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.