give akashic records a comparator output

This commit is contained in:
yrsegal@gmail.com 2022-04-25 10:05:43 -04:00
parent 54147e86b6
commit 7614e01b75

View file

@ -24,6 +24,20 @@ public class BlockAkashicRecord extends Block implements EntityBlock {
return new BlockEntityAkashicRecord(pPos, pState);
}
@Override
public boolean hasAnalogOutputSignal(BlockState pState) {
return true;
}
@Override
public int getAnalogOutputSignal(BlockState pState, Level pLevel, BlockPos pPos) {
BlockEntity be = pLevel.getBlockEntity(pPos);
if (be instanceof BlockEntityAkashicRecord record) {
return Math.min(15, record.getCount());
}
return 0;
}
@Override
public void onRemove(BlockState pState, Level pLevel, BlockPos pPos, BlockState pNewState, boolean pIsMoving) {
var seen = new HashSet<BlockPos>();