Jump to content

[1.6.4] Multi-tab container inventory


Flenix

Recommended Posts

Hey guys,

 

I need to know how to create a chest-style block. I've got my container etc, but the items won't save to it on game close.

I'm guessing there's a tutorial somewhere for that though...

 

More importantly; I need to have various slots only render and be available at certain times.

As the Container class is only called once, when you load the container up, I can't just change my slot loading dynamically.

 

Does anyone know of a way I can? What I need to do is have different slots available and usable depending on which tab of my GUI is open. Everything else for the GUI works (Packets sent to the server so it knows which tab the client is using etc); all I need to do is enable and disable the relevant slots.

Anyone got any ideas?

 

(Sorry if this post doesn't make sense, been working on this pretty much all day and very tired now. going to bed to sleep on it for a bit!)

width=463 height=200

http://s13.postimg.org/z9mlly2av/siglogo.png[/img]

My mods (Links coming soon)

Cities | Roads | Remula | SilvaniaMod | MoreStats

Link to comment
Share on other sites

The way I do it is just move the slots to the "left side" of the screen (set x position to -100 or whatever). That way they are a) not rendered and b) you can't interact with them.

Then when you want then to be visible, just change their x position to the right value and move the other ones out of the way.

 

Can you give me an example though? I've always done my slot rendering (and therefore positioning) in the Container class; which as I said is only called on the initial opening.

width=463 height=200

http://s13.postimg.org/z9mlly2av/siglogo.png[/img]

My mods (Links coming soon)

Cities | Roads | Remula | SilvaniaMod | MoreStats

Link to comment
Share on other sites

 

Don't see an "Active", did you mean setCurrentPage?

Anyway; is that triggered externally? I don't see how that would solve the issue, as the Container class is only called when the container is first opened?

width=463 height=200

http://s13.postimg.org/z9mlly2av/siglogo.png[/img]

My mods (Links coming soon)

Cities | Roads | Remula | SilvaniaMod | MoreStats

Link to comment
Share on other sites

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.