Updated for 1.7.2
This commit is contained in:
parent
cc178e1a3b
commit
29228e18fe
105 changed files with 1939 additions and 2690 deletions
22
common/mysticworld/Blocks/ItemBlockMulti.java
Normal file
22
common/mysticworld/Blocks/ItemBlockMulti.java
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
package mysticworld.blocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemBlockWithMetadata;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class ItemBlockMulti extends ItemBlockWithMetadata {
|
||||
public final ArrayList<String> names;
|
||||
public ItemBlockMulti(Block block, ArrayList<String> names) {
|
||||
super(block, block);
|
||||
this.names = names;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemStack) {
|
||||
int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, names.size());
|
||||
return names.get(meta);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue