| 1 | package net.minecraft.util.datafix.schemas;
|
| 2 |
|
| 3 | import com.google.common.collect.Maps;
|
| 4 | import com.mojang.datafixers.DSL;
|
| 5 | import com.mojang.datafixers.schemas.Schema;
|
| 6 | import com.mojang.datafixers.types.templates.TypeTemplate;
|
| 7 | import com.mojang.datafixers.types.templates.Hook.HookFunction;
|
| 8 | import com.mojang.datafixers.util.Pair;
|
| 9 | import java.util.Map;
|
| 10 | import java.util.function.Supplier;
|
| 11 | import net.minecraft.util.datafix.fixes.References;
|
| 12 |
|
| 13 | public class V1460 extends NamespacedSchema {
|
| 14 | public V1460(final int versionKey, final Schema parent) {
|
| 15 | super(versionKey, parent);
|
| 16 | }
|
| 17 |
|
| 18 | protected static void registerMob(final Schema schema, final Map<String, Supplier<TypeTemplate>> map, final String name) {
|
| 19 | schema.registerSimple(map, name);
|
| 20 | }
|
| 21 |
|
| 22 | protected static void registerInventory(final Schema schema, final Map<String, Supplier<TypeTemplate>> map, final String name) {
|
| 23 | schema.register(map, name, () -> V1458.nameableInventory(schema));
|
| 24 | }
|
| 25 |
|
| 26 | @Override
|
| 27 | public Map<String, Supplier<TypeTemplate>> registerEntities(final Schema schema) {
|
| 28 | Map<String, Supplier<TypeTemplate>> map = Maps.newHashMap();
|
| 29 | schema.register(map, "minecraft:area_effect_cloud", name -> DSL.optionalFields("Particle", References.PARTICLE.in(schema)));
|
| 30 | registerMob(schema, map, "minecraft:armor_stand");
|
| 31 | schema.register(map, "minecraft:arrow", name -> DSL.optionalFields("inBlockState", References.BLOCK_STATE.in(schema)));
|
| 32 | registerMob(schema, map, "minecraft:bat");
|
| 33 | registerMob(schema, map, "minecraft:blaze");
|
| 34 | schema.registerSimple(map, "minecraft:boat");
|
| 35 | registerMob(schema, map, "minecraft:cave_spider");
|
| 36 | schema.register(
|
| 37 | map,
|
| 38 | "minecraft:chest_minecart",
|
| 39 | name -> DSL.optionalFields("DisplayState", References.BLOCK_STATE.in(schema), "Items", DSL.list(References.ITEM_STACK.in(schema)))
|
| 40 | );
|
| 41 | registerMob(schema, map, "minecraft:chicken");
|
| 42 | schema.register(
|
| 43 | map,
|
| 44 | "minecraft:commandblock_minecart",
|
| 45 | name -> DSL.optionalFields("DisplayState", References.BLOCK_STATE.in(schema), "LastOutput", References.TEXT_COMPONENT.in(schema))
|
| 46 | );
|
| 47 | registerMob(schema, map, "minecraft:cow");
|
| 48 | registerMob(schema, map, "minecraft:creeper");
|
| 49 | schema.register(
|
| 50 | map, "minecraft:donkey", name -> DSL.optionalFields("Items", DSL.list(References.ITEM_STACK.in(schema)), "SaddleItem", References.ITEM_STACK.in(schema))
|
| 51 | );
|
| 52 | schema.registerSimple(map, "minecraft:dragon_fireball");
|
| 53 | schema.registerSimple(map, "minecraft:egg");
|
| 54 | registerMob(schema, map, "minecraft:elder_guardian");
|
| 55 | schema.registerSimple(map, "minecraft:ender_crystal");
|
| 56 | registerMob(schema, map, "minecraft:ender_dragon");
|
| 57 | schema.register(map, "minecraft:enderman", name -> DSL.optionalFields("carriedBlockState", References.BLOCK_STATE.in(schema)));
|
| 58 | registerMob(schema, map, "minecraft:endermite");
|
| 59 | schema.registerSimple(map, "minecraft:ender_pearl");
|
| 60 | schema.registerSimple(map, "minecraft:evocation_fangs");
|
| 61 | registerMob(schema, map, "minecraft:evocation_illager");
|
| 62 | schema.registerSimple(map, "minecraft:eye_of_ender_signal");
|
| 63 | schema.register(
|
| 64 | map,
|
| 65 | "minecraft:falling_block",
|
| 66 | name -> DSL.optionalFields("BlockState", References.BLOCK_STATE.in(schema), "TileEntityData", References.BLOCK_ENTITY.in(schema))
|
| 67 | );
|
| 68 | schema.registerSimple(map, "minecraft:fireball");
|
| 69 | schema.register(map, "minecraft:fireworks_rocket", name -> DSL.optionalFields("FireworksItem", References.ITEM_STACK.in(schema)));
|
| 70 | schema.register(map, "minecraft:furnace_minecart", name -> DSL.optionalFields("DisplayState", References.BLOCK_STATE.in(schema)));
|
| 71 | registerMob(schema, map, "minecraft:ghast");
|
| 72 | registerMob(schema, map, "minecraft:giant");
|
| 73 | registerMob(schema, map, "minecraft:guardian");
|
| 74 | schema.register(
|
| 75 | map,
|
| 76 | "minecraft:hopper_minecart",
|
| 77 | name -> DSL.optionalFields("DisplayState", References.BLOCK_STATE.in(schema), "Items", DSL.list(References.ITEM_STACK.in(schema)))
|
| 78 | );
|
| 79 | schema.register(
|
| 80 | map, "minecraft:horse", name -> DSL.optionalFields("ArmorItem", References.ITEM_STACK.in(schema), "SaddleItem", References.ITEM_STACK.in(schema))
|
| 81 | );
|
| 82 | registerMob(schema, map, "minecraft:husk");
|
| 83 | registerMob(schema, map, "minecraft:illusion_illager");
|
| 84 | schema.register(map, "minecraft:item", name -> DSL.optionalFields("Item", References.ITEM_STACK.in(schema)));
|
| 85 | schema.register(map, "minecraft:item_frame", name -> DSL.optionalFields("Item", References.ITEM_STACK.in(schema)));
|
| 86 | schema.registerSimple(map, "minecraft:leash_knot");
|
| 87 | schema.register(
|
| 88 | map,
|
| 89 | "minecraft:llama",
|
| 90 | name -> DSL.optionalFields(
|
| 91 | "Items", DSL.list(References.ITEM_STACK.in(schema)), "SaddleItem", References.ITEM_STACK.in(schema), "DecorItem", References.ITEM_STACK.in(schema)
|
| 92 | )
|
| 93 | );
|
| 94 | schema.registerSimple(map, "minecraft:llama_spit");
|
| 95 | registerMob(schema, map, "minecraft:magma_cube");
|
| 96 | schema.register(map, "minecraft:minecart", name -> DSL.optionalFields("DisplayState", References.BLOCK_STATE.in(schema)));
|
| 97 | registerMob(schema, map, "minecraft:mooshroom");
|
| 98 | schema.register(
|
| 99 | map, "minecraft:mule", name -> DSL.optionalFields("Items", DSL.list(References.ITEM_STACK.in(schema)), "SaddleItem", References.ITEM_STACK.in(schema))
|
| 100 | );
|
| 101 | registerMob(schema, map, "minecraft:ocelot");
|
| 102 | schema.registerSimple(map, "minecraft:painting");
|
| 103 | registerMob(schema, map, "minecraft:parrot");
|
| 104 | registerMob(schema, map, "minecraft:pig");
|
| 105 | registerMob(schema, map, "minecraft:polar_bear");
|
| 106 | schema.register(map, "minecraft:potion", name -> DSL.optionalFields("Potion", References.ITEM_STACK.in(schema)));
|
| 107 | registerMob(schema, map, "minecraft:rabbit");
|
| 108 | registerMob(schema, map, "minecraft:sheep");
|
| 109 | registerMob(schema, map, "minecraft:shulker");
|
| 110 | schema.registerSimple(map, "minecraft:shulker_bullet");
|
| 111 | registerMob(schema, map, "minecraft:silverfish");
|
| 112 | registerMob(schema, map, "minecraft:skeleton");
|
| 113 | schema.register(map, "minecraft:skeleton_horse", name -> DSL.optionalFields("SaddleItem", References.ITEM_STACK.in(schema)));
|
| 114 | registerMob(schema, map, "minecraft:slime");
|
| 115 | schema.registerSimple(map, "minecraft:small_fireball");
|
| 116 | schema.registerSimple(map, "minecraft:snowball");
|
| 117 | registerMob(schema, map, "minecraft:snowman");
|
| 118 | schema.register(
|
| 119 | map, "minecraft:spawner_minecart", name -> DSL.optionalFields("DisplayState", References.BLOCK_STATE.in(schema), References.UNTAGGED_SPAWNER.in(schema))
|
| 120 | );
|
| 121 | schema.register(map, "minecraft:spectral_arrow", name -> DSL.optionalFields("inBlockState", References.BLOCK_STATE.in(schema)));
|
| 122 | registerMob(schema, map, "minecraft:spider");
|
| 123 | registerMob(schema, map, "minecraft:squid");
|
| 124 | registerMob(schema, map, "minecraft:stray");
|
| 125 | schema.registerSimple(map, "minecraft:tnt");
|
| 126 | schema.register(map, "minecraft:tnt_minecart", name -> DSL.optionalFields("DisplayState", References.BLOCK_STATE.in(schema)));
|
| 127 | registerMob(schema, map, "minecraft:vex");
|
| 128 | schema.register(
|
| 129 | map,
|
| 130 | "minecraft:villager",
|
| 131 | name -> DSL.optionalFields(
|
| 132 | "Inventory", DSL.list(References.ITEM_STACK.in(schema)), "Offers", DSL.optionalFields("Recipes", DSL.list(References.VILLAGER_TRADE.in(schema)))
|
| 133 | )
|
| 134 | );
|
| 135 | registerMob(schema, map, "minecraft:villager_golem");
|
| 136 | registerMob(schema, map, "minecraft:vindication_illager");
|
| 137 | registerMob(schema, map, "minecraft:witch");
|
| 138 | registerMob(schema, map, "minecraft:wither");
|
| 139 | registerMob(schema, map, "minecraft:wither_skeleton");
|
| 140 | schema.registerSimple(map, "minecraft:wither_skull");
|
| 141 | registerMob(schema, map, "minecraft:wolf");
|
| 142 | schema.registerSimple(map, "minecraft:xp_bottle");
|
| 143 | schema.registerSimple(map, "minecraft:xp_orb");
|
| 144 | registerMob(schema, map, "minecraft:zombie");
|
| 145 | schema.register(map, "minecraft:zombie_horse", name -> DSL.optionalFields("SaddleItem", References.ITEM_STACK.in(schema)));
|
| 146 | registerMob(schema, map, "minecraft:zombie_pigman");
|
| 147 | schema.register(
|
| 148 | map, "minecraft:zombie_villager", name -> DSL.optionalFields("Offers", DSL.optionalFields("Recipes", DSL.list(References.VILLAGER_TRADE.in(schema))))
|
| 149 | );
|
| 150 | return map;
|
| 151 | }
|
| 152 |
|
| 153 | @Override
|
| 154 | public Map<String, Supplier<TypeTemplate>> registerBlockEntities(final Schema schema) {
|
| 155 | Map<String, Supplier<TypeTemplate>> map = Maps.newHashMap();
|
| 156 | registerInventory(schema, map, "minecraft:furnace");
|
| 157 | registerInventory(schema, map, "minecraft:chest");
|
| 158 | registerInventory(schema, map, "minecraft:trapped_chest");
|
| 159 | schema.registerSimple(map, "minecraft:ender_chest");
|
| 160 | schema.register(map, "minecraft:jukebox", name -> DSL.optionalFields("RecordItem", References.ITEM_STACK.in(schema)));
|
| 161 | registerInventory(schema, map, "minecraft:dispenser");
|
| 162 | registerInventory(schema, map, "minecraft:dropper");
|
| 163 | schema.register(map, "minecraft:sign", () -> V99.sign(schema));
|
| 164 | schema.register(map, "minecraft:mob_spawner", name -> References.UNTAGGED_SPAWNER.in(schema));
|
| 165 | schema.register(map, "minecraft:piston", name -> DSL.optionalFields("blockState", References.BLOCK_STATE.in(schema)));
|
| 166 | registerInventory(schema, map, "minecraft:brewing_stand");
|
| 167 | schema.register(map, "minecraft:enchanting_table", () -> V1458.nameable(schema));
|
| 168 | schema.registerSimple(map, "minecraft:end_portal");
|
| 169 | schema.register(map, "minecraft:beacon", () -> V1458.nameable(schema));
|
| 170 | schema.register(map, "minecraft:skull", () -> DSL.optionalFields("custom_name", References.TEXT_COMPONENT.in(schema)));
|
| 171 | schema.registerSimple(map, "minecraft:daylight_detector");
|
| 172 | registerInventory(schema, map, "minecraft:hopper");
|
| 173 | schema.registerSimple(map, "minecraft:comparator");
|
| 174 | schema.register(map, "minecraft:banner", () -> V1458.nameable(schema));
|
| 175 | schema.registerSimple(map, "minecraft:structure_block");
|
| 176 | schema.registerSimple(map, "minecraft:end_gateway");
|
| 177 | schema.register(map, "minecraft:command_block", () -> DSL.optionalFields("LastOutput", References.TEXT_COMPONENT.in(schema)));
|
| 178 | registerInventory(schema, map, "minecraft:shulker_box");
|
| 179 | schema.registerSimple(map, "minecraft:bed");
|
| 180 | return map;
|
| 181 | }
|
| 182 |
|
| 183 | @Override
|
| 184 | public void registerTypes(
|
| 185 | final Schema schema, final Map<String, Supplier<TypeTemplate>> entityTypes, final Map<String, Supplier<TypeTemplate>> blockEntityTypes
|
| 186 | ) {
|
| 187 | schema.registerType(
|
| 188 | false,
|
| 189 | References.LEVEL,
|
| 190 | () -> DSL.optionalFields(
|
| 191 | "CustomBossEvents", DSL.compoundList(DSL.optionalFields("Name", References.TEXT_COMPONENT.in(schema))), References.LIGHTWEIGHT_LEVEL.in(schema)
|
| 192 | )
|
| 193 | );
|
| 194 | schema.registerType(false, References.LIGHTWEIGHT_LEVEL, DSL::remainder);
|
| 195 | schema.registerType(false, References.RECIPE, () -> DSL.constType(namespacedString()));
|
| 196 | schema.registerType(
|
| 197 | false,
|
| 198 | References.PLAYER,
|
| 199 | () -> DSL.optionalFields(
|
| 200 | Pair.of("RootVehicle", DSL.optionalFields("Entity", References.ENTITY_TREE.in(schema))),
|
| 201 | Pair.of("ender_pearls", DSL.list(References.ENTITY_TREE.in(schema))),
|
| 202 | Pair.of("Inventory", DSL.list(References.ITEM_STACK.in(schema))),
|
| 203 | Pair.of("EnderItems", DSL.list(References.ITEM_STACK.in(schema))),
|
| 204 | Pair.of("ShoulderEntityLeft", References.ENTITY_TREE.in(schema)),
|
| 205 | Pair.of("ShoulderEntityRight", References.ENTITY_TREE.in(schema)),
|
| 206 | Pair.of("recipeBook", DSL.optionalFields("recipes", DSL.list(References.RECIPE.in(schema)), "toBeDisplayed", DSL.list(References.RECIPE.in(schema))))
|
| 207 | )
|
| 208 | );
|
| 209 | schema.registerType(
|
| 210 | false,
|
| 211 | References.CHUNK,
|
| 212 | () -> DSL.fields(
|
| 213 | "Level",
|
| 214 | DSL.optionalFields(
|
| 215 | "Entities",
|
| 216 | DSL.list(References.ENTITY_TREE.in(schema)),
|
| 217 | "TileEntities",
|
| 218 | DSL.list(DSL.or(References.BLOCK_ENTITY.in(schema), DSL.remainder())),
|
| 219 | "TileTicks",
|
| 220 | DSL.list(DSL.fields("i", References.BLOCK_NAME.in(schema))),
|
| 221 | "Sections",
|
| 222 | DSL.list(DSL.optionalFields("Palette", DSL.list(References.BLOCK_STATE.in(schema))))
|
| 223 | )
|
| 224 | )
|
| 225 | );
|
| 226 | schema.registerType(
|
| 227 | true,
|
| 228 | References.BLOCK_ENTITY,
|
| 229 | () -> DSL.optionalFields("components", References.DATA_COMPONENTS.in(schema), DSL.taggedChoiceLazy("id", namespacedString(), blockEntityTypes))
|
| 230 | );
|
| 231 | schema.registerType(
|
| 232 | true, References.ENTITY_TREE, () -> DSL.optionalFields("Passengers", DSL.list(References.ENTITY_TREE.in(schema)), References.ENTITY.in(schema))
|
| 233 | );
|
| 234 | schema.registerType(
|
| 235 | true,
|
| 236 | References.ENTITY,
|
| 237 | () -> DSL.and(
|
| 238 | References.ENTITY_EQUIPMENT.in(schema),
|
| 239 | DSL.optionalFields("CustomName", References.TEXT_COMPONENT.in(schema), DSL.taggedChoiceLazy("id", namespacedString(), entityTypes))
|
| 240 | )
|
| 241 | );
|
| 242 | schema.registerType(
|
| 243 | true,
|
| 244 | References.ITEM_STACK,
|
| 245 | () -> DSL.hook(DSL.optionalFields("id", References.ITEM_NAME.in(schema), "tag", V99.itemStackTag(schema)), V705.ADD_NAMES, HookFunction.IDENTITY)
|
| 246 | );
|
| 247 | schema.registerType(false, References.HOTBAR, () -> DSL.compoundList(DSL.list(References.ITEM_STACK.in(schema))));
|
| 248 | schema.registerType(false, References.OPTIONS, DSL::remainder);
|
| 249 | schema.registerType(
|
| 250 | false,
|
| 251 | References.STRUCTURE,
|
| 252 | () -> DSL.optionalFields(
|
| 253 | "entities",
|
| 254 | DSL.list(DSL.optionalFields("nbt", References.ENTITY_TREE.in(schema))),
|
| 255 | "blocks",
|
| 256 | DSL.list(DSL.optionalFields("nbt", References.BLOCK_ENTITY.in(schema))),
|
| 257 | "palette",
|
| 258 | DSL.list(References.BLOCK_STATE.in(schema)),
|
| 259 | "palettes",
|
| 260 | DSL.list(DSL.list(References.BLOCK_STATE.in(schema)))
|
| 261 | )
|
| 262 | );
|
| 263 | schema.registerType(false, References.BLOCK_NAME, () -> DSL.constType(namespacedString()));
|
| 264 | schema.registerType(false, References.ITEM_NAME, () -> DSL.constType(namespacedString()));
|
| 265 | schema.registerType(false, References.BLOCK_STATE, DSL::remainder);
|
| 266 | schema.registerType(false, References.FLAT_BLOCK_STATE, DSL::remainder);
|
| 267 | Supplier<TypeTemplate> itemStats = () -> DSL.compoundList(References.ITEM_NAME.in(schema), DSL.constType(DSL.intType()));
|
| 268 | schema.registerType(
|
| 269 | false,
|
| 270 | References.STATS,
|
| 271 | () -> DSL.optionalFields(
|
| 272 | "stats",
|
| 273 | DSL.optionalFields(
|
| 274 | Pair.of("minecraft:mined", DSL.compoundList(References.BLOCK_NAME.in(schema), DSL.constType(DSL.intType()))),
|
| 275 | Pair.of("minecraft:crafted", itemStats.get()),
|
| 276 | Pair.of("minecraft:used", itemStats.get()),
|
| 277 | Pair.of("minecraft:broken", itemStats.get()),
|
| 278 | Pair.of("minecraft:picked_up", itemStats.get()),
|
| 279 | Pair.of("minecraft:dropped", itemStats.get()),
|
| 280 | Pair.of("minecraft:killed", DSL.compoundList(References.ENTITY_NAME.in(schema), DSL.constType(DSL.intType()))),
|
| 281 | Pair.of("minecraft:killed_by", DSL.compoundList(References.ENTITY_NAME.in(schema), DSL.constType(DSL.intType()))),
|
| 282 | Pair.of("minecraft:custom", DSL.compoundList(DSL.constType(namespacedString()), DSL.constType(DSL.intType())))
|
| 283 | )
|
| 284 | )
|
| 285 | );
|
| 286 | schema.registerType(false, References.SAVED_DATA_COMMAND_STORAGE, DSL::remainder);
|
| 287 | schema.registerType(
|
| 288 | false,
|
| 289 | References.SAVED_DATA_CUSTOM_BOSS_EVENTS,
|
| 290 | () -> DSL.optionalFields("data", DSL.compoundList(DSL.optionalFields("Name", References.TEXT_COMPONENT.in(schema))))
|
| 291 | );
|
| 292 | schema.registerType(false, References.SAVED_DATA_ENDER_DRAGON_FIGHT, DSL::remainder);
|
| 293 | schema.registerType(false, References.SAVED_DATA_GAME_RULES, DSL::remainder);
|
| 294 | schema.registerType(false, References.SAVED_DATA_TICKETS, DSL::remainder);
|
| 295 | schema.registerType(
|
| 296 | false,
|
| 297 | References.SAVED_DATA_MAP_DATA,
|
| 298 | () -> DSL.optionalFields("data", DSL.optionalFields("banners", DSL.list(DSL.optionalFields("Name", References.TEXT_COMPONENT.in(schema)))))
|
| 299 | );
|
| 300 | schema.registerType(false, References.SAVED_DATA_MAP_INDEX, DSL::remainder);
|
| 301 | schema.registerType(false, References.SAVED_DATA_RAIDS, DSL::remainder);
|
| 302 | schema.registerType(false, References.SAVED_DATA_RANDOM_SEQUENCES, DSL::remainder);
|
| 303 | schema.registerType(false, References.SAVED_DATA_SCHEDULED_EVENTS, DSL::remainder);
|
| 304 | schema.registerType(
|
| 305 | false,
|
| 306 | References.SAVED_DATA_SCOREBOARD,
|
| 307 | () -> DSL.optionalFields(
|
| 308 | "data",
|
| 309 | DSL.optionalFields(
|
| 310 | "Objectives",
|
| 311 | DSL.list(References.OBJECTIVE.in(schema)),
|
| 312 | "Teams",
|
| 313 | DSL.list(References.TEAM.in(schema)),
|
| 314 | "PlayerScores",
|
| 315 | DSL.list(DSL.optionalFields("display", References.TEXT_COMPONENT.in(schema)))
|
| 316 | )
|
| 317 | )
|
| 318 | );
|
| 319 | schema.registerType(false, References.SAVED_DATA_STOPWATCHES, DSL::remainder);
|
| 320 | schema.registerType(
|
| 321 | false,
|
| 322 | References.SAVED_DATA_STRUCTURE_FEATURE_INDICES,
|
| 323 | () -> DSL.optionalFields("data", DSL.optionalFields("Features", DSL.compoundList(References.STRUCTURE_FEATURE.in(schema))))
|
| 324 | );
|
| 325 | schema.registerType(false, References.SAVED_DATA_WANDERING_TRADER, DSL::remainder);
|
| 326 | schema.registerType(false, References.SAVED_DATA_WEATHER, DSL::remainder);
|
| 327 | schema.registerType(false, References.SAVED_DATA_WORLD_BORDER, DSL::remainder);
|
| 328 | schema.registerType(false, References.SAVED_DATA_WORLD_CLOCKS, DSL::remainder);
|
| 329 | schema.registerType(false, References.SAVED_DATA_WORLD_GEN_SETTINGS, () -> DSL.fields("data", References.WORLD_GEN_SETTINGS.in(schema)));
|
| 330 | schema.registerType(false, References.DEBUG_PROFILE, DSL::remainder);
|
| 331 | schema.registerType(false, References.STRUCTURE_FEATURE, DSL::remainder);
|
| 332 | Map<String, Supplier<TypeTemplate>> criterionTypes = V1451_6.createCriterionTypes(schema);
|
| 333 | schema.registerType(
|
| 334 | false,
|
| 335 | References.OBJECTIVE,
|
| 336 | () -> DSL.hook(
|
| 337 | DSL.optionalFields("CriteriaType", DSL.taggedChoiceLazy("type", DSL.string(), criterionTypes), "DisplayName", References.TEXT_COMPONENT.in(schema)),
|
| 338 | V1451_6.UNPACK_OBJECTIVE_ID,
|
| 339 | V1451_6.REPACK_OBJECTIVE_ID
|
| 340 | )
|
| 341 | );
|
| 342 | schema.registerType(
|
| 343 | false,
|
| 344 | References.TEAM,
|
| 345 | () -> DSL.optionalFields(
|
| 346 | "MemberNamePrefix",
|
| 347 | References.TEXT_COMPONENT.in(schema),
|
| 348 | "MemberNameSuffix",
|
| 349 | References.TEXT_COMPONENT.in(schema),
|
| 350 | "DisplayName",
|
| 351 | References.TEXT_COMPONENT.in(schema)
|
| 352 | )
|
| 353 | );
|
| 354 | schema.registerType(
|
| 355 | true,
|
| 356 | References.UNTAGGED_SPAWNER,
|
| 357 | () -> DSL.optionalFields(
|
| 358 | "SpawnPotentials", DSL.list(DSL.fields("Entity", References.ENTITY_TREE.in(schema))), "SpawnData", References.ENTITY_TREE.in(schema)
|
| 359 | )
|
| 360 | );
|
| 361 | schema.registerType(
|
| 362 | false,
|
| 363 | References.ADVANCEMENTS,
|
| 364 | () -> DSL.optionalFields(
|
| 365 | "minecraft:adventure/adventuring_time",
|
| 366 | DSL.optionalFields("criteria", DSL.compoundList(References.BIOME.in(schema), DSL.constType(DSL.string()))),
|
| 367 | "minecraft:adventure/kill_a_mob",
|
| 368 | DSL.optionalFields("criteria", DSL.compoundList(References.ENTITY_NAME.in(schema), DSL.constType(DSL.string()))),
|
| 369 | "minecraft:adventure/kill_all_mobs",
|
| 370 | DSL.optionalFields("criteria", DSL.compoundList(References.ENTITY_NAME.in(schema), DSL.constType(DSL.string()))),
|
| 371 | "minecraft:husbandry/bred_all_animals",
|
| 372 | DSL.optionalFields("criteria", DSL.compoundList(References.ENTITY_NAME.in(schema), DSL.constType(DSL.string())))
|
| 373 | )
|
| 374 | );
|
| 375 | schema.registerType(false, References.BIOME, () -> DSL.constType(namespacedString()));
|
| 376 | schema.registerType(false, References.ENTITY_NAME, () -> DSL.constType(namespacedString()));
|
| 377 | schema.registerType(false, References.POI_CHUNK, DSL::remainder);
|
| 378 | schema.registerType(false, References.WORLD_GEN_SETTINGS, DSL::remainder);
|
| 379 | schema.registerType(false, References.ENTITY_CHUNK, () -> DSL.optionalFields("Entities", DSL.list(References.ENTITY_TREE.in(schema))));
|
| 380 | schema.registerType(true, References.DATA_COMPONENTS, DSL::remainder);
|
| 381 | schema.registerType(
|
| 382 | true,
|
| 383 | References.VILLAGER_TRADE,
|
| 384 | () -> DSL.optionalFields("buy", References.ITEM_STACK.in(schema), "buyB", References.ITEM_STACK.in(schema), "sell", References.ITEM_STACK.in(schema))
|
| 385 | );
|
| 386 | schema.registerType(true, References.PARTICLE, () -> DSL.constType(DSL.string()));
|
| 387 | schema.registerType(true, References.TEXT_COMPONENT, () -> DSL.constType(DSL.string()));
|
| 388 | schema.registerType(
|
| 389 | true,
|
| 390 | References.ENTITY_EQUIPMENT,
|
| 391 | () -> DSL.and(
|
| 392 | DSL.optional(DSL.field("ArmorItems", DSL.list(References.ITEM_STACK.in(schema)))),
|
| 393 | DSL.optional(DSL.field("HandItems", DSL.list(References.ITEM_STACK.in(schema)))),
|
| 394 | DSL.optional(DSL.field("body_armor_item", References.ITEM_STACK.in(schema))),
|
| 395 | DSL.optional(DSL.field("saddle", References.ITEM_STACK.in(schema)))
|
| 396 | )
|
| 397 | );
|
| 398 | }
|
| 399 | }
|
| 400 |
|