Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable Modifiers #7

Closed
Kovak opened this issue Mar 9, 2019 · 11 comments
Closed

Configurable Modifiers #7

Kovak opened this issue Mar 9, 2019 · 11 comments

Comments

@Kovak
Copy link

Kovak commented Mar 9, 2019

I noticed you have a note for yourself in the code, but it would be really nice to switch away from the current EnumBaubleModifier to a real registry

@Kovak Kovak mentioned this issue Mar 9, 2019
@CursedFlames
Copy link
Owner

Current progress on this: the bauble modifier registry is implemented in modifier_registry, however it won't work for any non-attribute modifier effects, due to the hacky workaround that is currently used to apply modifiers - every 10 ticks, every single possible modifier is removed, then modifiers on the baubles players are wearing are reapplied. This is obviously far from ideal, and calling every single removeModifier method would be even worse.

The reason I did this originally was due to the lack of events for bauble equips/unequips. I've asked for events in Azanor/Baubles#273, but haven't gotten any response yet.

If events don't get implemented in Baubles, these are the possible ways I see of dealing with equipping/unequipping:

  • Call every single removeModifier method every n ticks, then reapply active modifiers. Not good.
  • Store a list of player's currently equipped items somewhere, then every n ticks check if baubles have changed, and if so call the respective removeModifier and applyModifier methods. This solution seems the most viable, although it might be prone to issues on death or leave/rejoin.
  • Use ASM to add events to baubles. I have no experience with ASM, and this seems like a bad idea, but it could work?

Also interesting to note that Quality Tools also implements bauble modifiers. Might be a good idea to investigate how it handles it, although it doesn't seem to be open source.

@Kovak
Copy link
Author

Kovak commented Apr 6, 2019

Do the baubles not currently trigger a LivingEquipmentChangeEvent event?

@CursedFlames
Copy link
Owner

Just checked (with Baubles 1.5.2) and it appears they do not.

@Kovak
Copy link
Author

Kovak commented Apr 14, 2019

Just sent a PR to add an event modeled after LivingEquipmentChangeEvent for you:

Azanor/Baubles#292

Hopefully they will be receptive.

@CursedFlames
Copy link
Owner

Thanks.

@CursedFlames
Copy link
Owner

Looks like the Baubles PR is never going to be accepted, however Modifiers, the 1.14 version of this system for curios, does use the modifier registry.

@Kovak
Copy link
Author

Kovak commented Oct 23, 2019

does curios replace bountiful baubles?

@CursedFlames
Copy link
Owner

Curios is basically the equivalent of Baubles for 1.14, except with a bunch of nicer features and a significantly more responsive developer. BountifulBaubles and Modifiers both use Curios instead of Baubles on 1.14. (Splitting Modifiers into its own mod was an unrelated decision to this, I just figured that doing so would allow me to expand on its features eventually.)

@Kovak
Copy link
Author

Kovak commented Oct 23, 2019

Oh that's awesome. I'll be moving my development over to 1.14 pretty soon and will definitely be adding an integration for MK Ultra attributes on your modifiers.

@CursedFlames
Copy link
Owner

You might want to hold off on doing that just a bit, because I'll probably be refactoring how modifiers work - will probably have a registry for modifier effects, and have data pack-defined modifiers with 1 or more effects from those registered effects. That way it's configurable by non-modders but also extensible by modders.

@Kovak
Copy link
Author

Kovak commented Oct 23, 2019

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants