mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-25 14:24:35 +00:00
v5.5.6 Beta #18
*Robit GUI closes when "go home" called. *Refactor multiblock inventory system to use only 1 map. *Better-balanced recipes. *Metallurgic Infuser now has a purple side by default. *Configurable generation for MekanismGenerators. *isAirBlock() instead of explicit id == 0 check. *doubles instead of ints.
This commit is contained in:
1 parent
b80172da4c
commit
a51050e30f
17 files changed
+68
-81
No files matched your search
@@ -295,6 +295,7 @@ public class GuiRobitMain extends GuiContainer
|
||||
{
|
||||
mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F);
|
||||
PacketHandler.sendPacket(Transmission.SERVER, new PacketRobit().setParams(RobitPacketType.GO_HOME, robit.entityId));
|
||||
mc.displayGuiScreen(null);
|
||||
}
|
||||
else if(xAxis >= 6 && xAxis <= 24 && yAxis >= 35 && yAxis <= 53)
|
||||
{
|
||||
|
||||
@@ -7,9 +7,7 @@ import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
|
||||
import mekanism.api.Object3D;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.common.ITickHandler;
|
||||
import cpw.mods.fml.common.TickType;
|
||||
@@ -34,11 +32,11 @@ public class CommonWorldTickHandler implements ITickHandler
|
||||
|
||||
if(!world.isRemote)
|
||||
{
|
||||
for(Map.Entry<Integer, HashSet<Object3D>> entry : Mekanism.inventoryLocations.entrySet())
|
||||
for(Map.Entry<Integer, DynamicTankCache> entry : Mekanism.dynamicInventories.entrySet())
|
||||
{
|
||||
int inventoryID = entry.getKey();
|
||||
|
||||
for(Object3D obj : entry.getValue())
|
||||
for(Object3D obj : entry.getValue().locations)
|
||||
{
|
||||
if(obj.dimensionId == world.provider.dimensionId)
|
||||
{
|
||||
@@ -56,7 +54,7 @@ public class CommonWorldTickHandler implements ITickHandler
|
||||
}
|
||||
}
|
||||
|
||||
if(entry.getValue().isEmpty())
|
||||
if(entry.getValue().locations.isEmpty())
|
||||
{
|
||||
idsToKill.add(inventoryID);
|
||||
}
|
||||
@@ -66,13 +64,13 @@ public class CommonWorldTickHandler implements ITickHandler
|
||||
{
|
||||
for(Object3D obj : entry.getValue())
|
||||
{
|
||||
Mekanism.inventoryLocations.get(entry.getKey()).remove(obj);
|
||||
Mekanism.dynamicInventories.get(entry.getKey()).locations.remove(obj);
|
||||
}
|
||||
}
|
||||
|
||||
for(int inventoryID : idsToKill)
|
||||
{
|
||||
for(Object3D obj : Mekanism.inventoryLocations.get(inventoryID))
|
||||
for(Object3D obj : Mekanism.dynamicInventories.get(inventoryID).locations)
|
||||
{
|
||||
TileEntityDynamicTank dynamicTank = (TileEntityDynamicTank)obj.getTileEntity(world);
|
||||
|
||||
@@ -84,7 +82,6 @@ public class CommonWorldTickHandler implements ITickHandler
|
||||
}
|
||||
}
|
||||
|
||||
Mekanism.inventoryLocations.remove(inventoryID);
|
||||
Mekanism.dynamicInventories.remove(inventoryID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package mekanism.common;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
import mekanism.api.Object3D;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
|
||||
@@ -7,4 +10,6 @@ public class DynamicTankCache
|
||||
{
|
||||
public ItemStack[] inventory = new ItemStack[2];
|
||||
public LiquidStack liquid;
|
||||
|
||||
public HashSet<Object3D> locations = new HashSet<Object3D>();
|
||||
}
|
||||
@@ -110,9 +110,6 @@ public class Mekanism
|
||||
/** A map containing references to all dynamic tank inventory caches. */
|
||||
public static Map<Integer, DynamicTankCache> dynamicInventories = new HashMap<Integer, DynamicTankCache>();
|
||||
|
||||
/** A map containing references to all locations corresponding to a specific inventory ID. */
|
||||
public static Map<Integer, HashSet<Object3D>> inventoryLocations = new HashMap<Integer, HashSet<Object3D>>();
|
||||
|
||||
/** Mekanism creative tab */
|
||||
public static CreativeTabMekanism tabMekanism = new CreativeTabMekanism();
|
||||
|
||||
@@ -344,13 +341,13 @@ public class Mekanism
|
||||
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(Transmitter, 8, 2), new Object[] {
|
||||
"OBO", Character.valueOf('O'), "ingotOsmium", Character.valueOf('B'), Item.bucketEmpty
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(BasicBlock, 4, 9), new Object[] {
|
||||
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(BasicBlock, 8, 9), new Object[] {
|
||||
" I ", "ISI", " I ", Character.valueOf('I'), "ingotSteel", Character.valueOf('S'), Block.cobblestone
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(BasicBlock, 4, 10), new Object[] {
|
||||
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(BasicBlock, 8, 10), new Object[] {
|
||||
" I ", "IGI", " I ", Character.valueOf('I'), "ingotSteel", Character.valueOf('G'), Block.glass
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(BasicBlock, 1, 11), new Object[] {
|
||||
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(BasicBlock, 2, 11), new Object[] {
|
||||
" I ", "ICI", " I ", Character.valueOf('I'), "ingotSteel", Character.valueOf('C'), ControlCircuit
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(MachineBlock, 1, 14), new Object[] {
|
||||
@@ -1066,7 +1063,7 @@ public class Mekanism
|
||||
|
||||
//Registrations
|
||||
EntityRegistry.registerModEntity(EntityObsidianTNT.class, "ObsidianTNT", 0, this, 40, 5, true);
|
||||
EntityRegistry.registerModEntity(EntityRobit.class, "Robit", 1, this, 40, 5, true);
|
||||
EntityRegistry.registerModEntity(EntityRobit.class, "Robit", 1, this, 40, 2, true);
|
||||
|
||||
//Tile entities
|
||||
GameRegistry.registerTileEntity(TileEntityEnergyCube.class, "EnergyCube");
|
||||
@@ -1090,7 +1087,6 @@ public class Mekanism
|
||||
{
|
||||
teleporters.clear();
|
||||
dynamicInventories.clear();
|
||||
inventoryLocations.clear();
|
||||
}
|
||||
|
||||
@PreInit
|
||||
|
||||
@@ -764,9 +764,8 @@ public final class MekanismUtils
|
||||
public static DynamicTankCache pullInventory(World world, int id)
|
||||
{
|
||||
DynamicTankCache toReturn = Mekanism.dynamicInventories.get(id);
|
||||
Mekanism.dynamicInventories.remove(id);
|
||||
|
||||
for(Object3D obj : Mekanism.inventoryLocations.get(id))
|
||||
for(Object3D obj : Mekanism.dynamicInventories.get(id).locations)
|
||||
{
|
||||
TileEntityDynamicTank tileEntity = (TileEntityDynamicTank)obj.getTileEntity(world);
|
||||
|
||||
@@ -778,7 +777,7 @@ public final class MekanismUtils
|
||||
}
|
||||
}
|
||||
|
||||
Mekanism.inventoryLocations.remove(id);
|
||||
Mekanism.dynamicInventories.remove(id);
|
||||
|
||||
return toReturn;
|
||||
}
|
||||
@@ -797,34 +796,17 @@ public final class MekanismUtils
|
||||
DynamicTankCache cache = new DynamicTankCache();
|
||||
cache.inventory = inventory;
|
||||
cache.liquid = liquid;
|
||||
cache.locations.add(Object3D.get(tileEntity));
|
||||
|
||||
Mekanism.dynamicInventories.put(inventoryID, cache);
|
||||
|
||||
HashSet<Object3D> set = new HashSet<Object3D>();
|
||||
set.add(Object3D.get(tileEntity));
|
||||
|
||||
Mekanism.inventoryLocations.put(inventoryID, set);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Mekanism.dynamicInventories.get(inventoryID).inventory = inventory;
|
||||
Mekanism.dynamicInventories.get(inventoryID).liquid = liquid;
|
||||
|
||||
if(!Mekanism.inventoryLocations.containsKey(inventoryID))
|
||||
{
|
||||
HashSet<Object3D> set = new HashSet<Object3D>();
|
||||
set.add(Object3D.get(tileEntity));
|
||||
|
||||
Mekanism.inventoryLocations.put(inventoryID, set);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if(!Mekanism.inventoryLocations.get(inventoryID).contains(Object3D.get(tileEntity)))
|
||||
{
|
||||
Mekanism.inventoryLocations.get(inventoryID).add(Object3D.get(tileEntity));
|
||||
}
|
||||
Mekanism.dynamicInventories.get(inventoryID).locations.add(Object3D.get(tileEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -259,7 +259,7 @@ public class TankUpdateProtocol
|
||||
*/
|
||||
private boolean isAir(int x, int y, int z)
|
||||
{
|
||||
return pointer.worldObj.getBlockId(x, y, z) == 0;
|
||||
return pointer.worldObj.isAirBlock(x, y, z);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -89,7 +89,7 @@ public class TileEntityMetallurgicInfuser extends TileEntityElectricBlock implem
|
||||
sideOutputs.add(new SideData(EnumColor.DARK_BLUE, 3, 1, new int[] {3}));
|
||||
sideOutputs.add(new SideData(EnumColor.DARK_GREEN, 4, 1, new int[] {4}));
|
||||
|
||||
sideConfig = new byte[] {0, 1, 0, 5, 3, 4};
|
||||
sideConfig = new byte[] {2, 1, 0, 5, 3, 4};
|
||||
|
||||
inventory = new ItemStack[5];
|
||||
}
|
||||
|
||||
@@ -2,17 +2,17 @@ package mekanism.generators.client;
|
||||
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.generators.common.ContainerWindTurbine;
|
||||
import mekanism.generators.common.MekanismGenerators;
|
||||
import mekanism.generators.common.TileEntityWindTurbine;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import universalelectricity.core.electricity.ElectricityDisplay;
|
||||
import universalelectricity.core.electricity.ElectricityDisplay.ElectricUnit;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiWindTurbine extends GuiContainer
|
||||
@@ -37,7 +37,7 @@ public class GuiWindTurbine extends GuiContainer
|
||||
fontRenderer.drawString(tileEntity.fullName, 45, 6, 0x404040);
|
||||
fontRenderer.drawString("Inventory", 8, (ySize - 96) + 2, 0x404040);
|
||||
fontRenderer.drawString(ElectricityDisplay.getDisplayShort(tileEntity.electricityStored, ElectricUnit.JOULES), 51, 26, 0x00CD00);
|
||||
fontRenderer.drawString("Power: " + tileEntity.GENERATION_RATE*tileEntity.getMultiplier(), 51, 35, 0x00CD00);
|
||||
fontRenderer.drawString("Power: " + MekanismGenerators.windGeneration*tileEntity.getMultiplier(), 51, 35, 0x00CD00);
|
||||
fontRenderer.drawString(tileEntity.getVoltage() + "v", 51, 44, 0x00CD00);
|
||||
|
||||
int size = 44;
|
||||
|
||||
@@ -5,6 +5,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.Configuration;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
/**
|
||||
@@ -39,6 +40,12 @@ public class GeneratorsCommonProxy
|
||||
{
|
||||
Mekanism.configuration.load();
|
||||
MekanismGenerators.generatorID = Mekanism.configuration.getBlock("Generator", 3010).getInt();
|
||||
MekanismGenerators.advancedSolarGeneration = Mekanism.configuration.get("generation", "AdvancedSolarGeneration", 180).getDouble(180);
|
||||
MekanismGenerators.bioGeneration = Mekanism.configuration.get("generation", "BioGeneration", 120).getDouble(120);
|
||||
MekanismGenerators.heatGeneration = Mekanism.configuration.get("generation", "HeatGeneration", 100).getDouble(100);
|
||||
MekanismGenerators.hydrogenGeneration = Mekanism.configuration.get("generation", "HydrogenGeneration", 300).getDouble(300);
|
||||
MekanismGenerators.solarGeneration = Mekanism.configuration.get("generation", "SolarGeneration", 30).getDouble(30);
|
||||
MekanismGenerators.windGeneration = Mekanism.configuration.get("generation", "WindGeneration", 30).getDouble(30);
|
||||
Mekanism.configuration.save();
|
||||
}
|
||||
|
||||
|
||||
@@ -53,6 +53,14 @@ public class MekanismGenerators implements IModule
|
||||
//Block IDs
|
||||
public static int generatorID = 3005;
|
||||
|
||||
//Configuration
|
||||
public static double advancedSolarGeneration;
|
||||
public static double bioGeneration;
|
||||
public static double heatGeneration;
|
||||
public static double hydrogenGeneration;
|
||||
public static double solarGeneration;
|
||||
public static double windGeneration;
|
||||
|
||||
@PreInit
|
||||
public void preInit(FMLPreInitializationEvent event)
|
||||
{
|
||||
@@ -100,7 +108,7 @@ public class MekanismGenerators implements IModule
|
||||
"SES", "SES", "III", Character.valueOf('S'), new ItemStack(Generator, 1, 1), Character.valueOf('E'), Mekanism.EnrichedAlloy, Character.valueOf('I'), Item.ingotIron
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(Generator, 1, 4), new Object[] {
|
||||
"RER", "BIB", "NEN", Character.valueOf('R'), Item.redstone, Character.valueOf('E'), Mekanism.EnrichedAlloy, Character.valueOf('B'), BioFuel, Character.valueOf('I'), new ItemStack(Mekanism.BasicBlock, 1, 8), Character.valueOf('N'), Item.ingotIron
|
||||
"RER", "BCB", "NEN", Character.valueOf('R'), Item.redstone, Character.valueOf('E'), Mekanism.EnrichedAlloy, Character.valueOf('B'), BioFuel, Character.valueOf('C'), Mekanism.ControlCircuit, Character.valueOf('N'), Item.ingotIron
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(Generator, 1, 2), new Object[] {
|
||||
"IRI", "ECE", "IRI", Character.valueOf('I'), Item.ingotIron, Character.valueOf('R'), Item.redstone, Character.valueOf('E'), Mekanism.EnrichedAlloy, Character.valueOf('C'), ElectrolyticCore
|
||||
@@ -115,7 +123,7 @@ public class MekanismGenerators implements IModule
|
||||
"GGG", "RAR", "PPP", Character.valueOf('G'), Block.thinGlass, Character.valueOf('R'), Item.redstone, Character.valueOf('A'), Mekanism.EnrichedAlloy, Character.valueOf('P'), "ingotOsmium"
|
||||
}));
|
||||
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(Generator, 1, 6), new Object[] {
|
||||
" O ", "OTO", "ECE", Character.valueOf('O'), "ingotOsmium", Character.valueOf('T'), new ItemStack(Mekanism.BasicBlock, 1, 8), Character.valueOf('E'), Mekanism.EnergyTablet.getUnchargedItem(), Character.valueOf('C'), Mekanism.ControlCircuit
|
||||
" O ", "OAO", "ECE", Character.valueOf('O'), "ingotOsmium", Character.valueOf('A'), Mekanism.EnrichedAlloy, Character.valueOf('E'), Mekanism.EnergyTablet.getUnchargedItem(), Character.valueOf('C'), Mekanism.ControlCircuit
|
||||
}));
|
||||
|
||||
//BioFuel Crusher Recipes
|
||||
|
||||
@@ -8,7 +8,7 @@ public class TileEntityAdvancedSolarGenerator extends TileEntitySolarGenerator i
|
||||
{
|
||||
public TileEntityAdvancedSolarGenerator()
|
||||
{
|
||||
super("Advanced Solar Generator", 200000, 360, 180);
|
||||
super("Advanced Solar Generator", 200000, 360, MekanismGenerators.advancedSolarGeneration);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -37,9 +37,6 @@ public class TileEntityBioGenerator extends TileEntityGenerator implements ITank
|
||||
/** Where the crush piston should be on the model. */
|
||||
public float crushMatrix = 0;
|
||||
|
||||
/** The amount of electricity this machine can produce with a unit of fuel. */
|
||||
public final int GENERATION = 120;
|
||||
|
||||
/** The LiquidSlot biofuel instance for this generator. */
|
||||
public LiquidSlot bioFuelSlot = new LiquidSlot(24000, Mekanism.hooks.ForestryBiofuelID);
|
||||
|
||||
@@ -48,7 +45,7 @@ public class TileEntityBioGenerator extends TileEntityGenerator implements ITank
|
||||
|
||||
public TileEntityBioGenerator()
|
||||
{
|
||||
super("Bio-Generator", 160000, 240);
|
||||
super("Bio-Generator", 160000, MekanismGenerators.bioGeneration*2);
|
||||
inventory = new ItemStack[2];
|
||||
|
||||
if(Mekanism.hooks.ForestryLoaded)
|
||||
@@ -148,7 +145,7 @@ public class TileEntityBioGenerator extends TileEntityGenerator implements ITank
|
||||
setActive(true);
|
||||
}
|
||||
bioFuelSlot.setLiquid(bioFuelSlot.liquidStored - 1);
|
||||
setEnergy(electricityStored + GENERATION);
|
||||
setEnergy(electricityStored + MekanismGenerators.bioGeneration);
|
||||
}
|
||||
else {
|
||||
if(!worldObj.isRemote)
|
||||
@@ -197,7 +194,7 @@ public class TileEntityBioGenerator extends TileEntityGenerator implements ITank
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnvironmentBoost()
|
||||
public double getEnvironmentBoost()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ import dan200.computer.api.IPeripheral;
|
||||
public abstract class TileEntityGenerator extends TileEntityElectricBlock implements IEnergySource, IEnergyStorage, IPowerReceptor, IPeripheral, IActiveState, IHasSound, ICableOutputter
|
||||
{
|
||||
/** Output per tick this generator can transfer. */
|
||||
public int output;
|
||||
public double output;
|
||||
|
||||
/** Whether or not this block is in it's active state. */
|
||||
public boolean isActive;
|
||||
@@ -58,7 +58,7 @@ public abstract class TileEntityGenerator extends TileEntityElectricBlock implem
|
||||
* @param maxEnergy - how much energy this generator can store
|
||||
* @param maxFuel - how much fuel this generator can store
|
||||
*/
|
||||
public TileEntityGenerator(String name, int maxEnergy, int out)
|
||||
public TileEntityGenerator(String name, double maxEnergy, double out)
|
||||
{
|
||||
super(name, maxEnergy);
|
||||
|
||||
@@ -164,7 +164,7 @@ public abstract class TileEntityGenerator extends TileEntityElectricBlock implem
|
||||
* Gets the boost this generator can receive in it's current location.
|
||||
* @return environmental boost
|
||||
*/
|
||||
public abstract int getEnvironmentBoost();
|
||||
public abstract double getEnvironmentBoost();
|
||||
|
||||
/**
|
||||
* Whether or not this generator can operate.
|
||||
@@ -238,7 +238,7 @@ public abstract class TileEntityGenerator extends TileEntityElectricBlock implem
|
||||
@Override
|
||||
public int getMaxEnergyOutput()
|
||||
{
|
||||
return output;
|
||||
return (int)(output*Mekanism.TO_IC2);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -276,7 +276,7 @@ public abstract class TileEntityGenerator extends TileEntityElectricBlock implem
|
||||
@Override
|
||||
public int getOutput()
|
||||
{
|
||||
return output;
|
||||
return (int)(output*Mekanism.TO_IC2);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -28,12 +28,9 @@ public class TileEntityHeatGenerator extends TileEntityGenerator implements ITan
|
||||
/** The LiquidTank for this generator. */
|
||||
public LiquidTank lavaTank = new LiquidTank(24000);
|
||||
|
||||
/** The amount of electricity this machine can produce with a unit of fuel. */
|
||||
public final int GENERATION = 100;
|
||||
|
||||
public TileEntityHeatGenerator()
|
||||
{
|
||||
super("Heat Generator", 160000, 200);
|
||||
super("Heat Generator", 160000, MekanismGenerators.heatGeneration*2);
|
||||
inventory = new ItemStack[2];
|
||||
}
|
||||
|
||||
@@ -98,7 +95,7 @@ public class TileEntityHeatGenerator extends TileEntityGenerator implements ITan
|
||||
setActive(true);
|
||||
|
||||
lavaTank.drain(10, true);
|
||||
setEnergy(electricityStored + GENERATION);
|
||||
setEnergy(electricityStored + MekanismGenerators.heatGeneration);
|
||||
}
|
||||
else {
|
||||
setActive(false);
|
||||
@@ -168,7 +165,7 @@ public class TileEntityHeatGenerator extends TileEntityGenerator implements ITan
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnvironmentBoost()
|
||||
public double getEnvironmentBoost()
|
||||
{
|
||||
int boost = 0;
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ public class TileEntityHydrogenGenerator extends TileEntityGenerator implements
|
||||
|
||||
public TileEntityHydrogenGenerator()
|
||||
{
|
||||
super("Hydrogen Generator", 40000, 600);
|
||||
super("Hydrogen Generator", 40000, MekanismGenerators.hydrogenGeneration*2);
|
||||
inventory = new ItemStack[2];
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ public class TileEntityHydrogenGenerator extends TileEntityGenerator implements
|
||||
setActive(true);
|
||||
|
||||
hydrogenStored-=2;
|
||||
setEnergy(electricityStored + 300);
|
||||
setEnergy(electricityStored + MekanismGenerators.hydrogenGeneration);
|
||||
}
|
||||
else {
|
||||
setActive(false);
|
||||
@@ -160,7 +160,7 @@ public class TileEntityHydrogenGenerator extends TileEntityGenerator implements
|
||||
@Override
|
||||
public boolean canOperate()
|
||||
{
|
||||
return electricityStored < MAX_ELECTRICITY && hydrogenStored-10 > -1;
|
||||
return electricityStored < MAX_ELECTRICITY && hydrogenStored-2 > -1;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -218,7 +218,7 @@ public class TileEntityHydrogenGenerator extends TileEntityGenerator implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnvironmentBoost()
|
||||
public double getEnvironmentBoost()
|
||||
{
|
||||
int boost = 1;
|
||||
|
||||
|
||||
@@ -23,16 +23,16 @@ public class TileEntitySolarGenerator extends TileEntityGenerator
|
||||
public boolean seesSun = false;
|
||||
|
||||
/** How fast this tile entity generates energy. */
|
||||
public int GENERATION_RATE;
|
||||
public double GENERATION_RATE;
|
||||
|
||||
public TileEntitySolarGenerator()
|
||||
{
|
||||
super("Solar Generator", 96000, 60);
|
||||
GENERATION_RATE = 30;
|
||||
super("Solar Generator", 96000, MekanismGenerators.solarGeneration*2);
|
||||
GENERATION_RATE = MekanismGenerators.solarGeneration;
|
||||
inventory = new ItemStack[1];
|
||||
}
|
||||
|
||||
public TileEntitySolarGenerator(String name, int maxEnergy, int output, int generation)
|
||||
public TileEntitySolarGenerator(String name, double maxEnergy, double output, double generation)
|
||||
{
|
||||
super(name, maxEnergy, output);
|
||||
GENERATION_RATE = generation;
|
||||
@@ -138,7 +138,7 @@ public class TileEntitySolarGenerator extends TileEntityGenerator
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnvironmentBoost()
|
||||
public double getEnvironmentBoost()
|
||||
{
|
||||
return seesSun ? (GENERATION_RATE*(worldObj.provider instanceof ISolarLevel ? (int)((ISolarLevel)worldObj.provider).getSolarEnergyMultiplier() : 1)) : 0;
|
||||
}
|
||||
|
||||
@@ -13,12 +13,9 @@ public class TileEntityWindTurbine extends TileEntityGenerator implements IBound
|
||||
/** The angle the blades of this Wind Turbine are currently at. */
|
||||
public int angle;
|
||||
|
||||
/** How much energy this generator produces per-tick. */
|
||||
public int GENERATION_RATE = 30;
|
||||
|
||||
public TileEntityWindTurbine()
|
||||
{
|
||||
super("Wind Turbine", 200000, 400);
|
||||
super("Wind Turbine", 200000, (MekanismGenerators.windGeneration*8)*2);
|
||||
inventory = new ItemStack[1];
|
||||
}
|
||||
|
||||
@@ -34,7 +31,7 @@ public class TileEntityWindTurbine extends TileEntityGenerator implements IBound
|
||||
if(canOperate())
|
||||
{
|
||||
setActive(true);
|
||||
setEnergy(electricityStored + (GENERATION_RATE*getMultiplier()));
|
||||
setEnergy(electricityStored + (MekanismGenerators.windGeneration*getMultiplier()));
|
||||
}
|
||||
else {
|
||||
setActive(false);
|
||||
@@ -67,9 +64,9 @@ public class TileEntityWindTurbine extends TileEntityGenerator implements IBound
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnvironmentBoost()
|
||||
public double getEnvironmentBoost()
|
||||
{
|
||||
return (int)getMultiplier();
|
||||
return getMultiplier();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -88,7 +85,7 @@ public class TileEntityWindTurbine extends TileEntityGenerator implements IBound
|
||||
{
|
||||
for(int z = obj.zCoord-2; z <= obj.zCoord+2; z++)
|
||||
{
|
||||
if(worldObj.getBlockId(x, y, z) == 0)
|
||||
if(worldObj.isAirBlock(x, y, z))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user