Fixed duplication bug involving reinforced hoppers
@@ -57,13 +57,17 @@ public class ReinforcedHopperBlock extends HopperBlock implements IReinforcedBlo
@Override
public void onRemove(BlockState state, Level level, BlockPos pos, BlockState newState, boolean isMoving) {
- if (state.getBlock() != newState.getBlock()) {
+ if (state.is(newState.getBlock())) {
if (level.getBlockEntity(pos) instanceof ReinforcedHopperBlockEntity be) {
+ if (!isMoving)
Containers.dropContents(level, pos, be);
+
level.updateNeighbourForOutputSignal(pos, this);
}
- super.onRemove(state, level, pos, newState, isMoving);
+ if (state.hasBlockEntity() && (!state.is(newState.getBlock()) || !newState.hasBlockEntity())) {
+ level.removeBlockEntity(pos);
+ }
}
}
