So I have an entity spawned from an item (similar to Art).
When the entity is created, it is passed metadata from the item.
When it is hit, it drops the item with appropriate metadata.
That part works.
What is strange, is that the rendering function asks for the metadata but gets an incorrect value:
The Rendering code
public void renderFoo(EntityFoo entity, double glX, double glY, double glZ, float glTheta, float glPhi) {
GL11.glPushMatrix();
GL11.glTranslatef((float)glX, (float)glY, (float)glZ);
GL11.glRotatef(glTheta, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(180, 0.0F, 0.0F, 1.0F);
this.loadTexture(CommonProxy.getFooTexture(entity.getFooData()));
model.render(entity, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
GL11.glPopMatrix();
}
The Entity code
public EntityFoo(World worldObject, int xPos, int yPos, int zPos, int facing, int fooData, Item itemDropped) {
super(worldObject, xPos, yPos, zPos, facing);
this.itemDropped = itemDropped;
this.fooData = fooData;
setSize(1.0F, 2.0F);
setDirection(facing);
}
public int getFooData() { return this.fooData; }
public void dropItemStack() { entityDropItem(new ItemStack(this.itemDropped, 1, this.fooData), 0.0F); }
One possible reason -- can't figure out solution
I have done println on the entity created vs the entity rendered and it seems they are different???
The metadata passed in is not the metadata returned when getFooData() is called, even though it drops the correct item when the entity is destroyed.
But I have tried to follow the path of the entity through the program and it doesn't look like another entity is created.
Thanks for any help!