Skip to content

Commit

Permalink
clean up usage of RecipeManager
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMCLoveMan committed Feb 27, 2024
1 parent 67274cd commit de1704f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@

import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.Container;
import net.minecraft.world.item.crafting.CraftingRecipe;
import net.minecraft.world.item.crafting.Recipe;
import net.minecraft.world.item.crafting.RecipeManager;
import net.minecraft.world.item.crafting.RecipeType;
import net.themcbrothers.interiormod.init.InteriorRecipeTypes;

import java.util.*;
import java.util.List;

/**
* @author TheMCBrothers
Expand All @@ -25,12 +21,6 @@ public InteriorRecipes() {
}

public List<CraftingRecipe> getFurnitureCraftingRecipes() {
return new ArrayList<>(getRecipes(recipeManager, InteriorRecipeTypes.FURNITURE_CRAFTING.get()));
}

@SuppressWarnings("unchecked")
private <C extends Container, T extends Recipe<C>> Collection<T> getRecipes(RecipeManager recipeManager, RecipeType<T> recipeType) {
Map<ResourceLocation, Recipe<?>> recipes = recipeManager.recipes.getOrDefault(recipeType, Collections.emptyMap());
return (Collection<T>) recipes.values();
return this.recipeManager.getAllRecipesFor(InteriorRecipeTypes.FURNITURE_CRAFTING.get());
}
}
1 change: 0 additions & 1 deletion src/main/resources/META-INF/accesstransformer.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
public net.minecraft.data.advancements.AdvancementProvider f_123961_ # GSON
public net.minecraft.world.item.crafting.RecipeManager f_44007_ # recipes

0 comments on commit de1704f

Please sign in to comment.