-
-
Notifications
You must be signed in to change notification settings - Fork 406
Add ExprTimeLived #8134
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
base: dev/feature
Are you sure you want to change the base?
Add ExprTimeLived #8134
Conversation
Co-authored-by: SirSmurfy2 <82696841+Absolutionism@users.noreply.github.com>
Co-authored-by: SirSmurfy2 <82696841+Absolutionism@users.noreply.github.com>
Co-authored-by: SirSmurfy2 <82696841+Absolutionism@users.noreply.github.com>
Co-authored-by: SirSmurfy2 <82696841+Absolutionism@users.noreply.github.com>
Co-authored-by: SirSmurfy2 <82696841+Absolutionism@users.noreply.github.com>
…g but delete and remove_all
Co-authored-by: SirSmurfy2 <82696841+Absolutionism@users.noreply.github.com>
Co-authored-by: SirSmurfy2 <82696841+Absolutionism@users.noreply.github.com>
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.
Last one, re-request for approval
Co-authored-by: SirSmurfy2 <82696841+Absolutionism@users.noreply.github.com>
I will add the import when I get home and run some final tests then request review |
|
||
@Override | ||
public void change(Event event, Object @Nullable [] delta, ChangeMode mode) { | ||
int newTicks = 1; |
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.
It might be better to store this and valueToSet
as longs to account for overflows. That is, if the value is set to high for an int, clamp it down to the max int value.
Problem
There's no current way to get the time lived of an entity
Solution
Added ExprTimeLived
time lived of %entities%
%entities%'s time alive
etc
Testing Completed
Test 1
expected off by a tick? I'm assuming since it doesn't wait for the cow to actually "start living"?
that's the reason I added the getTicksLived directly just to make sure this wasn't an error in the expression
Test 2 - edited provided example
Test 3
Supporting Information
No breaking changes

Just out of curiosity I checked back and from what I can tell even in ancient versions of the game getTicksLived and setTicksLived has stayed the same
Completes: none
Related: none