• Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Solved Modifier la vitesse d'une echelle

    1.7.x
    1.7.2
    7
    30
    6854
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • FairyOne
      FairyOne last edited by

      Re Bonsoir , sais encore moi je voudrais modifier la vitesse d’une échelle mais je sais pas quoi changer pour arriver a sa

      voila la classe de l’échelle :

      merci
      :::
      import cpw.mods.fml.relauncher.Side;

      import cpw.mods.fml.relauncher.SideOnly;
      import java.util.Random;
      import net.minecraft.block.material.Material;
      import net.minecraft.creativetab.CreativeTabs;
      import net.minecraft.entity.EntityLivingBase;
      import net.minecraft.util.AxisAlignedBB;
      import net.minecraft.world.IBlockAccess;
      import net.minecraft.world.World;

      import net.minecraftforge.common.util.ForgeDirection;
      import static net.minecraftforge.common.util.ForgeDirection.*;

      public class BlockLadder extends Block
      {
          private static final String __OBFID = “CL_00000262”;

      protected BlockLadder()
          {
              super(Material.circuits);
              this.setCreativeTab(CreativeTabs.tabDecorations);
          }

      /**
           * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
           * cleared to be reused)
           */
          public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_)
          {
              this.setBlockBoundsBasedOnState(p_149668_1_, p_149668_2_, p_149668_3_, p_149668_4_);
              return super.getCollisionBoundingBoxFromPool(p_149668_1_, p_149668_2_, p_149668_3_, p_149668_4_);
          }

      /**
           * Updates the blocks bounds based on its current state. Args: world, x, y, z
           */
          public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_)
          {
              this.func_149797_b(p_149719_1_.getBlockMetadata(p_149719_2_, p_149719_3_, p_149719_4_));
          }

      /**
           * Returns the bounding box of the wired rectangular prism to render.
           */
          @SideOnly(Side.CLIENT)
          public AxisAlignedBB getSelectedBoundingBoxFromPool(World p_149633_1_, int p_149633_2_, int p_149633_3_, int p_149633_4_)
          {
              this.setBlockBoundsBasedOnState(p_149633_1_, p_149633_2_, p_149633_3_, p_149633_4_);
              return super.getSelectedBoundingBoxFromPool(p_149633_1_, p_149633_2_, p_149633_3_, p_149633_4_);
          }

      public void func_149797_b(int p_149797_1_)
          {
              float f = 0.125F;

      if (p_149797_1_ == 2)
              {
                  this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
              }

      if (p_149797_1_ == 3)
              {
                  this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
              }

      if (p_149797_1_ == 4)
              {
                  this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
              }

      if (p_149797_1_ == 5)
              {
                  this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
              }
          }

      /**
           * Is this block (a) opaque and (b) a full 1m cube?  This determines whether or not to render the shared face of two
           * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
           */
          public boolean isOpaqueCube()
          {
              return false;
          }

      /**
           * If this block doesn’t render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
           */
          public boolean renderAsNormalBlock()
          {
              return false;
          }

      /**
           * The type of render function that is called for this block
           */
          public int getRenderType()
          {
              return 8;
          }

      /**
           * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
           */
          public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
          {
              return p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST ) ||
                     p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST ) ||
                     p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH) ||
                     p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH);
          }

      /**
           * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata
           */
          public int onBlockPlaced(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_)
          {
              int j1 = p_149660_9_;

      if ((p_149660_9_ == 0 || p_149660_5_ == 2) && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH))
              {
                  j1 = 2;
              }

      if ((j1 == 0 || p_149660_5_ == 3) && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH))
              {
                  j1 = 3;
              }

      if ((j1 == 0 || p_149660_5_ == 4) && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST))
              {
                  j1 = 4;
              }

      if ((j1 == 0 || p_149660_5_ == 5) && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST))
              {
                  j1 = 5;
              }

      return j1;
          }

      /**
           * Lets the block know when one of its neighbor changes. Doesn’t know which neighbor changed (coordinates passed are
           * their own) Args: x, y, z, neighbor Block
           */
          public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_)
          {
              int l = p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_);
              boolean flag = false;

      if (l == 2 && p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ + 1, NORTH))
              {
                  flag = true;
              }

      if (l == 3 && p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ - 1, SOUTH))
              {
                  flag = true;
              }

      if (l == 4 && p_149695_1_.isSideSolid(p_149695_2_ + 1, p_149695_3_, p_149695_4_, WEST))
              {
                  flag = true;
              }

      if (l == 5 && p_149695_1_.isSideSolid(p_149695_2_ - 1, p_149695_3_, p_149695_4_, EAST))
              {
                  flag = true;
              }

      if (!flag)
              {
                  this.dropBlockAsItem(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, l, 0);
                  p_149695_1_.setBlockToAir(p_149695_2_, p_149695_3_, p_149695_4_);
              }

      super.onNeighborBlockChange(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, p_149695_5_);
          }

      /**
           * Returns the quantity of items to drop on block destruction.
           */
          public int quantityDropped(Random p_149745_1_)
          {
              return 1;
          }

      @Override
          public boolean isLadder(IBlockAccess world, int x, int y, int z, EntityLivingBase entity)
          {
              return true;
          }
      }
      :::

      1 Reply Last reply Reply Quote 0
      • robin4002
        robin4002 Moddeurs confirmés Rédacteurs Administrateurs last edited by

        À mon avis il faudrait passer par l’event PlayerTick, si le joueur est sur un échelle tu accélère son motionY.

        1 Reply Last reply Reply Quote 0
        • FairyOne
          FairyOne last edited by

          Bonjours merci pour ta réponse mais je voudrais crée une nouvelle échelle est celle la aura une vitesse plus rapide que celle de minecraft .

          je sais pas si on pourrais ajouter onEntityCollidedWithBlock .

          1 Reply Last reply Reply Quote 0
          • robin4002
            robin4002 Moddeurs confirmés Rédacteurs Administrateurs last edited by

            Essayes, si ça ne fonctionne pas passe par l’event de tick du joueur.

            1 Reply Last reply Reply Quote 0
            • FairyOne
              FairyOne last edited by

              J’ai essayer plusieurs truc comme :
              public void onEntityCollidedWithBlock(double par1, int par2, int par3, int par4, Entity par5)

              {
                      if par5.onEntityUpdate();
                      {
                          par5.setVelocity(par1, par3, getMobilityFlag(5));
                      }    
                  }

              private double getMobilityFlag(double d) {
                      // TODO Auto-generated method stub
                      return 0;
                  }
              }

              mais sais pas très concluant j’ai mis :if par5.onEntityUpdate();
              car si je le mets pas sa ferrait monté automatiquement

              1 Reply Last reply Reply Quote 0
              • SCAREX
                SCAREX last edited by

                @‘FairyOne’:

                sa fessait monté

                -> accent portugais spotted !

                @‘FairyOne’:

                J’ai essayer plusieurs truc comme :
                public void onEntityCollidedWithBlock(double par1, int par2, int par3, int par4, Entity par5)

                {
                if par5.onEntityUpdate();
                {
                par5.setVelocity(par1, par3, getMobilityFlag(5));
                }
                }

                private double getMobilityFlag(double d) {
                // TODO Auto-generated method stub
                return 0;
                }
                }

                mais sais pas très concluant j’ai mis :if par5.onEntityUpdate();
                car si je le mets pas sa fessait monté automatiquement

                C’est sûr que ton entitée risque pas de montée vu que la fonction onEntityUpdate est de type void… Il faut utiliser les touches de minecraft pour ça.

                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 Reply Last reply Reply Quote 0
                • FairyOne
                  FairyOne last edited by

                  ok xD

                  sais quoi l’event pour la touche?

                  1 Reply Last reply Reply Quote 0
                  • SCAREX
                    SCAREX last edited by

                    @‘FairyOne’:

                    ok xD

                    sais quoi l’event pour la touche?

                    Tutoriel sur les touches

                    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 Reply Last reply Reply Quote 0
                    • FairyOne
                      FairyOne last edited by

                      J’arrive pas avec a utiliser la touche .

                      1 Reply Last reply Reply Quote 0
                      • SCAREX
                        SCAREX last edited by

                        @‘FairyOne’:

                        J’arrive pas avec a utiliser la touche .

                        Envoi ton code

                        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 Reply Last reply Reply Quote 0
                        • FairyOne
                          FairyOne last edited by

                          voila :

                          :::
                          import static net.minecraftforge.common.util.ForgeDirection.EAST;

                          import static net.minecraftforge.common.util.ForgeDirection.NORTH;
                          import static net.minecraftforge.common.util.ForgeDirection.SOUTH;
                          import static net.minecraftforge.common.util.ForgeDirection.WEST;

                          import java.util.Random;

                          import net.minecraft.block.Block;
                          import net.minecraft.block.material.Material;
                          import net.minecraft.creativetab.CreativeTabs;
                          import net.minecraft.entity.Entity;
                          import net.minecraft.entity.EntityLivingBase;
                          import net.minecraft.util.AxisAlignedBB;
                          import net.minecraft.world.IBlockAccess;
                          import net.minecraft.world.World;
                          import cpw.mods.fml.relauncher.Side;
                          import cpw.mods.fml.relauncher.SideOnly;

                          public class BaseVigne extends Block
                          {
                              private static final String __OBFID = “CL_00000262”;

                          protected BaseVigne()
                              {
                                  super(Material.circuits);
                              }

                          /**
                               * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
                               * cleared to be reused)
                               */
                              public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_)
                              {
                                  this.setBlockBoundsBasedOnState(p_149668_1_, p_149668_2_, p_149668_3_, p_149668_4_);
                                  return super.getCollisionBoundingBoxFromPool(p_149668_1_, p_149668_2_, p_149668_3_, p_149668_4_);
                              }

                          /**
                               * Updates the blocks bounds based on its current state. Args: world, x, y, z
                               */
                              public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_)
                              {
                                  this.func_149797_b(p_149719_1_.getBlockMetadata(p_149719_2_, p_149719_3_, p_149719_4_));
                              }

                          /**
                               * Returns the bounding box of the wired rectangular prism to render.
                               */
                              @SideOnly(Side.CLIENT)
                              public AxisAlignedBB getSelectedBoundingBoxFromPool(World p_149633_1_, int p_149633_2_, int p_149633_3_, int p_149633_4_)
                              {
                                  this.setBlockBoundsBasedOnState(p_149633_1_, p_149633_2_, p_149633_3_, p_149633_4_);
                                  return super.getSelectedBoundingBoxFromPool(p_149633_1_, p_149633_2_, p_149633_3_, p_149633_4_);
                              }

                          public void func_149797_b(int p_149797_1_)
                              {
                                  float f = 0.125F;

                          if (p_149797_1_ == 2)
                                  {
                                      this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F);
                                  }

                          if (p_149797_1_ == 3)
                                  {
                                      this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f);
                                  }

                          if (p_149797_1_ == 4)
                                  {
                                      this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
                                  }

                          if (p_149797_1_ == 5)
                                  {
                                      this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
                                  }
                              }

                          /**
                               * Is this block (a) opaque and (b) a full 1m cube?  This determines whether or not to render the shared face of two
                               * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
                               */
                              public boolean isOpaqueCube()
                              {
                                  return false;
                              }

                          /**
                               * If this block doesn’t render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
                               */
                              public boolean renderAsNormalBlock()
                              {
                                  return false;
                              }

                          /**
                               * The type of render function that is called for this block
                               */
                              public int getRenderType()
                              {
                                  return 8;
                              }

                          /**
                               * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
                               */
                              public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_)
                              {
                                  return p_149742_1_.isSideSolid(p_149742_2_ - 1, p_149742_3_, p_149742_4_, EAST ) ||
                                         p_149742_1_.isSideSolid(p_149742_2_ + 1, p_149742_3_, p_149742_4_, WEST ) ||
                                         p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ - 1, SOUTH) ||
                                         p_149742_1_.isSideSolid(p_149742_2_, p_149742_3_, p_149742_4_ + 1, NORTH);
                              }

                          /**
                               * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata
                               */
                              public int onBlockPlaced(World p_149660_1_, int p_149660_2_, int p_149660_3_, int p_149660_4_, int p_149660_5_, float p_149660_6_, float p_149660_7_, float p_149660_8_, int p_149660_9_)
                              {
                                  int j1 = p_149660_9_;

                          if ((p_149660_9_ == 0 || p_149660_5_ == 2) && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ + 1, NORTH))
                                  {
                                      j1 = 2;
                                  }

                          if ((j1 == 0 || p_149660_5_ == 3) && p_149660_1_.isSideSolid(p_149660_2_, p_149660_3_, p_149660_4_ - 1, SOUTH))
                                  {
                                      j1 = 3;
                                  }

                          if ((j1 == 0 || p_149660_5_ == 4) && p_149660_1_.isSideSolid(p_149660_2_ + 1, p_149660_3_, p_149660_4_, WEST))
                                  {
                                      j1 = 4;
                                  }

                          if ((j1 == 0 || p_149660_5_ == 5) && p_149660_1_.isSideSolid(p_149660_2_ - 1, p_149660_3_, p_149660_4_, EAST))
                                  {
                                      j1 = 5;
                                  }

                          return j1;
                              }

                          /**
                               * Lets the block know when one of its neighbor changes. Doesn’t know which neighbor changed (coordinates passed are
                               * their own) Args: x, y, z, neighbor Block
                               */
                              public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_)
                              {
                                  int l = p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_);
                                  boolean flag = false;

                          if (l == 2 && p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ + 1, NORTH))
                                  {
                                      flag = true;
                                  }

                          if (l == 3 && p_149695_1_.isSideSolid(p_149695_2_, p_149695_3_, p_149695_4_ - 1, SOUTH))
                                  {
                                      flag = true;
                                  }

                          if (l == 4 && p_149695_1_.isSideSolid(p_149695_2_ + 1, p_149695_3_, p_149695_4_, WEST))
                                  {
                                      flag = true;
                                  }

                          if (l == 5 && p_149695_1_.isSideSolid(p_149695_2_ - 1, p_149695_3_, p_149695_4_, EAST))
                                  {
                                      flag = true;
                                  }

                          if (!flag)
                                  {
                                      this.dropBlockAsItem(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, l, 0);
                                      p_149695_1_.setBlockToAir(p_149695_2_, p_149695_3_, p_149695_4_);
                                  }

                          super.onNeighborBlockChange(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, p_149695_5_);
                              }

                          /**
                               * Returns the quantity of items to drop on block destruction.
                               */
                              public int quantityDropped(Random p_149745_1_)
                              {
                                  return 1;
                              }

                          @Override
                              public boolean isLadder(IBlockAccess world, int x, int y, int z, EntityLivingBase entity)
                              {
                                  return true;
                              }
                              public void onEntityCollidedWithBlock(World par1, int par2, int par3, int par4, Entity par5)
                              {
                                      par5.moveEntity(par1, getMobilityFlag(5), par5);
                              }

                          private double getMobilityFlag(int i) {
                                  // TODO Auto-generated method stub
                                  return 0;
                              }
                              }
                          :::

                          1 Reply Last reply Reply Quote 0
                          • robin4002
                            robin4002 Moddeurs confirmés Rédacteurs Administrateurs last edited by

                                public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity)
                                {
                                     entity.motionY *= 1.1F;
                                }
                            

                            Comme ça ?

                            1 Reply Last reply Reply Quote 0
                            • SCAREX
                              SCAREX last edited by

                              @‘robin4002’:

                                  public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity)
                                  {
                                       entity.motionY *= 1.1F;
                                  }
                              

                              Comme ça ?

                              Essaie avec çà :

                              
                              public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity)
                                  {
                                       if (Minecraft.getMinecraft().gameSettings.keyBindForward.isPressed()) entity.motionY *= 1.1F;
                                  }
                              
                              

                              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 Reply Last reply Reply Quote 0
                              • Diangle
                                Diangle last edited by

                                @‘SCAREX’:

                                @‘robin4002’:

                                    public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity)
                                    {
                                         entity.motionY *= 1.1F;
                                    }
                                

                                Comme ça ?

                                Essaie avec çà :

                                
                                public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity)
                                    {
                                         if (Minecraft.getMinecraft().gameSettings.keyBindForward.isPressed()) entity.motionY *= 1.1F;
                                    }
                                
                                

                                Et si le joueur recule sur l échelle ?

                                Envoyé de mon GT-S7390G

                                1 Reply Last reply Reply Quote 0
                                • SCAREX
                                  SCAREX last edited by

                                  @‘Diangle’:

                                  @‘SCAREX’:

                                  @‘robin4002’:

                                      public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity)
                                      {
                                           entity.motionY *= 1.1F;
                                      }
                                  

                                  Comme ça ?

                                  Essaie avec çà :

                                  
                                  public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity)
                                      {
                                           if (Minecraft.getMinecraft().gameSettings.keyBindForward.isPressed()) entity.motionY *= 1.1F;
                                      }
                                  

                                  Et si le joueur recule sur l échelle ?

                                  Envoyé de mon GT-S7390G

                                  Dans le code de minecraft, pour descendre faut appuyer sur aucune touche. Après si tu veux totalement changer le gameplay, je te laisse jeter un coup d’oeil à toutes les touches dans Minecraft.getMinecraft().gameSettings.keyBindCeQueTuVeux et si tu veux un keyBind custom, il y a un tutoriel pour ça sur le forum.

                                  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 Reply Last reply Reply Quote 0
                                  • Diangle
                                    Diangle last edited by

                                    @‘SCAREX’:

                                    @‘Diangle’:

                                    @‘SCAREX’:

                                    @‘robin4002’:

                                        public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity)
                                        {
                                             entity.motionY *= 1.1F;
                                        }
                                    

                                    Comme ça ?

                                    Essaie avec çà :

                                    
                                    public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity)
                                        {
                                             if (Minecraft.getMinecraft().gameSettings.keyBindForward.isPressed()) entity.motionY *= 1.1F;
                                        }
                                    

                                    Et si le joueur recule sur l échelle ?

                                    Envoyé de mon GT-S7390G

                                    Dans le code de minecraft, pour descendre faut appuyer sur aucune touche. Après si tu veux totalement changer le gameplay, je te laisse jeter un coup d’oeil à toutes les touches dans Minecraft.getMinecraft().gameSettings.keyBindCeQueTuVeux et si tu veux un keyBind custom, il y a un tutoriel pour ça sur le forum.

                                    Non pas pour descendre xD Mais quand tu te met dos a une échelle et que tu appuis sur la touche de recule ^^

                                    1 Reply Last reply Reply Quote 0
                                    • SCAREX
                                      SCAREX last edited by

                                      @‘Diangle’:

                                      @‘SCAREX’:

                                      @‘Diangle’:

                                      @‘SCAREX’:

                                      @‘robin4002’:

                                          public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity)
                                          {
                                               entity.motionY *= 1.1F;
                                          }
                                      

                                      Comme ça ?

                                      Essaie avec çà :

                                      
                                      public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity)
                                          {
                                               if (Minecraft.getMinecraft().gameSettings.keyBindForward.isPressed()) entity.motionY *= 1.1F;
                                          }
                                      

                                      Et si le joueur recule sur l échelle ?

                                      Envoyé de mon GT-S7390G

                                      Dans le code de minecraft, pour descendre faut appuyer sur aucune touche. Après si tu veux totalement changer le gameplay, je te laisse jeter un coup d’oeil à toutes les touches dans Minecraft.getMinecraft().gameSettings.keyBindCeQueTuVeux et si tu veux un keyBind custom, il y a un tutoriel pour ça sur le forum.

                                      Non pas pour descendre xD Mais quand tu te met dos a une échelle et que tu appuis sur la touche de recule ^^

                                      J’arrive pas à trouver où le code est exécuté, il faut que tu cherches en profondeur de ton côté.

                                      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 Reply Last reply Reply Quote 0
                                      • Deleted
                                        Deleted last edited by

                                        @‘SCAREX’:

                                        @‘Diangle’:

                                        @‘SCAREX’:

                                        @‘Diangle’:

                                        @‘SCAREX’:

                                        Essaie avec çà :

                                        
                                        public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity)
                                            {
                                                 if (Minecraft.getMinecraft().gameSettings.keyBindForward.isPressed()) entity.motionY *= 1.1F;
                                            }
                                        

                                        Et si le joueur recule sur l échelle ?

                                        Envoyé de mon GT-S7390G

                                        Dans le code de minecraft, pour descendre faut appuyer sur aucune touche. Après si tu veux totalement changer le gameplay, je te laisse jeter un coup d’oeil à toutes les touches dans Minecraft.getMinecraft().gameSettings.keyBindCeQueTuVeux et si tu veux un keyBind custom, il y a un tutoriel pour ça sur le forum.

                                        Non pas pour descendre xD Mais quand tu te met dos a une échelle et que tu appuis sur la touche de recule ^^

                                        J’arrive pas à trouver où le code est exécuté, il faut que tu cherches en profondeur de ton côté.

                                        Eh bien pour cela tu check soit la direction (Nord - Sud - Est ou Ouest) que le joueur regarde ou alors tu regardes si rotationYaw ou rotationPitch je ne sais plus est compris entre telle et telle valeur afin de faire en sorte qu il y ait une condition qui check si le joueur est de dos et puis en second tu check si la touche pour reculer est presse et si les deux conditions sont validées et bien tu changeras motionY comme l avait deja dit Scarex.

                                        1 Reply Last reply Reply Quote 0
                                        • Norskel
                                          Norskel last edited by

                                          regarde les source du mod ender io il ajoute les dark steel ladder qui vont plus vite que celle de base 😛

                                          1 Reply Last reply Reply Quote 0
                                          • SCAREX
                                            SCAREX last edited by

                                            Voilà :

                                            
                                            package fr.scarex.st18.ST18Blocks;
                                            
                                            import net.minecraft.block.Block;
                                            import net.minecraft.block.BlockLadder;
                                            import net.minecraft.block.material.Material;
                                            import net.minecraft.block.properties.PropertyDirection;
                                            import net.minecraft.block.state.IBlockState;
                                            import net.minecraft.entity.Entity;
                                            import net.minecraft.util.BlockPos;
                                            import net.minecraft.util.EnumFacing;
                                            import net.minecraft.world.World;
                                            import net.minecraftforge.fml.common.registry.GameRegistry;
                                            import fr.scarex.st18.ST18;
                                            
                                            public class AdvancedLadder extends BlockLadder
                                            {
                                            private static final String name = "advanced_ladder";
                                            public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL);
                                            
                                            protected AdvancedLadder() {
                                            GameRegistry.registerBlock(this, name);
                                            setUnlocalizedName(ST18.MODID + "_" + name);
                                            }
                                            
                                            @Override
                                            public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity)
                                            {
                                            if (entity.onGround || entity.isCollidedVertically) { return; }
                                            if (entity.motionY >= 0.1) {
                                            entity.setPosition(entity.posX, entity.posY + 1.0F, entity.posZ);
                                            } else if (entity.motionY <= -0.1) {
                                            Block blockUnder = world.getBlockState(new BlockPos(entity.posX, entity.posY - 3, entity.posZ)).getBlock();
                                            if (blockUnder == null || blockUnder == this) {
                                            entity.setPosition(entity.posX, entity.posY - 1.0F, entity.posZ);
                                            }
                                            }
                                            }
                                            }
                                            
                                            

                                            NOTES :
                                            -ce code marche pour la 1.8, il faut modifier quelques trucs pour que ça fonctionne en 1.7.
                                            -le 1.0F correspond à la vitesse voulue (ici 1.0F est très grand)

                                            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 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post
                                            Design by Woryk
                                            Contact / Mentions Légales

                                            MINECRAFT FORGE FRANCE © 2018

                                            Powered by NodeBB