mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Merge pull request #2614 from PewPewCricket/master
Update PWR OpenComputers Compat
This commit is contained in:
commit
fd348a40e7
@ -582,7 +582,7 @@ public class TileEntityPWRController extends TileEntityMachineBase implements IG
|
||||
@Callback(direct = true)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getHeat(Context context, Arguments args) {
|
||||
return new Object[] {coreHeat, hullHeat};
|
||||
return new Object[] {coreHeat, hullHeat, coreHeatCapacity, hullHeatCapacityBase};
|
||||
}
|
||||
|
||||
@Callback(direct = true)
|
||||
@ -612,7 +612,7 @@ public class TileEntityPWRController extends TileEntityMachineBase implements IG
|
||||
@Callback(direct = true)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
return new Object[] {coreHeat, hullHeat, flux, rodTarget, rodLevel, amountLoaded, progress, processTime, tanks[0].getFill(), tanks[0].getMaxFill(), tanks[1].getFill(), tanks[1].getMaxFill()};
|
||||
return new Object[] {coreHeat, hullHeat, coreHeatCapacity, hullHeatCapacityBase, flux, rodTarget, rodLevel, amountLoaded, progress, processTime, tanks[0].getFill(), tanks[0].getMaxFill(), tanks[1].getFill(), tanks[1].getMaxFill()};
|
||||
}
|
||||
|
||||
@Callback(direct = true, limit = 4)
|
||||
|
||||
@ -22,7 +22,12 @@ local mt = {
|
||||
}
|
||||
setmetatable(const, mt)
|
||||
|
||||
const.fullCoreHeatMAX = 9000000
|
||||
for address, _ in component.list("ntm_pwr_control") do
|
||||
pwrController = address
|
||||
end
|
||||
|
||||
_, _, const.coreHeatCapacity = call(pwrController, "getHeat")
|
||||
const.fullCoreHeatMAX = const.coreHeatCapacity * 0.9
|
||||
const.coldCoolantLevelMIN = 10000
|
||||
const.hotCoolantLevelMAX = 0.5
|
||||
|
||||
@ -88,10 +93,6 @@ buttons[9] = newButton(94, 9, 12, 2, 0x00FF00, 0x00AA00, function() coolantLossE
|
||||
|
||||
buttons[10] = newButton(107, 8, 5, 3, 0xFF0000, 0xAA0000, function() runSig = false end)
|
||||
|
||||
for address, _ in component.list("ntm_pwr_control") do
|
||||
pwrController = address
|
||||
end
|
||||
|
||||
gpu.setForeground(0xAAAAAA)
|
||||
|
||||
--Control rods
|
||||
@ -203,7 +204,7 @@ while (runSig == true) do
|
||||
rodLevel = call(pwrController, "getLevel")
|
||||
|
||||
coreHeat, _ = call(pwrController, "getHeat")
|
||||
coreHeat = coreHeat//1000000
|
||||
coreHeat = coreHeat // (const.coreHeatCapacity / 10)
|
||||
|
||||
for _, b in pairs(buttons) do
|
||||
drawButton(b, b.colorUp)
|
||||
@ -243,7 +244,7 @@ while (runSig == true) do
|
||||
|
||||
fullCoreHeat, fullHullHeat = call(pwrController, "getHeat")
|
||||
coldCoolantLevel, _, hotCoolantLevel, maxHotCoolantLevel = call(pwrController, "getCoolantInfo")
|
||||
|
||||
|
||||
coldCoolantOutflow = coldCoolantLevel - prevCoolantFlow
|
||||
hotCoolantOutflow = hotCoolantLevel - prevHotCoolantFlow
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user