V4300.java

net.minecraft.util.datafix.schemas.V4300

信息

  • 全限定名:net.minecraft.util.datafix.schemas.V4300
  • 类型:public class
  • 包:net.minecraft.util.datafix.schemas
  • 源码路径:src/main/java/net/minecraft/util/datafix/schemas/V4300.java
  • 起始行号:L10
  • 继承:NamespacedSchema
  • 职责:

    TODO

字段/常量

内部类/嵌套类型

构造器

public V4300(int versionKey, Schema parent) @ L11

  • 构造器名:V4300
  • 源码定位:L11
  • 修饰符:public

参数:

  • versionKey: int
  • parent: Schema

说明:

TODO

方法

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

public Map<String,Supplier<TypeTemplate>> registerEntities(Schema schema) @ L15

  • 方法名:registerEntities
  • 源码定位:L15
  • 返回类型:Map<String,Supplier>
  • 修饰符:public

参数:

  • schema: Schema

说明:

TODO

private static TypeTemplate entityWithInventory(Schema schema) @ L28

  • 方法名:entityWithInventory
  • 源码定位:L28
  • 返回类型:TypeTemplate
  • 修饰符:private static

参数:

  • schema: Schema

说明:

TODO

代码

public class V4300 extends NamespacedSchema {
    public V4300(int versionKey, Schema parent) {
        super(versionKey, parent);
    }
 
    @Override
    public Map<String, Supplier<TypeTemplate>> registerEntities(Schema schema) {
        Map<String, Supplier<TypeTemplate>> map = super.registerEntities(schema);
        schema.register(map, "minecraft:llama", name -> entityWithInventory(schema));
        schema.register(map, "minecraft:trader_llama", name -> entityWithInventory(schema));
        schema.register(map, "minecraft:donkey", name -> entityWithInventory(schema));
        schema.register(map, "minecraft:mule", name -> entityWithInventory(schema));
        schema.registerSimple(map, "minecraft:horse");
        schema.registerSimple(map, "minecraft:skeleton_horse");
        schema.registerSimple(map, "minecraft:zombie_horse");
        return map;
    }
 
    private static TypeTemplate entityWithInventory(Schema schema) {
        return DSL.optionalFields("Items", DSL.list(References.ITEM_STACK.in(schema)));
    }
}

引用的其他类