give akashic records a comparator output

This commit is contained in:
yrsegal@gmail.com 2022-04-25 10:05:43 -04:00
parent 39bb13d39f
commit 4576afff65

View file

@ -24,6 +24,20 @@ public class BlockAkashicRecord extends Block implements EntityBlock {
return new BlockEntityAkashicRecord(pPos, pState); 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 @Override
public void onRemove(BlockState pState, Level pLevel, BlockPos pPos, BlockState pNewState, boolean pIsMoving) { public void onRemove(BlockState pState, Level pLevel, BlockPos pPos, BlockState pNewState, boolean pIsMoving) {
var seen = new HashSet<BlockPos>(); var seen = new HashSet<BlockPos>();