- 31
- 1
- 1
Если кратко,то нужна помощь с отображением поножей.
код брони
код брони
Java:
public class soularmor extends ItemArmor{
private String [] armourTypes = new String [] {"helmetsoul", "chestplatesoul", "legssoul", "bootssoul"};
public soularmor(ArmorMaterial armorMaterial, int renderIndex, int armourType){
super(armorMaterial, renderIndex, armourType);
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String layer){
if(stack.getItem().equals(Main.helmetsoul)|| stack.getItem().equals(Main.chestplatesoul)|| stack.getItem().equals(Main.bootssoul)){
return "shinkansen:textures/armor/soul_1.png";
}
if(stack.getItem().equals(Main.legssoul)){
return "shinkansen:textures/armor/soul_2.png";
}
else return null;
}
@Override
public void registerIcons(IIconRegister reg)
{
if(this == Main.helmetsoul)
this.itemIcon = reg.registerIcon("shinkansen:helmetsoul");
if(this == Main.chestplatesoul)
this.itemIcon = reg.registerIcon("shinkansen:chestplatesoul");
if(this == Main.legssoul)
this.itemIcon = reg.registerIcon("shinkansen:legssoul");
if(this == Main.bootssoul)
this.itemIcon = reg.registerIcon("shinkansen:bootssoul");
}
}
Мейн:
package com.endienasg.shinkansen;
import javax.swing.text.html.parser.Entity;
import com.endienasg.proxy.CommonProxy;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityList;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.world.WorldType;
import net.minecraftforge.common.util.EnumHelper;
@Mod(modid = Main.MODID, name = Main.MODNAME,version = Main.VERSION)
public class Main {
//proxy-связь;
@Mod.Instance("com.endienasg.shinkansen.Main")
public static com.endienasg.shinkansen.Main instance;
@SidedProxy(clientSide = "com.endienasg.proxy.ClientProxy", serverSide = "com.endienasg.proxy.CommonProxy")
public static CommonProxy proxy;
//creative Tab
public static final CreativeTabs tabshinkansenMod = new CreativeTabs("tabshinkansenMod"){
public Item getTabIconItem() {
return Item.getItemFromBlock(Blocks.command_block);
}
};
//info
public static final String MODID = "shinkansen";
public static final String MODNAME = "shinkansen Mod";
public static final String VERSION = "0.1.0";
//Armor
public static Item helmetsoul;
public static Item chestplatesoul;
public static Item legssoul;
public static Item bootssoul;
//block
public static Block pipe;
public static Block wood;
//item
public static Item MyPickaxe;
public static Item Myaxe;
public static Item MyShovel;
public static Item MyZanpakto;
public static Item MyZan2;
//toolmaterial
public static ToolMaterial soul = EnumHelper.addToolMaterial("soul", 4, 3000, 20.0F, 5.0F, 30);
public static ToolMaterial empty_soul = EnumHelper.addToolMaterial("empty_soul", 4, 3000, 20.0F, 5.0F, 30);
public static ToolMaterial steel = EnumHelper.addToolMaterial("steel", 3,700, 10.0F, 25, 0);
public static ToolMaterial soulsteel = EnumHelper.addToolMaterial("soulsteel", 3,800, 10.0F, 250, 0);
//armour material
public static ArmorMaterial enumArmorMaterialsoul = EnumHelper.addArmorMaterial("soul", 50, new int[] {5,10,8,3}, 10);
//food
public static ItemFood Semki;
public static ItemFood PackofSemki;
//Mob|entity{
//gop
public static void registerEntity(Class entityClass, String name, int primaryColor, int secondaryColor)
{
int entityID = EntityRegistry.findGlobalUniqueEntityId();
long seed = name.hashCode();
EntityRegistry.registerGlobalEntityID(entityClass, name, entityID);
EntityList.entityEggs.put(Integer.valueOf(entityID), new EntityList.EntityEggInfo(entityID, primaryColor, secondaryColor));
}
//}
@EventHandler
public void preLoad(FMLPreInitializationEvent event)
{
System.out.println("Я тут");
//entity_load
registerEntity(Gop.class, "Gop", 0x00FFFF, 0x00008B);
//Rendera_rmor
RenderingRegistry.addNewArmourRendererPrefix("5");
//block
pipe = new BlockTut(Material.iron, "pipe", "iron");
wood = new BlockWood(Material.wood, "wood", "wood");
//item
MyPickaxe = new MyPickaxe()
.setUnlocalizedName("MyPickaxe");
Myaxe = new Myaxe()
.setUnlocalizedName("Myaxe");
MyShovel = new MyShovel()
.setUnlocalizedName("MyShovel");
MyZanpakto = new MyZanpakto()
.setUnlocalizedName("Zanpakto");
MyZan2 = new MyZan2()
.setUnlocalizedName("Zan2");
proxy.registerRenderers();
//food
Semki = (ItemFood) new Semki(10, false)
.setUnlocalizedName("Semki");
PackofSemki = (ItemFood) new PackofSemki(20, false)
.setUnlocalizedName("PackofSemki");
//armor
helmetsoul = new soularmor(Main.enumArmorMaterialsoul, 5, 0)
.setUnlocalizedName("helmetsoul").setCreativeTab(Main.tabshinkansenMod);
chestplatesoul = new soularmor(Main.enumArmorMaterialsoul, 5, 1)
.setUnlocalizedName("chestplatesoul").setCreativeTab(Main.tabshinkansenMod);
legssoul = new soularmor(Main.enumArmorMaterialsoul, 5, 2)
.setUnlocalizedName("legssoul").setCreativeTab(Main.tabshinkansenMod);
bootssoul = new soularmor(Main.enumArmorMaterialsoul, 5, 3)
.setUnlocalizedName("bootssoul").setCreativeTab(Main.tabshinkansenMod);
//GameRegistry.registerItem
GameRegistry.registerItem( MyShovel, "SilverShovel");
GameRegistry.registerItem( Myaxe, "Silveraxe");
GameRegistry.registerItem( MyPickaxe, "SilverPickaxe");
GameRegistry.registerItem( MyZanpakto, "Zanpakto");
GameRegistry.registerItem( MyZan2, "Zano2");
GameRegistry.registerItem(Semki, "Semki");
GameRegistry.registerItem(PackofSemki, "PackofSemki");
GameRegistry.registerItem(helmetsoul, "helmetsoul");
GameRegistry.registerItem(chestplatesoul, "chestplatesoul");
GameRegistry.registerItem(legssoul, "legssoul");
GameRegistry.registerItem(bootssoul, "bootssoul");
}
@EventHandler
public void Load(FMLInitializationEvent event)
{
}
@EventHandler
public void postLoad(FMLPostInitializationEvent event)
{
GameRegistry.addRecipe(new ItemStack(Main.MyPickaxe, 1),
new Object[]{
"X#X",
" Y ",
" X ",
('X'),Blocks.diamond_block,
('#'),Items.nether_star,
('Y'),Items.golden_apple
});
//My_pickaxe
/*GameRegistry.addRecipe(new ItemStack(Main.MyZanpakto,1),
new Object[]{
"",
"",
"",
});
*/
//end_of_repice
}
}