Résolu Problème Entité Invisible
-
Bonjour,
J’ai dans l’idée de faire un vélo dans mon mod.
J’ai fait le model de mon vélo sur Techne.
Quand je pose le vélo avec l’itemBike, le vélo est invisible mais il y a une collision avec le joueur.
J’ai repris certains code du bateau vanilla.J’enregistre l’entité dans le ClientProxy.java comme ceci:
RenderingRegistry.registerEntityRenderingHandler(EntityBike.class, new RenderBike(new ModelBike(), 0.5F));
EntityBike.java
:::package com.namilowarus.phase.client; import java.util.List; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; //import net.minecraft.entity.item.EntityBoat; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.DamageSource; import net.minecraft.util.MathHelper; import net.minecraft.world.World; public class EntityBike extends Entity{ /** true if no player in boat */ private boolean isBoatEmpty; private double speedMultiplier; private int boatPosRotationIncrements; private double boatX; private double boatY; private double boatZ; private double boatYaw; private double boatPitch; @SideOnly(Side.CLIENT) private double velocityX; @SideOnly(Side.CLIENT) private double velocityY; @SideOnly(Side.CLIENT) private double velocityZ; private static final String __OBFID = "CL_00001667"; public EntityBike(World p_i1704_1_) { super(p_i1704_1_); this.isBoatEmpty = true; this.speedMultiplier = 0.07D; this.preventEntitySpawning = true; this.setSize(1.5F, 0.6F); this.yOffset = this.height / 2.0F; } /** * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to * prevent them from trampling crops */ protected boolean canTriggerWalking() { return false; } protected void entityInit() { this.dataWatcher.addObject(17, new Integer(0)); this.dataWatcher.addObject(18, new Integer(1)); this.dataWatcher.addObject(19, new Float(0.0F)); } /** * Returns a boundingBox used to collide the entity with other entities and blocks. This enables the entity to be * pushable on contact, like boats or minecarts. */ public AxisAlignedBB getCollisionBox(Entity p_70114_1_) { return p_70114_1_.boundingBox; } /** * returns the bounding box for this entity */ public AxisAlignedBB getBoundingBox() { return this.boundingBox; } /** * Returns true if this entity should push and be pushed by other entities when colliding. */ public boolean canBePushed() { return true; } public EntityBike(World p_i1705_1_, double p_i1705_2_, double p_i1705_4_, double p_i1705_6_) { this(p_i1705_1_); this.setPosition(p_i1705_2_, p_i1705_4_ + (double)this.yOffset, p_i1705_6_); this.motionX = 0.0D; this.motionY = 0.0D; this.motionZ = 0.0D; this.prevPosX = p_i1705_2_; this.prevPosY = p_i1705_4_; this.prevPosZ = p_i1705_6_; } /** * Returns the Y offset from the entity's position for any entity riding this one. */ public double getMountedYOffset() { return (double)this.height * 0.0D - 0.30000001192092896D; } /** * Called when the entity is attacked. */ public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { if (this.isEntityInvulnerable()) { return false; } else if (!this.worldObj.isRemote && !this.isDead) { this.setForwardDirection(-this.getForwardDirection()); this.setTimeSinceHit(10); this.setDamageTaken(this.getDamageTaken() + p_70097_2_ * 10.0F); this.setBeenAttacked(); boolean flag = p_70097_1_.getEntity() instanceof EntityPlayer && ((EntityPlayer)p_70097_1_.getEntity()).capabilities.isCreativeMode; if (flag || this.getDamageTaken() > 40.0F) { if (this.riddenByEntity != null) { this.riddenByEntity.mountEntity(this); } if (!flag) { this.func_145778_a(Items.boat, 1, 0.0F); } this.setDead(); } return true; } else { return true; } } /** * Setups the entity to do the hurt animation. Only used by packets in multiplayer. */ @SideOnly(Side.CLIENT) public void performHurtAnimation() { this.setForwardDirection(-this.getForwardDirection()); this.setTimeSinceHit(10); this.setDamageTaken(this.getDamageTaken() * 11.0F); } /** * Returns true if other Entities should be prevented from moving through this Entity. */ public boolean canBeCollidedWith() { return !this.isDead; } /** * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, * posY, posZ, yaw, pitch */ @SideOnly(Side.CLIENT) public void setPositionAndRotation2(double p_70056_1_, double p_70056_3_, double p_70056_5_, float p_70056_7_, float p_70056_8_, int p_70056_9_) { if (this.isBoatEmpty) { this.boatPosRotationIncrements = p_70056_9_ + 5; } else { double d3 = p_70056_1_ - this.posX; double d4 = p_70056_3_ - this.posY; double d5 = p_70056_5_ - this.posZ; double d6 = d3 * d3 + d4 * d4 + d5 * d5; if (d6 <= 1.0D) { return; } this.boatPosRotationIncrements = 3; } this.boatX = p_70056_1_; this.boatY = p_70056_3_; this.boatZ = p_70056_5_; this.boatYaw = (double)p_70056_7_; this.boatPitch = (double)p_70056_8_; this.motionX = this.velocityX; this.motionY = this.velocityY; this.motionZ = this.velocityZ; } /** * Sets the velocity to the args. Args: x, y, z */ @SideOnly(Side.CLIENT) public void setVelocity(double p_70016_1_, double p_70016_3_, double p_70016_5_) { this.velocityX = this.motionX = p_70016_1_; this.velocityY = this.motionY = p_70016_3_; this.velocityZ = this.motionZ = p_70016_5_; } /** * Called to update the entity's position/logic. */ public void onUpdate() { super.onUpdate(); if (this.getTimeSinceHit() > 0) { this.setTimeSinceHit(this.getTimeSinceHit() - 1); } if (this.getDamageTaken() > 0.0F) { this.setDamageTaken(this.getDamageTaken() - 1.0F); } this.prevPosX = this.posX; this.prevPosY = this.posY; this.prevPosZ = this.posZ; byte b0 = 5; double d0 = 0.0D; for (int i = 0; i < b0; ++i) { double d1 = this.boundingBox.minY + (this.boundingBox.maxY - this.boundingBox.minY) * (double)(i + 0) / (double)b0 - 0.125D; double d3 = this.boundingBox.minY + (this.boundingBox.maxY - this.boundingBox.minY) * (double)(i + 1) / (double)b0 - 0.125D; AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox(this.boundingBox.minX, d1, this.boundingBox.minZ, this.boundingBox.maxX, d3, this.boundingBox.maxZ); if (this.worldObj.isAABBInMaterial(axisalignedbb, Material.water)) { d0 += 1.0D / (double)b0; } } double d10 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); double d2; double d4; int j; if (d10 > 0.26249999999999996D) { d2 = Math.cos((double)this.rotationYaw * Math.PI / 180.0D); d4 = Math.sin((double)this.rotationYaw * Math.PI / 180.0D); for (j = 0; (double)j < 1.0D + d10 * 60.0D; ++j) { double d5 = (double)(this.rand.nextFloat() * 2.0F - 1.0F); double d6 = (double)(this.rand.nextInt(2) * 2 - 1) * 0.7D; double d8; double d9; if (this.rand.nextBoolean()) { d8 = this.posX - d2 * d5 * 0.8D + d4 * d6; d9 = this.posZ - d4 * d5 * 0.8D - d2 * d6; this.worldObj.spawnParticle("splash", d8, this.posY - 0.125D, d9, this.motionX, this.motionY, this.motionZ); } else { d8 = this.posX + d2 + d4 * d5 * 0.7D; d9 = this.posZ + d4 - d2 * d5 * 0.7D; this.worldObj.spawnParticle("splash", d8, this.posY - 0.125D, d9, this.motionX, this.motionY, this.motionZ); } } } double d11; double d12; if (this.worldObj.isRemote && this.isBoatEmpty) { if (this.boatPosRotationIncrements > 0) { d2 = this.posX + (this.boatX - this.posX) / (double)this.boatPosRotationIncrements; d4 = this.posY + (this.boatY - this.posY) / (double)this.boatPosRotationIncrements; d11 = this.posZ + (this.boatZ - this.posZ) / (double)this.boatPosRotationIncrements; d12 = MathHelper.wrapAngleTo180_double(this.boatYaw - (double)this.rotationYaw); this.rotationYaw = (float)((double)this.rotationYaw + d12 / (double)this.boatPosRotationIncrements); this.rotationPitch = (float)((double)this.rotationPitch + (this.boatPitch - (double)this.rotationPitch) / (double)this.boatPosRotationIncrements); –this.boatPosRotationIncrements; this.setPosition(d2, d4, d11); this.setRotation(this.rotationYaw, this.rotationPitch); } else { d2 = this.posX + this.motionX; d4 = this.posY + this.motionY; d11 = this.posZ + this.motionZ; this.setPosition(d2, d4, d11); if (this.onGround) { this.motionX *= 0.5D; this.motionY *= 0.5D; this.motionZ *= 0.5D; } this.motionX *= 0.9900000095367432D; this.motionY *= 0.949999988079071D; this.motionZ *= 0.9900000095367432D; } } else { if (d0 < 1.0D) { d2 = d0 * 2.0D - 1.0D; this.motionY += 0.03999999910593033D * d2; } else { if (this.motionY < 0.0D) { this.motionY /= 2.0D; } this.motionY += 0.007000000216066837D; } if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityLivingBase) { EntityLivingBase entitylivingbase = (EntityLivingBase)this.riddenByEntity; float f = this.riddenByEntity.rotationYaw + -entitylivingbase.moveStrafing * 90.0F; this.motionX += -Math.sin((double)(f * (float)Math.PI / 180.0F)) * this.speedMultiplier * (double)entitylivingbase.moveForward * 0.05000000074505806D; this.motionZ += Math.cos((double)(f * (float)Math.PI / 180.0F)) * this.speedMultiplier * (double)entitylivingbase.moveForward * 0.05000000074505806D; } d2 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); if (d2 > 0.35D) { d4 = 0.35D / d2; this.motionX *= d4; this.motionZ *= d4; d2 = 0.35D; } if (d2 > d10 && this.speedMultiplier < 0.35D) { this.speedMultiplier += (0.35D - this.speedMultiplier) / 35.0D; if (this.speedMultiplier > 0.35D) { this.speedMultiplier = 0.35D; } } else { this.speedMultiplier -= (this.speedMultiplier - 0.07D) / 35.0D; if (this.speedMultiplier < 0.07D) { this.speedMultiplier = 0.07D; } } int l; for (l = 0; l < 4; ++l) { int i1 = MathHelper.floor_double(this.posX + ((double)(l % 2) - 0.5D) * 0.8D); j = MathHelper.floor_double(this.posZ + ((double)(l / 2) - 0.5D) * 0.8D); for (int j1 = 0; j1 < 2; ++j1) { int k = MathHelper.floor_double(this.posY) + j1; Block block = this.worldObj.getBlock(i1, k, j); if (block == Blocks.snow_layer) { this.worldObj.setBlockToAir(i1, k, j); this.isCollidedHorizontally = false; } else if (block == Blocks.waterlily) { this.worldObj.func_147480_a(i1, k, j, true); this.isCollidedHorizontally = false; } } } if (this.onGround) { this.motionX *= 0.5D; this.motionY *= 0.5D; this.motionZ *= 0.5D; } this.moveEntity(this.motionX, this.motionY, this.motionZ); if (this.isCollidedHorizontally && d10 > 0.2D) { if (!this.worldObj.isRemote && !this.isDead) { this.setDead(); for (l = 0; l < 3; ++l) { this.func_145778_a(Item.getItemFromBlock(Blocks.planks), 1, 0.0F); } for (l = 0; l < 2; ++l) { this.func_145778_a(Items.stick, 1, 0.0F); } } } else { this.motionX *= 0.9900000095367432D; this.motionY *= 0.949999988079071D; this.motionZ *= 0.9900000095367432D; } this.rotationPitch = 0.0F; d4 = (double)this.rotationYaw; d11 = this.prevPosX - this.posX; d12 = this.prevPosZ - this.posZ; if (d11 * d11 + d12 * d12 > 0.001D) { d4 = (double)((float)(Math.atan2(d12, d11) * 180.0D / Math.PI)); } double d7 = MathHelper.wrapAngleTo180_double(d4 - (double)this.rotationYaw); if (d7 > 20.0D) { d7 = 20.0D; } if (d7 < -20.0D) { d7 = -20.0D; } this.rotationYaw = (float)((double)this.rotationYaw + d7); this.setRotation(this.rotationYaw, this.rotationPitch); if (!this.worldObj.isRemote) { List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(0.20000000298023224D, 0.0D, 0.20000000298023224D)); if (list != null && !list.isEmpty()) { for (int k1 = 0; k1 < list.size(); ++k1) { Entity entity = (Entity)list.get(k1); if (entity != this.riddenByEntity && entity.canBePushed() && entity instanceof EntityBike) { entity.applyEntityCollision(this); } } } if (this.riddenByEntity != null && this.riddenByEntity.isDead) { this.riddenByEntity = null; } } } } public void updateRiderPosition() { if (this.riddenByEntity != null) { double d0 = Math.cos((double)this.rotationYaw * Math.PI / 180.0D) * 0.4D; double d1 = Math.sin((double)this.rotationYaw * Math.PI / 180.0D) * 0.4D; this.riddenByEntity.setPosition(this.posX + d0, this.posY + this.getMountedYOffset() + this.riddenByEntity.getYOffset(), this.posZ + d1); } } /** * (abstract) Protected helper method to write subclass entity data to NBT. */ protected void writeEntityToNBT(NBTTagCompound p_70014_1_) {} /** * (abstract) Protected helper method to read subclass entity data from NBT. */ protected void readEntityFromNBT(NBTTagCompound p_70037_1_) {} @SideOnly(Side.CLIENT) public float getShadowSize() { return 0.0F; } /** * First layer of player interaction */ public boolean interactFirst(EntityPlayer p_130002_1_) { if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != p_130002_1_) { return true; } else { if (!this.worldObj.isRemote) { p_130002_1_.mountEntity(this); } return true; } } /** * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround */ protected void updateFallState(double p_70064_1_, boolean p_70064_3_) { int i = MathHelper.floor_double(this.posX); int j = MathHelper.floor_double(this.posY); int k = MathHelper.floor_double(this.posZ); if (p_70064_3_) { if (this.fallDistance > 3.0F) { this.fall(this.fallDistance); if (!this.worldObj.isRemote && !this.isDead) { this.setDead(); int l; for (l = 0; l < 3; ++l) { this.func_145778_a(Item.getItemFromBlock(Blocks.planks), 1, 0.0F); } for (l = 0; l < 2; ++l) { this.func_145778_a(Items.stick, 1, 0.0F); } } this.fallDistance = 0.0F; } } else if (this.worldObj.getBlock(i, j - 1, k).getMaterial() != Material.water && p_70064_1_ < 0.0D) { this.fallDistance = (float)((double)this.fallDistance - p_70064_1_); } } /** * Sets the damage taken from the last hit. */ public void setDamageTaken(float p_70266_1_) { this.dataWatcher.updateObject(19, Float.valueOf(p_70266_1_)); } /** * Gets the damage taken from the last hit. */ public float getDamageTaken() { return this.dataWatcher.getWatchableObjectFloat(19); } /** * Sets the time to count down from since the last time entity was hit. */ public void setTimeSinceHit(int p_70265_1_) { this.dataWatcher.updateObject(17, Integer.valueOf(p_70265_1_)); } /** * Gets the time since the last hit. */ public int getTimeSinceHit() { return this.dataWatcher.getWatchableObjectInt(17); } /** * Sets the forward direction of the entity. */ public void setForwardDirection(int p_70269_1_) { this.dataWatcher.updateObject(18, Integer.valueOf(p_70269_1_)); } /** * Gets the forward direction of the entity. */ public int getForwardDirection() { return this.dataWatcher.getWatchableObjectInt(18); } /** * true if no player in boat */ @SideOnly(Side.CLIENT) public void setIsBoatEmpty(boolean p_70270_1_) { this.isBoatEmpty = p_70270_1_; } }
:::
RenderBike.java
:::package com.namilowarus.phase.client; import org.lwjgl.opengl.GL11; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.model.ModelBase; //import net.minecraft.client.model.ModelBoat; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.entity.Entity; //import net.minecraft.entity.item.EntityBoat; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; @SideOnly(Side.CLIENT) public class RenderBike extends Render { private static final ResourceLocation boatTextures = new ResourceLocation("pm:textures/entity/bike.png"); /** instance of ModelBoat for rendering */ protected ModelBase modelBoat; private static final String __OBFID = "CL_00000981"; public RenderBike(ModelBike modelBike, float f) { } /** * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic * (Render<t extends="" entity)="" and="" this="" method="" has="" signature="" public="" void="" func_76986_a(t="" entity,="" double="" d,="" d1,<br=""> * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that. */ public void doRender(EntityBike p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) { GL11.glPushMatrix(); GL11.glTranslatef((float)p_76986_2_, (float)p_76986_4_, (float)p_76986_6_); GL11.glRotatef(180.0F - p_76986_8_, 0.0F, 1.0F, 0.0F); float f2 = (float)p_76986_1_.getTimeSinceHit() - p_76986_9_; float f3 = p_76986_1_.getDamageTaken() - p_76986_9_; if (f3 < 0.0F) { f3 = 0.0F; } if (f2 > 0.0F) { GL11.glRotatef(MathHelper.sin(f2) * f2 * f3 / 10.0F * (float)p_76986_1_.getForwardDirection(), 1.0F, 0.0F, 0.0F); } float f4 = 0.75F; GL11.glScalef(f4, f4, f4); GL11.glScalef(1.0F / f4, 1.0F / f4, 1.0F / f4); this.bindEntityTexture(p_76986_1_); GL11.glScalef(-1.0F, -1.0F, 1.0F); this.modelBoat.render(p_76986_1_, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); } /** * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. */ protected ResourceLocation getEntityTexture(EntityBike p_110775_1_) { return boatTextures; } /** * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. */ protected ResourceLocation getEntityTexture(Entity p_110775_1_) { return this.getEntityTexture((EntityBike)p_110775_1_); } /* * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic * (Render<t extends="" entity)="" and="" this="" method="" has="" signature="" public="" void="" func_76986_a(t="" entity,="" double="" d,="" d1,<br=""> * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that. */ public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) { this.doRender((EntityBike)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); } }
:::</t></t>
-
Le problème est seulement que le vélo est invisible ? Peux-tu y monter dessus et le diriger ?
-
Il est invisible, il y a seulement une collision et je ne peux pas monter dessus.
-
Je te conseille dans un premier temps d’essayer de faire un rendu correct de ton vélo sans copier-coller les classes de minecraft mais n’étant pas très expérimenté, je te conseille aussi d’attendre les réponses des autres membres avant de faire des modifications majeures
-
Tu peux aussi faire voir la classe model ? Supprime pour voir le fichier qui contiens la texture de ton vélo. Ensuite, petit conseil met au propre ton code, supprime les commentaires et renomme les paramètres, ton code gagnera en propreté.
-
En retirant la texture, rien ne change. Toujours le même problème.
Voilà le model, il vient de Techne. Le model me faisait crash, j’ai désactivé 2 lignes armature1.mirror et ça démarre.
:::package com.namilowarus.phase.client; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; public class ModelBike extends ModelBase { //fields ModelRenderer BasRA; ModelRenderer CentreRA; ModelRenderer HautRA; ModelRenderer GRA; ModelRenderer DRA; ModelRenderer CentreBRA; ModelRenderer Arc1RA; ModelRenderer Arc2RA; ModelRenderer EntreArcHRA; ModelRenderer SupportGuid; ModelRenderer BouleGuid; ModelRenderer Armature1; ModelRenderer GuidManche; ModelRenderer Armature2; ModelRenderer Armature3; ModelRenderer BasRR; ModelRenderer CentreRR; ModelRenderer GRR; ModelRenderer DRR; ModelRenderer HautRR; ModelRenderer CentreBRR; ModelRenderer Arc1RR; ModelRenderer Arc2RR; ModelRenderer BatonSelle; ModelRenderer Chaine1; ModelRenderer BatonSelle2; ModelRenderer Chaine2; ModelRenderer Shape1; public ModelBike() { textureWidth = 64; textureHeight = 64; BasRA = new ModelRenderer(this, 0, 0); BasRA.addBox(0F, 0F, 0F, 8, 1, 1); BasRA.setRotationPoint(-4F, 23F, 0F); BasRA.setTextureSize(64, 32); BasRA.mirror = true; setRotation(BasRA, 0F, 0F, 0F); CentreRA = new ModelRenderer(this, 0, 0); CentreRA.addBox(0F, 0F, 0F, 10, 10, 1); CentreRA.setRotationPoint(-5F, 13F, 0F); CentreRA.setTextureSize(64, 32); CentreRA.mirror = true; setRotation(CentreRA, 0F, 0F, 0F); HautRA = new ModelRenderer(this, 0, 0); HautRA.addBox(0F, 0F, 0F, 8, 1, 1); HautRA.setRotationPoint(-4F, 12F, 0F); HautRA.setTextureSize(64, 32); HautRA.mirror = true; setRotation(HautRA, 0F, 0F, 0F); GRA = new ModelRenderer(this, 0, 0); GRA.addBox(0F, 0F, 0F, 1, 8, 1); GRA.setRotationPoint(-6F, 14F, 0F); GRA.setTextureSize(64, 32); GRA.mirror = true; setRotation(GRA, 0F, 0F, 0F); DRA = new ModelRenderer(this, 0, 0); DRA.addBox(0F, 0F, 0F, 1, 8, 1); DRA.setRotationPoint(5F, 14F, 0F); DRA.setTextureSize(64, 32); DRA.mirror = true; setRotation(DRA, 0F, 0F, 0F); CentreBRA = new ModelRenderer(this, 0, 0); CentreBRA.addBox(0F, 0F, 0F, 1, 1, 3); CentreBRA.setRotationPoint(0F, 17F, -1F); CentreBRA.setTextureSize(64, 32); CentreBRA.mirror = true; setRotation(CentreBRA, 0F, 0F, 0F); Arc1RA = new ModelRenderer(this, 0, 0); Arc1RA.addBox(0F, 0F, 0F, 1, 8, 1); Arc1RA.setRotationPoint(0F, 10F, 2F); Arc1RA.setTextureSize(64, 32); Arc1RA.mirror = true; setRotation(Arc1RA, 0F, 0F, 0F); Arc2RA = new ModelRenderer(this, 0, 0); Arc2RA.addBox(0F, 0F, 0F, 1, 8, 1); Arc2RA.setRotationPoint(0F, 10F, -2F); Arc2RA.setTextureSize(64, 32); Arc2RA.mirror = true; setRotation(Arc2RA, 0F, 0F, 0F); EntreArcHRA = new ModelRenderer(this, 0, 0); EntreArcHRA.addBox(0F, 0F, 0F, 1, 1, 3); EntreArcHRA.setRotationPoint(0F, 10F, -1F); EntreArcHRA.setTextureSize(64, 32); EntreArcHRA.mirror = true; setRotation(EntreArcHRA, 0F, 0F, 0F); SupportGuid = new ModelRenderer(this, 0, 0); SupportGuid.addBox(0F, 0F, 0F, 1, 5, 1); SupportGuid.setRotationPoint(-2F, 6F, 0F); SupportGuid.setTextureSize(64, 32); SupportGuid.mirror = true; setRotation(SupportGuid, 0F, 0F, -0.4363323F); BouleGuid = new ModelRenderer(this, 0, 0); BouleGuid.addBox(0F, 0F, 0F, 2, 2, 2); BouleGuid.setRotationPoint(-3F, 4F, -0.5333334F); BouleGuid.setTextureSize(64, 32); BouleGuid.mirror = true; setRotation(BouleGuid, 0F, 0F, 0F); //Armature1.mirror = true; Armature1 = new ModelRenderer(this, 0, 0); Armature1.addBox(0F, 0F, 0F, 18, 1, 1); Armature1.setRotationPoint(-1F, 8F, 0F); Armature1.setTextureSize(64, 32); Armature1.mirror = true; setRotation(Armature1, 0F, 0F, 3.0251F); //Armature1.mirror = false; GuidManche = new ModelRenderer(this, 0, 0); GuidManche.addBox(0F, 0F, 0F, 1, 1, 9); GuidManche.setRotationPoint(-2.5F, 4.5F, -4F); GuidManche.setTextureSize(64, 32); GuidManche.mirror = true; setRotation(GuidManche, 0F, 0F, 0F); Armature2 = new ModelRenderer(this, 0, 0); Armature2.addBox(0F, 0F, 0F, 21, 1, 1); Armature2.setRotationPoint(-18F, 19F, 0F); Armature2.setTextureSize(64, 32); Armature2.mirror = true; setRotation(Armature2, 0F, 0F, -0.5934119F); Armature3 = new ModelRenderer(this, 0, 0); Armature3.addBox(0F, 0F, 0F, 13, 1, 1); Armature3.setRotationPoint(-18F, 20F, 0F); Armature3.setTextureSize(64, 32); Armature3.mirror = true; setRotation(Armature3, 0F, 0F, -1.745949F); BasRR = new ModelRenderer(this, 0, 0); BasRR.addBox(0F, 0F, 0F, 8, 1, 1); BasRR.setRotationPoint(-30F, 23F, 0F); BasRR.setTextureSize(64, 32); BasRR.mirror = true; setRotation(BasRR, 0F, 0F, 0F); CentreRR = new ModelRenderer(this, 0, 0); CentreRR.addBox(0F, 0F, 0F, 10, 10, 1); CentreRR.setRotationPoint(-31F, 13F, 0F); CentreRR.setTextureSize(64, 32); CentreRR.mirror = true; setRotation(CentreRR, 0F, 0F, 0F); GRR = new ModelRenderer(this, 0, 0); GRR.addBox(0F, 0F, 0F, 1, 8, 1); GRR.setRotationPoint(-21F, 14F, 0F); GRR.setTextureSize(64, 32); GRR.mirror = true; setRotation(GRR, 0F, 0F, 0F); DRR = new ModelRenderer(this, 0, 0); DRR.addBox(0F, 0F, 0F, 1, 8, 1); DRR.setRotationPoint(-32F, 14F, 0F); DRR.setTextureSize(64, 32); DRR.mirror = true; setRotation(DRR, 0F, 0F, 0F); HautRR = new ModelRenderer(this, 0, 0); HautRR.addBox(0F, 0F, 0F, 8, 1, 1); HautRR.setRotationPoint(-30F, 12F, 0F); HautRR.setTextureSize(64, 32); HautRR.mirror = true; setRotation(HautRR, 0F, 0F, 0F); CentreBRR = new ModelRenderer(this, 0, 0); CentreBRR.addBox(0F, 0F, 0F, 1, 1, 5); CentreBRR.setRotationPoint(-26F, 17F, -2F); CentreBRR.setTextureSize(64, 32); CentreBRR.mirror = true; setRotation(CentreBRR, 0F, 0F, 0F); Arc1RR = new ModelRenderer(this, 0, 0); Arc1RR.addBox(0F, 0F, 0F, 1, 11, 1); Arc1RR.setRotationPoint(-25F, 18F, -2F); Arc1RR.setTextureSize(64, 32); Arc1RR.mirror = true; setRotation(Arc1RR, 0F, 0F, -2.548181F); Arc2RR = new ModelRenderer(this, 0, 0); Arc2RR.addBox(0F, 0F, 0F, 1, 11, 1); Arc2RR.setRotationPoint(-25F, 18F, 2F); Arc2RR.setTextureSize(64, 32); Arc2RR.mirror = true; setRotation(Arc2RR, 0F, 0F, -2.548181F); BatonSelle = new ModelRenderer(this, 0, 0); BatonSelle.addBox(0F, 0F, 0F, 1, 1, 5); BatonSelle.setRotationPoint(-20F, 8.5F, -2F); BatonSelle.setTextureSize(64, 32); BatonSelle.mirror = true; setRotation(BatonSelle, 0F, 0F, 0F); Chaine1 = new ModelRenderer(this, 0, 0); Chaine1.addBox(0F, 0F, 0F, 1, 9, 1); Chaine1.setRotationPoint(-26F, 18F, 2F); Chaine1.setTextureSize(64, 32); Chaine1.mirror = true; setRotation(Chaine1, 0F, 0F, -1.361357F); BatonSelle2 = new ModelRenderer(this, 0, 0); BatonSelle2.addBox(0F, 0F, 0F, 1, 1, 5); BatonSelle2.setRotationPoint(-18F, 19F, -2F); BatonSelle2.setTextureSize(64, 32); BatonSelle2.mirror = true; setRotation(BatonSelle2, 0F, 0F, 0F); Chaine2 = new ModelRenderer(this, 0, 0); Chaine2.addBox(0F, 0F, 0F, 1, 9, 1); Chaine2.setRotationPoint(-26F, 18F, -2F); Chaine2.setTextureSize(64, 32); Chaine2.mirror = true; setRotation(Chaine2, 0F, 0F, -1.361357F); Shape1 = new ModelRenderer(this, 0, 0); Shape1.addBox(0F, 0F, 0F, 4, 1, 3); Shape1.setRotationPoint(-21F, 6.5F, -1F); Shape1.setTextureSize(64, 32); Shape1.mirror = true; setRotation(Shape1, 0F, 0F, -0.1396263F); } 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); BasRA.render(f5); CentreRA.render(f5); HautRA.render(f5); GRA.render(f5); DRA.render(f5); CentreBRA.render(f5); Arc1RA.render(f5); Arc2RA.render(f5); EntreArcHRA.render(f5); SupportGuid.render(f5); BouleGuid.render(f5); Armature1.render(f5); GuidManche.render(f5); Armature2.render(f5); Armature3.render(f5); BasRR.render(f5); CentreRR.render(f5); GRR.render(f5); DRR.render(f5); HautRR.render(f5); CentreBRR.render(f5); Arc1RR.render(f5); Arc2RR.render(f5); BatonSelle.render(f5); Chaine1.render(f5); BatonSelle2.render(f5); Chaine2.render(f5); Shape1.render(f5); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } }
:::
-
Alors, tout d’abord ton model est correct comme tu peux le voir :
Le problème viens peut-être de la fonction doRender appelée dans la classe RenderBike ? Je ne sais pas …
-
J’ai légèrement changé la fonction, toujours pas de rendu.
Je n’ai pas trop compris comment marcher le système de rendu, si quelqu’un veut bien m’expliquer, svp.public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) { GL11.glPushMatrix(); GL11.glTranslatef((float)p_76986_2_, (float)p_76986_4_, (float)p_76986_6_); GL11.glRotatef(180.0F - p_76986_8_, 0.0F, 1.0F, 0.0F); float f2 = ((EntityBike) p_76986_1_).getTimeSinceHit() - p_76986_9_; float f3 = ((EntityBike) p_76986_1_).getDamageTaken() - p_76986_9_; if (f3 < 0.0F) { f3 = 0.0F; } if (f2 > 0.0F) { GL11.glRotatef(MathHelper.sin(f2) * f2 * f3 / 10.0F * ((EntityBike) p_76986_1_).getForwardDirection(), 1.0F, 0.0F, 0.0F); } float f4 = 0.75F; GL11.glScalef(f4, f4, f4); GL11.glScalef(1.0F / f4, 1.0F / f4, 1.0F / f4); this.bindEntityTexture(p_76986_1_); GL11.glScalef(-1.0F, -1.0F, 1.0F); this.modelBoat.render(p_76986_1_, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); }
-
Ajoutes un @Override au dessus de la méthode, si eclipse indique une erreur c’est que la méthode n’existe pas dans la classe mère et donc que ce n’est pas la bonne.
Ajoutes aussi un System.out.println(“quelque chose”) pour vérifier que la méthode est appelé. -
En ajoutant un @Override, eclipse indique une erreur.
Dans la classe mère il y a cette fonction:public abstract void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_);
Ma fonction est celle-ci:
public void doRender(EntityBike p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) { System.out.println("Appel doRender"); GL11.glPushMatrix(); GL11.glTranslatef((float)p_76986_2_, (float)p_76986_4_, (float)p_76986_6_); GL11.glRotatef(180.0F - p_76986_8_, 0.0F, 1.0F, 0.0F); float f2 = (float)p_76986_1_.getTimeSinceHit() - p_76986_9_; float f3 = p_76986_1_.getDamageTaken() - p_76986_9_; if (f3 < 0.0F) { f3 = 0.0F; } if (f2 > 0.0F) { GL11.glRotatef(MathHelper.sin(f2) * f2 * f3 / 10.0F * (float)p_76986_1_.getForwardDirection(), 1.0F, 0.0F, 0.0F); } float f4 = 0.75F; GL11.glScalef(f4, f4, f4); GL11.glScalef(1.0F / f4, 1.0F / f4, 1.0F / f4); this.bindEntityTexture(p_76986_1_); GL11.glScalef(-1.0F, -1.0F, 1.0F); this.modelBike.render(p_76986_1_, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); }
Et je l’appel avec ça:
public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) { this.doRender((EntityBike)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); }
Bordi me dit qu’il faudrait voir du coté de la fonction doRender, mais je ne vois pas.
-
Il aurait fallut mettre le @Override sur le deuxième doRender (celui avec Entity en premier paramètre), visiblement le problème n’est pas là.
Et avec un System.out.println ça donne quoi ? -
Je viens de tester avec le Override sur le doRender avec Entity. Pas d’erreur Eclipse.
Avec le ```java
System.out.println(“Appel doRender”);Et toujours le même bug d'entité.
-
Classe principale + Client proxy ?
-
En ce qui concerne le vélo, Dans le ClientProxy et la classe Principale je n’ai ajouté que cela:
@Override public void registerRender(){ System.out.println("méthode côté client"); RenderingRegistry.registerEntityRenderingHandler(EntityBike.class, new RenderBike(new ModelBike(), 0.5F)); }
proxy.registerRender();
-
C’est vraiment étrange, ta fonction devrait normalement être appelé. Je peux avoir la ligne où tu déclares ton proxy ?
-
Les proxy sont déclarés dans la classe principale:
@SidedProxy(clientSide = "com.namilowarus.phase.client.ClientProxy", serverSide = "com.namilowarus.phase.common.CommonProxy") public static CommonProxy proxy;
Peut-être faut-il rajouter des EntityRegistry.registerGlobalEntityID ou EntityRegistry.registerModEntity pour enregistrer l’entité.
EDIT: J’ai essayé, quand je pose le vélo, le jeu crash. -
Ah oui, si ton entité n’est pas enregistré …
Envoie le rapport de crash. -
L’erreur est bien sur le doRender
Voilà le crash-report::::
–-- Minecraft Crash Report ---- // Hi. I'm Minecraft, and I'm a crashaholic. Time: 22/04/15 21:39 Description: Rendering entity in world java.lang.NullPointerException: Rendering entity in world at com.namilowarus.phase.client.RenderBike.doRender(RenderBike.java:58) at com.namilowarus.phase.client.RenderBike.doRender(RenderBike.java:81) at net.minecraft.client.renderer.entity.RenderManager.func_147939_a(RenderManager.java:300) at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:278) at net.minecraft.client.renderer.entity.RenderManager.renderEntitySimple(RenderManager.java:251) at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:527) at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1300) at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1087) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1056) at net.minecraft.client.Minecraft.run(Minecraft.java:951) at net.minecraft.client.main.Main.main(Main.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) at GradleStart.main(Unknown Source) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at com.namilowarus.phase.client.RenderBike.doRender(RenderBike.java:58) at com.namilowarus.phase.client.RenderBike.doRender(RenderBike.java:81) -- Entity being rendered -- Details: Entity Type: entityBike (com.namilowarus.phase.client.EntityBike) Entity ID: 195 Entity Name: entity.entityBike.name Entity's Exact location: -378,50, 71,58, 1023,50 Entity's Block location: World: (-379,71,1023), Chunk: (at 5,4,15 in -24,63; contains blocks -384,0,1008 to -369,255,1023), Region: (-1,1; contains chunks -32,32 to -1,63, blocks -512,0,512 to -1,255,1023) Entity's Momentum: 0,00, 0,00, 0,00 -- Renderer details -- Details: Assigned renderer: com.namilowarus.phase.client.RenderBike@d5d9d92 Location: 2,24,-2,04,1,18 - World: (2,-3,1), Chunk: (at 2,-1,1 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511) Rotation: -180.0 Delta: 0.12956238 Stacktrace: at net.minecraft.client.renderer.entity.RenderManager.func_147939_a(RenderManager.java:300) at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:278) at net.minecraft.client.renderer.entity.RenderManager.renderEntitySimple(RenderManager.java:251) at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:527) at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1300) -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityClientPlayerMP['Player777'/194, l='MpServer', x=-380,74, y=73,62, z=1022,32]] Chunk stats: MultiplayerChunkCache: 110, 110 Level seed: 0 Level generator: ID 00 - default, ver 1\. Features enabled: false Level generator options: Level spawn location: World: (132,64,244), Chunk: (at 4,4,4 in 8,15; contains blocks 128,0,240 to 143,255,255), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511) Level time: 128129 game time, 128129 day time Level dimension: 0 Level storage version: 0x00000 - Unknown? Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false) Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false Forced entities: 120 total; [EntityCreeper['Creeper'/256, l='MpServer', x=-445,22, y=57,00, z=1020,09], EntityZombie['Zombie'/257, l='MpServer', x=-439,25, y=57,00, z=1020,38], EntityZombie['Zombie'/258, l='MpServer', x=-440,06, y=57,00, z=1020,69], EntityItem['item.item.egg'/259, l='MpServer', x=-433,22, y=66,13, z=1008,47], EntityChicken['Chicken'/260, l='MpServer', x=-440,69, y=66,00, z=1021,53], EntityCreeper['Creeper'/261, l='MpServer', x=-370,59, y=65,00, z=945,94], EntityChicken['Chicken'/262, l='MpServer', x=-316,56, y=69,00, z=1010,53], EntityCreeper['Creeper'/263, l='MpServer', x=-433,50, y=12,00, z=1028,50], EntityBat['Bat'/264, l='MpServer', x=-434,66, y=14,47, z=1034,48], EntityBat['Bat'/265, l='MpServer', x=-436,53, y=16,10, z=1031,94], EntityCreeper['Creeper'/266, l='MpServer', x=-439,50, y=57,00, z=1031,44], EntityCreeper['Creeper'/267, l='MpServer', x=-446,34, y=57,00, z=1026,03], EntityZombie['Zombie'/268, l='MpServer', x=-436,00, y=57,00, z=1029,53], EntitySpider['Spider'/269, l='MpServer', x=-440,00, y=57,00, z=1032,63], EntitySkeleton['Skeleton'/270, l='MpServer', x=-446,34, y=57,00, z=1025,03], EntitySkeleton['Skeleton'/271, l='MpServer', x=-384,69, y=63,00, z=955,88], EntitySkeleton['Skeleton'/272, l='MpServer', x=-385,72, y=63,00, z=956,75], EntitySheep['Sheep'/273, l='MpServer', x=-395,47, y=83,00, z=950,16], EntitySheep['Sheep'/274, l='MpServer', x=-399,64, y=80,00, z=946,27], EntityZombie['Zombie'/275, l='MpServer', x=-309,94, y=31,00, z=993,25], EntityCreeper['Creeper'/276, l='MpServer', x=-425,50, y=40,00, z=1057,50], EntitySkeleton['Skeleton'/277, l='MpServer', x=-330,50, y=33,00, z=1058,50], EntityBat['Bat'/278, l='MpServer', x=-400,69, y=63,01, z=1085,26], EntityZombie['Zombie'/279, l='MpServer', x=-438,50, y=11,00, z=1050,84], EntityZombie['Zombie'/280, l='MpServer', x=-432,50, y=16,00, z=1043,50], EntitySkeleton['Skeleton'/281, l='MpServer', x=-438,09, y=16,00, z=1042,50], EntityCreeper['Creeper'/282, l='MpServer', x=-436,50, y=57,00, z=1040,50], EntityCreeper['Creeper'/283, l='MpServer', x=-433,03, y=57,00, z=1040,34], EntitySheep['Sheep'/284, l='MpServer', x=-338,53, y=75,00, z=956,84], EntityChicken['Chicken'/285, l='MpServer', x=-317,41, y=67,00, z=1047,59], EntityItem['item.item.egg'/287, l='MpServer', x=-337,09, y=70,13, z=1076,78], EntityChicken['Chicken'/288, l='MpServer', x=-337,84, y=69,00, z=1079,84], EntityBat['Bat'/289, l='MpServer', x=-431,18, y=14,95, z=1067,79], EntitySquid['Squid'/290, l='MpServer', x=-435,50, y=59,38, z=1065,45], EntitySquid['Squid'/291, l='MpServer', x=-435,70, y=60,06, z=1063,96], EntitySquid['Squid'/292, l='MpServer', x=-433,28, y=60,40, z=1067,79], EntitySquid['Squid'/293, l='MpServer', x=-437,28, y=60,25, z=1065,38], EntitySquid['Squid'/294, l='MpServer', x=-431,72, y=60,19, z=1064,60], EntitySheep['Sheep'/295, l='MpServer', x=-452,56, y=68,00, z=1012,61], EntityChicken['Chicken'/298, l='MpServer', x=-321,56, y=71,00, z=1080,59], EntitySheep['Sheep'/299, l='MpServer', x=-456,19, y=63,00, z=1002,81], EntitySheep['Sheep'/300, l='MpServer', x=-393,53, y=87,00, z=943,34], EntityZombie['Zombie'/303, l='MpServer', x=-411,66, y=17,00, z=1102,34], EntityChicken['Chicken'/307, l='MpServer', x=-342,55, y=62,26, z=1099,59], EntityCreeper['Creeper'/309, l='MpServer', x=-433,31, y=14,00, z=1074,31], EntityZombie['Zombie'/310, l='MpServer', x=-436,22, y=14,00, z=1074,78], EntityZombie['Zombie'/311, l='MpServer', x=-433,91, y=14,00, z=1075,16], EntityZombie['Zombie'/312, l='MpServer', x=-440,44, y=22,00, z=1085,02], EntitySkeleton['Skeleton'/313, l='MpServer', x=-433,66, y=15,00, z=1081,50], EntitySkeleton['Skeleton'/314, l='MpServer', x=-436,06, y=15,00, z=1078,53], EntityCreeper['Creeper'/315, l='MpServer', x=-432,52, y=16,00, z=1078,02], EntitySheep['Sheep'/316, l='MpServer', x=-438,50, y=69,00, z=1080,19], EntityZombie['Zombie'/317, l='MpServer', x=-309,50, y=54,00, z=1083,03], EntitySkeleton['Skeleton'/319, l='MpServer', x=-323,50, y=57,00, z=1092,50], EntityChicken['Chicken'/320, l='MpServer', x=-331,44, y=67,23, z=1100,47], EntityZombie['Zombie'/330, l='MpServer', x=-442,97, y=18,87, z=1092,53], EntitySheep['Sheep'/331, l='MpServer', x=-440,78, y=68,87, z=1096,19], EntityZombie['Zombie'/332, l='MpServer', x=-452,09, y=22,87, z=1087,53], EntityClientPlayerMP['Player777'/194, l='MpServer', x=-380,74, y=73,62, z=1022,32], EntityBike['entity.entityBike.name'/195, l='MpServer', x=-378,50, y=71,58, z=1023,50], EntityCreeper['Creeper'/196, l='MpServer', x=-399,31, y=47,00, z=1023,31], EntityZombie['Zombie'/197, l='MpServer', x=-374,88, y=13,00, z=1037,69], EntityZombie['Zombie'/198, l='MpServer', x=-379,00, y=14,00, z=1030,44], EntityZombie['Zombie'/199, l='MpServer', x=-394,38, y=32,00, z=999,03], EntityChicken['Chicken'/200, l='MpServer', x=-395,63, y=63,00, z=1003,06], EntityZombie['Zombie'/201, l='MpServer', x=-367,50, y=15,00, z=1030,50], EntityBat['Bat'/202, l='MpServer', x=-357,34, y=19,10, z=1026,75], EntityBat['Bat'/203, l='MpServer', x=-355,75, y=18,10, z=1027,75], EntitySkeleton['Skeleton'/204, l='MpServer', x=-358,50, y=34,00, z=1036,16], EntityChicken['Chicken'/205, l='MpServer', x=-358,44, y=70,00, z=1035,59], EntityItem['item.item.egg'/206, l='MpServer', x=-358,47, y=70,13, z=1036,72], EntityChicken['Chicken'/207, l='MpServer', x=-356,47, y=70,00, z=1036,53], EntityBat['Bat'/208, l='MpServer', x=-412,75, y=47,10, z=1017,75], EntityItem['item.item.egg'/209, l='MpServer', x=-405,22, y=70,13, z=1011,28], EntitySheep['Sheep'/210, l='MpServer', x=-414,47, y=68,00, z=1011,53], EntityBat['Bat'/211, l='MpServer', x=-369,69, y=57,98, z=979,75], EntitySheep['Sheep'/212, l='MpServer', x=-368,22, y=85,00, z=980,53], EntitySquid['Squid'/213, l='MpServer', x=-395,50, y=59,33, z=1051,82], EntityZombie['Zombie'/214, l='MpServer', x=-405,16, y=47,00, z=1035,53], EntityCreeper['Creeper'/215, l='MpServer', x=-406,69, y=46,00, z=1038,69], EntityCreeper['Creeper'/216, l='MpServer', x=-404,38, y=46,00, z=1036,00], EntitySkeleton['Skeleton'/217, l='MpServer', x=-400,91, y=47,00, z=1026,66], EntitySkeleton['Skeleton'/218, l='MpServer', x=-407,53, y=60,00, z=1035,00], EntityChicken['Chicken'/219, l='MpServer', x=-410,25, y=64,00, z=1004,16], EntityBat['Bat'/220, l='MpServer', x=-360,25, y=60,10, z=983,25], EntitySheep['Sheep'/221, l='MpServer', x=-357,25, y=83,00, z=976,53], EntityZombie['Zombie'/222, l='MpServer', x=-366,91, y=29,00, z=1053,41], EntityCreeper['Creeper'/223, l='MpServer', x=-354,50, y=34,00, z=1053,50], EntityCreeper['Creeper'/224, l='MpServer', x=-415,69, y=43,00, z=1051,28], EntityFi['Firhoth'/225, l='MpServer', x=-412,50, y=70,00, z=1054,50], EntityNa['Namilowarus'/226, l='MpServer', x=-414,50, y=70,00, z=1054,50], EntityCreeper['Creeper'/227, l='MpServer', x=-405,56, y=64,00, z=1055,59], EntitySpider['Spider'/228, l='MpServer', x=-419,09, y=44,00, z=1014,72], EntityItem['item.item.rottenFlesh'/229, l='MpServer', x=-426,13, y=61,13, z=1023,13], EntityChicken['Chicken'/230, l='MpServer', x=-422,53, y=67,00, z=1014,47], EntitySkeleton['Skeleton'/231, l='MpServer', x=-383,50, y=63,00, z=960,50], EntityZombie['Zombie'/232, l='MpServer', x=-369,41, y=59,00, z=962,00], EntitySheep['Sheep'/233, l='MpServer', x=-370,66, y=89,00, z=974,56], EntityBat['Bat'/234, l='MpServer', x=-383,25, y=46,10, z=1057,75], EntitySkeleton['Skeleton'/235, l='MpServer', x=-399,59, y=46,00, z=1063,69], EntitySkeleton['Skeleton'/236, l='MpServer', x=-399,53, y=46,00, z=1062,84], EntityBat['Bat'/237, l='MpServer', x=-386,59, y=46,01, z=1059,47], EntityBat['Bat'/238, l='MpServer', x=-421,50, y=46,10, z=1034,53], EntityZombie['Zombie'/239, l='MpServer', x=-424,00, y=45,00, z=1032,44], EntityZombie['Zombie'/240, l='MpServer', x=-430,63, y=56,00, z=1037,13], EntityCreeper['Creeper'/241, l='MpServer', x=-430,00, y=57,00, z=1032,66], EntitySpider['Spider'/242, l='MpServer', x=-431,81, y=56,00, z=1032,88], EntityZombie['Zombie'/243, l='MpServer', x=-425,31, y=16,00, z=995,00], EntitySheep['Sheep'/244, l='MpServer', x=-428,75, y=66,00, z=1001,53], EntityChicken['Chicken'/245, l='MpServer', x=-418,47, y=68,00, z=996,56], EntityCreeper['Creeper'/246, l='MpServer', x=-389,50, y=62,00, z=962,50], EntityCreeper['Creeper'/247, l='MpServer', x=-390,09, y=59,00, z=970,36], EntitySpider['Spider'/248, l='MpServer', x=-402,08, y=45,37, z=1061,86], EntityBat['Bat'/249, l='MpServer', x=-399,26, y=62,73, z=1061,47], EntityBat['Bat'/250, l='MpServer', x=-417,75, y=43,04, z=1052,26], EntitySkeleton['Skeleton'/251, l='MpServer', x=-424,50, y=60,00, z=1040,91], EntitySkeleton['Skeleton'/252, l='MpServer', x=-418,09, y=61,00, z=1051,50], EntityNe['NeoFuneralGTX'/253, l='MpServer', x=-416,50, y=70,00, z=1054,50], EntityXPOrb['Experience Orb'/254, l='MpServer', x=-423,56, y=66,58, z=1053,17], EntityBat['Bat'/255, l='MpServer', x=-343,25, y=64,10, z=966,75]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:415) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2555) at net.minecraft.client.Minecraft.run(Minecraft.java:973) at net.minecraft.client.main.Main.main(Main.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) at GradleStart.main(Unknown Source) – System Details -- Details: Minecraft Version: 1.7.10 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.8.0_45, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 833113928 bytes (794 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95 FML: MCP v9.05 FML v7.10.112.1374 Minecraft Forge 10.13.3.1374 4 mods loaded, 4 mods active mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available FML{7.10.112.1374} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.3.1374-1.7.10.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Forge{10.13.3.1374} [Minecraft Forge] (forgeSrc-1.7.10-10.13.3.1374-1.7.10.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available pm{1.0} [Phase Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Launched Version: 1.7.10 LWJGL: 2.9.1 OpenGL: AMD Radeon HD 7800 Series GL version 4.4.13283 Compatibility Profile Context 14.501.1003.0, ATI Technologies Inc. GL Caps: Using GL 1.3 multitexturing. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Anisotropic filtering is supported and maximum anisotropy is 16. Shaders are available because OpenGL 2.1 is supported. Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Resource Packs: [] Current Language: English (US) Profiler Position: N/A (disabled) Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Anisotropic Filtering: Off (1)
:::
-
Ton modèle n’est pas initialisé. Ajoute dans le constructeur :
this.modelBoat = modelBike;
↓ public RenderBike(ModelBike modelBike, float f) { this.modelBoat = modelBike; }
-
Oui merci, je viens de l’initialisé, le vélo spawn bien correctement.
Après il reste encore le fait qu’il spawn et s’enfonce dans le sol, la position du joueur est mal placé et le contrôle se fait mal.
Je pense que je débrouillerais pour le reste ou je créerais un nouveau topic.
Merci.