Added shipCoreCooldownDone event

This fix the issue with controller showing all datas after a jump
This commit is contained in:
LemADEC 2016-02-07 22:50:53 +01:00
parent 2d7a04c491
commit a17b40d9aa
2 changed files with 8 additions and 1 deletions

View file

@ -774,6 +774,10 @@ public class TileEntityShipController extends TileEntityAbstractInterfaced {
return new Object[] { targetJumpgateName };
}
protected void cooldownDone() {
sendEvent("shipCoreCooldownDone", null);
}
// ComputerCraft IPeripheral methods implementation
@Override
@Optional.Method(modid = "ComputerCraft")

View file

@ -113,6 +113,9 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy {
if (cooldownTime > 0) {
cooldownTime--;
warmupTime = 0;
if (cooldownTime == 0) {
controller.cooldownDone();
}
}
// Update state
@ -322,7 +325,7 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy {
}
doJump();
cooldownTime = WarpDriveConfig.SHIP_COOLDOWN_INTERVAL_SECONDS * 20;
cooldownTime = Math.max(1, WarpDriveConfig.SHIP_COOLDOWN_INTERVAL_SECONDS * 20);
controller.setJumpFlag(false);
} else {
warmupTime = 0;