aw_wolfe Posted April 19, 2017 Share Posted April 19, 2017 I'm looking at starting a new mod with new potions and potion effects. From what I can tell in 1.11.2, the potion registry is private and you are unable to register directly to it. In researching around, I've found PotionCore, awesome to all those that post their mod's code, on github that basically shows creating an entire extended potion system to support the new potions/potion effects. I should be able to follow the example and get my project working, but I was wondering IF it was necessary to do, or am I missing some way to register new potions, potiontypes, etc.... without having to create an entire support structure for it.....also, does anyone know why this is the direction Forge went with the potion registry (some older examples seem to indicate you could register directly). Thanks, Tony Quote Link to comment Share on other sites More sharing options...
aw_wolfe Posted April 20, 2017 Author Share Posted April 20, 2017 I could easily be wrong (am most of the time), but scanning through and trying a lit bit, I came to the following... ( I deleted the code I was actually trying)... but summarizing...I was trying to register the mod potiontype and mod potion in a similar fashion as in the Potion.registerPotions, and PotionType.registerPotionTypes was causing errors.... Registries are marked final and Potion constructor is marked private....I did not simply go to the GameRegistry.register(). Looks like the PotionCore code uses the basic framework of the classes, but then relies on trapping events and checking to see if instanceof is modded potion, then implements it's code, rather than using the built in system to have it call the potioneffect,etc... It seems using the built in system would be better if possible. I can play around and see if I can get it to work by registering a ModPotionType, ModPotion, ModPotionEffect straight to the GameRegistry and see if that automatically takes care of implementing the events for me, just wasn't assuming it would, which is why I was trying to look at how the vanilla potions were created and handled. Quote Link to comment Share on other sites More sharing options...
aw_wolfe Posted April 20, 2017 Author Share Posted April 20, 2017 I just think I need to pay attention better to where Forge takes over from MC. Mimicing the MC method wouldn't work now that I think about it. Difficult to think through sometimes when not able to focus on this for more than a few minutes at a time during the day. Thanks, Tony Quote Link to comment Share on other sites More sharing options...
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.