mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-26 06:42:56 +00:00
Merge pull request #212 from Thorfusion/Energy-Configs
More Energy Configs
This commit is contained in:
15 files changed
+165
-97
No files matched your search
+2
-2
@@ -4,5 +4,5 @@ FMP_version=1.2.0.345
|
||||
CCLIB_version=1.1.3.141
|
||||
NEI_version=1.0.5.120
|
||||
CCC_version=1.0.7.48
|
||||
mod_version=9.10.43
|
||||
alt_version=9, 10, 43
|
||||
mod_version=9.10.44
|
||||
alt_version=9, 10, 44
|
||||
@@ -91,6 +91,9 @@ public class MekanismConfig
|
||||
public static int atomicDisassemblerPoweredDamage;
|
||||
public static int atomicDisassemblerUnpoweredDamage;
|
||||
public static int atomicDisassemblerAttackPowerCost;
|
||||
public static int electricBowPowerCost;
|
||||
public static int teleporterBasePowerCost;
|
||||
public static int robitEnergyPerHP;
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +120,7 @@ public class MekanismConfig
|
||||
|
||||
public static class machines
|
||||
{
|
||||
private static Map<String, Boolean> config = new HashMap<String, Boolean>();
|
||||
private static final Map<String, Boolean> config = new HashMap<String, Boolean>();
|
||||
|
||||
public static boolean isEnabled(String type)
|
||||
{
|
||||
|
||||
@@ -321,7 +321,10 @@ public class CommonProxy implements IGuiProvider
|
||||
mekce.atomicDisassemblerPoweredDamage = Mekanism.configurationce.get("mekce", "atomicDisassemblerPoweredDamage", 20, "Attack Damage of a powered Atomic Disassembler. Default is 20").getInt();
|
||||
mekce.atomicDisassemblerUnpoweredDamage = Mekanism.configurationce.get("mekce", "atomicDisassemblerUnpoweredDamage", 4, "Attack Damage of an unpowered Atomic Disassembler. Default is 4").getInt();
|
||||
mekce.atomicDisassemblerAttackPowerCost = Mekanism.configurationce.get("mekce", "atomicDisassemblerAttackPowerCost", 2000, "Energy cost of attacking entities with the Atomic Disassembler. Default is 2000").getInt();
|
||||
|
||||
mekce.electricBowPowerCost = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ElectricBowJoulesPerShot", 120, "Base energy cost of shooting arrows with the Electric Bow. Default is 120", 1, Integer.MAX_VALUE).getInt();
|
||||
mekce.robitEnergyPerHP = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "robitEnergyPerHP", 1000, "Energy equivalency of 1HP of health for Robit", 1, Integer.MAX_VALUE).getInt();
|
||||
mekce.teleporterBasePowerCost = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "BaseTeleporterCost", 1000, "Base energy cost of using teleporters. Default is 1000", 1, Integer.MAX_VALUE).getInt();
|
||||
|
||||
mekce.IC2SinkTier = Mekanism.configurationce.get("mekce", "IC2SinkTier", 4, "Tier level for machines, we recommend setting it to tier 2 for ic2 classic", 1, 4).getInt();
|
||||
mekce.IC2SourceTier = Mekanism.configurationce.get("mekce", "IC2SourceTier", 4, "Tier level for generators, we recommend setting it to tier 2 for ic2 classic", 1, 4).getInt();
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ public class MekanismItems
|
||||
public static final Item MufflingUpgrade = new ItemUpgrade(Upgrade.MUFFLING).setUnlocalizedName("MufflingUpgrade");
|
||||
public static final Item GasUpgrade = new ItemUpgrade(Upgrade.GAS).setUnlocalizedName("GasUpgrade");
|
||||
public static final Item TierInstaller = new ItemTierInstaller().setUnlocalizedName("FactoryInstaller");
|
||||
public static final ItemEnergized EnergyTablet = (ItemEnergized)new ItemEnergized(1000000).setUnlocalizedName("EnergyTablet");
|
||||
public static final ItemEnergized EnergyTablet = (ItemEnergized)new ItemEnergized(Tier.EquipmentTier.ADVANCED.energy).setUnlocalizedName("EnergyTablet");
|
||||
public static final ItemRobit Robit = (ItemRobit)new ItemRobit().setUnlocalizedName("Robit");
|
||||
public static final ItemAtomicDisassembler AtomicDisassembler = (ItemAtomicDisassembler)new ItemAtomicDisassembler().setUnlocalizedName("AtomicDisassembler");
|
||||
public static final ItemPortableTeleporter PortableTeleporter = (ItemPortableTeleporter)new ItemPortableTeleporter().setUnlocalizedName("PortableTeleporter");
|
||||
|
||||
@@ -18,14 +18,14 @@ import codechicken.lib.colour.ColourRGBA;
|
||||
*/
|
||||
public final class Tier
|
||||
{
|
||||
private static List<ITier> tierTypes = new ArrayList<ITier>();
|
||||
private static final List<ITier> tierTypes = new ArrayList<ITier>();
|
||||
|
||||
private static boolean initiated = false;
|
||||
|
||||
/** The default tiers used in Mekanism.
|
||||
* @author aidancbrady
|
||||
*/
|
||||
public static enum BaseTier
|
||||
public enum BaseTier
|
||||
{
|
||||
BASIC("Basic", EnumColor.BRIGHT_GREEN),
|
||||
ADVANCED("Advanced", EnumColor.DARK_RED),
|
||||
@@ -53,17 +53,17 @@ public final class Tier
|
||||
return this != CREATIVE;
|
||||
}
|
||||
|
||||
private String name;
|
||||
private EnumColor color;
|
||||
private final String name;
|
||||
private final EnumColor color;
|
||||
|
||||
private BaseTier(String s, EnumColor c)
|
||||
BaseTier(String s, EnumColor c)
|
||||
{
|
||||
name = s;
|
||||
color = c;
|
||||
}
|
||||
}
|
||||
|
||||
public static enum EnergyCubeTier implements ITier
|
||||
public enum EnergyCubeTier implements ITier
|
||||
{
|
||||
BASIC(2000000, 800),
|
||||
ADVANCED(8000000, 3200),
|
||||
@@ -72,12 +72,12 @@ public final class Tier
|
||||
CREATIVE(Double.MAX_VALUE, Double.MAX_VALUE);
|
||||
|
||||
public double maxEnergy;
|
||||
private double baseMaxEnergy;
|
||||
private final double baseMaxEnergy;
|
||||
|
||||
public double output;
|
||||
private double baseOutput;
|
||||
private final double baseOutput;
|
||||
|
||||
private EnergyCubeTier(double max, double out)
|
||||
EnergyCubeTier(double max, double out)
|
||||
{
|
||||
baseMaxEnergy = maxEnergy = max;
|
||||
baseOutput = output = out;
|
||||
@@ -133,7 +133,7 @@ public final class Tier
|
||||
}
|
||||
}
|
||||
|
||||
public static enum InductionCellTier implements ITier
|
||||
public enum InductionCellTier implements ITier
|
||||
{
|
||||
BASIC(1E9D),
|
||||
ADVANCED(8E9D),
|
||||
@@ -141,9 +141,9 @@ public final class Tier
|
||||
ULTIMATE(512E9D);
|
||||
|
||||
public double maxEnergy;
|
||||
private double baseMaxEnergy;
|
||||
private final double baseMaxEnergy;
|
||||
|
||||
private InductionCellTier(double max)
|
||||
InductionCellTier(double max)
|
||||
{
|
||||
baseMaxEnergy = maxEnergy = max;
|
||||
}
|
||||
@@ -173,7 +173,7 @@ public final class Tier
|
||||
}
|
||||
}
|
||||
|
||||
public static enum InductionProviderTier implements ITier
|
||||
public enum InductionProviderTier implements ITier
|
||||
{
|
||||
BASIC(64000),
|
||||
ADVANCED(512000),
|
||||
@@ -181,9 +181,9 @@ public final class Tier
|
||||
ULTIMATE(32768000);
|
||||
|
||||
public double output;
|
||||
private double baseOutput;
|
||||
private final double baseOutput;
|
||||
|
||||
private InductionProviderTier(double out)
|
||||
InductionProviderTier(double out)
|
||||
{
|
||||
baseOutput = output = out;
|
||||
}
|
||||
@@ -213,14 +213,14 @@ public final class Tier
|
||||
}
|
||||
}
|
||||
|
||||
public static enum FactoryTier
|
||||
public enum FactoryTier
|
||||
{
|
||||
BASIC(3, new ResourceLocation("mekanism", "gui/factory/GuiBasicFactory.png")),
|
||||
ADVANCED(5, new ResourceLocation("mekanism", "gui/factory/GuiAdvancedFactory.png")),
|
||||
ELITE(7, new ResourceLocation("mekanism", "gui/factory/GuiEliteFactory.png"));
|
||||
|
||||
public int processes;
|
||||
public ResourceLocation guiLocation;
|
||||
public final int processes;
|
||||
public final ResourceLocation guiLocation;
|
||||
|
||||
public static FactoryTier getFromName(String tierName)
|
||||
{
|
||||
@@ -241,14 +241,14 @@ public final class Tier
|
||||
return BaseTier.values()[ordinal()];
|
||||
}
|
||||
|
||||
private FactoryTier(int process, ResourceLocation gui)
|
||||
FactoryTier(int process, ResourceLocation gui)
|
||||
{
|
||||
processes = process;
|
||||
guiLocation = gui;
|
||||
}
|
||||
}
|
||||
|
||||
public static enum CableTier implements ITier
|
||||
public enum CableTier implements ITier
|
||||
{
|
||||
BASIC(3200, TransmitterType.UNIVERSAL_CABLE_BASIC),
|
||||
ADVANCED(12800, TransmitterType.UNIVERSAL_CABLE_ADVANCED),
|
||||
@@ -256,11 +256,11 @@ public final class Tier
|
||||
ULTIMATE(320000, TransmitterType.UNIVERSAL_CABLE_ULTIMATE);
|
||||
|
||||
public int cableCapacity;
|
||||
private int baseCapacity;
|
||||
private final int baseCapacity;
|
||||
|
||||
public TransmitterType type;
|
||||
public final TransmitterType type;
|
||||
|
||||
private CableTier(int capacity, TransmitterType transmitterType)
|
||||
CableTier(int capacity, TransmitterType transmitterType)
|
||||
{
|
||||
baseCapacity = cableCapacity = capacity;
|
||||
|
||||
@@ -305,7 +305,7 @@ public final class Tier
|
||||
}
|
||||
}
|
||||
|
||||
public static enum PipeTier implements ITier
|
||||
public enum PipeTier implements ITier
|
||||
{
|
||||
BASIC(1000, 100, TransmitterType.MECHANICAL_PIPE_BASIC),
|
||||
ADVANCED(4000, 400, TransmitterType.MECHANICAL_PIPE_ADVANCED),
|
||||
@@ -313,14 +313,14 @@ public final class Tier
|
||||
ULTIMATE(64000, 6400, TransmitterType.MECHANICAL_PIPE_ULTIMATE);
|
||||
|
||||
public int pipeCapacity;
|
||||
private int baseCapacity;
|
||||
private final int baseCapacity;
|
||||
|
||||
public int pipePullAmount;
|
||||
private int basePull;
|
||||
private final int basePull;
|
||||
|
||||
public TransmitterType type;
|
||||
public final TransmitterType type;
|
||||
|
||||
private PipeTier(int capacity, int pullAmount, TransmitterType transmitterType)
|
||||
PipeTier(int capacity, int pullAmount, TransmitterType transmitterType)
|
||||
{
|
||||
baseCapacity = pipeCapacity = capacity;
|
||||
basePull = pipePullAmount = pullAmount;
|
||||
@@ -369,7 +369,7 @@ public final class Tier
|
||||
}
|
||||
}
|
||||
|
||||
public static enum TubeTier implements ITier
|
||||
public enum TubeTier implements ITier
|
||||
{
|
||||
BASIC(256, 64, TransmitterType.PRESSURIZED_TUBE_BASIC),
|
||||
ADVANCED(1024, 256, TransmitterType.PRESSURIZED_TUBE_ADVANCED),
|
||||
@@ -377,14 +377,14 @@ public final class Tier
|
||||
ULTIMATE(16384, 4096, TransmitterType.PRESSURIZED_TUBE_ULTIMATE);
|
||||
|
||||
public int tubeCapacity;
|
||||
private int baseCapacity;
|
||||
private final int baseCapacity;
|
||||
|
||||
public int tubePullAmount;
|
||||
private int basePull;
|
||||
private final int basePull;
|
||||
|
||||
public TransmitterType type;
|
||||
public final TransmitterType type;
|
||||
|
||||
private TubeTier(int capacity, int pullAmount, TransmitterType transmitterType)
|
||||
TubeTier(int capacity, int pullAmount, TransmitterType transmitterType)
|
||||
{
|
||||
baseCapacity = tubeCapacity = capacity;
|
||||
basePull = tubePullAmount = pullAmount;
|
||||
@@ -433,7 +433,7 @@ public final class Tier
|
||||
}
|
||||
}
|
||||
|
||||
public static enum TransporterTier implements ITier
|
||||
public enum TransporterTier implements ITier
|
||||
{
|
||||
BASIC(1, 5, TransmitterType.LOGISTICAL_TRANSPORTER_BASIC),
|
||||
ADVANCED(16, 10, TransmitterType.LOGISTICAL_TRANSPORTER_ADVANCED),
|
||||
@@ -441,14 +441,14 @@ public final class Tier
|
||||
ULTIMATE(64, 50, TransmitterType.LOGISTICAL_TRANSPORTER_ULTIMATE);
|
||||
|
||||
public int pullAmount;
|
||||
private int basePull;
|
||||
private final int basePull;
|
||||
|
||||
public int speed;
|
||||
private int baseSpeed;
|
||||
private final int baseSpeed;
|
||||
|
||||
public TransmitterType type;
|
||||
public final TransmitterType type;
|
||||
|
||||
private TransporterTier(int pull, int s, TransmitterType transmitterType)
|
||||
TransporterTier(int pull, int s, TransmitterType transmitterType)
|
||||
{
|
||||
basePull = pullAmount = pull;
|
||||
baseSpeed = speed = s;
|
||||
@@ -497,7 +497,7 @@ public final class Tier
|
||||
}
|
||||
}
|
||||
|
||||
public static enum ConductorTier implements ITier
|
||||
public enum ConductorTier implements ITier
|
||||
{
|
||||
BASIC(5, 1, 10, new ColourRGBA(0.2, 0.2, 0.2, 1), TransmitterType.THERMODYNAMIC_CONDUCTOR_BASIC),
|
||||
ADVANCED(5, 1, 400, new ColourRGBA(0.2, 0.2, 0.2, 1), TransmitterType.THERMODYNAMIC_CONDUCTOR_ADVANCED),
|
||||
@@ -505,19 +505,19 @@ public final class Tier
|
||||
ULTIMATE(5, 1, 100000, new ColourRGBA(0.2, 0.2, 0.2, 1), TransmitterType.THERMODYNAMIC_CONDUCTOR_ULTIMATE);
|
||||
|
||||
public double inverseConduction;
|
||||
private double baseConduction;
|
||||
private final double baseConduction;
|
||||
|
||||
public double inverseHeatCapacity;
|
||||
private double baseHeatCapacity;
|
||||
private final double baseHeatCapacity;
|
||||
|
||||
public double inverseConductionInsulation;
|
||||
private double baseConductionInsulation;
|
||||
private final double baseConductionInsulation;
|
||||
|
||||
public ColourRGBA baseColour;
|
||||
public final ColourRGBA baseColour;
|
||||
|
||||
public TransmitterType type;
|
||||
public final TransmitterType type;
|
||||
|
||||
private ConductorTier(double inversek, double inverseC, double insulationInversek, ColourRGBA colour, TransmitterType transmitterType)
|
||||
ConductorTier(double inversek, double inverseC, double insulationInversek, ColourRGBA colour, TransmitterType transmitterType)
|
||||
{
|
||||
baseConduction = inverseConduction = inversek;
|
||||
baseHeatCapacity = inverseHeatCapacity = inverseC;
|
||||
@@ -572,7 +572,7 @@ public final class Tier
|
||||
}
|
||||
}
|
||||
|
||||
public static enum FluidTankTier implements ITier
|
||||
public enum FluidTankTier implements ITier
|
||||
{
|
||||
BASIC(14000, 400),
|
||||
ADVANCED(28000, 800),
|
||||
@@ -580,12 +580,12 @@ public final class Tier
|
||||
ULTIMATE(112000, 3200);
|
||||
|
||||
public int storage;
|
||||
private int baseStorage;
|
||||
private final int baseStorage;
|
||||
|
||||
public int output;
|
||||
private int baseOutput;
|
||||
private final int baseOutput;
|
||||
|
||||
private FluidTankTier(int s, int o)
|
||||
FluidTankTier(int s, int o)
|
||||
{
|
||||
baseStorage = storage = s;
|
||||
baseOutput = output = o;
|
||||
@@ -619,7 +619,7 @@ public final class Tier
|
||||
}
|
||||
}
|
||||
|
||||
public static enum GasTankTier implements ITier
|
||||
public enum GasTankTier implements ITier
|
||||
{
|
||||
BASIC(64000, 256),
|
||||
ADVANCED(128000, 512),
|
||||
@@ -627,12 +627,12 @@ public final class Tier
|
||||
ULTIMATE(512000, 2056);
|
||||
|
||||
public int storage;
|
||||
private int baseStorage;
|
||||
private final int baseStorage;
|
||||
|
||||
public int output;
|
||||
private int baseOutput;
|
||||
private final int baseOutput;
|
||||
|
||||
private GasTankTier(int s, int o)
|
||||
GasTankTier(int s, int o)
|
||||
{
|
||||
baseStorage = storage = s;
|
||||
baseOutput = output = o;
|
||||
@@ -666,7 +666,7 @@ public final class Tier
|
||||
}
|
||||
}
|
||||
|
||||
public static enum BinTier implements ITier
|
||||
public enum BinTier implements ITier
|
||||
{
|
||||
BASIC(4096),
|
||||
ADVANCED(8192),
|
||||
@@ -674,9 +674,9 @@ public final class Tier
|
||||
ULTIMATE(262144);
|
||||
|
||||
public int storage;
|
||||
private int baseStorage;
|
||||
private final int baseStorage;
|
||||
|
||||
private BinTier(int s)
|
||||
BinTier(int s)
|
||||
{
|
||||
baseStorage = storage = s;
|
||||
}
|
||||
@@ -705,6 +705,46 @@ public final class Tier
|
||||
dataStream.writeInt(storage);
|
||||
}
|
||||
}
|
||||
|
||||
public enum EquipmentTier implements ITier
|
||||
{
|
||||
BASIC(60000), // Configurator, Network Reader, Seismic Reader
|
||||
ADVANCED(120000), // Electric Bow
|
||||
ELITE(1000000), // Portable Teleporter
|
||||
ULTIMATE(1000000); // Atomic Dissassembler
|
||||
|
||||
public int energy;
|
||||
private final int maxEnergy;
|
||||
|
||||
EquipmentTier(int s)
|
||||
{
|
||||
maxEnergy = energy = s;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseTier getBaseTier()
|
||||
{
|
||||
return BaseTier.values()[ordinal()];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadConfig()
|
||||
{
|
||||
energy = Mekanism.configuration.get("tier", getBaseTier().getName() + "Equipment", maxEnergy).getInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readConfig(ByteBuf dataStream)
|
||||
{
|
||||
energy = dataStream.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeConfig(ByteBuf dataStream)
|
||||
{
|
||||
dataStream.writeInt(energy);
|
||||
}
|
||||
}
|
||||
|
||||
public static void init()
|
||||
{
|
||||
@@ -758,14 +798,14 @@ public final class Tier
|
||||
}
|
||||
}
|
||||
|
||||
public static interface ITier
|
||||
public interface ITier
|
||||
{
|
||||
public BaseTier getBaseTier();
|
||||
BaseTier getBaseTier();
|
||||
|
||||
public void loadConfig();
|
||||
void loadConfig();
|
||||
|
||||
public void readConfig(ByteBuf dataStream);
|
||||
void readConfig(ByteBuf dataStream);
|
||||
|
||||
public void writeConfig(ByteBuf dataStream);
|
||||
void writeConfig(ByteBuf dataStream);
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import java.math.RoundingMode;
|
||||
import java.util.List;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.MekanismConfig;
|
||||
import mekanism.api.MekanismConfig.general;
|
||||
import mekanism.api.energy.EnergizedItemManager;
|
||||
import mekanism.api.energy.IEnergizedItem;
|
||||
@@ -47,7 +48,8 @@ import cpw.mods.fml.common.Optional.Interface;
|
||||
@Interface(iface = "micdoodle8.mods.galacticraft.api.entity.IEntityBreathable", modid = "Galacticraft API")
|
||||
public class EntityRobit extends EntityCreature implements IInventory, ISustainedInventory, IEntityBreathable
|
||||
{
|
||||
public double MAX_ELECTRICITY = 100000;
|
||||
public final double MAX_ELECTRICITY = HP_ENERGY_COST * 100;
|
||||
public static int HP_ENERGY_COST = MekanismConfig.mekce.robitEnergyPerHP;
|
||||
|
||||
public Coord4D homeLocation;
|
||||
|
||||
@@ -498,7 +500,7 @@ public class EntityRobit extends EntityCreature implements IInventory, ISustaine
|
||||
amount = applyPotionDamageCalculations(damageSource, amount);
|
||||
float j = getHealth();
|
||||
|
||||
setEnergy(Math.max(0, getEnergy() - (amount*1000)));
|
||||
setEnergy(Math.max(0, getEnergy() - (amount * HP_ENERGY_COST)));
|
||||
func_110142_aN().func_94547_a(damageSource, j, amount);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import mekanism.api.EnumColor;
|
||||
import mekanism.api.MekanismConfig.general;
|
||||
import mekanism.api.MekanismConfig.mekce;
|
||||
import mekanism.api.util.ListUtils;
|
||||
import mekanism.common.Tier;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.block.Block;
|
||||
@@ -34,7 +35,7 @@ public class ItemAtomicDisassembler extends ItemEnergized
|
||||
|
||||
public ItemAtomicDisassembler()
|
||||
{
|
||||
super(1000000);
|
||||
super(Tier.EquipmentTier.ULTIMATE.energy);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -9,6 +9,7 @@ import mekanism.api.*;
|
||||
import mekanism.api.transmitters.TransmissionType;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.SideData;
|
||||
import mekanism.common.Tier;
|
||||
import mekanism.common.base.ISideConfiguration;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.tile.TileEntityBasicBlock;
|
||||
@@ -39,14 +40,14 @@ import java.util.Random;
|
||||
})
|
||||
public class ItemConfigurator extends ItemEnergized implements IMekWrench, IToolWrench, IToolHammer
|
||||
{
|
||||
public final int ENERGY_PER_CONFIGURE = 400;
|
||||
public final int ENERGY_PER_ITEM_DUMP = 8;
|
||||
public final int ENERGY_PER_CONFIGURE = (int) (MAX_ELECTRICITY/150);
|
||||
public final int ENERGY_PER_ITEM_DUMP = (int) (MAX_ELECTRICITY/500);
|
||||
|
||||
private Random random = new Random();
|
||||
|
||||
public ItemConfigurator()
|
||||
{
|
||||
super(60000);
|
||||
super(Tier.EquipmentTier.BASIC.energy);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package mekanism.common.item;
|
||||
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.api.MekanismConfig;
|
||||
import mekanism.common.Tier;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
@@ -16,9 +18,12 @@ import java.util.List;
|
||||
|
||||
public class ItemElectricBow extends ItemEnergized
|
||||
{
|
||||
|
||||
public final int ENERGY_PER_USE = (int) (MAX_ELECTRICITY/1000);
|
||||
|
||||
public ItemElectricBow()
|
||||
{
|
||||
super(120000);
|
||||
super(Tier.EquipmentTier.ADVANCED.energy);
|
||||
setFull3D();
|
||||
}
|
||||
|
||||
@@ -62,7 +67,7 @@ public class ItemElectricBow extends ItemEnergized
|
||||
|
||||
if(!player.capabilities.isCreativeMode)
|
||||
{
|
||||
setEnergy(itemstack, getEnergy(itemstack) - (getFireState(itemstack) ? 1200 : 120));
|
||||
setEnergy(itemstack, getEnergy(itemstack) - (getFireState(itemstack) ? MekanismConfig.mekce.electricBowPowerCost * 10 : MekanismConfig.mekce.electricBowPowerCost));
|
||||
}
|
||||
|
||||
world.playSoundAtEntity(player, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F);
|
||||
|
||||
@@ -11,6 +11,7 @@ import mekanism.api.transmitters.DynamicNetwork;
|
||||
import mekanism.api.transmitters.IGridTransmitter;
|
||||
import mekanism.api.transmitters.ITransmitterTile;
|
||||
import mekanism.api.transmitters.TransmitterNetworkRegistry;
|
||||
import mekanism.common.Tier;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -20,11 +21,11 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class ItemNetworkReader extends ItemEnergized
|
||||
{
|
||||
public static double ENERGY_PER_USE = 400;
|
||||
public final int ENERGY_PER_USE = (int) (MAX_ELECTRICITY/150);
|
||||
|
||||
public ItemNetworkReader()
|
||||
{
|
||||
super(60000);
|
||||
super(Tier.EquipmentTier.BASIC.energy);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -4,7 +4,9 @@ import java.util.List;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.api.MekanismConfig;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.Tier;
|
||||
import mekanism.common.security.IOwnerItem;
|
||||
import mekanism.common.security.ISecurityTile;
|
||||
import mekanism.common.util.LangUtils;
|
||||
@@ -18,11 +20,13 @@ import net.minecraft.world.World;
|
||||
|
||||
public class ItemPortableTeleporter extends ItemEnergized implements IOwnerItem
|
||||
{
|
||||
static final int baseCost = MekanismConfig.mekce.teleporterBasePowerCost;
|
||||
|
||||
public ItemPortableTeleporter()
|
||||
{
|
||||
super(1000000);
|
||||
super(Tier.EquipmentTier.ELITE.energy);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag)
|
||||
{
|
||||
@@ -78,18 +82,16 @@ public class ItemPortableTeleporter extends ItemEnergized implements IOwnerItem
|
||||
return 0;
|
||||
}
|
||||
|
||||
int neededEnergy = 1000;
|
||||
int distance = (int)entity.getDistance(coords.xCoord, coords.yCoord, coords.zCoord);
|
||||
|
||||
int cost = distance * baseCost/100;
|
||||
|
||||
if(entity.worldObj.provider.dimensionId != coords.dimensionId)
|
||||
{
|
||||
neededEnergy+=10000;
|
||||
cost += baseCost * 10;
|
||||
}
|
||||
|
||||
int distance = (int)entity.getDistance(coords.xCoord, coords.yCoord, coords.zCoord);
|
||||
|
||||
neededEnergy+=(distance*10);
|
||||
|
||||
return neededEnergy;
|
||||
return cost;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -4,6 +4,7 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.api.MekanismConfig;
|
||||
import mekanism.common.base.ISustainedInventory;
|
||||
import mekanism.common.entity.EntityRobit;
|
||||
import mekanism.common.tile.TileEntityChargepad;
|
||||
@@ -22,7 +23,7 @@ public class ItemRobit extends ItemEnergized implements ISustainedInventory
|
||||
{
|
||||
public ItemRobit()
|
||||
{
|
||||
super(100000);
|
||||
super(MekanismConfig.mekce.robitEnergyPerHP * 100);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,6 +3,7 @@ package mekanism.common.item;
|
||||
import mekanism.api.Chunk3D;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.Tier;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -12,11 +13,11 @@ import net.minecraft.world.World;
|
||||
|
||||
public class ItemSeismicReader extends ItemEnergized
|
||||
{
|
||||
public static final double ENERGY_USAGE = 250;
|
||||
public final double ENERGY_USAGE = MAX_ELECTRICITY/250;
|
||||
|
||||
public ItemSeismicReader()
|
||||
{
|
||||
super(12000);
|
||||
super(Tier.EquipmentTier.BASIC.energy);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -90,6 +90,10 @@ public class PacketConfigSync implements IMessageHandler<ConfigSyncMessage, IMes
|
||||
dataStream.writeInt(mekce.atomicDisassemblerPoweredDamage);
|
||||
dataStream.writeInt(mekce.atomicDisassemblerUnpoweredDamage);
|
||||
dataStream.writeInt(mekce.atomicDisassemblerAttackPowerCost);
|
||||
dataStream.writeInt(mekce.electricBowPowerCost);
|
||||
dataStream.writeInt(mekce.robitEnergyPerHP);
|
||||
dataStream.writeInt(mekce.teleporterBasePowerCost);
|
||||
|
||||
|
||||
for(MachineType type : MachineType.getValidMachines())
|
||||
{
|
||||
@@ -291,6 +295,9 @@ public class PacketConfigSync implements IMessageHandler<ConfigSyncMessage, IMes
|
||||
mekce.atomicDisassemblerPoweredDamage = dataStream.readInt();
|
||||
mekce.atomicDisassemblerUnpoweredDamage = dataStream.readInt();
|
||||
mekce.atomicDisassemblerAttackPowerCost = dataStream.readInt();
|
||||
mekce.electricBowPowerCost = dataStream.readInt();
|
||||
mekce.teleporterBasePowerCost = dataStream.readInt();
|
||||
mekce.robitEnergyPerHP = dataStream.readInt();
|
||||
|
||||
for(MachineType type : MachineType.getValidMachines())
|
||||
{
|
||||
|
||||
@@ -11,6 +11,7 @@ import java.util.UUID;
|
||||
|
||||
import mekanism.api.Chunk3D;
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.MekanismConfig;
|
||||
import mekanism.api.Range4D;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.MekanismBlocks;
|
||||
@@ -50,11 +51,10 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import scala.Int;
|
||||
|
||||
public class TileEntityTeleporter extends TileEntityElectricBlock implements IComputerIntegration, IChunkLoader, IFrequencyHandler, IRedstoneControl, ISecurityTile
|
||||
{
|
||||
private MinecraftServer server = MinecraftServer.getServer();
|
||||
private final MinecraftServer server = MinecraftServer.getServer();
|
||||
|
||||
public AxisAlignedBB teleportBounds = null;
|
||||
|
||||
@@ -67,7 +67,9 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements ICo
|
||||
public boolean prevShouldRender;
|
||||
|
||||
public Frequency frequency;
|
||||
|
||||
|
||||
static final int baseCost = MekanismConfig.mekce.teleporterBasePowerCost;
|
||||
|
||||
public List<Frequency> publicCache = new ArrayList<Frequency>();
|
||||
public List<Frequency> privateCache = new ArrayList<Frequency>();
|
||||
public List<Frequency> protectedCache = new ArrayList<Frequency>();
|
||||
@@ -537,17 +539,16 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements ICo
|
||||
|
||||
public int calculateEnergyCost(Entity entity, Coord4D coords)
|
||||
{
|
||||
int energyCost = 1000;
|
||||
int distance = (int)entity.getDistance(coords.xCoord, coords.yCoord, coords.zCoord);
|
||||
|
||||
int cost = distance * baseCost/100;
|
||||
|
||||
if(entity.worldObj.provider.dimensionId != coords.dimensionId)
|
||||
{
|
||||
energyCost+=10000;
|
||||
cost += baseCost * 10;
|
||||
}
|
||||
|
||||
int distance = (int)entity.getDistance(coords.xCoord, coords.yCoord, coords.zCoord);
|
||||
energyCost+=(distance*10);
|
||||
|
||||
return energyCost;
|
||||
return cost;
|
||||
}
|
||||
|
||||
public boolean hasFrame()
|
||||
|
||||
Reference in new issue
Block a user