Jump to content

Player's village reputation resets?


AstroTibs

Recommended Posts

I'm updating my mod that deals with villages and villagers, and adding a feature that requires the player's reputation in that village.

Things are going well for 1.7.10 and 1.8.9, but I noticed that for versions 1.9.4, 1.10.2, and 1.11.2, your player's reputation in the village resets whenever the server is closed.

 

This was immediately apparent in Eclipse, as a reputation query I put into my mod returned 0 for my player's name.

I've been using NBTExplorer to look at the villages.dat file, and indeed for those three versions, the player reputation entry blanks when the server is reset (more specifically, when it's reset and the player logs back in). It's not a matter of username vs UUID, because 1.8.9 saves reputation under UUID, yet it remains between server runs.

To be more sure, I ran a server on my machine and local-connected to it. I also used ZeroXCorbin's Village Info mod, and reputation resets to 0 when the server is closed and restarted.

To be extra extra sure, I launched local vanilla-only servers and connected to them, using NBTExplorer to track reputation. Sure enough, it resets. To be clear, by "resets" I don't simply mean the reputation value goes to zero for the given UUID: I mean the village's list of players just blank completely, as though no player had earned or lost reputation in that village.

Lastly, I even created a local vanilla world in 1.11.2. Same issue.

 

It does not seem to matter whether I'm in creative mode or survival mode. It does not seem to matter whether I stop the server with /stop or with just X-ing out of the server window. It does not matter if I go a few hundred meters away from the village, sign out, sign back in, and return to the village. Upon returning, my reputation gets blanked.

 

Am I missing something subtle in my diagnosis? Or is this a bug in 1.9 and later that's just so circumstantial to spot that it's not been caught yet?

Edited by AstroTibs
Added additional info
Link to comment
Share on other sites

Ya, looks like nobody really cares about reputation. The vanilla code would never of worked.

As it checks the world is not null before it looks up the player name from the UUID {as it needs to because the server olds that lookup} 

It's not a simple fix as all the public API for that class use the players name as a string, instead of the UUID or profile or anything.

 

Edit:

I've pushed a fix to Forge for this: https://github.com/MinecraftForge/MinecraftForge/commit/72937c90be8a337190964e43281d3da85c43319b

 

  • Like 1

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Link to comment
Share on other sites

Good deal LexManos, thanks. My mod development has been a real random walk. I'll need to find a creative way to work around this one.

So, just to confirm—this is an issue with vanilla Minecraft itself, ca 1.9?

Edit: I want to emphasize that this bug does not occur on 1.8.9, even though according to NBTExplorer, reputation is saved under UUID and not user display name.

Edited by AstroTibs
Link to comment
Share on other sites

That is because in 1.8.9 MinecraftServer was a singleton and it didn't have to go through the world, which isn't set at the time read is called. It's a order of operations thing, Mojang needs to fix.

 

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

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.