Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Water Purifier fuel data-driven and rework thirst/hydration data files #845

Open
Kiryonn opened this issue May 25, 2024 · 0 comments
Open

Comments

@Kiryonn
Copy link

Kiryonn commented May 25, 2024

Overview

Don't hard code the water purifier fuel sources.
I had to look into the code to see that:

Item Duration (ticks)
SHORT_GRASS 100
PAPER 200
GRAVEL 400
SAND 800
CHARCOAL 1600
PRISMARINE_CRYSTALS 3200
HEART_OF_THE_SEA 6400

Also why are the hydration values set like that ?
image
Just use a dictionary with keys & values in one single file. It would be much easier to deserialize the data if you do.
Usually you would use items as keys and the values as, well, values...

Why would this feature be useful?

  • make the mod more modulable (so people can add their own fuel source for modpacks, mod compatibility, and datapacks).
  • more readability (for yourself and other people working on your mod)
  • more maintainability (you don't have to change your code whenever you want to add or remove a fuel source)
@Forstride Forstride changed the title Bad Programming Practices Make Water Purifier fuel data-driven and rework thirst/hydration data files May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants