Add recipes for wallpaper and linoleum

This commit is contained in:
Andrew-71 2023-10-31 12:22:44 +03:00
parent e9e8dd3450
commit 4873b24911
51 changed files with 1760 additions and 8 deletions

View file

@ -4,7 +4,8 @@ package su.a71.new_soviet.datagen;
import com.google.common.collect.Lists;
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider;
import net.minecraft.block.Blocks;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.*;
import net.minecraft.data.server.recipe.RecipeJsonProvider;
import net.minecraft.data.server.recipe.RecipeProvider;
import net.minecraft.data.server.recipe.ShapedRecipeJsonBuilder;
@ -15,6 +16,7 @@ import net.minecraft.recipe.Ingredient;
import net.minecraft.recipe.book.RecipeCategory;
import net.minecraft.registry.tag.BlockTags;
import net.minecraft.registry.tag.ItemTags;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.util.Util;
import su.a71.new_soviet.registration.NSE_Blocks;
import su.a71.new_soviet.registration.NSE_Custom;
@ -137,6 +139,31 @@ public class RecipeGenerator extends FabricRecipeProvider {
.offerTo(exporter);
}
private void wallpaperRecipe(Consumer<RecipeJsonProvider> exporter, ItemConvertible output, ItemConvertible dye) {
ShapedRecipeJsonBuilder.create(RecipeCategory.BUILDING_BLOCKS, output, 2)
.input('D', dye).input('P', Items.PAPER).input('S', Items.SLIME_BALL)
.pattern(" D ")
.pattern("PPP")
.pattern(" S ")
.criterion(hasItem(dye), conditionsFromItem(dye))
.criterion(hasItem(Items.PAPER), conditionsFromItem(Items.PAPER))
.criterion(hasItem(Items.SLIME_BALL), conditionsFromItem(Items.SLIME_BALL))
.offerTo(exporter);
}
private void linoleumRecipe(Consumer<RecipeJsonProvider> exporter, ItemConvertible output, ItemConvertible dye) {
ShapedRecipeJsonBuilder.create(RecipeCategory.BUILDING_BLOCKS, output, 2)
.input('D', dye).input('P', Items.PAPER).input('C', Items.CLAY).input('S', Items.SLIME_BALL)
.pattern(" D ")
.pattern("CPC")
.pattern("SPS")
.criterion(hasItem(dye), conditionsFromItem(dye))
.criterion(hasItem(Items.PAPER), conditionsFromItem(Items.PAPER))
.criterion(hasItem(Items.SLIME_BALL), conditionsFromItem(Items.SLIME_BALL))
.criterion(hasItem(Items.CLAY), conditionsFromItem(Items.CLAY))
.offerTo(exporter);
}
private void tvRecipe(Consumer<RecipeJsonProvider> exporter, ItemConvertible output, ItemConvertible dye) {
ShapedRecipeJsonBuilder.create(RecipeCategory.DECORATIONS, output, 1)
.pattern("N N")
@ -765,7 +792,7 @@ public class RecipeGenerator extends FabricRecipeProvider {
List.of(Items.GREEN_DYE, Items.YELLOW_DYE, Items.BLUE_DYE, Items.RED_DYE, Items.WHITE_DYE, Items.LIGHT_GRAY_DYE),
List.of(NSE_Blocks.GREEN_CONCRETE.asItem(), NSE_Blocks.YELLOW_CONCRETE.asItem(), NSE_Blocks.BLUE_CONCRETE.asItem(),
NSE_Blocks.RED_CONCRETE.asItem(), NSE_Blocks.WHITE_CONCRETE.asItem(), NSE_Blocks.BEIGE_CONCRETE.asItem()),
"boundary_markers");
"concrete");
concreteRecipe(exporter, NSE_Blocks.GREEN_CONCRETE, Items.GREEN_DYE);
concreteRecipe(exporter, NSE_Blocks.YELLOW_CONCRETE, Items.YELLOW_DYE);
@ -779,5 +806,28 @@ public class RecipeGenerator extends FabricRecipeProvider {
concreteWithBarsRecipe(exporter, NSE_Blocks.RED_CONCRETE_WITH_BARS, NSE_Blocks.CRACKED_RED_CONCRETE);
concreteWithBarsRecipe(exporter, NSE_Blocks.WHITE_CONCRETE_WITH_BARS, NSE_Blocks.CRACKED_WHITE_CONCRETE);
concreteWithBarsRecipe(exporter, NSE_Blocks.BEIGE_CONCRETE_WITH_BARS, NSE_Blocks.CRACKED_BEIGE_CONCRETE);
wallpaperRecipe(exporter, NSE_Blocks.BEIGE_WALLPAPER, Items.WHITE_DYE);
wallpaperRecipe(exporter, NSE_Blocks.GREEN_WALLPAPER, Items.GREEN_DYE);
wallpaperRecipe(exporter, NSE_Blocks.BROWN_WALLPAPER, Items.BROWN_DYE);
offerDyeableRecipes(exporter,
List.of(Items.GREEN_DYE, Items.WHITE_DYE, Items.BROWN_DYE ),
List.of(NSE_Blocks.GREEN_WALLPAPER.asItem(), NSE_Blocks.BEIGE_WALLPAPER.asItem(), NSE_Blocks.BROWN_WALLPAPER.asItem()),
"wallpaper");
linoleumRecipe(exporter, NSE_Blocks.GREEN_LINOLEUM, Items.GREEN_DYE);
linoleumRecipe(exporter, NSE_Blocks.BLUE_LINOLEUM, Items.BLUE_DYE);
linoleumRecipe(exporter, NSE_Blocks.RED_LINOLEUM, Items.RED_DYE);
linoleumRecipe(exporter, NSE_Blocks.GRAY_LINOLEUM, Items.GRAY_DYE);
linoleumRecipe(exporter, NSE_Blocks.ORANGE_LINOLEUM, Items.GRAY_DYE);
linoleumRecipe(exporter, NSE_Blocks.BROWN_LINOLEUM, Items.GRAY_DYE);
linoleumRecipe(exporter, NSE_Blocks.CYAN_LINOLEUM, Items.GRAY_DYE);
offerStonecuttingRecipe(exporter, RecipeCategory.BUILDING_BLOCKS, NSE_Blocks.CROSS_ORANGE_LINOLEUM, NSE_Blocks.ORANGE_LINOLEUM);
offerStonecuttingRecipe(exporter, RecipeCategory.BUILDING_BLOCKS, NSE_Blocks.CROSS_BROWN_LINOLEUM, NSE_Blocks.ORANGE_LINOLEUM);
offerDyeableRecipes(exporter,
List.of(Items.GREEN_DYE, Items.ORANGE_DYE, Items.BLUE_DYE, Items.RED_DYE, Items.GRAY_DYE, Items.BROWN_DYE, Items.CYAN_DYE),
List.of(NSE_Blocks.GREEN_LINOLEUM.asItem(), NSE_Blocks.ORANGE_LINOLEUM.asItem(), NSE_Blocks.BLUE_LINOLEUM.asItem(),
NSE_Blocks.RED_LINOLEUM.asItem(), NSE_Blocks.GRAY_LINOLEUM.asItem(), NSE_Blocks.BROWN_LINOLEUM.asItem(), NSE_Blocks.CYAN_LINOLEUM.asItem()),
"linoleum");
}
}