give akashic records a comparator output
This commit is contained in:
parent
39bb13d39f
commit
4576afff65
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);
|
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>();
|
||||||
|
|
Loading…
Reference in a new issue