From c7f3db01ec102ca30d9c8ec1762242c18832a669 Mon Sep 17 00:00:00 2001 From: TylerS1066 Date: Sun, 15 Sep 2024 10:51:51 -0500 Subject: [PATCH] Fix exception with empty item tag (#47) * Update WEUtils.java * Update WEUtils.java * Revert "Update WEUtils.java" This reverts commit 7868bd88f2700c7c4122a844feaee90e758f63e9. --- .../java/net/countercraft/movecraft/repair/util/WEUtils.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/net/countercraft/movecraft/repair/util/WEUtils.java b/src/main/java/net/countercraft/movecraft/repair/util/WEUtils.java index 634c405..92c324d 100644 --- a/src/main/java/net/countercraft/movecraft/repair/util/WEUtils.java +++ b/src/main/java/net/countercraft/movecraft/repair/util/WEUtils.java @@ -161,6 +161,8 @@ public static Counter 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))