Created
June 19, 2022 23:15
-
-
Save bconlon1/0591bf856632c508d3f3950de9f91b49 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AetherDataGenerator<T> { | |
public DataProvider create(DataGenerator generator, ExistingFileHelper helper, DeferredRegister<T> registry, ResourceKey<Registry<T>> registryKey) { | |
RegistryAccess registryAccess = RegistryAccess.builtinCopy(); | |
RegistryOps<JsonElement> registryOps = RegistryOps.create(JsonOps.INSTANCE, registryAccess); | |
Map<ResourceLocation, T> map = new HashMap<>(); | |
for (RegistryObject<T> object : registry.getEntries()) { | |
map.put(object.getId(), object.get()); | |
} | |
return JsonCodecProvider.forDatapackRegistry(generator, helper, Aether.MODID, registryOps, registryKey, map); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment