Posted October 19, 20214 yr I have a tile entity renderer that renders a model. Code looks like this private static final ResourceLocation TEXTURE = ResourceHelper.createNew("block/test.png"); private final ClockworksDoorModel model; private final RenderMaterial doorMaterial; public ClockworksDoorTileEntityRenderer(TileEntityRendererDispatcher dispatcher) { super(dispatcher); model = new ClockworksDoorModel(); doorMaterial = new RenderMaterial(PlayerContainer.BLOCK_ATLAS, TEXTURE); } @Override public void render(ClockworksDoorTileEntity tileEntity, float partialTicks, MatrixStack matrixStack, IRenderTypeBuffer buffer, int combinedLight, int combinedOverlay) { IVertexBuilder builder = doorMaterial.buffer(buffer, RenderType::entityCutoutNoCull); model.renderToBuffer(matrixStack, builder, combinedLight, combinedOverlay, 1, 1, 1, 1); } In game, however, it has the black and purple missing texture. When examining the log it does not report anything about missing textures if I put the path correctly, so I can only assume it's correctly finding my texture.
October 20, 20214 yr Please show the entire class and the ClockworksDoorModel. I'm imagining you are incorrectly binding information here. The block atlas will not hold your texture unless some block is also using it. Also, RenderMaterials do not contain the full path, just a relative ResourceLocation. I would instead follow the BoatRenderer model here since it will be much easier to use with the current data you are trying to draw.
October 20, 20214 yr Author The code I posted was in fact the entire tile entity renderer, minus the class declaration. I have added some small stuff since for testing, but overall its the same and should be very similar to the enchanting table renderer. public class ClockworksDoorTileEntityRenderer extends TileEntityRenderer<ClockworksDoorTileEntity> { private static final ResourceLocation TEXTURE = ResourceHelper.createNew("block/test.png"); private final ClockworksDoorModel model; private final RenderMaterial doorMaterial; public ClockworksDoorTileEntityRenderer(TileEntityRendererDispatcher dispatcher) { super(dispatcher); model = new ClockworksDoorModel(); doorMaterial = new RenderMaterial(PlayerContainer.BLOCK_ATLAS, TEXTURE); } @Override public void render(ClockworksDoorTileEntity tileEntity, float partialTicks, MatrixStack matrixStack, IRenderTypeBuffer buffer, int combinedLight, int combinedOverlay) { matrixStack.pushPose(); IVertexBuilder builder = doorMaterial.buffer(buffer, RenderType::entitySolid); model.renderToBuffer(matrixStack, builder, combinedLight, combinedOverlay, 1, 1, 1, 1); matrixStack.popPose(); } } The model itself is just a basic model. Not much to showcase, but since I was asked I'll do it anyway. public class ClockworksDoorModel extends Model { private final ModelRenderer model; public ClockworksDoorModel() { super(RenderType::entitySolid); texWidth = 64; texHeight = 64; model = new ModelRenderer(this); model.setPos(8, 32, 8); model.texOffs(0, 0).addBox(-8.0F, -32.0F, -8.0F, 16.0F, 32.0F, 3.0F, 0.0F, false); } @Override public void renderToBuffer(MatrixStack matrixStack, IVertexBuilder builder, int partialLight, int partialOverlay, float red, float green, float blue, float alpha) { model.render(matrixStack, builder, partialLight, partialOverlay); } }
October 22, 20214 yr Author I really am not sure how this differs from the enchanting table in a meaningful way
October 22, 20214 yr try to remove the .png, because it can be that minecraft adds this automatically
October 22, 20214 yr Author Didn't seem to change anything at all. Interestingly I noticed that it's not giving me errors for missing textures in the log either.
October 22, 20214 yr Author Tried several varations of the path: Writing out the full path like Luis said above Including and excluding "textures/" Including and excluding the file extension Nothing seems to be working. No error for anything either. Probably the biggest clue so far.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.