aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kekztech/common/itemBlocks/ItemBlockLapotronicEnergyUnit.java
blob: e0f016afae52fbd29280dd9d48d109aac378a34e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
package kekztech.common.itemBlocks;

import static com.google.common.math.LongMath.pow;

import java.math.BigInteger;
import java.util.List;

import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;

import gregtech.api.enums.GTValues;
import gregtech.api.util.GTUtility;

public class ItemBlockLapotronicEnergyUnit extends ItemBlock {

    public ItemBlockLapotronicEnergyUnit(Block block) {
        super(block);
    }

    @Override
    public int getMetadata(int meta) {
        return meta;
    }

    @Override
    public boolean getHasSubtypes() {
        return true;
    }

    @Override
    public String getUnlocalizedName(ItemStack stack) {
        return super.getUnlocalizedName() + "." + stack.getItemDamage();
    }

    // 5 Minutes, 5 mins * 60s * 20 ticks.
    public static long LSC_time_between_wireless_rebalance_in_ticks = 5L * 60L * 20L;

    // 60 Trillion EU.
    public static BigInteger LSC_wireless_eu_cap = BigInteger.valueOf(60 * pow(10, 12));

    // 10 Billion EU/t
    private static final BigInteger UHV_cap_eu_per_tick = LSC_wireless_eu_cap
        .divide(BigInteger.valueOf(LSC_time_between_wireless_rebalance_in_ticks));

    // 6 Quadrillion EU.
    public static BigInteger UEV_wireless_eu_cap = BigInteger.valueOf(100 * 60 * pow(10, 12));

    // 1 Trillion EU/t
    private static final BigInteger UEV_cap_eu_per_tick = UEV_wireless_eu_cap
        .divide(BigInteger.valueOf(LSC_time_between_wireless_rebalance_in_ticks));

    // 600 Quadrillion EU.
    public static BigInteger UIV_wireless_eu_cap = BigInteger.valueOf(60 * pow(10, 16));

    // 100 Trillion EU/t
    private static final BigInteger UIV_cap_eu_per_tick = UIV_wireless_eu_cap
        .divide(BigInteger.valueOf(LSC_time_between_wireless_rebalance_in_ticks));

    // 60 Quintillion EU.
    public static BigInteger UMV_wireless_eu_cap = UIV_wireless_eu_cap.multiply(BigInteger.valueOf(100));

    // 10 Quadrillion EU/t
    private static final BigInteger UMV_cap_eu_per_tick = UMV_wireless_eu_cap
        .divide(BigInteger.valueOf(LSC_time_between_wireless_rebalance_in_ticks));

    public static long EV_cap_storage = 60_000_000L;
    public static long IV_cap_storage = 600_000_000L;
    public static long LuV_cap_storage = 6_000_000_000L;
    public static long ZPM_cap_storage = 60_000_000_000L;
    public static long UV_cap_storage = 600_000_000_000L;
    public static long UHV_cap_storage = Long.MAX_VALUE;
    public static long UEV_cap_storage = Long.MAX_VALUE;
    public static long UIV_cap_storage = Long.MAX_VALUE;
    public static BigInteger UMV_cap_storage = BigInteger.valueOf(UIV_cap_storage)
        .pow(2);

    @SuppressWarnings("unchecked")
    @Override
    public void addInformation(ItemStack stack, EntityPlayer player, List lines, boolean advancedTooltips) {
        lines.add(StatCollector.translateToLocal("tile.kekztech_lapotronicenergyunit_block.desc"));
        switch (stack.getItemDamage()) {
            case 1:
                lines.add(
                    "Capacity: " + EnumChatFormatting.RED
                        + GTUtility.formatNumbers(IV_cap_storage)
                        + EnumChatFormatting.GRAY
                        + "EU");
                break;
            case 2:
                lines.add(
                    "Capacity: " + EnumChatFormatting.RED
                        + GTUtility.formatNumbers(LuV_cap_storage)
                        + EnumChatFormatting.GRAY
                        + "EU");
                break;
            case 3:
                lines.add(
                    "Capacity: " + EnumChatFormatting.RED
                        + GTUtility.formatNumbers(ZPM_cap_storage)
                        + EnumChatFormatting.GRAY
                        + "EU");
                break;
            case 4:
                lines.add(
                    "Capacity: " + EnumChatFormatting.RED
                        + GTUtility.formatNumbers(UV_cap_storage)
                        + EnumChatFormatting.GRAY
                        + "EU");
                break;
            case 5:
                lines.add(
                    "Capacity: " + EnumChatFormatting.RED
                        + GTUtility.formatNumbers(UHV_cap_storage)
                        + EnumChatFormatting.GRAY
                        + "EU");
                lines.add(
                    "Supports up to " + EnumChatFormatting.RED
                        + GTUtility.formatNumbers(UHV_cap_eu_per_tick)
                        + EnumChatFormatting.GRAY
                        + "EU/t of wireless transfer per "
                        + GTValues.TIER_COLORS[9]
                        + GTValues.VN[9]
                        + EnumChatFormatting.GRAY
                        + " capacitor.");
                break;
            case 6:
                lines.add("Capacity: None");
                break;
            case 7:
                lines.add(
                    "Capacity: " + EnumChatFormatting.RED
                        + GTUtility.formatNumbers(EV_cap_storage)
                        + EnumChatFormatting.GRAY
                        + " EU");
                break;
            case 8:
                lines.add(
                    "Capacity: " + EnumChatFormatting.RED
                        + GTUtility.formatNumbers(UEV_cap_storage)
                        + EnumChatFormatting.GRAY
                        + "EU");
                lines.add(
                    "Supports up to " + EnumChatFormatting.RED
                        + GTUtility.formatNumbers(UEV_cap_eu_per_tick)
                        + EnumChatFormatting.GRAY
                        + "EU/t of wireless transfer per "
                        + GTValues.TIER_COLORS[10]
                        + GTValues.VN[10]
                        + EnumChatFormatting.GRAY
                        + " capacitor.");
                break;
            case 9:
                lines.add(
                    "Capacity: " + EnumChatFormatting.RED
                        + GTUtility.formatNumbers(UIV_cap_storage)
                        + EnumChatFormatting.GRAY
                        + "EU");
                lines.add(
                    "Supports up to " + EnumChatFormatting.RED
                        + GTUtility.formatNumbers(UIV_cap_eu_per_tick)
                        + EnumChatFormatting.GRAY
                        + "EU/t of wireless transfer per "
                        + GTValues.TIER_COLORS[11]
                        + GTValues.VN[11]
                        + EnumChatFormatting.GRAY
                        + " capacitor.");
                break;
            case 10:
                lines.add(
                    "Capacity: " + EnumChatFormatting.RED
                        + GTUtility.formatNumbers(UMV_cap_storage)
                        + EnumChatFormatting.GRAY
                        + "EU");
                lines.add(
                    "Supports up to " + EnumChatFormatting.RED
                        + GTUtility.formatNumbers(UMV_cap_eu_per_tick)
                        + EnumChatFormatting.GRAY
                        + "EU/t of wireless transfer per "
                        + GTValues.TIER_COLORS[12]
                        + GTValues.VN[12]
                        + EnumChatFormatting.GRAY
                        + " capacitor.");
                break;
        }
    }
}