5 juin 2014, 17:28

je ne comprend pas ajouter 4 autres ?

bon edit:
exemple pour ajouter d’autre armure avec d’autre effet tu doit faire cela :


package fr.blackpandagaming.dragonadventure.common;

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 Armures extends ItemArmor
{
private ItemArmor.ArmorMaterial material;

public Armures(ItemArmor.ArmorMaterial material, int type)
{
super(material, 0, type);
this.material = material;
}

//Armure en Dragonite blanche

public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
{
if(stack.getItem() == DragonAdventure.pentalonDragoniteBlanche)
{
return DragonAdventure.MODID + ":textures/models/armor/DragoniteBlanche_leyer_2.png";
}
return DragonAdventure.MODID + ":textures/models/armor/DragoniteBlanche_leyer_1.png";
}

public boolean getIsRepairable1(ItemStack input, ItemStack repair)
{
if(repair.getItem() == DragonAdventure.dragoniteBlanche || repair.getItem() == DragonAdventure.dragoniteBlanche)
{
return true;
}
return false;
}

public void onArmorTick1(World world, EntityPlayer player, ItemStack stack)
{
if(this.material == ClassePrincipale.nomDuMaterial)
{
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 210, 2));
}
if(this.material == ClassePrincipale.unAutreMaterial)
{
//de nouveau un effet
}

//tu recommence les méthode a chaque fois :p
}
}