-
Notifications
You must be signed in to change notification settings - Fork 20
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
Effects API #117
base: develop
Are you sure you want to change the base?
Effects API #117
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At a cursory glance, this looks pretty good. Might want to get a few opinions on the GUI background though.
...n/java/net/modificationstation/stationapi/impl/effect/packet/SendAllEffectsPlayerPacket.java
Outdated
Show resolved
Hide resolved
...fects-api-v0/src/main/java/net/modificationstation/stationapi/api/effect/EffectRegistry.java
Outdated
Show resolved
Hide resolved
...fects-api-v0/src/main/java/net/modificationstation/stationapi/mixin/effects/MixinEntity.java
Show resolved
Hide resolved
Change the base to 2.0-alpha.3 branch. Master is for minor updates only. |
Done |
Unfucked your branch for you. |
No, don't merge your old changes. Reset to my changes. |
a196e30
to
f92e50c
Compare
Current effect frame texture is very simple, but like any other texture it can be altered with texturepack. I'm not sure about official modern texture, current one looks fine
There is an infinity effect in example above |
I'd possibly say just use the achievement toast background directly for this. Saves adding a StAPI-specific texture. |
An API for creating effects that works for all entities (including not-living ones like items and minecarts).
Effect can stay for specified amount of ticks or it can last infinity:
Effects applied to the player will be visible in the top left corner:
In player inventory effects will display their name and description (compatible with HMI):
Effect names have support for minecraft color codes:
Effects have
onStart
,process
,onEnd
methods for large behaviour customisation, same aswriteCustomData
andreadCustomData
for storing custom valuesTo register effects you need to listen a specific event (common side):
You can set affect on entity like this:
player.addEffect(effectID);
where effectID is Identifier.There are also other helper functions that you can directly call from entity to operate with effects.
Effects works on both client and server.
PR is ready for review