Skip to content

Commit

Permalink
Fix exception with empty item tag (#47)
Browse files Browse the repository at this point in the history
* Update WEUtils.java

* Update WEUtils.java

* Revert "Update WEUtils.java"

This reverts commit 7868bd8.
  • Loading branch information
TylerS1066 authored Sep 15, 2024
1 parent 74b8552 commit c7f3db0
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ public static Counter<Material> getBlockContents(@NotNull BaseBlock block) {
blockItems = blockNBT.getListTag("Items", LinTagType.compoundTag());
} catch (NoSuchElementException e) {
return null;
} catch (IllegalStateException e) {
return null; // empty list
}
for (var t : blockItems.value()) {
if (!(t instanceof LinCompoundTag ct))
Expand Down

0 comments on commit c7f3db0

Please sign in to comment.