aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/tectech/thing/casing/BlockGTCasingsBA0.java
blob: 19469a0c703c164be976552b45088b0d0aead695 (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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
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;

/**
 * Created by danie_000 on 03.10.2016.
 */
// Mostly tesla coils, also 2 eye of harmony casings.
public class BlockGTCasingsBA0 extends BlockCasingsAbstract {

    private static final IIcon[] tM0 = new IIcon[2];
    private static final IIcon[] tM1 = new IIcon[2];
    private static final IIcon[] tM2 = new IIcon[2];
    private static final IIcon[] tM3 = new IIcon[2];
    private static final IIcon[] tM4 = new IIcon[2];
    private static final IIcon[] tM5 = new IIcon[2];
    private static final IIcon[] tM6 = new IIcon[2];
    private static IIcon tM7;
    private static final IIcon[] tM8 = new IIcon[2];
    private static final IIcon[] tM9 = new IIcon[2];

    private static IIcon EOH_INNER;
    private static IIcon EOH_OUTER;
    private static IIcon EOH_INFINITE;

    private static final byte START_INDEX = 16;

    public BlockGTCasingsBA0() {
        super(ItemCasingsBA0.class, "gt.blockcasingsBA0", MaterialCasings.INSTANCE);
        for (byte b = 0; b < 16; b = (byte) (b + 1)) {
            Textures.BlockIcons.casingTexturePages[BlockGTCasingsTT.texturePage][b
                + START_INDEX] = new GTCopiedBlockTexture(this, 6, b);
            /* IMPORTANT for block recoloring **/
        }

        GTLanguageManager
            .addStringLocalization(getUnlocalizedName() + ".0.name", "Redstone Alloy Primary Tesla Windings");
        GTLanguageManager
            .addStringLocalization(getUnlocalizedName() + ".1.name", "MV Superconductor Primary Tesla Windings");
        GTLanguageManager
            .addStringLocalization(getUnlocalizedName() + ".2.name", "HV Superconductor Primary Tesla Windings");
        GTLanguageManager
            .addStringLocalization(getUnlocalizedName() + ".3.name", "EV Superconductor Primary Tesla Windings");
        GTLanguageManager
            .addStringLocalization(getUnlocalizedName() + ".4.name", "IV Superconductor Primary Tesla Windings");
        GTLanguageManager
            .addStringLocalization(getUnlocalizedName() + ".5.name", "LuV Superconductor Primary Tesla Windings");
        GTLanguageManager
            .addStringLocalization(getUnlocalizedName() + ".9.name", "ZPM Superconductor Primary Tesla Windings");

        GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "Tesla Base Casing");
        GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "Tesla Toroid Casing");
        GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "Tesla Secondary Windings");

        GTLanguageManager
            .addStringLocalization(getUnlocalizedName() + ".10.name", "Reinforced Temporal Structure Casing");
        GTLanguageManager
            .addStringLocalization(getUnlocalizedName() + ".11.name", "Reinforced Spatial Structure Casing");
        GTLanguageManager
            .addStringLocalization(getUnlocalizedName() + ".12.name", "Infinite Spacetime Energy Boundary Casing");

        CustomItemList.tM_TeslaPrimary_0.set(new ItemStack(this, 1, 0));
        CustomItemList.tM_TeslaPrimary_1.set(new ItemStack(this, 1, 1));
        CustomItemList.tM_TeslaPrimary_2.set(new ItemStack(this, 1, 2));
        CustomItemList.tM_TeslaPrimary_3.set(new ItemStack(this, 1, 3));
        CustomItemList.tM_TeslaPrimary_4.set(new ItemStack(this, 1, 4));
        CustomItemList.tM_TeslaPrimary_5.set(new ItemStack(this, 1, 5));
        CustomItemList.tM_TeslaPrimary_6.set(new ItemStack(this, 1, 9));

        CustomItemList.tM_TeslaBase.set(new ItemStack(this, 1, 6));
        CustomItemList.tM_TeslaToroid.set(new ItemStack(this, 1, 7));
        CustomItemList.tM_TeslaSecondary.set(new ItemStack(this, 1, 8));

        CustomItemList.EOH_Reinforced_Temporal_Casing.set(new ItemStack(this, 1, 10));
        CustomItemList.EOH_Reinforced_Spatial_Casing.set(new ItemStack(this, 1, 11));
        CustomItemList.EOH_Infinite_Energy_Casing.set(new ItemStack(this, 1, 12));
    }

    @Override
    public void registerBlockIcons(IIconRegister aIconRegister) {
        tM0[0] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_0");
        tM0[1] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_0");
        tM1[0] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_1");
        tM1[1] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_1");
        tM2[0] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_2");
        tM2[1] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_2");
        tM3[0] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_3");
        tM3[1] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_3");
        tM4[0] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_4");
        tM4[1] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_4");
        tM5[0] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_5");
        tM5[1] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_5");
        tM9[0] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_TOP_BOTTOM_6");
        tM9[1] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_PRIMARY_SIDES_6");

        tM6[0] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_BASE_TOP_BOTTOM");
        tM6[1] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_BASE_SIDES");
        tM7 = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_TOROID");
        tM8[0] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_SECONDARY_TOP_BOTTOM");
        tM8[1] = aIconRegister.registerIcon("gregtech:iconsets/TM_TESLA_WINDING_SECONDARY_SIDES");

        EOH_INNER = aIconRegister.registerIcon("gregtech:iconsets/EM_INNER_SPACETIME_REINFORCED_EOH_CASING");
        EOH_OUTER = aIconRegister.registerIcon("gregtech:iconsets/EM_OUTER_SPACETIME_REINFORCED_EOH_CASING");
        EOH_INFINITE = aIconRegister.registerIcon("gregtech:iconsets/EM_POWER_INFINITE");
    }

    @Override
    public IIcon getIcon(int ordinalSide, int aMeta) {
        switch (aMeta) {
            case 0:
                switch (ordinalSide) {
                    case 0:
                    case 1:
                        return tM0[0];
                    default:
                        return tM0[1];
                }
            case 1:
                switch (ordinalSide) {
                    case 0:
                    case 1:
                        return tM1[0];
                    default:
                        return tM1[1];
                }
            case 2:
                switch (ordinalSide) {
                    case 0:
                    case 1:
                        return tM2[0];
                    default:
                        return tM2[1];
                }
            case 3:
                switch (ordinalSide) {
                    case 0:
                    case 1:
                        return tM3[0];
                    default:
                        return tM3[1];
                }
            case 4:
                switch (ordinalSide) {
                    case 0:
                    case 1:
                        return tM4[0];
                    default:
                        return tM4[1];
                }
            case 5:
                switch (ordinalSide) {
                    case 0:
                    case 1:
                        return tM5[0];
                    default:
                        return tM5[1];
                }
            case 6:
                switch (ordinalSide) {
                    case 0:
                    case 1:
                        return tM6[0];
                    default:
                        return tM6[1];
                }
            case 7:
                return tM7;
            case 8:
                switch (ordinalSide) {
                    case 0:
                    case 1:
                        return tM8[0];
                    default:
                        return tM8[1];
                }
            case 9:
                switch (ordinalSide) {
                    case 0:
                    case 1:
                        return tM9[0];
                    default:
                        return tM9[1];
                }
            case 10:
                return EOH_INNER;
            case 11:
                return EOH_OUTER;
            case 12:
                return EOH_INFINITE;
            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 ordinalSide) {
        int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord);
        return getIcon(ordinalSide, tMeta);
    }

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