elBukkit / PreciousStones

Self-service protection for Minecraft servers
http://dev.bukkit.org/server-mods/preciousstones/
10 stars 10 forks source link

Old fields are detected on startup but not found in-game #141

Open xDeeKay opened 1 year ago

xDeeKay commented 1 year ago

Hey so I've been using this plugin for a long time, way before the forks so my database is very old. I'm using sqlite specifically.

When updating to the 1.18 release found here, the startup logs show that the plugin is detecting the fields, or at least how many fields there are:

[11:07:00] [Server thread/INFO]: [PreciousStones] Enabling PreciousStones v1.18 [11:07:00] [Server thread/INFO]: [PreciousStones] Version 1.18 loaded [11:07:00] [Server thread/INFO]: [net.sacredlabyrinth.Phaed.PreciousStones.shaded.com.zaxxer.hikari.HikariDataSource] HikariPool-1 - Starting... [11:07:00] [Server thread/INFO]: [net.sacredlabyrinth.Phaed.PreciousStones.shaded.com.zaxxer.hikari.HikariDataSource] HikariPool-1 - Start completed. [11:07:00] [Craft Scheduler Thread - 9 - PreciousStones/INFO]: [PreciousStones] (DKCraft) fields: 252 [11:07:00] [Server thread/INFO]: Timings Reset [11:07:00] [Craft Scheduler Thread - 9 - PreciousStones/INFO]: [PreciousStones] (DKCraft_nether) fields: 3 [11:07:00] [Craft Scheduler Thread - 9 - PreciousStones/INFO]: [PreciousStones] (DKCraft2) fields: 3 [11:07:00] [Craft Scheduler Thread - 9 - PreciousStones/INFO]: [PreciousStones] (DKCraft_the_end) fields: 1

However when hopping on the server and trying to /ps info inside a known field, I get "No fields found". Only newly placed precious stones actually seem to take effect.

Is there a fix or workaround for this?

xDeeKay commented 1 year ago

Taking a further look into the database, it looks like newer versions of PreciousStones started using different "type_id" values within the fields table. The values went from 16, 21, 129 in the old rows, to "22934, 30965, ?" in the new rows.

I think somewhere down the line I missed a db migration step but it should be as easy as modifying the existing table data to match the new values. Where the plugin defines which type_id belongs to which field type I've yet to find out, they're not found anywhere in the config.yml or database.