generated from Anvil-Dev/ArchitecturyExampleMod
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
187 additions
and
32 deletions.
There are no files selected for viewing
35 changes: 34 additions & 1 deletion
35
common/src/main/java/dev/anvilcraft/lib/data/DataProviderType.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,55 @@ | ||
package dev.anvilcraft.lib.data; | ||
|
||
import net.minecraft.data.DataGenerator; | ||
import net.minecraft.data.DataProvider; | ||
import net.minecraft.data.recipes.RecipeProvider; | ||
import net.minecraft.data.tags.TagsProvider; | ||
import net.minecraft.world.item.Item; | ||
import net.minecraft.world.level.block.Block; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.List; | ||
import java.util.function.Consumer; | ||
|
||
public interface DataProviderType<P extends DataProvider> { | ||
DataProviderType<AnvilLibItemModelProvider> ITEM_MODEL = new DataProviderType<>() { | ||
}; | ||
DataProviderType<AnvilLibBlockModelProvider> BLOCK_MODEL = new DataProviderType<>() { | ||
}; | ||
DataProviderType<RegistratorRecipeProvider> RECIPE = new DataProviderType<>() { | ||
@Override | ||
public void create(@NotNull DataGenerator.PackGenerator generator, @NotNull String namespace, @NotNull List<Consumer<RegistratorRecipeProvider>> consumer) { | ||
generator.addProvider(output -> { | ||
RegistratorRecipeProvider provider = new RegistratorRecipeProvider(output); | ||
consumer.forEach(c -> c.accept(provider)); | ||
return provider; | ||
}); | ||
} | ||
}; | ||
DataProviderType<TagsProvider<Item>> ITEM_TAG = new DataProviderType<>() { | ||
}; | ||
DataProviderType<TagsProvider<Block>> BLOCK_TAG = new DataProviderType<>() { | ||
}; | ||
DataProviderType<LanguageProvider> LANG = new DataProviderType<>() { | ||
@Override | ||
public void create(@NotNull DataGenerator.PackGenerator generator, @NotNull String namespace, @NotNull List<Consumer<LanguageProvider>> consumer) { | ||
generator.addProvider(output -> { | ||
LanguageProvider provider = new LanguageProvider(output, namespace); | ||
consumer.forEach(c -> c.accept(provider)); | ||
return provider; | ||
}); | ||
generator.addProvider(output -> { | ||
LanguageProvider provider = new UpsideDownLanguageProvider(output, namespace); | ||
consumer.forEach(c -> c.accept(provider)); | ||
return provider; | ||
}); | ||
} | ||
}; | ||
|
||
default void create(@NotNull DataGenerator.PackGenerator generator, @NotNull String namespace, @NotNull List<Consumer<P>> consumer) { | ||
} | ||
|
||
@SuppressWarnings("unchecked") | ||
default void create(@NotNull String namespace, @NotNull DataGenerator.PackGenerator generator, @NotNull List<Consumer<? extends DataProvider>> consumer) { | ||
this.create(generator, namespace, consumer.stream().map(c -> (Consumer<P>) c).toList()); | ||
} | ||
} |
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
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
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
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
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
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
3 changes: 3 additions & 0 deletions
3
fabric/src/test/generated/resources/.cache/2fc0a18b1befa47ffaddca78faee788f5ecfb9cb
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// 1.20.1 2024-08-31T15:38:52.951909 AnvilLib Test/Recipes | ||
4cd064cbd4fa1437c2a145d2176b2cbb5b7ccc06 data/anvil-lib-test/advancements/recipes/misc/test.json | ||
5ff54d03f1e14bdfe21d703af7ab8622773d680c data/anvil-lib-test/recipes/test.json |
2 changes: 2 additions & 0 deletions
2
fabric/src/test/generated/resources/.cache/af8f5f55c1320d7b783487b0749ad66525e7e7eb
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// 1.20.1 2024-08-31T15:38:52.958558 AnvilLib Test/UpsideDownLanguage | ||
4f2270cb5b55f19f5fd5a278fec75b064631cbfa assets/anvil-lib-test/lang/en_ud.json |
2 changes: 2 additions & 0 deletions
2
fabric/src/test/generated/resources/.cache/be0358542ac885878a467772a460af89c9bc4d44
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// 1.20.1 2024-08-31T15:38:52.956432 AnvilLib Test/Language | ||
5cca06a243afdcb758b4e9b0c89bb9a8e102719d assets/anvil-lib-test/lang/en_us.json |
3 changes: 3 additions & 0 deletions
3
fabric/src/test/generated/resources/assets/anvil-lib-test/lang/en_ud.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"item.anvil-lib-test.test": "ʇsǝ⟘" | ||
} |
3 changes: 3 additions & 0 deletions
3
fabric/src/test/generated/resources/assets/anvil-lib-test/lang/en_us.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"item.anvil-lib-test.test": "Test" | ||
} |
35 changes: 35 additions & 0 deletions
35
fabric/src/test/generated/resources/data/anvil-lib-test/advancements/recipes/misc/test.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"parent": "minecraft:recipes/root", | ||
"criteria": { | ||
"has_apple": { | ||
"conditions": { | ||
"items": [ | ||
{ | ||
"items": [ | ||
"minecraft:apple" | ||
] | ||
} | ||
] | ||
}, | ||
"trigger": "minecraft:inventory_changed" | ||
}, | ||
"has_the_recipe": { | ||
"conditions": { | ||
"recipe": "anvil-lib-test:test" | ||
}, | ||
"trigger": "minecraft:recipe_unlocked" | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"has_apple", | ||
"has_the_recipe" | ||
] | ||
], | ||
"rewards": { | ||
"recipes": [ | ||
"anvil-lib-test:test" | ||
] | ||
}, | ||
"sends_telemetry_event": false | ||
} |
Oops, something went wrong.