Skip to content

Commit

Permalink
simplify logic
Browse files Browse the repository at this point in the history
  • Loading branch information
PrototypeTrousers committed Jun 5, 2021
1 parent 69da377 commit 3fe2797
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ protected boolean canFitNewOutputs() {
if (this.isOutputsFull && !hasNotifiedOutputs()) return false;
else {
this.isOutputsFull = false;
metaTileEntity.removeNotifiedOutput(getOutputInventory());
metaTileEntity.removeNotifiedOutput(getOutputTank());
metaTileEntity.getNotifiedItemOutputList().clear();
metaTileEntity.getNotifiedFluidOutputList().clear();
}
return true;
}
Expand Down Expand Up @@ -209,8 +209,8 @@ protected void trySearchNewRecipe() {
if (currentRecipe != null && setupAndConsumeRecipeInputs(currentRecipe))
setupRecipe(currentRecipe);
// Inputs have been inspected.
metaTileEntity.removeNotifiedInput(importInventory);
metaTileEntity.removeNotifiedInput(importFluids);
metaTileEntity.getNotifiedItemInputList().clear();
metaTileEntity.getNotifiedFluidInputList().clear();
}

public void forceRecipeRecheck() {
Expand Down
14 changes: 0 additions & 14 deletions src/main/java/gregtech/api/metatileentity/MetaTileEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -283,20 +283,6 @@ public <T> void addNotifiedOutput(T output) {
}
}

public <T> void removeNotifiedInput(T input) {
if (input instanceof IItemHandlerModifiable)
this.notifiedItemInputList.remove(input);
else if (input instanceof FluidTank)
this.notifiedFluidInputList.remove(input);
}

public <T> void removeNotifiedOutput(T input) {
if (input instanceof IItemHandlerModifiable)
this.notifiedItemOutputList.remove(input);
else if (input instanceof FluidTank)
this.notifiedFluidOutputList.remove(input);
}

/**
* Adds a trait to this meta tile entity
* traits are objects linked with meta tile entity and performing certain
Expand Down

0 comments on commit 3fe2797

Please sign in to comment.