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

    Solved Entité qui disparais.

    1.7.x
    1.7.10
    3
    5
    1388
    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.
    • T
      ThisMisterious last edited by

      [font=helvetica, arial, sans-serif**Version : **1.7.10
      **API utilisée(s) : **Forge
      **Recherche(s) effectuée(s) : **Google, MfF]
      [font=helvetica, arial, sans-serifExplication détaillé du problème :
      Mon entité custom disparais quand je m’éloigne(elle est toujours la mais elle n’apparais plus).]
      [font=helvetica, arial, sans-serifCa ne me le fait avec aucune autre entité.]
      [font=helvetica, arial, sans-serif**Code(s) : **
      ModelCrystalFaction]

      package com.kyrionmc.client;
      
      import org.lwjgl.opengl.GL11;
      
      import net.minecraft.client.model.ModelBase;
      import net.minecraft.client.model.ModelBiped;
      import net.minecraft.client.model.ModelRenderer;
      import net.minecraft.entity.Entity;
      
      public class ModelCrystalFaction extends ModelBiped
      {
       //fields
         ModelRenderer Crystal1;
         ModelRenderer BendRock;
         ModelRenderer Pied;
         ModelRenderer Crystal2;
         ModelRenderer Crystal3;
         ModelRenderer Pied2;
         ModelRenderer Pied3;
         ModelRenderer Pied4;
         ModelRenderer Pied5;
      
       public ModelCrystalFaction()
       {
         textureWidth = 128;
         textureHeight = 64;
      
           Crystal1 = new ModelRenderer(this, 32, 12);
           Crystal1.addBox(0F, 0F, 0F, 6, 6, 6);
           Crystal1.setRotationPoint(0F, 1F, 0F);
           Crystal1.setTextureSize(128, 64);
      
           setRotation(Crystal1, 2.408554F, -0.7853982F, -0.7853982F);
      
           BendRock = new ModelRenderer(this, 0, 24);
           BendRock.addBox(0F, 0F, 0F, 16, 7, 16);
           BendRock.setRotationPoint(-8F, 17F, -8F);
           BendRock.setTextureSize(128, 64);
      
           setRotation(BendRock, 0F, 0F, 0F);
           Pied = new ModelRenderer(this, 0, 0);
           Pied.addBox(0F, 0F, 0F, 8, 16, 8);
           Pied.setRotationPoint(-4F, 1F, -4F);
           Pied.setTextureSize(128, 64);
      
           setRotation(Pied, 0F, 0F, 0F);
      
           Crystal2 = new ModelRenderer(this, 32, 12);
           Crystal2.addBox(0F, 0F, 0F, 6, 6, 6);
           Crystal2.setRotationPoint(0F, 1F, 0F);
           Crystal2.setTextureSize(128, 64);
      
           setRotation(Crystal2, 2.268928F, -1.448623F, -0.7679449F);
      
           Crystal3 = new ModelRenderer(this, 32, 12);
           Crystal3.addBox(0F, 0F, 0F, 6, 6, 6);
           Crystal3.setRotationPoint(0F, 1F, 0F);
           Crystal3.setTextureSize(128, 64);
      
           setRotation(Crystal3, 2.164208F, -2.408554F, -0.6457718F);
           Pied2 = new ModelRenderer(this, 66, 7);
           Pied2.addBox(0F, 0F, 0F, 1, 13, 4);
           Pied2.setRotationPoint(4F, 4F, -2F);
           Pied2.setTextureSize(128, 64);
      
           setRotation(Pied2, 0F, 0F, 0F);
           Pied3 = new ModelRenderer(this, 66, 7);
           Pied3.addBox(0F, 0F, 0F, 1, 13, 4);
           Pied3.setRotationPoint(-5F, 4F, -2F);
           Pied3.setTextureSize(128, 64);
      
           setRotation(Pied3, 0F, 0F, 0F);
           Pied4 = new ModelRenderer(this, 56, 10);
           Pied4.addBox(0F, 0F, 0F, 4, 13, 1);
           Pied4.setRotationPoint(-2F, 4.333333F, 4F);
           Pied4.setTextureSize(128, 64);
      
           setRotation(Pied4, 0F, 0F, 0F);
           Pied5 = new ModelRenderer(this, 56, 10);
           Pied5.addBox(0F, 0F, 0F, 4, 13, 1);
           Pied5.setRotationPoint(-2F, 4F, -5F);
           Pied5.setTextureSize(128, 64);
      
           setRotation(Pied5, 0F, 0F, 0F);
       }
      
       public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
       {
         //super.render(entity, f, f1, f2, f3, f4, f5);
         setRotationAngles(f, f1, f2, f3, f4, f5, entity);
         GL11.glEnable(GL11.GL_BLEND);
         Crystal1.render(f5);
         Crystal2.render(f5);
         Crystal3.render(f5);
         GL11.glDisable(GL11.GL_BLEND);
         BendRock.render(f5);
         Pied.render(f5);
      
         Pied2.render(f5);
         Pied3.render(f5);
         Pied4.render(f5);
         Pied5.render(f5);
       }
      
       private void setRotation(ModelRenderer model, float x, float y, float z)
       {
         model.rotateAngleX = x;
         model.rotateAngleY = y;
         model.rotateAngleZ = z;
       }
      
       public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
       {
         //super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
       }
      
      }
      


      RenderStatutFaction

      package com.kyrionmc.client;
      
      import com.kyrionmc.common.EntityStatutFaction;
      import com.kyrionmc.common.FactionGui;
      
      import net.minecraft.client.model.ModelBiped;
      import net.minecraft.client.renderer.entity.Render;
      import net.minecraft.client.renderer.entity.RenderBiped;
      import net.minecraft.client.renderer.entity.RenderEntity;
      import net.minecraft.entity.Entity;
      import net.minecraft.entity.EntityLiving;
      import net.minecraft.entity.boss.BossStatus;
      import net.minecraft.util.ResourceLocation;
      
      public class RenderStatutFaction extends RenderBiped
      {
      public final ResourceLocation texture = new ResourceLocation(FactionGui.MODID, "textures/CrystalFaction.png");
      
      public RenderStatutFaction(ModelCrystalFaction modelCrystalFaction, float shadow)
      {
      super(modelCrystalFaction, shadow);
      }
      
      protected ResourceLocation getEntityTexture(EntityLiving living)
      {
      return this.getStatutFactionTexture((EntityStatutFaction)living);
      }
      
      private ResourceLocation getStatutFactionTexture(EntityStatutFaction mobTutoriel)
      {
      return texture;
      }
      public void renderHealtBar(EntityStatutFaction  mob, double x, double y, double z, float par8, float par9)
      {
      BossStatus.setBossStatus(mob, true);
      super.doRender(mob, x, y, z, par8, par9);
      }
      public void doRender(Entity entity, double x, double y, double z, float par8, float par9)
      {
      this.renderHealtBar((EntityStatutFaction)entity, x, y, z, par8, par9);
      }
      }
      


      EntityStatutFaction

      package com.kyrionmc.common;
      
      import net.minecraft.entity.EntityCreature;
      import net.minecraft.entity.SharedMonsterAttributes;
      import net.minecraft.entity.boss.IBossDisplayData;
      import net.minecraft.entity.monster.EntityMob;
      import net.minecraft.util.MathHelper;
      import net.minecraft.world.World;
      
      public class EntityStatutFaction extends EntityCreature  implements IBossDisplayData{
      
      public EntityStatutFaction(World world) {
      super(world);
      // TODO Auto-generated constructor stub
      
      }
      
      public void applyEntityAttributes()
      {
      super.applyEntityAttributes();
      // la suite va ici
      this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(2000D);
      this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(10000D);
      }
      
         protected boolean isMovementCeased()
         {
             return true;
         }
      
         public void onLivingUpdate()
         {
             //if (this.jumpTicks > 0)
             //{
             //    –this.jumpTicks;
             //}
      
             if (this.newPosRotationIncrements > 0)
             {
                 double d0 = this.posX + (this.newPosX - this.posX) / (double)this.newPosRotationIncrements;
                 double d1 = this.posY + (this.newPosY - this.posY) / (double)this.newPosRotationIncrements;
                 double d2 = this.posZ + (this.newPosZ - this.posZ) / (double)this.newPosRotationIncrements;
                 double d3 = MathHelper.wrapAngleTo180_double(this.newRotationYaw - (double)this.rotationYaw);
                 this.rotationYaw = (float)0;
                 this.rotationPitch = (float)0;
                 --this.newPosRotationIncrements;
                 this.setPosition(d0, d1, d2);
                 this.setRotation(this.rotationYaw, this.rotationPitch);
             }
             else if (!this.isClientWorld())
             {
                 this.motionX *= 0.98D;
                 this.motionY *= 0.98D;
                 this.motionZ *= 0.98D;
             }
      
             if (Math.abs(this.motionX) < 0.005D)
             {
                 this.motionX = 0.0D;
             }
      
             if (Math.abs(this.motionY) < 0.005D)
             {
                 this.motionY = 0.0D;
             }
      
             if (Math.abs(this.motionZ) < 0.005D)
             {
                 this.motionZ = 0.0D;
             }
      
             this.worldObj.theProfiler.startSection("ai");
      
             if (this.isMovementBlocked())
             {
                 this.isJumping = false;
                 this.moveStrafing = 0.0F;
                 this.moveForward = 0.0F;
                 this.randomYawVelocity = 0.0F;
             }
             else if (this.isClientWorld())
             {
                 if (this.isAIEnabled())
                 {
                     this.worldObj.theProfiler.startSection("newAi");
                     this.updateAITasks();
                     this.worldObj.theProfiler.endSection();
                 }
                 else
                 {
                     this.worldObj.theProfiler.startSection("oldAi");
                     this.updateEntityActionState();
                     this.worldObj.theProfiler.endSection();
                     this.rotationYawHead = this.rotationYaw;
                 }
             }
      
             this.worldObj.theProfiler.endSection();
             this.worldObj.theProfiler.startSection("jump");
      
             if (this.isJumping)
             {
                 if (!this.isInWater() && !this.handleLavaMovement())
                 {
                     //if (this.onGround && this.jumpTicks == 0)
                     //{
                     //    this.jump();
                     //    //this.jumpTicks = 10;
                     //}
                 }
                 else
                 {
                     this.motionY += 0.03999999910593033D;
                 }
             }
             else
             {
                 //this.jumpTicks = 0;
             }
      
             this.worldObj.theProfiler.endSection();
             this.worldObj.theProfiler.startSection("travel");
             this.moveStrafing *= 0.98F;
             this.moveForward *= 0.98F;
             this.randomYawVelocity *= 0.9F;
             //this.moveEntityWithHeading(this.moveStrafing, this.moveForward);
             this.worldObj.theProfiler.endSection();
             this.worldObj.theProfiler.startSection("push");
      
             if (!this.worldObj.isRemote)
             {
                 this.collideWithNearbyEntities();
             }
      
             this.worldObj.theProfiler.endSection();
         }
      
      }
      


      Et ma methode Init

      @EventHandler
      public void init(FMLInitializationEvent event)
      {
      
      NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);
      EntityRegistry.registerGlobalEntityID(EntityStatutFaction.class, "statutFaction", EntityRegistry.findGlobalUniqueEntityId(), new Color(0, 255, 0).getRGB(), new Color(255, 0, 0).getRGB());
      EntityRegistry.registerModEntity(EntityStatutFaction.class, "statutFaction", 420, this.instance, 40, 1, true);
      
      }
      

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

        Salut,
        @‘ThisMisterious’:

        Mon entité custom disparais quand je m’éloigne(elle est toujours la mais elle n’apparais plus).

        ?!?
        Comment ça ?
        L’entité est toujours là mais elle ne s’affiche plus sur ton client ? C’est ça que tu veux dire ?
        Et c’est quoi les :

        qui sont partout dans ton message ?

        1 Reply Last reply Reply Quote 0
        • jglrxavpok
          jglrxavpok Modérateurs last edited by

          Elle disparaît à partir de quelle distance?
          Cela arrive-t-il sous toutes les orientations?

          Modérateur sur MFF. 
          Mon Github: http://github.com/jglrxavpok
          Mon compte Steam si vous voulez jouer à CS:GO ou TF2 avec moi: https://steamcommunity.com/id/jglrxavpok/

          1 Reply Last reply Reply Quote 0
          • T
            ThisMisterious last edited by

            @‘robin4002’:

            Salut,
            @‘ThisMisterious’:

            Mon entité custom disparais quand je m’éloigne(elle est toujours la mais elle n’apparais plus).

            ?!?
            Comment ça ?
            L’entité est toujours là mais elle ne s’affiche plus sur ton client ? C’est ça que tu veux dire ?
            Et c’est quoi les :

            qui sont partout dans ton message ?

            oui c’est ce que je veux dire.
            Pour les imag aucune idée 0o
            @‘jglrxavpok’:

            Elle disparaît à partir de quelle distance?
            Cela arrive-t-il sous toutes les orientations?

            Elle disparais comme toutes les autres entité quand je m’éloigne.
            Mais la ou les autres ré-apparaisse normalement, elle non.
            Si on deco reco elle revien. les joueur qui sont rester a porté la voie toujours

            1 Reply Last reply Reply Quote 0
            • T
              ThisMisterious last edited by

              j’ai fini par trouver!
              Cela venais de la maniere dont je la fesai spawn avec bukkit.

              Il falais simplement faire un :
              entity.setRemoveWhenFarAway(false);

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              Design by Woryk
              Contact / Mentions Légales

              MINECRAFT FORGE FRANCE © 2018

              Powered by NodeBB