2021-05-02 00:51:36 +02:00
|
|
|
package de.ellpeck.actuallyadditions.data;
|
|
|
|
|
|
|
|
import com.google.gson.JsonObject;
|
2021-05-05 18:34:43 +02:00
|
|
|
import de.ellpeck.actuallyadditions.api.ActuallyTags;
|
2021-05-02 00:51:36 +02:00
|
|
|
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
|
2024-03-03 01:20:53 +01:00
|
|
|
import net.minecraft.data.CachedOutput;
|
|
|
|
import net.minecraft.data.PackOutput;
|
2024-03-02 21:23:08 +01:00
|
|
|
import net.minecraft.data.recipes.FinishedRecipe;
|
2024-03-03 01:20:53 +01:00
|
|
|
import net.minecraft.data.recipes.RecipeCategory;
|
2024-03-02 21:23:08 +01:00
|
|
|
import net.minecraft.data.recipes.RecipeProvider;
|
|
|
|
import net.minecraft.data.recipes.ShapedRecipeBuilder;
|
|
|
|
import net.minecraft.data.recipes.ShapelessRecipeBuilder;
|
2022-04-23 19:49:25 +02:00
|
|
|
import net.minecraft.tags.ItemTags;
|
2024-03-02 21:23:08 +01:00
|
|
|
import net.minecraft.world.item.Items;
|
|
|
|
import net.minecraft.world.level.ItemLike;
|
2021-05-02 00:51:36 +02:00
|
|
|
import net.minecraftforge.common.Tags;
|
2024-03-03 01:20:53 +01:00
|
|
|
import org.jetbrains.annotations.Nullable;
|
2021-05-02 00:51:36 +02:00
|
|
|
|
2023-01-07 21:54:54 +01:00
|
|
|
import javax.annotation.Nonnull;
|
2021-05-05 18:44:52 +02:00
|
|
|
import java.util.Arrays;
|
2024-03-03 01:20:53 +01:00
|
|
|
import java.util.concurrent.CompletableFuture;
|
2021-05-02 00:51:36 +02:00
|
|
|
import java.util.function.Consumer;
|
|
|
|
|
|
|
|
public class BlockRecipeGenerator extends RecipeProvider {
|
2024-03-03 01:20:53 +01:00
|
|
|
public BlockRecipeGenerator(PackOutput packOutput) {
|
|
|
|
super(packOutput);
|
2021-05-02 00:51:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2024-03-03 01:20:53 +01:00
|
|
|
protected void buildRecipes(@Nonnull Consumer<FinishedRecipe> consumer) {
|
2021-05-02 17:47:50 +02:00
|
|
|
//Battery Box
|
2021-11-24 17:57:31 +01:00
|
|
|
Recipe.shapeless(ActuallyBlocks.BATTERY_BOX.getItem()).ingredients(ActuallyBlocks.ENERGIZER.get(), ActuallyBlocks.ENERVATOR.get(), ActuallyItems.BASIC_COIL.get()).save(consumer);
|
2021-05-02 00:51:36 +02:00
|
|
|
|
2021-05-02 17:47:50 +02:00
|
|
|
//Farmer
|
2021-10-02 18:49:11 +02:00
|
|
|
Recipe.shaped(ActuallyBlocks.FARMER.getItem())
|
2021-08-22 23:40:28 +02:00
|
|
|
.pattern("ISI", "SCS", "ISI")
|
|
|
|
.define('I', ActuallyBlocks.ENORI_CRYSTAL.getItem())
|
|
|
|
.define('C', ActuallyBlocks.IRON_CASING.get())
|
|
|
|
.define('S', Tags.Items.SEEDS)
|
|
|
|
.save(consumer);
|
2021-05-05 18:44:52 +02:00
|
|
|
|
2021-05-05 19:05:24 +02:00
|
|
|
//Empowerer
|
2021-10-02 18:49:11 +02:00
|
|
|
Recipe.shaped(ActuallyBlocks.EMPOWERER.getItem())
|
2021-08-22 23:40:28 +02:00
|
|
|
.pattern(" R ", " B ", "CDC")
|
|
|
|
.define('R', ActuallyItems.RESTONIA_CRYSTAL.get())
|
2021-11-24 17:57:31 +01:00
|
|
|
.define('B', ActuallyItems.DOUBLE_BATTERY.get())
|
2021-08-22 23:40:28 +02:00
|
|
|
.define('C', ActuallyBlocks.IRON_CASING.get())
|
|
|
|
.define('D', ActuallyBlocks.DISPLAY_STAND.get())
|
|
|
|
.save(consumer);
|
2021-05-05 19:05:24 +02:00
|
|
|
|
|
|
|
//Tiny Torch
|
2021-10-02 18:49:11 +02:00
|
|
|
Recipe.shaped(ActuallyBlocks.TINY_TORCH.getItem(), 2)
|
2021-08-22 23:40:28 +02:00
|
|
|
.pattern("C", "S")
|
|
|
|
.define('C', ActuallyTags.Items.TINY_COALS)
|
|
|
|
.define('S', Tags.Items.RODS_WOODEN)
|
2021-11-21 22:38:48 +01:00
|
|
|
.save(consumer);
|
2021-05-05 17:21:00 +02:00
|
|
|
|
|
|
|
//Fireworks Box
|
2021-10-02 18:49:11 +02:00
|
|
|
Recipe.shaped(ActuallyBlocks.FIREWORK_BOX.getItem())
|
2021-08-22 23:40:28 +02:00
|
|
|
.pattern("GFG", "SAS", "CCC")
|
|
|
|
.define('G', Tags.Items.GUNPOWDER)
|
|
|
|
.define('S', Tags.Items.RODS_WOODEN)
|
|
|
|
.define('A', ActuallyBlocks.IRON_CASING.get())
|
|
|
|
.define('F', Items.FIREWORK_ROCKET)
|
|
|
|
.define('C', ActuallyItems.ENORI_CRYSTAL.get())
|
|
|
|
.save(consumer);
|
2021-05-05 17:21:00 +02:00
|
|
|
|
|
|
|
//Shock Suppressor
|
2021-10-02 18:49:11 +02:00
|
|
|
Recipe.shaped(ActuallyBlocks.SHOCK_SUPPRESSOR.getItem())
|
2021-11-27 01:21:01 +01:00
|
|
|
.pattern("OAO", "ACA", "OAO")
|
|
|
|
.define('A', ActuallyItems.EMPOWERED_VOID_CRYSTAL.get())
|
|
|
|
.define('O', Tags.Items.OBSIDIAN)
|
|
|
|
.define('C', ActuallyItems.ADVANCED_COIL.get())
|
|
|
|
.save(consumer);
|
2021-05-02 17:47:50 +02:00
|
|
|
|
2021-05-05 17:21:00 +02:00
|
|
|
//Display Stand
|
2021-10-02 18:49:11 +02:00
|
|
|
Recipe.shaped(ActuallyBlocks.DISPLAY_STAND.getItem())
|
2021-11-27 01:21:01 +01:00
|
|
|
.pattern(" R ", "EEE", "GGG")
|
|
|
|
.define('R', ActuallyItems.ADVANCED_COIL.get())
|
|
|
|
.define('E', ActuallyBlocks.ETHETIC_GREEN_BLOCK.get())
|
|
|
|
.define('G', ActuallyBlocks.ETHETIC_WHITE_BLOCK.get())
|
|
|
|
.save(consumer);
|
2021-05-05 18:15:25 +02:00
|
|
|
|
|
|
|
//Vertical Digger
|
2021-10-02 18:49:11 +02:00
|
|
|
Recipe.shaped(ActuallyBlocks.VERTICAL_DIGGER.getItem())
|
2021-11-27 01:21:01 +01:00
|
|
|
.pattern("IRI", "RCR", "IDI")
|
|
|
|
.define('R', Tags.Items.STORAGE_BLOCKS_REDSTONE)
|
|
|
|
.define('I', ActuallyBlocks.IRON_CASING.get())
|
|
|
|
.define('C', ActuallyItems.EMPOWERED_VOID_CRYSTAL.get())
|
|
|
|
.define('D', ActuallyTags.Items.DRILLS)
|
|
|
|
.save(consumer);
|
2021-05-05 18:15:25 +02:00
|
|
|
|
|
|
|
//Black Quartz Wall
|
2021-11-25 21:27:45 +01:00
|
|
|
Recipe.wall(ActuallyBlocks.BLACK_QUARTZ_WALL.getItem(), ActuallyBlocks.BLACK_QUARTZ_PILLAR.get(), consumer);
|
2021-05-05 18:15:25 +02:00
|
|
|
|
|
|
|
//Black Quartz Slab
|
2021-11-25 21:27:45 +01:00
|
|
|
Recipe.slab(ActuallyBlocks.BLACK_QUARTZ_SLAB.getItem(), ActuallyBlocks.BLACK_QUARTZ_PILLAR.get(), consumer);
|
2021-05-05 18:15:25 +02:00
|
|
|
|
|
|
|
//Black Quartz Stairs
|
2021-11-25 21:27:45 +01:00
|
|
|
Recipe.stairs(ActuallyBlocks.BLACK_QUARTZ_STAIR.getItem(), ActuallyBlocks.BLACK_QUARTZ_PILLAR.get(), consumer);
|
2021-05-05 18:34:43 +02:00
|
|
|
|
2023-01-07 21:54:54 +01:00
|
|
|
//Smooth Black Quartz Wall
|
|
|
|
Recipe.wall(ActuallyBlocks.SMOOTH_BLACK_QUARTZ_WALL.getItem(), ActuallyBlocks.SMOOTH_BLACK_QUARTZ.get(), consumer);
|
|
|
|
|
|
|
|
//Smooth Black Quartz Slab
|
|
|
|
Recipe.slab(ActuallyBlocks.SMOOTH_BLACK_QUARTZ_SLAB.getItem(), ActuallyBlocks.SMOOTH_BLACK_QUARTZ.get(), consumer);
|
|
|
|
|
|
|
|
//Smooth Black Quartz Stairs
|
|
|
|
Recipe.stairs(ActuallyBlocks.SMOOTH_BLACK_QUARTZ_STAIR.getItem(), ActuallyBlocks.SMOOTH_BLACK_QUARTZ.get(), consumer);
|
|
|
|
|
|
|
|
//Black Quartz Brick Wall
|
|
|
|
Recipe.wall(ActuallyBlocks.BLACK_QUARTZ_BRICK_WALL.getItem(), ActuallyBlocks.BLACK_QUARTZ_BRICK.get(), consumer);
|
|
|
|
|
|
|
|
//Black Quartz Brick Slab
|
|
|
|
Recipe.slab(ActuallyBlocks.BLACK_QUARTZ_BRICK_SLAB.getItem(), ActuallyBlocks.BLACK_QUARTZ_BRICK.get(), consumer);
|
|
|
|
|
|
|
|
//Black Quartz Brick Stairs
|
|
|
|
Recipe.stairs(ActuallyBlocks.BLACK_QUARTZ_BRICK_STAIR.getItem(), ActuallyBlocks.BLACK_QUARTZ_BRICK.get(), consumer);
|
|
|
|
|
2021-05-05 18:34:43 +02:00
|
|
|
//Pillar Black Quartz Wall
|
2021-11-25 21:27:45 +01:00
|
|
|
Recipe.wall(ActuallyBlocks.BLACK_QUARTZ_PILLAR_WALL.getItem(), ActuallyBlocks.BLACK_QUARTZ_PILLAR.get(), consumer);
|
2021-05-05 18:34:43 +02:00
|
|
|
|
|
|
|
//Pillar Black Quartz Slab
|
2021-11-25 21:27:45 +01:00
|
|
|
Recipe.slab(ActuallyBlocks.BLACK_QUARTZ_PILLAR_SLAB.getItem(), ActuallyBlocks.BLACK_QUARTZ_PILLAR.get(), consumer);
|
2021-05-05 18:34:43 +02:00
|
|
|
|
|
|
|
//Pillar Black Quartz Stairs
|
2021-11-25 21:27:45 +01:00
|
|
|
Recipe.stairs(ActuallyBlocks.BLACK_QUARTZ_PILLAR_STAIR.getItem(), ActuallyBlocks.BLACK_QUARTZ_PILLAR.get(), consumer);
|
2021-05-05 18:34:43 +02:00
|
|
|
|
|
|
|
//Chiseled Black Quartz Wall
|
2021-11-25 21:27:45 +01:00
|
|
|
Recipe.wall(ActuallyBlocks.CHISELED_BLACK_QUARTZ_WALL.getItem(), ActuallyBlocks.CHISELED_BLACK_QUARTZ.get(), consumer);
|
2021-05-05 18:34:43 +02:00
|
|
|
|
|
|
|
//Chiseled Black Quartz Slab
|
2021-11-25 21:27:45 +01:00
|
|
|
Recipe.slab(ActuallyBlocks.CHISELED_BLACK_QUARTZ_SLAB.getItem(), ActuallyBlocks.CHISELED_BLACK_QUARTZ.get(), consumer);
|
2021-05-05 18:34:43 +02:00
|
|
|
|
|
|
|
//Chiseled Black Quartz Stairs
|
2021-11-25 21:27:45 +01:00
|
|
|
Recipe.stairs(ActuallyBlocks.CHISELED_BLACK_QUARTZ_STAIR.getItem(), ActuallyBlocks.CHISELED_BLACK_QUARTZ.get(), consumer);
|
2021-05-05 18:15:25 +02:00
|
|
|
|
|
|
|
//Ethetic White Wall
|
2021-10-02 18:49:11 +02:00
|
|
|
Recipe.wall(ActuallyBlocks.ETHETIC_WHITE_WALL.getItem(), ActuallyBlocks.ETHETIC_WHITE_BLOCK.get(), consumer);
|
2021-05-05 18:15:25 +02:00
|
|
|
|
|
|
|
//Ethetic White Slab
|
2021-10-02 18:49:11 +02:00
|
|
|
Recipe.slab(ActuallyBlocks.ETHETIC_WHITE_SLAB.getItem(), ActuallyBlocks.ETHETIC_WHITE_BLOCK.get(), consumer);
|
2021-05-05 18:15:25 +02:00
|
|
|
|
|
|
|
//Ethetic White Stairs
|
2021-10-02 18:49:11 +02:00
|
|
|
Recipe.stairs(ActuallyBlocks.ETHETIC_WHITE_STAIRS.getItem(), ActuallyBlocks.ETHETIC_WHITE_BLOCK.get(), consumer);
|
2021-05-05 19:05:24 +02:00
|
|
|
|
|
|
|
// Ethetic Green Wall
|
2021-10-02 18:49:11 +02:00
|
|
|
Recipe.wall(ActuallyBlocks.ETHETIC_GREEN_WALL.getItem(), ActuallyBlocks.ETHETIC_GREEN_BLOCK.get(), consumer);
|
2021-05-05 19:05:24 +02:00
|
|
|
|
|
|
|
// Ethetic Green Slab
|
2021-10-02 18:49:11 +02:00
|
|
|
Recipe.slab(ActuallyBlocks.ETHETIC_GREEN_SLAB.getItem(), ActuallyBlocks.ETHETIC_GREEN_BLOCK.get(), consumer);
|
2021-05-05 19:05:24 +02:00
|
|
|
|
|
|
|
// Ethetic Green Stairs
|
2021-10-02 18:49:11 +02:00
|
|
|
Recipe.stairs(ActuallyBlocks.ETHETIC_GREEN_STAIRS.getItem(), ActuallyBlocks.ETHETIC_GREEN_BLOCK.get(), consumer);
|
2021-05-05 19:05:24 +02:00
|
|
|
|
|
|
|
// Atomic Reconstructor
|
2021-10-02 18:49:11 +02:00
|
|
|
Recipe.shaped(ActuallyBlocks.ATOMIC_RECONSTRUCTOR.getItem())
|
2021-08-22 23:40:28 +02:00
|
|
|
.pattern("IRI", "RCR", "IRI")
|
|
|
|
.define('R', Tags.Items.DUSTS_REDSTONE)
|
|
|
|
.define('I', Tags.Items.INGOTS_IRON)
|
|
|
|
.define('C', ActuallyBlocks.IRON_CASING.get())
|
|
|
|
.save(consumer);
|
2021-05-09 23:31:24 +02:00
|
|
|
|
|
|
|
// Laser Relay
|
2021-10-02 18:49:11 +02:00
|
|
|
Recipe.shaped(ActuallyBlocks.LASER_RELAY.getItem(), 4)
|
2021-08-22 23:40:28 +02:00
|
|
|
.pattern("OBO", "RCR", "OBO")
|
|
|
|
.define('B', Tags.Items.STORAGE_BLOCKS_REDSTONE)
|
|
|
|
.define('O', Tags.Items.OBSIDIAN)
|
|
|
|
.define('R', ActuallyItems.RESTONIA_CRYSTAL.get())
|
2021-11-24 17:57:31 +01:00
|
|
|
.define('C', ActuallyItems.ADVANCED_COIL.get())
|
2021-08-22 23:40:28 +02:00
|
|
|
.save(consumer);
|
2021-05-09 23:31:24 +02:00
|
|
|
|
|
|
|
// Advanced Laser Relay
|
2021-10-02 18:49:11 +02:00
|
|
|
Recipe.shaped(ActuallyBlocks.LASER_RELAY_ADVANCED.getItem())
|
2021-08-22 23:40:28 +02:00
|
|
|
.pattern(" I ", "XRX", " I ")
|
|
|
|
.define('I', ActuallyItems.ENORI_CRYSTAL.get())
|
|
|
|
.define('R', ActuallyBlocks.LASER_RELAY.get())
|
|
|
|
.define('X', ActuallyItems.RESTONIA_CRYSTAL.get())
|
|
|
|
.save(consumer);
|
2021-05-09 23:31:24 +02:00
|
|
|
|
|
|
|
// Extreme Laser Relay
|
2021-10-02 18:49:11 +02:00
|
|
|
Recipe.shaped(ActuallyBlocks.LASER_RELAY_EXTREME.getItem())
|
2021-08-22 23:40:28 +02:00
|
|
|
.pattern(" I ", "XRX", " I ")
|
2021-10-14 21:15:16 +02:00
|
|
|
.define('I', ActuallyItems.EMPOWERED_DIAMATINE_CRYSTAL.get())
|
2021-08-22 23:40:28 +02:00
|
|
|
.define('R', ActuallyBlocks.LASER_RELAY_ADVANCED.get())
|
|
|
|
.define('X', ActuallyItems.RESTONIA_CRYSTAL.get())
|
|
|
|
.save(consumer);
|
2021-08-22 20:16:04 +02:00
|
|
|
|
|
|
|
// Whitelist Item Laser Relay
|
2021-10-02 18:49:11 +02:00
|
|
|
Recipe.shapeless(ActuallyBlocks.LASER_RELAY_ITEM_ADVANCED.getItem())
|
2021-11-24 17:57:31 +01:00
|
|
|
.ingredients(ActuallyBlocks.LASER_RELAY_ITEM.get(), ActuallyItems.ADVANCED_COIL.get(), ActuallyItems.BLACK_QUARTZ.get())
|
2021-08-22 23:40:28 +02:00
|
|
|
.save(consumer);
|
2021-08-22 20:16:04 +02:00
|
|
|
|
|
|
|
// Item Interface
|
2021-11-13 18:02:42 +01:00
|
|
|
Recipe.shaped(ActuallyBlocks.ITEM_INTERFACE.getItem())
|
2021-08-22 23:40:28 +02:00
|
|
|
.pattern("OBO", "RCR", "OBO")
|
|
|
|
.define('B', Tags.Items.DUSTS_REDSTONE)
|
2021-11-24 17:57:31 +01:00
|
|
|
.define('O', ActuallyItems.BASIC_COIL.get())
|
2021-08-22 23:40:28 +02:00
|
|
|
.define('R', ActuallyItems.RESTONIA_CRYSTAL.get())
|
|
|
|
.define('C', Tags.Items.CHESTS_WOODEN)
|
|
|
|
.save(consumer);
|
2021-08-22 20:16:04 +02:00
|
|
|
|
|
|
|
// Hopping Item Interface
|
2021-11-13 18:02:42 +01:00
|
|
|
Recipe.shapeless(ActuallyBlocks.ITEM_INTERFACE_HOPPING.get()).ingredients(ActuallyBlocks.ITEM_INTERFACE.get()).save(consumer);
|
2021-08-22 20:16:04 +02:00
|
|
|
|
2022-04-23 19:49:25 +02:00
|
|
|
//Wood Casing
|
|
|
|
Recipe.shaped(ActuallyBlocks.WOOD_CASING.getItem())
|
|
|
|
.pattern("WSW", "SRS", "WSW")
|
|
|
|
.define('S', Tags.Items.RODS_WOODEN)
|
|
|
|
.define('W', ItemTags.PLANKS)
|
|
|
|
.define('R', ItemTags.LOGS)
|
|
|
|
.save(consumer);
|
|
|
|
|
|
|
|
//Iron Casing
|
|
|
|
Recipe.shaped(ActuallyBlocks.IRON_CASING.getItem())
|
|
|
|
.pattern("WSW", "SQS", "WSW")
|
|
|
|
.define('Q', ActuallyItems.BLACK_QUARTZ.get())
|
|
|
|
.define('W', Tags.Items.INGOTS_IRON)
|
|
|
|
.define('S', Tags.Items.RODS_WOODEN)
|
|
|
|
.save(consumer);
|
|
|
|
|
|
|
|
//Ender Casing
|
|
|
|
Recipe.shaped(ActuallyBlocks.ENDER_CASING.getItem())
|
|
|
|
.pattern("WSW", "SRS", "WSW")
|
|
|
|
.define('W', Tags.Items.ENDER_PEARLS)
|
|
|
|
.define('R', ActuallyBlocks.BLACK_QUARTZ.getItem())
|
|
|
|
.define('S', ActuallyItems.EMPOWERED_DIAMATINE_CRYSTAL.get())
|
|
|
|
.save(consumer);
|
|
|
|
|
|
|
|
|
2021-08-22 20:16:04 +02:00
|
|
|
|
2021-05-02 00:51:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2024-03-03 01:20:53 +01:00
|
|
|
protected @Nullable CompletableFuture<?> saveAdvancement(CachedOutput output, FinishedRecipe finishedRecipe, JsonObject advancementJson) {
|
|
|
|
return null;
|
2021-05-09 23:31:24 +02:00
|
|
|
//Nope... maybe later...
|
2021-05-02 00:51:36 +02:00
|
|
|
}
|
2021-05-05 18:44:52 +02:00
|
|
|
|
|
|
|
public static class Recipe {
|
2024-03-02 21:23:08 +01:00
|
|
|
public static Shapeless shapeless(ItemLike result) {
|
2021-05-05 18:44:52 +02:00
|
|
|
return new Shapeless(result);
|
|
|
|
}
|
|
|
|
|
2024-03-02 21:23:08 +01:00
|
|
|
public static Shapeless shapeless(ItemLike result, int count) {
|
2021-05-05 19:05:24 +02:00
|
|
|
return new Shapeless(result, count);
|
|
|
|
}
|
|
|
|
|
2024-03-02 21:23:08 +01:00
|
|
|
public static Shaped shaped(ItemLike result) {
|
2021-05-05 18:44:52 +02:00
|
|
|
return new Shaped(result);
|
|
|
|
}
|
|
|
|
|
2024-03-02 21:23:08 +01:00
|
|
|
public static Shaped shaped(ItemLike result, int count) {
|
2021-05-05 19:05:24 +02:00
|
|
|
return new Shaped(result, count);
|
|
|
|
}
|
|
|
|
|
2024-03-02 21:23:08 +01:00
|
|
|
public static void stairs(ItemLike result, ItemLike resource, Consumer<FinishedRecipe> consumer) {
|
2021-08-22 17:09:06 +02:00
|
|
|
Recipe.shaped(result).patternSingleKey('Q', resource, "Q ", "QQ ", "QQQ").save(consumer);
|
2021-05-05 19:05:24 +02:00
|
|
|
}
|
|
|
|
|
2024-03-02 21:23:08 +01:00
|
|
|
public static void wall(ItemLike result, ItemLike resource, Consumer<FinishedRecipe> consumer) {
|
2021-08-22 17:09:06 +02:00
|
|
|
Recipe.shaped(result).patternSingleKey('Q', resource, "QQQ", "QQQ").save(consumer);
|
2021-05-05 19:05:24 +02:00
|
|
|
}
|
|
|
|
|
2024-03-02 21:23:08 +01:00
|
|
|
public static void slab(ItemLike result, ItemLike resource, Consumer<FinishedRecipe> consumer) {
|
2021-08-22 17:09:06 +02:00
|
|
|
Recipe.shaped(result).patternSingleKey('Q', resource, "QQQ").save(consumer);
|
2021-05-05 19:05:24 +02:00
|
|
|
}
|
|
|
|
|
2021-05-05 18:44:52 +02:00
|
|
|
private static class Shapeless extends ShapelessRecipeBuilder {
|
2024-03-02 21:23:08 +01:00
|
|
|
public Shapeless(ItemLike result) {
|
2021-05-05 18:44:52 +02:00
|
|
|
this(result, 1);
|
|
|
|
}
|
|
|
|
|
2024-03-02 21:23:08 +01:00
|
|
|
public Shapeless(ItemLike result, int countIn) {
|
2024-03-03 01:20:53 +01:00
|
|
|
super(RecipeCategory.MISC, result, countIn);
|
2021-05-05 18:44:52 +02:00
|
|
|
}
|
|
|
|
|
2024-03-02 21:23:08 +01:00
|
|
|
public Shapeless ingredients(ItemLike... ingredients) {
|
2021-08-22 17:09:06 +02:00
|
|
|
Arrays.asList(ingredients).forEach(this::requires);
|
2021-05-05 18:44:52 +02:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2024-03-02 21:23:08 +01:00
|
|
|
public void save(Consumer<FinishedRecipe> consumer) {
|
2021-08-22 17:09:06 +02:00
|
|
|
this.unlockedBy("has_book", has(ActuallyItems.ITEM_BOOKLET.get()));
|
|
|
|
super.save(consumer);
|
2021-05-05 18:44:52 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private static class Shaped extends ShapedRecipeBuilder {
|
2024-03-02 21:23:08 +01:00
|
|
|
public Shaped(ItemLike resultIn) {
|
2021-05-05 18:44:52 +02:00
|
|
|
this(resultIn, 1);
|
|
|
|
}
|
|
|
|
|
2024-03-02 21:23:08 +01:00
|
|
|
public Shaped(ItemLike resultIn, int countIn) {
|
2024-03-03 01:20:53 +01:00
|
|
|
super(RecipeCategory.MISC, resultIn, countIn);
|
2021-05-05 18:44:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public Shaped pattern(String line1, String line2, String line3) {
|
2021-08-22 17:09:06 +02:00
|
|
|
this.pattern(line1);
|
|
|
|
this.pattern(line2);
|
|
|
|
this.pattern(line3);
|
2021-05-05 18:44:52 +02:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Shaped pattern(String line1, String line2) {
|
2021-08-22 17:09:06 +02:00
|
|
|
this.pattern(line1);
|
|
|
|
this.pattern(line2);
|
2021-05-05 18:44:52 +02:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2024-03-02 21:23:08 +01:00
|
|
|
public Shaped patternSingleKey(char key, ItemLike resource, String... lines) {
|
2021-08-22 17:09:06 +02:00
|
|
|
this.define(key, resource);
|
2021-05-05 19:05:24 +02:00
|
|
|
for (String line : lines) {
|
2021-08-22 17:09:06 +02:00
|
|
|
this.pattern(line);
|
2021-05-05 19:05:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2021-05-05 18:44:52 +02:00
|
|
|
@Override
|
2024-03-02 21:23:08 +01:00
|
|
|
public void save(Consumer<FinishedRecipe> consumerIn) {
|
2021-08-22 17:09:06 +02:00
|
|
|
this.unlockedBy("has_book", has(ActuallyItems.ITEM_BOOKLET.get()));
|
|
|
|
super.save(consumerIn);
|
2021-05-05 18:44:52 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-05-02 00:51:36 +02:00
|
|
|
}
|