MFF

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

    Créer un achievement

    Planifier Épinglé Verrouillé Déplacé Autres
    1.6.x
    82 Messages 17 Publieurs 30.1k 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

      Dans la condition tu ajoute && stack.getItemDamage() == le metadata

      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

        Suite à vos demande, j’ai ajouté plus d’event (CraftingHandler et PlayerTracker de FML, et quelques event de Forge) et comment faire une page d’achievement.

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

          Possibilité de mettre un bloc custon pas moi sa me mets une erreur quand je mets BlockUranium :/___

          –-- Minecraft Crash Report ----
          // You should try our sister game, Minceraft!
          
          Time: 16/01/14 19:57
          Description: Initializing game
          
          java.lang.NullPointerException
          at net.minecraft.item.ItemStack.<init>(ItemStack.java:66)
          at net.minecraft.item.ItemStack.<init>(ItemStack.java:61)
          at net.minecraft.stats.Achievement.<init>(Achievement.java:57)
          at bdbladx.common.eryliablocks.PreInit(eryliablocks.java:45)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:540)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
          at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
          at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
          at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
          at com.google.common.eventbus.EventBus.post(EventBus.java:267)
          at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:194)
          at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:174)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
          at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
          at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
          at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
          at com.google.common.eventbus.EventBus.post(EventBus.java:267)
          at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:105)
          at cpw.mods.fml.common.Loader.loadMods(Loader.java:520)
          at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:181)
          at net.minecraft.client.Minecraft.startGame(Minecraft.java:471)
          at net.minecraft.client.Minecraft.run(Minecraft.java:806)
          at net.minecraft.client.main.Main.main(Main.java:93)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at net.minecraft.launchwrapper.Launch.launch(Launch.java:57)
          at net.minecraft.launchwrapper.Launch.main(Launch.java:18)
          
          A detailed walkthrough of the error, its code path and all known details is as follows:
          ---------------------------------------------------------------------------------------
          
          -- Head --
          Stacktrace:
          at net.minecraft.item.ItemStack.<init>(ItemStack.java:66)
          at net.minecraft.item.ItemStack.<init>(ItemStack.java:61)
          at net.minecraft.stats.Achievement.<init>(Achievement.java:57)
          at bdbladx.common.eryliablocks.PreInit(eryliablocks.java:45)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:540)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
          at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
          at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
          at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
          at com.google.common.eventbus.EventBus.post(EventBus.java:267)
          at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:194)
          at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:174)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
          at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
          at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
          at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
          at com.google.common.eventbus.EventBus.post(EventBus.java:267)
          at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:105)
          at cpw.mods.fml.common.Loader.loadMods(Loader.java:520)
          at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:181)
          at net.minecraft.client.Minecraft.startGame(Minecraft.java:471)
          
          -- Initialization --
          Details:
          Stacktrace:
          at net.minecraft.client.Minecraft.run(Minecraft.java:806)
          at net.minecraft.client.main.Main.main(Main.java:93)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at net.minecraft.launchwrapper.Launch.launch(Launch.java:57)
          at net.minecraft.launchwrapper.Launch.main(Launch.java:18)
          
          -- System Details --
          Details:
          Minecraft Version: 1.6.2
          Operating System: Windows 7 (amd64) version 6.1
          Java Version: 1.7.0_45, Oracle Corporation
          Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
          Memory: 946048528 bytes (902 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
          JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
          AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
          Suspicious classes: FML and Forge are installed
          IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
          FML: MCP v8.04 FML v6.2.62.871 Minecraft Forge 9.10.1.871 5 mods loaded, 5 mods active
          mcp{8.04} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized
          FML{6.2.62.871} [Forge Mod Loader] (bin) Unloaded->Constructed->Pre-initialized
          Forge{9.10.1.871} [Minecraft Forge] (bin) Unloaded->Constructed->Pre-initialized
          eryliablock{1.0.0} [Biralva by EryliaCoders] (bin) Unloaded->Constructed->Errored
          Erylia{1.0.0} [Erylia] (bin) Unloaded->Constructed->Pre-initialized
          Launched Version: 1.6
          LWJGL: 2.9.0
          OpenGL: AMD Radeon HD 7310 Graphics GL version 4.2.11399 Compatibility Profile Context, ATI Technologies Inc.
          Is Modded: Definitely; Client brand changed to 'fml,forge'
          Type: Client (map_client.txt)
          Resource Pack: Default
          Current Language: English (US)
          Profiler Position: N/A (disabled)
          Vec3 Pool Size: ~~ERROR~~ NullPointerException: null
          ```</init></init></init></init></init></init>

          Des mods à venir ! :0

          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

            Oui c’est possible. Envoie ton erreur.

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

              elle est juste au-dessus ^^’

              Des mods à venir ! :0

              1 réponse Dernière réponse Répondre Citer 0
              • Phenix246P Hors-ligne
                Phenix246 Rédacteurs
                dernière édition par

                Je dirais que tu as fait une faute sur la déclaration de ton ItemStack, vérifie le code et poste-le également ici qu’on puisse le voir.

                Le crash log c’est bien mais sans la classe de ton mod qui plante personne ne peux te donner une explication claire

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

                  package bdbladx.common;
                  
                  import net.minecraft.block.Block;
                  import net.minecraftforge.common.EnumHelper;
                  import net.minecraftforge.common.MinecraftForge;
                  import net.minecraft.item.EnumArmorMaterial;
                  import net.minecraft.item.EnumToolMaterial;
                  import net.minecraft.item.Item;
                  import net.minecraft.item.ItemStack;
                  import net.minecraft.item.crafting.FurnaceRecipes;
                  import net.minecraft.stats.Achievement;
                  import net.minecraft.stats.AchievementList;
                  import bdbladx.proxy.PlayerRenderEvent;
                  import bdbladx.proxy.eryliaCommonProxy;
                  import cpw.mods.fml.common.Mod;
                  import cpw.mods.fml.common.Mod.EventHandler;
                  import cpw.mods.fml.common.Mod.Instance;
                  import cpw.mods.fml.common.SidedProxy;
                  import cpw.mods.fml.common.event.FMLInitializationEvent;
                  import cpw.mods.fml.common.event.FMLPostInitializationEvent;
                  import cpw.mods.fml.common.event.FMLPreInitializationEvent;
                  import cpw.mods.fml.common.network.NetworkMod;
                  import cpw.mods.fml.common.registry.GameRegistry;
                  
                  @Mod(modid = "eryliablock", name = "Biralva by EryliaCoders", version = "1.0.0")
                  @NetworkMod(clientSideRequired = true, serverSideRequired = false)
                  
                  public class eryliablocks {
                  @SidedProxy(clientSide = "bdbladx.proxy.eryliaClientProxy", serverSide = "bdbladx.proxy.eryliaCommonProxy")
                  public static eryliaCommonProxy proxy;
                  
                  public static Block BlockTutorial;
                  public static Item ItemUranium;
                  public Achievement achievementUraniumBrut;
                  public static Block BlockUranium;
                  public static Item CasqueUranium, PlastronUranium, JambieresUranium, BottesUranium;
                  static EnumArmorMaterial ArmureUranium = EnumHelper.addArmorMaterial("Uranium", 20, new int[]{4, 16, 8, 4}, 15);
                  
                  @EventHandler
                  public void PreInit(FMLPreInitializationEvent event)
                  {
                  //Achievements
                  
                  achievementUraniumBrut = new Achievement(1200, "UraniumBrut", -2, 0, BlockUranium.blockID, AchievementList.openInventory).registerAchievement();
                  
                  //Blocks
                  BlockTutorial = new BlockTutorial(2000).setHardness(1.0F).setResistance(5.0F).setStepSound(Block.soundGlassFootstep)
                  .setUnlocalizedName("BlockTutorial").setLightValue(1.0F).setTextureName("eryliablock:BlockTutorial");
                  GameRegistry.registerBlock(BlockTutorial, "BlockTutorial");
                  
                  BlockUranium = new BlockUranium(3000).setHardness(3.0F).setResistance(15.0F).setStepSound(Block.soundStoneFootstep)
                  .setUnlocalizedName("BlockUranium").setTextureName("eryliablock:BlockUranium");
                  GameRegistry.registerBlock(BlockUranium, "Uranium");
                  //Items
                  
                  ItemUranium = new ItemUranium(1200).setUnlocalizedName("ItemUranium").setTextureName("eryliablock:Uranium2");
                  GameRegistry.registerItem(ItemUranium, "ItemUranium", "eryliablock");
                  
                  CasqueUranium = new CasqueUranium(4000, ArmureUranium, 0, 0).setUnlocalizedName("CasqueUranium").setTextureName("eryliablock:Casque_Uranium");
                  GameRegistry.registerItem(CasqueUranium, "Casqueuranium", "eryliablock");
                  PlastronUranium = new PlastronUranium(4001, ArmureUranium, 0, 1).setUnlocalizedName("PlastronUranium").setTextureName("eryliablock:Plastron_Uranium");
                  GameRegistry.registerItem(PlastronUranium, "PlastronUranium", "eryliablock");
                  
                  }
                  
                  @EventHandler
                  public void Init(FMLInitializationEvent event)
                  {
                  
                  //generation de mondes
                  
                  GameRegistry.registerWorldGenerator(new WorldGeneratorMineralis());
                  
                  //capes
                  
                  if(event.getSide().isClient())
                  {
                  MinecraftForge.EVENT_BUS.register(new PlayerRenderEvent());
                  }
                  //recettes four
                  
                  GameRegistry.addSmelting(BlockUranium.blockID, new ItemStack(ItemUranium.itemID, 2, 0), 0.2f);
                  
                  //reccettes
                  GameRegistry.addRecipe(new ItemStack(BlockTutorial), new Object[]{"XXX", "XYX", "XXX", 'X', Block.planks,
                  'Y', Block.glowStone});
                  proxy.registerRender();
                  }
                  
                  @EventHandler
                  public void PostInit(FMLPostInitializationEvent event)
                  {
                  
                  }
                  
                  }
                  
                  

                  voilà ma classe principale 😃

                  Cherchez pas trop voici le code ou l’erreur apparait :
                  achievementUraniumBrut = new Achievement(1200, “UraniumBrut”, -2, 0, BlockUranium.blockID, AchievementList.openInventory).registerAchievement();___
                  Sachant que pour les recettes avec se font avec notrebloc.blockID je crois que à ce point je suis juste mais reste à voir si je ne dois pas faire eryliablocks.BlockUranium ( testé mais crash quand meme ) ^^’

                  Des mods à venir ! :0

                  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

                    @‘jglrxavpok’:

                    Votre méthode preInit devrait ressembler à ça :

                    @EventHandler
                    public void PreInit(FMLPreInitializationEvent event)
                    {
                    // Configuration
                    […]
                    // Blocks
                    […]
                    // Enregistrement des blocs
                    […]
                    // Items
                    […]
                    // Enregistrement des items
                    […]
                    // Achievements
                    achievementTuto = new Achievement(2100, "achievementTuto", -2, 0, Block.dirt, AchievementList.openInventory).registerAchievement();
                    achievementTuto2 = new Achievement(2101, "achievementTuto2", -1, 0, this.BlockTutorial, null).registerAchievement();
                    maPage = new AchievementPage("Nom de la page", achievementTuto, achievementTuto2);
                    AchievementPage.registerAchievementPage(maPage);
                    }
                    

                    Les blocs est items doivent être initialisés avant les achievements (sinon NPE (= NullPointerException)), et la page après les achievements (pareil, si vous ne le faite pas dans cette ordre, craft avec NPE). Petit rappel, si en icône vous voulez mettre un bloc ou item de votre mod, il faudra utiliser this.nomDuBloc/Item et non Item. ou Block.

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

                      Salut je voudrais que en minant le bloc pour la 1ere fois que le joueur gagne 30 nv mais juste la premiere fois mais je ne sais pas comment faire 😕

                      event.entityPlayer.addExperienceLevel(30);
                      

                      Des mods à venir ! :0

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

                        Tu fais un Extended Entity Property, une boolean, qui fait que quand l’event “miner” se déclenche, la boolean est set a true, et ne peut plus être changé par des commandes. Ainsi, une fois miné, le joueur ne recevras plus jamais les niveau bonus, sauf si le fichier player est effacé. Tu peut faire une commande de reset, et les Extended Entity Property sont complètement compatibles en multijoueur, et donc très pratiques 😉

                        "If you have a comprehensive explanation for everything then it decreases uncertainty and anxiety and reduces your cognitive load. And if you can use that simplifying algorithm to put yourself on the side of moral virtue then you’re constantly a good person with a minimum of effort."
                        ― Jordan B. Peterson

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

                          Merci je test ça et je te dis quelque chose et aufait merci robin pour la reponse à mon probleme j’avais oublié 😃
                          Hum juste une question je dois mettre ```java
                          boolean (je sais pas quoi mettre ici) = true

                          Des mods à venir ! :0

                          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

                            Ou alors tu check juste si le joueur a déjà l’achievement ou pas, tout simplement.

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

                              oui robin ca me parait un peut plus simple xD mais comment faire ? :0 ( sachez que je retiens toutes les suggestions et je les teste toutes =D comme ça j’apprends plus 😉 )

                              Des mods à venir ! :0

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

                                Ah, mais c’est vrai que tu passe par un achievement ( J’suis con )

                                Dans ce cas, c’est surement .hasAchievement ou .getAchievement il me semble

                                "If you have a comprehensive explanation for everything then it decreases uncertainty and anxiety and reduces your cognitive load. And if you can use that simplifying algorithm to put yourself on the side of moral virtue then you’re constantly a good person with a minimum of effort."
                                ― Jordan B. Peterson

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

                                  je dois mettre ou ce code ?

                                  Des mods à venir ! :0

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

                                    if(!player.hasAchieved / je sais plus la méthode )){

                                    code pour give les niveau

                                    }

                                    "If you have a comprehensive explanation for everything then it decreases uncertainty and anxiety and reduces your cognitive load. And if you can use that simplifying algorithm to put yourself on the side of moral virtue then you’re constantly a good person with a minimum of effort."
                                    ― Jordan B. Peterson

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

                                      celui que j’avais mis au dessus ? 😃 ```java
                                      event.entityPlayer.addExperienceLevel(30);

                                      Des mods à venir ! :0

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

                                        Yes

                                        "If you have a comprehensive explanation for everything then it decreases uncertainty and anxiety and reduces your cognitive load. And if you can use that simplifying algorithm to put yourself on the side of moral virtue then you’re constantly a good person with a minimum of effort."
                                        ― Jordan B. Peterson

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

                                          mas la methode je ne la trouve pas 😕

                                          Des mods à venir ! :0

                                          1 réponse Dernière réponse Répondre Citer 0
                                          • Superloup10S Hors-ligne
                                            Superloup10 Modérateurs
                                            dernière édition par

                                            La méthode, c’est celle qui débloque ton achievement.

                                            Si vous souhaitez me faire un don, il vous suffit de cliquer sur le bouton situé en dessous.

                                            Je suis un membre apprécié et joueur, j'ai déjà obtenu 17 points de réputation.

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

                                            MINECRAFT FORGE FRANCE © 2024

                                            Powered by NodeBB