Simplified switch statements and minor formatting

This commit is contained in:
matt
2019-03-27 11:36:26 -04:00
parent 67fd0668ee
commit 1424998327
8 changed files with 50 additions and 86 deletions

View File

@ -66,7 +66,7 @@ public class FloatingTreeRemover implements BlockTool {
@Override
public boolean actPrimary(Platform server, LocalConfiguration config,
Player player, LocalSession session, Location clicked) {
Player player, LocalSession session, Location clicked) {
final World world = (World) clicked.getExtent();
final BlockState state = world.getBlock(clicked.toVector().toBlockPoint());
@ -132,13 +132,8 @@ public class FloatingTreeRemover implements BlockTool {
if (visited.add(next)) {
BlockState state = world.getBlock(next);
BlockType type = state.getBlockType();
switch (type.getResource().toUpperCase()) {
case "AIR":
case "CAVE_AIR":
case "VOID_AIR":
case "SNOW":
continue;
if (state.getBlockType().getMaterial().isAir() || state.getBlockType() == BlockTypes.SNOW) {
continue;
}
if (isTreeBlock(state.getBlockType())) {
queue.addLast(next);
@ -156,4 +151,4 @@ public class FloatingTreeRemover implements BlockTool {
return visited;
}
}
}