Allow dark steel armor to charge other mods' armors

This commit is contained in:
tterrag1098 committed 2015-01-02 01:33:59 -05:00
1 parent 848fc10d37
commit 9fa3d5d645
2 files changed
+4 -1

No files matched your search

@@ -226,6 +226,7 @@ public final class Config {
public static int darkSteelSolarOneCost = 15;
public static int darkSteelSolarTwoGen = 40;
public static int darkSteelSolarTwoCost = 30;
public static boolean darkSteelSolarChargeOthers = true;
public static float darkSteelAnvilDamageChance = 0.024f;
@@ -794,6 +795,8 @@ public final class Config {
"Cost in XP levels of the Solar II upgrade.").getInt();
darkSteelSolarTwoGen = config.get(sectionDarkSteel.name, "darkSteelSolarTwoGen", darkSteelSolarTwoGen,
"RF per SECOND generated by the Solar II upgrade. Split between all equipped DS armors.").getInt();
darkSteelSolarChargeOthers = config.get(sectionDarkSteel.name, "darkSteelSolarChargeOthers", darkSteelSolarChargeOthers,
"If enabled allows the solar upgrade to charge non-darksteel armors that the player is wearing.").getBoolean();
darkSteelSwordSkullChance = (float) config.get(sectionDarkSteel.name, "darkSteelSwordSkullChance", darkSteelSwordSkullChance,
"The base chance that a skull will be dropped when using a powered dark steel sword (0 = no chance, 1 = 100% chance)").getDouble(
@@ -156,7 +156,7 @@ public class DarkSteelController {
for (int i = 0; i < 4 && toAdd > 0; i++) {
ItemStack stack = player.inventory.armorInventory[nextIndex];
if(EnergyUpgrade.loadFromItem(stack) != null) {
if(stack != null && (EnergyUpgrade.loadFromItem(stack) != null || (Config.darkSteelSolarChargeOthers && stack.getItem() instanceof IEnergyContainerItem))) {
toAdd -= ((IEnergyContainerItem) stack.getItem()).receiveEnergy(stack, toAdd, false);
}
nextIndex = (nextIndex + 1) % 4;