Switch to throwable and readd check for glass / stained glass

This commit is contained in:
scorbett123 2022-07-06 14:45:54 +01:00
parent 3e7f9039c4
commit 8d480cefb9

View File

@ -152,8 +152,8 @@ public interface MovementHelper extends ActionCosts, Helper {
try { // A dodgy catch-all at the end, for most blocks with default behaviour this will work, however where blocks are special this will error out, and we can handle it when we have this information
return Optional.of(block.isPassable(null, null));
} catch (NullPointerException exception) {
System.out.println("Error");
} catch (Throwable exception) {
System.out.println("The block " + state.getBlock().getLocalizedName() + " requires a special case due to the exception " + exception.getMessage());
return Optional.empty();
}
}
@ -369,6 +369,10 @@ public interface MovementHelper extends ActionCosts, Helper {
return Optional.empty();
}
if (block == Blocks.GLASS || block == Blocks.STAINED_GLASS) {
return TRUE;
}
if (block instanceof BlockSlab) {
if (!Baritone.settings().allowWalkOnBottomSlab.value) {
if (((BlockSlab) block).isDouble()) {