33 lines
1.8 KiB
Java
33 lines
1.8 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* com.mojang.datafixers.DSL
|
|
* com.mojang.datafixers.schemas.Schema
|
|
* com.mojang.datafixers.types.Type
|
|
* com.mojang.datafixers.types.templates.TypeTemplate
|
|
*/
|
|
package net.minecraft.util.datafix.schemas;
|
|
|
|
import com.mojang.datafixers.DSL;
|
|
import com.mojang.datafixers.schemas.Schema;
|
|
import com.mojang.datafixers.types.Type;
|
|
import com.mojang.datafixers.types.templates.TypeTemplate;
|
|
import java.util.Map;
|
|
import java.util.function.Supplier;
|
|
import net.minecraft.util.datafix.fixes.References;
|
|
import net.minecraft.util.datafix.schemas.NamespacedSchema;
|
|
|
|
public class V4292
|
|
extends NamespacedSchema {
|
|
public V4292(int versionKey, Schema parent) {
|
|
super(versionKey, parent);
|
|
}
|
|
|
|
public void registerTypes(Schema schema, Map<String, Supplier<TypeTemplate>> entityTypes, Map<String, Supplier<TypeTemplate>> blockEntityTypes) {
|
|
super.registerTypes(schema, entityTypes, blockEntityTypes);
|
|
schema.registerType(true, References.TEXT_COMPONENT, () -> DSL.or((TypeTemplate)DSL.or((TypeTemplate)DSL.constType((Type)DSL.string()), (TypeTemplate)DSL.list((TypeTemplate)References.TEXT_COMPONENT.in(schema))), (TypeTemplate)DSL.optionalFields((String)"extra", (TypeTemplate)DSL.list((TypeTemplate)References.TEXT_COMPONENT.in(schema)), (String)"separator", (TypeTemplate)References.TEXT_COMPONENT.in(schema), (String)"hover_event", (TypeTemplate)DSL.taggedChoice((String)"action", (Type)DSL.string(), Map.of("show_text", DSL.optionalFields((String)"value", (TypeTemplate)References.TEXT_COMPONENT.in(schema)), "show_item", References.ITEM_STACK.in(schema), "show_entity", DSL.optionalFields((String)"id", (TypeTemplate)References.ENTITY_NAME.in(schema), (String)"name", (TypeTemplate)References.TEXT_COMPONENT.in(schema)))))));
|
|
}
|
|
}
|
|
|