Skip to content

Hoppers stop sending items through once they've been emptied and must be manually updated to work again. #20

@libalpm64

Description

@libalpm64

Expected behavior

When items are moved out of a hopper via ejectItems -> hopperPush the state isn't being recomputed.

In the tryMoveInItem method in HopperBlockEntity
we do setChanged(level, pos, state);

The main issue is that we are calling the static method setChanged(level, pos, state) from BlockEntity not the instance method blockEntity.setChanged()

protected static void setChanged(Level level, BlockPos pos, BlockState state) {                
       level.blockEntityChanged(pos);                                                             
       if (!state.isAir()) {                                                                      
           level.updateNeighbourForOutputSignal(pos, state.getBlock());                           
       }                                                                                          
} 

instead of

@Override                                                                                      
public void setChanged() {                                                                     
      super.setChanged();                                                                        
      recomputeFullState(this);                                                                  
  } 

we need to update line 254 to do blockEntity.setChanged() instead as it fixes the hopper full state.

Observed/Actual behavior

Hoppers stop sending items after being emptied.

Steps/models to reproduce

Red-stone pulses do not matter as-well all you need to do is try and setup a hopper system and wait for it to be emptied.

Plugin and Datapack List

N/A

Folia version

N/A

Other

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions