• S'inscrire
    • Se connecter
    • Recherche
    • Récent
    • Mots-clés
    • Populaire
    • Utilisateurs
    • Groupes

    Résolu Système de nom et prénom à la place du pseudo

    1.8.x
    1.8
    8
    155
    22811
    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.
    • Gabs
      Gabs dernière édition par

      Bonjour,

      Je fais un système de nom et donc je stocke tout cela sur un des ftp le problème c’est que lors du load de ce fichier yml j’ai un crash le voilà:

      
      Caused by: java.io.FileNotFoundException: http:\cite-sous-controle.fr\ModCSC\SavePlayerName\playername.yml (La syntaxe du nom de fichier, de répertoire ou de volume est incorrecte)
      at java.io.FileInputStream.open0(Native Method)
      at java.io.FileInputStream.open(FileInputStream.java:195)
      at java.io.FileInputStream.<init>(FileInputStream.java:138)
      at java.io.FileReader.<init>(FileReader.java:72)
      at com.CSC.net.save.SaveName.load(SaveName.java:45)
      at com.CSC.net.Main.preinit(Main.java:101)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:518)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
      at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
      at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
      at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
      at com.google.common.eventbus.EventBus.post(EventBus.java:275)
      at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:208)
      at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:187)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
      at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
      at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
      at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
      at com.google.common.eventbus.EventBus.post(EventBus.java:275)
      at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118)
      at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:514)
      … 12 more
      
      

      Merci d’avance :)</init></init>

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

        C’est si compliqué de lire un rapport de crash ? En plus c’est même écrit en français …

        1 réponse Dernière réponse Répondre Citer 1
        • Gabs
          Gabs dernière édition par

          @‘robin4002’:

          C’est si compliqué de lire un rapport de crash ? En plus c’est même écrit en français …

          Je vois pas du tout ou est le soucis en fait…

          (La syntaxe du nom de fichier, de répertoire ou de volume est incorrecte)

          C’est pas le nom je penses pas le répertoire veut dire quoi ? l’emplacement ? le volume je penses pas il est vide

          1 réponse Dernière réponse Répondre Citer 0
          • AymericRed
            AymericRed dernière édition par

            Montres ton code. Et un FileReader ne peut pas lire un fichier qui est sur Internet.

            Si je vous ai aidé, n'oubliez pas d’être heureux, j'aiderai encore +

            AymericRed, moddeur expérimenté qui aide sur ce forum et qui peut accepter de faire un mod Forge rémunéré de temps en temps.

            Mes tutos : Table de craft, plugin NEI, plugin JEI, modifier l'overlay
            Je suis un membre apprécié et joueur, j'ai déjà obtenu 6 points de réputation.

            1 réponse Dernière réponse Répondre Citer 0
            • Gabs
              Gabs dernière édition par robin4002

              @‘AymericRed’:

              Montres ton code. Et un FileReader ne peut pas lire un fichier qui est sur Internet.

              Ah bah le soucis vient de là x)

              
              package com.CSC.net.save;
              
              import java.io.File;
              import java.io.FileReader;
              import java.io.FileWriter;
              import java.io.IOException;
              import java.util.HashMap;
              import java.util.Map;
              
              import com.google.gson.Gson;
              import com.google.gson.GsonBuilder;
              import com.google.gson.JsonParseException;
              
              public class SaveName {
              
                  private final Map<String, String> map = new HashMap<String, String>();
              
                  private SaveName() {
                  }
              
                  public void add(String string, String string2) {
                      map.put(string, string2);
                  }
              
                  public void remove(String string) {
                      map.remove(string);
                  }
              
                  public Map <String, String> map()
                  {
                      return map;
                  }
              
                  public void save(File file) throws IOException {
                      final GsonBuilder builder = new GsonBuilder();
                      final Gson gson = builder.create();
                      final FileWriter writer = new FileWriter(file);
                      gson.toJson(this, writer);
                      writer.close();
                  }
              
                  public static SaveName load(File file) throws IOException {
                      final GsonBuilder builder = new GsonBuilder();
                      final Gson gson = builder.create();
                      final FileReader reader = new FileReader(file);
                      SaveName loaded = null;
                      try {
                          loaded = gson.fromJson(reader, SaveName.class);
                      } catch (JsonParseException e) {
                      }
              
                      if (loaded == null) {
                          loaded = new SaveName();
                      }
              
                      reader.close();
                      return loaded;
                  }
              }
              

              Comment faire ?

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

                Google -> lire un fichier sur le web ?
                Ça c’est facilement faisable.

                Par contre pour l’écrire ça va être bien plus compliqué.
                Pourquoi tu cherches à sauvegarder quelque chose en ligne ? Quel est le but ?

                1 réponse Dernière réponse Répondre Citer 0
                • Gabs
                  Gabs dernière édition par

                  @‘robin4002’:

                  Google -> lire un fichier sur le web ?
                  Ça c’est facilement faisable.

                  Par contre pour l’écrire ça va être bien plus compliqué.
                  Pourquoi tu cherches à sauvegarder quelque chose en ligne ? Quel est le but ?

                  bah c’est pour le système de nom prénom que j’ai mis en place.

                  Le problème c’est que si je save ça dans le fichier config de mc tout les joueur aurons pas le même fichier si ? fin se que je veux dire il serra pas relié donc les joueurs pourrons s’appeler pareil etc… non?

                  1 réponse Dernière réponse Répondre Citer 0
                  • jglrxavpok
                    jglrxavpok Modérateurs dernière édition par

                    Il y a deux possibilités:

                    • Soit chaque nom peut être attribué à un seul joueur sur un seul serveur (ie les noms peuvent être sauvegardés sur chaque serveur MC):
                      Dans ce cas là, sauvegarde tout simplement les noms côté serveur dans un fichier, c’est relativement simple.
                    • Soit un joueur a un et un seul nom unique sur tous les serveurs.
                      Dans ce cas-ci, ça va vite devenir compliqué; la meilleure façon de faire qui me vient à l’esprit est de faire un site avec une base de données et communiquer avec ce site via des requêtes (par HTTP et GET/POST, par exemple).

                    Modérateur sur MFF. 
                    Mon Github: http://github.com/jglrxavpok
                    Mon compte Steam si vous voulez jouer à CS:GO ou TF2 avec moi: https://steamcommunity.com/id/jglrxavpok/

                    1 réponse Dernière réponse Répondre Citer 0
                    • AymericRed
                      AymericRed dernière édition par

                      Oui ils pourront tous avoir le même nom ^^ Comme l’a dit robin lire c’est simple, écrire, ya peut être une librairie mais en tout cas c’est plus compliqué, sinon tu obligé les joueurs à passer par un site internet pour créer le nom.

                      EDIT: comme l’a dit l’homme au nom compliqué, si c’est un nom pour un serveur, tu peux simplement le save sur ce serveur et utiliser des packets.

                      Si je vous ai aidé, n'oubliez pas d’être heureux, j'aiderai encore +

                      AymericRed, moddeur expérimenté qui aide sur ce forum et qui peut accepter de faire un mod Forge rémunéré de temps en temps.

                      Mes tutos : Table de craft, plugin NEI, plugin JEI, modifier l'overlay
                      Je suis un membre apprécié et joueur, j'ai déjà obtenu 6 points de réputation.

                      1 réponse Dernière réponse Répondre Citer 0
                      • Gabs
                        Gabs dernière édition par

                        Ok ouais donc je suis pas chaud pour faire ça…

                        @jglrxavpok Bah en fait le joueur peut changer de nom quand il le souhaite avec un simple déco reco et c’est donner a tout les joueurs …

                        Donc c’est dans quel cas ? 1 ou 2 ?

                        1 réponse Dernière réponse Répondre Citer 0
                        • jglrxavpok
                          jglrxavpok Modérateurs dernière édition par

                          @‘floriangabet’:

                          Ok ouais donc je suis pas chaud pour faire ça…

                          @jglrxavpok Bah en fait le joueur peut changer de nom quand il le souhaite avec un simple déco reco et c’est donner a tout les joueurs …

                          Donc c’est dans quel cas ? 1 ou 2 ?

                          Je dois bien avouer que j’ai pas vraiment compris ce que tu veux dire exactement.
                          De ce que j’ai compris, les noms sont attribués à la connexion du serveur et changent dès qu’on se reconnecte? Si oui, alors pourquoi se donner la peine de les sauvegarder? Autant tout garder en mémoire.

                          Modérateur sur MFF. 
                          Mon Github: http://github.com/jglrxavpok
                          Mon compte Steam si vous voulez jouer à CS:GO ou TF2 avec moi: https://steamcommunity.com/id/jglrxavpok/

                          1 réponse Dernière réponse Répondre Citer 0
                          • Gabs
                            Gabs dernière édition par

                            @‘jglrxavpok’:

                            @‘floriangabet’:

                            Ok ouais donc je suis pas chaud pour faire ça…

                            @jglrxavpok Bah en fait le joueur peut changer de nom quand il le souhaite avec un simple déco reco et c’est donner a tout les joueurs …

                            Donc c’est dans quel cas ? 1 ou 2 ?

                            Je dois bien avouer que j’ai pas vraiment compris ce que tu veux dire exactement.
                            De ce que j’ai compris, les noms sont attribués à la connexion du serveur et changent dès qu’on se reconnecte? Si oui, alors pourquoi se donner la peine de les sauvegarder? Autant tout garder en mémoire.

                            Oui c’est en gros ça ouvre un gui au menu principal nom , prénom on valide et une fois que on valide on se connecte au serveur avec le nom et prénom.
                            C’est a dire garder en mémoire ?

                            1 réponse Dernière réponse Répondre Citer 0
                            • jglrxavpok
                              jglrxavpok Modérateurs dernière édition par

                              Je vois, effectivement, sauvegarder ne servirait à rien.

                              Contentes-toi d’envoyer un packet au serveur pour lui dire le nom du joueur et ça suffit.

                              Quand je dis garder en mémoire, c’est juste faire quelque chose comme une ‘Map’ qui aurait pour entrée/clé le joueur et en sortie le nom (et une qui ferais l’inverse si nécessaire).

                              Modérateur sur MFF. 
                              Mon Github: http://github.com/jglrxavpok
                              Mon compte Steam si vous voulez jouer à CS:GO ou TF2 avec moi: https://steamcommunity.com/id/jglrxavpok/

                              1 réponse Dernière réponse Répondre Citer 0
                              • Gabs
                                Gabs dernière édition par

                                @‘jglrxavpok’:

                                Je vois, effectivement, sauvegarder ne servirait à rien.

                                Contentes-toi d’envoyer un packet au serveur pour lui dire le nom du joueur et ça suffit.

                                Quand je dis garder en mémoire, c’est juste faire quelque chose comme une ‘Map’ qui aurait pour entrée/clé le joueur et en sortie le nom (et une qui ferais l’inverse si nécessaire).

                                envoyer packet au serveur ? avec quoi dedans ?

                                1 réponse Dernière réponse Répondre Citer 0
                                • jglrxavpok
                                  jglrxavpok Modérateurs dernière édition par

                                  Le nom du joueur pour que le serveur puisse associer un joueur à un nom.

                                  Modérateur sur MFF. 
                                  Mon Github: http://github.com/jglrxavpok
                                  Mon compte Steam si vous voulez jouer à CS:GO ou TF2 avec moi: https://steamcommunity.com/id/jglrxavpok/

                                  1 réponse Dernière réponse Répondre Citer 0
                                  • Gabs
                                    Gabs dernière édition par robin4002

                                    @‘jglrxavpok’:

                                    Le nom du joueur pour que le serveur puisse associer un joueur à un nom.

                                    Je vois mais je l’envoie ou ?

                                    J’ai fais une map mais j’ai un crash:

                                    
                                    [11:53:09] [main/INFO] [GradleStart]: username: floriangabet
                                    [11:53:09] [main/INFO] [GradleStart]: Extra: []
                                    [11:53:09] [main/INFO] [GradleStart]: Running with arguments: [–userProperties, {}, --assetsDir, C:/Users/Admin/.gradle/caches/minecraft/assets, --assetIndex, 1.8, --accessToken, {REDACTED}, --version, 1.8, --username, floriangabet, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
                                    [11:53:09] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
                                    [11:53:09] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
                                    [11:53:09] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
                                    [11:53:09] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker
                                    [11:53:09] [main/INFO] [FML]: Forge Mod Loader version 8.0.37.1334 for Minecraft 1.8 loading
                                    [11:53:09] [main/INFO] [FML]: Java is Java HotSpot(TM) Client VM, version 1.8.0_45, running on Windows 7:x86:6.1, installed at C:\Program Files (x86)\Java\jdk1.8.0_45\jre
                                    [11:53:09] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
                                    [11:53:09] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker
                                    [11:53:09] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin
                                    [11:53:09] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
                                    [11:53:09] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
                                    [11:53:09] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
                                    [11:53:09] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
                                    [11:53:09] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
                                    [11:53:09] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
                                    [11:53:09] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
                                    [11:53:09] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!
                                    [11:53:10] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
                                    [11:53:10] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
                                    [11:53:10] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
                                    [11:53:10] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
                                    [11:53:10] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker
                                    [11:53:10] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker
                                    [11:53:10] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
                                    [11:53:10] [Client thread/INFO]: Setting user: floriangabet
                                    [11:53:12] [Client thread/INFO]: LWJGL Version: 2.9.1
                                    [11:53:13] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization
                                    [11:53:13] [Client thread/INFO] [FML]: MinecraftForge v11.14.1.1334 Initialized
                                    [11:53:13] [Client thread/INFO] [FML]: Replaced 204 ore recipies
                                    [11:53:13] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization
                                    [11:53:13] [Client thread/INFO] [FML]: Searching C:\Users\Admin\Desktop\CSC\eclipse\mods for mods
                                    [11:53:14] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load
                                    [11:53:14] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, csc] at CLIENT
                                    [11:53:14] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, csc] at SERVER
                                    [11:53:15] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Cite Sous Controle
                                    [11:53:15] [Client thread/INFO] [FML]: Processing ObjectHolder annotations
                                    [11:53:15] [Client thread/INFO] [FML]: Found 384 ObjectHolder annotations
                                    [11:53:15] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0
                                    [11:53:15] [Client thread/INFO] [STDOUT]: [com.CSC.net.block.CSCBlocks:registerItemsBlocksModels:50]: registerItemsBlocksModels
                                    [11:53:15] [Client thread/INFO] [FML]: Applying holder lookups
                                    [11:53:15] [Client thread/INFO] [FML]: Holder lookups applied
                                    [11:53:15] [Sound Library Loader/INFO]: Starting up SoundSystem…
                                    [11:53:15] [Thread-7/INFO]: Initializing LWJGL OpenAL
                                    [11:53:15] [Thread-7/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
                                    [11:53:16] [Thread-7/INFO]: OpenAL initialized.
                                    [11:53:16] [Sound Library Loader/INFO]: Sound engine started
                                    [11:53:31] [Client thread/INFO]: Created: 4096x2048 textures-atlas
                                    [11:53:31] [Client thread/ERROR] [FML]: Model definition for location csc:item_batonP#inventory not found
                                    [11:53:31] [Client thread/ERROR] [FML]: Model definition for location csc:item_panierlinge#inventory not found
                                    [11:53:31] [Client thread/ERROR] [FML]: Model definition for location csc:item_lesive#inventory not found
                                    [11:53:31] [Client thread/ERROR] [FML]: Model definition for location csc:item_coli#inventory not found
                                    [11:53:31] [Client thread/ERROR] [FML]: Model definition for location csc:item_balai#inventory not found
                                    [11:53:31] [Client thread/ERROR] [FML]: Model definition for location csc:item_propre_sec#inventory not found
                                    [11:53:31] [Client thread/ERROR] [FML]: Model definition for location csc:item_linge_propre_mouiller#inventory not found
                                    [11:53:31] [Client thread/ERROR] [FML]: Model definition for location csc:item_medic#inventory not found
                                    [11:53:31] [Client thread/ERROR] [FML]: Model definition for location csc:item_infoplayer#inventory not found
                                    [11:53:31] [Client thread/ERROR] [FML]: Model definition for location csc:item_linge_sale#inventory not found
                                    [11:53:31] [Client thread/ERROR] [FML]: Model definition for location csc:item_belier#inventory not found
                                    [11:53:31] [Client thread/ERROR] [FML]: Model definition for location csc:item_clefm#inventory not found
                                    [11:53:31] [Client thread/ERROR] [FML]: Model definition for location csc:item_lingette#inventory not found
                                    [11:53:32] [Client thread/INFO] [STDOUT]: [com.CSC.net.Main:init:115]: 
                                    [11:53:32] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods
                                    [11:53:32] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Cite Sous Controle
                                    [11:53:32] [Client thread/INFO]: SoundSystem shutting down…
                                    [11:53:32] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com
                                    [11:53:32] [Sound Library Loader/INFO]: Starting up SoundSystem…
                                    [11:53:32] [Thread-9/INFO]: Initializing LWJGL OpenAL
                                    [11:53:32] [Thread-9/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
                                    [11:53:32] [Thread-9/INFO]: OpenAL initialized.
                                    [11:53:33] [Sound Library Loader/INFO]: Sound engine started
                                    [11:53:33] [Client thread/INFO]: Created: 4096x2048 textures-atlas
                                    [11:53:34] [Client thread/ERROR] [FML]: Model definition for location csc:item_batonP#inventory not found
                                    [11:53:34] [Client thread/ERROR] [FML]: Model definition for location csc:item_panierlinge#inventory not found
                                    [11:53:34] [Client thread/ERROR] [FML]: Model definition for location csc:item_lesive#inventory not found
                                    [11:53:34] [Client thread/ERROR] [FML]: Model definition for location csc:item_coli#inventory not found
                                    [11:53:34] [Client thread/ERROR] [FML]: Model definition for location csc:item_balai#inventory not found
                                    [11:53:34] [Client thread/ERROR] [FML]: Model definition for location csc:item_propre_sec#inventory not found
                                    [11:53:34] [Client thread/ERROR] [FML]: Model definition for location csc:item_linge_propre_mouiller#inventory not found
                                    [11:53:34] [Client thread/ERROR] [FML]: Model definition for location csc:item_medic#inventory not found
                                    [11:53:34] [Client thread/ERROR] [FML]: Model definition for location csc:item_infoplayer#inventory not found
                                    [11:53:34] [Client thread/ERROR] [FML]: Model definition for location csc:item_linge_sale#inventory not found
                                    [11:53:34] [Client thread/ERROR] [FML]: Model definition for location csc:item_belier#inventory not found
                                    [11:53:34] [Client thread/ERROR] [FML]: Model definition for location csc:item_clefm#inventory not found
                                    [11:53:34] [Client thread/ERROR] [FML]: Model definition for location csc:item_lingette#inventory not found
                                    [11:53:34] [Client thread/INFO] [STDOUT]: [com.CSC.net.proxy.ClientProxy:onGuiOpen:175]: net.minecraft.client.gui.GuiMainMenu@18f9bb5
                                    [11:53:37] [Client thread/INFO] [STDOUT]: [com.CSC.net.proxy.ClientProxy:onGuiOpen:175]: net.minecraft.client.gui.GuiSelectWorld@8ec235
                                    [11:53:37] [Client thread/INFO] [STDOUT]: [com.CSC.net.proxy.ClientProxy:onGuiOpen:175]: com.CSC.net.GUI.PrenomGui@145ef9
                                    true
                                    [11:53:39] [Client thread/FATAL]: Reported exception thrown!
                                    net.minecraft.util.ReportedException: Updating screen events
                                    at net.minecraft.client.Minecraft.runTick(Minecraft.java:1766) ~[Minecraft.class:?]
                                    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1080) ~[Minecraft.class:?]
                                    at net.minecraft.client.Minecraft.run(Minecraft.java:376) [Minecraft.class:?]
                                    at net.minecraft.client.main.Main.main(Main.java:117) [Main.class:?]
                                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45]
                                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_45]
                                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_45]
                                    at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_45]
                                    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?]
                                    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?]
                                    at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?]
                                    at GradleStart.main(Unknown Source) [start/:?]
                                    Caused by: java.lang.NullPointerException
                                    at com.CSC.net.GUI.PrenomGui.actionPerformed(PrenomGui.java:100) ~[PrenomGui.class:?]
                                    at net.minecraft.client.gui.GuiScreen.mouseClicked(GuiScreen.java:510) ~[GuiScreen.class:?]
                                    at com.CSC.net.GUI.PrenomGui.mouseClicked(PrenomGui.java:77) ~[PrenomGui.class:?]
                                    at net.minecraft.client.gui.GuiScreen.handleMouseInput(GuiScreen.java:602) ~[GuiScreen.class:?]
                                    at net.minecraft.client.gui.GuiScreen.handleInput(GuiScreen.java:571) ~[GuiScreen.class:?]
                                    at net.minecraft.client.Minecraft.runTick(Minecraft.java:1752) ~[Minecraft.class:?]
                                    … 11 more
                                    [11:53:39] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:660]: –-- Minecraft Crash Report ----
                                    // Shall we play a game?
                                    
                                    Time: 21/10/16 11:53
                                    Description: Updating screen events
                                    
                                    java.lang.NullPointerException: Updating screen events
                                    at com.CSC.net.GUI.PrenomGui.actionPerformed(PrenomGui.java:100)
                                    at net.minecraft.client.gui.GuiScreen.mouseClicked(GuiScreen.java:510)
                                    at com.CSC.net.GUI.PrenomGui.mouseClicked(PrenomGui.java:77)
                                    at net.minecraft.client.gui.GuiScreen.handleMouseInput(GuiScreen.java:602)
                                    at net.minecraft.client.gui.GuiScreen.handleInput(GuiScreen.java:571)
                                    at net.minecraft.client.Minecraft.runTick(Minecraft.java:1752)
                                    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1080)
                                    at net.minecraft.client.Minecraft.run(Minecraft.java:376)
                                    at net.minecraft.client.main.Main.main(Main.java:117)
                                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                                    at java.lang.reflect.Method.invoke(Method.java:497)
                                    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
                                    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
                                    at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
                                    at GradleStart.main(Unknown Source)
                                    
                                    A detailed walkthrough of the error, its code path and all known details is as follows:
                                    ---------------------------------------------------------------------------------------
                                    
                                    -- Head --
                                    Stacktrace:
                                    at com.CSC.net.GUI.PrenomGui.actionPerformed(PrenomGui.java:100)
                                    at net.minecraft.client.gui.GuiScreen.mouseClicked(GuiScreen.java:510)
                                    at com.CSC.net.GUI.PrenomGui.mouseClicked(PrenomGui.java:77)
                                    at net.minecraft.client.gui.GuiScreen.handleMouseInput(GuiScreen.java:602)
                                    at net.minecraft.client.gui.GuiScreen.handleInput(GuiScreen.java:571)
                                    
                                    -- Affected screen --
                                    Details:
                                    Screen name: com.CSC.net.GUI.PrenomGui
                                    Stacktrace:
                                    at net.minecraft.client.Minecraft.runTick(Minecraft.java:1752)
                                    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1080)
                                    at net.minecraft.client.Minecraft.run(Minecraft.java:376)
                                    at net.minecraft.client.main.Main.main(Main.java:117)
                                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                                    at java.lang.reflect.Method.invoke(Method.java:497)
                                    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
                                    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
                                    at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
                                    at GradleStart.main(Unknown Source)
                                    
                                    -- System Details --
                                    Details:
                                    Minecraft Version: 1.8
                                    Operating System: Windows 7 (x86) version 6.1
                                    Java Version: 1.8.0_45, Oracle Corporation
                                    Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
                                    Memory: 850573872 bytes (811 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)
                                    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
                                    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
                                    FML: MCP v9.10 FML v8.0.37.1334 Minecraft Forge 11.14.1.1334 4 mods loaded, 4 mods active
                                    mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
                                    FML{8.0.37.1334} [Forge Mod Loader] (forgeSrc-1.8-11.14.1.1334.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
                                    Forge{11.14.1.1334} [Minecraft Forge] (forgeSrc-1.8-11.14.1.1334.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
                                    csc{1.0} [Cite Sous Controle] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available
                                    Loaded coremods (and transformers): 
                                    Launched Version: 1.8
                                    LWJGL: 2.9.1
                                    OpenGL: GeForce GTX 960/PCIe/SSE2 GL version 4.5.0 NVIDIA 368.39, NVIDIA Corporation
                                    GL Caps: Using GL 1.3 multitexturing.
                                    Using GL 1.3 texture combiners.
                                    Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
                                    Shaders are available because OpenGL 2.1 is supported.
                                    VBOs are available because OpenGL 1.5 is supported.
                                    
                                    Using VBOs: No
                                    Is Modded: Definitely; Client brand changed to 'fml,forge'
                                    Type: Client (map_client.txt)
                                    Resource Packs: []
                                    Current Language: Français (France)
                                    Profiler Position: N/A (disabled)
                                    [11:53:39] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:660]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\Admin\Desktop\CSC\eclipse\.\crash-reports\crash-2016-10-21_11.53.39-client.txt
                                    AL lib: (EE) alc_cleanup: 1 device not closed
                                    Java HotSpot(TM) Client VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
                                    
                                    

                                    Classe:

                                    
                                    package com.CSC.net.GUI;
                                    
                                    import java.io.File;
                                    import java.io.IOException;
                                    import java.util.Date;
                                    import java.util.HashMap;
                                    import java.util.UUID;
                                    
                                    import org.lwjgl.input.Keyboard;
                                    
                                    import net.minecraft.client.Minecraft;
                                    import net.minecraft.client.gui.GuiButton;
                                    import net.minecraft.client.gui.GuiScreen;
                                    import net.minecraft.client.gui.GuiSelectWorld;
                                    import net.minecraft.client.gui.GuiTextField;
                                    import net.minecraft.util.EnumChatFormatting;
                                    import net.minecraft.util.ResourceLocation;
                                    
                                    import com.CSC.net.Main;
                                    
                                    public class PrenomGui extends GuiScreen {
                                    
                                        private static boolean erreur;
                                    
                                        public static HashMap<UUID, String> map = new HashMap<UUID, String>();
                                    
                                        public static boolean b;
                                    
                                        private int valider;
                                    
                                        private int nom;
                                    
                                        private int prenom;
                                    
                                        public static GuiTextField text;
                                    
                                        public static GuiTextField text2;
                                    
                                        public PrenomGui() {
                                    
                                        }
                                    
                                        @Override
                                        public void initGui() {
                                    
                                            valider = 0;
                                    
                                            nom = 1;
                                    
                                            prenom = 2;
                                    
                                            text = new GuiTextField(nom, fontRendererObj, width / 2, 130, 64, 20);
                                    
                                            text2 = new GuiTextField(prenom, fontRendererObj, width / 2, 100, 64, 20);
                                    
                                            text.setFocused(false);
                                    
                                            text2.setFocused(true);
                                    
                                            text.setMaxStringLength(20);
                                    
                                            text2.setMaxStringLength(20);
                                    
                                            this.buttonList.add(new GuiButton(valider, width / 2 - 123, 200, 40, 20, "Valider"));
                                    
                                            super.initGui();
                                        }
                                    
                                        @Override
                                        public void mouseClicked(int i, int j, int k) {
                                            text.mouseClicked(i, j, k);
                                            text2.mouseClicked(i, j, k);
                                            try {
                                                super.mouseClicked(i, j, k);
                                            } catch (IOException e) {
                                                // TODO Auto-generated catch block
                                                e.printStackTrace();
                                            }
                                        }
                                    
                                        @Override
                                        protected void keyTyped(char typedChar, int keyCode) throws IOException {
                                    
                                            text.textboxKeyTyped(typedChar, keyCode);
                                            text2.textboxKeyTyped(typedChar, keyCode);
                                            super.keyTyped(typedChar, keyCode);
                                        }
                                    
                                        @Override
                                        protected void actionPerformed(GuiButton button) throws IOException {
                                    
                                            switch (button.id) {
                                            case 0:
                                                if (!text.getText().equals("") && text.getText().length() > 3 && !text2.getText().equals("")
                                                        && text2.getText().length() > 3) {
                                                    if (!map.containsKey(Minecraft.getMinecraft().thePlayer.getUniqueID()))// crash surement car mc est
                                                                                                                           // client et il faut du serveur
                                                                                                                           // /*\ Ligne 100
                                                    {
                                                        System.out.println(b);
                                                        b = false;
                                                        map.put(Minecraft.getMinecraft().thePlayer.getUniqueID(), text2.getText() + "_" + text.getText());
                                                        System.out.println(map.get(Minecraft.getMinecraft().thePlayer.getUniqueID()));
                                                        erreur = false;
                                                        mc.displayGuiScreen(new GuiSelectWorld(this));
                                                    } else {
                                                        map.remove(Minecraft.getMinecraft().thePlayer.getUniqueID());
                                                        System.out.println(b);
                                                        b = false;
                                                        map.put(Minecraft.getMinecraft().thePlayer.getUniqueID(), text2.getText() + "_" + text.getText());
                                                        System.out.println(map.get(Minecraft.getMinecraft().thePlayer.getUniqueID()));
                                                        erreur = false;
                                                        mc.displayGuiScreen(new GuiSelectWorld(this));
                                                    }
                                                } else if (text.getText().equals("72") && !text2.getText().equals("") && text2.getText().length() > 3) {
                                                    if (!map.containsKey(Minecraft.getMinecraft().thePlayer.getUniqueID())) {
                                                        System.out.println(b);
                                                        b = false;
                                                        map.put(Minecraft.getMinecraft().thePlayer.getUniqueID(), text2.getText());
                                                        erreur = false;
                                                        mc.displayGuiScreen(new GuiSelectWorld(this));
                                                    } else {
                                                        map.remove(Minecraft.getMinecraft().thePlayer.getUniqueID());
                                                        System.out.println(b);
                                                        b = false;
                                                        map.put(Minecraft.getMinecraft().thePlayer.getUniqueID(), text2.getText());
                                                        erreur = false;
                                                        mc.displayGuiScreen(new GuiSelectWorld(this));
                                                    }
                                                } else {
                                                    erreur = true;
                                                }
                                                break;
                                            default:
                                                erreur = false;
                                                break;
                                            }
                                    
                                            super.actionPerformed(button);
                                        }
                                    
                                        @Override
                                        public void updateScreen() {
                                            super.updateScreen();
                                        }
                                    
                                        public void drawScreen(int mouseX, int mouseY, float partialTick) {
                                    
                                            this.drawDefaultBackground();
                                    
                                            text.drawTextBox();
                                            text2.drawTextBox();
                                    
                                            this.drawString(this.fontRendererObj, EnumChatFormatting.GRAY + "Nom", width / 2 - 80, 135, 0);
                                    
                                            this.drawString(this.fontRendererObj, EnumChatFormatting.GRAY + "Prénom", width / 2 - 80, 105, 0);
                                    
                                            super.drawScreen(mouseX, mouseY, partialTick);
                                    
                                            if (erreur) {
                                                this.drawString(fontRendererObj, "§cVotre nom et/ou prénom est/sont vide ou trop court !",
                                                        this.width / 2 - 110, this.height / 2 - 50, 0);
                                            }
                                        }
                                    
                                        @Override
                                        public void onGuiClosed() {
                                    
                                        }
                                    }
                                    

                                    event:

                                    @SubscribeEvent
                                    public void test(PlayerEvent.NameFormat e)
                                    {
                                        if(PrenomGui.b)
                                        {
                                            e.displayname = PrenomGui.map.get(e.entityPlayer.getUniqueID());
                                            System.out.println(e.displayname);
                                        }
                                        else
                                        {
                                            PrenomGui.b = false;
                                        }
                                    }
                                    
                                    1 réponse Dernière réponse Répondre Citer 0
                                    • jglrxavpok
                                      jglrxavpok Modérateurs dernière édition par

                                      1. La map doit être stockée côté serveur, ça sert absolument à rien de la mettre dans le GUI.
                                      2. Tu utilises ‘Minecraft::thePlayer’, mais es-tu sûr qu’il existe? Parce que si ton GUI est ouvert sans être dans un monde MC, thePlayer renvoit null. Pour récupérer l’ID du joueur, utilise plutôt GameProfile (il y a un getter dans Minecraft de mémoire)

                                      Modérateur sur MFF. 
                                      Mon Github: http://github.com/jglrxavpok
                                      Mon compte Steam si vous voulez jouer à CS:GO ou TF2 avec moi: https://steamcommunity.com/id/jglrxavpok/

                                      1 réponse Dernière réponse Répondre Citer 0
                                      • Gabs
                                        Gabs dernière édition par

                                        @‘jglrxavpok’:

                                        1. La map doit être stockée côté serveur, ça sert absolument à rien de la mettre dans le GUI.
                                        2. Tu utilises ‘Minecraft::thePlayer’, mais es-tu sûr qu’il existe? Parce que si ton GUI est ouvert sans être dans un monde MC, thePlayer renvoit null. Pour récupérer l’ID du joueur, utilise plutôt GameProfile (il y a un getter dans Minecraft de mémoire)

                                        Quand tu dis stockée une map côté serveur tu peux t’expliqué mieux je comprends pas ou je peux la stocké.

                                        Oui mon gui est ouvert sans êtres dans un monde mc se qui explique le crash d’accord !

                                        Avec GameProfile je peux avoir l’uuid du joueur du coup ?

                                        1 réponse Dernière réponse Répondre Citer 0
                                        • jglrxavpok
                                          jglrxavpok Modérateurs dernière édition par

                                          Pour le GameProfile, oui

                                          Pour la map côté serveur, dans ton proxy serveur (par exemple), fais une map et ajoute lui du contenu lorsque tu reçois un packet pour les noms.

                                          Modérateur sur MFF. 
                                          Mon Github: http://github.com/jglrxavpok
                                          Mon compte Steam si vous voulez jouer à CS:GO ou TF2 avec moi: https://steamcommunity.com/id/jglrxavpok/

                                          1 réponse Dernière réponse Répondre Citer 0
                                          • Gabs
                                            Gabs dernière édition par robin4002

                                            @‘jglrxavpok’:

                                            Pour le GameProfile, oui

                                            Pour la map côté serveur, dans ton proxy serveur (par exemple), fais une map et ajoute lui du contenu lorsque tu reçois un packet pour les noms.

                                            Du coup ça rend ça:

                                            ServerProxy:

                                            
                                            package com.CSC.net.proxy;
                                            
                                            import java.io.File;
                                            import java.util.HashMap;
                                            import java.util.UUID;
                                            
                                            import com.CSC.net.properties.EnumRank;
                                            
                                            public class ServerProxy extends CommonProxy {
                                            
                                                public static final HashMap<String, String> map = new HashMap<String, String>();
                                            
                                                @Override
                                                public void preInit(File configFile) {
                                                    super.preInit(configFile);
                                                    // code
                                                }
                                            
                                                @Override
                                                public void init() {
                                                    super.init();
                                                }
                                            }
                                            

                                            Classe gui:

                                            package com.CSC.net.GUI;
                                            
                                            import java.io.File;
                                            import java.io.IOException;
                                            import java.util.Date;
                                            import java.util.UUID;
                                            
                                            import org.lwjgl.input.Keyboard;
                                            
                                            import net.minecraft.client.Minecraft;
                                            import net.minecraft.client.gui.GuiButton;
                                            import net.minecraft.client.gui.GuiScreen;
                                            import net.minecraft.client.gui.GuiSelectWorld;
                                            import net.minecraft.client.gui.GuiTextField;
                                            import net.minecraft.util.EnumChatFormatting;
                                            import net.minecraft.util.ResourceLocation;
                                            
                                            import com.CSC.net.Main;
                                            import com.CSC.net.proxy.ServerProxy;
                                            import com.mojang.authlib.GameProfile;
                                            
                                            public class PrenomGui extends GuiScreen {
                                            
                                                private static boolean erreur;
                                            
                                                public static boolean b;
                                            
                                                private int valider;
                                            
                                                private int nom;
                                            
                                                private int prenom;
                                            
                                                public static GuiTextField text;
                                            
                                                public static GuiTextField text2;
                                            
                                                public PrenomGui() {
                                            
                                                }
                                            
                                                @Override
                                                public void initGui() {
                                            
                                                    valider = 0;
                                            
                                                    nom = 1;
                                            
                                                    prenom = 2;
                                            
                                                    text = new GuiTextField(nom, fontRendererObj, width / 2, 130, 64, 20);
                                            
                                                    text2 = new GuiTextField(prenom, fontRendererObj, width / 2, 100, 64, 20);
                                            
                                                    text.setFocused(false);
                                            
                                                    text2.setFocused(true);
                                            
                                                    text.setMaxStringLength(20);
                                            
                                                    text2.setMaxStringLength(20);
                                            
                                                    this.buttonList.add(new GuiButton(valider, width / 2 - 123, 200, 40, 20, "Valider"));
                                            
                                                    super.initGui();
                                                }
                                            
                                                @Override
                                                public void mouseClicked(int i, int j, int k) {
                                                    text.mouseClicked(i, j, k);
                                                    text2.mouseClicked(i, j, k);
                                                    try {
                                                        super.mouseClicked(i, j, k);
                                                    } catch (IOException e) {
                                                        // TODO Auto-generated catch block
                                                        e.printStackTrace();
                                                    }
                                                }
                                            
                                                @Override
                                                protected void keyTyped(char typedChar, int keyCode) throws IOException {
                                            
                                                    text.textboxKeyTyped(typedChar, keyCode);
                                                    text2.textboxKeyTyped(typedChar, keyCode);
                                                    super.keyTyped(typedChar, keyCode);
                                                }
                                            
                                                @Override
                                                protected void actionPerformed(GuiButton button) throws IOException {
                                            
                                                    switch (button.id) {
                                                    case 0:
                                                        if (!text.getText().equals("") && text.getText().length() > 3 && !text2.getText().equals("")
                                                                && text2.getText().length() > 3) {
                                                            if (!ServerProxy.map.containsKey(Minecraft.getMinecraft().getSession().getPlayerID()))// crash car mc
                                                                                                                                                  // est client et
                                                                                                                                                  // il faut du
                                                                                                                                                  // serveur
                                                                                                                                                  // surement /*\
                                                                                                                                                  // Ligne 100
                                                            {
                                                                System.out.println(b);
                                                                b = false;
                                                                ServerProxy.map.put(Minecraft.getMinecraft().getSession().getPlayerID(),
                                                                        text2.getText() + "_" + text.getText());
                                                                System.out.println(ServerProxy.map.get(Minecraft.getMinecraft().getSession().getPlayerID()));
                                                                erreur = false;
                                                                mc.displayGuiScreen(new GuiSelectWorld(this));
                                                            } else {
                                                                ServerProxy.map.remove(Minecraft.getMinecraft().getSession().getPlayerID());
                                                                System.out.println(b);
                                                                b = false;
                                                                ServerProxy.map.put(Minecraft.getMinecraft().getSession().getPlayerID(),
                                                                        text2.getText() + "_" + text.getText());
                                                                System.out.println(ServerProxy.map.get(Minecraft.getMinecraft().getSession().getPlayerID()));
                                                                erreur = false;
                                                                mc.displayGuiScreen(new GuiSelectWorld(this));
                                                            }
                                                        } else if (text.getText().equals("72") && !text2.getText().equals("") && text2.getText().length() > 3) {
                                                            if (!ServerProxy.map.containsKey(Minecraft.getMinecraft().getSession().getPlayerID())) {
                                                                System.out.println(b);
                                                                b = false;
                                                                ServerProxy.map.put(Minecraft.getMinecraft().getSession().getPlayerID(), text2.getText());
                                                                erreur = false;
                                                                mc.displayGuiScreen(new GuiSelectWorld(this));
                                                            } else {
                                                                ServerProxy.map.remove(Minecraft.getMinecraft().getSession().getPlayerID());
                                                                System.out.println(b);
                                                                b = false;
                                                                ServerProxy.map.put(Minecraft.getMinecraft().getSession().getPlayerID(), text2.getText());
                                                                erreur = false;
                                                                mc.displayGuiScreen(new GuiSelectWorld(this));
                                                            }
                                                        } else {
                                                            erreur = true;
                                                        }
                                                        break;
                                                    default:
                                                        erreur = false;
                                                        break;
                                                    }
                                            
                                                    super.actionPerformed(button);
                                                }
                                            
                                                @Override
                                                public void updateScreen() {
                                                    super.updateScreen();
                                                }
                                            
                                                public void drawScreen(int mouseX, int mouseY, float partialTick) {
                                            
                                                    this.drawDefaultBackground();
                                            
                                                    text.drawTextBox();
                                                    text2.drawTextBox();
                                            
                                                    this.drawString(this.fontRendererObj, EnumChatFormatting.GRAY + "Nom", width / 2 - 80, 135, 0);
                                            
                                                    this.drawString(this.fontRendererObj, EnumChatFormatting.GRAY + "Prénom", width / 2 - 80, 105, 0);
                                            
                                                    super.drawScreen(mouseX, mouseY, partialTick);
                                            
                                                    if (erreur) {
                                                        this.drawString(fontRendererObj, "§cVotre nom et/ou prénom est/sont vide ou trop court !",
                                                                this.width / 2 - 110, this.height / 2 - 50, 0);
                                                    }
                                                }
                                            
                                                @Override
                                                public void onGuiClosed() {
                                            
                                                }
                                            }
                                            

                                            Event:

                                            @SubscribeEvent
                                            public void test(PlayerEvent.NameFormat e)
                                            {
                                                if(PrenomGui.b)
                                                {
                                                    e.displayname = ServerProxy.map.get(Minecraft.getMinecraft().getSession().getPlayerID());
                                                    System.out.println(e.displayname);
                                                }
                                                else
                                                {
                                                    PrenomGui.b = false;
                                                }
                                            }
                                            
                                            1 réponse Dernière réponse Répondre Citer 0
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 6
                                            • 7
                                            • 8
                                            • 1 / 8
                                            • Premier message
                                              Dernier message
                                            Design by Woryk
                                            Contact / Mentions Légales

                                            MINECRAFT FORGE FRANCE © 2018

                                            Powered by NodeBB