Skip to content

Commit 3e44bec

Browse files
feat: added up until rope on item/plant-fiber
1 parent c218eac commit 3e44bec

8 files changed

Lines changed: 225 additions & 32 deletions

File tree

src/client/java/com/tcm/MineTale/datagen/ModBlockTagProvider.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.tcm.MineTale.datagen;
22

3-
import com.jcraft.jorbis.Block;
43
import com.tcm.MineTale.registry.ModBlocks;
54
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
65
import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider;

src/client/java/com/tcm/MineTale/datagen/ModLootTableProvider.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import com.tcm.MineTale.block.workbenches.AbstractWorkbench;
44
import com.tcm.MineTale.registry.ModBlocks;
5-
import com.tcm.MineTale.registry.ModItems;
65
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
76
import net.fabricmc.fabric.api.datagen.v1.provider.FabricBlockLootTableProvider;
87
import net.minecraft.advancements.criterion.StatePropertiesPredicate;

src/client/java/com/tcm/MineTale/datagen/ModRecipeProvider.java

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44

55
import com.tcm.MineTale.MineTale;
66
import com.tcm.MineTale.datagen.builders.WorkbenchRecipeBuilder;
7-
import com.tcm.MineTale.registry.ModBlocks;
7+
import com.tcm.MineTale.datagen.recipes.ArmorRecipes;
8+
import com.tcm.MineTale.datagen.recipes.FurnitureRecipes;
9+
import com.tcm.MineTale.datagen.recipes.PlantFibreRecipes;
10+
import com.tcm.MineTale.datagen.recipes.WorkbenchRecipes;
811
import com.tcm.MineTale.registry.ModRecipeDisplay;
912
import com.tcm.MineTale.registry.ModRecipes;
1013

@@ -68,27 +71,6 @@ public void buildRecipes() {
6871
.bookCategory(ModRecipeDisplay.CAMPFIRE_SEARCH)
6972
.save(exporter, "campfire_pork_cooking");
7073

71-
// Workbench Recipes
72-
73-
// 1. Workbenches
74-
new WorkbenchRecipeBuilder(ModRecipes.WORKBENCH_TYPE, ModRecipes.WORKBENCH_SERIALIZER)
75-
.input(Items.COPPER_INGOT, 2)
76-
.input(ItemTags.LOGS, registryLookup, 10)
77-
.input(ItemTags.STONE_TOOL_MATERIALS, registryLookup, 5)
78-
.output(ModBlocks.ARMORERS_WORKBENCH_BLOCK.asItem())
79-
.unlockedBy("has_workbench", has(ModBlocks.WORKBENCH_WORKBENCH_BLOCK.asItem()))
80-
.bookCategory(ModRecipeDisplay.WORKBENCH_SEARCH)
81-
.save(exporter, "workbench_armorers_workbench");
82-
83-
new WorkbenchRecipeBuilder(ModRecipes.WORKBENCH_TYPE, ModRecipes.WORKBENCH_SERIALIZER)
84-
.input(ItemTags.LOGS, registryLookup, 6)
85-
.input(ItemTags.STONE_TOOL_MATERIALS, registryLookup, 6)
86-
.output(ModBlocks.FURNACE_WORKBENCH_BLOCK_T1.asItem())
87-
.unlockedBy("has_workbench", has(ModBlocks.WORKBENCH_WORKBENCH_BLOCK.asItem()))
88-
.bookCategory(ModRecipeDisplay.WORKBENCH_SEARCH)
89-
.save(exporter, "workbench_furnace_workbench_t1");
90-
91-
9274
// 2. Chests
9375
new WorkbenchRecipeBuilder(ModRecipes.WORKBENCH_TYPE, ModRecipes.WORKBENCH_SERIALIZER)
9476
.input(ItemTags.LOGS, registryLookup, 10)
@@ -108,6 +90,18 @@ public void buildRecipes() {
10890
.unlockedBy("has_copper_ore", has(Items.COPPER_ORE))
10991
.bookCategory(ModRecipeDisplay.FURNACE_T1_SEARCH)
11092
.save(exporter, "furnace_t1_copper_ingot");
93+
94+
// Crafting Recipes
95+
PlantFibreRecipes.buildRecipes(this, exporter, registryLookup);
96+
97+
// Workbench Recipes
98+
WorkbenchRecipes.buildRecipes(this, exporter, registryLookup);
99+
100+
// Armor Recipes
101+
ArmorRecipes.buildRecipes(this, exporter, registryLookup);
102+
103+
// Furniture Recipes
104+
FurnitureRecipes.buildRecipes(this, exporter, registryLookup);
111105
}
112106
};
113107
}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
package com.tcm.MineTale.datagen.recipes;
2+
3+
import com.tcm.MineTale.datagen.builders.WorkbenchRecipeBuilder;
4+
import com.tcm.MineTale.registry.ModItems;
5+
import com.tcm.MineTale.registry.ModRecipeDisplay;
6+
import com.tcm.MineTale.registry.ModRecipes;
7+
8+
import net.minecraft.core.HolderLookup;
9+
import net.minecraft.data.recipes.RecipeOutput;
10+
import net.minecraft.data.recipes.RecipeProvider;
11+
import net.minecraft.world.item.Items;
12+
13+
public class ArmorRecipes {
14+
public static void buildRecipes(RecipeProvider provider, RecipeOutput exporter, HolderLookup.Provider lookup) {
15+
new WorkbenchRecipeBuilder(ModRecipes.ARMORERS_TYPE, ModRecipes.ARMORERS_SERIALIZER)
16+
.input(Items.COPPER_INGOT, 11)
17+
.input(ModItems.PLANT_FIBER, 4)
18+
.output(Items.COPPER_CHESTPLATE)
19+
.time(3)
20+
.unlockedBy("has_copper_ingot", provider.has(Items.COPPER_INGOT))
21+
.bookCategory(ModRecipeDisplay.ARMORERS_SEARCH)
22+
.save(exporter, "copper_cuirass");
23+
24+
new WorkbenchRecipeBuilder(ModRecipes.ARMORERS_TYPE, ModRecipes.ARMORERS_SERIALIZER)
25+
.input(Items.COPPER_INGOT, 6)
26+
.input(ModItems.PLANT_FIBER, 2)
27+
.output(Items.COPPER_HELMET)
28+
.time(3)
29+
.unlockedBy("has_copper_ingot", provider.has(Items.COPPER_INGOT))
30+
.bookCategory(ModRecipeDisplay.ARMORERS_SEARCH)
31+
.save(exporter, "copper_helmet");
32+
33+
new WorkbenchRecipeBuilder(ModRecipes.ARMORERS_TYPE, ModRecipes.ARMORERS_SERIALIZER)
34+
.input(Items.COPPER_INGOT, 9)
35+
.input(ModItems.PLANT_FIBER, 3)
36+
.output(Items.COPPER_LEGGINGS)
37+
.time(3)
38+
.unlockedBy("has_copper_ingot", provider.has(Items.COPPER_INGOT))
39+
.bookCategory(ModRecipeDisplay.ARMORERS_SEARCH)
40+
.save(exporter, "copper_greaves");
41+
42+
// CopperGauntlets - TODO: CopperGauntlets Not Implemented.
43+
// new WorkbenchRecipeBuilder(ModRecipes.ARMORERS_TYPE, ModRecipes.ARMORERS_SERIALIZER)
44+
// .input(Items.COPPER_INGOT, 5)
45+
// .input(ModItems.PLANT_FIBER, 1)
46+
// .output(Items.COPPER_LEGGINGS)
47+
// .time(3)
48+
// .unlockedBy("has_copper_ingot", provider.has(Items.COPPER_INGOT))
49+
// .save(exporter, "copper_gauntlets");
50+
51+
// TODO: WoodenArmor Not Implemented
52+
// new WorkbenchRecipeBuilder(ModRecipes.ARMORERS_TYPE, ModRecipes.ARMORERS_SERIALIZER)
53+
// .input(ItemTags.LOGS, lookup, 15)
54+
// .input(ModItems.PLANT_FIBER, 3)
55+
// .output(Items.COPPER_CHESTPLATE)
56+
// .time(3)
57+
// .unlockedBy("has_copper_ingot", provider.has(Items.COPPER_INGOT))
58+
// .save(exporter, "copper_cuirass");
59+
// new WorkbenchRecipeBuilder(ModRecipes.ARMORERS_TYPE, ModRecipes.ARMORERS_SERIALIZER)
60+
// .input(Items.COPPER_INGOT, 6)
61+
// .input(ModItems.PLANT_FIBER, 2)
62+
// .output(Items.COPPER_HELMET)
63+
// .time(3)
64+
// .unlockedBy("has_copper_ingot", provider.has(Items.COPPER_INGOT))
65+
// .save(exporter, "copper_helmet");
66+
// new WorkbenchRecipeBuilder(ModRecipes.ARMORERS_TYPE, ModRecipes.ARMORERS_SERIALIZER)
67+
// .input(Items.COPPER_INGOT, 9)
68+
// .input(ModItems.PLANT_FIBER, 3)
69+
// .output(Items.COPPER_LEGGINGS)
70+
// .time(3)
71+
// .unlockedBy("has_copper_ingot", provider.has(Items.COPPER_INGOT))
72+
// .save(exporter, "copper_greaves");
73+
// new WorkbenchRecipeBuilder(ModRecipes.ARMORERS_TYPE, ModRecipes.ARMORERS_SERIALIZER)
74+
// .input(Items.COPPER_INGOT, 5)
75+
// .input(ModItems.PLANT_FIBER, 1)
76+
// .output(Items.COPPER_LEGGINGS)
77+
// .time(3)
78+
// .unlockedBy("has_copper_ingot", provider.has(Items.COPPER_INGOT))
79+
// .save(exporter, "copper_gauntlets");
80+
81+
82+
}
83+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
package com.tcm.MineTale.datagen.recipes;
2+
3+
import net.minecraft.core.HolderLookup;
4+
import net.minecraft.data.recipes.RecipeOutput;
5+
import net.minecraft.data.recipes.RecipeProvider;
6+
7+
public class FurnitureRecipes {
8+
public static void buildRecipes(RecipeProvider provider, RecipeOutput exporter, HolderLookup.Provider lookup) {
9+
// TODO: WOODCUTTERS_BLOCK & FURNITURE_WORKBENCH_BLOCK Not Implemented
10+
// new WorkbenchRecipeBuilder(ModRecipes.FURNITURE_TYPE, ModRecipes.FURNITURE_SERIALIZER)
11+
// .input(ItemTags.LOGS, lookup)
12+
// .input(ModItems.RUBBLE, 2)
13+
// .input(ModItems.PLANT_FIBER, 2)
14+
// .input(Items.STICK, 2)
15+
// .output(ModItems.WOODCUTTERS_BLOCK)
16+
// .unlockedBy("has_furniture_workbench", provider.has(ModBlocks.FURNITURE_WORKBENCH_BLOCK))
17+
// .bookCategory(ModRecipeDisplay.FURNITURE_SEARCH)
18+
// .save(exporter, "woodcutters_block");
19+
20+
// TODO: LARGE_PILE_OF_BOOKS & FURNITURE_WORKBENCH_BLOCK Not Implemented
21+
// new WorkbenchRecipeBuilder(ModRecipes.FURNITURE_TYPE, ModRecipes.FURNITURE_SERIALIZER)
22+
// .input(ModItems.PLANT_FIBER, 12)
23+
// .input(ModItems.LIGHT_LEATHER, 4)
24+
// .output(ModBlocks.LARGE_PILE_OF_BOOKS.asItem())
25+
// .unlockedBy("has_furniture_workbench", provider.has(ModBlocks.FURNITURE_WORKBENCH_BLOCK))
26+
// .bookCategory(ModRecipeDisplay.FURNITURE_SEARCH)
27+
// .save(exporter, "LARGE_PILE_OF_BOOKS");
28+
29+
// TODO: SMALL_PILE_OF_BOOKS & FURNITURE_WORKBENCH_BLOCK Not Implemented
30+
// new WorkbenchRecipeBuilder(ModRecipes.FURNITURE_TYPE, ModRecipes.FURNITURE_SERIALIZER)
31+
// .input(ModItems.PLANT_FIBER, 6)
32+
// .input(ModItems.LIGHT_LEATHER, 2)
33+
// .output(ModBlocks.SMALL_PILE_OF_BOOKS.asItem())
34+
// .unlockedBy("has_furniture_workbench", provider.has(ModBlocks.FURNITURE_WORKBENCH_BLOCK))
35+
// .bookCategory(ModRecipeDisplay.FURNITURE_SEARCH)
36+
// .save(exporter, "SMALL_PILE_OF_BOOKS");
37+
38+
// TODO: KWEEBEC_PLUSHIE & FURNITURE_WORKBENCH_BLOCK Not Implemented
39+
// new WorkbenchRecipeBuilder(ModRecipes.FURNITURE_TYPE, ModRecipes.FURNITURE_SERIALIZER)
40+
// .input(ModBlocks.CYAN_CLOTH, 2)
41+
// .input(ModItems.PLANT_FIBER, 4)
42+
// .output(ModBlocks.KWEEBEC_PLUSHIE.asItem())
43+
// .unlockedBy("has_furniture_workbench", provider.has(ModBlocks.FURNITURE_WORKBENCH_BLOCK))
44+
// .bookCategory(ModRecipeDisplay.FURNITURE_SEARCH)
45+
// .save(exporter, "KWEEBEC_PLUSHIE");
46+
}
47+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.tcm.MineTale.datagen.recipes;
2+
3+
import com.tcm.MineTale.datagen.builders.WorkbenchRecipeBuilder;
4+
import com.tcm.MineTale.registry.ModItems;
5+
import com.tcm.MineTale.registry.ModRecipes;
6+
7+
import net.minecraft.core.HolderLookup;
8+
import net.minecraft.data.recipes.RecipeOutput;
9+
import net.minecraft.data.recipes.RecipeProvider;
10+
import net.minecraft.world.item.Items;
11+
12+
public class PlantFibreRecipes {
13+
public static void buildRecipes(RecipeProvider provider, RecipeOutput exporter, HolderLookup.Provider lookup) {
14+
// Use the static helper from RecipeProvider (or InventoryChangeTrigger)
15+
new WorkbenchRecipeBuilder(ModRecipes.WORKBENCH_TYPE, ModRecipes.WORKBENCH_SERIALIZER)
16+
.input(ModItems.PLANT_FIBER, 3)
17+
.output(Items.STRING)
18+
.unlockedBy("has_plant_fibre", provider.has(ModItems.PLANT_FIBER.asItem())) // Call the static version
19+
.save(exporter, "plant_fibre_to_string");
20+
}
21+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
package com.tcm.MineTale.datagen.recipes;
2+
3+
import com.tcm.MineTale.datagen.builders.WorkbenchRecipeBuilder;
4+
import com.tcm.MineTale.registry.ModBlocks;
5+
import com.tcm.MineTale.registry.ModRecipeDisplay;
6+
import com.tcm.MineTale.registry.ModRecipes;
7+
8+
import net.minecraft.core.HolderLookup;
9+
import net.minecraft.data.recipes.RecipeOutput;
10+
import net.minecraft.data.recipes.RecipeProvider;
11+
import net.minecraft.tags.ItemTags;
12+
import net.minecraft.world.item.Items;
13+
14+
public class WorkbenchRecipes {
15+
public static void buildRecipes(RecipeProvider provider, RecipeOutput exporter, HolderLookup.Provider lookup) {
16+
new WorkbenchRecipeBuilder(ModRecipes.WORKBENCH_TYPE, ModRecipes.WORKBENCH_SERIALIZER)
17+
.input(Items.COPPER_INGOT, 2)
18+
.input(ItemTags.LOGS, lookup, 10)
19+
.input(ItemTags.STONE_TOOL_MATERIALS, lookup, 5)
20+
.output(ModBlocks.ARMORERS_WORKBENCH_BLOCK.asItem())
21+
.time(3)
22+
.unlockedBy("has_workbench", provider.has(ModBlocks.WORKBENCH_WORKBENCH_BLOCK.asItem()))
23+
.bookCategory(ModRecipeDisplay.WORKBENCH_SEARCH)
24+
.save(exporter, "workbench_armorers_workbench");
25+
26+
new WorkbenchRecipeBuilder(ModRecipes.WORKBENCH_TYPE, ModRecipes.WORKBENCH_SERIALIZER)
27+
.input(ItemTags.LOGS, lookup, 6)
28+
.input(ItemTags.STONE_TOOL_MATERIALS, lookup, 6)
29+
.output(ModBlocks.FURNACE_WORKBENCH_BLOCK_T1.asItem())
30+
.time(3)
31+
.unlockedBy("has_workbench", provider.has(ModBlocks.WORKBENCH_WORKBENCH_BLOCK.asItem()))
32+
.bookCategory(ModRecipeDisplay.WORKBENCH_SEARCH)
33+
.save(exporter, "workbench_furnace_workbench_t1");
34+
35+
// TODO: FarmersWorkbench Not Implemented
36+
// new WorkbenchRecipeBuilder(ModRecipes.WORKBENCH_TYPE, ModRecipes.WORKBENCH_SERIALIZER)
37+
// .input(ItemTags.LOGS, lookup, 6)
38+
// .input(ModItems.PLANT_FIBER, 20)
39+
// .output(ModBlocks.FARMERS_WORKBENCH)
40+
// .time(3)
41+
// .unlockedBy("has_workbench", provider.has(ModBlocks.WORKBENCH_WORKBENCH_BLOCK.asItem()))
42+
// .bookCategory(ModRecipeDisplay.WORKBENCH_SEARCH)
43+
// .save(exporter, "workbench_farmers_workbench");
44+
45+
// TODO: ChickenCoop Not Implemented
46+
// new WorkbenchRecipeBuilder(ModRecipes.FARMERS_TYPE, ModRecipes.FARMERS_SERIALIZER)
47+
// .input(ItemTags.PLANKS, lookup, 20)
48+
// .input(ModItems.ESSENCE_OF_LIFE, 50)
49+
// .input(ModItems.PLANT_FIBER, 6)
50+
// .output(ModBlocks.CHICKEN_COOP.asItem())
51+
// .time(2)
52+
// .unlockedBy("has_workbench", provider.has(ModBlocks.FARMERS_WORKBENCH.asItem()))
53+
// .bookCategory(ModRecipeDisplay.FARMERS_SEARCH)
54+
// .save(exporter, "workbench_furnace_workbench_t1");
55+
56+
57+
}
58+
}

src/main/java/com/tcm/MineTale/registry/ModItems.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,18 @@
33
import java.util.ArrayList;
44
import java.util.List;
55
import java.util.function.Function;
6-
import java.util.function.UnaryOperator;
76

87
import com.tcm.MineTale.MineTale;
98
import com.tcm.MineTale.item.ModCreativeTab;
109

1110
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
1211
import net.minecraft.core.Registry;
13-
import net.minecraft.core.component.DataComponents;
1412
import net.minecraft.core.registries.BuiltInRegistries;
1513
import net.minecraft.core.registries.Registries;
1614
import net.minecraft.resources.Identifier;
1715
import net.minecraft.resources.ResourceKey;
1816
import net.minecraft.world.food.FoodProperties;
19-
import net.minecraft.world.item.BlockItem;
2017
import net.minecraft.world.item.Item;
21-
import net.minecraft.world.item.Items;
22-
import net.minecraft.world.item.component.ItemContainerContents;
23-
import net.minecraft.world.level.block.Block;
24-
25-
import static net.minecraft.world.item.Items.registerBlock;
2618

2719
public class ModItems {
2820

0 commit comments

Comments
 (0)