@@ -76,7 +76,7 @@ public static ItemStack applyToItem(@Nullable final ItemStack item, final boolea
7676
7777 try {
7878 return NMS_NBT_BRIDGE .applyUnbreakableTag (item , "Unbreakable" , unbreakable );
79- } catch (Throwable t ) {
79+ } catch (InvocationTargetException | IllegalAccessException | InstantiationException t ) {
8080 logger .logError (t , () -> "Failed to apply legacy unbreakable" );
8181 return item ;
8282 }
@@ -101,7 +101,7 @@ public static boolean isUnbreakable(@Nullable final ItemStack item) {
101101 if (!NMS_NBT_BRIDGE .isReflectionReady ()) return false ;
102102 try {
103103 return NMS_NBT_BRIDGE .hasBooleanTag (item , "Unbreakable" );
104- } catch (Throwable e ) {
104+ } catch (InvocationTargetException | IllegalAccessException | InstantiationException e ) {
105105 logger .logError (e , () -> "Failed to invoke the item to check if it is unbreakable." );
106106 return false ;
107107 }
@@ -276,7 +276,7 @@ public void setBooleanTag(@Nonnull final Object tag, @Nonnull final String key,
276276 * @return the NBTTagCompound if exist or create new one.
277277 */
278278 public Object getOrCreateNbtTag (@ Nonnull final Object nmsItem ) throws InvocationTargetException , IllegalAccessException , InstantiationException {
279- boolean hasTag = (Boolean ) hasTagMethod .invoke (nmsItem );
279+ boolean hasTag = (boolean ) hasTagMethod .invoke (nmsItem );
280280 return hasTag
281281 ? getTagMethod .invoke (nmsItem )
282282 : nbtTagConstructor .newInstance ();
0 commit comments