mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-12-01 23:23:22 +01:00
Refactor, use if statements instead of switches
This commit is contained in:
parent
325c9c2351
commit
39a6fc5006
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user