Skip to content

Commit

Permalink
Prefill Array for recipes.craft to prevent NPEs
Browse files Browse the repository at this point in the history
Closes #1133
  • Loading branch information
kindlich committed Jan 6, 2021
1 parent 56d703e commit 73548ff
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ public IItemStack craft(IItemStack[][] contents) {
}

ItemStack[] iContents = new ItemStack[width * height];
Arrays.fill(iContents, ItemStack.EMPTY);

for(int i = 0; i < height; i++) {
for(int j = 0; j < contents[i].length; j++) {
if(contents[i][j] != null) {
Expand Down

0 comments on commit 73548ff

Please sign in to comment.