Updated configuration for XML and simplification
Updated configuration structure to match tile names, both internally and in externally Moved configuration file to it's dedicated folder Added copy of default XML files if none was found Fixed ship scanner max energy stored Renamed transition planes to planets Simplified a few configuration entries Added finer laser cannon effects configuration Added missing configuration for Cloaking core max energy stored Added range clamping on all configuration entries
This commit is contained in:
parent
0c4da0c193
commit
c0d5105bd3
25 changed files with 644 additions and 524 deletions
|
@ -30,7 +30,7 @@ import cr0s.warpdrive.block.movement.TileEntityShipCore;
|
|||
import cr0s.warpdrive.conf.WarpDriveConfig;
|
||||
import cr0s.warpdrive.data.JumpBlock;
|
||||
import cr0s.warpdrive.data.MovingEntity;
|
||||
import cr0s.warpdrive.data.TransitionPlane;
|
||||
import cr0s.warpdrive.data.Planet;
|
||||
import cr0s.warpdrive.data.Vector3;
|
||||
import cr0s.warpdrive.world.SpaceTeleporter;
|
||||
|
||||
|
@ -342,9 +342,9 @@ public class EntityJump extends Entity {
|
|||
Boolean planeFound = false;
|
||||
Boolean planeValid = false;
|
||||
int closestPlaneDistance = Integer.MAX_VALUE;
|
||||
TransitionPlane closestTransitionPlane = null;
|
||||
for (int iPlane = 0; (!planeValid) && iPlane < WarpDriveConfig.G_TRANSITIONPLANES.length; iPlane++) {
|
||||
TransitionPlane transitionPlane = WarpDriveConfig.G_TRANSITIONPLANES[iPlane];
|
||||
Planet closestTransitionPlane = null;
|
||||
for (int iPlane = 0; (!planeValid) && iPlane < WarpDriveConfig.PLANETS.length; iPlane++) {
|
||||
Planet transitionPlane = WarpDriveConfig.PLANETS[iPlane];
|
||||
if (worldObj.provider.dimensionId == transitionPlane.dimensionId) {
|
||||
planeFound = true;
|
||||
int planeDistance = transitionPlane.isValidToSpace(new Vector3(this));
|
||||
|
@ -383,9 +383,9 @@ public class EntityJump extends Entity {
|
|||
} else if (fromSpace) {
|
||||
Boolean planeFound = false;
|
||||
int closestPlaneDistance = Integer.MAX_VALUE;
|
||||
TransitionPlane closestTransitionPlane = null;
|
||||
for (int iPlane = 0; (!planeFound) && iPlane < WarpDriveConfig.G_TRANSITIONPLANES.length; iPlane++) {
|
||||
TransitionPlane transitionPlane = WarpDriveConfig.G_TRANSITIONPLANES[iPlane];
|
||||
Planet closestTransitionPlane = null;
|
||||
for (int iPlane = 0; (!planeFound) && iPlane < WarpDriveConfig.PLANETS.length; iPlane++) {
|
||||
Planet transitionPlane = WarpDriveConfig.PLANETS[iPlane];
|
||||
int planeDistance = transitionPlane.isValidFromSpace(new Vector3(this));
|
||||
if (planeDistance == 0) {
|
||||
planeFound = true;
|
||||
|
@ -714,7 +714,7 @@ public class EntityJump extends Entity {
|
|||
}
|
||||
|
||||
// Register explosion(s) at collision point
|
||||
if (blowPoints > WarpDriveConfig.WC_COLLISION_TOLERANCE_BLOCKS) {
|
||||
if (blowPoints > WarpDriveConfig.SHIP_COLLISION_TOLERANCE_BLOCKS) {
|
||||
result = checkMovement(Math.max(1, testDistance + 1), true);
|
||||
if (result != null) {
|
||||
/*
|
||||
|
@ -722,10 +722,10 @@ public class EntityJump extends Entity {
|
|||
* boom = 5 Endercrystal = 6 TNTcart = 4 to 11.5 TNT = 4
|
||||
*/
|
||||
float massCorrection = 0.5F + (float) Math
|
||||
.sqrt(Math.min(1.0D, Math.max(0.0D, shipCore.shipVolume - WarpDriveConfig.WC_MAX_SHIP_VOLUME_ON_SURFACE)
|
||||
/ WarpDriveConfig.WC_MIN_SHIP_VOLUME_FOR_HYPERSPACE));
|
||||
.sqrt(Math.min(1.0D, Math.max(0.0D, shipCore.shipVolume - WarpDriveConfig.SHIP_VOLUME_MAX_ON_PLANET_SURFACE)
|
||||
/ WarpDriveConfig.SHIP_VOLUME_MIN_FOR_HYPERSPACE));
|
||||
collisionDetected = true;
|
||||
collisionStrength = (4.0F + blowPoints - WarpDriveConfig.WC_COLLISION_TOLERANCE_BLOCKS) * massCorrection;
|
||||
collisionStrength = (4.0F + blowPoints - WarpDriveConfig.SHIP_COLLISION_TOLERANCE_BLOCKS) * massCorrection;
|
||||
collisionAtSource = result.atSource;
|
||||
collisionAtTarget = result.atTarget;
|
||||
WarpDrive.logger.info(this + " Reporting " + collisionAtTarget.size() + " collisions coordinates " + blowPoints
|
||||
|
|
|
@ -24,7 +24,6 @@ import net.minecraftforge.common.ForgeChunkManager.LoadingCallback;
|
|||
import net.minecraftforge.common.ForgeChunkManager.Ticket;
|
||||
import net.minecraftforge.common.ForgeChunkManager.Type;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
|
@ -412,19 +411,19 @@ public class WarpDrive implements LoadingCallback {
|
|||
public void postInit(FMLPostInitializationEvent event) {
|
||||
space = DimensionManager.getWorld(WarpDriveConfig.G_SPACE_DIMENSION_ID);
|
||||
hyperSpace = DimensionManager.getWorld(WarpDriveConfig.G_HYPERSPACE_DIMENSION_ID);
|
||||
|
||||
|
||||
WarpDriveConfig.postInit();
|
||||
|
||||
if (WarpDriveConfig.isIndustrialCraft2loaded && WarpDriveConfig.G_ENABLE_IC2_RECIPES) {
|
||||
if (WarpDriveConfig.isIndustrialCraft2loaded && WarpDriveConfig.RECIPES_ENABLE_IC2) {
|
||||
initIC2Recipes();
|
||||
}
|
||||
if (WarpDriveConfig.isIndustrialCraft2loaded && WarpDriveConfig.G_ENABLE_HARD_IC2_RECIPES) {
|
||||
if (WarpDriveConfig.isIndustrialCraft2loaded && WarpDriveConfig.RECIPES_ENABLE_HARD_IC2) {
|
||||
initHardIC2Recipes();
|
||||
}
|
||||
if (WarpDriveConfig.G_ENABLE_VANILLA_RECIPES) {
|
||||
if (WarpDriveConfig.RECIPES_ENABLE_VANILLA) {
|
||||
initVanillaRecipes();
|
||||
}
|
||||
|
||||
|
||||
starMap = new StarMapRegistry();
|
||||
jumpgates = new JumpgatesRegistry();
|
||||
cameras = new CamerasRegistry();
|
||||
|
|
|
@ -100,7 +100,7 @@ public class BlockAirGenerator extends BlockContainer
|
|||
Item heldItem = heldItemStack.getItem();
|
||||
if (heldItem != null && (heldItem instanceof IAirCanister)) {
|
||||
IAirCanister airCanister = (IAirCanister)heldItem;
|
||||
if (airCanister.canContainAir(heldItemStack) && te.consumeEnergy(WarpDriveConfig.AG_RF_PER_CANISTER, true)) {
|
||||
if (airCanister.canContainAir(heldItemStack) && te.consumeEnergy(WarpDriveConfig.AIRGEN_ENERGY_PER_CANISTER, true)) {
|
||||
player.inventory.decrStackSize(player.inventory.currentItem, 1);
|
||||
ItemStack toAdd = airCanister.fullDrop(heldItemStack);
|
||||
if (toAdd != null) {
|
||||
|
@ -108,7 +108,7 @@ public class BlockAirGenerator extends BlockContainer
|
|||
EntityItem ie = new EntityItem(player.worldObj, player.posX, player.posY, player.posZ, toAdd);
|
||||
player.worldObj.spawnEntityInWorld(ie);
|
||||
}
|
||||
te.consumeEnergy(WarpDriveConfig.AG_RF_PER_CANISTER, false);
|
||||
te.consumeEnergy(WarpDriveConfig.AIRGEN_ENERGY_PER_CANISTER, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,8 +45,8 @@ public abstract class TileEntityAbstractBase extends TileEntity
|
|||
return false;
|
||||
}
|
||||
|
||||
protected static int clamp(int a, int min, int max) {
|
||||
return Math.min(max, Math.max(a, min));
|
||||
protected static int clamp(final int min, final int max, final int value) {
|
||||
return Math.min(max, Math.max(value, min));
|
||||
}
|
||||
|
||||
protected static double clamp(double a, double min, double max) {
|
||||
|
|
|
@ -8,12 +8,7 @@ import cr0s.warpdrive.WarpDrive;
|
|||
import cr0s.warpdrive.conf.WarpDriveConfig;
|
||||
|
||||
public class TileEntityAirGenerator extends TileEntityAbstractEnergy {
|
||||
private final int EU_PER_NEWAIRBLOCK = WarpDriveConfig.AG_EU_PER_NEWAIRBLOCK;
|
||||
private final int EU_PER_EXISTINGAIRBLOCK = WarpDriveConfig.AG_EU_PER_EXISTINGAIRBLOCK;
|
||||
private final int MAX_ENERGY_VALUE = WarpDriveConfig.AG_MAX_ENERGY;
|
||||
|
||||
private int cooldownTicks = 0;
|
||||
private final int AIR_GENERATION_TICKS = WarpDriveConfig.AG_AIR_GENERATION_TICKS;
|
||||
private final int START_CONCENTRATION_VALUE = 15;
|
||||
|
||||
public TileEntityAirGenerator() {
|
||||
|
@ -43,8 +38,8 @@ public class TileEntityAirGenerator extends TileEntityAbstractEnergy {
|
|||
}
|
||||
|
||||
cooldownTicks++;
|
||||
if (cooldownTicks > AIR_GENERATION_TICKS) {
|
||||
if (consumeEnergy(EU_PER_NEWAIRBLOCK, true)) {
|
||||
if (cooldownTicks > WarpDriveConfig.AIRGEN_AIR_GENERATION_TICKS) {
|
||||
if (consumeEnergy(WarpDriveConfig.AIRGEN_ENERGY_PER_NEWAIRBLOCK, true)) {
|
||||
if (getBlockMetadata() != 1) {
|
||||
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 1, 2); // set enabled texture
|
||||
}
|
||||
|
@ -67,13 +62,13 @@ public class TileEntityAirGenerator extends TileEntityAbstractEnergy {
|
|||
private void releaseAir(int xOffset, int yOffset, int zOffset) {
|
||||
Block block = worldObj.getBlock(xCoord + xOffset, yCoord + yOffset, zCoord + zOffset);
|
||||
if (block.isAir(worldObj, xOffset, yOffset, zOffset)) {// can be air
|
||||
int energy_cost = (!block.isAssociatedBlock(WarpDrive.blockAir)) ? EU_PER_NEWAIRBLOCK : EU_PER_EXISTINGAIRBLOCK;
|
||||
int energy_cost = (!block.isAssociatedBlock(WarpDrive.blockAir)) ? WarpDriveConfig.AIRGEN_ENERGY_PER_NEWAIRBLOCK : WarpDriveConfig.AIRGEN_ENERGY_PER_EXISTINGAIRBLOCK;
|
||||
if (consumeEnergy(energy_cost, true)) {// enough energy
|
||||
if (worldObj.setBlock(xCoord + xOffset, yCoord + yOffset, zCoord + zOffset, WarpDrive.blockAir, START_CONCENTRATION_VALUE, 2)) {
|
||||
// (needs to renew air or was not maxed out)
|
||||
consumeEnergy(EU_PER_NEWAIRBLOCK, false);
|
||||
consumeEnergy(WarpDriveConfig.AIRGEN_ENERGY_PER_NEWAIRBLOCK, false);
|
||||
} else {
|
||||
consumeEnergy(EU_PER_EXISTINGAIRBLOCK, false);
|
||||
consumeEnergy(WarpDriveConfig.AIRGEN_ENERGY_PER_EXISTINGAIRBLOCK, false);
|
||||
}
|
||||
} else {// low energy => remove air block
|
||||
if (block.isAssociatedBlock(WarpDrive.blockAir)) {
|
||||
|
@ -103,7 +98,7 @@ public class TileEntityAirGenerator extends TileEntityAbstractEnergy {
|
|||
|
||||
@Override
|
||||
public int getMaxEnergyStored() {
|
||||
return MAX_ENERGY_VALUE;
|
||||
return WarpDriveConfig.AIRGEN_MAX_ENERGY_STORED;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -74,12 +74,7 @@ public class TileEntityChunkLoader extends TileEntityAbstractChunkLoading implem
|
|||
canLoad = consumeEnergy(area * WarpDriveConfig.CL_RF_PER_CHUNKTICK, true);
|
||||
}
|
||||
}
|
||||
|
||||
private int clampDistance(int dis)
|
||||
{
|
||||
return clamp(dis,0,WarpDriveConfig.CL_MAX_DISTANCE);
|
||||
}
|
||||
|
||||
|
||||
private void changedDistance()
|
||||
{
|
||||
if(worldObj == null) {
|
||||
|
@ -93,10 +88,10 @@ public class TileEntityChunkLoader extends TileEntityAbstractChunkLoading implem
|
|||
return;
|
||||
}
|
||||
}
|
||||
negDX = -clampDistance(negDX);
|
||||
posDX = clampDistance(posDX);
|
||||
negDZ = -clampDistance(negDZ);
|
||||
posDZ = clampDistance(posDZ);
|
||||
negDX = - clamp(0, WarpDriveConfig.CL_MAX_DISTANCE, negDX);
|
||||
posDX = clamp(0, WarpDriveConfig.CL_MAX_DISTANCE, posDX);
|
||||
negDZ = - clamp(0, WarpDriveConfig.CL_MAX_DISTANCE, negDZ);
|
||||
posDZ = clamp(0, WarpDriveConfig.CL_MAX_DISTANCE, posDZ);
|
||||
minChunk = new ChunkCoordIntPair(myChunk.chunkXPos+negDX,myChunk.chunkZPos+negDZ);
|
||||
maxChunk = new ChunkCoordIntPair(myChunk.chunkXPos+posDX,myChunk.chunkZPos+posDZ);
|
||||
area = (posDX - negDX + 1) * (posDZ - negDZ + 1);
|
||||
|
|
|
@ -94,13 +94,14 @@ public class TileEntityLaser extends TileEntityAbstractInterfaced {
|
|||
}
|
||||
|
||||
delayTicks++;
|
||||
if (isEmitting
|
||||
&& ((beamFrequency != BEAM_FREQUENCY_SCANNING && delayTicks > WarpDriveConfig.LE_EMIT_DELAY_TICKS) || (beamFrequency == BEAM_FREQUENCY_SCANNING && delayTicks > WarpDriveConfig.LE_EMIT_SCAN_DELAY_TICKS))) {
|
||||
if ( isEmitting
|
||||
&& ( (beamFrequency != BEAM_FREQUENCY_SCANNING && delayTicks > WarpDriveConfig.LASER_CANNON_EMIT_FIRE_DELAY_TICKS)
|
||||
|| (beamFrequency == BEAM_FREQUENCY_SCANNING && delayTicks > WarpDriveConfig.LASER_CANNON_EMIT_SCAN_DELAY_TICKS))) {
|
||||
delayTicks = 0;
|
||||
isEmitting = false;
|
||||
int beamEnergy = Math.min(
|
||||
this.consumeEnergyFromBoosters() + MathHelper.floor_double(energyFromOtherBeams * WarpDriveConfig.LE_COLLECT_ENERGY_MULTIPLIER),
|
||||
WarpDriveConfig.LE_MAX_LASER_ENERGY);
|
||||
this.consumeEnergyFromBoosters() + MathHelper.floor_double(energyFromOtherBeams * WarpDriveConfig.LASER_CANNON_BOOSTER_BEAM_ENERGY_EFFICIENCY),
|
||||
WarpDriveConfig.LASER_CANNON_MAX_LASER_ENERGY);
|
||||
emitBeam(beamEnergy);
|
||||
energyFromOtherBeams = 0;
|
||||
sendEvent("laserSend", new Object[] { beamFrequency, beamEnergy });
|
||||
|
@ -133,7 +134,7 @@ public class TileEntityLaser extends TileEntityAbstractInterfaced {
|
|||
if (findFirstBooster() != null) {
|
||||
int newX, newY, newZ;
|
||||
TileEntity te;
|
||||
for (int shift = 1; shift <= WarpDriveConfig.LE_MAX_BOOSTERS_NUMBER; shift++) {
|
||||
for (int shift = 1; shift <= WarpDriveConfig.LASER_CANNON_MAX_MEDIUMS_COUNT; shift++) {
|
||||
newX = xCoord + (dx * shift);
|
||||
newY = yCoord + (dy * shift);
|
||||
newZ = zCoord + (dz * shift);
|
||||
|
@ -152,7 +153,7 @@ public class TileEntityLaser extends TileEntityAbstractInterfaced {
|
|||
// TODO refactor me
|
||||
private void emitBeam(int parEnergy) {
|
||||
int energy = parEnergy; // FIXME Beam power calculations
|
||||
int beamLengthBlocks = energy / WarpDriveConfig.LE_BEAM_LENGTH_PER_ENERGY_DIVIDER;
|
||||
int beamLengthBlocks = energy / WarpDriveConfig.LASER_CANNON_ENERGY_LOSS_PER_BLOCK;
|
||||
|
||||
if (energy == 0 || beamLengthBlocks < 1 || beamFrequency > 65000 || beamFrequency <= 0) {
|
||||
return;
|
||||
|
@ -212,20 +213,23 @@ public class TileEntityLaser extends TileEntityAbstractInterfaced {
|
|||
}
|
||||
|
||||
if (entityHit != null && entityHit.entityHit instanceof EntityLivingBase) {
|
||||
EntityLivingBase e = (EntityLivingBase) entityHit.entityHit;
|
||||
EntityLivingBase entity = (EntityLivingBase) entityHit.entityHit;
|
||||
double distanceToEntity = entityHit.hitVec.distanceTo(beamVector.clone().toVec3());
|
||||
|
||||
if (hit == null || (hit != null && hit.hitVec.distanceTo(beamVector.clone().toVec3()) > distanceToEntity)) {
|
||||
if (distanceToEntity <= beamLengthBlocks) {
|
||||
e.setFire(WarpDriveConfig.LE_ENTITY_HIT_SET_ON_FIRE_TIME);
|
||||
e.attackEntityFrom(DamageSource.inFire, energy / WarpDriveConfig.LE_ENTITY_HIT_DAMAGE_PER_ENERGY_DIVIDER);
|
||||
entity.setFire(WarpDriveConfig.LASER_CANNON_ENTITY_HIT_SET_ON_FIRE_SECONDS);
|
||||
entity.attackEntityFrom(DamageSource.inFire, energy / WarpDriveConfig.LASER_CANNON_ENTITY_HIT_ENERGY_PER_DAMAGE);
|
||||
|
||||
if (energy > WarpDriveConfig.LE_ENTITY_HIT_EXPLOSION_LASER_ENERGY) {
|
||||
worldObj.newExplosion(null, e.posX, e.posY, e.posZ, 4F, true, true);
|
||||
if (energy > WarpDriveConfig.LASER_CANNON_ENTITY_HIT_ENERGY_THRESHOLD_FOR_EXPLOSION) {
|
||||
float strength = Math.max(0.0F, Math.min(WarpDriveConfig.LASER_CANNON_ENTITY_HIT_EXPLOSION_MAX_STRENGTH,
|
||||
WarpDriveConfig.LASER_CANNON_ENTITY_HIT_EXPLOSION_BASE_STRENGTH
|
||||
+ (energy / (float)WarpDriveConfig.LASER_CANNON_ENTITY_HIT_EXPLOSION_ENERGY_PER_STRENGTH)));
|
||||
worldObj.newExplosion(null, entity.posX, entity.posY, entity.posZ, strength, true, true);
|
||||
}
|
||||
|
||||
// consume energy
|
||||
energy -= WarpDriveConfig.LE_ENTITY_HIT_DAMAGE_PER_ENERGY_DIVIDER + (10 * distanceToEntity);
|
||||
energy -= WarpDriveConfig.LASER_CANNON_ENTITY_HIT_ENERGY_PER_DAMAGE + (10 * distanceToEntity);
|
||||
endPoint = new Vector3(entityHit.hitVec);
|
||||
break;
|
||||
}
|
||||
|
@ -273,8 +277,9 @@ public class TileEntityLaser extends TileEntityAbstractInterfaced {
|
|||
endPoint = new Vector3(hit.hitVec);
|
||||
}
|
||||
|
||||
energy -= WarpDriveConfig.LE_BLOCK_HIT_CONSUME_ENERGY + (resistance * WarpDriveConfig.LE_BLOCK_HIT_CONSUME_ENERGY_PER_BLOCK_RESISTANCE)
|
||||
+ ((distance - distanceTravelled) * WarpDriveConfig.LE_BLOCK_HIT_CONSUME_ENERGY_PER_DISTANCE);
|
||||
energy -= WarpDriveConfig.LASER_CANNON_BLOCK_HIT_ENERGY
|
||||
+ (resistance * WarpDriveConfig.LASER_CANNON_BLOCK_HIT_ENERGY_PER_BLOCK_RESISTANCE)
|
||||
+ ((distance - distanceTravelled) * WarpDriveConfig.LASER_CANNON_BLOCK_HIT_ENERGY_PER_DISTANCE);
|
||||
distanceTravelled = distance;
|
||||
endPoint = new Vector3(hit.hitVec);
|
||||
|
||||
|
@ -282,8 +287,11 @@ public class TileEntityLaser extends TileEntityAbstractInterfaced {
|
|||
break;
|
||||
}
|
||||
|
||||
if (resistance >= Blocks.obsidian.getExplosionResistance(null)) {// TODO: choose entity
|
||||
worldObj.newExplosion(null, hit.blockX, hit.blockY, hit.blockZ, 4F * (2 + (energy / 500000)), true, true);
|
||||
if (resistance >= WarpDriveConfig.LASER_CANNON_BLOCK_HIT_EXPLOSION_RESISTANCE_THRESHOLD) {
|
||||
float strength = Math.max(0.0F, Math.min(WarpDriveConfig.LASER_CANNON_BLOCK_HIT_EXPLOSION_MAX_STRENGTH,
|
||||
WarpDriveConfig.LASER_CANNON_BLOCK_HIT_EXPLOSION_BASE_STRENGTH
|
||||
+ (energy / (float)WarpDriveConfig.LASER_CANNON_BLOCK_HIT_EXPLOSION_ENERGY_PER_STRENGTH)));
|
||||
worldObj.newExplosion(null, hit.blockX, hit.blockY, hit.blockZ, strength, true, true);
|
||||
worldObj.setBlock(hit.blockX, hit.blockY, hit.blockZ, (worldObj.rand.nextBoolean()) ? Blocks.fire : Blocks.air);
|
||||
} else {
|
||||
worldObj.setBlockToAir(hit.blockX, hit.blockY, hit.blockZ);
|
||||
|
|
|
@ -47,7 +47,7 @@ public class TileEntityLaserMedium extends TileEntityAbstractEnergy {
|
|||
// IEnergySink methods implementation
|
||||
@Override
|
||||
public int getMaxEnergyStored() {
|
||||
return WarpDriveConfig.PB_MAX_ENERGY_VALUE;
|
||||
return WarpDriveConfig.LASER_MEDIUM_MAX_ENERGY_STORED;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -208,7 +208,7 @@ public class TileEntityShipScanner extends TileEntityAbstractEnergy {
|
|||
if (WarpDriveConfig.SS_EU_PER_BLOCK_SCAN > 0) {
|
||||
return size * WarpDriveConfig.SS_EU_PER_BLOCK_SCAN;
|
||||
} else {
|
||||
return WarpDriveConfig.SS_MAX_ENERGY_VALUE;
|
||||
return WarpDriveConfig.SS_MAX_ENERGY_STORED;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -216,7 +216,7 @@ public class TileEntityShipScanner extends TileEntityAbstractEnergy {
|
|||
if (WarpDriveConfig.SS_EU_PER_BLOCK_DEPLOY > 0) {
|
||||
return size * WarpDriveConfig.SS_EU_PER_BLOCK_DEPLOY;
|
||||
} else {
|
||||
return WarpDriveConfig.SS_MAX_ENERGY_VALUE;
|
||||
return WarpDriveConfig.SS_MAX_ENERGY_STORED;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -613,7 +613,7 @@ public class TileEntityShipScanner extends TileEntityAbstractEnergy {
|
|||
// IEnergySink methods implementation
|
||||
@Override
|
||||
public int getMaxEnergyStored() {
|
||||
return WarpDriveConfig.SS_MAX_ENERGY_VALUE;
|
||||
return WarpDriveConfig.SS_MAX_ENERGY_STORED;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -116,11 +116,11 @@ public abstract class TileEntityAbstractMiner extends TileEntityAbstractLaser
|
|||
return silkTouch(toBool(o));
|
||||
}
|
||||
|
||||
protected int fortune(int f)
|
||||
protected int fortune(int level)
|
||||
{
|
||||
try
|
||||
{
|
||||
fortuneLevel = clamp(f,minFortune(),maxFortune());
|
||||
fortuneLevel = clamp(minFortune(), maxFortune(), level);
|
||||
}
|
||||
catch(NumberFormatException e)
|
||||
{
|
||||
|
@ -131,7 +131,7 @@ public abstract class TileEntityAbstractMiner extends TileEntityAbstractLaser
|
|||
|
||||
protected TileEntityLaserMedium booster()
|
||||
{
|
||||
if(booster == null)
|
||||
if (booster == null)
|
||||
findFirstBooster();
|
||||
return booster;
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ public abstract class TileEntityAbstractMiner extends TileEntityAbstractLaser
|
|||
|
||||
protected int calculateLayerCost()
|
||||
{
|
||||
return isOnEarth() ? WarpDriveConfig.ML_EU_PER_LAYER_EARTH : WarpDriveConfig.ML_EU_PER_LAYER_SPACE;
|
||||
return isOnEarth() ? WarpDriveConfig.MINING_LASER_PLANET_ENERGY_PER_LAYER : WarpDriveConfig.MINING_LASER_SPACE_ENERGY_PER_LAYER;
|
||||
}
|
||||
|
||||
protected int calculateBlockCost()
|
||||
|
@ -158,10 +158,10 @@ public abstract class TileEntityAbstractMiner extends TileEntityAbstractLaser
|
|||
|
||||
protected int calculateBlockCost(Block block)
|
||||
{
|
||||
int enPerBlock = isOnEarth() ? WarpDriveConfig.ML_EU_PER_BLOCK_EARTH : WarpDriveConfig.ML_EU_PER_BLOCK_SPACE;
|
||||
int enPerBlock = isOnEarth() ? WarpDriveConfig.MINING_LASER_PLANET_ENERGY_PER_BLOCK : WarpDriveConfig.MINING_LASER_SPACE_ENERGY_PER_BLOCK;
|
||||
if (silkTouch(block))
|
||||
return (int) Math.round(enPerBlock * WarpDriveConfig.ML_EU_MUL_SILKTOUCH);
|
||||
return (int) Math.round(enPerBlock * (Math.pow(WarpDriveConfig.ML_EU_MUL_FORTUNE, fortune())));
|
||||
return (int) Math.round(enPerBlock * WarpDriveConfig.MINING_LASER_SILKTOUCH_ENERGY_FACTOR);
|
||||
return (int) Math.round(enPerBlock * (Math.pow(WarpDriveConfig.MINING_LASER_FORTUNE_ENERGY_FACTOR, fortune())));
|
||||
}
|
||||
|
||||
protected boolean isRoomForHarvest()
|
||||
|
@ -210,7 +210,7 @@ public abstract class TileEntityAbstractMiner extends TileEntityAbstractLaser
|
|||
float r = getColorR();
|
||||
float g = getColorG();
|
||||
float b = getColorB();
|
||||
PacketHandler.sendBeamPacket(worldObj, minerVector, valuable.clone().translate(0.5D), r, g, b, 2 * WarpDriveConfig.ML_MINE_DELAY_TICKS, 0, 50);
|
||||
PacketHandler.sendBeamPacket(worldObj, minerVector, valuable.clone().translate(0.5D), r, g, b, 2 * WarpDriveConfig.MINING_LASER_MINE_DELAY_TICKS, 0, 50);
|
||||
//worldObj.playSoundEffect(xCoord + 0.5f, yCoord, zCoord + 0.5f, "warpdrive:lowlaser", 4F, 1F);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,16 +19,16 @@ public class TileEntityLaserTreeFarm extends TileEntityAbstractMiner {
|
|||
private boolean silkTouchLeaves = false;
|
||||
private boolean treeTap = false;
|
||||
|
||||
private final int defSize = 8;
|
||||
private final int radiusDefault = 8;
|
||||
private final int scanWait = 40;
|
||||
private final int mineWait = 4;
|
||||
private int delayMul = 4;
|
||||
|
||||
private int totalHarvested=0;
|
||||
private int totalHarvested = 0;
|
||||
|
||||
private int scan = 0;
|
||||
private int xSize = defSize;
|
||||
private int zSize = defSize;
|
||||
private int radiusX = radiusDefault;
|
||||
private int radiusZ = radiusDefault;
|
||||
|
||||
LinkedList<Vector3> logs;
|
||||
private int logIndex = 0;
|
||||
|
@ -41,7 +41,7 @@ public class TileEntityLaserTreeFarm extends TileEntityAbstractMiner {
|
|||
methodsArray = new String[] {
|
||||
"start",
|
||||
"stop",
|
||||
"area",
|
||||
"radius",
|
||||
"leaves",
|
||||
"silkTouch",
|
||||
"silkTouchLeaves",
|
||||
|
@ -165,13 +165,13 @@ public class TileEntityLaserTreeFarm extends TileEntityAbstractMiner {
|
|||
private LinkedList<Vector3> scanTrees() {
|
||||
int xmax, zmax, x1, x2, z1, z2;
|
||||
int xmin, zmin;
|
||||
x1 = xCoord + xSize / 2;
|
||||
x2 = xCoord - xSize / 2;
|
||||
x1 = xCoord + radiusX;
|
||||
x2 = xCoord - radiusX;
|
||||
xmin = Math.min(x1, x2);
|
||||
xmax = Math.max(x1, x2);
|
||||
|
||||
z1 = zCoord + zSize / 2;
|
||||
z2 = zCoord - zSize / 2;
|
||||
z1 = zCoord + radiusZ;
|
||||
z2 = zCoord - radiusZ;
|
||||
zmin = Math.min(z1, z2);
|
||||
zmax = Math.max(z1, z2);
|
||||
|
||||
|
@ -213,8 +213,8 @@ public class TileEntityLaserTreeFarm extends TileEntityAbstractMiner {
|
|||
@Override
|
||||
public void writeToNBT(NBTTagCompound tag) {
|
||||
super.writeToNBT(tag);
|
||||
tag.setInteger("xSize", xSize);
|
||||
tag.setInteger("zSize", zSize);
|
||||
tag.setInteger("radiusX", radiusX);
|
||||
tag.setInteger("radiusZ", radiusZ);
|
||||
tag.setBoolean("doLeaves", doLeaves);
|
||||
tag.setBoolean("active", active);
|
||||
tag.setBoolean("treetap", treeTap);
|
||||
|
@ -224,9 +224,17 @@ public class TileEntityLaserTreeFarm extends TileEntityAbstractMiner {
|
|||
@Override
|
||||
public void readFromNBT(NBTTagCompound tag) {
|
||||
super.readFromNBT(tag);
|
||||
xSize = tag.getInteger("xSize");
|
||||
zSize = tag.getInteger("zSize");
|
||||
|
||||
radiusX = tag.getInteger("radiusX");
|
||||
if (radiusX == 0) {
|
||||
radiusX = radiusDefault;
|
||||
}
|
||||
radiusX = clamp(WarpDriveConfig.TREE_FARM_MIN_RADIUS, WarpDriveConfig.TREE_FARM_MAX_RADIUS, radiusX);
|
||||
radiusZ = tag.getInteger("radiusZ");
|
||||
if (radiusZ == 0) {
|
||||
radiusZ = radiusDefault;
|
||||
}
|
||||
radiusZ = clamp(WarpDriveConfig.TREE_FARM_MIN_RADIUS, WarpDriveConfig.TREE_FARM_MAX_RADIUS, radiusZ);
|
||||
|
||||
doLeaves = tag.getBoolean("doLeaves");
|
||||
active = tag.getBoolean("active");
|
||||
treeTap = tag.getBoolean("treetap");
|
||||
|
@ -247,22 +255,25 @@ public class TileEntityLaserTreeFarm extends TileEntityAbstractMiner {
|
|||
active = true;
|
||||
}
|
||||
return new Boolean[] { true };
|
||||
|
||||
} else if (methodName.equals("stop")) {
|
||||
active = false;
|
||||
} else if (methodName.equals("area")) {
|
||||
|
||||
} else if (methodName.equals("radius")) {
|
||||
try {
|
||||
if (arguments.length == 1) {
|
||||
xSize = clamp(toInt(arguments[0]),3,WarpDriveConfig.TF_MAX_SIZE);
|
||||
zSize = xSize;
|
||||
radiusX = clamp(WarpDriveConfig.TREE_FARM_MIN_RADIUS, WarpDriveConfig.TREE_FARM_MAX_RADIUS, toInt(arguments[0]));
|
||||
radiusZ = radiusX;
|
||||
} else if (arguments.length == 2) {
|
||||
xSize = clamp(toInt(arguments[0]),3,WarpDriveConfig.TF_MAX_SIZE);
|
||||
zSize = clamp(toInt(arguments[1]),3,WarpDriveConfig.TF_MAX_SIZE);
|
||||
radiusX = clamp(WarpDriveConfig.TREE_FARM_MIN_RADIUS, WarpDriveConfig.TREE_FARM_MAX_RADIUS, toInt(arguments[0]));
|
||||
radiusZ = clamp(WarpDriveConfig.TREE_FARM_MIN_RADIUS, WarpDriveConfig.TREE_FARM_MAX_RADIUS, toInt(arguments[1]));
|
||||
}
|
||||
} catch(NumberFormatException e) {
|
||||
xSize = defSize;
|
||||
zSize = defSize;
|
||||
radiusX = radiusDefault;
|
||||
radiusZ = radiusDefault;
|
||||
}
|
||||
return new Integer[] { xSize , zSize };
|
||||
return new Integer[] { radiusX , radiusZ };
|
||||
|
||||
} else if (methodName.equals("leaves")) {
|
||||
try {
|
||||
if (arguments.length > 0) {
|
||||
|
@ -272,6 +283,7 @@ public class TileEntityLaserTreeFarm extends TileEntityAbstractMiner {
|
|||
|
||||
}
|
||||
return new Boolean[] { doLeaves };
|
||||
|
||||
} else if (methodName.equals("silkTouch")) {
|
||||
try {
|
||||
silkTouch(arguments[0]);
|
||||
|
@ -279,6 +291,7 @@ public class TileEntityLaserTreeFarm extends TileEntityAbstractMiner {
|
|||
silkTouch(false);
|
||||
}
|
||||
return new Object[] { silkTouch() };
|
||||
|
||||
} else if (methodName.equals("silkTouchLeaves")) {
|
||||
try {
|
||||
if (arguments.length >= 1) {
|
||||
|
@ -288,6 +301,7 @@ public class TileEntityLaserTreeFarm extends TileEntityAbstractMiner {
|
|||
silkTouchLeaves = false;
|
||||
}
|
||||
return new Object[] { silkTouchLeaves };
|
||||
|
||||
} else if (methodName.equals("treetap")) {
|
||||
try {
|
||||
if (arguments.length >= 1) {
|
||||
|
@ -297,9 +311,10 @@ public class TileEntityLaserTreeFarm extends TileEntityAbstractMiner {
|
|||
treeTap = false;
|
||||
}
|
||||
return new Object[] { treeTap };
|
||||
|
||||
} else if (methodName.equals("state")) {
|
||||
String state = active ? (mode==0?"scanning" : (mode == 1 ? "harvesting" : "tapping")) : "inactive";
|
||||
return new Object[] { state, xSize, zSize, energy(), totalHarvested };
|
||||
return new Object[] { state, radiusX, radiusZ, energy(), totalHarvested };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ public class TileEntityMiningLaser extends TileEntityAbstractInterfaced {
|
|||
if (currentState == STATE_WARMUP) { // warming up
|
||||
delayTicksWarmup++;
|
||||
updateMetadata(BlockMiningLaser.ICON_SCANNINGLOWPOWER);
|
||||
if (delayTicksWarmup >= WarpDriveConfig.ML_WARMUP_DELAY_TICKS) {
|
||||
if (delayTicksWarmup >= WarpDriveConfig.MINING_LASER_WARMUP_DELAY_TICKS) {
|
||||
delayTicksScan = 0;
|
||||
currentState = STATE_SCANNING;
|
||||
updateMetadata(BlockMiningLaser.ICON_SCANNINGLOWPOWER);
|
||||
|
@ -94,7 +94,7 @@ public class TileEntityMiningLaser extends TileEntityAbstractInterfaced {
|
|||
delayTicksScan++;
|
||||
if (delayTicksScan == 1) {
|
||||
// check power level
|
||||
enoughPower = consumeEnergyPacketFromBooster(isOnEarth ? WarpDriveConfig.ML_EU_PER_LAYER_EARTH : WarpDriveConfig.ML_EU_PER_LAYER_SPACE, true);
|
||||
enoughPower = consumeEnergyPacketFromBooster(isOnEarth ? WarpDriveConfig.MINING_LASER_PLANET_ENERGY_PER_LAYER : WarpDriveConfig.MINING_LASER_SPACE_ENERGY_PER_LAYER, true);
|
||||
if (!enoughPower) {
|
||||
updateMetadata(BlockMiningLaser.ICON_SCANNINGLOWPOWER);
|
||||
delayTicksScan = 0;
|
||||
|
@ -103,24 +103,24 @@ public class TileEntityMiningLaser extends TileEntityAbstractInterfaced {
|
|||
updateMetadata(BlockMiningLaser.ICON_SCANNINGPOWERED);
|
||||
}
|
||||
// show current layer
|
||||
int age = Math.max(40, 5 * WarpDriveConfig.ML_SCAN_DELAY_TICKS);
|
||||
double xmax = xCoord + WarpDriveConfig.ML_MAX_RADIUS + 1.0D;
|
||||
double xmin = xCoord - WarpDriveConfig.ML_MAX_RADIUS + 0.0D;
|
||||
double zmax = zCoord + WarpDriveConfig.ML_MAX_RADIUS + 1.0D;
|
||||
double zmin = zCoord - WarpDriveConfig.ML_MAX_RADIUS + 0.0D;
|
||||
int age = Math.max(40, 5 * WarpDriveConfig.MINING_LASER_SCAN_DELAY_TICKS);
|
||||
double xmax = xCoord + WarpDriveConfig.MINING_LASER_MAX_RADIUS + 1.0D;
|
||||
double xmin = xCoord - WarpDriveConfig.MINING_LASER_MAX_RADIUS + 0.0D;
|
||||
double zmax = zCoord + WarpDriveConfig.MINING_LASER_MAX_RADIUS + 1.0D;
|
||||
double zmin = zCoord - WarpDriveConfig.MINING_LASER_MAX_RADIUS + 0.0D;
|
||||
double y = currentLayer + 1.0D;
|
||||
PacketHandler.sendBeamPacket(worldObj, new Vector3(xmin, y, zmin), new Vector3(xmax, y, zmin), 0.3F, 0.0F, 1.0F, age, 0, 50);
|
||||
PacketHandler.sendBeamPacket(worldObj, new Vector3(xmax, y, zmin), new Vector3(xmax, y, zmax), 0.3F, 0.0F, 1.0F, age, 0, 50);
|
||||
PacketHandler.sendBeamPacket(worldObj, new Vector3(xmax, y, zmax), new Vector3(xmin, y, zmax), 0.3F, 0.0F, 1.0F, age, 0, 50);
|
||||
PacketHandler.sendBeamPacket(worldObj, new Vector3(xmin, y, zmax), new Vector3(xmin, y, zmin), 0.3F, 0.0F, 1.0F, age, 0, 50);
|
||||
} else if (delayTicksScan >= WarpDriveConfig.ML_SCAN_DELAY_TICKS) {
|
||||
} else if (delayTicksScan >= WarpDriveConfig.MINING_LASER_SCAN_DELAY_TICKS) {
|
||||
delayTicksScan = 0;
|
||||
if (currentLayer <= 0) {
|
||||
stop();
|
||||
return;
|
||||
}
|
||||
// consume power
|
||||
enoughPower = consumeEnergyPacketFromBooster(isOnEarth ? WarpDriveConfig.ML_EU_PER_LAYER_EARTH : WarpDriveConfig.ML_EU_PER_LAYER_SPACE, false);
|
||||
enoughPower = consumeEnergyPacketFromBooster(isOnEarth ? WarpDriveConfig.MINING_LASER_PLANET_ENERGY_PER_LAYER : WarpDriveConfig.MINING_LASER_SPACE_ENERGY_PER_LAYER, false);
|
||||
if (!enoughPower) {
|
||||
updateMetadata(BlockMiningLaser.ICON_SCANNINGLOWPOWER);
|
||||
return;
|
||||
|
@ -130,9 +130,9 @@ public class TileEntityMiningLaser extends TileEntityAbstractInterfaced {
|
|||
// scan
|
||||
scanLayer();
|
||||
if (valuablesInLayer.size() > 0) {
|
||||
int r = (int) Math.ceil(WarpDriveConfig.ML_MAX_RADIUS / 2.0D);
|
||||
int r = (int) Math.ceil(WarpDriveConfig.MINING_LASER_MAX_RADIUS / 2.0D);
|
||||
int offset = (yCoord - currentLayer) % (2 * r);
|
||||
int age = Math.max(20, Math.round(2.5F * WarpDriveConfig.ML_SCAN_DELAY_TICKS));
|
||||
int age = Math.max(20, Math.round(2.5F * WarpDriveConfig.MINING_LASER_SCAN_DELAY_TICKS));
|
||||
double y = currentLayer + 1.0D;
|
||||
PacketHandler.sendBeamPacket(worldObj, minerVector, new Vector3(xCoord - r + offset, y, zCoord + r).translate(0.3D),
|
||||
0.0F, 0.0F, 1.0F, age, 0, 50);
|
||||
|
@ -154,7 +154,7 @@ public class TileEntityMiningLaser extends TileEntityAbstractInterfaced {
|
|||
}
|
||||
} else if (currentState == STATE_MINING) { // mining
|
||||
delayTicksMine++;
|
||||
if (delayTicksMine >= WarpDriveConfig.ML_MINE_DELAY_TICKS) {
|
||||
if (delayTicksMine >= WarpDriveConfig.MINING_LASER_MINE_DELAY_TICKS) {
|
||||
delayTicksMine = 0;
|
||||
|
||||
if (valuableIndex >= valuablesInLayer.size()) {
|
||||
|
@ -170,7 +170,7 @@ public class TileEntityMiningLaser extends TileEntityAbstractInterfaced {
|
|||
}
|
||||
|
||||
// consume power
|
||||
enoughPower = consumeEnergyPacketFromBooster(isOnEarth ? WarpDriveConfig.ML_EU_PER_BLOCK_EARTH : WarpDriveConfig.ML_EU_PER_BLOCK_SPACE, false);
|
||||
enoughPower = consumeEnergyPacketFromBooster(isOnEarth ? WarpDriveConfig.MINING_LASER_PLANET_ENERGY_PER_BLOCK : WarpDriveConfig.MINING_LASER_SPACE_ENERGY_PER_BLOCK, false);
|
||||
if (!enoughPower) {
|
||||
updateMetadata(BlockMiningLaser.ICON_MININGLOWPOWER);
|
||||
return;
|
||||
|
@ -187,9 +187,9 @@ public class TileEntityMiningLaser extends TileEntityAbstractInterfaced {
|
|||
// Skip if block is too hard or its empty block (check again in
|
||||
// case it changed)
|
||||
if (!canDig(block, valuable.intX(), valuable.intY(), valuable.intZ())) {
|
||||
delayTicksMine = Math.round(WarpDriveConfig.ML_MINE_DELAY_TICKS * 0.8F);
|
||||
delayTicksMine = Math.round(WarpDriveConfig.MINING_LASER_MINE_DELAY_TICKS * 0.8F);
|
||||
}
|
||||
int age = Math.max(10, Math.round((4 + worldObj.rand.nextFloat()) * WarpDriveConfig.ML_MINE_DELAY_TICKS));
|
||||
int age = Math.max(10, Math.round((4 + worldObj.rand.nextFloat()) * WarpDriveConfig.MINING_LASER_MINE_DELAY_TICKS));
|
||||
PacketHandler.sendBeamPacket(worldObj, minerVector, new Vector3(valuable.intX(), valuable.intY(), valuable.intZ()).translate(0.5D), 1.0F, 1.0F,
|
||||
0.0F, age, 0, 50);
|
||||
worldObj.playSoundEffect(xCoord + 0.5f, yCoord, zCoord + 0.5f, "warpdrive:lowlaser", 4F, 1F);
|
||||
|
@ -323,7 +323,7 @@ public class TileEntityMiningLaser extends TileEntityAbstractInterfaced {
|
|||
e.printStackTrace();
|
||||
}
|
||||
if (isSilkHarvestable) {
|
||||
if (WarpDriveConfig.ML_DEUTERIUM_MUL_SILKTOUCH <= 0) {
|
||||
if (WarpDriveConfig.MINING_LASER_SILKTOUCH_DEUTERIUM_L <= 0) {
|
||||
ArrayList<ItemStack> isBlock = new ArrayList<ItemStack>();
|
||||
isBlock.add(new ItemStack(block, 1, blockMeta));
|
||||
return isBlock;
|
||||
|
@ -419,7 +419,7 @@ public class TileEntityMiningLaser extends TileEntityAbstractInterfaced {
|
|||
valuablesInLayer.add(new Vector3(x, currentLayer, z));
|
||||
}
|
||||
}
|
||||
for (radius = 1; radius <= WarpDriveConfig.ML_MAX_RADIUS; radius++) {
|
||||
for (radius = 1; radius <= WarpDriveConfig.MINING_LASER_MAX_RADIUS; radius++) {
|
||||
xmax = xCoord + radius;
|
||||
xmin = xCoord - radius;
|
||||
zmax = zCoord + radius;
|
||||
|
@ -617,7 +617,7 @@ public class TileEntityMiningLaser extends TileEntityAbstractInterfaced {
|
|||
delayTicksWarmup = 0;
|
||||
currentState = STATE_WARMUP;
|
||||
currentLayer = yCoord - layerOffset - 1;
|
||||
enableSilktouch = (arguments.length == 1 && (WarpDriveConfig.ML_DEUTERIUM_MUL_SILKTOUCH <= 0 || FluidRegistry.isFluidRegistered("deuterium")));
|
||||
enableSilktouch = (arguments.length == 1 && (WarpDriveConfig.MINING_LASER_SILKTOUCH_DEUTERIUM_L <= 0 || FluidRegistry.isFluidRegistered("deuterium")));
|
||||
return new Boolean[] { true };
|
||||
}
|
||||
|
||||
|
@ -630,7 +630,7 @@ public class TileEntityMiningLaser extends TileEntityAbstractInterfaced {
|
|||
delayTicksScan = 0;
|
||||
currentState = STATE_WARMUP;
|
||||
currentLayer = yCoord - layerOffset - 1;
|
||||
enableSilktouch = (arguments.length == 1 && (WarpDriveConfig.ML_DEUTERIUM_MUL_SILKTOUCH <= 0 || FluidRegistry.isFluidRegistered("deuterium")));
|
||||
enableSilktouch = (arguments.length == 1 && (WarpDriveConfig.MINING_LASER_SILKTOUCH_DEUTERIUM_L <= 0 || FluidRegistry.isFluidRegistered("deuterium")));
|
||||
return new Boolean[] { true };
|
||||
}
|
||||
|
||||
|
|
|
@ -21,8 +21,6 @@ import dan200.computercraft.api.lua.ILuaContext;
|
|||
import dan200.computercraft.api.peripheral.IComputerAccess;
|
||||
|
||||
public class TileEntityCloakingCore extends TileEntityAbstractEnergy {
|
||||
private final int MAX_ENERGY_VALUE = 500000000; // 500kk EU
|
||||
|
||||
public boolean isEnabled = false;
|
||||
public byte tier = 1; // cloaking field tier, 1 or 2
|
||||
|
||||
|
@ -86,7 +84,7 @@ public class TileEntityCloakingCore extends TileEntityAbstractEnergy {
|
|||
if (WarpDriveConfig.LOGGING_CLOAKING) {
|
||||
WarpDrive.logger.info(this + " Updating cloaking state...");
|
||||
}
|
||||
updateTicks = ((tier == 1) ? 20 : (tier == 2) ? 10 : 20) * WarpDriveConfig.CD_FIELD_REFRESH_INTERVAL_SECONDS; // resetting timer
|
||||
updateTicks = ((tier == 1) ? 20 : (tier == 2) ? 10 : 20) * WarpDriveConfig.CLOAKING_FIELD_REFRESH_INTERVAL_SECONDS; // resetting timer
|
||||
|
||||
isValid = validateAssembly();
|
||||
isCloaking = WarpDrive.cloaks.isAreaExists(worldObj, xCoord, yCoord, zCoord);
|
||||
|
@ -263,7 +261,7 @@ public class TileEntityCloakingCore extends TileEntityAbstractEnergy {
|
|||
}
|
||||
}
|
||||
}
|
||||
energyToConsume = volume * WarpDriveConfig.CD_ENERGY_PER_BLOCK_TIER1;
|
||||
energyToConsume = volume * WarpDriveConfig.CLOAKING_TIER1_ENERGY_PER_BLOCK;
|
||||
} else {// tier2 = everything counts
|
||||
for (y = minY; y <= maxY; y++) {
|
||||
for (x = minX; x <= maxX; x++) {
|
||||
|
@ -274,7 +272,7 @@ public class TileEntityCloakingCore extends TileEntityAbstractEnergy {
|
|||
}
|
||||
}
|
||||
}
|
||||
energyToConsume = volume * WarpDriveConfig.CD_ENERGY_PER_BLOCK_TIER2;
|
||||
energyToConsume = volume * WarpDriveConfig.CLOAKING_TIER2_ENERGY_PER_BLOCK;
|
||||
}
|
||||
|
||||
// WarpDrive.logger.info(this + " Consuming " + energyToConsume + " eU for " + blocksCount + " blocks");
|
||||
|
@ -296,7 +294,7 @@ public class TileEntityCloakingCore extends TileEntityAbstractEnergy {
|
|||
}
|
||||
|
||||
public boolean validateAssembly() {
|
||||
final int maxOuterCoilDistance = WarpDriveConfig.CD_MAX_CLOAKING_FIELD_SIDE - WarpDriveConfig.CD_COIL_CAPTURE_BLOCKS;
|
||||
final int maxOuterCoilDistance = WarpDriveConfig.CLOAKING_MAX_FIELD_RADIUS - WarpDriveConfig.CLOAKING_COIL_CAPTURE_BLOCKS;
|
||||
|
||||
// Directions to check (all six directions: left, right, up, down, front, back)
|
||||
for (int direction = 0; direction < 6; direction++) {
|
||||
|
@ -344,12 +342,12 @@ public class TileEntityCloakingCore extends TileEntityAbstractEnergy {
|
|||
}
|
||||
|
||||
// Check cloaking field parameters defining coils
|
||||
minX = xCoord - outerCoilsDistance[0] - WarpDriveConfig.CD_COIL_CAPTURE_BLOCKS;
|
||||
maxX = xCoord + outerCoilsDistance[1] + WarpDriveConfig.CD_COIL_CAPTURE_BLOCKS;
|
||||
minY = Math.max( 0, yCoord - outerCoilsDistance[2] - WarpDriveConfig.CD_COIL_CAPTURE_BLOCKS);
|
||||
maxY = Math.min(255, yCoord + outerCoilsDistance[3] + WarpDriveConfig.CD_COIL_CAPTURE_BLOCKS);
|
||||
minZ = zCoord - outerCoilsDistance[4] - WarpDriveConfig.CD_COIL_CAPTURE_BLOCKS;
|
||||
maxZ = zCoord + outerCoilsDistance[5] + WarpDriveConfig.CD_COIL_CAPTURE_BLOCKS;
|
||||
minX = xCoord - outerCoilsDistance[0] - WarpDriveConfig.CLOAKING_COIL_CAPTURE_BLOCKS;
|
||||
maxX = xCoord + outerCoilsDistance[1] + WarpDriveConfig.CLOAKING_COIL_CAPTURE_BLOCKS;
|
||||
minY = Math.max( 0, yCoord - outerCoilsDistance[2] - WarpDriveConfig.CLOAKING_COIL_CAPTURE_BLOCKS);
|
||||
maxY = Math.min(255, yCoord + outerCoilsDistance[3] + WarpDriveConfig.CLOAKING_COIL_CAPTURE_BLOCKS);
|
||||
minZ = zCoord - outerCoilsDistance[4] - WarpDriveConfig.CLOAKING_COIL_CAPTURE_BLOCKS;
|
||||
maxZ = zCoord + outerCoilsDistance[5] + WarpDriveConfig.CLOAKING_COIL_CAPTURE_BLOCKS;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -415,7 +413,7 @@ public class TileEntityCloakingCore extends TileEntityAbstractEnergy {
|
|||
|
||||
@Override
|
||||
public int getMaxEnergyStored() {
|
||||
return MAX_ENERGY_VALUE;
|
||||
return WarpDriveConfig.CLOAKING_MAX_ENERGY_STORED;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -195,7 +195,7 @@ public class TileEntityRadar extends TileEntityAbstractEnergy {
|
|||
|
||||
@Override
|
||||
public int getMaxEnergyStored() {
|
||||
return WarpDriveConfig.WR_MAX_ENERGY_VALUE;
|
||||
return WarpDriveConfig.RADAR_MAX_ENERGY_STORED;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -77,15 +77,15 @@ public class TileEntityEnanReactorCore extends TileEntityAbstractEnergy implemen
|
|||
}
|
||||
|
||||
int side = from.ordinal() - 2;
|
||||
if (containedEnergy > WarpDriveConfig.PR_TICK_TIME * PR_MIN_GENERATION * 100) {
|
||||
double amountToIncrease = WarpDriveConfig.PR_TICK_TIME
|
||||
* Math.max(PR_MIN_INSTABILITY, PR_MAX_INSTABILITY * Math.pow((worldObj.rand.nextDouble() * containedEnergy) / WarpDriveConfig.PR_MAX_ENERGY, 0.1));
|
||||
if (containedEnergy > WarpDriveConfig.ENAN_REACTOR_UPDATE_INTERVAL_TICKS * PR_MIN_GENERATION * 100) {
|
||||
double amountToIncrease = WarpDriveConfig.ENAN_REACTOR_UPDATE_INTERVAL_TICKS
|
||||
* Math.max(PR_MIN_INSTABILITY, PR_MAX_INSTABILITY * Math.pow((worldObj.rand.nextDouble() * containedEnergy) / WarpDriveConfig.ENAN_REACTOR_MAX_ENERGY_STORED, 0.1));
|
||||
if (WarpDriveConfig.LOGGING_ENERGY) {
|
||||
WarpDrive.logger.info("InsInc" + amountToIncrease);
|
||||
}
|
||||
instabilityValues[side] += amountToIncrease * (isNatural ? 1.0D : 0.25D);
|
||||
} else {
|
||||
double amountToDecrease = WarpDriveConfig.PR_TICK_TIME * Math.max(PR_MIN_INSTABILITY, instabilityValues[side] * 0.02D);
|
||||
double amountToDecrease = WarpDriveConfig.ENAN_REACTOR_UPDATE_INTERVAL_TICKS * Math.max(PR_MIN_INSTABILITY, instabilityValues[side] * 0.02D);
|
||||
instabilityValues[side] = Math.max(0.0D, instabilityValues[side] - amountToDecrease);
|
||||
}
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ public class TileEntityEnanReactorCore extends TileEntityAbstractEnergy implemen
|
|||
return;
|
||||
}
|
||||
|
||||
lasersReceived = Math.min(10.0F, lasersReceived + 1F / WarpDriveConfig.PR_MAX_LASERS);
|
||||
lasersReceived = Math.min(10.0F, lasersReceived + 1F / WarpDriveConfig.ENAN_REACTOR_MAX_LASERS_PER_SECOND);
|
||||
double nospamFactor = 1.0;
|
||||
if (lasersReceived > 1.0F) {
|
||||
nospamFactor = 0.5;
|
||||
|
@ -145,16 +145,16 @@ public class TileEntityEnanReactorCore extends TileEntityAbstractEnergy implemen
|
|||
}
|
||||
|
||||
if (active) {// producing, instability increase output, you want to take the risk
|
||||
int amountToGenerate = (int) Math.ceil(WarpDriveConfig.PR_TICK_TIME * (0.5D + stabilityOffset)
|
||||
* (PR_MIN_GENERATION + PR_MAX_GENERATION * Math.pow(containedEnergy / (double) WarpDriveConfig.PR_MAX_ENERGY, 0.6D)));
|
||||
containedEnergy = Math.min(containedEnergy + amountToGenerate, WarpDriveConfig.PR_MAX_ENERGY);
|
||||
lastGenerationRate = amountToGenerate / WarpDriveConfig.PR_TICK_TIME;
|
||||
int amountToGenerate = (int) Math.ceil(WarpDriveConfig.ENAN_REACTOR_UPDATE_INTERVAL_TICKS * (0.5D + stabilityOffset)
|
||||
* (PR_MIN_GENERATION + PR_MAX_GENERATION * Math.pow(containedEnergy / (double) WarpDriveConfig.ENAN_REACTOR_MAX_ENERGY_STORED, 0.6D)));
|
||||
containedEnergy = Math.min(containedEnergy + amountToGenerate, WarpDriveConfig.ENAN_REACTOR_MAX_ENERGY_STORED);
|
||||
lastGenerationRate = amountToGenerate / WarpDriveConfig.ENAN_REACTOR_UPDATE_INTERVAL_TICKS;
|
||||
if (WarpDriveConfig.LOGGING_ENERGY) {
|
||||
WarpDrive.logger.info("Generated " + amountToGenerate);
|
||||
}
|
||||
} else {// decaying over 20s without producing power, you better have
|
||||
// power for those lasers
|
||||
int amountToDecay = (int) (WarpDriveConfig.PR_TICK_TIME * (1.0D - stabilityOffset) * (PR_MIN_GENERATION + containedEnergy * 0.01D));
|
||||
int amountToDecay = (int) (WarpDriveConfig.ENAN_REACTOR_UPDATE_INTERVAL_TICKS * (1.0D - stabilityOffset) * (PR_MIN_GENERATION + containedEnergy * 0.01D));
|
||||
containedEnergy = Math.max(0, containedEnergy - amountToDecay);
|
||||
lastGenerationRate = 0;
|
||||
if (WarpDriveConfig.LOGGING_ENERGY) {
|
||||
|
@ -179,7 +179,7 @@ public class TileEntityEnanReactorCore extends TileEntityAbstractEnergy implemen
|
|||
|
||||
lasersReceived = Math.max(0.0F, lasersReceived - 0.05F);
|
||||
tickCount++;
|
||||
if (tickCount < WarpDriveConfig.PR_TICK_TIME) {
|
||||
if (tickCount < WarpDriveConfig.ENAN_REACTOR_UPDATE_INTERVAL_TICKS) {
|
||||
return;
|
||||
}
|
||||
tickCount = 0;
|
||||
|
@ -206,7 +206,7 @@ public class TileEntityEnanReactorCore extends TileEntityAbstractEnergy implemen
|
|||
|
||||
private void explode() {
|
||||
// remove blocks randomly up to x blocks around (breaking whatever protection is there)
|
||||
double normalizedEnergy = containedEnergy / (double) WarpDriveConfig.PR_MAX_ENERGY;
|
||||
double normalizedEnergy = containedEnergy / (double) WarpDriveConfig.ENAN_REACTOR_MAX_ENERGY_STORED;
|
||||
int radius = (int) Math.round(PR_MAX_EXPLOSION_RADIUS * Math.pow(normalizedEnergy, 0.125));
|
||||
double c = PR_MAX_EXPLOSION_REMOVAL_CHANCE * Math.pow(normalizedEnergy, 0.125);
|
||||
if (WarpDriveConfig.LOGGING_ENERGY) {
|
||||
|
@ -245,7 +245,7 @@ public class TileEntityEnanReactorCore extends TileEntityAbstractEnergy implemen
|
|||
}
|
||||
}
|
||||
int instabilityNibble = (int) Math.max(0, Math.min(3, Math.round(maxInstability / 25.0D)));
|
||||
int energyNibble = (int) Math.max(0, Math.min(3, Math.round(4.0D * containedEnergy / WarpDriveConfig.PR_MAX_ENERGY)));
|
||||
int energyNibble = (int) Math.max(0, Math.min(3, Math.round(4.0D * containedEnergy / WarpDriveConfig.ENAN_REACTOR_MAX_ENERGY_STORED)));
|
||||
|
||||
int metadata = 4 * instabilityNibble + energyNibble;
|
||||
if (getBlockMetadata() != metadata) {
|
||||
|
@ -404,7 +404,7 @@ public class TileEntityEnanReactorCore extends TileEntityAbstractEnergy implemen
|
|||
return active(arguments);
|
||||
|
||||
} else if (methodName.equals("energy")) {
|
||||
return new Object[] { containedEnergy, WarpDriveConfig.PR_MAX_ENERGY, releasedLastCycle / WarpDriveConfig.PR_TICK_TIME };
|
||||
return new Object[] { containedEnergy, WarpDriveConfig.ENAN_REACTOR_MAX_ENERGY_STORED, releasedLastCycle / WarpDriveConfig.ENAN_REACTOR_UPDATE_INTERVAL_TICKS };
|
||||
|
||||
} else if (methodName.equals("instability")) {
|
||||
Object[] retVal = new Object[4];
|
||||
|
@ -489,7 +489,7 @@ public class TileEntityEnanReactorCore extends TileEntityAbstractEnergy implemen
|
|||
|
||||
@Override
|
||||
public int getMaxEnergyStored() {
|
||||
return convertRFtoInternal(WarpDriveConfig.PR_MAX_ENERGY);
|
||||
return convertRFtoInternal(WarpDriveConfig.ENAN_REACTOR_MAX_ENERGY_STORED);
|
||||
}
|
||||
|
||||
// Forge overrides
|
||||
|
|
|
@ -30,7 +30,7 @@ public class TileEntityEnergyBank extends TileEntityAbstractEnergy {
|
|||
|
||||
@Override
|
||||
public int getMaxEnergyStored() {
|
||||
return WarpDriveConfig.PS_MAX_ENERGY;
|
||||
return WarpDriveConfig.ENERGY_BANK_MAX_ENERGY_STORED;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -71,10 +71,10 @@ public class TileEntityIC2reactorLaserMonitor extends TileEntityAbstractLaser {
|
|||
if (item != null) {
|
||||
if(item.getItem() instanceof ItemIC2reactorLaserFocus) {
|
||||
int heat = item.getItemDamage();
|
||||
int heatRemoval = (int) Math.floor(Math.min(getEnergyStored() / WarpDriveConfig.RM_EU_PER_HEAT, heat));
|
||||
int heatRemoval = (int) Math.floor(Math.min(getEnergyStored() / WarpDriveConfig.IC2_REACTOR_ENERGY_PER_HEAT, heat));
|
||||
if (heatRemoval > 0) {
|
||||
didCoolReactor = true;
|
||||
consumeEnergy((int) Math.ceil(heatRemoval * WarpDriveConfig.RM_EU_PER_HEAT), false);
|
||||
consumeEnergy((int) Math.ceil(heatRemoval * WarpDriveConfig.IC2_REACTOR_ENERGY_PER_HEAT), false);
|
||||
item.setItemDamage(heat - heatRemoval);
|
||||
}
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ public class TileEntityIC2reactorLaserMonitor extends TileEntityAbstractLaser {
|
|||
|
||||
@Override
|
||||
public int getMaxEnergyStored() {
|
||||
return WarpDriveConfig.RM_MAX_ENERGY;
|
||||
return WarpDriveConfig.IC2_REACTOR_MAX_ENERGY_STORED;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -56,7 +56,7 @@ public class TileEntityLift extends TileEntityAbstractEnergy {
|
|||
}
|
||||
|
||||
tickCount++;
|
||||
if (tickCount >= WarpDriveConfig.LL_TICK_RATE) {
|
||||
if (tickCount >= WarpDriveConfig.LIFT_UPDATE_INTERVAL_TICKS) {
|
||||
tickCount = 0;
|
||||
|
||||
// Switching mode
|
||||
|
@ -72,7 +72,7 @@ public class TileEntityLift extends TileEntityAbstractEnergy {
|
|||
&& isPassableBlock(yCoord - 1)
|
||||
&& isPassableBlock(yCoord - 2);
|
||||
|
||||
if (getEnergyStored() < WarpDriveConfig.LL_LIFT_ENERGY
|
||||
if (getEnergyStored() < WarpDriveConfig.LIFT_ENERGY_PER_ENTITY
|
||||
|| !isEnabled) {
|
||||
mode = MODE_INACTIVE;
|
||||
if (getBlockMetadata() != 0) {
|
||||
|
@ -140,13 +140,13 @@ public class TileEntityLift extends TileEntityAbstractEnergy {
|
|||
for (Object o : list) {
|
||||
if ( o != null
|
||||
&& o instanceof EntityLivingBase
|
||||
&& consumeEnergy(WarpDriveConfig.LL_LIFT_ENERGY, true)) {
|
||||
&& consumeEnergy(WarpDriveConfig.LIFT_ENERGY_PER_ENTITY, true)) {
|
||||
((EntityLivingBase) o).setPositionAndUpdate(xCoord + 0.5D, yCoord + 1.0D, zCoord + 0.5D);
|
||||
PacketHandler.sendBeamPacket(worldObj,
|
||||
new Vector3(xCoord + 0.5D, firstUncoveredY, zCoord + 0.5D),
|
||||
new Vector3(xCoord + 0.5D, yCoord, zCoord + 0.5D), 1F, 1F, 0F, 40, 0, 100);
|
||||
worldObj.playSoundEffect(xCoord + 0.5D, yCoord, zCoord + 0.5D, "warpdrive:hilaser", 4F, 1F);
|
||||
consumeEnergy(WarpDriveConfig.LL_LIFT_ENERGY, false);
|
||||
consumeEnergy(WarpDriveConfig.LIFT_ENERGY_PER_ENTITY, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -158,13 +158,13 @@ public class TileEntityLift extends TileEntityAbstractEnergy {
|
|||
for (Object o : list) {
|
||||
if ( o != null
|
||||
&& o instanceof EntityLivingBase
|
||||
&& consumeEnergy(WarpDriveConfig.LL_LIFT_ENERGY, true)) {
|
||||
&& consumeEnergy(WarpDriveConfig.LIFT_ENERGY_PER_ENTITY, true)) {
|
||||
((EntityLivingBase) o).setPositionAndUpdate(xCoord + 0.5D, firstUncoveredY, zCoord + 0.5D);
|
||||
PacketHandler.sendBeamPacket(worldObj,
|
||||
new Vector3(xCoord + 0.5D, yCoord, zCoord + 0.5D),
|
||||
new Vector3(xCoord + 0.5D, firstUncoveredY, zCoord + 0.5D), 1F, 1F, 0F, 40, 0, 100);
|
||||
worldObj.playSoundEffect(xCoord + 0.5D, yCoord, zCoord + 0.5D, "warpdrive:hilaser", 4F, 1F);
|
||||
consumeEnergy(WarpDriveConfig.LL_LIFT_ENERGY, false);
|
||||
consumeEnergy(WarpDriveConfig.LIFT_ENERGY_PER_ENTITY, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ public class TileEntityLift extends TileEntityAbstractEnergy {
|
|||
|
||||
@Override
|
||||
public int getMaxEnergyStored() {
|
||||
return WarpDriveConfig.LL_MAX_ENERGY;
|
||||
return WarpDriveConfig.LIFT_MAX_ENERGY_STORED;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -47,7 +47,7 @@ public class TileEntityShipController extends TileEntityAbstractInterfaced {
|
|||
|
||||
boolean ready = false; // Ready to operate (valid assembly)
|
||||
|
||||
private final int updateInterval_ticks = 20 * WarpDriveConfig.WC_CONTROLLER_UPDATE_INTERVAL_SECONDS;
|
||||
private final int updateInterval_ticks = 20 * WarpDriveConfig.SHIP_CONTROLLER_UPDATE_INTERVAL_SECONDS;
|
||||
private int updateTicks = updateInterval_ticks;
|
||||
private int bootTicks = 20;
|
||||
|
||||
|
@ -139,7 +139,7 @@ public class TileEntityShipController extends TileEntityAbstractInterfaced {
|
|||
private void doJump() {
|
||||
if (core != null) {
|
||||
// Adding random ticks to warmup
|
||||
core.randomWarmupAddition = worldObj.rand.nextInt(WarpDriveConfig.WC_WARMUP_RANDOM_TICKS);
|
||||
core.randomWarmupAddition = worldObj.rand.nextInt(WarpDriveConfig.SHIP_WARMUP_RANDOM_TICKS);
|
||||
} else {
|
||||
WarpDrive.logger.error(this + " doJump without a core");
|
||||
}
|
||||
|
@ -344,7 +344,7 @@ public class TileEntityShipController extends TileEntityAbstractInterfaced {
|
|||
}
|
||||
|
||||
private void setDistance(int distance) {
|
||||
this.distance = Math.max(1, Math.min(WarpDriveConfig.WC_MAX_JUMP_DISTANCE, distance));
|
||||
this.distance = Math.max(1, Math.min(WarpDriveConfig.SHIP_MAX_JUMP_DISTANCE, distance));
|
||||
if (WarpDriveConfig.LOGGING_JUMP) {
|
||||
WarpDrive.logger.info(this + " Jump distance set to " + distance);
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy {
|
|||
public int randomWarmupAddition = 0;
|
||||
|
||||
private int chestTeleportUpdateTicks = 0;
|
||||
private final int registryUpdateInterval_ticks = 20 * WarpDriveConfig.WC_CORES_REGISTRY_UPDATE_INTERVAL_SECONDS;
|
||||
private final int registryUpdateInterval_ticks = 20 * WarpDriveConfig.SHIP_CORE_REGISTRY_UPDATE_INTERVAL_SECONDS;
|
||||
private int registryUpdateTicks = 0;
|
||||
private int bootTicks = 20;
|
||||
|
||||
|
@ -166,7 +166,7 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy {
|
|||
}
|
||||
|
||||
isolationUpdateTicks++;
|
||||
if (isolationUpdateTicks > WarpDriveConfig.WC_ISOLATION_UPDATE_INTERVAL_SECONDS * 20) {
|
||||
if (isolationUpdateTicks > WarpDriveConfig.SHIP_CORE_ISOLATION_UPDATE_INTERVAL_SECONDS * 20) {
|
||||
isolationUpdateTicks = 0;
|
||||
updateIsolationState();
|
||||
}
|
||||
|
@ -228,9 +228,9 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy {
|
|||
case BASIC_JUMP:
|
||||
case LONG_JUMP:
|
||||
if (controller.getDistance() < 50) {
|
||||
targetWarmup = WarpDriveConfig.WC_WARMUP_SHORTJUMP_SECONDS * 20;
|
||||
targetWarmup = WarpDriveConfig.SHIP_SHORTJUMP_WARMUP_SECONDS * 20;
|
||||
} else {
|
||||
targetWarmup = WarpDriveConfig.WC_WARMUP_LONGJUMP_SECONDS * 20;
|
||||
targetWarmup = WarpDriveConfig.SHIP_LONGJUMP_WARMUP_SECONDS * 20;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -238,7 +238,7 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy {
|
|||
case HYPERSPACE:
|
||||
case GATE_JUMP:
|
||||
default:
|
||||
targetWarmup = WarpDriveConfig.WC_WARMUP_LONGJUMP_SECONDS * 20;
|
||||
targetWarmup = WarpDriveConfig.SHIP_LONGJUMP_WARMUP_SECONDS * 20;
|
||||
break;
|
||||
}
|
||||
// Select best sound file and adjust offset
|
||||
|
@ -278,11 +278,11 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy {
|
|||
messageToAllPlayersOnShip(reason.toString());
|
||||
return;
|
||||
}
|
||||
if (WarpDriveConfig.WC_WARMUP_SICKNESS) {
|
||||
if (WarpDriveConfig.SHIP_WARMUP_SICKNESS) {
|
||||
if (WarpDriveConfig.LOGGING_JUMP) {
|
||||
WarpDrive.logger.info(this + " Giving warp sickness targetWarmup " + targetWarmup + " distance " + controller.getDistance());
|
||||
}
|
||||
makePlayersOnShipDrunk(targetWarmup + WarpDriveConfig.WC_WARMUP_RANDOM_TICKS);
|
||||
makePlayersOnShipDrunk(targetWarmup + WarpDriveConfig.SHIP_WARMUP_RANDOM_TICKS);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -322,7 +322,7 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy {
|
|||
}
|
||||
|
||||
doJump();
|
||||
cooldownTime = WarpDriveConfig.WC_COOLDOWN_INTERVAL_SECONDS * 20;
|
||||
cooldownTime = WarpDriveConfig.SHIP_COOLDOWN_INTERVAL_SECONDS * 20;
|
||||
controller.setJumpFlag(false);
|
||||
} else {
|
||||
warmupTime = 0;
|
||||
|
@ -351,16 +351,16 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy {
|
|||
// Search block in cube around core
|
||||
int xmax, ymax, zmax;
|
||||
int xmin, ymin, zmin;
|
||||
xmin = xCoord - WarpDriveConfig.WR_MAX_ISOLATION_RANGE;
|
||||
xmax = xCoord + WarpDriveConfig.WR_MAX_ISOLATION_RANGE;
|
||||
xmin = xCoord - WarpDriveConfig.RADAR_MAX_ISOLATION_RANGE;
|
||||
xmax = xCoord + WarpDriveConfig.RADAR_MAX_ISOLATION_RANGE;
|
||||
|
||||
zmin = zCoord - WarpDriveConfig.WR_MAX_ISOLATION_RANGE;
|
||||
zmax = zCoord + WarpDriveConfig.WR_MAX_ISOLATION_RANGE;
|
||||
zmin = zCoord - WarpDriveConfig.RADAR_MAX_ISOLATION_RANGE;
|
||||
zmax = zCoord + WarpDriveConfig.RADAR_MAX_ISOLATION_RANGE;
|
||||
|
||||
// scan 1 block higher to encourage putting isolation block on both
|
||||
// ground and ceiling
|
||||
ymin = Math.max(0, yCoord - WarpDriveConfig.WR_MAX_ISOLATION_RANGE + 1);
|
||||
ymax = Math.min(255, yCoord + WarpDriveConfig.WR_MAX_ISOLATION_RANGE + 1);
|
||||
ymin = Math.max(0, yCoord - WarpDriveConfig.RADAR_MAX_ISOLATION_RANGE + 1);
|
||||
ymax = Math.min(255, yCoord + WarpDriveConfig.RADAR_MAX_ISOLATION_RANGE + 1);
|
||||
|
||||
int newCount = 0;
|
||||
|
||||
|
@ -375,12 +375,12 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy {
|
|||
}
|
||||
}
|
||||
isolationBlocksCount = newCount;
|
||||
if (isolationBlocksCount >= WarpDriveConfig.WR_MIN_ISOLATION_BLOCKS) {
|
||||
isolationRate = WarpDriveConfig.WR_MIN_ISOLATION_EFFECT
|
||||
+ (isolationBlocksCount - WarpDriveConfig.WR_MIN_ISOLATION_BLOCKS) // bonus
|
||||
if (isolationBlocksCount >= WarpDriveConfig.RADAR_MIN_ISOLATION_BLOCKS) {
|
||||
isolationRate = WarpDriveConfig.RADAR_MIN_ISOLATION_EFFECT
|
||||
+ (isolationBlocksCount - WarpDriveConfig.RADAR_MIN_ISOLATION_BLOCKS) // bonus
|
||||
// blocks
|
||||
* (WarpDriveConfig.WR_MAX_ISOLATION_EFFECT - WarpDriveConfig.WR_MIN_ISOLATION_EFFECT)
|
||||
/ (WarpDriveConfig.WR_MAX_ISOLATION_BLOCKS - WarpDriveConfig.WR_MIN_ISOLATION_BLOCKS);
|
||||
* (WarpDriveConfig.RADAR_MAX_ISOLATION_EFFECT - WarpDriveConfig.RADAR_MIN_ISOLATION_EFFECT)
|
||||
/ (WarpDriveConfig.RADAR_MAX_ISOLATION_BLOCKS - WarpDriveConfig.RADAR_MIN_ISOLATION_BLOCKS);
|
||||
} else {
|
||||
isolationRate = 0.0D;
|
||||
}
|
||||
|
@ -433,7 +433,7 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy {
|
|||
}
|
||||
|
||||
private void summonPlayer(EntityPlayerMP player, int x, int y, int z) {
|
||||
if (consumeEnergy(WarpDriveConfig.WC_ENERGY_PER_ENTITY_TO_SPACE, false)) {
|
||||
if (consumeEnergy(WarpDriveConfig.SHIP_TELEPORT_ENERGY_PER_ENTITY, false)) {
|
||||
player.setPositionAndUpdate(x, y, z);
|
||||
|
||||
if (player.dimension != worldObj.provider.dimensionId) {
|
||||
|
@ -531,9 +531,9 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy {
|
|||
}
|
||||
|
||||
// Ship side is too big
|
||||
if ((shipBack + shipFront) > WarpDriveConfig.WC_MAX_SHIP_SIDE || (shipLeft + shipRight) > WarpDriveConfig.WC_MAX_SHIP_SIDE
|
||||
|| (shipDown + shipUp) > WarpDriveConfig.WC_MAX_SHIP_SIDE) {
|
||||
reason.append("Ship is too big (max is " + WarpDriveConfig.WC_MAX_SHIP_SIDE + " per side)");
|
||||
if ((shipBack + shipFront) > WarpDriveConfig.SHIP_MAX_SIDE_SIZE || (shipLeft + shipRight) > WarpDriveConfig.SHIP_MAX_SIDE_SIZE
|
||||
|| (shipDown + shipUp) > WarpDriveConfig.SHIP_MAX_SIDE_SIZE) {
|
||||
reason.append("Ship is too big (max is " + WarpDriveConfig.SHIP_MAX_SIDE_SIZE + " per side)");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -546,14 +546,14 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy {
|
|||
}
|
||||
|
||||
String playerName = ((EntityPlayer) o).getDisplayName();
|
||||
for (String unlimiteName : WarpDriveConfig.WC_UNLIMITED_PLAYERNAMES) {
|
||||
for (String unlimiteName : WarpDriveConfig.SHIP_VOLUME_UNLIMITED_PLAYERNAMES) {
|
||||
isUnlimited = isUnlimited || unlimiteName.equals(playerName);
|
||||
}
|
||||
}
|
||||
|
||||
shipVolume = computeRealShipVolume();
|
||||
if (!isUnlimited && shipVolume > WarpDriveConfig.WC_MAX_SHIP_VOLUME_ON_SURFACE && worldObj.provider.dimensionId == 0) {
|
||||
reason.append("Ship is too big for the overworld (max is " + WarpDriveConfig.WC_MAX_SHIP_VOLUME_ON_SURFACE + " blocks)");
|
||||
if (!isUnlimited && shipVolume > WarpDriveConfig.SHIP_VOLUME_MAX_ON_PLANET_SURFACE && worldObj.provider.dimensionId == 0) {
|
||||
reason.append("Ship is too big for the overworld (max is " + WarpDriveConfig.SHIP_VOLUME_MAX_ON_PLANET_SURFACE + " blocks)");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -793,7 +793,7 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy {
|
|||
WarpDrive.logger.info(this + " Performing hyperspace jump of " + shipInfo);
|
||||
|
||||
// Check ship size for hyper-space jump
|
||||
if (shipVolume < WarpDriveConfig.WC_MIN_SHIP_VOLUME_FOR_HYPERSPACE) {
|
||||
if (shipVolume < WarpDriveConfig.SHIP_VOLUME_MIN_FOR_HYPERSPACE) {
|
||||
Jumpgate nearestGate = null;
|
||||
if (WarpDrive.jumpgates == null) {
|
||||
WarpDrive.logger.warn(this + " WarpDrive.instance.jumpGates is NULL!");
|
||||
|
@ -803,7 +803,7 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy {
|
|||
|
||||
StringBuilder reason = new StringBuilder();
|
||||
if (nearestGate == null || !isShipInJumpgate(nearestGate, reason)) {
|
||||
this.messageToAllPlayersOnShip("Ship is too small (" + shipVolume + "/" + WarpDriveConfig.WC_MIN_SHIP_VOLUME_FOR_HYPERSPACE
|
||||
this.messageToAllPlayersOnShip("Ship is too small (" + shipVolume + "/" + WarpDriveConfig.SHIP_VOLUME_MIN_FOR_HYPERSPACE
|
||||
+ "). Insufficient ship mass to open hyperspace portal. Use a jumpgate to reach or exit hyperspace.");
|
||||
this.controller.setJumpFlag(false);
|
||||
return;
|
||||
|
@ -857,7 +857,7 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy {
|
|||
|
||||
WorldServer spaceWorld = DimensionManager.getWorld(WarpDriveConfig.G_SPACE_DIMENSION_ID);
|
||||
for (Object o : list) {
|
||||
if (!consumeEnergy(WarpDriveConfig.WC_ENERGY_PER_ENTITY_TO_SPACE, false)) {
|
||||
if (!consumeEnergy(WarpDriveConfig.SHIP_TELEPORT_ENERGY_PER_ENTITY, false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -980,19 +980,19 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy {
|
|||
public static int calculateRequiredEnergy(ShipCoreMode currentMode, int shipVolume, int jumpDistance) {
|
||||
switch (currentMode) {
|
||||
case TELEPORT:
|
||||
return WarpDriveConfig.WC_ENERGY_PER_ENTITY_TO_SPACE;
|
||||
return WarpDriveConfig.SHIP_TELEPORT_ENERGY_PER_ENTITY;
|
||||
|
||||
case BASIC_JUMP:
|
||||
return (WarpDriveConfig.WC_ENERGY_PER_BLOCK_MODE1 * shipVolume) + (WarpDriveConfig.WC_ENERGY_PER_DISTANCE_MODE1 * jumpDistance);
|
||||
return (WarpDriveConfig.SHIP_NORMALJUMP_ENERGY_PER_BLOCK * shipVolume) + (WarpDriveConfig.SHIP_NORMALJUMP_ENERGY_PER_DISTANCE * jumpDistance);
|
||||
|
||||
case LONG_JUMP:
|
||||
return (WarpDriveConfig.WC_ENERGY_PER_BLOCK_MODE2 * shipVolume) + (WarpDriveConfig.WC_ENERGY_PER_DISTANCE_MODE2 * jumpDistance);
|
||||
return (WarpDriveConfig.SHIP_HYPERJUMP_ENERGY_PER_BLOCK * shipVolume) + (WarpDriveConfig.SHIP_HYPERJUMP_ENERGY_PER_DISTANCE * jumpDistance);
|
||||
|
||||
case HYPERSPACE:
|
||||
return WarpDriveConfig.WC_MAX_ENERGY_VALUE / 10; // 10% of maximum
|
||||
return WarpDriveConfig.SHIP_MAX_ENERGY_STORED / 10; // 10% of maximum
|
||||
|
||||
case BEACON_JUMP:
|
||||
return WarpDriveConfig.WC_MAX_ENERGY_VALUE / 2; // half of maximum
|
||||
return WarpDriveConfig.SHIP_MAX_ENERGY_STORED / 2; // half of maximum
|
||||
|
||||
case GATE_JUMP:
|
||||
return 2 * shipVolume;
|
||||
|
@ -1000,7 +1000,7 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy {
|
|||
break;
|
||||
}
|
||||
|
||||
return WarpDriveConfig.WC_MAX_ENERGY_VALUE;
|
||||
return WarpDriveConfig.SHIP_MAX_ENERGY_STORED;
|
||||
}
|
||||
|
||||
private int computeRealShipVolume() {
|
||||
|
@ -1070,7 +1070,7 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy {
|
|||
|
||||
@Override
|
||||
public int getMaxEnergyStored() {
|
||||
return WarpDriveConfig.WC_MAX_ENERGY_VALUE;
|
||||
return WarpDriveConfig.SHIP_MAX_ENERGY_STORED;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -69,13 +69,13 @@ public class TileEntityTransporter extends TileEntityAbstractEnergy implements I
|
|||
if (function != null && function.length > 0) {
|
||||
String fun = function[0].toString().toLowerCase();
|
||||
if (fun.equals("source")) {
|
||||
if (WarpDriveConfig.TR_RELATIVE_COORDS) {
|
||||
if (WarpDriveConfig.TRANSPORTER_USE_RELATIVE_COORDS) {
|
||||
return "source(x,y,z): sets the coordinates (relative to the transporter) to teleport from\ndest(): returns the relative x,y,z coordinates of the source";
|
||||
} else {
|
||||
return "source(x,y,z): sets the absolute coordinates to teleport from\ndest(): returns the x,y,z coordinates of the source";
|
||||
}
|
||||
} else if (fun.equals("dest")) {
|
||||
if (WarpDriveConfig.TR_RELATIVE_COORDS) {
|
||||
if (WarpDriveConfig.TRANSPORTER_USE_RELATIVE_COORDS) {
|
||||
return "dest(x,y,z): sets the coordinates (relative to the transporter) to teleport to\ndest(): returns the relative x,y,z coordinates of the destination";
|
||||
} else {
|
||||
return "dest(x,y,z): sets the absolute coordinates to teleport to\ndest(): returns the x,y,z coordinates of the destination";
|
||||
|
@ -105,7 +105,7 @@ public class TileEntityTransporter extends TileEntityAbstractEnergy implements I
|
|||
Vector3 vec = src ? sourceVec : destVec;
|
||||
|
||||
if (vec == null) {
|
||||
Vector3 sV = WarpDriveConfig.TR_RELATIVE_COORDS ? new Vector3(this) : new Vector3(0, 0, 0);
|
||||
Vector3 sV = WarpDriveConfig.TRANSPORTER_USE_RELATIVE_COORDS ? new Vector3(this) : new Vector3(0, 0, 0);
|
||||
if (src)
|
||||
sourceVec = sV;
|
||||
else
|
||||
|
@ -121,7 +121,7 @@ public class TileEntityTransporter extends TileEntityAbstractEnergy implements I
|
|||
vec.z = toDouble(arguments[2]);
|
||||
} else if (arguments.length == 1) {
|
||||
unlock();
|
||||
if (WarpDriveConfig.TR_RELATIVE_COORDS) {
|
||||
if (WarpDriveConfig.TRANSPORTER_USE_RELATIVE_COORDS) {
|
||||
vec.x = centreOnMe.x;
|
||||
vec.y = centreOnMe.y;
|
||||
vec.z = centreOnMe.z;
|
||||
|
@ -158,7 +158,7 @@ public class TileEntityTransporter extends TileEntityAbstractEnergy implements I
|
|||
} else if (methodName.equals("powerBoost")) {
|
||||
try {
|
||||
if (arguments.length >= 1) {
|
||||
powerBoost = clamp(toDouble(arguments[0]), 1, WarpDriveConfig.TR_MAX_BOOST_MUL);
|
||||
powerBoost = clamp(toDouble(arguments[0]), 1, WarpDriveConfig.TRANSPORTER_MAX_BOOST_MUL);
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
powerBoost = 1;
|
||||
|
@ -175,7 +175,7 @@ public class TileEntityTransporter extends TileEntityAbstractEnergy implements I
|
|||
|
||||
private Integer energyCost() {
|
||||
if (sourceVec != null && destVec != null) {
|
||||
return (int) Math.ceil(Math.pow(3, powerBoost - 1) * WarpDriveConfig.TR_EU_PER_METRE * sourceVec.distanceTo(destVec));
|
||||
return (int) Math.ceil(Math.pow(3, powerBoost - 1) * WarpDriveConfig.TRANSPORTER_ENERGY_PER_BLOCK * sourceVec.distanceTo(destVec));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -216,13 +216,13 @@ public class TileEntityTransporter extends TileEntityAbstractEnergy implements I
|
|||
private void transportEnt(Entity ent, Vector3 dest) {
|
||||
if (ent instanceof EntityLivingBase) {
|
||||
EntityLivingBase livingEnt = (EntityLivingBase) ent;
|
||||
if (WarpDriveConfig.TR_RELATIVE_COORDS) {
|
||||
if (WarpDriveConfig.TRANSPORTER_USE_RELATIVE_COORDS) {
|
||||
livingEnt.setPositionAndUpdate(xCoord + dest.x, yCoord + dest.y, zCoord + dest.z);
|
||||
} else {
|
||||
livingEnt.setPositionAndUpdate(dest.x, dest.y, dest.z);
|
||||
}
|
||||
} else {
|
||||
if (WarpDriveConfig.TR_RELATIVE_COORDS) {
|
||||
if (WarpDriveConfig.TRANSPORTER_USE_RELATIVE_COORDS) {
|
||||
ent.setPosition(xCoord + dest.x, yCoord + dest.y, zCoord + dest.z);
|
||||
} else {
|
||||
ent.setPosition(dest.x, dest.y, dest.z);
|
||||
|
@ -295,7 +295,7 @@ public class TileEntityTransporter extends TileEntityAbstractEnergy implements I
|
|||
}
|
||||
|
||||
private Vector3 absoluteVector(Vector3 a) {
|
||||
if (WarpDriveConfig.TR_RELATIVE_COORDS)
|
||||
if (WarpDriveConfig.TRANSPORTER_USE_RELATIVE_COORDS)
|
||||
return a.clone().translate(new Vector3(this));
|
||||
else
|
||||
return a;
|
||||
|
@ -303,7 +303,7 @@ public class TileEntityTransporter extends TileEntityAbstractEnergy implements I
|
|||
|
||||
private double calculatePower(Vector3 d) {
|
||||
Vector3 myCoords;
|
||||
if (WarpDriveConfig.TR_RELATIVE_COORDS)
|
||||
if (WarpDriveConfig.TRANSPORTER_USE_RELATIVE_COORDS)
|
||||
myCoords = centreOnMe;
|
||||
else
|
||||
myCoords = new Vector3(this).translate(centreOnMe);
|
||||
|
@ -359,7 +359,7 @@ public class TileEntityTransporter extends TileEntityAbstractEnergy implements I
|
|||
Vector3 bS = new Vector3(this);
|
||||
Vector3 scanPos = new Vector3(scanRange / 2, 2, scanRange / 2);
|
||||
Vector3 scanNeg = new Vector3(-scanRange / 2, -1, -scanRange / 2);
|
||||
if (WarpDriveConfig.TR_RELATIVE_COORDS) {
|
||||
if (WarpDriveConfig.TRANSPORTER_USE_RELATIVE_COORDS) {
|
||||
tS.translate(sourceVec).translate(scanPos);
|
||||
bS.translate(sourceVec).translate(scanNeg);
|
||||
} else {
|
||||
|
@ -395,7 +395,7 @@ public class TileEntityTransporter extends TileEntityAbstractEnergy implements I
|
|||
|
||||
@Override
|
||||
public int getMaxEnergyStored() {
|
||||
int max = WarpDriveConfig.TR_MAX_ENERGY;
|
||||
int max = WarpDriveConfig.TRANSPORTER_MAX_ENERGY;
|
||||
if (upgrades.containsKey(EnumUpgradeTypes.Energy)) {
|
||||
max = (int) Math.floor(max * Math.pow(1.2, upgrades.get(EnumUpgradeTypes.Energy)));
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.config.ConfigCategory;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
|
@ -26,7 +27,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
|||
import cr0s.warpdrive.WarpDrive;
|
||||
import cr0s.warpdrive.conf.filler.FillerManager;
|
||||
import cr0s.warpdrive.conf.structures.StructureManager;
|
||||
import cr0s.warpdrive.data.TransitionPlane;
|
||||
import cr0s.warpdrive.data.Planet;
|
||||
|
||||
public class WarpDriveConfig {
|
||||
private static File configDirectory;
|
||||
|
@ -93,10 +94,10 @@ public class WarpDriveConfig {
|
|||
public static String G_SCHEMALOCATION = "warpDrive_schematics";
|
||||
public static int G_BLOCKS_PER_TICK = 3500;
|
||||
|
||||
public static boolean G_ENABLE_IC2_RECIPES = true;
|
||||
public static boolean G_ENABLE_HARD_IC2_RECIPES = false;
|
||||
public static boolean G_ENABLE_VANILLA_RECIPES = false;
|
||||
public static boolean G_ENABLE_TDK_RECIPES = false;
|
||||
public static boolean RECIPES_ENABLE_IC2 = true;
|
||||
public static boolean RECIPES_ENABLE_HARD_IC2 = false;
|
||||
public static boolean RECIPES_ENABLE_VANILLA = false;
|
||||
public static boolean RECIPES_ENABLE_MIXED = false;
|
||||
|
||||
// logging
|
||||
public static boolean LOGGING_JUMP = false;
|
||||
|
@ -116,140 +117,142 @@ public class WarpDriveConfig {
|
|||
public static boolean LOGGING_WORLDGEN = false;
|
||||
|
||||
// Transition planes
|
||||
public static TransitionPlane[] G_TRANSITIONPLANES = null;
|
||||
public static Planet[] PLANETS = null;
|
||||
|
||||
// Warp Drive Core
|
||||
public static int WC_MAX_ENERGY_VALUE = 100000000;
|
||||
public static int WC_ENERGY_PER_BLOCK_MODE1 = 10;
|
||||
public static int WC_ENERGY_PER_DISTANCE_MODE1 = 100;
|
||||
public static int WC_ENERGY_PER_BLOCK_MODE2 = 1000;
|
||||
public static int WC_ENERGY_PER_DISTANCE_MODE2 = 1000;
|
||||
public static int WC_ENERGY_PER_ENTITY_TO_SPACE = 1000000;
|
||||
public static int WC_MAX_JUMP_DISTANCE = 128;
|
||||
public static int WC_MAX_SHIP_VOLUME_ON_SURFACE = 3000;
|
||||
public static int WC_MIN_SHIP_VOLUME_FOR_HYPERSPACE = 1200;
|
||||
public static int WC_MAX_SHIP_SIDE = 127;
|
||||
public static int WC_COOLDOWN_INTERVAL_SECONDS = 30;
|
||||
public static int WC_COLLISION_TOLERANCE_BLOCKS = 3;
|
||||
public static int WC_WARMUP_SHORTJUMP_SECONDS = 10;
|
||||
public static int WC_WARMUP_LONGJUMP_SECONDS = 30;
|
||||
public static int WC_WARMUP_RANDOM_TICKS = 60;
|
||||
public static int WC_CORES_REGISTRY_UPDATE_INTERVAL_SECONDS = 10;
|
||||
public static int WC_CONTROLLER_UPDATE_INTERVAL_SECONDS = 2;
|
||||
public static int WC_ISOLATION_UPDATE_INTERVAL_SECONDS = 10;
|
||||
public static String[] WC_UNLIMITED_PLAYERNAMES = { "notch", "someone" };
|
||||
public static boolean WC_WARMUP_SICKNESS = true;
|
||||
public static int SHIP_MAX_ENERGY_STORED = 100000000;
|
||||
public static int SHIP_NORMALJUMP_ENERGY_PER_BLOCK = 10;
|
||||
public static int SHIP_NORMALJUMP_ENERGY_PER_DISTANCE = 100;
|
||||
public static int SHIP_HYPERJUMP_ENERGY_PER_BLOCK = 1000;
|
||||
public static int SHIP_HYPERJUMP_ENERGY_PER_DISTANCE = 1000;
|
||||
public static int SHIP_TELEPORT_ENERGY_PER_ENTITY = 1000000;
|
||||
public static int SHIP_MAX_JUMP_DISTANCE = 128;
|
||||
public static int SHIP_VOLUME_MAX_ON_PLANET_SURFACE = 3000;
|
||||
public static int SHIP_VOLUME_MIN_FOR_HYPERSPACE = 1200;
|
||||
public static int SHIP_MAX_SIDE_SIZE = 127;
|
||||
public static int SHIP_COOLDOWN_INTERVAL_SECONDS = 30;
|
||||
public static int SHIP_COLLISION_TOLERANCE_BLOCKS = 3;
|
||||
public static int SHIP_SHORTJUMP_THRESHOLD_BLOCKS = 50;
|
||||
public static int SHIP_SHORTJUMP_WARMUP_SECONDS = 10;
|
||||
public static int SHIP_LONGJUMP_WARMUP_SECONDS = 30;
|
||||
public static int SHIP_WARMUP_RANDOM_TICKS = 60;
|
||||
public static int SHIP_CORE_REGISTRY_UPDATE_INTERVAL_SECONDS = 10;
|
||||
public static int SHIP_CONTROLLER_UPDATE_INTERVAL_SECONDS = 2;
|
||||
public static int SHIP_CORE_ISOLATION_UPDATE_INTERVAL_SECONDS = 10;
|
||||
public static String[] SHIP_VOLUME_UNLIMITED_PLAYERNAMES = { "notch", "someone" };
|
||||
public static boolean SHIP_WARMUP_SICKNESS = true;
|
||||
|
||||
// Warp Radar
|
||||
public static int WR_MAX_ENERGY_VALUE = 100000000; // 100kk eU
|
||||
public static int WR_MAX_ISOLATION_RANGE = 2;
|
||||
public static int WR_MIN_ISOLATION_BLOCKS = 5;
|
||||
public static int WR_MAX_ISOLATION_BLOCKS = 132;
|
||||
public static double WR_MIN_ISOLATION_EFFECT = 0.12;
|
||||
public static double WR_MAX_ISOLATION_EFFECT = 1.00;
|
||||
public static int RADAR_MAX_ENERGY_STORED = 100000000; // 100kk eU
|
||||
public static int RADAR_MAX_ISOLATION_RANGE = 2;
|
||||
public static int RADAR_MIN_ISOLATION_BLOCKS = 5;
|
||||
public static int RADAR_MAX_ISOLATION_BLOCKS = 132;
|
||||
public static double RADAR_MIN_ISOLATION_EFFECT = 0.12;
|
||||
public static double RADAR_MAX_ISOLATION_EFFECT = 1.00;
|
||||
|
||||
// Ship Scanner
|
||||
public static int SS_MAX_ENERGY_VALUE = 500000000;
|
||||
public static int SS_MAX_ENERGY_STORED = 500000000;
|
||||
public static int SS_EU_PER_BLOCK_SCAN = 100; // eU per block of ship volume
|
||||
// (including air)
|
||||
public static int SS_EU_PER_BLOCK_DEPLOY = 5000;
|
||||
public static int SS_MAX_DEPLOY_RADIUS_BLOCKS = 50;
|
||||
|
||||
// Particle Booster
|
||||
public static int PB_MAX_ENERGY_VALUE = 100000;
|
||||
public static int LASER_MEDIUM_MAX_ENERGY_STORED = 100000;
|
||||
|
||||
// Laser Emitter
|
||||
public static int LE_MAX_BOOSTERS_NUMBER = 10;
|
||||
public static int LE_MAX_LASER_ENERGY = 4000000;
|
||||
public static int LE_EMIT_DELAY_TICKS = 20 * 3;
|
||||
public static int LE_EMIT_SCAN_DELAY_TICKS = 10;
|
||||
|
||||
public static double LE_COLLECT_ENERGY_MULTIPLIER = 0.60D;
|
||||
public static int LE_BEAM_LENGTH_PER_ENERGY_DIVIDER = 5000;
|
||||
public static int LE_ENTITY_HIT_SET_ON_FIRE_TIME = 100;
|
||||
public static int LE_ENTITY_HIT_DAMAGE_PER_ENERGY_DIVIDER = 10000;
|
||||
public static int LE_ENTITY_HIT_EXPLOSION_LASER_ENERGY = 1000000;
|
||||
public static int LE_BLOCK_HIT_CONSUME_ENERGY = 70000;
|
||||
public static int LE_BLOCK_HIT_CONSUME_ENERGY_PER_BLOCK_RESISTANCE = 1000;
|
||||
public static int LE_BLOCK_HIT_CONSUME_ENERGY_PER_DISTANCE = 10;
|
||||
public static int LASER_CANNON_MAX_MEDIUMS_COUNT = 10;
|
||||
public static int LASER_CANNON_MAX_LASER_ENERGY = 4000000;
|
||||
public static int LASER_CANNON_EMIT_FIRE_DELAY_TICKS = 20 * 3;
|
||||
public static int LASER_CANNON_EMIT_SCAN_DELAY_TICKS = 10;
|
||||
|
||||
public static double LASER_CANNON_BOOSTER_BEAM_ENERGY_EFFICIENCY = 0.60D;
|
||||
public static int LASER_CANNON_ENERGY_LOSS_PER_BLOCK = 5000;
|
||||
public static int LASER_CANNON_ENTITY_HIT_SET_ON_FIRE_SECONDS = 100;
|
||||
public static int LASER_CANNON_ENTITY_HIT_ENERGY_PER_DAMAGE = 10000;
|
||||
public static int LASER_CANNON_ENTITY_HIT_MAX_DAMAGE = 100;
|
||||
public static int LASER_CANNON_ENTITY_HIT_ENERGY_THRESHOLD_FOR_EXPLOSION = 1000000;
|
||||
public static float LASER_CANNON_ENTITY_HIT_EXPLOSION_BASE_STRENGTH = 4.0F;
|
||||
public static int LASER_CANNON_ENTITY_HIT_EXPLOSION_ENERGY_PER_STRENGTH = 125000;
|
||||
public static float LASER_CANNON_ENTITY_HIT_EXPLOSION_MAX_STRENGTH = 4.0F;
|
||||
|
||||
public static int LASER_CANNON_BLOCK_HIT_ENERGY = 70000;
|
||||
public static int LASER_CANNON_BLOCK_HIT_ENERGY_PER_BLOCK_RESISTANCE = 1000;
|
||||
public static int LASER_CANNON_BLOCK_HIT_ENERGY_PER_DISTANCE = 10;
|
||||
public static double LASER_CANNON_BLOCK_HIT_EXPLOSION_RESISTANCE_THRESHOLD = 1200.0D; // obsidian is 2000 * 3 / 5 = 1200
|
||||
public static float LASER_CANNON_BLOCK_HIT_EXPLOSION_BASE_STRENGTH = 8.0F;
|
||||
public static int LASER_CANNON_BLOCK_HIT_EXPLOSION_ENERGY_PER_STRENGTH = 125000;
|
||||
public static float LASER_CANNON_BLOCK_HIT_EXPLOSION_MAX_STRENGTH = 100F;
|
||||
|
||||
// Mining Laser
|
||||
// BuildCraft quarry values for reference
|
||||
// - harvesting one block is 60 MJ/block = 600 RF/block = ~145 EU/block
|
||||
// - maximum speed is 3.846 ticks per blocks
|
||||
// - overall consumption varies from 81.801 to 184.608 MJ/block (depending
|
||||
// on speed) = up to 1846.08 RF/block = up to ~448 EU/block
|
||||
// - at radius 5, one layer takes ~465 ticks ((ML_MAX_RADIUS * 2 + 1) ^ 2 *
|
||||
// 3.846)
|
||||
// - overall consumption is ((ML_MAX_RADIUS * 2 + 1) ^ 2) * 448 => ~ 54208
|
||||
// EU/layer
|
||||
// - overall consumption varies from 81.801 to 184.608 MJ/block (depending on speed) = up to 1846.08 RF/block = up to ~448 EU/block
|
||||
// - at radius 5, one layer takes ~465 ticks ((ML_MAX_RADIUS * 2 + 1) ^ 2 * 3.846)
|
||||
// - overall consumption is ((ML_MAX_RADIUS * 2 + 1) ^ 2) * 448 => ~ 54208 EU/layer
|
||||
// WarpDrive mining laser in comparison
|
||||
// - each mined layer is scanned twice
|
||||
// - default ore generation: 1 ore out of 25 blocks
|
||||
// - overall consumption in 'all, space' is ML_EU_PER_LAYER_SPACE /
|
||||
// ((ML_MAX_RADIUS * 2 + 1) ^ 2) + ML_EU_PER_BLOCK_SPACE => ~ 356 EU/block
|
||||
// - overall consumption in 'all, space' is ML_EU_PER_LAYER_SPACE +
|
||||
// ((ML_MAX_RADIUS * 2 + 1) ^ 2) * ML_EU_PER_BLOCK_SPACE => ~ 43150 EU/layer
|
||||
// - overall consumption in 'ores, space' is ML_EU_PER_LAYER_SPACE +
|
||||
// ((ML_MAX_RADIUS * 2 + 1) ^ 2) * ML_EU_PER_BLOCK_SPACE *
|
||||
// ML_EU_MUL_ORESONLY / 25 => ~ 28630 EU/layer
|
||||
// - at radius 5, one layer takes 403 ticks (2 * ML_SCAN_DELAY_TICKS +
|
||||
// ML_MINE_DELAY_TICKS * (ML_MAX_RADIUS * 2 + 1) ^ 2)
|
||||
public static int ML_MAX_BOOSTERS_NUMBER = 1;
|
||||
public static int ML_WARMUP_DELAY_TICKS = 20;
|
||||
public static int ML_SCAN_DELAY_TICKS = 20;
|
||||
public static int ML_MINE_DELAY_TICKS = 3;
|
||||
public static int ML_EU_PER_LAYER_SPACE = 25000;
|
||||
public static int ML_EU_PER_LAYER_EARTH = 35000;
|
||||
public static int ML_EU_PER_BLOCK_SPACE = 150;
|
||||
public static int ML_EU_PER_BLOCK_EARTH = 300;
|
||||
public static double ML_EU_MUL_ORESONLY = 5.0; // lower value encourages to
|
||||
// keep the land 'clean'
|
||||
public static double ML_EU_MUL_SILKTOUCH = 2.5;
|
||||
public static double ML_DEUTERIUM_MUL_SILKTOUCH = 1.0;
|
||||
public static double ML_EU_MUL_FORTUNE = 2.5;
|
||||
public static int ML_MAX_RADIUS = 5;
|
||||
|
||||
// - overall consumption in 'all, space' is ML_EU_PER_LAYER_SPACE / ((ML_MAX_RADIUS * 2 + 1) ^ 2) + ML_EU_PER_BLOCK_SPACE => ~ 356 EU/block
|
||||
// - overall consumption in 'all, space' is ML_EU_PER_LAYER_SPACE + ((ML_MAX_RADIUS * 2 + 1) ^ 2) * ML_EU_PER_BLOCK_SPACE => ~ 43150 EU/layer
|
||||
// - overall consumption in 'ores, space' is ML_EU_PER_LAYER_SPACE + ((ML_MAX_RADIUS * 2 + 1) ^ 2) * ML_EU_PER_BLOCK_SPACE * ML_EU_MUL_ORESONLY / 25 => ~ 28630 EU/layer
|
||||
// - at radius 5, one layer takes 403 ticks (2 * ML_SCAN_DELAY_TICKS + ML_MINE_DELAY_TICKS * (ML_MAX_RADIUS * 2 + 1) ^ 2)
|
||||
public static int MINING_LASER_MAX_MEDIUMS_COUNT = 1;
|
||||
public static int MINING_LASER_MAX_RADIUS = 16;
|
||||
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 = 25000;
|
||||
public static int MINING_LASER_PLANET_ENERGY_PER_LAYER = 35000;
|
||||
public static int MINING_LASER_SPACE_ENERGY_PER_BLOCK = 150;
|
||||
public static int MINING_LASER_PLANET_ENERGY_PER_BLOCK = 300;
|
||||
public static double MINING_LASER_ORESONLY_ENERGY_FACTOR = 5.0; // lower value encourages to keep the land 'clean'
|
||||
public static double MINING_LASER_SILKTOUCH_ENERGY_FACTOR = 2.5;
|
||||
public static double MINING_LASER_SILKTOUCH_DEUTERIUM_L = 1.0;
|
||||
public static double MINING_LASER_FORTUNE_ENERGY_FACTOR = 2.5;
|
||||
|
||||
// Tree farm
|
||||
public static int TF_MAX_SIZE = 16;
|
||||
|
||||
// Cloaking device core
|
||||
public static int CD_MAX_CLOAKING_FIELD_SIDE = 100;
|
||||
public static int CD_ENERGY_PER_BLOCK_TIER1 = 125;
|
||||
public static int CD_ENERGY_PER_BLOCK_TIER2 = 500;
|
||||
public static int CD_FIELD_REFRESH_INTERVAL_SECONDS = 3;
|
||||
public static int CD_COIL_CAPTURE_BLOCKS = 5;
|
||||
|
||||
public static int TREE_FARM_MIN_RADIUS = 5;
|
||||
public static int TREE_FARM_MAX_RADIUS = 16;
|
||||
|
||||
// Cloaking
|
||||
public static int CLOAKING_MAX_ENERGY_STORED = 500000000;
|
||||
public static int CLOAKING_COIL_CAPTURE_BLOCKS = 5;
|
||||
public static int CLOAKING_MAX_FIELD_RADIUS = 100;
|
||||
public static int CLOAKING_TIER1_ENERGY_PER_BLOCK = 125;
|
||||
public static int CLOAKING_TIER2_ENERGY_PER_BLOCK = 500;
|
||||
public static int CLOAKING_FIELD_REFRESH_INTERVAL_SECONDS = 3;
|
||||
|
||||
// Air generator
|
||||
public static int AG_RF_PER_CANISTER = 20;
|
||||
public static int AG_EU_PER_NEWAIRBLOCK = 12;
|
||||
public static int AG_EU_PER_EXISTINGAIRBLOCK = 4;
|
||||
public static int AG_MAX_ENERGY = 4000;
|
||||
public static int AG_AIR_GENERATION_TICKS = 40;
|
||||
public static int AIRGEN_ENERGY_PER_CANISTER = 20;
|
||||
public static int AIRGEN_ENERGY_PER_NEWAIRBLOCK = 12;
|
||||
public static int AIRGEN_ENERGY_PER_EXISTINGAIRBLOCK = 4;
|
||||
public static int AIRGEN_MAX_ENERGY_STORED = 4000;
|
||||
public static int AIRGEN_AIR_GENERATION_TICKS = 40;
|
||||
|
||||
// IC2 Reactor monitor
|
||||
public static int RM_MAX_ENERGY = 1000000;
|
||||
public static double RM_EU_PER_HEAT = 2;
|
||||
public static int IC2_REACTOR_MAX_ENERGY_STORED = 1000000;
|
||||
public static double IC2_REACTOR_ENERGY_PER_HEAT = 2;
|
||||
|
||||
// Transporter
|
||||
public static int TR_MAX_ENERGY = 1000000;
|
||||
public static boolean TR_RELATIVE_COORDS = true;
|
||||
public static double TR_EU_PER_METRE = 100.0;
|
||||
// public static double TR_MAX_SCAN_RANGE = 4; FIXME: not used ?!?
|
||||
public static double TR_MAX_BOOST_MUL = 4.0;
|
||||
public static int TRANSPORTER_MAX_ENERGY = 1000000;
|
||||
public static boolean TRANSPORTER_USE_RELATIVE_COORDS = true;
|
||||
public static double TRANSPORTER_ENERGY_PER_BLOCK = 100.0;
|
||||
public static double TRANSPORTER_MAX_BOOST_MUL = 4.0;
|
||||
|
||||
// Enantiomorphic Power reactor
|
||||
public static int PR_MAX_ENERGY = 100000000;
|
||||
public static int PR_TICK_TIME = 5;
|
||||
public static int PR_MAX_LASERS = 6;
|
||||
public static int ENAN_REACTOR_MAX_ENERGY_STORED = 100000000;
|
||||
public static int ENAN_REACTOR_UPDATE_INTERVAL_TICKS = 5;
|
||||
public static int ENAN_REACTOR_MAX_LASERS_PER_SECOND = 6;
|
||||
|
||||
// Power store
|
||||
public static int PS_MAX_ENERGY = 1000000;
|
||||
public static int ENERGY_BANK_MAX_ENERGY_STORED = 1000000;
|
||||
|
||||
// Laser Lift
|
||||
public static int LL_MAX_ENERGY = 2400;
|
||||
public static int LL_LIFT_ENERGY = 800;
|
||||
public static int LL_TICK_RATE = 10;
|
||||
public static int LIFT_MAX_ENERGY_STORED = 2400;
|
||||
public static int LIFT_ENERGY_PER_ENTITY = 800;
|
||||
public static int LIFT_UPDATE_INTERVAL_TICKS = 10;
|
||||
|
||||
// Chunk Loader
|
||||
public static int CL_MAX_ENERGY = 1000000;
|
||||
|
@ -299,240 +302,351 @@ public class WarpDriveConfig {
|
|||
});
|
||||
if (files.length == 0) {
|
||||
for(String defaultXMLfilename : defaultXMLfilenames) {
|
||||
unpackResourceToFolder(defaultXMLfilename, "config/" + defaultXMLfilename, configDirectory);
|
||||
unpackResourceToFolder(defaultXMLfilename, "config", configDirectory);
|
||||
}
|
||||
}
|
||||
|
||||
FillerManager.loadOres(configDirectory);
|
||||
StructureManager.loadStructures(configDirectory);
|
||||
}
|
||||
|
||||
|
||||
public static void loadWarpDriveConfig(File file) {
|
||||
Configuration config = new Configuration(file);
|
||||
config.load();
|
||||
|
||||
// General
|
||||
G_SPACE_PROVIDER_ID = config.get("General", "space_provider_id", G_SPACE_PROVIDER_ID, "Space dimension provider ID").getInt();
|
||||
G_SPACE_DIMENSION_ID = config.get("General", "space_dimension_id", G_SPACE_DIMENSION_ID, "Space dimension world ID").getInt();
|
||||
G_HYPERSPACE_PROVIDER_ID = config.get("General", "hyperspace_provider_id", G_HYPERSPACE_PROVIDER_ID, "Hyperspace dimension provider ID").getInt();
|
||||
G_HYPERSPACE_DIMENSION_ID = config.get("General", "hyperspace_dimension_id", G_HYPERSPACE_DIMENSION_ID, "Hyperspace dimension world ID").getInt();
|
||||
G_SPACE_WORLDBORDER_BLOCKS = config.get("General", "space_worldborder_blocks", G_SPACE_WORLDBORDER_BLOCKS,
|
||||
"World border applied to hyperspace & space, set to 0 to disable it").getInt();
|
||||
G_ENTITY_JUMP_ID = config.get("General", "entity_jump_id", G_ENTITY_JUMP_ID, "Entity jump ID").getInt();
|
||||
G_ENTITY_SPHERE_GENERATOR_ID = config.get("General", "entity_sphere_generator_id", G_ENTITY_SPHERE_GENERATOR_ID, "Entity sphere generator ID").getInt();
|
||||
G_ENTITY_STAR_CORE_ID = config.get("General", "entity_star_core_id", G_ENTITY_STAR_CORE_ID, "Entity star core ID").getInt();
|
||||
G_ENTITY_CAMERA_ID = config.get("General", "entity_camera_id", G_ENTITY_CAMERA_ID, "Entity camera ID").getInt();
|
||||
G_SPACE_PROVIDER_ID = clamp(Integer.MIN_VALUE, Integer.MAX_VALUE,
|
||||
config.get("general", "space_provider_id", G_SPACE_PROVIDER_ID, "Space dimension provider ID").getInt());
|
||||
G_SPACE_DIMENSION_ID = clamp(Integer.MIN_VALUE, Integer.MAX_VALUE,
|
||||
config.get("general", "space_dimension_id", G_SPACE_DIMENSION_ID, "Space dimension world ID").getInt());
|
||||
G_HYPERSPACE_PROVIDER_ID = clamp(Integer.MIN_VALUE, Integer.MAX_VALUE,
|
||||
config.get("general", "hyperspace_provider_id", G_HYPERSPACE_PROVIDER_ID, "Hyperspace dimension provider ID").getInt());
|
||||
G_HYPERSPACE_DIMENSION_ID = clamp(Integer.MIN_VALUE, Integer.MAX_VALUE,
|
||||
config.get("general", "hyperspace_dimension_id", G_HYPERSPACE_DIMENSION_ID, "Hyperspace dimension world ID").getInt());
|
||||
G_SPACE_WORLDBORDER_BLOCKS = clamp(0, 3000000,
|
||||
config.get("general", "space_worldborder_blocks", G_SPACE_WORLDBORDER_BLOCKS,
|
||||
"World border applied to hyperspace & space, set to 0 to disable it").getInt());
|
||||
|
||||
G_ENTITY_JUMP_ID = clamp(Integer.MIN_VALUE, Integer.MAX_VALUE,
|
||||
config.get("general", "entity_jump_id", G_ENTITY_JUMP_ID, "Entity jump ID").getInt());
|
||||
G_ENTITY_SPHERE_GENERATOR_ID = clamp(Integer.MIN_VALUE, Integer.MAX_VALUE,
|
||||
config.get("general", "entity_sphere_generator_id", G_ENTITY_SPHERE_GENERATOR_ID, "Entity sphere generator ID").getInt());
|
||||
G_ENTITY_STAR_CORE_ID = clamp(Integer.MIN_VALUE, Integer.MAX_VALUE,
|
||||
config.get("general", "entity_star_core_id", G_ENTITY_STAR_CORE_ID, "Entity star core ID").getInt());
|
||||
G_ENTITY_CAMERA_ID = clamp(Integer.MIN_VALUE, Integer.MAX_VALUE,
|
||||
config.get("general", "entity_camera_id", G_ENTITY_CAMERA_ID, "Entity camera ID").getInt());
|
||||
|
||||
G_LUA_SCRIPTS = clamp(0, 2,
|
||||
config.get("general", "lua_scripts", G_LUA_SCRIPTS,
|
||||
"LUA scripts to load when connecting machines: 0 = none, 1 = templates in a subfolder, 2 = ready to roll (templates are still provided)").getInt());
|
||||
G_SCHEMALOCATION = config.get("general", "schematic_location", G_SCHEMALOCATION, "Folder where to save ship schematics").getString();
|
||||
G_BLOCKS_PER_TICK = clamp(100, 100000,
|
||||
config.get("general", "blocks_per_tick", G_BLOCKS_PER_TICK,
|
||||
"Number of blocks to move per ticks, too high will cause lag spikes on ship jumping or deployment, too low may break the ship wirings").getInt());
|
||||
|
||||
// Recipes
|
||||
RECIPES_ENABLE_VANILLA = config.get("recipes", "enable_vanilla", RECIPES_ENABLE_VANILLA, "Vanilla recipes by DarkholmeTenk").getBoolean(false);
|
||||
RECIPES_ENABLE_IC2 = config.get("recipes", "enable_ic2", RECIPES_ENABLE_IC2, "Original recipes based on IndustrialCrat2 by Cr0s").getBoolean(true);
|
||||
RECIPES_ENABLE_HARD_IC2 = config.get("recipes", "enable_hard_ic2", RECIPES_ENABLE_HARD_IC2, "Harder recipes based on IC2 by YuRaNnNzZZ").getBoolean(false);
|
||||
RECIPES_ENABLE_MIXED = config.get("recipes", "enable_mixed", RECIPES_ENABLE_MIXED,
|
||||
"Mixed recipes for Lem'ADEC's packs (currently requires at least AppliedEnergistics, Extracells, AtomicScience, IndustrialCraft2, GraviSuite and ThermalExpansion").getBoolean(false);
|
||||
|
||||
G_LUA_SCRIPTS = config.get("General", "lua_scripts", G_LUA_SCRIPTS,
|
||||
"LUA scripts to load when connecting machines: 0 = none, 1 = templates in a subfolder, 2 = ready to roll (templates are still provided)").getInt();
|
||||
G_SCHEMALOCATION = config.get("General", "schematic_location", G_SCHEMALOCATION, "Folder where to save ship schematics").getString();
|
||||
G_BLOCKS_PER_TICK = config.get("General", "blocks_per_tick", G_BLOCKS_PER_TICK,
|
||||
"Number of blocks to move per ticks, too high will cause lag spikes on ship jumping or deployment, too low may break the ship wirings").getInt();
|
||||
|
||||
G_ENABLE_IC2_RECIPES = config.get("General", "enable_ic2_recipes", G_ENABLE_IC2_RECIPES, "Original recipes based on IndustrialCrat2 by Cr0s").getBoolean(true);
|
||||
G_ENABLE_HARD_IC2_RECIPES = config.get("General", "enable_hard_ic2_recipes", G_ENABLE_HARD_IC2_RECIPES, "Harder recipes based on IC2 by YuRaNnNzZZ").getBoolean(false);
|
||||
G_ENABLE_VANILLA_RECIPES = config.get("General", "enable_vanilla_recipes", G_ENABLE_VANILLA_RECIPES, "Vanilla recipes by DarkholmeTenk").getBoolean(false);
|
||||
G_ENABLE_TDK_RECIPES = config
|
||||
.get("General",
|
||||
"enable_TDK_recipes",
|
||||
G_ENABLE_TDK_RECIPES,
|
||||
"Mixed recipes for TDK packs by Lem'ADEC (currently requires at least AppliedEnergistics, Extracells, AtomicScience, IndustrialCraft2, GraviSuite and ThermalExpansion")
|
||||
.getBoolean(false);
|
||||
|
||||
// Logging
|
||||
LOGGING_JUMP = config.get("Logging", "enable_jump_debugLogs", LOGGING_JUMP, "Detailled jump logs to help debug the mod, enable it before reporting a bug").getBoolean(false);
|
||||
LOGGING_ENERGY = config.get("Logging", "enable_energy_debugLogs", LOGGING_ENERGY, "Detailled energy logs to help debug the mod, enable it before reporting a bug").getBoolean(false);
|
||||
LOGGING_JUMP = config.get("logging", "enable_jump_debugLogs", LOGGING_JUMP, "Detailled jump logs to help debug the mod, enable it before reporting a bug").getBoolean(false);
|
||||
LOGGING_ENERGY = config.get("logging", "enable_energy_debugLogs", LOGGING_ENERGY, "Detailled energy logs to help debug the mod, enable it before reporting a bug").getBoolean(false);
|
||||
if (WarpDrive.VERSION.contains("-dev")) {// disabled in production, for obvious reasons :)
|
||||
LOGGING_EFFECTS = config.get("Logging", "enable_effects_logs", LOGGING_EFFECTS, "Detailled effects logs to help debug the mod, will spam your console!").getBoolean(false);
|
||||
LOGGING_CLOAKING = config.get("Logging", "enable_cloaking_logs", LOGGING_CLOAKING, "Detailled cloaking logs to help debug the mod, will spam your console!").getBoolean(false);
|
||||
LOGGING_FREQUENCY = config.get("Logging", "enable_frequency_logs", LOGGING_FREQUENCY, "Detailled frequency logs to help debug the mod, will spam your console!").getBoolean(false);
|
||||
LOGGING_TARGETTING = config.get("Logging", "enable_targetting_logs", LOGGING_TARGETTING, "Detailled targetting logs to help debug the mod, will spam your console!").getBoolean(false);
|
||||
LOGGING_EFFECTS = config.get("logging", "enable_effects_logs", LOGGING_EFFECTS, "Detailled effects logs to help debug the mod, will spam your console!").getBoolean(false);
|
||||
LOGGING_CLOAKING = config.get("logging", "enable_cloaking_logs", LOGGING_CLOAKING, "Detailled cloaking logs to help debug the mod, will spam your console!").getBoolean(false);
|
||||
LOGGING_FREQUENCY = config.get("logging", "enable_frequency_logs", LOGGING_FREQUENCY, "Detailled frequency logs to help debug the mod, will spam your console!").getBoolean(false);
|
||||
LOGGING_TARGETTING = config.get("logging", "enable_targetting_logs", LOGGING_TARGETTING, "Detailled targetting logs to help debug the mod, will spam your console!").getBoolean(false);
|
||||
} else {
|
||||
LOGGING_EFFECTS = false;
|
||||
LOGGING_CLOAKING = false;
|
||||
LOGGING_FREQUENCY = false;
|
||||
LOGGING_TARGETTING = false;
|
||||
}
|
||||
LOGGING_WEAPON = config.get("Logging", "enable_weapon_logs", LOGGING_WEAPON, "Detailled weapon logs to help debug the mod, enable it before reporting a bug").getBoolean(false);
|
||||
LOGGING_CAMERA = config.get("Logging", "enable_camera_logs", LOGGING_CAMERA, "Detailled camera logs to help debug the mod, enable it before reporting a bug").getBoolean(false);
|
||||
LOGGING_BUILDING = config.get("Logging", "enable_building_logs", LOGGING_BUILDING, "Detailled building logs to help debug the mod, enable it before reporting a bug").getBoolean(false);
|
||||
LOGGING_COLLECTION = config.get("Logging", "enable_collection_logs", LOGGING_COLLECTION, "Detailled collection logs to help debug the mod, enable it before reporting a bug").getBoolean(false);
|
||||
LOGGING_TRANSPORTER = config.get("Logging", "enable_transporter_logs", LOGGING_TRANSPORTER, "Detailled transporter logs to help debug the mod, enable it before reporting a bug").getBoolean(false);
|
||||
LOGGING_LUA = config.get("Logging", "enable_LUA_logs", LOGGING_LUA, "Detailled LUA logs to help debug the mod, enable it before reporting a bug").getBoolean(false);
|
||||
LOGGING_RADAR = config.get("Logging", "enable_radar_logs", LOGGING_RADAR, "Detailled radar logs to help debug the mod, enable it before reporting a bug").getBoolean(false);
|
||||
LOGGING_BREATHING = config.get("Logging", "enable_breathing_logs", LOGGING_BREATHING, "Detailled breathing logs to help debug the mod, enable it before reporting a bug").getBoolean(false);
|
||||
LOGGING_WORLDGEN = config.get("Logging", "enable_worldgen_logs", LOGGING_WORLDGEN, "Detailled world generation logs to help debug the mod, enable it before reporting a bug").getBoolean(false);
|
||||
LOGGING_WEAPON = config.get("logging", "enable_weapon_logs", LOGGING_WEAPON, "Detailled weapon logs to help debug the mod, enable it before reporting a bug").getBoolean(false);
|
||||
LOGGING_CAMERA = config.get("logging", "enable_camera_logs", LOGGING_CAMERA, "Detailled camera logs to help debug the mod, enable it before reporting a bug").getBoolean(false);
|
||||
LOGGING_BUILDING = config.get("logging", "enable_building_logs", LOGGING_BUILDING, "Detailled building logs to help debug the mod, enable it before reporting a bug").getBoolean(false);
|
||||
LOGGING_COLLECTION = config.get("logging", "enable_collection_logs", LOGGING_COLLECTION, "Detailled collection logs to help debug the mod, enable it before reporting a bug").getBoolean(false);
|
||||
LOGGING_TRANSPORTER = config.get("logging", "enable_transporter_logs", LOGGING_TRANSPORTER, "Detailled transporter logs to help debug the mod, enable it before reporting a bug").getBoolean(false);
|
||||
LOGGING_LUA = config.get("logging", "enable_LUA_logs", LOGGING_LUA, "Detailled LUA logs to help debug the mod, enable it before reporting a bug").getBoolean(false);
|
||||
LOGGING_RADAR = config.get("logging", "enable_radar_logs", LOGGING_RADAR, "Detailled radar logs to help debug the mod, enable it before reporting a bug").getBoolean(false);
|
||||
LOGGING_BREATHING = config.get("logging", "enable_breathing_logs", LOGGING_BREATHING, "Detailled breathing logs to help debug the mod, enable it before reporting a bug").getBoolean(false);
|
||||
LOGGING_WORLDGEN = config.get("logging", "enable_worldgen_logs", LOGGING_WORLDGEN, "Detailled world generation logs to help debug the mod, enable it before reporting a bug").getBoolean(false);
|
||||
|
||||
// TransitionPlane
|
||||
config.addCustomCategoryComment("TransitionPlane",
|
||||
"Transition planes defines which region in space allows to go to other dimensions, default is overworld with 100k radius.\n"
|
||||
+ "Each plane is square shaped and defined as a list of 7 integers (all measured in blocks, border is the radius from center)");
|
||||
String[] transitionNames = { "overworld" };
|
||||
transitionNames = config.get("TransitionPlane", "names", transitionNames, "this is the list of transition planes defined hereafter").getStringList();
|
||||
int[] defaultPlane = { 0, 0, 0, 30000000, 30000000, 0, 0 }; // 30000000 is Minecraft limit for SetBlock
|
||||
G_TRANSITIONPLANES = new TransitionPlane[transitionNames.length];
|
||||
int index = 0;
|
||||
for (String name : transitionNames) {
|
||||
int[] plane = config.get("TransitionPlane", name, defaultPlane,
|
||||
"dimensionId, dimensionCenterX, dimensionCenterZ, borderSizeX, borderSizeZ, SpaceCenterX, SpaceCenterZ").getIntList();
|
||||
if (plane.length != 7) {
|
||||
WarpDrive.logger.warn("Invalid transition plane definition '" + name + "' (exactly 7 integers are expected), using default instead");
|
||||
plane = defaultPlane.clone();
|
||||
}
|
||||
TransitionPlane newPlane = new TransitionPlane(plane[0], plane[1], plane[2], plane[3], plane[4], plane[5], plane[6]);
|
||||
WarpDrive.logger.info("Adding '" + name + "' as " + newPlane.toString());
|
||||
G_TRANSITIONPLANES[index] = newPlane;
|
||||
// Planets
|
||||
config.addCustomCategoryComment("planets",
|
||||
"Planets are other dimensions connected through the Space dimension. Default is overworld with 100k radius.\n"
|
||||
+ "Each planet orbit is square shaped and defined as a list of 7 integers (all measured in blocks).");
|
||||
|
||||
ConfigCategory cat = config.getCategory("planets");
|
||||
String[] planetsName = cat.getValues().keySet().toArray(new String[0]);
|
||||
if (planetsName.length == 0) {
|
||||
planetsName = new String[] { "overworld" };
|
||||
}
|
||||
// FIXME: check transition planes aren't overlapping
|
||||
// FIXME: check transition planes have valid dimension id, and ignore them
|
||||
|
||||
// Warp Core
|
||||
WC_MAX_ENERGY_VALUE = config.get("WarpCore", "max_energy_value", WC_MAX_ENERGY_VALUE, "Maximum energy storage").getInt();
|
||||
WC_ENERGY_PER_BLOCK_MODE1 = config.get("WarpCore", "energy_per_block_mode1", WC_ENERGY_PER_BLOCK_MODE1).getInt();
|
||||
WC_ENERGY_PER_DISTANCE_MODE1 = config.get("WarpCore", "energy_per_distance_mode1", WC_ENERGY_PER_DISTANCE_MODE1).getInt();
|
||||
WC_ENERGY_PER_DISTANCE_MODE2 = config.get("WarpCore", "energy_per_distance_mode2", WC_ENERGY_PER_DISTANCE_MODE2).getInt();
|
||||
WC_ENERGY_PER_BLOCK_MODE2 = config.get("WarpCore", "energy_per_block_mode2", WC_ENERGY_PER_BLOCK_MODE2).getInt();
|
||||
WC_ENERGY_PER_ENTITY_TO_SPACE = config.get("WarpCore", "energy_per_entity_to_space", WC_ENERGY_PER_ENTITY_TO_SPACE).getInt();
|
||||
WC_MAX_JUMP_DISTANCE = config.get("WarpCore", "max_jump_distance", WC_MAX_JUMP_DISTANCE, "Maximum jump lenght value in blocks").getInt();
|
||||
WC_MAX_SHIP_VOLUME_ON_SURFACE = config.get("WarpCore", "max_ship_volume_on_surface", WC_MAX_SHIP_VOLUME_ON_SURFACE,
|
||||
"Maximum ship mass (in blocks) to jump on earth").getInt();
|
||||
WC_MIN_SHIP_VOLUME_FOR_HYPERSPACE = config.get("WarpCore", "min_ship_volume_for_hyperspace", WC_MIN_SHIP_VOLUME_FOR_HYPERSPACE,
|
||||
"Minimum ship mass (in blocks) to enter or exit hyperspace without a jumpgate").getInt();
|
||||
WC_MAX_SHIP_SIDE = config.get("WarpCore", "max_ship_side", WC_MAX_SHIP_SIDE, "Maximum ship size on each axis in blocks").getInt();
|
||||
WC_COLLISION_TOLERANCE_BLOCKS = config.get("WarpCore", "collision_tolerance_blocks", WC_COLLISION_TOLERANCE_BLOCKS,
|
||||
"Tolerance in block in case of collision before causing damages...").getInt();
|
||||
WC_COOLDOWN_INTERVAL_SECONDS = config.get("WarpCore", "cooldown_interval_seconds", WC_COOLDOWN_INTERVAL_SECONDS,
|
||||
"Cooldown seconds to wait after jumping").getInt();
|
||||
WC_WARMUP_SHORTJUMP_SECONDS = config.get("WarpCore", "warmup_shortjump_seconds", WC_WARMUP_SHORTJUMP_SECONDS, "Short jump means less than 50 blocks")
|
||||
.getInt();
|
||||
WC_WARMUP_LONGJUMP_SECONDS = config.get("WarpCore", "warmup_longjump_seconds", WC_WARMUP_LONGJUMP_SECONDS, "Long jump means more than 50 blocks")
|
||||
.getInt();
|
||||
WC_WARMUP_SICKNESS = config.get("WarpCore", "warmup_sickness", true, "Enable warp sickness during warmup").getBoolean(true);
|
||||
|
||||
WC_CORES_REGISTRY_UPDATE_INTERVAL_SECONDS = config.get("WarpCore", "cores_registry_update_interval", WC_CORES_REGISTRY_UPDATE_INTERVAL_SECONDS,
|
||||
"(measured in seconds)").getInt();
|
||||
WC_CONTROLLER_UPDATE_INTERVAL_SECONDS = config.get("WarpCore", "controller_update_interval", WC_CONTROLLER_UPDATE_INTERVAL_SECONDS,
|
||||
"(measured in seconds)").getInt();
|
||||
WC_ISOLATION_UPDATE_INTERVAL_SECONDS = config.get("WarpCore", "isolation_update_interval", WC_ISOLATION_UPDATE_INTERVAL_SECONDS,
|
||||
"(measured in seconds)").getInt();
|
||||
WC_UNLIMITED_PLAYERNAMES = config.get("WarpCore", "unlimited_playernames", WC_UNLIMITED_PLAYERNAMES,
|
||||
"List of player names which gives unlimited block counts to their ship").getStringList();
|
||||
|
||||
// Warp Radar
|
||||
WR_MAX_ENERGY_VALUE = config.get("WarpRadar", "max_energy_value", WR_MAX_ENERGY_VALUE).getInt();
|
||||
WR_MAX_ISOLATION_RANGE = config.get("WarpRadar", "max_isolation_range", WR_MAX_ISOLATION_RANGE,
|
||||
"radius around core where isolation blocks count (2 to 8), higher is lagger").getInt();
|
||||
WR_MAX_ISOLATION_RANGE = Math.min(8, Math.max(WR_MAX_ISOLATION_RANGE, 2));
|
||||
WR_MIN_ISOLATION_BLOCKS = config.get("WarpRadar", "min_isolation_blocks", WR_MIN_ISOLATION_BLOCKS,
|
||||
"number of isolation blocks required to get some isolation (0 to 20)").getInt();
|
||||
WR_MIN_ISOLATION_BLOCKS = Math.min(20, Math.max(WR_MIN_ISOLATION_BLOCKS, 0));
|
||||
WR_MAX_ISOLATION_BLOCKS = config.get("WarpRadar", "max_isolation_blocks", WR_MAX_ISOLATION_BLOCKS,
|
||||
"number of isolation blocks required to reach maximum effect (5 to 100)").getInt();
|
||||
WR_MAX_ISOLATION_BLOCKS = Math.min(100, Math.max(WR_MAX_ISOLATION_BLOCKS, 5));
|
||||
WR_MIN_ISOLATION_EFFECT = config.get("WarpRadar", "min_isolation_effect", WR_MIN_ISOLATION_EFFECT,
|
||||
"isolation effect achieved with min number of isolation blocks (0.01 to 0.95)").getDouble(0.12D);
|
||||
WR_MIN_ISOLATION_EFFECT = Math.min(0.95D, Math.max(WR_MIN_ISOLATION_EFFECT, 0.01D));
|
||||
WR_MAX_ISOLATION_EFFECT = config.get("WarpRadar", "max_isolation_effect", WR_MAX_ISOLATION_EFFECT,
|
||||
"isolation effect achieved with max number of isolation blocks (0.01 to 1.00)").getDouble(1.00D);
|
||||
WR_MAX_ISOLATION_EFFECT = Math.min(1.0D, Math.max(WR_MAX_ISOLATION_EFFECT, 0.01D));
|
||||
|
||||
|
||||
int[] defaultPlanet = { 0, 0, 0, 100000, 100000, 0, 0 }; // 30000000 is Minecraft limit for SetBlock
|
||||
PLANETS = new Planet[planetsName.length];
|
||||
int index = 0;
|
||||
for (String name : planetsName) {
|
||||
int[] planetInts = config.get("planets", name, defaultPlanet,
|
||||
"dimensionId, dimensionCenterX, dimensionCenterZ, radiusX, radiusZ, spaceCenterX, spaceCenterZ").getIntList();
|
||||
if (planetInts.length != 7) {
|
||||
WarpDrive.logger.warn("Invalid planet definition '" + name + "' (exactly 7 integers are expected), using default instead");
|
||||
planetInts = defaultPlanet.clone();
|
||||
}
|
||||
Planet planet = new Planet(planetInts[0], planetInts[1], planetInts[2], planetInts[3], planetInts[4], planetInts[5], planetInts[6]);
|
||||
WarpDrive.logger.info("Adding '" + name + "' as " + planet.toString());
|
||||
PLANETS[index] = planet;
|
||||
}
|
||||
// FIXME: check planets aren't overlapping
|
||||
// We're not checking invalid dimension id, so they can be pre-allocated (see MystCraft)
|
||||
|
||||
// Ship
|
||||
SHIP_MAX_ENERGY_STORED = clamp(0, Integer.MAX_VALUE,
|
||||
config.get("ship", "max_energy_stored", SHIP_MAX_ENERGY_STORED, "Maximum energy storage").getInt());
|
||||
SHIP_NORMALJUMP_ENERGY_PER_BLOCK = clamp(0, Integer.MAX_VALUE,
|
||||
config.get("ship", "normaljump_energy_per_block", SHIP_NORMALJUMP_ENERGY_PER_BLOCK).getInt());
|
||||
SHIP_NORMALJUMP_ENERGY_PER_DISTANCE = clamp(0, Integer.MAX_VALUE,
|
||||
config.get("ship", "normaljump_energy_per_distance", SHIP_NORMALJUMP_ENERGY_PER_DISTANCE).getInt());
|
||||
SHIP_HYPERJUMP_ENERGY_PER_DISTANCE = clamp(0, Integer.MAX_VALUE,
|
||||
config.get("ship", "hyperjump_energy_per_distance", SHIP_HYPERJUMP_ENERGY_PER_DISTANCE).getInt());
|
||||
SHIP_HYPERJUMP_ENERGY_PER_BLOCK = clamp(0, Integer.MAX_VALUE,
|
||||
config.get("ship", "hyperjump_energy_per_block", SHIP_HYPERJUMP_ENERGY_PER_BLOCK).getInt());
|
||||
SHIP_TELEPORT_ENERGY_PER_ENTITY = clamp(0, Integer.MAX_VALUE,
|
||||
config.get("ship", "teleport_energy_per_entity", SHIP_TELEPORT_ENERGY_PER_ENTITY).getInt());
|
||||
|
||||
SHIP_MAX_JUMP_DISTANCE = clamp(0, 30000000,
|
||||
config.get("ship", "max_jump_distance", SHIP_MAX_JUMP_DISTANCE, "Maximum jump lenght value in blocks").getInt());
|
||||
|
||||
SHIP_VOLUME_MAX_ON_PLANET_SURFACE = clamp(0, 10000000,
|
||||
config.get("ship", "volume_max_on_planet_surface", SHIP_VOLUME_MAX_ON_PLANET_SURFACE,
|
||||
"Maximum ship mass (in blocks) to jump on earth").getInt());
|
||||
SHIP_VOLUME_MIN_FOR_HYPERSPACE = clamp(0, 10000000,
|
||||
config.get("ship", "volume_min_for_hyperspace", SHIP_VOLUME_MIN_FOR_HYPERSPACE,
|
||||
"Minimum ship mass (in blocks) to enter or exit hyperspace without a jumpgate").getInt());
|
||||
SHIP_VOLUME_UNLIMITED_PLAYERNAMES = config.get("ship", "volume_unlimited_playernames", SHIP_VOLUME_UNLIMITED_PLAYERNAMES,
|
||||
"List of player names which have unlimited block counts to their ship").getStringList();
|
||||
|
||||
SHIP_MAX_SIDE_SIZE = clamp(0, 30000000,
|
||||
config.get("ship", "max_side_size", SHIP_MAX_SIDE_SIZE, "Maximum ship size on each axis in blocks").getInt());
|
||||
SHIP_COLLISION_TOLERANCE_BLOCKS = clamp(0, 30000000,
|
||||
config.get("ship", "collision_tolerance_blocks", SHIP_COLLISION_TOLERANCE_BLOCKS, "Tolerance in block in case of collision before causing damages...").getInt());
|
||||
SHIP_COOLDOWN_INTERVAL_SECONDS = clamp(0, 3600,
|
||||
config.get("ship", "cooldown_interval_seconds", SHIP_COOLDOWN_INTERVAL_SECONDS, "Cooldown seconds to wait after jumping").getInt());
|
||||
|
||||
SHIP_SHORTJUMP_THRESHOLD_BLOCKS = clamp(0, 30000000,
|
||||
config.get("ship", "shortjump_threhold_blocs", SHIP_SHORTJUMP_THRESHOLD_BLOCKS, "Short jump definition").getInt());
|
||||
SHIP_SHORTJUMP_WARMUP_SECONDS = clamp(0, 3600,
|
||||
config.get("ship", "shortjump_warmup_seconds", SHIP_SHORTJUMP_WARMUP_SECONDS, "(measured in seconds)").getInt());
|
||||
SHIP_LONGJUMP_WARMUP_SECONDS = clamp(0, 3600,
|
||||
config.get("ship", "longjump_warmup_seconds", SHIP_LONGJUMP_WARMUP_SECONDS, "(measured in seconds)").getInt());
|
||||
SHIP_WARMUP_RANDOM_TICKS = clamp(10, 200,
|
||||
config.get("ship", "warmp_random_ticks", SHIP_WARMUP_RANDOM_TICKS).getInt());
|
||||
SHIP_WARMUP_SICKNESS = config.get("ship", "warmup_sickness", true, "Enable warp sickness during warmup").getBoolean(true);
|
||||
|
||||
SHIP_CORE_REGISTRY_UPDATE_INTERVAL_SECONDS = clamp(0, 300,
|
||||
config.get("ship", "core_registry_update_interval", SHIP_CORE_REGISTRY_UPDATE_INTERVAL_SECONDS, "(measured in seconds)").getInt());
|
||||
SHIP_CORE_ISOLATION_UPDATE_INTERVAL_SECONDS = clamp(0, 300,
|
||||
config.get("ship", "core_isolation_update_interval", SHIP_CORE_ISOLATION_UPDATE_INTERVAL_SECONDS, "(measured in seconds)").getInt());
|
||||
SHIP_CONTROLLER_UPDATE_INTERVAL_SECONDS = clamp(0, 300,
|
||||
config.get("ship", "controller_update_interval", SHIP_CONTROLLER_UPDATE_INTERVAL_SECONDS, "(measured in seconds)").getInt());
|
||||
|
||||
// Radar
|
||||
RADAR_MAX_ENERGY_STORED = clamp(0, Integer.MAX_VALUE,
|
||||
config.get("radar", "max_energy_stored", RADAR_MAX_ENERGY_STORED).getInt());
|
||||
RADAR_MAX_ISOLATION_RANGE = clamp(2, 8,
|
||||
config.get("radar", "max_isolation_range", RADAR_MAX_ISOLATION_RANGE, "radius around core where isolation blocks count (2 to 8), higher is lagger").getInt());
|
||||
|
||||
RADAR_MIN_ISOLATION_BLOCKS = clamp(0, 20,
|
||||
config.get("radar", "min_isolation_blocks", RADAR_MIN_ISOLATION_BLOCKS, "number of isolation blocks required to get some isolation (0 to 20)").getInt());
|
||||
RADAR_MAX_ISOLATION_BLOCKS = clamp(5, 100,
|
||||
config.get("radar", "max_isolation_blocks", RADAR_MAX_ISOLATION_BLOCKS, "number of isolation blocks required to reach maximum effect (5 to 100)").getInt());
|
||||
|
||||
RADAR_MIN_ISOLATION_EFFECT = clamp(0.01D, 0.95D,
|
||||
config.get("radar", "min_isolation_effect", RADAR_MIN_ISOLATION_EFFECT, "isolation effect achieved with min number of isolation blocks (0.01 to 0.95)").getDouble(0.12D));
|
||||
RADAR_MAX_ISOLATION_EFFECT = clamp(0.01D, 1.0D,
|
||||
config.get("radar", "max_isolation_effect", RADAR_MAX_ISOLATION_EFFECT, "isolation effect achieved with max number of isolation blocks (0.01 to 1.00)").getDouble(1.00D));
|
||||
|
||||
// Ship Scanner
|
||||
SS_MAX_ENERGY_VALUE = config.get("WarpCore", "max_energy_value", SS_MAX_ENERGY_VALUE, "Maximum energy storage").getInt();
|
||||
SS_EU_PER_BLOCK_SCAN = config.get("ShipScanner", "energy_per_block_when_scanning", SS_EU_PER_BLOCK_SCAN,
|
||||
SS_MAX_ENERGY_STORED = clamp(1, Integer.MAX_VALUE,
|
||||
config.get("ship_scanner", "max_energy_stored", SS_MAX_ENERGY_STORED, "Maximum energy storage").getInt());
|
||||
|
||||
SS_EU_PER_BLOCK_SCAN = config.get("ship_scanner", "energy_per_block_when_scanning", SS_EU_PER_BLOCK_SCAN,
|
||||
"Energy consummed per block when scanning a ship (use -1 to consume everything)").getInt();
|
||||
if (SS_EU_PER_BLOCK_SCAN != -1) {
|
||||
SS_EU_PER_BLOCK_SCAN = Math.min(SS_MAX_ENERGY_VALUE, Math.max(SS_EU_PER_BLOCK_SCAN, 1));
|
||||
SS_EU_PER_BLOCK_SCAN = clamp(1, SS_MAX_ENERGY_STORED, SS_EU_PER_BLOCK_SCAN);
|
||||
}
|
||||
SS_EU_PER_BLOCK_DEPLOY = config.get("ShipScanner", "energy_per_block_when_deploying", SS_EU_PER_BLOCK_DEPLOY,
|
||||
|
||||
SS_EU_PER_BLOCK_DEPLOY = config.get("ship_scanner", "energy_per_block_when_deploying", SS_EU_PER_BLOCK_DEPLOY,
|
||||
"Energy consummed per block when deploying a ship (use -1 to consume everything)").getInt();
|
||||
if (SS_EU_PER_BLOCK_DEPLOY != -1) {
|
||||
SS_EU_PER_BLOCK_DEPLOY = Math.min(SS_MAX_ENERGY_VALUE, Math.max(SS_EU_PER_BLOCK_DEPLOY, 1));
|
||||
SS_EU_PER_BLOCK_DEPLOY = clamp(1, SS_MAX_ENERGY_STORED, SS_EU_PER_BLOCK_DEPLOY);
|
||||
}
|
||||
SS_MAX_DEPLOY_RADIUS_BLOCKS = config.get("ShipScanner", "max_deploy_radius_blocks", SS_MAX_DEPLOY_RADIUS_BLOCKS,
|
||||
"Max distance from ship scanner to ship core, measured in blocks").getInt();
|
||||
|
||||
// Particle Booster
|
||||
PB_MAX_ENERGY_VALUE = config.get("ParticleBooster", "max_energy_value", PB_MAX_ENERGY_VALUE).getInt();
|
||||
|
||||
// Laser Emitter
|
||||
LE_MAX_BOOSTERS_NUMBER = config.get("LaserEmitter", "max_boosters_number", LE_MAX_BOOSTERS_NUMBER).getInt();
|
||||
LE_MAX_LASER_ENERGY = config.get("LaserEmitter", "max_laser_energy", LE_MAX_LASER_ENERGY).getInt();
|
||||
LE_EMIT_DELAY_TICKS = config.get("LaserEmitter", "emit_delay_ticks", LE_EMIT_DELAY_TICKS).getInt();
|
||||
LE_EMIT_SCAN_DELAY_TICKS = config.get("LaserEmitter", "emit_scan_delay_ticks", LE_EMIT_SCAN_DELAY_TICKS).getInt();
|
||||
|
||||
// Laser Emitter tweaks
|
||||
LE_COLLECT_ENERGY_MULTIPLIER = config.get("LaserEmitterTweaks", "collect_energy_multiplier", LE_COLLECT_ENERGY_MULTIPLIER).getDouble(0.6D);
|
||||
LE_BEAM_LENGTH_PER_ENERGY_DIVIDER = config.get("LaserEmitterTweaks", "beam_length_per_energy_divider", LE_BEAM_LENGTH_PER_ENERGY_DIVIDER).getInt();
|
||||
LE_ENTITY_HIT_SET_ON_FIRE_TIME = config.get("LaserEmitterTweaks", "entity_hit_set_on_fire_time", LE_ENTITY_HIT_SET_ON_FIRE_TIME).getInt();
|
||||
LE_ENTITY_HIT_DAMAGE_PER_ENERGY_DIVIDER = config.get("LaserEmitterTweaks", "entity_hit_damage_per_energy_divider",
|
||||
LE_ENTITY_HIT_DAMAGE_PER_ENERGY_DIVIDER).getInt();
|
||||
LE_ENTITY_HIT_EXPLOSION_LASER_ENERGY = config.get("LaserEmitterTweaks", "entity_hit_explosion_laser_energy", LE_ENTITY_HIT_EXPLOSION_LASER_ENERGY)
|
||||
.getInt();
|
||||
LE_BLOCK_HIT_CONSUME_ENERGY = config.get("LaserEmitterTweaks", "block_hit_consume_energy", LE_BLOCK_HIT_CONSUME_ENERGY).getInt();
|
||||
LE_BLOCK_HIT_CONSUME_ENERGY_PER_BLOCK_RESISTANCE = config.get("LaserEmitterTweaks", "block_hit_consume_energy_per_block_resistance",
|
||||
LE_BLOCK_HIT_CONSUME_ENERGY_PER_BLOCK_RESISTANCE).getInt();
|
||||
LE_BLOCK_HIT_CONSUME_ENERGY_PER_DISTANCE = config.get("LaserEmitterTweaks", "block_hit_consume_energy_per_distance",
|
||||
LE_BLOCK_HIT_CONSUME_ENERGY_PER_DISTANCE).getInt();
|
||||
|
||||
|
||||
SS_MAX_DEPLOY_RADIUS_BLOCKS = clamp(5, 150,
|
||||
config.get("ship_scanner", "max_deploy_radius_blocks", SS_MAX_DEPLOY_RADIUS_BLOCKS, "Max distance from ship scanner to ship core, measured in blocks (5-150)").getInt());
|
||||
|
||||
// Laser medium
|
||||
LASER_MEDIUM_MAX_ENERGY_STORED = clamp(1, Integer.MAX_VALUE,
|
||||
config.get("laser_medium", "max_energy_stored", LASER_MEDIUM_MAX_ENERGY_STORED).getInt());
|
||||
|
||||
// Laser cannon
|
||||
LASER_CANNON_MAX_MEDIUMS_COUNT = clamp(1, 64,
|
||||
config.get("laser_cannon", "max_mediums_count", LASER_CANNON_MAX_MEDIUMS_COUNT).getInt());
|
||||
LASER_CANNON_MAX_LASER_ENERGY = clamp(1, Integer.MAX_VALUE,
|
||||
config.get("laser_cannon", "max_laser_energy", LASER_CANNON_MAX_LASER_ENERGY, "Maximum energy in beam after accounting for boosters beams").getInt());
|
||||
LASER_CANNON_EMIT_FIRE_DELAY_TICKS = clamp(1, 100,
|
||||
config.get("laser_cannon", "emit_fire_delay_ticks", LASER_CANNON_EMIT_FIRE_DELAY_TICKS, "Delay while booster beams are accepted, before actually shooting").getInt());
|
||||
LASER_CANNON_EMIT_SCAN_DELAY_TICKS = clamp(1, 100,
|
||||
config.get("laser_cannon", "emit_scan_delay_ticks", LASER_CANNON_EMIT_SCAN_DELAY_TICKS, "Delay while booster beams are accepted, before actually scanning").getInt());
|
||||
|
||||
LASER_CANNON_BOOSTER_BEAM_ENERGY_EFFICIENCY = clamp(0.01D, 10.0D,
|
||||
config.get("laser_cannon", "booster_beam_energy_efficiency", LASER_CANNON_BOOSTER_BEAM_ENERGY_EFFICIENCY).getDouble(0.6D));
|
||||
LASER_CANNON_ENERGY_LOSS_PER_BLOCK = clamp(1, LASER_CANNON_MAX_LASER_ENERGY / 10,
|
||||
config.get("laser_cannon", "energy_loss_per_block", LASER_CANNON_ENERGY_LOSS_PER_BLOCK).getInt());
|
||||
|
||||
LASER_CANNON_ENTITY_HIT_SET_ON_FIRE_SECONDS = clamp(0, 300,
|
||||
config.get("laser_cannon", "entity_hit_set_on_fire_seconds", LASER_CANNON_ENTITY_HIT_SET_ON_FIRE_SECONDS).getInt());
|
||||
LASER_CANNON_ENTITY_HIT_ENERGY_PER_DAMAGE = clamp(0, LASER_CANNON_MAX_LASER_ENERGY,
|
||||
config.get("laser_cannon", "entity_hit_energy_per_damage", LASER_CANNON_ENTITY_HIT_ENERGY_PER_DAMAGE).getInt());
|
||||
LASER_CANNON_ENTITY_HIT_MAX_DAMAGE = clamp(0, Integer.MAX_VALUE,
|
||||
config.get("laser_cannon", "entity_hit_max_damage", LASER_CANNON_ENTITY_HIT_MAX_DAMAGE).getInt());
|
||||
|
||||
LASER_CANNON_ENTITY_HIT_ENERGY_THRESHOLD_FOR_EXPLOSION = clamp(0, Integer.MAX_VALUE,
|
||||
config.get("laser_cannon", "entity_hit_energy_threshold_for_explosion", LASER_CANNON_ENTITY_HIT_ENERGY_THRESHOLD_FOR_EXPLOSION, "Minimum energy to cause explosion effect").getInt());
|
||||
LASER_CANNON_ENTITY_HIT_EXPLOSION_BASE_STRENGTH = (float) clamp(0.0D, 100.0D,
|
||||
config.get("laser_cannon", "entity_hit_explosion_base_strength", LASER_CANNON_ENTITY_HIT_EXPLOSION_BASE_STRENGTH).getDouble());
|
||||
LASER_CANNON_ENTITY_HIT_EXPLOSION_ENERGY_PER_STRENGTH = clamp(1, Integer.MAX_VALUE,
|
||||
config.get("laser_cannon", "entity_hit_explosion_energy_per_strength", LASER_CANNON_ENTITY_HIT_EXPLOSION_ENERGY_PER_STRENGTH, "Energy per added explosion strength").getInt());
|
||||
LASER_CANNON_ENTITY_HIT_EXPLOSION_MAX_STRENGTH = (float) clamp(0.0D, 1000.0D,
|
||||
config.get("laser_cannon", "entity_hit_explosion_max_strength", LASER_CANNON_ENTITY_HIT_EXPLOSION_MAX_STRENGTH, "Maximum explosion strength, set to 0 to disable explosion completly").getDouble());
|
||||
|
||||
LASER_CANNON_BLOCK_HIT_ENERGY = clamp(0, Integer.MAX_VALUE,
|
||||
config.get("laser_cannon", "block_hit_energy", LASER_CANNON_BLOCK_HIT_ENERGY, "Base energy consummed from hitting a block").getInt());
|
||||
LASER_CANNON_BLOCK_HIT_ENERGY_PER_BLOCK_RESISTANCE = clamp(0, Integer.MAX_VALUE,
|
||||
config.get("laser_cannon", "block_hit_energy_per_block_resistance", LASER_CANNON_BLOCK_HIT_ENERGY_PER_BLOCK_RESISTANCE, "Energy consummed per explosive resistance points").getInt());
|
||||
LASER_CANNON_BLOCK_HIT_ENERGY_PER_DISTANCE = clamp(0, Integer.MAX_VALUE,
|
||||
config.get("laser_cannon", "block_hit_energy_per_distance", LASER_CANNON_BLOCK_HIT_ENERGY_PER_DISTANCE, "Energy consummed per distance travelled").getInt());
|
||||
|
||||
LASER_CANNON_BLOCK_HIT_EXPLOSION_RESISTANCE_THRESHOLD = clamp(0.0D, 1000000.0D,
|
||||
config.get("laser_cannon", "block_hit_explosion_resistance_threshold", LASER_CANNON_BLOCK_HIT_EXPLOSION_RESISTANCE_THRESHOLD, "Block explosion resistance threshold to cause an explosion").getDouble());
|
||||
LASER_CANNON_BLOCK_HIT_EXPLOSION_BASE_STRENGTH = (float) clamp(0.0D, 1000.0D,
|
||||
config.get("laser_cannon", "block_hit_explosion_base_strength", LASER_CANNON_BLOCK_HIT_EXPLOSION_BASE_STRENGTH, "Explosion base strength, 4 is Vanilla TNT").getDouble());
|
||||
LASER_CANNON_BLOCK_HIT_EXPLOSION_ENERGY_PER_STRENGTH = clamp(1, Integer.MAX_VALUE,
|
||||
config.get("laser_cannon", "block_hit_explosion_energy_per_strength", LASER_CANNON_BLOCK_HIT_EXPLOSION_ENERGY_PER_STRENGTH, "Energy per added explosion strength").getInt());
|
||||
LASER_CANNON_BLOCK_HIT_EXPLOSION_MAX_STRENGTH = (float) clamp(0.0D, 1000.0D,
|
||||
config.get("laser_cannon", "block_hit_explosion_max_strength", LASER_CANNON_BLOCK_HIT_EXPLOSION_MAX_STRENGTH, "Maximum explosion strength, set to 0 to disable explosion completly").getDouble());
|
||||
|
||||
// Mining Laser
|
||||
ML_MAX_BOOSTERS_NUMBER = config.get("MiningLaser", "max_boosters_number", ML_MAX_BOOSTERS_NUMBER).getInt();
|
||||
ML_WARMUP_DELAY_TICKS = config.get("MiningLaser", "warmup_delay_ticks", ML_WARMUP_DELAY_TICKS).getInt();
|
||||
ML_SCAN_DELAY_TICKS = config.get("MiningLaser", "scan_delay_ticks", ML_SCAN_DELAY_TICKS).getInt();
|
||||
ML_MINE_DELAY_TICKS = config.get("MiningLaser", "mine_delay_ticks", ML_MINE_DELAY_TICKS).getInt();
|
||||
ML_EU_PER_LAYER_SPACE = config.get("MiningLaser", "eu_per_layer_space", ML_EU_PER_LAYER_SPACE).getInt();
|
||||
ML_EU_PER_LAYER_EARTH = config.get("MiningLaser", "eu_per_layer_earth", ML_EU_PER_LAYER_EARTH).getInt();
|
||||
ML_EU_PER_BLOCK_SPACE = config.get("MiningLaser", "eu_per_block_space", ML_EU_PER_BLOCK_SPACE).getInt();
|
||||
ML_EU_PER_BLOCK_EARTH = config.get("MiningLaser", "eu_per_block_earth", ML_EU_PER_BLOCK_EARTH).getInt();
|
||||
ML_EU_MUL_ORESONLY = config.get("MiningLaser", "oresonly_power_mul", ML_EU_MUL_ORESONLY).getDouble(4.0);
|
||||
ML_EU_MUL_SILKTOUCH = config.get("MiningLaser", "silktouch_power_mul", ML_EU_MUL_SILKTOUCH).getDouble(2.5);
|
||||
ML_DEUTERIUM_MUL_SILKTOUCH = config.get("MiningLaser", "silktouch_deuterium_mul", ML_DEUTERIUM_MUL_SILKTOUCH).getDouble(1.0);
|
||||
ML_EU_MUL_FORTUNE = config.get("MiningLaser", "fortune_power_base", ML_EU_MUL_FORTUNE).getDouble(2.5);
|
||||
ML_MAX_RADIUS = config.get("MiningLaser", "max_radius", ML_MAX_RADIUS).getInt();
|
||||
|
||||
MINING_LASER_MAX_MEDIUMS_COUNT = clamp(1, 64,
|
||||
config.get("mining_laser", "max_mediums_count", MINING_LASER_MAX_MEDIUMS_COUNT).getInt());
|
||||
MINING_LASER_MAX_RADIUS = clamp(1, 64,
|
||||
config.get("mining_laser", "max_radius", MINING_LASER_MAX_RADIUS).getInt());
|
||||
|
||||
MINING_LASER_WARMUP_DELAY_TICKS = clamp(1, 300,
|
||||
config.get("mining_laser", "warmup_delay_ticks", MINING_LASER_WARMUP_DELAY_TICKS).getInt());
|
||||
MINING_LASER_SCAN_DELAY_TICKS = clamp(1, 300,
|
||||
config.get("mining_laser", "scan_delay_ticks", MINING_LASER_SCAN_DELAY_TICKS).getInt());
|
||||
MINING_LASER_MINE_DELAY_TICKS = clamp(1, 300,
|
||||
config.get("mining_laser", "mine_delay_ticks", MINING_LASER_MINE_DELAY_TICKS).getInt());
|
||||
|
||||
MINING_LASER_PLANET_ENERGY_PER_LAYER = clamp(1, Integer.MAX_VALUE,
|
||||
config.get("mining_laser", "planet_energy_per_layer", MINING_LASER_PLANET_ENERGY_PER_LAYER).getInt());
|
||||
MINING_LASER_PLANET_ENERGY_PER_BLOCK = clamp(1, Integer.MAX_VALUE,
|
||||
config.get("mining_laser", "planet_energy_per_block", MINING_LASER_PLANET_ENERGY_PER_BLOCK).getInt());
|
||||
MINING_LASER_SPACE_ENERGY_PER_LAYER = clamp(1, Integer.MAX_VALUE,
|
||||
config.get("mining_laser", "space_energy_per_layer", MINING_LASER_SPACE_ENERGY_PER_LAYER).getInt());
|
||||
MINING_LASER_SPACE_ENERGY_PER_BLOCK = clamp(1, Integer.MAX_VALUE,
|
||||
config.get("mining_laser", "space_energy_per_block", MINING_LASER_SPACE_ENERGY_PER_BLOCK).getInt());
|
||||
|
||||
MINING_LASER_ORESONLY_ENERGY_FACTOR = clamp(0.01D, 1000.0D,
|
||||
config.get("mining_laser", "oresonly_energy_factor", MINING_LASER_ORESONLY_ENERGY_FACTOR).getDouble(4.0D));
|
||||
MINING_LASER_SILKTOUCH_ENERGY_FACTOR = clamp(0.01D, 1000.0D,
|
||||
config.get("mining_laser", "silktouch_energy_factor", MINING_LASER_SILKTOUCH_ENERGY_FACTOR).getDouble(2.5D));
|
||||
MINING_LASER_SILKTOUCH_DEUTERIUM_L = clamp(0.001D, 10.0D,
|
||||
config.get("mining_laser", "silktouch_deuterium_l", MINING_LASER_SILKTOUCH_DEUTERIUM_L).getDouble(1.0D));
|
||||
MINING_LASER_FORTUNE_ENERGY_FACTOR = clamp(0.01D, 1000.0D,
|
||||
config.get("mining_laser", "fortune_energy_factor", MINING_LASER_FORTUNE_ENERGY_FACTOR).getDouble(2.5D));
|
||||
|
||||
// Tree Farm
|
||||
TF_MAX_SIZE = config.get("TreeFarm", "max_treefarm_size", TF_MAX_SIZE).getInt();
|
||||
|
||||
// Cloaking device core
|
||||
CD_MAX_CLOAKING_FIELD_SIDE = config.get("CloakingDevice", "max_cloaking_field_side", CD_MAX_CLOAKING_FIELD_SIDE).getInt();
|
||||
CD_ENERGY_PER_BLOCK_TIER1 = config.get("CloakingDevice", "energy_per_block_tier1", CD_ENERGY_PER_BLOCK_TIER1).getInt();
|
||||
CD_ENERGY_PER_BLOCK_TIER2 = config.get("CloakingDevice", "energy_per_block_tier2", CD_ENERGY_PER_BLOCK_TIER2).getInt();
|
||||
CD_FIELD_REFRESH_INTERVAL_SECONDS = config.get("CloakingDevice", "field_refresh_interval_seconds", CD_FIELD_REFRESH_INTERVAL_SECONDS).getInt();
|
||||
CD_COIL_CAPTURE_BLOCKS = config.get("CloakingDevice", "coil_capture_blocks", CD_COIL_CAPTURE_BLOCKS, "Extra blocks covered after the outer coils")
|
||||
.getInt();
|
||||
|
||||
TREE_FARM_MIN_RADIUS = clamp(1, 30,
|
||||
config.get("tree_farm", "min_radius", TREE_FARM_MIN_RADIUS, "Minimum radius on X and Z axis, measured in blocks").getInt());
|
||||
TREE_FARM_MAX_RADIUS = clamp(TREE_FARM_MIN_RADIUS, 30,
|
||||
config.get("tree_farm", "max_radius", TREE_FARM_MAX_RADIUS, "Maximum radius on X and Z axis, measured in blocks").getInt());
|
||||
|
||||
// Cloaking
|
||||
CLOAKING_MAX_ENERGY_STORED = clamp(1, Integer.MAX_VALUE,
|
||||
config.get("cloaking", "max_energy_stored", CLOAKING_MAX_ENERGY_STORED, "Maximum energy storage").getInt());
|
||||
CLOAKING_COIL_CAPTURE_BLOCKS = clamp(0, 30,
|
||||
config.get("cloaking", "coil_capture_blocks", CLOAKING_COIL_CAPTURE_BLOCKS, "Extra blocks covered after the outer coils").getInt());
|
||||
CLOAKING_MAX_FIELD_RADIUS = clamp(CLOAKING_COIL_CAPTURE_BLOCKS + 3, 128,
|
||||
config.get("cloaking", "max_field_radius", CLOAKING_MAX_FIELD_RADIUS).getInt());
|
||||
CLOAKING_TIER1_ENERGY_PER_BLOCK = clamp(0, Integer.MAX_VALUE,
|
||||
config.get("cloaking", "tier1_energy_per_block", CLOAKING_TIER1_ENERGY_PER_BLOCK).getInt());
|
||||
CLOAKING_TIER2_ENERGY_PER_BLOCK = clamp(CLOAKING_TIER1_ENERGY_PER_BLOCK, Integer.MAX_VALUE,
|
||||
config.get("cloaking", "tier2_energy_per_block", CLOAKING_TIER2_ENERGY_PER_BLOCK).getInt());
|
||||
CLOAKING_FIELD_REFRESH_INTERVAL_SECONDS = clamp(1, 30,
|
||||
config.get("cloaking", "field_refresh_interval_seconds", CLOAKING_FIELD_REFRESH_INTERVAL_SECONDS).getInt());
|
||||
|
||||
// Air generator
|
||||
AG_RF_PER_CANISTER = config.get("Air Generator", "energy_per_canister", AG_RF_PER_CANISTER).getInt();
|
||||
AG_EU_PER_NEWAIRBLOCK = config.get("Air Generator", "eu_per_new_air_block", AG_EU_PER_NEWAIRBLOCK).getInt();
|
||||
AG_EU_PER_EXISTINGAIRBLOCK = config.get("Air Generator", "eu_per_existing_air_block", AG_EU_PER_EXISTINGAIRBLOCK).getInt();
|
||||
AG_MAX_ENERGY = config.get("Air Generator", "max_energy", AG_MAX_ENERGY).getInt();
|
||||
AG_AIR_GENERATION_TICKS = config.get("Air Generator", "air_generation_ticks", AG_AIR_GENERATION_TICKS).getInt();
|
||||
AIRGEN_MAX_ENERGY_STORED = clamp(1, Integer.MAX_VALUE,
|
||||
config.get("air_generator", "max_energy_stored", AIRGEN_MAX_ENERGY_STORED).getInt());
|
||||
AIRGEN_ENERGY_PER_CANISTER = clamp(1, AIRGEN_MAX_ENERGY_STORED,
|
||||
config.get("air_generator", "energy_per_canister", AIRGEN_ENERGY_PER_CANISTER).getInt());
|
||||
AIRGEN_ENERGY_PER_NEWAIRBLOCK = clamp(1, AIRGEN_MAX_ENERGY_STORED,
|
||||
config.get("air_generator", "energy_per_new_air_block", AIRGEN_ENERGY_PER_NEWAIRBLOCK).getInt());
|
||||
AIRGEN_ENERGY_PER_EXISTINGAIRBLOCK = clamp(1, AIRGEN_MAX_ENERGY_STORED,
|
||||
config.get("air_generator", "eu_per_existing_air_block", AIRGEN_ENERGY_PER_EXISTINGAIRBLOCK).getInt());
|
||||
AIRGEN_AIR_GENERATION_TICKS = clamp(1, 300,
|
||||
config.get("air_generator", "air_generation_ticks", AIRGEN_AIR_GENERATION_TICKS).getInt());
|
||||
|
||||
// Reactor monitor
|
||||
RM_MAX_ENERGY = config.get("Reactor Monitor", "max_rm_energy", RM_MAX_ENERGY).getInt();
|
||||
RM_EU_PER_HEAT = config.get("Reactor Monitor", "eu_per_heat", RM_EU_PER_HEAT).getDouble(2);
|
||||
|
||||
IC2_REACTOR_MAX_ENERGY_STORED = clamp(1, Integer.MAX_VALUE,
|
||||
config.get("ic2_reactor_laser", "max_energy_stored", IC2_REACTOR_MAX_ENERGY_STORED).getInt());
|
||||
IC2_REACTOR_ENERGY_PER_HEAT = clamp(2.0D, 100000.0D,
|
||||
config.get("ic2_reactor_laser", "energy_per_heat", IC2_REACTOR_ENERGY_PER_HEAT).getDouble(2));
|
||||
|
||||
// Transporter
|
||||
TR_MAX_ENERGY = config.get("Transporter", "max_energy", TR_MAX_ENERGY).getInt();
|
||||
TR_RELATIVE_COORDS = config.get("Transporter", "relative_coords", TR_RELATIVE_COORDS).getBoolean(true);
|
||||
TR_EU_PER_METRE = config.get("Transporter", "eu_per_ent_per_metre", TR_EU_PER_METRE).getDouble(100.0);
|
||||
TR_MAX_BOOST_MUL = config.get("Transporter", "max_boost", TR_MAX_BOOST_MUL).getDouble(4.0);
|
||||
|
||||
// Power reactor
|
||||
PR_MAX_ENERGY = config.get("Reactor", "max_energy", PR_MAX_ENERGY).getInt();
|
||||
PR_TICK_TIME = config.get("Reactor", "ticks_per_update", PR_TICK_TIME).getInt();
|
||||
PR_MAX_LASERS = config.get("Reactor", "max_lasers", PR_MAX_LASERS).getInt();
|
||||
|
||||
// Power store
|
||||
PS_MAX_ENERGY = config.get("PowerStore", "max_energy", PS_MAX_ENERGY).getInt();
|
||||
|
||||
// Laser lift
|
||||
LL_MAX_ENERGY = config.get("LaserLift", "max_energy", LL_MAX_ENERGY).getInt();
|
||||
LL_LIFT_ENERGY = config.get("LaserLift", "lift_energy", LL_LIFT_ENERGY, "Energy consummed per entity moved").getInt();
|
||||
LL_TICK_RATE = config.get("LaserLift", "tick_rate", LL_TICK_RATE).getInt();
|
||||
TRANSPORTER_MAX_ENERGY = clamp(1, Integer.MAX_VALUE,
|
||||
config.get("transporter", "max_energy", TRANSPORTER_MAX_ENERGY).getInt());
|
||||
TRANSPORTER_USE_RELATIVE_COORDS = config.get("transporter", "use_relative_coords", TRANSPORTER_USE_RELATIVE_COORDS).getBoolean(true);
|
||||
TRANSPORTER_ENERGY_PER_BLOCK = clamp(1.0D, TRANSPORTER_MAX_ENERGY / 10.0D,
|
||||
config.get("transporter", "energy_per_block", TRANSPORTER_ENERGY_PER_BLOCK).getDouble(100.0D));
|
||||
TRANSPORTER_MAX_BOOST_MUL = clamp(1.0D, 1000.0D,
|
||||
config.get("transporter", "max_boost", TRANSPORTER_MAX_BOOST_MUL).getDouble(4.0));
|
||||
|
||||
// Enantiomorphic reactor
|
||||
ENAN_REACTOR_MAX_ENERGY_STORED = clamp(1, Integer.MAX_VALUE,
|
||||
config.get("enantiomorphic_reactor", "max_energy_stored", ENAN_REACTOR_MAX_ENERGY_STORED).getInt());
|
||||
ENAN_REACTOR_UPDATE_INTERVAL_TICKS = clamp(1, 300,
|
||||
config.get("enantiomorphic_reactor", "update_interval_ticks", ENAN_REACTOR_UPDATE_INTERVAL_TICKS).getInt());
|
||||
ENAN_REACTOR_MAX_LASERS_PER_SECOND = clamp(4, 80,
|
||||
config.get("enantiomorphic_reactor", "max_lasers", ENAN_REACTOR_MAX_LASERS_PER_SECOND, "Maximum number of stabiliation laser shots per seconds before loosing effiency").getInt());
|
||||
|
||||
// Energy bank
|
||||
ENERGY_BANK_MAX_ENERGY_STORED = config.get("energy_bank", "max_energy_stored", ENERGY_BANK_MAX_ENERGY_STORED).getInt();
|
||||
|
||||
// Lift
|
||||
LIFT_MAX_ENERGY_STORED = clamp(1, Integer.MAX_VALUE,
|
||||
config.get("lift", "max_energy_stored", LIFT_MAX_ENERGY_STORED).getInt());
|
||||
LIFT_ENERGY_PER_ENTITY = clamp(1, Integer.MAX_VALUE,
|
||||
config.get("lift", "energy_per_entity", LIFT_ENERGY_PER_ENTITY, "Energy consummed per entity moved").getInt());
|
||||
LIFT_UPDATE_INTERVAL_TICKS = clamp(1, 60,
|
||||
config.get("lift", "update_interval_ticks", LIFT_UPDATE_INTERVAL_TICKS).getInt());
|
||||
|
||||
config.save();
|
||||
}
|
||||
|
||||
|
||||
public static int clamp(final int min, final int max, final int value) {
|
||||
return Math.min(max, Math.max(value, min));
|
||||
}
|
||||
|
||||
public static double clamp(final double min, final double max, final double value) {
|
||||
return Math.min(max, Math.max(value, min));
|
||||
}
|
||||
|
||||
public static void load() {
|
||||
commonWorldGenOres = new ArrayList<Block>();
|
||||
commonWorldGenOres.add(Blocks.iron_ore);
|
||||
|
@ -858,26 +972,22 @@ public class WarpDriveConfig {
|
|||
* Copy a default configuration file from the mod's resources to the specified configuration folder
|
||||
*/
|
||||
public static void unpackResourceToFolder(final String filename, final String sourceResourcePath, File targetFolder) {
|
||||
// targetFolder is already created by caller
|
||||
|
||||
String resourceName = sourceResourcePath + "/" + filename;
|
||||
|
||||
boolean result = targetFolder.mkdirs();
|
||||
if (!result) {
|
||||
WarpDrive.logger.error("Failed to create target folder for unpacking resource \'" + resourceName + "\' into " + targetFolder);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
File destination = new File(targetFolder, filename);
|
||||
|
||||
|
||||
try {
|
||||
InputStream inputStream = WarpDrive.class.getClassLoader().getResourceAsStream(resourceName);
|
||||
BufferedOutputStream outputStream = new BufferedOutputStream(new FileOutputStream(destination));
|
||||
|
||||
|
||||
byte[] byteBuffer = new byte[Math.max(8192, inputStream.available())];
|
||||
int bytesRead;
|
||||
while ((bytesRead = inputStream.read(byteBuffer)) >= 0) {
|
||||
outputStream.write(byteBuffer, 0, bytesRead);
|
||||
}
|
||||
|
||||
|
||||
inputStream.close();
|
||||
outputStream.close();
|
||||
} catch (Exception exception) {
|
||||
|
|
|
@ -7,17 +7,17 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
*
|
||||
* @author LemADEC
|
||||
*/
|
||||
public class TransitionPlane implements Cloneable {
|
||||
public class Planet implements Cloneable {
|
||||
public int dimensionId;
|
||||
public int dimensionCenterX, dimensionCenterZ;
|
||||
public int borderSizeX, borderSizeZ;
|
||||
public int spaceCenterX, spaceCenterZ;
|
||||
|
||||
public TransitionPlane() {
|
||||
public Planet() {
|
||||
this(0, 0, 0, 5000, 5000, 0, 0);
|
||||
}
|
||||
|
||||
public TransitionPlane(int parDimensionId, int parDimensionCenterX, int parDimensionCenterZ, int parBorderSizeX, int parBorderSizeZ, int parSpaceCenterX, int parSpaceCenterZ) {
|
||||
public Planet(int parDimensionId, int parDimensionCenterX, int parDimensionCenterZ, int parBorderSizeX, int parBorderSizeZ, int parSpaceCenterX, int parSpaceCenterZ) {
|
||||
this.dimensionId = parDimensionId;
|
||||
this.spaceCenterX = parSpaceCenterX;
|
||||
this.spaceCenterZ = parSpaceCenterZ;
|
||||
|
@ -27,7 +27,7 @@ public class TransitionPlane implements Cloneable {
|
|||
this.borderSizeZ = parBorderSizeZ;
|
||||
}
|
||||
|
||||
public TransitionPlane(NBTTagCompound nbt) {
|
||||
public Planet(NBTTagCompound nbt) {
|
||||
readFromNBT(nbt);
|
||||
}
|
||||
|
||||
|
@ -35,8 +35,8 @@ public class TransitionPlane implements Cloneable {
|
|||
* Makes a new copy of this TransitionPlane. Prevents variable referencing problems.
|
||||
*/
|
||||
@Override
|
||||
public TransitionPlane clone() {
|
||||
return new TransitionPlane(dimensionId, dimensionCenterX, dimensionCenterZ, borderSizeX, borderSizeZ, spaceCenterX, spaceCenterZ);
|
||||
public Planet clone() {
|
||||
return new Planet(dimensionId, dimensionCenterX, dimensionCenterZ, borderSizeX, borderSizeZ, spaceCenterX, spaceCenterZ);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -95,8 +95,8 @@ public class TransitionPlane implements Cloneable {
|
|||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o instanceof TransitionPlane) {
|
||||
TransitionPlane transitionPlane = (TransitionPlane) o;
|
||||
if (o instanceof Planet) {
|
||||
Planet transitionPlane = (Planet) o;
|
||||
return this.dimensionId == transitionPlane.dimensionId && this.dimensionCenterX == transitionPlane.dimensionCenterX && this.dimensionCenterZ == transitionPlane.dimensionCenterZ
|
||||
&& this.borderSizeX == transitionPlane.borderSizeX && this.borderSizeZ == transitionPlane.borderSizeZ && this.spaceCenterX == transitionPlane.spaceCenterX
|
||||
&& this.spaceCenterZ == transitionPlane.spaceCenterZ;
|
|
@ -110,7 +110,7 @@ public class StarMapEntry {
|
|||
if (dimensionId == WarpDriveConfig.G_HYPERSPACE_DIMENSION_ID) {
|
||||
return new VectorI(x, y + 512, z);
|
||||
}
|
||||
for (TransitionPlane transitionPlane : WarpDriveConfig.G_TRANSITIONPLANES) {
|
||||
for (Planet transitionPlane : WarpDriveConfig.PLANETS) {
|
||||
if (transitionPlane.dimensionId == dimensionId) {
|
||||
if ( (Math.abs(x - transitionPlane.dimensionCenterX) <= transitionPlane.borderSizeX)
|
||||
&& (Math.abs(z - transitionPlane.dimensionCenterZ) <= transitionPlane.borderSizeZ)) {
|
||||
|
|
|
@ -135,7 +135,7 @@ public class StarMapRegistry {
|
|||
double d5 = entry.z - core.zCoord;
|
||||
double distance2 = d3 * d3 + d4 * d4 + d5 * d5;
|
||||
|
||||
if (distance2 <= ((2 * WarpDriveConfig.WC_MAX_SHIP_SIDE) - 1) * ((2 * WarpDriveConfig.WC_MAX_SHIP_SIDE) - 1)) {
|
||||
if (distance2 <= ((2 * WarpDriveConfig.SHIP_MAX_SIDE_SIZE) - 1) * ((2 * WarpDriveConfig.SHIP_MAX_SIDE_SIZE) - 1)) {
|
||||
// Compare warp-fields for intersection
|
||||
aabb2 = AxisAlignedBB.getBoundingBox(entry.minX, entry.minY, entry.minZ, entry.maxX, entry.maxY, entry.maxZ);
|
||||
if (aabb1.intersectsWith(aabb2)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue