diff options
| author | Blood-Asp <bloodasphendrik@gmail.com> | 2016-10-30 22:39:40 +0100 |
|---|---|---|
| committer | Blood-Asp <bloodasphendrik@gmail.com> | 2016-10-30 22:39:40 +0100 |
| commit | 814dc25690a60faaaeab710d0dad40fb4386b849 (patch) | |
| tree | dc16a1911f585900367c35a623f9ad02e7e072fa /src | |
| parent | ed724da44d7783705cb8fd503b3f4623b1cf1b86 (diff) | |
| download | GT5-Unofficial-814dc25690a60faaaeab710d0dad40fb4386b849.tar.gz GT5-Unofficial-814dc25690a60faaaeab710d0dad40fb4386b849.tar.bz2 GT5-Unofficial-814dc25690a60faaaeab710d0dad40fb4386b849.zip | |
Modular Armor changes 1
Diffstat (limited to 'src')
28 files changed, 881 insertions, 799 deletions
diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index 2e727f7250..e36d897820 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -21,6 +21,7 @@ import gregtech.common.GT_Proxy; import gregtech.common.GT_RecipeAdder;
import gregtech.common.entities.GT_Entity_Arrow;
import gregtech.common.entities.GT_Entity_Arrow_Potion;
+import gregtech.common.items.armor.components.LoadArmorComponents;
import gregtech.common.items.behaviors.Behaviour_DataOrb;
import gregtech.loaders.load.GT_CoverBehaviorLoader;
import gregtech.loaders.load.GT_FuelLoader;
@@ -537,6 +538,7 @@ public class GT_Mod implements IGT_Mod { new GT_CropLoader().run();
new GT_Worldgenloader().run();
new GT_CoverLoader().run();
+ LoadArmorComponents.init();
GT_RecipeRegistrator.registerUsagesForMaterials(new ItemStack(Blocks.planks, 1), null, false);
GT_RecipeRegistrator.registerUsagesForMaterials(new ItemStack(Blocks.cobblestone, 1), null, false);
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java index ee30d8f4b9..d4d8f9cec7 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java @@ -37,7 +37,7 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch } public GT_MetaTileEntity_Hatch_Maintenance(int aID, String aName, String aNameRegional, int aTier, boolean aAuto) { - super(aID, aName, aNameRegional, aTier, 4, "For automaticly maintaining Multiblocks"); + super(aID, aName, aNameRegional, aTier, 4, "For automatically maintaining Multiblocks"); mAuto = aAuto; } @@ -48,7 +48,7 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch @Override public String[] getDescription() { - if(mAuto)return new String[]{mDescription, "Cannot be shared between Multiblocks!","4 Ducttape, 2 Lubricant Cells","4 Steel Screws, 2 Adv Circuits","For each autorepair"}; + if(mAuto)return new String[]{mDescription,"4 Ducttape, 2 Lubricant Cells","4 Steel Screws, 2 Adv Circuits","For each autorepair"}; return new String[]{mDescription, "Cannot be shared between Multiblocks!"}; } diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index 00ee739ef1..01b8b3c3b2 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -29,6 +29,11 @@ import gregtech.api.util.*; import gregtech.common.entities.GT_Entity_Arrow; import gregtech.common.items.GT_MetaGenerated_Tool_01; import gregtech.common.items.armor.*; +import gregtech.common.items.armor.gui.ContainerBasicArmor; +import gregtech.common.items.armor.gui.ContainerElectricArmor1; +import gregtech.common.items.armor.gui.GuiElectricArmor1; +import gregtech.common.items.armor.gui.GuiModularArmor; +import gregtech.common.items.armor.gui.InventoryArmor; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; @@ -1315,6 +1320,20 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { return getRightItem(aPlayer, ID); } } + if(aID>=100){ + int tSlot = aID / 100; + int ID = aID%100; + switch(ID){ + case 0: + return new ContainerBasicArmor(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getEquipmentInSlot(tSlot))); + case 1: + return new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getEquipmentInSlot(tSlot))); + case 2: + return new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getEquipmentInSlot(tSlot))); + default: + return getRightItem(aPlayer, ID); + } + } TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if ((tTileEntity instanceof IGregTechTileEntity)) { IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); @@ -1355,6 +1374,20 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { return getRightItemGui(aPlayer, ID); } } + if(aID>=100){ + int tSlot = aID / 100; + int ID = aID%100; + switch(ID){ + case 0: + return new GuiModularArmor(new ContainerBasicArmor(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getEquipmentInSlot(tSlot))), aPlayer); + case 1: + return new GuiElectricArmor1(new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getEquipmentInSlot(tSlot))), aPlayer); + case 2: + return new GuiElectricArmor1(new ContainerElectricArmor1(aPlayer, new InventoryArmor(ModularArmor_Item.class, aPlayer.getEquipmentInSlot(tSlot))), aPlayer); + default: + return getRightItem(aPlayer, ID); + } + } TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if ((tTileEntity instanceof IGregTechTileEntity)) { IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity(); diff --git a/src/main/java/gregtech/common/items/armor/ArmorCalculation.java b/src/main/java/gregtech/common/items/armor/ArmorCalculation.java index 440d6aaef9..7c8100db62 100644 --- a/src/main/java/gregtech/common/items/armor/ArmorCalculation.java +++ b/src/main/java/gregtech/common/items/armor/ArmorCalculation.java @@ -14,361 +14,10 @@ import thaumcraft.api.nodes.IRevealer; public class ArmorCalculation { public static float[] calculateArmor(ItemStack[] parts) { - float[] def = new float[32]; - def[0] = 0; // Weight - def[1] = 1; // physical Def - def[2] = 1; // projectileDef - def[3] = 1; // fireDef - def[4] = 1; // magicDef - def[5] = 1; // explosionDef - def[6] = 0; // radiationDef - def[7] = 0; // electricDef - def[8] = 0; // witherDef - def[9] = 0; // fallDef - def[10] = 0; // Thorns - def[11] = 0; // ItemMagnet - def[12] = 0; // ItemCharge - def[13] = 0; // Thaumcraft goggles - def[14] = 0; // Nightvision - def[15] = 0; // tankCap - def[16] = 0; // motorPower - def[17] = 0; // motorEU - def[18] = 0; // pistonPower - def[19] = 0; // pistonEU - def[20] = 0; // ElectrolyzerPower - def[21] = 0; // ElectrolyzerEU - def[22] = 0; // FieldEmmiterPower - def[23] = 0; // FieldEmmiterEU - def[24] = 0; // JetpackFuelPower - def[25] = 0; // FuelUsage - def[26] = 0; // JetpackEUPower - def[27] = 0; // JetpackEU - def[28] = 0; // AntiGravPower - def[29] = 0; // AntiGravEU - def[30] = 0; // ProcessingPower - def[31] = 0; // ProcessingPowerUsed - - if (parts != null) { - def[12] = 0.0f; - for (int i = 0; i < parts.length; i++) { - if (parts[i] != null) { - ItemData data = GT_OreDictUnificator.getItemData(parts[i]); - if (data != null && (data.mPrefix == OrePrefixes.plate || data.mPrefix == OrePrefixes.plateAlloy)) { - // Weight - def[0] = def[0] + Values.INSTANCE.getValues(data.mMaterial.mMaterial).weight; - if (data.mPrefix == OrePrefixes.plateAlloy && data.mMaterial.mMaterial == Materials.Iridium) { - def[0] = def[0] - 20; - } - // physicalDef - float tmp = Values.INSTANCE.getValues(data.mMaterial.mMaterial).physicalDef; - if (data.mPrefix == OrePrefixes.plateAlloy && data.mMaterial.mMaterial == Materials.Iridium) { - tmp = 0.27f; - } - if (tmp > 0.0f) { - def[1] = def[1] - (tmp * def[1]); - } - // projectileDef - tmp = Values.INSTANCE.getValues(data.mMaterial.mMaterial).projectileDef; - if (data.mPrefix == OrePrefixes.plateAlloy && data.mMaterial.mMaterial == Materials.Iridium) { - tmp = 0.27f; - } - if (tmp > 0.0f) { - def[2] = def[2] - (tmp * def[2]); - } - // fireDef - tmp = Values.INSTANCE.getValues(data.mMaterial.mMaterial).fireDef; - if (data.mPrefix == OrePrefixes.plateAlloy && data.mMaterial.mMaterial == Materials.Iridium) { - tmp = 0.25f; - } - if (tmp > 0.0f) { - def[3] = def[3] - (tmp * def[3]); - } - // magicDef - tmp = Values.INSTANCE.getValues(data.mMaterial.mMaterial).magicDef; - if (data.mPrefix == OrePrefixes.plateAlloy && data.mMaterial.mMaterial == Materials.Iridium) { - tmp = 0.25f; - } - if (tmp > 0.0f) { - def[4] = def[4] - (tmp * def[4]); - } - // explosionDef - tmp = Values.INSTANCE.getValues(data.mMaterial.mMaterial).explosionDef; - if (data.mPrefix == OrePrefixes.plateAlloy && data.mMaterial.mMaterial == Materials.Iridium) { - tmp = 0.27f; - } - if (tmp > 0.0f) { - def[5] = def[5] - (tmp * def[5]); - } - if (data.mPrefix == OrePrefixes.plate && data.mMaterial.mMaterial == Materials.Rubber) { - def[7] = def[7] + 0.25f; - def[9] = def[9] + 2.0f; - } - if (data.mPrefix == OrePrefixes.plate && data.mMaterial.mMaterial == Materials.Lead) { - def[6] = def[6] + 0.30f; - } - if (data.mPrefix == OrePrefixes.plate && data.mMaterial.mMaterial == Materials.Plastic) { - def[7] = def[7] + 0.25f; - } - if (data.mPrefix == OrePrefixes.plate && data.mMaterial.mMaterial == Materials.NeodymiumMagnetic) { - def[11] = def[11] + 2.0f; - } - if (data.mPrefix == OrePrefixes.plate && data.mMaterial.mMaterial == Materials.NetherStar) { - def[8] = def[8] + 0.20f; - } - if (data.mPrefix == OrePrefixes.plate && data.mMaterial.mMaterial == Materials.InfusedFire) { - def[10] = def[10] + 3.0f; - } - if (data.mPrefix == OrePrefixes.plate && data.mMaterial.mMaterial == Materials.InfusedEntropy) { - def[10] = def[10] + 4.0f; - } - } else if (GT_ModHandler.isChargerItem(parts[i])) { - def[12] = def[12] + (float) ic2.api.item.ElectricItem.manager.getCharge(parts[i]); - def[0] = (float) (def[0] + Math.pow(ic2.api.item.ElectricItem.manager.getCharge(parts[i]), 0.33f)); - } - else if (Loader.isModLoaded("Thaumcraft") && parts[i].getItem() instanceof IRevealer) { - def[13] = 1; - def[31] += 100; - } - else if (parts[i].getItem().getUnlocalizedName().equals("ic2.itemNightvisionGoggles")) { - def[14] = 1; - def[31] += 100; - } else if (parts[i].getItem().getUnlocalizedName().equals("gt.meta.spring")) {// Once readded: GT Motors - switch (parts[i].getItem().getDamage(parts[i])) { - case 8630: - def[16] += 200; // motorPower - def[17] += 50; - def[31] += 10; - break; - case 8631: - def[16] += 300; // motorPower - def[17] += 100; - def[31] += 20; - break; - case 8632: - def[16] += 400; // motorPower - def[17] += 200; - def[31] += 50; - break; - case 8633: - def[16] += 500; // motorPower - def[17] += 400; - def[31] += 100; - break; - case 8634: - def[16] += 600; // motorPower - def[17] += 800; - def[31] += 200; - break; - } - } else if (parts[i].getItem().getUnlocalizedName().equals("gt.meta.springSmall")) {// Once Readded: GT Electric Pistons - switch (parts[i].getItem().getDamage(parts[i])) { - case 8630: - def[18] += 3; - def[19] += 200; - def[31] += 10; - break; - case 8631: - def[18] += 4; - def[19] += 300; - def[31] += 20; - break; - case 8632: - def[18] += 5; - def[19] += 450; - def[31] += 50; - break; - case 8633: - def[18] += 6; - def[19] += 800; - def[31] += 100; - break; - case 8634: - def[18] += 7; - def[19] += 1600; - def[31] += 200; - break; - } - } else if (parts[i].getItem().getUnlocalizedName().equals("gt.meta.Electrolyzer")) {// Once Readded: GT Electrolyzer - switch (parts[i].getItem().getDamage(parts[i])) { - case 8630: - def[20] += 10; // ElectrolyzerPower - def[21] += 1; // ElectrolyzerEU - def[31] += 50; - break; - case 8631: - def[20] += 20; // ElectrolyzerPower - def[21] += 4; // ElectrolyzerEU - def[31] += 100; - break; - case 8632: - def[20] += 40; // ElectrolyzerPower - def[21] += 16; // ElectrolyzerEU - def[31] += 150; - break; - case 8633: - def[20] += 80; // ElectrolyzerPower - def[21] += 64; // ElectrolyzerEU - def[31] += 200; - break; - case 8634: - def[20] += 160; // ElectrolyzerPower - def[21] += 256; // ElectrolyzerEU - def[31] += 250; - break; - } - } else if (parts[i].getItem().equals(ItemList.Cell_Empty.getItem())) { - def[15] += 8000; - } else if (parts[i].getItem().getUnlocalizedName().equals("gt.meta.cell")) {// Once Readded: GT Fluid Cells (tank) - switch (parts[i].getItem().getDamage(parts[i])) { - case 8630: // steel fluid cell - def[15] += 16000; - break; - case 8631: // tungsten fluid cell - def[15] += 64000; - break; - } - } else if (parts[i].getItem().getUnlocalizedName().equals("gt.meta.emmiter")) {// Once Readded: GT Field Emmiter - switch (parts[i].getItem().getDamage(parts[i])) { - case 8630: - def[22] += 1; // FieldEmmiterPower - def[23] += 1; // FieldEmmiterEU - def[31] += 100; - break; - case 8631: - def[22] += 2; // FieldEmmiterPower - def[23] += 4; // FieldEmmiterEU - def[31] += 200; - break; - case 8632: - def[22] += 3; // FieldEmmiterPower - def[23] += 16; // FieldEmmiterEU - def[31] += 300; - break; - case 8633: - def[22] += 4; // FieldEmmiterPower - def[23] += 64; // FieldEmmiterEU - def[31] += 400; - break; - case 8634: - def[22] += 5; // FieldEmmiterPower - def[23] += 512; // FieldEmmiterEU - def[31] += 500; - break; - } - } else if (data !=null && data.mPrefix == OrePrefixes.circuit) {// processing power stuff - if (data.mMaterial.mMaterial == Materials.Basic) { - def[30] += 100; - } else if (data.mMaterial.mMaterial == Materials.Good) { - def[30] += 200; - } else if (data.mMaterial.mMaterial == Materials.Advanced) { - def[30] += 300; - } else if (data.mMaterial.mMaterial == Materials.Data) { - def[30] += 400; - } else if (data.mMaterial.mMaterial == Materials.Elite) { - def[30] += 500; - } else if (data.mMaterial.mMaterial == Materials.Master) { - def[30] += 600; - } - } else if (parts[i].getItem().getUnlocalizedName().equals("gte.meta.jetpack")) {// jeptack parts - switch (parts[i].getItem().getDamage(parts[i])) { - case 0: - def[24] += 50; // JetpackFuelPower - def[25] += 1; // FuelUsage - def[31] += 10; - break; - case 1: - def[24] += 75; // JetpackFuelPower - def[25] += 2; // FuelUsage - def[31] += 20; - break; - case 2: - def[24] += 100; // JetpackFuelPower - def[25] += 4; // FuelUsage - def[31] += 30; - break; - case 3: - def[24] += 125; // JetpackFuelPower - def[25] += 8; // FuelUsage - def[31] += 40; - break; - case 4: - def[24] += 150; // JetpackFuelPower - def[25] += 16; // FuelUsage - def[31] += 50; - break; - case 5: - def[26] += 20; // JetpackEUPower - def[27] += 8; // JetpackEU - def[31] += 30; - break; - case 6: - def[26] += 30; // JetpackEUPower - def[27] += 16; // JetpackEU - def[31] += 60; - break; - case 7: - def[26] += 40; // JetpackEUPower - def[27] += 32; // JetpackEU - def[31] += 90; - break; - case 8: - def[26] += 50; // JetpackEUPower - def[27] += 64; // JetpackEU - def[31] += 120; - break; - case 9: - def[26] += 60; // JetpackEUPower - def[27] += 128; // JetpackEU - def[31] += 150; - break; - case 10: - def[28] += 100; // AntiGravPower - def[29] += 32; // AntiGravEU - def[31] += 100; - break; - case 11: - def[28] += 133; // AntiGravPower - def[29] += 64; // AntiGravEU - def[31] += 200; - break; - case 12: - def[28] += 166; // AntiGravPower - def[29] += 128; // AntiGravEU - def[31] += 300; - break; - case 13: - def[28] += 200; // AntiGravPower - def[29] += 256; // AntiGravEU - def[31] += 400; - break; - case 14: - def[28] += 233; // AntiGravPower - def[29] += 512; // AntiGravEU - def[31] += 500; - break; - } - } else if (true) { - //System.out.println("Unknown Item: " + parts[i].getItem().getUnlocalizedName()); - } - } - } - } - def[1] = 1 - def[1]; - def[2] = 1 - def[2]; - def[3] = 1 - def[3]; - def[4] = 1 - def[4]; - def[5] = 1 - def[5]; - if (def[7] > 0.95) { - def[7] = 1.0f; - } - if (def[8] > 0.98) { - def[8] = 1.0f; - } - return def; + return new float[32]; } public static int deChargeBatterys(ItemStack[] parts, int amount) { - // System.out.println("deCharge " + amount); int decharged = 0; for (int i = 0; decharged < amount && i < parts.length; i++) { if (GT_ModHandler.isChargerItem(parts[i])) { diff --git a/src/main/java/gregtech/common/items/armor/ArmorData.java b/src/main/java/gregtech/common/items/armor/ArmorData.java index 79c6a20ffa..c6ef4d5bc0 100644 --- a/src/main/java/gregtech/common/items/armor/ArmorData.java +++ b/src/main/java/gregtech/common/items/armor/ArmorData.java @@ -4,13 +4,20 @@ import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.text.NumberFormat; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Locale; +import java.util.Map; import java.util.Random; import gregtech.api.damagesources.GT_DamageSources; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; +import gregtech.common.items.armor.components.ArmorComponent; +import gregtech.common.items.armor.components.StatType; +import gregtech.common.items.armor.gui.ContainerBasicArmor; +import gregtech.common.items.armor.gui.ContainerModularArmor; +import gregtech.common.items.armor.gui.InventoryArmor; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -32,56 +39,59 @@ public class ArmorData { public ArmorData helmet; public ArmorData chestplate; public ArmorData leggings; - public ArmorData boots; + public ArmorData boots; - public boolean fullArmor; - public boolean fullRadiationDef; - public boolean fullElectricDef; + public Map<StatType,Float> mStat = new HashMap<StatType,Float>(); + public Map<StatType,Boolean> mBStat = new HashMap<StatType,Boolean>(); - public float fallDef; - public float physicalDef; - public float projectileDef; - public float fireDef; - public float magicDef; - public float explosionDef; - public float radiationDef; - public float electricDef; - public float witherDef; - - public float thorns; - public float thornsSingle; - public int magnet; - public int magnetSingle; - - public int partsCharge; +// public boolean fullArmor; +// public boolean fullRadiationDef; +// public boolean fullElectricDef; +// +// public float fallDef; +// public float physicalDef; +// public float projectileDef; +// public float fireDef; +// public float magicDef; +// public float explosionDef; +// public float radiationDef; +// public float electricDef; +// public float witherDef; +// +// public float thorns; +// public float thornsSingle; +// public int magnet; +// public int magnetSingle; +// +// public int partsCharge; public int maxCharge; public int charge; - public boolean thaumicGoggles; - public boolean nightVision; - public boolean potionInjector; - public boolean autoFeeder; +// public boolean thaumicGoggles; +// public boolean nightVision; +// public boolean potionInjector; +// public boolean autoFeeder; public FluidStack fluid; - public int tankCap; - - public int weight; - public int maxWeight; - public int processingPower; - public int processingPowerUsed; - public int partProcessing; - public int partProcessingUsed; - - public int motorPower; - public int motorEUusage; - public int pistonJumpboost; - public int pistonEUusage; - public int electrolyzerProd; - public int electrolyzerEUusage; - public int fieldGenCap; - public int fieldGenEUusage; - - public int jetpackMaxWeight; - public int antiGravMaxWeight; +// public int tankCap; +// +// public int weight; + public float maxWeight; +// public int processingPower; +// public int processingPowerUsed; +// public int partProcessing; +// public int partProcessingUsed; +// +// public int motorPower; +// public int motorEUusage; +// public int pistonJumpboost; +// public int pistonEUusage; +// public int electrolyzerProd; +// public int electrolyzerEUusage; +// public int fieldGenCap; +// public int fieldGenEUusage; +// +// public int jetpackMaxWeight; +// public int antiGravMaxWeight; public ArmorData(EntityPlayer player, ItemStack stack, int type, int tier) { this.type = type; @@ -118,45 +128,14 @@ public class ArmorData { } public ArmorData calculateArmor(ItemStack[] parts) { - float[] def = ArmorCalculation.calculateArmor(parts); - weight = (int) def[0]; - physicalDef = def[1]; - projectileDef = def[2]; - fireDef = def[3]; - magicDef = def[4]; - explosionDef = def[5]; - radiationDef = def[6]; - electricDef = def[7]; - witherDef = def[8]; - fallDef = def[9]; - thornsSingle = def[10]; - magnetSingle = (int) def[11]; - if (armorTier > 0) { - partsCharge = (int) def[12]; - thaumicGoggles = def[13] > 0.5f; - nightVision = def[14] > 0.5f; - tankCap = (int) def[15]; // tankCap - motorPower = (int) def[16]; // motorPower - motorEUusage = (int) def[17]; // motorEU - pistonJumpboost = (int) def[18]; // pistonPower - fallDef += pistonJumpboost; - pistonEUusage = (int) def[19]; // pistonEU - electrolyzerProd = (int) def[20]; // ElectrolyzerPower - electrolyzerEUusage = (int) def[21]; // ElectrolyzerEU - fieldGenCap = (int) def[22]; // FieldEmmiterPower - fieldGenEUusage = (int) def[23]; // FieldEmmiterEU - jetpackMaxWeight = (int) def[24] + (int) def[26]; // JetpackFuelPower// JetpackEUPower - def[25] = 0; // FuelUsage - def[27] = 0; // JetpackEU - antiGravMaxWeight = (int) def[28]; // AntiGravPower - def[29] = 0; // AntiGravEU - if (armorTier == 2) { - partProcessing = (int) def[30] + 500; // ProcessingPower - } else { - partProcessing = (int) def[30] + 300; // ProcessingPower - } - partProcessingUsed = (int) def[31]; // ProcessingPowerUsed + mStat.clear(); + mBStat.clear(); + for(ItemStack tPart : parts){ + if(tPart!=null && ArmorComponent.mStacks.containsKey(tPart.getUnlocalizedName())) + ArmorComponent.mStacks.get(tPart.getUnlocalizedName()).calculateArmor(this); } + for(StatType tType : StatType.values())if(!mStat.containsKey(tType))mStat.put(tType, .0f); + for(StatType tType : StatType.values())if(!mBStat.containsKey(tType))mBStat.put(tType, false); updateTooltip(); return this; } @@ -165,67 +144,67 @@ public class ArmorData { List<String> tagList = new ArrayList<String>(); String tmp2 = ""; if (maxWeight > 4000) { - tmp2 = " " + GT_LanguageManager.getTranslation("hav"); + tmp2 = " " + GT_LanguageManager.getTranslation("Too Heavy"); } if (maxCharge != 0) { DecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.US); DecimalFormatSymbols symbols = formatter.getDecimalFormatSymbols(); symbols.setGroupingSeparator(' '); if (type == 0) { - if (thaumicGoggles) { - tagList.add(GT_LanguageManager.getTranslation("thaum")); + if (mBStat.get(StatType.THAUMICGOGGLES)) { + tagList.add(GT_LanguageManager.getTranslation("Thaumic Goggles installed")); } - if (nightVision) { - tagList.add(GT_LanguageManager.getTranslation("night")); + if (mBStat.get(StatType.NIGHTVISION)) { + tagList.add(GT_LanguageManager.getTranslation("Nightvision installed")); } } - tagList.add("EU: " + formatter.format(charge + partsCharge)); + tagList.add("EU: " + formatter.format(charge + mStat.get(StatType.PARTSCHARGE))); if (type == 2) { - tagList.add(GT_LanguageManager.getTranslation("jum") + ": " + pistonJumpboost / 3 + "m"); + tagList.add(GT_LanguageManager.getTranslation("Jumpboost") + ": " + mStat.get(StatType.PISTONJUMPBOOST) / 3 + "m"); } - if (type == 2 && pistonJumpboost > 0) { - tagList.add(GT_LanguageManager.getTranslation("uph")); + if (type == 2 && mStat.get(StatType.PISTONJUMPBOOST) > 0) { + tagList.add(GT_LanguageManager.getTranslation("Uphill step assist active")); } - if (type == 2 && motorPower > 0) { - tagList.add(GT_LanguageManager.getTranslation("speass") + ": " + motorPower); - tagList.add(GT_LanguageManager.getTranslation("motuse") + ": " + motorEUusage + " EU"); + if (type == 2 && mStat.get(StatType.MOTPRPOWER) > 0) { + tagList.add(GT_LanguageManager.getTranslation("Speedup") + ": " + mStat.get(StatType.MOTPRPOWER)); + tagList.add(GT_LanguageManager.getTranslation("Motor energy usage") + ": " + mStat.get(StatType.MOTOREUUSAGE) + " EU"); if (maxWeight > 4000) { - tagList.add(GT_LanguageManager.getTranslation("over")); + tagList.add(GT_LanguageManager.getTranslation("Too Heavy!!!")); } } - tagList.add(GT_LanguageManager.getTranslation("pro1") + " " + partProcessing + " " + GT_LanguageManager.getTranslation("pro3")); - tagList.add(GT_LanguageManager.getTranslation("pro2") + ": " + partProcessingUsed + " " + GT_LanguageManager.getTranslation("pro3")); - if (type == 0 && electrolyzerProd > 0) { - tagList.add(GT_LanguageManager.getTranslation("elec1") + " " + electrolyzerProd / 2 + GT_LanguageManager.getTranslation("elec2")); + tagList.add(GT_LanguageManager.getTranslation("Processing power ") + " " + mStat.get(StatType.PARTPROCESSING) + " " + GT_LanguageManager.getTranslation("")); + tagList.add(GT_LanguageManager.getTranslation("Processing power used") + ": " + mStat.get(StatType.PARTPROCESSINGUSED) + " " + GT_LanguageManager.getTranslation("")); + if (type == 0 && mStat.ge |
