33 lines
1.2 KiB
Java
33 lines
1.2 KiB
Java
package net.minecraft.client.multiplayer;
|
|
|
|
import java.util.Map;
|
|
import net.fabricmc.api.EnvType;
|
|
import net.fabricmc.api.Environment;
|
|
import net.minecraft.resources.ResourceKey;
|
|
import net.minecraft.world.item.crafting.RecipeAccess;
|
|
import net.minecraft.world.item.crafting.RecipePropertySet;
|
|
import net.minecraft.world.item.crafting.SelectableRecipe;
|
|
import net.minecraft.world.item.crafting.StonecutterRecipe;
|
|
|
|
@Environment(EnvType.CLIENT)
|
|
public class ClientRecipeContainer implements RecipeAccess {
|
|
private final Map<ResourceKey<RecipePropertySet>, RecipePropertySet> itemSets;
|
|
private final SelectableRecipe.SingleInputSet<StonecutterRecipe> stonecutterRecipes;
|
|
|
|
public ClientRecipeContainer(
|
|
Map<ResourceKey<RecipePropertySet>, RecipePropertySet> itemSets, SelectableRecipe.SingleInputSet<StonecutterRecipe> stonecutterRecipes
|
|
) {
|
|
this.itemSets = itemSets;
|
|
this.stonecutterRecipes = stonecutterRecipes;
|
|
}
|
|
|
|
@Override
|
|
public RecipePropertySet propertySet(ResourceKey<RecipePropertySet> propertySet) {
|
|
return (RecipePropertySet)this.itemSets.getOrDefault(propertySet, RecipePropertySet.EMPTY);
|
|
}
|
|
|
|
@Override
|
|
public SelectableRecipe.SingleInputSet<StonecutterRecipe> stonecutterRecipes() {
|
|
return this.stonecutterRecipes;
|
|
}
|
|
}
|