sammypanda / MCJE-PlayerQuests-Plugin

Survival-friendly questing by the players for the players!
GNU General Public License v3.0
4 stars 0 forks source link

Use quest caching instead of real-time database (and other QOL fixes)… #77

Closed sammypanda closed 2 months ago

sammypanda commented 2 months ago

… (#76)

35 leaves one blank, 36 fills all except the bottom row

adds creating quest template dir at start always

breaks the in-game/realtime database/data folders init. Also requires reload for new quest files (this can be addressed by attaching some fs watcher elsewhere, that would be more efficient)

will move data correction to a watcher, probably in ServerListener. Will be more performant, and way more out of your face/overcomplicated.

also includes making the ServerListener less untidy + using onDisable over ServerLoadEvent.RELOAD, as a more reliable method. We still need to implement the repair part of the watch-and-repair.

see issue #67 for fixing the regression in this commit

Previously the data for Quests would all come from the database, but this went bad when too many tasks were happening and there were concurrency issues; #67. There are still concurrency issues, but it no longer breaks usage (just restoring data from previous session after reloads/restarts). The database now should only be used for 'preserving' state between reloads/restarts. It would make sense to maybe just run the Database on one thread, all in order (but idk, that's my assumption ~ maybe other things like transactions would be fine but not that i know of immediately).

fixes #70

shows the [class + class hash = quest id]

An older reference to a quest that has now been replaced with a new reference, is effectively a different quest and so shows duplicated actions. Fixes #72

inefficient patch for #73

improvement over bb323b7 for issue #73, closes #73

to explain this: SelectBlock has select by Chat, select by Hit and select by Inventory. Those aren't the exact things, check SelectMethod if you want to see the actual ones. But basically, the chat listener didn't know it should allow chat to not be cancelled if it's not an allowed method of selecting a block.

this marks durable quest progress and data, despite reloads and restarts

saves from being able to take items from the GUI when it's no longer being listened to.

stage_11 -> stage_2

For example something like action_0, is now stage_0.action_0. Obvious reason being how would you know otherwise whether it's action_0 in stage_0 or action_0 in stage_1. Fixes #74

Fixes an issue where if you join super early or reload a little unlucky, it will put a Quest into your diary based on the start of the quest (even if you have progress). This change works because QuestDiary's load the quests into themselves (when they are ready, since conveniently QuestRegistry is a neatly accessible singleton).

This would break creating new stages

this is a good thing to change, with the proper support for changing it