Доброго времени суток, подскажите, почему вместо модельки блок? за код не бить, учусь)
Java:
package sub_mod.techne_item;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
public class ItemTechne extends ItemArmor {
public ItemTechne () {
super(ArmorMaterial.CHAIN, 0, 0);
//аргументы: ID, материал, индекс рендера (нам не нужен, 0), тип брони
//типы брони:
//0 - шлем
//1 - кираса
//2 - поножи
//3 - ботинки
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister par1IconRegister) {
this.itemIcon = par1IconRegister.registerIcon(ModItemTechne.MODID+":"+"icon_name");
//очевидно регистрируем иконку для брони
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
if (slot == 0) //шлем?
return ModItemTechne.MODID + ":textures/armor/" + "texture_name.png";
return ModItemTechne.MODID + ":textures/armor/" + "texture_name.png"; //ну мне лень было делать пустую текстуру
//привязываем текстуру, путь именно в таком в формате
//после MODID двоеточие, потом папки разделяются привычными слешами
//в конце обязательно .png!
}
@SideOnly(Side.CLIENT)
@Override
public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) {
if (armorSlot != 0) //если не шлем - бай-бай
return null;
if (itemStack != null && itemStack.getItem() instanceof ItemTechne) {
ModelBiped model = ProxyClient.getArmorModel(); //Я сохранил инстанс модельки в клиентском прокси
return model;
}
else
return null;
}
}
Java:
public class ModelHelmet extends ModelItemBase {
ModelRenderer Shape1;
ModelRenderer Shape2;
ModelRenderer Shape3;
ModelRenderer Shape4;
ModelRenderer Shape5;
ModelRenderer Shape6;
ModelRenderer Shape7;
ModelRenderer Shape8;
ModelRenderer Shape9;
ModelRenderer Shape10;
ModelRenderer Shape11;
ModelRenderer Shape12;
ModelRenderer Shape13;
ModelRenderer Shape14;
ModelRenderer Shape15;
ModelRenderer Shape16;
ModelRenderer Shape17;
ModelRenderer Shape18;
ModelRenderer Shape19;
ModelRenderer Shape21;
ModelRenderer Shape22;
ModelRenderer Shape23;
ModelRenderer Shape24;
ModelRenderer Shape25;
ModelRenderer Shape26;
ModelRenderer Shape27;
ModelRenderer Shape28;
ModelRenderer Shape29;
ModelRenderer Shape30;
ModelRenderer Shape31;
ModelRenderer Shape32;
ModelRenderer Shape33;
ModelRenderer Shape34;
ModelRenderer Shape35;
ModelRenderer Shape36;
ModelRenderer Shape37;
ModelRenderer Shape38;
ModelRenderer Shape39;
ModelRenderer Shape40;
ModelRenderer Shape42;
ModelRenderer Shape43;
ModelRenderer Shape44;
ModelRenderer Shape45;
ModelRenderer Shape46;
ModelRenderer Shape48;
ModelRenderer Shape49;
ModelRenderer Shape50;
ModelRenderer Shape51;
ModelRenderer Shape52;
ModelRenderer Shape53;
ModelRenderer Shape54;
ModelRenderer Shape55;
ModelRenderer Shape56;
ModelRenderer Shape57;
ModelRenderer Shape58;
ModelRenderer Shape59;
ModelRenderer Shape60;
ModelRenderer Shape61;
ModelRenderer Shape62;
ModelRenderer Shape63;
ModelRenderer Shape64;
ModelRenderer Shape65;
ModelRenderer Shape67;
ModelRenderer Shape68;
ModelRenderer Shape47;
ModelRenderer Shape69;
public ModelHelmet() {
super.textureWidth = 32;
super.textureHeight = 64;
this.Shape1 = new ModelRenderer(this, 7, 7);
this.Shape1.addBox(1.5F, -1.0F, -6.0F, 2, 3, 1);
this.Shape1.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape1.setTextureSize(32, 64);
this.Shape1.mirror = true;
this.setRotation(this.Shape1, 0.0F, 0.0F, 0.0F);
this.Shape2 = new ModelRenderer(this, 7, 0);
this.Shape2.addBox(2.5F, -1.5F, -5.5F, 1, 3, 1);
this.Shape2.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape2.setTextureSize(32, 64);
this.Shape2.mirror = true;
this.setRotation(this.Shape2, 0.0F, 0.0F, 0.0F);
this.Shape3 = new ModelRenderer(this, 0, 0);
this.Shape3.addBox(3.5F, -2.5F, -5.5F, 1, 4, 1);
this.Shape3.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape3.setTextureSize(32, 64);
this.Shape3.mirror = true;
this.setRotation(this.Shape3, 0.0F, 0.0F, 0.0F);
this.Shape4 = new ModelRenderer(this, 7, 0);
this.Shape4.addBox(4.3F, -3.0F, -4.8F, 1, 4, 1);
this.Shape4.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape4.setTextureSize(32, 64);
this.Shape4.mirror = true;
this.setRotation(this.Shape4, 0.0F, 0.0F, 0.0F);
this.Shape5 = new ModelRenderer(this, 0, 0);
this.Shape5.addBox(3.8F, -4.0F, -4.1F, 1, 4, 1);
this.Shape5.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape5.setTextureSize(32, 64);
this.Shape5.mirror = true;
this.setRotation(this.Shape5, 0.0F, 0.0F, 0.0F);
this.Shape6 = new ModelRenderer(this, 0, 0);
this.Shape6.addBox(4.0F, -1.0F, -4.0F, 1, 1, 4);
this.Shape6.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape6.setTextureSize(32, 64);
this.Shape6.mirror = true;
this.setRotation(this.Shape6, 0.0F, 0.0F, 0.0F);
this.Shape7 = new ModelRenderer(this, 8, 11);
this.Shape7.addBox(-3.5F, -1.0F, -6.0F, 2, 3, 1);
this.Shape7.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape7.setTextureSize(32, 64);
this.Shape7.mirror = true;
this.setRotation(this.Shape7, 0.0F, 0.0F, 0.0F);
this.Shape8 = new ModelRenderer(this, 7, 0);
this.Shape8.addBox(-3.5F, -1.5F, -5.5F, 1, 3, 1);
this.Shape8.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape8.setTextureSize(32, 64);
this.Shape8.mirror = true;
this.setRotation(this.Shape8, 0.0F, 0.0F, 0.0F);
this.Shape9 = new ModelRenderer(this, 6, 0);
this.Shape9.addBox(-4.5F, -2.5F, -5.5F, 1, 4, 1);
this.Shape9.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape9.setTextureSize(32, 64);
this.Shape9.mirror = true;
this.setRotation(this.Shape9, 0.0F, 0.0F, 0.0F);
this.Shape10 = new ModelRenderer(this, 1, 1);
this.Shape10.addBox(-5.3F, -3.0F, -4.8F, 1, 4, 1);
this.Shape10.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape10.setTextureSize(32, 64);
this.Shape10.mirror = true;
this.setRotation(this.Shape10, 0.0F, 0.0F, 0.0F);
this.Shape11 = new ModelRenderer(this, 6, 0);
this.Shape11.addBox(-4.8F, -4.0F, -4.1F, 1, 4, 1);
this.Shape11.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape11.setTextureSize(32, 64);
this.Shape11.mirror = true;
this.setRotation(this.Shape11, 0.0F, 0.0F, 0.0F);
this.Shape12 = new ModelRenderer(this, 0, 0);
this.Shape12.addBox(-5.0F, -1.0F, -4.0F, 1, 1, 4);
this.Shape12.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape12.setTextureSize(32, 64);
this.Shape12.mirror = true;
this.setRotation(this.Shape12, 0.0F, 0.0F, 0.0F);
this.Shape13 = new ModelRenderer(this, 9, 4);
this.Shape13.addBox(-3.5F, -7.5F, -5.0F, 7, 2, 1);
this.Shape13.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape13.setTextureSize(32, 64);
this.Shape13.mirror = true;
this.setRotation(this.Shape13, 0.0F, 0.0F, 0.0F);
this.Shape14 = new ModelRenderer(this, 7, 6);
this.Shape14.addBox(-2.0F, -6.0F, -5.5F, 4, 1, 1);
this.Shape14.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape14.setTextureSize(32, 64);
this.Shape14.mirror = true;
this.setRotation(this.Shape14, 0.0F, 0.0F, 0.0F);
this.Shape15 = new ModelRenderer(this, 5, 45);
this.Shape15.addBox(-1.0F, -9.2F, -5.5F, 2, 2, 1);
this.Shape15.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape15.setTextureSize(32, 64);
this.Shape15.mirror = true;
this.setRotation(this.Shape15, 0.0F, 0.0F, 0.0F);
this.Shape16 = new ModelRenderer(this, 6, 2);
this.Shape16.addBox(-3.5F, -8.066667F, -5.3F, 7, 1, 1);
this.Shape16.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape16.setTextureSize(32, 64);
this.Shape16.mirror = true;
this.setRotation(this.Shape16, 0.0F, 0.0F, 0.0F);
this.Shape17 = new ModelRenderer(this, 0, 47);
this.Shape17.addBox(-1.0F, -8.5F, -6.0F, 2, 5, 1);
this.Shape17.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape17.setTextureSize(32, 64);
this.Shape17.mirror = true;
this.setRotation(this.Shape17, 0.0F, 0.0F, 0.0F);
this.Shape18 = new ModelRenderer(this, 6, 41);
this.Shape18.addBox(-0.5F, -7.0F, -6.5F, 1, 4, 1);
this.Shape18.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape18.setTextureSize(32, 64);
this.Shape18.mirror = true;
this.setRotation(this.Shape18, 0.0F, 0.0F, 0.0F);
this.Shape19 = new ModelRenderer(this, 2, 0);
this.Shape19.addBox(4.0F, -9.0F, -3.5F, 1, 9, 8);
this.Shape19.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape19.setTextureSize(32, 64);
this.Shape19.mirror = true;
this.setRotation(this.Shape19, 0.0F, 0.0F, 0.0F);
this.Shape21 = new ModelRenderer(this, 8, 0);
this.Shape21.addBox(-4.5F, -9.0F, -4.1F, 1, 3, 1);
this.Shape21.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape21.setTextureSize(32, 64);
this.Shape21.mirror = true;
this.setRotation(this.Shape21, 0.0F, 0.0F, 0.0F);
this.Shape22 = new ModelRenderer(this, 4, 0);
this.Shape22.addBox(-4.0F, -10.0F, -4.0F, 8, 1, 1);
this.Shape22.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape22.setTextureSize(32, 64);
this.Shape22.mirror = true;
this.setRotation(this.Shape22, 0.0F, 0.0F, 0.0F);
this.Shape23 = new ModelRenderer(this, 7, 0);
this.Shape23.addBox(-4.0F, -9.0F, -4.8F, 8, 2, 1);
this.Shape23.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape23.setTextureSize(32, 64);
this.Shape23.mirror = true;
this.setRotation(this.Shape23, 0.0F, 0.0F, 0.0F);
this.Shape24 = new ModelRenderer(this, 2, 0);
this.Shape24.addBox(-5.0F, -9.0F, -3.5F, 1, 9, 8);
this.Shape24.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape24.setTextureSize(32, 64);
this.Shape24.mirror = true;
this.setRotation(this.Shape24, 0.0F, 0.0F, 0.0F);
this.Shape25 = new ModelRenderer(this, 2, 0);
this.Shape25.addBox(4.5F, -8.0F, -3.0F, 1, 8, 7);
this.Shape25.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape25.setTextureSize(32, 64);
this.Shape25.mirror = true;
this.setRotation(this.Shape25, 0.0F, 0.0F, 0.0F);
this.Shape26 = new ModelRenderer(this, 6, 0);
this.Shape26.addBox(5.0F, -7.0F, -2.5F, 1, 6, 6);
this.Shape26.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape26.setTextureSize(32, 64);
this.Shape26.mirror = true;
this.setRotation(this.Shape26, 0.0F, 0.0F, 0.0F);
this.Shape27 = new ModelRenderer(this, 2, 0);
this.Shape27.addBox(-5.5F, -8.0F, -3.0F, 1, 8, 7);
this.Shape27.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape27.setTextureSize(32, 64);
this.Shape27.mirror = true;
this.setRotation(this.Shape27, 0.0F, 0.0F, 0.0F);
this.Shape28 = new ModelRenderer(this, 2, 0);
this.Shape28.addBox(-6.0F, -7.0F, -2.5F, 1, 6, 6);
this.Shape28.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape28.setTextureSize(32, 64);
this.Shape28.mirror = true;
this.setRotation(this.Shape28, 0.0F, 0.0F, 0.0F);
this.Shape29 = new ModelRenderer(this, 7, 0);
this.Shape29.addBox(3.5F, -9.0F, -4.1F, 1, 3, 1);
this.Shape29.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape29.setTextureSize(32, 64);
this.Shape29.mirror = true;
this.setRotation(this.Shape29, 0.0F, 0.0F, 0.0F);
this.Shape30 = new ModelRenderer(this, 8, 0);
this.Shape30.addBox(-4.5F, -10.0F, -3.0F, 9, 1, 2);
this.Shape30.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape30.setTextureSize(32, 64);
this.Shape30.mirror = true;
this.setRotation(this.Shape30, 0.0F, 0.0F, 0.0F);
this.Shape31 = new ModelRenderer(this, 2, 0);
this.Shape31.addBox(-5.0F, -10.0F, -1.0F, 10, 1, 4);
this.Shape31.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape31.setTextureSize(32, 64);
this.Shape31.mirror = true;
this.setRotation(this.Shape31, 0.0F, 0.0F, 0.0F);
this.Shape32 = new ModelRenderer(this, 6, 2);
this.Shape32.addBox(-3.5F, -10.66667F, -3.0F, 7, 1, 2);
this.Shape32.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape32.setTextureSize(32, 64);
this.Shape32.mirror = true;
this.setRotation(this.Shape32, 0.0F, 0.0F, 0.0F);
this.Shape33 = new ModelRenderer(this, 5, 6);
this.Shape33.addBox(-4.0F, -10.66667F, -1.0F, 8, 1, 4);
this.Shape33.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape33.setTextureSize(32, 64);
this.Shape33.mirror = true;
this.setRotation(this.Shape33, 0.0F, 0.0F, 0.0F);
this.Shape34 = new ModelRenderer(this, 5, 3);
this.Shape34.addBox(-3.5F, -10.66667F, 3.0F, 7, 1, 1);
this.Shape34.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape34.setTextureSize(32, 64);
this.Shape34.mirror = true;
this.setRotation(this.Shape34, 0.0F, 0.0F, 0.0F);
this.Shape35 = new ModelRenderer(this, 3, 0);
this.Shape35.addBox(-4.5F, -9.9F, 2.4F, 9, 1, 2);
this.Shape35.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape35.setTextureSize(32, 64);
this.Shape35.mirror = true;
this.setRotation(this.Shape35, 0.0F, 0.0F, 0.0F);
this.Shape36 = new ModelRenderer(this, 6, 0);
this.Shape36.addBox(3.0F, -9.0F, 4.2F, 1, 8, 1);
this.Shape36.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape36.setTextureSize(32, 64);
this.Shape36.mirror = true;
this.setRotation(this.Shape36, 0.0F, 0.0F, 0.0F);
this.Shape37 = new ModelRenderer(this, 6, 0);
this.Shape37.addBox(-4.0F, -9.0F, 4.2F, 1, 8, 1);
this.Shape37.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape37.setTextureSize(32, 64);
this.Shape37.mirror = true;
this.setRotation(this.Shape37, 0.0F, 0.0F, 0.0F);
this.Shape38 = new ModelRenderer(this, 8, 0);
this.Shape38.addBox(-3.0F, -10.0F, 4.7F, 6, 1, 1);
this.Shape38.setRotationPoint(0.0F, 0.0F, -1.0F);
this.Shape38.setTextureSize(32, 64);
this.Shape38.mirror = true;
this.setRotation(this.Shape38, 0.0F, 0.0F, 0.0F);
this.Shape39 = new ModelRenderer(this, 8, 0);
this.Shape39.addBox(-3.0F, -9.0F, 4.2F, 6, 5, 1);
this.Shape39.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape39.setTextureSize(32, 64);
this.Shape39.mirror = true;
this.setRotation(this.Shape39, 0.0F, 0.0F, 0.0F);
this.Shape40 = new ModelRenderer(this, 20, 28);
this.Shape40.addBox(-2.0F, -8.5F, 5.0F, 4, 1, 1);
this.Shape40.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape40.setTextureSize(32, 64);
this.Shape40.mirror = true;
this.setRotation(this.Shape40, 0.0F, 0.0F, 0.0F);
this.Shape42 = new ModelRenderer(this, 4, 10);
this.Shape42.addBox(-3.0F, -7.5F, 5.0F, 6, 2, 1);
this.Shape42.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape42.setTextureSize(32, 64);
this.Shape42.mirror = true;
this.setRotation(this.Shape42, 0.0F, 0.0F, 0.0F);
this.Shape43 = new ModelRenderer(this, 20, 28);
this.Shape43.addBox(-2.0F, -5.5F, 5.0F, 4, 1, 1);
this.Shape43.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape43.setTextureSize(32, 64);
this.Shape43.mirror = true;
this.setRotation(this.Shape43, 0.0F, 0.0F, 0.0F);
this.Shape44 = new ModelRenderer(this, 4, 2);
this.Shape44.addBox(2.0F, -4.0F, 4.0F, 1, 1, 1);
this.Shape44.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape44.setTextureSize(32, 64);
this.Shape44.mirror = true;
this.setRotation(this.Shape44, 0.0F, 0.0F, 0.0F);
this.Shape45 = new ModelRenderer(this, 4, 2);
this.Shape45.addBox(-3.0F, -4.0F, 4.0F, 1, 1, 1);
this.Shape45.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape45.setTextureSize(32, 64);
this.Shape45.mirror = true;
this.setRotation(this.Shape45, 0.0F, 0.0F, 0.0F);
this.Shape46 = new ModelRenderer(this, 10, 28);
this.Shape46.addBox(5.533333F, -6.7F, 2.0F, 1, 2, 1);
this.Shape46.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape46.setTextureSize(32, 64);
this.Shape46.mirror = true;
this.setRotation(this.Shape46, 0.0F, 0.0F, 0.0F);
this.Shape47 = new ModelRenderer(this, 9, 30);
this.Shape47.addBox(5.4F, -9.0F, -0.1F, 1, 3, 3);
this.Shape47.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape47.setTextureSize(32, 64);
this.Shape47.mirror = true;
this.setRotation(this.Shape47, 0.0F, 0.0F, 0.0F);
this.Shape48 = new ModelRenderer(this, 10, 29);
this.Shape48.addBox(5.533333F, -6.7F, -0.4F, 1, 2, 1);
this.Shape48.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape48.setTextureSize(32, 64);
this.Shape48.mirror = true;
this.setRotation(this.Shape48, 0.0F, 0.0F, 0.0F);
this.Shape49 = new ModelRenderer(this, 10, 28);
this.Shape49.addBox(5.533333F, -4.9F, 0.3F, 1, 1, 2);
this.Shape49.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape49.setTextureSize(32, 64);
this.Shape49.mirror = true;
this.setRotation(this.Shape49, 0.0F, 0.0F, 0.0F);
this.Shape50 = new ModelRenderer(this, 7, 31);
this.Shape50.addBox(6.033333F, -10.73333F, 0.3F, 1, 6, 2);
this.Shape50.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape50.setTextureSize(32, 64);
this.Shape50.mirror = true;
this.setRotation(this.Shape50, 0.0F, 0.0F, 0.0F);
this.Shape51 = new ModelRenderer(this, 7, 30);
this.Shape51.addBox(6.533333F, -12.0F, 0.7F, 1, 7, 2);
this.Shape51.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape51.setTextureSize(32, 64);
this.Shape51.mirror = true;
this.setRotation(this.Shape51, 0.0F, 0.0F, 0.0F);
this.Shape52 = new ModelRenderer(this, 10, 31);
this.Shape52.addBox(7.0F, -11.0F, 1.3F, 1, 5, 1);
this.Shape52.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape52.setTextureSize(32, 64);
this.Shape52.mirror = true;
this.setRotation(this.Shape52, 0.0F, 0.0F, 0.0F);
this.Shape53 = new ModelRenderer(this, 8, 31);
this.Shape53.addBox(6.1F, -13.0F, 0.8F, 1, 3, 2);
this.Shape53.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape53.setTextureSize(32, 64);
this.Shape53.mirror = true;
this.setRotation(this.Shape53, 0.0F, 0.0F, 0.0F);
this.Shape54 = new ModelRenderer(this, 10, 30);
this.Shape54.addBox(5.533333F, -14.0F, 1.3F, 1, 2, 1);
this.Shape54.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape54.setTextureSize(32, 64);
this.Shape54.mirror = true;
this.setRotation(this.Shape54, 0.0F, 0.0F, 0.0F);
this.Shape55 = new ModelRenderer(this, 3, 30);
this.Shape55.addBox(-6.5F, -6.7F, -0.4F, 1, 2, 1);
this.Shape55.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape55.setTextureSize(32, 64);
this.Shape55.mirror = true;
this.setRotation(this.Shape55, 0.0F, 0.0F, 0.0F);
this.Shape56 = new ModelRenderer(this, 5, 30);
this.Shape56.addBox(-6.5F, -4.9F, 0.3F, 1, 1, 2);
this.Shape56.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape56.setTextureSize(32, 64);
this.Shape56.mirror = true;
this.setRotation(this.Shape56, 0.0F, 0.0F, 0.0F);
this.Shape57 = new ModelRenderer(this, 3, 30);
this.Shape57.addBox(-6.5F, -6.7F, 2.0F, 1, 2, 1);
this.Shape57.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape57.setTextureSize(32, 64);
this.Shape57.mirror = true;
this.setRotation(this.Shape57, 0.0F, 0.0F, 0.0F);
this.Shape58 = new ModelRenderer(this, 1, 31);
this.Shape58.addBox(-6.9F, -10.7F, 0.2666667F, 1, 6, 2);
this.Shape58.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape58.setTextureSize(32, 64);
this.Shape58.mirror = true;
this.setRotation(this.Shape58, 0.0F, 0.0F, 0.0F);
this.Shape59 = new ModelRenderer(this, 3, 31);
this.Shape59.addBox(-8.0F, -11.0F, 1.3F, 1, 4, 1);
this.Shape59.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape59.setTextureSize(32, 64);
this.Shape59.mirror = true;
this.setRotation(this.Shape59, 0.0F, 0.0F, 0.0F);
this.Shape60 = new ModelRenderer(this, 0, 30);
this.Shape60.addBox(-7.5F, -12.0F, 0.7F, 1, 6, 2);
this.Shape60.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape60.setTextureSize(32, 64);
this.Shape60.mirror = true;
this.setRotation(this.Shape60, 0.0F, 0.0F, 0.0F);
this.Shape61 = new ModelRenderer(this, 2, 31);
this.Shape61.addBox(-7.0F, -13.0F, 0.8F, 1, 3, 2);
this.Shape61.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape61.setTextureSize(32, 64);
this.Shape61.mirror = true;
this.setRotation(this.Shape61, 0.0F, 0.0F, 0.0F);
this.Shape62 = new ModelRenderer(this, 4, 28);
this.Shape62.addBox(-6.5F, -14.0F, 1.3F, 1, 2, 1);
this.Shape62.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape62.setTextureSize(32, 64);
this.Shape62.mirror = true;
this.setRotation(this.Shape62, 0.0F, 0.0F, 0.0F);
this.Shape63 = new ModelRenderer(this, 4, 48);
this.Shape63.addBox(-1.0F, -11.23333F, -3.0F, 2, 1, 6);
this.Shape63.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape63.setTextureSize(32, 64);
this.Shape63.mirror = true;
this.setRotation(this.Shape63, 0.0F, 0.0F, 0.0F);
this.Shape64 = new ModelRenderer(this, 8, 52);
this.Shape64.addBox(-1.0F, -10.73333F, -4.0F, 2, 1, 1);
this.Shape64.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape64.setTextureSize(32, 64);
this.Shape64.mirror = true;
this.setRotation(this.Shape64, 0.0F, 0.0F, 0.0F);
this.Shape65 = new ModelRenderer(this, 7, 47);
this.Shape65.addBox(-1.0F, -10.0F, -4.8F, 2, 1, 1);
this.Shape65.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape65.setTextureSize(32, 64);
this.Shape65.mirror = true;
this.setRotation(this.Shape65, 0.0F, 0.0F, 0.0F);
this.Shape67 = new ModelRenderer(this, 4, 28);
this.Shape67.addBox(-6.0F, -14.5F, 1.3F, 1, 1, 1);
this.Shape67.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape67.setTextureSize(32, 64);
this.Shape67.mirror = true;
this.setRotation(this.Shape67, 0.0F, 0.0F, 0.0F);
this.Shape68 = new ModelRenderer(this, 10, 30);
this.Shape68.addBox(5.0F, -14.5F, 1.3F, 1, 1, 1);
this.Shape68.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape68.setTextureSize(32, 64);
this.Shape68.mirror = true;
this.setRotation(this.Shape68, 0.0F, 0.0F, 0.0F);
this.Shape69 = new ModelRenderer(this, 2, 30);
this.Shape69.addBox(-6.4F, -9.0F, -0.1F, 1, 3, 3);
this.Shape69.setRotationPoint(0.0F, 0.0F, 0.0F);
this.Shape69.setTextureSize(32, 64);
this.Shape69.mirror = true;
this.setRotation(this.Shape69, 0.0F, 0.0F, 0.0F);
super.bipedHead.cubeList.clear();
super.bipedHead.addChild(this.Shape1);
super.bipedHead.addChild(this.Shape2);
super.bipedHead.addChild(this.Shape3);
super.bipedHead.addChild(this.Shape4);
super.bipedHead.addChild(this.Shape5);
super.bipedHead.addChild(this.Shape6);
super.bipedHead.addChild(this.Shape7);
super.bipedHead.addChild(this.Shape8);
super.bipedHead.addChild(this.Shape9);
super.bipedHead.addChild(this.Shape10);
super.bipedHead.addChild(this.Shape11);
super.bipedHead.addChild(this.Shape12);
super.bipedHead.addChild(this.Shape13);
super.bipedHead.addChild(this.Shape14);
super.bipedHead.addChild(this.Shape15);
super.bipedHead.addChild(this.Shape16);
super.bipedHead.addChild(this.Shape17);
super.bipedHead.addChild(this.Shape18);
super.bipedHead.addChild(this.Shape19);
super.bipedHead.addChild(this.Shape21);
super.bipedHead.addChild(this.Shape22);
super.bipedHead.addChild(this.Shape23);
super.bipedHead.addChild(this.Shape24);
super.bipedHead.addChild(this.Shape25);
super.bipedHead.addChild(this.Shape26);
super.bipedHead.addChild(this.Shape27);
super.bipedHead.addChild(this.Shape28);
super.bipedHead.addChild(this.Shape29);
super.bipedHead.addChild(this.Shape30);
super.bipedHead.addChild(this.Shape31);
super.bipedHead.addChild(this.Shape32);
super.bipedHead.addChild(this.Shape33);
super.bipedHead.addChild(this.Shape34);
super.bipedHead.addChild(this.Shape35);
super.bipedHead.addChild(this.Shape36);
super.bipedHead.addChild(this.Shape37);
super.bipedHead.addChild(this.Shape38);
super.bipedHead.addChild(this.Shape39);
super.bipedHead.addChild(this.Shape40);
super.bipedHead.addChild(this.Shape42);
super.bipedHead.addChild(this.Shape43);
super.bipedHead.addChild(this.Shape44);
super.bipedHead.addChild(this.Shape45);
super.bipedHead.addChild(this.Shape46);
super.bipedHead.addChild(this.Shape47);
super.bipedHead.addChild(this.Shape48);
super.bipedHead.addChild(this.Shape49);
super.bipedHead.addChild(this.Shape50);
super.bipedHead.addChild(this.Shape51);
super.bipedHead.addChild(this.Shape52);
super.bipedHead.addChild(this.Shape53);
super.bipedHead.addChild(this.Shape54);
super.bipedHead.addChild(this.Shape55);
super.bipedHead.addChild(this.Shape56);
super.bipedHead.addChild(this.Shape57);
super.bipedHead.addChild(this.Shape58);
super.bipedHead.addChild(this.Shape59);
super.bipedHead.addChild(this.Shape60);
super.bipedHead.addChild(this.Shape61);
super.bipedHead.addChild(this.Shape62);
super.bipedHead.addChild(this.Shape63);
super.bipedHead.addChild(this.Shape64);
super.bipedHead.addChild(this.Shape65);
super.bipedHead.addChild(this.Shape67);
super.bipedHead.addChild(this.Shape68);
super.bipedHead.addChild(this.Shape69);
}
private void setRotation(ModelRenderer model, float x, float y, float z) {
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}
Java:
public class ModelItemBase extends ModelBiped {
public int swing;
public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) {
super.bipedHead.rotateAngleY = par4 / 57.295776F;
super.bipedHead.rotateAngleX = par5 / 57.295776F;
super.bipedHeadwear.rotateAngleY = super.bipedHead.rotateAngleY;
super.bipedHeadwear.rotateAngleX = super.bipedHead.rotateAngleX;
super.bipedRightArm.rotateAngleX = MathHelper.cos(par1 * 0.6662F + 3.1415927F) * 2.0F * par2 * 0.5F;
super.bipedLeftArm.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 2.0F * par2 * 0.5F;
super.bipedRightArm.rotateAngleZ = 0.0F;
super.bipedLeftArm.rotateAngleZ = 0.0F;
super.bipedRightLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2;
super.bipedLeftLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + 3.1415927F) * 1.4F * par2;
super.bipedRightLeg.rotateAngleY = 0.0F;
super.bipedLeftLeg.rotateAngleY = 0.0F;
if(this.swing > 0) {
System.out.println(this.swing);
}
if(super.isRiding) {
super.bipedRightArm.rotateAngleX += -0.62831855F;
super.bipedLeftArm.rotateAngleX += -0.62831855F;
super.bipedRightLeg.rotateAngleX = -1.2566371F;
super.bipedLeftLeg.rotateAngleX = -1.2566371F;
super.bipedRightLeg.rotateAngleY = 0.31415927F;
super.bipedLeftLeg.rotateAngleY = -0.31415927F;
}
if(super.heldItemLeft != 0) {
super.bipedLeftArm.rotateAngleX = super.bipedLeftArm.rotateAngleX * 0.5F - 0.31415927F * (float)super.heldItemLeft;
}
if(super.heldItemRight != 0) {
super.bipedRightArm.rotateAngleX = super.bipedRightArm.rotateAngleX * 0.5F - 0.31415927F * (float)super.heldItemRight;
}
super.bipedRightArm.rotateAngleY = 0.0F;
super.bipedLeftArm.rotateAngleY = 0.0F;
float f6;
float f7;
float f8;
if(this.swing > 0) {
super.bipedRightArm.rotateAngleX = super.bipedRightArm.rotateAngleX * 0.5F - 0.31415927F * (float)this.swing;
super.bipedRightArm.rotateAngleY = 0.0F;
super.bipedLeftArm.rotateAngleY = 0.0F;
f6 = (float)(this.swing + 100);
super.bipedBody.rotateAngleY = MathHelper.sin(MathHelper.sqrt_float(f6) * 3.1415927F * 2.0F) * 0.2F;
super.bipedRightArm.rotationPointZ = MathHelper.sin(super.bipedBody.rotateAngleY) * 5.0F;
super.bipedRightArm.rotationPointX = -MathHelper.cos(super.bipedBody.rotateAngleY) * 5.0F;
super.bipedLeftArm.rotationPointZ = -MathHelper.sin(super.bipedBody.rotateAngleY) * 5.0F;
super.bipedLeftArm.rotationPointX = MathHelper.cos(super.bipedBody.rotateAngleY) * 5.0F;
super.bipedRightArm.rotateAngleY += super.bipedBody.rotateAngleY;
super.bipedLeftArm.rotateAngleY += super.bipedBody.rotateAngleY;
super.bipedLeftArm.rotateAngleX += super.bipedBody.rotateAngleY;
f6 = 1.0F - (float)this.swing + 100.0F;
f6 *= f6;
f6 *= f6;
f6 = 1.0F - f6;
f7 = MathHelper.sin(f6 * 3.1415927F);
f8 = MathHelper.sin((float)(this.swing + 100) * 3.1415927F) * -(super.bipedHead.rotateAngleX - 0.7F) * 0.75F;
super.bipedRightArm.rotateAngleX = (float)((double)super.bipedRightArm.rotateAngleX - ((double)f7 * 1.2D + (double)f8));
super.bipedRightArm.rotateAngleY += super.bipedBody.rotateAngleY * 2.0F;
super.bipedRightArm.rotateAngleZ = MathHelper.sin((float)(this.swing + 100) * 3.1415927F) * -0.4F;
}
if(super.onGround > -9990.0F) {
f6 = super.onGround;
super.bipedBody.rotateAngleY = MathHelper.sin(MathHelper.sqrt_float(f6) * 3.1415927F * 2.0F) * 0.2F;
super.bipedRightArm.rotationPointZ = MathHelper.sin(super.bipedBody.rotateAngleY) * 5.0F;
super.bipedRightArm.rotationPointX = -MathHelper.cos(super.bipedBody.rotateAngleY) * 5.0F;
super.bipedLeftArm.rotationPointZ = -MathHelper.sin(super.bipedBody.rotateAngleY) * 5.0F;
super.bipedLeftArm.rotationPointX = MathHelper.cos(super.bipedBody.rotateAngleY) * 5.0F;
super.bipedRightArm.rotateAngleY += super.bipedBody.rotateAngleY;
super.bipedLeftArm.rotateAngleY += super.bipedBody.rotateAngleY;
super.bipedLeftArm.rotateAngleX += super.bipedBody.rotateAngleY;
f6 = 1.0F - super.onGround;
f6 *= f6;
f6 *= f6;
f6 = 1.0F - f6;
f7 = MathHelper.sin(f6 * 3.1415927F);
f8 = MathHelper.sin(super.onGround * 3.1415927F) * -(super.bipedHead.rotateAngleX - 0.7F) * 0.75F;
super.bipedRightArm.rotateAngleX = (float)((double)super.bipedRightArm.rotateAngleX - ((double)f7 * 1.2D + (double)f8));
super.bipedRightArm.rotateAngleY += super.bipedBody.rotateAngleY * 2.0F;
super.bipedRightArm.rotateAngleZ = MathHelper.sin(super.onGround * 3.1415927F) * -0.4F;
}
if(super.isSneak) {
super.bipedBody.rotateAngleX = 0.5F;
super.bipedRightArm.rotateAngleX += 0.4F;
super.bipedLeftArm.rotateAngleX += 0.4F;
super.bipedRightLeg.rotationPointZ = 4.0F;
super.bipedLeftLeg.rotationPointZ = 4.0F;
super.bipedRightLeg.rotationPointY = 9.0F;
super.bipedLeftLeg.rotationPointY = 9.0F;
super.bipedHead.rotationPointY = 1.0F;
super.bipedHeadwear.rotationPointY = 1.0F;
} else {
super.bipedBody.rotateAngleX = 0.0F;
super.bipedRightLeg.rotationPointZ = 0.1F;
super.bipedLeftLeg.rotationPointZ = 0.1F;
super.bipedRightLeg.rotationPointY = 12.0F;
super.bipedLeftLeg.rotationPointY = 12.0F;
super.bipedHead.rotationPointY = 0.0F;
super.bipedHeadwear.rotationPointY = 0.0F;
}
super.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F;
super.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F;
super.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F;
super.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F;
if(super.aimedBow) {
f6 = 0.0F;
f7 = 0.0F;
super.bipedRightArm.rotateAngleZ = 0.0F;
super.bipedLeftArm.rotateAngleZ = 0.0F;
super.bipedRightArm.rotateAngleY = -(0.1F - f6 * 0.6F) + super.bipedHead.rotateAngleY;
super.bipedLeftArm.rotateAngleY = 0.1F - f6 * 0.6F + super.bipedHead.rotateAngleY + 0.4F;
super.bipedRightArm.rotateAngleX = -1.5707964F + super.bipedHead.rotateAngleX;
super.bipedLeftArm.rotateAngleX = -1.5707964F + super.bipedHead.rotateAngleX;
super.bipedRightArm.rotateAngleX -= f6 * 1.2F - f7 * 0.4F;
super.bipedLeftArm.rotateAngleX -= f6 * 1.2F - f7 * 0.4F;
super.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F;
super.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F;
super.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F;
super.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F;
}
}
}
Java:
@Mod (modid = ModItemTechne.MODID, name = ModItemTechne.MODNAME, version = ModItemTechne.VERSION)
public class ModItemTechne {
public static final String MODID = "sub_mod_techne_item";
public static final String MODNAME = "SM_TI";
public static final String VERSION = "0.1a";
@Instance(ModItemTechne.MODID) public static ModItemTechne instance;
@SidedProxy(modId = ModItemTechne.MODID, clientSide = "sub_mod.techne_item.ProxyClient", serverSide = "sub_mod.techne_item.ProxyCommon")
public static ProxyCommon proxy;
public static Item modelHelmet;
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) {
modelHelmet = new ItemTechne();
GameRegistry.registerItem(modelHelmet, "modelHelmet");
proxy.preInit();
}
@Mod.EventHandler
public void init(FMLInitializationEvent event) {
proxy.init();
}
}
Java:
public class ProxyClient extends ProxyCommon {
public static ModelHelmet modelHelmet;
public void preInit() {
super.preInit();
}
@Override
public void init() {
super.init();
modelHelmet = new ModelHelmet();
//хотел поиздеваться, да не буду, сразу скажу, что надо отключить рендер стандартных боксов брони
modelHelmet.bipedHead.showModel = false;
modelHelmet.bipedHeadwear.showModel = false;
modelHelmet.bipedBody.showModel = false;
modelHelmet.bipedLeftArm.showModel = false;
modelHelmet.bipedRightArm.showModel = false;
modelHelmet.bipedLeftLeg.showModel = false;
modelHelmet.bipedRightLeg.showModel = false;
modelHelmet.bipedCloak.showModel = false;
}
public static ModelBiped getArmorModel() {
modelHelmet = new ModelHelmet();
return null;
}
private static final ModelHelmet tutChest = new ModelHelmet();
public ModelBiped getArmorModel(int i) {
// TODO Auto-generated method stub
return null;
}
public ModelBiped getArmorModel1(int id) {
// TODO Auto-generated method stub
return null;
}
}
Java:
public class ProxyCommon {
public void preInit() {
}
public void init() {
}
public static ModelBiped getArmorModel() {
return null;
}
}