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

Feature Request: Fire an event when affecting an Entity with Radiation debuffs #256

Open
mallrat208 opened this issue Jan 31, 2018 · 0 comments

Comments

@mallrat208
Copy link

mallrat208 commented Jan 31, 2018

I'm working on my add-on for Cyberware/Robotic Parts for 1.12.2 and one of the items I'd like to add is an augment that at the cost of energy helps protect against DR Radiation. The problem I run into is that DR pretty much only looks for armor for the purposes of determining radiation protection.

If DR also posted an event with the Entity affected as well as their current protection rating, it'd make it rather easy for add-on's like mine to listen for that event and if needed either modify the protection amount that should be used, cancel the event, or trigger additional effects to the entity being affected.

As a proof of concept, I made a local branch with these changes to see how it would work out. The LivingRadiationEvent (RadiationEffectsEvent?) extends LivingEvent and tracks the EntityLivingBase affected and their protection value.
https://github.com/mallrat208/DeepResonance/blob/7bcd7153a6fecd5901c49435cfa10fd326fcbb1a/src/main/java/mcjty/deepresonance/radiation/LivingRadiationEvent.java#L7-L34

The LivingRadiationEvent is posted and the protection value is reset based on the results of the event. If the event is canceled the potion effects never get applied.
https://github.com/mallrat208/DeepResonance/blob/7bcd7153a6fecd5901c49435cfa10fd326fcbb1a/src/main/java/mcjty/deepresonance/radiation/RadiationTickEvent.java#L265-L277

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

1 participant