mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-21 12:42:36 +00:00
- Add storage blocks for alloys and other metals - Register quite clear glass as "blockGlass" as well for compatability - Add registration for all nuggets
40 lines
990 B
Java
40 lines
990 B
Java
package crazypants.enderio.material;
|
|
|
|
import java.util.List;
|
|
|
|
import net.minecraft.block.Block;
|
|
import net.minecraft.creativetab.CreativeTabs;
|
|
import net.minecraft.item.Item;
|
|
import net.minecraft.item.ItemBlock;
|
|
import net.minecraft.item.ItemStack;
|
|
import cpw.mods.fml.relauncher.Side;
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
|
|
|
public class BlockItemIngotStorage extends ItemBlock {
|
|
|
|
public BlockItemIngotStorage(Block block) {
|
|
super(block);
|
|
setHasSubtypes(true);
|
|
setMaxDamage(0);
|
|
}
|
|
|
|
@Override
|
|
public String getUnlocalizedName(ItemStack stack) {
|
|
return "tile." + Alloy.values()[stack.getItemDamage()].unlocalisedName;
|
|
}
|
|
|
|
@Override
|
|
public int getMetadata(int damage) {
|
|
return damage;
|
|
}
|
|
|
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
|
@Override
|
|
@SideOnly(Side.CLIENT)
|
|
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
|
for (Alloy alloy : Alloy.values()) {
|
|
list.add(new ItemStack(this, 1, alloy.ordinal()));
|
|
}
|
|
}
|
|
}
|