Jump to content

De Joker

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by De Joker

  1. Solution for future viewers In the render class on doRender add this: GlStateManager.rotate(entity.rotationPitch, 1, 0, 0);
  2. This might be an obvious question but I just started to understand how models work. How do I rotate a model during onUpdate on both Yaw and Pitch angles? Basically the player is on the Entity and I want the entity to look where the passenger is looking at. The current code works for Yaw angle only. I can see the pitch changes on the entity (Blue line on debug) but the model it self does not rotate. @Override public void onUpdate() { super.onUpdate(); if (this.canPassengerSteer() && getControllingPassenger() != null) { Entity entity = this.getControllingPassenger(); setRotation(entity.rotationYaw, entity.rotationPitch); } }
  3. Where are you setting those StatConstants.LONG_BLADE? maybe you are calling the drawString before the actual setting.
  4. I can see my model when it extends EntityLiving. And when it extends Entity I do not see the model rendering at all
  5. Thanks! That did work. Another thing I might ask is why when i extend EntityLiving the model register correctly and when i extend Entityit does not?
  6. Hey, so i created an Entity that extends Entity. I registered it correctly and I see the spawn egg and i can spawn it without any errors. The problem is when i render it, It does not render correctly. I always see the model next to the player and not where the entity is. (The render is registered correctly as well) I think i need to use some GL code but i really didnt see any explantion of this. Here is my render class: (I used boat textures just for testing purposes) package me.dejoker.broomstick.render; import me.dejoker.broomstick.entities.EntityBroomstick; import me.dejoker.broomstick.models.ModelBroomstick; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class RenderBroomstick extends Render<EntityBroomstick> { private static final ResourceLocation BOAT_TEXTURES = new ResourceLocation("textures/entity/boat/boat_oak.png"); ModelBase modelBroom = new ModelBroomstick(); protected RenderBroomstick(RenderManager renderManager) { super(renderManager); } @Override public void doRender(EntityBroomstick entity, double x, double y, double z, float entityYaw, float partialTicks) { modelBroom.render(entity, 0f, 0f, -0.1f, 0f, 0f, 0.0625f); super.doRender(entity, x, y, z, entityYaw, partialTicks); } @Override protected ResourceLocation getEntityTexture(EntityBroomstick entity) { return BOAT_TEXTURES; } }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.