blob: 2f54c9c41537b599e9aafead7e9e735b402681cf (
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
|
package gregtech.common.blocks;
import cpw.mods.fml.common.Loader;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.interfaces.IIconContainer;
import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_OreDictUnificator;
import net.minecraft.block.material.Material;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
public class GT_Block_Metal extends GT_Block_Storage {
public Materials[] mMats;
public OrePrefixes mPrefix;
public IIconContainer[] mBlockIcons;
public boolean mHideBlocks;
public GT_Block_Metal(String aName, Materials[] aMats, OrePrefixes aPrefix, IIconContainer[] aBlockIcons) {
super(GT_Item_Storage.class, aName, Material.iron);
mMats = aMats;
mPrefix = aPrefix;
mBlockIcons = aBlockIcons;
mHideBlocks = Loader.isModLoaded("NotEnoughItems");
for (int i = 0; i < aMats.length; i++) {
if (aMats[i].mMetaItemSubID > 0 && aMats[i].mHasParentMod) {
GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + i + ".name", "Block of " + aMats[i].mDefaultLocalName);
GT_OreDictUnificator.registerOre(aPrefix, aMats[i], new ItemStack(this, 1, i));
}
}
if (aMats.length<16 && Loader.isModLoaded("NotEnoughItems")) {
for (int i = aMats.length; i < 16; i++) codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i));
}
}
public IIcon getIcon(int aSide, int aMeta) {
if ((aMeta >= 0) && (aMeta < 16) && aMeta < mMats.length) {
return mBlockIcons[aMeta].getIcon();
}
return null;
}
}
|