42 lines
1.7 KiB
Java
42 lines
1.7 KiB
Java
package net.minecraft.util.datafix.schemas;
|
|
|
|
import com.mojang.datafixers.DSL;
|
|
import com.mojang.datafixers.schemas.Schema;
|
|
import com.mojang.datafixers.types.templates.TypeTemplate;
|
|
import java.util.Map;
|
|
import java.util.function.Supplier;
|
|
import net.minecraft.util.datafix.fixes.References;
|
|
|
|
public class V1125 extends NamespacedSchema {
|
|
public V1125(int i, Schema schema) {
|
|
super(i, schema);
|
|
}
|
|
|
|
@Override
|
|
public Map<String, Supplier<TypeTemplate>> registerBlockEntities(Schema schema) {
|
|
Map<String, Supplier<TypeTemplate>> map = super.registerBlockEntities(schema);
|
|
schema.registerSimple(map, "minecraft:bed");
|
|
return map;
|
|
}
|
|
|
|
@Override
|
|
public void registerTypes(Schema schema, Map<String, Supplier<TypeTemplate>> map, Map<String, Supplier<TypeTemplate>> map2) {
|
|
super.registerTypes(schema, map, map2);
|
|
schema.registerType(
|
|
false,
|
|
References.ADVANCEMENTS,
|
|
() -> DSL.optionalFields(
|
|
"minecraft:adventure/adventuring_time",
|
|
DSL.optionalFields("criteria", DSL.compoundList(References.BIOME.in(schema), DSL.constType(DSL.string()))),
|
|
"minecraft:adventure/kill_a_mob",
|
|
DSL.optionalFields("criteria", DSL.compoundList(References.ENTITY_NAME.in(schema), DSL.constType(DSL.string()))),
|
|
"minecraft:adventure/kill_all_mobs",
|
|
DSL.optionalFields("criteria", DSL.compoundList(References.ENTITY_NAME.in(schema), DSL.constType(DSL.string()))),
|
|
"minecraft:husbandry/bred_all_animals",
|
|
DSL.optionalFields("criteria", DSL.compoundList(References.ENTITY_NAME.in(schema), DSL.constType(DSL.string())))
|
|
)
|
|
);
|
|
schema.registerType(false, References.BIOME, () -> DSL.constType(namespacedString()));
|
|
schema.registerType(false, References.ENTITY_NAME, () -> DSL.constType(namespacedString()));
|
|
}
|
|
}
|