Code cleanup

This commit is contained in:
LemADEC 2017-05-29 15:51:22 +02:00
parent a06b6a441b
commit 638787d140
6 changed files with 18 additions and 13 deletions

View file

@ -17,6 +17,7 @@ import cpw.mods.fml.common.Optional;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityAirGenerator extends TileEntityAbstractEnergy {
private int cooldownTicks = 0;
private boolean isEnabled = true;
private static final int START_CONCENTRATION_VALUE = 15;
@ -99,15 +100,15 @@ public class TileEntityAirGenerator extends TileEntityAbstractEnergy {
}
@Override
public void readFromNBT(NBTTagCompound tag) {
super.readFromNBT(tag);
isEnabled = tag.getBoolean("isEnabled");
public void readFromNBT(final NBTTagCompound tagCompound) {
super.readFromNBT(tagCompound);
isEnabled = tagCompound.getBoolean("isEnabled");
}
@Override
public void writeToNBT(NBTTagCompound tag) {
super.writeToNBT(tag);
tag.setBoolean("isEnabled", isEnabled);
public void writeToNBT(final NBTTagCompound tagCompound) {
super.writeToNBT(tagCompound);
tagCompound.setBoolean("isEnabled", isEnabled);
}
@Override
@ -128,6 +129,7 @@ public class TileEntityAirGenerator extends TileEntityAbstractEnergy {
xCoord, yCoord, zCoord);
}
// Common OC/CC methods
public Object[] enable(Object[] arguments) {
if (arguments.length == 1) {
isEnabled = Commons.toBool(arguments[0]);
@ -149,8 +151,8 @@ public class TileEntityAirGenerator extends TileEntityAbstractEnergy {
String methodName = getMethodName(method);
switch (methodName) {
case "enable":
return enable(arguments);
case "enable":
return enable(arguments);
}
return super.callMethod(computer, context, method, arguments);

View file

@ -29,6 +29,7 @@ import net.minecraftforge.common.IPlantable;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityLaserTreeFarm extends TileEntityAbstractMiner {
private boolean breakLeaves = false;
private boolean tapTrees = false;

View file

@ -25,6 +25,7 @@ import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidRegistry;
public class TileEntityMiningLaser extends TileEntityAbstractMiner {
private final boolean canSilktouch = (WarpDriveConfig.MINING_LASER_SILKTOUCH_DEUTERIUM_L <= 0 || FluidRegistry.isFluidRegistered("deuterium"));
private boolean isActive() {

View file

@ -11,6 +11,7 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class TileEntitySiren extends TileEntityAbstractBase {
public enum SirenState {
STARTING, STARTED, STOPPING, STOPPED
}

View file

@ -134,13 +134,13 @@ public class TileEntityEnanReactorLaser extends TileEntityAbstractLaser {
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
public void writeToNBT(final NBTTagCompound tagCompound) {
super.writeToNBT(tagCompound);
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
public void readFromNBT(final NBTTagCompound tagCompound) {
super.readFromNBT(tagCompound);
}
// OpenComputers callback methods

View file

@ -47,7 +47,7 @@ public class CompatSGCraft implements IBlockTransformer {
Object object = methodSGBaseTE_sgStateDescription.invoke(tileEntity);
String state = (String)object;
if (!state.equalsIgnoreCase("Idle")) {
reason.append("Stargate is active (" + state + ")!");
reason.append(String.format("Stargate is active (%s)!", state));
return false;
}
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException exception) {