Skip to content

Commit 0f854a0

Browse files
fix: rename type from alloying
1 parent 308bb12 commit 0f854a0

13 files changed

Lines changed: 26 additions & 32 deletions

File tree

src/client/java/com/tcm/MineTale/block/workbenches/screen/CampfireWorkbenchScreen.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import net.minecraft.resources.Identifier;
1717
import net.minecraft.world.entity.player.Inventory;
1818
import net.minecraft.world.item.ItemStack;
19-
import net.minecraft.world.item.crafting.RecipeBookCategories;
2019
import net.minecraft.network.chat.Component;
2120

2221
// FurnaceScreen
@@ -45,7 +44,7 @@ private static MineTaleRecipeBookComponent createRecipeBookComponent(CampfireWor
4544

4645
// CHANGE THIS: Replace CRAFTING_MISC with your custom category
4746
List<RecipeBookComponent.TabInfo> tabs = List.of(
48-
new RecipeBookComponent.TabInfo(tabIcon.getItem(), ModRecipeDisplay.CAMPFIRE_ALLOYING_SEARCH)
47+
new RecipeBookComponent.TabInfo(tabIcon.getItem(), ModRecipeDisplay.CAMPFIRE_SEARCH)
4948
);
5049

5150
return new MineTaleRecipeBookComponent(menu, tabs);

src/client/java/com/tcm/MineTale/mixin/client/ClientRecipeBookMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public abstract class ClientRecipeBookMixin {
1818
private static void minetale$addCustomCategory(RecipeHolder<?> recipe, CallbackInfoReturnable<RecipeBookCategory> cir) {
1919
if (recipe.value().getType() == ModRecipes.FURNACE_SERIALIZER) {
2020
// This tells the search engine to put your recipes into your custom tab
21-
cir.setReturnValue(ModRecipeDisplay.CAMPFIRE_ALLOYING_SEARCH);
21+
cir.setReturnValue(ModRecipeDisplay.CAMPFIRE_SEARCH);
2222
}
2323
}
2424
}

src/client/java/com/tcm/MineTale/recipe/MineTaleRecipeBookComponent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ protected void selectMatchingRecipes(RecipeCollection recipeCollection, StackedI
3939
recipeCollection.selectRecipes(stackedItemContents, (recipeDisplay) -> {
4040
// Only allow recipes that use your custom Workbench display type
4141
// This effectively filters out vanilla CraftingRecipeDisplays (the boats)
42-
return recipeDisplay.type() == ModRecipeDisplay.WORKBENCH_ALLOYING_TYPE;
42+
return recipeDisplay.type() == ModRecipeDisplay.WORKBENCH_TYPE;
4343
});
4444
}
4545

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// 1.21.11 -999999999-01-01T00:00:00 MineTale/minetaleModRecipeProvider
22
dcc5dac31dc51d16b53e14666f87d47297089c0d data/minetale/advancement/recipes/campfire_pork_cooking.json
33
dd19aa0d10f93fd31ca88ddad6ab59e1414c54dc data/minetale/advancement/recipes/furnace_pork_cooking.json
4-
c6b30105a7233e86c89fb513bd0c839b64fae640 data/minetale/recipe/campfire_pork_cooking.json
5-
8c3ca9c30df9ace65513e270fdff5f9e92aec069 data/minetale/recipe/furnace_pork_cooking.json
4+
148ccb00c60f08e02d5571193e4c7647f7b5a382 data/minetale/recipe/campfire_pork_cooking.json
5+
75851b07a6cd45395d22ed3c63683786103b98c9 data/minetale/recipe/furnace_pork_cooking.json

src/main/generated/data/minetale/recipe/campfire_pork_cooking.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"type": "minetale:campfire_alloying",
2+
"type": "minetale:campfire_recipe_type",
33
"cookTime": 10,
44
"ingredients": [
55
"minecraft:porkchop"

src/main/generated/data/minetale/recipe/furnace_pork_cooking.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"type": "minetale:furnace_alloying",
2+
"type": "minetale:furnace_recipe_type",
33
"cookTime": 10,
44
"ingredients": [
55
"minecraft:porkchop"

src/main/java/com/tcm/MineTale/block/workbenches/menu/AbstractWorkbenchContainerMenu.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,7 @@ public ItemStack quickMoveStack(Player player, int index) {
294294
@Override
295295
public RecipeBookMenu.PostPlaceAction handlePlacement(boolean placeAll, boolean isSpecial, RecipeHolder<?> recipe, ServerLevel serverLevel, Inventory inventory
296296
) {
297-
if (recipe.value() instanceof WorkbenchRecipe workbenchRecipe) {
298-
297+
if (recipe.value() instanceof WorkbenchRecipe) {
299298
@SuppressWarnings("unchecked")
300299
RecipeHolder<WorkbenchRecipe> castRecipe = (RecipeHolder<WorkbenchRecipe>) recipe;
301300
// 2. Call the static placeRecipe method

src/main/java/com/tcm/MineTale/recipe/WorkbenchRecipe.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ public boolean matches(WorkbenchRecipeInput input, Level level) {
6262
return matchesA || matchesB;
6363
}
6464

65-
// If the recipe has 2 ingredients (for future alloying/combining)
6665
if (ingredients.size() == 2) {
6766
Ingredient secondIngredient = ingredients.get(1);
6867
return (recipeIngredient.test(slotA) && secondIngredient.test(slotB)) ||
@@ -124,7 +123,7 @@ public PlacementInfo placementInfo() {
124123
@Override
125124
public RecipeBookCategory recipeBookCategory() {
126125
// Using null as we are using a custom workbench
127-
return ModRecipeDisplay.CAMPFIRE_ALLOYING_SEARCH;
126+
return ModRecipeDisplay.CAMPFIRE_SEARCH;
128127
}
129128

130129
@Override

src/main/java/com/tcm/MineTale/recipe/WorkbenchRecipeDisplay.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public SlotDisplay result() {
4343
@Override
4444
public RecipeDisplay.Type<WorkbenchRecipeDisplay> type() {
4545
// We will register this next
46-
return ModRecipeDisplay.WORKBENCH_ALLOYING_TYPE;
46+
return ModRecipeDisplay.WORKBENCH_TYPE;
4747
}
4848

4949
@Override

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,24 @@ public class ModRecipeDisplay {
2121
(ingredients, result, craftingStation) -> new WorkbenchRecipeDisplay(ingredients, result, craftingStation)
2222
);
2323

24-
public static final RecipeDisplay.Type<WorkbenchRecipeDisplay> WORKBENCH_ALLOYING_TYPE =
24+
public static final RecipeDisplay.Type<WorkbenchRecipeDisplay> WORKBENCH_TYPE =
2525
new RecipeDisplay.Type<>(WorkbenchRecipeDisplay.CODEC, STREAM_CODEC);
2626

27-
public static final RecipeBookCategory CAMPFIRE_ALLOYING_SEARCH = new RecipeBookCategory();
27+
public static final RecipeBookCategory CAMPFIRE_SEARCH = new RecipeBookCategory();
2828

2929
public static void initialize() {
3030
// Register the Display TYPE
3131
Registry.register(
3232
BuiltInRegistries.RECIPE_DISPLAY,
33-
Identifier.fromNamespaceAndPath(MineTale.MOD_ID, "workbench_alloying"),
34-
WORKBENCH_ALLOYING_TYPE
33+
Identifier.fromNamespaceAndPath(MineTale.MOD_ID, "workbench_recipe_display"),
34+
WORKBENCH_TYPE
3535
);
3636

3737
// Register the Category
3838
Registry.register(
3939
BuiltInRegistries.RECIPE_BOOK_CATEGORY,
40-
Identifier.fromNamespaceAndPath(MineTale.MOD_ID, "campfire_alloying_search"),
41-
CAMPFIRE_ALLOYING_SEARCH
40+
Identifier.fromNamespaceAndPath(MineTale.MOD_ID, "campfire_recipe_book_category"),
41+
CAMPFIRE_SEARCH
4242
);
4343
}
4444
}

0 commit comments

Comments
 (0)