Posted December 21, 20195 yr I am trying to draw the texture of the signboard on the screen using TextureManager.bindTexture () when hovering over the signboard. In 1.12.2 [1.12.2] public class SignReader extends HudBase { private static final ResourceLocation SIGN_TEXTURE = new ResourceLocation ("textures / entity / sign.png"); @Override public Rect render (Event event) { Minecraft.getInstance (). GetTextureManager (). BindTexture (SIGN_TEXTURE); / * ....... my code ....... * / } } And it was drawing normally. In 1.14.4, the texture of the signboard was divided for each woodSIGN_TEXTURE in the above code [1.14.4] new ResourceLocation ("textures / entity / signs / oak.png"); Changed to However, these codes do not work properly, and a black rectangle is drawn on the screen. Is the ResourceLocation of oak.png wrong? Or has bindTexture () changed its usage? Edited December 22, 20195 yr by tokuhausu solved
December 21, 20195 yr In 1.14, the ResourceLocation definition required two arguments : you may use this instead : ResourceLocation SIGN_TEXTURE = new ResourceLocation(YourMod.MODID,"textures/entity/signs/oak.png"); the MODID is how you name your mod
December 21, 20195 yr Author Umm MODID, in this case the default texture, so I tried both "minecraft" but couldn't draw correctly.TextureManager.getTexture () seems to return null.
December 21, 20195 yr you needn't to do a mod for changing the texture of sign you can change it using only a resource pack
December 21, 20195 yr 15 minutes ago, matt1999rd said: you needn't to do a mod for changing the texture of sign you can change it using only a resource pack That isn't the goal here. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
December 21, 20195 yr 4 hours ago, tokuhausu said: Umm MODID, in this case the default texture, so I tried both "minecraft" but couldn't draw correctly.TextureManager.getTexture () seems to return null. What happens if you cal getTexture() after bind() ? And what appears in the log? Looking at TextureManager, bind() will load the texture if the texture is not already in the manager's internal map. getTexture() will not - it is just a reach into the map and return whatever is (or is not) there. So if getTexture() is still returning null after the bind() ( or loadTexture() ), that'll give you a hint of where things could be going wrong. That said, loadTexture() does log a warning if there in an IOException, and crashes outright if there is some other exception, so I'd expect there to be a note in the log if something were going wrong here. Edit: And those spaces in the ResourceLocation path... there are just there for the convenience of those reading the post, right? If you're getting a ResourceLocationException in the logs, well, that would go a long way to explain why the later bind() is not working. Edited December 21, 20195 yr by Ommina Add ResourceLocation path edit
December 22, 20195 yr Author 4 hours ago, Ommina said: Looking at TextureManager, bind() will load the texture if the texture is not already in the manager's internal map. getTexture() will not - it is just a reach into the map and return whatever is (or is not) there. So if getTexture() is still returning null after the bind() ( or loadTexture() ), that'll give you a hint of where things could be going wrong. As you say, getTexture () after bind () did not return null. 4 hours ago, Ommina said: That said, loadTexture() does log a warning if there in an IOException, and crashes outright if there is some other exception, so I'd expect there to be a note in the log if something were going wrong here. No exception is raised at runtime. I considered another drawing method. So, refer to net.minecraft.client.gui.screen.EditSignScreen TileEntityRendererDispatcher.instance.render (TileEntity, Double, Double, Double, Float); By using, the texture was successfully drawn. However, when text is written on the signboard, the texture is not drawn correctly and the text texture is displayed (see image). Is there a solution for this?
December 22, 20195 yr Author While working with the code, I noticed that when I upgraded, the color settings were incorrect. This was not because the texture was not drawn, but because the texture was painted black. After modifying the code, it was successfully drawn. Sorry for the trouble.
December 22, 20195 yr 13 hours ago, matt1999rd said: what is your problem ? Its not my problem. But if you felt like knowing, its drawing the existing sign texture into a GUI. As you might notice from the included images in the first post. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
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.