33 lines
1.1 KiB
Java
33 lines
1.1 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 V2684 extends NamespacedSchema {
|
|
public V2684(int i, Schema schema) {
|
|
super(i, schema);
|
|
}
|
|
|
|
@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.GAME_EVENT_NAME, () -> DSL.constType(namespacedString()));
|
|
}
|
|
|
|
@Override
|
|
public Map<String, Supplier<TypeTemplate>> registerBlockEntities(Schema schema) {
|
|
Map<String, Supplier<TypeTemplate>> map = super.registerBlockEntities(schema);
|
|
schema.register(
|
|
map,
|
|
"minecraft:sculk_sensor",
|
|
(Supplier<TypeTemplate>)(() -> DSL.optionalFields(
|
|
"listener", DSL.optionalFields("event", DSL.optionalFields("game_event", References.GAME_EVENT_NAME.in(schema)))
|
|
))
|
|
);
|
|
return map;
|
|
}
|
|
}
|