Skip to content

Improve research parsing code#10732

Merged
Raycoms merged 6 commits intoversion/mainfrom
feature/improve_research_serialization
May 11, 2025
Merged

Improve research parsing code#10732
Raycoms merged 6 commits intoversion/mainfrom
feature/improve_research_serialization

Conversation

@Thodor12
Copy link
Copy Markdown
Contributor

@Thodor12 Thodor12 commented Mar 28, 2025

Changes proposed in this pull request

  • Clean up a lot of the extraneous parsing code, favoring to use GsonHelper in a lot of cases to remove lots of extra if statements
  • Custom GsonHelper implementation on top of the Minecraft one, giving even more options
  • Removed unused icon property + code for researches
  • Improved the registry setup of effects/costs/requirements
  • Research data (GlobalResearchEffect etc) it's properties are now fully final, using a JsonObject constructor for deserialization
  • Requirements now finally appropriately use the type field for parsing during JSON parse
  • New format to research > effects, (with compat code for old format + deprecation logging)
    • Datagen executed to apply new format

Testing

  • Yes I tested this before submitting it.
  • I also did a multiplayer test.

Review please

@Thodor12 Thodor12 marked this pull request as draft March 28, 2025 22:18
@Thodor12
Copy link
Copy Markdown
Contributor Author

Found a few bugs that need backporting from 1.21

@Thodor12 Thodor12 marked this pull request as ready for review March 30, 2025 17:46
# Conflicts:
#	src/datagen/generated/minecolonies/data/minecolonies/researches/civilian/agile.json
#	src/datagen/generated/minecolonies/data/minecolonies/researches/civilian/athlete.json
#	src/datagen/generated/minecolonies/data/minecolonies/researches/civilian/moq.json
#	src/datagen/generated/minecolonies/data/minecolonies/researches/civilian/nimble.json
#	src/datagen/generated/minecolonies/data/minecolonies/researches/civilian/swift.json
#	src/main/java/com/minecolonies/core/client/gui/WindowResearchTree.java
someaddons
someaddons previously approved these changes Apr 20, 2025
Raycoms
Raycoms previously approved these changes May 10, 2025
@Raycoms Raycoms dismissed stale reviews from someaddons and themself via 5b4cb71 May 11, 2025 07:58
@Raycoms Raycoms merged commit 835e12b into version/main May 11, 2025
5 checks passed
@Raycoms Raycoms deleted the feature/improve_research_serialization branch May 11, 2025 08:01
@uecasm uecasm mentioned this pull request May 26, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants