diff --git a/src/main/java/com/mrbysco/forcecraft/blocks/infuser/InfuserBlock.java b/src/main/java/com/mrbysco/forcecraft/blocks/infuser/InfuserBlock.java index 95c043b8..126e9d69 100644 --- a/src/main/java/com/mrbysco/forcecraft/blocks/infuser/InfuserBlock.java +++ b/src/main/java/com/mrbysco/forcecraft/blocks/infuser/InfuserBlock.java @@ -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));