give akashic records a comparator output
This commit is contained in:
parent
54147e86b6
commit
7614e01b75
1 changed files with 14 additions and 0 deletions
|
@ -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>();
|
||||
|
|
Loading…
Reference in a new issue