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.
    • 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
              • AymericRedA Hors-ligne
                AymericRed
                dernière édition par

                Car il me semble que cette fonction est faite pour les entités, mais pas pour les joueurs.

                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 le portal de base utilisé aussi cette fonction. Un joueur est avant tout une entité, non ?

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

                    Le portail de base utilise cette fonction pour les entitées, mais regarde bien, pour les joueurs c’est une autre fonction que “changeDimension” qui est appelée.

                    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, ça utilise bien la fonction changeDimension.
                      Dans le blockPortl, ça appelle cette fonction : ```java
                      public void setPortal(BlockPos pos)
                         {
                             if (this.timeUntilPortal > 0)
                             {
                                 this.timeUntilPortal = this.getPortalCooldown();
                             }
                             else
                             {
                                 if (!this.worldObj.isRemote && !pos.equals(this.lastPortalPos))
                                 {
                                     this.lastPortalPos = new BlockPos(pos);
                                     BlockPattern.PatternHelper blockpattern$patternhelper = Blocks.PORTAL.createPatternHelper(this.worldObj, this.lastPortalPos);
                                     double d0 = blockpattern$patternhelper.getForwards().getAxis() == EnumFacing.Axis.X ? (double)blockpattern$patternhelper.getFrontTopLeft().getZ() : (double)blockpattern$patternhelper.getFrontTopLeft().getX();
                                     double d1 = blockpattern$patternhelper.getForwards().getAxis() == EnumFacing.Axis.X ? this.posZ : this.posX;
                                     d1 = Math.abs(MathHelper.pct(d1 - (double)(blockpattern$patternhelper.getForwards().rotateY().getAxisDirection() == EnumFacing.AxisDirection.NEGATIVE ? 1 : 0), d0, d0 - (double)blockpattern$patternhelper.getWidth()));
                                     double d2 = MathHelper.pct(this.posY - 1.0D, (double)blockpattern$patternhelper.getFrontTopLeft().getY(), (double)(blockpattern$patternhelper.getFrontTopLeft().getY() - blockpattern$patternhelper.getHeight()));
                                     this.lastPortalVec = new Vec3d(d1, d2, 0.0D);
                                     this.teleportDirection = blockpattern$patternhelper.getForwards();
                                 }

                      this.inPortal = true;
                             }
                         }

                      Ici, ```java
                      public void onEntityUpdate()
                         {
                             this.worldObj.theProfiler.startSection("entityBaseTick");
                      
                             if (this.isRiding() && this.getRidingEntity().isDead)
                             {
                                 this.dismountRidingEntity();
                             }
                      
                             if (this.rideCooldown > 0)
                             {
                                 –this.rideCooldown;
                             }
                      
                             this.prevDistanceWalkedModified = this.distanceWalkedModified;
                             this.prevPosX = this.posX;
                             this.prevPosY = this.posY;
                             this.prevPosZ = this.posZ;
                             this.prevRotationPitch = this.rotationPitch;
                             this.prevRotationYaw = this.rotationYaw;
                      
                             if (!this.worldObj.isRemote && this.worldObj instanceof WorldServer)
                             {
                                 this.worldObj.theProfiler.startSection("portal");
                      
                                 if (this.inPortal)
                                 {
                                     MinecraftServer minecraftserver = this.worldObj.getMinecraftServer();
                      
                                     if (minecraftserver.getAllowNether())
                                     {
                                         if (!this.isRiding())
                                         {
                                             int i = this.getMaxInPortalTime();
                      
                                             if (this.portalCounter++ >= i)
                                             {
                                                 this.portalCounter = i;
                                                 this.timeUntilPortal = this.getPortalCooldown();
                                                 int j;
                      
                                                 if (this.worldObj.provider.getDimensionType().getId() == -1)
                                                 {
                                                     j = 0;
                                                 }
                                                 else
                                                 {
                                                     j = -1;
                                                 }
                      
                                                 this.changeDimension(j);
                                             }
                                         }
                      
                                         this.inPortal = false;
                                     }
                                 }
                                 else
                                 {
                                     if (this.portalCounter > 0)
                                     {
                                         this.portalCounter -= 4;
                                     }
                      
                                     if (this.portalCounter < 0)
                                     {
                                         this.portalCounter = 0;
                                     }
                                 }
                      
                                 this.decrementTimeUntilPortal();
                                 this.worldObj.theProfiler.endSection();
                             }...
                      ```(je l'ai coupé car trop longue et le reste pas intéréssant) ça utilise bien la fonction changeDimension
                      1 réponse Dernière réponse Répondre Citer 0
                      • AymericRedA Hors-ligne
                        AymericRed
                        dernière édition par

                        Ah autant pour moi, ça a du changer dans ta version, ou alors, le EntityPlayer (ou EntityPlayerMP) gère à sa façon le isInPortal.

                        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

                          J’ai regarder, mais je trouve rien d’autre qui gère le inPortal.

                          Mais c’est quand même bizarre que quand j’utilise la fonction changeDimension d’origine, ça marche bien suelement si je vais dans l’End (je comprend pas pourquoi les autres dimensions bug). La mienne est une pure copie et bug.

                          Pour le entity1 qui est null, j’ai pu trouver pourquoi. En fait, j’ai décomposé chaque étape et affiché dans les lgos :

                          System.out.println("getEntityString : " + EntityList.getEntityString(entity));
                                     System.out.println("getEntityStringFromClass : " + getEntityStringFromClass(Entity.class));
                                     System.out.println("createEntityByName : " + EntityList.createEntityByName(EntityList.getEntityStringFromClass(Entity.class), worldserver1));
                          

                          (je suis d’accord avec vous, le 1er et le 2ème reviennent au même)
                          En gros, si ler 1er (ou le 2ème, c’est pareil) est null, le 3ème sera forcément null (à cause du 1er (ou du 2ème)). Et bah ça se confirme : le 1er et le 2ème sont bien null.
                          C’est cette fonction qui bug : ```java
                             public static String getEntityStringFromClass(Class entityClass)
                             {
                                 return (String)CLASS_TO_NAME.get(entityClass);
                             }

                          
                          Pourtant avant j'utilisais simplement ```java
                          mcServer.getPlayerList().transferPlayerToDimension(player, -1, new Teleporter(mcServer.worldServerForDimension(-1)));
                          ``` Je vois pas pourquoi elle bug maintenant
                          1 réponse Dernière réponse Répondre Citer 0
                          • SCAREXS Hors-ligne
                            SCAREX
                            dernière édition par

                            Tu utilises l’id -1 pour ta dimension ?

                            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

                              Non, ma dimension c’est -5. Mais j’ai mis -1 pour que ça m’emmène vers le Nether, pour être sûr que c’est pas ma dimension qui bug

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

                                Salut
                                Je reviens après très longtemps (quand même 3 semaines). J’étais pas mal occupée par le lycée.
                                (Je ne sais pas si vous vous souvenez toujours du problème, je vais vous l’énoncer :
                                :::
                                Pour faire court, avant j’utilisais une fonction (transferPlayerToDimension) pour me tp à ma dimension custom. Mais depuis la 1.9.4 (pareil en 1.10), ça crash quand j’entre dans le portail. Le voici :

                                [18:27:16] [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 net.minecraft.world.Teleporter.placeInExistingPortal(Teleporter.java:134) ~[Teleporter.class:?]
                                at net.minecraft.world.Teleporter.placeInPortal(Teleporter.java:38) ~[Teleporter.class:?]
                                at net.minecraft.server.management.PlayerList.transferEntityToWorld(PlayerList.java:734) ~[PlayerList.class:?]
                                at net.minecraft.server.management.PlayerList.transferPlayerToDimension(PlayerList.java:641) ~[PlayerList.class:?]
                                at thisishalloween.block.BlockPortalFrightful.onEntityCollidedWithBlock(BlockPortalFrightful.java:244) ~[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
                                [18:27:16] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 4445ms behind, skipping 88 tick(s)
                                [18:27:17] [Server thread/INFO] [FML]: Unloading dimension -5
                                

                                J’avais ensuite essayer avec le Nether et le teleporter de base mais pareil.
                                J’ai testé plein de trucs avec l’aide de plusieurs membres, mais toujours rien. Voilà au point où on en est
                                :::
                                Bref, j’ai remis l’ancienne fonction (transferPlayerToDimension, celle qui marche pour tout le monde sauf pour moi 😢 ) en modifiant des trucs, toujours rien. Même quand j’essaye d’y accéder depuis le Nether. J’ai pensé que c’étais ma version de Forge qui buguait et ai voulu télécharger la recommandé, mais c’est celle là que j’ai.
                                Le crash m’indique cette ligne : ```java
                                           d6 = (double)(blockpattern$patternhelper.getFrontTopLeft().getY() + 1) - entityIn.getLastPortalVec().yCoord * (double)blockpattern$patternhelper.getHeight();

                                Il y a une NPE dans le crash. J'avais donc pensé voir le crash-report en pensant que y'aurai plus d'info, mais il n'existe pas. Et c'est normal, Minecraft ne crash pas (il se fige juste mais ne s'éteint pas). Du coup, j'avais pensé à faire crasher Minecraft au moment du tp histoire de voir ce qu'il y aura dans le crash-report, peut-être une chance de nous aider.
                                
                                En gros, on est au même point qu'avant :/
                                
                                Merci d'avance
                                1 réponse Dernière réponse Répondre Citer 0
                                • AxaurusA Hors-ligne
                                  Axaurus
                                  dernière édition par

                                  Salut
                                  J’ai testé 3 trucs mais rien n’a marché.
                                  J’ai testé de recréer un nouveau projet et ne mettre que le blockPortal (en plus des proxy et de l’activateur) et de testé en pensant que c’est un truc qui corrompt le teleporter, mais c’est pareil ça ne marche pas.
                                  J’ai ensuite testé de build le mod en pensant que c’est Eclipse qui fait bug mais pareil, ça ne marche pas.
                                  J’ai, pour finir, testé d’utiliser mon teleporter, mais rien de plus (là, j’étais pratiquement sûr que ça ne marchait pas vu que c’est une copie du teleporter de base).
                                  Je suis vraiment désespéré. Je continue tout de même de chercher.
                                  Si vous avez une idée, je suis preneur.
                                  Merci d’avance

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

                                    Si tu n’arrives pas à build le mod c’est qu’il y a un problème dans le code : fait un refresh du workspace dans eclipse et regarde l’onglet problème, si rien ne s’affiche regarde les logs du build.
                                    Pour ce qui est du crash ce n’est pas normal que ce soit le téléporteur de minecraft qui soit utilisé

                                    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

                                      J’ai dû mal expliqué. J’ai réussi à build et à tester dans Minecraft. C’est dans Minecraft que ça freeze pareil que dans éclipse. (J’ai testé ça en pensant que c’est Ec’ipse qui faisait buguer)
                                      C’est tout à fait normal que ça utilise le teleporter de base, j’ai fait en sorte que ça l’utilise le temps de reparer (et je remettrai le mien ensuite)

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

                                        Si minecraft freeze et que tu n’as pas de rapport de crash ni rien c’est soit que tu utilises trop de puissance (boucle infinie lente, ou algorithme trop gourmand), soit qu’il faut investir dans un pc

                                        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
                                          Je n’ai pas de crash à proprement dit : j’ai une erreur dans la console, mais Minecraft ne s’éteint pas et je n’ai pas de crash-report, juste l’erreur dans la console. J’ai peut-être une mauvaise définition de crash

                                          Sinon, j’ai essayé de mettre le transfer dans une commande, mais quand je la fait, c’est la même erreur.
                                          J’ai essayé de “refaire” la classe du blockPortal en réduisant : ```java
                                          package thisishalloween.block;

                                          import java.util.Map;
                                          import java.util.Random;

                                          import javax.annotation.Nullable;

                                          import com.google.common.cache.LoadingCache;
                                          import com.google.common.collect.Maps;

                                          import net.minecraft.block.Block;
                                          import net.minecraft.block.BlockBreakable;
                                          import net.minecraft.block.BlockPortal;
                                          import net.minecraft.block.SoundType;
                                          import net.minecraft.block.material.Material;
                                          import net.minecraft.block.properties.IProperty;
                                          import net.minecraft.block.properties.PropertyEnum;
                                          import net.minecraft.block.state.BlockStateContainer;
                                          import net.minecraft.block.state.BlockWorldState;
                                          import net.minecraft.block.state.IBlockState;
                                          import net.minecraft.block.state.pattern.BlockPattern;
                                          import net.minecraft.entity.Entity;
                                          import net.minecraft.entity.EntityList;
                                          import net.minecraft.entity.monster.EntityPigZombie;
                                          import net.minecraft.entity.player.EntityPlayer;
                                          import net.minecraft.entity.player.EntityPlayerMP;
                                          import net.minecraft.init.Blocks;
                                          import net.minecraft.init.SoundEvents;
                                          import net.minecraft.item.ItemMonsterPlacer;
                                          import net.minecraft.item.ItemStack;
                                          import net.minecraft.server.MinecraftServer;
                                          import net.minecraft.util.BlockRenderLayer;
                                          import net.minecraft.util.EnumFacing;
                                          import net.minecraft.util.EnumParticleTypes;
                                          import net.minecraft.util.Rotation;
                                          import net.minecraft.util.SoundCategory;
                                          import net.minecraft.util.math.AxisAlignedBB;
                                          import net.minecraft.util.math.BlockPos;
                                          import net.minecraft.util.math.MathHelper;
                                          import net.minecraft.util.math.Vec3d;
                                          import net.minecraft.world.IBlockAccess;
                                          import net.minecraft.world.Teleporter;
                                          import net.minecraft.world.World;
                                          import net.minecraft.world.WorldServer;
                                          import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
                                          import net.minecraftforge.fml.relauncher.Side;
                                          import net.minecraftforge.fml.relauncher.SideOnly;
                                          import thisishalloween.CreateBlocks;
                                          import thisishalloween.ThisisHalloween;
                                          import thisishalloween.world.frightful.TeleporterFrightful;

                                          public class BlockPortalFrightful extends BlockPortal
                                          {
                                          public static final PropertyEnum <enumfacing.axis>AXIS = PropertyEnum.<enumfacing.axis>create(“axis”, EnumFacing.Axis.class, new EnumFacing.Axis[] {EnumFacing.Axis.X, EnumFacing.Axis.Z});
                                          protected static final AxisAlignedBB field_185683_b = new AxisAlignedBB(0.0D, 0.0D, 0.375D, 1.0D, 1.0D, 0.625D);
                                          protected static final AxisAlignedBB field_185684_c = new AxisAlignedBB(0.375D, 0.0D, 0.0D, 0.625D, 1.0D, 1.0D);
                                          protected static final AxisAlignedBB field_185685_d = new AxisAlignedBB(0.375D, 0.0D, 0.375D, 0.625D, 1.0D, 0.625D);

                                          public BlockPortalFrightful()
                                          {
                                          setTickRandomly(false);
                                          setBlockUnbreakable();
                                          isCollidable();
                                          }

                                          public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
                                          {

                                          }

                                          public boolean trySpawnPortal(World worldIn, BlockPos pos)
                                          {
                                          BlockPortalFrightful.Size blockportal$size = new BlockPortalFrightful.Size(worldIn, pos, EnumFacing.Axis.X);

                                          if (blockportal$size.isValid() && blockportal$size.portalBlockCount == 0)
                                          {
                                          blockportal$size.placePortalBlocks();
                                          return true;
                                          }

                                          BlockPortalFrightful.Size blockportal$size1 = new BlockPortalFrightful.Size(worldIn, pos, EnumFacing.Axis.Z);

                                          if (blockportal$size1.isValid() && blockportal$size1.portalBlockCount == 0)
                                          {
                                          blockportal$size1.placePortalBlocks();
                                          return true;
                                          }
                                          return false;
                                          }

                                          public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn)
                                          {
                                          EnumFacing.Axis axis = (EnumFacing.Axis)state.getValue(AXIS);

                                          if (axis == EnumFacing.Axis.X)
                                          {
                                          BlockPortalFrightful.Size size = new BlockPortalFrightful.Size(worldIn, pos, EnumFacing.Axis.X);

                                          if (!size.isValid() || size.portalBlockCount < size.width * size.height)
                                          {
                                          if(ThisisHalloween.portal)
                                          {
                                          worldIn.setBlockState(pos, Blocks.AIR.getDefaultState());
                                          }
                                          }
                                          }
                                          else if (axis == EnumFacing.Axis.Z)
                                          {
                                          BlockPortalFrightful.Size size = new BlockPortalFrightful.Size(worldIn, pos, EnumFacing.Axis.Z);

                                          if (!size.isValid() || size.portalBlockCount < size.width * size.height)
                                          {
                                          if(ThisisHalloween.portal)
                                          {
                                          worldIn.setBlockState(pos, Blocks.AIR.getDefaultState());
                                          }
                                          }
                                          }
                                          }

                                          @Override
                                          public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn)
                                          {
                                          if ((entityIn.getRidingEntity() == null) && (!entityIn.isDead))
                                          {
                                          if(entityIn instanceof EntityPlayerMP)
                                          {
                                          EntityPlayerMP player = (EntityPlayerMP) entityIn;
                                          if(entityIn.isEntityAlive())
                                          {
                                          if (player.dimension != -1)
                                          {
                                          // ThisisHalloween.portal = false;
                                          // player.timeUntilPortal = 100;
                                          player.mcServer.getPlayerList().transferPlayerToDimension(player, -1, new Teleporter(player.mcServer.worldServerForDimension(-1)));
                                          // player.timeUntilPortal = 100;
                                          // ThisisHalloween.portal = true;
                                          }
                                          else
                                          {
                                          player.mcServer.getPlayerList().transferPlayerToDimension(player, 0, new Teleporter(player.mcServer.worldServerForDimension(0)));
                                          // player.timeUntilPortal = 100;
                                          }
                                          }
                                          }
                                          }
                                          }

                                          @SideOnly(Side.CLIENT)
                                          public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand)
                                          {

                                          }

                                          protected BlockStateContainer createBlockState()
                                          {
                                          return new BlockStateContainer(this, new IProperty[] {AXIS});
                                          }

                                          public static class Size
                                          {
                                          private final World world;
                                          private final EnumFacing.Axis axis;
                                          private final EnumFacing rightDir;
                                          private final EnumFacing leftDir;
                                          private int portalBlockCount = 0;
                                          private BlockPos bottomLeft;
                                          private int height;
                                          private int width;

                                          public Size(World worldIn, BlockPos p_i45694_2_, EnumFacing.Axis p_i45694_3_)
                                          {
                                          this.world = worldIn;
                                          this.axis = p_i45694_3_;

                                          if (p_i45694_3_ == EnumFacing.Axis.X)
                                          {
                                          this.leftDir = EnumFacing.EAST;
                                          this.rightDir = EnumFacing.WEST;
                                          }
                                          else
                                          {
                                          this.leftDir = EnumFacing.NORTH;
                                          this.rightDir = EnumFacing.SOUTH;
                                          }

                                          for (BlockPos blockpos = p_i45694_2_; p_i45694_2_.getY() > blockpos.getY() - 21 && p_i45694_2_.getY() > 0 && (isEmptyBlock(worldIn.getBlockState(p_i45694_2_.down()), p_i45694_2_.down())); p_i45694_2_ = p_i45694_2_.down())
                                          {

                                          }

                                          int i = this.getDistanceUntilEdge(p_i45694_2_, this.leftDir) - 1;

                                          if (i >= 0)
                                          {
                                          this.bottomLeft = p_i45694_2_.offset(this.leftDir, i);
                                          this.width = this.getDistanceUntilEdge(this.bottomLeft, this.rightDir);

                                          if (this.width < 1 || this.width > 21)
                                          {
                                          this.bottomLeft = null;
                                          this.width = 0;
                                          }
                                          }

                                          if (this.bottomLeft != null)
                                          {
                                          this.height = this.calculatePortalHeight();
                                          }
                                          }

                                          protected int getDistanceUntilEdge(BlockPos p_180120_1_, EnumFacing p_180120_2_)
                                          {
                                          int i = 0;
                                          if(i < 22){i++;}

                                          BlockPos blockpos = p_180120_1_.offset(p_180120_2_, i);

                                          if (!this.isEmptyBlock(this.world.getBlockState(blockpos), blockpos) || this.world.getBlockState(blockpos.down()).getBlock() != Blocks.NETHER_BRICK)
                                          {

                                          }

                                          Block block = this.world.getBlockState(p_180120_1_.offset(p_180120_2_, i)).getBlock();
                                          return block == Blocks.NETHER_BRICK ? i : 0;
                                          }

                                          public int getHeight()
                                          {
                                          return this.height;
                                          }

                                          public int getWidth()
                                          {
                                          return this.width;
                                          }

                                          protected int calculatePortalHeight()
                                          {
                                          label190:
                                          for (this.height = 0; this.height < 21; this.height += 1)
                                          {
                                          for (int i = 0; i < this.width; ++i)
                                          {
                                          BlockPos blockpos = this.bottomLeft.offset(this.rightDir, i).up(this.height);
                                          IBlockState state = this.world.getBlockState(blockpos);
                                          Block block = state.getBlock();

                                          if (!this.isEmptyBlock(state, blockpos))
                                          {
                                          break label190;
                                          }

                                          if (block == CreateBlocks.portalFrightful)
                                          {
                                          this.portalBlockCount += 1;
                                          }

                                          if (i == 0)
                                          {
                                          block = this.world.getBlockState(blockpos.offset(this.leftDir)).getBlock();

                                          if (block != Blocks.NETHER_BRICK)
                                          {
                                          break label190;
                                          }
                                          }
                                          else if (i == this.width - 1)
                                          {
                                          block = this.world.getBlockState(blockpos.offset(this.rightDir)).getBlock();

                                          if (block != Blocks.NETHER_BRICK)
                                          {
                                          break label190;
                                          }
                                          }
                                          }
                                          }

                                          for (int j = 0; j < this.width; ++j)
                                          {
                                          if (this.world.getBlockState(this.bottomLeft.offset(this.rightDir, j).up(this.height)).getBlock() != Blocks.NETHER_BRICK)
                                          {
                                          this.height = 0;
                                          break;
                                          }
                                          }

                                          if ((this.height <= 21) && (this.height >= 2))
                                          {
                                          return this.height;
                                          }

                                          this.bottomLeft = null;
                                          this.width = 0;
                                          this.height = 0;
                                          return 0;
                                          }

                                          protected boolean isEmptyBlock(IBlockState blockIn, BlockPos pos)
                                          {
                                          return (blockIn.getBlock().isAir(blockIn, world, pos)) || (blockIn.getBlock() == CreateBlocks.portalFrightful);
                                          }

                                          public boolean isValid()
                                          {
                                          return (this.bottomLeft != null) && (this.width >= 1) && (this.width <= 21) && (this.height >= 2) && (this.height <= 21);
                                          }

                                          public void placePortalBlocks()
                                          {
                                          for (int i = 0; i < this.width; ++i)
                                          {
                                          BlockPos blockpos = this.bottomLeft.offset(this.rightDir, i);

                                          for (int j = 0; j < this.height; ++j)
                                          {
                                          this.world.setBlockState(blockpos.up(j), CreateBlocks.portalFrightful.getDefaultState().withProperty(BlockPortalFrightful.AXIS, this.axis), 2);
                                          }
                                          }
                                          }
                                          }
                                          }

                                          déjà, je comprend pas pourquoi dans l'erreur, y'a un NPE. Pourtant, rien n'est null.
                                          
                                          PS : Voilà l'erreur pour ceux qui n'ont pas lu les messages au-dessus :
                                          

                                          Caused by: java.lang.NullPointerException
                                          at net.minecraft.world.Teleporter.placeInExistingPortal(Teleporter.java:134) ~[Teleporter.class:?]
                                          at net.minecraft.world.Teleporter.placeInPortal(Teleporter.java:38) ~[Teleporter.class:?]
                                          at net.minecraft.server.management.PlayerList.transferEntityToWorld(PlayerList.java:734) ~[PlayerList.class:?]
                                          at net.minecraft.server.management.PlayerList.transferPlayerToDimension(PlayerList.java:641) ~[PlayerList.class:?]
                                          at thisishalloween.block.BlockPortalFrightful.onEntityCollidedWithBlock(BlockPortalFrightful.java:137) ~[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$PositionRotation.processPacket(CPacketPlayer.java:125) ~[CPacketPlayer$PositionRotation.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

                                          
                                          EDIT : J'ai enfin réussi à faire crash le jeu (oui je sais, un mec qui fait crash un jeu est content -_- ). Bref, j'ai utilisé la fonction transferEntityToWorld, en voulant toujours me téléporter vers le Nether et en utilisant le teleporter de base. Dans le crash-report, 2 chose m'ont interpellé :
                                          

                                          Entity Type: null (net.minecraft.entity.player.EntityPlayerMP)
                                          Entity’s Vehicle: ERROR NullPointerException: null

                                          Est-ce normal que le type de l'entité soit null et en même temps EntityPlayerMP (c'est ce que j'en ai compris) ?
                                          Sur le véhicule, ça dit erreur NPE. Ce qui est bizarre, c'est que ça tp seulement si le joueur n'est pas monté ou n'est pas en train de monté.
                                          
                                          Voilà le code :
                                          ```java
                                          if ((entityIn.getRidingEntity() == null) && (!entityIn.isDead) && (!entityIn.isBeingRidden()) && (!entityIn.isRiding()))
                                          {
                                          if(entityIn instanceof EntityPlayerMP)
                                          {
                                          EntityPlayerMP player = (EntityPlayerMP) entityIn;
                                          if(entityIn.isEntityAlive())
                                          {
                                          if (player.dimension != -1)
                                          {
                                          // ThisisHalloween.portal = false;
                                          // player.timeUntilPortal = 100;
                                          //player.mcServer.getPlayerList().transferPlayerToDimension(player, -1, new Teleporter(player.mcServer.worldServerForDimension(-1)));
                                          player.mcServer.getPlayerList().transferEntityToWorld(player, -1, player.mcServer.worldServerForDimension(0), player.mcServer.worldServerForDimension(-1), new Teleporter(player.mcServer.worldServerForDimension(-1)));
                                          // player.timeUntilPortal = 100;
                                          // ThisisHalloween.portal = true;
                                          }
                                          else
                                          {
                                          // player.mcServer.getPlayerList().transferPlayerToDimension(player, 0, new Teleporter(player.mcServer.worldServerForDimension(0)));
                                          // player.timeUntilPortal = 100;
                                          }
                                          }
                                          }
                                          }
                                          

                                          Merci d’avance

                                          EDIT n°2 : Je vous met quand même le crash-report : ```
                                          ---- Minecraft Crash Report ----
                                          // Don’t be sad, have a hug! ❤

                                          Time: 24/09/16 23:56
                                          Description: Colliding entity with block

                                          java.lang.NullPointerException: Colliding entity with block

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

                                          – Head –
                                          Thread: Server thread
                                          Stacktrace:
                                          at net.minecraft.entity.Entity.doBlockCollisions(Entity.java:1045)

                                          – Block being collided with –
                                          Details:
                                          Block: this_is_halloween:PortalFrightful[axis=x]
                                          Block location: World: (-575,4,-1163), Chunk: (at 1,0,5 in -36,-73; contains blocks -576,0,-1168 to -561,255,-1153), Region: (-2,-3; contains chunks -64,-96 to -33,-65, blocks -1024,0,-1536 to -513,255,-1025)
                                          Stacktrace:
                                          at net.minecraft.entity.Entity.doBlockCollisions(Entity.java:1045)
                                          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:1921)
                                          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)

                                          – Entity being checked for collision –
                                          Details:
                                          Entity Type: null (net.minecraft.entity.player.EntityPlayerMP)
                                          Entity ID: 49
                                          Entity Name: Player732
                                          Entity’s Exact location: -71,00, 4,25, -145,00
                                          Entity’s Block location: World: (-71,4,-145), Chunk: (at 9,0,15 in -5,-10; contains blocks -80,0,-160 to -65,255,-145), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)
                                          Entity’s Momentum: 0,00, 0,00, 0,00
                                          Entity’s Passengers: []
                                          Entity’s Vehicle: ERROR NullPointerException: null

                                          – Player being ticked –
                                          Details:
                                          Entity Type: null (net.minecraft.entity.player.EntityPlayerMP)
                                          Entity ID: 49
                                          Entity Name: Player732
                                          Entity’s Exact location: -71,00, 4,25, -145,00
                                          Entity’s Block location: World: (-71,4,-145), Chunk: (at 9,0,15 in -5,-10; contains blocks -80,0,-160 to -65,255,-145), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)
                                          Entity’s Momentum: 0,00, 0,00, 0,00
                                          Entity’s Passengers: []
                                          Entity’s Vehicle: ERROR NullPointerException: null

                                          – Ticking connection –
                                          Details:
                                          Connection: net.minecraft.network.NetworkManager@3b2dafa7

                                          – 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: 471250968 bytes (449 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[‘Player732’/49, l=‘New World’, x=-71,00, y=4,25, z=-145,00]]
                                          Type: Integrated Server (map_client.txt)
                                          Is Modded: Definitely; Client brand changed to ‘fml,forge’

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

                                            Le joueur ne doit pas être transféré correctement je pense

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

                                            MINECRAFT FORGE FRANCE © 2024

                                            Powered by NodeBB