diff --git a/src/main/java/codechicken/lib/datagen/ItemModelProvider.java b/src/main/java/codechicken/lib/datagen/ItemModelProvider.java index 96b21847..20b17f49 100644 --- a/src/main/java/codechicken/lib/datagen/ItemModelProvider.java +++ b/src/main/java/codechicken/lib/datagen/ItemModelProvider.java @@ -165,6 +165,11 @@ private ExistingFileHelper getExistingFileHelper() { return existingFileHelper; } + @Override + public String getName() { + return modid + " Item models."; + } + public static class SimpleItemModelBuilder { private final ItemModelProvider provider; diff --git a/src/main/java/codechicken/lib/datagen/LootTableProvider.java b/src/main/java/codechicken/lib/datagen/LootTableProvider.java index bf3bf7ef..458a4bad 100644 --- a/src/main/java/codechicken/lib/datagen/LootTableProvider.java +++ b/src/main/java/codechicken/lib/datagen/LootTableProvider.java @@ -40,13 +40,14 @@ public abstract class LootTableProvider implements DataProvider { private static final Logger logger = LogManager.getLogger(); - private static final Gson GSON = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create(); private final PackOutput.PathProvider output; + protected final String modId; private final Map tables = new HashMap<>(); - protected LootTableProvider(PackOutput output) { + protected LootTableProvider(PackOutput output, String modId) { this.output = output.createPathProvider(PackOutput.Target.DATA_PACK, "loot_tables"); + this.modId = modId; } @Override @@ -88,10 +89,6 @@ protected void registerTable(ResourceLocation name, LootTable table) { } } - private static Path getPath(Path pathIn, ResourceLocation id) { - return pathIn.resolve("data/" + id.getNamespace() + "/loot_tables/" + id.getPath() + ".json"); - } - public static abstract class BlockLootProvider extends LootTableProvider { protected static final LootItemCondition.Builder SILK_TOUCH = MatchTool.toolMatches(ItemPredicate.Builder.item() @@ -99,8 +96,8 @@ public static abstract class BlockLootProvider extends LootTableProvider { ); protected static final LootItemCondition.Builder NO_SILK_TOUCH = SILK_TOUCH.invert(); - protected BlockLootProvider(PackOutput output) { - super(output); + protected BlockLootProvider(PackOutput output, String modId) { + super(output, modId); } protected LootPool.Builder singleItem(ItemLike item) { @@ -160,6 +157,10 @@ public void register(Block block, LootTable.Builder builder) { protected void register(ResourceLocation name, LootTable.Builder builder) { registerTable(new ResourceLocation(name.getNamespace(), "blocks/" + name.getPath()), builder.setParamSet(LootContextParamSets.BLOCK).build()); } - } + @Override + public String getName() { + return modId + " Block Loot Tables"; + } + } } diff --git a/src/main/java/codechicken/lib/datagen/recipe/RecipeProvider.java b/src/main/java/codechicken/lib/datagen/recipe/RecipeProvider.java index cb38c5ed..d1098c45 100644 --- a/src/main/java/codechicken/lib/datagen/recipe/RecipeProvider.java +++ b/src/main/java/codechicken/lib/datagen/recipe/RecipeProvider.java @@ -31,9 +31,11 @@ public abstract class RecipeProvider implements DataProvider { private final Map recipes = new HashMap<>(); private final PackOutput output; + protected final String modId; - public RecipeProvider(PackOutput output) { + public RecipeProvider(PackOutput output, String modId) { this.output = output; + this.modId = modId; } @Override @@ -169,4 +171,9 @@ protected InventoryChangeTrigger.TriggerInstance hasItem(TagKey tagIn) { protected InventoryChangeTrigger.TriggerInstance hasItem(ItemPredicate... predicates) { return new InventoryChangeTrigger.TriggerInstance(ContextAwarePredicate.ANY, MinMaxBounds.Ints.ANY, MinMaxBounds.Ints.ANY, MinMaxBounds.Ints.ANY, predicates); } + + @Override + public String getName() { + return modId + " Recipes."; + } }