Skip to content

Commit

Permalink
implement core improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Sep 20, 2021
1 parent 9714f3b commit d59f313
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
Expand Up @@ -120,7 +120,7 @@ public boolean couldMatchArea(String text) {
}
}
}
addPossibleCouldMatchFailReason("Not a valid area label: '" + text + "'");
addPossibleCouldMatchFailReason("Not a valid area label", text);
return false;
}

Expand All @@ -130,7 +130,7 @@ public boolean exactMatchesEnum(String text, final Enum<?>[] enumVals) {
return true;
}
}
addPossibleCouldMatchFailReason("Does not match required enumeration: '" + text + "'");
addPossibleCouldMatchFailReason("Does not match required enumeration", text);
return false;
}

Expand All @@ -146,7 +146,7 @@ public boolean couldMatchEnum(String text, final Enum<?>[] enumVals) {
}
}
}
addPossibleCouldMatchFailReason("Does not match required enumeration: '" + text + "'");
addPossibleCouldMatchFailReason("Does not match required enumeration", text);
return false;
}

Expand Down Expand Up @@ -183,7 +183,7 @@ public boolean couldMatchInventory(String text) {
}
}
}
addPossibleCouldMatchFailReason("Not a valid inventory label: '" + text + "'");
addPossibleCouldMatchFailReason("Not a valid inventory label", text);
return false;
}

Expand All @@ -204,7 +204,7 @@ public boolean couldMatchEntity(String text) {
}
}
}
addPossibleCouldMatchFailReason("Not a valid entity label: '" + text + "'");
addPossibleCouldMatchFailReason("Not a valid entity label", text);
return false;
}

Expand All @@ -218,7 +218,7 @@ public boolean exactMatchEntity(String text) {
if (EntityTag.matches(text)) {
return true;
}
addPossibleCouldMatchFailReason("Not a valid entity label: '" + text + "'");
addPossibleCouldMatchFailReason("Not a valid entity label", text);
return false;
}

Expand All @@ -238,16 +238,16 @@ public boolean exactMatchesVehicle(String text) {
if (EntityTag.matches(text)) {
EntityTag entity = EntityTag.valueOf(text, CoreUtilities.noDebugContext);
if (entity == null) {
addPossibleCouldMatchFailReason("Broken entity/vehicle reference: '" + text + "'");
addPossibleCouldMatchFailReason("Broken entity/vehicle reference", text);
return false;
}
if (!Vehicle.class.isAssignableFrom(entity.getEntityType().getBukkitEntityType().getEntityClass())) {
addPossibleCouldMatchFailReason("Entity type is not a vehicle: '" + text + "'");
addPossibleCouldMatchFailReason("Entity type is not a vehicle", text);
return false;
}
return true;
}
addPossibleCouldMatchFailReason("Not a valid inventory vehicle: '" + text + "'");
addPossibleCouldMatchFailReason("Not a valid vehicle label", text);
return false;
}

Expand All @@ -268,7 +268,7 @@ public boolean couldMatchVehicle(String text) {
}
}
}
addPossibleCouldMatchFailReason("Not a valid vehicle label: '" + text + "'");
addPossibleCouldMatchFailReason("Not a valid vehicle label", text);
return false;
}

Expand Down Expand Up @@ -299,7 +299,7 @@ public boolean couldMatchBlockOrItem(String text) {
}
}
}
addPossibleCouldMatchFailReason("Not a valid block or item label: '" + text + "'");
addPossibleCouldMatchFailReason("Not a valid block or item label", text);
return false;
}

Expand All @@ -322,7 +322,7 @@ public boolean couldMatchBlock(String text, Function<Material, Boolean> requirem
if (mat.getMaterial().isBlock() && (requirement == null || requirement.apply(mat.getMaterial()))) {
return true;
}
addPossibleCouldMatchFailReason("Material is an item not a block: '" + text + "'");
addPossibleCouldMatchFailReason("Material is an item not a block", text);
return false;
}
if (isAdvancedMatchable(text)) {
Expand All @@ -333,7 +333,7 @@ public boolean couldMatchBlock(String text, Function<Material, Boolean> requirem
}
}
}
addPossibleCouldMatchFailReason("Not a valid block label: '" + text + "'");
addPossibleCouldMatchFailReason("Not a valid block label", text);
return false;
}

Expand All @@ -347,7 +347,7 @@ public boolean couldMatchItem(String text) {
if (MaterialTag.matches(text)) {
MaterialTag mat = MaterialTag.valueOf(text, CoreUtilities.noDebugContext);
if (mat == null || !mat.getMaterial().isItem()) {
addPossibleCouldMatchFailReason("Material is not an item: '" + text + "'");
addPossibleCouldMatchFailReason("Material is not an item", text);
return false;
}
return true;
Expand All @@ -368,7 +368,7 @@ public boolean couldMatchItem(String text) {
}
}
}
addPossibleCouldMatchFailReason("Not a valid item label: '" + text + "'");
addPossibleCouldMatchFailReason("Not a valid item label", text);
return false;
}

Expand Down
Expand Up @@ -73,7 +73,7 @@ public boolean matches(ScriptPath path) {

@Override
public String getName() {
return "PlayerClosesInv";
return "PlayerClosesInventory";
}

@Override
Expand Down
Expand Up @@ -70,7 +70,7 @@ public boolean matches(ScriptPath path) {

@Override
public String getName() {
return "PlayerOpensInv";
return "PlayerOpensInventory";
}

@Override
Expand Down

0 comments on commit d59f313

Please sign in to comment.