Code cleanup
This commit is contained in:
parent
7fef5df4b3
commit
f95257da75
5 changed files with 10 additions and 13 deletions
|
@ -499,7 +499,6 @@ public class WarpDrive implements LoadingCallback {
|
|||
|
||||
@EventHandler
|
||||
public void onFMLServerStarting(FMLServerStartingEvent event) {
|
||||
WarpDrive.logger.info("onFMLServerStarting");
|
||||
event.registerServerCommand(new CommandGenerate());
|
||||
event.registerServerCommand(new CommandSpace());
|
||||
event.registerServerCommand(new CommandInvisible());
|
||||
|
|
|
@ -64,24 +64,22 @@ public class TileEntityLift extends TileEntityAbstractEnergy {
|
|||
mode = MODE_UP;
|
||||
}
|
||||
|
||||
isEnabled = computerEnabled && isPassableBlock(yCoord + 1)
|
||||
&& isPassableBlock(yCoord + 2)
|
||||
&& isPassableBlock(yCoord - 1)
|
||||
&& isPassableBlock(yCoord - 2);
|
||||
isEnabled = computerEnabled
|
||||
&& isPassableBlock(yCoord + 1)
|
||||
&& isPassableBlock(yCoord + 2)
|
||||
&& isPassableBlock(yCoord - 1)
|
||||
&& isPassableBlock(yCoord - 2);
|
||||
|
||||
if (getEnergyStored() < WarpDriveConfig.LIFT_ENERGY_PER_ENTITY
|
||||
|| !isEnabled) {
|
||||
if (getEnergyStored() < WarpDriveConfig.LIFT_ENERGY_PER_ENTITY || !isEnabled) {
|
||||
mode = MODE_INACTIVE;
|
||||
if (getBlockMetadata() != 0) {
|
||||
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord,
|
||||
0, 2); // disabled
|
||||
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 0, 2); // disabled
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (getBlockMetadata() != mode) {
|
||||
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord,
|
||||
mode, 2); // current mode
|
||||
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, mode, 2); // current mode
|
||||
}
|
||||
|
||||
// Launch a beam: search non-air blocks under lift
|
||||
|
|
|
@ -1024,8 +1024,8 @@ public class JumpSequencer extends AbstractSequencer {
|
|||
// compute explosion strength with a jitter, at least 1 TNT
|
||||
float strength = Math.max(4.0F, collisionStrength / nbExplosions - 2.0F + 2.0F * sourceWorld.rand.nextFloat());
|
||||
|
||||
(atTarget ? targetWorld : sourceWorld).newExplosion((Entity) null, current.x, current.y, current.z, strength, atTarget, atTarget);
|
||||
WarpDrive.logger.info("Ship collision caused explosion at " + current.x + ", " + current.y + ", " + current.z + " with strength " + strength);
|
||||
(atTarget ? targetWorld : sourceWorld).newExplosion(null, current.x, current.y, current.z, strength, atTarget, atTarget);
|
||||
WarpDrive.logger.info("Ship collision caused explosion at " + current.x + " " + current.y + " " + current.z + " with strength " + strength);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Before Width: | Height: | Size: 5 KiB After Width: | Height: | Size: 5 KiB |
Loading…
Reference in a new issue