Skip to content

Commit

Permalink
Fix Spirit Furnace not resuming after drained by hopper
Browse files Browse the repository at this point in the history
Closes #1058
  • Loading branch information
rubensworks committed Sep 9, 2024
1 parent d902f16 commit b7252b0
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,16 @@ public static CubeDetector getCubeDetector() {

@Override
protected void addItemHandlerCapabilities() {
LazyOptional<IItemHandler> itemHandlerBox = LazyOptional.of(() -> new ItemHandlerSlotMasked(getInventory(), SLOTS_DROP));
LazyOptional<IItemHandler> itemHandlerBox = LazyOptional.of(() -> new ItemHandlerSlotMasked(getInventory(), SLOTS_DROP) {
@Override
public ItemStack extractItem(int slot, int amount, boolean simulate) {
ItemStack extracted = super.extractItem(slot, amount, simulate);
if (!extracted.isEmpty() && !simulate) {
resetWork(false);
}
return extracted;
}
});
LazyOptional<IItemHandler> itemHandlerContainer = LazyOptional.of(() -> new ItemHandlerSlotMasked(getInventory(), SLOT_BOX, SLOT_CONTAINER));
addCapabilitySided(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, Direction.UP, itemHandlerBox);
addCapabilitySided(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, Direction.DOWN, itemHandlerBox);
Expand Down

0 comments on commit b7252b0

Please sign in to comment.