Skip to content

Commit

Permalink
Prevent strange crash problem from happening. See #170 log. Chute doe…
Browse files Browse the repository at this point in the history
…s not check item validity before insertion.

Close #170.
  • Loading branch information
MarbleGateKeeper committed May 10, 2024
1 parent b391891 commit 9aafe27
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public int getSlots() {
@Override
public @NotNull ItemStack insertItem(int slot, @NotNull ItemStack stack, boolean simulate) {
if(!be.getCopyTarget().isEmpty()) return stack;
if(!isItemValid(slot,stack)) return stack; // Prevent strange crash problem from happening. See #170 log. Chute does not check item validity before insertion.
else{
if(!simulate){
be.setCopyTarget(stack);
Expand All @@ -48,9 +49,6 @@ public int getSlotLimit(int slot) {

@Override
public boolean isItemValid(int slot, @NotNull ItemStack stack) {
for(var entry:PrintEntries.ENTRIES.values()){
if(entry.match(stack)) return true;
}
return false;
return Printing.match(stack)!=null;
}
}

0 comments on commit 9aafe27

Please sign in to comment.