timaxa007 написал(а):
В класс твоего шлема брони.
вообщем со шлемом получилось ,а с названием проблема
только,что заметил ,что у меня эффект даётся любой частью брони ,вот код
package ru.armor.armor;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
public class Fila_trupArmor extends ItemArmor {
private String texturePath = "armor:textures/model/armor/";
public Fila_trupArmor(int id, int armorType) {
super(Fila_trupMain.heavystill, id, armorType);
this.setCreativeTab(CreativeTabs.tabCombat);
this.setMaxStackSize(1);
this.setTextureName();
}
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 20));
}
public void setTextureName()
{
if(armorType == 0||armorType == 1||armorType == 3){
this.texturePath += "Heavy_" + 1 + ".png";
}
else {
this.texturePath += "Heavy_" + 2 + ".png";
}
}
@Override
public String getArmorTexture(ItemStack itemstack, Entity entity, int slot, String type){
return this.texturePath;
}
}