Code cleanup

This commit is contained in:
Unknown 2018-05-01 21:17:27 +02:00 committed by unknown
parent 993825903c
commit b38886e3de
28 changed files with 37 additions and 51 deletions

View file

@ -7,7 +7,6 @@ import cr0s.warpdrive.api.IBlockBase;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;

View file

@ -122,7 +122,7 @@ public abstract class BlockAbstractAir extends BlockAbstractBase {
}
@Override
public Item getItemDropped(int metadata, Random random, int fortune) {
public Item getItemDropped(final int metadata, final Random random, final int fortune) {
return null;
}

View file

@ -87,7 +87,7 @@ public class BlockAirGenerator extends BlockAbstractContainer {
}
@Override
public Item getItemDropped(int par1, Random par2Random, int par3) {
public Item getItemDropped(final int metadata, final Random random, final int fortune) {
return Item.getItemFromBlock(this);
}

View file

@ -85,7 +85,7 @@ public class BlockAirGeneratorTiered extends BlockAbstractContainer {
}
@Override
public Item getItemDropped(int metadata, Random random, int fortune) {
public Item getItemDropped(final int metadata, final Random random, final int fortune) {
return Item.getItemFromBlock(this);
}

View file

@ -121,7 +121,7 @@ public class BlockShipScanner extends BlockAbstractContainer {
}
@Override
public Item getItemDropped(int par1, Random par2Random, int par3) {
public Item getItemDropped(final int metadata, final Random random, final int fortune) {
return Item.getItemFromBlock(this);
}

View file

@ -89,11 +89,8 @@ public class BlockLaserTreeFarm extends BlockAbstractContainer {
return 1;
}
/**
* Returns the item to drop on destruction.
*/
@Override
public Item getItemDropped(int par1, Random random, int par3) {
public Item getItemDropped(final int metadata, final Random random, final int fortune) {
return Item.getItemFromBlock(this);
}

View file

@ -85,11 +85,8 @@ public class BlockMiningLaser extends BlockAbstractContainer {
return 1;
}
/**
* Returns the item to drop on destruction.
*/
@Override
public Item getItemDropped(int par1, Random random, int par3) {
public Item getItemDropped(final int metadata, final Random random, final int fortune) {
return Item.getItemFromBlock(this);
}

View file

@ -64,7 +64,7 @@ public class BlockCamera extends BlockAbstractContainer {
}
@Override
public Item getItemDropped(int par1, Random par2Random, int par3) {
public Item getItemDropped(final int metadata, final Random random, final int fortune) {
return Item.getItemFromBlock(this);
}

View file

@ -90,7 +90,7 @@ public class BlockRadar extends BlockAbstractContainer {
}
@Override
public Item getItemDropped(int par1, Random par2Random, int par3) {
public Item getItemDropped(final int metadata, final Random random, final int fortune) {
return Item.getItemFromBlock(this);
}

View file

@ -35,23 +35,17 @@ public class BlockWarpIsolation extends Block {
@SideOnly(Side.CLIENT)
@Override
public IIcon getIcon(int side, int metadata) {
public IIcon getIcon(final int side, final int metadata) {
return iconBuffer[0];
}
/**
* Returns the quantity of items to drop on block destruction.
*/
@Override
public int quantityDropped(Random par1Random) {
public int quantityDropped(final Random random) {
return 1;
}
/**
* Returns the ID of the items to drop on destruction.
*/
@Override
public Item getItemDropped(int par1, Random par2Random, int par3) {
return Item.getItemFromBlock(this);
public Item getItemDropped(final int metadata, final Random random, final int fortune) {
return Item.getItemFromBlock(this);
}
}

View file

@ -89,7 +89,7 @@ public class BlockLift extends BlockAbstractContainer {
}
@Override
public Item getItemDropped(int par1, Random par2Random, int par3) {
public Item getItemDropped(final int metadata, final Random random, final int fortune) {
return Item.getItemFromBlock(this);
}

View file

@ -94,11 +94,8 @@ public class BlockShipController extends BlockAbstractContainer {
return 1;
}
/**
* Returns the items to drop on destruction.
*/
@Override
public Item getItemDropped(int par1, Random par2Random, int par3) {
public Item getItemDropped(final int metadata, final Random random, final int fortune) {
return Item.getItemFromBlock(this);
}

View file

@ -77,7 +77,7 @@ public class BlockBedrockGlass extends Block {
}
@Override
public Item getItemDropped(int var1, Random random, int var3) {
public Item getItemDropped(final int metadata, final Random random, final int fortune) {
return null;
}

View file

@ -104,7 +104,7 @@ public class BlockGas extends Block {
}
@Override
public Item getItemDropped(int var1, Random var2, int var3) {
public Item getItemDropped(final int metadata, final Random random, final int fortune) {
return null;
}

View file

@ -29,7 +29,7 @@ public class BlockHighlyAdvancedMachine extends Block {
}
@Override
public Item getItemDropped(int var1, Random var2, int var3) {
public Item getItemDropped(final int metadata, final Random random, final int fortune) {
return Item.getItemFromBlock(this);
}

View file

@ -30,7 +30,7 @@ public class BlockIridium extends Block {
}
@Override
public Item getItemDropped(int var1, Random var2, int var3) {
public Item getItemDropped(final int metadata, final Random random, final int fortune) {
return Item.getItemFromBlock(this);
}

View file

@ -65,7 +65,7 @@ public class BlockWeaponController extends BlockAbstractContainer {
}
@Override
public Item getItemDropped(int par1, Random par2Random, int par3) {
public Item getItemDropped(final int metadata, final Random random, final int fortune) {
return Item.getItemFromBlock(this);
}

View file

@ -524,7 +524,6 @@ public class AcceleratorSetup extends GlobalPosition {
final int energyMean = amount_internal / energyBanks.size();
int energyConsumed = 0;
int energyLeft = amount_internal - energyMean * energyBanks.size();
assert(energyConsumed + energyLeft == amount_internal);
for (final TileEntityEnergyBank tileEntityEnergyBank : energyBanks) {
final int energyToConsume = Math.min(tileEntityEnergyBank.energy_getPotentialOutput(), energyMean + energyLeft);
tileEntityEnergyBank.energy_consume(energyToConsume);

View file

@ -22,7 +22,7 @@ if #args > 0 then
if args[1] == "help" or args[1] == "?" then
print("Usage: farm <breakLeaves> <tapTrees> <silktouch>")
print()
print("Farmer always farm above it.")
print("Farmer always farms above it.")
print("Use 'true' or '1' to enable an option.")
print("Use 'false' or '0' to disable an option.")
print("Default is to break leaves and tap rubber trees.")
@ -81,7 +81,7 @@ if noExit then
local areActive
repeat
areActive = false
for key,treefarm in pairs(treefarms) do
for key, treefarm in pairs(treefarms) do
local status, isActive, energy, totalHarvested, currentValuable, totalValuables = treefarm.state()
term.setBackgroundColor(colors.black)

View file

@ -22,7 +22,7 @@ if #args > 0 then
if args[1] == "help" or args[1] == "?" then
print("Usage: mine <layerOffset> <onlyOres> <silktouch>")
print()
print("Miner always mine below it, down to bedrock.")
print("Miner always mines below it, down to bedrock.")
print("Set layerOffset to define starting level.")
print("Power consumption will be much lower in space.")
print("Mining only ores is faster but more expensive...")

View file

@ -96,6 +96,7 @@ function scanAndDraw()
return 0
end
radar.radius(radius)
radar.start()
local scanDuration = radar.getScanDuration(radius)

View file

@ -168,7 +168,7 @@ function transporter_page_writeEnergy(energy)
w.setColorNormal()
w.setCursorPos(19, 8)
if energy[2] ~= nil then
w.write(w.format_integer(energy[1], 7) .. " / " .. energy[2] .. " EU ")
w.write(w.format_integer(energy[1], 7) .. " / " .. energy[2] .. " EU ")
else
w.write(w.format_string("???", 20))
end
@ -287,7 +287,7 @@ function transporter_config()
remoteLocation[2] = "0";
remoteLocation[3] = "0";
end
w.setColorNormal()
w.setCursorPos(1, 11)
w.writeFullLine(" ")

View file

@ -34,12 +34,12 @@ local noExit = true
breakLeaves = true
tapTrees = true
silktouch = false
local args = {... }
local args = {...}
if #args > 0 then
if args[1] == "help" or args[1] == "?" then
print("Usage: farm <breakLeaves> <tapTrees> <silktouch>")
print()
print("Farmer always farm above it.")
print("Farmer always farms above it.")
print("Use 'true' or '1' to enable an option.")
print("Use 'false' or '0' to disable an option.")
print("Default is to break leaves and tap rubber trees.")
@ -69,6 +69,7 @@ end
if #treefarms == 0 then
computer.beep()
textOut(1, 2, "No laser tree farm detected", 0xFFFFFF, 0xFF0000)
noExit = false
end
if noExit then

View file

@ -39,7 +39,7 @@ if #args > 0 then
if args[1] == "help" or args[1] == "?" then
print("Usage: mine <layerOffset> <onlyOres> <silktouch>")
print()
print("Miner always mine below it, down to bedrock.")
print("Miner always mines below it, down to bedrock.")
print("Set layerOffset to define starting level.")
print("Power consumption will be much lower in space.")
print("Mining only ores is faster but more expensive...")

View file

@ -31,6 +31,7 @@ local argv = { ... }
if #argv ~= 1 then
showErrorAndExit("Usage: ping <scanRadius>")
end
local radius = tonumber(argv[1])
if radius < 1 or radius > 9999 then

View file

@ -157,4 +157,4 @@ while component.isAvailable("warpdriveRadar") and continue do
os.sleep(0)
end
term.clear()
term.clear()

View file

@ -167,7 +167,7 @@ function transporter_page_writeEnergy(energy)
w.setColorNormal()
w.setCursorPos(19, 8)
if energy[2] ~= nil then
w.write(w.format_integer(energy[1], 7) .. " / " .. energy[2] .. " EU")
w.write(w.format_integer(energy[1], 7) .. " / " .. energy[2] .. " EU ")
else
w.write(w.format_string("???", 20))
end
@ -182,7 +182,7 @@ function transporter_page_writeLockStrength(lockStrength)
else
w.setColorWarning()
end
w.write(w.format_float(percent) .. " %")
w.write(w.format_float(percent) .. " % ")
else
w.setColorDisabled()
w.write(w.format_string("-none-", 7))
@ -286,7 +286,7 @@ function transporter_config()
remoteLocation[2] = "0";
remoteLocation[3] = "0";
end
w.setColorNormal()
w.setCursorPos(1, 11)
w.writeFullLine(" ")

View file

@ -28,7 +28,7 @@ function laser_save(parData)
data.laser_stations[keyStation] = {
name = laserstation.name,
cameraAddress = laserstation.cameraAddress,
batteries = {}}
batteries = {} }
for keyBattery, laserbattery in pairs(laser_stations[keyStation].batteries) do
data.laser_stations[keyStation].batteries[keyBattery] = {
name = laserbattery.name,