MFF

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

    BonjourLeJsonBugué:)

    Planifier Épinglé Verrouillé Déplacé Sans suite
    1.11.x
    13 Messages 2 Publieurs 2.3k Vues 1 Abonné
    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.
    • Infectiion21I Hors-ligne
      Infectiion21
      dernière édition par

      Alors, oui il y a plusieurs erreurs dans les logs… J’ai des erreurs qui me disent que j’ai mes items registré 2 fois et je ne comprend pas pourquoi, puisque ça ne m’a jamais fait crash et…
      J’ai une erreur à propos de mon model.

      Je te laisse regarder ça: https://pastebin.com/XnsDe0Cb

      je pense avoir trouvé une piste, mais je ne suis pas encore sur.

      Dans la classe de mon outil, j’ai ceci:

      package fr.breakfight.infectiion21.tools;
      
      import fr.breakfight.infectiion21.handlers.ToolsHandler;
      import net.minecraft.creativetab.CreativeTabs;
      import net.minecraft.item.ItemPickaxe;
      
      public class ToolPlatinePickaxe extends ItemPickaxe{
      
      public ToolPlatinePickaxe(ToolMaterial material) {
      super(material);
      setUnlocalizedName(ToolsHandler.BreakFightTools.PLATINEPICKAXE.getUnlocalizedName());
      setRegistryName(ToolsHandler.BreakFightTools.PLATINEPICKAXE.getRegistryName());
      setCreativeTab(CreativeTabs.TOOLS);
      // TODO Auto-generated constructor stub
      }
      
      }
      
      

      Je pense que le constructor défini seulement le material et non le unlocalizedname + registryname. 
      Dans mes autres classes, items, il n’y a pas d’argument: ToolMaterial material.
      Je ne peux pas l’enlever, puisque c’est le constructor de ‘‘ItemPickaxe’’ de minecraft… Alors je ne sais pas comment arranger ça, si c’est la source du problème.

      Merci beaucoup

      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

        ToolsHandler.BreakFightTools.PLATINEPICKAXE.getRegistryName() renvoie quoi ?

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

          Ça:
          public static enum BreakFightTools {

          PLATINEPICKAXE(“platinePickaxe”, “ToolPlatinePickaxe”),
          PINKSTARPICKAXE(“pinkstarPickaxe”, “ToolPinkstarPickaxe”),
          TAFEITEPICKAXE(“tafeitePickaxe”, “ToolTafeitePickaxe”),
          PAINITEPICKAXE(“painitePickaxe”, “ToolPainitePickaxe”),

          PLATINESHOVEL(“platineShovel”, “ToolPlatineShovel”),
          PINKSTARSHOVEL(“pinkstarShovel”, “ToolPinkstarShovel”),
          TAFEITESHOVEL(“tafeiteShovel”, “ToolTafeiteShovel”),
          PAINITESHOVEL(“painiteShovel”, “ToolPainiteShovel”),

          PLATINEAXE(“platineAxe”, “ToolPlatineAxe”),
          PINKSTARAXE(“pinkstarAxe”, “ToolPinkstarAxe”),
          TAFEITEAXE(“tafeiteAxe”, “ToolTafeiteAxe”),
          PAINITEAXE(“painiteAxe”, “ToolPainiteAxe”),

          PLATINESWORD(“platineSword”, “ToolPlatineSword”),
          PINKSTARSWORD(“pinkstarSword”, “ToolPinkstarSword”),
          TAFEITESWORD(“tafeiteSword”, “ToolTafeiteSword”),
          PAINITESWORD(“painiteSword”, “ToolPainiteSword”),

          PLATINEHOE(“platineHoe”, “ToolPlatineHoe”),
          PINKSTARHOE(“pinkstarHoe”, “ToolPinkstarHoe”),
          TAFEITEHOE(“tafeiteHoe”, “ToolTafeiteHoe”),
          PAINITEHOE(“painiteHoe”, “ToolPainiteHoe”);

          private String unlocalizedName;
          private String registryName;

          BreakFightTools(String unlocalizedName, String registryName) {
          this.unlocalizedName = unlocalizedName;
          this.registryName = registryName;
          }

          public String getUnlocalizedName() {
          return unlocalizedName;
          }

          public String getRegistryName() {
          return registryName;
          }
          }

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

            Ça:

            public static enum BreakFightTools {
            
              PLATINEPICKAXE("platinePickaxe", "ToolPlatinePickaxe"),
              PINKSTARPICKAXE("pinkstarPickaxe", "ToolPinkstarPickaxe"),
              TAFEITEPICKAXE("tafeitePickaxe", "ToolTafeitePickaxe"),
              PAINITEPICKAXE("painitePickaxe", "ToolPainitePickaxe"),
            
              PLATINESHOVEL("platineShovel", "ToolPlatineShovel"),
              PINKSTARSHOVEL("pinkstarShovel", "ToolPinkstarShovel"),
              TAFEITESHOVEL("tafeiteShovel", "ToolTafeiteShovel"),
              PAINITESHOVEL("painiteShovel", "ToolPainiteShovel"),
            
              PLATINEAXE("platineAxe", "ToolPlatineAxe"),
              PINKSTARAXE("pinkstarAxe", "ToolPinkstarAxe"),
              TAFEITEAXE("tafeiteAxe", "ToolTafeiteAxe"),
              PAINITEAXE("painiteAxe", "ToolPainiteAxe"),
            
              PLATINESWORD("platineSword", "ToolPlatineSword"),
              PINKSTARSWORD("pinkstarSword", "ToolPinkstarSword"),
              TAFEITESWORD("tafeiteSword", "ToolTafeiteSword"),
              PAINITESWORD("painiteSword", "ToolPainiteSword"),
            
              PLATINEHOE("platineHoe", "ToolPlatineHoe"),
              PINKSTARHOE("pinkstarHoe", "ToolPinkstarHoe"),
              TAFEITEHOE("tafeiteHoe", "ToolTafeiteHoe"),
              PAINITEHOE("painiteHoe", "ToolPainiteHoe");
            
              private String unlocalizedName;
              private String registryName;
            
              BreakFightTools(String unlocalizedName, String registryName) {
              this.unlocalizedName = unlocalizedName;
              this.registryName = registryName;
              }
            
              public String getUnlocalizedName() {
              return unlocalizedName;
              }
            
              public String getRegistryName() {
              return registryName;
              }
            }
            

            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

              Donc pas de problème à ce niveau.

              Le json est bien enregistré ?

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

                Bien enregistré… ? C’est à dire ?

                edit: c’Est bon j’ai compris ^^

                Au pire je te donne ma classe:

                package fr.breakfight.infectiion21.handlers;
                
                import fr.breakfight.infectiion21.common.BreakfMain;
                import fr.breakfight.infectiion21.tools.ToolPainiteAxe;
                import fr.breakfight.infectiion21.tools.ToolPainiteHoe;
                import fr.breakfight.infectiion21.tools.ToolPainitePickaxe;
                import fr.breakfight.infectiion21.tools.ToolPainiteShovel;
                import fr.breakfight.infectiion21.tools.ToolPainiteSword;
                import fr.breakfight.infectiion21.tools.ToolPinkstarAxe;
                import fr.breakfight.infectiion21.tools.ToolPinkstarHoe;
                import fr.breakfight.infectiion21.tools.ToolPinkstarPickaxe;
                import fr.breakfight.infectiion21.tools.ToolPinkstarShovel;
                import fr.breakfight.infectiion21.tools.ToolPinkstarSword;
                import fr.breakfight.infectiion21.tools.ToolPlatineAxe;
                import fr.breakfight.infectiion21.tools.ToolPlatineHoe;
                import fr.breakfight.infectiion21.tools.ToolPlatinePickaxe;
                import fr.breakfight.infectiion21.tools.ToolPlatineShovel;
                import fr.breakfight.infectiion21.tools.ToolPlatineSword;
                import fr.breakfight.infectiion21.tools.ToolTafeiteAxe;
                import fr.breakfight.infectiion21.tools.ToolTafeiteHoe;
                import fr.breakfight.infectiion21.tools.ToolTafeitePickaxe;
                import fr.breakfight.infectiion21.tools.ToolTafeiteShovel;
                import fr.breakfight.infectiion21.tools.ToolTafeiteSword;
                import net.minecraft.client.Minecraft;
                import net.minecraft.client.renderer.block.model.ModelResourceLocation;
                import net.minecraft.item.Item;
                import net.minecraft.item.Item.ToolMaterial;
                import net.minecraft.item.ItemHoe;
                import net.minecraft.item.ItemPickaxe;
                import net.minecraft.item.ItemSpade;
                import net.minecraft.item.ItemSword;
                import net.minecraftforge.common.util.EnumHelper;
                import net.minecraftforge.fml.common.registry.GameRegistry;
                
                public class ToolsHandler {
                
                public static final ToolMaterial platineMaterial = EnumHelper.addToolMaterial(BreakfMain.MODID + ":platine", 2, 500, 7.0F, 2.5F, 15);
                public static final ToolMaterial pinkstarMaterial = EnumHelper.addToolMaterial(BreakfMain.MODID + ":pinkstar", 3, 2000, 10.0F, 4.0F, 9);
                public static final ToolMaterial tafeiteMaterial = EnumHelper.addToolMaterial(BreakfMain.MODID + ":tafeite", 4, 3500, 20.0F, 5.5F, 8);
                public static final ToolMaterial painiteMaterial = EnumHelper.addToolMaterial(BreakfMain.MODID + ":painite", 5, 5000, 32.0F, 9.25F, 7);
                
                public static ItemPickaxe platinePickaxe;
                public static ItemPickaxe pinkstarPickaxe;
                public static ItemPickaxe tafeitePickaxe;
                public static ItemPickaxe painitePickaxe;
                
                public static ItemSpade platineShovel;
                public static ItemSpade pinkstarShovel;
                public static ItemSpade tafeiteShovel;
                public static ItemSpade painiteShovel;
                
                public static ToolPlatineAxe platineAxe;
                public static ToolPinkstarAxe pinkstarAxe;
                public static ToolTafeiteAxe tafeiteAxe;
                public static ToolPainiteAxe painiteAxe;
                
                public static ItemSword platineSword;
                public static ItemSword pinkstarSword;
                public static ItemSword tafeiteSword;
                public static ItemSword painiteSword;
                
                public static ItemHoe platineHoe;
                public static ItemHoe pinkstarHoe;
                public static ItemHoe tafeiteHoe;
                public static ItemHoe painiteHoe;
                
                public static void init() {
                
                platinePickaxe = new ToolPlatinePickaxe();
                pinkstarPickaxe = new ToolPinkstarPickaxe(pinkstarMaterial);
                tafeitePickaxe = new ToolTafeitePickaxe(tafeiteMaterial);
                painitePickaxe = new ToolPainitePickaxe(painiteMaterial);
                
                platineShovel = new ToolPlatineShovel(platineMaterial);
                pinkstarShovel = new ToolPinkstarShovel(pinkstarMaterial);
                tafeiteShovel = new ToolTafeiteShovel(tafeiteMaterial);
                painiteShovel = new ToolPainiteShovel(painiteMaterial);
                
                platineAxe = new ToolPlatineAxe(platineMaterial);
                pinkstarAxe = new ToolPinkstarAxe(pinkstarMaterial);
                tafeiteAxe = new ToolTafeiteAxe(tafeiteMaterial);
                painiteAxe = new ToolPainiteAxe(painiteMaterial);
                
                platineSword = new ToolPlatineSword(platineMaterial);
                pinkstarSword = new ToolPinkstarSword(pinkstarMaterial);
                tafeiteSword = new ToolTafeiteSword(tafeiteMaterial);
                painiteSword = new ToolPainiteSword(painiteMaterial);
                
                platineHoe = new ToolPlatineHoe(platineMaterial);
                pinkstarHoe = new ToolPinkstarHoe(pinkstarMaterial);
                tafeiteHoe = new ToolTafeiteHoe(tafeiteMaterial);
                painiteHoe = new ToolPainiteHoe(painiteMaterial);
                
                }
                
                public static void register() {
                
                GameRegistry.register(platinePickaxe);
                GameRegistry.register(pinkstarPickaxe);
                GameRegistry.register(tafeitePickaxe);
                GameRegistry.register(painitePickaxe);
                
                GameRegistry.register(platineShovel);
                GameRegistry.register(pinkstarShovel);
                GameRegistry.register(tafeiteShovel);
                GameRegistry.register(painiteShovel);
                
                GameRegistry.register(platineAxe);
                GameRegistry.register(pinkstarAxe);
                GameRegistry.register(tafeiteAxe);
                GameRegistry.register(painiteAxe);
                
                GameRegistry.register(platineSword);
                GameRegistry.register(pinkstarSword);
                GameRegistry.register(tafeiteSword);
                GameRegistry.register(painiteSword);
                
                GameRegistry.register(platineHoe);
                GameRegistry.register(pinkstarHoe);
                GameRegistry.register(tafeiteHoe);
                GameRegistry.register(painiteHoe);
                
                }
                
                public static void registerRenders() {
                
                registerRender(platinePickaxe);
                registerRender(pinkstarPickaxe);
                registerRender(tafeitePickaxe);
                registerRender(painitePickaxe);
                
                registerRender(platineShovel);
                registerRender(pinkstarShovel);
                registerRender(tafeiteShovel);
                registerRender(painiteShovel);
                
                registerRender(platineAxe);
                registerRender(pinkstarAxe);
                registerRender(tafeiteAxe);
                registerRender(painiteAxe);
                
                registerRender(platineSword);
                registerRender(pinkstarSword);
                registerRender(tafeiteSword);
                registerRender(painiteSword);
                
                registerRender(platineHoe);
                registerRender(pinkstarHoe);
                registerRender(tafeiteHoe);
                registerRender(painiteHoe);
                
                }
                
                public static void registerRender(Item item) {
                
                Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
                }
                public static enum BreakFightTools {
                
                  PLATINEPICKAXE("platinePickaxe", "ToolPlatinePickaxe"),
                  PINKSTARPICKAXE("pinkstarPickaxe", "ToolPinkstarPickaxe"),
                  TAFEITEPICKAXE("tafeitePickaxe", "ToolTafeitePickaxe"),
                  PAINITEPICKAXE("painitePickaxe", "ToolPainitePickaxe"),
                
                  PLATINESHOVEL("platineShovel", "ToolPlatineShovel"),
                  PINKSTARSHOVEL("pinkstarShovel", "ToolPinkstarShovel"),
                  TAFEITESHOVEL("tafeiteShovel", "ToolTafeiteShovel"),
                  PAINITESHOVEL("painiteShovel", "ToolPainiteShovel"),
                
                  PLATINEAXE("platineAxe", "ToolPlatineAxe"),
                  PINKSTARAXE("pinkstarAxe", "ToolPinkstarAxe"),
                  TAFEITEAXE("tafeiteAxe", "ToolTafeiteAxe"),
                  PAINITEAXE("painiteAxe", "ToolPainiteAxe"),
                
                  PLATINESWORD("platineSword", "ToolPlatineSword"),
                  PINKSTARSWORD("pinkstarSword", "ToolPinkstarSword"),
                  TAFEITESWORD("tafeiteSword", "ToolTafeiteSword"),
                  PAINITESWORD("painiteSword", "ToolPainiteSword"),
                
                  PLATINEHOE("platineHoe", "ToolPlatineHoe"),
                  PINKSTARHOE("pinkstarHoe", "ToolPinkstarHoe"),
                  TAFEITEHOE("tafeiteHoe", "ToolTafeiteHoe"),
                  PAINITEHOE("painiteHoe", "ToolPainiteHoe");
                
                  private String unlocalizedName;
                  private String registryName;
                
                  BreakFightTools(String unlocalizedName, String registryName) {
                  this.unlocalizedName = unlocalizedName;
                  this.registryName = registryName;
                  }
                
                  public String getUnlocalizedName() {
                  return unlocalizedName;
                  }
                
                  public String getRegistryName() {
                  return registryName;
                  }
                }
                }
                
                

                J’ai beaucoup d’outils, mais aucune des textures marchent alors je me concentrais seulement sur platinepickaxe ^^

                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

                  Ici :
                  Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(item.getRegistryName(), “inventory”));
                  Essaies plutôt :
                  ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(BreakfMain.MODID + item.getRegistryName().toLowerCase(), “inventory”));

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

                    J’ai trouvé mon problème mdr ! J’avais oublié d’enlever un commentaire ‘’//‘’ dans mes proxy, que j’avais mis pour un test et depuis je n’avais pas pensé de l’enlever x)

                    Merci tout de même de ton aide !

                    Sinon, est-ce que je pourrais savoir pourquoi il y a des erreurs dans ma console à propos de l’item qui est register 2 fois 0o ? Car je ne comprend pas trop ^^

                    Merci encore 🙂

                    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

                      Le plus probable serait que ta fonction register est appelé deux fois.

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

                        Mais je ne vois pas en quoi… En tenant compte de la classe que je t’ai donné un peu plus haut, y’aurais vraiment la fonction register 2 fois x) ?

                        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

                          Mets un point d’arrêt ou un print dedans, tu verra bien.

                          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