MFF

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

    Plusieurs problèmes de mise à jour

    Planifier Épinglé Verrouillé Déplacé Sans suite
    1.9
    69 Messages 8 Publieurs 13.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.
    • J Hors-ligne
      Jodge
      dernière édition par

      Pour le passage de la 1.9 à la 1.10 : la seul erreur que j’ai pus avoir était un changement sur certaine constance (désormais toute écrite en majuscule)

      g) Il faut savoir que dans cette maj, beaucoup de “liaison” on changé. Des objets ont été rajouté/modifié pour servir de liaison plus propre.
      Je ne connais pas trop le principe de Dimension, je m’y suis jamais vraiment penché, mais de ce que j’ai vue du code source, cette fonctionne donner un objet de type DimensionType.
      Cette objet est une valeur contenus dans un enum et apporte plusieurs information sur la dimension.
      Il faut en créer un avec “DimensionType.register(String name, String suffix, int id, Class provider, boolean keepLoaded)” et c’est celui que tu dois retourner.

      Les fonctions servent ensuite un peu partout dans le code pour gérer : les villages (suffix), le displays (name) lors de l’enregistrement, et tous ce qui attrait au dimension (id) (rendu du ciel, portail, placement de block, update d’entité). C’est aussi lui qui permet de créer la dimension (apparemment, une fonction gère la création grâce a la class WorldProvider fournis en paramètre)

      Astuce : si tu code sur Eclipse, quand tu ne sais pas à quoi sert une fonction, sélectionne le nom, clic droit, et 'open call hierarchy". Tu aura une liste de toute les fonctions qui appelle cette méthode. De fils en aiguille tu peu généralement comprendre plus ou moins à quoi ça sert 😉

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

        Salut
        Désolé du temps de la réponse, j’étais partis en vacances.
        J’ai d’autres problèmes (que ça soit pour la barre de vie du boss ou pour le dimension type).
        Pour la barre de vie, ```java
        super.addTrackingPlayer(player);
        super.removeTrackingPlayer(player);

        
        Pour le dimensionType, quand je met ```java
        DimensionType.register("Frightful", "Frightful", this.DIMENSIONID, new WorldProviderFrightful(), false);
        ``` il y a une erreur sur register en me précisant que ces arguments ne sont pas bon. Le voilà (l'erreur):
        

        The method register(String, String, int, Class, boolean) in the type DimensionType is not applicable for the arguments (String, String, int, WorldProviderFrightful, boolean)

        . Mais voilà l'erreur : ma classe WorldProviderFrightful est extends de WorldProvider. Il demande une classe extends de WorldProvider mais quand je lui en donne une, ça ne lui convient pas  :@. Du coup, j'ai aussi testé avec le WorldProviderHell (qui est lui aussi extends de WorldProvider) mais pareil ça ne marche pas.
        
        J'ai continuer de faire d'autres recherches (disons rapides) mais je n'ai rien trouvé. Je continuerai de chercher plus en profondeur
        
        Merci d'avance
        1 réponse Dernière réponse Répondre Citer 0
        • J Hors-ligne
          Jodge
          dernière édition par

          DimensionType.register(“Frightful”, “Frightful”, this.DIMENSIONID, WorldProviderFrightful.class, false);

          il demande un objet de type classe, pas une instance de la class

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

            Salut
            J’ai compris mon erreur, je l’ai corrigé.
            J’ai aussi corrigé d’autres erreurs mais je ne suis pas sûr de ce que j’ai mis.
            Par exemple, dans le teleporter, j’ai remplacé ma fonction placeInExistingPortal par celle de base. Pour les .getMaterial où il fallait un argument (voir 1er post), il suffisait d’enlever le .getBlock qui étais juste avant.
            En gros, je me suis inspiré des classes de base.
            Pour mon WorldChunkManager, il étais extends de WorldChunkManager. Je croyais qu’il n’existait plus en 1.9, mais si, il a juste changé de nom. Il s’appelle dorénavant BiomeProvider.

            Je n’ai plus que quelques erreurs : Dans mon teleporter :

            private void travelToDimension(Entity entity, int id)
            {
            if (!entity.worldObj.isRemote && !entity.isDead)
            {
            entity.worldObj.theProfiler.startSection("changeDimension");
            MinecraftServer minecraftserver = entity.getServer();
            int j = entity.dimension;
            WorldServer worldserver = minecraftserver.worldServerForDimension(j);
            WorldServer worldserver1 = minecraftserver.worldServerForDimension(id);
            entity.dimension = id;
            
            if (j == 1 && id == 1) {
            worldserver1 = minecraftserver.worldServerForDimension(0);
            entity.dimension = 0;
            }
            
            entity.worldObj.removeEntity(entity);
            entity.isDead = false;
            entity.worldObj.theProfiler.startSection("reposition");
            minecraftserver.getConfigurationManager().transferEntityToWorld(entity, j, worldserver, worldserver1, new Teleporter(worldserver1));
            entity.worldObj.theProfiler.endStartSection("reloading");
            Entity entity1 = EntityList.createEntityByName(EntityList.getEntityString(entity), worldserver1);
            
            if (entity1 != null) {
            entity1.copyDataFromOld(entity);
            
            if (j == 1 && id == 1) {
            BlockPos spawnPoint = worldserver1.getSpawnPoint();
            spawnPoint = entity.worldObj.getTopSolidOrLiquidBlock(spawnPoint);
            entity1.setLocationAndAngles(spawnPoint.getX(), spawnPoint.getY(), spawnPoint.getZ(), entity1.rotationYaw, entity1.rotationPitch);
            }
            
            worldserver1.spawnEntityInWorld(entity1);
            }
            
            entity.isDead = true;
            entity.worldObj.theProfiler.endSection();
            worldserver.resetUpdateEntityTick();
            worldserver1.resetUpdateEntityTick();
            entity.worldObj.theProfiler.endSection();
            }
            }
            ``` getConfigurationManager n'existe plus dans MinecraftServer. Dans Entity, copyDateFromOld est devenu privée. Du coup, quelle alternative prendre ?
            
            Dans mon ChunkProvider, à cette ligne : ```java
                   noiseGens = TerrainGen.getModdedNoiseGenerators(worldIn, this.rand, noiseGens);
            ```il a une erreur sur getModdedNoiseGenerators :
            

            Bound mismatch: The generic method getModdedNoiseGenerators(World, Random, T) of type TerrainGen is not applicable for the arguments (World, Random, NoiseGenerator[]). The inferred type NoiseGenerator[] is not a valid substitute for the bounded parameter <t extends=“” initnoisegensevent.context=“”>```
            Je comprend la 1ère partie, c’est un problème de paramètres (qu’est ce que T ?), mais après je ne comprend pas.
            minHeight et maxHeight n’existe plus dans BiomeGenBase. Je suis allé dedans, et j’ai vu qu’il y a deux variables : une qui s’appelle baseHeight ( = minHeight) et une heightVariation. J’ai trouvé comment faire pour maxHeight : la variation - la base. Pour le minHeight, elle a juste changé de nom. Mais voilà le problème : elles sont toutes les deux privées. Comment faire ?
            Dans la fonction populate, la classe SpawnerAnimals n’existe plus.

            Et j’ai aussi une question : j’ai dû ajouté cette fonction : ```java
            @Override
            public boolean generateStructures(Chunk chunkIn, int x, int z) {
            // TODO Auto-generated method stub
            return false;
            }

            
            Après ça, je n'aurais plus d'erreur. J'espère juste que tout marchera correctement
            
            Merci d'avance
            
            EDIT : Salut. J'ai pu corriger les erreurs dans le ChunkProvider. Il me reste plus que deux erreurs (en réalité 4 mais 3 erreurs sont les mêmes). Dans le blockPortal, getConfigurationManager n'existe pas dans MinecraftServer. Je suis allé dedans, mais je ne vois rien de similaire. Et copyDataFromOld est privée dans Entity.</t>
            1 réponse Dernière réponse Répondre Citer 0
            • AxaurusA Hors-ligne
              Axaurus
              dernière édition par

              Re (ou salut à ceux qui n’aurait pas vu l’édit du post au-dessus)

              (comme dit dans l’édit du post ci-dessus) Il ne me reste plus que quelques erreurs dans le teleporter. Malheureusement, je ne peux pas utiliser les classes vanilla pour les corriger vu que ce n’est pas utilisé (en tout cas, pas à ma connaissance). J’ai quand même lancé le jeu et j’ai remarquer un bug assez illogique. Je ne peux aller dans un monde qu’une seule fois. Si j’y retourne une deuxième fois, ça me fait crash en me mettant comme erreur :

              [18:21:18] [Server thread/INFO]: Player942 joined the game
              [18:21:18] [Server thread/ERROR] [FML]: Exception caught during firing event net.minecraftforge.fml.common.gameevent.TickEvent$PlayerTickEvent@784676da:
              java.lang.NullPointerException
              at thisishalloween.client.ClientTickHandler.NightSound(ClientTickHandler.java:33) ~[ClientTickHandler.class:?]
              at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_16_ClientTickHandler_NightSound_PlayerTickEvent.invoke(.dynamic) ~[?:?]
              at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:49) ~[ASMEventHandler.class:?]
              at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:140) [EventBus.class:?]
              at net.minecraftforge.fml.common.FMLCommonHandler.onPlayerPostTick(FMLCommonHandler.java:357) [FMLCommonHandler.class:?]
              at net.minecraft.entity.player.EntityPlayer.updateSize(EntityPlayer.java:395) [EntityPlayer.class:?]
              at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:311) [EntityPlayer.class:?]
              at net.minecraft.entity.player.EntityPlayerMP.onUpdateEntity(EntityPlayerMP.java:339) [EntityPlayerMP.class:?]
              at net.minecraft.network.NetHandlerPlayServer.update(NetHandlerPlayServer.java:174) [NetHandlerPlayServer.class:?]
              at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher$1.update(NetworkDispatcher.java:196) [NetworkDispatcher$1.class:?]
              at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:307) [NetworkManager.class:?]
              at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:195) [NetworkSystem.class:?]
              at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:802) [MinecraftServer.class:?]
              at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:683) [MinecraftServer.class:?]
              at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:155) [IntegratedServer.class:?]
              at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:532) [MinecraftServer.class:?]
              at java.lang.Thread.run(Unknown Source) [?:1.8.0_92]
              [18:21:18] [Server thread/ERROR] [FML]: Index: 1 Listeners:
              [18:21:18] [Server thread/ERROR] [FML]: 0: NORMAL
              [18:21:18] [Server thread/ERROR] [FML]: 1: ASM: thisishalloween.client.ClientTickHandler@54b7bfbe NightSound(Lnet/minecraftforge/fml/common/gameevent/TickEvent$PlayerTickEvent;)V
              [18:21:18] [Server thread/ERROR]: Encountered an unexpected exception
              net.minecraft.util.ReportedException: Ticking player
              at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:210) ~[NetworkSystem.class:?]
              at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:802) ~[MinecraftServer.class:?]
              at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:683) ~[MinecraftServer.class:?]
              at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:155) ~[IntegratedServer.class:?]
              at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:532) [MinecraftServer.class:?]
              at java.lang.Thread.run(Unknown Source) [?:1.8.0_92]
              Caused by: java.lang.NullPointerException
              at thisishalloween.client.ClientTickHandler.NightSound(ClientTickHandler.java:33) ~[ClientTickHandler.class:?]
              at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_16_ClientTickHandler_NightSound_PlayerTickEvent.invoke(.dynamic) ~[?:?]
              at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:49) ~[ASMEventHandler.class:?]
              at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:140) ~[EventBus.class:?]
              at net.minecraftforge.fml.common.FMLCommonHandler.onPlayerPostTick(FMLCommonHandler.java:357) ~[FMLCommonHandler.class:?]
              at net.minecraft.entity.player.EntityPlayer.updateSize(EntityPlayer.java:395) ~[EntityPlayer.class:?]
              at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:311) ~[EntityPlayer.class:?]
              at net.minecraft.entity.player.EntityPlayerMP.onUpdateEntity(EntityPlayerMP.java:339) ~[EntityPlayerMP.class:?]
              at net.minecraft.network.NetHandlerPlayServer.update(NetHandlerPlayServer.java:174) ~[NetHandlerPlayServer.class:?]
              at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher$1.update(NetworkDispatcher.java:196) ~[NetworkDispatcher$1.class:?]
              at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:307) ~[NetworkManager.class:?]
              at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:195) ~[NetworkSystem.class:?]
              … 5 more
              [18:21:18] [Server thread/ERROR]: This crash report has been saved to: G:\Codage\Minecraft\This_is_Halloween\v1.3\MC 1.9\run\.\crash-reports\crash-2016-08-10_18.21.18-server.txt
              [18:21:18] [Server thread/INFO]: Stopping server
              [18:21:18] [Server thread/INFO]: Saving players
              [18:21:18] [Server thread/INFO]: Saving worlds
              [18:21:18] [Server thread/INFO]: Saving chunks for level 'New World'/Overworld
              [18:21:18] [Server thread/INFO]: Saving chunks for level 'New World'/Nether
              [18:21:18] [Server thread/INFO]: Saving chunks for level 'New World'/The End
              [18:21:18] [Server thread/INFO] [FML]: Unloading dimension 0
              [18:21:18] [Server thread/INFO] [FML]: Unloading dimension -1
              [18:21:18] [Server thread/INFO] [FML]: Unloading dimension 1
              [18:21:18] [Server thread/INFO] [FML]: Applying holder lookups
              [18:21:18] [Server thread/INFO] [FML]: Holder lookups applied
              [18:21:18] [Server thread/INFO] [FML]: The state engine was in incorrect state SERVER_STOPPING and forced into state SERVER_STOPPED. Errors may have been discarded.
              [18:21:18] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:646]: –-- Minecraft Crash Report ----
              // Uh... Did I do that?
              
              Time: 10/08/16 18:21
              Description: Ticking player
              
              java.lang.NullPointerException: Ticking player
              at thisishalloween.client.ClientTickHandler.NightSound(ClientTickHandler.java:33)
              at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_16_ClientTickHandler_NightSound_PlayerTickEvent.invoke(.dynamic)
              at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:49)
              at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:140)
              at net.minecraftforge.fml.common.FMLCommonHandler.onPlayerPostTick(FMLCommonHandler.java:357)
              at net.minecraft.entity.player.EntityPlayer.updateSize(EntityPlayer.java:395)
              at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:311)
              at net.minecraft.entity.player.EntityPlayerMP.onUpdateEntity(EntityPlayerMP.java:339)
              at net.minecraft.network.NetHandlerPlayServer.update(NetHandlerPlayServer.java:174)
              at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher$1.update(NetworkDispatcher.java:196)
              at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:307)
              at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:195)
              at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:802)
              at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:683)
              at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:155)
              at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:532)
              at java.lang.Thread.run(Unknown Source)
              
              A detailed walkthrough of the error, its code path and all known details is as follows:
              ---------------------------------------------------------------------------------------
              
              -- Head --
              Stacktrace:
              at thisishalloween.client.ClientTickHandler.NightSound(ClientTickHandler.java:33)
              at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_16_ClientTickHandler_NightSound_PlayerTickEvent.invoke(.dynamic)
              at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:49)
              at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:140)
              at net.minecraftforge.fml.common.FMLCommonHandler.onPlayerPostTick(FMLCommonHandler.java:357)
              at net.minecraft.entity.player.EntityPlayer.updateSize(EntityPlayer.java:395)
              at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:311)
              
              -- Player being ticked --
              Details:
              Entity Type: null (net.minecraft.entity.player.EntityPlayerMP)
              Entity ID: 11290
              Entity Name: Player942
              Entity's Exact location: -236,50, 4,00, 902,50
              Entity's Block location: World: (-237,4,902), Chunk: (at 3,0,6 in -15,56; contains blocks -240,0,896 to -225,255,911), Region: (-1,1; contains chunks -32,32 to -1,63, blocks -512,0,512 to -1,255,1023)
              Entity's Momentum: 0,00, -0,08, 0,00
              Entity's Passengers: []
              Entity's Vehicle: ~~ERROR~~ NullPointerException: null
              Stacktrace:
              at net.minecraft.entity.player.EntityPlayerMP.onUpdateEntity(EntityPlayerMP.java:339)
              at net.minecraft.network.NetHandlerPlayServer.update(NetHandlerPlayServer.java:174)
              at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher$1.update(NetworkDispatcher.java:196)
              at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:307)
              
              -- Ticking connection --
              Details:
              Connection: net.minecraft.network.NetworkManager@685bb755
              Stacktrace:
              at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:195)
              at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:802)
              at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:683)
              at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:155)
              at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:532)
              at java.lang.Thread.run(Unknown Source)
              
              -- System Details --
              Details:
              Minecraft Version: 1.9
              Operating System: Windows 10 (amd64) version 10.0
              Java Version: 1.8.0_92, Oracle Corporation
              Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
              Memory: 617548424 bytes (588 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
              JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
              IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
              FML: MCP 9.23 Powered by Forge 12.16.1.1887 4 mods loaded, 4 mods active
              States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
              UCHIJAAAAAAAAA mcp{9.19} [Minecraft Coder Pack] (minecraft.jar)
              UCHIJAAAAAAAAA FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.9-12.16.1.1887.jar)
              UCHIJAAAAAAAAA Forge{12.16.1.1887} [Minecraft Forge] (forgeSrc-1.9-12.16.1.1887.jar)
              UCHIJAAAAAAAAA This_is_Halloween{1.3} [This_is_Halloween] (bin)
              Loaded coremods (and transformers):
              GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread.
              Profiler Position: N/A (disabled)
              Player Count: 1 / 8; [EntityPlayerMP['Player942'/11290, l='New World', x=-236,50, y=4,00, z=902,50]]
              Type: Integrated Server (map_client.txt)
              Is Modded: Definitely; Client brand changed to 'fml,forge'
              [18:21:18] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:646]: #@!@# Game crashed! Crash report saved to: #@!@# .\crash-reports\crash-2016-08-10_18.21.18-server.txt
              [18:21:18] [Client Shutdown Thread/INFO]: Stopping server
              [18:21:18] [Client Shutdown Thread/INFO]: Saving players
              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
              
              

              L’erreur me pointe à ```java
              if(mc.theWorld.getWorldTime() == 15000)

              
              Il y a aussi un autre bug en "rapport" avec ma dimension (je met entre guillemet parce que logiquement non, mais si). Je créer et enregistre ma dimension par ```java
              DimensionManager.registerDimension(DIMENSIONID, this.frightfulDimensionType);
              DimensionManager.createProviderFor(DIMENSIONID);
              ```Quand j'essaye de créer un monde, ça crash :
              

              [18:24:10] [Server thread/INFO] [FML]: Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@11b08534)
              [18:24:11] [Server thread/INFO] [FML]: Loading dimension -5 (New World) (net.minecraft.server.integrated.IntegratedServer@11b08534)
              [18:24:11] [Server thread/ERROR]: Encountered an unexpected exception
              java.lang.NullPointerException
              at net.minecraft.village.VillageCollection.fileNameForProvider(VillageCollection.java:305) ~[VillageCollection.class:?]
              at net.minecraft.world.WorldServerMulti.init(WorldServerMulti.java:67) ~[WorldServerMulti.class:?]
              at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:90) ~[IntegratedServer.class:?]
              at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:123) ~[IntegratedServer.class:?]
              at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:492) [MinecraftServer.class:?]
              at java.lang.Thread.run(Unknown Source) [?:1.8.0_92]
              [18:24:11] [Server thread/ERROR]: This crash report has been saved to: G:\Codage\Minecraft\This_is_Halloween\v1.3\MC 1.9\run.\crash-reports\crash-2016-08-10_18.24.11-server.txt
              [18:24:11] [Server thread/INFO]: Stopping server
              [18:24:11] [Server thread/INFO]: Saving players
              [18:24:11] [Server thread/INFO]: Saving worlds
              [18:24:11] [Server thread/INFO]: Saving chunks for level ‘New World’/Overworld
              [18:24:11] [Server thread/ERROR]: Exception stopping the server
              java.lang.NullPointerException
              at net.minecraft.server.MinecraftServer.saveAllWorlds(MinecraftServer.java:406) ~[MinecraftServer.class:?]
              at net.minecraft.server.integrated.IntegratedServer.saveAllWorlds(IntegratedServer.java:237) ~[IntegratedServer.class:?]
              at net.minecraft.server.MinecraftServer.stopServer(MinecraftServer.java:452) ~[MinecraftServer.class:?]
              at net.minecraft.server.integrated.IntegratedServer.stopServer(IntegratedServer.java:368) ~[IntegratedServer.class:?]
              at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:585) [MinecraftServer.class:?]
              at java.lang.Thread.run(Unknown Source) [?:1.8.0_92]
              [18:24:11] [Server thread/INFO] [FML]: Applying holder lookups
              [18:24:11] [Server thread/INFO] [FML]: Holder lookups applied
              [18:24:11] [Server thread/INFO] [FML]: The state engine was in incorrect state SERVER_STARTING and forced into state SERVER_STOPPED. Errors may have been discarded.
              [18:24:12] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:646]: –-- Minecraft Crash Report ----
              // Daisy, daisy…

              Time: 10/08/16 18:24
              Description: Exception in server tick loop

              java.lang.NullPointerException: Exception in server tick loop
              at net.minecraft.village.VillageCollection.fileNameForProvider(VillageCollection.java:305)
              at net.minecraft.world.WorldServerMulti.init(WorldServerMulti.java:67)
              at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:90)
              at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:123)
              at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:492)
              at java.lang.Thread.run(Unknown Source)

              A detailed walkthrough of the error, its code path and all known details is as follows:

              – System Details –
              Details:
              Minecraft Version: 1.9
              Operating System: Windows 10 (amd64) version 10.0
              Java Version: 1.8.0_92, Oracle Corporation
              Java VM Version: Java HotSpot™ 64-Bit Server VM (mixed mode), Oracle Corporation
              Memory: 618242424 bytes (589 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
              JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
              IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
              FML: MCP 9.23 Powered by Forge 12.16.1.1887 4 mods loaded, 4 mods active
              States: ‘U’ = Unloaded ‘L’ = Loaded ‘C’ = Constructed ‘H’ = Pre-initialized ‘I’ = Initialized ‘J’ = Post-initialized ‘A’ = Available ‘D’ = Disabled ‘E’ = Errored
              UCHIJAA mcp{9.19} [Minecraft Coder Pack] (minecraft.jar)
              UCHIJAA FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.9-12.16.1.1887.jar)
              UCHIJAA Forge{12.16.1.1887} [Minecraft Forge] (forgeSrc-1.9-12.16.1.1887.jar)
              UCHIJAA This_is_Halloween{1.3} [This_is_Halloween] (bin)
              Loaded coremods (and transformers):
              GL info: ERROR RuntimeException: No OpenGL context found in the current thread.
              Profiler Position: N/A (disabled)
              Player Count: 0 / 8; []
              Type: Integrated Server (map_client.txt)
              Is Modded: Definitely; Client brand changed to ‘fml,forge’
              [18:24:12] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:646]: #@!@# Game crashed! Crash report saved to: #@!@# .\crash-reports\crash-2016-08-10_18.24.11-server.txt
              [18:24:12] [Client Shutdown Thread/INFO]: Stopping server
              [18:24:12] [Client Shutdown Thread/INFO]: Saving players
              [18:24:12] [Client Shutdown Thread/INFO]: Saving worlds
              [18:24:12] [Client Shutdown Thread/INFO]: Saving chunks for level ‘New World’/Overworld
              Exception in thread “Client Shutdown Thread” AL lib: (EE) alc_cleanup: 1 device not closed
              Java HotSpot™ 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release

              Visiblement, ça serrait au moment de charger ma dimension. Mais ce que je trouve étonnant, c'est que les logs parlent de villages … alors qu'il n'y a pas de village dans ma dimension. Par contre, si j'enlève ces deux lignes, ça marche parfaitement (quand je n'ai pas l'autre crash).
              
              J'ai aussi une question : dans les logs, j'ai ça :
              

              2016-08-10 18:23:37,193 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
              2016-08-10 18:23:37,225 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
              2016-08-10 18:23:37,226 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream

              Je sais pas si c'est Minecraft ou Java qui affiche ça, mais je voudrais savoir ce que c'est. Ce n'est pas dérangeant du tout, ça marche bien, mais bon ...
              
              Merci d'avance
              1 réponse Dernière réponse Répondre Citer 0
              • SCAREXS Hors-ligne
                SCAREX
                dernière édition par

                1. La première est un NPE donc soit Minecraft est null, soit le monde est null, tu tick le client ou le monde ? Envoi la fonction entière ce sera plus claire.
                2. Peut être qu’il faut préciser que ton monde n’a pas de village (c’est une supposition, je n’y connais pas grand chose en dimensions)
                3. C’est un simple avertissement, il n’a rien d’important (j’ai la même chose dans mes logs)

                PS : si tu mets à jour ton mod pense à respecter la convention java au passage.

                Site web contenant mes scripts : http://SCAREXgaming.github.io

                Pas de demandes de support par MP ni par skype SVP.
                Je n'accepte sur skype que l…

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

                  1. Il semblerait que ça soit l’entity type qui soit null, je vois ça dans les logs :
                  Entity Type: null (net.minecraft.entity.player.EntityPlayerMP)
                  

                  C’est le joueur que je tick, voilà ma fonction : ```java
                  @SubscribeEvent
                  public void nightSound(TickEvent.PlayerTickEvent event)
                  {
                  if (event.phase == TickEvent.Phase.END)
                  {
                  Minecraft mc = FMLClientHandler.instance().getClient();

                  if(mc.theWorld.getWorldTime() == 15000)
                  {
                  mc.theWorld.playSound(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, SoundsRegistering.ambient_nightSound, SoundCategory.AMBIENT, 0.2F, 1.0F, false);
                  }

                  if(mc.theWorld.getWorldTime() == 16000)
                  {
                  mc.theWorld.playSound(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, SoundsRegistering.ambient_nightSound, SoundCategory.AMBIENT, 0.2F, 1.0F, false);
                  }

                  if(mc.theWorld.getWorldTime() == 17000)
                  {
                  mc.theWorld.playSound(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, SoundsRegistering.ambient_nightSound, SoundCategory.AMBIENT, 0.2F, 1.0F, false);
                  }

                  if(mc.theWorld.getWorldTime() == 18000)
                  {
                  mc.theWorld.playSound(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, SoundsRegistering.ambient_nightSound, SoundCategory.AMBIENT, 0.2F, 1.0F, false);
                  }

                  if(mc.theWorld.getWorldTime() == 19000)
                  {
                  mc.theWorld.playSound(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, SoundsRegistering.ambient_nightSound, SoundCategory.AMBIENT, 0.2F, 1.0F, false);
                  }

                  if(mc.theWorld.getWorldTime() == 20000)
                  {
                  mc.theWorld.playSound(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, SoundsRegistering.ambient_nightSound, SoundCategory.AMBIENT, 0.2F, 1.0F, false);
                  }
                  }
                  }

                  Ce que je ne comprend pas, c'est pourquoi ça crash quand je charge un monde et pas au moment où ça doit jouer le son. De plus, le son se joue quand même la nuit.
                  
                  2) Je ne sais pas comment faire (si c'est bien ça qu'il faut faire …). Mais je ne comprend pas pourquoi ça fait ça quand je créer un monde. Ca devrait plutôt le faire quand je rentre dans ma dimension.
                  
                  3) Ok merci :)
                  
                  EDIT : Pour la convention java, j'essaye mais je n'y arrive pas toujours
                  1 réponse Dernière réponse Répondre Citer 0
                  • SCAREXS Hors-ligne
                    SCAREX
                    dernière édition par

                    1. Impossible car tu n’appelles pas l’entité à ce moment là. Essaie plutôt un WorldTick
                      Voici un meilleur code :
                    @SubscribeEvent
                    public void nightSound(TickEvent.WorldTickEvent event)
                    {
                    if (event.phase == TickEvent.Phase.END)
                    {
                    Minecraft mc = FMLClientHandler.instance().getClient();
                    
                    switch (mc.theWorld.getWorldTime()) {
                    case 15000:
                    case 16000:
                    case 17000:
                    case 18000:
                    case 19000:
                    case 20000:
                    mc.theWorld.playSound(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, SoundsRegistering.ambient_nightSound, SoundCategory.AMBIENT, 0.2F, 1.0F, false);
                    break;
                    }
                    }
                    
                    1. tu n’arrives pas à quoi ?

                    Site web contenant mes scripts : http://SCAREXgaming.github.io

                    Pas de demandes de support par MP ni par skype SVP.
                    Je n'accepte sur skype que l…

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

                      Salut

                      J’ai essayé (en gardant mon code) de tick le world et pas le joueur, c’est pareil. J’ai ensuite mis ton code, mais il y a eu une erreur à cette ligne :java switch (mc.theWorld.getWorldTime()) Ca ne peut pas switch des valeurs de type long. J’ai ajouté un int pour faire ```java
                      switch ((int)mc.theWorld.getWorldTime())

                      [13:27:33] [Server thread/ERROR] [FML]: Exception caught during firing event net.minecraftforge.fml.common.gameevent.TickEvent$WorldTickEvent@7b87a4de:
                      java.lang.NullPointerException
                      at thisishalloween.client.ClientTickHandler.nightSound(ClientTickHandler.java:73) ~[ClientTickHandler.class:?]
                      at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_14_ClientTickHandler_nightSound_WorldTickEvent.invoke(.dynamic) ~[?:?]
                      at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:49) ~[ASMEventHandler.class:?]
                      at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:140) [EventBus.class:?]
                      at net.minecraftforge.fml.common.FMLCommonHandler.onPostWorldTick(FMLCommonHandler.java:261) [FMLCommonHandler.class:?]
                      at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:788) [MinecraftServer.class:?]
                      at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:683) [MinecraftServer.class:?]
                      at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:155) [IntegratedServer.class:?]
                      at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:532) [MinecraftServer.class:?]
                      at java.lang.Thread.run(Unknown Source) [?:1.8.0_92]
                      [13:27:33] [Server thread/ERROR] [FML]: Index: 1 Listeners:
                      [13:27:33] [Server thread/ERROR] [FML]: 0: NORMAL
                      [13:27:33] [Server thread/ERROR] [FML]: 1: ASM: thisishalloween.client.ClientTickHandler@54b7bfbe nightSound(Lnet/minecraftforge/fml/common/gameevent/TickEvent$WorldTickEvent;)V
                      [13:27:33] [Server thread/ERROR]: Encountered an unexpected exception
                      java.lang.NullPointerException
                      at thisishalloween.client.ClientTickHandler.nightSound(ClientTickHandler.java:73) ~[ClientTickHandler.class:?]
                      at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_14_ClientTickHandler_nightSound_WorldTickEvent.invoke(.dynamic) ~[?:?]
                      at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:49) ~[ASMEventHandler.class:?]
                      at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:140) ~[EventBus.class:?]
                      at net.minecraftforge.fml.common.FMLCommonHandler.onPostWorldTick(FMLCommonHandler.java:261) ~[FMLCommonHandler.class:?]
                      at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:788) ~[MinecraftServer.class:?]
                      at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:683) ~[MinecraftServer.class:?]
                      at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:155) ~[IntegratedServer.class:?]
                      at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:532) [MinecraftServer.class:?]
                      at java.lang.Thread.run(Unknown Source) [?:1.8.0_92]
                      [13:27:33] [Server thread/ERROR]: This crash report has been saved to: G:\Codage\Minecraft\This_is_Halloween\v1.3\MC 1.9\run.\crash-reports\crash-2016-08-11_13.27.33-server.txt
                      [13:27:33] [Server thread/INFO]: Stopping server
                      [13:27:33] [Server thread/INFO]: Saving players
                      [13:27:33] [Server thread/INFO]: Saving worlds
                      [13:27:33] [Server thread/INFO]: Saving chunks for level ‘New World’/Overworld
                      [13:27:34] [Server thread/INFO]: Saving chunks for level ‘New World’/Nether
                      [13:27:34] [Server thread/INFO]: Saving chunks for level ‘New World’/The End
                      [13:27:34] [Server thread/INFO] [FML]: Unloading dimension 0
                      [13:27:34] [Server thread/INFO] [FML]: Unloading dimension -1
                      [13:27:34] [Server thread/INFO] [FML]: Unloading dimension 1
                      [13:27:34] [Server thread/INFO] [FML]: Applying holder lookups
                      [13:27:34] [Server thread/INFO] [FML]: Holder lookups applied
                      [13:27:34] [Server thread/INFO] [FML]: The state engine was in incorrect state SERVER_STOPPING and forced into state SERVER_STOPPED. Errors may have been discarded.
                      [13:27:35] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:646]: –-- Minecraft Crash Report ----
                      // On the bright side, I bought you a teddy bear!

                      Time: 11/08/16 13:27
                      Description: Exception in server tick loop

                      java.lang.NullPointerException: Exception in server tick loop
                      at thisishalloween.client.ClientTickHandler.nightSound(ClientTickHandler.java:73)
                      at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_14_ClientTickHandler_nightSound_WorldTickEvent.invoke(.dynamic)
                      at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:49)
                      at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:140)
                      at net.minecraftforge.fml.common.FMLCommonHandler.onPostWorldTick(FMLCommonHandler.java:261)
                      at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:788)
                      at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:683)
                      at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:155)
                      at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:532)
                      at java.lang.Thread.run(Unknown Source)

                      A detailed walkthrough of the error, its code path and all known details is as follows:

                      – System Details –
                      Details:
                      Minecraft Version: 1.9
                      Operating System: Windows 10 (amd64) version 10.0
                      Java Version: 1.8.0_92, Oracle Corporation
                      Java VM Version: Java HotSpot™ 64-Bit Server VM (mixed mode), Oracle Corporation
                      Memory: 624213848 bytes (595 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
                      JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
                      IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
                      FML: MCP 9.23 Powered by Forge 12.16.1.1887 4 mods loaded, 4 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.19} [Minecraft Coder Pack] (minecraft.jar)
                      UCHIJAAAA FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.9-12.16.1.1887.jar)
                      UCHIJAAAA Forge{12.16.1.1887} [Minecraft Forge] (forgeSrc-1.9-12.16.1.1887.jar)
                      UCHIJAAAA This_is_Halloween{1.3} [This_is_Halloween] (bin)
                      Loaded coremods (and transformers):
                      GL info: ERROR RuntimeException: No OpenGL context found in the current thread.
                      Profiler Position: N/A (disabled)
                      Player Count: 0 / 8; []
                      Type: Integrated Server (map_client.txt)
                      Is Modded: Definitely; Client brand changed to ‘fml,forge’
                      [13:27:35] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:646]: #@!@# Game crashed! Crash report saved to: #@!@# .\crash-reports\crash-2016-08-11_13.27.33-server.txt
                      [13:27:35] [Client Shutdown Thread/INFO]: Stopping server
                      [13:27:35] [Client Shutdown Thread/INFO]: Saving players
                      [13:27:35] [Client Shutdown Thread/INFO]: Saving worlds
                      AL lib: (EE) alc_cleanup: 1 device not closed
                      Java HotSpot™ 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release

                      
                      En regardant plus bas, ça parle de server. Peut-être est-ce à cause de ça. Mais c'est censé être uniquement client, c'est enregistrer dans le ClientProxy
                      
                      Pour ta question, je n'arrive pas à toujours respecter la convention. J'essaye de faire plus attention, mais ça ne suffit pas quelques fois.
                      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

                        Ajoutes juste un null check.

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

                          J’ai testé ça, j’ai testé d’autres trucs et j’ai enfin trouvé (malgré que ça soit bizarre) : la fonction n’est pas appelé côté client. Ca peut paraître bizarre, mais pourtant c’est ça.```java
                          @SubscribeEvent
                          public void nightSound(TickEvent.WorldTickEvent event)
                          {
                          if(event.world.isRemote)
                          {
                          if (event.phase == TickEvent.Phase.END)
                          {
                          System.out.println(“test”);
                          //if(event.world != null && event.side.isClient() && event.type.WORLD != null && event.type.CLIENT != null && event.type.PLAYER != null)
                          {
                          System.out.println(“rien n’est nul”);
                          Minecraft mc = FMLClientHandler.instance().getClient();

                          switch ((int)mc.theWorld.getWorldTime())
                          {
                          case 15000:
                          case 16000:
                          case 17000:
                          case 18000:
                          case 19000:
                          case 20000:
                          mc.theWorld.playSound(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, SoundsRegistering.ambient_nightSound, SoundCategory.AMBIENT, 0.2F, 1.0F, false);
                          break;
                          }
                          }
                          }
                          }
                          }

                          Si j'enlève le world isRemote, ça crash. Or, si je le met ça marche bien mais il n'y a pas les messages (ce qui prouve que la fonction n'est pas appelé. Mais c'est quand même bizarre vu que la classe est enregistré dans le ClientProxy
                          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

                            Utilises alors TickEvent.ClientTickEvent

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

                              J’ai testé, Minecraft charge bien mais il m’affiche le menu principal une demi-seconde et crash en me précisant cette ligne : ```java
                              switch ((int)mc.theWorld.getWorldTime())

                              
                              Sinon, j'ai réessayé PlayerTickEvent et ça marche bien seulement si je met :```java
                              if(event.side.isClient())
                              ```Ca ne me gène pas de l'utiliser (au contraire, si c'est pour le bon fonctionnement je suis pour) mais pourquoi c'est aussi appelé côté serveur sinon ? C'est enregistrer dans le client proxy pourtant.
                              1 réponse Dernière réponse Répondre Citer 0
                              • AymericRedA Hors-ligne
                                AymericRed
                                dernière édition par

                                Les events enregistrés dans le client proxy sont toujours appelés côté serveur intégré, vu que c’est le programme client, le seul endroit où ils ne sont pas appelés, c’est le serveur dédié, mais tu peux mettre un @SideOnly(Side.CLIENT) sur la fonction pour éviter ça.
                                Et pour le NPE, tu peux faire un null check sur mc.theWorld au lieu d’utiliser PlayerTickEvent.

                                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
                                • AxaurusA Hors-ligne
                                  Axaurus
                                  dernière édition par

                                  Ok merci 🙂

                                  Je n’ai plus que deux problèmes dans le mod. Dans le blockPortal, j’utilisait java mcServer.getConfigurationManager().transferPlayerToDimension(player, ThisisHalloween.DIMENSION_ID, new TeleporterFrightful(mcServer.worldServerForDimension(ThisisHalloween.DIMENSION_ID))); pour me tp dans ma dimension. Mais getConfigurationManager n’existe plus. J’ai cherché et j’ai trouvé ```java
                                  entityIn.changeDimension(ThisisHalloween.DIMENSION_ID);

                                  Encore dans le blockPortal, cette fonction```java
                                  entity1.copyDataFromOld(entity);
                                  ``` est private. Là, on n'y peut malheureusement pas grand chose, mais est-elle importante ? Elle est dans cette fonction :```java
                                  private void travelToDimension(Entity entity, int id)
                                  {
                                  if (!entity.worldObj.isRemote && !entity.isDead)
                                  {
                                  entity.worldObj.theProfiler.startSection("changeDimension");
                                  MinecraftServer minecraftserver = entity.getServer();
                                  int j = entity.dimension;
                                  WorldServer worldserver = minecraftserver.worldServerForDimension(j);
                                  WorldServer worldserver1 = minecraftserver.worldServerForDimension(id);
                                  entity.dimension = id;
                                  
                                  if (j == 1 && id == 1) {
                                  worldserver1 = minecraftserver.worldServerForDimension(0);
                                  entity.dimension = 0;
                                  }
                                  
                                  entity.worldObj.removeEntity(entity);
                                  entity.isDead = false;
                                  entity.worldObj.theProfiler.startSection("reposition");
                                  //. minecraftserver.getConfigurationManager().transferEntityToWorld(entity, j, worldserver, worldserver1, new Teleporter(worldserver1));
                                  entity.worldObj.theProfiler.endStartSection("reloading");
                                  Entity entity1 = EntityList.createEntityByName(EntityList.getEntityString(entity), worldserver1);
                                  
                                  if (entity1 != null)
                                  {
                                  // entity1.copyDataFromOld(entity);
                                  
                                  if (j == 1 && id == 1)
                                  {
                                  BlockPos spawnPoint = worldserver1.getSpawnPoint();
                                  spawnPoint = entity.worldObj.getTopSolidOrLiquidBlock(spawnPoint);
                                  entity1.setLocationAndAngles(spawnPoint.getX(), spawnPoint.getY(), spawnPoint.getZ(), entity1.rotationYaw, entity1.rotationPitch);
                                  }
                                  
                                  worldserver1.spawnEntityInWorld(entity1);
                                  }
                                  
                                  entity.isDead = true;
                                  entity.worldObj.theProfiler.endSection();
                                  worldserver.resetUpdateEntityTick();
                                  worldserver1.resetUpdateEntityTick();
                                  entity.worldObj.theProfiler.endSection();
                                  }
                                  }
                                  

                                  Pour le problème de la création d’un monde à l’enregistrement du WorldProvider (voir dernier post page 1), c’est de ma faute, j’ai oublier un truc.```java
                                  @Override
                                  public DimensionType getDimensionType()
                                  {
                                  return ThisisHalloween.FRIGHTFUL_DIMENSION_TYPE;
                                  }

                                  
                                  Merci d'avance
                                  1 réponse Dernière réponse Répondre Citer 0
                                  • AymericRedA Hors-ligne
                                    AymericRed
                                    dernière édition par

                                    getConfiguration doit avoir changé de nom, ou l’élément qu’elle return est passé en public, donc la fonction est devenue inutile, regarde si une fonction ou une field n’a pas un nom semblable dans la classe McServer.
                                    Pour le copyDataFromOld, regarde dans la version de mc où cette fonction existe et essaye de le refaire, sinon, il faudra passer par de la réflexion pour accéder quand même à la fonction.

                                    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
                                    • AxaurusA Hors-ligne
                                      Axaurus
                                      dernière édition par

                                      1. Mais c’est là que viens le problème, elle retourne le fichier ServerConfigurationManager, qui n’existe plus en 1.9 (il a dû changer de nom et de package).

                                      2. Je viens d’essayer, mais la fonction utilise des trucs en private, et d’autres en protégés. Du coup, je vais essayer d’utiliser la réflexion

                                      EDIT : j’ai essayer d’utiliser le reflection, j’ai fait ```java

                                      ObfuscationReflectionHelper.setPrivateValue(Entity.class, instance, entity1., “lastPortalPos”);
                                      ObfuscationReflectionHelper.setPrivateValue(Entity.class, instance, entity1., “lastPortalVec”);
                                      ObfuscationReflectionHelper.setPrivateValue(Entity.class, instance, entity1., “teleportDirection”);

                                      
                                      EDIT n°2 : je viens de trouver pour la 1\. Il faut remplacer ```java
                                      mcServer.getConfigurationManager().transferPlayerToDimension(player, 0, new TeleporterFrightful(mcServer.worldServerForDimension(0)));
                                      ``` par ```java
                                      playerList.transferPlayerToDimension(player, 0, new TeleporterFrightful(mcServer.worldServerForDimension(0)));
                                      ```. Je vais vous expliquer comment j'ai trouvé. J'ai ouvert eclipse avec mon mod en 1.8 et je suis aller dans le fichiers ServerConfigurationManager. J'ai utilisé la méthode que quelqu'un (désolé si tu lis ce post, je ne me souviens plus de ton pseudo) m'a donné pour voir où est appelé la classe UserListBans (elle est appelé dans convertUserBanlist et ServerConfigurationManager). Je suis retourné en 1.9, j'ai fait pareil et elle est appelé dans convertUserBanlist et dans PlayerList. Comme PlayerList n'est pas en 1.8, je l'ai ouvert et l'ai comparé à ServerConfigurationManager. C'est exactement pareil. Il me reste un seul problème : il faut initialiser la variable. J'utilise ```java
                                      PlayerList playerList;
                                      ``` et ensuite je l'utilise pour ```java
                                      playerList.transferPlayerToDimension(
                                      ``` mais je ne sais pas quoi mettre pour l'initialiser.
                                      1 réponse Dernière réponse Répondre Citer 0
                                      • AymericRedA Hors-ligne
                                        AymericRed
                                        dernière édition par

                                        1. Je regarde ça 🙂
                                        2. Pour l’instance, c’est ton entité (donc entity1), et pour les valeurs, faut regarder dans la fonction en private les valeurs qu’elle utilise.
                                          PS: Il y a aussi un moyen (plus compliqué) d’appeler directement la fonction copyDataFromOld, car là, si tu changes plusieurs valeurs, au niveau perfs c’est pas extra ^^

                                        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
                                        • AxaurusA Hors-ligne
                                          Axaurus
                                          dernière édition par

                                          Pour la 1, j’ai modifier le post d’au-dessus, regarde l’édit n°2.
                                          Pour la 2, je vais voir
                                          EDIT : je ne change que 3 valeurs par la reflection. Tu pense que ça va beaucoup jouer sur les performances ?

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

                                            Pour le playerList, tu dois pouvoir l’avoir via le mcServer.
                                            Vu que le code n’est pas appelé souvent, oui ça ira.

                                            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
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 3 / 4
                                            • Premier message
                                              Dernier message
                                            Design by Woryk
                                            ContactMentions Légales

                                            MINECRAFT FORGE FRANCE © 2024

                                            Powered by NodeBB