| 1 | package net.minecraft.util.datafix.schemas;
|
| 2 |
|
| 3 | import com.mojang.datafixers.DSL;
|
| 4 | import com.mojang.datafixers.schemas.Schema;
|
| 5 | import com.mojang.datafixers.types.templates.TypeTemplate;
|
| 6 | import java.util.Map;
|
| 7 | import java.util.function.Supplier;
|
| 8 | import net.minecraft.util.datafix.fixes.References;
|
| 9 |
|
| 10 | public class V1451_3 extends NamespacedSchema {
|
| 11 | public V1451_3(final int versionKey, final Schema parent) {
|
| 12 | super(versionKey, parent);
|
| 13 | }
|
| 14 |
|
| 15 | @Override
|
| 16 | public Map<String, Supplier<TypeTemplate>> registerEntities(final Schema schema) {
|
| 17 | Map<String, Supplier<TypeTemplate>> map = super.registerEntities(schema);
|
| 18 | schema.registerSimple(map, "minecraft:egg");
|
| 19 | schema.registerSimple(map, "minecraft:ender_pearl");
|
| 20 | schema.registerSimple(map, "minecraft:fireball");
|
| 21 | schema.register(map, "minecraft:potion", name -> DSL.optionalFields("Potion", References.ITEM_STACK.in(schema)));
|
| 22 | schema.registerSimple(map, "minecraft:small_fireball");
|
| 23 | schema.registerSimple(map, "minecraft:snowball");
|
| 24 | schema.registerSimple(map, "minecraft:wither_skull");
|
| 25 | schema.registerSimple(map, "minecraft:xp_bottle");
|
| 26 | schema.register(map, "minecraft:arrow", () -> DSL.optionalFields("inBlockState", References.BLOCK_STATE.in(schema)));
|
| 27 | schema.register(map, "minecraft:enderman", () -> DSL.optionalFields("carriedBlockState", References.BLOCK_STATE.in(schema)));
|
| 28 | schema.register(
|
| 29 | map,
|
| 30 | "minecraft:falling_block",
|
| 31 | () -> DSL.optionalFields("BlockState", References.BLOCK_STATE.in(schema), "TileEntityData", References.BLOCK_ENTITY.in(schema))
|
| 32 | );
|
| 33 | schema.register(map, "minecraft:spectral_arrow", () -> DSL.optionalFields("inBlockState", References.BLOCK_STATE.in(schema)));
|
| 34 | schema.register(
|
| 35 | map,
|
| 36 | "minecraft:chest_minecart",
|
| 37 | () -> DSL.optionalFields("DisplayState", References.BLOCK_STATE.in(schema), "Items", DSL.list(References.ITEM_STACK.in(schema)))
|
| 38 | );
|
| 39 | schema.register(
|
| 40 | map,
|
| 41 | "minecraft:commandblock_minecart",
|
| 42 | () -> DSL.optionalFields("DisplayState", References.BLOCK_STATE.in(schema), "LastOutput", References.TEXT_COMPONENT.in(schema))
|
| 43 | );
|
| 44 | schema.register(map, "minecraft:furnace_minecart", () -> DSL.optionalFields("DisplayState", References.BLOCK_STATE.in(schema)));
|
| 45 | schema.register(
|
| 46 | map,
|
| 47 | "minecraft:hopper_minecart",
|
| 48 | () -> DSL.optionalFields("DisplayState", References.BLOCK_STATE.in(schema), "Items", DSL.list(References.ITEM_STACK.in(schema)))
|
| 49 | );
|
| 50 | schema.register(map, "minecraft:minecart", () -> DSL.optionalFields("DisplayState", References.BLOCK_STATE.in(schema)));
|
| 51 | schema.register(
|
| 52 | map, "minecraft:spawner_minecart", () -> DSL.optionalFields("DisplayState", References.BLOCK_STATE.in(schema), References.UNTAGGED_SPAWNER.in(schema))
|
| 53 | );
|
| 54 | schema.register(map, "minecraft:tnt_minecart", () -> DSL.optionalFields("DisplayState", References.BLOCK_STATE.in(schema)));
|
| 55 | return map;
|
| 56 | }
|
| 57 | }
|
| 58 |
|