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.
    • RedRelayR Hors-ligne
      RedRelay Moddeurs confirmés
      dernière édition par

      Arrêtez de debugger avec des prints …
      Tu mets un point d’arret sur la ligne qui pose problème, tu lance en debug et tu fais du pas par pas …
      C’est 1000x plus efficace et rapide.

      Si tu ne sais pas te servir du debuggueur Eclipse, cherche sur internet, ça te changera la vie

      –------------------------------------------------------------------------------------
      Si tu trouves mon intervention pertinente, n'hésite pas a m…

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

        Salut
        Ca doit être la reflection qui bug car

        [13:49:58] [Server thread/INFO] [STDOUT]: [thisishalloween.world.frightful.TeleporterFrightful:placeInExistingPortal:76]: lastPortalVec : null
        [13:49:58] [Server thread/INFO] [STDOUT]: [thisishalloween.world.frightful.TeleporterFrightful:placeInExistingPortal:77]: teleportDirection : null
        

        lastPortalVec est nul.
        Je vais voir le blockPortal vanilla voir ce qui change

        @‘RedRelay’:

        Tu mets un point d’arret sur la ligne qui pose problème …

        Si je sais pas c’est quelle ligne qui bug, ça va être plutôt dur  😕

        1 réponse Dernière réponse Répondre Citer 0
        • RedRelayR Hors-ligne
          RedRelay Moddeurs confirmés
          dernière édition par

          @‘Axaurus’:

          @‘RedRelay’:

          Tu mets un point d’arret sur la ligne qui pose problème …

          Si je sais pas c’est quelle ligne qui bug, ça va être plutôt dur  😕

          
          thisishalloween.world.frightful.TeleporterFrightful.placeInExistingPortal(TeleporterFrightful.java:139)
          
          

          Elle est la ta ligne qui pose problème

          –------------------------------------------------------------------------------------
          Si tu trouves mon intervention pertinente, n'hésite pas a m…

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

            Les logs disent ça mais c’est pas ça. Il ne faut pas trop se fier au crash report des fois. Par exemple, quand j’ai voulu mettre à jour mon mod en 1.8, j’ai eu un problème pour la dimension. J’avais cru que c’était le teleporter qui buguait (ça m’indiquait la même ligne) mais en fait c’était le worldChunkManager, ça marchait très bien pour m’emmener dans le Nether. Et pis là, j’ai testé en allant dans le Nether en utilisant le teleporter de base et ça crash quand même.
            Mais merci quand même 😉

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

              Le crash report indique toujours la bonne raison, c’est juste que quelque fois il faut remonter un peu car le problème peut être dû à une autre classe

              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
              • RedRelayR Hors-ligne
                RedRelay Moddeurs confirmés
                dernière édition par

                Tu remontes dans la StackTrace alors.
                Ça aussi le débuggeur permet de le faire, et c’est monstrueusement plus efficace qu’un syso.

                –------------------------------------------------------------------------------------
                Si tu trouves mon intervention pertinente, n'hésite pas a m…

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

                  Salut
                  J’ai modifier des tas de trucs et le tp marche plus ou moins.
                  Déjà, je vous donne le code :```java
                  @Override
                  public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn)
                  {
                  if (entityIn.getRidingEntity() == null && entityIn.getRidingEntity() == null && entityIn.timeUntilPortal <= 0)
                  {
                  int id = -1;

                  if (entityIn.dimension == id)
                  {
                  id = 0;
                  }

                  if (entityIn instanceof EntityPlayerMP)
                  {
                  EntityPlayerMP player = (EntityPlayerMP) entityIn;
                  MinecraftServer mcServer = entityIn.getServer();

                  if (player.timeUntilPortal > 0)
                  {
                  player.timeUntilPortal = 100;
                  }
                  else if (player.dimension != ThisisHalloween.DIMENSION_ID)
                  {
                  ThisisHalloween.portal = false;
                  // mcServer.getPlayerList().transferPlayerToDimension(player, -1, new Teleporter(mcServer.worldServerForDimension(-1)));
                  //entityIn.changeDimension(-1);
                  travelToDimension(entityIn, id);
                  player.timeUntilPortal = 100;
                  System.out.println(“appel travel”);
                  ThisisHalloween.portal = true;
                  }
                  else
                  {
                  mcServer.getPlayerList().transferPlayerToDimension(player, 0, new TeleporterFrightful(mcServer.worldServerForDimension(0)));
                  // entityIn.changeDimension(0);
                  player.timeUntilPortal = 100;
                  }

                  // System.out.println(“appel travel”);
                  // travelToDimension(entityIn, id);
                  // player.timeUntilPortal = 100;
                  }

                  }
                  }

                  private Entity travelToDimension(Entity entity, int id)
                  {
                  if (!entity.worldObj.isRemote && !entity.isDead)
                  {
                  if (!net.minecraftforge.common.ForgeHooks.onTravelToDimension(entity, id)) return null;
                  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”);
                             BlockPos blockpos;

                  if (id == 1)
                             {
                                 blockpos = worldserver1.getSpawnCoordinate();
                             }
                             else
                             {
                                 double d0 = entity.posX;
                                 double d1 = entity.posZ;
                                 double d2 = 8.0D;

                  if (id == -1)
                                 {
                                     d0 = MathHelper.clamp_double(d0 / d2, worldserver1.getWorldBorder().minX() + 16.0D, worldserver1.getWorldBorder().maxX() - 16.0D);
                                     d1 = MathHelper.clamp_double(d1 / d2, worldserver1.getWorldBorder().minZ() + 16.0D, worldserver1.getWorldBorder().maxZ() - 16.0D);
                                 }
                                 else if (id == 0)
                                 {
                                     d0 = MathHelper.clamp_double(d0 * d2, worldserver1.getWorldBorder().minX() + 16.0D, worldserver1.getWorldBorder().maxX() - 16.0D);
                                     d1 = MathHelper.clamp_double(d1 * d2, worldserver1.getWorldBorder().minZ() + 16.0D, worldserver1.getWorldBorder().maxZ() - 16.0D);
                                 }

                  d0 = (double)MathHelper.clamp_int((int)d0, -29999872, 29999872);
                                 d1 = (double)MathHelper.clamp_int((int)d1, -29999872, 29999872);
                                 float f = entity.rotationYaw;
                                 entity.setLocationAndAngles(d0, entity.posY, d1, 90.0F, 0.0F);
                                 Teleporter teleporter = worldserver1.getDefaultTeleporter();
                                 teleporter.placeInExistingPortal(entity, f);
                                 blockpos = new BlockPos(entity);
                             }

                  //TODO minecraftserver.getPlayerList().transferEntityToWorld(entity, j, worldserver, worldserver1, new Teleporter(worldserver1));
                  worldserver.updateEntityWithOptionalForce(entity, false);
                  entity.worldObj.theProfiler.endStartSection(“reloading”);
                  Entity entity1 = EntityList.createEntityByName(EntityList.getEntityString(entity), worldserver1);

                  if (entity1 != null)
                  {
                  // entity1.copyDataFromOld(entity);
                  BlockPos lastPortalPos = new BlockPos(entity.posX, entity.posY, entity.posZ);
                  Vec3d lastPortalVec = entity.getLastPortalVec();
                  EnumFacing teleportDirection = entity.getTeleportDirection();

                  entity.timeUntilPortal = entity1.timeUntilPortal;
                  ObfuscationReflectionHelper.setPrivateValue(Entity.class, entity1, lastPortalPos, “lastPortalPos”);
                  ObfuscationReflectionHelper.setPrivateValue(Entity.class, entity1, lastPortalVec, “lastPortalVec”);
                  ObfuscationReflectionHelper.setPrivateValue(Entity.class, entity1, teleportDirection, “teleportDirection”);

                  if (j == 1 && id == 1)
                  {
                  BlockPos spawnPoint = worldserver1.getTopSolidOrLiquidBlock(worldserver1.getSpawnPoint());
                  entity1.moveToBlockPosAndAngles(spawnPoint, entity1.rotationYaw, entity1.rotationPitch);
                  }
                  else
                                 {
                                     entity1.moveToBlockPosAndAngles(blockpos, entity1.rotationYaw, entity1.rotationPitch);
                                 }

                  boolean flag = entity1.forceSpawn;
                                 entity1.forceSpawn = true;
                                 worldserver1.spawnEntityInWorld(entity1);
                                 entity1.forceSpawn = flag;
                                 worldserver1.updateEntityWithOptionalForce(entity1, false);
                  }

                  entity.isDead = true;
                  entity.worldObj.theProfiler.endSection();
                  worldserver.resetUpdateEntityTick();
                  worldserver1.resetUpdateEntityTick();
                  entity.worldObj.theProfiler.endSection();
                  return entity1;
                  }
                         else
                         {
                          System.out.println(“null travel”);
                             return null;
                         }

                  }

                  
                  Ensuite, voilà le problème.
                  Quand j'entre dans le portail, ça me tp, mais pas visuellement. Qu'est ce que je veux dire par là ? Quand je rentre dans le portail, le jeu me croie dans le Nether : les entités qui sont dans l'Overworld ne bouge plus et je ne peux plus intéragir avec mais à part ça tout fonctionne (le temps qui défile, le chat, …), j'ai fait afficher dans la console dans quel dimension je suis et dès que je rentre dans le portail, ça me dit -1\. Et quand je déco/reco, je me retrouve dans le nether. De plus, je vois dans la console que le Nether charge. Par contre, la console me spam à l'infini :
                  

                  [16:01:57] [Server thread/INFO] [FML]: Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@574531d4)
                  [16:01:57] [Server thread/INFO] [FML]: Unloading dimension -1

                  
                  Donc, je pense que vous vous doutez de ma question : pourquoi ça fait ça et comment corriger ?
                  
                  Merci d'avance
                  
                  PS : je précise que j'utilise toujours le teleporter de base, ça ne peut donc pas être ça
                  
                  EDIT : j'ai testé c'est bien la fonction TravelToDimension qui bug.
                  1 réponse Dernière réponse Répondre Citer 0
                  • AxaurusA Hors-ligne
                    Axaurus
                    dernière édition par

                    Salut
                    J’ai découvert un autre problème.
                    Déjà, pour en revenir au problème précédent, (pour ceux qui ont pas vu l’édit) c’est la fonction travelToDimension qui bug, et non OnEntityCollided. Pourtant ce qui est bizarre c’est que cette fonction est carrément copié sur la fonction changeDimension de la classe Entity. Et quand je me tp en utilisant cette fonction, ça marche très bien. Je comprend pas là.

                    Ensuite, pour mon autre problème, ma dimension marche très bien (à part que je spawn dans le sol et que y’a pas de portail. Mais ça, c’est le tp puisque même dans le nether je suis dans le sol) mais quand j’utilise mon biome, c’est le biome océan qui spawn. J’ai regarder et tester, mon biome n’est pas enregistrer. Voilà comment il est initialiser et “enregistrer” : (c’est dans le init de la classe principale) ```java
                    Evilland = new BiomeGenEvilland((new BiomeGenBase.BiomeProperties(“Evilland”)).setBaseHeight(0.125F).setHeightVariation(0.05F).setRainDisabled().setTemperature(2.0F).setRainfall(0.0F));
                    BiomeDictionary.registerBiomeType(Evilland, Type.DEAD);
                    BiomeManager.addBiome(BiomeType.WARM, new BiomeEntry(Evilland, 20));
                    System.out.println("Evilland registerd ? : " + BiomeDictionary.isBiomeRegistered(Evilland));

                    Grâce à mon message, la console me met false, ce qui veut dire qu'il n'est pas enregistrer. Mais dans BiomeDictionary et BiomeManager, il n'y a rien d'autre qui permet d'enregistrer. J'ai aussi tester d'utiliser l'enregistrement de BiomeGenBase, mais pareil.
                    
                    Merci d'avance
                    1 réponse Dernière réponse Répondre Citer 0
                    • AymericRedA Hors-ligne
                      AymericRed
                      dernière édition par

                      Pour ton problème de tp, j’essayerais de regarder plus tard si j’ai le time, et pour le biome, il me semble que tu n’es pas obligé de l’enregistré (pour les dimensions déjà existantes), tu as juste besoin de spécifier son utilisation dans le BiomeGenLayer de ta dimension.

                      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

                        Pourtant, il est bien renseigné partout où il doit être. Quand je met la plaine, ça marche bien. Mais dès que je met mon biome, ça bug.

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

                          Montre la classe du biome.

                          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

                            Salut

                            package thisishalloween.world.frightful;
                            
                            import net.minecraft.init.Blocks;
                            import net.minecraft.world.biome.BiomeGenBase;
                            import net.minecraft.world.biome.BiomeGenPlains;
                            import thisishalloween.entity.EntityEvilChicken;
                            import thisishalloween.entity.EntityEvilCow;
                            import thisishalloween.entity.EntityEvilPig;
                            import thisishalloween.entity.EntityEvilSheep;
                            import thisishalloween.entity.EntityGhost;
                            import thisishalloween.entity.EntityMummy;
                            import thisishalloween.entity.EntityVampire;
                            
                            public class BiomeGenEvilland extends BiomeGenBase
                            {
                            public BiomeGenEvilland(BiomeProperties i)
                            {
                            super(i);
                               this.spawnableCaveCreatureList.clear();
                               this.spawnableWaterCreatureList.clear();
                               this.spawnableMonsterList.clear();
                               this.spawnableCreatureList.clear();
                            
                               this.spawnableMonsterList.add(new SpawnListEntry(EntityEvilPig.class, 40, 8, 10));
                            this.spawnableMonsterList.add(new SpawnListEntry(EntityEvilSheep.class, 40, 8, 10));
                            this.spawnableMonsterList.add(new SpawnListEntry(EntityEvilChicken.class, 40, 8, 10));
                            this.spawnableMonsterList.add(new SpawnListEntry(EntityEvilCow.class, 40, 8, 10));
                            this.spawnableMonsterList.add(new SpawnListEntry(EntityMummy.class, 50, 1, 4));
                            this.spawnableMonsterList.add(new SpawnListEntry(EntityVampire.class, 50, 1, 4));
                            this.spawnableMonsterList.add(new SpawnListEntry(EntityGhost.class, 50, 1, 4));
                               this.addFlower(Blocks.yellow_flower.getDefaultState(), 10);// …
                               this.topBlock = Blocks.grass.getDefaultState();
                               this.fillerBlock = Blocks.dirt.getDefaultState();
                            
                               this.theBiomeDecorator.flowersPerChunk = 4;
                               this.theBiomeDecorator.treesPerChunk = 5;
                               this.theBiomeDecorator.grassPerChunk = 5;
                            this.theBiomeDecorator.mushroomsPerChunk = 2;
                            this.theBiomeDecorator.reedsPerChunk = 2;
                            this.theBiomeDecorator.generateLakes = true;
                            }
                            
                            }
                            
                            1 réponse Dernière réponse Répondre Citer 0
                            • AxaurusA Hors-ligne
                              Axaurus
                              dernière édition par

                              Salut
                              Je up ce topic pour vous dire que j’ai enfin réussi à faire marcher mon biome.
                              J’ai modifier son système (j’ai aussi profiter pour refaire la dimension) :
                              Dans le init de la classe principale :

                              Evilland = BiomeGenEvilland.instance = new BiomeGenEvilland();
                              Biome.registerBiome(BiomeGenEvilland.BIOME_ID, BiomeGenEvilland.instance.getBiomeName(), BiomeGenEvilland.instance);
                              ``` et la classe de mon biome : ```java
                              package thisishalloween.world.frightful;
                              
                              import net.minecraft.init.Blocks;
                              import net.minecraft.world.biome.Biome;
                              import thisishalloween.entity.EntityEvilChicken;
                              import thisishalloween.entity.EntityEvilCow;
                              import thisishalloween.entity.EntityEvilPig;
                              import thisishalloween.entity.EntityEvilSheep;
                              import thisishalloween.entity.EntityGhost;
                              import thisishalloween.entity.EntityMummy;
                              import thisishalloween.entity.EntityVampire;
                              
                              public class BiomeGenEvilland extends Biome
                              {
                              public static BiomeGenEvilland instance;
                              public static final String BIOME_NAME = "Evilland";
                              public static final int BIOME_ID = 255;
                              
                              public BiomeGenEvilland()
                              {
                              super(properties());
                                 this.spawnableCaveCreatureList.clear();
                                 this.spawnableWaterCreatureList.clear();
                                 this.spawnableMonsterList.clear();
                                 this.spawnableCreatureList.clear();
                              
                                 this.spawnableMonsterList.add(new SpawnListEntry(EntityEvilPig.class, 40, 8, 10));
                              this.spawnableMonsterList.add(new SpawnListEntry(EntityEvilSheep.class, 40, 8, 10));
                              this.spawnableMonsterList.add(new SpawnListEntry(EntityEvilChicken.class, 40, 8, 10));
                              this.spawnableMonsterList.add(new SpawnListEntry(EntityEvilCow.class, 40, 8, 10));
                              this.spawnableMonsterList.add(new SpawnListEntry(EntityMummy.class, 50, 1, 4));
                              this.spawnableMonsterList.add(new SpawnListEntry(EntityVampire.class, 50, 1, 4));
                              this.spawnableMonsterList.add(new SpawnListEntry(EntityGhost.class, 50, 1, 4));    // Pour ajouter une fleur (state, probabilité)
                                 this.addFlower(Blocks.YELLOW_FLOWER.getDefaultState(), 10);// …
                                 this.topBlock = Blocks.GRASS.getDefaultState();
                                 this.fillerBlock = Blocks.DIRT.getDefaultState();
                              
                                 this.theBiomeDecorator.flowersPerChunk = 4;
                                 this.theBiomeDecorator.treesPerChunk = 5;
                                 this.theBiomeDecorator.grassPerChunk = 5;
                              this.theBiomeDecorator.mushroomsPerChunk = 2;
                              this.theBiomeDecorator.reedsPerChunk = 2;
                              this.theBiomeDecorator.generateLakes = true;
                              }
                              
                              private static Biome.BiomeProperties properties()
                              {
                              Biome.BiomeProperties properties = new Biome.BiomeProperties(BIOME_NAME);
                              properties.setBaseHeight(0.125F);
                              properties.setHeightVariation(0.05F);
                              properties.setRainDisabled();
                              return properties;
                              }
                              }
                              ``` Après, c'est sûr, il y a plein d'autres moyen, mais celui-là marche, j'en suis satisfait :-).
                              Il ne reste plus que le tp qui bug.
                              Merci d'avance
                              
                              EDIT : J'ai oublié de vous dire, je suis désormais en 1.9.4\. Auparavant, j'était en 1.9 1er du nom
                              1 réponse Dernière réponse Répondre Citer 0
                              • AxaurusA Hors-ligne
                                Axaurus
                                dernière édition par

                                Salut
                                J’ai continué de chercher pour le problème de tp et j’ai trouvé des choses assez étonnantes : quand j’utilise la fonction changeDimension de la classe entity, ça me tp bien seulement si je met la dimension 1 (qui correspond à l’End). Si je veux aller dans le Nether ou dans ma dimension, ça crash. Par contre, si je met ma propre fonction changeDimension (qui est une pure copie de la fonction d’origine (à part un truc)), ça me tp dans la dimension que je veux seulement après avoir relancé le monde. Déjà, (juste pour savoir, je ne l’utiliserais pas) pourquoi ça crash quand j’utilise la fonction de base (celle de la classe Entity) ?
                                Ensuite, j’ai trouvé un truc (je ne sais pas si c’est ça qui résoudra le bug) : ```java
                                public Entity changeDimension(Entity entity, int dimensionIn)
                                   {
                                       if (!entity.worldObj.isRemote && !entity.isDead)
                                       {
                                           if (!net.minecraftforge.common.ForgeHooks.onTravelToDimension(entity, dimensionIn)) return null;
                                           entity.worldObj.theProfiler.startSection(“changeDimension”);
                                           MinecraftServer minecraftserver = entity.getServer();
                                           int i = entity.dimension;
                                           WorldServer worldserver = minecraftserver.worldServerForDimension(i);
                                           WorldServer worldserver1 = minecraftserver.worldServerForDimension(dimensionIn);
                                           entity.dimension = dimensionIn;

                                if (i == 1 && dimensionIn == 1)
                                           {
                                               worldserver1 = minecraftserver.worldServerForDimension(0);
                                               entity.dimension = 0;
                                           }

                                entity.worldObj.removeEntity(entity);
                                           entity.isDead = false;
                                           entity.worldObj.theProfiler.startSection(“reposition”);
                                           BlockPos blockpos;

                                if (dimensionIn == 1)
                                           {
                                               blockpos = worldserver1.getSpawnCoordinate();
                                           }
                                           else
                                           {
                                               double d0 = entity.posX;
                                               double d1 = entity.posZ;
                                               double d2 = 8.0D;

                                if (dimensionIn == -1)
                                               {
                                                   d0 = MathHelper.clamp_double(d0 / d2, worldserver1.getWorldBorder().minX() + 16.0D, worldserver1.getWorldBorder().maxX() - 16.0D);
                                                   d1 = MathHelper.clamp_double(d1 / d2, worldserver1.getWorldBorder().minZ() + 16.0D, worldserver1.getWorldBorder().maxZ() - 16.0D);
                                               }
                                               else if (dimensionIn == 0)
                                               {
                                                   d0 = MathHelper.clamp_double(d0 * d2, worldserver1.getWorldBorder().minX() + 16.0D, worldserver1.getWorldBorder().maxX() - 16.0D);
                                                   d1 = MathHelper.clamp_double(d1 * d2, worldserver1.getWorldBorder().minZ() + 16.0D, worldserver1.getWorldBorder().maxZ() - 16.0D);
                                               }

                                d0 = (double)MathHelper.clamp_int((int)d0, -29999872, 29999872);
                                               d1 = (double)MathHelper.clamp_int((int)d1, -29999872, 29999872);
                                               float f = entity.rotationYaw;
                                               entity.setLocationAndAngles(d0, entity.posY, d1, 90.0F, 0.0F);
                                               Teleporter teleporter = new Teleporter(entity.getServer().worldServerForDimension(entity.dimension));
                                               teleporter.placeInExistingPortal(entity, f);
                                               blockpos = new BlockPos(entity);
                                           }

                                worldserver.updateEntityWithOptionalForce(entity, false);
                                           entity.worldObj.theProfiler.endStartSection(“reloading”);
                                           Entity entity1 = EntityList.createEntityByName(EntityList.getEntityString(entity), worldserver1);

                                if (entity1 != null)
                                           {
                                         //      entity1.copyDataFromOld(entity1);

                                BlockPos lastPortalPos = new BlockPos(entity.posX, entity.posY, entity.posZ);
                                Vec3d lastPortalVec = entity.getLastPortalVec();
                                EnumFacing teleportDirection = entity.getTeleportDirection();

                                entity.timeUntilPortal = entity1.timeUntilPortal;
                                ObfuscationReflectionHelper.setPrivateValue(Entity.class, entity1, lastPortalPos, “lastPortalPos”);
                                ObfuscationReflectionHelper.setPrivateValue(Entity.class, entity1, lastPortalVec, “lastPortalVec”);
                                ObfuscationReflectionHelper.setPrivateValue(Entity.class, entity1, teleportDirection, “teleportDirection”);

                                if (i == 1 && dimensionIn == 1)
                                               {
                                                   BlockPos blockpos1 = worldserver1.getTopSolidOrLiquidBlock(worldserver1.getSpawnPoint());
                                                   entity1.moveToBlockPosAndAngles(blockpos1, entity1.rotationYaw, entity1.rotationPitch);
                                               }
                                               else
                                               {
                                                   entity1.moveToBlockPosAndAngles(blockpos, entity1.rotationYaw, entity1.rotationPitch);
                                               }

                                boolean flag = entity1.forceSpawn;
                                               entity1.forceSpawn = true;
                                               worldserver1.spawnEntityInWorld(entity1);
                                               entity1.forceSpawn = flag;
                                               worldserver1.updateEntityWithOptionalForce(entity1, false);
                                           }
                                           else
                                           {
                                            System.out.println(“entity1 == null”);
                                           }

                                entity.isDead = true;
                                           entity.worldObj.theProfiler.endSection();
                                           worldserver.resetUpdateEntityTick();
                                           worldserver1.resetUpdateEntityTick();
                                           entity.worldObj.theProfiler.endSection();
                                           return entity1;
                                       }
                                       else
                                       {
                                           return null;
                                       }

                                [15:29:50] [Server thread/FATAL]: Error executing task
                                java.util.concurrent.ExecutionException: net.minecraft.util.ReportedException: Colliding entity with block
                                at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_92]
                                at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_92]
                                at net.minecraft.util.Util.runTask(Util.java:26) [Util.class:?]
                                at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:740) [MinecraftServer.class:?]
                                at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:685) [MinecraftServer.class:?]
                                at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:155) [IntegratedServer.class:?]
                                at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:534) [MinecraftServer.class:?]
                                at java.lang.Thread.run(Unknown Source) [?:1.8.0_92]
                                Caused by: net.minecraft.util.ReportedException: Colliding entity with block
                                at net.minecraft.entity.Entity.moveEntity(Entity.java:965) ~[Entity.class:?]
                                at net.minecraft.network.NetHandlerPlayServer.processPlayer(NetHandlerPlayServer.java:500) ~[NetHandlerPlayServer.class:?]
                                at net.minecraft.network.play.client.CPacketPlayer.processPacket(CPacketPlayer.java:36) ~[CPacketPlayer.class:?]
                                at net.minecraft.network.play.client.CPacketPlayer$Position.processPacket(CPacketPlayer.java:85) ~[CPacketPlayer$Position.class:?]
                                at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:15) ~[PacketThreadUtil$1.class:?]
                                at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_92]
                                at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_92]
                                at net.minecraft.util.Util.runTask(Util.java:25) ~[Util.class:?]
                                … 5 more
                                Caused by: java.lang.NullPointerException
                                at thisishalloween.block.BlockPortalFrightful.changeDimension(BlockPortalFrightful.java:331) ~[BlockPortalFrightful.class:?]
                                at thisishalloween.block.BlockPortalFrightful.onEntityCollidedWithBlock(BlockPortalFrightful.java:245) ~[BlockPortalFrightful.class:?]
                                at net.minecraft.entity.Entity.doBlockCollisions(Entity.java:1040) ~[Entity.class:?]
                                at net.minecraft.entity.Entity.moveEntity(Entity.java:958) ~[Entity.class:?]
                                at net.minecraft.network.NetHandlerPlayServer.processPlayer(NetHandlerPlayServer.java:500) ~[NetHandlerPlayServer.class:?]
                                at net.minecraft.network.play.client.CPacketPlayer.processPacket(CPacketPlayer.java:36) ~[CPacketPlayer.class:?]
                                at net.minecraft.network.play.client.CPacketPlayer$Position.processPacket(CPacketPlayer.java:85) ~[CPacketPlayer$Position.class:?]
                                at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:15) ~[PacketThreadUtil$1.class:?]
                                at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_92]
                                at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_92]
                                at net.minecraft.util.Util.runTask(Util.java:25) ~[Util.class:?]
                                … 5 more
                                [15:29:50] [Server thread/ERROR]: Encountered an unexpected exception
                                net.minecraft.util.ReportedException: Colliding entity with block
                                at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:210) ~[NetworkSystem.class:?]
                                at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:804) ~[MinecraftServer.class:?]
                                at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:685) ~[MinecraftServer.class:?]
                                at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:155) ~[IntegratedServer.class:?]
                                at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:534) [MinecraftServer.class:?]
                                at java.lang.Thread.run(Unknown Source) [?:1.8.0_92]
                                Caused by: java.lang.NullPointerException
                                at thisishalloween.block.BlockPortalFrightful.changeDimension(BlockPortalFrightful.java:331) ~[BlockPortalFrightful.class:?]
                                at thisishalloween.block.BlockPortalFrightful.onEntityCollidedWithBlock(BlockPortalFrightful.java:245) ~[BlockPortalFrightful.class:?]
                                at net.minecraft.entity.Entity.doBlockCollisions(Entity.java:1040) ~[Entity.class:?]
                                at net.minecraft.entity.Entity.moveEntity(Entity.java:958) ~[Entity.class:?]
                                at net.minecraft.entity.EntityLivingBase.moveEntityWithHeading(EntityLivingBase.java:1952) ~[EntityLivingBase.class:?]
                                at net.minecraft.entity.player.EntityPlayer.moveEntityWithHeading(EntityPlayer.java:1929) ~[EntityPlayer.class:?]
                                at net.minecraft.entity.EntityLivingBase.onLivingUpdate(EntityLivingBase.java:2382) ~[EntityLivingBase.class:?]
                                at net.minecraft.entity.player.EntityPlayer.onLivingUpdate(EntityPlayer.java:549) ~[EntityPlayer.class:?]
                                at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:2174) ~[EntityLivingBase.class:?]
                                at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:253) ~[EntityPlayer.class:?]
                                at net.minecraft.entity.player.EntityPlayerMP.onUpdateEntity(EntityPlayerMP.java:341) ~[EntityPlayerMP.class:?]
                                at net.minecraft.network.NetHandlerPlayServer.update(NetHandlerPlayServer.java:175) ~[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:308) ~[NetworkManager.class:?]
                                at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:195) ~[NetworkSystem.class:?]
                                … 5 more
                                [15:29:50] [Server thread/ERROR]: This crash report has been saved to: G:\Codage\Minecraft\This_is_Halloween\v1.3\MC 1.9.4\run.\crash-reports\crash-2016-08-24_15.29.50-server.txt
                                [15:29:50] [Server thread/INFO]: Stopping server
                                [15:29:50] [Server thread/INFO]: Saving players
                                [15:29:50] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:649]: –-- Minecraft Crash Report ----
                                // I let you down. Sorry 😞

                                Time: 24/08/16 15:29
                                Description: Colliding entity with block

                                java.lang.NullPointerException: Colliding entity with block
                                at thisishalloween.block.BlockPortalFrightful.changeDimension(BlockPortalFrightful.java:331)
                                at thisishalloween.block.BlockPortalFrightful.onEntityCollidedWithBlock(BlockPortalFrightful.java:245)
                                at net.minecraft.entity.Entity.doBlockCollisions(Entity.java:1040)
                                at net.minecraft.entity.Entity.moveEntity(Entity.java:958)
                                at net.minecraft.entity.EntityLivingBase.moveEntityWithHeading(EntityLivingBase.java:1952)
                                at net.minecraft.entity.player.EntityPlayer.moveEntityWithHeading(EntityPlayer.java:1929)
                                at net.minecraft.entity.EntityLivingBase.onLivingUpdate(EntityLivingBase.java:2382)
                                at net.minecraft.entity.player.EntityPlayer.onLivingUpdate(EntityPlayer.java:549)
                                at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:2174)
                                at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:253)
                                at net.minecraft.entity.player.EntityPlayerMP.onUpdateEntity(EntityPlayerMP.java:341)
                                at net.minecraft.network.NetHandlerPlayServer.update(NetHandlerPlayServer.java:175)
                                at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher$1.update(NetworkDispatcher.java:196)
                                at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:308)
                                at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:195)
                                at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:804)
                                at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:685)
                                at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:155)
                                at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:534)
                                at java.lang.Thread.run(Unknown Source)

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

                                – Head –
                                Thread: Client thread
                                Stacktrace:
                                at thisishalloween.block.BlockPortalFrightful.changeDimension(BlockPortalFrightful.java:331)
                                at thisishalloween.block.BlockPortalFrightful.onEntityCollidedWithBlock(BlockPortalFrightful.java:245)

                                – Block being collided with –
                                Details:
                                Block: this_is_halloween:PortalFrightful[axis=x]
                                Block location: World: (-1433,4,949), Chunk: (at 7,0,5 in -90,59; contains blocks -1440,0,944 to -1425,255,959), Region: (-3,1; contains chunks -96,32 to -65,63, blocks -1536,0,512 to -1025,255,1023)
                                Stacktrace:
                                at net.minecraft.entity.Entity.doBlockCollisions(Entity.java:1040)

                                – Entity being checked for collision –
                                Details:
                                Entity Type: null (net.minecraft.entity.player.EntityPlayerMP)
                                Entity ID: 31
                                Entity Name: Player222
                                Entity’s Exact location: -1432,19, 4,00, 948,83
                                Entity’s Block location: World: (-1433,4,948), Chunk: (at 7,0,4 in -90,59; contains blocks -1440,0,944 to -1425,255,959), Region: (-3,1; contains chunks -96,32 to -65,63, blocks -1536,0,512 to -1025,255,1023)
                                Entity’s Momentum: 0,00, 0,00, 0,00
                                Entity’s Passengers: []
                                Entity’s Vehicle: ERROR NullPointerException: null
                                Stacktrace:
                                at net.minecraft.entity.Entity.moveEntity(Entity.java:958)
                                at net.minecraft.entity.EntityLivingBase.moveEntityWithHeading(EntityLivingBase.java:1952)
                                at net.minecraft.entity.player.EntityPlayer.moveEntityWithHeading(EntityPlayer.java:1929)
                                at net.minecraft.entity.EntityLivingBase.onLivingUpdate(EntityLivingBase.java:2382)
                                at net.minecraft.entity.player.EntityPlayer.onLivingUpdate(EntityPlayer.java:549)
                                at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:2174)
                                at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:253)

                                – Player being ticked –
                                Details:
                                Entity Type: null (net.minecraft.entity.player.EntityPlayerMP)
                                Entity ID: 31
                                Entity Name: Player222
                                Entity’s Exact location: -1432,19, 4,00, 948,83
                                Entity’s Block location: World: (-1433,4,948), Chunk: (at 7,0,4 in -90,59; contains blocks -1440,0,944 to -1425,255,959), Region: (-3,1; contains chunks -96,32 to -65,63, blocks -1536,0,512 to -1025,255,1023)
                                Entity’s Momentum: 0,00, 0,00, 0,00
                                Entity’s Passengers: []
                                Entity’s Vehicle: ERROR NullPointerException: null
                                Stacktrace:
                                at net.minecraft.entity.player.EntityPlayerMP.onUpdateEntity(EntityPlayerMP.java:341)
                                at net.minecraft.network.NetHandlerPlayServer.update(NetHandlerPlayServer.java:175)
                                at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher$1.update(NetworkDispatcher.java:196)
                                at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:308)

                                – Ticking connection –
                                Details:
                                Connection: net.minecraft.network.NetworkManager@bc70390
                                Stacktrace:
                                at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:195)
                                at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:804)
                                at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:685)
                                at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:155)
                                at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:534)
                                at java.lang.Thread.run(Unknown Source)

                                – System Details –
                                Details:
                                Minecraft Version: 1.9.4
                                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: 673332264 bytes (642 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.28 Powered by Forge 12.17.0.1976 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.4-12.17.0.1976.jar)
                                UCHIJAAAA Forge{12.17.0.1976} [Minecraft Forge] (forgeSrc-1.9.4-12.17.0.1976.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: 1 / 8; [EntityPlayerMP[‘Player222’/31, l=‘New World’, x=-1432,19, y=4,00, z=948,83]]
                                Type: Integrated Server (map_client.txt)
                                Is Modded: Definitely; Client brand changed to ‘fml,forge’
                                [15:29:50] [Client thread/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:649]: #@!@# Game crashed! Crash report saved to: #@!@# .\crash-reports\crash-2016-08-24_15.29.50-server.txt
                                [15:29:50] [Client thread/INFO] [FML]: Waiting for the server to terminate/save.
                                [15:29:50] [Server thread/INFO]: Saving worlds
                                [15:29:50] [Server thread/INFO]: Saving chunks for level ‘New World’/Overworld
                                [15:29:50] [Server thread/INFO]: Saving chunks for level ‘New World’/Nether
                                [15:29:50] [Server thread/INFO]: Saving chunks for level ‘New World’/The End
                                [15:29:50] [Server thread/INFO]: Saving chunks for level ‘New World’/Frightful
                                [15:29:50] [Server thread/INFO] [FML]: Unloading dimension 0
                                [15:29:50] [Server thread/INFO] [FML]: Unloading dimension -1
                                [15:29:50] [Server thread/INFO] [FML]: Unloading dimension 1
                                [15:29:50] [Server thread/INFO] [FML]: Unloading dimension -5
                                [15:29:50] [Server thread/INFO] [FML]: Applying holder lookups
                                [15:29:50] [Server thread/INFO] [FML]: Holder lookups applied
                                [15:29:50] [Server thread/INFO] [FML]: The state engine was in incorrect state SERVER_STOPPING and forced into state SERVER_STOPPED. Errors may have been discarded.
                                [15:29:50] [Client thread/INFO] [FML]: Server terminated.
                                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

                                (c'est normal que ça crash, vu que entity1 est null ça veut redéfinir une variable par un null)
                                Celui-ci pointe vers ```java
                                entity.timeUntilPortal = entity1.timeUntilPortal;
                                ```(pour ceux qui n'aurait pas lu depuis le début du topic et qui ne comprennent pas pourquoi j'ai mis cette ligne et les 3 ReflectionHelper du dessous, c'est que la fonction copyDataFromOld doit être appelé, mais elle est privée.)
                                
                                Merci d'avance
                                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

                                  at thisishalloween.block.BlockPortalFrightful.changeDimension(BlockPortalFrightful.java:331) ~[BlockPortalFrightful.class:?]
                                  C’est laquelle la ligne 331 ?

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

                                    C’est la ligne que j’ai doné au-dessus, ```java
                                    entity.timeUntilPortal = entity1.timeUntilPortal;

                                    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

                                      Comment est-ce possible ? entity1 ne peut pas être null comme il y a un null check, et si entity est null il y aura eu un NPE avant.

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

                                        Justement, j’ai inverse le null check, j’ai fait que si entity1 est null, alors ça fait …
                                        Je savais que ça marcherais pas, c’était juste pour être sûr.
                                        Mais je comprend pas pourquoi il est null

                                        entity1 est défini par : ```java
                                                   Entity entity1 = EntityList.createEntityByName(EntityList.getEntityString(entity), worldserver1);

                                        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

                                          faut voir ce que fais la fonction createEntityByName

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

                                            D’après ce que j’en ai compris, au départ ça créer une variable de type Entity qui est null. Ensuite, ça essaye de récupérer la classe du String inséré en paramètre. Si la classe n’est pas null (autrement dit, si elle existe ?), ça get un constructeur et ça créer une nouvelle instance.

                                            Je suis pas sûr, mais pour moi ça fait ça. Voilà la fonction : ```java
                                            @Nullable
                                            public static Entity createEntityByName(String entityName, World worldIn)
                                            {
                                            Entity entity = null;

                                            try
                                            {
                                            Class oclass = (Class)NAME_TO_CLASS.get(entityName);

                                            if (oclass != null)
                                            {
                                            entity = (Entity)oclass.getConstructor(new Class[] {World.class}).newInstance(new Object[] {worldIn});
                                            }
                                            }
                                            catch (Exception exception)
                                            {
                                            exception.printStackTrace();
                                            }

                                            return entity;
                                            }

                                            
                                            Si j'ai raison au-dessus, je pense que ça n'arrive pas à récuprer la classe.
                                            1 réponse Dernière réponse Répondre Citer 0
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 1 / 4
                                            • Premier message
                                              Dernier message
                                            Design by Woryk
                                            ContactMentions Légales

                                            MINECRAFT FORGE FRANCE © 2024

                                            Powered by NodeBB