Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Send Creative Inventory on Player First Spawn #1808

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Send Creative Inventory on Player First Spawn #1808

wants to merge 2 commits into from

Conversation

Christian7573
Copy link

I got bored, so I attempted to fix #1786

@jonathanpeppers
Copy link

jonathanpeppers commented Jul 25, 2017

Did this used to work fine? Did perhaps the PR here broke it: #518

I haven't used nukkit for a while, and updated to see this issue happening. @sero583 any suggestions on what to do--I can take a stab at it.

@sero583
Copy link

sero583 commented Jul 25, 2017

@jonathanpeppers A research would be good to know when it happens and taking a look at the current inventory sending code, for me it used to happen sometimes but it wasn't really a major issue thats why I didn't reported it anytime. It happened for me sometimes also after gamemode changing.

@sero583
Copy link

sero583 commented Jul 25, 2017

Oh yes that change which made the Player variable from protected to public is not good, because plugins can actually edit the variable how they like to.

@jonathanpeppers
Copy link

jonathanpeppers commented Jul 25, 2017

@sero583

Here is how it has been happening for me (this is issue #1786):

  • Wipe the players directory
  • Run Nukkit with defaultgamemode set to creative
  • First player logs in, has inventory as usual
  • Any subsequent player joining has no inventory--this includes if the first players leaves and rejoins

I was finding I could only get the inventory back if I deletes all the player .dat files, and then only the first player could get them.

I have Minecraft: PE 1.1.4 on iOS.

Also, I tried @Christian7573 's code and it seems to work, however I have never worked in this codebase before--so maybe it needs to happen in another place than Player.doFirstSpawn.

@sero583
Copy link

sero583 commented Jul 25, 2017

Also Event changes made which shouldn't be made.

@Christian7573
Copy link
Author

Ok, I'll do some research. Also, if you're referring to the weird public / protected change in PlayerEvent, that was something from when I first downloaded nukkit and I undid it in the next commit.

@augustoeliezer
Copy link

Thanks @Christian7573

See #1842, same fix but add for each user in server.

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

Successfully merging this pull request may close these issues.

In creative mode, sometimes no items in creative inventory.
4 participants