Skip to content

Commit

Permalink
Simplify if
Browse files Browse the repository at this point in the history
  • Loading branch information
KorewaLidesu committed Sep 20, 2023
1 parent d47afb8 commit b82ae3c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,8 @@ public static void cleanup() {
@Nonnull
@Override
public IPartModel getStaticModels() {
if (this.isActive() && this.isPowered()) {
return MODELS_HAS_CHANNEL;
} else if (this.isPowered()) {
return MODELS_ON;
} else {
return MODELS_OFF;
}
return this.isPowered() ?
(this.isActive() ? MODELS_HAS_CHANNEL : MODELS_ON) : MODELS_OFF;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,8 @@ public void nextOrientation() {
}

public void setPointedOrientation(@Nullable EnumFacing dir) {
if (dir == null) {
pointedAdjacent = null;
} else {
pointedAdjacent = new SingleAdjacent(this, dir, ConnectionType.UNDEFINED);
}
pointedAdjacent =
dir == null ? null : new SingleAdjacent(this, dir, ConnectionType.UNDEFINED);
}

@Override
Expand Down

0 comments on commit b82ae3c

Please sign in to comment.