Casual Dutchman Posted December 28, 2013 Posted December 28, 2013 Hi everyone, I made a block, but I want an item to be rendered on it. like an itemframe, but then bigger. I dont want to make a different model for the block, because others can make different textures for that item. It would really help me out if you helped me. thanks in advance Quote Coding, Testing, Smiling, Publishing!
CJLetsGame Posted December 28, 2013 Posted December 28, 2013 You need a block renderer with a reference to the ItemRenderer. Then you can use the rendering from that to render the item. Quote
Draco18s Posted December 28, 2013 Posted December 28, 2013 Artifacts to the rescue (again)! https://github.com/Draco18s/Artifacts/blob/master/draco18s/artifacts/client/ModelPedestal.java That's my model for my custom block. I render an item from there as well. If you want the item bigger, why gl11.glScale() will do wonders. Quote 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.
Casual Dutchman Posted December 29, 2013 Author Posted December 29, 2013 Artifacts to the rescue (again)! https://github.com/Draco18s/Artifacts/blob/master/draco18s/artifacts/client/ModelPedestal.java That's my model for my custom block. I render an item from there as well. If you want the item bigger, why gl11.glScale() will do wonders. and if I want to render the item as a sword rendered in hand. full3d. This is great, but if you could help me with that, that would be amazing Quote Coding, Testing, Smiling, Publishing!
CJLetsGame Posted December 29, 2013 Posted December 29, 2013 Again... itemRenderer can render items in 3d. Quote
Draco18s Posted December 29, 2013 Posted December 29, 2013 Artifacts to the rescue (again)! https://github.com/Draco18s/Artifacts/blob/master/draco18s/artifacts/client/ModelPedestal.java That's my model for my custom block. I render an item from there as well. If you want the item bigger, why gl11.glScale() will do wonders. and if I want to render the item as a sword rendered in hand. full3d. This is great, but if you could help me with that, that would be amazing Above code does render in 3D. Because I'm rendering an item entity which (in vanilla) is a 3D object. See? http://s2.postimg.org/9u6haor3t/2013_09_28_14_38_32.png[/img] Quote 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.
Casual Dutchman Posted December 29, 2013 Author Posted December 29, 2013 Above code does render in 3D. Because I'm rendering an item entity which (in vanilla) is a 3D object. See? image sorry about that, thought it was 2d. anyways, this helped me out a lot, thanks! Quote Coding, Testing, Smiling, Publishing!
Casual Dutchman Posted January 4, 2014 Author Posted January 4, 2014 Artifacts to the rescue (again)! https://github.com/Draco18s/Artifacts/blob/master/draco18s/artifacts/client/ModelPedestal.java That's my model for my custom block. I render an item from there as well. If you want the item bigger, why gl11.glScale() will do wonders. and if I want to render the item as a sword rendered in hand. full3d. This is great, but if you could help me with that, that would be amazing Above code does render in 3D. Because I'm rendering an item entity which (in vanilla) is a 3D object. See? I got two more things to ask. How to always render the entityitems on fancy or how to not render the entityitem when graphics are set to fast? And how to show the entityitem on game load? I tried those thing, but I could not figure it out. Quote Coding, Testing, Smiling, Publishing!
Draco18s Posted January 4, 2014 Posted January 4, 2014 You cheat. GameSettings settings = Minecraft.getMinecraft().settings; That will have all of the settings (including fast/fancy graphics). You can even change them (be sure to change them back when you're done!) Quote 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.
Casual Dutchman Posted January 4, 2014 Author Posted January 4, 2014 You cheat. GameSettings settings = Minecraft.getMinecraft().settings; That will have all of the settings (including fast/fancy graphics). You can even change them (be sure to change them back when you're done!) And how to I render the entityItems when I enter the world. They now appear when I have right-clicked the container. Quote Coding, Testing, Smiling, Publishing!
Draco18s Posted January 5, 2014 Posted January 5, 2014 You cheat. GameSettings settings = Minecraft.getMinecraft().settings; That will have all of the settings (including fast/fancy graphics). You can even change them (be sure to change them back when you're done!) And how to I render the entityItems when I enter the world. They now appear when I have right-clicked the container. Client-server disparity. You don't have getDescriptionPacket implemented. Assuming your TE is writing its inventory to its NBT (otherwise items would vanish on save/load), then this is all you need: public Packet getDescriptionPacket() { NBTTagCompound nbtTag = new NBTTagCompound(); this.writeToNBT(nbtTag); return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, nbtTag); } public void onDataPacket(INetworkManager net, Packet132TileEntityData packet) { readFromNBT(packet.data); } Quote 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.
Casual Dutchman Posted April 30, 2014 Author Posted April 30, 2014 This methode is different in 1.7. which classes or methodes do I need you use now? Quote Coding, Testing, Smiling, Publishing!
SanAndreaP Posted April 30, 2014 Posted April 30, 2014 look at the TileEntity superclass, the methods are called the same. Here is my tileentity for reference: https://github.com/SanAndreasP/EnderStuffPlus/blob/master/java/de/sanandrew/mods/enderstuffplus/tileentity/TileEntityBiomeChanger.java (line 187 and line 319) Quote Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! | mah twitter This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.
Casual Dutchman Posted April 30, 2014 Author Posted April 30, 2014 Thanks, that worked. Quote Coding, Testing, Smiling, Publishing!
Recommended Posts
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.