ClientRecipeContainer.java

net.minecraft.client.multiplayer.ClientRecipeContainer

信息

  • 全限定名:net.minecraft.client.multiplayer.ClientRecipeContainer
  • 类型:public class
  • 包:net.minecraft.client.multiplayer
  • 源码路径:src/main/java/net/minecraft/client/multiplayer/ClientRecipeContainer.java
  • 起始行号:L13
  • 实现:RecipeAccess
  • 职责:

    TODO

字段/常量

  • itemSets

    • 类型: Map<ResourceKey<RecipePropertySet>,RecipePropertySet>
    • 修饰符: private final
    • 源码定位: L14
    • 说明:

      TODO

  • stonecutterRecipes

    • 类型: SelectableRecipe.SingleInputSet<StonecutterRecipe>
    • 修饰符: private final
    • 源码定位: L15
    • 说明:

      TODO

内部类/嵌套类型

构造器

public ClientRecipeContainer(Map<ResourceKey<RecipePropertySet>,RecipePropertySet> itemSets, SelectableRecipe.SingleInputSet<StonecutterRecipe> stonecutterRecipes) @ L17

  • 构造器名:ClientRecipeContainer
  • 源码定位:L17
  • 修饰符:public

参数:

  • itemSets: Map<ResourceKey,RecipePropertySet>
  • stonecutterRecipes: SelectableRecipe.SingleInputSet

说明:

TODO

方法

下面的方法块按源码顺序生成。

public RecipePropertySet propertySet(ResourceKey<RecipePropertySet> id) @ L24

  • 方法名:propertySet
  • 源码定位:L24
  • 返回类型:RecipePropertySet
  • 修饰符:public

参数:

  • id: ResourceKey

说明:

TODO

public SelectableRecipe.SingleInputSet<StonecutterRecipe> stonecutterRecipes() @ L29

  • 方法名:stonecutterRecipes
  • 源码定位:L29
  • 返回类型:SelectableRecipe.SingleInputSet
  • 修饰符:public

参数:

说明:

TODO

代码

@OnlyIn(Dist.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> id) {
        return this.itemSets.getOrDefault(id, RecipePropertySet.EMPTY);
    }
 
    @Override
    public SelectableRecipe.SingleInputSet<StonecutterRecipe> stonecutterRecipes() {
        return this.stonecutterRecipes;
    }
}

引用的其他类