Skip to content

Commit

Permalink
Fixed an UnsupportedOperationException when getting contents of wild …
Browse files Browse the repository at this point in the history
…chests (#158)
  • Loading branch information
OmerBenGera committed Jan 28, 2023
1 parent 24bd547 commit 059a626
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -85,7 +85,9 @@ public ItemStack getItem(int i) {
public NonNullList<ItemStack> getContents() {
List<WildContainerItem> contents = ((WChest) chest).getWildContents();
NonNullList<ItemStack> nonNullList = NonNullList.a(contents.size(), ItemStack.b);
contents.forEach(wildContainerItem -> nonNullList.add(nonNullList.size(), ((WildContainerItemImpl) wildContainerItem).getHandle()));
int index = 0;
for (WildContainerItem wildContainerItem : contents)
nonNullList.set(index++, ((WildContainerItemImpl) wildContainerItem).getHandle());
return nonNullList;
}

Expand Down

0 comments on commit 059a626

Please sign in to comment.