Skip to content

Commit

Permalink
Fix Infuser drops (Closes #100)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrbysco committed Sep 27, 2024
1 parent 9323fec commit a6f030a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Lev
public void onRemove(BlockState state, Level level, BlockPos pos, BlockState newState, boolean isMoving) {
if (!state.is(newState.getBlock())) {
BlockEntity blockentity = level.getBlockEntity(pos);
if (blockentity instanceof InfuserBlockEntity) {
IItemHandler handler = level.getCapability(Capabilities.ItemHandler.BLOCK, pos, null);
if (blockentity instanceof InfuserBlockEntity infuserBlockEntity) {
IItemHandler handler = infuserBlockEntity.getItemHandler(null);
if (handler != null) {
for (int i = 0; i < handler.getSlots(); ++i) {
Containers.dropItemStack(level, pos.getX(), pos.getY(), pos.getZ(), handler.getStackInSlot(i));
Expand Down

0 comments on commit a6f030a

Please sign in to comment.