Posted October 9, 201411 yr My goal is to have something like a tablet computer in minecraft. Similar as the map (http://minecraft.gamepedia.com/Map) it should change its texture dynamically. The screen should show information like found in the debug screen [F3]. (Yes, it would be superfluous, but much more pretty in my opinion.) By way of illustration: https://dl.dropboxusercontent.com/u/43694603/tablet.png How can i bring ever-changing content (text...) on an item's texture?
October 9, 201411 yr Poke around in the Vanilla map code. You should be able to access it via Eclipse. Or look at the Lexica Botania: https://github.com/Vazkii/Botania You Only Live Once, So Win At Golf. Sorry for my English, I'm American.
October 9, 201411 yr Author Thank you. But trawling through unexplained foreign code can get very tedious.. Does somebody maybe know any related tutorial?
October 9, 201411 yr I doubt you will find a step-by-step tutorial What you need is in MapItemRenderer: DynamicTexture created, returns an int [] which is then overwritten directly by the RGB data. Bind Dynamic texture when rendering. -TGG
October 9, 201411 yr Author Ok thank you very much! You seem to know how that works, but that was a really short explaination . The only way adding item textures that i know is new Item().setTextureName("ID:Name"). How is MapItemRenderer to be used, when i have an Item object and nothing else? Furthermore i actually only need *text*, that is updated in certain time intervals and write it onto that texture. Realizing that using a RGB array might be overkill.. Is there maybe a more specific method?
October 10, 201411 yr Ok thank you very much! You seem to know how that works, :-P well to be honest actually I'm just figuring this out as I go, plus a bit of background knowledge but that was a really short explaination . I wouldn't want to rob you of the satisfaction of a thrilling voyage of discovery For me, a lot of the fun of programming minecraft is trying to pick my way through this incomprehensible swamp of vanilla code until it finally goes 'click' in my head and I understand how it works. I think it's a very important skill for anyone who's going to try something more complicated than a new Block and a couple of recipes... Furthermore i actually only need *text*, that is updated in certain time intervals and write it onto that texture. Realizing that using a RGB array might be overkill.. Is there maybe a more specific method? If you just need text, that's relatively simple; you could try looking into the FontRenderer. It's scattered all throughout the vanilla code, for example the debug screen in Minecraft.displayDebugInfo; or the number of items in an itemstack in RenderItem.renderItemOverlayIntoGUI() -TGG
October 11, 201411 yr Author Now i'm stuck because i can not find a Forge Event that is fired when the player selects an item in the hotbar . Going through net.minecraftforge.event.* it seems like such an event doesn't exist. Can somebody help, maybe describing a workaround for my intention?
October 11, 201411 yr Use ClientTick Event and check if the player holds your item. Then call the method you want. I think it is Minecraft.getMinecraft().thePlayer.getItemInUse();
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.