Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to unpack 'window_items'? #158

Open
tcrch opened this issue May 18, 2022 · 3 comments
Open

How to unpack 'window_items'? #158

tcrch opened this issue May 18, 2022 · 3 comments

Comments

@tcrch
Copy link

tcrch commented May 18, 2022

I don't have any idea how to unpack it. Does anyone know?

@davidawesome02
Copy link

This is what I did for getting the players inventory, (This is only one part, your inv gets updated by like 5 methods)

In the code below I have it set up for a proxy, with the variables
self.data at index of their uuid (self.downstream.uuid) so The different players have different variables (This requires some other code I didn't include, so use different variables)

        buff.save()
        
        self.downstream.send_packet("window_items",buff.read())
        buff.restore()
        window = buff.read(1)
        #below is state id, I know my code is bad, but it is a useless number for the most part
        idc = buff.unpack_varint()
        self.data[self.downstream.uuid]["slot_state"] = idc
        count = buff.unpack_varint()
        # below is check if inv, inventory is always window 00
        if (window == b'\x00'):
            for i in range(count):
                self.data[self.downstream.uuid]["slot_dat"][i] = buff.unpack_slot()
        buff.discard()
        return()```
        
       If you need any more help just ask (sorry if this answer is bad)

@tcrch
Copy link
Author

tcrch commented Jul 15, 2022

@davidawesome02 hey thanks alot! do you have discord? i'd love some more help!

@davidawesome02
Copy link

davidawesome02 commented Jul 17, 2022

Sorry for a late reply, my discord is davidawesome01#**** (I will delete this after I get a friend request from you), I forgot to check my email, because of some personal things. I can talk any time (almost) betwine 9am and 8pm.

@tcrch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants