mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-08 19:04:46 +00:00
Merge pull request #218 from Thorfusion/EquipCfg
Equipment Config and UI Fixes
This commit is contained in:
13 files changed
+71
-47
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.44
|
||||
alt_version=9, 10, 44
|
||||
mod_version=9.10.45
|
||||
alt_version=9, 10, 45
|
||||
@@ -5,17 +5,17 @@ package mekanism.api.util;
|
||||
*/
|
||||
public class UnitDisplayUtils
|
||||
{
|
||||
public static enum ElectricUnit
|
||||
public enum ElectricUnit
|
||||
{
|
||||
JOULES("Joule", "J"),
|
||||
REDSTONE_FLUX("Redstone Flux", "RF"),
|
||||
MINECRAFT_JOULES("Minecraft Joule", "MJ"),
|
||||
ELECTRICAL_UNITS("Electrical Unit", "EU");
|
||||
|
||||
public String name;
|
||||
public String symbol;
|
||||
public final String name;
|
||||
public final String symbol;
|
||||
|
||||
private ElectricUnit(String s, String s1)
|
||||
ElectricUnit(String s, String s1)
|
||||
{
|
||||
name = s;
|
||||
symbol = s1;
|
||||
@@ -27,20 +27,20 @@ public class UnitDisplayUtils
|
||||
}
|
||||
}
|
||||
|
||||
public static enum TemperatureUnit
|
||||
public enum TemperatureUnit
|
||||
{
|
||||
KELVIN("Kelvin", "K", 0, 1),
|
||||
CELSIUS("Celsius", "°C", 273.15, 1),
|
||||
CELSIUS("Celsius", "C", 273.15, 1),
|
||||
RANKINE("Rankine", "R", 0, 9D/5D),
|
||||
FAHRENHEIT("Fahrenheit", "°F", 459.67, 9D/5D),
|
||||
FAHRENHEIT("Fahrenheit", "F", 459.67, 9D/5D),
|
||||
AMBIENT("Ambient", "+STP", 300, 1);
|
||||
|
||||
public String name;
|
||||
public String symbol;
|
||||
public double zeroOffset;
|
||||
public double intervalSize;
|
||||
public final String name;
|
||||
public final String symbol;
|
||||
public final double zeroOffset;
|
||||
public final double intervalSize;
|
||||
|
||||
private TemperatureUnit(String s, String s1, double offset, double size)
|
||||
TemperatureUnit(String s, String s1, double offset, double size)
|
||||
{
|
||||
name = s;
|
||||
symbol = s1;
|
||||
@@ -60,7 +60,7 @@ public class UnitDisplayUtils
|
||||
}
|
||||
|
||||
/** Metric system of measurement. */
|
||||
public static enum MeasurementUnit
|
||||
public enum MeasurementUnit
|
||||
{
|
||||
FEMTO("Femto", "f", 0.000000000000001D),
|
||||
PICO("Pico", "p", 0.000000000001D),
|
||||
@@ -78,15 +78,15 @@ public class UnitDisplayUtils
|
||||
YOTTA("Yotta", "Y", 1000000000000000000000000D);
|
||||
|
||||
/** long name for the unit */
|
||||
public String name;
|
||||
public final String name;
|
||||
|
||||
/** short unit version of the unit */
|
||||
public String symbol;
|
||||
public final String symbol;
|
||||
|
||||
/** Point by which a number is consider to be of this unit */
|
||||
public double value;
|
||||
/** Point by which a number is considered to be of this unit */
|
||||
public final double value;
|
||||
|
||||
private MeasurementUnit(String s, String s1, double v)
|
||||
MeasurementUnit(String s, String s1, double v)
|
||||
{
|
||||
name = s;
|
||||
symbol = s1;
|
||||
@@ -122,7 +122,7 @@ public class UnitDisplayUtils
|
||||
|
||||
/**
|
||||
* Displays the unit as text. Does handle negative numbers, and will place a negative sign in
|
||||
* front of the output string showing this. Use string.replace to remove the negative sign if
|
||||
* front of the output string showing this. Use "string.replace" to remove the negative sign if
|
||||
* unwanted
|
||||
*/
|
||||
public static String getDisplay(double value, ElectricUnit unit, int decimalPlaces, boolean isShort)
|
||||
@@ -281,7 +281,7 @@ public class UnitDisplayUtils
|
||||
return roundDecimals(d, 2);
|
||||
}
|
||||
|
||||
public static enum EnergyType
|
||||
public enum EnergyType
|
||||
{
|
||||
J,
|
||||
RF,
|
||||
@@ -289,7 +289,7 @@ public class UnitDisplayUtils
|
||||
MJ
|
||||
}
|
||||
|
||||
public static enum TempType
|
||||
public enum TempType
|
||||
{
|
||||
K,
|
||||
C,
|
||||
|
||||
@@ -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(Tier.EquipmentTier.ADVANCED.energy).setUnlocalizedName("EnergyTablet");
|
||||
public static final ItemEnergizedTiered EnergyTablet = (ItemEnergizedTiered)new ItemEnergizedTiered(Tier.EquipmentTier.ADVANCED).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");
|
||||
|
||||
@@ -730,7 +730,7 @@ public final class Tier
|
||||
@Override
|
||||
public void loadConfig()
|
||||
{
|
||||
energy = Mekanism.configuration.get("tier", getBaseTier().getName() + "Equipment", maxEnergy).getInt();
|
||||
energy = Mekanism.configuration.get("tier", getBaseTier().getName() + "EquipmentMaxEnergy", maxEnergy).getInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -29,13 +29,13 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.entity.player.UseHoeEvent;
|
||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||
|
||||
public class ItemAtomicDisassembler extends ItemEnergized
|
||||
public class ItemAtomicDisassembler extends ItemEnergizedTiered
|
||||
{
|
||||
public double HOE_USAGE = 10 * general.DISASSEMBLER_USAGE;
|
||||
|
||||
public ItemAtomicDisassembler()
|
||||
{
|
||||
super(Tier.EquipmentTier.ULTIMATE.energy);
|
||||
super(Tier.EquipmentTier.ULTIMATE);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -52,7 +52,7 @@ public class ItemAtomicDisassembler extends ItemEnergized
|
||||
{
|
||||
super.addInformation(itemstack, entityplayer, list, flag);
|
||||
|
||||
list.add(LangUtils.localize("tooltip.mode") + ": " + EnumColor.INDIGO + getModeName(itemstack));
|
||||
list.add(LangUtils.localize("gui.mode") + ": " + EnumColor.INDIGO + getModeName(itemstack));
|
||||
list.add(LangUtils.localize("tooltip.efficiency") + ": " + EnumColor.INDIGO + getEfficiency(itemstack));
|
||||
}
|
||||
|
||||
|
||||
@@ -38,16 +38,16 @@ import java.util.Random;
|
||||
@InterfaceList({
|
||||
@Interface(iface = "buildcraft.api.tools.IToolWrench", modid = "BuildCraft")
|
||||
})
|
||||
public class ItemConfigurator extends ItemEnergized implements IMekWrench, IToolWrench, IToolHammer
|
||||
public class ItemConfigurator extends ItemEnergizedTiered implements IMekWrench, IToolWrench, IToolHammer
|
||||
{
|
||||
public final int ENERGY_PER_CONFIGURE = (int) (MAX_ELECTRICITY/150);
|
||||
public final int ENERGY_PER_ITEM_DUMP = (int) (MAX_ELECTRICITY/500);
|
||||
public final int ENERGY_PER_CONFIGURE = EquipmentTier.energy/150;
|
||||
public final int ENERGY_PER_ITEM_DUMP = EquipmentTier.energy/500;
|
||||
|
||||
private Random random = new Random();
|
||||
|
||||
public ItemConfigurator()
|
||||
{
|
||||
super(Tier.EquipmentTier.BASIC.energy);
|
||||
super(Tier.EquipmentTier.BASIC);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,14 +16,11 @@ import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemElectricBow extends ItemEnergized
|
||||
public class ItemElectricBow extends ItemEnergizedTiered
|
||||
{
|
||||
|
||||
public final int ENERGY_PER_USE = (int) (MAX_ELECTRICITY/1000);
|
||||
|
||||
public ItemElectricBow()
|
||||
{
|
||||
super(Tier.EquipmentTier.ADVANCED.energy);
|
||||
super(Tier.EquipmentTier.ADVANCED);
|
||||
setFull3D();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package mekanism.common.item;
|
||||
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.Tier;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemEnergizedTiered extends ItemEnergized
|
||||
{
|
||||
/** The Tier used to define this equipment's energy stats. */
|
||||
public Tier.EquipmentTier EquipmentTier;
|
||||
|
||||
public ItemEnergizedTiered(Tier.EquipmentTier tier)
|
||||
{
|
||||
super(0);
|
||||
EquipmentTier = tier;
|
||||
setMaxStackSize(1);
|
||||
setCreativeTab(Mekanism.tabMekanism);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getMaxEnergy(ItemStack itemStack)
|
||||
{
|
||||
return EquipmentTier.energy;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -41,7 +41,7 @@ public class ItemFlamethrower extends ItemMekanism implements IGasItem
|
||||
list.add(LangUtils.localize("tooltip.stored") + " " + gasStack.getGas().getLocalizedName() + ": " + gasStack.amount);
|
||||
}
|
||||
|
||||
list.add(EnumColor.GREY + LangUtils.localize("tooltip.mode") + ": " + EnumColor.GREY + getMode(itemstack).getName());
|
||||
list.add(EnumColor.GREY + LangUtils.localize("gui.mode") + ": " + EnumColor.GREY + getMode(itemstack).getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -68,7 +68,7 @@ public class ItemJetpack extends ItemArmor implements IGasItem, ISpecialArmor
|
||||
list.add(LangUtils.localize("tooltip.stored") + " " + gasStack.getGas().getLocalizedName() + ": " + gasStack.amount);
|
||||
}
|
||||
|
||||
list.add(EnumColor.GREY + LangUtils.localize("tooltip.mode") + ": " + EnumColor.GREY + getMode(itemstack).getName());
|
||||
list.add(EnumColor.GREY + LangUtils.localize("gui.mode") + ": " + EnumColor.GREY + getMode(itemstack).getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,13 +19,13 @@ import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class ItemNetworkReader extends ItemEnergized
|
||||
public class ItemNetworkReader extends ItemEnergizedTiered
|
||||
{
|
||||
public final int ENERGY_PER_USE = (int) (MAX_ELECTRICITY/150);
|
||||
public final int ENERGY_PER_USE = EquipmentTier.energy/150;
|
||||
|
||||
public ItemNetworkReader()
|
||||
{
|
||||
super(Tier.EquipmentTier.BASIC.energy);
|
||||
super(Tier.EquipmentTier.BASIC);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,13 +18,13 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemPortableTeleporter extends ItemEnergized implements IOwnerItem
|
||||
public class ItemPortableTeleporter extends ItemEnergizedTiered implements IOwnerItem
|
||||
{
|
||||
static final int baseCost = MekanismConfig.mekce.teleporterBasePowerCost;
|
||||
|
||||
public ItemPortableTeleporter()
|
||||
{
|
||||
super(Tier.EquipmentTier.ELITE.energy);
|
||||
super(Tier.EquipmentTier.ELITE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,13 +11,13 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemSeismicReader extends ItemEnergized
|
||||
public class ItemSeismicReader extends ItemEnergizedTiered
|
||||
{
|
||||
public final double ENERGY_USAGE = MAX_ELECTRICITY/250;
|
||||
public final int ENERGY_USAGE = EquipmentTier.energy/250;
|
||||
|
||||
public ItemSeismicReader()
|
||||
{
|
||||
super(Tier.EquipmentTier.BASIC.energy);
|
||||
super(Tier.EquipmentTier.BASIC);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user