mirror of
https://github.com/Pridecraft-Studios/joy.git
synced 2025-08-03 14:36:03 -04:00
feat: Add flowers -> dyes
This commit is contained in:
parent
7f137234f5
commit
74a44d8e9b
@ -25,6 +25,7 @@ public class JoyData implements DataGeneratorEntrypoint {
|
|||||||
pack.addProvider(JoyEntityTagProvider::new);
|
pack.addProvider(JoyEntityTagProvider::new);
|
||||||
pack.addProvider(JoyItemTagProvider::new);
|
pack.addProvider(JoyItemTagProvider::new);
|
||||||
pack.addProvider(JoyModelProvider::new);
|
pack.addProvider(JoyModelProvider::new);
|
||||||
|
pack.addProvider(JoyRecipeProvider::new);
|
||||||
|
|
||||||
for (final var translation : Bootstrap.getMissingTranslations()) {
|
for (final var translation : Bootstrap.getMissingTranslations()) {
|
||||||
logger.warn("Missing translation: {}", translation);
|
logger.warn("Missing translation: {}", translation);
|
||||||
|
@ -0,0 +1,41 @@
|
|||||||
|
package gay.pridecraft.joy.data;
|
||||||
|
|
||||||
|
import gay.pridecraft.joy.registry.JoyBlocks;
|
||||||
|
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||||
|
import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider;
|
||||||
|
import net.minecraft.data.server.recipe.RecipeExporter;
|
||||||
|
import net.minecraft.data.server.recipe.ShapelessRecipeJsonBuilder;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemConvertible;
|
||||||
|
import net.minecraft.item.Items;
|
||||||
|
import net.minecraft.recipe.book.RecipeCategory;
|
||||||
|
import net.minecraft.registry.Registries;
|
||||||
|
import net.minecraft.registry.RegistryWrapper;
|
||||||
|
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Ampflower
|
||||||
|
* @since 1.0.0
|
||||||
|
**/
|
||||||
|
public class JoyRecipeProvider extends FabricRecipeProvider {
|
||||||
|
public JoyRecipeProvider(final FabricDataOutput output, final CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture) {
|
||||||
|
super(output, registriesFuture);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void generate(final RecipeExporter exporter) {
|
||||||
|
offerConversion(JoyBlocks.BLUE_ALLIUM, Items.BLUE_DYE, exporter);
|
||||||
|
offerConversion(JoyBlocks.PINK_ALLIUM, Items.PINK_DYE, exporter);
|
||||||
|
offerConversion(JoyBlocks.WHITE_ALLIUM, Items.WHITE_DYE, exporter);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void offerConversion(ItemConvertible base, Item dye, RecipeExporter exporter) {
|
||||||
|
ShapelessRecipeJsonBuilder.create(RecipeCategory.MISC, dye)
|
||||||
|
.input(base)
|
||||||
|
.group(Registries.ITEM.getId(dye).getPath())
|
||||||
|
.criterion(Registries.ITEM.getId(base.asItem())
|
||||||
|
.withSuffixedPath("has_").toString(), conditionsFromItem(base))
|
||||||
|
.offerTo(exporter);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user