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

    2 Questions sur ma voiture [1 Résolue]

    Sans suite
    1.7.10
    7
    31
    10411
    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.
    • Deleted
      Deleted dernière édition par

      Salut à tous et à toutes et je vois qu’aujourd’hui, y’a pas mal de post alors pourquoi me gêner surtout quand je galère depuis ce matin 10h30 j’ai changé toutes les valeurs et et j’ai essayé de remonter les classes que ma voiture extends rien n’y fait je n’arrive pas à chagner la vitesse de ma voiture

      ma class entity :

      
      package mrplaigon.psccraft.funpscmod.common;
      
      import net.minecraft.entity.Entity;
      import net.minecraft.entity.EntityAgeable;
      import net.minecraft.entity.EntityLivingBase;
      import net.minecraft.entity.SharedMonsterAttributes;
      import net.minecraft.entity.ai.attributes.IAttributeInstance;
      import net.minecraft.entity.passive.EntityAnimal;
      import net.minecraft.entity.player.EntityPlayer;
      import net.minecraft.item.Item;
      import net.minecraft.item.ItemStack;
      import net.minecraft.nbt.NBTTagCompound;
      import net.minecraft.util.DamageSource;
      import net.minecraft.util.MathHelper;
      import net.minecraft.world.World;
      import cpw.mods.fml.relauncher.Side;
      import cpw.mods.fml.relauncher.SideOnly;
      
      public class CARSEntityCar
      extends EntityAnimal
      {
      private static final String[] field_110273_bx = { "", "meo", "goo", "dio" };
      private static final String[] field_110269_bA = { "hwh", "hcr", "hch", "hbr", "hbl", "hgr", "hdb" };
      private static final String[] field_110292_bC = { "", "wo_", "wmo", "wdo", "bdo" };
      private int jumpRearingCounter;
      public int field_110278_bp;
      public int field_110279_bq;
      protected boolean horseJumping;
      private boolean hasReproduced;
      protected float jumpPower;
      private boolean field_110294_bI;
      private float headLean;
      private float prevHeadLean;
      private float rearingAmount;
      private float prevRearingAmount;
      private float mouthOpenness;
      private float prevMouthOpenness;
      private int field_110285_bP;
      private String field_110286_bQ;
      private String[] field_110280_bR = new String[3];
      private int fuse;
      
      public CARSEntityCar(World par1World)
      {
      super(par1World);
      setSize(0.8F, 0.1F);
      this.isImmuneToFire = false;
      getNavigator().setAvoidsWater(true);
      this.fuse = 15;
      }
      
      protected void applyEntityAttributes()
      {
      super.applyEntityAttributes();
      getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20.0D);
      getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(10.45D * FunPSCMod.SpeedMultiplier);
      }
      
      protected void entityInit()
      {
      super.entityInit();
      this.dataWatcher.addObject(16, Integer.valueOf(0));
      this.dataWatcher.addObject(19, Byte.valueOf((byte)0));
      this.dataWatcher.addObject(20, Integer.valueOf(0));
      this.dataWatcher.addObject(21, String.valueOf(""));
      this.dataWatcher.addObject(22, Integer.valueOf(0));
      }
      
      private boolean getHorseWatchableBoolean(int par1)
      {
      return (this.dataWatcher.getWatchableObjectInt(16) & par1) != 0;
      }
      
      private void setHorseWatchableBoolean(int par1, boolean par2)
      {
      int j = this.dataWatcher.getWatchableObjectInt(16);
      if (par2) {
      this.dataWatcher.updateObject(16, Integer.valueOf(j | par1));
      } else {
      this.dataWatcher.updateObject(16, Integer.valueOf(j & (par1 ^ 0xFFFFFFFF)));
      }
      }
      
      public boolean isAdultHorse()
      {
      return !isChild();
      }
      
      public boolean func_110253_bW()
      {
      return isAdultHorse();
      }
      
      public boolean isHorseJumping()
      {
      return this.horseJumping;
      }
      
      public void setHorseJumping(boolean par1)
      {
      this.horseJumping = par1;
      }
      
      public boolean allowLeashing()
      {
      return super.allowLeashing();
      }
      
      public int func_110241_cb()
      {
      return this.dataWatcher.getWatchableObjectInt(22);
      }
      
      public boolean isRearing()
      {
      return getHorseWatchableBoolean(64);
      }
      
      public boolean func_110205_ce()
      {
      return getHorseWatchableBoolean(16);
      }
      
      public boolean getHasReproduced()
      {
      return this.hasReproduced;
      }
      
      public void func_110236_r(int par1)
      {
      this.dataWatcher.updateObject(22, Integer.valueOf(par1));
      func_110230_cF();
      }
      
      public void func_110242_l(boolean par1)
      {
      setHorseWatchableBoolean(16, par1);
      }
      
      public void setHasReproduced(boolean par1)
      {
      this.hasReproduced = par1;
      }
      
      public boolean attackEntityFrom(DamageSource par1DamageSource, float par2)
      {
      Entity entity = par1DamageSource.getEntity();
      return (this.riddenByEntity != null) && (this.riddenByEntity.equals(entity)) ? false : super.attackEntityFrom(par1DamageSource, par2);
      }
      
      public boolean canBePushed()
      {
      return this.riddenByEntity == null;
      }
      
      public boolean prepareChunkForSpawn()
      {
      int i = MathHelper.floor_double(this.posX);
      int j = MathHelper.floor_double(this.posZ);
      this.worldObj.getBiomeGenForCoords(i, j);
      return true;
      }
      
      protected void fall(float par1)
      {
      if (par1 > 1.0F) {
      playSound("", 0.4F, 1.0F);
      }
      int i = MathHelper.ceiling_float_int(par1 * 0.5F - 3.0F);
      if (i > 0)
      {
      attackEntityFrom(DamageSource.fall, i);
      if (this.riddenByEntity != null) {
      this.riddenByEntity.attackEntityFrom(DamageSource.fall, i);
      }
      }
      }
      
      protected String getDeathSound()
      {
      return "";
      }
      
      protected Item getDropItem()
      {
      return null;//Cars_and_Drives_Base.Wheel;
      }
      
      protected String getHurtSound()
      {
      return "";
      }
      
      protected String getLivingSound()
      {
      return "";
      }
      
      protected String getAngrySoundName()
      {
      return "";
      }
      
      protected void playStepSound(int par1, int par2, int par3, int par4) {}
      
      /**public int getMaxSpawnedInChunk()
      {
      return 6;
      }
      */
      public int getMaxTemper()
      {
      return 4000;
      }
      
      protected float getSoundVolume()
      {
      return 0.8F;
      }
      
      public int getTalkInterval()
      {
      return 400;
      }
      
      private void func_110230_cF()
      {
      this.field_110286_bQ = null;
      }
      
      public boolean interact(EntityPlayer par1EntityPlayer)
      {
      if (super.interact(par1EntityPlayer)) {
      return true;
      }
      if ((getSaddled()) && (!this.worldObj.isRemote) && ((this.riddenByEntity == null) || (this.riddenByEntity == par1EntityPlayer)))
      {
      par1EntityPlayer.mountEntity(this);
      return true;
      }
      return false;
      }
      
      public boolean getSaddled()
      {
      return true;
      }
      
      private void func_110237_h(EntityPlayer par1EntityPlayer)
      {
      par1EntityPlayer.rotationYaw = this.rotationYaw;
      par1EntityPlayer.rotationPitch = this.rotationPitch;
      setEatingHaystack(false);
      setRearing(false);
      if (!this.worldObj.isRemote) {
      par1EntityPlayer.mountEntity(this);
      }
      }
      
      public boolean isBreedingItem(ItemStack par1ItemStack)
      {
      return false;
      }
      
      private void func_110210_cH()
      {
      this.field_110278_bp = 1;
      }
      
      public void onDeath(DamageSource par1DamageSource)
      {
      super.onDeath(par1DamageSource);
      }
      
      public void onLivingUpdate()
      {
      if (this.rand.nextInt(200) == 0) {
      func_110210_cH();
      }
      super.onLivingUpdate();
      if (!this.worldObj.isRemote) {
      if ((this.rand.nextInt(900) == 0) && (this.deathTime == 0)) {
      heal(1.0F);
      }
      }
      }
      
      public void onUpdate()
      {
      super.onUpdate();
      if ((this.worldObj.isRemote) && (this.dataWatcher.hasChanges()))
      {
      this.dataWatcher.func_111144_e();
      func_110230_cF();
      }
      if ((!this.worldObj.isRemote) && (this.jumpRearingCounter > 0) && (++this.jumpRearingCounter > 20))
      {
      this.jumpRearingCounter = 0;
      setRearing(false);
      }
      if ((this.field_110278_bp > 0) && (++this.field_110278_bp > 8)) {
      this.field_110278_bp = 0;
      }
      if (this.field_110279_bq > 0)
      {
      this.field_110279_bq += 1;
      if (this.field_110279_bq > 300) {
      this.field_110279_bq = 0;
      }
      }
      this.prevHeadLean = this.headLean;
      
      this.prevRearingAmount = this.rearingAmount;
      if (isRearing())
      {
      this.prevHeadLean = (this.headLean = 0.0F);
      this.rearingAmount += (1.0F - this.rearingAmount) * 0.4F + 0.05F;
      if (this.rearingAmount > 1.0F) {
      this.rearingAmount = 1.0F;
      }
      }
      else
      {
      this.field_110294_bI = false;
      this.rearingAmount += (0.8F * this.rearingAmount * this.rearingAmount * this.rearingAmount - this.rearingAmount) * 0.6F - 0.05F;
      if (this.rearingAmount < 0.0F) {
      this.rearingAmount = 0.0F;
      }
      }
      this.prevMouthOpenness = this.mouthOpenness;
      if (getHorseWatchableBoolean(128))
      {
      this.mouthOpenness += (1.0F - this.mouthOpenness) * 0.7F + 0.05F;
      if (this.mouthOpenness > 1.0F) {
      this.mouthOpenness = 1.0F;
      }
      }
      else
      {
      this.mouthOpenness += (0.0F - this.mouthOpenness) * 0.7F - 0.05F;
      if (this.mouthOpenness < 0.0F) {
      this.mouthOpenness = 0.0F;
      }
      }
      if ((isBurning()) && (this.fuse– <= 0))
      {
      this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 1.5F, true);
      setDead();
      }
      }
      
      private boolean func_110200_cJ()
      {
      return (this.riddenByEntity == null) && (this.ridingEntity == null) && (isAdultHorse()) && (getHealth() >= getMaxHealth());
      }
      
      public void func_70019_c(boolean par1)
      {
      setHorseWatchableBoolean(32, par1);
      }
      
      public void setEatingHaystack(boolean par1)
      {
      func_70019_c(par1);
      }
      
      public void setRearing(boolean par1)
      {
      if (par1) {
      setEatingHaystack(false);
      }
      setHorseWatchableBoolean(64, par1);
      }
      
      private void makeHorseRear()
      {
      if (!this.worldObj.isRemote)
      {
      this.jumpRearingCounter = 1;
      setRearing(true);
      }
      }
      
      public void makeHorseRearWithSound()
      {
      makeHorseRear();
      String s = getAngrySoundName();
      if (s != null) {
      playSound(s, getSoundVolume(), getSoundPitch());
      }
      }
      
      public void moveEntityWithHeading(float par1, float par2)
      {
      if (this.riddenByEntity != null)
      {
      this.prevRotationYaw = (this.rotationYaw = this.riddenByEntity.rotationYaw);
      this.rotationPitch = (this.riddenByEntity.rotationPitch * 0.5F);
      setRotation(this.rotationYaw, this.rotationPitch);
      this.rotationYawHead = (this.rotationYawHead = this.rotationYaw);
      par1 = ((EntityLivingBase)this.riddenByEntity).moveStrafing * 5.5F;//0.5
      par2 = ((EntityLivingBase)this.riddenByEntity).moveForward;
      if (par2 <= 0.0F)
      {
      par2 *= 0.25F;
      this.field_110285_bP = 0;
      }
      if ((this.onGround) && (this.jumpPower == 0.0F) && (isRearing()) && (!this.field_110294_bI))
      {
      par1 = 0.0F;
      par2 = 0.0F;
      }
      this.stepHeight = 1.0F;
      this.jumpMovementFactor = (getAIMoveSpeed() * 0.1F);
      if (!this.worldObj.isRemote)
      {
      setAIMoveSpeed((float)getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue());
      super.moveEntityWithHeading(par1, par2);
      }
      if (this.onGround)
      {
      this.jumpPower = 0.0F;
      setHorseJumping(false);
      }
      this.prevLimbSwingAmount = this.limbSwingAmount;
      double d0 = this.posX - this.prevPosX;
      double d1 = this.posZ - this.prevPosZ;
      float f4 = MathHelper.sqrt_double(d0 * d0 + d1 * d1) * 4.0F;
      if (f4 > 1.0F) {
      f4 = 1.0F;
      }
      this.limbSwingAmount += (f4 - this.limbSwingAmount) * 0.4F;
      this.limbSwing += this.limbSwingAmount;
      }
      else
      {
      this.stepHeight = 0.5F;
      this.jumpMovementFactor = 0.02F;
      super.moveEntityWithHeading(par1, par2);
      }
      }
      
      public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
      {
      super.writeEntityToNBT(par1NBTTagCompound);
      par1NBTTagCompound.setBoolean("HasReproduced", getHasReproduced());
      par1NBTTagCompound.setBoolean("Bred", func_110205_ce());
      }
      
      public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
      {
      super.readEntityFromNBT(par1NBTTagCompound);
      func_110242_l(par1NBTTagCompound.getBoolean("Bred"));
      setHasReproduced(par1NBTTagCompound.getBoolean("HasReproduced"));
      
      IAttributeInstance attributeinstance = getAttributeMap().getAttributeInstanceByName("Speed");
      if (attributeinstance != null) {
      getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(attributeinstance.getBaseValue() * 5.75D);
      }
      }
      
      public EntityAgeable func_90011_a(EntityAgeable par1EntityAgeable)
      {
      return null;
      }
      
      @SideOnly(Side.CLIENT)
      public float getGrassEatingAmount(float par1)
      {
      return 0.0F;
      }
      
      @SideOnly(Side.CLIENT)
      public float getRearingAmount(float par1)
      {
      return 0.0F;
      }
      
      @SideOnly(Side.CLIENT)
      public float func_110201_q(float par1)
      {
      return 0.0F;
      }
      
      protected boolean func_70650_aV()
      {
      return true;
      }
      
      public void setJumpPower(int par1)
      {
      if (par1 < 0)
      {
      par1 = 0;
      }
      else
      {
      this.field_110294_bI = true;
      makeHorseRear();
      }
      if (par1 >= 90) {
      this.jumpPower = 1.0F;
      } else {
      this.jumpPower = (0.4F + 0.4F * par1 / 90.0F);
      }
      }
      
      @SideOnly(Side.CLIENT)
      public void handleHealthUpdate(byte par1)
      {
      if (par1 != 7) {
      super.handleHealthUpdate(par1);
      }
      }
      
      public void updateRiderPosition()
      {
      super.updateRiderPosition();
      if (this.prevRearingAmount > 0.0F)
      {
      float f = MathHelper.sin(this.rotationYawHead * 3.141593F / 180.0F);
      float f1 = MathHelper.cos(this.rotationYawHead * 3.141593F / 180.0F);
      float f2 = 0.7F * this.prevRearingAmount;
      float f3 = 0.15F * this.prevRearingAmount;
      this.riddenByEntity.setPosition(this.posX + f2 * f, this.posY + getMountedYOffset() + this.riddenByEntity.getYOffset() + f3, this.posZ - f2 * f1);
      if ((this.riddenByEntity instanceof EntityLivingBase)) {
      ((EntityLivingBase)this.riddenByEntity).rotationYawHead = this.rotationYawHead;
      }
      }
      }
      
      private float func_110267_cL()
      {
      return 15.0F + this.rand.nextInt(8) + this.rand.nextInt(9);
      }
      
      private double func_110245_cM()
      {
      return 0.4000000059604645D + this.rand.nextDouble() * 0.2D + this.rand.nextDouble() * 0.2D + this.rand.nextDouble() * 0.2D;
      }
      
      private double func_110203_cN()
      {
      return (0.449999988079071D + this.rand.nextDouble() * 0.3D + this.rand.nextDouble() * 0.3D + this.rand.nextDouble() * 0.3D) * 0.25D;
      }
      
      public boolean func_70617_f_()
      {
      return false;
      }
      
      @Override
      public EntityAgeable createChild(EntityAgeable entityageable)
      {
      
      return null;
      }
      }
      
      

      Merci d’avance

      PS = Je viens de rajouter un attributeModifier dans la class de mon mob avec une condition qui le valide comme quoi si mon mob est monté la vitesse est modifiée pour voir si la condition était ok j’ai fait afficher un message dans les logs il y était mais après la vitesse n’a pas changé d’un poil voilà ma class modifiée

      
      package mrplaigon.psccraft.funpscmod.common;
      
      import java.util.UUID;
      
      import net.minecraft.entity.Entity;
      import net.minecraft.entity.EntityAgeable;
      import net.minecraft.entity.EntityLivingBase;
      import net.minecraft.entity.SharedMonsterAttributes;
      import net.minecraft.entity.ai.attributes.AttributeModifier;
      import net.minecraft.entity.ai.attributes.IAttributeInstance;
      import net.minecraft.entity.passive.EntityAnimal;
      import net.minecraft.entity.player.EntityPlayer;
      import net.minecraft.item.Item;
      import net.minecraft.item.ItemStack;
      import net.minecraft.nbt.NBTTagCompound;
      import net.minecraft.util.DamageSource;
      import net.minecraft.util.MathHelper;
      import net.minecraft.world.World;
      import cpw.mods.fml.relauncher.Side;
      import cpw.mods.fml.relauncher.SideOnly;
      
      public class CARSEntityCar
      extends EntityAnimal
      {
      private static final String[] field_110273_bx = { "", "meo", "goo", "dio" };
      private static final String[] field_110269_bA = { "hwh", "hcr", "hch", "hbr", "hbl", "hgr", "hdb" };
      private static final String[] field_110292_bC = { "", "wo_", "wmo", "wdo", "bdo" };
      private int jumpRearingCounter;
      public int field_110278_bp;
      public int field_110279_bq;
      protected boolean horseJumping;
      private boolean hasReproduced;
      protected float jumpPower;
      private boolean field_110294_bI;
      private float headLean;
      private float prevHeadLean;
      private float rearingAmount;
      private float prevRearingAmount;
      private float mouthOpenness;
      private float prevMouthOpenness;
      private int field_110285_bP;
      private String field_110286_bQ;
      private String[] field_110280_bR = new String[3];
      private int fuse;
      
      %(#FF0000)[ public static final UUID vitesseModifiee2 = UUID.fromString("E199AD21-BA8A-4C53-8D13-6182D5C69D3A");
      public static final AttributeModifier vitesseModifiee = (new AttributeModifier(vitesseModifiee2, "Vitesse modifiee", 0.0D, 2)).setSaved(true);]
      
      public CARSEntityCar(World par1World)
      {
      super(par1World);
      setSize(0.8F, 0.1F);
      this.isImmuneToFire = false;
      getNavigator().setAvoidsWater(true);
      this.fuse = 15;
      }
      
      %(#FF0000)[ protected void updateEntityActionState()
      {
      if (this.riddenByEntity == null)
      {
      IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed);
      iattributeinstance.removeModifier(vitesseModifiee);
      }
      }]
      
      protected void applyEntityAttributes()
      {
      super.applyEntityAttributes();
      getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20.0D);
      getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.45D * FunPSCMod.SpeedMultiplier);
      }
      
      protected void entityInit()
      {
      super.entityInit();
      this.dataWatcher.addObject(16, Integer.valueOf(0));
      this.dataWatcher.addObject(19, Byte.valueOf((byte)0));
      this.dataWatcher.addObject(20, Integer.valueOf(0));
      this.dataWatcher.addObject(21, String.valueOf(""));
      this.dataWatcher.addObject(22, Integer.valueOf(0));
      }
      
      private boolean getHorseWatchableBoolean(int par1)
      {
      return (this.dataWatcher.getWatchableObjectInt(16) & par1) != 0;
      }
      
      private void setHorseWatchableBoolean(int par1, boolean par2)
      {
      int j = this.dataWatcher.getWatchableObjectInt(16);
      if (par2) {
      this.dataWatcher.updateObject(16, Integer.valueOf(j | par1));
      } else {
      this.dataWatcher.updateObject(16, Integer.valueOf(j & (par1 ^ 0xFFFFFFFF)));
      }
      }
      
      public boolean isAdultHorse()
      {
      return !isChild();
      }
      
      public boolean func_110253_bW()
      {
      return isAdultHorse();
      }
      
      public boolean isHorseJumping()
      {
      return this.horseJumping;
      }
      
      public void setHorseJumping(boolean par1)
      {
      this.horseJumping = par1;
      }
      
      public boolean allowLeashing()
      {
      return super.allowLeashing();
      }
      
      public int func_110241_cb()
      {
      return this.dataWatcher.getWatchableObjectInt(22);
      }
      
      public boolean isRearing()
      {
      return getHorseWatchableBoolean(64);
      }
      
      public boolean func_110205_ce()
      {
      return getHorseWatchableBoolean(16);
      }
      
      public boolean getHasReproduced()
      {
      return this.hasReproduced;
      }
      
      public void func_110236_r(int par1)
      {
      this.dataWatcher.updateObject(22, Integer.valueOf(par1));
      func_110230_cF();
      }
      
      public void func_110242_l(boolean par1)
      {
      setHorseWatchableBoolean(16, par1);
      }
      
      public void setHasReproduced(boolean par1)
      {
      this.hasReproduced = par1;
      }
      
      public boolean attackEntityFrom(DamageSource par1DamageSource, float par2)
      {
      Entity entity = par1DamageSource.getEntity();
      return (this.riddenByEntity != null) && (this.riddenByEntity.equals(entity)) ? false : super.attackEntityFrom(par1DamageSource, par2);
      }
      
      public boolean canBePushed()
      {
      return this.riddenByEntity == null;
      }
      
      public boolean prepareChunkForSpawn()
      {
      int i = MathHelper.floor_double(this.posX);
      int j = MathHelper.floor_double(this.posZ);
      this.worldObj.getBiomeGenForCoords(i, j);
      return true;
      }
      
      protected void fall(float par1)
      {
      if (par1 > 1.0F) {
      playSound("", 0.4F, 1.0F);
      }
      int i = MathHelper.ceiling_float_int(par1 * 0.5F - 3.0F);
      if (i > 0)
      {
      attackEntityFrom(DamageSource.fall, i);
      if (this.riddenByEntity != null) {
      this.riddenByEntity.attackEntityFrom(DamageSource.fall, i);
      }
      }
      }
      
      protected String getDeathSound()
      {
      return "";
      }
      
      protected Item getDropItem()
      {
      return null;//Cars_and_Drives_Base.Wheel;
      }
      
      protected String getHurtSound()
      {
      return "";
      }
      
      protected String getLivingSound()
      {
      return "";
      }
      
      protected String getAngrySoundName()
      {
      return "";
      }
      
      protected void playStepSound(int par1, int par2, int par3, int par4) {}
      
      /**public int getMaxSpawnedInChunk()
      {
      return 6;
      }
      */
      public int getMaxTemper()
      {
      return 4000;
      }
      
      protected float getSoundVolume()
      {
      return 0.8F;
      }
      
      public int getTalkInterval()
      {
      return 400;
      }
      
      private void func_110230_cF()
      {
      this.field_110286_bQ = null;
      }
      
      public boolean interact(EntityPlayer par1EntityPlayer)
      {
      if (super.interact(par1EntityPlayer)) {
      return true;
      }
      if ((getSaddled()) && (!this.worldObj.isRemote) && ((this.riddenByEntity == null) || (this.riddenByEntity == par1EntityPlayer)))
      {
      par1EntityPlayer.mountEntity(this);
      return true;
      }
      return false;
      }
      
      public boolean getSaddled()
      {
      return true;
      }
      
      private void func_110237_h(EntityPlayer par1EntityPlayer)
      {
      par1EntityPlayer.rotationYaw = this.rotationYaw;
      par1EntityPlayer.rotationPitch = this.rotationPitch;
      setEatingHaystack(false);
      setRearing(false);
      if (!this.worldObj.isRemote) {
      par1EntityPlayer.mountEntity(this);
      }
      }
      
      public boolean isBreedingItem(ItemStack par1ItemStack)
      {
      return false;
      }
      
      private void func_110210_cH()
      {
      this.field_110278_bp = 1;
      }
      
      public void onDeath(DamageSource par1DamageSource)
      {
      super.onDeath(par1DamageSource);
      }
      
      public void onLivingUpdate()
      {
      if (this.rand.nextInt(200) == 0) {
      func_110210_cH();
      }
      super.onLivingUpdate();
      if (!this.worldObj.isRemote) {
      if ((this.rand.nextInt(900) == 0) && (this.deathTime == 0)) {
      heal(1.0F);
      }
      }
      }
      
      public void onUpdate()
      {
      super.onUpdate();
      if ((this.worldObj.isRemote) && (this.dataWatcher.hasChanges()))
      {
      this.dataWatcher.func_111144_e();
      func_110230_cF();
      }
      if ((!this.worldObj.isRemote) && (this.jumpRearingCounter > 0) && (++this.jumpRearingCounter > 20))
      {
      this.jumpRearingCounter = 0;
      setRearing(false);
      }
      if ((this.field_110278_bp > 0) && (++this.field_110278_bp > 8)) {
      this.field_110278_bp = 0;
      }
      if (this.field_110279_bq > 0)
      {
      this.field_110279_bq += 1;
      if (this.field_110279_bq > 300) {
      this.field_110279_bq = 0;
      }
      }
      this.prevHeadLean = this.headLean;
      
      this.prevRearingAmount = this.rearingAmount;
      if (isRearing())
      {
      this.prevHeadLean = (this.headLean = 0.0F);
      this.rearingAmount += (1.0F - this.rearingAmount) * 0.4F + 0.05F;
      if (this.rearingAmount > 1.0F) {
      this.rearingAmount = 1.0F;
      }
      }
      else
      {
      this.field_110294_bI = false;
      this.rearingAmount += (0.8F * this.rearingAmount * this.rearingAmount * this.rearingAmount - this.rearingAmount) * 0.6F - 0.05F;
      if (this.rearingAmount < 0.0F) {
      this.rearingAmount = 0.0F;
      }
      }
      this.prevMouthOpenness = this.mouthOpenness;
      if (getHorseWatchableBoolean(128))
      {
      this.mouthOpenness += (1.0F - this.mouthOpenness) * 0.7F + 0.05F;
      if (this.mouthOpenness > 1.0F) {
      this.mouthOpenness = 1.0F;
      }
      }
      else
      {
      this.mouthOpenness += (0.0F - this.mouthOpenness) * 0.7F - 0.05F;
      if (this.mouthOpenness < 0.0F) {
      this.mouthOpenness = 0.0F;
      }
      }
      if ((isBurning()) && (this.fuse– <= 0))
      {
      this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 1.5F, true);
      setDead();
      }
      }
      
      private boolean func_110200_cJ()
      {
      return (this.riddenByEntity == null) && (this.ridingEntity == null) && (isAdultHorse()) && (getHealth() >= getMaxHealth());
      }
      
      public void func_70019_c(boolean par1)
      {
      setHorseWatchableBoolean(32, par1);
      }
      
      public void setEatingHaystack(boolean par1)
      {
      func_70019_c(par1);
      }
      
      public void setRearing(boolean par1)
      {
      if (par1) {
      setEatingHaystack(false);
      }
      setHorseWatchableBoolean(64, par1);
      }
      
      private void makeHorseRear()
      {
      if (!this.worldObj.isRemote)
      {
      this.jumpRearingCounter = 1;
      setRearing(true);
      }
      }
      
      public void makeHorseRearWithSound()
      {
      makeHorseRear();
      String s = getAngrySoundName();
      if (s != null) {
      playSound(s, getSoundVolume(), getSoundPitch());
      }
      }
      
      public void moveEntityWithHeading(float par1, float par2)
      {
      if (this.riddenByEntity != null)
      {
      this.prevRotationYaw = (this.rotationYaw = this.riddenByEntity.rotationYaw);
      this.rotationPitch = (this.riddenByEntity.rotationPitch * 0.5F);
      setRotation(this.rotationYaw, this.rotationPitch);
      this.rotationYawHead = (this.rotationYawHead = this.rotationYaw);
      par1 = ((EntityLivingBase)this.riddenByEntity).moveStrafing * 5.5F;//0.5
      par2 = ((EntityLivingBase)this.riddenByEntity).moveForward;
      if (par2 <= 0.0F)
      {
      par2 *= 0.25F;
      this.field_110285_bP = 0;
      }
      if ((this.onGround) && (this.jumpPower == 0.0F) && (isRearing()) && (!this.field_110294_bI))
      {
      par1 = 0.0F;
      par2 = 0.0F;
      }
      this.stepHeight = 1.0F;
      this.jumpMovementFactor = (getAIMoveSpeed() * 0.1F);
      if (!this.worldObj.isRemote)
      {
      setAIMoveSpeed((float)getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue());
      super.moveEntityWithHeading(par1, par2);
      }
      if (this.onGround)
      {
      this.jumpPower = 0.0F;
      setHorseJumping(false);
      }
      this.prevLimbSwingAmount = this.limbSwingAmount;
      double d0 = this.posX - this.prevPosX;
      double d1 = this.posZ - this.prevPosZ;
      float f4 = MathHelper.sqrt_double(d0 * d0 + d1 * d1) * 4.0F;
      if (f4 > 1.0F) {
      f4 = 1.0F;
      }
      this.limbSwingAmount += (f4 - this.limbSwingAmount) * 0.4F;
      this.limbSwing += this.limbSwingAmount;
      }
      else
      {
      this.stepHeight = 0.5F;
      this.jumpMovementFactor = 0.02F;
      super.moveEntityWithHeading(par1, par2);
      }
      }
      
      public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
      {
      super.writeEntityToNBT(par1NBTTagCompound);
      par1NBTTagCompound.setBoolean("HasReproduced", getHasReproduced());
      par1NBTTagCompound.setBoolean("Bred", func_110205_ce());
      }
      
      public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
      {
      super.readEntityFromNBT(par1NBTTagCompound);
      func_110242_l(par1NBTTagCompound.getBoolean("Bred"));
      setHasReproduced(par1NBTTagCompound.getBoolean("HasReproduced"));
      
      IAttributeInstance attributeinstance = getAttributeMap().getAttributeInstanceByName("Speed");
      if (attributeinstance != null) {
      getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(attributeinstance.getBaseValue() * 0.75D);
      }
      }
      
      public EntityAgeable func_90011_a(EntityAgeable par1EntityAgeable)
      {
      return null;
      }
      
      @SideOnly(Side.CLIENT)
      public float getGrassEatingAmount(float par1)
      {
      return 0.0F;
      }
      
      @SideOnly(Side.CLIENT)
      public float getRearingAmount(float par1)
      {
      return 0.0F;
      }
      
      @SideOnly(Side.CLIENT)
      public float func_110201_q(float par1)
      {
      return 0.0F;
      }
      
      protected boolean func_70650_aV()
      {
      return true;
      }
      
      public void setJumpPower(int par1)
      {
      if (par1 < 0)
      {
      par1 = 0;
      }
      else
      {
      this.field_110294_bI = true;
      makeHorseRear();
      }
      if (par1 >= 90) {
      this.jumpPower = 1.0F;
      } else {
      this.jumpPower = (0.4F + 0.4F * par1 / 90.0F);
      }
      }
      
      @SideOnly(Side.CLIENT)
      public void handleHealthUpdate(byte par1)
      {
      if (par1 != 7) {
      super.handleHealthUpdate(par1);
      }
      }
      
      public void updateRiderPosition()
      {
      super.updateRiderPosition();
      if (this.prevRearingAmount > 0.0F)
      {
      float f = MathHelper.sin(this.rotationYawHead * 3.141593F / 180.0F);
      float f1 = MathHelper.cos(this.rotationYawHead * 3.141593F / 180.0F);
      float f2 = 0.7F * this.prevRearingAmount;
      float f3 = 0.15F * this.prevRearingAmount;
      this.riddenByEntity.setPosition(this.posX + f2 * f, this.posY + getMountedYOffset() + this.riddenByEntity.getYOffset() + f3, this.posZ - f2 * f1);
      if ((this.riddenByEntity instanceof EntityLivingBase)) {
      ((EntityLivingBase)this.riddenByEntity).rotationYawHead = this.rotationYawHead;
      }
      }
      }
      
      private float func_110267_cL()
      {
      return 15.0F + this.rand.nextInt(8) + this.rand.nextInt(9);
      }
      
      private double func_110245_cM()
      {
      return 0.4000000059604645D + this.rand.nextDouble() * 0.2D + this.rand.nextDouble() * 0.2D + this.rand.nextDouble() * 0.2D;
      }
      
      private double func_110203_cN()
      {
      return (0.449999988079071D + this.rand.nextDouble() * 0.3D + this.rand.nextDouble() * 0.3D + this.rand.nextDouble() * 0.3D) * 0.25D;
      }
      
      public boolean func_70617_f_()
      {
      return false;
      }
      
      @Override
      public EntityAgeable createChild(EntityAgeable entityageable)
      {
      
      return null;
      }
      }
      
      
      1 réponse Dernière réponse Répondre Citer 0
      • elias54
        elias54 Administrateurs dernière édition par

        Mh… J’ai du mal à comprendre certaines partie de ton code.

        Pour répondre à ton problème, regarde les sources de Fake ores, j’ai ajouté un mob où sa vitesse est modifié quand on monte dessus. 🙂

        Mon site | GitHub

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

          @‘elias54’:

          Mh… J’ai du mal à comprendre certaines partie de ton code.

          Pour répondre à ton problème, regarde les sources de Fake ores, j’ai ajouté un mob où sa vitesse est modifié quand on monte dessus. 🙂

          Euh juste pourrais-tu me dire quel est ce mob (perso je pense au Schaza, nan ?)

          Euh j’ai regardé vite fait mais quand même pourrais-tu m’indiquer la partie du code de ton entité car j’ai vu les conditions si il était monté par une entité et etc… mais tout ce qui concerne sa vitesse non.
          Peut-être le float f enfin je sais pas mais d’autres valeurs sont égales à 0 (comme le moveForward et le moveStrafing ) donc j’en déduis qu’elles n’assurent pas la vitesse un peu d’aide elias ou une autre personne svp ?

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

            Schaza oui 🙂

            Mon site | GitHub

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

              J’ai sinon vu cette méthode :

              
              public void moveEntityWithHeading(float par1, float par2)
              {
              if (this.riddenByEntity != null)
              {
              par1 = ((EntityLivingBase)this.riddenByEntity).moveStrafing * 1.7F;
              par2 = ((EntityLivingBase)this.riddenByEntity).moveForward;
              float groundMovementFactor = ObfuscationReflectionHelper.getPrivateValue(EntityLivingBase.class, this, "landMovementFactor", "field_70746_aG");
              if (!this.worldObj.isRemote)
              {
              this.jumpMovementFactor = 0.5F;
              groundMovementFactor = (float)this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue();
              super.moveEntityWithHeading(par1, par2);
              }
              }
              else
              {
              this.stepHeight = 0.5F;
              this.jumpMovementFactor = 0.02F;
              super.moveEntityWithHeading(par1, par2);
              }
              }
              
              

              avec surtout cette ligne là ^^

              
              groundMovementFactor = (float)this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue();
              
              

              cette méthode et cette lignes là sont aussi dans mon entity mais elle ne gèrent pas la vitesse uj’ai essayé de modifier de mettre comme un argument un float à la place de this.getEntityAttribute mais rien n’y fait

              Je ne pers pas espoir ^^

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

                “.getAttributeValue();”

                Ça veut tout dire. 😉

                Mon site | GitHub

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

                  @‘elias54’:

                  “.getAttributeValue();”

                  Ça veut tout dire. 😉

                  Ok merci Elias sauf que je ne peux rien mettre en argument à la méthode .getAttributeValue j’ai remonté et j’ai vu qu’on pouvait mettre un double un peu plus d’aide s’il te plait ?


                  nan c’est bon problème réglé fail de ma part : il suffisait juste de changer cette valeur ….

                  
                  this.jumpMovementFactor = (getAIMoveSpeed() * 10.1F);
                  
                  

                  Mais maintenant se pose un autre problème voilà ma voiture marche bien mais j’au un bug au niveau de sa hitbox et donc de l’endroit ou le joueur va être quand il s’assoira pourtant j’ai regardé cette fonction et quelque autres valeurs mais cette fois j’en suis sur et certain cela ne marche pas alors est ce que cela se passe dans le model ou dans le render aidez moi svp

                  
                  public void updateRiderPosition()
                  {
                  super.updateRiderPosition();
                  if (this.prevRearingAmount > 0.0F)
                  {
                  float f = MathHelper.sin(this.rotationYawHead * 3.141593F / 180.0F);
                  float f1 = MathHelper.cos(this.rotationYawHead * 3.141593F / 180.0F);
                  float f2 = 0.7F * this.prevRearingAmount;
                  float f3 = 0.15F * this.prevRearingAmount;
                  this.riddenByEntity.setPosition(this.posX + f2 * f, this.posY + getMountedYOffset() + this.riddenByEntity.getYOffset() + f3, this.posZ - f2 * f1);
                  if ((this.riddenByEntity instanceof EntityLivingBase)) {
                  ((EntityLivingBase)this.riddenByEntity).rotationYawHead = this.rotationYawHead;
                  }
                  }
                  }
                  
                  
                  1 réponse Dernière réponse Répondre Citer 0
                  • Deleted
                    Deleted dernière édition par

                    Voilà une image est-ce quelqu’un pourrait m’expliquer comment changer les coordonnées du joueur qui monte ma voiture :

                    Regarder la première image mon joueur est avancé par-rapport à la flèche rouge.Au lieu d’être sur le siège entouré en vert sur la 2ème photo il se trouve plus en avant sur le capot de la voiture (intrépide de mario sur mario kart ^^)

                    Peut-être que vous verrez mieux si le model avait une texture mais je n’ai pas eu le temps j’étais impatient de vous donner plus de détails sur le post pour que vous m’aidiez plus vite 😉 je l’espère

                    1 réponse Dernière réponse Répondre Citer 0
                    • isador
                      isador Moddeurs confirmés Modérateurs dernière édition par

                      regarde les code du cheval, la partie rendu.

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

                        Le siège du .tcn doit peut-être être situé au centre du bloc de base ?

                        Mes mods :

                        Agriculcraft

                        #L'âge ne fait pas le mod.(L'âge ne fait pas le mod.)

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

                          public void updateRiderPosition()
                          {
                          if (this.riddenByEntity != null)
                          {
                          this.riddenByEntity.setPosition(this.posX, this.posY + this.getMountedYOffset() + this.riddenByEntity.getYOffset(), this.posZ);
                          }
                          }
                          

                          Suffit juste de changer les valeurs.

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

                            @‘robin4002’:

                            public void updateRiderPosition()
                            {
                            if (this.riddenByEntity != null)
                            {
                            this.riddenByEntity.setPosition(this.posX, this.posY + this.getMountedYOffset() + this.riddenByEntity.getYOffset(), this.posZ);
                            }
                            }
                            

                            Suffit juste de changer les valeurs.

                            Comme je l’ai dit Robin j’ai changé les valeurs en mode debug (et après sans mode debug) et rien n’y fait mon joueur ne bouge pas


                            @‘Fine33’:

                            Le siège du .tcn doit peut-être être situé au centre du bloc de base ?

                            Merci de ta réponse Fine33 mais n’y aurait-il pas une une solution dans les codes et non sur techne car c’est embêtant j’ai une gros model (on dirait pas sur l’image mais il possède plein de parties) et il faudrait que je bouge chaque membre du model ça me prendrait beaucoup de temps ….

                            1 réponse Dernière réponse Répondre Citer 0
                            • isador
                              isador Moddeurs confirmés Modérateurs dernière édition par

                              non tu sélectionne toute les partie et tu modifie l’offset

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

                                @‘isador34’:

                                non tu sélectionne toute les partie et tu modifie l’offset

                                Que veux-tu dire modifier l’offset des parties sur techne ou directement sur eclipse ?

                                1 réponse Dernière réponse Répondre Citer 0
                                • isador
                                  isador Moddeurs confirmés Modérateurs dernière édition par

                                  Bah tu modifié l’offset (la position)

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

                                    @‘isador34’:

                                    Bah tu modifié l’offset (la position)

                                    C’est ce que j’ai dit quoi ça sera super long de devoir tout décaler chaque parties du model juste pour que le siège soit sur le block de techne sinon dans techne “offset” est différent de “position” car il permet de faire bouger sans que l’axe de rotation lui ne suive donc si je bouge tout avec l’offset merci pour animer le modèle ensuite

                                    1 réponse Dernière réponse Répondre Citer 0
                                    • isador
                                      isador Moddeurs confirmés Modérateurs dernière édition par

                                      Our mais en sélectionnant toute les partie je pense que tu peut bouger l’ensemble

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

                                        @‘isador34’:

                                        Our mais en sélectionnant toute les partie je pense que tu peut bouger l’ensemble

                                        Euh je pourrai peut-être créer un dossier qui regroupe toutes les parties du model ensuite cliquer sur ce dossier et ensuite bouger je vais voir ça sinon merci d’avoir réexpliqué Isador ^^


                                        Alors je viens de mettre toutes les parties dans une boite et après avoir sélectionné cette boite qui effectivement me sélectionne la voiture en entière mais pourtant je ne peux changer aucune coordonnées rien ne me permet de bouger la voiture en entière je testerai après avoir mangé et j’éditerai mon message si je peux changer les coordonnées dans eclipse

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

                                          Ou alors, dans le render tu utilies les GL11.gltranslatef. 🙂

                                          Mon site | GitHub

                                          1 réponse Dernière réponse Répondre Citer 0
                                          • isador
                                            isador Moddeurs confirmés Modérateurs dernière édition par

                                            oui aussi ^^

                                            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