Aide mise à jour d'un mod
-
ctrl + shift + f
.itemID n’existe plus, suffit de les enlever.
this.setContainerItem(book); -> this.setContainerItem(Items.book);
Pour tout ça :private Icon nom0; private Icon nom1; private Icon nom2; private Icon nom3; private Icon nom4; private Icon nom5;IIcon à la place de Icon.
Pour ça :public void registerIcons(IIconRegister iconregister) { this.blockIcon = IIconRegister .registerIcon("pixelmonfr:bibliotheque1"); this.nom0 = IIconRegister.registerIcon("pixelmonfr:top1"); this.nom1 = IIconRegister .registerIcon("pixelmonfr:top1"); this.nom2 = IIconRegister .registerIcon("pixelmonfr:bibliotheque1"); this.nom3 = IIconRegister .registerIcon("pixelmonfr:bibliotheque1"); this.nom4 = IIconRegister .registerIcon("pixelmonfr:bibliotheque1"); this.nom5 = IIconRegister .registerIcon("pixelmonfr:bibliotheque1"); }ça devient :
public void registerBlockIcons(IIconRegister iconregister) { this.blockIcon = iconregister.registerIcon("pixelmonfr:bibliotheque1"); this.nom0 = iconregister.registerIcon("pixelmonfr:top1"); this.nom1 = iconregister.registerIcon("pixelmonfr:top1"); this.nom2 = iconregister.registerIcon("pixelmonfr:bibliotheque1"); this.nom3 = iconregister.registerIcon("pixelmonfr:bibliotheque1"); this.nom4 = iconregister.registerIcon("pixelmonfr:bibliotheque1"); this.nom5 = iconregister.registerIcon("pixelmonfr:bibliotheque1"); }Pour la fonction dropPlayerItem, elle a surement changé de nom.
Et pour l’onglet créatif :
package pixelmonfr; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; public class creatitems extends CreativeTabs { public creatitems(String label) { super(label); } public Item getTabIconItem() { return pixelmain.CarteMembre; } -
Pour la classe sans les “itemID” voici ce que cela donne :
package pixelmonfr; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; public class CB extends ItemArmor { public CB(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) { super(par1, par2EnumArmorMaterial, par3, par4); } public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) { if (stack == pixelmain.CB1 || stack == pixelmain.CB2 || stack == pixelmain.CB4) { return "pixelmonfr:textures/armor/chemiseb_layer_1.png"; } if (stack == pixelmain.CB3) { return "pixelmonfr:textures/armor/chemiseb_layer_2.png"; } else { return null; } } public void registerIcons(IIconRegister reg) { // Make sure to import IconRegister! if ( == pixelmain.CB2) { this.itemIcon = reg.registerIcon("pixelmonfr:cb2"); // You can also replace blockID and blockIcon with itemID and itemIcon } if ( == pixelmain.CB3) { this.itemIcon = reg.registerIcon("pixelmonfr:cb3"); // You can also replace blockID and blockIcon with itemID and itemIcon } if ( == pixelmain.CB4) { this.itemIcon = reg.registerIcon("pixelmonfr:cb4"); // You can also replace blockID and blockIcon with itemID and itemIcon } if ( == pixelmain.CB1) { this.itemIcon = reg.registerIcon("pixelmonfr:cb1"); // You can also replace blockID and blockIcon with itemID and itemIcon } } }Cela donne donc des if avec des == vide.
Pour les erreurs les voici :
:::Incompatible operand types ItemStack and Item (ligne 13 à 18 même erreur)
Syntax error on token “==”, delete this token CB.java (ligne 26,30,34,38 : je vois pas quoi mettre à la place des “itemID” du coup)
Type mismatch: cannot convert from Item to boolean CB.java (ligne 29,33,37,41)
par2ArmorMaterial cannot be resolved to a variable CB.java (ligne 11)
:::
Sinon où puis-je me renseigner pour trouver le nouveau nom de la fonction : dropPlayerItem
J’ai également un erreur sur la fonction : “setLightValue”
Ici :Stats = (new Stats(10000)).setUnlocalizedName("Stats") .setTextureName("pixelmonfr:Stats").setCreativeTab(pixelitems); GameRegistry.registerItem(Stats, "Classement Joueur"); LanguageRegistry.addName(Stats, "Classement Joueur"); lampe1 = (new lampeBlanche1(2020)).setHardness(1.0F) .setStepSound(Block.soundTypeStone) .setBlockName("lampeblanche") .setBlockTextureName("pixelmonfr:lampe1") .setCreativeTab(pixelblock).setLightValue(1.0F); -
Il faut chercher dans la classe du joueur.
Pour l’armure je te conseil de regarder le tutoriel 1.7.x du site.
Et pour le setLightValue c’est étrange, ça devrait fonctionner normalement.
-
Pour le setLightValue voici l’erreur : The method setLightValue(float) is undefined for the type Block
-
Ah si, elle a changée c’est setLightLevel maintenant.
-
Je viens de voir le tutoriel pour la création d’une armure.
J’ai donc modifier ma classe par contre je bute sur la fonction registerIcons.
Voici ma classe :package pixelmonfr; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; public class CB extends ItemArmor { public CB(ArmorMaterial material, int type) { super(material, 0, type); } public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { if(slot == 2) { return "pixelmonfr:textures/armor/chemiseb_layer_1.png"; } return "pixelmonfr:textures/armor/chemiseb_layer_2.png"; } public void registerIcons(IIconRegister reg) { // Make sure to import IconRegister! if (pixelmain.CB2) { this.itemIcon = reg.registerIcon("pixelmonfr:cb2"); // You can also replace blockID and blockIcon with itemID and itemIcon } if ( == pixelmain.CB3) { this.itemIcon = reg.registerIcon("pixelmonfr:cb3"); // You can also replace blockID and blockIcon with itemID and itemIcon } if ( == pixelmain.CB4) { this.itemIcon = reg.registerIcon("pixelmonfr:cb4"); // You can also replace blockID and blockIcon with itemID and itemIcon } if ( == pixelmain.CB1) { this.itemIcon = reg.registerIcon("pixelmonfr:cb1"); // You can also replace blockID and blockIcon with itemID and itemIcon } } } -
Elle ne sert à rien, tu peux définir les textures dans la déclarations de l’item directement avec .setTextureName
Donc vire totalement cette fonction. -
Ok merci par contre je ne trouve pas la fonction qui remplace “dropPlayerItem”.
Dans quelles classe faut-il que je cherche ? -
Visiblement c’est
par3EntityPlayer.dropPlayerItemWithRandomChoice(new ItemStack(pixelmain.tortank), true); -
Merci beaucoup pour cette précieuse aide et le temps que tu as accordé
