Once a player has a reputation written to villages.dat, that file will fail to load. Instead it will cause a NullPointerException during startup and every village with player reputation will be removed from the file.
Steps to Reproduce:
Create or find a village
Kill a villager belonging to that village
Restart the server
Notice the NullPointerException on startup while loading villages.dat
Removing all player reputation from villages.dat and restarting fixes the exception.
Linked issues
relates to 1
Comments 28
Confirmed as well in 1.9 and above. I actually noticed this a couple of weeks back, but didn't think about it being a bug. I just removed the player reputation entry and it was fine. Good some one thought a bit more about it and filed this report.
Applicable in 1.9 and 1.9.2. However I didn't check for the NullPointerException directly, but rather for a symptom: A village entry in the villages.dat file with a player reputation entry got removed once the world was loaded if this village is a fake entry (or the village wasn't a valid village, by covering up the doors). Therefore the entry in the villages.dat file would not re-generate instantly and only exist, because it existed before.
I believe this should be added to the bug description, to underline the severity of the bug: Every village with player reputation will be removed from the file.
@unknown, added to the description, the reason why I asked is because there's also a thing called snapshots, and you didn't seem to have tested those. 🙂
@Jesse Visscher Could you please not use abbreviated links so that people know on what they are clicking? You only have to click on it anyway, so it isn't useful to abbreviate it.
I'm seeing a similar, possibly related bug MC-106350 in 1.10.2. If interacting with villagers sets the player's reputation in the villages.dat, the console starts spamming "java.lang.IllegalArgumentException: Name and ID cannot both be blank" when attempting to save villages.dat. Deleting the Player subtags S and UUID from villages.dat stops the messages.
Is it possible that the fix was incomplete and/or triggered the new messages?
Confirmed. Run in latest Spigot 1.9.2 server, got NullPointerException in console:
[10:00:01] [Server thread/WARN]: java.lang.NullPointerException
[10:00:01] [Server thread/WARN]: at net.minecraft.server.v1_9_R1.Village.a(Village.java:394)
[10:00:01] [Server thread/WARN]: at net.minecraft.server.v1_9_R1.PersistentVillage.a(SourceFile:215)
[10:00:01] [Server thread/WARN]: at net.minecraft.server.v1_9_R1.PersistentCollection.get(PersistentCollection.java:50)
[10:00:01] [Server thread/WARN]: at net.minecraft.server.v1_9_R1.WorldServer.b(WorldServer.java:75)
[10:00:01] [Server thread/WARN]: at net.minecraft.server.v1_9_R1.MinecraftServer.a(MinecraftServer.java:268)
[10:00:01] [Server thread/WARN]: at net.minecraft.server.v1_9_R1.DedicatedServer.init(DedicatedServer.java:269)
[10:00:01] [Server thread/WARN]: at net.minecraft.server.v1_9_R1.MinecraftServer.run(MinecraftServer.java:527)
[10:00:01] [Server thread/WARN]: at java.lang.Thread.run(Unknown Source)
EDIT: Doesn't matter if the reputation is negative, positive, or zero. As long as it's there, you get the NullPointerException error.