gigaherz / Guidebook

Minecraft book API and library
https://www.curseforge.com/minecraft/mc-mods/guidebook
Other
31 stars 16 forks source link

Cleanups, Refactors and a Datagen #106

Open Minecraftschurli opened 2 years ago

gigaherz commented 2 years ago

Uhhh... could you give an explanation of what you changed and why? You made a lot of changes ;P

Minecraftschurli commented 2 years ago
  1. I moved the book parsing into another class and those methods static
  2. I moved the document level elements and the inline elements to a map of factories like the custom elements
  3. I moved the default elements to the map of elements
  4. I added custom element post processors to be able to modify existing elements based on a custom attribute
  5. I moved the logger to slf4j
  6. I moved to the usage of try with resources
  7. I made it invalidate the include cache on reload
  8. I made a base interface for all elements including the ChapterData and such
  9. I expanded the parsing context to accommodate the new way of parsing
  10. I added the Color record to handle colors (can now also handle hsl)
  11. I added the Length record to handle lengths (width, height, ...) with units (px, %, ...)
  12. I converted the Size and Point classes to records (and renamed the Point classes to make it more clear what they are)