summaryrefslogtreecommitdiff
path: root/ihl/processing/invslots
diff options
context:
space:
mode:
Diffstat (limited to 'ihl/processing/invslots')
-rw-r--r--ihl/processing/invslots/InvSlotUpgradeIHL.java61
1 files changed, 61 insertions, 0 deletions
diff --git a/ihl/processing/invslots/InvSlotUpgradeIHL.java b/ihl/processing/invslots/InvSlotUpgradeIHL.java
new file mode 100644
index 0000000..5c1fff9
--- /dev/null
+++ b/ihl/processing/invslots/InvSlotUpgradeIHL.java
@@ -0,0 +1,61 @@
+package ihl.processing.invslots;
+
+import ic2.core.Ic2Items;
+import ic2.core.block.TileEntityInventory;
+import ic2.core.block.invslot.InvSlot;
+import ihl.utils.IHLUtils;
+import net.minecraft.item.ItemStack;
+
+public class InvSlotUpgradeIHL extends InvSlot {
+
+ public InvSlotUpgradeIHL(int count) {
+ super(count);
+ }
+
+ public InvSlotUpgradeIHL(TileEntityInventory base, int oldStartIndex, Access access, int count, InvSide side) {
+ super(base, "invSlotUpgrade", oldStartIndex, access, count, side);
+ }
+
+ public double getPowerConsumtionMultiplier() {
+ double base = 1d;
+ for (int i = 0; i < this.size(); i++) {
+ if (IHLUtils.isItemStacksIsEqual(this.get(i), Ic2Items.overclockerUpgrade, false)) {
+ int i1 = this.get(i).stackSize;
+ while (i1-- > 0 && base < 600) {
+ base *= 1.6f;
+ }
+ }
+ }
+ return base;
+ }
+
+ public float getProgressMultiplier() {
+ float base = 1f;
+ for (int i = 0; i < this.size(); i++) {
+ if (IHLUtils.isItemStacksIsEqual(this.get(i), Ic2Items.overclockerUpgrade, false)) {
+ int i1 = this.get(i).stackSize;
+ while (i1-- > 0 && base < 600) {
+ base *= 1.428571429f;
+ }
+ }
+ }
+ return base;
+ }
+
+ public int getAdditionalEnergyStorage() {
+ int base = 0;
+ for (int i = 0; i < this.size(); i++) {
+ if (IHLUtils.isItemStacksIsEqual(this.get(i), Ic2Items.energyStorageUpgrade, false)) {
+ base += this.get(i).stackSize * 10000;
+ }
+ }
+ return base;
+ }
+
+ @Override
+ public boolean accepts(ItemStack stack) {
+ return IHLUtils.isItemStacksIsEqual(stack, Ic2Items.overclockerUpgrade, false) ||
+ IHLUtils.isItemStacksIsEqual(stack, Ic2Items.energyStorageUpgrade, false);
+ }
+
+}