Moved power configs to settings class, attempting to fix missing config gen

This commit is contained in:
Robert S 2014-04-10 17:29:16 -04:00
parent 79f3fa57e0
commit a90f300602
3 changed files with 95 additions and 93 deletions

View file

@ -11,6 +11,7 @@ import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.util.Icon;
import net.minecraftforge.common.Configuration;
import resonantinduction.core.Reference;
import resonantinduction.core.Settings;
import resonantinduction.electrical.battery.TileEnergyDistribution;
import universalelectricity.api.energy.EnergyStorageHandler;
@ -18,13 +19,12 @@ public class TileSolarPanel extends TileEnergyDistribution
{
@SideOnly(Side.CLIENT)
public static Icon sideIcon, bottomIcon;
@Config(category = "Power", key = "Solor_Panel")
public static long SOLAR_ENERGY = 50;
public TileSolarPanel()
{
super(Material.iron);
energy = new EnergyStorageHandler(SOLAR_ENERGY * 20);
energy = new EnergyStorageHandler(Settings.SOLAR_ENERGY * 20);
ioMap = 728;
textureName = "solarPanel_top";
bounds = new Cuboid(0, 0, 0, 1, 0.3f, 1);
@ -68,7 +68,7 @@ public class TileSolarPanel extends TileEnergyDistribution
{
if (!(this.worldObj.isThundering() || this.worldObj.isRaining()))
{
this.energy.receiveEnergy(SOLAR_ENERGY, true);
this.energy.receiveEnergy(Settings.SOLAR_ENERGY, true);
markDistributionUpdate |= produce() > 0;
}
}

View file

@ -2,6 +2,7 @@ package resonantinduction.mechanical.energy.turbine;
import java.util.List;
import resonantinduction.core.Settings;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.item.Item;
@ -12,16 +13,14 @@ import net.minecraft.world.biome.BiomeGenPlains;
import net.minecraftforge.common.ForgeDirection;
import universalelectricity.api.vector.Vector3;
import calclavia.api.resonantinduction.IBoilHandler;
import calclavia.lib.config.Config;
import calclavia.lib.prefab.vector.Cuboid;
import calclavia.lib.utility.inventory.InventoryUtility;
/**
* The vertical wind turbine collects airflow.
* The horizontal wind turbine collects steam from steam power plants.
/** The vertical wind turbine collects airflow. The horizontal wind turbine collects steam from steam
* power plants.
*
* @author Calclavia
*
*/
* @author Calclavia */
public class TileWindTurbine extends TileMechanicalTurbine
{
private final byte[] openBlockCache = new byte[224];
@ -29,12 +28,12 @@ public class TileWindTurbine extends TileMechanicalTurbine
private float efficiency = 0;
private long windPower = 0;
@Override
public void updateEntity()
{
/**
* Break under storm.
*/
/** Break under storm. */
if (tier == 0 && getDirection().offsetY == 0 && worldObj.isRaining() && worldObj.isThundering() && worldObj.rand.nextFloat() < 0.00000008)
{
InventoryUtility.dropItemStack(worldObj, new Vector3(this), new ItemStack(Block.cloth, 1 + worldObj.rand.nextInt(2)));
@ -43,15 +42,11 @@ public class TileWindTurbine extends TileMechanicalTurbine
return;
}
/**
* Only the primary turbine ticks.
*/
/** Only the primary turbine ticks. */
if (!getMultiBlock().isPrimary())
return;
/**
* If this is a vertical turbine.
*/
/** If this is a vertical turbine. */
if (getDirection().offsetY == 0)
{
maxPower = 3000;
@ -121,6 +116,6 @@ public class TileWindTurbine extends TileMechanicalTurbine
boolean hasBonus = biome instanceof BiomeGenOcean || biome instanceof BiomeGenPlains || biome == BiomeGenBase.river;
float windSpeed = (worldObj.rand.nextFloat() / 8) + (yCoord / 256f) * (hasBonus ? 1.2f : 1) + worldObj.getRainStrength(1.5f);
windPower = (long) Math.min(materialMultiplier * multiblockMultiplier * windSpeed * efficiency, maxPower);
windPower = (long) Math.min(materialMultiplier * multiblockMultiplier * windSpeed * efficiency * Settings.WIND_POWER_RATIO, maxPower * Settings.WIND_POWER_RATIO);
}
}

View file

@ -66,6 +66,13 @@ public class Settings
@Config(category = Configuration.CATEGORY_GENERAL, key = "Levitator Acceleration")
public static double LEVITATOR_ACCELERATION = .02;
@Config(category = "Power", key = "Wind_tubine_Ratio")
public static int WIND_POWER_RATIO = 1;
@Config(category = "Power", key = "Water_tubine_Ratio")
public static int WATER_POWER_RATIO = 1;
@Config(category = "Power", key = "Solor_Panel")
public static long SOLAR_ENERGY = 50;
public static void setModMetadata(ModMetadata metadata, String id, String name)
{
setModMetadata(metadata, id, name, "");