Posted June 23, 20223 yr I'm making a mod where you can add a small 4 by 4 emblem to your armor. I want to add multiple symbols, but it can get tedious to create a texture for each emblem. Also, I plan on adding the ability make your own emblems with patterns, similar to banner patterns. I looked at the code for rendering banner patterns, but I can't understand it. I know you can add layers to item model JSONs, like the spawn egg, but they're not dynamic. I thought of combining the two images and making a temporary texture while the game runs, but is there a more elegant way to achieve this? Edited June 29, 20223 yr by MWR I realize that I can't combine textures and the best way is to add another render layer.
June 29, 20223 yr Author After a lot of digging, I've concluded the best way to go about this is not combining textures, as that is impossible during runtime, but to add a render layer. I've been trying to understand how the rendering works, but I don't know what buffers are, like this one in HorseMarkingLayer: public void render(PoseStack p_117058_, MultiBufferSource p_117059_, int p_117060_, Horse p_117061_, float p_117062_, float p_117063_, float p_117064_, float p_117065_, float p_117066_, float p_117067_) { ResourceLocation resourcelocation = LOCATION_BY_MARKINGS.get(p_117061_.getMarkings()); if (resourcelocation != null && !p_117061_.isInvisible()) { VertexConsumer vertexconsumer = p_117059_.getBuffer(RenderType.entityTranslucent(resourcelocation)); this.getParentModel().renderToBuffer(p_117058_, vertexconsumer, p_117060_, LivingEntityRenderer.getOverlayCoords(p_117061_, 0.0F), 1.0F, 1.0F, 1.0F, 1.0F); } } If this is a Java question, let me know, but any help is appreciated!
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.