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

[1.21.3] Add method to allow building custom DataGenerator.PackGenerator instances #1624

Open
wants to merge 1 commit into
base: 1.21.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion patches/net/minecraft/data/DataGenerator.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
stopwatch1.start();
hashcache.applyUpdate(hashcache.generateUpdate(p_254418_, p_253750_::run).join());
stopwatch1.stop();
@@ -56,6 +_,51 @@
@@ -56,6 +_,55 @@
public DataGenerator.PackGenerator getBuiltinDatapack(boolean p_253826_, String p_254134_) {
Path path = this.vanillaPackOutput.getOutputFolder(PackOutput.Target.DATA_PACK).resolve("minecraft").resolve("datapacks").resolve(p_254134_);
return new DataGenerator.PackGenerator(p_253826_, p_254134_, new PackOutput(path));
Expand All @@ -39,6 +39,10 @@
+ return new PackOutput(rootOutputFolder.resolve(path));
+ }
+
+ public PackGenerator getPackGenerator(boolean run, String providerPrefix, String path) {
+ return new PackGenerator(run, providerPrefix, getPackOutput(path));
+ }
+
+ public <T extends DataProvider> T addProvider(boolean run, DataProvider.Factory<T> factory) {
+ return addProvider(run, factory.create(this.vanillaPackOutput));
+ }
Expand Down