diff --git a/src/main/java/crazypants/enderio/config/Config.java b/src/main/java/crazypants/enderio/config/Config.java index 2d9fdcd647..e12ba7d2c2 100644 --- a/src/main/java/crazypants/enderio/config/Config.java +++ b/src/main/java/crazypants/enderio/config/Config.java @@ -288,6 +288,10 @@ public String lc() { public static int maxPhotovoltaicAdvancedOutputRF = 40; public static int maxPhotovoltaicVibrantOutputRF = 160; + public static int photovoltaicCellCapacityRF = 10000; + public static int photovoltaicAdvancedCellCapacityRF = 10000; + public static int photovoltaicVibrantCellCapacityRF = 10000; + public static int zombieGeneratorRfPerTick = 80; public static int zombieGeneratorTicksPerBucketFuel = 12000; @@ -808,6 +812,26 @@ public static void processConfig(Configuration config) { "Maximum output in RF/t of the Vibrant Photovoltaic Panels.") .getInt(maxPhotovoltaicVibrantOutputRF); + photovoltaicCellCapacityRF = config.get( + sectionPower.name, + "photovoltaicCellCapacityRF", + photovoltaicCellCapacityRF, + "Maximum capacity in RF/t of the Photovoltaic Panels.").getInt(photovoltaicCellCapacityRF); + photovoltaicAdvancedCellCapacityRF = config + .get( + sectionPower.name, + "photovoltaicAdvancedCellCapacityRF", + photovoltaicAdvancedCellCapacityRF, + "Maximum capacity in RF/t of the Advanced Photovoltaic Panels.") + .getInt(photovoltaicAdvancedCellCapacityRF); + photovoltaicVibrantCellCapacityRF = config + .get( + sectionPower.name, + "photovoltaicVibrantCellCapacityRF", + photovoltaicVibrantCellCapacityRF, + "Maximum capacity in RF/t of the Vibrant Photovoltaic Panels.") + .getInt(photovoltaicVibrantCellCapacityRF); + useAlternateBinderRecipe = config .get( sectionRecipe.name, diff --git a/src/main/java/crazypants/enderio/machine/solar/SolarPanelNetwork.java b/src/main/java/crazypants/enderio/machine/solar/SolarPanelNetwork.java index 15bb12e469..4999c8abfa 100644 --- a/src/main/java/crazypants/enderio/machine/solar/SolarPanelNetwork.java +++ b/src/main/java/crazypants/enderio/machine/solar/SolarPanelNetwork.java @@ -10,6 +10,7 @@ import cofh.api.energy.EnergyStorage; import com.google.common.collect.Lists; +import crazypants.enderio.config.Config; public class SolarPanelNetwork { @@ -25,12 +26,13 @@ public class SolarPanelNetwork { public SolarPanelNetwork() { panels = Lists.newArrayList(); - energy = new EnergyStorage(ENERGY_PER); + energy = new EnergyStorage(getCapacity()); } SolarPanelNetwork(TileEntitySolarPanel initial) { this(); panels.add(initial); + energy.setCapacity(getCapacity(initial, 1)); empty = false; } @@ -83,8 +85,42 @@ void removeFromNetwork(TileEntitySolarPanel panel) { destroyNetwork(); } + private int getCapacity() { + int capacity = ENERGY_PER; + + if (panels.size() > 0) { + TileEntitySolarPanel masterPanel = getMaster(); + capacity = getCapacity(masterPanel, panels.size()); + } + + return capacity; + } + + private static int getCapacity(TileEntitySolarPanel panel, int panelsCount) { + int capacity = ENERGY_PER; + + if (panel != null) { + int meta = panel.getBlockMetadata(); + switch (meta) { + case 0: // Default + capacity = Config.photovoltaicCellCapacityRF; + break; + case 1: // Advanced + capacity = Config.photovoltaicAdvancedCellCapacityRF; + break; + case 2: // Vibrant + capacity = Config.photovoltaicVibrantCellCapacityRF; + break; + } + } + + capacity = capacity * panelsCount; + + return capacity; + } + private void updateEnergy() { - energy.setCapacity(ENERGY_PER * panels.size()); + energy.setCapacity(getCapacity()); energy.setMaxExtract(energy.getMaxEnergyStored()); }