Why null check when you can default null
This commit is contained in:
parent
b7cc707737
commit
bc82276e62
43
src/main/java/baritone/cache/ChunkPacker.java
vendored
43
src/main/java/baritone/cache/ChunkPacker.java
vendored
@ -143,29 +143,28 @@ public final class ChunkPacker implements Helper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static IBlockState pathingTypeToBlock(PathingBlockType type) {
|
public static IBlockState pathingTypeToBlock(PathingBlockType type) {
|
||||||
if (type != null) {
|
switch (type) {
|
||||||
switch (type) {
|
case AIR:
|
||||||
case AIR:
|
return Blocks.AIR.getDefaultState();
|
||||||
return Blocks.AIR.getDefaultState();
|
case WATER:
|
||||||
case WATER:
|
return Blocks.WATER.getDefaultState();
|
||||||
return Blocks.WATER.getDefaultState();
|
case AVOID:
|
||||||
case AVOID:
|
return Blocks.LAVA.getDefaultState();
|
||||||
return Blocks.LAVA.getDefaultState();
|
case SOLID:
|
||||||
case SOLID:
|
// Dimension solid types
|
||||||
// Dimension solid types
|
switch (mc.player.dimension) {
|
||||||
switch (mc.player.dimension) {
|
case -1:
|
||||||
case -1:
|
return Blocks.NETHERRACK.getDefaultState();
|
||||||
return Blocks.NETHERRACK.getDefaultState();
|
case 0:
|
||||||
case 0:
|
return Blocks.STONE.getDefaultState();
|
||||||
return Blocks.STONE.getDefaultState();
|
case 1:
|
||||||
case 1:
|
return Blocks.END_STONE.getDefaultState();
|
||||||
return Blocks.END_STONE.getDefaultState();
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// The fallback solid type
|
// The fallback solid type
|
||||||
return Blocks.STONE.getDefaultState();
|
return Blocks.STONE.getDefaultState();
|
||||||
}
|
default:
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user