Render Entity avec un .obj ou .b3d



  • Bonjour, il y a quelleque temps, j'ai décidé de mettre le mods ExRollerCoaster en 1.8.9, sauf que voila, j'ai réussi a faire le rendue du Coaster en block, sauf que en entity c'est impossible, cela ne se rend pas et je crois que le problème ce situe dans le model, voici le model

    package erc.model;
    
    import net.minecraft.client.Minecraft;
    import net.minecraft.client.resources.model.ModelBakery;
    import net.minecraftforge.client.model.IModel;
    import net.minecraftforge.client.model.IModel;
    import net.minecraft.client.renderer.BlockRendererDispatcher;
    import net.minecraft.client.renderer.Tessellator;
    import net.minecraft.client.resources.model.IBakedModel;
    import net.minecraft.client.resources.model.ModelManager;
    import net.minecraftforge.client.model.IModel;
    import net.minecraftforge.fml.client.FMLClientHandler;
    import org.lwjgl.opengl.GL11;
    
    import erc.entity.ERC_EntityCoaster;
    import net.minecraft.client.model.ModelBase;
    import net.minecraft.util.ResourceLocation;
    
    public class ERC_ModelCoaster extends ModelBase {
    
    private IModel modelCoaster;
    private ResourceLocation TextureResource;
    
    @SuppressWarnings("unused")
    private ERC_ModelCoaster(){} //���[�h����t�@�C�������w��C���X�^���X�������ۂł���H[/font]
    
    public ERC_ModelCoaster(IModel Obj, ResourceLocation Tex)
    {
    modelCoaster = Obj;
    TextureResource = Tex;
    }
    
    public void render(ERC_EntityCoaster coaster, double x, double y, double z, float t)
    {
    GL11.glPushMatrix();
    GL11.glTranslatef((float)x, (float)y, (float)z);
    // if(coaster.ERCPosMat != null)
    // {
    // GL11.glMultMatrix(coaster.ERCPosMat.rotmat);
    // }
    GL11.glRotatef(coaster.ERCPosMat.getFixedYaw(t), 0f, -1f, 0f);
    GL11.glRotatef(coaster.ERCPosMat.getFixedPitch(t),1f, 0f, 0f);
    GL11.glRotatef(coaster.ERCPosMat.getFixedRoll(t), 0f, 0f, 1f);
    
    GL11.glScalef(1.0f, 1.0f, 1.0f);
    FMLClientHandler.instance().getClient().renderEngine.bindTexture(TextureResource);
    
    //coaster.shouldRenderInPass(0);
    //modelCoaster
    //r.renderModel(coaster.worldObj, modelCoaster, null, coaster.getPosition(), Tessellator.getInstance().getWorldRenderer());
    //modelCoaster.render(t);
    
    GL11.glPopMatrix();
    }
    
    }
    

    voici mon entity

    [font=Courier Newpackage ]erc.entity%(#cc7832)[;
    ]
    import java.util.ArrayList%(#cc7832)[;
    ]import java.util.List%(#cc7832)[;
    ]
    import erc._core.ERC_Core%(#cc7832)[;
    ]import erc._core.ERC_Logger%(#cc7832)[;
    ]import erc._core.ERC_ReturnCoasterRot%(#cc7832)[;
    ]import erc.item.ERC_ItemCoasterConnector%(#cc7832)[;
    ]import erc.manager.ERC_CoasterAndRailManager%(#cc7832)[;
    ]import erc.manager.ERC_ManagerCoasterLoad%(#cc7832)[;
    ]import erc.manager.ERC_ModelLoadManager%(#cc7832)[;
    ]import erc.manager.ERC_ModelLoadManager.ModelOptions%(#cc7832)[;
    ]import erc.message.ERC_MessageCoasterMisc%(#cc7832)[;
    ]import erc.message.ERC_MessageCoasterStC%(#cc7832)[;
    ]import erc.message.ERC_PacketHandler%(#cc7832)[;
    ]import erc.model.ERC_ModelCoaster%(#cc7832)[;
    ]import erc.tileEntity.TileEntityRailBase%(#cc7832)[;
    ]import erc.tileEntity.TileEntityRailBranch2%(#cc7832)[;
    ]import erc.tileEntity.Wrap_TileEntityRail%(#cc7832)[;
    ]import io.netty.buffer.ByteBuf%(#cc7832)[;
    ]import net.minecraft.entity.Entity%(#cc7832)[;
    ]import net.minecraft.entity.monster.EntitySkeleton%(#cc7832)[;
    ]import net.minecraft.entity.player.EntityPlayer%(#cc7832)[;
    ]import net.minecraft.entity.player.EntityPlayerMP%(#cc7832)[;
    ]import net.minecraft.item.Item%(#cc7832)[;
    ]import net.minecraft.item.ItemStack%(#cc7832)[;
    ]import net.minecraft.nbt.NBTTagCompound%(#cc7832)[;
    ]import net.minecraft.tileentity.TileEntity%(#cc7832)[;
    ]import net.minecraft.util.AxisAlignedBB%(#cc7832)[;
    ]import net.minecraft.util.BlockPos%(#cc7832)[;
    ]import net.minecraft.util.DamageSource%(#cc7832)[;
    ]import net.minecraft.util.MathHelper%(#cc7832)[;
    ]import net.minecraft.world.EnumSkyBlock%(#cc7832)[;
    ]import net.minecraft.world.World%(#cc7832)[;
    ]import net.minecraftforge.fml.relauncher.Side%(#cc7832)[;
    ]import net.minecraftforge.fml.relauncher.SideOnly%(#cc7832)[;
    ]
    
    public class ERC_EntityCoaster extends Wrap_EntityCoaster{
    
      protected String entityName%(#cc7832)[;
    ]   protected TileEntityRailBase tlrail%(#cc7832)[;
    ]
      // [font=DejaVu Sans���]f[font=DejaVu Sans���]`[font=DejaVu Sans��]p[font=DejaVu Sans�]p[font=DejaVu Sans�����][[font=DejaVu Sans�]%(#808080)[^
    ]   protected int CoasterType = -1%(#cc7832)[;
    ]   protected int ModelID = -1%(#cc7832)[;
    ]   protected ERC_ModelCoaster modelCoaster%(#cc7832)[;
    ]   public ERC_ModelCoaster getModelRenderer(){return modelCoaster;}
    
      private int savex%(#cc7832)[;
    ]   private int savey%(#cc7832)[;
    ]   private int savez%(#cc7832)[;
    ]
       public int connectNum%(#cc7832)[;
    ]
       public ERC_ReturnCoasterRot ERCPosMat%(#cc7832)[;
    ]   public float paramT%(#cc7832)[;
    ]   public double Speed%(#cc7832)[;
    ]   public double sumSpeed%(#cc7832)[;
    ]   %(#808080)[//    public float rotationViewYaw;
    ]%(#808080)[//    public float prevRotationViewYaw;
    ]%(#808080)[//    public float rotationViewPitch;
    ]%(#808080)[//    public float prevRotationViewPitch;
    ]   // [font=DejaVu Sans�]T[font=DejaVu Sans�][[font=DejaVu Sans�]o[font=DejaVu Sans�][[font=DejaVu Sans�]̃p[font=DejaVu Sans�]P[font=DejaVu Sans�]%(#808080)**[font=DejaVu Sans�]g[font=DejaVu Sans���]M[font=DejaVu Sans�]J[font=DejaVu Sans�]E[font=DejaVu Sans���]%(#808080)[g
    ]   protected int UpdatePacketCounter = 5%(#cc7832)[;
    ]   // Tick[font=DejaVu Sans����]X[font=DejaVu Sans�]V[font=DejaVu Sans�]p[font=DejaVu Sans�]J[font=DejaVu Sans�]E[font=DejaVu Sans���]^[font=DejaVu Sans�]ۑ[font=DejaVu Sans�
    ]   protected int prevTickCount%(#cc7832)[;
    ]
    //    public float coasterLength; //[font=DejaVu Sans�]A[font=DejaVu Sans���]R[font=DejaVu Sans�][[font=DejaVu Sans�]X[font=DejaVu Sans�]^[font=DejaVu Sans�][[font=DejaVu Sans�]̌[font=DejaVu Sans�][font=Malgun Gothic낻][font=DejaVu Sans�][font=DejaVu Sans����
    ]
      public ERC_ModelLoadManager.ModelOptions CoasterOptions; // [font=DejaVu Sans�]R[font=DejaVu Sans�][[font=DejaVu Sans�]X[font=DejaVu Sans�]^[font=DejaVu Sans�][[font=DejaVu Sans�]̃I[font=DejaVu Sans�]v[font=DejaVu Sans�]V[font=DejaVu Sans����
    ]   public int seatsNum = -1%(#cc7832)[;
    ]   protected ERC_EntityCoasterSeat[] seats%(#cc7832)[;
    ]   public boolean updateFlag = %(#cc7832)[false;
    ]//    public Entity[ riddenByEntities = new Entity[1];
    ]
       // [font=DejaVu Sans�]A[font=DejaVu Sans���]p[font=DejaVu Sans�]p[font=DejaVu Sans�����][[font=DejaVu Sans�]%(#808080)[^
    ]   private List <erc_entitycoasterconnector>connectCoasterList = new ArrayList<erc_entitycoasterconnector>()%(#cc7832)[;
    ]
    %(#808080)[//    public AxisAlignedBB collisionAABB;
    ]
      public ERC_EntityCoaster(World world)
      {
         super(world)%(#cc7832)[;
    ]      CoasterOptions = new ModelOptions()%(#cc7832)[;
    ]      this.preventEntitySpawning = %(#cc7832)[true;
    ]      this.isCollidedHorizontally = %(#cc7832)[false;
    ]      this.isCollidedVertically = %(#cc7832)[false;
    ]      this.isCollided = %(#cc7832)[false;
    ]
          this.setSize(1.7f, 0.4f)%(#cc7832)[;
    ]      renderDistanceWeight = 1000f%(#cc7832)[;
    ]      %(#808080)[//this.yOffset = 0.0f;//(this.height / 2.0F) - 0.3F;
    ]      prevRotationRoll = rotationRoll = 0f%(#cc7832)[;
    ]      this.rotationYaw = this.prevRotationYaw = 0.0f%(#cc7832)[;
    ]      this.motionX = 0.0D%(#cc7832)[;
    ]      this.motionY = 0.0D%(#cc7832)[;
    ]      this.motionZ = 0.0D%(#cc7832)[;
    ]
         ERCPosMat = new ERC_ReturnCoasterRot()%(#cc7832)[;
    ]      Speed = 0%(#cc7832)[;
    ]      paramT = 0%(#cc7832)[;
    ]      savex = -1%(#cc7832)[;
    ]      savey = -1%(#cc7832)[;
    ]      savez = -1%(#cc7832)[;
    ]
         connectNum = 0%(#cc7832)[;
    ]      prevTickCount = -1%(#cc7832)[;
    ]
         connectCoasterList.clear()%(#cc7832)[;
    ]
         CoasterType = 0%(#cc7832)[;
    ]      seats = %(#cc7832)[null;
    ]      seatsNum = -1%(#cc7832)[;
    ]
          if(worldObj.isRemote)
         {
            ERC_ManagerCoasterLoad.*registerParentCoaster*(this)%(#cc7832)[;
    ]         if(ERC_CoasterAndRailManager.*coastersetY *> -1)
            {
               int x = ERC_CoasterAndRailManager.*coastersetX*%(#cc7832)[;
    ]            int y = ERC_CoasterAndRailManager.*coastersetY*%(#cc7832)[;
    ]            int z = ERC_CoasterAndRailManager.*coastersetZ*%(#cc7832)[;
    ]            Wrap_TileEntityRail rail = (Wrap_TileEntityRail) worldObj.getTileEntity(new BlockPos(x, y, z))%(#cc7832)[;
    ]            if(rail==null){
                  ERC_Logger.*warn*("ERC_EntityCoaster.constractor : can't get rail… xyz:"+x+"."+y+"."+z)%(#cc7832)[;
    ]%(#cc7832)[               return;
    ]            }
               tlrail = rail.getRail()%(#cc7832)[;
    ]            this.setPosition(x+0.5, y+1.0, z+0.5)%(#cc7832)[;
    ]         }
    
            if(ERC_CoasterAndRailManager.*saveModelID *> -1)
            {
               setModel(ERC_CoasterAndRailManager.*saveModelID*, CoasterType)%(#cc7832)[;
    ]            setModelOptions()%(#cc7832)[;
    ]            ERC_CoasterAndRailManager.*saveModelID *= -1%(#cc7832)[;
    ]
            }
    
         %(#808080)[// modelCoaster.render();
    ]      }
    %(#808080)[//    ERC_Logger.info("EntityCoaster:construct … modelID:"+ModelID+", CoasterType:"+CoasterType);
    ]%(#808080)[//    ERC_Logger.info("EntityCoaster:construct ... pos init2  :"+posX+"."+posY+"."+posZ);
    ]%(#808080)[//    ERC_Logger.info("EntityCoaster:construct ... aabb  :"+boundingBox.toString()+", width:"+width);
    ]   }
    
      public ERC_EntityCoaster(World world, TileEntityRailBase rail, double x, double y, double z)
      {
         this(world)%(#cc7832)[;
    ]      this.tlrail = rail%(#cc7832)[;
    ]
          this.setPosition(x, y, z)%(#cc7832)[;
    ]      this.prevPosX = x%(#cc7832)[;
    ]      this.prevPosY = y%(#cc7832)[;
    ]      this.prevPosZ = z%(#cc7832)[;
    ]
    %(#808080)[//        ERC_Logger.info("EntityCoaster:construct … pos init   :"+posX+"."+posY+"."+posZ);
    ]%(#808080)[//        ERC_Logger.info("EntityCoaster:construct2 ... aabb  :"+boundingBox.toString()+", width:"+width);
    ]   }
    
      %(#bbb529)[@Override
    ]   protected void entityInit()
      {
    %(#808080)[//        this.dataWatcher.addObject(17, new Integer(0));
    ]%(#808080)[//        this.dataWatcher.addObject(18, new Integer(1));
    ]%(#808080)[//        this.dataWatcher.addObject(19, new Float(0.0F));
    ]%(#808080)[//        this.dataWatcher.addObject(20, new Integer(0));
    ]%(#808080)[//        this.dataWatcher.addObject(21, new Integer(6));
    ]%(#808080)[//        this.dataWatcher.addObject(22, Byte.valueOf((byte)0));
    ]   }
    
      %(#808080)[// return true if kill coaster
    ]   protected boolean checkTileEntity()
      {
         TileEntity tile = worldObj.getTileEntity(new BlockPos(savex, savey, savez))%(#cc7832)[;
    ]      if(!(tile instanceof Wrap_TileEntityRail))
         {
            this.killCoaster()%(#cc7832)[;
    ]%(#cc7832)[         return true;
    ]      }
         tlrail = ((Wrap_TileEntityRail) tile).getRail()%(#cc7832)[;
    ]      savex = savey = savez = -1%(#cc7832)[;
    ]%(#cc7832)[      return false;
    ]   }
    
      %(#808080)[/*protected void setSize(float w, float h)
    ]%(#808080)[   {
    ]%(#808080)[//     w*=10.0;h*=10.0;
    ]%(#808080)[      if (w != this.width || h != this.height)
    ]%(#808080)[      {
    ]%(#808080)[         this.width = w;// + 40f;
    ]%(#808080)[         this.height = h;
    ]%(#808080)[//            this.boundingBox.maxX = this.boundingBox.minX + (double)this.width;
    ]%(#808080)[//            this.boundingBox.maxZ = this.boundingBox.minZ + (double)this.width;
    ]%(#808080)[//            this.boundingBox.maxY = this.boundingBox.minY + (double)this.height;
    ]%(#808080)[         this.boundingBox.minX = -w/2 + this.posX;
    ]%(#808080)[         this.boundingBox.minY = +h/2 + this.posY;
    ]%(#808080)[         this.boundingBox.minZ = -w/2 + this.posZ;
    ]%(#808080)[         this.boundingBox.maxX = +w/2 + this.posX;
    ]%(#808080)[         this.boundingBox.maxY = +h/2 + this.posY;
    ]%(#808080)[         this.boundingBox.maxZ = +w/2 + this.posZ;
    ]
    %(#808080)[//            if (this.width > f2 && !this.worldObj.isRemote)
    ]%(#808080)[//            {
    ]%(#808080)[//                this.moveEntity((double)(f2 - this.width), 0.0D, (double)(f2 - this.width));
    ]%(#808080)[//            }
    ]
    %(#808080)[      }
    ]
    
    %(#808080)[   }*/
    ]
      public AxisAlignedBB getCollisionBox(Entity entity)
      {
    %(#808080)[//        return entity.boundingBox;
    ]      %(#cc7832)[return null;
    ]   }
    
      public AxisAlignedBB getBoundingBox()
      {
         %(#cc7832)[return null;
    ]   }
    
      @SideOnly(Side.*CLIENT*)
      public int getBrightnessForRender(float p_70070_1_)
      {
         int i = MathHelper.*floor_double*(this.posX)%(#cc7832)[;
    ]      int j = MathHelper.*floor_double*(this.posZ)%(#cc7832)[;
    ]
          if (this.worldObj.getBlockState(new BlockPos(i, 0, j)) != null)
         {
    %(#808080)[//            double d0 = (this.boundingBox.maxY - this.boundingBox.minY) * 0.66D;
    ]         int k = MathHelper.*floor_double*(this.posY%(#808080))%(#cc7832)[;
    ]
             return this.worldObj.getLightFor(EnumSkyBlock.*BLOCK*, new BlockPos(i,k,j))%(#cc7832)[;
    ]      }
         %(#cc7832)[else
    ]      {
            return 0%(#cc7832)[;
    ]      }
      }
    
      %(#bbb529)[@Override
    ]   public boolean isInRangeToRenderDist(double p_70112_1_)
      {
         %(#cc7832)[return true;
    ]   }
    
      public Item getItem()
      {
         return ERC_Core.*ItemCoaster*%(#cc7832)[;
    ]   }
    
      public int getModelID()
      {
         return ModelID%(#cc7832)[;
    ]   }
    
      public void setModelOptions(int modelID, ModelOptions op)
      {
         if(this.ModelID == modelID)%(#cc7832)[return;
    ]      setModel(modelID, CoasterType)%(#cc7832)[;
    ]      setModelOptions(op)%(#cc7832)[;
    ]   }
    
      public void setModel(int id, int ct)
      {
         ModelID = id%(#cc7832)[;
    ]      if(!worldObj.isRemote)%(#cc7832)[return;
    ]      if(id < 0)%(#cc7832)[return;
    ]%(#808080)[//    ERC_Logger.info("EntityCoaster:setModel … set ModelID : "+id+" -> "+(id%ERC_ModelLoadManager.getModelPackNum(CoasterType))+" CoasterType:"+CoasterType);
    ]      ModelID = ModelID%ERC_ModelLoadManager.*getModelPackNum*(CoasterType)%(#cc7832)[;
    ]      modelCoaster = ERC_ModelLoadManager.*getModel*(ModelID, CoasterType)%(#cc7832)[;
    ]   }
    
      protected void setModelOptions()
      {
         // [font=DejaVu Sans���]̂Ƃ[font=DejaVu Sans��]R[font=DejaVu Sans�][[font=DejaVu Sans�]X[font=DejaVu Sans�]^[font=DejaVu Sans�][[font=DejaVu Sans�]ƘA[font=DejaVu Sans���]R[font=DejaVu Sans�][[font=DejaVu Sans�]X[font=DejaVu Sans�]^[font=DejaVu Sans�][[font=DejaVu Sans�]̃R[font=DejaVu Sans���]X[font=DejaVu Sans�]g[font=DejaVu Sans���]N[font=DejaVu Sans�]^[font=DejaVu Sans����]̂݌Ă΂[font=DejaVu Sans�]Ă[font=DejaVu Sans�]@[font=DejaVu Sans�]C[font=DejaVu Sans�]ɂȂ[font=DejaVu Sans�����]`[font=DejaVu Sans�]F[font=DejaVu Sans�]%(#808080)**[font=DejaVu Sans�]%(#808080)[N
    ]      ModelOptions op = ERC_ModelLoadManager.*getModelOP*(ModelID, CoasterType)%(#cc7832)[;
    ]      if(op==null)%(#cc7832)[return;
    ]      setModelOptions(op)%(#cc7832)[;
    ]   }
      protected void setModelOptions(ModelOptions op)
      {
         if(op.SeatNum<0)%(#cc7832)[return;
    ]      CoasterOptions = op%(#cc7832)[;
    ]      setSize(op.Width, op.Height)%(#cc7832)[;
    ]      addSeats(op)%(#cc7832)[;
    ]   }
      protected void addSeats(ModelOptions op)
      {
         seatsNum = op.SeatNum%(#cc7832)[;
    ]
          if(!worldObj.isRemote)
         {
            if(seatsNum <= 0)%(#cc7832)[return;
    ]         if(seats==null)seats = new ERC_EntityCoasterSeat[seatsNum]%(#cc7832)[;
    ]         else if(seats.length != seatsNum)seats = new ERC_EntityCoasterSeat[seatsNum]%(#cc7832)[;
    ]
             for(int i=0;i<seatsNum;++i)
            {
               seats* = new ERC_EntityCoasterSeat(worldObj, this, i)%(#cc7832)[;
    ]            seats*.setOptions(CoasterOptions, i)%(#cc7832)[;
    ]            seats*.setPosition(posX, posY, posZ)%(#cc7832)[;
    ]            worldObj.spawnEntityInWorld(seats*)%(#cc7832)[;
    ]%(#808080)[//          seats*._onUpdate();
    *]*%(#808080)[//          ERC_Logger.debugInfo(flag?"***********success":"*********************failed");
    ]         }
         }
         %(#cc7832)[else
    ]      {
            if(seats==null)seats = new ERC_EntityCoasterSeat[seatsNum]%(#cc7832)[;
    ]         else if(seats.length != seatsNum)seats = new ERC_EntityCoasterSeat[seatsNum]%(#cc7832)[;
    ]         for(int i=0;i<seats.length;++i)
            {
               if(seats*==null)%(#cc7832)[continue;
    ]            seats*.setOptions(CoasterOptions, i)%(#cc7832)[;
    ]         }
         }
      }
      // [font=DejaVu Sans�]N[font=DejaVu Sans���]C[font=DejaVu Sans�]A[font=DejaVu Sans���]g[font=DejaVu Sans���]Ŏ[font=DejaVu Sans����������][font=Microsoft Yi Baitiꂽ]Entity[font=DejaVu Sans�]̕[font=DejaVu Sansߊ]%(#808080)[l
    ]   protected void addSeat(ERC_EntityCoasterSeat seat, int index)
      {
         if(index < 0)%(#cc7832)[return;
    ]      if(seats == null)
         {
            ERC_Logger.*warn*("ERC_EntityCoaster::addSeat, seats is null")%(#cc7832)[;
    ]%(#cc7832)[         return;
    ]      }
    
         else if(seats.length <= index)%(#cc7832)[return;
    ]
         seats[index] = seat%(#cc7832)[;
    ]      seats[index].setOptions(CoasterOptions, index)%(#cc7832)[;
    ]      seat.updateFlag = this.updateFlag%(#cc7832)[;
    ]%(#808080)[//    ERC_Logger.debugInfo("EntityCaoster::addSeat… seatidx:"+index);
    ]   }
    
      public boolean resetSeat(int idx, ERC_EntityCoasterSeat seat)
      {
         if(idx < 0 || idx >= seats.length)
         {
            ERC_Logger.*warn*("EntityCoaster::resetSeat : out of index")%(#cc7832)[;
    ]%(#808080)[//       seat.setDead();
    ]         %(#cc7832)[return true;
    ]      }
         seats[idx] = seat%(#cc7832)[;
    ]%(#cc7832)[      return false;
    ]   }
    
    // public Entity[ getParts()
    ]%(#808080)[// {
    ]%(#808080)[//    return this.seats;
    ]%(#808080)[//    }
    ]
    %(#808080)[// @Override
    ]%(#808080)[// protected void setSize(float p_70105_1_, float p_70105_2_){}
    ]%(#808080)[// protected void setSize(float width, float height, float length)
    ]%(#808080)[//    {
    ]%(#808080)[////        float f2;
    ]%(#808080)[//
    ]%(#808080)[//        if (width != this.width || height != this.height || length != this.length)
    ]%(#808080)[//        {
    ]%(#808080)[////            f2 = this.width;
    ]%(#808080)[//            this.width = width;
    ]%(#808080)[//            this.height = height;
    ]%(#808080)[//            this.length = length;
    ]%(#808080)[//            this.boundingBox.minX = this.posX - (double)this.width/2f;
    ]%(#808080)[//            this.boundingBox.minZ = this.posZ - (double)this.length/2f;
    ]%(#808080)[//            this.boundingBox.minY = this.posY ;
    ]%(#808080)[//            this.boundingBox.maxX = this.boundingBox.minX + (double)this.width;
    ]%(#808080)[//            this.boundingBox.maxZ = this.boundingBox.minZ + (double)this.length;
    ]%(#808080)[//            this.boundingBox.maxY = this.boundingBox.minY + (double)this.height;
    ]%(#808080)[//
    ]%(#808080)[//            ERC_Logger.info("pos        :"+posX+"."+posY+"."+posZ);
    ]%(#808080)[//            ERC_Logger.info("boundingMin:"+boundingBox.minX+"."+boundingBox.minY+"."+boundingBox.minZ);
    ]%(#808080)[//            ERC_Logger.info("boundingMax:"+boundingBox.maxX+"."+boundingBox.maxY+"."+boundingBox.maxZ);
    ]%(#808080)[//        }
    ]%(#808080)[//    }
    ]
      %(#bbb529)[@Override
    ]   public boolean canBePushed()
      {
         %(#cc7832)[return false;
    ]   }
    
      %(#bbb529)[@Override
    ]   public boolean canBeCollidedWith()
      {
    %(#808080)[//        return !this.isDead;
    ]      %(#cc7832)[return false;
    ]   }
    
      %(#bbb529)[@Override
    ]   protected boolean canTriggerWalking()
      {
         // [font=DejaVu Sans����]Entity[font=DejaVu Sans������]Ă[font=DejaVu Sans���]%(#808080)*[font=DejaVu Sans���]%(#808080)**[font=DejaVu Sans�]N[font=DejaVu Sans��]onEntityWalking[font=DejaVu Sans���]ĂԂ[font=DejaVu Sans��]ǂ[font=DejaVu Sans���
    ]      %(#cc7832)[return false;
    ]   }
    
      protected boolean canConnectForrowingCoaster()
      {
         %(#cc7832)[return true;
    ]   }
    
      %(#629755)[*/**
    *]%(#629755)[*    * Returns the Y offset from the entity's position for any entity riding this one.
    *]%(#629755)[*    */
    *]   public double getMountedYOffset()
      {
         return (double)this.height * 0.4%(#cc7832)[;
    ]   }
    
      // [font=DejaVu Sans�]E[font=DejaVu Sans�]N[font=DejaVu Sans���]%(#808080)**[font=DejaVu Sans�]N[font=DejaVu Sans���][font=Microsoft Yi Baitiꂽ][font=DejaVu Sans�][font=DejaVu Sans��
    ]   public boolean interactFirst(EntityPlayer player)
      {
         if(requestConnectCoaster(player))%(#cc7832)[return true;
    ]%(#808080)[//     if(isRiddenSUSHI(player))return true;
    ]%(#808080)[//     if(!canBeRidden())return true;
    ]
    %(#808080)[//        if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != player)
    ]%(#808080)[//        {
    ]%(#808080)[//            return true;
    ]%(#808080)[//        }
    ]%(#808080)[//        else if (this.riddenByEntity != null && this.riddenByEntity != player)
    ]%(#808080)[//        {
    ]%(#808080)[//            return true;
    ]%(#808080)[//        }
    ]%(#808080)[//        else
    ]%(#808080)[//        {
    ]%(#808080)[//            if (!this.worldObj.isRemote)
    ]%(#808080)[//            {
    ]%(#808080)[//
    ]%(#808080)[////                player.mountEntity(this);
    ]%(#808080)[////                mountSeats(player);
    ]%(#808080)[//            }
    ]      %(#cc7832)[return true;
    ]%(#808080)[//        }
    ]   }
    
      %(#808080)[// return true to prevent any further processing.
    ]   protected boolean requestConnectCoaster(EntityPlayer player)
      {
         // [font=DejaVu Sans�]A[font=DejaVu Sans���]R[font=DejaVu Sans�][[font=DejaVu Sans�]X[font=DejaVu Sans�]^[font=DejaVu Sans�][[font=DejaVu Sans���]v[font=DejaVu Sans���]C[font=DejaVu Sans���][[font=DejaVu Sans�������]ĂȂ[font=DejaVu Sans������][font=DejaVu Sans��
    ]      if(player.getCurrentEquippedItem() == null ) %(#cc7832)[return false;
    ]      if( !(player.getCurrentEquippedItem().getItem() instanceof ERC_ItemCoasterConnector) ) %(#cc7832)[return false;
    ]
         //[font=DejaVu Sans�]N[font=DejaVu Sans���]%(#808080)**[font=DejaVu Sans�]N[font=DejaVu Sans�����]R[font=DejaVu Sans�][[font=DejaVu Sans�]X[font=DejaVu Sans�]^[font=DejaVu Sans�][[font=DejaVu Sans���]A[font=DejaVu Sans�����]‚[font=DejaVu Sans���]Ă[font=DejaVu Sans�]̂[font=DejaVu Sans���]Ȃ[font=DejaVu Sans��]Ƃ[font=DejaVu Sans���
    ]      if( !canConnectForrowingCoaster() )%(#cc7832)[return false;
    ]
         AnswerRequestConnect(player)%(#cc7832)[;
    ]%(#cc7832)[      return true;
    ]   }
    
      protected void AnswerRequestConnect(EntityPlayer player)
      {
         // [font=DejaVu Sans�]ȉ[font=DejaVu Sans����]‚[font=DejaVu Sans��]A[font=DejaVu Sans���]̉E[font=DejaVu Sans�]N[font=DejaVu Sans���]%(#808080)**[font=DejaVu Sans�]N[font=DejaVu Sans����]͂[font=DejaVu Sans����]Ȃ[font=DejaVu Sans�
    ]      if(worldObj.isRemote)
         {
            ERC_ItemCoasterConnector itemcc = (ERC_ItemCoasterConnector) player.getCurrentEquippedItem().getItem()%(#cc7832)[;
    ]         itemcc.setCoaster(tlrail.getXcoord(), tlrail.getYcoord(), tlrail.getZcoord(), this.getEntityId())%(#cc7832)[;
    ]         ERC_CoasterAndRailManager.*client_setParentCoaster*(this)%(#cc7832)[;
    ]      }
         if(!player.capabilities.isCreativeMode)–player.getCurrentEquippedItem().stackSize%(#cc7832)[;
    ]      player.swingItem()%(#cc7832)[;
    ]   }
    
      public void connectionCoaster(ERC_EntityCoasterConnector followCoaster)
      {
         if(worldObj.isRemote)
         {
    
         }
         followCoaster.parent = %(#cc7832)[this;
    ]%(#808080)[//    if(!connectCoasterList.isEmpty())connectCoasterList.get(connectCoasterList.size()-1).setNextCoasterConnect(followCoaster);
    ]      float length = this.CoasterOptions.Length%(#cc7832)[;
    ]      for(ERC_EntityCoasterConnector c : connectCoasterList)
         {
            length += c.CoasterOptions.Length%(#cc7832)[;
    ]      }
         if(followCoaster.tlrail == null)followCoaster.tlrail = this.tlrail%(#cc7832)[;
    ]      followCoaster.initConnectParamT(paramT, length)%(#cc7832)[;
    ]      connectCoasterList.add( followCoaster )%(#cc7832)[;
    ]%(#808080)[//    ERC_Logger.info("connectEntityIdx:"+followCoaster.connectIndex);
    ]      followCoaster.connectIndex = connectCoasterList.size()%(#cc7832)[;
    ]   }
    
      public void deleteConnectCoaster(ERC_EntityCoasterConnector c)
      {
         connectCoasterList.remove©%(#cc7832)[;
    ]   }
    
      public void clearConnectCoaster()
      {
         connectCoasterList.clear()%(#cc7832)[;
    ]   }
    
      protected void mountSeats(EntityPlayer player)
      {
         player.mountEntity(this)%(#cc7832)[;
    ]//    player.mountEntity(this.seats[0);
    ]   }
    
      %(#629755)[*/**
    *]%(#629755)[*    * Called when the entity is attacked.
    *]%(#629755)[*    */
    *]   %(#bbb529)[@Override
    ]   public boolean attackEntityFrom(DamageSource ds, float p_70097_2_)
      {
         boolean flag = ds.getEntity() instanceof EntityPlayer;%(#808080)[// && ((EntityPlayer)ds.getEntity()).capabilities.isCreativeMode;
    ]
         if (this.worldObj.isRemote || this.isDead)
         {
            if(ds.getEntity() instanceof EntityPlayer)this.killCoaster(!((EntityPlayer)ds.getEntity()).capabilities.isCreativeMode)%(#cc7832)[;
    ]         else this.killCoaster()%(#cc7832)[;
    ]%(#cc7832)[         return true;
    ]      }
    
         if (this.isEntityInvulnerable(DamageSource.*generic*) || this.isDead)
         {
            %(#cc7832)[return false;
    ]      }
    
    %(#808080)[//     this.setRollingDirection(-this.getRollingDirection());
    ]%(#808080)[//     this.setRollingAmplitude(10);
    ]%(#808080)[//     this.setBeenAttacked();
    ]%(#808080)[//     this.setDamage(this.getDamage() + p_70097_2_ * 10.0F);
    ]
         if (flag)
         {
            if (this.riddenByEntity != null)
            {
               this.riddenByEntity.mountEntity(this)%(#cc7832)[;
    ]         }
    
            this.killCoaster(!((EntityPlayer)ds.getEntity()).capabilities.isCreativeMode)%(#cc7832)[;
    ]      }
    
         %(#cc7832)[return true;
    ]   }
    
      public void killCoaster()
      {
         killCoaster(true)%(#cc7832)[;
    ]   }
      public void killCoaster(boolean dropflag)
      {
         if(worldObj.isRemote) return; //[font=DejaVu Sans�]N[font=DejaVu Sans���]͏[font=DejaVu Sans����]Kill[font=DejaVu Sans���]Ȃ[font=DejaVu Sans�
    ]
         if(tlrail!=null)tlrail.onDeleteCoaster()%(#cc7832)[;
    ]      tlrail = %(#cc7832)[null;
    ]      if(this.isDead)%(#cc7832)[return;
    ]
          this.setDead()%(#cc7832)[;
    ]      ItemStack itemstack = dropflag?new ItemStack(getItem(), 1):%(#cc7832)[null;
    ]
          if(itemstack!=null)
            this.entityDropItem(itemstack, 0.0F)%(#cc7832)[;
    ]
    %(#808080)[//        if(seats!=null)for(ERC_EntitySecondSeat s : seats)if(s!=null)s.setDead();
    ]
    %(#808080)[//        ERC_Logger.info("server coaster is dead : "+this.getEntityId());
    ]      if(!connectCoasterList.isEmpty())connectCoasterList.get(0).killCoaster(dropflag)%(#cc7832)[;
    ]      ERC_PacketHandler.*INSTANCE*.sendToAll(new ERC_MessageCoasterMisc(this,1))%(#cc7832)[;
    ]   }
      public void killPrevCoasters(boolean dropflag, int idx)
      {
         List <erc_entitycoasterconnector>removelist = new ArrayList<erc_entitycoasterconnector>()%(#cc7832)[;
    ]      for(ERC_EntityCoasterConnector c : connectCoasterList)
         {
            if(c.connectIndex > idx)removelist.add©%(#cc7832)[;
    ]      }
         for(ERC_EntityCoasterConnector c : removelist)
         {
            c.killCoaster(dropflag)%(#cc7832)[;
    ]         connectCoasterList.remove©%(#cc7832)[;
    ]      }
      }
      protected void killCoaster_Clientside()
      {
         if(tlrail!=null)tlrail.onDeleteCoaster()%(#cc7832)[;
    ]      tlrail = %(#cc7832)[null;
    ]      if(this.isDead)%(#cc7832)[return;
    ]      this.setDead()%(#cc7832)[;
    ]%(#808080)[//        for(ERC_EntitySecondSeat s : seats)if(s!=null)s.setDead();
    ]%(#808080)[//        ERC_Logger.info("client coaster is dead : "+this.getEntityId());
    ]      if(!connectCoasterList.isEmpty())connectCoasterList.get(0).killCoaster_Clientside()%(#cc7832)[;
    ]   }
    
      public void onChunkLoad() {} //[font=DejaVu Sans�����]Ɏg[font=DejaVu Sans���][font=DejaVu Sans��
    ]
      public void onUpdate()
      {
    %(#808080)[//    setDead();
    ]%(#808080)[//    if(!worldObj.isRemote)
    ]%(#808080)[//       ERC_Logger.info("update:"+this.getClass().getName()+"   speed:"+Speed);
    ]      syncToClient()%(#cc7832)[;
    ]      if(updateInit())%(#cc7832)[return;
    ]      savePrevData()%(#cc7832)[;
    ]
         // [font=DejaVu Sans�]}[font=DejaVu Sans��]ϐ[font=DejaVu Sans��]̍X[font=DejaVu Sans�]%(#808080)[V
    ]      updateParamT()%(#cc7832)[;
    ]      // [font=DejaVu Sans�����][[font=DejaVu Sans���]?[font=DejaVu Sans����][font=DejaVu Sans�]̐[font=Arialݒ][font=DejaVu Sans�
    ]      AdjustParamT()%(#cc7832)[;
    ]
    %(#808080)[//        ERC_Logger.info("update parent pos");
    ]
          // [font=DejaVu Sans�]V[font=DejaVu Sans�][[font=DejaVu Sans�]g[font=DejaVu Sans�]̍[font=DejaVu Sans��]W[font=DejaVu Sans�][font=Arialݒ][font=DejaVu Sans�
    ]%(#808080)[//        ERC_Logger.info("update seats pos");
    ]%(#808080)[//     if(seats!=null)
    ]%(#808080)[//    {
    ]//        for(int i=0; i<seats.length; ++i)if(seats*!="null)seats*.onUpdate(i);<br">*********
    

    et la classe test avec le block qui se render bien :
    http://pastebin.com/0HNuCfPR
    Voila, j'ai tenté de faire avec des models JSON mais impossible, merci de votre aide !</seats.length;></erc_entitycoasterconnector></erc_entitycoasterconnector></erc_entitycoasterconnector></erc_entitycoasterconnector>



  • Effectivement si tout ça est en commentaire, ça va pas se rendre : ```java
    //coaster.shouldRenderInPass(0);
    //modelCoaster
    //r.renderModel(coaster.worldObj, modelCoaster, null, coaster.getPosition(), Tessellator.getInstance().getWorldRenderer());
    //modelCoaster.render(t);

    
    Et pour les jsons tu as des logiciels très bien pour en faire, je t'invite à en rechercher ;)


  • Bonjours, oui pour les JSON j'ai MCreator (de MrCrazyFish) sauf que ce n'es pas pour les entity 😕 Le problème est que modelCoaster.render(t) n'es pas présent dans IModel, et si je passe par ModelRenderer je ne peux pas chargé le fichier .obj ou .b3d ! Merci de vos réponse !