Less String Comparisons, More Cleanup

This commit is contained in:
Sn0wStorm
2018-10-27 23:24:24 +02:00
parent f206e45d03
commit 124267898e
2 changed files with 28 additions and 14 deletions
+6 -1
View File
@@ -628,7 +628,12 @@ public class Barrel implements InventoryHolder {
default:
wood = spigot.getRelative(0, 0, -1);
}
return LegacyUtil.getWoodType(wood);
try {
return LegacyUtil.getWoodType(wood);
} catch (NoSuchFieldError | NoClassDefFoundError noSuchFieldError) {
// Using older minecraft versions some fields and classes do not exist
return 0;
}
}
// returns the Sign of a large barrel, the spigot if there is none