Wunst
-
Posts
7 -
Joined
-
Last visited
Posts posted by Wunst
-
-
Should I initialize the field like
EntityCultist entity = new EntityCultist();
public void render(…) {
...
}
-
Okay, it works now, I changed the code to:
public class TESRCultistSpawn extends TileEntitySpecialRenderer<TileEntityCultistSpawn> {
EntityCultist entity;
@Override
public void render(TileEntityCultistSpawn te, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
if(entity == null) {
entity = new EntityCultist(te.getWorld());
}
GlStateManager.pushMatrix();
GlStateManager.translate(0, 0, 0);
Minecraft.getMinecraft().getRenderManager().renderEntity(entity, x + 0.5, y, z + 0.5, 180.0f, partialTicks, true);
GlStateManager.popMatrix();
}
} -
@Cadiboo Oh, ok, I'll make the entity a field instead of a local variable.
@DavidM Maybe that will help, I forgot it...
-
This just reverses the effect: the TESR itself is moved to the left.
-
Can you post a picture of the error screen and (if it's a crash) the crash report?
-
Hi all,
I coded a Tile Entity that spawns a mob with a TESR that shows the entity's model, but as soon as the TE is on screen, all other TESRs like chests move to the right and forth while their blocks stay at the same spot.
Here's the renderer:
public class TESRCultistSpawn extends TileEntitySpecialRenderer<TileEntityCultistSpawn> {
@Override
public void render(TileEntityCultistSpawn te, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
GlStateManager.translate(0.5, 0, 0.5);
EntityCultist entity = new EntityCultist(te.getWorld());
entity.rotationYaw = 45;
Minecraft.getMinecraft().getRenderManager().renderEntity(entity, x, y, z, 180.0f, partialTicks, true);
}
}And what happens is attached as PNG. Compare the chest model and the block outline!
TESR showing entity moves other TESRs
in Modder Support
Posted
Okay, that makes sense... I'll edit this post when I tried it.