-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
Determination format modernization Part.2 #2689
base: dev
Are you sure you want to change the base?
Conversation
@@ -34,6 +34,9 @@ public class RedstoneScriptEvent extends BukkitScriptEvent implements Listener { | |||
|
|||
public RedstoneScriptEvent() { | |||
registerCouldMatcher("redstone recalculated"); | |||
this.<RedstoneScriptEvent, ElementTag>registerDetermination(null, ElementTag.class, (evt, context, current) -> { | |||
evt.event.setNewCurrent(current.asInt()); |
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.
these rewrites are removing the error checks that the prior impl had
return switch (name) { | ||
case "location" -> location; | ||
case "item" -> item; | ||
case "recipe_id" -> new ElementTag(Utilities.namespacedKeyToString(event.getRecipe().getKey()), true); |
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.
this is a functionality change
Updated |
@@ -44,6 +45,11 @@ public class FurnaceStartsSmeltingScriptEvent extends BukkitScriptEvent implemen | |||
|
|||
public FurnaceStartsSmeltingScriptEvent() { | |||
registerCouldMatcher("furnace starts smelting <item>"); | |||
this.<FurnaceStartsSmeltingScriptEvent, DurationTag>registerDetermination(null, DurationTag.class, (evt, context, time) -> { | |||
if (time.asElement().isInt()) { |
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.
this still has no error handling that was previously available. Go test a bad determination on an old build vs your version and compare the results
Updating the determination format for the following ScriptEvents :
FurnaceStartsSmeltingScriptEvent
RedstoneScriptEvent
EntityHealsScriptEvent
PlayerCraftsItemScriptEvent
PlayerItemTakesDamageScriptEvent