MFF

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

    Modification de la vitesse d'une fireball buggé côté serveur :/

    Planifier Épinglé Verrouillé Déplacé Sans suite
    1.10.x
    31 Messages 3 Publieurs 5.7k 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.
    • GabsG Hors-ligne
      Gabs
      dernière édition par

      Bonjour,

      Comme vous l’avez surement lu dans le titre quand je modifie la vitesse de mon entity fireball en multi ça marche pas.

      En solo ça marche mais en multi l’entity part normalement (vitesse normale) la modification n’est pas prise en compte.

      Je sais pas si cela vient de mon code ou que j’ai mal fais la procédure donc je vous passes mon code:

      
      @SubscribeEvent
          public void onInteractWithItem(PlayerInteractEvent.RightClickItem e)
          {
          EntityPlayer entityplayer = e.getEntityPlayer();
          PlayersCapabilities cap = entityplayer.getCapability(Main.PLAYERS_CAP, null);
          World worldIn = entityplayer.worldObj;
          ItemStack stack = e.getEntityPlayer().getHeldItem(e.getHand());
          Vec3d look = entityplayer.getLookVec();
      if(!worldIn.isRemote)
      
          {
      if(stack != null && stack.getItem() == /*Item.getByNameOrId("flansmod:9mm")*/Items.APPLE)
      {
      EntityLargeFireball fireball2 = new EntityLargeFireball(worldIn, entityplayer, 1, 1, 1);
        fireball2.setPosition(
        entityplayer.posX + look.xCoord,
        entityplayer.posY + 1 + look.yCoord,
        entityplayer.posZ + look.zCoord);
        fireball2.accelerationX = look.xCoord * 10;
        fireball2.accelerationY = look.yCoord * 10;
        fireball2.accelerationZ = look.zCoord * 10;
        worldIn.spawnEntityInWorld(fireball2);
      }
      
          }
      }
      
      
      1 réponse Dernière réponse Répondre Citer 0
      • GabsG Hors-ligne
        Gabs
        dernière édition par

        Upppppppppp

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

          Personne ?

          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

            La classe d’event en question ne serait pas enregistré en client seulement ?

            Je ne vois que ça qui pourrait causer ce soucis.

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

              Normalement non…

              Il me semble que FML existe plus en 1.10 et ma classe est register que avec MinecraftForge …

              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

                Vérifies que la fonction est bien appelé.

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

                  Elle est bien appelé c’est sur, car je joue un sons dans un rayon de 25 blocs et tout le monde l’entends dans se rayon et l’entity part bien mais comme une fireball normale.

                  Sinon robin, j’ai recréer l’entity fireball la si je modifie de base ça vitesse ça peut réglé le problème ?

                  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

                    Essaies, tu verra bien x)

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

                      Je viens d’essaye en soit ça mache avec l’entitylargefireball.

                      Le problème c’est que j’utilise pas vraiment L’entitylargefireball j’utilise ma propre entité qui est un copier coller de l’entitylargefireball avec juste quelques truc enlever j’ai regarder et re regarder mais je vois pas d’ou ça peut venir…

                      
                      package com.CSC.net.Entity;
                      
                      import com.CSC.net.Main;
                      import com.CSC.net.packet.PacketSounds;
                      
                      import net.minecraft.entity.Entity;
                      import net.minecraft.entity.EntityLivingBase;
                      import net.minecraft.entity.projectile.EntityFireball;
                      import net.minecraft.nbt.NBTTagCompound;
                      import net.minecraft.util.DamageSource;
                      import net.minecraft.util.datafix.DataFixer;
                      import net.minecraft.util.math.RayTraceResult;
                      import net.minecraft.world.World;
                      import net.minecraftforge.fml.common.network.NetworkRegistry;
                      import net.minecraftforge.fml.relauncher.Side;
                      import net.minecraftforge.fml.relauncher.SideOnly;
                      
                      public class EntityTesting2 extends EntityTesting
                      {
                          public int explosionPower = 1;
                          public int damage;
                      
                          public EntityTesting2(World worldIn)
                          {
                              super(worldIn);
                          }
                      
                          @SideOnly(Side.CLIENT)
                          public EntityTesting2(World worldIn, double x, double y, double z, double accelX, double accelY, double accelZ)
                          {
                              super(worldIn, x, y, z, accelX, accelY, accelZ);
                          }
                      
                          public EntityTesting2(World worldIn, EntityLivingBase shooter, double accelX, double accelY, double accelZ, int damage)
                          {
                              super(worldIn, shooter, accelX, accelY, accelZ, damage);
                              this.damage = damage;
                          }
                      
                          /**
                           * Called when this EntityFireball hits a block or entity.
                           */
                          protected void onImpact(RayTraceResult result)
                          {
                              if (!this.worldObj.isRemote)
                              {
                                  if (result.entityHit != null && this.shootingEntity != null)
                                  {
                                      result.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.shootingEntity), damage);
                                      this.applyEnchantments(this.shootingEntity, result.entityHit);
                                  }
                                  if (result.typeOfHit == RayTraceResult.Type.BLOCK && this.shootingEntity != null)
                              {
                              System.out.println("");
                              if(this.shootingEntity.worldObj.rand.nextInt(2) == 0)
                              {
                              Main.network.sendToAllAround(new PacketSounds(84), new NetworkRegistry.TargetPoint(shootingEntity.dimension, shootingEntity.posX, shootingEntity.posY, shootingEntity.posZ, 10));
                              }
                              }
                      
                                  //boolean flag = this.worldObj.getGameRules().getBoolean("mobGriefing");
                                  //this.worldObj.newExplosion((Entity)null, this.posX, this.posY, this.posZ, (float)this.explosionPower, flag, flag);
                                  this.setDead();
                              }
                          }
                      
                          public static void func_189744_a(DataFixer p_189744_0_)
                          {
                              EntityFireball.func_189743_a(p_189744_0_, "Fireball");
                          }
                      
                          /**
                           * (abstract) Protected helper method to write subclass entity data to NBT.
                           */
                          public void writeEntityToNBT(NBTTagCompound compound)
                          {
                              super.writeEntityToNBT(compound);
                              compound.setInteger("ExplosionPower", this.explosionPower);
                          }
                      
                          /**
                           * (abstract) Protected helper method to read subclass entity data from NBT.
                           */
                          public void readEntityFromNBT(NBTTagCompound compound)
                          {
                              super.readEntityFromNBT(compound);
                      
                              if (compound.hasKey("ExplosionPower", 99))
                              {
                                  this.explosionPower = compound.getInteger("ExplosionPower");
                              }
                          }
                      }
                      
                      
                      
                      package com.CSC.net.Entity;
                      
                      import com.CSC.net.Main;
                      import com.CSC.net.packet.PacketSounds;
                      
                      import net.minecraft.block.Block;
                      import net.minecraft.entity.Entity;
                      import net.minecraft.entity.EntityLivingBase;
                      import net.minecraft.entity.projectile.ProjectileHelper;
                      import net.minecraft.nbt.NBTTagCompound;
                      import net.minecraft.nbt.NBTTagList;
                      import net.minecraft.util.DamageSource;
                      import net.minecraft.util.EnumParticleTypes;
                      import net.minecraft.util.ResourceLocation;
                      import net.minecraft.util.datafix.DataFixer;
                      import net.minecraft.util.math.BlockPos;
                      import net.minecraft.util.math.MathHelper;
                      import net.minecraft.util.math.RayTraceResult;
                      import net.minecraft.util.math.Vec3d;
                      import net.minecraft.world.World;
                      import net.minecraftforge.fml.common.network.NetworkRegistry;
                      import net.minecraftforge.fml.relauncher.Side;
                      import net.minecraftforge.fml.relauncher.SideOnly;
                      
                      public class EntityTesting extends Entity
                      {
                      public static EntityTesting instance;
                      public int damage;
                          private int xTile = -1;
                          private int yTile = -1;
                          private int zTile = -1;
                          private Block inTile;
                          private boolean inGround;
                          public EntityLivingBase shootingEntity;
                          private int ticksAlive;
                          private int ticksInAir;
                          public double accelerationX;
                          public double accelerationY;
                          public double accelerationZ;
                      
                          public EntityTesting(World worldIn)
                          {
                              super(worldIn);
                              this.setSize(1.0F, 1.0F);
                              this.instance = this;
                          }
                      
                          protected void entityInit()
                          {
                          }
                      
                          /**
                           * Checks if the entity is in range to render.
                           */
                          @SideOnly(Side.CLIENT)
                          public boolean isInRangeToRenderDist(double distance)
                          {
                              double d0 = this.getEntityBoundingBox().getAverageEdgeLength() * 4.0D;
                      
                              if (Double.isNaN(d0))
                              {
                                  d0 = 4.0D;
                              }
                      
                              d0 = d0 * 64.0D;
                              return distance < d0 * d0;
                          }
                      
                          public EntityTesting(World worldIn, double x, double y, double z, double accelX, double accelY, double accelZ)
                          {
                              super(worldIn);
                              this.setSize(0.15F, 0.15F);
                              this.setLocationAndAngles(x, y, z, this.rotationYaw, this.rotationPitch);
                              this.setPosition(x, y, z);
                              double d0 = (double)MathHelper.sqrt_double(accelX * accelX + accelY * accelY + accelZ * accelZ);
                              this.accelerationX = accelX / d0 * 0.1D;
                              this.accelerationY = accelY / d0 * 0.1D;
                              this.accelerationZ = accelZ / d0 * 0.1D;
                              this.instance = this;
                          }
                      
                          public EntityTesting(World worldIn, EntityLivingBase shooter, double accelX, double accelY, double accelZ, int damage)
                          {
                              super(worldIn);
                              this.shootingEntity = shooter;
                              this.setSize(0.15F, 0.15F);
                              this.setLocationAndAngles(shooter.posX, shooter.posY, shooter.posZ, shooter.rotationYaw, shooter.rotationPitch);
                              this.setPosition(this.posX, this.posY, this.posZ);
                              this.motionX = 0.0D;
                              this.motionY = 0.0D;
                              this.motionZ = 0.0D;
                              accelX = accelX + this.rand.nextGaussian() * 0.4D;
                              accelY = accelY + this.rand.nextGaussian() * 0.4D;
                              accelZ = accelZ + this.rand.nextGaussian() * 0.4D;
                              double d0 = (double)MathHelper.sqrt_double(accelX * accelX + accelY * accelY + accelZ * accelZ);
                              this.accelerationX = accelX / d0 * 0.1D;
                              this.accelerationY = accelY / d0 * 0.1D;
                              this.accelerationZ = accelZ / d0 * 0.1D;
                              this.instance = this;
                              this.damage = damage;
                          }
                      
                          /**
                           * Called to update the entity's position/logic.
                           */
                          public void onUpdate()
                          {
                              if (this.worldObj.isRemote || (this.shootingEntity == null || !this.shootingEntity.isDead) && this.worldObj.isBlockLoaded(new BlockPos(this)))
                              {
                                  super.onUpdate();
                      
                                  if (this.isFireballFiery())
                                  {
                                      this.setFire(1);
                                  }
                      
                                  if (this.inGround)
                                  {
                                      if (this.worldObj.getBlockState(new BlockPos(this.xTile, this.yTile, this.zTile)).getBlock() == this.inTile)
                                      {
                                          ++this.ticksAlive;
                      
                                          if (this.ticksAlive == 600)
                                          {
                                              this.setDead();
                                          }
                      
                                          return;
                                      }
                      
                                      this.inGround = false;
                                      this.motionX *= (double)(this.rand.nextFloat() * 0.2F);
                                      this.motionY *= (double)(this.rand.nextFloat() * 0.2F);
                                      this.motionZ *= (double)(this.rand.nextFloat() * 0.2F);
                                      this.ticksAlive = 0;
                                      this.ticksInAir = 0;
                                  }
                                  else
                                  {
                                      ++this.ticksInAir;
                                  }
                      
                                  RayTraceResult raytraceresult = ProjectileHelper.forwardsRaycast(this, true, this.ticksInAir >= 25, this.shootingEntity);
                      
                                  if (raytraceresult != null)
                                  {
                                      this.onImpact(raytraceresult);
                                  }
                      
                                  this.posX += this.motionX;
                                  this.posY += this.motionY;
                                  this.posZ += this.motionZ;
                                  ProjectileHelper.rotateTowardsMovement(this, 0.2F);
                                  float f = this.getMotionFactor();
                      
                                  if (this.isInWater())
                                  {
                                      for (int i = 0; i < 4; ++i)
                                      {
                                          float f1 = 0.25F;
                                          this.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX - this.motionX * 0.25D, this.posY - this.motionY * 0.25D, this.posZ - this.motionZ * 0.25D, this.motionX, this.motionY, this.motionZ, new int[0]);
                                      }
                      
                                      f = 0.8F;
                                  }
                      
                                  this.motionX += this.accelerationX;
                                  this.motionY += this.accelerationY;
                                  this.motionZ += this.accelerationZ;
                                  this.motionX *= (double)f;
                                  this.motionY *= (double)f;
                                  this.motionZ *= (double)f;
                                  this.worldObj.spawnParticle(this.getParticleType(), this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D, new int[0]);
                                  this.setPosition(this.posX, this.posY, this.posZ);
                              }
                              else
                              {
                                  this.setDead();
                              }
                          }
                      
                          protected boolean isFireballFiery()
                          {
                              return true;
                          }
                      
                          protected EnumParticleTypes getParticleType()
                          {
                              return EnumParticleTypes.SMOKE_NORMAL;
                          }
                      
                          /**
                           * Return the motion factor for this projectile. The factor is multiplied by the original motion.
                           */
                          protected float getMotionFactor()
                          {
                              return 0.95F;
                          }
                      
                          /**
                           * Called when this EntityFireball hits a block or entity.
                           */
                          protected void onImpact(RayTraceResult result) {
                      
                      }
                      
                          public static void func_189743_a(DataFixer p_189743_0_, String p_189743_1_)
                          {
                          }
                      
                          /**
                           * (abstract) Protected helper method to write subclass entity data to NBT.
                           */
                          public void writeEntityToNBT(NBTTagCompound compound)
                          {
                              compound.setInteger("xTile", this.xTile);
                              compound.setInteger("yTile", this.yTile);
                              compound.setInteger("zTile", this.zTile);
                              ResourceLocation resourcelocation = (ResourceLocation)Block.REGISTRY.getNameForObject(this.inTile);
                              compound.setString("inTile", resourcelocation == null ? "" : resourcelocation.toString());
                              compound.setByte("inGround", (byte)(this.inGround ? 1 : 0));
                              compound.setTag("direction", this.newDoubleNBTList(new double[] {this.motionX, this.motionY, this.motionZ}));
                              compound.setTag("power", this.newDoubleNBTList(new double[] {this.accelerationX, this.accelerationY, this.accelerationZ}));
                              compound.setInteger("life", this.ticksAlive);
                          }
                      
                          /**
                           * (abstract) Protected helper method to read subclass entity data from NBT.
                           */
                          public void readEntityFromNBT(NBTTagCompound compound)
                          {
                              this.xTile = compound.getInteger("xTile");
                              this.yTile = compound.getInteger("yTile");
                              this.zTile = compound.getInteger("zTile");
                      
                              if (compound.hasKey("inTile", 8))
                              {
                                  this.inTile = Block.getBlockFromName(compound.getString("inTile"));
                              }
                              else
                              {
                                  this.inTile = Block.getBlockById(compound.getByte("inTile") & 255);
                              }
                      
                              this.inGround = compound.getByte("inGround") == 1;
                      
                              if (compound.hasKey("power", 9))
                              {
                                  NBTTagList nbttaglist = compound.getTagList("power", 6);
                      
                                  if (nbttaglist.tagCount() == 3)
                                  {
                                      this.accelerationX = nbttaglist.getDoubleAt(0);
                                      this.accelerationY = nbttaglist.getDoubleAt(1);
                                      this.accelerationZ = nbttaglist.getDoubleAt(2);
                                  }
                              }
                      
                              this.ticksAlive = compound.getInteger("life");
                      
                              if (compound.hasKey("direction", 9) && compound.getTagList("direction", 6).tagCount() == 3)
                              {
                                  NBTTagList nbttaglist1 = compound.getTagList("direction", 6);
                                  this.motionX = nbttaglist1.getDoubleAt(0);
                                  this.motionY = nbttaglist1.getDoubleAt(1);
                                  this.motionZ = nbttaglist1.getDoubleAt(2);
                              }
                              else
                              {
                                  this.setDead();
                              }
                          }
                      
                          /**
                           * Returns true if other Entities should be prevented from moving through this Entity.
                           */
                          public boolean canBeCollidedWith()
                          {
                              return true;
                          }
                      
                          public float getCollisionBorderSize()
                          {
                              return 1.0F;
                          }
                      
                          /**
                           * Called when the entity is attacked.
                           */
                          public boolean attackEntityFrom(DamageSource source, float amount)
                          {
                              if (this.isEntityInvulnerable(source))
                              {
                                  return false;
                              }
                              else
                              {
                                  this.setBeenAttacked();
                      
                                  if (source.getEntity() != null)
                                  {
                                      Vec3d vec3d = source.getEntity().getLookVec();
                      
                                      if (vec3d != null)
                                      {
                                          this.motionX = vec3d.xCoord;
                                          this.motionY = vec3d.yCoord;
                                          this.motionZ = vec3d.zCoord;
                                          this.accelerationX = this.motionX * 0.1D;
                                          this.accelerationY = this.motionY * 0.1D;
                                          this.accelerationZ = this.motionZ * 0.1D;
                                      }
                      
                                      if (source.getEntity() instanceof EntityLivingBase)
                                      {
                                          this.shootingEntity = (EntityLivingBase)source.getEntity();
                                      }
                      
                                      return true;
                                  }
                                  else
                                  {
                                      return false;
                                  }
                              }
                          }
                      
                          /**
                           * Gets how bright this entity is.
                           */
                          public float getBrightness(float partialTicks)
                          {
                              return 1.0F;
                          }
                      
                          @SideOnly(Side.CLIENT)
                          public int getBrightnessForRender(float partialTicks)
                          {
                              return 15728880;
                          }
                      }
                      
                      
                      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

                        public static EntityTesting instance;

                        C’est quoi ça ?

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

                          Euhh je sais pas du tout …

                          Pourquoi cette question ? x)

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

                            Parce que tu devrais pas avoir besoin d’une telle chose sur une entité, où est-ce que tu l’utilises ? (Clic droit dessus, References -> Workspace)

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

                              Je ne l’utilise plus, je viens de l’enlever.
                              C’est ça qui causé problème ?

                              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

                                Je ne pense pas, mais en tout cas ça n’a rien à faire là.
                                Je ne sais pas trop d’où peut venir le problème. Faudrait que je débug de mon côté quand j’aurai le temps (si tu peux m’envoyer les sources ça serait bien).

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

                                  Tien:

                                  Je t’envoies le mdp du zip en privé

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

                                    Source:

                                    ps: j’ai oublié de enlever le menu principal du coup dans le clientproxy tout en bas vire l’event onGui.

                                    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

                                      En fait la raison est surment du au fait que les valeurs de look.xCoord, look.yCoord et look.zCoord ne sont pas les mêmes côtés serveur.
                                      Je ne vois que ça qui pourrait causer ce soucis.

                                      Pour avoir une balle qui va plus vite fait simplement une classe extends EntityFireball (pas besoin de recréer un équivalent de EntityFireball comme actuellement) et reprend simplement cette partie du code dans le constructeur :

                                      accelX = accelX + this.rand.nextGaussian() * 0.4D;
                                      accelY = accelY + this.rand.nextGaussian() * 0.4D;
                                      accelZ = accelZ + this.rand.nextGaussian() * 0.4D;
                                      double d0 = (double)MathHelper.sqrt_double(accelX * accelX + accelY * accelY + accelZ * accelZ);
                                      this.accelerationX = accelX / d0 * 0.1D;
                                      this.accelerationY = accelY / d0 * 0.1D;
                                      this.accelerationZ = accelZ / d0 * 0.1D;
                                      

                                      En augmentant l’accélération. Exemple :

                                      accelX = accelX + this.rand.nextGaussian() * 0.4D;
                                      accelY = accelY + this.rand.nextGaussian() * 0.4D;
                                      accelZ = accelZ + this.rand.nextGaussian() * 0.4D;
                                      double d0 = (double)MathHelper.sqrt_double(accelX * accelX + accelY * accelY + accelZ * accelZ);
                                      this.accelerationX = accelX * 2 / d0 * 0.1D;
                                      this.accelerationY = accelY * 2 / d0 * 0.1D;
                                      this.accelerationZ = accelZ * 2 / d0 * 0.1D;
                                      
                                      1 réponse Dernière réponse Répondre Citer 0
                                      • GabsG Hors-ligne
                                        Gabs
                                        dernière édition par

                                        J’ai fais se que tu m’as dis mais y’a un soucis^^

                                        La vitesse la fireball est bien modifié et tout mais le truc c’est elle part pas droite et de façon aléatoire.
                                        Pour que elle ne parte pas de travers je fais ça:

                                        
                                        if(stack != null && stack.getItem() == /*Item.getByNameOrId("flansmod:9mm")*/Items.APPLE)
                                            {
                                            if(cap.getammo9mm() >= 1 | entityplayer.capabilities.isCreativeMode && timer <= 0)
                                            {
                                            timer = 20*2;
                                            Main.network.sendToAllAround(new PacketSounds(58), new NetworkRegistry.TargetPoint(entityplayer.dimension, entityplayer.posX, entityplayer.posY, entityplayer.posZ, 25));
                                            TEST fireball2 = new TEST(worldIn, entityplayer, look.xCoord, look.yCoord, look.zCoord);
                                          fireball2.setPosition(
                                          entityplayer.posX + look.xCoord,
                                          entityplayer.posY + 1 + look.yCoord,
                                          entityplayer.posZ + look.zCoord);
                                          fireball2.accelerationX = look.xCoord;//ça
                                          fireball2.accelerationY = look.yCoord;//ça
                                          fireball2.accelerationZ = look.zCoord;//ça
                                          System.out.println(fireball2.accelerationX + " " + fireball2.accelerationY + " " + fireball2.accelerationZ);
                                          worldIn.spawnEntityInWorld(fireball2);
                                          cap.removeammo9mm();
                                          cap.sync();
                                          System.out.println(cap.getammo9mm());
                                            }
                                        
                                        

                                        Mais le soucis c’est que quand je fais ça, la vitesse de la fireball n’est plus modifier forcément …

                                        J’ai essayer de regarder comment la fireball du ghast faisait mais j’ai pas trop compris x) !

                                        Voilà donc je sais pas trop comment faire la…

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

                                          J’ai fais se que tu m’as dis

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

                                            J’ai fais se que tu m’as dis mais y’a un soucis^^

                                            La vitesse la fireball est bien modifié et tout mais le truc c’est elle part pas droite et de façon aléatoire (en solo pas testé en multi).
                                            Pour que elle ne parte pas de travers je fais ça:

                                            
                                            if(stack != null && stack.getItem() == /*Item.getByNameOrId("flansmod:9mm")*/Items.APPLE)
                                                {
                                                if(cap.getammo9mm() >= 1 | entityplayer.capabilities.isCreativeMode && timer <= 0)
                                                {
                                                timer = 20*2;
                                                Main.network.sendToAllAround(new PacketSounds(58), new NetworkRegistry.TargetPoint(entityplayer.dimension, entityplayer.posX, entityplayer.posY, entityplayer.posZ, 25));
                                                TEST fireball2 = new TEST(worldIn, entityplayer, look.xCoord, look.yCoord, look.zCoord);
                                              fireball2.setPosition(
                                              entityplayer.posX + look.xCoord,
                                              entityplayer.posY + 1 + look.yCoord,
                                              entityplayer.posZ + look.zCoord);
                                              fireball2.accelerationX = look.xCoord;//ça
                                              fireball2.accelerationY = look.yCoord;//ça
                                              fireball2.accelerationZ = look.zCoord;//ça
                                              System.out.println(fireball2.accelerationX + " " + fireball2.accelerationY + " " + fireball2.accelerationZ);
                                              worldIn.spawnEntityInWorld(fireball2);
                                              cap.removeammo9mm();
                                              cap.sync();
                                              System.out.println(cap.getammo9mm());
                                                }
                                            
                                            

                                            Mais le soucis c’est que quand je fais ça, la vitesse de la fireball n’est plus modifier forcément …

                                            J’ai essayer de regarder comment la fireball du ghast faisait mais j’ai pas trop compris x) !

                                            Voilà donc je sais pas trop comment faire la…

                                            J’ai essayer de faire le Vec3d dans le constructeur de l’entity la vitesse est modif en solo mais pas multi c’est comme avant…

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

                                            MINECRAFT FORGE FRANCE © 2024

                                            Powered by NodeBB