Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ExampleItemBlock extends ItemBlockWithMetadata
- {
- public static final String[] SUBNAMES = new String[] {"blue", "green", "yellow", "red"};
- public ExampleItemBlock(Block block)
- {
- super(block, block);
- }
- @Override
- public String getUnlocalizedName(ItemStack itemStack)
- {
- int i = itemStack.getItemDamage();
- if (i < 0 || i >= SUBNAMES.length) i = 0;
- return getUnlocalizedName() + "." + SUBNAMES[i];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement