Tough As Nails

Tough As Nails

21M Downloads

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

Kiryonn opened this issue ยท 0 comments

commented

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)