Skip to content

Commit

Permalink
Minor improvements from SonarCloud
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Aug 12, 2024
1 parent fa439ed commit d18a496
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,10 @@ private void setBlock(BlockProbability prob, int x, int y, int z, List<SkyGridBl
}
// Convert to deep
if (y < 0) {
if (blockMat == Material.STONE) {
blockMat = Material.DEEPSLATE;

} else if (blockMat == Material.COBBLESTONE) {
blockMat = Material.COBBLED_DEEPSLATE;
} else {
blockMat = Enums.getIfPresent(Material.class, "DEEPSLATE_" + blockMat.name()).or(blockMat);
switch (blockMat) {
case STONE -> blockMat = Material.DEEPSLATE;
case COBBLESTONE -> blockMat = Material.COBBLED_DEEPSLATE;
default -> blockMat = Enums.getIfPresent(Material.class, "DEEPSLATE_" + blockMat.name()).or(blockMat);
}
}

Expand Down
5 changes: 1 addition & 4 deletions src/test/java/world/bentobox/skygrid/SettingsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,8 @@ public class SettingsTest {

private Settings s;

/**
* @throws java.lang.Exception
*/
@Before
public void setUp() throws Exception {
public void setUp() {
s = new Settings();
}

Expand Down

0 comments on commit d18a496

Please sign in to comment.