From 007ea0a17011dc4470c85e887d5db331ccb95d22 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 24 May 2018 16:39:09 -0400 Subject: [PATCH 1/5] Fixed server crash when mixing tiers next to accelerator controller --- src/main/java/cr0s/warpdrive/data/AcceleratorSetup.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/cr0s/warpdrive/data/AcceleratorSetup.java b/src/main/java/cr0s/warpdrive/data/AcceleratorSetup.java index d3eecbdd..3fb08e07 100644 --- a/src/main/java/cr0s/warpdrive/data/AcceleratorSetup.java +++ b/src/main/java/cr0s/warpdrive/data/AcceleratorSetup.java @@ -288,10 +288,10 @@ public class AcceleratorSetup extends GlobalPosition { // count main magnets final int indexTier = (trajectoryPoint.type & TrajectoryPoint.MASK_TIERS) - 1; - if ((trajectoryPoint.type & TrajectoryPoint.MAGNETS_HORIZONTAL) != 0) { + if ((trajectoryPoint.type & TrajectoryPoint.MAGNETS_HORIZONTAL) != 0 && indexTier >= 0) { countMagnets[indexTier] += 2; } - if ((trajectoryPoint.type & TrajectoryPoint.MAGNETS_VERTICAL) != 0) { + if ((trajectoryPoint.type & TrajectoryPoint.MAGNETS_VERTICAL) != 0 && indexTier >= 0) { countMagnets[indexTier] += 2; } From bb8b3a471baaa52e1372e9454e36338de1b1e68e Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 24 May 2018 17:05:36 -0400 Subject: [PATCH 2/5] Code cleanup --- .../assets/warpdrive/lua.ComputerCraft/common/warpdriveCommons | 2 +- .../lua.ComputerCraft/warpdriveForceFieldController/startup | 2 +- .../lua.OpenComputers/common/usr/lib/warpdriveCommons.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/assets/warpdrive/lua.ComputerCraft/common/warpdriveCommons b/src/main/resources/assets/warpdrive/lua.ComputerCraft/common/warpdriveCommons index dc025466..307b8a1d 100644 --- a/src/main/resources/assets/warpdrive/lua.ComputerCraft/common/warpdriveCommons +++ b/src/main/resources/assets/warpdrive/lua.ComputerCraft/common/warpdriveCommons @@ -985,7 +985,7 @@ local function data_register(name, callbackRead, callbackSave, callbackName) callbackSave = function() end end - -- name callback is nill when not defined + -- name callback is nil when not defined data_handlers[name] = { read = callbackRead, save = callbackSave, name = callbackName } end diff --git a/src/main/resources/assets/warpdrive/lua.ComputerCraft/warpdriveForceFieldController/startup b/src/main/resources/assets/warpdrive/lua.ComputerCraft/warpdriveForceFieldController/startup index 004a4a92..9dfd71b2 100644 --- a/src/main/resources/assets/warpdrive/lua.ComputerCraft/warpdriveForceFieldController/startup +++ b/src/main/resources/assets/warpdrive/lua.ComputerCraft/warpdriveForceFieldController/startup @@ -179,7 +179,7 @@ function ffield_projector_key(character, keycode) return true elseif character == 'e' or character == 'E' then local projector = ffield_projector_getSelected() - if projector ~= nil and projector.device ~= nill then + if projector ~= nil and projector.device ~= nil then ffield_enable(projector) end return true diff --git a/src/main/resources/assets/warpdrive/lua.OpenComputers/common/usr/lib/warpdriveCommons.lua b/src/main/resources/assets/warpdrive/lua.OpenComputers/common/usr/lib/warpdriveCommons.lua index 23e9335e..126b3ce0 100644 --- a/src/main/resources/assets/warpdrive/lua.OpenComputers/common/usr/lib/warpdriveCommons.lua +++ b/src/main/resources/assets/warpdrive/lua.OpenComputers/common/usr/lib/warpdriveCommons.lua @@ -962,7 +962,7 @@ local function data_register(name, callbackRead, callbackSave, callbackName) callbackSave = function() end end - -- name callback is nill when not defined + -- name callback is nil when not defined data_handlers[name] = { read = callbackRead, save = callbackSave, name = callbackName } end From 4a4df79fe58f6a2e6ef62a64e4e99f1bd84faaea Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 24 May 2018 19:14:03 -0400 Subject: [PATCH 3/5] Fixed #326 reactor display not matching reality upon computer reboot --- .../warpdriveEnanReactorCore/startup | 135 +++++++++--------- .../warpdriveEnanReactorCore/startup | 135 +++++++++--------- 2 files changed, 132 insertions(+), 138 deletions(-) diff --git a/src/main/resources/assets/warpdrive/lua.ComputerCraft/warpdriveEnanReactorCore/startup b/src/main/resources/assets/warpdrive/lua.ComputerCraft/warpdriveEnanReactorCore/startup index 5c7b55d9..5a9ad497 100644 --- a/src/main/resources/assets/warpdrive/lua.ComputerCraft/warpdriveEnanReactorCore/startup +++ b/src/main/resources/assets/warpdrive/lua.ComputerCraft/warpdriveEnanReactorCore/startup @@ -7,33 +7,38 @@ local data ----------- Reactor support -local reactor_output = 0 -local reactor = nil +local reactor local reactorlasers = {} +local reactor_mode = 0 +local reactor_rate = 100 +local reactor_targetStability = 50 +local reactor_laserAmount = 10000 + +local reactor_output = 0 + function reactor_read(parData) data = parData - if data.reactor_mode == nil then data.reactor_mode = 0 end - if data.reactor_rate == nil then data.reactor_rate = 100 end - if data.reactor_targetStability == nil then data.reactor_targetStability = 50 end - if data.reactor_laserAmount == nil then data.reactor_laserAmount = 10000 end end function reactor_boot() if reactor ~= nil then w.writeLn("Booting Reactor...") local _, _, _, strMode, _ = reactor.state() - if strMode == "OFF" then - data.reactor_mode = 0 - elseif strMode == "MANUAL" then - data.reactor_mode = 1 - elseif strMode == "ABOVE" then - data.reactor_mode = 2 - elseif strMode == "RATE" then - data.reactor_mode = 3 + if strMode == "off" then + reactor_mode = 0 + elseif strMode == "unlimited" then + reactor_mode = 1 + elseif strMode == "above" then + reactor_mode = 2 + elseif strMode == "at_rate" then + reactor_mode = 3 else - data.reactor_mode = 0 + reactor_mode = 0 end + _, reactor_rate = reactor.releaseRate() + reactor_targetStability = 100.0 - reactor.instabilityTarget() + reactor_laserAmount = reactor.stabilizerEnergy() end end @@ -48,43 +53,35 @@ function reactor_key(character, keycode) reactor_laser() return true elseif character == 'o' or character == 'O' then -- O - data.reactor_mode = (data.reactor_mode + 1) % 4 + reactor_mode = (reactor_mode + 1) % 4 reactor_setMode() - w.data_save() return true elseif character == 'g' or character == 'G' then -- G - data.reactor_rate = data.reactor_rate - 1000 + reactor_rate = reactor_rate - 1000 reactor_setMode() - w.data_save() return true elseif character == 't' or character == 'T' then -- T - data.reactor_rate = data.reactor_rate + 1000 + reactor_rate = reactor_rate + 1000 reactor_setMode() - w.data_save() return true elseif character == 'j' or character == 'J' then -- J - data.reactor_laserAmount = data.reactor_laserAmount - 500 + reactor_laserAmount = reactor_laserAmount - 500 reactor_setLaser() - w.data_save() return true elseif character == 'u' or character == 'U' then -- U - data.reactor_laserAmount = data.reactor_laserAmount + 500 + reactor_laserAmount = reactor_laserAmount + 500 reactor_setLaser() - w.data_save() return true elseif character == '-' then -- - - data.reactor_targetStability = data.reactor_targetStability - 1 + reactor_targetStability = reactor_targetStability - 1 reactor_setTargetStability() - w.data_save() return true elseif character == '+' then -- + - data.reactor_targetStability = data.reactor_targetStability + 1 + reactor_targetStability = reactor_targetStability + 1 reactor_setTargetStability() - w.data_save() return true elseif character == 'c' or character == 'C' then -- C reactor_config() - w.data_save() return true end return false @@ -104,7 +101,7 @@ function reactor_page() for key, instability in pairs(instabilities) do w.setCursorPos(12, 2 + key) local stability = math.floor((100.0 - instability) * 10) / 10.0 - if stability >= data.reactor_targetStability then + if stability >= reactor_targetStability then w.setColorSuccess() else w.setColorWarning() @@ -155,7 +152,7 @@ function reactor_page() local energy = reactorlaser.wrap.energy() if not reactorlaser.wrap.hasReactor() then w.setColorDisabled() - elseif energy > 3 * data.reactor_laserAmount then + elseif energy > 3 * reactor_laserAmount then w.setColorSuccess() else w.setColorWarning() @@ -170,21 +167,21 @@ function reactor_page() w.write(" -----------------------------------------------") w.setCursorPos(1, 11) w.write("Output mode : ") - if data.reactor_mode == 0 then + if reactor_mode == 0 then w.setColorDisabled() w.write("hold") - elseif data.reactor_mode == 1 then + elseif reactor_mode == 1 then w.write("manual/unlimited") - elseif data.reactor_mode == 2 then - w.write("surplus above " .. data.reactor_rate .. " RF") + elseif reactor_mode == 2 then + w.write("surplus above " .. reactor_rate .. " RF") else - w.write("rated at " .. data.reactor_rate .. " RF") + w.write("rated at " .. reactor_rate .. " RF") end w.setColorNormal() w.setCursorPos( 1, 12) - w.write("Target stability: " .. data.reactor_targetStability .. "%") + w.write("Target stability: " .. reactor_targetStability .. "%") w.setCursorPos(30, 12) - w.write("Laser amount: " .. data.reactor_laserAmount) + w.write("Laser amount: " .. reactor_laserAmount) w.setColorControl() w.setCursorPos(1, 14) @@ -195,43 +192,43 @@ function reactor_page() end function reactor_setMode() - if data.reactor_rate < 1 then - data.reactor_rate = 1 - elseif data.reactor_rate > 100000 then - data.reactor_rate = 100000 + if reactor_rate < 1 then + reactor_rate = 1 + elseif reactor_rate > 100000 then + reactor_rate = 100000 end if reactor ~= nil then - if data.reactor_mode == 0 then + if reactor_mode == 0 then reactor.release(false) - elseif data.reactor_mode == 1 then + elseif reactor_mode == 1 then reactor.release(true) - elseif data.reactor_mode == 2 then - reactor.releaseAbove(data.reactor_rate) + elseif reactor_mode == 2 then + reactor.releaseAbove(reactor_rate) else - reactor.releaseRate(data.reactor_rate) + reactor.releaseRate(reactor_rate) end end end function reactor_setLaser() - if data.reactor_laserAmount < 1 then - data.reactor_laserAmount = 1 - elseif data.reactor_laserAmount > 100000 then - data.reactor_laserAmount = 100000 + if reactor_laserAmount < 1 then + reactor_laserAmount = 1 + elseif reactor_laserAmount > 100000 then + reactor_laserAmount = 100000 end - if reactor ~= nill then - data.reactor_laserAmount = reactor.stabilizerEnergy(data.reactor_laserAmount) + if reactor ~= nil then + reactor_laserAmount = reactor.stabilizerEnergy(reactor_laserAmount) end end function reactor_setTargetStability() - if data.reactor_targetStability < 1.0 then - data.reactor_targetStability = 1.0 - elseif data.reactor_targetStability > 100.0 then - data.reactor_targetStability = 100.0 + if reactor_targetStability < 1.0 then + reactor_targetStability = 1.0 + elseif reactor_targetStability > 100.0 then + reactor_targetStability = 100.0 end - if reactor ~= nill then - data.reactor_targetStability = 100.0 - reactor.instabilityTarget(100.0 - data.reactor_targetStability) + if reactor ~= nil then + reactor_targetStability = 100.0 - reactor.instabilityTarget(100.0 - reactor_targetStability) end end @@ -251,7 +248,7 @@ end function reactor_laser(side) for key, reactorlaser in pairs(reactorlasers) do if (side == nil) or (reactorlaser.side == side) then - reactorlaser.wrap.stabilize(data.reactor_laserAmount) + reactorlaser.wrap.stabilize(reactor_laserAmount) end end end @@ -267,7 +264,7 @@ function reactor_pulse(output) for key, instability in pairs(instabilities) do w.setCursorPos(12, 2 + key) local stability = math.floor((100.0 - instability) * 10) / 10 - if stability >= data.reactor_targetStability then + if stability >= reactor_targetStability then w.setColorSuccess() else w.setColorWarning() @@ -302,7 +299,7 @@ function reactor_pulse(output) end if not reactorlaser.wrap.hasReactor() then w.setColorDisabled() - elseif energy > 3 * data.reactor_laserAmount then + elseif energy > 3 * reactor_laserAmount then w.setColorSuccess() else w.setColorWarning() @@ -325,22 +322,22 @@ function reactor_config() else w.setColorNormal() w.setCursorPos(1, 4) - w.write("Reactor output rate (" .. w.format_integer(data.reactor_rate) .. " RF): ") - data.reactor_rate = w.input_readInteger(data.reactor_rate) + w.write("Reactor output rate (" .. w.format_integer(reactor_rate) .. " RF): ") + reactor_rate = w.input_readInteger(reactor_rate) reactor_setMode() w.setCursorPos(1, 5) w.write("Reactor output rate set") w.setCursorPos(1, 7) - w.write("Laser energy level (" .. w.format_integer(data.reactor_laserAmount) .. "): ") - data.reactor_laserAmount = w.input_readInteger(data.reactor_laserAmount) + w.write("Laser energy level (" .. w.format_integer(reactor_laserAmount) .. "): ") + reactor_laserAmount = w.input_readInteger(reactor_laserAmount) reactor_setLaser() w.setCursorPos(1, 8) w.write("Laser energy level set") w.setCursorPos(1, 10) - w.write("Reactor target stability (" .. w.format_integer(data.reactor_targetStability) .. "%): ") - data.reactor_targetStability = w.input_readInteger(data.reactor_targetStability) + w.write("Reactor target stability (" .. w.format_integer(reactor_targetStability) .. "%): ") + reactor_targetStability = w.input_readInteger(reactor_targetStability) reactor_setTargetStability() w.setCursorPos(1, 11) w.write("Reactor target stability set") diff --git a/src/main/resources/assets/warpdrive/lua.OpenComputers/warpdriveEnanReactorCore/startup b/src/main/resources/assets/warpdrive/lua.OpenComputers/warpdriveEnanReactorCore/startup index 34dc28b6..e042b661 100644 --- a/src/main/resources/assets/warpdrive/lua.OpenComputers/warpdriveEnanReactorCore/startup +++ b/src/main/resources/assets/warpdrive/lua.OpenComputers/warpdriveEnanReactorCore/startup @@ -6,33 +6,38 @@ local data ----------- Reactor support -local reactor_output = 0 -local reactor = nil +local reactor local reactorlasers = {} +local reactor_mode = 0 +local reactor_rate = 100 +local reactor_targetStability = 50 +local reactor_laserAmount = 10000 + +local reactor_output = 0 + function reactor_read(parData) data = parData - if data.reactor_mode == nil then data.reactor_mode = 0 end - if data.reactor_rate == nil then data.reactor_rate = 100 end - if data.reactor_targetStability == nil then data.reactor_targetStability = 50 end - if data.reactor_laserAmount == nil then data.reactor_laserAmount = 10000 end end function reactor_boot() if reactor ~= nil then w.writeLn("Booting Reactor...") local _, _, _, strMode, _ = reactor.state() - if strMode == "OFF" then - data.reactor_mode = 0 - elseif strMode == "MANUAL" then - data.reactor_mode = 1 - elseif strMode == "ABOVE" then - data.reactor_mode = 2 - elseif strMode == "RATE" then - data.reactor_mode = 3 + if strMode == "off" then + reactor_mode = 0 + elseif strMode == "unlimited" then + reactor_mode = 1 + elseif strMode == "above" then + reactor_mode = 2 + elseif strMode == "at_rate" then + reactor_mode = 3 else - data.reactor_mode = 0 + reactor_mode = 0 end + _, reactor_rate = reactor.releaseRate() + reactor_targetStability = 100.0 - reactor.instabilityTarget() + reactor_laserAmount = reactor.stabilizerEnergy() end end @@ -47,43 +52,35 @@ function reactor_key(character, keycode) reactor_laser() return true elseif character == 'o' or character == 'O' then -- O - data.reactor_mode = (data.reactor_mode + 1) % 4 + reactor_mode = (reactor_mode + 1) % 4 reactor_setMode() - w.data_save() return true elseif character == 'g' or character == 'G' then -- G - data.reactor_rate = data.reactor_rate - 1000 + reactor_rate = reactor_rate - 1000 reactor_setMode() - w.data_save() return true elseif character == 't' or character == 'T' then -- T - data.reactor_rate = data.reactor_rate + 1000 + reactor_rate = reactor_rate + 1000 reactor_setMode() - w.data_save() return true elseif character == 'j' or character == 'J' then -- J - data.reactor_laserAmount = data.reactor_laserAmount - 500 + reactor_laserAmount = reactor_laserAmount - 500 reactor_setLaser() - w.data_save() return true elseif character == 'u' or character == 'U' then -- U - data.reactor_laserAmount = data.reactor_laserAmount + 500 + reactor_laserAmount = reactor_laserAmount + 500 reactor_setLaser() - w.data_save() return true elseif character == '-' then -- - - data.reactor_targetStability = data.reactor_targetStability - 1 + reactor_targetStability = reactor_targetStability - 1 reactor_setTargetStability() - w.data_save() return true elseif character == '+' then -- + - data.reactor_targetStability = data.reactor_targetStability + 1 + reactor_targetStability = reactor_targetStability + 1 reactor_setTargetStability() - w.data_save() return true elseif character == 'c' or character == 'C' then -- C reactor_config() - w.data_save() return true end return false @@ -103,7 +100,7 @@ function reactor_page() for key, instability in pairs(instabilities) do w.setCursorPos(12, 2 + key) local stability = math.floor((100.0 - instability) * 10) / 10.0 - if stability >= data.reactor_targetStability then + if stability >= reactor_targetStability then w.setColorSuccess() else w.setColorWarning() @@ -154,7 +151,7 @@ function reactor_page() local energy = reactorlaser.wrap.energy() if not reactorlaser.wrap.hasReactor() then w.setColorDisabled() - elseif energy > 3 * data.reactor_laserAmount then + elseif energy > 3 * reactor_laserAmount then w.setColorSuccess() else w.setColorWarning() @@ -169,21 +166,21 @@ function reactor_page() w.write(" -----------------------------------------------") w.setCursorPos(1, 11) w.write("Output mode : ") - if data.reactor_mode == 0 then + if reactor_mode == 0 then w.setColorDisabled() w.write("hold") - elseif data.reactor_mode == 1 then + elseif reactor_mode == 1 then w.write("manual/unlimited") - elseif data.reactor_mode == 2 then - w.write("surplus above " .. data.reactor_rate .. " RF") + elseif reactor_mode == 2 then + w.write("surplus above " .. reactor_rate .. " RF") else - w.write("rated at " .. data.reactor_rate .. " RF") + w.write("rated at " .. reactor_rate .. " RF") end w.setColorNormal() w.setCursorPos( 1, 12) - w.write("Target stability: " .. data.reactor_targetStability .. "%") + w.write("Target stability: " .. reactor_targetStability .. "%") w.setCursorPos(30, 12) - w.write("Laser amount: " .. data.reactor_laserAmount) + w.write("Laser amount: " .. reactor_laserAmount) w.setColorControl() w.setCursorPos(1, 18) @@ -194,43 +191,43 @@ function reactor_page() end function reactor_setMode() - if data.reactor_rate < 1 then - data.reactor_rate = 1 - elseif data.reactor_rate > 100000 then - data.reactor_rate = 100000 + if reactor_rate < 1 then + reactor_rate = 1 + elseif reactor_rate > 100000 then + reactor_rate = 100000 end if reactor ~= nil then - if data.reactor_mode == 0 then + if reactor_mode == 0 then reactor.release(false) - elseif data.reactor_mode == 1 then + elseif reactor_mode == 1 then reactor.release(true) - elseif data.reactor_mode == 2 then - reactor.releaseAbove(data.reactor_rate) + elseif reactor_mode == 2 then + reactor.releaseAbove(reactor_rate) else - reactor.releaseRate(data.reactor_rate) + reactor.releaseRate(reactor_rate) end end end function reactor_setLaser() - if data.reactor_laserAmount < 1 then - data.reactor_laserAmount = 1 - elseif data.reactor_laserAmount > 100000 then - data.reactor_laserAmount = 100000 + if reactor_laserAmount < 1 then + reactor_laserAmount = 1 + elseif reactor_laserAmount > 100000 then + reactor_laserAmount = 100000 end - if reactor ~= nill then - data.reactor_laserAmount = reactor.stabilizerEnergy(data.reactor_laserAmount) + if reactor ~= nil then + reactor_laserAmount = reactor.stabilizerEnergy(reactor_laserAmount) end end function reactor_setTargetStability() - if data.reactor_targetStability < 1.0 then - data.reactor_targetStability = 1.0 - elseif data.reactor_targetStability > 100.0 then - data.reactor_targetStability = 100.0 + if reactor_targetStability < 1.0 then + reactor_targetStability = 1.0 + elseif reactor_targetStability > 100.0 then + reactor_targetStability = 100.0 end - if reactor ~= nill then - data.reactor_targetStability = 100.0 - reactor.instabilityTarget(100.0 - data.reactor_targetStability) + if reactor ~= nil then + reactor_targetStability = 100.0 - reactor.instabilityTarget(100.0 - reactor_targetStability) end end @@ -250,7 +247,7 @@ end function reactor_laser(side) for key, reactorlaser in pairs(reactorlasers) do if (side == nil) or (reactorlaser.side == side) then - reactorlaser.wrap.stabilize(data.reactor_laserAmount) + reactorlaser.wrap.stabilize(reactor_laserAmount) end end end @@ -269,7 +266,7 @@ function reactor_pulse(output) for key, instability in pairs(instabilities) do w.setCursorPos(12, 2 + key) local stability = math.floor((100.0 - instability) * 10) / 10 - if stability >= data.reactor_targetStability then + if stability >= reactor_targetStability then w.setColorSuccess() else w.setColorWarning() @@ -306,7 +303,7 @@ function reactor_pulse(output) end if not reactorlaser.wrap.hasReactor() then w.setColorDisabled() - elseif energy > 3 * data.reactor_laserAmount then + elseif energy > 3 * reactor_laserAmount then w.setColorSuccess() else w.setColorWarning() @@ -330,22 +327,22 @@ function reactor_config() else w.setColorNormal() w.setCursorPos(1, 4) - w.write("Reactor output rate (" .. w.format_integer(data.reactor_rate) .. " RF): ") - data.reactor_rate = w.input_readInteger(data.reactor_rate) + w.write("Reactor output rate (" .. w.format_integer(reactor_rate) .. " RF): ") + reactor_rate = w.input_readInteger(reactor_rate) reactor_setMode() w.setCursorPos(1, 5) w.write("Reactor output rate set") w.setCursorPos(1, 7) - w.write("Laser energy level (" .. w.format_integer(data.reactor_laserAmount) .. "): ") - data.reactor_laserAmount = w.input_readInteger(data.reactor_laserAmount) + w.write("Laser energy level (" .. w.format_integer(reactor_laserAmount) .. "): ") + reactor_laserAmount = w.input_readInteger(reactor_laserAmount) reactor_setLaser() w.setCursorPos(1, 8) w.write("Laser energy level set") w.setCursorPos(1, 10) - w.write("Reactor target stability (" .. w.format_integer(data.reactor_targetStability) .. "%): ") - data.reactor_targetStability = w.input_readInteger(data.reactor_targetStability) + w.write("Reactor target stability (" .. w.format_integer(reactor_targetStability) .. "%): ") + reactor_targetStability = w.input_readInteger(reactor_targetStability) reactor_setTargetStability() w.setCursorPos(1, 11) w.write("Reactor target stability set") From c7ef6d75ccc887a78a2b471014e35bfb2421c0fc Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 24 May 2018 19:25:10 -0400 Subject: [PATCH 4/5] Code cleanup (decoration package) --- src/main/java/cr0s/warpdrive/WarpDrive.java | 8 ++++---- .../block/{passive => decoration}/BlockBedrockGlass.java | 2 +- .../block/{passive => decoration}/BlockDecorative.java | 2 +- .../warpdrive/block/{passive => decoration}/BlockGas.java | 2 +- .../{passive => decoration}/ItemBlockDecorative.java | 2 +- src/main/java/cr0s/warpdrive/config/Recipes.java | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) rename src/main/java/cr0s/warpdrive/block/{passive => decoration}/BlockBedrockGlass.java (97%) rename src/main/java/cr0s/warpdrive/block/{passive => decoration}/BlockDecorative.java (98%) rename src/main/java/cr0s/warpdrive/block/{passive => decoration}/BlockGas.java (98%) rename src/main/java/cr0s/warpdrive/block/{passive => decoration}/ItemBlockDecorative.java (96%) diff --git a/src/main/java/cr0s/warpdrive/WarpDrive.java b/src/main/java/cr0s/warpdrive/WarpDrive.java index 98766a12..306af6af 100644 --- a/src/main/java/cr0s/warpdrive/WarpDrive.java +++ b/src/main/java/cr0s/warpdrive/WarpDrive.java @@ -33,6 +33,10 @@ import cr0s.warpdrive.block.collection.BlockLaserTreeFarm; import cr0s.warpdrive.block.collection.BlockMiningLaser; import cr0s.warpdrive.block.collection.TileEntityLaserTreeFarm; import cr0s.warpdrive.block.collection.TileEntityMiningLaser; +import cr0s.warpdrive.block.decoration.BlockBedrockGlass; +import cr0s.warpdrive.block.decoration.BlockDecorative; +import cr0s.warpdrive.block.decoration.BlockGas; +import cr0s.warpdrive.block.decoration.ItemBlockDecorative; import cr0s.warpdrive.block.detection.BlockCamera; import cr0s.warpdrive.block.detection.BlockCloakingCoil; import cr0s.warpdrive.block.detection.BlockCloakingCore; @@ -83,12 +87,8 @@ import cr0s.warpdrive.block.movement.TileEntityShipController; import cr0s.warpdrive.block.movement.TileEntityShipCore; import cr0s.warpdrive.block.movement.TileEntityTransporterBeacon; import cr0s.warpdrive.block.movement.TileEntityTransporterCore; -import cr0s.warpdrive.block.passive.BlockBedrockGlass; -import cr0s.warpdrive.block.passive.BlockDecorative; -import cr0s.warpdrive.block.passive.BlockGas; import cr0s.warpdrive.block.passive.BlockHighlyAdvancedMachine; import cr0s.warpdrive.block.passive.BlockIridium; -import cr0s.warpdrive.block.passive.ItemBlockDecorative; import cr0s.warpdrive.block.weapon.BlockLaserCamera; import cr0s.warpdrive.block.weapon.BlockWeaponController; import cr0s.warpdrive.block.weapon.TileEntityLaserCamera; diff --git a/src/main/java/cr0s/warpdrive/block/passive/BlockBedrockGlass.java b/src/main/java/cr0s/warpdrive/block/decoration/BlockBedrockGlass.java similarity index 97% rename from src/main/java/cr0s/warpdrive/block/passive/BlockBedrockGlass.java rename to src/main/java/cr0s/warpdrive/block/decoration/BlockBedrockGlass.java index 5cd4b8a6..307b9d4d 100644 --- a/src/main/java/cr0s/warpdrive/block/passive/BlockBedrockGlass.java +++ b/src/main/java/cr0s/warpdrive/block/decoration/BlockBedrockGlass.java @@ -1,4 +1,4 @@ -package cr0s.warpdrive.block.passive; +package cr0s.warpdrive.block.decoration; import cr0s.warpdrive.block.BlockAbstractBase; diff --git a/src/main/java/cr0s/warpdrive/block/passive/BlockDecorative.java b/src/main/java/cr0s/warpdrive/block/decoration/BlockDecorative.java similarity index 98% rename from src/main/java/cr0s/warpdrive/block/passive/BlockDecorative.java rename to src/main/java/cr0s/warpdrive/block/decoration/BlockDecorative.java index 642882a7..a5211f68 100644 --- a/src/main/java/cr0s/warpdrive/block/passive/BlockDecorative.java +++ b/src/main/java/cr0s/warpdrive/block/decoration/BlockDecorative.java @@ -1,4 +1,4 @@ -package cr0s.warpdrive.block.passive; +package cr0s.warpdrive.block.decoration; import cr0s.warpdrive.WarpDrive; import cr0s.warpdrive.block.BlockAbstractBase; diff --git a/src/main/java/cr0s/warpdrive/block/passive/BlockGas.java b/src/main/java/cr0s/warpdrive/block/decoration/BlockGas.java similarity index 98% rename from src/main/java/cr0s/warpdrive/block/passive/BlockGas.java rename to src/main/java/cr0s/warpdrive/block/decoration/BlockGas.java index 565ce878..f85845ec 100644 --- a/src/main/java/cr0s/warpdrive/block/passive/BlockGas.java +++ b/src/main/java/cr0s/warpdrive/block/decoration/BlockGas.java @@ -1,4 +1,4 @@ -package cr0s.warpdrive.block.passive; +package cr0s.warpdrive.block.decoration; import cr0s.warpdrive.block.BlockAbstractBase; import cr0s.warpdrive.data.CelestialObjectManager; diff --git a/src/main/java/cr0s/warpdrive/block/passive/ItemBlockDecorative.java b/src/main/java/cr0s/warpdrive/block/decoration/ItemBlockDecorative.java similarity index 96% rename from src/main/java/cr0s/warpdrive/block/passive/ItemBlockDecorative.java rename to src/main/java/cr0s/warpdrive/block/decoration/ItemBlockDecorative.java index 664fc889..49505c0a 100644 --- a/src/main/java/cr0s/warpdrive/block/passive/ItemBlockDecorative.java +++ b/src/main/java/cr0s/warpdrive/block/decoration/ItemBlockDecorative.java @@ -1,4 +1,4 @@ -package cr0s.warpdrive.block.passive; +package cr0s.warpdrive.block.decoration; import cr0s.warpdrive.data.EnumDecorativeType; diff --git a/src/main/java/cr0s/warpdrive/config/Recipes.java b/src/main/java/cr0s/warpdrive/config/Recipes.java index 4679c7eb..6449c54c 100644 --- a/src/main/java/cr0s/warpdrive/config/Recipes.java +++ b/src/main/java/cr0s/warpdrive/config/Recipes.java @@ -2,8 +2,8 @@ package cr0s.warpdrive.config; import cr0s.warpdrive.WarpDrive; import cr0s.warpdrive.api.ParticleRegistry; +import cr0s.warpdrive.block.decoration.BlockDecorative; import cr0s.warpdrive.block.detection.BlockSiren; -import cr0s.warpdrive.block.passive.BlockDecorative; import cr0s.warpdrive.data.EnumComponentType; import cr0s.warpdrive.data.EnumDecorativeType; import cr0s.warpdrive.data.EnumForceFieldShape; From 8b66bc128f3eed516874b36f9a14892bf1dcb302 Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 25 May 2018 11:41:09 -0400 Subject: [PATCH 5/5] improved isolation rate formatting in ship core status message --- .../java/cr0s/warpdrive/block/movement/TileEntityShipCore.java | 3 ++- src/main/resources/assets/warpdrive/lang/de_DE.lang | 2 +- src/main/resources/assets/warpdrive/lang/en_US.lang | 2 +- src/main/resources/assets/warpdrive/lang/fr_FR.lang | 2 +- src/main/resources/assets/warpdrive/lang/nl_NL.lang | 2 +- src/main/resources/assets/warpdrive/lang/ru_RU.lang | 2 +- src/main/resources/assets/warpdrive/lang/zh_CN.lang | 2 +- src/main/resources/assets/warpdrive/lang/zh_TW.lang | 2 +- 8 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipCore.java b/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipCore.java index 70894b3f..7ced6480 100644 --- a/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipCore.java +++ b/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipCore.java @@ -1075,9 +1075,10 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy implements ISta @Override public String getStatus() { + final String strIsolationRate = String.format("%.1f", isolationRate * 100.0D); return super.getStatus() + ((cooldownTime_ticks > 0) ? "\n" + StatCollector.translateToLocalFormatted("warpdrive.ship.status_line.cooling", cooldownTime_ticks / 20) : "") - + ((isolationBlocksCount > 0) ? "\n" + StatCollector.translateToLocalFormatted("warpdrive.ship.status_line.isolation", isolationBlocksCount, isolationRate * 100.0) : ""); + + ((isolationBlocksCount > 0) ? "\n" + StatCollector.translateToLocalFormatted("warpdrive.ship.status_line.isolation", isolationBlocksCount, strIsolationRate) : ""); } public String getBoundingBoxStatus() { diff --git a/src/main/resources/assets/warpdrive/lang/de_DE.lang b/src/main/resources/assets/warpdrive/lang/de_DE.lang index 4375e3f4..cdde6e89 100644 --- a/src/main/resources/assets/warpdrive/lang/de_DE.lang +++ b/src/main/resources/assets/warpdrive/lang/de_DE.lang @@ -574,7 +574,7 @@ warpdrive.ship.attached_players=Verbundene Spieler: %1$s warpdrive.ship.player_attached=Du bist jetzt mit dem Schiff %1$s verbunden.\nVerbundene Spieler sind %2$s warpdrive.ship.player_detached=Du wurdest vom Schiff %1$s getrennt.\nVerbundene Spieler sind %2$s warpdrive.ship.status_line.cooling=%1$d s Abklingzeit verbleibend. -warpdrive.ship.status_line.isolation=%1$d aktive Isolations Blöcke bieten %2$2.1f%% Absorption. +warpdrive.ship.status_line.isolation=%1$d aktive Isolations Blöcke bieten %2$s%% Absorption. warpdrive.energy.status_line=Das Energie Level ist %1$s / %2$s EU. warpdrive.energy.side.changed_to_input=%1$s Seite auf Energiezufuhr Modus gestellt! diff --git a/src/main/resources/assets/warpdrive/lang/en_US.lang b/src/main/resources/assets/warpdrive/lang/en_US.lang index beb36193..959e450d 100644 --- a/src/main/resources/assets/warpdrive/lang/en_US.lang +++ b/src/main/resources/assets/warpdrive/lang/en_US.lang @@ -571,7 +571,7 @@ warpdrive.ship.attached_players=Attached players: %1$s warpdrive.ship.player_attached=You're now attached to ship %1$s.\nAttached players are %2$s warpdrive.ship.player_detached=You've been detached from ship %1$s.\nAttached players are %2$s warpdrive.ship.status_line.cooling=%1$d s left of cooldown. -warpdrive.ship.status_line.isolation=%1$d active isolation blocks providing %2$2.1f%% absorption. +warpdrive.ship.status_line.isolation=%1$d active isolation blocks providing %2$s%% absorption. warpdrive.energy.status_line=Energy level is %1$s / %2$s EU. warpdrive.energy.side.changed_to_input=%1$s side changed to energy Input mode! diff --git a/src/main/resources/assets/warpdrive/lang/fr_FR.lang b/src/main/resources/assets/warpdrive/lang/fr_FR.lang index a66fcd23..cc19d3f2 100644 --- a/src/main/resources/assets/warpdrive/lang/fr_FR.lang +++ b/src/main/resources/assets/warpdrive/lang/fr_FR.lang @@ -571,7 +571,7 @@ warpdrive.ship.attached_players=Joueurs attachés: %1$s warpdrive.ship.player_attached=Tu es désormais attaché au vaisseau %1$s.\nLes joueurs attachés sont %2$s warpdrive.ship.player_detached=Tu es désormais détaché du vaisseau %1$s.\nLes joueurs attachés sont %2$s warpdrive.ship.status_line.cooling=Encore %1$d s de refroidissement. -warpdrive.ship.status_line.isolation=Les %1$d blocs d'isolations actifs fournissent %2$2.1f%% d'absorption. +warpdrive.ship.status_line.isolation=Les %1$d blocs d'isolations actifs fournissent %2$s%% d'absorption. warpdrive.energy.status_line=Le niveau d'énergie est de %1$s / %2$s EU. warpdrive.energy.side.changed_to_input=Le coté %1$s est en mode Réception d'énergie! diff --git a/src/main/resources/assets/warpdrive/lang/nl_NL.lang b/src/main/resources/assets/warpdrive/lang/nl_NL.lang index 6fe728e3..d545af34 100644 --- a/src/main/resources/assets/warpdrive/lang/nl_NL.lang +++ b/src/main/resources/assets/warpdrive/lang/nl_NL.lang @@ -571,7 +571,7 @@ warpdrive.ship.attached_players=Aangesloten Spelers: %1$s warpdrive.ship.player_attached=Je bent nu aangesloten op schip %1$s.\nDe aangesloten spelers zijn %2$s warpdrive.ship.player_detached=Je bent nu afgesloten op schip %1$s.\nDe aangesloten spelers zijn %2$s warpdrive.ship.status_line.cooling=%1$d seconden over van afkoeling -warpdrive.ship.status_line.isolation=%1$d actieve isolatie-blokken geven %2$2.1f%% absorptie. +warpdrive.ship.status_line.isolation=%1$d actieve isolatie-blokken geven %2$s%% absorptie. warpdrive.energy.status_line=Energielevel is op %1$s / %2$s EU. warpdrive.energy.side.changed_to_input=%1$s kant verandert naar energie input modus! diff --git a/src/main/resources/assets/warpdrive/lang/ru_RU.lang b/src/main/resources/assets/warpdrive/lang/ru_RU.lang index 8b292e66..e6e3b186 100644 --- a/src/main/resources/assets/warpdrive/lang/ru_RU.lang +++ b/src/main/resources/assets/warpdrive/lang/ru_RU.lang @@ -571,7 +571,7 @@ warpdrive.ship.attached_players=Прирепленные игроки: %1$s warpdrive.ship.player_attached=Вы были прикреплены к кораблю %1$s.\nПрикрепленные игроки: %2$s warpdrive.ship.player_detached=Вы были откреплены от корабля %1$s.\nПрикрепленные игроки: %2$s warpdrive.ship.status_line.cooling=Осталось %1$d с до остывания. -warpdrive.ship.status_line.isolation=%1$d активных блоков изоляции предоставляют %2$2.1f%% поглощения. +warpdrive.ship.status_line.isolation=%1$d активных блоков изоляции предоставляют %2$s%% поглощения. warpdrive.energy.status_line=Содержит энергии: %1$s / %2$s EU. warpdrive.energy.side.changed_to_input=%1$s side changed to energy Input mode! diff --git a/src/main/resources/assets/warpdrive/lang/zh_CN.lang b/src/main/resources/assets/warpdrive/lang/zh_CN.lang index 0ad97952..cd0c47a2 100644 --- a/src/main/resources/assets/warpdrive/lang/zh_CN.lang +++ b/src/main/resources/assets/warpdrive/lang/zh_CN.lang @@ -571,7 +571,7 @@ warpdrive.ship.attached_players=所属的玩家: %1$s warpdrive.ship.player_attached=你在飞船 %1$s上.\n属于%2$s warpdrive.ship.player_detached=你已经脱离了飞船 %1$s.\n属于%2$s warpdrive.ship.status_line.cooling=%1$d s 冷却时间 -warpdrive.ship.status_line.isolation=%1$d有效的隔离方块提供%2$2.1f%%吸收. +warpdrive.ship.status_line.isolation=%1$d有效的隔离方块提供%2$s%%吸收. warpdrive.energy.status_line=能量水平%1$s / %2$s EU. warpdrive.energy.side.changed_to_input=%1$s侧面更改为能量输入模式! diff --git a/src/main/resources/assets/warpdrive/lang/zh_TW.lang b/src/main/resources/assets/warpdrive/lang/zh_TW.lang index de993be5..28a58373 100644 --- a/src/main/resources/assets/warpdrive/lang/zh_TW.lang +++ b/src/main/resources/assets/warpdrive/lang/zh_TW.lang @@ -569,7 +569,7 @@ warpdrive.ship.attached_players=屬於: %1$s warpdrive.ship.player_attached=您現在已連接到船艦 %1$s.\n這艘船艦屬於 %2$s warpdrive.ship.player_detached=您現在已從船艦分離 %1$s.\n這艘船艦屬於 %2$s warpdrive.ship.status_line.cooling=%1$d s 升降梯的冷卻中。 -warpdrive.ship.status_line.isolation=%1$d 主動隔離塊由 %2$2.1f%% 吸收。 +warpdrive.ship.status_line.isolation=%1$d 主動隔離塊由 %2$s%% 吸收。 warpdrive.energy.status_line=能量填充 %1$s / %2$s EU. warpdrive.energy.side.changed_to_input=%1$s 側面變為能量輸入模式!