MFF

    Minecraft Forge France
    • Récent
    • Mots-clés
    • Populaire
    • Utilisateurs
    • Groupes
    • Forge Events
      • Automatique
      • Foncé
      • Clair
    • S'inscrire
    • Se connecter

    Aide mise à jour d'un mod

    Planifier Épinglé Verrouillé Déplacé Résolu 1.7.x
    1.7.x
    13 Messages 2 Publieurs 2.2k Vues 1 Watching
    Charger plus de messages
    • Du plus ancien au plus récent
    • Du plus récent au plus ancien
    • Les plus votés
    Répondre
    • Répondre à l'aide d'un nouveau sujet
    Se connecter pour répondre
    Ce sujet a été supprimé. Seuls les utilisateurs avec les droits d'administration peuvent le voir.
    • robin4002R Hors-ligne
      robin4002 Moddeurs confirmés Rédacteurs Administrateurs
      dernière édition par

      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;
      }
      
      1 réponse Dernière réponse Répondre Citer 0
      • S Hors-ligne
        Sebenf0rce
        dernière édition par

        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);
        
        1 réponse Dernière réponse Répondre Citer 0
        • robin4002R Hors-ligne
          robin4002 Moddeurs confirmés Rédacteurs Administrateurs
          dernière édition par

          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.

          1 réponse Dernière réponse Répondre Citer 0
          • S Hors-ligne
            Sebenf0rce
            dernière édition par

            Pour le setLightValue voici l’erreur : The method setLightValue(float) is undefined for the type Block

            1 réponse Dernière réponse Répondre Citer 0
            • robin4002R Hors-ligne
              robin4002 Moddeurs confirmés Rédacteurs Administrateurs
              dernière édition par

              Ah si, elle a changée c’est setLightLevel maintenant.

              1 réponse Dernière réponse Répondre Citer 0
              • S Hors-ligne
                Sebenf0rce
                dernière édition par

                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
                }
                
                }
                }
                
                1 réponse Dernière réponse Répondre Citer 0
                • robin4002R Hors-ligne
                  robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                  dernière édition par

                  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.

                  1 réponse Dernière réponse Répondre Citer 0
                  • S Hors-ligne
                    Sebenf0rce
                    dernière édition par

                    Ok merci par contre je ne trouve pas la fonction qui remplace “dropPlayerItem”.
                    Dans quelles classe faut-il que je cherche ?

                    1 réponse Dernière réponse Répondre Citer 0
                    • robin4002R Hors-ligne
                      robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                      dernière édition par

                      Visiblement c’est
                      par3EntityPlayer.dropPlayerItemWithRandomChoice(new ItemStack(pixelmain.tortank), true);

                      1 réponse Dernière réponse Répondre Citer 0
                      • S Hors-ligne
                        Sebenf0rce
                        dernière édition par

                        Merci beaucoup pour cette précieuse aide et le temps que tu as accordé 😉

                        1 réponse Dernière réponse Répondre Citer 0
                        • 1 / 1
                        • Premier message
                          Dernier message
                        Design by Woryk
                        ContactMentions Légales

                        MINECRAFT FORGE FRANCE © 2024

                        Powered by NodeBB