Refactor, use if statements instead of switches

This commit is contained in:
tastybento 2023-07-08 08:39:00 -07:00
parent 325c9c2351
commit 39a6fc5006

View File

@ -164,10 +164,11 @@ public class BlueprintBlock {
* @since 1.24.0 * @since 1.24.0
*/ */
public void setGlowingText(Side side, boolean glowingText) { public void setGlowingText(Side side, boolean glowingText) {
switch (side) { if (side == Side.FRONT) {
case FRONT -> this.glowingText = glowingText; this.glowingText = glowingText;
default -> this.glowingText2 = glowingText; } else {
}; this.glowingText2 = glowingText;
}
} }
@ -177,10 +178,8 @@ public class BlueprintBlock {
* @since 1.24.0 * @since 1.24.0
*/ */
public boolean isGlowingText(Side side) { public boolean isGlowingText(Side side) {
return switch (side) { if (side == Side.FRONT) return glowingText;
case FRONT -> glowingText; return glowingText2;
default -> glowingText2;
};
} }
/** /**
@ -189,10 +188,8 @@ public class BlueprintBlock {
* @since 1.24.0 * @since 1.24.0
*/ */
public List<String> getSignLines(Side side) { public List<String> getSignLines(Side side) {
return switch (side) { if (side == Side.FRONT) return signLines;
case FRONT -> signLines; return signLines2;
default -> signLines2;
};
} }
/** /**
@ -201,12 +198,10 @@ public class BlueprintBlock {
* @since 1.24.0 * @since 1.24.0
*/ */
public void setSignLines(Side side, List<String> signLines) { public void setSignLines(Side side, List<String> signLines) {
switch (side) { if (side == Side.FRONT) {
case FRONT -> this.signLines = signLines; this.signLines = signLines;
default -> this.signLines2 = signLines; } else {
}; this.signLines2 = signLines;
}
} }
} }