Skip to content

Commit

Permalink
minor cleaning (isEmpty usage)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Feb 4, 2020
1 parent a2de331 commit 7e43556
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ else if (name.equals("inventory")) {

@EventHandler
public void onCraftItem(PrepareAnvilEvent event) {
if (event.getInventory().getViewers().size() == 0) {
if (event.getInventory().getViewers().isEmpty()) {
return;
}
HumanEntity humanEntity = event.getInventory().getViewers().get(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ && matchesMaterialList(loc.clone().add(0, -1, 0), mats, attribute)) {
}

public World getWorld() {
if (pairs.size() == 0) {
if (pairs.isEmpty()) {
return null;
}
return pairs.get(0).high.getWorld();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2188,7 +2188,7 @@ else if (item != null && item.hasItemMeta() && item.getItemMeta().hasDisplayName
return null;
}
ListTag slots = ListTag.getListFor(attribute.getContextObject(1), attribute.context);
if (slots.size() == 0) {
if (slots.isEmpty()) {
if (!attribute.hasAlternative()) {
Debug.echoError("Cannot get a list of zero slots.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public void adjust(Mechanism mechanism) {
// -->
if (mechanism.matches("age")) {
ListTag list = mechanism.valueAsType(ListTag.class);
if (list.size() == 0) {
if (list.isEmpty()) {
Debug.echoError("Missing value for 'age' mechanism!");
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public void adjust(Mechanism mechanism) {
// -->
if (mechanism.matches("framed")) {
ListTag list = mechanism.valueAsType(ListTag.class);
if (list.size() == 0) {
if (list.isEmpty()) {
Debug.echoError("Missing value for 'framed' mechanism!");
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public void adjust(Mechanism mechanism) {
// -->
if (mechanism.matches("tame")) {
ListTag list = mechanism.valueAsType(ListTag.class);
if (list.size() == 0) {
if (list.isEmpty()) {
Debug.echoError("Missing value for 'tame' mechanism!");
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ public void execute(ScriptEntry scriptEntry) {
Debug.echoError("Invalid player!");
continue;
}
if ((scores == null || scores.size() == 0) && perScores == null) {
if ((scores == null || scores.isEmpty()) && perScores == null) {
Debug.echoError("Missing or invalid 'scores' parameter.");
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,10 @@ public void execute(final ScriptEntry scriptEntry) {
Debug.echoError("Must specify a valid location!");
return;
}
if ((location_list != null && location_list.size() == 0) || (locations != null && locations.size() == 0)) {
if ((location_list != null && location_list.isEmpty()) || (locations != null && locations.isEmpty())) {
return;
}
if (materialList.size() == 0) {
if (materialList.isEmpty()) {
Debug.echoError("Must specify a valid material!");
return;
}
Expand Down

0 comments on commit 7e43556

Please sign in to comment.