Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Video demonstration of the problem: https://www.youtube.com/watch?time_continue=14&v=f7BUdXHRMqQ

Github repo

 

I've tried a bunch of stuff to resolve this issue, and check what getSlot and slotClick returns, and they seem fine (if i click on a dirt block in my container both of them return that the itemstack contains dirt)

But after those functions get called it grabs from ContainerPlayers inventorySlots, and there the first 9 slots are for armor and crafting, and I'm clueless to the flow and why this is happening.

 

Container class

Proxy

What version of Forge are you using? (I looked at your main repo and I'm guessing 1.11.2)

the inventory class used for players PlayerInventory has sub lists inside it "mainInventory", "offHandInventory", and "armorInventory". Try pulling from mainInventory.
Now I haven't worked with the Slot class for a bit, so I'm not sure if the constructor would accept that, if that's the case you will have to create an offset of the index so it skips past the armor indexes

  • Author

Yeah an offset was what I was thinking as well but I don't know where to apply it since I don't know which function uses the inventoryslots in ContainerPlayer. I've used breakpoints in most of the functions in the Container class but came up empty handed. Thank you for your input.

https://github.com/xt9/DeepMobLearner/blob/master/src/main/java/xt9/deepmoblearning/common/items/ItemDeepLearner.java#L24

No, you must open a container on both the server and the client. Opening it on the client only leads to all kinds of bugs including the one you are experiencing. How would a container be opened on client only if the server needs to know about inventory changes? Remove the isRemote check and everything will work fine.

Edited by V0idWa1k3r

  • Author

Wow, how did that get in there, I'm amazed I didn't catch that. Thanks a bunch.
 

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.