Logger update and code cleanup
This commit is contained in:
parent
d1cce7764c
commit
6c316a16c7
4 changed files with 92 additions and 105 deletions
|
@ -326,7 +326,6 @@ public class TileEntityCloakingDeviceCore extends WarpEnergyTE {
|
|||
public void readFromNBT(NBTTagCompound tag) {
|
||||
super.readFromNBT(tag);
|
||||
this.tier = tag.getByte("tier");
|
||||
// this.frequency = tag.getInteger("frequency");
|
||||
this.isEnabled = tag.getBoolean("enabled");
|
||||
}
|
||||
|
||||
|
@ -334,7 +333,6 @@ public class TileEntityCloakingDeviceCore extends WarpEnergyTE {
|
|||
public void writeToNBT(NBTTagCompound tag) {
|
||||
super.writeToNBT(tag);
|
||||
tag.setByte("tier", tier);
|
||||
// tag.setInteger("frequency", frequency);
|
||||
tag.setBoolean("enabled", isEnabled);
|
||||
}
|
||||
|
||||
|
|
|
@ -26,33 +26,22 @@ public class TileEntityPowerReactor extends WarpEnergyTE implements IBlockUpdate
|
|||
private static final double PR_MAX_EXPLOSION_REMOVAL_CHANCE = 0.1D;
|
||||
|
||||
// laser stabilization is per shot
|
||||
// target is to consume 10% max output power every second, hence 2.5% per
|
||||
// side
|
||||
// laser efficiency is 33% at 16% power (target spot), 50% at 24% power, 84%
|
||||
// at 50% power, etc.
|
||||
// 10% * 20 * PR_MAX_GENERATION / (4 * 0.16) => ~200kRF => ~ max laser
|
||||
// energy
|
||||
// target is to consume 10% max output power every second, hence 2.5% per side
|
||||
// laser efficiency is 33% at 16% power (target spot), 50% at 24% power, 84% at 50% power, etc.
|
||||
// 10% * 20 * PR_MAX_GENERATION / (4 * 0.16) => ~200kRF => ~ max laser energy
|
||||
private static final double PR_MAX_LASER_ENERGY = 200000.0D;
|
||||
private static final double PR_MAX_LASER_EFFECT = PR_MAX_INSTABILITY * 20 / 0.33D;
|
||||
|
||||
private int tickCount = 0;
|
||||
|
||||
private double[] instabilityValues = { 0.0D, 0.0D, 0.0D, 0.0D }; // no
|
||||
// instability
|
||||
// = 0,
|
||||
// explosion
|
||||
// = 100
|
||||
private double[] instabilityValues = { 0.0D, 0.0D, 0.0D, 0.0D }; // no instability = 0, explosion = 100
|
||||
private float lasersReceived = 0;
|
||||
private int lastGenerationRate = 0;
|
||||
private int releasedThisTick = 0; // amount of energy released during
|
||||
// current tick update
|
||||
private int releasedThisCycle = 0; // amount of energy released during
|
||||
// current cycle
|
||||
private int releasedThisTick = 0; // amount of energy released during current tick update
|
||||
private int releasedThisCycle = 0; // amount of energy released during current cycle
|
||||
private int releasedLastCycle = 0;
|
||||
|
||||
private boolean hold = true; // hold updates and power output until reactor
|
||||
// is controlled (i.e. don't explode on
|
||||
// chunk-loading while computer is booting)
|
||||
private boolean hold = true; // hold updates and power output until reactor is controlled (i.e. don't explode on chunk-loading while computer is booting)
|
||||
private boolean active = false;
|
||||
private static final int MODE_DONT_RELEASE = 0;
|
||||
private static final int MODE_MANUAL_RELEASE = 1;
|
||||
|
@ -68,15 +57,12 @@ public class TileEntityPowerReactor extends WarpEnergyTE implements IBlockUpdate
|
|||
public TileEntityPowerReactor() {
|
||||
super();
|
||||
peripheralName = "warpdriveReactor";
|
||||
methodsArray = new String[] { "active", "energy", // returns energy, max
|
||||
// energy, energy
|
||||
// rate
|
||||
"instability", // returns ins0,1,2,3
|
||||
"release", // releases all energy
|
||||
"releaseRate", // releases energy when more than arg0 is
|
||||
// produced
|
||||
"releaseAbove", // releases any energy above arg0 amount
|
||||
"help" // returns help on arg0 function
|
||||
methodsArray = new String[] { "active", "energy", // returns energy, max energy, energy rate
|
||||
"instability", // returns ins0,1,2,3
|
||||
"release", // releases all energy
|
||||
"releaseRate", // releases energy when more than arg0 is produced
|
||||
"releaseAbove", // releases any energy above arg0 amount
|
||||
"help" // returns help on arg0 function
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -89,7 +75,9 @@ public class TileEntityPowerReactor extends WarpEnergyTE implements IBlockUpdate
|
|||
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));
|
||||
// WarpDrive.debugPrint("InsInc" + amountToIncrease);
|
||||
if (WarpDriveConfig.G_DEBUGMODE) {
|
||||
WarpDrive.debugPrint("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);
|
||||
|
@ -125,25 +113,20 @@ public class TileEntityPowerReactor extends WarpEnergyTE implements IBlockUpdate
|
|||
// increaseInstability(from, false);
|
||||
// increaseInstability(false);
|
||||
}
|
||||
double normalisedAmount = Math.min(1.0D, Math.max(0.0D, amount / PR_MAX_LASER_ENERGY)); // 0.0
|
||||
// to
|
||||
// 1.0
|
||||
double baseLaserEffect = 0.5D + 0.5D * Math.cos(Math.PI - (1.0D + Math.log10(0.1D + 0.9D * normalisedAmount)) * Math.PI); // 0.0
|
||||
// to
|
||||
// 1.0
|
||||
double normalisedAmount = Math.min(1.0D, Math.max(0.0D, amount / PR_MAX_LASER_ENERGY)); // 0.0 to 1.0
|
||||
double baseLaserEffect = 0.5D + 0.5D * Math.cos(Math.PI - (1.0D + Math.log10(0.1D + 0.9D * normalisedAmount)) * Math.PI); // 0.0 to 1.0
|
||||
double randomVariation = 0.8D + 0.4D * worldObj.rand.nextDouble(); // ~1.0
|
||||
double amountToRemove = PR_MAX_LASER_EFFECT * baseLaserEffect * randomVariation * nospamFactor;
|
||||
|
||||
int side = from.ordinal() - 2;
|
||||
|
||||
/*
|
||||
* if (side == 3) WarpDrive.debugPrint("Instability on " +
|
||||
* from.toString() + " decreased by " + String.format("%.1f",
|
||||
* amountToRemove) + "/" + String.format("%.1f", PR_MAX_LASER_EFFECT) +
|
||||
* " after consuming " + amount + "/" + PR_MAX_LASER_ENERGY +
|
||||
* " lasersReceived is " + String.format("%.1f", lasersReceived) +
|
||||
* " hence nospamFactor is " + nospamFactor); /*
|
||||
*/
|
||||
if (WarpDriveConfig.G_DEBUGMODE) {
|
||||
if (side == 3) {
|
||||
WarpDrive.debugPrint("Instability on " + from.toString()
|
||||
+ " decreased by " + String.format("%.1f", amountToRemove) + "/" + String.format("%.1f", PR_MAX_LASER_EFFECT)
|
||||
+ " after consuming " + amount + "/" + PR_MAX_LASER_ENERGY + " lasersReceived is " + String.format("%.1f", lasersReceived) + " hence nospamFactor is " + nospamFactor);
|
||||
}
|
||||
}
|
||||
|
||||
instabilityValues[side] = Math.max(0, instabilityValues[side] - amountToRemove);
|
||||
|
||||
|
@ -156,19 +139,22 @@ public class TileEntityPowerReactor extends WarpEnergyTE implements IBlockUpdate
|
|||
stabilityOffset *= Math.max(0.01D, instabilityValues[i] / 100.0D);
|
||||
}
|
||||
|
||||
if (active) {// producing, instability increase output, you want to take
|
||||
// the risk
|
||||
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;
|
||||
// WarpDrive.debugPrint("Generated " + amountToGenerate);
|
||||
if (WarpDriveConfig.G_DEBUGMODE) {
|
||||
WarpDrive.debugPrint("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));
|
||||
containedEnergy = Math.max(0, containedEnergy - amountToDecay);
|
||||
lastGenerationRate = 0;
|
||||
// WarpDrive.debugPrint("Decayed " + amountToDecay);
|
||||
if (WarpDriveConfig.G_DEBUGMODE) {
|
||||
WarpDrive.debugPrint("Decayed " + amountToDecay);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -179,10 +165,10 @@ public class TileEntityPowerReactor extends WarpEnergyTE implements IBlockUpdate
|
|||
}
|
||||
super.updateEntity();
|
||||
|
||||
// WarpDrive.debugPrint("tickCount " + tickCount + " releasedThisTick "
|
||||
// + releasedThisTick + " lasersReceived " + lasersReceived +
|
||||
// " releasedThisCycle " + releasedThisCycle + " containedEnergy " +
|
||||
// containedEnergy);
|
||||
if (WarpDriveConfig.G_DEBUGMODE) {
|
||||
WarpDrive.debugPrint("tickCount " + tickCount + " releasedThisTick " + releasedThisTick + " lasersReceived " + lasersReceived
|
||||
+ " releasedThisCycle " + releasedThisCycle + " containedEnergy " + containedEnergy);
|
||||
}
|
||||
releasedThisTick = 0;
|
||||
|
||||
lasersReceived = Math.max(0.0F, lasersReceived - 0.05F);
|
||||
|
@ -213,8 +199,7 @@ public class TileEntityPowerReactor extends WarpEnergyTE implements IBlockUpdate
|
|||
}
|
||||
|
||||
private void explode() {
|
||||
// remove blocks randomly up to x blocks around (breaking whatever
|
||||
// protection is there)
|
||||
// remove blocks randomly up to x blocks around (breaking whatever protection is there)
|
||||
double normalizedEnergy = containedEnergy / (double) WarpDriveConfig.PR_MAX_ENERGY;
|
||||
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);
|
||||
|
@ -236,8 +221,11 @@ public class TileEntityPowerReactor extends WarpEnergyTE implements IBlockUpdate
|
|||
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||
// set a few TnT augmented around reactor
|
||||
for (int i = 0; i < 3; i++) {
|
||||
worldObj.newExplosion((Entity) null, xCoord + worldObj.rand.nextInt(3) - 0.5D, yCoord + worldObj.rand.nextInt(3) - 0.5D, zCoord + worldObj.rand.nextInt(3) - 0.5D,
|
||||
4.0F + worldObj.rand.nextInt(3), true, true);
|
||||
worldObj.newExplosion((Entity) null,
|
||||
xCoord + worldObj.rand.nextInt(3) - 0.5D,
|
||||
yCoord + worldObj.rand.nextInt(3) - 0.5D,
|
||||
zCoord + worldObj.rand.nextInt(3) - 0.5D,
|
||||
4.0F + worldObj.rand.nextInt(3), true, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -266,15 +254,15 @@ public class TileEntityPowerReactor extends WarpEnergyTE implements IBlockUpdate
|
|||
|
||||
if (exploding) {
|
||||
WarpDrive.logger.info(this
|
||||
+ String.format(" Explosion trigerred, Instability is [%.2f, %.2f, %.2f, %.2f], Energy stored is %d, Laser received is %.2f, %s", new Object[] { instabilityValues[0],
|
||||
instabilityValues[1], instabilityValues[2], instabilityValues[3], this.containedEnergy, this.lasersReceived, this.active ? "ACTIVE" : "INACTIVE" }));
|
||||
+ String.format(" Explosion trigerred, Instability is [%.2f, %.2f, %.2f, %.2f], Energy stored is %d, Laser received is %.2f, %s",
|
||||
new Object[] { instabilityValues[0], instabilityValues[1], instabilityValues[2], instabilityValues[3],
|
||||
containedEnergy, lasersReceived, active ? "ACTIVE" : "INACTIVE" }));
|
||||
active = false;
|
||||
}
|
||||
return exploding;
|
||||
}
|
||||
|
||||
// Takes the arguments passed by function call and returns an appropriate
|
||||
// string
|
||||
// Takes the arguments passed by function call and returns an appropriate string
|
||||
private static String helpStr(Object[] args) {
|
||||
if (args.length > 0) {
|
||||
String arg = args[0].toString().toLowerCase();
|
||||
|
@ -368,11 +356,6 @@ public class TileEntityPowerReactor extends WarpEnergyTE implements IBlockUpdate
|
|||
releaseMode = MODE_DONT_RELEASE;
|
||||
releaseRate = 0;
|
||||
} else {
|
||||
/*
|
||||
* releaseAbove = (int)Math.ceil(Math.pow(rate, 1.0 / 0.6));
|
||||
* WarpDrive.debugPrint("releaseAbove " + releaseAbove); releaseMode
|
||||
* = MODE_RELEASE_ABOVE;/*
|
||||
*/
|
||||
// player has to adjust it
|
||||
releaseRate = rate;
|
||||
releaseMode = MODE_RELEASE_AT_RATE;
|
||||
|
@ -465,20 +448,20 @@ public class TileEntityPowerReactor extends WarpEnergyTE implements IBlockUpdate
|
|||
int capacity = Math.max(0, 2 * lastGenerationRate - releasedThisTick);
|
||||
if (releaseMode == MODE_MANUAL_RELEASE) {
|
||||
result = Math.min(Math.max(0, containedEnergy), capacity);
|
||||
// WarpDrive.debugPrint("PotentialOutput Manual " + result + " RF ("
|
||||
// + convertRFtoInternal(result) + " internal) capacity " +
|
||||
// capacity);
|
||||
if (WarpDriveConfig.G_DEBUGMODE) {
|
||||
WarpDrive.debugPrint("PotentialOutput Manual " + result + " RF (" + convertRFtoInternal(result) + " internal) capacity " + capacity);
|
||||
}
|
||||
} else if (releaseMode == MODE_RELEASE_ABOVE) {
|
||||
result = Math.min(Math.max(0, containedEnergy - releaseAbove), capacity);
|
||||
// WarpDrive.debugPrint("PotentialOutput Above " + result + " RF ("
|
||||
// + convertRFtoInternal(result) + " internal) capacity " +
|
||||
// capacity);
|
||||
if (WarpDriveConfig.G_DEBUGMODE) {
|
||||
WarpDrive.debugPrint("PotentialOutput Above " + result + " RF (" + convertRFtoInternal(result) + " internal) capacity " + capacity);
|
||||
}
|
||||
} else if (releaseMode == MODE_RELEASE_AT_RATE) {
|
||||
int remainingRate = Math.max(0, releaseRate - releasedThisTick);
|
||||
result = Math.min(Math.max(0, containedEnergy), Math.min(remainingRate, capacity));
|
||||
// WarpDrive.debugPrint("PotentialOutput Rated " + result + " RF ("
|
||||
// + convertRFtoInternal(result) + " internal) remainingRate " +
|
||||
// remainingRate + " RF/t capacity " + capacity);
|
||||
if (WarpDriveConfig.G_DEBUGMODE) {
|
||||
WarpDrive.debugPrint("PotentialOutput Rated " + result + " RF (" + convertRFtoInternal(result) + " internal) remainingRate " + remainingRate + " RF/t capacity " + capacity);
|
||||
}
|
||||
}
|
||||
return convertRFtoInternal(result);
|
||||
}
|
||||
|
@ -500,8 +483,9 @@ public class TileEntityPowerReactor extends WarpEnergyTE implements IBlockUpdate
|
|||
}
|
||||
releasedThisTick += energyOutput_RF;
|
||||
releasedThisCycle += energyOutput_RF;
|
||||
// WarpDrive.debugPrint("OutputDone " + energyOutput_internal + " (" +
|
||||
// energyOutput_RF + " RF)");
|
||||
if (WarpDriveConfig.G_DEBUGMODE) {
|
||||
WarpDrive.debugPrint("OutputDone " + energyOutput_internal + " (" + energyOutput_RF + " RF)");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -545,8 +529,11 @@ public class TileEntityPowerReactor extends WarpEnergyTE implements IBlockUpdate
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("%s \'%s\' @ \'%s\' %.2f, %.2f, %.2f", new Object[] { getClass().getSimpleName(), this.connectedComputers == null ? "~NULL~" : this.connectedComputers,
|
||||
worldObj == null ? "~NULL~" : worldObj.getWorldInfo().getWorldName(), Double.valueOf(xCoord), Double.valueOf(yCoord), Double.valueOf(zCoord) });
|
||||
return String.format("%s \'%s\' @ \'%s\' %.2f, %.2f, %.2f", new Object[] {
|
||||
getClass().getSimpleName(),
|
||||
connectedComputers == null ? "~NULL~" : connectedComputers,
|
||||
worldObj == null ? "~NULL~" : worldObj.getWorldInfo().getWorldName(),
|
||||
Double.valueOf(xCoord), Double.valueOf(yCoord), Double.valueOf(zCoord) });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -52,11 +52,13 @@ public class TileEntityReactor extends WarpEnergyTE {
|
|||
private ReactorMode currentMode = ReactorMode.IDLE;
|
||||
|
||||
public enum ReactorMode {
|
||||
IDLE(0), BASIC_JUMP(1), // 0-128
|
||||
LONG_JUMP(2), // 0-12800
|
||||
TELEPORT(3), BEACON_JUMP(4), // Jump ship by beacon
|
||||
HYPERSPACE(5), // Jump to/from Hyperspace
|
||||
GATE_JUMP(6); // Jump via jumpgate
|
||||
IDLE(0),
|
||||
BASIC_JUMP(1), // 0-128
|
||||
LONG_JUMP(2), // 0-12800
|
||||
TELEPORT(3),
|
||||
BEACON_JUMP(4), // Jump ship by beacon
|
||||
HYPERSPACE(5), // Jump to/from Hyperspace
|
||||
GATE_JUMP(6); // Jump via jumpgate
|
||||
|
||||
private final int code;
|
||||
|
||||
|
@ -123,11 +125,11 @@ public class TileEntityReactor extends WarpEnergyTE {
|
|||
if (registryUpdateTicks > WarpDriveConfig.WC_CORES_REGISTRY_UPDATE_INTERVAL_SECONDS * 20) {
|
||||
registryUpdateTicks = 0;
|
||||
WarpDrive.warpCores.updateInRegistry(this);
|
||||
// WarpDrive.warpCores.printRegistry();
|
||||
// WarpDrive.debugPrint("" + this + " controller is " + controller +
|
||||
// ", warmupTime " + warmupTime + ", currentMode " + currentMode +
|
||||
// ", jumpFlag " + (controller == null ? "NA" :
|
||||
// controller.isJumpFlag()) + ", cooldownTime " + cooldownTime);
|
||||
if (WarpDriveConfig.G_DEBUGMODE) {
|
||||
WarpDrive.warpCores.printRegistry();
|
||||
WarpDrive.debugPrint("" + this + " controller is " + controller + ", warmupTime " + warmupTime + ", currentMode " + currentMode + ", jumpFlag "
|
||||
+ (controller == null ? "NA" : controller.isJumpFlag()) + ", cooldownTime " + cooldownTime);
|
||||
}
|
||||
|
||||
TileEntity c = findControllerBlock();
|
||||
if (c == null) {
|
||||
|
@ -252,16 +254,16 @@ public class TileEntityReactor extends WarpEnergyTE {
|
|||
messageToAllPlayersOnShip(reason.toString());
|
||||
return;
|
||||
}
|
||||
// WarpDrive.debugPrint(this +
|
||||
// " Giving warp sickness targetWarmup " + targetWarmup +
|
||||
// " distance " + controller.getDistance());
|
||||
if (WarpDriveConfig.G_DEBUGMODE) {
|
||||
WarpDrive.debugPrint(this + " Giving warp sickness targetWarmup " + targetWarmup + " distance " + controller.getDistance());
|
||||
}
|
||||
makePlayersOnShipDrunk(targetWarmup + WarpDriveConfig.WC_WARMUP_RANDOM_TICKS);
|
||||
}
|
||||
|
||||
if (!soundPlayed && (soundThreshold > warmupTime)) {
|
||||
// WarpDrive.debugPrint(this + " Playing sound effect '" +
|
||||
// soundFile + "' soundThreshold " + soundThreshold +
|
||||
// " warmupTime " + warmupTime);
|
||||
if (WarpDriveConfig.G_DEBUGMODE) {
|
||||
WarpDrive.debugPrint(this + " Playing sound effect '" + soundFile + "' soundThreshold " + soundThreshold + " warmupTime " + warmupTime);
|
||||
}
|
||||
worldObj.playSoundEffect(xCoord + 0.5f, yCoord + 0.5f, zCoord + 0.5f, soundFile, 4F, 1F);
|
||||
soundPlayed = true;
|
||||
}
|
||||
|
@ -356,9 +358,9 @@ public class TileEntityReactor extends WarpEnergyTE {
|
|||
} else {
|
||||
isolationRate = 0.0D;
|
||||
}
|
||||
// WarpDrive.debugPrint(this + " Isolation updated to " +
|
||||
// isolationBlocksCount + " (" + String.format("%.1f", isolationRate *
|
||||
// 100) + "%)");
|
||||
if (WarpDriveConfig.G_DEBUGMODE) {
|
||||
WarpDrive.debugPrint(this + " Isolation updated to " + isolationBlocksCount + " (" + String.format("%.1f", isolationRate * 100) + "%)");
|
||||
}
|
||||
}
|
||||
|
||||
private void makePlayersOnShipDrunk(int tickDuration) {
|
||||
|
@ -410,10 +412,12 @@ public class TileEntityReactor extends WarpEnergyTE {
|
|||
|
||||
if (player.dimension != worldObj.provider.dimensionId) {
|
||||
player.mcServer.getConfigurationManager().transferPlayerToDimension(
|
||||
player,
|
||||
this.worldObj.provider.dimensionId,
|
||||
new SpaceTeleporter(DimensionManager.getWorld(this.worldObj.provider.dimensionId), 0, MathHelper.floor_double(player.posX), MathHelper
|
||||
.floor_double(player.posY), MathHelper.floor_double(player.posZ)));
|
||||
player,
|
||||
worldObj.provider.dimensionId,
|
||||
new SpaceTeleporter(
|
||||
DimensionManager.getWorld(worldObj.provider.dimensionId),
|
||||
0,
|
||||
MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY), MathHelper.floor_double(player.posZ)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -686,8 +690,7 @@ public class TileEntityReactor extends WarpEnergyTE {
|
|||
|
||||
// If gate is blocked by obstacle
|
||||
if (!isFreePlaceForShip(gateX, gateY, gateZ)) {
|
||||
// Randomize destination coordinates and check for collision with
|
||||
// obstacles around jumpgate
|
||||
// Randomize destination coordinates and check for collision with obstacles around jumpgate
|
||||
// Try to find good place for ship
|
||||
int numTries = 10; // num tries to check for collision
|
||||
boolean placeFound = false;
|
||||
|
@ -826,7 +829,6 @@ public class TileEntityReactor extends WarpEnergyTE {
|
|||
int x = MathHelper.floor_double(entity.posX);
|
||||
int z = MathHelper.floor_double(entity.posZ);
|
||||
// int y = MathHelper.floor_double(entity.posY);
|
||||
final int WOOL_BLOCK_ID = 35;
|
||||
int newY;
|
||||
|
||||
for (newY = 254; newY > 0; newY--) {
|
||||
|
|
|
@ -346,7 +346,7 @@ public class TileEntityShipScanner extends WarpEnergyTE {
|
|||
}
|
||||
|
||||
private void writeNBTToFile(String fileName, NBTTagCompound nbttagcompound) {
|
||||
WarpDrive.print(this + " Filename: " + fileName);
|
||||
WarpDrive.logger.info(this + " Filename: " + fileName);
|
||||
|
||||
try {
|
||||
File file = new File(fileName);
|
||||
|
|
Loading…
Add table
Reference in a new issue