mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Geiger counter comparator output
This commit is contained in:
parent
b00e3b9efb
commit
8f2a858f52
@ -131,4 +131,22 @@ public class GeigerCounter extends BlockContainer {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasComparatorInputOverride() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getComparatorInputOverride(World world, int x, int y, int z, int side) {
|
||||||
|
TileEntityGeiger te = (TileEntityGeiger)world.getTileEntity(x, y, z);
|
||||||
|
if (te == null) return 0;
|
||||||
|
|
||||||
|
float rad = te.check();
|
||||||
|
|
||||||
|
// 0 at exactly 0 rads/sec
|
||||||
|
// +1 per 5 rads/sec
|
||||||
|
// 15 at 75+ rads/sec
|
||||||
|
return Math.min((int)Math.ceil(rad / 5f), 15);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -65,6 +65,7 @@ public class TileEntityGeiger extends TileEntity implements SimpleComponent, IIn
|
|||||||
public float check() {
|
public float check() {
|
||||||
return ChunkRadiationManager.proxy.getRadiation(worldObj, xCoord, yCoord, zCoord);
|
return ChunkRadiationManager.proxy.getRadiation(worldObj, xCoord, yCoord, zCoord);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Optional.Method(modid = "OpenComputers")
|
@Optional.Method(modid = "OpenComputers")
|
||||||
public String getComponentName() {
|
public String getComponentName() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user