Skip to content

Commit

Permalink
feat: switch to using isIngredient instead of canProcess
Browse files Browse the repository at this point in the history
  • Loading branch information
klikli-dev committed Aug 20, 2024
1 parent a67d077 commit efaa092
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void tick(Player player) {
if (!blockPos.equals(this.lastHitBlockPos) || !ItemStack.isSameItemSameComponents(stack, this.lastStack)) {
this.lastHitBlockPos = blockPos;
this.lastStack = stack;
this.lastCanProcess = this.canProcess(hasCraftingBehaviour.craftingBehaviour(), stack);
this.lastCanProcess = this.isIngredient(hasCraftingBehaviour.craftingBehaviour(), stack);
}
}
//TODO: here handle theurgy blocks without a crafting behaviour
Expand Down Expand Up @@ -80,8 +80,8 @@ public void tick(Player player) {
}
}

private boolean canProcess(CraftingBehaviour<?, ?, ?> craftingBehaviour, ItemStack stack) {
if (craftingBehaviour.canProcess(stack))
private boolean isIngredient(CraftingBehaviour<?, ?, ?> craftingBehaviour, ItemStack stack) {
if (craftingBehaviour.isIngredient(stack))
return true;

var fluidHandler = stack.getCapability(Capabilities.FluidHandler.ITEM);
Expand All @@ -92,7 +92,7 @@ private boolean canProcess(CraftingBehaviour<?, ?, ?> craftingBehaviour, ItemSta
if (fluidStack.isEmpty())
return false;

return craftingBehaviour.canProcess(fluidStack);
return craftingBehaviour.isIngredient(fluidStack);
}

private void reset() {
Expand Down

0 comments on commit efaa092

Please sign in to comment.