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

    Résolu Blocks de portail

    1.7.x
    1.7.x
    4
    23
    4434
    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.
    • bin4r1s
      bin4r1s dernière édition par robin4002

      Bonjour/Bonsoir, voilà :
      J’ai créé une dimension avec un portail.
      Seul problème : le portail ne marche qu’avec des blocs vanilla (je dois faire appel à eux par la classe Blocks) et je ne peux pas utiliser les blocs de mon mod (dont la classe hérite de Block.java). Alors je voulais savoir pourquoi.
      Un peu d’aide :huh: ?

      Mes mods:

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

        Heu ? Envoie ton code ?

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

          Au lien de mettre Blocks.portals essaie de mettre leNomDeTonMod.leNomDeTonBloc

          au pire si tu ne comprends file nous ton code je pourrais te le redonner corrigé 😉

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

            Bon moi je vais vite finir mon tuto xD.

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

              @Julot10085 : Je parle de la structure du portail et non des blocs nommés ‘portal’.

              @robin4002 : Je ne suis sûr que du code soit nécessaire c’est de la théorie.

              Mes mods:

              • New Ores
              • More Dragons
              1 réponse Dernière réponse Répondre Citer 0
              • Deleted
                Deleted dernière édition par

                @‘MrBlockTNT’:

                @Julot10085 : Je parle de la structure du portail et non des blocs nommés ‘portal’.

                @robin4002 : Je ne suis sûr que du code soit nécessaire c’est de la théorie.

                Je prenais le block portals comme exemple, dans ma tête je pensais au bloc constituant le portail tel que l’obsidienne désolé je suis allé trop vite. Mais enfin tu peux remplacer le block constituant le portail par te tien autrement c’est pas possible

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

                  Si justement j’ai besoin de tes codes pour voir ce que tu as fait et donc conclure pourquoi ça ne fonctionne pas avec un bloc custom …

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

                    Apparemment il semble que ça marche avec des blocs (de mon mod) possédant une classe dédiée (type BlockGrass).

                    L’erreur doit être dans cette classe (le système du drop est une expérience) :
                    BlockDragonsMod.java :

                    
                    package fr.MrBlockTNT.Dragons.block;
                    
                    import java.util.Random;
                    
                    import net.minecraft.block.Block;
                    import net.minecraft.block.material.Material;
                    import net.minecraft.item.Item;
                    import fr.MrBlockTNT.Dragons.core.Dragons;
                    
                    public class BlockDragonsMod extends Block
                    {
                    Block drop;
                    
                    public BlockDragonsMod(Material material)
                    {
                    super(material);
                    drop = null;
                    this.setCreativeTab(Dragons.DragonsTab);
                    }
                    
                    public BlockDragonsMod(Block block, Material material)
                    {
                    super(material);
                    drop = block;
                    this.setCreativeTab(Dragons.DragonsTab);
                    }
                    
                    public Item getItemDropped(int a, Random b, int c)
                    {
                    return Item.getItemFromBlock(this.drop);
                    }
                    }
                    
                    

                    Mes mods:

                    • New Ores
                    • More Dragons
                    1 réponse Dernière réponse Répondre Citer 0
                    • Deleted
                      Deleted dernière édition par

                      @‘MrBlockTNT’:

                      Apparemment il semble que ça marche avec des blocs (de mon mod) possédant une classe dédiée (type BlockGrass).

                      L’erreur doit être dans cette classe (le système du drop est une expérience) :
                      BlockDragonsMod.java :

                      
                      package fr.MrBlockTNT.Dragons.block;
                      
                      import java.util.Random;
                      
                      import net.minecraft.block.Block;
                      import net.minecraft.block.material.Material;
                      import net.minecraft.item.Item;
                      import fr.MrBlockTNT.Dragons.core.Dragons;
                      
                      public class BlockDragonsMod extends Block
                      {
                      Block drop;
                      
                      public BlockDragonsMod(Material material)
                      {
                      super(material);
                      drop = null;
                      this.setCreativeTab(Dragons.DragonsTab);
                      }
                      
                      public BlockDragonsMod(Block block, Material material)
                      {
                      super(material);
                      drop = block;
                      this.setCreativeTab(Dragons.DragonsTab);
                      }
                      
                      public Item getItemDropped(int a, Random b, int c)
                      {
                      return Item.getItemFromBlock(this.drop);
                      }
                      }
                      
                      

                      Euh essaie de mettre en commentaire ta ligne

                      
                      drop = null
                      
                      

                      pour voir si ça change quelque chose

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

                        Je vois pas de problème en rapport avec ton histoire de portail.
                        En revanche fait attention, celle classe peut déclencher un NPE …
                        Normalement tu mets TaClassePrincipale.nomDuBloc et voila.

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

                          Je pense pas étant donné que mon block “structure” possède les 2 arguments (logiquement, drop sera quand même null), mais je teste quand même.

                          EDIT : C’est bien ce que je pensais ça ne marche pas.

                          Mes mods:

                          • New Ores
                          • More Dragons
                          1 réponse Dernière réponse Répondre Citer 0
                          • Deleted
                            Deleted dernière édition par

                            @‘MrBlockTNT’:

                            Je pense pas étant donné que mon block “structure” possède les 2 arguments (logiquement, drop sera quand même null), mais je teste quand même.

                            EDIT : C’est bien ce que je pensais ça ne marche pas.

                            Autant pour moi….

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

                              J’ai posté une réponse qui est resté inaperçu :
                              @‘robin4002’:

                              Je vois pas de problème en rapport avec ton histoire de portail.
                              En revanche fait attention, celle classe peut déclencher un NPE …
                              Normalement tu mets TaClassePrincipale.nomDuBloc et voila.

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

                                A désolé je n’avais pas vu.
                                Le rapport avec le portail c’est que c’est la classe du bloc ‘structure/container’ du portail.


                                Je ne comprends plus rien : avec deux classes différentes possédant le même code un bloc sur les deux marche… 😞

                                Mes mods:

                                • New Ores
                                • More Dragons
                                1 réponse Dernière réponse Répondre Citer 0
                                • Diangle
                                  Diangle dernière édition par

                                  Je ne comprend pas ton problème xD.

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

                                    Envoie tout tes codes en rapport avec le portail.

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

                                      Classe principale (Dragons.java) :

                                      fire_stone = (new BlockDragonsMod(this.fire_stone, Material.rock)).setHardness(20.0F).setResistance(2000.0F).setStepSound(Block.soundTypeStone).setBlockName("fire_stone").setBlockTextureName("dragons:fire_stone");
                                      GameRegistry.registerBlock(fire_stone, "fire_stone");
                                      

                                      IDimBlockPortal.java (non, ce n’est pas une interface 😄 (I = Ice))

                                      package fr.MrBlockTNT.Dragons.dimension.ice;
                                      
                                      import java.util.Random;
                                      
                                      import net.minecraft.block.Block;
                                      import net.minecraft.block.material.Material;
                                      import net.minecraft.entity.Entity;
                                      import net.minecraft.entity.player.EntityPlayerMP;
                                      import net.minecraft.init.Blocks;
                                      import net.minecraft.item.ItemStack;
                                      import net.minecraft.util.AxisAlignedBB;
                                      import net.minecraft.util.MovingObjectPosition;
                                      import net.minecraft.world.IBlockAccess;
                                      import net.minecraft.world.World;
                                      import cpw.mods.fml.relauncher.Side;
                                      import cpw.mods.fml.relauncher.SideOnly;
                                      import fr.MrBlockTNT.Dragons.block.BlockBase;
                                      import fr.MrBlockTNT.Dragons.core.Dragons;
                                      
                                      public class IDimBlockPortal extends BlockBase
                                      {
                                          public static Block portalMaterial = Dragons.fire_stone;
                                      
                                          public IDimBlockPortal()
                                          {
                                              super(Material.portal);
                                              this.setTickRandomly(true);
                                              this.setStepSound(Block.soundTypeGlass);
                                              this.setLightLevel(0.75F);
                                          }
                                      
                                          @Override
                                          public void setBlockBoundsBasedOnState(IBlockAccess blockaccess, int x, int y, int z)
                                          {
                                              float f;
                                              float f1;
                                      
                                              if(!blockaccess.getBlock(x - 1, y, z).equals(this) && !blockaccess.getBlock(x + 1, y, z).equals(this))
                                              {
                                                  f = 0.125F;
                                                  f1 = 0.5F;
                                                  this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f1, 0.5F + f, 1.0F, 0.5F + f1);
                                              }
                                              else
                                              {
                                                  f = 0.5F;
                                                  f1 = 0.125F;
                                                  this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f1, 0.5F + f, 1.0F, 0.5F + f1);
                                              }
                                          }
                                      
                                          @Override
                                          public void setBlockBoundsForItemRender()
                                          {
                                              float f1 = 0.125F;
                                              this.setBlockBounds(0, 0.0F, 0.5F - f1, 1F, 1.0F, 0.5F + f1);
                                          }
                                      
                                          @Override
                                          public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z)
                                          {
                                              return null;
                                          }
                                      
                                      @Override
                                      public void onNeighborBlockChange(World world, int x, int y, int z, Block block)
                                      {
                                      int y2 = y;
                                      while(world.getBlock(x, y2, z).equals(this))
                                      {
                                      y2–;
                                      }
                                      if(!world.getBlock(x, y2, z).equals(this.portalMaterial))
                                      {
                                      world.setBlockToAir(x, y, z);
                                      }
                                      int y3 = y2 + 1;
                                      boolean portalIsGood = false;
                                      if(world.getBlock(x, y3, z + 1).equals(this))
                                      {
                                      portalIsGood = (world.getBlock(x, y2, z).equals(this.portalMaterial) && world.getBlock(x, y2, z + 1).equals(this.portalMaterial) && world.getBlock(x, y2 + 1, z + 2).equals(this.portalMaterial) && world.getBlock(x, y2 + 2, z + 2).equals(this.portalMaterial) && world.getBlock(x, y2 + 3, z + 2).equals(this.portalMaterial) && world.getBlock(x, y2 + 1, z - 1).equals(this.portalMaterial) && world.getBlock(x, y2 + 2, z - 1).equals(this.portalMaterial) && world.getBlock(x, y2 + 3, z - 1).equals(this.portalMaterial) && world.getBlock(x, y2 + 4, z - 1).equals(this.portalMaterial) && world.getBlock(x, y2 + 4, z).equals(this.portalMaterial));
                                      }
                                      else if(world.getBlock(x, y3, z - 1).equals(this))
                                      {
                                      portalIsGood = (world.getBlock(x, y2, z).equals(this.portalMaterial) && world.getBlock(x, y2, z - 1).equals(this.portalMaterial) && world.getBlock(x, y2 + 1, z - 2).equals(this.portalMaterial) && world.getBlock(x, y2 + 2, z - 2).equals(this.portalMaterial) && world.getBlock(x, y2 + 3, z - 2).equals(this.portalMaterial) && world.getBlock(x, y2 + 1, z + 1).equals(this.portalMaterial) && world.getBlock(x, y2 + 2, z + 1).equals(this.portalMaterial) && world.getBlock(x, y2 + 3, z + 1).equals(this.portalMaterial) && world.getBlock(x, y2 + 4, z + 1).equals(this.portalMaterial) && world.getBlock(x, y2 + 4, z).equals(this.portalMaterial));
                                      }
                                      else if(world.getBlock(x + 1, y3, z).equals(this))
                                      {
                                      portalIsGood = (world.getBlock(x, y2, z).equals(this.portalMaterial) && world.getBlock(x + 1, y2, z).equals(this.portalMaterial) && world.getBlock(x + 2, y2 + 1, z).equals(this.portalMaterial) && world.getBlock(x + 2, y2 + 2, z).equals(this.portalMaterial) && world.getBlock(x + 2, y2 + 3, z).equals(this.portalMaterial) && world.getBlock(x - 1, y2 + 1, z).equals(this.portalMaterial) && world.getBlock(x - 1, y2 + 2, z).equals(this.portalMaterial) && world.getBlock(x - 1, y2 + 3, z).equals(this.portalMaterial) && world.getBlock(x + 1, y2 + 4, z).equals(this.portalMaterial) && world.getBlock(x, y2 + 4, z).equals(this.portalMaterial));
                                      }
                                      else if(world.getBlock(x - 1, y3, z).equals(this))
                                      {
                                      portalIsGood = (world.getBlock(x, y2, z).equals(this.portalMaterial) && world.getBlock(x - 1, y2, z).equals(this.portalMaterial) && world.getBlock(x - 2, y2 + 1, z).equals(this.portalMaterial) && world.getBlock(x - 2, y2 + 2, z).equals(this.portalMaterial) && world.getBlock(x - 2, y2 + 3, z).equals(this.portalMaterial) && world.getBlock(x + 1, y2 + 1, z).equals(this.portalMaterial) && world.getBlock(x + 1, y2 + 2, z).equals(this.portalMaterial) && world.getBlock(x + 1, y2 + 3, z).equals(this.portalMaterial) && world.getBlock(x + 1, y2 + 4, z).equals(this.portalMaterial) && world.getBlock(x, y2 + 4, z).equals(this.portalMaterial));
                                      }
                                      
                                      if(!portalIsGood)
                                      {
                                      world.setBlockToAir(x, y, z);
                                      }
                                      }
                                      
                                          @Override
                                          public boolean isOpaqueCube()
                                          {
                                              return false;
                                          }
                                      
                                          @Override
                                          public boolean renderAsNormalBlock()
                                          {
                                              return false;
                                          }
                                      
                                          @Override
                                          public int quantityDropped(Random random)
                                          {
                                              return 0;
                                          }
                                      
                                          @Override
                                          public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity)
                                          {
                                              if((entity.ridingEntity == null) && (entity.riddenByEntity == null))
                                              {
                                                  if(entity.dimension != Dragons.dimensionIdIce)
                                                  {
                                                      if(entity instanceof EntityPlayerMP)
                                                      {
                                                          EntityPlayerMP player = (EntityPlayerMP)entity;
                                                          if(player.timeUntilPortal > 0)
                                                          {
                                                              player.timeUntilPortal = 10;
                                                          }
                                                          else
                                                          {
                                                              player.timeUntilPortal = 10;
                                                              player.mcServer.getConfigurationManager().transferPlayerToDimension(player, Dragons.dimensionIdIce, new IDimTeleporter(player.mcServer.worldServerForDimension(Dragons.dimensionIdIce)));
                                                          }
                                                      }
                                                      else
                                                      {
                                                          EntityTeleporter.teleportToDim(entity, Dragons.dimensionIdIce);
                                                      }
                                                  }
                                                  else
                                                  {
                                                      if(entity instanceof EntityPlayerMP)
                                                      {
                                                          EntityPlayerMP player = (EntityPlayerMP)entity;
                                                          if(player.timeUntilPortal > 0)
                                                          {
                                                              player.timeUntilPortal = 10;
                                                          }
                                                          else
                                                          {
                                                              player.timeUntilPortal = 10;
                                                              player.mcServer.getConfigurationManager().transferPlayerToDimension(player, 0, new IDimTeleporter(player.mcServer.worldServerForDimension(0)));
                                                          }
                                                      }
                                                      else
                                                      {
                                                          EntityTeleporter.teleportToDim(entity, 0);
                                                      }
                                                  }
                                              }
                                      
                                          }
                                      
                                          @SideOnly(Side.CLIENT)
                                          @Override
                                          public int getRenderBlockPass()
                                          {
                                              return 1;
                                          }
                                      
                                          @SideOnly(Side.CLIENT)
                                          @Override
                                          public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
                                          {
                                              return null;
                                          }
                                      
                                          @Override
                                          public void breakBlock(World world, int x, int y, int z, Block block, int metadata)
                                          {
                                              super.breakBlock(world, x, y, z, block, metadata);
                                              if(world.getBlock(x, y + 1, z).equals(this))
                                              {
                                                  world.setBlockToAir(x, y + 1, z);
                                              }
                                              if(world.getBlock(x, y - 1, z).equals(this))
                                              {
                                                  world.setBlockToAir(x, y - 1, z);
                                              }
                                              if(world.getBlock(x + 1, y, z).equals(this))
                                              {
                                                  world.setBlockToAir(x + 1, y, z);
                                              }
                                              if(world.getBlock(x - 1, y, z).equals(this))
                                              {
                                                  world.setBlockToAir(x - 1, y, z);
                                              }
                                              if(world.getBlock(x, y, z + 1).equals(this))
                                              {
                                                  world.setBlockToAir(x, y, z + 1);
                                              }
                                              if(world.getBlock(x, y, z - 1).equals(this))
                                              {
                                                  world.setBlockToAir(x, y, z - 1);
                                              }
                                          }
                                      }
                                      

                                      Mes mods:

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

                                        Heu ? Je ne vois pas où est le problème, ça devrait très bien fonctionner non ?

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

                                          Et bien apparemment non 😞

                                          Code de l’activateur ? :
                                          ItemIcePortalOpener.java :

                                          package fr.MrBlockTNT.Dragons.item;
                                          
                                          import net.minecraft.entity.player.EntityPlayer;
                                          import net.minecraft.item.Item;
                                          import net.minecraft.item.ItemStack;
                                          import net.minecraft.world.World;
                                          import fr.MrBlockTNT.Dragons.core.Dragons;
                                          import fr.MrBlockTNT.Dragons.dimension.ice.IDimBlockPortal;
                                          
                                          public class ItemIcePortalOpener extends Item
                                          {
                                              public ItemIcePortalOpener()
                                              {
                                                  super();
                                              }
                                          
                                              public boolean onItemUse(ItemStack stack, EntityPlayer player, World par3World, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
                                              {
                                                  if(!par3World.isRemote && par3World.getBlock(x, y, z).equals(IDimBlockPortal.portalMaterial))
                                                  {
                                                      if(par3World.getBlock(x, y, z).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x - 1, y, z).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x - 2, y + 1, z).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x - 2, y + 2, z).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x - 2, y + 3, z).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x + 1, y + 1, z).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x + 1, y + 2, z).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x + 1, y + 3, z).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x - 1, y + 4, z).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x, y + 4, z).equals(IDimBlockPortal.portalMaterial))
                                                      {
                                                          for(int i = 0; i < 3; i++)
                                                          {
                                                              par3World.setBlock(x, y + 1 + i, z, Dragons.ice_portal);
                                                              par3World.setBlock(x - 1, y + 1 + i, z, Dragons.ice_portal);
                                                          }
                                                          if(!player.capabilities.isCreativeMode)
                                                          {
                                                              stack.stackSize–;
                                                          }
                                                          return true;
                                                      }
                                          
                                                      if(par3World.getBlock(x, y, z).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x + 1, y, z).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x + 2, y + 1, z).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x + 2, y + 2, z).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x + 2, y + 3, z).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x - 1, y + 1, z).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x - 1, y + 2, z).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x - 1, y + 3, z).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x + 1, y + 4, z).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x, y + 4, z).equals(IDimBlockPortal.portalMaterial))
                                                      {
                                                          for(int i = 0; i < 3; i++)
                                                          {
                                                              par3World.setBlock(x, y + 1 + i, z, Dragons.ice_portal);
                                                              par3World.setBlock(x + 1, y + 1 + i, z, Dragons.ice_portal);
                                                          }
                                                          if(!player.capabilities.isCreativeMode)
                                                          {
                                                              stack.stackSize--;
                                                          }
                                                          return true;
                                                      }
                                          
                                                      if(par3World.getBlock(x, y, z).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x, y, z - 1).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x, y + 1, z - 2).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x, y + 2, z - 2).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x, y + 3, z - 2).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x, y + 1, z + 1).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x, y + 2, z + 1).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x, y + 3, z + 1).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x, y + 4, z - 1).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x, y + 4, z).equals(IDimBlockPortal.portalMaterial))
                                                      {
                                                          for(int i = 0; i < 3; i++)
                                                          {
                                                              par3World.setBlock(x, y + 1 + i, z, Dragons.ice_portal);
                                                              par3World.setBlock(x, y + 1 + i, z - 1, Dragons.ice_portal);
                                                          }
                                                          if(!player.capabilities.isCreativeMode)
                                                          {
                                                              stack.stackSize--;
                                                          }
                                                          return true;
                                                      }
                                          
                                                      if(par3World.getBlock(x, y, z).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x, y, z + 1).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x, y + 1, z + 2).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x, y + 2, z + 2).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x, y + 3, z + 2).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x, y + 1, z - 1).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x, y + 2, z - 1).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x, y + 3, z - 1).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x, y + 4, z + 1).equals(IDimBlockPortal.portalMaterial) && par3World.getBlock(x, y + 4, z).equals(IDimBlockPortal.portalMaterial))
                                                      {
                                                          for(int i = 0; i < 3; i++)
                                                          {
                                                              par3World.setBlock(x, y + 1 + i, z, Dragons.ice_portal);
                                                              par3World.setBlock(x, y + 1 + i, z + 1, Dragons.ice_portal);
                                                          }
                                                          if(!player.capabilities.isCreativeMode)
                                                          {
                                                              stack.stackSize--;
                                                          }
                                                          return true;
                                                      }
                                                  }
                                                  if(par3World.isRemote)
                                                  {
                                                      par3World.spawnParticle("largesmoke", x, y, z, hitX, hitY, hitZ);
                                                  }
                                                  return false;
                                              }
                                          }
                                          

                                          Mes mods:

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

                                            Dans le constructeur de la classe IDimBlockPortal, ajoutes :
                                            System.out.println(portalMaterial.getUnlocalizedName());

                                            ça t’affiche son nom dans la console ou le jeu crash avec un NPE ?

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

                                            MINECRAFT FORGE FRANCE © 2018

                                            Powered by NodeBB