Code cleanup
This commit is contained in:
parent
993825903c
commit
b38886e3de
28 changed files with 37 additions and 51 deletions
|
@ -7,7 +7,6 @@ import cr0s.warpdrive.api.IBlockBase;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.item.EnumRarity;
|
import net.minecraft.item.EnumRarity;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
|
@ -122,7 +122,7 @@ public abstract class BlockAbstractAir extends BlockAbstractBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Item getItemDropped(int metadata, Random random, int fortune) {
|
public Item getItemDropped(final int metadata, final Random random, final int fortune) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ public class BlockAirGenerator extends BlockAbstractContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
return Item.getItemFromBlock(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,7 @@ public class BlockAirGeneratorTiered extends BlockAbstractContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
return Item.getItemFromBlock(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -121,7 +121,7 @@ public class BlockShipScanner extends BlockAbstractContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
return Item.getItemFromBlock(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,11 +89,8 @@ public class BlockLaserTreeFarm extends BlockAbstractContainer {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the item to drop on destruction.
|
|
||||||
*/
|
|
||||||
@Override
|
@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);
|
return Item.getItemFromBlock(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -85,11 +85,8 @@ public class BlockMiningLaser extends BlockAbstractContainer {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the item to drop on destruction.
|
|
||||||
*/
|
|
||||||
@Override
|
@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);
|
return Item.getItemFromBlock(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ public class BlockCamera extends BlockAbstractContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
return Item.getItemFromBlock(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,7 @@ public class BlockRadar extends BlockAbstractContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
return Item.getItemFromBlock(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,23 +35,17 @@ public class BlockWarpIsolation extends Block {
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIcon(int side, int metadata) {
|
public IIcon getIcon(final int side, final int metadata) {
|
||||||
return iconBuffer[0];
|
return iconBuffer[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the quantity of items to drop on block destruction.
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public int quantityDropped(Random par1Random) {
|
public int quantityDropped(final Random random) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the ID of the items to drop on destruction.
|
|
||||||
*/
|
|
||||||
@Override
|
@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);
|
return Item.getItemFromBlock(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -89,7 +89,7 @@ public class BlockLift extends BlockAbstractContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
return Item.getItemFromBlock(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -94,11 +94,8 @@ public class BlockShipController extends BlockAbstractContainer {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the items to drop on destruction.
|
|
||||||
*/
|
|
||||||
@Override
|
@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);
|
return Item.getItemFromBlock(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ public class BlockBedrockGlass extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Item getItemDropped(int var1, Random random, int var3) {
|
public Item getItemDropped(final int metadata, final Random random, final int fortune) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ public class BlockGas extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Item getItemDropped(int var1, Random var2, int var3) {
|
public Item getItemDropped(final int metadata, final Random random, final int fortune) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ public class BlockHighlyAdvancedMachine extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
return Item.getItemFromBlock(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ public class BlockIridium extends Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
return Item.getItemFromBlock(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ public class BlockWeaponController extends BlockAbstractContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
return Item.getItemFromBlock(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -524,7 +524,6 @@ public class AcceleratorSetup extends GlobalPosition {
|
||||||
final int energyMean = amount_internal / energyBanks.size();
|
final int energyMean = amount_internal / energyBanks.size();
|
||||||
int energyConsumed = 0;
|
int energyConsumed = 0;
|
||||||
int energyLeft = amount_internal - energyMean * energyBanks.size();
|
int energyLeft = amount_internal - energyMean * energyBanks.size();
|
||||||
assert(energyConsumed + energyLeft == amount_internal);
|
|
||||||
for (final TileEntityEnergyBank tileEntityEnergyBank : energyBanks) {
|
for (final TileEntityEnergyBank tileEntityEnergyBank : energyBanks) {
|
||||||
final int energyToConsume = Math.min(tileEntityEnergyBank.energy_getPotentialOutput(), energyMean + energyLeft);
|
final int energyToConsume = Math.min(tileEntityEnergyBank.energy_getPotentialOutput(), energyMean + energyLeft);
|
||||||
tileEntityEnergyBank.energy_consume(energyToConsume);
|
tileEntityEnergyBank.energy_consume(energyToConsume);
|
||||||
|
|
|
@ -22,7 +22,7 @@ if #args > 0 then
|
||||||
if args[1] == "help" or args[1] == "?" then
|
if args[1] == "help" or args[1] == "?" then
|
||||||
print("Usage: farm <breakLeaves> <tapTrees> <silktouch>")
|
print("Usage: farm <breakLeaves> <tapTrees> <silktouch>")
|
||||||
print()
|
print()
|
||||||
print("Farmer always farm above it.")
|
print("Farmer always farms above it.")
|
||||||
print("Use 'true' or '1' to enable an option.")
|
print("Use 'true' or '1' to enable an option.")
|
||||||
print("Use 'false' or '0' to disable an option.")
|
print("Use 'false' or '0' to disable an option.")
|
||||||
print("Default is to break leaves and tap rubber trees.")
|
print("Default is to break leaves and tap rubber trees.")
|
||||||
|
@ -81,7 +81,7 @@ if noExit then
|
||||||
local areActive
|
local areActive
|
||||||
repeat
|
repeat
|
||||||
areActive = false
|
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()
|
local status, isActive, energy, totalHarvested, currentValuable, totalValuables = treefarm.state()
|
||||||
|
|
||||||
term.setBackgroundColor(colors.black)
|
term.setBackgroundColor(colors.black)
|
||||||
|
|
|
@ -22,7 +22,7 @@ if #args > 0 then
|
||||||
if args[1] == "help" or args[1] == "?" then
|
if args[1] == "help" or args[1] == "?" then
|
||||||
print("Usage: mine <layerOffset> <onlyOres> <silktouch>")
|
print("Usage: mine <layerOffset> <onlyOres> <silktouch>")
|
||||||
print()
|
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("Set layerOffset to define starting level.")
|
||||||
print("Power consumption will be much lower in space.")
|
print("Power consumption will be much lower in space.")
|
||||||
print("Mining only ores is faster but more expensive...")
|
print("Mining only ores is faster but more expensive...")
|
||||||
|
|
|
@ -96,6 +96,7 @@ function scanAndDraw()
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
radar.radius(radius)
|
radar.radius(radius)
|
||||||
radar.start()
|
radar.start()
|
||||||
local scanDuration = radar.getScanDuration(radius)
|
local scanDuration = radar.getScanDuration(radius)
|
||||||
|
|
|
@ -168,7 +168,7 @@ function transporter_page_writeEnergy(energy)
|
||||||
w.setColorNormal()
|
w.setColorNormal()
|
||||||
w.setCursorPos(19, 8)
|
w.setCursorPos(19, 8)
|
||||||
if energy[2] ~= nil then
|
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
|
else
|
||||||
w.write(w.format_string("???", 20))
|
w.write(w.format_string("???", 20))
|
||||||
end
|
end
|
||||||
|
|
|
@ -34,12 +34,12 @@ local noExit = true
|
||||||
breakLeaves = true
|
breakLeaves = true
|
||||||
tapTrees = true
|
tapTrees = true
|
||||||
silktouch = false
|
silktouch = false
|
||||||
local args = {... }
|
local args = {...}
|
||||||
if #args > 0 then
|
if #args > 0 then
|
||||||
if args[1] == "help" or args[1] == "?" then
|
if args[1] == "help" or args[1] == "?" then
|
||||||
print("Usage: farm <breakLeaves> <tapTrees> <silktouch>")
|
print("Usage: farm <breakLeaves> <tapTrees> <silktouch>")
|
||||||
print()
|
print()
|
||||||
print("Farmer always farm above it.")
|
print("Farmer always farms above it.")
|
||||||
print("Use 'true' or '1' to enable an option.")
|
print("Use 'true' or '1' to enable an option.")
|
||||||
print("Use 'false' or '0' to disable an option.")
|
print("Use 'false' or '0' to disable an option.")
|
||||||
print("Default is to break leaves and tap rubber trees.")
|
print("Default is to break leaves and tap rubber trees.")
|
||||||
|
@ -69,6 +69,7 @@ end
|
||||||
if #treefarms == 0 then
|
if #treefarms == 0 then
|
||||||
computer.beep()
|
computer.beep()
|
||||||
textOut(1, 2, "No laser tree farm detected", 0xFFFFFF, 0xFF0000)
|
textOut(1, 2, "No laser tree farm detected", 0xFFFFFF, 0xFF0000)
|
||||||
|
|
||||||
noExit = false
|
noExit = false
|
||||||
end
|
end
|
||||||
if noExit then
|
if noExit then
|
||||||
|
|
|
@ -39,7 +39,7 @@ if #args > 0 then
|
||||||
if args[1] == "help" or args[1] == "?" then
|
if args[1] == "help" or args[1] == "?" then
|
||||||
print("Usage: mine <layerOffset> <onlyOres> <silktouch>")
|
print("Usage: mine <layerOffset> <onlyOres> <silktouch>")
|
||||||
print()
|
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("Set layerOffset to define starting level.")
|
||||||
print("Power consumption will be much lower in space.")
|
print("Power consumption will be much lower in space.")
|
||||||
print("Mining only ores is faster but more expensive...")
|
print("Mining only ores is faster but more expensive...")
|
||||||
|
|
|
@ -31,6 +31,7 @@ local argv = { ... }
|
||||||
if #argv ~= 1 then
|
if #argv ~= 1 then
|
||||||
showErrorAndExit("Usage: ping <scanRadius>")
|
showErrorAndExit("Usage: ping <scanRadius>")
|
||||||
end
|
end
|
||||||
|
|
||||||
local radius = tonumber(argv[1])
|
local radius = tonumber(argv[1])
|
||||||
|
|
||||||
if radius < 1 or radius > 9999 then
|
if radius < 1 or radius > 9999 then
|
||||||
|
|
|
@ -167,7 +167,7 @@ function transporter_page_writeEnergy(energy)
|
||||||
w.setColorNormal()
|
w.setColorNormal()
|
||||||
w.setCursorPos(19, 8)
|
w.setCursorPos(19, 8)
|
||||||
if energy[2] ~= nil then
|
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
|
else
|
||||||
w.write(w.format_string("???", 20))
|
w.write(w.format_string("???", 20))
|
||||||
end
|
end
|
||||||
|
@ -182,7 +182,7 @@ function transporter_page_writeLockStrength(lockStrength)
|
||||||
else
|
else
|
||||||
w.setColorWarning()
|
w.setColorWarning()
|
||||||
end
|
end
|
||||||
w.write(w.format_float(percent) .. " %")
|
w.write(w.format_float(percent) .. " % ")
|
||||||
else
|
else
|
||||||
w.setColorDisabled()
|
w.setColorDisabled()
|
||||||
w.write(w.format_string("-none-", 7))
|
w.write(w.format_string("-none-", 7))
|
||||||
|
|
|
@ -28,7 +28,7 @@ function laser_save(parData)
|
||||||
data.laser_stations[keyStation] = {
|
data.laser_stations[keyStation] = {
|
||||||
name = laserstation.name,
|
name = laserstation.name,
|
||||||
cameraAddress = laserstation.cameraAddress,
|
cameraAddress = laserstation.cameraAddress,
|
||||||
batteries = {}}
|
batteries = {} }
|
||||||
for keyBattery, laserbattery in pairs(laser_stations[keyStation].batteries) do
|
for keyBattery, laserbattery in pairs(laser_stations[keyStation].batteries) do
|
||||||
data.laser_stations[keyStation].batteries[keyBattery] = {
|
data.laser_stations[keyStation].batteries[keyBattery] = {
|
||||||
name = laserbattery.name,
|
name = laserbattery.name,
|
||||||
|
|
Loading…
Reference in a new issue