aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/GoodGenerator/util/ItemRefer.java
blob: e3abaa44f83fc41a099c327d73645a971dde5fbc (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
package GoodGenerator.util;

import gregtech.api.util.GT_Utility;
import ic2.api.reactor.IReactorComponent;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;

import static GoodGenerator.Loader.FuelRodLoader.*;
import static GoodGenerator.Loader.Loaders.*;

public final class ItemRefer {

    public static ItemRefer Radiation_Protection_Plate = getItemStack(radiationProtectionPlate);
    public static ItemRefer Wrapped_Uranium_Ingot = getItemStack(wrappedUraniumIngot);
    public static ItemRefer High_Density_Uranium_Nugget = getItemStack(highDensityUraniumNugget);
    public static ItemRefer High_Density_Uranium = getItemStack(highDensityUranium);
    public static ItemRefer Wrapped_Thorium_Ingot = getItemStack(wrappedThoriumIngot);
    public static ItemRefer High_Density_Thorium_Nugget = getItemStack(highDensityThoriumNugget);
    public static ItemRefer High_Density_Thorium = getItemStack(highDensityThorium);
    public static ItemRefer Wrapped_Plutonium_Ingot = getItemStack(wrappedPlutoniumIngot);
    public static ItemRefer High_Density_Plutonium_Nugget = getItemStack(highDensityPlutoniumNugget);
    public static ItemRefer High_Density_Plutonium = getItemStack(highDensityPlutonium);
    public static ItemRefer Raw_Atomic_Separation_Catalyst = getItemStack(rawAtomicSeparationCatalyst);
    public static ItemRefer Advanced_Radiation_Protection_Plate = getItemStack(advancedRadiationProtectionPlate);
    public static ItemRefer Aluminum_Nitride_Dust = getItemStack(aluminumNitride);
    public static ItemRefer Special_Ceramics_Dust = getItemStack(specialCeramics);
    public static ItemRefer Special_Ceramics_Plate = getItemStack(specialCeramicsPlate);
    public static ItemRefer Radioactive_Waste = getItemStack(radioactiveWaste);
    public static ItemRefer Plastic_Case = getItemStack(plasticCase);
    public static ItemRefer Quartz_Wafer = getItemStack(quartzWafer);
    public static ItemRefer Micro_Heater = getItemStack(microHeater);
    public static ItemRefer Quartz_Crystal_Resonator = getItemStack(quartzCrystalResonator);
    public static ItemRefer Inverter = getItemStack(inverter);
    public static ItemRefer Neutron_Source = getItemStack(neutronSource);
    public static ItemRefer Naquadah_Mass = getItemStack(naquadahMass);
    public static ItemRefer Enriched_Naquadah_Mass = getItemStack(enrichedNaquadahMass);
    public static ItemRefer Naquadria_Mass = getItemStack(naquadriaMass);
    public static ItemRefer Advanced_Fuel_Rod = getItemStack(advancedFuelRod);
    public static ItemRefer Fuel_Rod_U_Depleted_1 = getItemStack(rodCompressedUraniumDepleted);
    public static ItemRefer Fuel_Rod_U_Depleted_2 = getItemStack(rodCompressedUraniumDepleted_2);
    public static ItemRefer Fuel_Rod_U_Depleted_4 = getItemStack(rodCompressedUraniumDepleted_4);
    public static ItemRefer Fuel_Rod_U_1 = getItemStack(rodCompressedUranium);
    public static ItemRefer Fuel_Rod_U_2 = getItemStack(rodCompressedUranium_2);
    public static ItemRefer Fuel_Rod_U_4 = getItemStack(rodCompressedUranium_4);

    public static ItemRefer Field_Restriction_Casing = getItemStack(MAR_Casing);
    public static ItemRefer Naquadah_Fuel_Refinery_Casing = getItemStack(FRF_Casings);
    public static ItemRefer Field_Restriction_Coil_T1 = getItemStack(FRF_Coil_1);
    public static ItemRefer Field_Restriction_Coil_T2 = getItemStack(FRF_Coil_2);
    public static ItemRefer Field_Restriction_Coil_T3 = getItemStack(FRF_Coil_3);
    public static ItemRefer Radiation_Proof_Steel_Frame_Box = getItemStack(radiationProtectionSteelFrame);
    public static ItemRefer Field_Restriction_Glass = getItemStack(fieldRestrictingGlass);
    public static ItemRefer Raw_Cylinder = getItemStack(rawCylinder);
    public static ItemRefer Titanium_Plated_Cylinder = getItemStack(titaniumPlatedCylinder);
    public static ItemRefer Magic_Casing = getItemStack(magicCasing);
    public static ItemRefer Speeding_Pipe = getItemStack(speedingPipe);
    public static ItemRefer Essentia_Cell_T1 = getItemStack(essentiaCell, 0);
    public static ItemRefer Essentia_Cell_T2 = getItemStack(essentiaCell, 1);
    public static ItemRefer Essentia_Cell_T3 = getItemStack(essentiaCell, 2);
    public static ItemRefer Essentia_Hatch = getItemStack(essentiaHatch);

    public static ItemRefer Large_Naquadah_Reactor = getItemStack(MAR.copy());
    public static ItemRefer Naquadah_Fuel_Refinery = getItemStack(FRF.copy());
    public static ItemRefer Universal_Chemical_Fuel_Engine = getItemStack(UCFE.copy());
    public static ItemRefer Large_Essentia_Generator = getItemStack(LEG.copy());

    private Item mItem = null;
    private Block mBlock = null;
    private ItemStack mItemStack = null;
    private int mMeta = 0;

    private static ItemRefer getItemStack(ItemStack itemStack) {
        return new ItemRefer(itemStack);
    }

    private static ItemRefer getItemStack(Item item) {
        return getItemStack(item, 0);
    }

    private static ItemRefer getItemStack(Item item, int meta) {
        if (item == null) return null;
        return new ItemRefer(item, meta);
    }

    private static ItemRefer getItemStack(Block block) {
        return getItemStack(block, 0);
    }

    private static ItemRefer getItemStack(Block block, int meta) {
        if (block == null) return null;
        return new ItemRefer(block, meta);
    }

    private ItemRefer(Item item, int meta) {
        mItem = item;
        mMeta = meta;
    }

    private ItemRefer(Block block, int meta) {
        mBlock = block;
        mMeta = meta;
    }

    private ItemRefer(ItemStack itemStack) {
        mItemStack = itemStack;
    }

    public ItemStack get(int amount){
        if (mItem != null) return new ItemStack(mItem, amount, mMeta);
        if (mBlock != null) return new ItemStack(mBlock, amount, mMeta);
        if (mItemStack != null) return GT_Utility.copyAmount(amount, mItemStack);
        return null;
    }
}