summaryrefslogtreecommitdiff
path: root/src/main/java/moe/nea/funnyteleporters/FunnyRecipeProvider.java
blob: d59eea01791fc0bc4316b6352094d9ad7d744bea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package moe.nea.funnyteleporters;

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.ShapedRecipeJsonBuilder;
import net.minecraft.data.server.recipe.ShapelessRecipeJsonBuilder;
import net.minecraft.item.Items;
import net.minecraft.recipe.book.RecipeCategory;
import net.minecraft.registry.RegistryWrapper;

import java.util.concurrent.CompletableFuture;

public class FunnyRecipeProvider extends FabricRecipeProvider {

	public FunnyRecipeProvider(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture) {
		super(output, registriesFuture);
	}

	@Override
	public void generate(RecipeExporter recipeExporter) {
		ShapelessRecipeJsonBuilder.create(RecipeCategory.TRANSPORTATION, FunnyRegistry.COLOURED_CHEST)
		                          .input(Items.ENDER_CHEST).input(Items.REDSTONE_BLOCK).input(Items.HOPPER)
		                          .criterion(hasItem(Items.ENDER_CHEST), conditionsFromItem(Items.ENDER_CHEST))
		                          .offerTo(recipeExporter);

		ShapedRecipeJsonBuilder.create(RecipeCategory.BUILDING_BLOCKS, FunnyRegistry.ENDER_PEARL_BLOCK)
		                       .pattern("eee").pattern("eee").pattern("eee")
		                       .input('e', Items.ENDER_PEARL)
		                       .criterion(hasItem(Items.ENDER_PEARL), conditionsFromItem(Items.ENDER_PEARL))
		                       .offerTo(recipeExporter);

		ShapelessRecipeJsonBuilder.create(RecipeCategory.MISC, Items.ENDER_PEARL, 9)
		                          .input(FunnyRegistry.ENDER_PEARL_BLOCK)
		                          .criterion(hasItem(FunnyRegistry.ENDER_PEARL_BLOCK), conditionsFromItem(FunnyRegistry.ENDER_PEARL_BLOCK))
		                          .offerTo(recipeExporter);
		ShapedRecipeJsonBuilder.create(RecipeCategory.TRANSPORTATION, FunnyRegistry.TELEPORTER)
		                       .pattern("ooo")
		                       .pattern("oeo")
		                       .pattern("ooo")
		                       .input('o', Items.OBSIDIAN)
		                       .input('e', FunnyRegistry.ENDER_PEARL_BLOCK)
		                       .criterion(hasItem(FunnyRegistry.ENDER_PEARL_BLOCK), conditionsFromItem(FunnyRegistry.ENDER_PEARL_BLOCK))
		                       .offerTo(recipeExporter);
		ShapedRecipeJsonBuilder.create(RecipeCategory.TOOLS, FunnyRegistry.TELEPORTER_WAND)
		                       .pattern("  e")
		                       .pattern(" r ")
		                       .pattern("s  ")
		                       .input('e', FunnyRegistry.ENDER_PEARL_BLOCK)
		                       .input('r', Items.REDSTONE_BLOCK)
		                       .input('s', Items.STICK)
		                       .criterion(hasItem(Items.ENDER_PEARL), conditionsFromItem(Items.ENDER_PEARL))
		                       .offerTo(recipeExporter);

		ShapedRecipeJsonBuilder.create(RecipeCategory.TRANSPORTATION, FunnyRegistry.TELEPORTER_NEXUS)
		                       .pattern(" e ")
		                       .pattern("ptp")
		                       .pattern("ttt")
		                       .input('e', Items.ENCHANTING_TABLE)
		                       .input('p', FunnyRegistry.ENDER_PEARL_BLOCK)
		                       .input('t', FunnyRegistry.TELEPORTER)
		                       .criterion(hasItem(FunnyRegistry.TELEPORTER), conditionsFromItem(FunnyRegistry.TELEPORTER))
		                       .offerTo(recipeExporter);
	}
}