PrismarineJS / minecraft-data

Language independent module providing minecraft data for minecraft clients, servers and libraries.
https://prismarinejs.github.io/minecraft-data
646 stars 218 forks source link

Fuel burn times #352

Open smartboyathome opened 3 years ago

smartboyathome commented 3 years ago

I am a developer on the Glowstone minecraft server, which is a clean room Java server implementing the Bukkit (as carried on by Paper / Spigot) APIs. One of the things I have been focusing on during our huge uplift from 1.12 to 1.16 is utilizing external data sources over hard coded data where possible. I have a module that generates Bukkit implementations from data packs, but one key source of data that is missing for us is fuel burn times.

Today how this is handled is that we have a manager that contains all materials or tags, mapped to their fuel burn time in seconds. Ideally, this would be stored as ticks in a series of JSON files in the data pack generated by the vanilla server, but until that happens we're hoping minecraft-data can fill that void. Currently, we don't know of any other source outside of the vanilla server itself that provides this data, so it would likely need to be maintained by hand here, but this could lead to reduced redundant maintenance for other server implementations.

rom1504 commented 3 years ago

Sounds pretty good. https://github.com/PrismarineJS/minecraft-data/issues/290 may contain some information for this

extremeheat commented 3 years ago

This can be extracted from the source with Burger or a separate extractor, something that was discussed in #290. I think manual data should be avoided most of the time, it's hard to reproduce and hard to keep update.

Relevant sources:

I'll have to dig through the source a bit more to see where they changed furnace fuels, probably happened in 1.13 but as you can see it's stored in a Map now which makes it alot easier to parse. But of course we want to support 1.7+ if possible so I'm not sure if the fuel times changed between 1.7 - 1.6, but if not the 1.16 data could be backported to older versions. I think @DeltaEvo was looking at using mc as a lib, not sure how successful that was. Otherwise I was thinking of a hacky workaround in parsing some of the Java code as JS and using that to extract data, it would be easier to resolve block/item tags this way and from a bit of testing this seems to actually work.