Skip to content

Commit

Permalink
update for core event determine fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jun 28, 2023
1 parent 5c525e1 commit 33fe369
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Expand Up @@ -42,8 +42,8 @@ public class EntityTeleportedByPortalScriptEvent extends BukkitScriptEvent imple
public EntityTeleportedByPortalScriptEvent() {
registerCouldMatcher("<entity> teleported by portal");
registerSwitches("to", "portal_type");
registerDetermination("target_world", WorldTag.class, (context, targetWorld) -> event.setTargetWorld(targetWorld.getWorld()));
registerTextDetermination("remove_target_world", () -> event.setTargetWorld(null));
this.<EntityTeleportedByPortalScriptEvent, WorldTag>registerDetermination("target_world", WorldTag.class, (evt, context, targetWorld) -> evt.event.setTargetWorld(targetWorld.getWorld()));
this.<EntityTeleportedByPortalScriptEvent>registerTextDetermination("remove_target_world", (evt) -> evt.event.setTargetWorld(null));
}

EntityPortalReadyEvent event;
Expand Down
Expand Up @@ -46,13 +46,13 @@ public class EntityCombustsScriptEvent extends BukkitScriptEvent implements List

public EntityCombustsScriptEvent() {
registerCouldMatcher("<entity> combusts");
registerOptionalDetermination(null, ObjectTag.class, (context, determination) -> {
this.<EntityCombustsScriptEvent, ObjectTag>registerOptionalDetermination(null, ObjectTag.class, (evt, context, determination) -> {
if (determination instanceof ElementTag element && element.isInt()) {
event.setDuration(element.asInt());
evt.event.setDuration(element.asInt());
return true;
}
else if (determination.canBeType(DurationTag.class)) {
event.setDuration(determination.asType(DurationTag.class, context).getSecondsAsInt());
evt.event.setDuration(determination.asType(DurationTag.class, context).getSecondsAsInt());
return true;
}
return false;
Expand Down

0 comments on commit 33fe369

Please sign in to comment.