Skip to content

Commit

Permalink
Do nothing when frequency is set with null colours.
Browse files Browse the repository at this point in the history
  • Loading branch information
covers1624 committed Sep 22, 2024
1 parent 866e9ac commit b9f1015
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/main/java/codechicken/enderstorage/api/Frequency.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,24 @@ public static Frequency fromString(String left, String middle, String right, UUI
return new Frequency(c1, c2, c3, owner, ownerName);
}

public Frequency setLeft(EnumColour left) {
this.left = left;
public Frequency setLeft(@Nullable EnumColour left) {
if (left != null) {
this.left = left;
}
return this;
}

public Frequency setMiddle(EnumColour middle) {
this.middle = middle;
public Frequency setMiddle(@Nullable EnumColour middle) {
if (middle != null) {
this.middle = middle;
}
return this;
}

public Frequency setRight(EnumColour right) {
this.right = right;
public Frequency setRight(@Nullable EnumColour right) {
if (right != null) {
this.right = right;
}
return this;
}

Expand All @@ -102,7 +108,7 @@ public boolean hasOwner() {
return owner != null && ownerName != null;
}

public Frequency set(EnumColour[] colours) {
public Frequency set(@Nullable EnumColour[] colours) {
setLeft(colours[0]);
setMiddle(colours[1]);
setRight(colours[2]);
Expand Down

0 comments on commit b9f1015

Please sign in to comment.