Skip to content

Commit

Permalink
Fix Statue Table drop issue (Closes #99)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrbysco committed Dec 30, 2024
1 parent 6a54edf commit aea90a6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public InteractionResult useWithoutItem(BlockState state, Level level, BlockPos
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 StatueTableBlockEntity) {
IItemHandler handler = level.getCapability(Capabilities.ItemHandler.BLOCK, pos, null);
if (blockentity instanceof StatueTableBlockEntity tableBlockEntity) {
IItemHandler handler = tableBlockEntity.getHandler();
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 aea90a6

Please sign in to comment.