- 9
- 2
Java:
public class Items {
public static Item xHelmetpnv;
public static Item xChest;
public static Item xLeggins;
public static Item xBoots;
public static void registerItems() {
xHelmetpnv = (Item) new XHelmetPNV(2302, XARMORMATERIAL, 0, 0);
xChest = (Item) new Chest(2303, XARMORMATERIAL, "Prototype X407 Chest", "X407Chest", "X407");
xLeggins = (Item) new Leggins(2304, XARMORMATERIAL, "Prototype X407 Leggins", "X407Legs", "X407");
xBoots = (Item) new Boots(2305, XARMORMATERIAL, "Prototype X407 Boots", "X407Boots", "X407");
GameRegistry.registerItem(xHelmetpnv, "xHelmetpnv");
GameRegistry.registerItem(xChest, "X407Chest");
GameRegistry.registerItem(xLeggins, "X407Legs");
GameRegistry.registerItem(xBoots, "X407Boots");
}
static {
XARMORMATERIAL = EnumHelper.addArmorMaterial("XARMORMATERIAL", 70, (int[]) new int[] { 3, 8, 5, 3 }, 1);
}
}
Класс XHelmet:
public class XHelmetPNV extends ItemArmor {
public XHelmetPNV(final int n, final ItemArmor.ArmorMaterial anxb2, final int n2, final int n3) {
super(anxb2, n2, n3);
this.setCreativeTab(Tabs.KrylexArmor);
this.setUnlocalizedName("X407Head");
LanguageRegistry.addName((Object) this, "Prototype X407 Helmet");
}
@SideOnly(Side.CLIENT)
public void registerIcons(final IIconRegister mqnk2) {
this.itemIcon = mqnk2.registerIcon("kent1ch:X407Head");
}
public void onArmorTick(final World twca2, final EntityPlayer player, final ItemStack cucj2) {
if (twca2.isRemote) {
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 1));
}
}
public String getArmorTexture(final ItemStack itemstack, final Entity entity, final int slot, final String type) {
return "kent1ch:textures/armor/X407_1.png";
}
}