Jump to content

Recommended Posts

Posted

Anyone know? I'm stuck here with my mod and I can't do much right now until I get this solved.

Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.

Posted

Do you just want to display it? Or interact with it (like take things in and out)?

 

I'm not sure but I think you can make a container that combines any number of inventories. The "glue" that holds a container together is the inventorySlots List. You can make a custom Container that takes in various inventories (like another player's) and then map those to slots in the container. Then they should be available for display, and they should sync between client and server (provided you implement an IGuiHandler as well).

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted

Do you just want to display it? Or interact with it (like take things in and out)?

 

I'm not sure but I think you can make a container that combines any number of inventories. The "glue" that holds a container together is the inventorySlots List. You can make a custom Container that takes in various inventories (like another player's) and then map those to slots in the container. Then they should be available for display, and they should sync between client and server (provided you implement an IGuiHandler as well).

 

How would I make the game show a container with another players inv slots? And why would I need a GuiHandler?

Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.

Posted

A gui is nothing more than a screen wich displays data you put in. in order to be able to ineract with a gui, you need an regular guiHandler and Gui class. Beside that you need an container wich is linked to your Gui. (The container class containes the data and methodes to update the Gui). So in order to display an other players inventory, you'll need to get the instance of the other player in your container class, and use ot to retrieve data. Thats basicly it. Other than that, its just an regular Gui setup

Projects:

Discontinued:

- N2ConfigAPI

- Meachanical Crafting Table

 

Latest:

- CollectionUtils

 

Coöperations:

- InGameConfigManager

Posted

Then how am I supposed to send the other player variable to the Guihandler which creates the container?

Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.

Posted

Let the server send the container contents.

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Posted

Okay, you seem a bit confused. Let me try to break it down for you.

 

You want to do something custom, so you're going to have to do some work. Custom GUIs aren't hard, but there are a couple tricky points and it takes a fair bit of coding to get right.

 

If you have a GUI that shows an inventory (I mean it has slots that you can move things into and out from) then it is recommended you use a Container with IGuiHandler. A Container helps map the slots in the GUI to whatever inventory you want, and the IGuiHandler ensures everything gets synced between client and server.

 

The only thing different about your GUI is you want the inventory to be from a different player. Like we've said above, that isn't really that different -- you can simply pass that in like you would the local player's inventory.

 

But the big question is how you find the player. Are you clicking on the other player, or are you just opening this GUI at some other point? If you're clicking on the player, then you can just treat it like an Entity interaction, check that it is EntityPlayer, cast it to EntityPlayer then take the inventory. If you are not clicking on the player, please describe when you want the GUI to open so we can provide suggestions.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted

I get all of that, but can someone show me what to do to open the Gui and what to put in my GuiHandler because that's where I'm confused

Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.

Posted

Note:

- Server has inventories of loaded players, to load offline inventory you would need to manipulate .dat on your own.

- Client has only constructed EntityPlayers that are in visible range. Client doesn't know shit about players that are out of range, aside from player list (nicks) sent from server. Have in mind that your client won't always be able to get desired EntityPlayer's instance (well, you can go with nicks).

1.7.10 is no longer supported by forge, you are on your own.

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • When I first heard about Bitcoin back in 2018, I was skeptical. The idea of a decentralized, digital currency seemed too good to be true. But I was intrigued as I learned more about the technology behind it and its potential. I started small, investing just a few hundred dollars, dipping my toes into the cryptocurrency waters. At first, it was exhilarating to watch the value of my investment grow exponentially. I felt like I was part of the future, an early adopter of this revolutionary new asset. But that euphoria was short-lived. One day, I logged into my digital wallet only to find it empty - my Bitcoin had vanished without a trace. It turned out that the online exchange I had trusted had been hacked, and my funds were stolen. I was devastated, both financially and emotionally. All the potential I had seen in Bitcoin was tainted by the harsh reality that with decentralization came a lack of regulation and oversight. My hard-earned money was gone, lost to the ether of the digital world. This experience taught me a painful lesson about the price of trust in the uncharted territory of cryptocurrency. While the technology holds incredible promise, the risks can be catastrophic if you don't approach it with extreme caution. My Bitcoin investment gamble had failed, and I was left to pick up the pieces, wiser but poorer for having placed my faith in the wrong hands. My sincere appreciation goes to MUYERN TRUST HACKER. You are my hero in recovering my lost funds. Send a direct m a i l ( muyerntrusted ( @ ) mail-me ( . )c o m ) or message on whats app : + 1 ( 4-4-0 ) ( 3 -3 -5 ) ( 0-2-0-5 )
    • You could try posting a log (if there is no log at all, it may be the launcher you are using, the FAQ may have info on how to enable the log) as described in the FAQ, however this will probably need to be reported to/remedied by the mod author.
    • So me and a couple of friends are playing with a shitpost mod pack and one of the mods in the pack is corail tombstone and for some reason there is a problem with it, where on death to fire the player will get kicked out of the server and the tombstone will not spawn basically deleting an entire inventory, it doesn't matter what type of fire it is, whether it's from vanilla fire/lava, or from modded fire like ice&fire/lycanites and it's common enough to where everyone on the server has experienced at least once or twice and it doesn't give any crash log. a solution to this would be much appreciated thank you!
    • It is 1.12.2 - I have no idea if there is a 1.12 pack
  • Topics

×
×
  • Create New...

Important Information

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