aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/tectech/thing/casing/BlockGodforgeCasings.java
blob: e744cdf9b79400fe2f7ec93fee493bee9cbdbcf3 (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
package tectech.thing.casing;

import java.util.List;

import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.Textures;
import gregtech.api.objects.GTCopiedBlockTexture;
import gregtech.api.util.GTLanguageManager;
import gregtech.common.blocks.BlockCasingsAbstract;
import gregtech.common.blocks.MaterialCasings;
import tectech.thing.CustomItemList;

public class BlockGodforgeCasings extends BlockCasingsAbstract {

    private static IIcon GodforgeTrim;
    private static IIcon GodforgeInner;
    private static IIcon GodforgeSupport;
    private static IIcon GodforgeOuter;
    private static IIcon GodforgeEnergy;
    private static IIcon GravitonModulatorT1;
    private static IIcon GravitonModulatorT2;
    private static IIcon GravitonModulatorT3;
    private static IIcon PhononConduit;

    private static final byte START_INDEX = 64;

    public BlockGodforgeCasings() {
        super(ItemCasingsGodforge.class, "gt.godforgecasing", MaterialCasings.INSTANCE);
        for (byte b = 0; b < 16; b = (byte) (b + 1)) {
            Textures.BlockIcons.casingTexturePages[7][b + START_INDEX] = new GTCopiedBlockTexture(this, 6, b);
        }

        GTLanguageManager
            .addStringLocalization(getUnlocalizedName() + ".0.name", "Singularity Reinforced Stellar Shielding Casing");
        GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Celestial Matter Guidance Casing");
        GTLanguageManager.addStringLocalization(
            getUnlocalizedName() + ".2.name",
            "Boundless Gravitationally Severed Structure Casing");
        GTLanguageManager.addStringLocalization(
            getUnlocalizedName() + ".3.name",
            "Transcendentally Amplified Magnetic Confinement Casing");
        GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "Stellar Energy Siphon Casing");
        GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "Remote Graviton Flow Modulator");
        GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "Medial Graviton Flow Modulator");
        GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "Central Graviton Flow Modulator");
        GTLanguageManager
            .addStringLocalization(getUnlocalizedName() + ".8.name", "Harmonic Phonon Transmission Conduit");

        CustomItemList.Godforge_SingularityShieldingCasing.set(new ItemStack(this, 1, 0));
        CustomItemList.Godforge_GuidanceCasing.set(new ItemStack(this, 1, 1));
        CustomItemList.Godforge_BoundlessStructureCasing.set(new ItemStack(this, 1, 2));
        CustomItemList.Godforge_MagneticConfinementCasing.set(new ItemStack(this, 1, 3));
        CustomItemList.Godforge_StellarEnergySiphonCasing.set(new ItemStack(this, 1, 4));
        CustomItemList.Godforge_GravitonFlowModulatorTier1.set(new ItemStack(this, 1, 5));
        CustomItemList.Godforge_GravitonFlowModulatorTier2.set(new ItemStack(this, 1, 6));
        CustomItemList.Godforge_GravitonFlowModulatorTier3.set(new ItemStack(this, 1, 7));
        CustomItemList.Godforge_HarmonicPhononTransmissionConduit.set(new ItemStack(this, 1, 8));
    }

    @Override
    public void registerBlockIcons(IIconRegister aIconRegister) {
        GodforgeTrim = aIconRegister.registerIcon("gregtech:iconsets/GODFORGE_TRIM");
        GodforgeInner = aIconRegister.registerIcon("gregtech:iconsets/GODFORGE_INNER");
        GodforgeSupport = aIconRegister.registerIcon("gregtech:iconsets/GODFORGE_SUPPORT");
        GodforgeOuter = aIconRegister.registerIcon("gregtech:iconsets/GRAVITON_TOP_BOTTOM");
        GodforgeEnergy = aIconRegister.registerIcon("gregtech:iconsets/GODFORGE_ENERGY");
        GravitonModulatorT1 = aIconRegister.registerIcon("gregtech:iconsets/GRAVITON_CASING_2");
        GravitonModulatorT2 = aIconRegister.registerIcon("gregtech:iconsets/GRAVITON_CASING_1");
        GravitonModulatorT3 = aIconRegister.registerIcon("gregtech:iconsets/GRAVITON_CASING_0");
        PhononConduit = aIconRegister.registerIcon("gregtech:iconsets/PHONON_CONDUIT");
    }

    @Override
    public IIcon getIcon(int aSide, int aMeta) {
        switch (aMeta) {
            case 0:
                return GodforgeTrim;
            case 1:
                return GodforgeInner;
            case 2:
                return GodforgeSupport;
            case 3:
                return GodforgeOuter;
            case 4:
                return GodforgeEnergy;
            case 5:
                if (aSide < 2) {
                    return GodforgeOuter;
                }
                return GravitonModulatorT1;
            case 6:
                if (aSide < 2) {
                    return GodforgeOuter;
                }
                return GravitonModulatorT2;
            case 7:
                if (aSide < 2) {
                    return GodforgeOuter;
                }
                return GravitonModulatorT3;
            case 8:
                return PhononConduit;
            default:
                return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon();
        }
    }

    @Override
    @SideOnly(Side.CLIENT)
    public IIcon getIcon(IBlockAccess aWorld, int xCoord, int yCoord, int zCoord, int aSide) {
        int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord);
        return getIcon(aSide, tMeta);
    }

    @SuppressWarnings("unchecked")
    @Override
    public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) {
        for (int i = 0; i <= 8; i++) {
            aList.add(new ItemStack(aItem, 1, i));
        }
    }
}