-
-
Notifications
You must be signed in to change notification settings - Fork 109
10 block event modernizations #2774
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
Are you sure you want to change the base?
Conversation
return false; | ||
} | ||
String changeType = path.eventArgLowerAt(2); | ||
if (changeType.equals("raises")) { |
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.
nitpick, but these could probably be a switch statement
this.<CauldronLevelChangeScriptEvent, ElementTag>registerOptionalDetermination(null, ElementTag.class, (evt, context, level) -> { | ||
if (level.isInt()) { | ||
evt.newLevel = level.asInt(); | ||
((Levelled) evt.event.getNewState().getBlockData()).setLevel(newLevel); |
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.
Have you tested this with e.g. an empty cauldron getting a level or a cauldron emptying? I believe the point of the deprecation was that while lava/water_cauldron
are levelled, the base cauldron
isn't.
String changeType = path.eventArgLowerAt(2); | ||
if (changeType.equals("raises")) { | ||
if (event.getNewLevel() <= event.getOldLevel()) { | ||
if (path.eventArgLowerAt(2).equals("raises")) { |
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.
Is there a reason you replaced the variable with calling eventArgLowerAt
for every check?
public FurnaceBurnsItemScriptEvent() { | ||
registerCouldMatcher("furnace burns <item>"); | ||
this.<FurnaceBurnsItemScriptEvent, DurationTag>registerDetermination(null, DurationTag.class, (evt, context, time) -> { | ||
evt.event.setBurnTime(time.getTicksAsInt()); |
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.
I believe this is a breaking change? Previously inputting just a number would go through the ElementTag
handling and be set as ticks, now it'll be converted into a DurationTag
and be set as seconds (unless setBurnTime
is in seconds instead of ticks for some reason).
#getOldLevel
and#getNewLevel
, modernized determination format, minor getContext format change