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;
|
|
|
|
import net.minecraft.data.*;
|
|
|
|
import net.minecraft.item.Items;
|
2021-05-05 18:44:52 +02:00
|
|
|
import net.minecraft.util.IItemProvider;
|
2021-05-02 00:51:36 +02:00
|
|
|
import net.minecraftforge.common.Tags;
|
|
|
|
|
|
|
|
import java.nio.file.Path;
|
2021-05-05 18:44:52 +02:00
|
|
|
import java.util.Arrays;
|
2021-05-02 00:51:36 +02:00
|
|
|
import java.util.function.Consumer;
|
|
|
|
|
|
|
|
public class BlockRecipeGenerator extends RecipeProvider {
|
|
|
|
public BlockRecipeGenerator(DataGenerator generatorIn) {
|
|
|
|
super(generatorIn);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2021-08-22 17:09:06 +02:00
|
|
|
protected void buildShapelessRecipes(Consumer<IFinishedRecipe> 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
|
|
|
|
|
|
|
//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
|
|
|
|
|
|
|
|
2021-05-02 00:51:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2021-08-22 23:40:28 +02:00
|
|
|
protected void saveAdvancement(DirectoryCache p_208310_1_, JsonObject p_208310_2_, Path p_208310_3_) {
|
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 {
|
|
|
|
public static Shapeless shapeless(IItemProvider result) {
|
|
|
|
return new Shapeless(result);
|
|
|
|
}
|
|
|
|
|
2021-05-05 19:05:24 +02:00
|
|
|
public static Shapeless shapeless(IItemProvider result, int count) {
|
|
|
|
return new Shapeless(result, count);
|
|
|
|
}
|
|
|
|
|
2021-05-05 18:44:52 +02:00
|
|
|
public static Shaped shaped(IItemProvider result) {
|
|
|
|
return new Shaped(result);
|
|
|
|
}
|
|
|
|
|
2021-05-05 19:05:24 +02:00
|
|
|
public static Shaped shaped(IItemProvider result, int count) {
|
|
|
|
return new Shaped(result, count);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void stairs(IItemProvider result, IItemProvider resource, Consumer<IFinishedRecipe> 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
|
|
|
}
|
|
|
|
|
|
|
|
public static void wall(IItemProvider result, IItemProvider resource, Consumer<IFinishedRecipe> 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
|
|
|
}
|
|
|
|
|
|
|
|
public static void slab(IItemProvider result, IItemProvider resource, Consumer<IFinishedRecipe> 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 {
|
|
|
|
public Shapeless(IItemProvider result) {
|
|
|
|
this(result, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Shapeless(IItemProvider result, int countIn) {
|
|
|
|
super(result, countIn);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Shapeless ingredients(IItemProvider... 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
|
2021-08-22 17:09:06 +02:00
|
|
|
public void save(Consumer<IFinishedRecipe> consumer) {
|
|
|
|
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 {
|
|
|
|
public Shaped(IItemProvider resultIn) {
|
|
|
|
this(resultIn, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Shaped(IItemProvider resultIn, int countIn) {
|
|
|
|
super(resultIn, countIn);
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2021-05-05 19:05:24 +02:00
|
|
|
public Shaped patternSingleKey(char key, IItemProvider 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
|
2021-08-22 17:09:06 +02:00
|
|
|
public void save(Consumer<IFinishedRecipe> consumerIn) {
|
|
|
|
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
|
|
|
}
|