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

    Résolu OnEntityJoinWorldEvent

    1.7.x
    1.7.10
    2
    5
    1123
    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.
    • DiabolicaTrix
      DiabolicaTrix Correcteurs Moddeurs confirmés dernière édition par

      Hey, ça fait longtemps que je suis pas venu 😛

      Bref, J’ai un petit problème, j’ai créé un event EntityJoinWorldEvent dans cette event je vérifies si l’entité à l’instance d’un joueur et si le mon n’est pas distant. Ça fonctionne, mais pas si j’essaye d’ouvrir un gui, ça donne un crash:

      [21:21:43] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:388]: –-- Minecraft Crash Report ----
      // This doesn't make any sense!
      
      Time: 8/30/15 9:21 PM
      Description: Ticking memory connection
      
      java.lang.NullPointerException: Ticking memory connection
      at cpw.mods.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:110)
      at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241)
      at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182)
      at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726)
      at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614)
      at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118)
      at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485)
      at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752)
      
      A detailed walkthrough of the error, its code path and all known details is as follows:
      ---------------------------------------------------------------------------------------
      
      -- Head --
      Stacktrace:
      at cpw.mods.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:110)
      at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241)
      
      -- Ticking connection --
      Details:
      Connection: net.minecraft.network.NetworkManager@1a5ee367
      Stacktrace:
      at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182)
      at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726)
      at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614)
      at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118)
      at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485)
      at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752)
      
      -- System Details --
      Details:
      Minecraft Version: 1.7.10
      Operating System: Windows 8.1 (amd64) version 6.3
      Java Version: 1.8.0_51, Oracle Corporation
      Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
      Memory: 850215928 bytes (810 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
      JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
      AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
      IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95
      FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1492 8 mods loaded, 8 mods active
      States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
      UCHIJAAAA mcp{9.05} [Minecraft Coder Pack] (minecraft.jar)
      UCHIJAAAA FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.4.1492-1.7.10.jar)
      UCHIJAAAA Forge{10.13.4.1492} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1492-1.7.10.jar)
      UCHIJAAAA CarpentersBlocks{0.0.1 Beta} [AltisCraft.fr] (bin)
      UCHIJAAAA flansmod{@VERSION@} [Flan's Mod] (bin)
      UCHIJAAAA thirstmod{1.8.14} [Thirst Mod] (bin)
      UCHIJAAAA t4pro{1.0.1} [Project] (bin)
      UCHIJAAAA altiscraft.MODID{1.0.0} [AltisCraft.fr] (bin)
      GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread.
      Profiler Position: N/A (disabled)
      Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
      Player Count: 1 / 8; [EntityPlayerMP['DiabolicaTrix'/228, l='New World', x=337.28, y=70.00, z=705.42]]
      Type: Integrated Server (map_client.txt)
      Is Modded: Definitely; Client brand changed to 'fml,forge'
      [21:21:43] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:393]: #@!@# Game crashed! Crash report saved to: #@!@# .\crash-reports\crash-2015-08-30_21.21.41-server.txt
      [21:21:43] [Client thread/INFO] [FML]: Waiting for the server to terminate/save.
      [21:21:43] [Server thread/INFO] [FML]: Unloading dimension 0
      [21:21:43] [Server thread/INFO] [FML]: Unloading dimension -1
      [21:21:43] [Server thread/INFO] [FML]: Unloading dimension 1
      [21:21:43] [Server thread/INFO] [FML]: Applying holder lookups
      [21:21:43] [Server thread/INFO] [FML]: Holder lookups applied
      [21:21:43] [Server thread/INFO] [FML]: The state engine was in incorrect state SERVER_STOPPING and forced into state SERVER_STOPPED. Errors may have been discarded.
      [21:21:43] [Client thread/INFO] [FML]: Server terminated.
      AL lib: (EE) alc_cleanup: 1 device not closed
      Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
      

      La première raison à laquelle j’ai pensé est que le joueur n’est pas complètement chargé quand le fonction est appelée mais je n’ai aucune idée comment faire cette vérification et surtout, si elle échoue, la fonction ne sera pas rappellé donc ça ne fera pas le travail.

      Donc ma question, comment faire que l’event soit appelé après que le joueur soit chargé? Je ne crois pas qu’il y aie un autre event pour faire ça.

      Merci d’avance! 🙂

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

        Tu veux ouvrir un gui dès que le joueur se connecte ?
        Sur NHG on a géré ça dans un event de tick du joueur. Tant que son kit est null on lui affiche le gui de sélection de kit.
        Après pour ton cas je ne sais pas ce que tu veux faire dans ton gui, donc la solution ne sera peut-être pas adapté.

        1 réponse Dernière réponse Répondre Citer 0
        • DiabolicaTrix
          DiabolicaTrix Correcteurs Moddeurs confirmés dernière édition par

          En fait, je veux lui ouvrir un Gui pour qu’il puisse choisir où spawn.

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

            Dans ce cas tu peux utiliser le même principe. Dans un event de tick du joueur, si le spawn n’a pas encore été choisis tu ouvres le gui

            1 réponse Dernière réponse Répondre Citer 0
            • DiabolicaTrix
              DiabolicaTrix Correcteurs Moddeurs confirmés dernière édition par

              Ok, je vais voir ça.

              EDIT: Ça fonctionne parfaitement, merci!

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

              MINECRAFT FORGE FRANCE © 2018

              Powered by NodeBB