Created
July 7, 2015 08:15
-
-
Save LionZXY/f175dbfaa6b5bf7739da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ru.nord.common.items; | |
import net.minecraft.creativetab.CreativeTabs; | |
import net.minecraft.item.Item; | |
import net.minecraft.item.ItemStack; | |
import net.minecraftforge.fml.common.registry.GameRegistry; | |
import net.minecraftforge.fml.relauncher.Side; | |
import net.minecraftforge.fml.relauncher.SideOnly; | |
import ru.nord.NordItems; | |
import ru.nord.NordTabs; | |
import ru.nord.common.lib.helpers.RegisterHelper; | |
import java.util.List; | |
/** | |
* Created by nikit_000 on 06.07.2015. | |
*/ | |
public class ItemDust extends Item { | |
public static String[] namedust = new String[]{"iron","gold","diamond","glass"}; | |
public static void preInit(){ | |
NordItems.dustItem = new ItemDust().setUnlocalizedName("dust"); | |
RegisterHelper.registerMetadataItem(NordItems.dustItem,"dust","dust",namedust); | |
} | |
public ItemDust() | |
{ | |
this.setHasSubtypes(true); | |
this.setMaxDamage(0); | |
this.setCreativeTab(NordTabs.tabGeneral); | |
} | |
public String getUnlocalizedName(ItemStack stack) | |
{ | |
return super.getUnlocalizedName() + "." + stack.getMetadata(); | |
} | |
@SideOnly(Side.CLIENT) | |
public void getSubItems(Item itemIn, CreativeTabs tab, List subItems) | |
{ | |
for (int i = 0; i < namedust.length; ++i) | |
{ | |
subItems.add(new ItemStack(itemIn, 1, i)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment