Skip to content

Commit

Permalink
resource pack status event: status switch
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Aug 30, 2021
1 parent 7180246 commit 1159925
Showing 1 changed file with 10 additions and 0 deletions.
Expand Up @@ -20,6 +20,8 @@ public class ResourcePackStatusScriptEvent extends BukkitScriptEvent {
//
// @Triggers when a player accepts, denies, successfully loads, or fails to download a resource pack.
//
// @Switch status:<status> to only process the event when a specific status is returned. Same status names as returned by 'context.status'.
//
// @Context
// <context.status> returns an ElementTag of the status. Can be: SUCCESSFULLY_LOADED, DECLINED, FAILED_DOWNLOAD, ACCEPTED.
//
Expand All @@ -41,6 +43,14 @@ public boolean couldMatch(ScriptPath path) {
return path.eventLower.startsWith("resource pack status");
}

@Override
public boolean matches(ScriptPath path) {
if (!runGenericSwitchCheck(path, "status", status.asString())) {
return false;
}
return super.matches(path);
}

public boolean enabled;

@Override
Expand Down

0 comments on commit 1159925

Please sign in to comment.