diff --git a/build.gradle.kts b/build.gradle.kts index 477881a0..1307f827 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,9 +3,9 @@ import net.fabricmc.loom.api.LoomGradleExtensionAPI plugins { java - id("architectury-plugin") version "3.4.+" - id("dev.architectury.loom") version "1.7.+" apply false - id("com.modrinth.minotaur") version "2.+" apply false + id("architectury-plugin") version "3.4.159" + id("dev.architectury.loom") version "1.7.416" apply false + id("com.modrinth.minotaur") version "2.8.7" apply false } operator fun Project.get(key: String) = properties[key] as String diff --git a/common/src/main/generated/.cache/0863d6b6d415911b15e9b245a98fa603d174e7c6 b/common/src/main/generated/.cache/0863d6b6d415911b15e9b245a98fa603d174e7c6 index a0a92643..ded64dd4 100644 --- a/common/src/main/generated/.cache/0863d6b6d415911b15e9b245a98fa603d174e7c6 +++ b/common/src/main/generated/.cache/0863d6b6d415911b15e9b245a98fa603d174e7c6 @@ -1,9 +1,9 @@ -// 1.21.3 Bingo/Tags for minecraft:item +// 1.21.4 Bingo/Tags for minecraft:item b6112420422099eed7aaae79f801a0250bf8764a data/bingo/tags/item/all_mineral_blocks.json 849681cfac44a9f01a440afc75340e33bcdd9c4f data/bingo/tags/item/allowed_heads.json b8fb8aac34ee76a18519bf8341cc6965f6fc775f data/bingo/tags/item/banner_patterns.json 50d93d5dff6f31f99f861c2df7c4e2dc1ec86e4b data/bingo/tags/item/basic_mineral_blocks.json -72ee76c8c074ccc46fb422ca6f71e0db6eac67b1 data/bingo/tags/item/bonemealable.json +cd2afed4cf4cca46f9e57cd552ce33cf5e2f75d2 data/bingo/tags/item/bonemealable.json fd55d4f9e6c3005580bc3aed7e6c8a10dfdf5a91 data/bingo/tags/item/climbable.json c882f1fc924c7ace24f2ece6ec48f727ede793e9 data/bingo/tags/item/concrete.json a8e3cdd07707862c9287a13bbcb1ad927c21bde8 data/bingo/tags/item/dead_coral_blocks.json @@ -11,11 +11,13 @@ a8e3cdd07707862c9287a13bbcb1ad927c21bde8 data/bingo/tags/item/dead_coral_blocks. edc1d7ae236968dab44675ce2726aa8177c35461 data/bingo/tags/item/fish_buckets.json cffae9219a2ffab50a7f48a5083429e6aaaa85f0 data/bingo/tags/item/fishing_junk.json e69e73d172c40891d65fb28f3dbbc50a77c89c3c data/bingo/tags/item/fishing_treasure.json -c05e998c718feb7c79e577ca9f09edc7225b3d22 data/bingo/tags/item/flowers.json +cefd6a45729a4b211703ecfb540481fc6931c7c6 data/bingo/tags/item/flowers.json 84ca487e773b4a6e5d2dfb9c9a4e6a7d99f6f480 data/bingo/tags/item/glazed_terracotta.json fadcbb38e7665bed6ea2c1b8876f4954189179c5 data/bingo/tags/item/gold_in_name.json 1d06a2ee122e3edcd98600fe98e131c26392d4bf data/bingo/tags/item/living_coral_blocks.json 76ff0180f4ac33ecd2e129331abfc90bb84adad2 data/bingo/tags/item/meat.json 86894fcb39eb59a6350754e0397f720fe8f95ba6 data/bingo/tags/item/not_meat.json -48828d4be77f045e1a0ff9bb1a7ae16d73d0c2fe data/bingo/tags/item/slabs.json -089d3c92d1c3cec83e79681b2d921d41af15170c data/bingo/tags/item/stairs.json +8507c2b2fef6ee4a8d7612f9a88bdbcc5ee49ba2 data/bingo/tags/item/slabs.json +fa0e5bbc7baa2a87b08d4ff060afbe8add649491 data/bingo/tags/item/stairs.json +292d60df471fb3e6039b68cd562d7197fd5b980a data/bingo/tags/item/tall_flowers.json +3d04b6a728cd0032981b253212c9037e5d66cc22 data/bingo/tags/item/trim_templates.json diff --git a/common/src/main/generated/.cache/297dc8c0802911a4b1235dc7fd00d8b887ddc7b2 b/common/src/main/generated/.cache/297dc8c0802911a4b1235dc7fd00d8b887ddc7b2 index f0283f0d..b49aca6d 100644 --- a/common/src/main/generated/.cache/297dc8c0802911a4b1235dc7fd00d8b887ddc7b2 +++ b/common/src/main/generated/.cache/297dc8c0802911a4b1235dc7fd00d8b887ddc7b2 @@ -1,4 +1,4 @@ -// 1.21.3 Bingo/Tags for minecraft:block +// 1.21.4 Bingo/Tags for minecraft:block b6112420422099eed7aaae79f801a0250bf8764a data/bingo/tags/block/all_mineral_blocks.json 50d93d5dff6f31f99f861c2df7c4e2dc1ec86e4b data/bingo/tags/block/basic_mineral_blocks.json 085238f24aca214ce9eb3f57ab02370467990f33 data/bingo/tags/block/copper_blocks.json diff --git a/common/src/main/generated/.cache/5e382c1dcfdccab7d9d316094aa5b015abb24861 b/common/src/main/generated/.cache/5e382c1dcfdccab7d9d316094aa5b015abb24861 index 56d80f87..b6a3769a 100644 --- a/common/src/main/generated/.cache/5e382c1dcfdccab7d9d316094aa5b015abb24861 +++ b/common/src/main/generated/.cache/5e382c1dcfdccab7d9d316094aa5b015abb24861 @@ -1,5 +1,5 @@ -// 1.21.3 Bingo/Tags for minecraft:worldgen/configured_feature +// 1.21.4 Bingo/Tags for minecraft:worldgen/configured_feature 013d9ea62ec0ddf2721a333297ac7574249a7563 data/bingo/tags/worldgen/configured_feature/huge_fungi.json afade1a0005224f958f1e4506ac161e087293ffb data/bingo/tags/worldgen/configured_feature/huge_mushrooms.json 39430c9384ca4890a27c206f2fd4ae6bf99c8730 data/bingo/tags/worldgen/configured_feature/mega_jungle_trees.json -85165a3d13da0173035b65d069a4f37b4fe49902 data/bingo/tags/worldgen/configured_feature/trees.json +cc47aa4eafc74b65c6f6ad1a19a803477bfd88e2 data/bingo/tags/worldgen/configured_feature/trees.json diff --git a/common/src/main/generated/.cache/81117bebc11de4e4a17e141516825a2dcdf80cb4 b/common/src/main/generated/.cache/81117bebc11de4e4a17e141516825a2dcdf80cb4 index 5b3a1db8..27b49c27 100644 --- a/common/src/main/generated/.cache/81117bebc11de4e4a17e141516825a2dcdf80cb4 +++ b/common/src/main/generated/.cache/81117bebc11de4e4a17e141516825a2dcdf80cb4 @@ -1,3 +1,3 @@ -// 1.21.3 Bingo/Tags for minecraft:damage_type +// 1.21.4 Bingo/Tags for minecraft:damage_type 0b98089d9e5e0278007f19881ffff2e4bdd990b0 data/bingo/tags/damage_type/berry_bush.json d1ee7bd9dc6ab495ba73da1f280cf19c3e54586f data/bingo/tags/damage_type/void.json diff --git a/common/src/main/generated/.cache/abd11bd80d925d09bec653682365b33e1c628412 b/common/src/main/generated/.cache/abd11bd80d925d09bec653682365b33e1c628412 index a8550374..260eb977 100644 --- a/common/src/main/generated/.cache/abd11bd80d925d09bec653682365b33e1c628412 +++ b/common/src/main/generated/.cache/abd11bd80d925d09bec653682365b33e1c628412 @@ -1,4 +1,4 @@ -// 1.21.3 Bingo/Tags for minecraft:entity_type -d75e6edfc24a5cd791f808f13d958ee9146ad879 data/bingo/tags/entity_type/hostile.json +// 1.21.4 Bingo/Tags for minecraft:entity_type +a7266d62674990146a1e353a2242927ac8595909 data/bingo/tags/entity_type/hostile.json c32b895c9caf0e47d56aa324a6fe36ebb50f8754 data/bingo/tags/entity_type/passive.json 98330efe44bb1f14c86f1b764de6b749e31e03b1 data/bingo/tags/entity_type/tamable.json diff --git a/common/src/main/generated/.cache/fc6fe7acca2b7156c3a9a1a4a9b4946c68c37823 b/common/src/main/generated/.cache/fc6fe7acca2b7156c3a9a1a4a9b4946c68c37823 index 9e5491a1..762bf7b2 100644 --- a/common/src/main/generated/.cache/fc6fe7acca2b7156c3a9a1a4a9b4946c68c37823 +++ b/common/src/main/generated/.cache/fc6fe7acca2b7156c3a9a1a4a9b4946c68c37823 @@ -1,4 +1,4 @@ -// 1.21.3 Bingo/Bingo goals +// 1.21.4 Bingo/Bingo goals 60933cb93b51bc5046fb820f19ed358af2699f4d data/bingo/bingo/goal/easy/3x3x3_glass_cube.json 49041086f9176f531ee3096073f5f1230a4e0f6a data/bingo/bingo/goal/easy/4x4_paintings.json 86d1d398343deced49a4d91d7b0ca17274600842 data/bingo/bingo/goal/easy/acacia_log.json @@ -48,7 +48,7 @@ db609a040f6342c59be40ac8c35bd07bbc0174e9 data/bingo/bingo/goal/easy/cut_sandston 1602ac535923af29d61511abb1adf6fbd5b22273 data/bingo/bingo/goal/easy/dead_bush.json 22e548d31778ef763882be34fe7565dee7d74cfe data/bingo/bingo/goal/easy/different_colored_shields.json ec9ac0d68d3369392df21107a0af540942cf5ee6 data/bingo/bingo/goal/easy/different_fish.json -a44eca8d6c16189f9303314e2841bcf0bb8c0e70 data/bingo/bingo/goal/easy/different_flowers.json +8a6d82d3712de6cd0a2ed947dc50ea7f64448683 data/bingo/bingo/goal/easy/different_flowers.json 582a9ff49dc48c6c63ef1fc548bac0d957046645 data/bingo/bingo/goal/easy/different_slabs.json c334650a5ee8f28a3d95ffe6cd001af55caa52ae data/bingo/bingo/goal/easy/different_stairs.json 76e43a841dd1d1630f5517211355952f0ea94bcd data/bingo/bingo/goal/easy/disenchant.json @@ -65,7 +65,7 @@ f44d7c72b92caf7bc6def6d7a2bcf27ce78f89c5 data/bingo/bingo/goal/easy/feather.json 18a0ea4bdbc00230ac5260d53b18c9350b3c1c19 data/bingo/bingo/goal/easy/fermented_spider_eye.json d99653aa4be89ffeeeed6fb67b8aea5d850fd05f data/bingo/bingo/goal/easy/fill_bundle.json d8841bf3176d1994f76649da1849c277786bcbf1 data/bingo/bingo/goal/easy/fill_water_cauldron.json -44244e744f4b412f27766b92b468c0c9be16c766 data/bingo/bingo/goal/easy/finish_at_spawn.json +3a6453dda3d6539b84b8ee8a10f8f29566f3ca79 data/bingo/bingo/goal/easy/finish_at_spawn.json 66d844b0c71416883190edafdd93bab00daa48d9 data/bingo/bingo/goal/easy/fish_treasure_junk.json 841544c182f8ef11e603396c1d870827a55b882c data/bingo/bingo/goal/easy/flint.json 7555c1b6896e1c9220be0cb7b9d73e1bf813b6da data/bingo/bingo/goal/easy/full_iron_armor.json @@ -171,7 +171,7 @@ f70709cd3c94a8007b545409e05b4057bf284aa7 data/bingo/bingo/goal/easy/yellow_dye.j 9fc37f21d82a5a865b47f66843d45d6ae958135b data/bingo/bingo/goal/hard/6x6scaffolding.json 6798b4185a52a0db40e254189a9d9a626306c697 data/bingo/bingo/goal/hard/all_pickaxes.json dfd27dd94b993865c74b77330a527e1ddf3bce3b data/bingo/bingo/goal/hard/all_swords.json -b00e5fce751f2054c303d0508ba8044d433ae1b4 data/bingo/bingo/goal/hard/armor_trims.json +4c5ca9e23b00690c49394022dd3df62847c454e7 data/bingo/bingo/goal/hard/armor_trims.json fa792625b604cb3048b411629de819d46e034cd3 data/bingo/bingo/goal/hard/bed_row.json 6903c02e192530e725673ee97817ddef22749802 data/bingo/bingo/goal/hard/bonemealable_blocks.json fab07567003cc2fc393d2bc331bddb9d715e55db data/bingo/bingo/goal/hard/breed_pandas.json @@ -272,7 +272,7 @@ e491c360a66e40c893fd86ad586f111f7a2ec766 data/bingo/bingo/goal/medium/crouch_dis 2cf9c1433902a4d21a288d6c0e248b7edc45843d data/bingo/bingo/goal/medium/daylight_detector.json 80654013eb12a4f600e0ee2bbc214997c9cede60 data/bingo/bingo/goal/medium/diamond_block.json a85c1efd208d634d4c0ad4722bae4e372d18e067 data/bingo/bingo/goal/medium/diamond_in_name.json -50cbe7be09bbb6499eba01039e95c361f2c14461 data/bingo/bingo/goal/medium/different_flowers.json +5ff022dffb0d0a7b2e88a3202d6f08bb34b927f0 data/bingo/bingo/goal/medium/different_flowers.json 97f5fbe190aa5363bef9aa30eb4cedcd4eaae21a data/bingo/bingo/goal/medium/different_saplings.json 524ae877758ea21323b4347a0f3c508a912ba00c data/bingo/bingo/goal/medium/dried_kelp_block.json 5eab18305e8491e81710a522e272c71bbb17c98e data/bingo/bingo/goal/medium/edible_items.json @@ -307,7 +307,7 @@ d2b0d6a8dd9714a472882be430c222fe5e9dfa96 data/bingo/bingo/goal/medium/iron_block 7ecc63a47d4bf00f5b213f0b80520132c66e89a3 data/bingo/bingo/goal/medium/item_frame.json 9f205d2007a3791aa17edf9007a23dfd8c54cf62 data/bingo/bingo/goal/medium/kill_golem.json 8ab402836b2aa0e439183086ce11a00fd7f6f37d data/bingo/bingo/goal/medium/kill_hostile_with_berries.json -242dca53b8ab66574739eda45b7e4b3a109f3f75 data/bingo/bingo/goal/medium/kill_mobs.json +eea754fc0a38c7f4254a324bd5fecf3c09dd0e7a data/bingo/bingo/goal/medium/kill_mobs.json b04f0d5f09b51bf2f355fb424b6868fd022549b9 data/bingo/bingo/goal/medium/kill_self_with_arrow.json 3b5fc34fac71fcd63d5c059ed20982f7443e724a data/bingo/bingo/goal/medium/kill_with_crystal.json 3d89fa541171469d187a87186d3181d868e31717 data/bingo/bingo/goal/medium/lapis_block.json @@ -457,7 +457,7 @@ b3e51f0f2da51866b5c0e5c9a5bcb3e5a0c2c0a4 data/bingo/bingo/goal/very_hard/all_dye 22839d439d819fb145097f7d1c6fb2886c38e199 data/bingo/bingo/goal/very_hard/all_goat_horns.json 1b5dcc05ad69d41307f26e44aec797f6ec8b6616 data/bingo/bingo/goal/very_hard/all_mineral_blocks.json 23c837332ca49cc2bce7da669f49b653e3905efa data/bingo/bingo/goal/very_hard/any_head.json -0dc93b63e5f54acc0eed302e556798653f1fec29 data/bingo/bingo/goal/very_hard/armor_trims.json +ea1d89d2fcd20a02a96e77ac76b3b9d6fc900c7b data/bingo/bingo/goal/very_hard/armor_trims.json 5d44aa401fd646bc31cbd1acd7a415d55c7fa8a1 data/bingo/bingo/goal/very_hard/beacon_regen.json 06c419b8517777c09d474aba8098c00c3ef7b218 data/bingo/bingo/goal/very_hard/bed_row.json 3e9359c857a0c0f3eafec86a6b59ea9d5dcdd777 data/bingo/bingo/goal/very_hard/blue_ice.json diff --git a/common/src/main/generated/.cache/fd92b0e9e07895138b66a79af3d38ddbb4f5c5ed b/common/src/main/generated/.cache/fd92b0e9e07895138b66a79af3d38ddbb4f5c5ed index dc66bfb8..1dac400c 100644 --- a/common/src/main/generated/.cache/fd92b0e9e07895138b66a79af3d38ddbb4f5c5ed +++ b/common/src/main/generated/.cache/fd92b0e9e07895138b66a79af3d38ddbb4f5c5ed @@ -1,4 +1,4 @@ -// 1.21.3 Bingo/Bingo registries +// 1.21.4 Bingo/Bingo registries a9f72075009412853f311f802e5a8cc82026e3b1 data/bingo/bingo/difficulty/easy.json c9569c8872f3f25555109253e266f5c683ed2377 data/bingo/bingo/difficulty/hard.json de8a0760a96282ce0120de5a0068c43bd439bbbe data/bingo/bingo/difficulty/medium.json diff --git a/common/src/main/generated/data/bingo/bingo/goal/easy/different_flowers.json b/common/src/main/generated/data/bingo/bingo/goal/easy/different_flowers.json index 621df938..12e703f5 100644 --- a/common/src/main/generated/data/bingo/bingo/goal/easy/different_flowers.json +++ b/common/src/main/generated/data/bingo/bingo/goal/easy/different_flowers.json @@ -17,7 +17,7 @@ "bingo_type": "bingo:sub", "key": "count" }, - "tag": "minecraft:flowers" + "tag": "bingo:flowers" }, "trigger": "bingo:has_some_items_from_tag" } @@ -29,7 +29,7 @@ "bingo_type": "bingo:sub", "key": "count" }, - "tag": "minecraft:flowers" + "tag": "bingo:flowers" }, "infrequency": 2, "name": { diff --git a/common/src/main/generated/data/bingo/bingo/goal/easy/finish_at_spawn.json b/common/src/main/generated/data/bingo/bingo/goal/easy/finish_at_spawn.json index 652ad2b9..172c0394 100644 --- a/common/src/main/generated/data/bingo/bingo/goal/easy/finish_at_spawn.json +++ b/common/src/main/generated/data/bingo/bingo/goal/easy/finish_at_spawn.json @@ -3,6 +3,12 @@ "nearby": { "conditions": { "player": [ + { + "condition": "minecraft:location_check", + "predicate": { + "dimension": "minecraft:overworld" + } + }, { "condition": "bingo:distance_from_spawn", "distance": { diff --git a/common/src/main/generated/data/bingo/bingo/goal/hard/armor_trims.json b/common/src/main/generated/data/bingo/bingo/goal/hard/armor_trims.json index 00bbcc65..c93858fc 100644 --- a/common/src/main/generated/data/bingo/bingo/goal/hard/armor_trims.json +++ b/common/src/main/generated/data/bingo/bingo/goal/hard/armor_trims.json @@ -4,7 +4,7 @@ "obtain": { "conditions": { "required_count": 3, - "tag": "minecraft:trim_templates" + "tag": "bingo:trim_templates" }, "trigger": "bingo:has_some_items_from_tag" } @@ -13,7 +13,7 @@ "icon": { "type": "bingo:item_tag_cycle", "count": 3, - "tag": "minecraft:trim_templates" + "tag": "bingo:trim_templates" }, "name": { "translate": "bingo.goal.armor_trims", diff --git a/common/src/main/generated/data/bingo/bingo/goal/medium/different_flowers.json b/common/src/main/generated/data/bingo/bingo/goal/medium/different_flowers.json index 12177a23..2ec743fe 100644 --- a/common/src/main/generated/data/bingo/bingo/goal/medium/different_flowers.json +++ b/common/src/main/generated/data/bingo/bingo/goal/medium/different_flowers.json @@ -17,7 +17,7 @@ "bingo_type": "bingo:sub", "key": "count" }, - "tag": "minecraft:flowers" + "tag": "bingo:flowers" }, "trigger": "bingo:has_some_items_from_tag" } @@ -29,7 +29,7 @@ "bingo_type": "bingo:sub", "key": "count" }, - "tag": "minecraft:flowers" + "tag": "bingo:flowers" }, "infrequency": 2, "name": { diff --git a/common/src/main/generated/data/bingo/bingo/goal/medium/kill_mobs.json b/common/src/main/generated/data/bingo/bingo/goal/medium/kill_mobs.json index 0e158f5a..8f07c47d 100644 --- a/common/src/main/generated/data/bingo/bingo/goal/medium/kill_mobs.json +++ b/common/src/main/generated/data/bingo/bingo/goal/medium/kill_mobs.json @@ -147,6 +147,14 @@ "id": "minecraft:cow_spawn_egg" } }, + { + "type": "bingo:entity", + "entity": "minecraft:creaking", + "item": { + "count": 1, + "id": "minecraft:creaking_spawn_egg" + } + }, { "type": "bingo:entity", "entity": "minecraft:creeper", diff --git a/common/src/main/generated/data/bingo/bingo/goal/very_hard/armor_trims.json b/common/src/main/generated/data/bingo/bingo/goal/very_hard/armor_trims.json index 4b7c70b3..59dac437 100644 --- a/common/src/main/generated/data/bingo/bingo/goal/very_hard/armor_trims.json +++ b/common/src/main/generated/data/bingo/bingo/goal/very_hard/armor_trims.json @@ -4,7 +4,7 @@ "obtain": { "conditions": { "required_count": 5, - "tag": "minecraft:trim_templates" + "tag": "bingo:trim_templates" }, "trigger": "bingo:has_some_items_from_tag" } @@ -13,7 +13,7 @@ "icon": { "type": "bingo:item_tag_cycle", "count": 5, - "tag": "minecraft:trim_templates" + "tag": "bingo:trim_templates" }, "name": { "translate": "bingo.goal.armor_trims", diff --git a/common/src/main/generated/data/bingo/tags/entity_type/hostile.json b/common/src/main/generated/data/bingo/tags/entity_type/hostile.json index 7f9c71dc..3f93d63b 100644 --- a/common/src/main/generated/data/bingo/tags/entity_type/hostile.json +++ b/common/src/main/generated/data/bingo/tags/entity_type/hostile.json @@ -5,7 +5,6 @@ "minecraft:breeze", "minecraft:cave_spider", "minecraft:creaking", - "minecraft:creaking_transient", "minecraft:creeper", "minecraft:drowned", "minecraft:elder_guardian", diff --git a/common/src/main/generated/data/bingo/tags/item/bonemealable.json b/common/src/main/generated/data/bingo/tags/item/bonemealable.json index 7136e0f6..7779c397 100644 --- a/common/src/main/generated/data/bingo/tags/item/bonemealable.json +++ b/common/src/main/generated/data/bingo/tags/item/bonemealable.json @@ -2,7 +2,7 @@ "values": [ "#minecraft:villager_plantable_seeds", "#minecraft:saplings", - "#minecraft:tall_flowers", + "#bingo:tall_flowers", "minecraft:bamboo", "minecraft:big_dripleaf", "minecraft:small_dripleaf", diff --git a/common/src/main/generated/data/bingo/tags/item/flowers.json b/common/src/main/generated/data/bingo/tags/item/flowers.json index 4aa35cef..843703f9 100644 --- a/common/src/main/generated/data/bingo/tags/item/flowers.json +++ b/common/src/main/generated/data/bingo/tags/item/flowers.json @@ -1,6 +1,6 @@ { "values": [ "#minecraft:small_flowers", - "#minecraft:tall_flowers" + "#bingo:tall_flowers" ] } \ No newline at end of file diff --git a/common/src/main/generated/data/bingo/tags/item/slabs.json b/common/src/main/generated/data/bingo/tags/item/slabs.json index 7f543ffa..ef85d171 100644 --- a/common/src/main/generated/data/bingo/tags/item/slabs.json +++ b/common/src/main/generated/data/bingo/tags/item/slabs.json @@ -41,6 +41,7 @@ "minecraft:prismarine_slab", "minecraft:prismarine_brick_slab", "minecraft:dark_prismarine_slab", + "minecraft:resin_brick_slab", "minecraft:polished_granite_slab", "minecraft:smooth_red_sandstone_slab", "minecraft:mossy_stone_brick_slab", diff --git a/common/src/main/generated/data/bingo/tags/item/stairs.json b/common/src/main/generated/data/bingo/tags/item/stairs.json index 8272a603..69301006 100644 --- a/common/src/main/generated/data/bingo/tags/item/stairs.json +++ b/common/src/main/generated/data/bingo/tags/item/stairs.json @@ -13,6 +13,7 @@ "minecraft:waxed_oxidized_cut_copper_stairs", "minecraft:purpur_stairs", "minecraft:cobblestone_stairs", + "minecraft:resin_brick_stairs", "minecraft:brick_stairs", "minecraft:stone_brick_stairs", "minecraft:mud_brick_stairs", diff --git a/common/src/main/generated/data/bingo/tags/item/tall_flowers.json b/common/src/main/generated/data/bingo/tags/item/tall_flowers.json new file mode 100644 index 00000000..02602649 --- /dev/null +++ b/common/src/main/generated/data/bingo/tags/item/tall_flowers.json @@ -0,0 +1,9 @@ +{ + "values": [ + "minecraft:lilac", + "minecraft:peony", + "minecraft:pitcher_plant", + "minecraft:rose_bush", + "minecraft:sunflower" + ] +} \ No newline at end of file diff --git a/common/src/main/generated/data/bingo/tags/item/trim_templates.json b/common/src/main/generated/data/bingo/tags/item/trim_templates.json new file mode 100644 index 00000000..230a9a38 --- /dev/null +++ b/common/src/main/generated/data/bingo/tags/item/trim_templates.json @@ -0,0 +1,22 @@ +{ + "values": [ + "minecraft:bolt_armor_trim_smithing_template", + "minecraft:coast_armor_trim_smithing_template", + "minecraft:dune_armor_trim_smithing_template", + "minecraft:eye_armor_trim_smithing_template", + "minecraft:flow_armor_trim_smithing_template", + "minecraft:host_armor_trim_smithing_template", + "minecraft:raiser_armor_trim_smithing_template", + "minecraft:rib_armor_trim_smithing_template", + "minecraft:sentry_armor_trim_smithing_template", + "minecraft:shaper_armor_trim_smithing_template", + "minecraft:silence_armor_trim_smithing_template", + "minecraft:snout_armor_trim_smithing_template", + "minecraft:spire_armor_trim_smithing_template", + "minecraft:tide_armor_trim_smithing_template", + "minecraft:vex_armor_trim_smithing_template", + "minecraft:ward_armor_trim_smithing_template", + "minecraft:wayfinder_armor_trim_smithing_template", + "minecraft:wild_armor_trim_smithing_template" + ] +} \ No newline at end of file diff --git a/common/src/main/generated/data/bingo/tags/worldgen/configured_feature/trees.json b/common/src/main/generated/data/bingo/tags/worldgen/configured_feature/trees.json index 7b3a5b90..0cea846f 100644 --- a/common/src/main/generated/data/bingo/tags/worldgen/configured_feature/trees.json +++ b/common/src/main/generated/data/bingo/tags/worldgen/configured_feature/trees.json @@ -3,6 +3,7 @@ "minecraft:oak", "minecraft:dark_oak", "minecraft:pale_oak", + "minecraft:pale_oak_bonemeal", "minecraft:pale_oak_creaking", "minecraft:birch", "minecraft:acacia", diff --git a/common/src/main/java/io/github/gaming32/bingo/BingoCommand.java b/common/src/main/java/io/github/gaming32/bingo/BingoCommand.java index a1d5e086..1b6b3047 100644 --- a/common/src/main/java/io/github/gaming32/bingo/BingoCommand.java +++ b/common/src/main/java/io/github/gaming32/bingo/BingoCommand.java @@ -16,6 +16,7 @@ import io.github.gaming32.bingo.data.BingoDifficulty; import io.github.gaming32.bingo.data.BingoRegistries; import io.github.gaming32.bingo.data.BingoTag; +import io.github.gaming32.bingo.data.goal.BingoGoal; import io.github.gaming32.bingo.data.goal.GoalHolder; import io.github.gaming32.bingo.data.goal.GoalManager; import io.github.gaming32.bingo.game.ActiveGoal; @@ -31,6 +32,7 @@ import net.minecraft.commands.SharedSuggestionProvider; import net.minecraft.commands.arguments.ColorArgument; import net.minecraft.commands.arguments.EntityArgument; +import net.minecraft.commands.arguments.ResourceKeyArgument; import net.minecraft.commands.arguments.ResourceLocationArgument; import net.minecraft.commands.arguments.TeamArgument; import net.minecraft.commands.arguments.TimeArgument; @@ -40,6 +42,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.network.chat.ComponentUtils; import net.minecraft.network.chat.HoverEvent; +import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.MinecraftServer; import net.minecraft.server.ServerScoreboard; @@ -63,7 +66,6 @@ import java.util.Arrays; import java.util.Collection; import java.util.Collections; -import java.util.HashSet; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; @@ -121,41 +123,40 @@ public class BingoCommand { private static final CommandSwitch CONTINUE_AFTER_WIN = CommandSwitch.storeTrue("--continue-after-win"); private static final CommandSwitch INCLUDE_INACTIVE_TEAMS = CommandSwitch.storeTrue("--include-inactive-teams"); - private static final CommandSwitch SIZE = - CommandSwitch.argument("--size", IntegerArgumentType.integer(BingoBoard.MIN_SIZE, BingoBoard.MAX_SIZE)) - .defaultValue(BingoBoard.DEFAULT_SIZE) - .build(); - private static final CommandSwitch SEED = - CommandSwitch.argument("--seed", LongArgumentType.longArg()) - .defaultValue(RandomSupport::generateUniqueSeed) - .build(); - private static final CommandSwitch AUTO_FORFEIT_TIME = - CommandSwitch.argument("--auto-forfeit-time", TimeArgument.time(0)) - .getter(IntegerArgumentType::getInteger) - .defaultValue(BingoGame.DEFAULT_AUTO_FORFEIT_TICKS) - .build(); - private static final CommandSwitch> DIFFICULTY = - CommandSwitch.resource("--difficulty", BingoRegistries.DIFFICULTY) - .defaultValue(BingoDifficulties.MEDIUM) - .unknownExceptionType(UNKNOWN_DIFFICULTY) - .build(); - private static final CommandSwitch> GAMEMODE = - CommandSwitch.resource("--gamemode", BingoRegistries.GAME_MODE) - .defaultValue(BingoGameMode.STANDARD.key()) - .unknownExceptionType(UNKNOWN_GAMEMODE) - .build(); - - private static final CommandSwitch> REQUIRE_GOAL = - CommandSwitch.argument("--require-goal", ResourceLocationArgument.id()) - .getter(ResourceLocationArgument::getId) - .suggests((context, builder) -> SharedSuggestionProvider.suggestResource( - GoalManager.getGoalIds(), builder - )) - .buildRepeatable(HashSet::new); - private static final CommandSwitch> EXCLUDE_TAG = - CommandSwitch.resource("--exclude-tag", BingoRegistries.TAG) - .unknownExceptionType(UNKNOWN_TAG) - .buildRepeatable(); + private static final CommandSwitch SIZE = CommandSwitch + .argument("--size", IntegerArgumentType.integer(BingoBoard.MIN_SIZE, BingoBoard.MAX_SIZE)) + .build(BingoBoard.DEFAULT_SIZE); + private static final CommandSwitch SEED = CommandSwitch + .argument("--seed", LongArgumentType.longArg()) + .build(RandomSupport::generateUniqueSeed); + private static final CommandSwitch AUTO_FORFEIT_TIME = CommandSwitch + .argument("--auto-forfeit-time", TimeArgument.time(0)) + .getter(IntegerArgumentType::getInteger) + .build(BingoGame.DEFAULT_AUTO_FORFEIT_TICKS); + private static final CommandSwitch> DIFFICULTY = CommandSwitch + .resource("--difficulty", BingoRegistries.DIFFICULTY) + .unknownExceptionType(UNKNOWN_DIFFICULTY) + .build(BingoDifficulties.MEDIUM); + private static final CommandSwitch> GAMEMODE = CommandSwitch + .resource("--gamemode", BingoRegistries.GAME_MODE) + .unknownExceptionType(UNKNOWN_GAMEMODE) + .build(BingoGameMode.STANDARD.key()); + + private static final CommandSwitch> REQUIRE_GOAL = CommandSwitch + ., GoalHolder>specialArgument("--require-goal", ResourceKeyArgument.key(BingoRegistries.GOAL)) + .getter((context, arg) -> { + final var key = ResourceKeyArgument.getRegistryKey(context, arg, BingoRegistries.GOAL, INVALID_GOAL); + final var goal = GoalManager.getGoal(key.location()); + if (goal == null) { + throw UNKNOWN_GOAL.create(key.location()); + } + return goal; + }) + .buildRepeatable(LinkedHashSet::new); + private static final CommandSwitch> EXCLUDE_TAG = CommandSwitch + .resource("--exclude-tag", BingoRegistries.TAG) + .unknownExceptionType(UNKNOWN_TAG) + .buildRepeatable(); public static void register( CommandDispatcher dispatcher, @@ -394,7 +395,7 @@ private static int startGame(CommandContext context, int tea final var difficulty = DIFFICULTY.get(context); final long seed = SEED.get(context); - final var requiredGoalIds = REQUIRE_GOAL.get(context); + final var requiredGoals = REQUIRE_GOAL.get(context); final var excludedTags = EXCLUDE_TAG.get(context); final int size = SIZE.get(context); final var gamemode = GAMEMODE.get(context).value(); @@ -420,16 +421,6 @@ private static int startGame(CommandContext context, int tea throw NO_TEAMS.create(); } - final List requiredGoals = requiredGoalIds.stream() - .map(id -> { - final GoalHolder goal = GoalManager.getGoal(id); - if (goal == null) { - throwInBlock(UNKNOWN_GOAL.create(id)); - } - return goal; - }) - .toList(); - final CommandSyntaxException configError = gamemode.checkAllowedConfig( new BingoGameMode.GameConfig(gamemode, size, teams) ); @@ -571,9 +562,4 @@ private static int randomizeTeams( ); return players.size(); } - - @SuppressWarnings("unchecked") - private static void throwInBlock(Throwable t) throws T { - throw (T)t; - } } diff --git a/common/src/main/java/io/github/gaming32/bingo/client/icons/BlockIconRenderer.java b/common/src/main/java/io/github/gaming32/bingo/client/icons/BlockIconRenderer.java index 4c388cf0..758b449d 100644 --- a/common/src/main/java/io/github/gaming32/bingo/client/icons/BlockIconRenderer.java +++ b/common/src/main/java/io/github/gaming32/bingo/client/icons/BlockIconRenderer.java @@ -45,7 +45,7 @@ public void render(BlockIcon icon, GuiGraphics graphics, int x, int y) { private static void renderInGui(BlockState state, PoseStack poseStack, MultiBufferSource buffer, BakedModel model) { poseStack.pushPose(); - ItemTransform transform = model.getTransforms().gui; + ItemTransform transform = model.getTransforms().gui(); if (transform == ItemTransform.NO_TRANSFORM) { transform = DEFAULT_TRANSFORM; } diff --git a/common/src/main/java/io/github/gaming32/bingo/commandswitch/CommandSwitch.java b/common/src/main/java/io/github/gaming32/bingo/commandswitch/CommandSwitch.java index a768b00c..d9c71aae 100644 --- a/common/src/main/java/io/github/gaming32/bingo/commandswitch/CommandSwitch.java +++ b/common/src/main/java/io/github/gaming32/bingo/commandswitch/CommandSwitch.java @@ -8,9 +8,10 @@ import com.mojang.brigadier.exceptions.DynamicCommandExceptionType; import com.mojang.brigadier.suggestion.SuggestionProvider; import com.mojang.brigadier.tree.CommandNode; +import io.github.gaming32.bingo.util.BingoUtil; import net.minecraft.commands.CommandSourceStack; import net.minecraft.commands.arguments.ResourceKeyArgument; -import net.minecraft.core.DefaultedRegistry; +import net.minecraft.commands.arguments.ResourceOrTagKeyArgument; import net.minecraft.core.Holder; import net.minecraft.core.HolderSet; import net.minecraft.core.Registry; @@ -71,15 +72,10 @@ static ResourceArgumentSwitchBuilder resource(String name, ResourceKey { - private static final Function, ?> ALWAYS_NULL = context -> null; - private final String name; private final ArgumentType type; private String argName; private ArgGetter getter; - @SuppressWarnings("unchecked") - private Function, T> defaultValue = - (Function, T>)ALWAYS_NULL; private SuggestionProvider suggests = null; private ArgumentSwitchBuilder(String name, ArgumentType type) { @@ -102,36 +98,31 @@ public ArgumentSwitchBuilder getter(ArgGetter getter) { return this; } - public ArgumentSwitchBuilder defaultValue(Function, T> function) { - this.defaultValue = function; + public ArgumentSwitchBuilder suggests(SuggestionProvider suggests) { + this.suggests = suggests; return this; } - public ArgumentSwitchBuilder defaultValue(Supplier supplier) { - return defaultValue(context -> supplier.get()); + public CommandSwitch build(Function, T> defaultValue) { + return buildInner(defaultValue); } - public ArgumentSwitchBuilder defaultValue(T value) { - return defaultValue(context -> value); - } - - public ArgumentSwitchBuilder suggests(SuggestionProvider suggests) { - this.suggests = suggests; - return this; + public CommandSwitch build(Supplier defaultSupplier) { + return buildInner(ctx -> defaultSupplier.get()); } - public CommandSwitch build() { - return buildInner(); + public CommandSwitch build(T defaultValue) { + return buildInner(ctx -> defaultValue); } public CommandSwitch buildRepeatable(Function, C> collectionFunction) { - if (defaultValue != ALWAYS_NULL) { - throw new IllegalArgumentException("Cannot specify default value with buildRepeatable()"); - } - return new RepeatableArgumentSwitch<>(buildInner(), collectionFunction); + return new RepeatableArgumentSwitch<>( + buildInner(context -> null), + (context, values) -> collectionFunction.apply(values) + ); } - private ArgumentSwitch buildInner() { + private ArgumentSwitch buildInner(Function, T> defaultValue) { return new ArgumentSwitch<>( name, argName, type, Objects.requireNonNull(getter, "Must specify a getter() for a argument()"), @@ -144,7 +135,6 @@ final class ResourceArgumentSwitchBuilder { private final String name; private final ResourceKey> registry; private String argName; - private ResourceKey defaultValue; private DynamicCommandExceptionType unknownExceptionType; private ResourceArgumentSwitchBuilder(String name, ResourceKey> registry) { @@ -158,53 +148,54 @@ public ResourceArgumentSwitchBuilder argName(String argName) { return this; } - public ResourceArgumentSwitchBuilder defaultValue(ResourceKey defaultValue) { - this.defaultValue = defaultValue; - return this; - } - public ResourceArgumentSwitchBuilder unknownExceptionType(DynamicCommandExceptionType type) { unknownExceptionType = type; return this; } - public CommandSwitch> build() { - return buildInner(); - } - - public CommandSwitch> buildRepeatable() { - if (defaultValue != null) { - throw new IllegalArgumentException("Cannot specify default value with buildRepeatable()"); - } - return new RepeatableArgumentSwitch<>( - buildInner(), - values -> HolderSet.direct(values.stream().distinct().toList()) - ); - } - - private ArgumentSwitch, Holder.Reference> buildInner() { + public CommandSwitch> build(ResourceKey defaultValue) { final var registryKey = this.registry; - final var defaultKey = this.defaultValue; + final var exceptionType = + Objects.requireNonNull(unknownExceptionType, "unknownExceptionType() must be called"); return new ArgumentSwitch<>( name, argName, ResourceKeyArgument.key(registryKey), - ArgGetter.forResource( - registryKey, - Objects.requireNonNull(unknownExceptionType, "unknownExceptionType() must be called") + (context, arg) -> ResourceKeyArgument.resolveKey(context, arg, registry, exceptionType), + context -> context + .getSource() + .registryAccess() + .lookupOrThrow(registryKey) + .getOrThrow(defaultValue), + null + ); + } + + public CommandSwitch> buildRepeatable() { + final var registryKey = this.registry; + final var exceptionType = + Objects.requireNonNull(unknownExceptionType, "unknownExceptionType() must be called"); + return new RepeatableArgumentSwitch<>( + new ArgumentSwitch<>( + name, argName, + ResourceOrTagKeyArgument.resourceOrTagKey(registryKey), + (context, arg) -> + ResourceOrTagKeyArgument.getResourceOrTagKey(context, arg, registryKey, exceptionType), + context -> null, null ), - context -> { + (context, values) -> { final var registry = context.getSource().registryAccess().lookupOrThrow(registryKey); - final ResourceKey key; - if (defaultKey != null) { - key = defaultKey; - } else if (registry instanceof DefaultedRegistry defaulted) { - key = ResourceKey.create(registryKey, defaulted.getDefaultKey()); - } else { - throw new IllegalArgumentException("defaultValue() must be specified for non-defaulted registry"); - } - return registry.getOrThrow(key); - }, - null + return switch (values.size()) { + case 0 -> HolderSet.empty(); + case 1 -> BingoUtil.toHolderSet(registry, values.iterator().next()); + default -> HolderSet.direct( + values.stream() + .map(result -> BingoUtil.toHolderSet(registry, result)) + .flatMap(HolderSet::stream) + .distinct() + .toList() + ); + }; + } ); } } diff --git a/common/src/main/java/io/github/gaming32/bingo/commandswitch/RepeatableArgumentSwitch.java b/common/src/main/java/io/github/gaming32/bingo/commandswitch/RepeatableArgumentSwitch.java index 5e14793a..ffab0537 100644 --- a/common/src/main/java/io/github/gaming32/bingo/commandswitch/RepeatableArgumentSwitch.java +++ b/common/src/main/java/io/github/gaming32/bingo/commandswitch/RepeatableArgumentSwitch.java @@ -5,11 +5,11 @@ import net.minecraft.commands.CommandSourceStack; import java.util.Collection; -import java.util.function.Function; +import java.util.function.BiFunction; record RepeatableArgumentSwitch( ArgumentSwitch inner, - Function, C> collectionFunction + BiFunction, Collection, C> collectionFunction ) implements CommandSwitch { @Override public String name() { @@ -23,6 +23,6 @@ public void addTo(CommandNode node) { @Override public C get(CommandContext context) { - return collectionFunction.apply(context.getSource().bingo$getRepeatableArgument(inner)); + return collectionFunction.apply(context, context.getSource().bingo$getRepeatableArgument(inner)); } } diff --git a/common/src/main/java/io/github/gaming32/bingo/conditions/DistanceFromSpawnCondition.java b/common/src/main/java/io/github/gaming32/bingo/conditions/DistanceFromSpawnCondition.java index 58a5c5cb..33bdd374 100644 --- a/common/src/main/java/io/github/gaming32/bingo/conditions/DistanceFromSpawnCondition.java +++ b/common/src/main/java/io/github/gaming32/bingo/conditions/DistanceFromSpawnCondition.java @@ -2,9 +2,7 @@ import com.mojang.serialization.MapCodec; import net.minecraft.advancements.critereon.DistancePredicate; -import net.minecraft.core.GlobalPos; import net.minecraft.util.context.ContextKey; -import net.minecraft.world.item.CompassItem; import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.level.storage.loot.predicates.LootItemCondition; @@ -29,11 +27,7 @@ public LootItemConditionType getType() { @Override public boolean test(LootContext lootContext) { final Vec3 origin = lootContext.getParameter(LootContextParams.ORIGIN); - final GlobalPos spawnPoint = CompassItem.getSpawnPosition(lootContext.getLevel()); - if (spawnPoint == null || spawnPoint.dimension() != lootContext.getLevel().dimension()) { // Maybe some mod does something interesting? - return false; - } - final Vec3 spawnVec = Vec3.atCenterOf(spawnPoint.pos()); + final Vec3 spawnVec = Vec3.atCenterOf(lootContext.getLevel().getSharedSpawnPos()); return distance.isEmpty() || distance.get().matches( origin.x, origin.y, origin.z, spawnVec.x, spawnVec.y, spawnVec.z diff --git a/common/src/main/java/io/github/gaming32/bingo/conditions/WearingDifferentArmorCondition.java b/common/src/main/java/io/github/gaming32/bingo/conditions/WearingDifferentArmorCondition.java index 55834251..a09cf1fa 100644 --- a/common/src/main/java/io/github/gaming32/bingo/conditions/WearingDifferentArmorCondition.java +++ b/common/src/main/java/io/github/gaming32/bingo/conditions/WearingDifferentArmorCondition.java @@ -5,10 +5,11 @@ import io.github.gaming32.bingo.data.tags.convention.ConventionItemTags; import net.minecraft.advancements.critereon.MinMaxBounds; import net.minecraft.core.component.DataComponents; -import net.minecraft.resources.ResourceLocation; +import net.minecraft.resources.ResourceKey; import net.minecraft.util.context.ContextKey; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.item.equipment.EquipmentAsset; import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.level.storage.loot.predicates.LootItemCondition; @@ -46,12 +47,12 @@ public boolean test(LootContext lootContext) { return false; } int wearingCount = 0; - final var models = HashSet.newHashSet(4); + final var models = HashSet.>newHashSet(4); for (final var stack : livingEntity.getArmorSlots()) { if (!stack.is(ConventionItemTags.ARMORS)) continue; final var equippable = stack.get(DataComponents.EQUIPPABLE); if (equippable == null) continue; - models.add(equippable.model().orElse(null)); + equippable.assetId().ifPresent(models::add); } return equippedArmor.matches(wearingCount) && differentTypes.matches(models.size()); } diff --git a/common/src/main/java/io/github/gaming32/bingo/data/BingoRegistries.java b/common/src/main/java/io/github/gaming32/bingo/data/BingoRegistries.java index f479bfd0..c2d4998d 100644 --- a/common/src/main/java/io/github/gaming32/bingo/data/BingoRegistries.java +++ b/common/src/main/java/io/github/gaming32/bingo/data/BingoRegistries.java @@ -1,5 +1,6 @@ package io.github.gaming32.bingo.data; +import io.github.gaming32.bingo.data.goal.BingoGoal; import io.github.gaming32.bingo.data.icons.GoalIconType; import io.github.gaming32.bingo.data.progresstrackers.ProgressTrackerType; import io.github.gaming32.bingo.data.subs.BingoSubType; @@ -11,6 +12,7 @@ public class BingoRegistries { public static final ResourceKey> DIFFICULTY = createKey("difficulty"); public static final ResourceKey> GAME_MODE = createKey("game_mode"); + public static final ResourceKey> GOAL = createKey("goal"); public static final ResourceKey>> GOAL_ICON_TYPE = createKey("goal_icon_type"); public static final ResourceKey>> PROGRESS_TRACKER_TYPE = createKey("progress_tracker_type"); public static final ResourceKey>> SUB_TYPE = createKey("sub_type"); diff --git a/common/src/main/java/io/github/gaming32/bingo/data/goal/GoalManager.java b/common/src/main/java/io/github/gaming32/bingo/data/goal/GoalManager.java index fcc3e4f4..a94a34f2 100644 --- a/common/src/main/java/io/github/gaming32/bingo/data/goal/GoalManager.java +++ b/common/src/main/java/io/github/gaming32/bingo/data/goal/GoalManager.java @@ -2,9 +2,11 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import com.mojang.serialization.JsonOps; import io.github.gaming32.bingo.Bingo; import io.github.gaming32.bingo.util.ResourceLocations; import net.minecraft.core.HolderLookup; +import net.minecraft.resources.FileToIdConverter; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.packs.resources.ResourceManager; import net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener; @@ -24,7 +26,9 @@ public class GoalManager extends SimpleJsonResourceReloadListener { private static Map> goalsByDifficulty = Map.of(); public GoalManager(HolderLookup.Provider registries) { - super(registries, BingoGoal.CODEC, "bingo/goal"); + // FIXME: Switch to (HolderLookup.Provider, Codec, ResourceKey) overload and remove the AW once + // https://github.com/FabricMC/fabric/pull/4180 is merged + super(registries.createSerializationContext(JsonOps.INSTANCE), BingoGoal.CODEC, FileToIdConverter.json("bingo/goal")); } public static Set getGoalIds() { diff --git a/common/src/main/java/io/github/gaming32/bingo/data/tags/bingo/BingoItemTags.java b/common/src/main/java/io/github/gaming32/bingo/data/tags/bingo/BingoItemTags.java index a1f97b05..22383a19 100644 --- a/common/src/main/java/io/github/gaming32/bingo/data/tags/bingo/BingoItemTags.java +++ b/common/src/main/java/io/github/gaming32/bingo/data/tags/bingo/BingoItemTags.java @@ -29,6 +29,8 @@ private BingoItemTags() { public static final TagKey NOT_MEAT = create("not_meat"); public static final TagKey SLABS = create("slabs"); public static final TagKey STAIRS = create("stairs"); + public static final TagKey TALL_FLOWERS = create("tall_flowers"); + public static final TagKey TRIM_TEMPLATES = create("trim_templates"); private static TagKey create(String name) { return TagKey.create(Registries.ITEM, ResourceLocations.bingo(name)); diff --git a/common/src/main/java/io/github/gaming32/bingo/game/BingoBoard.java b/common/src/main/java/io/github/gaming32/bingo/game/BingoBoard.java index 8fb7ed29..c7ff2d8c 100644 --- a/common/src/main/java/io/github/gaming32/bingo/game/BingoBoard.java +++ b/common/src/main/java/io/github/gaming32/bingo/game/BingoBoard.java @@ -26,6 +26,7 @@ import java.util.ArrayDeque; import java.util.Arrays; +import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -82,7 +83,7 @@ public static BingoBoard generate( int teamCount, RandomSource rand, Predicate isAllowedGoal, - List requiredGoals, + Collection requiredGoals, HolderSet excludedTags, boolean allowsClientRequired, HolderLookup.Provider registries @@ -121,7 +122,7 @@ public static GoalHolder[] generateGoals( int difficulty, RandomSource rand, Predicate isAllowedGoal, - List requiredGoals, + Collection requiredGoals, HolderSet excludedTags, boolean allowsClientRequired ) { diff --git a/common/src/main/java/io/github/gaming32/bingo/mixin/common/MixinCommandSourceStack.java b/common/src/main/java/io/github/gaming32/bingo/mixin/common/MixinCommandSourceStack.java index ac2a18ec..d04c1772 100644 --- a/common/src/main/java/io/github/gaming32/bingo/mixin/common/MixinCommandSourceStack.java +++ b/common/src/main/java/io/github/gaming32/bingo/mixin/common/MixinCommandSourceStack.java @@ -5,7 +5,12 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Multimap; import com.llamalad7.mixinextras.injector.ModifyExpressionValue; +import com.mojang.brigadier.context.CommandContext; +import com.mojang.brigadier.suggestion.Suggestions; +import com.mojang.brigadier.suggestion.SuggestionsBuilder; import io.github.gaming32.bingo.commandswitch.CommandSwitch; +import io.github.gaming32.bingo.data.BingoRegistries; +import io.github.gaming32.bingo.data.goal.GoalManager; import io.github.gaming32.bingo.ext.CommandSourceStackExt; import io.github.gaming32.bingo.util.BingoUtil; import net.minecraft.Util; @@ -13,8 +18,11 @@ import net.minecraft.commands.CommandSigningContext; import net.minecraft.commands.CommandSource; import net.minecraft.commands.CommandSourceStack; +import net.minecraft.commands.SharedSuggestionProvider; import net.minecraft.commands.arguments.EntityAnchorArgument; +import net.minecraft.core.Registry; import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceKey; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerLevel; import net.minecraft.util.TaskChainer; @@ -29,11 +37,14 @@ import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.gen.Invoker; import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import java.util.Collection; import java.util.Map; import java.util.Optional; import java.util.Set; +import java.util.concurrent.CompletableFuture; @Mixin(CommandSourceStack.class) public class MixinCommandSourceStack implements CommandSourceStackExt { @@ -161,4 +172,24 @@ private CommandSourceStack copyExtraFields(@NotNull CommandSourceStack newStack) ext.bingo$repeatableArguments = bingo$repeatableArguments; return newStack; } + + @Inject( + method = "suggestRegistryElements", + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/commands/CommandSourceStack;registryAccess()Lnet/minecraft/core/RegistryAccess;" + ), + cancellable = true + ) + private void suggestBingoGoals( + ResourceKey> resourceKey, + SharedSuggestionProvider.ElementSuggestionType registryKey, + SuggestionsBuilder builder, + CommandContext context, + CallbackInfoReturnable> cir + ) { + if (resourceKey == BingoRegistries.GOAL) { + cir.setReturnValue(SharedSuggestionProvider.suggestResource(GoalManager.getGoalIds(), builder)); + } + } } diff --git a/common/src/main/java/io/github/gaming32/bingo/mixin/common/MixinEntity.java b/common/src/main/java/io/github/gaming32/bingo/mixin/common/MixinEntity.java index 82f8e5c9..39c6326d 100644 --- a/common/src/main/java/io/github/gaming32/bingo/mixin/common/MixinEntity.java +++ b/common/src/main/java/io/github/gaming32/bingo/mixin/common/MixinEntity.java @@ -58,7 +58,7 @@ private void setDroppedBy(ServerLevel serverLevel, ItemStack itemStack, float f, shift = At.Shift.AFTER ) ) - private void customTrigger(Entity killed, int scoreValue, DamageSource source, CallbackInfo ci) { + private void customTrigger(Entity killed, DamageSource source, CallbackInfo ci) { BingoTriggers.ENTITY_KILLED_PLAYER.get().trigger((ServerPlayer)killed, (Entity)(Object)this, source); } } diff --git a/common/src/main/java/io/github/gaming32/bingo/mixin/common/MixinServerPlayer.java b/common/src/main/java/io/github/gaming32/bingo/mixin/common/MixinServerPlayer.java index ba3c630f..1dd09657 100644 --- a/common/src/main/java/io/github/gaming32/bingo/mixin/common/MixinServerPlayer.java +++ b/common/src/main/java/io/github/gaming32/bingo/mixin/common/MixinServerPlayer.java @@ -48,7 +48,7 @@ private void itemPickedUpTrigger(ItemEntity itemEntity, CallbackInfo ci) { @Inject(method = "awardKillScore", at = @At("HEAD")) @SuppressWarnings("UnreachableCode") - private void killSelfTrigger(Entity killed, int scoreValue, DamageSource source, CallbackInfo ci) { + private void killSelfTrigger(Entity killed, DamageSource source, CallbackInfo ci) { if (killed == (Object)this) { BingoTriggers.KILL_SELF.get().trigger((ServerPlayer)killed, source); } diff --git a/common/src/main/java/io/github/gaming32/bingo/util/BingoUtil.java b/common/src/main/java/io/github/gaming32/bingo/util/BingoUtil.java index ab64876b..88d09d9a 100644 --- a/common/src/main/java/io/github/gaming32/bingo/util/BingoUtil.java +++ b/common/src/main/java/io/github/gaming32/bingo/util/BingoUtil.java @@ -13,8 +13,10 @@ import com.mojang.serialization.JsonOps; import io.github.gaming32.bingo.Bingo; import it.unimi.dsi.fastutil.Hash; +import net.minecraft.commands.arguments.ResourceOrTagKeyArgument; import net.minecraft.core.Holder; import net.minecraft.core.HolderSet; +import net.minecraft.core.Registry; import net.minecraft.locale.Language; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.ListTag; @@ -40,7 +42,6 @@ import java.util.function.Function; import java.util.function.Supplier; import java.util.stream.Collector; -import java.util.stream.Stream; public class BingoUtil { private static final Hash.Strategy> HOLDER_STRATEGY = new Hash.Strategy<>() { @@ -252,14 +253,11 @@ public static double distanceToSquareEdge(double angle, double squareRadius) { : squareRadius / sin; } - public static HolderSet concatHolderSets(HolderSet a, HolderSet b) { - if (a.size() == 0) { - return b; - } - if (b.size() == 0) { - return a; - } - return HolderSet.direct(Stream.concat(a.stream(), b.stream()).distinct().toList()); + public static HolderSet toHolderSet(Registry registry, ResourceOrTagKeyArgument.Result result) { + return result.unwrap().map( + resource -> HolderSet.direct(registry.getOrThrow(resource)), + registry::getOrThrow + ); } public static Set copyAndAdd(Set set, T value) { diff --git a/common/src/main/resources/bingo.accessWidener b/common/src/main/resources/bingo.accessWidener index 40b0dd46..d6ae529b 100644 --- a/common/src/main/resources/bingo.accessWidener +++ b/common/src/main/resources/bingo.accessWidener @@ -1,7 +1,15 @@ accessWidener v2 named accessible class net/minecraft/advancements/critereon/PlayerPredicate$StatMatcher + accessible method net/minecraft/client/gui/GuiGraphics renderTooltipInternal (Lnet/minecraft/client/gui/Font;Ljava/util/List;IILnet/minecraft/client/gui/screens/inventory/tooltip/ClientTooltipPositioner;Lnet/minecraft/resources/ResourceLocation;)V + +accessible method net/minecraft/commands/arguments/ResourceKeyArgument getRegistryKey (Lcom/mojang/brigadier/context/CommandContext;Ljava/lang/String;Lnet/minecraft/resources/ResourceKey;Lcom/mojang/brigadier/exceptions/DynamicCommandExceptionType;)Lnet/minecraft/resources/ResourceKey; accessible method net/minecraft/commands/arguments/ResourceKeyArgument resolveKey (Lcom/mojang/brigadier/context/CommandContext;Ljava/lang/String;Lnet/minecraft/resources/ResourceKey;Lcom/mojang/brigadier/exceptions/DynamicCommandExceptionType;)Lnet/minecraft/core/Holder$Reference; + +extendable method net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener (Lcom/mojang/serialization/DynamicOps;Lcom/mojang/serialization/Codec;Lnet/minecraft/resources/FileToIdConverter;)V + accessible method net/minecraft/world/level/storage/loot/parameters/LootContextParamSets register (Ljava/lang/String;Ljava/util/function/Consumer;)Lnet/minecraft/util/context/ContextKeySet; + accessible field net/minecraft/world/inventory/GrindstoneMenu repairSlots Lnet/minecraft/world/Container; + accessible method net/minecraft/world/level/storage/LevelResource (Ljava/lang/String;)V diff --git a/fabric/src/main/java/io/github/gaming32/bingo/fabric/datagen/goal/EasyGoalProvider.java b/fabric/src/main/java/io/github/gaming32/bingo/fabric/datagen/goal/EasyGoalProvider.java index edc9928b..0815b811 100644 --- a/fabric/src/main/java/io/github/gaming32/bingo/fabric/datagen/goal/EasyGoalProvider.java +++ b/fabric/src/main/java/io/github/gaming32/bingo/fabric/datagen/goal/EasyGoalProvider.java @@ -89,6 +89,7 @@ import net.minecraft.advancements.critereon.UsingItemTrigger; import net.minecraft.client.KeyMapping; import net.minecraft.client.Minecraft; +import net.minecraft.core.BlockPos; import net.minecraft.core.HolderLookup; import net.minecraft.core.registries.Registries; import net.minecraft.nbt.ByteTag; @@ -506,7 +507,7 @@ public void addGoals() { )) .antisynergy("bucket_types", "water_bucket", "lava_bucket", "milk_bucket") .reactant("use_buckets")); - addGoal(obtainSomeItemsFromTag(id("different_flowers"), ItemTags.FLOWERS, "bingo.goal.different_flowers", 5, 7) + addGoal(obtainSomeItemsFromTag(id("different_flowers"), BingoItemTags.FLOWERS, "bingo.goal.different_flowers", 5, 7) .antisynergy("flowers") .infrequency(2) .tags(BingoTags.OVERWORLD)); @@ -523,6 +524,10 @@ public void addGoals() { addGoal(BingoGoal.builder(id("finish_at_spawn")) .criterion("nearby", CriteriaTriggers.LOCATION.createCriterion( new PlayerTrigger.TriggerInstance(Optional.of(ContextAwarePredicate.create( + new LocationCheck( + Optional.of(LocationPredicate.Builder.inDimension(Level.OVERWORLD).build()), + BlockPos.ZERO + ), new DistanceFromSpawnCondition( Optional.of(DistancePredicate.horizontal(MinMaxBounds.Doubles.atMost(3))) ), diff --git a/fabric/src/main/java/io/github/gaming32/bingo/fabric/datagen/goal/HardGoalProvider.java b/fabric/src/main/java/io/github/gaming32/bingo/fabric/datagen/goal/HardGoalProvider.java index 4f02b25d..0c2d01c1 100644 --- a/fabric/src/main/java/io/github/gaming32/bingo/fabric/datagen/goal/HardGoalProvider.java +++ b/fabric/src/main/java/io/github/gaming32/bingo/fabric/datagen/goal/HardGoalProvider.java @@ -682,7 +682,7 @@ public void addGoals() { .tags(BingoTags.OCEAN, BingoTags.OVERWORLD)); addGoal(obtainItemGoal(id("sniffer_egg"), items, Items.SNIFFER_EGG) .tags(BingoTags.OCEAN, BingoTags.OVERWORLD)); - addGoal(obtainSomeItemsFromTag(id("armor_trims"), ItemTags.TRIM_TEMPLATES, "bingo.goal.armor_trims", 3, 3) + addGoal(obtainSomeItemsFromTag(id("armor_trims"), BingoItemTags.TRIM_TEMPLATES, "bingo.goal.armor_trims", 3, 3) .antisynergy("armor_trims")); addGoal(obtainSomeItemsFromTag(id("bonemealable_blocks"), BingoItemTags.BONEMEALABLE, "bingo.goal.bonemealable", 15, 25) .antisynergy("bonemealable")); diff --git a/fabric/src/main/java/io/github/gaming32/bingo/fabric/datagen/goal/MediumGoalProvider.java b/fabric/src/main/java/io/github/gaming32/bingo/fabric/datagen/goal/MediumGoalProvider.java index d1b8491b..7bf156f1 100644 --- a/fabric/src/main/java/io/github/gaming32/bingo/fabric/datagen/goal/MediumGoalProvider.java +++ b/fabric/src/main/java/io/github/gaming32/bingo/fabric/datagen/goal/MediumGoalProvider.java @@ -384,7 +384,7 @@ public void addGoals() { .tags(BingoTags.COLOR, BingoTags.OVERWORLD)); addGoal(bedRowGoal(id("bed_row"), 7, 10)); // TODO: power redstone lamp - addGoal(obtainSomeItemsFromTag(id("different_flowers"), ItemTags.FLOWERS, "bingo.goal.different_flowers", 8, 10) + addGoal(obtainSomeItemsFromTag(id("different_flowers"), BingoItemTags.FLOWERS, "bingo.goal.different_flowers", 8, 10) .antisynergy("flowers") .infrequency(2) .tags(BingoTags.OVERWORLD)); @@ -933,8 +933,8 @@ private Table getArmors() { .map(Holder::value) .forEach(item -> { final var equippable = item.components().get(DataComponents.EQUIPPABLE); - if (equippable == null || equippable.model().isEmpty()) return; - armors.put(equippable.slot(), equippable.model().get(), item); + if (equippable == null || equippable.assetId().isEmpty()) return; + armors.put(equippable.slot(), equippable.assetId().get().location(), item); }); return armors.build(); } diff --git a/fabric/src/main/java/io/github/gaming32/bingo/fabric/datagen/goal/VeryHardGoalProvider.java b/fabric/src/main/java/io/github/gaming32/bingo/fabric/datagen/goal/VeryHardGoalProvider.java index 7ec185dc..79c14c40 100644 --- a/fabric/src/main/java/io/github/gaming32/bingo/fabric/datagen/goal/VeryHardGoalProvider.java +++ b/fabric/src/main/java/io/github/gaming32/bingo/fabric/datagen/goal/VeryHardGoalProvider.java @@ -333,7 +333,7 @@ public void addGoals() { .name("beacon_regen") .icon(Blocks.BEACON) .reactant("pacifist")); - addGoal(obtainSomeItemsFromTag(id("armor_trims"), ItemTags.TRIM_TEMPLATES, "bingo.goal.armor_trims", 5, 5) + addGoal(obtainSomeItemsFromTag(id("armor_trims"), BingoItemTags.TRIM_TEMPLATES, "bingo.goal.armor_trims", 5, 5) .antisynergy("armor_trims")); addGoal(obtainAllGoatHorns()); addGoal(obtainAllItemsFromTag(BingoItemTags.CLIMBABLE, "climbables") diff --git a/fabric/src/main/java/io/github/gaming32/bingo/fabric/datagen/tag/BingoItemTagProvider.java b/fabric/src/main/java/io/github/gaming32/bingo/fabric/datagen/tag/BingoItemTagProvider.java index 0d1ffaee..ada1829f 100644 --- a/fabric/src/main/java/io/github/gaming32/bingo/fabric/datagen/tag/BingoItemTagProvider.java +++ b/fabric/src/main/java/io/github/gaming32/bingo/fabric/datagen/tag/BingoItemTagProvider.java @@ -9,6 +9,7 @@ import net.minecraft.core.HolderLookup; import net.minecraft.core.component.DataComponents; import net.minecraft.core.registries.Registries; +import net.minecraft.data.recipes.packs.VanillaRecipeProvider; import net.minecraft.resources.ResourceKey; import net.minecraft.tags.ItemTags; import net.minecraft.world.item.BannerPatternItem; @@ -104,7 +105,7 @@ protected void addTags(HolderLookup.Provider registries) { getOrCreateTagBuilder(BingoItemTags.BONEMEALABLE) .forceAddTag(ItemTags.VILLAGER_PLANTABLE_SEEDS) .forceAddTag(ItemTags.SAPLINGS) - .forceAddTag(ItemTags.TALL_FLOWERS) + .forceAddTag(BingoItemTags.TALL_FLOWERS) .add( Items.BAMBOO, Items.BIG_DRIPLEAF, @@ -135,8 +136,9 @@ protected void addTags(HolderLookup.Provider registries) { Items.WEEPING_VINES ); - // The vanilla flower tag contains weird stuff like cherry leaves that bees are attracted to, but they are not flowers - getOrCreateTagBuilder(BingoItemTags.FLOWERS).forceAddTag(ItemTags.SMALL_FLOWERS).forceAddTag(ItemTags.TALL_FLOWERS); + getOrCreateTagBuilder(BingoItemTags.FLOWERS) + .forceAddTag(ItemTags.SMALL_FLOWERS) + .addTag(BingoItemTags.TALL_FLOWERS); getOrCreateTagBuilder(BingoItemTags.DEAD_CORAL_BLOCKS).add( Items.DEAD_BRAIN_CORAL_BLOCK, @@ -146,6 +148,19 @@ protected void addTags(HolderLookup.Provider registries) { Items.DEAD_TUBE_CORAL_BLOCK ); + getOrCreateTagBuilder(BingoItemTags.TALL_FLOWERS).add( + Items.LILAC, + Items.PEONY, + Items.PITCHER_PLANT, + Items.ROSE_BUSH, + Items.SUNFLOWER + ); + + final var trimTemplatesBuilder = getOrCreateTagBuilder(BingoItemTags.TRIM_TEMPLATES); + VanillaRecipeProvider.smithingTrims() + .map(VanillaRecipeProvider.TrimTemplate::template) + .forEach(trimTemplatesBuilder::add); + var glazedTerracottaBuilder = getOrCreateTagBuilder(BingoItemTags.GLAZED_TERRACOTTA); var concreteBuilder = getOrCreateTagBuilder(BingoItemTags.CONCRETE); for (DyeColor dyeColor : DyeColor.values()) { diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index 2195c3fb..e8f413bc 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -39,9 +39,9 @@ "bingo-common.mixins.json" ], "depends": { - "fabricloader": ">=0.16.7", - "fabric-api": ">=0.107.0", - "minecraft": ">=1.21.2 <1.21.4" + "fabricloader": ">=0.16.9", + "fabric-api": ">=0.110.0", + "minecraft": ">=1.21.4 <1.21.5" }, "custom": { "loom:injected_interfaces": { diff --git a/gradle.properties b/gradle.properties index 89b2c784..ba6cf34b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,12 +1,12 @@ org.gradle.jvmargs=-Xmx2G -minecraft_version=1.21.3 +minecraft_version=1.21.4 archives_base_name=bingo mod_version=1.1.12 maven_group=io.github.gaming32 fabric_loader_version=0.16.9 -fabric_api_version=0.107.0+1.21.3 +fabric_api_version=0.110.5+1.21.4 -neoforge_version=21.3.56 +neoforge_version=21.4.1-beta diff --git a/neoforge/src/main/resources/META-INF/neoforge.mods.toml b/neoforge/src/main/resources/META-INF/neoforge.mods.toml index b49626bd..7cf84045 100644 --- a/neoforge/src/main/resources/META-INF/neoforge.mods.toml +++ b/neoforge/src/main/resources/META-INF/neoforge.mods.toml @@ -27,13 +27,13 @@ file = "META-INF/accesstransformer.cfg" [[dependencies.bingo]] modId="neoforge" type="required" - versionRange="[21.2.1-beta,)" + versionRange="[21.4.0-beta,)" ordering="NONE" side="BOTH" [[dependencies.bingo]] modId="minecraft" type="required" - versionRange="[1.21.2,1.21.4)" + versionRange="[1.21.4,1.21.5)" ordering="NONE" side="BOTH"