Make computer not detecting devices explicit.

This commit is contained in:
Florian Nücke
2022-02-05 14:06:45 +01:00
parent 581994327d
commit 2b3858bd14
2 changed files with 8 additions and 2 deletions

View File

@@ -133,7 +133,7 @@ public final class ComputerBlock extends HorizontalDirectionalBlock implements E
public void neighborChanged(final BlockState state, final Level level, final BlockPos pos, final Block changedBlock, final BlockPos changedBlockPos, final boolean isMoving) {
final BlockEntity blockEntity = level.getBlockEntity(pos);
if (blockEntity instanceof final ComputerBlockEntity computer) {
computer.handleNeighborChanged();
computer.handleNeighborChanged(changedBlockPos);
}
}

View File

@@ -132,9 +132,10 @@ public final class ComputerBlockEntity extends ModBlockEntity implements Termina
return terminalUsers;
}
public void handleNeighborChanged() {
public void handleNeighborChanged(final BlockPos pos) {
if (level != null && !level.isClientSide()) {
virtualMachine.busController.scheduleBusScan();
busElement.handleNeighborChanged(pos);
}
}
@@ -382,6 +383,11 @@ public final class ComputerBlockEntity extends ModBlockEntity implements Termina
return getBlockState().getValue(ComputerBlock.FACING) != direction;
}
@Override
protected boolean canDetectDevicesTowards(@Nullable final Direction direction) {
return false;
}
@Override
public Optional<UUID> getDeviceIdentifier(final Device device) {
if (devices.contains(device)) {