Gamemode 4 is a collection of modular Minecraft Datapacks that change or expand on the vanilla experience whilst keeping the vanilla feel. Our modules are developed with a focus on usability and efficiency.
All modules will need to be redownloaded to support the new guidebook module. Most of the guidebook json files haven't changed since the beet script handles the generate files.
Changes
Removed runtime alphabetical sort
it was only necessary for the distinction between Resurrecting Zombie and Resurrecting Skeletons
it caused inconsistent, difficult to reproduce bugs that just broke the table of contents entirely
Removed binary search tree in favor of macros
macros made the lectern table of contents much better as a direct insert of the lectern page number could be done instead
Removed separate loot tables for each module's book
due to the way the books are generated, there is only a loot table for the default book
this doesn't change survival gameplay
lecterns don't even use loot tables at all anymore
Unlocked page info is probably faster now
instead of building the book info upon changing the book, the book info is only updated once the player obtains an unlock advancement
book info is now stored in a Player Database which stored the book info for each module per player
when a player db entry is created, the player's advancements are checked to ensure their unlocked pages don't get lost
Update recipe files to use components
only visually affects SCUBA Gear and Boots of Ostara
Other recipes were update too in case we do want to use those to generate files in the future (unlikely cuz of the new nbt output crafting, but we'll see)
Future Optimizations
When modules are changed, the entire player database is wiped (restored with advancements, so nothing breaks)
Necessary since if a module is enabled/disabled it can change the book contents (e.g. the pages for desire lines change if boots of ostara and/or metallurgy are installed), and thus the page info needs to be updated for each player
Currently deletes the entire player db since it's the easiest way to do it
Can be sped up in "runtime" by deleting only entries for modules that have such complementary pages
will slow down the initial time required right after a /reload when modules are changed since it would require checking each player db entry for matching modules (this is nontrivial since the player db entries are currently stored only as a map; may require storing an extra list with each key to iterate through the entire player db)
The player db can become very large with duplicate data
Each player has a copy of their entire unlocked book data which may have duplicate pages as another player
This could be solved with a mapping system which maps an index to a variation of a page, so only one of each variation is created once and a link is created in the player db entry
Instead of storing the pages as strings, each player db entry (i.e. one for each player) would only contain integers which is significantly less storage
The mapping system would reduce the file size since the only duplicated data would be the index values
We usually don't consider space constraints, but the file may become significantly large on servers with many players
This would technically add more time to access a book since it'd have to do an extra (macro) data read
Another Major Change (Guidebook v3.0.0)
All modules will need to be redownloaded to support the new guidebook module. Most of the guidebook json files haven't changed since the beet script handles the generate files.
Changes
Removed runtime alphabetical sort
Removed binary search tree in favor of macros
Removed separate loot tables for each module's book
Unlocked page info is probably faster now
Update recipe files to use components
Future Optimizations
When modules are changed, the entire player database is wiped (restored with advancements, so nothing breaks)
/reload
when modules are changed since it would require checking each player db entry for matching modules (this is nontrivial since the player db entries are currently stored only as a map; may require storing an extra list with each key to iterate through the entire player db)The player db can become very large with duplicate data