Updated for 1.7.2
This commit is contained in:
parent
cc178e1a3b
commit
29228e18fe
105 changed files with 1939 additions and 2690 deletions
|
|
@ -1,39 +1,22 @@
|
|||
package mysticstones.blocks;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemBlockWithMetadata;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
public class ItemBlockMulti extends ItemBlock {
|
||||
private String[] types;
|
||||
private Block block;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public ItemBlockMulti(int par1, Block block, String[] names) {
|
||||
super(par1);
|
||||
public class ItemBlockMulti extends ItemBlockWithMetadata {
|
||||
private ArrayList<String> types;
|
||||
public ItemBlockMulti(Block block, ArrayList<String> names) {
|
||||
super(block, block);
|
||||
this.types = names;
|
||||
this.block = block;
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIconFromDamage(int par1) {
|
||||
return block.getIcon(2, par1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int par1) {
|
||||
return par1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemStack) {
|
||||
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, types.length);
|
||||
return types[meta];
|
||||
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, types.size());
|
||||
return types.get(meta);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue