Fixed reactor stabilisation laser crash in SMP

Improved reactor menus consistency
This commit is contained in:
Unknown 2019-04-18 09:28:55 +02:00
parent 05d812bf32
commit 443301c9a9
3 changed files with 10 additions and 5 deletions
src/main
java/cr0s/warpdrive/block/energy
resources/assets/warpdrive
lua.ComputerCraft/warpdriveEnanReactorCore
lua.OpenComputers/warpdriveEnanReactorCore

View file

@ -163,8 +163,8 @@ public class TileEntityEnanReactorLaser extends TileEntityAbstractLaser implemen
return 0;
}
if (energyStabilizationRequest > 0) {
WarpDrive.logger.warn("%s Stabilization already requested for %s",
this, energy);
WarpDrive.logger.warn(String.format("%s Stabilization already requested for %s",
this, energy));
return -energy;
}
energyStabilizationRequest = energy;
@ -208,7 +208,9 @@ public class TileEntityEnanReactorLaser extends TileEntityAbstractLaser implemen
@Override
public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) {
tagCompound = super.writeToNBT(tagCompound);
tagCompound.setString("reactorFace", reactorFace.getName());
if (reactorFace != null && reactorFace != ReactorFace.UNKNOWN) {
tagCompound.setString("reactorFace", reactorFace.getName());
}
tagCompound.setInteger("energyStabilizationRequest", energyStabilizationRequest);
return tagCompound;
}
@ -218,6 +220,9 @@ public class TileEntityEnanReactorLaser extends TileEntityAbstractLaser implemen
super.readFromNBT(tagCompound);
reactorFace = ReactorFace.get(tagCompound.getString("reactorFace"));
if (reactorFace == null) {
reactorFace = ReactorFace.UNKNOWN;
}
energyStabilizationRequest = tagCompound.getInteger("energyStabilizationRequest");
}

View file

@ -192,7 +192,7 @@ function reactor_page()
w.writeFullLine(" Start/stoP reactor (S/P), Use lasers (L)")
w.writeFullLine(" Output mode (O), Configuration (C)")
w.writeFullLine(" Target stability (+/-), Laser amount (U/J)")
w.writeFullLine(" Output rate/threshold (G/T)")
w.writeFullLine(" Output rate/threshold (T/G)")
end
function reactor_setMode()

View file

@ -191,7 +191,7 @@ function reactor_page()
w.writeFullLine(" Start/stoP reactor (S/P), Use lasers (L)")
w.writeFullLine(" Output mode (O), Configuration (C)")
w.writeFullLine(" Target stability (+/-), Laser amount (U/J)")
w.writeFullLine(" Output rate/threshold (G/T)")
w.writeFullLine(" Output rate/threshold (T/G)")
end
function reactor_setMode()