Closed DrunkRussianGun closed 8 months ago
Tested as well, all good. Just curious about serialVersionUID.
Also, can you bump the version to 1.9.2, in pom.xml.
Just curious about serialVersionUID.
This is related to built-in Java serialization which we use to store data about registered beds. That mechanism relies on serialVersionUID
to check if stored data is compatible with the class which the data is deserialized into, and if calculated serialVersionUID
doesn't match serialVersionUID
stored along with the data, it throws InvalidClassException
. Algorithm of serialVersionUID
calculation is sensitive to what fields and methods a class has, and if we didn't set it explicitly, serialVersionUID
of PlayerBedsData
would change because I added a new constructor and a new method there. That would lead to InvalidClassException
's in all servers which used version 1.9.1 of the plugin and decided to upgrade to 1.9.2, and those exceptions (which actually happened on my server where I tested early version of the changes), in turn, could lead to two scenarios depending on implementation details of Paper:
I haven't checked yet what happened to the data on my server, but neither of those scenarios is desirable, therefore we must set serialVersionUID
explicitly for each class that is used for persistent data storage and has changes which may change its serialVersionUID
.
You can also find another explanation here.
Also, can you bump the version to 1.9.2, in pom.xml.
Sure, done.
Finally made
/sharebed
command to work properly (I thought #27 did, but testing showed it didn't). This pull request includes the following changes:This time I tested the changes and I believe that I did that properly. At least works for me 🙂