Jump to content

Recommended Posts

Posted

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

Coding, Testing, Smiling, Publishing!

Posted

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.

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.

Posted

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

Coding, Testing, Smiling, Publishing!

Posted

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?

 

width=800 height=449http://s2.postimg.org/9u6haor3t/2013_09_28_14_38_32.png[/img]

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.

Posted

 

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!

Coding, Testing, Smiling, Publishing!

Posted

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.

Coding, Testing, Smiling, Publishing!

Posted

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!)

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.

Posted

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.

 

 

Coding, Testing, Smiling, Publishing!

Posted

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);
        }

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.

  • 3 months later...
Posted

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)

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.