Code cleanup

This commit is contained in:
Unknown 2019-02-16 21:24:32 +01:00 committed by unknown
parent 3145866254
commit 04b4cf2929
8 changed files with 19 additions and 17 deletions

View file

@ -758,7 +758,7 @@ public class TileEntityShipScanner extends TileEntityAbstractMachine implements
private int shipToken_countWarmup = SHIP_TOKEN_PLAYER_WARMUP_PERIODS;
private String shipToken_nameSchematic = "";
private void checkPlayerForShipToken() {
// cooldown to prevent player chat spam and server lag
// cool down to prevent player chat spam and server lag
shipToken_nextUpdate_ticks--;
if (shipToken_nextUpdate_ticks > 0) {
return;
@ -808,7 +808,7 @@ public class TileEntityShipScanner extends TileEntityAbstractMachine implements
return;
}
// short warmup so payer can cancel eventually
// short warm-up so payer can cancel eventually
if ( entityPlayer.getUniqueID() != shipToken_idPlayer
|| !shipToken_nameSchematic.equals(ItemShipToken.getSchematicName(itemStack)) ) {
shipToken_idPlayer = entityPlayer.getUniqueID();
@ -823,7 +823,7 @@ public class TileEntityShipScanner extends TileEntityAbstractMachine implements
shipToken_nameSchematic, shipToken_countWarmup));
return;
}
// warmup done
// warm-up done
shipToken_idPlayer = null;
playerName = entityPlayer.getName();

View file

@ -158,11 +158,11 @@ public class TileEntityShipCore extends TileEntityAbstractShipController impleme
return;
}
// always cooldown
// always cool down
if (ticksCooldown > 0) {
ticksCooldown--;
// report cooldown time when a command is requested
// report coo down time when a command is requested
if ( isEnabled
&& isCommandConfirmed
&& enumShipCommand != EnumShipCommand.IDLE
@ -205,7 +205,7 @@ public class TileEntityShipCore extends TileEntityAbstractShipController impleme
if (logTicks <= 0) {
logTicks = LOG_INTERVAL_TICKS;
if (WarpDriveConfig.LOGGING_JUMP) {
WarpDrive.logger.info(String.format("%s, %s, %s, %d controllers, warmup %d, cooldown %d",
WarpDrive.logger.info(String.format("%s, %s, %s, %d controllers, warm-up %d, cool down %d",
this,
stateCurrent,
isEnabled ? "Enabled" : "Disabled",
@ -364,7 +364,7 @@ public class TileEntityShipCore extends TileEntityAbstractShipController impleme
return;
}
// compute random ticks to warmup so it's harder to 'dup' items
// compute random ticks to warm-up so it's harder to 'dup' items
randomWarmupAddition_ticks = world.rand.nextInt(WarpDriveConfig.SHIP_WARMUP_RANDOM_TICKS);
stateCurrent = EnumShipCoreState.WARMING_UP;

View file

@ -157,7 +157,7 @@ public class TileEntityTransporterCore extends TileEntityAbstractEnergyConsumer
// frequency status
isConnected = beamFrequency > 0 && beamFrequency <= IBeamFrequency.BEAM_FREQUENCY_MAX;
// always cooldown
// always cool down
if (tickCooldown > 0) {
tickCooldown--;
} else {
@ -364,7 +364,7 @@ public class TileEntityTransporterCore extends TileEntityAbstractEnergyConsumer
// cancel if no entity was found
if (entityValues.count == 0) {
// cancel transfer, cooldown, don't loose strength
// cancel transfer, cool down, don't loose strength
isEnergizeRequested = false;
tickCooldown += WarpDriveConfig.TRANSPORTER_ENERGIZING_COOLDOWN_TICKS;
transporterState = EnumTransporterState.ACQUIRING;
@ -389,7 +389,7 @@ public class TileEntityTransporterCore extends TileEntityAbstractEnergyConsumer
energizeEntities(lockStrengthActual, movingEntitiesRemote, world, vLocalScanners);
}
// clear entities, cancel transfer, cooldown, loose a bit of strength
// clear entities, cancel transfer, cool down, loose a bit of strength
isEnergizeRequested = false;
tickUpdateParameters = 0;
tickCooldown += WarpDriveConfig.TRANSPORTER_ENERGIZING_COOLDOWN_TICKS;

View file

@ -42,7 +42,7 @@ public class ShipMovementCosts {
this.sickness_seconds = movementCosts.getSickness_seconds();
this.cooldown_seconds = movementCosts.getCooldown_seconds();
if (WarpDriveConfig.LOGGING_ENERGY) {
WarpDrive.logger.info(String.format("Ship movement %s with mass %d over %d blocks is capped to %d blocks, will cost %d EU, %d s warmup, %d s sickness, %d s cooldown",
WarpDrive.logger.info(String.format("Ship movement %s with mass %d over %d blocks is capped to %d blocks, will cost %d EU, %d s warm-up, %d s sickness, %d s cool down",
shipMovementType, mass, distance,
this.maximumDistance_blocks, this.energyRequired,
this.warmup_seconds, this.sickness_seconds, this.cooldown_seconds));

View file

@ -357,9 +357,11 @@ public class WarpDriveConfig {
public static int MINING_LASER_MAX_MEDIUMS_COUNT = 3;
public static int MINING_LASER_RADIUS_NO_LASER_MEDIUM = 4;
public static int MINING_LASER_RADIUS_PER_LASER_MEDIUM = 1;
public static int MINING_LASER_WARMUP_DELAY_TICKS = 20;
public static int MINING_LASER_SCAN_DELAY_TICKS = 20;
public static int MINING_LASER_MINE_DELAY_TICKS = 3;
public static int MINING_LASER_SPACE_ENERGY_PER_LAYER = 20000;
public static int MINING_LASER_PLANET_ENERGY_PER_LAYER = 33000;
public static int MINING_LASER_SPACE_ENERGY_PER_BLOCK = 1500;
@ -931,7 +933,7 @@ public class WarpDriveConfig {
config.get("ship", "collision_tolerance_blocks", SHIP_COLLISION_TOLERANCE_BLOCKS, "Tolerance in block in case of collision before causing damages...").getInt());
SHIP_WARMUP_RANDOM_TICKS = Commons.clamp(10, 200,
config.get("ship", "warmup_random_ticks", SHIP_WARMUP_RANDOM_TICKS, "Random variation added to warmup (measured in ticks)").getInt());
config.get("ship", "warmup_random_ticks", SHIP_WARMUP_RANDOM_TICKS, "Random variation added to warm-up (measured in ticks)").getInt());
SHIP_CORE_ISOLATION_UPDATE_INTERVAL_SECONDS = Commons.clamp(0, 300,
config.get("ship", "core_isolation_update_interval", SHIP_CORE_ISOLATION_UPDATE_INTERVAL_SECONDS, "(measured in seconds)").getInt());
@ -1183,7 +1185,7 @@ public class WarpDriveConfig {
IC2_REACTOR_ENERGY_PER_HEAT = Commons.clamp(2.0D, 100000.0D,
config.get("ic2_reactor_laser", "energy_per_heat", IC2_REACTOR_ENERGY_PER_HEAT, "Energy cost per heat absorbed").getDouble());
IC2_REACTOR_COOLING_INTERVAL_TICKS = Commons.clamp(0, 1200,
config.get("ic2_reactor_laser", "cooling_interval_ticks", IC2_REACTOR_COOLING_INTERVAL_TICKS, "Update speed of the check for reactors to cooldown. Use 10 to tick as fast as the reactor simulation").getInt());
config.get("ic2_reactor_laser", "cooling_interval_ticks", IC2_REACTOR_COOLING_INTERVAL_TICKS, "Update speed of the check for reactors to cool down. Use 10 to tick as fast as the reactor simulation").getInt());
// Transporter
TRANSPORTER_MAX_ENERGY_STORED = Commons.clamp(1, Integer.MAX_VALUE,

View file

@ -104,7 +104,7 @@ public class AcceleratorSetup extends GlobalPosition {
if (WarpDriveConfig.LOGGING_ACCELERATOR) {
WarpDrive.logger.info(String.format("Accelerator length: %d + %d including %d + %d + %d magnets, %d chillers and %d capacitors"
+ " cooldown: %.3f %.3f %.3f /t %.3f EU/t"
+ " cool down: %.3f %.3f %.3f /t %.3f EU/t"
+ " sustain: %.3f %.3f %.3f EU/t"
+ " acceleration: %.3f /particle",
trajectoryAccelerator == null ? -1 : trajectoryAccelerator.size(), trajectoryTransfer == null ? -1 : trajectoryTransfer.size(),

View file

@ -11,8 +11,8 @@ public enum EnumShipCoreState implements IStringSerializable {
IDLE (1, "idle"), // Ready for next command
// SCANNING (2, "scanning"), // Ready for next command
ONLINE (3, "online"), // Computing parameters
WARMING_UP (4, "warming_up"); // Warmup phase
// COOLING_DOWN (5, "cooling_down"); // Pending cooldown
WARMING_UP (4, "warming_up"); // Warm up phase
// COOLING_DOWN (5, "cooling_down"); // Pending cool down
private final int metadata;
private final String name;

View file

@ -308,7 +308,7 @@ public class MessageTransporterEffect implements IMessage, IMessageHandler<Messa
}
if (WarpDriveConfig.LOGGING_EFFECTS) {
WarpDrive.logger.info(String.format("Received transporter effect isTransporterRoom %s at %s towards %d entities, with %.3f lockStrength, energizing in %d ticks, cooldown for %d ticks",
WarpDrive.logger.info(String.format("Received transporter effect isTransporterRoom %s at %s towards %d entities, with %.3f lockStrength, energizing in %d ticks, cool down for %d ticks",
messageTransporterEffect.isTransporterRoom, messageTransporterEffect.globalPosition,
messageTransporterEffect.idEntities.size(),
messageTransporterEffect.lockStrength, messageTransporterEffect.tickEnergizing, messageTransporterEffect.tickCooldown));