Jump to content

1.11.2 new Potions with new PotionEffects. Forge design question


aw_wolfe

Recommended Posts

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

 

 

Link to comment
Share on other sites

 

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.

Link to comment
Share on other sites

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

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.