v5.5.6 Beta #4
*Even better energy balance. *Configurable energy-per-redstone. *Fixed debug corner display.
This commit is contained in:
parent
048a4742ca
commit
aa8f06c5e0
23 changed files with 60 additions and 40 deletions
|
@ -778,17 +778,17 @@ public class BlockMachine extends BlockContainer
|
|||
|
||||
public static enum MachineType
|
||||
{
|
||||
ENRICHMENT_CHAMBER(0, 3, 2000, TileEntityEnrichmentChamber.class, false),
|
||||
OSMIUM_COMPRESSOR(1, 4, 2000, TileEntityOsmiumCompressor.class, false),
|
||||
COMBINER(2, 5, 2000, TileEntityCombiner.class, false),
|
||||
CRUSHER(3, 6, 2000, TileEntityCrusher.class, false),
|
||||
THEORETICAL_ELEMENTIZER(4, 7, 4800, TileEntityTheoreticalElementizer.class, true),
|
||||
BASIC_FACTORY(5, 11, 6000, TileEntityFactory.class, false),
|
||||
ADVANCED_FACTORY(6, 11, 10000, TileEntityAdvancedFactory.class, false),
|
||||
ELITE_FACTORY(7, 11, 14000, TileEntityEliteFactory.class, false),
|
||||
METALLURGIC_INFUSER(8, 12, 2000, TileEntityMetallurgicInfuser.class, true),
|
||||
PURIFICATION_CHAMBER(9, 15, 12000, TileEntityPurificationChamber.class, false),
|
||||
ENERGIZED_SMELTER(10, 16, 2000, TileEntityEnergizedSmelter.class, false),
|
||||
ENRICHMENT_CHAMBER(0, 3, 20000, TileEntityEnrichmentChamber.class, false),
|
||||
OSMIUM_COMPRESSOR(1, 4, 20000, TileEntityOsmiumCompressor.class, false),
|
||||
COMBINER(2, 5, 20000, TileEntityCombiner.class, false),
|
||||
CRUSHER(3, 6, 20000, TileEntityCrusher.class, false),
|
||||
THEORETICAL_ELEMENTIZER(4, 7, 20000, TileEntityTheoreticalElementizer.class, true),
|
||||
BASIC_FACTORY(5, 11, 60000, TileEntityFactory.class, false),
|
||||
ADVANCED_FACTORY(6, 11, 100000, TileEntityAdvancedFactory.class, false),
|
||||
ELITE_FACTORY(7, 11, 140000, TileEntityEliteFactory.class, false),
|
||||
METALLURGIC_INFUSER(8, 12, 20000, TileEntityMetallurgicInfuser.class, true),
|
||||
PURIFICATION_CHAMBER(9, 15, 20000, TileEntityPurificationChamber.class, false),
|
||||
ENERGIZED_SMELTER(10, 16, 20000, TileEntityEnergizedSmelter.class, false),
|
||||
TELEPORTER(11, 13, 5000000, TileEntityTeleporter.class, false),
|
||||
ELECTRIC_PUMP(12, 17, 10000, TileEntityElectricPump.class, true),
|
||||
ELECTRIC_CHEST(13, -1, 12000, TileEntityElectricChest.class, true),
|
||||
|
|
|
@ -50,9 +50,9 @@ public final class ChargeUtils
|
|||
item.transferEnergy(itemStack, toTransfer, true);
|
||||
storer.setEnergy(storer.getEnergy() + (toTransfer*Mekanism.FROM_BC));
|
||||
}
|
||||
else if(storer.inventory[slotID].itemID == Item.redstone.itemID && storer.getEnergy()+1000 <= storer.getMaxEnergy())
|
||||
else if(storer.inventory[slotID].itemID == Item.redstone.itemID && storer.getEnergy()+Mekanism.ENERGY_PER_REDSTONE <= storer.getMaxEnergy())
|
||||
{
|
||||
storer.setEnergy(storer.getEnergy() + 1000);
|
||||
storer.setEnergy(storer.getEnergy() + Mekanism.ENERGY_PER_REDSTONE);
|
||||
storer.inventory[slotID].stackSize--;
|
||||
|
||||
if(storer.inventory[slotID].stackSize <= 0)
|
||||
|
|
|
@ -100,6 +100,7 @@ public class CommonProxy
|
|||
Mekanism.TO_IC2 = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EUToJoules", .1).getDouble(.1);
|
||||
Mekanism.FROM_BC = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "JoulesToMJ", 25).getDouble(25);
|
||||
Mekanism.TO_BC = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "MJToJoules", .04).getDouble(.04);
|
||||
Mekanism.ENERGY_PER_REDSTONE = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EnergyPerRedstone", 10000).getDouble(10000);
|
||||
Mekanism.configuration.save();
|
||||
}
|
||||
|
||||
|
|
|
@ -170,9 +170,9 @@ public class EntityRobit extends EntityCreature implements IInventory, ISustaine
|
|||
item.transferEnergy(itemStack, toTransfer, true);
|
||||
setEnergy(getEnergy() + (toTransfer*Mekanism.FROM_BC));
|
||||
}
|
||||
else if(inventory[27].itemID == Item.redstone.itemID && getEnergy()+1000 <= MAX_ELECTRICITY)
|
||||
else if(inventory[27].itemID == Item.redstone.itemID && getEnergy()+Mekanism.ENERGY_PER_REDSTONE <= MAX_ELECTRICITY)
|
||||
{
|
||||
setEnergy(getEnergy() + 1000);
|
||||
setEnergy(getEnergy() + Mekanism.ENERGY_PER_REDSTONE);
|
||||
inventory[27].stackSize--;
|
||||
|
||||
if(inventory[27].stackSize <= 0)
|
||||
|
|
|
@ -173,6 +173,7 @@ public class Mekanism
|
|||
public static double TO_BC;
|
||||
public static double FROM_IC2;
|
||||
public static double FROM_BC;
|
||||
public static double ENERGY_PER_REDSTONE = 10000;
|
||||
|
||||
/** Total ticks passed since thePlayer joined theWorld */
|
||||
public static int ticksPassed = 0;
|
||||
|
|
|
@ -814,7 +814,12 @@ public final class MekanismUtils
|
|||
*/
|
||||
public static boolean isObfuscated()
|
||||
{
|
||||
return !World.class.getSimpleName().equals("World");
|
||||
try {
|
||||
Class.forName("net.minecraft.src.World");
|
||||
return true;
|
||||
} catch(Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -14,10 +14,10 @@ public final class Tier
|
|||
*/
|
||||
public static enum EnergyCubeTier
|
||||
{
|
||||
BASIC("Basic", 1000000, 120, 320),
|
||||
ADVANCED("Advanced", 5000000, 240, 540),
|
||||
ELITE("Elite", 10000000, 240, 1280),
|
||||
ULTIMATE("Ultimate", 25000000, 480, 2560);
|
||||
BASIC("Basic", 2000000, 120, 320),
|
||||
ADVANCED("Advanced", 8000000, 240, 540),
|
||||
ELITE("Elite", 32000000, 240, 1280),
|
||||
ULTIMATE("Ultimate", 128000000, 480, 2560);
|
||||
|
||||
public double MAX_ELECTRICITY;
|
||||
public double VOLTAGE;
|
||||
|
|
|
@ -42,7 +42,7 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM
|
|||
* @param maxEnergy - maximum amount of energy this machine can hold.
|
||||
* @param maxSecondaryEnergy - maximum amount of secondary energy (fuel) this machine can hold.
|
||||
*/
|
||||
public TileEntityAdvancedElectricMachine(String soundPath, String name, String path, int perTick, int secondaryPerTick, int ticksRequired, int maxEnergy, int maxSecondaryEnergy)
|
||||
public TileEntityAdvancedElectricMachine(String soundPath, String name, String path, int perTick, int secondaryPerTick, int ticksRequired, double maxEnergy, int maxSecondaryEnergy)
|
||||
{
|
||||
super(soundPath, name, path, perTick, ticksRequired, maxEnergy);
|
||||
|
||||
|
|
|
@ -2,13 +2,14 @@ package mekanism.common;
|
|||
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.api.SideData;
|
||||
import mekanism.common.BlockMachine.MachineType;
|
||||
import mekanism.common.Tier.FactoryTier;
|
||||
|
||||
public class TileEntityAdvancedFactory extends TileEntityFactory
|
||||
{
|
||||
public TileEntityAdvancedFactory()
|
||||
{
|
||||
super(FactoryTier.ADVANCED);
|
||||
super(FactoryTier.ADVANCED, MachineType.ADVANCED_FACTORY);
|
||||
|
||||
sideOutputs.add(new SideData(EnumColor.GREY, 0, 0, new int[0]));
|
||||
sideOutputs.add(new SideData(EnumColor.ORANGE, 0, 1, new int[] {0}));
|
||||
|
|
|
@ -69,7 +69,7 @@ public abstract class TileEntityBasicMachine extends TileEntityElectricBlock imp
|
|||
* @param ticksRequired - how many ticks it takes to run a cycle
|
||||
* @param maxEnergy - how much energy this machine can store
|
||||
*/
|
||||
public TileEntityBasicMachine(String soundPath, String name, String path, int perTick, int ticksRequired, int maxEnergy)
|
||||
public TileEntityBasicMachine(String soundPath, String name, String path, int perTick, int ticksRequired, double maxEnergy)
|
||||
{
|
||||
super(name, maxEnergy);
|
||||
ENERGY_PER_TICK = perTick;
|
||||
|
|
|
@ -2,6 +2,7 @@ package mekanism.common;
|
|||
|
||||
import java.util.Map;
|
||||
|
||||
import mekanism.common.BlockMachine.MachineType;
|
||||
import mekanism.common.RecipeHandler.Recipe;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
|
@ -11,7 +12,7 @@ public class TileEntityCombiner extends TileEntityAdvancedElectricMachine
|
|||
{
|
||||
public TileEntityCombiner()
|
||||
{
|
||||
super("Combiner.ogg", "Combiner", "/mods/mekanism/gui/GuiCombiner.png", 10, 1, 200, 2000, 200);
|
||||
super("Combiner.ogg", "Combiner", "/mods/mekanism/gui/GuiCombiner.png", 50, 1, 200, MachineType.COMBINER.baseEnergy, 200);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -2,13 +2,14 @@ package mekanism.common;
|
|||
|
||||
import java.util.Map;
|
||||
|
||||
import mekanism.common.BlockMachine.MachineType;
|
||||
import mekanism.common.RecipeHandler.Recipe;
|
||||
|
||||
public class TileEntityCrusher extends TileEntityElectricMachine
|
||||
{
|
||||
public TileEntityCrusher()
|
||||
{
|
||||
super("Crusher.ogg", "Crusher", "/mods/mekanism/gui/GuiCrusher.png", 10, 200, 2000);
|
||||
super("Crusher.ogg", "Crusher", "/mods/mekanism/gui/GuiCrusher.png", 50, 200, MachineType.CRUSHER.baseEnergy);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -21,7 +21,7 @@ public abstract class TileEntityElectricMachine extends TileEntityBasicMachine
|
|||
* @param ticksRequired - ticks required to operate -- or smelt an item.
|
||||
* @param maxEnergy - maximum energy this machine can hold.
|
||||
*/
|
||||
public TileEntityElectricMachine(String soundPath, String name, String path, int perTick, int ticksRequired, int maxEnergy)
|
||||
public TileEntityElectricMachine(String soundPath, String name, String path, int perTick, int ticksRequired, double maxEnergy)
|
||||
{
|
||||
super(soundPath, name, path, perTick, ticksRequired, maxEnergy);
|
||||
|
||||
|
|
|
@ -2,13 +2,14 @@ package mekanism.common;
|
|||
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.api.SideData;
|
||||
import mekanism.common.BlockMachine.MachineType;
|
||||
import mekanism.common.Tier.FactoryTier;
|
||||
|
||||
public class TileEntityEliteFactory extends TileEntityFactory
|
||||
{
|
||||
public TileEntityEliteFactory()
|
||||
{
|
||||
super(FactoryTier.ELITE);
|
||||
super(FactoryTier.ELITE, MachineType.ELITE_FACTORY);
|
||||
|
||||
sideOutputs.add(new SideData(EnumColor.GREY, 0, 0, new int[0]));
|
||||
sideOutputs.add(new SideData(EnumColor.ORANGE, 0, 1, new int[] {0}));
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import mekanism.common.BlockMachine.MachineType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
|
||||
|
@ -11,7 +12,7 @@ public class TileEntityEnergizedSmelter extends TileEntityElectricMachine
|
|||
{
|
||||
public TileEntityEnergizedSmelter()
|
||||
{
|
||||
super("Smelter.ogg", "Energized Smelter", "/mods/mekanism/gui/GuiEnergizedSmelter.png", 10, 200, 2000);
|
||||
super("Smelter.ogg", "Energized Smelter", "/mods/mekanism/gui/GuiEnergizedSmelter.png", 50, 200, MachineType.ENERGIZED_SMELTER.baseEnergy);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -2,13 +2,14 @@ package mekanism.common;
|
|||
|
||||
import java.util.Map;
|
||||
|
||||
import mekanism.common.BlockMachine.MachineType;
|
||||
import mekanism.common.RecipeHandler.Recipe;
|
||||
|
||||
public class TileEntityEnrichmentChamber extends TileEntityElectricMachine
|
||||
{
|
||||
public TileEntityEnrichmentChamber()
|
||||
{
|
||||
super("Chamber.ogg", "Enrichment Chamber", "/mods/mekanism/gui/GuiChamber.png", 10, 200, 2000);
|
||||
super("Chamber.ogg", "Enrichment Chamber", "/mods/mekanism/gui/GuiChamber.png", 50, 200, MachineType.ENRICHMENT_CHAMBER.baseEnergy);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -45,7 +45,7 @@ public class TileEntityFactory extends TileEntityElectricBlock implements IEnerg
|
|||
public int TICKS_REQUIRED = 200;
|
||||
|
||||
/** How much energy each operation consumes per tick. */
|
||||
public int ENERGY_PER_TICK = 10;
|
||||
public int ENERGY_PER_TICK = 50;
|
||||
|
||||
/** This machine's speed multiplier. */
|
||||
public int speedMultiplier;
|
||||
|
@ -76,7 +76,7 @@ public class TileEntityFactory extends TileEntityElectricBlock implements IEnerg
|
|||
|
||||
public TileEntityFactory()
|
||||
{
|
||||
this(FactoryTier.BASIC);
|
||||
this(FactoryTier.BASIC, MachineType.BASIC_FACTORY);
|
||||
|
||||
sideOutputs.add(new SideData(EnumColor.GREY, 0, 0, new int[0]));
|
||||
sideOutputs.add(new SideData(EnumColor.ORANGE, 0, 1, new int[] {0}));
|
||||
|
@ -87,9 +87,9 @@ public class TileEntityFactory extends TileEntityElectricBlock implements IEnerg
|
|||
sideConfig = new byte[] {4, 3, 0, 0, 2, 1};
|
||||
}
|
||||
|
||||
public TileEntityFactory(FactoryTier type)
|
||||
public TileEntityFactory(FactoryTier type, MachineType machine)
|
||||
{
|
||||
super(type.name + " Factory", type.processes*2000);
|
||||
super(type.name + " Factory", machine.baseEnergy);
|
||||
tier = type;
|
||||
inventory = new ItemStack[4+type.processes*2];
|
||||
progress = new int[type.processes];
|
||||
|
|
|
@ -16,6 +16,7 @@ import mekanism.api.InfusionOutput;
|
|||
import mekanism.api.InfusionType;
|
||||
import mekanism.api.SideData;
|
||||
import mekanism.client.IHasSound;
|
||||
import mekanism.common.BlockMachine.MachineType;
|
||||
import mekanism.common.RecipeHandler.Recipe;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -44,7 +45,7 @@ public class TileEntityMetallurgicInfuser extends TileEntityElectricBlock implem
|
|||
public int MAX_INFUSE = 1000;
|
||||
|
||||
/** How much energy this machine consumes per-tick. */
|
||||
public double ENERGY_PER_TICK = 10;
|
||||
public double ENERGY_PER_TICK = 50;
|
||||
|
||||
/** How many ticks it takes to run an operation. */
|
||||
public int TICKS_REQUIRED = 200;
|
||||
|
@ -75,7 +76,7 @@ public class TileEntityMetallurgicInfuser extends TileEntityElectricBlock implem
|
|||
|
||||
public TileEntityMetallurgicInfuser()
|
||||
{
|
||||
super("Metallurgic Infuser", 2000);
|
||||
super("Metallurgic Infuser", MachineType.METALLURGIC_INFUSER.baseEnergy);
|
||||
|
||||
sideOutputs.add(new SideData(EnumColor.GREY, 0, 0, new int[0]));
|
||||
sideOutputs.add(new SideData(EnumColor.ORANGE, 0, 1, new int[] {0}));
|
||||
|
|
|
@ -2,6 +2,7 @@ package mekanism.common;
|
|||
|
||||
import java.util.Map;
|
||||
|
||||
import mekanism.common.BlockMachine.MachineType;
|
||||
import mekanism.common.RecipeHandler.Recipe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
@ -10,7 +11,7 @@ public class TileEntityOsmiumCompressor extends TileEntityAdvancedElectricMachin
|
|||
{
|
||||
public TileEntityOsmiumCompressor()
|
||||
{
|
||||
super("Compressor.ogg", "Osmium Compressor", "/mods/mekanism/gui/GuiCompressor.png", 10, 1, 200, 2000, 200);
|
||||
super("Compressor.ogg", "Osmium Compressor", "/mods/mekanism/gui/GuiCompressor.png", 50, 1, 200, MachineType.OSMIUM_COMPRESSOR.baseEnergy, 200);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -11,13 +11,14 @@ import mekanism.api.IGasAcceptor;
|
|||
import mekanism.api.IGasStorage;
|
||||
import mekanism.api.IStorageTank;
|
||||
import mekanism.api.ITubeConnection;
|
||||
import mekanism.common.BlockMachine.MachineType;
|
||||
import mekanism.common.RecipeHandler.Recipe;
|
||||
|
||||
public class TileEntityPurificationChamber extends TileEntityAdvancedElectricMachine implements IGasAcceptor, IGasStorage, ITubeConnection
|
||||
{
|
||||
public TileEntityPurificationChamber()
|
||||
{
|
||||
super("PurificationChamber.ogg", "Purification Chamber", "/mods/mekanism/gui/GuiPurificationChamber.png", 30, 1, 200, 12000, 1200);
|
||||
super("PurificationChamber.ogg", "Purification Chamber", "/mods/mekanism/gui/GuiPurificationChamber.png", 50, 1, 200, MachineType.PURIFICATION_CHAMBER.baseEnergy, 1200);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -7,6 +7,7 @@ import java.util.Random;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import mekanism.common.BlockMachine.MachineType;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
@ -15,7 +16,7 @@ public class TileEntityTheoreticalElementizer extends TileEntityAdvancedElectric
|
|||
{
|
||||
public TileEntityTheoreticalElementizer()
|
||||
{
|
||||
super("Elementizer.ogg", "Theoretical Elementizer", "/mods/mekanism/gui/GuiElementizer.png", 24, 1, 1000, 4800, 1000);
|
||||
super("Elementizer.ogg", "Theoretical Elementizer", "/mods/mekanism/gui/GuiElementizer.png", 24, 1, 1000, MachineType.THEORETICAL_ELEMENTIZER.baseEnergy, 1000);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -20,6 +20,7 @@ import mekanism.common.Mekanism;
|
|||
import mekanism.common.MekanismUtils;
|
||||
import mekanism.common.PacketHandler;
|
||||
import mekanism.common.TileEntityElectricBlock;
|
||||
import mekanism.generators.common.BlockGenerator.GeneratorType;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -65,7 +66,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
|||
|
||||
public TileEntityElectrolyticSeparator()
|
||||
{
|
||||
super("Electrolytic Separator", 20000);
|
||||
super("Electrolytic Separator", GeneratorType.ELECTROLYTIC_SEPARATOR.maxEnergy);
|
||||
inventory = new ItemStack[4];
|
||||
outputType = EnumGas.HYDROGEN;
|
||||
dumpType = EnumGas.NONE;
|
||||
|
@ -168,7 +169,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
|||
if(oxygenStored < MAX_GAS && hydrogenStored < MAX_GAS && waterTank.getLiquid() != null && waterTank.getLiquid().amount-2 >= 0 && electricityStored-100 > 0)
|
||||
{
|
||||
waterTank.drain(2, true);
|
||||
setEnergy(electricityStored - 10);
|
||||
setEnergy(electricityStored - 50);
|
||||
setGas(EnumGas.OXYGEN, oxygenStored + 1);
|
||||
setGas(EnumGas.HYDROGEN, hydrogenStored + 2);
|
||||
}
|
||||
|
@ -408,6 +409,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
|||
super.handlePacketData(dataStream);
|
||||
|
||||
int amount = dataStream.readInt();
|
||||
|
||||
if(amount != 0)
|
||||
{
|
||||
waterTank.setLiquid(new LiquidStack(Block.waterStill.blockID, amount, 0));
|
||||
|
|
|
@ -53,6 +53,7 @@ public class TileEntityHydrogenGenerator extends TileEntityGenerator implements
|
|||
{
|
||||
int received = 0;
|
||||
int hydrogenNeeded = MAX_HYDROGEN - hydrogenStored;
|
||||
|
||||
if(item.getRate() <= hydrogenNeeded)
|
||||
{
|
||||
received = item.removeGas(inventory[0], EnumGas.HYDROGEN, item.getRate());
|
||||
|
|
Loading…
Reference in a new issue