Jump to content

Recommended Posts

Posted

 

style as image Sorry for any incorrect on my conversation, my English is not good T_T

 

Model

Vj4lOI.jpg

1ZALyy.png

 

 

ClientProxy

 

package tutorial;

 

import net.minecraft.client.model.ModelBiped;

 

public class ClientProxy extends CommonProxy {

 

private static final tutarm tutChest = new tutarm((float) 1.0);

private static final tutarm tutLegs = new tutarm((float) 1.0);

 

@Override

public ModelBiped getArmorModel(int id){

switch (id) {

case 0:

return tutChest;

case 1:

return tutLegs;

default:

break;

}

return tutChest; //default, if whenever you should have passed on a wrong id

}

}

_____________________________________________

 

tutarm

 

 

package tutorial;

 

import net.minecraft.client.model.ModelBiped;

import net.minecraft.client.model.ModelRenderer;

import net.minecraft.entity.Entity;

import net.minecraft.util.MathHelper;

 

public class tutarm extends ModelBiped

{

//fields

  ModelRenderer Shape1;

 

public tutarm(float f)

{

super(f,0, 64,64);

  textureWidth = 64;

  textureHeight = 64;

 

    Shape1 = new ModelRenderer(this, 0, 0);

    Shape1.addBox(0F, 0F, 0F, 2, 3, 2);

    Shape1.setRotationPoint(-15, 53, -3F);

    Shape1.setTextureSize(64, 64);

    Shape1.mirror = true;

    setRotation(Shape1, 0F, 0F, 0F);

}

 

public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)

{

  super.render(entity, f, f1, f2, f3, f4, f5);

  setRotationAngles(f, f1, f2, f3, f4, f5);

  Shape1.render(f5);

}

 

private void setRotation(ModelRenderer model, float x, float y, float z)

{

  model.rotateAngleX = x;

  model.rotateAngleY = y;

  model.rotateAngleZ = z;

}

 

public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)

{

  super.setRotationAngles(f, f1, f2, f3, f4, f5, null);

}

 

}

____________________________________

 

mod_ArmorTutorial

 

 

package tutorial;

 

import net.minecraft.item.EnumArmorMaterial;

import net.minecraft.item.Item;

import cpw.mods.fml.common.Mod;

import cpw.mods.fml.common.Mod.EventHandler;

import cpw.mods.fml.common.SidedProxy;

import cpw.mods.fml.common.event.FMLInitializationEvent;

import cpw.mods.fml.common.network.NetworkMod;

import cpw.mods.fml.common.registry.LanguageRegistry;

 

@Mod(modid="ArmorTutorial", name="ArmorTutorial", version="tutorial")

@NetworkMod(clientSideRequired=true, serverSideRequired=false)

public class mod_ArmorTutorial {

 

@SidedProxy(serverSide="tutorial.CommonProxy", clientSide="tutorial.ClientProxy")

public static CommonProxy proxy;

 

public static Item chest;

public static Item legs;

public static Item boots;

public static Item helmet;

 

@EventHandler

public void load(FMLInitializationEvent e)

{

helmet = new CustomArmor(8469, EnumArmorMaterial.IRON, 4, 0).setUnlocalizedName("a.iron_helmet");

chest = new CustomArmor(8470, EnumArmorMaterial.IRON, 4, 1).setUnlocalizedName("a.iron_chestplate");

legs = new CustomArmor(8471, EnumArmorMaterial.IRON, 4, 2).setUnlocalizedName("a.armor:tutorial_chest.png");

boots = new CustomArmor(8472, EnumArmorMaterial.IRON, 4, 3).setUnlocalizedName("a.armor:tutorial_chest.png");

 

LanguageRegistry.addName(helmet, "Armor:หมวก");

LanguageRegistry.addName(chest, "Armor:เสื้อ");

LanguageRegistry.addName(legs, "Armor:กางเกง");

LanguageRegistry.addName(boots, "Armor:รองเท้า");

}

 

 

}

 

_____________________________________________

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.