Skip to content

Commit

Permalink
area enter event: ignore portal, bed, vehicle
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jul 2, 2020
1 parent 3fb6672 commit b12fc36
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Expand Up @@ -85,7 +85,7 @@ public boolean couldMatchEntity(String text) {
return genericCouldMatchChecks(text, this::couldMatchEntity);
}

public boolean couldMatchVehicle(String text) {
public boolean exactMatchesVehicle(String text) {
if (text.equals("vehicle")) {
return true;
}
Expand All @@ -102,6 +102,13 @@ public boolean couldMatchVehicle(String text) {
}
return true;
}
return false;
}

public boolean couldMatchVehicle(String text) {
if (exactMatchesVehicle(text)) {
return true;
}
return genericCouldMatchChecks(text, this::couldMatchVehicle);
}

Expand Down
Expand Up @@ -66,6 +66,12 @@ public boolean couldMatch(ScriptPath path) {
if (path.eventArgLowerAt(2).equals("biome") || exactMatchesEnum(path.eventArgLowerAt(2), Biome.values())) {
return false;
}
if (exactMatchesVehicle(path.eventArgLowerAt(2))) {
return false;
}
if (path.eventArgLowerAt(2).equals("bed") || path.eventArgLowerAt(2).equals("portal")) {
return false;
}
return true;
}

Expand Down

0 comments on commit b12fc36

Please sign in to comment.