From 774a40d46b15334b5177f9ea885b8bae3f22b15c Mon Sep 17 00:00:00 2001 From: Mrbysco Date: Tue, 3 Dec 2024 21:55:49 +0100 Subject: [PATCH] Initial port to 1.21.4 --- build.gradle | 42 +- changelog.md | 2 - gradle.properties | 25 +- .../103d9f3f36b01595f1aa5172191e60eff02e6924 | 2 +- .../3f45eedf5e40beff2a92fdcf50d6270c70fdb8e6 | 4 +- .../4a65d95ba5c1c1c09e5bd2f85262b17bca6ea80d | 4 +- .../59eb3dbb5f86130e09b3c62d89b9525ee01cf52d | 2 +- .../5e9f99de52df90fff0eca2705b8d4af79b8c83be | 2 +- .../62888ce2b9547abf000d004b13c12bacb5ffaca1 | 2 +- .../735031f3addf80804addae5e3f53249900116f1e | 2 +- .../79843005accff9521f87d6395bb5f230a222a908 | 92 ++++ .../8fa013ccbf10434e23abe63f04d41f64f8518015 | 2 +- .../9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e | 92 ---- .../cd090bff9ca93079474b6df48215a8307e531e73 | 6 - .../d9ca59ae31ccf5a8a87a3f23307ff41b6ca77e97 | 2 +- .../e5c5eb35b4ba40351ecb7d9f04c3527f2f5779b0 | 2 +- .../f83529e499d02003904562a2f999b81582975f80 | 2 +- .../resources/assets/statues/lang/en_us.json | 2 +- .../statues/en_us/categories/info.json | 5 - .../statues/en_us/entries/info/core.json | 19 - .../en_us/entries/info/statue_table.json | 15 - .../statues/en_us/entries/info/upgrading.json | 35 -- .../statues/patchouli_books/statues/book.json | 15 - ..._stand_from_quartz_block_stonecutting.json | 4 +- .../data/statues/recipe/info_statue.json | 12 +- .../statues/recipe/loot/allay_statue.json | 4 +- .../recipe/loot/axolotl_blue_statue.json | 4 +- .../recipe/loot/axolotl_cyan_statue.json | 4 +- .../recipe/loot/axolotl_gold_statue.json | 4 +- .../recipe/loot/axolotl_lucy_statue.json | 4 +- .../recipe/loot/axolotl_wild_statue.json | 4 +- .../recipe/loot/baby_zombie_statue.json | 4 +- .../data/statues/recipe/loot/bee_statue.json | 12 +- .../statues/recipe/loot/blaze_statue.json | 4 +- .../recipe/loot/brown_mooshroom_statue.json | 4 +- .../statues/recipe/loot/campfire_statue.json | 4 +- .../data/statues/recipe/loot/cat_statue.json | 44 +- .../recipe/loot/chicken_jockey_statue.json | 4 +- .../statues/recipe/loot/chicken_statue.json | 4 +- .../data/statues/recipe/loot/cod_statue.json | 4 +- .../data/statues/recipe/loot/cow_statue.json | 4 +- .../statues/recipe/loot/creeper_statue.json | 4 +- .../statues/recipe/loot/dolphin_statue.json | 4 +- .../statues/recipe/loot/drowned_statue.json | 4 +- .../recipe/loot/elder_guardian_statue.json | 4 +- .../statues/recipe/loot/enderman_statue.json | 4 +- .../statues/recipe/loot/evoker_statue.json | 4 +- .../statues/recipe/loot/flood_statue.json | 4 +- .../data/statues/recipe/loot/fox_statue.json | 8 +- .../statues/recipe/loot/frog_cold_statue.json | 4 +- .../recipe/loot/frog_temperate_statue.json | 4 +- .../statues/recipe/loot/frog_warm_statue.json | 4 +- .../statues/recipe/loot/ghast_statue.json | 4 +- .../statues/recipe/loot/guardian_statue.json | 4 +- .../data/statues/recipe/loot/husk_statue.json | 4 +- .../recipe/loot/king_cluck_statue.json | 4 +- .../statues/recipe/loot/magma_statue.json | 4 +- .../statues/recipe/loot/mooshroom_statue.json | 4 +- .../statues/recipe/loot/panda_statue.json | 28 +- .../data/statues/recipe/loot/pig_statue.json | 4 +- .../statues/recipe/loot/pillager_statue.json | 4 +- .../recipe/loot/pufferfish_statue.json | 12 +- .../statues/recipe/loot/rabbit_statue.json | 24 +- .../statues/recipe/loot/ravager_statue.json | 4 +- .../statues/recipe/loot/salmon_statue.json | 4 +- .../recipe/loot/sheep_shaven_statue.json | 4 +- .../recipe/loot/sheep_statue_black.json | 4 +- .../recipe/loot/sheep_statue_blue.json | 4 +- .../recipe/loot/sheep_statue_brown.json | 4 +- .../recipe/loot/sheep_statue_cyan.json | 4 +- .../recipe/loot/sheep_statue_gray.json | 4 +- .../recipe/loot/sheep_statue_green.json | 4 +- .../recipe/loot/sheep_statue_light_blue.json | 4 +- .../recipe/loot/sheep_statue_light_gray.json | 4 +- .../recipe/loot/sheep_statue_lime.json | 4 +- .../recipe/loot/sheep_statue_magenta.json | 4 +- .../recipe/loot/sheep_statue_orange.json | 4 +- .../recipe/loot/sheep_statue_pink.json | 4 +- .../recipe/loot/sheep_statue_purple.json | 4 +- .../statues/recipe/loot/sheep_statue_red.json | 4 +- .../recipe/loot/sheep_statue_white.json | 4 +- .../recipe/loot/sheep_statue_yellow.json | 4 +- .../statues/recipe/loot/shulker_statue.json | 4 +- .../statues/recipe/loot/slime_statue.json | 4 +- .../recipe/loot/snow_golem_statue.json | 4 +- .../statues/recipe/loot/spider_statue.json | 4 +- .../statues/recipe/loot/squid_statue.json | 4 +- .../statues/recipe/loot/tropical_fish.json | 48 +-- .../statues/recipe/loot/turtle_statue.json | 4 +- .../statues/recipe/loot/villager_statue.json | 16 +- .../recipe/loot/vindicator_statue.json | 4 +- .../statues/recipe/loot/warden_statue.json | 4 +- .../statues/recipe/loot/wasteland_statue.json | 4 +- .../statues/recipe/loot/witch_statue.json | 4 +- .../statues/recipe/loot/zombie_statue.json | 4 +- .../data/statues/recipe/statue_core.json | 4 +- .../data/statues/recipe/statue_table.json | 12 +- .../statues/recipe/upgrade/automation.json | 12 +- .../statues/recipe/upgrade/despawner.json | 16 +- .../data/statues/recipe/upgrade/glowing.json | 8 +- .../statues/recipe/upgrade/interaction.json | 8 +- .../data/statues/recipe/upgrade/looting.json | 20 +- .../statues/recipe/upgrade/mob_killer.json | 8 +- .../statues/recipe/upgrade/mob_killer_2.json | 18 +- .../statues/recipe/upgrade/mob_killer_3.json | 8 +- .../data/statues/recipe/upgrade/sound.json | 12 +- .../data/statues/recipe/upgrade/spawner.json | 20 +- .../data/statues/recipe/upgrade/speed.json | 16 +- .../recipe/upgrade/statue_upgrade.json | 4 +- .../statues/recipe/upgrade/unglowing.json | 8 +- .../worldgen/biome/can_spawn_statue_bat.json | 1 + .../java/com/shynieke/statues/Reference.java | 5 + .../AbstractStatueBlockEntity.java | 7 +- .../blockentities/PlayerBlockEntity.java | 7 +- .../blockentities/StatueBlockEntity.java | 22 +- .../blockentities/StatueTableBlockEntity.java | 5 +- .../statues/blocks/AbstractBaseBlock.java | 4 +- .../statues/blocks/AbstractStatueBase.java | 29 +- .../blocks/decorative/DisplayStandBlock.java | 2 +- .../blocks/statues/InfoStatueBlock.java | 33 +- .../blocks/statues/PlayerStatueBlock.java | 49 ++- .../blocks/statues/SheepStatueBlock.java | 6 +- .../blocks/statues/fish/FishStatueBlock.java | 4 +- .../statues/client/ClientHandler.java | 122 +----- .../client/model/PlayerStatueModel.java | 97 +++-- .../statues/client/model/StatueBatModel.java | 25 +- .../client/model/StatuePlayerTileModel.java | 11 +- .../model/state/PlayerStatueRenderState.java | 15 + .../model/state/StatueBatRenderState.java | 6 + .../client/property/StatueCompassAngle.java | 33 ++ .../property/StatueCompassAngleState.java | 96 +++++ .../statues/client/render/PlayerBER.java | 2 + .../statues/client/render/PlayerBEWLR.java | 261 ++++++------ .../client/render/PlayerStatueRenderer.java | 119 ++++-- .../client/render/StatueBatRenderer.java | 21 +- .../client/screen/PlayerPoseScreen.java | 1 + .../client/screen/ShulkerStatueScreen.java | 5 +- .../client/screen/StatueTableScreen.java | 5 +- .../client/screen/widget/EnumCycleButton.java | 2 +- .../statues/commands/StatuesCommands.java | 4 +- .../statues/commands/StatuesDevCommands.java | 24 +- .../curios/client/StatueCurioRenderer.java | 96 ++--- .../statues/compat/jade/JadeCompat.java | 152 +++---- .../statues/compat/jei/JEIPlugin.java | 250 +++++------ .../compat/jei/category/LootCategory.java | 162 +++---- .../compat/jei/category/UpgradeCategory.java | 396 ++++++++--------- .../compat/patchouli/PatchouliCompat.java | 58 +-- .../statues/compat/rei/REIPlugin.java | 398 +++++++++--------- .../compat/rei/category/LootCategory.java | 144 +++---- .../compat/rei/category/UpgradeCategory.java | 216 +++++----- .../compat/rei/display/LootDisplay.java | 130 +++--- .../compat/rei/display/UpgradeDisplay.java | 184 ++++---- .../datacomponent/PlayerCompassData.java | 9 +- .../statues/datagen/StatuesDataGenerator.java | 38 +- .../client/StatueItemModelProvider.java | 7 +- .../client/StatueLanguageProvider.java | 2 +- .../datagen/client/StatueSoundProvider.java | 2 +- .../server/StatueAdvancementProvider.java | 15 +- .../datagen/server/StatueBiomeModifiers.java | 4 +- .../datagen/server/StatueLootProvider.java | 5 - .../datagen/server/StatueRecipeProvider.java | 278 ++++++------ .../patchouli/StatuePatchouliProvider.java | 134 +++--- .../server/recipe/HardcoreRecipeBuilder.java | 150 +++++++ .../server/recipe/LootRecipeBuilder.java | 20 +- .../server/recipe/UpgradeRecipeBuilder.java | 14 +- .../shynieke/statues/entity/PlayerStatue.java | 38 +- .../statues/entity/StatueBatEntity.java | 18 +- .../statues/handlers/DropHandler.java | 6 +- .../statues/handlers/StatueHandler.java | 6 +- .../statues/items/PlayerStatueBlockItem.java | 25 -- .../statues/items/PlayerStatueSpawnItem.java | 4 +- .../statues/items/StatueBlockItem.java | 7 +- .../items/StatueCharredMarshmallow.java | 3 +- .../items/StatueGoldenMarshmallow.java | 10 +- .../statues/items/StatueMooshroomSoup.java | 10 +- .../shynieke/statues/items/StatueTeaItem.java | 16 +- .../CityStatuesLootModifier.java | 2 +- .../message/PlayerStatueScreenData.java | 2 +- .../network/message/PlayerStatueSyncData.java | 2 +- .../network/message/StatueTableData.java | 2 +- .../statues/recipe/HardcoreRecipe.java | 24 +- .../shynieke/statues/recipe/LootRecipe.java | 28 +- .../statues/recipe/UpgradeRecipe.java | 58 +-- .../statues/registry/StatueBlockEntities.java | 18 +- .../statues/registry/StatueEntities.java | 5 +- .../statues/registry/StatueJukeboxSongs.java | 2 +- .../statues/registry/StatuePatterns.java | 2 +- .../statues/registry/StatueRegistry.java | 343 +++++++-------- .../statues/registry/StatueSounds.java | 78 ++-- .../shynieke/statues/registry/StatueTags.java | 20 +- .../statues/registry/StatueTrims.java | 5 +- .../com/shynieke/statues/util/LootHelper.java | 9 +- .../resources/META-INF/accesstransformer.cfg | 5 +- .../resources/META-INF/neoforge.mods.toml | 4 +- .../data/statues/recipe/player_statue.json | 27 -- 195 files changed, 2803 insertions(+), 2869 deletions(-) create mode 100644 src/generated/resources/.cache/79843005accff9521f87d6395bb5f230a222a908 delete mode 100644 src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e delete mode 100644 src/generated/resources/.cache/cd090bff9ca93079474b6df48215a8307e531e73 delete mode 100644 src/generated/resources/assets/statues/patchouli_books/statues/en_us/categories/info.json delete mode 100644 src/generated/resources/assets/statues/patchouli_books/statues/en_us/entries/info/core.json delete mode 100644 src/generated/resources/assets/statues/patchouli_books/statues/en_us/entries/info/statue_table.json delete mode 100644 src/generated/resources/assets/statues/patchouli_books/statues/en_us/entries/info/upgrading.json delete mode 100644 src/generated/resources/data/statues/patchouli_books/statues/book.json create mode 100644 src/main/java/com/shynieke/statues/client/model/state/PlayerStatueRenderState.java create mode 100644 src/main/java/com/shynieke/statues/client/model/state/StatueBatRenderState.java create mode 100644 src/main/java/com/shynieke/statues/client/property/StatueCompassAngle.java create mode 100644 src/main/java/com/shynieke/statues/client/property/StatueCompassAngleState.java create mode 100644 src/main/java/com/shynieke/statues/datagen/server/recipe/HardcoreRecipeBuilder.java delete mode 100644 src/main/resources/data/statues/recipe/player_statue.json diff --git a/build.gradle b/build.gradle index 69173624..233972cb 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ plugins { id 'eclipse' id 'idea' id 'maven-publish' - id 'net.neoforged.gradle.userdev' version '7.0.168' + id 'net.neoforged.gradle.userdev' version '7.0.171' id 'net.darkhax.curseforgegradle' version '1.1.25' id 'com.modrinth.minotaur' version "2.+" } @@ -45,7 +45,7 @@ runs { programArgument '--nogui' } - data { + clientData { // example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it // workingDirectory project.file('run-data') @@ -94,35 +94,35 @@ repositories { dependencies { implementation "net.neoforged:neoforge:${neo_version}" - compileOnly "mezz.jei:jei-${jei_minecraft}-common-api:${jei_version}" - compileOnly "mezz.jei:jei-${jei_minecraft}-neoforge-api:${jei_version}" +// compileOnly "mezz.jei:jei-${jei_minecraft}-common-api:${jei_version}" +// compileOnly "mezz.jei:jei-${jei_minecraft}-neoforge-api:${jei_version}" - localRuntime "mezz.jei:jei-${jei_minecraft}-neoforge:${jei_version}" +// localRuntime "mezz.jei:jei-${jei_minecraft}-neoforge:${jei_version}" - compileOnly "me.shedaniel.cloth:cloth-config-neoforge:${cloth_config_version}" - compileOnly "dev.architectury:architectury-neoforge:${architectury_version}" - compileOnly "me.shedaniel:RoughlyEnoughItems-api-neoforge:${rei_version}" - compileOnly "me.shedaniel:RoughlyEnoughItems-default-plugin-neoforge:${rei_version}" +// compileOnly "me.shedaniel.cloth:cloth-config-neoforge:${cloth_config_version}" +// compileOnly "dev.architectury:architectury-neoforge:${architectury_version}" +// compileOnly "me.shedaniel:RoughlyEnoughItems-api-neoforge:${rei_version}" +// compileOnly "me.shedaniel:RoughlyEnoughItems-default-plugin-neoforge:${rei_version}" - compileOnly "me.shedaniel:RoughlyEnoughItems-neoforge:${rei_version}" +// compileOnly "me.shedaniel:RoughlyEnoughItems-neoforge:${rei_version}" // implementation "com.blamejared.crafttweaker:CraftTweaker-neoforge-${mc_version}:${crafttweaker_version}" - compileOnly "top.theillusivec4.curios:curios-neoforge:${curios_version}:api" - localRuntime "top.theillusivec4.curios:curios-neoforge:${curios_version}" +// compileOnly "top.theillusivec4.curios:curios-neoforge:${curios_version}:api" +// localRuntime "top.theillusivec4.curios:curios-neoforge:${curios_version}" - compileOnly "vazkii.patchouli:Patchouli:${patchouli_version}" - localRuntime "vazkii.patchouli:Patchouli:${patchouli_version}" +// compileOnly "vazkii.patchouli:Patchouli:${patchouli_version}" +// localRuntime "vazkii.patchouli:Patchouli:${patchouli_version}" - compileOnly "xyz.brassgoggledcoders:PatchouliProvider:${patchouli_provider_version}" - localRuntime "xyz.brassgoggledcoders:PatchouliProvider:${patchouli_provider_version}" +// compileOnly "xyz.brassgoggledcoders:PatchouliProvider:${patchouli_provider_version}" +// localRuntime "xyz.brassgoggledcoders:PatchouliProvider:${patchouli_provider_version}" - compileOnly "curse.maven:jade-324717:5639932" //Jade (WAILA) - localRuntime "curse.maven:jade-324717:5639932" //Jade (WAILA) -// runtimeOnly "curse.maven:TheOneProbe-245211:5084077" //The One probe (TOP) +// compileOnly "curse.maven:jade-324717:${jade_id}" //Jade (WAILA) +// localRuntime "curse.maven:jade-324717:${jade_id}" //Jade (WAILA) +// compileOnly "curse.maven:TheOneProbe-245211:5836106" //The One probe (TOP) - localRuntime "curse.maven:powah-rearchitected-633483:5608949" //Powah - localRuntime "curse.maven:cloth-config-348521:5623420" //Cloth Config (Dep for Powah) +// localRuntime "curse.maven:powah-rearchitected-633483:5608949" //Powah +// localRuntime "curse.maven:cloth-config-348521:5623420" //Cloth Config (Dep for Powah) } jar { diff --git a/changelog.md b/changelog.md index bf8c6cfd..e69de29b 100644 --- a/changelog.md +++ b/changelog.md @@ -1,2 +0,0 @@ -* Add a chance to get an egg from a looting upgraded Chicken Statue -* Fix a potential bug where villagers always drop the same statue instead of a random of the 4 variants \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 69e6c540..086e4e40 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,10 +5,10 @@ org.gradle.daemon=false org.gradle.debug=false # Base info -mc_version=1.21.1 -neo_version=21.1.77 -neogradle.subsystems.parchment.minecraftVersion=1.21 -neogradle.subsystems.parchment.mappingsVersion=2024.07.28 +mc_version=1.21.4 +neo_version=21.4.1-beta +neogradle.subsystems.parchment.minecraftVersion=1.21.1 +neogradle.subsystems.parchment.mappingsVersion=2024.11.17 neogradle.subsystems.conventions.runs.create-default-run-per-type=false mod_group=com.shynieke.statues mod_id=statues @@ -23,12 +23,13 @@ modrinth_id=hsCeX7k7 version=0.4.15 # Dependencies -jei_minecraft=1.21.1 -jei_version=19.19.0.220 +#jei_minecraft=1.21.1 +#jei_version=19.19.0.220 #crafttweaker_version=21.0.3 -rei_version=16.0.777 -architectury_version=13.0.6 -cloth_config_version=15.0.140 -curios_version=9.0.11+1.21 -patchouli_version=1.21-87-NEOFORGE -patchouli_provider_version=1.21.1-1.0.11-Snapshot.3 +#rei_version=16.0.777 +#architectury_version=13.0.6 +#cloth_config_version=15.0.140 +#curios_version=9.0.15+1.21.3 +#patchouli_version=1.21-87-NEOFORGE +#patchouli_provider_version=1.21.1-1.0.11-Snapshot.3 +#jade_id=5846076 \ No newline at end of file diff --git a/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 b/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 index 432aa1df..116a1779 100644 --- a/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 +++ b/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 @@ -1,4 +1,4 @@ -// 1.21.1 2024-08-11T14:53:50.3815318 Registries +// 1.21.4 2024-12-03T21:55:30.3457113 Registries bc7ea3f904e7fb36de7d3656abc98016c75a776f data/statues/jukebox_song/credits.json aca6701e2de1d3dcb9a0430456d039bae0872717 data/statues/neoforge/biome_modifier/add_fewer_statue_bat_spawn.json 760c99e0a58a4a3df8d4af59608f1b91e6e06b77 data/statues/neoforge/biome_modifier/add_statue_bat_spawn.json diff --git a/src/generated/resources/.cache/3f45eedf5e40beff2a92fdcf50d6270c70fdb8e6 b/src/generated/resources/.cache/3f45eedf5e40beff2a92fdcf50d6270c70fdb8e6 index c3a9fc4a..0f0d65ae 100644 --- a/src/generated/resources/.cache/3f45eedf5e40beff2a92fdcf50d6270c70fdb8e6 +++ b/src/generated/resources/.cache/3f45eedf5e40beff2a92fdcf50d6270c70fdb8e6 @@ -1,3 +1,3 @@ -// 1.21.1 2024-08-11T14:53:50.3770322 Tags for minecraft:worldgen/biome mod id statues +// 1.21.4 2024-12-03T21:55:30.3387052 Tags for minecraft:worldgen/biome mod id statues 04ac0a28392a7ff31602fa82ebe378e64220b060 data/statues/tags/worldgen/biome/can_spawn_fewer_statue_bat.json -57b9bc73504d77a105ed8da0e7b56fcdf9c2c74c data/statues/tags/worldgen/biome/can_spawn_statue_bat.json +d53c843400a1dbb4ebf99c1a390b04994bae4a9a data/statues/tags/worldgen/biome/can_spawn_statue_bat.json diff --git a/src/generated/resources/.cache/4a65d95ba5c1c1c09e5bd2f85262b17bca6ea80d b/src/generated/resources/.cache/4a65d95ba5c1c1c09e5bd2f85262b17bca6ea80d index ff97d8dd..489bb81d 100644 --- a/src/generated/resources/.cache/4a65d95ba5c1c1c09e5bd2f85262b17bca6ea80d +++ b/src/generated/resources/.cache/4a65d95ba5c1c1c09e5bd2f85262b17bca6ea80d @@ -1,2 +1,2 @@ -// 1.21.1 2024-09-05T19:45:11.278503 Languages: en_us for mod: statues -f24d78b394e3633c0e8f73f3b1578bf52d756460 assets/statues/lang/en_us.json +// 1.21.4 2024-12-03T21:48:09.5085958 Languages: en_us for mod: statues +d99ee1cfb37b091fb08b6bab47236bf04793320e assets/statues/lang/en_us.json diff --git a/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d index ce957c1b..411894ae 100644 --- a/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d +++ b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d @@ -1,4 +1,4 @@ -// 1.21.1 2024-08-11T14:53:50.3785331 Loot Tables +// 1.21.4 2024-12-03T21:55:30.3437094 Loot Tables 63ebf6ea91a5210188bc8165299f0beaa5759208 data/statues/loot_table/blocks/allay_statue.json 0e0103dece0812379551b1784138d8a1da8d34b9 data/statues/loot_table/blocks/angry_bee_statue.json b2974bee64db4765febe3eb74ef004981402308e data/statues/loot_table/blocks/axolotl_blue_statue.json diff --git a/src/generated/resources/.cache/5e9f99de52df90fff0eca2705b8d4af79b8c83be b/src/generated/resources/.cache/5e9f99de52df90fff0eca2705b8d4af79b8c83be index c0929adb..55f6692a 100644 --- a/src/generated/resources/.cache/5e9f99de52df90fff0eca2705b8d4af79b8c83be +++ b/src/generated/resources/.cache/5e9f99de52df90fff0eca2705b8d4af79b8c83be @@ -1,3 +1,3 @@ -// 1.21.1 2024-08-11T14:53:50.3840325 Tags for minecraft:block mod id statues +// 1.21.4 2024-12-03T21:55:30.3467229 Tags for minecraft:block mod id statues e0104da29651b73003011e7b3a36204a7089abf8 data/statues/tags/block/is_tropical_fish.json 5850f4c8d068888c785daf81c0fe8fb91828d352 data/statues/tags/block/statues.json diff --git a/src/generated/resources/.cache/62888ce2b9547abf000d004b13c12bacb5ffaca1 b/src/generated/resources/.cache/62888ce2b9547abf000d004b13c12bacb5ffaca1 index 7ef22648..c02851fa 100644 --- a/src/generated/resources/.cache/62888ce2b9547abf000d004b13c12bacb5ffaca1 +++ b/src/generated/resources/.cache/62888ce2b9547abf000d004b13c12bacb5ffaca1 @@ -1,4 +1,4 @@ -// 1.21.1 2024-09-30T20:37:28.7891398 Block States: statues +// 1.21.4 2024-12-03T21:48:09.5085958 Block States: statues 4427e42906b8877f46bd091919b793be75c3018b assets/statues/blockstates/allay_statue.json 42d5ac316c690763e56b4fc0cab4ff995f42790a assets/statues/blockstates/angry_bee_statue.json a969b3fd05f50339960b7a4fee7a0200e2a085c4 assets/statues/blockstates/axolotl_blue_statue.json diff --git a/src/generated/resources/.cache/735031f3addf80804addae5e3f53249900116f1e b/src/generated/resources/.cache/735031f3addf80804addae5e3f53249900116f1e index 5062c95b..aa902a6b 100644 --- a/src/generated/resources/.cache/735031f3addf80804addae5e3f53249900116f1e +++ b/src/generated/resources/.cache/735031f3addf80804addae5e3f53249900116f1e @@ -1,2 +1,2 @@ -// 1.21.1 2024-08-11T14:53:50.3850328 Sound Definitions +// 1.21.4 2024-12-03T21:48:09.5105981 Sound Definitions a13d81ffd6d8c2ca16d927669a4254399b64d01a assets/statues/sounds.json diff --git a/src/generated/resources/.cache/79843005accff9521f87d6395bb5f230a222a908 b/src/generated/resources/.cache/79843005accff9521f87d6395bb5f230a222a908 new file mode 100644 index 00000000..bea9fd3c --- /dev/null +++ b/src/generated/resources/.cache/79843005accff9521f87d6395bb5f230a222a908 @@ -0,0 +1,92 @@ +// 1.21.4 2024-12-03T21:55:30.3397052 Statues Recipes +18e987dfadfe8b3a50e692cace2f8740225aa39b data/statues/advancement/recipes/decorations/display_stand_from_quartz_block_stonecutting.json +63a4b8f8cbc1656364761abc74c1b083424037a7 data/statues/advancement/recipes/misc/info_statue.json +19084d3ced99bf522cf7e8705ebdeb8ce8c04c44 data/statues/advancement/recipes/misc/statue_core.json +b6d4957c7a93a1c517d6db67df0e43acd4d3ae97 data/statues/advancement/recipes/misc/statue_table.json +7c5fd0b1b881db640bdb36e75d951f3e22452e42 data/statues/recipe/display_stand_from_quartz_block_stonecutting.json +05bdfa743e08ff061bef482be9b46bac205a1407 data/statues/recipe/info_statue.json +77766ef48d60ee7958711f0101752814d8a97e24 data/statues/recipe/loot/allay_statue.json +3e65c139f53623c29724d431ad389f83a7f0042e data/statues/recipe/loot/axolotl_blue_statue.json +52ac47f0bd0fd2a1d2924f716512e82a5cd3941f data/statues/recipe/loot/axolotl_cyan_statue.json +2dbbc46ad68505a83e1ace2284654cfb2d8f4b7b data/statues/recipe/loot/axolotl_gold_statue.json +cf5f7f716199091cdc2ba0c7d5e1c1afa24c44f6 data/statues/recipe/loot/axolotl_lucy_statue.json +a69d42b44924dd05d8826adaeb509ac9cf94a7c3 data/statues/recipe/loot/axolotl_wild_statue.json +d34b834cdf66efa92c4e413fdbdfbaf232597166 data/statues/recipe/loot/baby_zombie_statue.json +b9c605c415873e737c3989775841dc008c04bc84 data/statues/recipe/loot/bee_statue.json +58343b8dc0c93a0698552c9aaf64e80dcc13700e data/statues/recipe/loot/blaze_statue.json +993ac49e6e475361458ccbc347ddd0d111514925 data/statues/recipe/loot/brown_mooshroom_statue.json +a9aa1b507a84a4f5ed5d2f7bf9f4907625d48a20 data/statues/recipe/loot/campfire_statue.json +77d1b368da600b7f64356c109d5308c56c7ad778 data/statues/recipe/loot/cat_statue.json +7f9f455acf214f5305f706feab9ee4129d5d8a94 data/statues/recipe/loot/chicken_jockey_statue.json +062f0fbd1eecac7bb7f78812e21d3c0b7254abca data/statues/recipe/loot/chicken_statue.json +62d3952ebf9855ab3f950eb8876ad926d952675d data/statues/recipe/loot/cod_statue.json +0b75bf56acf7f19015f1e8e83e754f5f4b1c7b35 data/statues/recipe/loot/cow_statue.json +eb39506f492f293ac9c3438b4f3f9b4da1aa19a1 data/statues/recipe/loot/creeper_statue.json +8609b605f10b04726f18283e2c27988cae874ca3 data/statues/recipe/loot/dolphin_statue.json +1ba920ec37d86c9fb4c04aec8fc3aa51a972dfc0 data/statues/recipe/loot/drowned_statue.json +a0fd089c128642bb94905479dc238f6aa8d49fc5 data/statues/recipe/loot/elder_guardian_statue.json +c7ab4fd4559cab6d7c1420d5fa1728ab9baca288 data/statues/recipe/loot/enderman_statue.json +3bb45d1d777d4f66de28522a7a1c26ecbcd59fc1 data/statues/recipe/loot/evoker_statue.json +5d58b0fbbeb77f5fdfdf176a0d886d535d029536 data/statues/recipe/loot/flood_statue.json +6837521d91e201abd1ee1e73c6aa5f15f560de13 data/statues/recipe/loot/fox_statue.json +da27576728b9be9e6b7ec955da1f616379fc52ad data/statues/recipe/loot/frog_cold_statue.json +70cb9ab02e9b8624e08e324fa30ab404c11f49e6 data/statues/recipe/loot/frog_temperate_statue.json +c51da032d0f84c11bb64cc69600f4ef9d46b5719 data/statues/recipe/loot/frog_warm_statue.json +f2cf6ed9261bdaa224199783dc9cb214d80f11da data/statues/recipe/loot/ghast_statue.json +183110e0618240bd459e5dd4ef92f9d66c5e873c data/statues/recipe/loot/guardian_statue.json +83be29987f5dead99c957017d7d7d303848eca69 data/statues/recipe/loot/husk_statue.json +a6d1b93b2d8d1eacd329f78ba3f61a42f3b93746 data/statues/recipe/loot/king_cluck_statue.json +ac969529635be0052d63fea4cfa8700709752f10 data/statues/recipe/loot/magma_statue.json +aa2deb1ede3cdbf5229e7615f921e06f015c0afd data/statues/recipe/loot/mooshroom_statue.json +2f85276644e1fc3c585c26d0b5fcc3c6e8b2390e data/statues/recipe/loot/panda_statue.json +a568116454236667cc051562a691cd69df5b2c51 data/statues/recipe/loot/pig_statue.json +5a9e60370963246d17e62c40977a653dbd1f5891 data/statues/recipe/loot/pillager_statue.json +b0b61b98afb94e6214e0d5560d34cfd956d09a35 data/statues/recipe/loot/pufferfish_statue.json +ad59af167352ded37811448862e197d7fcc6d89c data/statues/recipe/loot/rabbit_statue.json +e64aacbcbbe641d85aee190c2eec25483bf302ec data/statues/recipe/loot/ravager_statue.json +83cbd32e074a28a7059f708e48f2e654ad9f71bd data/statues/recipe/loot/salmon_statue.json +7e7e5cebd91ad5a9cc393185cf498eb1fc81070e data/statues/recipe/loot/sheep_shaven_statue.json +3fd47ec6d689cebce487289164003dfed836f427 data/statues/recipe/loot/sheep_statue_black.json +3b45d489396a13f779315b9425ca87622a4ae32e data/statues/recipe/loot/sheep_statue_blue.json +18479a90268cf2850eddc9b2c700bda24d79cb53 data/statues/recipe/loot/sheep_statue_brown.json +093378fc1a8b9ddbc117aefea241ea5954eb9903 data/statues/recipe/loot/sheep_statue_cyan.json +9b87540268094b30eec5fb247e56a154b190d8a0 data/statues/recipe/loot/sheep_statue_gray.json +b763ebd0436a6138d82185b7beaa4c236e5dca85 data/statues/recipe/loot/sheep_statue_green.json +3239fec634f306a34bc8bbf50c9b840e808e32c2 data/statues/recipe/loot/sheep_statue_light_blue.json +c307d99b5ef28953aef1fe877a767927ae36525f data/statues/recipe/loot/sheep_statue_light_gray.json +cb1a7e098ec5afcb79586b47f2b120642c6301c9 data/statues/recipe/loot/sheep_statue_lime.json +2500a7c97fd68f467c4f5846d570e362232fbfbc data/statues/recipe/loot/sheep_statue_magenta.json +b74ea1618833ecb823dbd12020fb45e3c8ffdcd0 data/statues/recipe/loot/sheep_statue_orange.json +887af237fd6fdba83d037d9316d443f533444573 data/statues/recipe/loot/sheep_statue_pink.json +21684909b50dd51702b557e5c43a07b207b32424 data/statues/recipe/loot/sheep_statue_purple.json +2999932a689667eb2f02c71f51ac8878d1897739 data/statues/recipe/loot/sheep_statue_red.json +b05e7ba1ad22ba7726135db1a79bc78926ef83e3 data/statues/recipe/loot/sheep_statue_white.json +98761b180fab296d83306d80dcfbfc41419304bb data/statues/recipe/loot/sheep_statue_yellow.json +314c542724b24cb5401e022d4fe3c032a8e7e3af data/statues/recipe/loot/shulker_statue.json +d677a2442d1a931914a6b1f075ee1a294656567d data/statues/recipe/loot/slime_statue.json +63ed528cef1e249b28ce203da0bc200459f29b32 data/statues/recipe/loot/snow_golem_statue.json +7d447cf573eca8997e39f5398dd0ee8310ac04ac data/statues/recipe/loot/spider_statue.json +a1c2f6b551b75f44738f7877a56dc0e7a46e18d0 data/statues/recipe/loot/squid_statue.json +bc6fc5771d412bcb376829771ad84f2ae7dd0e7c data/statues/recipe/loot/tropical_fish.json +f2d3456bcab887ae56ca89b3a49769b25fc1ba8d data/statues/recipe/loot/turtle_statue.json +9a075b2a399bd59a2fae490c5bf5069baad8d621 data/statues/recipe/loot/villager_statue.json +2e398dbc66a1a11631df2eec4911dcc039928efc data/statues/recipe/loot/vindicator_statue.json +8b27299ac922043db935f90c61b6f8e133184f13 data/statues/recipe/loot/warden_statue.json +f200b2f98e1229b26d0d57f0f0b47ee4380173b7 data/statues/recipe/loot/wasteland_statue.json +167b1481738cce9e05293d2c5889d39ec4d2c966 data/statues/recipe/loot/witch_statue.json +8cdd4433d82a1be3de1d44b2a92c115217a98814 data/statues/recipe/loot/zombie_statue.json +fa27eaabcd66330e5738b12f6abe5c60d0de4d14 data/statues/recipe/statue_core.json +14b4fa5d97f73b1c1020431d4d17ab23d826f06a data/statues/recipe/statue_table.json +229ea87ae5dc0b931f59a34bf3e48e9e1dcddae5 data/statues/recipe/upgrade/automation.json +548fe77f63db87c3b2c06f2737e3e3cbc18d6c1c data/statues/recipe/upgrade/despawner.json +55334c65a5cdd549fca73c7a317703c83f3576d9 data/statues/recipe/upgrade/glowing.json +f5e2b8022dc138dc207d93cc03e4ede86909b42d data/statues/recipe/upgrade/interaction.json +6f36cbf0b4293f7e040d468a3d64aad0fd827795 data/statues/recipe/upgrade/looting.json +2c6533d3d5d96dc95047e9d509ae01257cc08b60 data/statues/recipe/upgrade/mob_killer.json +a6d3bfccc50263a6916de22de7084af7db92e671 data/statues/recipe/upgrade/mob_killer_2.json +6bb065f29074066c7d42498b7456152400a90636 data/statues/recipe/upgrade/mob_killer_3.json +b29a630a6e2ef2feb52e5d16d2f0c0ef83dccb1b data/statues/recipe/upgrade/sound.json +d99894341ec65bb12a5a524c4e4a0466ff988e27 data/statues/recipe/upgrade/spawner.json +b3f5b4934a89b103e5b3e48089bf6f56066a74f1 data/statues/recipe/upgrade/speed.json +7d7871b2ed4cf626cdbf6f34a492036086353f76 data/statues/recipe/upgrade/statue_upgrade.json +d6cc51a83a7735e22a8749dcbc4394ceccc10aa0 data/statues/recipe/upgrade/unglowing.json diff --git a/src/generated/resources/.cache/8fa013ccbf10434e23abe63f04d41f64f8518015 b/src/generated/resources/.cache/8fa013ccbf10434e23abe63f04d41f64f8518015 index 72fd07e9..23a3f49b 100644 --- a/src/generated/resources/.cache/8fa013ccbf10434e23abe63f04d41f64f8518015 +++ b/src/generated/resources/.cache/8fa013ccbf10434e23abe63f04d41f64f8518015 @@ -1,4 +1,4 @@ -// 1.21.1 2024-08-13T22:16:45.8250573 Tags for minecraft:item mod id statues +// 1.21.4 2024-12-03T21:55:30.3417073 Tags for minecraft:item mod id statues 95e966c60ff996797cf399bd7d3288140ba8cc6e data/curios/tags/item/statue.json 5bcfc679cea4f2c5e4882599ec047623cfdfd711 data/minecraft/tags/item/decorated_pot_sherds.json a75022c454865d8cbe520ecf02bb8feeabf59d5b data/statues/tags/item/core.json diff --git a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e deleted file mode 100644 index c46e54cb..00000000 --- a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e +++ /dev/null @@ -1,92 +0,0 @@ -// 1.21.1 2024-11-13T15:30:30.5085386 Recipes -18e987dfadfe8b3a50e692cace2f8740225aa39b data/statues/advancement/recipes/decorations/display_stand_from_quartz_block_stonecutting.json -63a4b8f8cbc1656364761abc74c1b083424037a7 data/statues/advancement/recipes/misc/info_statue.json -19084d3ced99bf522cf7e8705ebdeb8ce8c04c44 data/statues/advancement/recipes/misc/statue_core.json -b6d4957c7a93a1c517d6db67df0e43acd4d3ae97 data/statues/advancement/recipes/misc/statue_table.json -28476bdec3c8db7610ad95ae0dc00022815cb9fd data/statues/recipe/display_stand_from_quartz_block_stonecutting.json -eda85b8b98a4c03bf20a14e00fbfdaec6e4629aa data/statues/recipe/info_statue.json -596ccc121dd47150261d1f23f31ba0fdf04f0e2a data/statues/recipe/loot/allay_statue.json -2d80270f95786c145566cbd66b6c041a97fe48b1 data/statues/recipe/loot/axolotl_blue_statue.json -3f789a971b1a0f63f61a1398f05599adf5613a3e data/statues/recipe/loot/axolotl_cyan_statue.json -7a22df7abb5df4ba8b94e10ccd0c8c44ea512935 data/statues/recipe/loot/axolotl_gold_statue.json -e6a1f1b0fb2d9cdf7db12895300a99e5192e79d8 data/statues/recipe/loot/axolotl_lucy_statue.json -f1dd1c71746766caa7092aee4e6fc8499697b8eb data/statues/recipe/loot/axolotl_wild_statue.json -64163bec44462e94ed39fee5f48c9305598eee0c data/statues/recipe/loot/baby_zombie_statue.json -4c3b612793863974383b095bc71debed1c060003 data/statues/recipe/loot/bee_statue.json -ce4ba4f00d1adcab3ee53a3fc0f85d93f11db198 data/statues/recipe/loot/blaze_statue.json -13c5e20b41d996de03f90c96867d6eda94e61046 data/statues/recipe/loot/brown_mooshroom_statue.json -9f3d228f76f73de6c35563d4e0e17d60fb2044a0 data/statues/recipe/loot/campfire_statue.json -af6447af925fa36144b8960b3c274c38a0814568 data/statues/recipe/loot/cat_statue.json -788767f6c6c58542347c546f625bc8ffccad34c6 data/statues/recipe/loot/chicken_jockey_statue.json -b248aae0dada7f6da91d5ca7dd614608d93cd14c data/statues/recipe/loot/chicken_statue.json -234e7b49ea59323e5da1d3a171121f12d26dce25 data/statues/recipe/loot/cod_statue.json -6910694f19fe1ce2c68a994a98380cfca0a91c07 data/statues/recipe/loot/cow_statue.json -2bbe4789dd9971868e8602b6826687a13e106e1b data/statues/recipe/loot/creeper_statue.json -f4917fec511a8484768965707b38f3e81c8d5fe9 data/statues/recipe/loot/dolphin_statue.json -2bfdf3bbe0c00426515e5058ca6905cad02289b0 data/statues/recipe/loot/drowned_statue.json -443a86811abf834c3a847f904c8abc121184c891 data/statues/recipe/loot/elder_guardian_statue.json -39178d2bd9625f261a0ac2f93563d1c3cbdd8aae data/statues/recipe/loot/enderman_statue.json -1e2301df621312ae65a02e6beab00030c3fe89e4 data/statues/recipe/loot/evoker_statue.json -7198d7f04e35b64bb57837a0c5ce9bfa1dbff381 data/statues/recipe/loot/flood_statue.json -646064cf9b18448bdb1594f7f2177923aa8ae0f2 data/statues/recipe/loot/fox_statue.json -32f989e701620f02d7b1f238335179f017c27904 data/statues/recipe/loot/frog_cold_statue.json -8e909111025f40851a0f28a01de1d027d33d02f0 data/statues/recipe/loot/frog_temperate_statue.json -96908ece4f06f2cfa00ebb181b3e255529f6d71f data/statues/recipe/loot/frog_warm_statue.json -b5fded4d4554431396547c4e4238d1855bfba3ca data/statues/recipe/loot/ghast_statue.json -88f5ab17114c4ad52f95e44dd8524e64b320970e data/statues/recipe/loot/guardian_statue.json -7c3aabb4682db01f8ea9a91d8e509534aa1ffc5f data/statues/recipe/loot/husk_statue.json -dd6fd204d77186bdfbc1fdd902a8cc16e7ba00f3 data/statues/recipe/loot/king_cluck_statue.json -67002e8087e8d42340233d5a3e3a5f0a78e16030 data/statues/recipe/loot/magma_statue.json -206df4f56a6360226e8d354daa3b7e1442ce002a data/statues/recipe/loot/mooshroom_statue.json -7a5d3f913c7eb00a2b6ee63afe94af4522966f52 data/statues/recipe/loot/panda_statue.json -7239a34533e14848c742f28cbb3ad3affc405f01 data/statues/recipe/loot/pig_statue.json -e66169d82848411ba9b8c4419fc6dde2c8092e0f data/statues/recipe/loot/pillager_statue.json -9c031fb19f4945d7cea0ae2844f7103535d65b61 data/statues/recipe/loot/pufferfish_statue.json -b8e3405d10a555f9acf8ab0c415658578e2b9421 data/statues/recipe/loot/rabbit_statue.json -fa20b46014d8e2267a5e3caa2468ee0d3bde0e32 data/statues/recipe/loot/ravager_statue.json -81d392cbbee1f6e653931886dbef37ba6b8d7f25 data/statues/recipe/loot/salmon_statue.json -f29b31f71982c0defb95561684dafd4c7bbf1f5e data/statues/recipe/loot/sheep_shaven_statue.json -260019be4b9e61cfa7578b65c28088f56601326c data/statues/recipe/loot/sheep_statue_black.json -53b18723c913d02a05e1c7c5f9147bc822d6537f data/statues/recipe/loot/sheep_statue_blue.json -184925362f6305fcbed79f9fe8d5638e0fc49fbe data/statues/recipe/loot/sheep_statue_brown.json -b6a902712027064d1191fc9444d5bf6c0bfae020 data/statues/recipe/loot/sheep_statue_cyan.json -dcc84e29c0b4336141cb1a1f5c84f0457cf48b22 data/statues/recipe/loot/sheep_statue_gray.json -9d13e289b9dda86866cd0899cad7aba042dc49d3 data/statues/recipe/loot/sheep_statue_green.json -7ca3de162b95a4c7594cad09b7544a96ef8ee768 data/statues/recipe/loot/sheep_statue_light_blue.json -95b3c1dfad925cd50fbf6100d015518fc822ffe9 data/statues/recipe/loot/sheep_statue_light_gray.json -f77a63ba295813397080bde5d4f0ce1509f79a16 data/statues/recipe/loot/sheep_statue_lime.json -600fe59bf2f6833106130983f7c54169981eb357 data/statues/recipe/loot/sheep_statue_magenta.json -ca3edb4d47fad448b0d4e83afcf5cbb8495c83b4 data/statues/recipe/loot/sheep_statue_orange.json -cd17e2ca8d7b3d6842856dcd8de109f328e24474 data/statues/recipe/loot/sheep_statue_pink.json -915e2fa0c747e4e03a3fa8ba7c0fd95d4262bc87 data/statues/recipe/loot/sheep_statue_purple.json -7ed5b14682eba0201b347907085ac26e509851b0 data/statues/recipe/loot/sheep_statue_red.json -8d7307db04e9f57e0a1308eb1605ee8be828f567 data/statues/recipe/loot/sheep_statue_white.json -ac749deae780650dd10dbcc670c19b7ef957892a data/statues/recipe/loot/sheep_statue_yellow.json -1ec5dfc83a22c0c0c23b7a3c7f620bef30d5c31c data/statues/recipe/loot/shulker_statue.json -47eae64c0b9098a496f8acb593bd9472376bcddb data/statues/recipe/loot/slime_statue.json -188af43241b64ca7bd5fab873e2972793d984ce7 data/statues/recipe/loot/snow_golem_statue.json -d179e075ca0d0b137947aee83a21dc4233c7567e data/statues/recipe/loot/spider_statue.json -646a222f3c6ed42f51d824de218951c79c65f95d data/statues/recipe/loot/squid_statue.json -7d95e8001a35253b8e9ea58b66aad4db3b3a075b data/statues/recipe/loot/tropical_fish.json -96f664030ff557f78a23772d45d8a60fcc93d6bf data/statues/recipe/loot/turtle_statue.json -b3691fcc239dcc433c3bce3bf0e83d32b639f592 data/statues/recipe/loot/villager_statue.json -430e7174e30ec9b429af9946fb692cf2d6b01dc0 data/statues/recipe/loot/vindicator_statue.json -42745857fa3ea1a4534c537e99fd0ef0fd12cf41 data/statues/recipe/loot/warden_statue.json -e0357230e5545194aee9baff834ebc8c95ce2559 data/statues/recipe/loot/wasteland_statue.json -c33e40a4b61e45d1ba87fd993ddd1240e3901657 data/statues/recipe/loot/witch_statue.json -71ccebe39409f6ae051c08ce5d021455557ab1aa data/statues/recipe/loot/zombie_statue.json -69012d905f60077d0633a49ca86e215021394387 data/statues/recipe/statue_core.json -deb570782bd819ac9122cf42d264821c06adf88d data/statues/recipe/statue_table.json -f818fd2f2a9d80f2336197c9a562735e70c46314 data/statues/recipe/upgrade/automation.json -f0bd7c049600dacb24b3a01563282241b2fd09de data/statues/recipe/upgrade/despawner.json -7d241d5bfba385cf630709c66608d002e2d72681 data/statues/recipe/upgrade/glowing.json -3d747c552ab24b0437b3aeb459fb8d23da3c8cca data/statues/recipe/upgrade/interaction.json -b616a2fe6788e5b100dff5402550ff59329e3214 data/statues/recipe/upgrade/looting.json -2715df4ee1bf327dac9963a667f2351dd1c0717a data/statues/recipe/upgrade/mob_killer.json -c51b630b3e025faa28a9c284bd5ba5aa913b6157 data/statues/recipe/upgrade/mob_killer_2.json -da908d72842b43a2f34ee4ad89c2b3077ea74cb0 data/statues/recipe/upgrade/mob_killer_3.json -54d09babd75673b1a2d7ff03ae3bdca207df4ab0 data/statues/recipe/upgrade/sound.json -79b18d5a10cf4010ef720739e9187a7dc5e645b1 data/statues/recipe/upgrade/spawner.json -9df9aebdfec2ccf0720efb83c821e71e5c892ea9 data/statues/recipe/upgrade/speed.json -b31ea62e8339a12e6dbb2923ee8617f8e14ebf41 data/statues/recipe/upgrade/statue_upgrade.json -ddd57d33039685637b335ef71b7aa3820c2476f1 data/statues/recipe/upgrade/unglowing.json diff --git a/src/generated/resources/.cache/cd090bff9ca93079474b6df48215a8307e531e73 b/src/generated/resources/.cache/cd090bff9ca93079474b6df48215a8307e531e73 deleted file mode 100644 index 247f2b28..00000000 --- a/src/generated/resources/.cache/cd090bff9ca93079474b6df48215a8307e531e73 +++ /dev/null @@ -1,6 +0,0 @@ -// 1.21.1 2024-08-18T17:51:47.8030212 Patchouli Book Provider -2ff8756e149e3f336ca43e0c0487508ed0e061c2 assets/statues/patchouli_books/statues/en_us/categories/info.json -7870ad52fde4a1931aca801d6ec869579e486b2e assets/statues/patchouli_books/statues/en_us/entries/info/core.json -2b716bcf78797c7b931565396355ee7e0543afd5 assets/statues/patchouli_books/statues/en_us/entries/info/statue_table.json -18595243ca397dcf57239dec3f98dc506810dc19 assets/statues/patchouli_books/statues/en_us/entries/info/upgrading.json -9c113c83091fa43a9dea1ce6403fc69002f057e9 data/statues/patchouli_books/statues/book.json diff --git a/src/generated/resources/.cache/d9ca59ae31ccf5a8a87a3f23307ff41b6ca77e97 b/src/generated/resources/.cache/d9ca59ae31ccf5a8a87a3f23307ff41b6ca77e97 index 9dde74d2..251dc9d8 100644 --- a/src/generated/resources/.cache/d9ca59ae31ccf5a8a87a3f23307ff41b6ca77e97 +++ b/src/generated/resources/.cache/d9ca59ae31ccf5a8a87a3f23307ff41b6ca77e97 @@ -1,4 +1,4 @@ -// 1.21.1 2024-08-11T14:53:50.3720326 Item Models: statues +// 1.21.4 2024-12-03T21:48:09.5045926 Item Models: statues 3bd1b5b2646515290e1ea7df0abf9798e194d549 assets/statues/models/item/allay_statue.json 7b1e7d4cd383ce69a71bdb343872386329321241 assets/statues/models/item/angry_bee_statue.json 9880572a3f4467e95bf0796f6d1ee27653ed0e92 assets/statues/models/item/axolotl_blue_statue.json diff --git a/src/generated/resources/.cache/e5c5eb35b4ba40351ecb7d9f04c3527f2f5779b0 b/src/generated/resources/.cache/e5c5eb35b4ba40351ecb7d9f04c3527f2f5779b0 index 0fe4116e..97be2c9f 100644 --- a/src/generated/resources/.cache/e5c5eb35b4ba40351ecb7d9f04c3527f2f5779b0 +++ b/src/generated/resources/.cache/e5c5eb35b4ba40351ecb7d9f04c3527f2f5779b0 @@ -1,4 +1,4 @@ -// 1.21.1 2024-08-11T14:53:50.3840325 Advancements +// 1.21.4 2024-12-03T21:55:30.3467229 Advancements b4ee7ee90d7f4b339c235ce6c5418cadf7f6eed1 data/statues/advancement/allay_statue.json 8689c4dcd413ee7e570d33de280523959456de42 data/statues/advancement/angry_bee_statue.json ea8a172cf2f6aeb1ea84d50050a59dc8591861d2 data/statues/advancement/axolotl_all_statue.json diff --git a/src/generated/resources/.cache/f83529e499d02003904562a2f999b81582975f80 b/src/generated/resources/.cache/f83529e499d02003904562a2f999b81582975f80 index 076d5839..aa222f98 100644 --- a/src/generated/resources/.cache/f83529e499d02003904562a2f999b81582975f80 +++ b/src/generated/resources/.cache/f83529e499d02003904562a2f999b81582975f80 @@ -1,4 +1,4 @@ -// 1.21.1 2024-08-11T14:53:50.3780333 Global Loot Modifiers : statues +// 1.21.4 2024-12-03T21:55:30.3427082 Global Loot Modifiers : statues 4596c5675c6b92e0b9088a2c5d72159138ef379a data/neoforge/loot_modifiers/global_loot_modifiers.json c22c7483673fe436fa45b6243a14419f2e3c5d8a data/statues/loot_modifiers/statues_core_flower.json 9fee9c7f7a191414a67bbfaa11e7d6a7521b13f0 data/statues/loot_modifiers/statues_loot.json diff --git a/src/generated/resources/assets/statues/lang/en_us.json b/src/generated/resources/assets/statues/lang/en_us.json index 3f7a7794..d8d42ac4 100644 --- a/src/generated/resources/assets/statues/lang/en_us.json +++ b/src/generated/resources/assets/statues/lang/en_us.json @@ -163,6 +163,7 @@ "block.statues.cod_statue": "Cod Statue", "block.statues.core_flower": "Core Flower", "block.statues.core_flower_crop": "Core Flower", + "block.statues.core_flower_seed": "Core Flower Seed", "block.statues.cow_statue": "Cow Statue", "block.statues.creeper_statue": "Creeper Statue", "block.statues.detective_platypus_statue": "Detective Platypus Statue", @@ -290,7 +291,6 @@ "info.statues.book.upgrading.text6": "$(l)Mob Killer$() - Kills the mob if it gets nearby (1 = Regular drops, 2 = Player drops, 3 = Player drops + XP)$(br)$(l)Looting$() - Allows the statue to generate loot$(br)$(l)Automation$() - Allows exporting of loot$(br)$(l)Speed$() - Speeds up the interaction/spawning timer", "info.statues.book.upgrading.text7": "$(l)Interaction$() - Allows special interactions$(br)$(l)Sound$() - Allows the statue to make sound when right-clicked or powered", "item.statues.core_armor_trim_smithing_template": "Core Armor Trim Smithing Template", - "item.statues.core_flower_seed": "Core Flower Seed", "item.statues.cup": "Edible Cup", "item.statues.marshmallow": "Marshmallow", "item.statues.marshmallow_charred": "Charred Marshmallow", diff --git a/src/generated/resources/assets/statues/patchouli_books/statues/en_us/categories/info.json b/src/generated/resources/assets/statues/patchouli_books/statues/en_us/categories/info.json deleted file mode 100644 index 5605dd8d..00000000 --- a/src/generated/resources/assets/statues/patchouli_books/statues/en_us/categories/info.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "description": "info.statues.book.info.desc", - "icon": "statues:info_statue", - "name": "info.statues.book.info.name" -} \ No newline at end of file diff --git a/src/generated/resources/assets/statues/patchouli_books/statues/en_us/entries/info/core.json b/src/generated/resources/assets/statues/patchouli_books/statues/en_us/entries/info/core.json deleted file mode 100644 index 8115a7d5..00000000 --- a/src/generated/resources/assets/statues/patchouli_books/statues/en_us/entries/info/core.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "category": "statues:info", - "icon": "statues:statue_core", - "name": "info.statues.book.core.entry.name", - "pages": [ - { - "type": "patchouli:text", - "text": "info.statues.book.core.text1" - }, - { - "type": "patchouli:entity", - "entity": "statues:statue_bat" - }, - { - "type": "patchouli:spotlight", - "item": "statues:statue_core" - } - ] -} \ No newline at end of file diff --git a/src/generated/resources/assets/statues/patchouli_books/statues/en_us/entries/info/statue_table.json b/src/generated/resources/assets/statues/patchouli_books/statues/en_us/entries/info/statue_table.json deleted file mode 100644 index 9327034c..00000000 --- a/src/generated/resources/assets/statues/patchouli_books/statues/en_us/entries/info/statue_table.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "category": "statues:info", - "icon": "statues:statue_table", - "name": "info.statues.book.statue_table.entry.name", - "pages": [ - { - "type": "patchouli:text", - "text": "info.statues.book.statue_table.text1" - }, - { - "type": "patchouli:spotlight", - "item": "statues:statue_table" - } - ] -} \ No newline at end of file diff --git a/src/generated/resources/assets/statues/patchouli_books/statues/en_us/entries/info/upgrading.json b/src/generated/resources/assets/statues/patchouli_books/statues/en_us/entries/info/upgrading.json deleted file mode 100644 index 0181271b..00000000 --- a/src/generated/resources/assets/statues/patchouli_books/statues/en_us/entries/info/upgrading.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "category": "statues:info", - "icon": "statues:slime_statue", - "name": "info.statues.book.upgrading.entry.name", - "pages": [ - { - "type": "patchouli:text", - "text": "info.statues.book.upgrading.text1" - }, - { - "type": "patchouli:text", - "text": "info.statues.book.upgrading.text2" - }, - { - "type": "patchouli:text", - "text": "info.statues.book.upgrading.text3" - }, - { - "type": "patchouli:text", - "text": "info.statues.book.upgrading.text4" - }, - { - "type": "patchouli:text", - "text": "info.statues.book.upgrading.text5" - }, - { - "type": "patchouli:text", - "text": "info.statues.book.upgrading.text6" - }, - { - "type": "patchouli:text", - "text": "info.statues.book.upgrading.text7" - } - ] -} \ No newline at end of file diff --git a/src/generated/resources/data/statues/patchouli_books/statues/book.json b/src/generated/resources/data/statues/patchouli_books/statues/book.json deleted file mode 100644 index ddb2a4be..00000000 --- a/src/generated/resources/data/statues/patchouli_books/statues/book.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "book_texture": "patchouli:textures/gui/book_gray.png", - "creative_tab": "statues.items", - "i18n": true, - "landing_text": "info.statues.book.landing", - "macros": { - "$(item)": "$(#c47567)" - }, - "model": "patchouli:book_gray", - "name": "info.statues.book.name", - "show_progress": false, - "subtitle": "info.statues.book.subtitle", - "use_blocky_font": true, - "use_resource_pack": true -} \ No newline at end of file diff --git a/src/generated/resources/data/statues/recipe/display_stand_from_quartz_block_stonecutting.json b/src/generated/resources/data/statues/recipe/display_stand_from_quartz_block_stonecutting.json index f28a3c74..b45c069e 100644 --- a/src/generated/resources/data/statues/recipe/display_stand_from_quartz_block_stonecutting.json +++ b/src/generated/resources/data/statues/recipe/display_stand_from_quartz_block_stonecutting.json @@ -1,8 +1,6 @@ { "type": "minecraft:stonecutting", - "ingredient": { - "item": "minecraft:quartz_block" - }, + "ingredient": "minecraft:quartz_block", "result": { "count": 2, "id": "statues:display_stand" diff --git a/src/generated/resources/data/statues/recipe/info_statue.json b/src/generated/resources/data/statues/recipe/info_statue.json index 79679947..79e6fd60 100644 --- a/src/generated/resources/data/statues/recipe/info_statue.json +++ b/src/generated/resources/data/statues/recipe/info_statue.json @@ -2,15 +2,9 @@ "type": "minecraft:crafting_shaped", "category": "misc", "key": { - "B": { - "item": "minecraft:book" - }, - "C": { - "tag": "c:cobblestones" - }, - "R": { - "tag": "c:dyes/red" - } + "B": "minecraft:book", + "C": "#c:cobblestones", + "R": "#c:dyes/red" }, "pattern": [ " R ", diff --git a/src/generated/resources/data/statues/recipe/loot/allay_statue.json b/src/generated/resources/data/statues/recipe/loot/allay_statue.json index dbfee0e1..e04e7e06 100644 --- a/src/generated/resources/data/statues/recipe/loot/allay_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/allay_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:allay_statue" - }, + "ingredient": "statues:allay_statue", "result": { "count": 1, "id": "minecraft:light_blue_dye" diff --git a/src/generated/resources/data/statues/recipe/loot/axolotl_blue_statue.json b/src/generated/resources/data/statues/recipe/loot/axolotl_blue_statue.json index 7dd29fd2..bf7c1ff2 100644 --- a/src/generated/resources/data/statues/recipe/loot/axolotl_blue_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/axolotl_blue_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:axolotl_blue_statue" - }, + "ingredient": "statues:axolotl_blue_statue", "result": { "count": 1, "id": "minecraft:tropical_fish" diff --git a/src/generated/resources/data/statues/recipe/loot/axolotl_cyan_statue.json b/src/generated/resources/data/statues/recipe/loot/axolotl_cyan_statue.json index 57aa7615..171b3c86 100644 --- a/src/generated/resources/data/statues/recipe/loot/axolotl_cyan_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/axolotl_cyan_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:axolotl_cyan_statue" - }, + "ingredient": "statues:axolotl_cyan_statue", "result": { "count": 1, "id": "minecraft:tropical_fish" diff --git a/src/generated/resources/data/statues/recipe/loot/axolotl_gold_statue.json b/src/generated/resources/data/statues/recipe/loot/axolotl_gold_statue.json index d683c138..6928152b 100644 --- a/src/generated/resources/data/statues/recipe/loot/axolotl_gold_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/axolotl_gold_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:axolotl_gold_statue" - }, + "ingredient": "statues:axolotl_gold_statue", "result": { "count": 1, "id": "minecraft:tropical_fish" diff --git a/src/generated/resources/data/statues/recipe/loot/axolotl_lucy_statue.json b/src/generated/resources/data/statues/recipe/loot/axolotl_lucy_statue.json index c84caa85..12263979 100644 --- a/src/generated/resources/data/statues/recipe/loot/axolotl_lucy_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/axolotl_lucy_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:axolotl_lucy_statue" - }, + "ingredient": "statues:axolotl_lucy_statue", "result": { "count": 1, "id": "minecraft:tropical_fish" diff --git a/src/generated/resources/data/statues/recipe/loot/axolotl_wild_statue.json b/src/generated/resources/data/statues/recipe/loot/axolotl_wild_statue.json index 1511d06b..4ec7cfee 100644 --- a/src/generated/resources/data/statues/recipe/loot/axolotl_wild_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/axolotl_wild_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:axolotl_wild_statue" - }, + "ingredient": "statues:axolotl_wild_statue", "result": { "count": 1, "id": "minecraft:tropical_fish" diff --git a/src/generated/resources/data/statues/recipe/loot/baby_zombie_statue.json b/src/generated/resources/data/statues/recipe/loot/baby_zombie_statue.json index 5db126ed..6fb6901d 100644 --- a/src/generated/resources/data/statues/recipe/loot/baby_zombie_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/baby_zombie_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:baby_zombie_statue" - }, + "ingredient": "statues:baby_zombie_statue", "result": { "count": 1, "id": "minecraft:rotten_flesh" diff --git a/src/generated/resources/data/statues/recipe/loot/bee_statue.json b/src/generated/resources/data/statues/recipe/loot/bee_statue.json index 54a967ff..c20b7726 100644 --- a/src/generated/resources/data/statues/recipe/loot/bee_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/bee_statue.json @@ -1,15 +1,9 @@ { "type": "statues:loot", "ingredient": [ - { - "item": "statues:bee_statue" - }, - { - "item": "statues:angry_bee_statue" - }, - { - "item": "statues:trans_bee_statue" - } + "statues:bee_statue", + "statues:angry_bee_statue", + "statues:trans_bee_statue" ], "result2": { "count": 1, diff --git a/src/generated/resources/data/statues/recipe/loot/blaze_statue.json b/src/generated/resources/data/statues/recipe/loot/blaze_statue.json index 7598011c..115ce9dc 100644 --- a/src/generated/resources/data/statues/recipe/loot/blaze_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/blaze_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:blaze_statue" - }, + "ingredient": "statues:blaze_statue", "result": { "count": 1, "id": "minecraft:blaze_powder" diff --git a/src/generated/resources/data/statues/recipe/loot/brown_mooshroom_statue.json b/src/generated/resources/data/statues/recipe/loot/brown_mooshroom_statue.json index a34ac0be..ddae63c0 100644 --- a/src/generated/resources/data/statues/recipe/loot/brown_mooshroom_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/brown_mooshroom_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:brown_mooshroom_statue" - }, + "ingredient": "statues:brown_mooshroom_statue", "result": { "count": 1, "id": "minecraft:beef" diff --git a/src/generated/resources/data/statues/recipe/loot/campfire_statue.json b/src/generated/resources/data/statues/recipe/loot/campfire_statue.json index 793a8542..14d54c6d 100644 --- a/src/generated/resources/data/statues/recipe/loot/campfire_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/campfire_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:campfire_statue" - }, + "ingredient": "statues:campfire_statue", "result": { "count": 1, "id": "statues:marshmallow" diff --git a/src/generated/resources/data/statues/recipe/loot/cat_statue.json b/src/generated/resources/data/statues/recipe/loot/cat_statue.json index cbd3fd93..db9afe28 100644 --- a/src/generated/resources/data/statues/recipe/loot/cat_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/cat_statue.json @@ -1,39 +1,17 @@ { "type": "statues:loot", "ingredient": [ - { - "item": "statues:cat_black_statue" - }, - { - "item": "statues:cat_british_shorthair_statue" - }, - { - "item": "statues:cat_calico_statue" - }, - { - "item": "statues:cat_jellie_statue" - }, - { - "item": "statues:cat_persian_statue" - }, - { - "item": "statues:cat_ragdoll_statue" - }, - { - "item": "statues:cat_red_statue" - }, - { - "item": "statues:cat_siamese_statue" - }, - { - "item": "statues:cat_tabby_statue" - }, - { - "item": "statues:cat_tuxedo_statue" - }, - { - "item": "statues:cat_white_statue" - } + "statues:cat_black_statue", + "statues:cat_british_shorthair_statue", + "statues:cat_calico_statue", + "statues:cat_jellie_statue", + "statues:cat_persian_statue", + "statues:cat_ragdoll_statue", + "statues:cat_red_statue", + "statues:cat_siamese_statue", + "statues:cat_tabby_statue", + "statues:cat_tuxedo_statue", + "statues:cat_white_statue" ], "result": { "count": 1, diff --git a/src/generated/resources/data/statues/recipe/loot/chicken_jockey_statue.json b/src/generated/resources/data/statues/recipe/loot/chicken_jockey_statue.json index d3463f51..3a133955 100644 --- a/src/generated/resources/data/statues/recipe/loot/chicken_jockey_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/chicken_jockey_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:chicken_jockey_statue" - }, + "ingredient": "statues:chicken_jockey_statue", "result": { "count": 1, "id": "minecraft:rotten_flesh" diff --git a/src/generated/resources/data/statues/recipe/loot/chicken_statue.json b/src/generated/resources/data/statues/recipe/loot/chicken_statue.json index 1b104447..8b569df5 100644 --- a/src/generated/resources/data/statues/recipe/loot/chicken_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/chicken_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:chicken_statue" - }, + "ingredient": "statues:chicken_statue", "result": { "count": 1, "id": "minecraft:feather" diff --git a/src/generated/resources/data/statues/recipe/loot/cod_statue.json b/src/generated/resources/data/statues/recipe/loot/cod_statue.json index 242b5a4f..77f93003 100644 --- a/src/generated/resources/data/statues/recipe/loot/cod_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/cod_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:cod_statue" - }, + "ingredient": "statues:cod_statue", "result": { "count": 1, "id": "minecraft:cod" diff --git a/src/generated/resources/data/statues/recipe/loot/cow_statue.json b/src/generated/resources/data/statues/recipe/loot/cow_statue.json index 06d796bd..784aa52a 100644 --- a/src/generated/resources/data/statues/recipe/loot/cow_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/cow_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:cow_statue" - }, + "ingredient": "statues:cow_statue", "result": { "count": 1, "id": "minecraft:beef" diff --git a/src/generated/resources/data/statues/recipe/loot/creeper_statue.json b/src/generated/resources/data/statues/recipe/loot/creeper_statue.json index 5d655523..d9f58950 100644 --- a/src/generated/resources/data/statues/recipe/loot/creeper_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/creeper_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:creeper_statue" - }, + "ingredient": "statues:creeper_statue", "result": { "count": 1, "id": "minecraft:gunpowder" diff --git a/src/generated/resources/data/statues/recipe/loot/dolphin_statue.json b/src/generated/resources/data/statues/recipe/loot/dolphin_statue.json index 09487499..efd8a6e1 100644 --- a/src/generated/resources/data/statues/recipe/loot/dolphin_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/dolphin_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:dolphin_statue" - }, + "ingredient": "statues:dolphin_statue", "result": { "count": 1, "id": "minecraft:cod" diff --git a/src/generated/resources/data/statues/recipe/loot/drowned_statue.json b/src/generated/resources/data/statues/recipe/loot/drowned_statue.json index 7a588a10..6d09ec0e 100644 --- a/src/generated/resources/data/statues/recipe/loot/drowned_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/drowned_statue.json @@ -1,9 +1,7 @@ { "type": "statues:loot", "group": "zombie", - "ingredient": { - "item": "statues:drowned_statue" - }, + "ingredient": "statues:drowned_statue", "result": { "count": 1, "id": "minecraft:rotten_flesh" diff --git a/src/generated/resources/data/statues/recipe/loot/elder_guardian_statue.json b/src/generated/resources/data/statues/recipe/loot/elder_guardian_statue.json index 257bfdb5..06ae8a42 100644 --- a/src/generated/resources/data/statues/recipe/loot/elder_guardian_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/elder_guardian_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:elder_guardian_statue" - }, + "ingredient": "statues:elder_guardian_statue", "result": { "count": 1, "id": "minecraft:prismarine_crystals" diff --git a/src/generated/resources/data/statues/recipe/loot/enderman_statue.json b/src/generated/resources/data/statues/recipe/loot/enderman_statue.json index aff8ecb6..b8185d06 100644 --- a/src/generated/resources/data/statues/recipe/loot/enderman_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/enderman_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:enderman_statue" - }, + "ingredient": "statues:enderman_statue", "result": { "count": 16, "id": "statues:pebble" diff --git a/src/generated/resources/data/statues/recipe/loot/evoker_statue.json b/src/generated/resources/data/statues/recipe/loot/evoker_statue.json index 0bf3ca58..0c4f440a 100644 --- a/src/generated/resources/data/statues/recipe/loot/evoker_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/evoker_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:evoker_statue" - }, + "ingredient": "statues:evoker_statue", "result3": { "count": 1, "id": "minecraft:totem_of_undying" diff --git a/src/generated/resources/data/statues/recipe/loot/flood_statue.json b/src/generated/resources/data/statues/recipe/loot/flood_statue.json index 8fd20635..462bcdc2 100644 --- a/src/generated/resources/data/statues/recipe/loot/flood_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/flood_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:flood_statue" - }, + "ingredient": "statues:flood_statue", "result": { "count": 1, "id": "minecraft:firework_rocket" diff --git a/src/generated/resources/data/statues/recipe/loot/fox_statue.json b/src/generated/resources/data/statues/recipe/loot/fox_statue.json index d54de995..2d5a3218 100644 --- a/src/generated/resources/data/statues/recipe/loot/fox_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/fox_statue.json @@ -1,12 +1,8 @@ { "type": "statues:loot", "ingredient": [ - { - "item": "statues:fox_statue" - }, - { - "item": "statues:fox_snow_statue" - } + "statues:fox_statue", + "statues:fox_snow_statue" ], "result": { "count": 1, diff --git a/src/generated/resources/data/statues/recipe/loot/frog_cold_statue.json b/src/generated/resources/data/statues/recipe/loot/frog_cold_statue.json index 6d4885a1..a7eb815d 100644 --- a/src/generated/resources/data/statues/recipe/loot/frog_cold_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/frog_cold_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:frog_cold_statue" - }, + "ingredient": "statues:frog_cold_statue", "result": { "count": 1, "id": "minecraft:slime_ball" diff --git a/src/generated/resources/data/statues/recipe/loot/frog_temperate_statue.json b/src/generated/resources/data/statues/recipe/loot/frog_temperate_statue.json index 9e72c834..d272da91 100644 --- a/src/generated/resources/data/statues/recipe/loot/frog_temperate_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/frog_temperate_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:frog_temperate_statue" - }, + "ingredient": "statues:frog_temperate_statue", "result": { "count": 1, "id": "minecraft:slime_ball" diff --git a/src/generated/resources/data/statues/recipe/loot/frog_warm_statue.json b/src/generated/resources/data/statues/recipe/loot/frog_warm_statue.json index 514b44c0..3d58b768 100644 --- a/src/generated/resources/data/statues/recipe/loot/frog_warm_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/frog_warm_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:frog_warm_statue" - }, + "ingredient": "statues:frog_warm_statue", "result": { "count": 1, "id": "minecraft:slime_ball" diff --git a/src/generated/resources/data/statues/recipe/loot/ghast_statue.json b/src/generated/resources/data/statues/recipe/loot/ghast_statue.json index 3e6de004..f8b0956c 100644 --- a/src/generated/resources/data/statues/recipe/loot/ghast_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/ghast_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:ghast_statue" - }, + "ingredient": "statues:ghast_statue", "result": { "count": 1, "id": "minecraft:gunpowder" diff --git a/src/generated/resources/data/statues/recipe/loot/guardian_statue.json b/src/generated/resources/data/statues/recipe/loot/guardian_statue.json index fd27372d..a0762d96 100644 --- a/src/generated/resources/data/statues/recipe/loot/guardian_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/guardian_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:guardian_statue" - }, + "ingredient": "statues:guardian_statue", "result": { "count": 1, "id": "minecraft:cod" diff --git a/src/generated/resources/data/statues/recipe/loot/husk_statue.json b/src/generated/resources/data/statues/recipe/loot/husk_statue.json index bf492c6c..04ef9992 100644 --- a/src/generated/resources/data/statues/recipe/loot/husk_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/husk_statue.json @@ -1,9 +1,7 @@ { "type": "statues:loot", "group": "zombie", - "ingredient": { - "item": "statues:husk_statue" - }, + "ingredient": "statues:husk_statue", "result": { "count": 1, "id": "minecraft:rotten_flesh" diff --git a/src/generated/resources/data/statues/recipe/loot/king_cluck_statue.json b/src/generated/resources/data/statues/recipe/loot/king_cluck_statue.json index f48819e8..dd2f1be8 100644 --- a/src/generated/resources/data/statues/recipe/loot/king_cluck_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/king_cluck_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:king_cluck_statue" - }, + "ingredient": "statues:king_cluck_statue", "result": { "count": 1, "id": "statues:royal_nugget" diff --git a/src/generated/resources/data/statues/recipe/loot/magma_statue.json b/src/generated/resources/data/statues/recipe/loot/magma_statue.json index 865d886f..302a0b7d 100644 --- a/src/generated/resources/data/statues/recipe/loot/magma_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/magma_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:magma_statue" - }, + "ingredient": "statues:magma_statue", "result": { "count": 1, "id": "minecraft:magma_cream" diff --git a/src/generated/resources/data/statues/recipe/loot/mooshroom_statue.json b/src/generated/resources/data/statues/recipe/loot/mooshroom_statue.json index be43b2a5..1a006b24 100644 --- a/src/generated/resources/data/statues/recipe/loot/mooshroom_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/mooshroom_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:mooshroom_statue" - }, + "ingredient": "statues:mooshroom_statue", "result": { "count": 1, "id": "minecraft:beef" diff --git a/src/generated/resources/data/statues/recipe/loot/panda_statue.json b/src/generated/resources/data/statues/recipe/loot/panda_statue.json index 79a1a8e1..54d3b0d3 100644 --- a/src/generated/resources/data/statues/recipe/loot/panda_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/panda_statue.json @@ -1,27 +1,13 @@ { "type": "statues:loot", "ingredient": [ - { - "item": "statues:panda_angry_statue" - }, - { - "item": "statues:panda_brown_statue" - }, - { - "item": "statues:panda_lazy_statue" - }, - { - "item": "statues:panda_normal_statue" - }, - { - "item": "statues:panda_playful_statue" - }, - { - "item": "statues:panda_weak_statue" - }, - { - "item": "statues:panda_worried_statue" - } + "statues:panda_angry_statue", + "statues:panda_brown_statue", + "statues:panda_lazy_statue", + "statues:panda_normal_statue", + "statues:panda_playful_statue", + "statues:panda_weak_statue", + "statues:panda_worried_statue" ], "result": { "count": 1, diff --git a/src/generated/resources/data/statues/recipe/loot/pig_statue.json b/src/generated/resources/data/statues/recipe/loot/pig_statue.json index e0f4fb1b..4447fa3b 100644 --- a/src/generated/resources/data/statues/recipe/loot/pig_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/pig_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:pig_statue" - }, + "ingredient": "statues:pig_statue", "result3": { "count": 1, "id": "minecraft:porkchop" diff --git a/src/generated/resources/data/statues/recipe/loot/pillager_statue.json b/src/generated/resources/data/statues/recipe/loot/pillager_statue.json index ff59d9cf..f54922d5 100644 --- a/src/generated/resources/data/statues/recipe/loot/pillager_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/pillager_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:pillager_statue" - }, + "ingredient": "statues:pillager_statue", "result": { "count": 1, "id": "minecraft:arrow" diff --git a/src/generated/resources/data/statues/recipe/loot/pufferfish_statue.json b/src/generated/resources/data/statues/recipe/loot/pufferfish_statue.json index 615bacf0..8bd27d77 100644 --- a/src/generated/resources/data/statues/recipe/loot/pufferfish_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/pufferfish_statue.json @@ -1,15 +1,9 @@ { "type": "statues:loot", "ingredient": [ - { - "item": "statues:pufferfish_statue" - }, - { - "item": "statues:pufferfish_medium_statue" - }, - { - "item": "statues:pufferfish_small_statue" - } + "statues:pufferfish_statue", + "statues:pufferfish_medium_statue", + "statues:pufferfish_small_statue" ], "result2": { "count": 1, diff --git a/src/generated/resources/data/statues/recipe/loot/rabbit_statue.json b/src/generated/resources/data/statues/recipe/loot/rabbit_statue.json index 4b1dd236..f8222ffd 100644 --- a/src/generated/resources/data/statues/recipe/loot/rabbit_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/rabbit_statue.json @@ -1,24 +1,12 @@ { "type": "statues:loot", "ingredient": [ - { - "item": "statues:rabbit_br_statue" - }, - { - "item": "statues:rabbit_bs_statue" - }, - { - "item": "statues:rabbit_bw_statue" - }, - { - "item": "statues:rabbit_go_statue" - }, - { - "item": "statues:rabbit_wh_statue" - }, - { - "item": "statues:rabbit_ws_statue" - } + "statues:rabbit_br_statue", + "statues:rabbit_bs_statue", + "statues:rabbit_bw_statue", + "statues:rabbit_go_statue", + "statues:rabbit_wh_statue", + "statues:rabbit_ws_statue" ], "result": { "count": 1, diff --git a/src/generated/resources/data/statues/recipe/loot/ravager_statue.json b/src/generated/resources/data/statues/recipe/loot/ravager_statue.json index bc62882b..7ff84ebd 100644 --- a/src/generated/resources/data/statues/recipe/loot/ravager_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/ravager_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:ravager_statue" - }, + "ingredient": "statues:ravager_statue", "result3": { "count": 1, "id": "minecraft:saddle" diff --git a/src/generated/resources/data/statues/recipe/loot/salmon_statue.json b/src/generated/resources/data/statues/recipe/loot/salmon_statue.json index f5f1ecc3..de8f5ce9 100644 --- a/src/generated/resources/data/statues/recipe/loot/salmon_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/salmon_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:salmon_statue" - }, + "ingredient": "statues:salmon_statue", "result": { "count": 1, "id": "minecraft:salmon" diff --git a/src/generated/resources/data/statues/recipe/loot/sheep_shaven_statue.json b/src/generated/resources/data/statues/recipe/loot/sheep_shaven_statue.json index 25516848..ab10adac 100644 --- a/src/generated/resources/data/statues/recipe/loot/sheep_shaven_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/sheep_shaven_statue.json @@ -1,9 +1,7 @@ { "type": "statues:loot", "group": "sheep", - "ingredient": { - "item": "statues:sheep_shaven_statue" - }, + "ingredient": "statues:sheep_shaven_statue", "result3": { "count": 1, "id": "minecraft:mutton" diff --git a/src/generated/resources/data/statues/recipe/loot/sheep_statue_black.json b/src/generated/resources/data/statues/recipe/loot/sheep_statue_black.json index 5e006229..279e4161 100644 --- a/src/generated/resources/data/statues/recipe/loot/sheep_statue_black.json +++ b/src/generated/resources/data/statues/recipe/loot/sheep_statue_black.json @@ -1,9 +1,7 @@ { "type": "statues:loot", "group": "sheep", - "ingredient": { - "item": "statues:sheep_statue_black" - }, + "ingredient": "statues:sheep_statue_black", "result": { "count": 1, "id": "minecraft:black_wool" diff --git a/src/generated/resources/data/statues/recipe/loot/sheep_statue_blue.json b/src/generated/resources/data/statues/recipe/loot/sheep_statue_blue.json index 42766e6f..41154bde 100644 --- a/src/generated/resources/data/statues/recipe/loot/sheep_statue_blue.json +++ b/src/generated/resources/data/statues/recipe/loot/sheep_statue_blue.json @@ -1,9 +1,7 @@ { "type": "statues:loot", "group": "sheep", - "ingredient": { - "item": "statues:sheep_statue_blue" - }, + "ingredient": "statues:sheep_statue_blue", "result": { "count": 1, "id": "minecraft:blue_wool" diff --git a/src/generated/resources/data/statues/recipe/loot/sheep_statue_brown.json b/src/generated/resources/data/statues/recipe/loot/sheep_statue_brown.json index 1a29ce10..cb245995 100644 --- a/src/generated/resources/data/statues/recipe/loot/sheep_statue_brown.json +++ b/src/generated/resources/data/statues/recipe/loot/sheep_statue_brown.json @@ -1,9 +1,7 @@ { "type": "statues:loot", "group": "sheep", - "ingredient": { - "item": "statues:sheep_statue_brown" - }, + "ingredient": "statues:sheep_statue_brown", "result": { "count": 1, "id": "minecraft:brown_wool" diff --git a/src/generated/resources/data/statues/recipe/loot/sheep_statue_cyan.json b/src/generated/resources/data/statues/recipe/loot/sheep_statue_cyan.json index 77ec9c16..25e71cff 100644 --- a/src/generated/resources/data/statues/recipe/loot/sheep_statue_cyan.json +++ b/src/generated/resources/data/statues/recipe/loot/sheep_statue_cyan.json @@ -1,9 +1,7 @@ { "type": "statues:loot", "group": "sheep", - "ingredient": { - "item": "statues:sheep_statue_cyan" - }, + "ingredient": "statues:sheep_statue_cyan", "result": { "count": 1, "id": "minecraft:cyan_wool" diff --git a/src/generated/resources/data/statues/recipe/loot/sheep_statue_gray.json b/src/generated/resources/data/statues/recipe/loot/sheep_statue_gray.json index a0f5222b..2c2d8044 100644 --- a/src/generated/resources/data/statues/recipe/loot/sheep_statue_gray.json +++ b/src/generated/resources/data/statues/recipe/loot/sheep_statue_gray.json @@ -1,9 +1,7 @@ { "type": "statues:loot", "group": "sheep", - "ingredient": { - "item": "statues:sheep_statue_gray" - }, + "ingredient": "statues:sheep_statue_gray", "result": { "count": 1, "id": "minecraft:gray_wool" diff --git a/src/generated/resources/data/statues/recipe/loot/sheep_statue_green.json b/src/generated/resources/data/statues/recipe/loot/sheep_statue_green.json index 4673e604..02b9a909 100644 --- a/src/generated/resources/data/statues/recipe/loot/sheep_statue_green.json +++ b/src/generated/resources/data/statues/recipe/loot/sheep_statue_green.json @@ -1,9 +1,7 @@ { "type": "statues:loot", "group": "sheep", - "ingredient": { - "item": "statues:sheep_statue_green" - }, + "ingredient": "statues:sheep_statue_green", "result": { "count": 1, "id": "minecraft:green_wool" diff --git a/src/generated/resources/data/statues/recipe/loot/sheep_statue_light_blue.json b/src/generated/resources/data/statues/recipe/loot/sheep_statue_light_blue.json index 0a732546..395eeafa 100644 --- a/src/generated/resources/data/statues/recipe/loot/sheep_statue_light_blue.json +++ b/src/generated/resources/data/statues/recipe/loot/sheep_statue_light_blue.json @@ -1,9 +1,7 @@ { "type": "statues:loot", "group": "sheep", - "ingredient": { - "item": "statues:sheep_statue_light_blue" - }, + "ingredient": "statues:sheep_statue_light_blue", "result": { "count": 1, "id": "minecraft:light_blue_wool" diff --git a/src/generated/resources/data/statues/recipe/loot/sheep_statue_light_gray.json b/src/generated/resources/data/statues/recipe/loot/sheep_statue_light_gray.json index 685f39cd..d4a61602 100644 --- a/src/generated/resources/data/statues/recipe/loot/sheep_statue_light_gray.json +++ b/src/generated/resources/data/statues/recipe/loot/sheep_statue_light_gray.json @@ -1,9 +1,7 @@ { "type": "statues:loot", "group": "sheep", - "ingredient": { - "item": "statues:sheep_statue_light_gray" - }, + "ingredient": "statues:sheep_statue_light_gray", "result": { "count": 1, "id": "minecraft:light_gray_wool" diff --git a/src/generated/resources/data/statues/recipe/loot/sheep_statue_lime.json b/src/generated/resources/data/statues/recipe/loot/sheep_statue_lime.json index e3a95c08..2b28fbe6 100644 --- a/src/generated/resources/data/statues/recipe/loot/sheep_statue_lime.json +++ b/src/generated/resources/data/statues/recipe/loot/sheep_statue_lime.json @@ -1,9 +1,7 @@ { "type": "statues:loot", "group": "sheep", - "ingredient": { - "item": "statues:sheep_statue_lime" - }, + "ingredient": "statues:sheep_statue_lime", "result": { "count": 1, "id": "minecraft:lime_wool" diff --git a/src/generated/resources/data/statues/recipe/loot/sheep_statue_magenta.json b/src/generated/resources/data/statues/recipe/loot/sheep_statue_magenta.json index 2a58cc02..90db8d71 100644 --- a/src/generated/resources/data/statues/recipe/loot/sheep_statue_magenta.json +++ b/src/generated/resources/data/statues/recipe/loot/sheep_statue_magenta.json @@ -1,9 +1,7 @@ { "type": "statues:loot", "group": "sheep", - "ingredient": { - "item": "statues:sheep_statue_magenta" - }, + "ingredient": "statues:sheep_statue_magenta", "result": { "count": 1, "id": "minecraft:magenta_wool" diff --git a/src/generated/resources/data/statues/recipe/loot/sheep_statue_orange.json b/src/generated/resources/data/statues/recipe/loot/sheep_statue_orange.json index 30884b6c..88780584 100644 --- a/src/generated/resources/data/statues/recipe/loot/sheep_statue_orange.json +++ b/src/generated/resources/data/statues/recipe/loot/sheep_statue_orange.json @@ -1,9 +1,7 @@ { "type": "statues:loot", "group": "sheep", - "ingredient": { - "item": "statues:sheep_statue_orange" - }, + "ingredient": "statues:sheep_statue_orange", "result": { "count": 1, "id": "minecraft:orange_wool" diff --git a/src/generated/resources/data/statues/recipe/loot/sheep_statue_pink.json b/src/generated/resources/data/statues/recipe/loot/sheep_statue_pink.json index de9da5d1..e6724a3f 100644 --- a/src/generated/resources/data/statues/recipe/loot/sheep_statue_pink.json +++ b/src/generated/resources/data/statues/recipe/loot/sheep_statue_pink.json @@ -1,9 +1,7 @@ { "type": "statues:loot", "group": "sheep", - "ingredient": { - "item": "statues:sheep_statue_pink" - }, + "ingredient": "statues:sheep_statue_pink", "result": { "count": 1, "id": "minecraft:pink_wool" diff --git a/src/generated/resources/data/statues/recipe/loot/sheep_statue_purple.json b/src/generated/resources/data/statues/recipe/loot/sheep_statue_purple.json index cf18adbc..57143af4 100644 --- a/src/generated/resources/data/statues/recipe/loot/sheep_statue_purple.json +++ b/src/generated/resources/data/statues/recipe/loot/sheep_statue_purple.json @@ -1,9 +1,7 @@ { "type": "statues:loot", "group": "sheep", - "ingredient": { - "item": "statues:sheep_statue_purple" - }, + "ingredient": "statues:sheep_statue_purple", "result": { "count": 1, "id": "minecraft:purple_wool" diff --git a/src/generated/resources/data/statues/recipe/loot/sheep_statue_red.json b/src/generated/resources/data/statues/recipe/loot/sheep_statue_red.json index 81ec5c0d..1a10b27b 100644 --- a/src/generated/resources/data/statues/recipe/loot/sheep_statue_red.json +++ b/src/generated/resources/data/statues/recipe/loot/sheep_statue_red.json @@ -1,9 +1,7 @@ { "type": "statues:loot", "group": "sheep", - "ingredient": { - "item": "statues:sheep_statue_red" - }, + "ingredient": "statues:sheep_statue_red", "result": { "count": 1, "id": "minecraft:red_wool" diff --git a/src/generated/resources/data/statues/recipe/loot/sheep_statue_white.json b/src/generated/resources/data/statues/recipe/loot/sheep_statue_white.json index 55751f52..b9990eaa 100644 --- a/src/generated/resources/data/statues/recipe/loot/sheep_statue_white.json +++ b/src/generated/resources/data/statues/recipe/loot/sheep_statue_white.json @@ -1,9 +1,7 @@ { "type": "statues:loot", "group": "sheep", - "ingredient": { - "item": "statues:sheep_statue_white" - }, + "ingredient": "statues:sheep_statue_white", "result": { "count": 1, "id": "minecraft:white_wool" diff --git a/src/generated/resources/data/statues/recipe/loot/sheep_statue_yellow.json b/src/generated/resources/data/statues/recipe/loot/sheep_statue_yellow.json index 3b70e48f..df32db87 100644 --- a/src/generated/resources/data/statues/recipe/loot/sheep_statue_yellow.json +++ b/src/generated/resources/data/statues/recipe/loot/sheep_statue_yellow.json @@ -1,9 +1,7 @@ { "type": "statues:loot", "group": "sheep", - "ingredient": { - "item": "statues:sheep_statue_yellow" - }, + "ingredient": "statues:sheep_statue_yellow", "result": { "count": 1, "id": "minecraft:yellow_wool" diff --git a/src/generated/resources/data/statues/recipe/loot/shulker_statue.json b/src/generated/resources/data/statues/recipe/loot/shulker_statue.json index ee09a0ae..bdb51e6a 100644 --- a/src/generated/resources/data/statues/recipe/loot/shulker_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/shulker_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:shulker_statue" - }, + "ingredient": "statues:shulker_statue", "result3": { "count": 1, "id": "minecraft:shulker_shell" diff --git a/src/generated/resources/data/statues/recipe/loot/slime_statue.json b/src/generated/resources/data/statues/recipe/loot/slime_statue.json index 05a1683d..28d61079 100644 --- a/src/generated/resources/data/statues/recipe/loot/slime_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/slime_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:slime_statue" - }, + "ingredient": "statues:slime_statue", "result2": { "count": 1, "id": "minecraft:slime_ball" diff --git a/src/generated/resources/data/statues/recipe/loot/snow_golem_statue.json b/src/generated/resources/data/statues/recipe/loot/snow_golem_statue.json index fdaa97b3..27f930c6 100644 --- a/src/generated/resources/data/statues/recipe/loot/snow_golem_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/snow_golem_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:snow_golem_statue" - }, + "ingredient": "statues:snow_golem_statue", "result": { "count": 1, "id": "minecraft:snowball" diff --git a/src/generated/resources/data/statues/recipe/loot/spider_statue.json b/src/generated/resources/data/statues/recipe/loot/spider_statue.json index 47133303..78a5e859 100644 --- a/src/generated/resources/data/statues/recipe/loot/spider_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/spider_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:spider_statue" - }, + "ingredient": "statues:spider_statue", "result": { "count": 1, "id": "minecraft:string" diff --git a/src/generated/resources/data/statues/recipe/loot/squid_statue.json b/src/generated/resources/data/statues/recipe/loot/squid_statue.json index e5bdf2a1..81899257 100644 --- a/src/generated/resources/data/statues/recipe/loot/squid_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/squid_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:squid_statue" - }, + "ingredient": "statues:squid_statue", "result2": { "count": 1, "id": "minecraft:ink_sac" diff --git a/src/generated/resources/data/statues/recipe/loot/tropical_fish.json b/src/generated/resources/data/statues/recipe/loot/tropical_fish.json index f75e7d51..57b7c7e5 100644 --- a/src/generated/resources/data/statues/recipe/loot/tropical_fish.json +++ b/src/generated/resources/data/statues/recipe/loot/tropical_fish.json @@ -1,42 +1,18 @@ { "type": "statues:loot", "ingredient": [ - { - "item": "statues:tropical_fish_b" - }, - { - "item": "statues:tropical_fish_bb" - }, - { - "item": "statues:tropical_fish_be" - }, - { - "item": "statues:tropical_fish_bm" - }, - { - "item": "statues:tropical_fish_bmb" - }, - { - "item": "statues:tropical_fish_bms" - }, - { - "item": "statues:tropical_fish_e" - }, - { - "item": "statues:tropical_fish_es" - }, - { - "item": "statues:tropical_fish_hb" - }, - { - "item": "statues:tropical_fish_sb" - }, - { - "item": "statues:tropical_fish_sd" - }, - { - "item": "statues:tropical_fish_ss" - } + "statues:tropical_fish_b", + "statues:tropical_fish_bb", + "statues:tropical_fish_be", + "statues:tropical_fish_bm", + "statues:tropical_fish_bmb", + "statues:tropical_fish_bms", + "statues:tropical_fish_e", + "statues:tropical_fish_es", + "statues:tropical_fish_hb", + "statues:tropical_fish_sb", + "statues:tropical_fish_sd", + "statues:tropical_fish_ss" ], "result": { "count": 1, diff --git a/src/generated/resources/data/statues/recipe/loot/turtle_statue.json b/src/generated/resources/data/statues/recipe/loot/turtle_statue.json index ddce8a69..1bbb9d23 100644 --- a/src/generated/resources/data/statues/recipe/loot/turtle_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/turtle_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:turtle_statue" - }, + "ingredient": "statues:turtle_statue", "result": { "count": 1, "id": "minecraft:seagrass" diff --git a/src/generated/resources/data/statues/recipe/loot/villager_statue.json b/src/generated/resources/data/statues/recipe/loot/villager_statue.json index 8a017dbd..c40748f4 100644 --- a/src/generated/resources/data/statues/recipe/loot/villager_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/villager_statue.json @@ -1,18 +1,10 @@ { "type": "statues:loot", "ingredient": [ - { - "item": "statues:villager_br_statue" - }, - { - "item": "statues:villager_gr_statue" - }, - { - "item": "statues:villager_pu_statue" - }, - { - "item": "statues:villager_wh_statue" - } + "statues:villager_br_statue", + "statues:villager_gr_statue", + "statues:villager_pu_statue", + "statues:villager_wh_statue" ], "result3": { "count": 1, diff --git a/src/generated/resources/data/statues/recipe/loot/vindicator_statue.json b/src/generated/resources/data/statues/recipe/loot/vindicator_statue.json index 32f902f4..901824c7 100644 --- a/src/generated/resources/data/statues/recipe/loot/vindicator_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/vindicator_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:vindicator_statue" - }, + "ingredient": "statues:vindicator_statue", "result2": { "count": 1, "id": "minecraft:emerald" diff --git a/src/generated/resources/data/statues/recipe/loot/warden_statue.json b/src/generated/resources/data/statues/recipe/loot/warden_statue.json index 8df4a9f0..82b40435 100644 --- a/src/generated/resources/data/statues/recipe/loot/warden_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/warden_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:warden_statue" - }, + "ingredient": "statues:warden_statue", "result": { "count": 1, "id": "minecraft:sculk_sensor" diff --git a/src/generated/resources/data/statues/recipe/loot/wasteland_statue.json b/src/generated/resources/data/statues/recipe/loot/wasteland_statue.json index bb757999..5e5b9548 100644 --- a/src/generated/resources/data/statues/recipe/loot/wasteland_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/wasteland_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:wasteland_statue" - }, + "ingredient": "statues:wasteland_statue", "result": { "count": 1, "id": "statues:tea" diff --git a/src/generated/resources/data/statues/recipe/loot/witch_statue.json b/src/generated/resources/data/statues/recipe/loot/witch_statue.json index 2630225d..c4be1f80 100644 --- a/src/generated/resources/data/statues/recipe/loot/witch_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/witch_statue.json @@ -1,8 +1,6 @@ { "type": "statues:loot", - "ingredient": { - "item": "statues:witch_statue" - }, + "ingredient": "statues:witch_statue", "result": { "count": 1, "id": "minecraft:glowstone_dust" diff --git a/src/generated/resources/data/statues/recipe/loot/zombie_statue.json b/src/generated/resources/data/statues/recipe/loot/zombie_statue.json index 7ba43f39..01ba2da9 100644 --- a/src/generated/resources/data/statues/recipe/loot/zombie_statue.json +++ b/src/generated/resources/data/statues/recipe/loot/zombie_statue.json @@ -1,9 +1,7 @@ { "type": "statues:loot", "group": "zombie", - "ingredient": { - "item": "statues:zombie_statue" - }, + "ingredient": "statues:zombie_statue", "result": { "count": 1, "id": "minecraft:rotten_flesh" diff --git a/src/generated/resources/data/statues/recipe/statue_core.json b/src/generated/resources/data/statues/recipe/statue_core.json index 5d26eed3..2c5c59e9 100644 --- a/src/generated/resources/data/statues/recipe/statue_core.json +++ b/src/generated/resources/data/statues/recipe/statue_core.json @@ -2,9 +2,7 @@ "type": "minecraft:crafting_shapeless", "category": "misc", "ingredients": [ - { - "item": "statues:core_flower" - } + "statues:core_flower" ], "result": { "count": 1, diff --git a/src/generated/resources/data/statues/recipe/statue_table.json b/src/generated/resources/data/statues/recipe/statue_table.json index 4aaf8bca..d074e702 100644 --- a/src/generated/resources/data/statues/recipe/statue_table.json +++ b/src/generated/resources/data/statues/recipe/statue_table.json @@ -2,15 +2,9 @@ "type": "minecraft:crafting_shaped", "category": "misc", "key": { - "C": { - "tag": "c:chests/wooden" - }, - "D": { - "tag": "c:cobblestones/deepslate" - }, - "P": { - "item": "minecraft:piston" - } + "C": "#c:chests/wooden", + "D": "#c:cobblestones/deepslate", + "P": "minecraft:piston" }, "pattern": [ " P ", diff --git a/src/generated/resources/data/statues/recipe/upgrade/automation.json b/src/generated/resources/data/statues/recipe/upgrade/automation.json index b5d0baf6..69c54177 100644 --- a/src/generated/resources/data/statues/recipe/upgrade/automation.json +++ b/src/generated/resources/data/statues/recipe/upgrade/automation.json @@ -1,15 +1,9 @@ { "type": "statues:upgrade", "catalysts": [ - { - "item": "minecraft:hopper" - }, - { - "item": "minecraft:observer" - } + "minecraft:hopper", + "minecraft:observer" ], - "center": { - "tag": "statues:statues/lootable" - }, + "center": "#statues:statues/lootable", "upgradeType": "automation" } \ No newline at end of file diff --git a/src/generated/resources/data/statues/recipe/upgrade/despawner.json b/src/generated/resources/data/statues/recipe/upgrade/despawner.json index 8e32d16c..3d11a5a8 100644 --- a/src/generated/resources/data/statues/recipe/upgrade/despawner.json +++ b/src/generated/resources/data/statues/recipe/upgrade/despawner.json @@ -1,18 +1,10 @@ { "type": "statues:upgrade", "catalysts": [ - { - "tag": "minecraft:skulls" - }, - { - "item": "minecraft:mycelium" - }, - { - "item": "minecraft:lantern" - } + "#minecraft:skulls", + "minecraft:mycelium", + "minecraft:lantern" ], - "center": { - "tag": "statues:statues/upgradeable" - }, + "center": "#statues:statues/upgradeable", "upgradeType": "despawner" } \ No newline at end of file diff --git a/src/generated/resources/data/statues/recipe/upgrade/glowing.json b/src/generated/resources/data/statues/recipe/upgrade/glowing.json index 0b45f44c..47407a78 100644 --- a/src/generated/resources/data/statues/recipe/upgrade/glowing.json +++ b/src/generated/resources/data/statues/recipe/upgrade/glowing.json @@ -1,12 +1,8 @@ { "type": "statues:upgrade", "catalysts": [ - { - "item": "minecraft:glow_ink_sac" - } + "minecraft:glow_ink_sac" ], - "center": { - "tag": "statues:statues/upgradeable" - }, + "center": "#statues:statues/upgradeable", "upgradeType": "glowing" } \ No newline at end of file diff --git a/src/generated/resources/data/statues/recipe/upgrade/interaction.json b/src/generated/resources/data/statues/recipe/upgrade/interaction.json index c9231edc..e8599eec 100644 --- a/src/generated/resources/data/statues/recipe/upgrade/interaction.json +++ b/src/generated/resources/data/statues/recipe/upgrade/interaction.json @@ -1,12 +1,8 @@ { "type": "statues:upgrade", "catalysts": [ - { - "item": "minecraft:sculk_sensor" - } + "minecraft:sculk_sensor" ], - "center": { - "tag": "statues:statues/interactable" - }, + "center": "#statues:statues/interactable", "upgradeType": "interaction" } \ No newline at end of file diff --git a/src/generated/resources/data/statues/recipe/upgrade/looting.json b/src/generated/resources/data/statues/recipe/upgrade/looting.json index 3c5ab3c3..67b003cf 100644 --- a/src/generated/resources/data/statues/recipe/upgrade/looting.json +++ b/src/generated/resources/data/statues/recipe/upgrade/looting.json @@ -1,21 +1,11 @@ { "type": "statues:upgrade", "catalysts": [ - { - "tag": "c:ender_pearls" - }, - { - "tag": "c:gunpowders" - }, - { - "tag": "c:bones" - }, - { - "item": "minecraft:rotten_flesh" - } + "#c:ender_pearls", + "#c:gunpowders", + "#c:bones", + "minecraft:rotten_flesh" ], - "center": { - "tag": "statues:statues/lootable" - }, + "center": "#statues:statues/lootable", "upgradeType": "looting" } \ No newline at end of file diff --git a/src/generated/resources/data/statues/recipe/upgrade/mob_killer.json b/src/generated/resources/data/statues/recipe/upgrade/mob_killer.json index 91a909e9..74fafbe3 100644 --- a/src/generated/resources/data/statues/recipe/upgrade/mob_killer.json +++ b/src/generated/resources/data/statues/recipe/upgrade/mob_killer.json @@ -1,13 +1,9 @@ { "type": "statues:upgrade", "catalysts": [ - { - "item": "minecraft:diamond_sword" - } + "minecraft:diamond_sword" ], - "center": { - "tag": "statues:statues/upgradeable" - }, + "center": "#statues:statues/upgradeable", "tier": 0, "upgradeType": "mob_killer" } \ No newline at end of file diff --git a/src/generated/resources/data/statues/recipe/upgrade/mob_killer_2.json b/src/generated/resources/data/statues/recipe/upgrade/mob_killer_2.json index a524ea93..05be8b8f 100644 --- a/src/generated/resources/data/statues/recipe/upgrade/mob_killer_2.json +++ b/src/generated/resources/data/statues/recipe/upgrade/mob_killer_2.json @@ -1,24 +1,16 @@ { "type": "statues:upgrade", "catalysts": [ + "#c:storage_blocks/lapis", + "#c:storage_blocks/lapis", + "#c:storage_blocks/lapis", { - "tag": "c:storage_blocks/lapis" - }, - { - "tag": "c:storage_blocks/lapis" - }, - { - "tag": "c:storage_blocks/lapis" - }, - { - "type": "neoforge:components", + "neoforge:ingredient_type": "neoforge:components", "components": {}, "items": "minecraft:enchanted_book" } ], - "center": { - "tag": "statues:statues/upgradeable" - }, + "center": "#statues:statues/upgradeable", "tier": 1, "upgradeType": "mob_killer" } \ No newline at end of file diff --git a/src/generated/resources/data/statues/recipe/upgrade/mob_killer_3.json b/src/generated/resources/data/statues/recipe/upgrade/mob_killer_3.json index 85a264c6..3ad46323 100644 --- a/src/generated/resources/data/statues/recipe/upgrade/mob_killer_3.json +++ b/src/generated/resources/data/statues/recipe/upgrade/mob_killer_3.json @@ -1,13 +1,9 @@ { "type": "statues:upgrade", "catalysts": [ - { - "item": "minecraft:experience_bottle" - } + "minecraft:experience_bottle" ], - "center": { - "tag": "statues:statues/upgradeable" - }, + "center": "#statues:statues/upgradeable", "tier": 2, "upgradeType": "mob_killer" } \ No newline at end of file diff --git a/src/generated/resources/data/statues/recipe/upgrade/sound.json b/src/generated/resources/data/statues/recipe/upgrade/sound.json index 58a75793..9cec21fc 100644 --- a/src/generated/resources/data/statues/recipe/upgrade/sound.json +++ b/src/generated/resources/data/statues/recipe/upgrade/sound.json @@ -1,15 +1,9 @@ { "type": "statues:upgrade", "catalysts": [ - { - "item": "minecraft:note_block" - }, - { - "item": "minecraft:amethyst_shard" - } + "minecraft:note_block", + "minecraft:amethyst_shard" ], - "center": { - "tag": "statues:statues/upgradeable" - }, + "center": "#statues:statues/upgradeable", "upgradeType": "sound" } \ No newline at end of file diff --git a/src/generated/resources/data/statues/recipe/upgrade/spawner.json b/src/generated/resources/data/statues/recipe/upgrade/spawner.json index f60a69eb..f703c7e5 100644 --- a/src/generated/resources/data/statues/recipe/upgrade/spawner.json +++ b/src/generated/resources/data/statues/recipe/upgrade/spawner.json @@ -1,21 +1,11 @@ { "type": "statues:upgrade", "catalysts": [ - { - "item": "minecraft:echo_shard" - }, - { - "tag": "c:eggs" - }, - { - "tag": "c:ender_pearls" - }, - { - "tag": "minecraft:soul_fire_base_blocks" - } + "minecraft:echo_shard", + "#c:eggs", + "#c:ender_pearls", + "#minecraft:soul_fire_base_blocks" ], - "center": { - "tag": "statues:statues/upgradeable" - }, + "center": "#statues:statues/upgradeable", "upgradeType": "spawner" } \ No newline at end of file diff --git a/src/generated/resources/data/statues/recipe/upgrade/speed.json b/src/generated/resources/data/statues/recipe/upgrade/speed.json index b76d0e3c..ae52815e 100644 --- a/src/generated/resources/data/statues/recipe/upgrade/speed.json +++ b/src/generated/resources/data/statues/recipe/upgrade/speed.json @@ -1,18 +1,10 @@ { "type": "statues:upgrade", "catalysts": [ - { - "tag": "c:dusts/redstone" - }, - { - "item": "minecraft:sugar" - }, - { - "item": "minecraft:clock" - } + "#c:dusts/redstone", + "minecraft:sugar", + "minecraft:clock" ], - "center": { - "tag": "statues:statues/upgradeable" - }, + "center": "#statues:statues/upgradeable", "upgradeType": "speed" } \ No newline at end of file diff --git a/src/generated/resources/data/statues/recipe/upgrade/statue_upgrade.json b/src/generated/resources/data/statues/recipe/upgrade/statue_upgrade.json index 245f4fb2..03dfe39d 100644 --- a/src/generated/resources/data/statues/recipe/upgrade/statue_upgrade.json +++ b/src/generated/resources/data/statues/recipe/upgrade/statue_upgrade.json @@ -1,9 +1,7 @@ { "type": "statues:upgrade", "catalysts": [], - "center": { - "tag": "statues:statues/upgradeable" - }, + "center": "#statues:statues/upgradeable", "requireCore": true, "upgradeType": "upgrade" } \ No newline at end of file diff --git a/src/generated/resources/data/statues/recipe/upgrade/unglowing.json b/src/generated/resources/data/statues/recipe/upgrade/unglowing.json index ad80f8cf..b4249d74 100644 --- a/src/generated/resources/data/statues/recipe/upgrade/unglowing.json +++ b/src/generated/resources/data/statues/recipe/upgrade/unglowing.json @@ -1,12 +1,8 @@ { "type": "statues:upgrade", "catalysts": [ - { - "item": "minecraft:ink_sac" - } + "minecraft:ink_sac" ], - "center": { - "tag": "statues:statues/upgradeable" - }, + "center": "#statues:statues/upgradeable", "upgradeType": "unglowing" } \ No newline at end of file diff --git a/src/generated/resources/data/statues/tags/worldgen/biome/can_spawn_statue_bat.json b/src/generated/resources/data/statues/tags/worldgen/biome/can_spawn_statue_bat.json index 321b23bd..a450b812 100644 --- a/src/generated/resources/data/statues/tags/worldgen/biome/can_spawn_statue_bat.json +++ b/src/generated/resources/data/statues/tags/worldgen/biome/can_spawn_statue_bat.json @@ -48,6 +48,7 @@ "minecraft:eroded_badlands", "minecraft:windswept_savanna", "minecraft:cherry_grove", + "minecraft:pale_garden", "minecraft:frozen_peaks", "minecraft:dripstone_caves", "minecraft:lush_caves" diff --git a/src/main/java/com/shynieke/statues/Reference.java b/src/main/java/com/shynieke/statues/Reference.java index a890cc7b..e952cd02 100644 --- a/src/main/java/com/shynieke/statues/Reference.java +++ b/src/main/java/com/shynieke/statues/Reference.java @@ -2,6 +2,7 @@ import com.mojang.authlib.GameProfile; import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; import java.util.UUID; @@ -14,4 +15,8 @@ public class Reference { public static final String UPGRADED = "statueUpgraded"; public static final String UPGRADE_SLOTS = "upgradeSlots"; public static final GameProfile GAME_PROFILE = new GameProfile(UUID.nameUUIDFromBytes("fakeplayer.statue".getBytes()), Component.translatable("fakeplayer.statue").getString()); + + public static ResourceLocation modLoc(String path) { + return ResourceLocation.fromNamespaceAndPath(MOD_ID, path); + } } diff --git a/src/main/java/com/shynieke/statues/blockentities/AbstractStatueBlockEntity.java b/src/main/java/com/shynieke/statues/blockentities/AbstractStatueBlockEntity.java index f20d8afa..876445bf 100644 --- a/src/main/java/com/shynieke/statues/blockentities/AbstractStatueBlockEntity.java +++ b/src/main/java/com/shynieke/statues/blockentities/AbstractStatueBlockEntity.java @@ -26,7 +26,7 @@ import net.minecraft.util.Mth; import net.minecraft.util.RandomSource; import net.minecraft.world.InteractionHand; -import net.minecraft.world.ItemInteractionResult; +import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; @@ -94,7 +94,6 @@ public void saveAdditional(CompoundTag compound, HolderLookup.Provider provider) this.saveToNbt(compound, provider); } - @Override public void saveToItem(ItemStack stack, HolderLookup.Provider provider) { stack.set(StatueDataComponents.STATS, this.stats); stack.set(StatueDataComponents.UPGRADED, true); @@ -373,8 +372,8 @@ public boolean drainPower(int amount) { return true; } - public ItemInteractionResult interact(Level level, BlockPos pos, BlockState state, Player player, InteractionHand handIn, BlockHitResult result) { - return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION; + public InteractionResult interact(Level level, BlockPos pos, BlockState state, Player player, InteractionHand handIn, BlockHitResult result) { + return InteractionResult.PASS; } public AbstractStatueBase getStatue() { diff --git a/src/main/java/com/shynieke/statues/blockentities/PlayerBlockEntity.java b/src/main/java/com/shynieke/statues/blockentities/PlayerBlockEntity.java index d64921dc..43c7e081 100644 --- a/src/main/java/com/shynieke/statues/blockentities/PlayerBlockEntity.java +++ b/src/main/java/com/shynieke/statues/blockentities/PlayerBlockEntity.java @@ -23,6 +23,7 @@ import net.minecraft.server.Services; import net.minecraft.util.StringUtil; import net.minecraft.world.Nameable; +import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.component.ResolvableProfile; import net.minecraft.world.level.Level; @@ -291,9 +292,11 @@ public static void serverTick(Level level, BlockPos pos, BlockState state, Playe } } - @Override public void saveToItem(ItemStack stack, HolderLookup.Provider registries) { - super.saveToItem(stack, registries); + CompoundTag compoundtag = this.saveCustomOnly(registries); + this.removeComponentsFromTag(compoundtag); + BlockItem.setBlockEntityData(stack, this.getType(), compoundtag); + stack.applyComponents(this.collectComponents()); } @Override diff --git a/src/main/java/com/shynieke/statues/blockentities/StatueBlockEntity.java b/src/main/java/com/shynieke/statues/blockentities/StatueBlockEntity.java index 2569478e..daea47ed 100644 --- a/src/main/java/com/shynieke/statues/blockentities/StatueBlockEntity.java +++ b/src/main/java/com/shynieke/statues/blockentities/StatueBlockEntity.java @@ -18,15 +18,15 @@ import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundSource; import net.minecraft.world.InteractionHand; -import net.minecraft.world.ItemInteractionResult; +import net.minecraft.world.InteractionResult; import net.minecraft.world.effect.MobEffect; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.effect.MobEffects; import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EntitySpawnReason; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.Mob; -import net.minecraft.world.entity.MobSpawnType; import net.minecraft.world.entity.SpawnPlacements; import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.entity.item.ItemEntity; @@ -111,10 +111,10 @@ public static void serverTick(Level level, BlockPos pos, BlockState state, Statu } @Override - public ItemInteractionResult interact(Level level, BlockPos pos, BlockState state, Player player, InteractionHand handIn, BlockHitResult result) { + public InteractionResult interact(Level level, BlockPos pos, BlockState state, Player player, InteractionHand handIn, BlockHitResult result) { AbstractStatueBase statueBase = getStatue(); if (statueBase == null) - return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION; + return InteractionResult.PASS; if (makesSounds()) { playSound(statueBase.getSound(state), pos); @@ -131,7 +131,7 @@ public ItemInteractionResult interact(Level level, BlockPos pos, BlockState stat if (hasSpecialInteraction()) { onSpecialInteract(level, pos, state, player, handIn, result); } - return ItemInteractionResult.CONSUME; + return InteractionResult.CONSUME; } public void onSpecialInteract(Level level, BlockPos pos, BlockState state, Player player, InteractionHand handIn, BlockHitResult result) { @@ -148,13 +148,13 @@ public void onSpecialInteract(Level level, BlockPos pos, BlockState state, Playe } public void giveItem() { - if (level != null) { + if (level != null && !level.isClientSide()) { if (!drainPower(getItemPowerUsage())) return; LootRecipe loot; if (cachedLootRecipe != null) { loot = cachedLootRecipe.value(); } else { - loot = (cachedLootRecipe = LootHelper.getMatchingLoot(level, new ItemStack(getBlockState().getBlock()))).value(); + loot = (cachedLootRecipe = LootHelper.getMatchingLoot((ServerLevel) level, new ItemStack(getBlockState().getBlock()))).value(); } if (loot == null) { Statues.LOGGER.error("No loot found for statue {}, please report this to the Statues issue tracker", getBlockState()); @@ -265,12 +265,12 @@ public void summonMob(ServerLevel serverLevel) { BlockPos blockpos = BlockPos.containing(d0, d1, d2); if (!serverLevel.isAreaLoaded(blockpos, 1)) continue; - if (!screwTheRulesIHasMoney && !SpawnPlacements.checkSpawnRules(entityType, serverLevel, MobSpawnType.SPAWNER, blockpos, serverLevel.getRandom())) { + if (!screwTheRulesIHasMoney && !SpawnPlacements.checkSpawnRules(entityType, serverLevel, EntitySpawnReason.SPAWNER, blockpos, serverLevel.getRandom())) { continue; } if (!drainPower(getSummonPowerUsage())) return; - Entity entity = entityType.create(level); + Entity entity = entityType.create(serverLevel, EntitySpawnReason.SPAWNER); if (entity == null) { continue; } @@ -284,12 +284,12 @@ public void summonMob(ServerLevel serverLevel) { entity.moveTo(entity.getX(), entity.getY(), entity.getZ(), level.random.nextFloat() * 360.0F, 0.0F); if (entity instanceof Mob mob) { - if (!screwTheRulesIHasMoney && !mob.checkSpawnRules(serverLevel, MobSpawnType.SPAWNER) || !mob.checkSpawnObstruction(serverLevel)) { + if (!screwTheRulesIHasMoney && !mob.checkSpawnRules(serverLevel, EntitySpawnReason.SPAWNER) || !mob.checkSpawnObstruction(serverLevel)) { continue; } net.neoforged.neoforge.event.EventHooks.finalizeMobSpawnSpawner(mob, serverLevel, - serverLevel.getCurrentDifficultyAt(entity.blockPosition()), MobSpawnType.SPAWNER, null, this, true); + serverLevel.getCurrentDifficultyAt(entity.blockPosition()), EntitySpawnReason.SPAWNER, null, this, true); } if (!serverLevel.tryAddFreshEntityWithPassengers(entity)) { diff --git a/src/main/java/com/shynieke/statues/blockentities/StatueTableBlockEntity.java b/src/main/java/com/shynieke/statues/blockentities/StatueTableBlockEntity.java index 1de31c91..ba3fbe5a 100644 --- a/src/main/java/com/shynieke/statues/blockentities/StatueTableBlockEntity.java +++ b/src/main/java/com/shynieke/statues/blockentities/StatueTableBlockEntity.java @@ -16,6 +16,7 @@ import net.minecraft.network.Connection; import net.minecraft.network.chat.Component; import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket; +import net.minecraft.server.level.ServerLevel; import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundSource; import net.minecraft.world.MenuProvider; @@ -81,7 +82,7 @@ public StatueTableBlockEntity(BlockPos pos, BlockState state) { } protected void updateCachedRecipe() { - if (this.level == null) return; + if (this.level == null || this.level.isClientSide) return; if (getCenterSlot().isEmpty()) { this.currentRecipe = null; @@ -93,7 +94,7 @@ protected void updateCachedRecipe() { for (int i = 0; i < handler.getSlots(); i++) { inputs.add(i, handler.getStackInSlot(i)); } - this.currentRecipe = this.level.getRecipeManager().getRecipeFor(StatuesRecipes.UPGRADE_RECIPE.get(), new MultipleRecipeInput(inputs), this.level).orElse(null); + this.currentRecipe = ((ServerLevel)this.level).recipeAccess().getRecipeFor(StatuesRecipes.UPGRADE_RECIPE.get(), new MultipleRecipeInput(inputs), this.level).orElse(null); } @Override diff --git a/src/main/java/com/shynieke/statues/blocks/AbstractBaseBlock.java b/src/main/java/com/shynieke/statues/blocks/AbstractBaseBlock.java index e116e8bd..acdb90b4 100644 --- a/src/main/java/com/shynieke/statues/blocks/AbstractBaseBlock.java +++ b/src/main/java/com/shynieke/statues/blocks/AbstractBaseBlock.java @@ -16,7 +16,7 @@ import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.BooleanProperty; -import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.block.state.properties.EnumProperty; import net.minecraft.world.level.material.FluidState; import net.minecraft.world.level.material.Fluids; import org.jetbrains.annotations.Nullable; @@ -25,7 +25,7 @@ public class AbstractBaseBlock extends BaseEntityBlock implements SimpleWaterlog public static final MapCodec CODEC = simpleCodec(AbstractBaseBlock::new); protected static final RandomSource RANDOM = RandomSource.create(); - public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING; + public static final EnumProperty FACING = BlockStateProperties.HORIZONTAL_FACING; public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; public AbstractBaseBlock(Block.Properties builder) { diff --git a/src/main/java/com/shynieke/statues/blocks/AbstractStatueBase.java b/src/main/java/com/shynieke/statues/blocks/AbstractStatueBase.java index 13eca54f..38fedf76 100644 --- a/src/main/java/com/shynieke/statues/blocks/AbstractStatueBase.java +++ b/src/main/java/com/shynieke/statues/blocks/AbstractStatueBase.java @@ -1,5 +1,6 @@ package com.shynieke.statues.blocks; +import com.shynieke.statues.blockentities.AbstractStatueBlockEntity; import com.shynieke.statues.blockentities.StatueBlockEntity; import com.shynieke.statues.registry.StatueBlockEntities; import net.minecraft.core.BlockPos; @@ -9,7 +10,6 @@ import net.minecraft.sounds.SoundSource; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; -import net.minecraft.world.ItemInteractionResult; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.item.ItemEntity; @@ -27,6 +27,7 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.redstone.Orientation; import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.shapes.CollisionContext; @@ -57,16 +58,15 @@ protected InteractionResult useWithoutItem(BlockState state, Level level, BlockP } return super.useWithoutItem(state, level, pos, player, result); } - @Override - protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Level level, BlockPos pos, Player player, + protected InteractionResult useItemOn(ItemStack stack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult result) { if (state.getValue(INTERACTIVE) && hand == InteractionHand.MAIN_HAND) { if (!level.isClientSide && (getBE(level, pos) != null)) { return getBE(level, pos).interact(level, pos, state, player, hand, result); } } - return ItemInteractionResult.SUCCESS; + return InteractionResult.SUCCESS; } public StatueBlockEntity getBE(BlockGetter getter, BlockPos pos) { @@ -106,22 +106,20 @@ protected static BlockEntityTicker createStatueTicker } @Override - public ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state) { - ItemStack itemstack = super.getCloneItemStack(level, pos, state); - if (level.getBlockEntity(pos) != null) { - level.getBlockEntity(pos).saveToItem(itemstack, level.registryAccess()); + public ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state, boolean includeData, Player player) { + ItemStack stack = super.getCloneItemStack(level, pos, state, includeData, player); + if (level.getBlockEntity(pos) instanceof AbstractStatueBlockEntity statueBlockEntity) { + statueBlockEntity.saveToItem(stack, level.registryAccess()); } - return itemstack; + return stack; } @Override public BlockState playerWillDestroy(Level level, BlockPos pos, BlockState state, Player player) { if (state.getValue(INTERACTIVE) && level.getBlockEntity(pos) instanceof StatueBlockEntity statueBlockEntity) { - BlockEntity blockentity = level.getBlockEntity(pos); if (!level.isClientSide && !player.hasInfiniteMaterials()) { ItemStack itemstack = new ItemStack(this.asItem()); statueBlockEntity.saveToItem(itemstack, level.registryAccess()); - blockentity.saveToItem(itemstack, level.registryAccess()); ItemEntity itementity = new ItemEntity(level, (double) pos.getX() + 0.5D, @@ -149,7 +147,7 @@ protected void createBlockStateDefinition(StateDefinition.Builder - blockEntity.saveToItem(itemstack, level.registryAccess())); - return itemstack; + public ItemStack getCloneItemStack(LevelReader level, BlockPos pos, BlockState state, boolean includeData, Player player) { + ItemStack stack = super.getCloneItemStack(level, pos, state, includeData, player); + if (level.getBlockEntity(pos) instanceof PlayerBlockEntity playerBlockEntity) { + playerBlockEntity.saveToItem(stack, level.registryAccess()); + } + return stack; } @Override @@ -179,10 +182,10 @@ protected void createBlockStateDefinition(Builder blockStateB } @Override - protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Level level, BlockPos pos, Player playerIn, InteractionHand hand, BlockHitResult result) { + protected InteractionResult useItemOn(ItemStack stack, BlockState state, Level level, BlockPos pos, Player playerIn, InteractionHand hand, BlockHitResult result) { ResolvableProfile tileProfile = getBE(level, pos).getPlayerProfile(); PlayerBlockEntity playerBlockEntity = getBE(level, pos); - if (!level.isClientSide && playerBlockEntity != null && tileProfile != null) { + if (playerIn instanceof ServerPlayer serverPlayer && playerBlockEntity != null && tileProfile != null) { String playerName = tileProfile.name().orElse("Unknown"); UUID id = tileProfile.id().orElse(null); boolean onlineFlag = id != null && level.getPlayerByUUID(tileProfile.id().get()) != null; @@ -195,7 +198,7 @@ protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Lev level.addFreshEntity(new ItemEntity(level, pos.getX(), pos.getY() + 0.5, pos.getZ(), comparatorStack)); } } - return ItemInteractionResult.SUCCESS; + return InteractionResult.SUCCESS; } else { if (StatuesConfig.COMMON.playerCompass.get()) { if (stack.getItem() == Items.COMPASS || stack.getItem() == StatueRegistry.PLAYER_COMPASS.get()) { @@ -204,7 +207,7 @@ protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Lev ItemStack playerCompass = isPlayerCompass ? stack : new ItemStack(StatueRegistry.PLAYER_COMPASS.get()); Player player = level.getPlayerByUUID(id); if (player != null && player.level().dimension().location().equals(playerIn.level().dimension().location())) { - BlockPos playerPos = player.blockPosition(); + GlobalPos playerPos = GlobalPos.of(player.level().dimension(), player.blockPosition()); playerCompass.set(StatueDataComponents.PLAYER_COMPASS_DATA.get(), new PlayerCompassData(playerPos, tileProfile.name().orElse("Unknown"))); if (!isPlayerCompass) { @@ -216,29 +219,29 @@ protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Lev } } } else { - playerIn.sendSystemMessage(Component.translatable("statues.player.compass.dimension.failure", ChatFormatting.GOLD + playerName)); + serverPlayer.sendSystemMessage(Component.translatable("statues.player.compass.dimension.failure", ChatFormatting.GOLD + playerName)); } } else { - playerIn.sendSystemMessage(Component.translatable("statues.player.compass.offline", ChatFormatting.GOLD + playerName)); + serverPlayer.sendSystemMessage(Component.translatable("statues.player.compass.offline", ChatFormatting.GOLD + playerName)); } - return ItemInteractionResult.SUCCESS; + return InteractionResult.SUCCESS; } if (stack.getItem() == Items.COMPARATOR) { if (!playerBlockEntity.getComparatorApplied()) { stack.consume(1, playerIn); playerBlockEntity.setComparatorApplied(true); playerBlockEntity.updateOnline(); - return ItemInteractionResult.SUCCESS; + return InteractionResult.SUCCESS; } } if (stack.is(StatueTags.PLAYER_UPGRADE_ITEM)) { if (level instanceof ServerLevel serverLevel) { Consumer consumer = EntityType.appendCustomEntityStackConfig((p_263581_) -> { }, serverLevel, stack, playerIn); - PlayerStatue playerStatueEntity = StatueRegistry.PLAYER_STATUE_ENTITY.get().create(serverLevel, consumer, pos, MobSpawnType.SPAWN_EGG, true, true); + PlayerStatue playerStatueEntity = StatueRegistry.PLAYER_STATUE_ENTITY.get().create(serverLevel, consumer, pos, EntitySpawnReason.SPAWN_ITEM_USE, true, true); if (playerStatueEntity == null) { - return ItemInteractionResult.FAIL; + return InteractionResult.FAIL; } serverLevel.addFreshEntityWithPassengers(playerStatueEntity); @@ -256,7 +259,7 @@ protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Lev } } } - return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION; + return InteractionResult.PASS; } @Override @@ -292,7 +295,7 @@ public void animateTick(BlockState state, Level level, BlockPos pos, RandomSourc } @Override - public VoxelShape getOcclusionShape(BlockState state, BlockGetter level, BlockPos pos) { + protected VoxelShape getOcclusionShape(BlockState state) { return Shapes.empty(); } diff --git a/src/main/java/com/shynieke/statues/blocks/statues/SheepStatueBlock.java b/src/main/java/com/shynieke/statues/blocks/statues/SheepStatueBlock.java index 1f3508ef..3210f3c9 100644 --- a/src/main/java/com/shynieke/statues/blocks/statues/SheepStatueBlock.java +++ b/src/main/java/com/shynieke/statues/blocks/statues/SheepStatueBlock.java @@ -9,7 +9,7 @@ import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvents; import net.minecraft.world.InteractionHand; -import net.minecraft.world.ItemInteractionResult; +import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.DyeColor; @@ -40,7 +40,7 @@ public SheepStatueBlock(Properties builder, DyeColor color) { } @Override - protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Level level, BlockPos pos, + protected InteractionResult useItemOn(ItemStack stack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult result) { if (stack.getItem() instanceof DyeItem dyeItem && this.COLOR != dyeItem.getDyeColor()) { Block block = COLOR_DYE_STATUE_MAP.get(dyeItem.getDyeColor()); @@ -60,7 +60,7 @@ protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Lev level.setBlockEntity(blockEntity); } stack.consume(1, player); - return ItemInteractionResult.SUCCESS; + return InteractionResult.SUCCESS; } } diff --git a/src/main/java/com/shynieke/statues/blocks/statues/fish/FishStatueBlock.java b/src/main/java/com/shynieke/statues/blocks/statues/fish/FishStatueBlock.java index 908c9f5e..61c3f14e 100644 --- a/src/main/java/com/shynieke/statues/blocks/statues/fish/FishStatueBlock.java +++ b/src/main/java/com/shynieke/statues/blocks/statues/fish/FishStatueBlock.java @@ -10,7 +10,7 @@ import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundSource; import net.minecraft.world.InteractionHand; -import net.minecraft.world.ItemInteractionResult; +import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.item.ItemEntity; @@ -52,7 +52,7 @@ public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, Co } @Override - public ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand handIn, BlockHitResult result) { + public InteractionResult useItemOn(ItemStack stack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand handIn, BlockHitResult result) { if (state.is(StatueTags.IS_TROPICAL_FISH) && stack.getItem() == Items.WET_SPONGE) { TropicalFishBlockEntity fishBlockEntity = getFishTE(level, pos); fishBlockEntity.scrambleColors(); diff --git a/src/main/java/com/shynieke/statues/client/ClientHandler.java b/src/main/java/com/shynieke/statues/client/ClientHandler.java index c7070b48..bea9dfd7 100644 --- a/src/main/java/com/shynieke/statues/client/ClientHandler.java +++ b/src/main/java/com/shynieke/statues/client/ClientHandler.java @@ -12,39 +12,22 @@ import com.shynieke.statues.client.render.StatueBatRenderer; import com.shynieke.statues.client.screen.ShulkerStatueScreen; import com.shynieke.statues.client.screen.StatueTableScreen; -import com.shynieke.statues.datacomponent.PlayerCompassData; import com.shynieke.statues.registry.StatueBlockEntities; -import com.shynieke.statues.registry.StatueDataComponents; import com.shynieke.statues.registry.StatueRegistry; import net.minecraft.client.Minecraft; import net.minecraft.client.model.geom.ModelLayerLocation; import net.minecraft.client.model.geom.builders.CubeDeformation; import net.minecraft.client.model.geom.builders.LayerDefinition; -import net.minecraft.client.multiplayer.ClientLevel; -import net.minecraft.client.renderer.item.ClampedItemPropertyFunction; -import net.minecraft.client.renderer.item.ItemProperties; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.resources.ResourceLocation; import net.minecraft.server.Services; import net.minecraft.server.players.GameProfileCache; import net.minecraft.util.Mth; -import net.minecraft.world.entity.Entity; -import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.entity.decoration.ItemFrame; -import net.minecraft.world.entity.item.ItemEntity; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.phys.Vec3; import net.neoforged.api.distmarker.Dist; import net.neoforged.api.distmarker.OnlyIn; -import net.neoforged.fml.ModList; import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; import net.neoforged.neoforge.client.event.ClientPlayerNetworkEvent; import net.neoforged.neoforge.client.event.EntityRenderersEvent; import net.neoforged.neoforge.client.event.RegisterColorHandlersEvent; import net.neoforged.neoforge.client.event.RegisterMenuScreensEvent; -import org.jetbrains.annotations.Nullable; import java.io.BufferedReader; import java.io.IOException; @@ -55,93 +38,14 @@ import java.util.UUID; public class ClientHandler { - public static final ModelLayerLocation PLAYER_STATUE = new ModelLayerLocation(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "player_statue"), "player_statue"); - public static final ModelLayerLocation PLAYER_STATUE_SLIM = new ModelLayerLocation(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "player_statue_slim"), "player_statue_slim"); + public static final ModelLayerLocation PLAYER_STATUE = new ModelLayerLocation(Reference.modLoc("player_statue"), "player_statue"); + public static final ModelLayerLocation PLAYER_STATUE_SLIM = new ModelLayerLocation(Reference.modLoc("player_statue_slim"), "player_statue_slim"); public static final List SUPPORTER = new ArrayList<>(); public static final List TRANSLATORS = new ArrayList<>(); public static void doClientStuff(final FMLClientSetupEvent event) { setPlayerCache(Minecraft.getInstance()); - event.enqueueWork(() -> { - ItemProperties.register(StatueRegistry.PLAYER_COMPASS.get(), ResourceLocation.withDefaultNamespace("angle"), new ClampedItemPropertyFunction() { - private final ClientHandler.Angle rotation = new ClientHandler.Angle(); - private final ClientHandler.Angle rota = new ClientHandler.Angle(); - - public float unclampedCall(ItemStack stack, @Nullable ClientLevel level, @Nullable LivingEntity entityIn, int p_174567_) { - Entity entity = (Entity) (entityIn != null ? entityIn : stack.getEntityRepresentation()); - if (entity == null) { - return 0.0F; - } else { - if (level == null && entity.level() instanceof ClientLevel) { - level = (ClientLevel) entity.level(); - } - if (level != null) { - BlockPos blockpos = this.getWorldPos(level); - long gameTime = level.getGameTime(); - - PlayerCompassData compassData = stack.get(StatueDataComponents.PLAYER_COMPASS_DATA.get()); - if (compassData != null) { - blockpos = compassData.pos(); - } - - if (blockpos != null && !(entity.distanceToSqr((double) blockpos.getX() + 0.5D, entity.position().y(), (double) blockpos.getZ() + 0.5D) < (double) 1.0E-5F)) { - boolean flag = entity instanceof Player && ((Player) entity).isLocalPlayer(); - double d1 = 0.0D; - if (flag) { - d1 = (double) entityIn.getYRot(); - } else if (entity instanceof ItemFrame) { - d1 = this.getFrameRotation((ItemFrame) entity); - } else if (entity instanceof ItemEntity) { - d1 = (double) (180.0F - ((ItemEntity) entity).getSpin(0.5F) / ((float) Math.PI * 2F) * 360.0F); - } else if (entityIn != null) { - d1 = (double) entityIn.yBodyRot; - } - - d1 = Mth.positiveModulo(d1 / 360.0D, 1.0D); - double d2 = this.getLocationToAngle(Vec3.atCenterOf(blockpos), entity) / (double) ((float) Math.PI * 2F); - double d3; - if (flag) { - if (this.rotation.shouldUpdate(gameTime)) { - this.rotation.update(gameTime, 0.5D - (d1 - 0.25D)); - } - d3 = d2 + this.rotation.rotation; - } else { - d3 = 0.5D - (d1 - 0.25D - d2); - } - - return Mth.positiveModulo((float) d3, 1.0F); - } else { - if (this.rota.shouldUpdate(gameTime)) { - this.rota.update(gameTime, Math.random()); - } - - double d0 = this.rota.rotation + (double) ((float) stack.hashCode() / 2.14748365E9F); - return Mth.positiveModulo((float) d0, 1.0F); - } - } - double d0 = this.rota.rotation + (double) ((float) stack.hashCode() / 2.14748365E9F); - return Mth.positiveModulo((float) d0, 1.0F); - } - } - - @Nullable - private BlockPos getWorldPos(ClientLevel level) { - return level.dimensionType().natural() ? level.getSharedSpawnPos() : null; - } - - private double getFrameRotation(ItemFrame itemFrameIn) { - Direction direction = itemFrameIn.getDirection(); - int i = direction.getAxis().isVertical() ? 90 * direction.getAxisDirection().getStep() : 0; - return (double) Mth.wrapDegrees(180 + direction.get2DDataValue() * 90 + itemFrameIn.getRotation() * 45 + i); - } - - private double getLocationToAngle(Vec3 location, Entity entityIn) { - return Math.atan2(location.z() - entityIn.getZ(), location.x() - entityIn.getX()); - } - }); - }); - new Thread(() -> { Statues.LOGGER.info("Loading Statues supporter data..."); try { @@ -172,11 +76,27 @@ private double getLocationToAngle(Vec3 location, Entity entityIn) { Statues.LOGGER.info("Loaded {} translators.", TRANSLATORS.size()); }, "Statues Perks Data Loader").start(); - if (ModList.get().isLoaded("curios")) { - com.shynieke.statues.compat.curios.client.StatueCurioRenderer.setupRenderer(); - } +// if (ModList.get().isLoaded("curios")) { +// com.shynieke.statues.compat.curios.client.StatueCurioRenderer.setupRenderer(); +// } } +// public static void registerExtensions(RegisterClientExtensionsEvent event) { +// event.registerItem(new IClientItemExtensions() { +// @Override +// public BlockEntityWithoutLevelRenderer getCustomRenderer() { +// return new PlayerBEWLR(new BlockEntityRendererProvider.Context( +// Minecraft.getInstance().getBlockEntityRenderDispatcher(), +// Minecraft.getInstance().getBlockRenderer(), +// Minecraft.getInstance().getItemRenderer(), +// Minecraft.getInstance().getEntityRenderDispatcher(), +// Minecraft.getInstance().getEntityModels(), +// Minecraft.getInstance().font +// )); +// } +// }, StatueRegistry.PLAYER_STATUE.asItem()); +// } + public static void onRegisterMenu(final RegisterMenuScreensEvent event) { event.register(StatueRegistry.STATUE_TABLE_MENU.get(), StatueTableScreen::new); event.register(StatueRegistry.SHULKER_STATUE_MENU.get(), ShulkerStatueScreen::new); diff --git a/src/main/java/com/shynieke/statues/client/model/PlayerStatueModel.java b/src/main/java/com/shynieke/statues/client/model/PlayerStatueModel.java index 0f688b0d..b54e5ec9 100644 --- a/src/main/java/com/shynieke/statues/client/model/PlayerStatueModel.java +++ b/src/main/java/com/shynieke/statues/client/model/PlayerStatueModel.java @@ -1,7 +1,8 @@ package com.shynieke.statues.client.model; -import com.google.common.collect.ImmutableList; -import com.shynieke.statues.entity.PlayerStatue; +import com.mojang.blaze3d.vertex.PoseStack; +import com.shynieke.statues.client.model.state.PlayerStatueRenderState; +import net.minecraft.client.model.HumanoidModel; import net.minecraft.client.model.PlayerModel; import net.minecraft.client.model.geom.ModelPart; import net.minecraft.client.model.geom.PartPose; @@ -9,11 +10,30 @@ import net.minecraft.client.model.geom.builders.CubeListBuilder; import net.minecraft.client.model.geom.builders.MeshDefinition; import net.minecraft.client.model.geom.builders.PartDefinition; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.world.entity.HumanoidArm; -public class PlayerStatueModel extends PlayerModel { +import java.util.List; - public PlayerStatueModel(ModelPart modelPart, boolean slim) { - super(modelPart, slim); +public class PlayerStatueModel extends HumanoidModel { + + private final List bodyParts; + public final ModelPart leftSleeve; + public final ModelPart rightSleeve; + public final ModelPart leftPants; + public final ModelPart rightPants; + public final ModelPart jacket; + private final boolean slim; + + public PlayerStatueModel(ModelPart root, boolean slim) { + super(root, RenderType::entityTranslucent); + this.slim = slim; + this.leftSleeve = this.leftArm.getChild("left_sleeve"); + this.rightSleeve = this.rightArm.getChild("right_sleeve"); + this.leftPants = this.leftLeg.getChild("left_pants"); + this.rightPants = this.rightLeg.getChild("right_pants"); + this.jacket = this.body.getChild("jacket"); + this.bodyParts = List.of(this.head, this.body, this.leftArm, this.rightArm, this.leftLeg, this.rightLeg); this.hat.setRotation(0.0F, -1.75F, 0.0F); this.rightSleeve.setRotation(-5.0F, 2.0F, 0.0F); @@ -34,25 +54,31 @@ public static MeshDefinition createStatueMesh(CubeDeformation cubeDeformation, b } @Override - public void setupAnim(PlayerStatue entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { - this.head.xRot = ((float) Math.PI / 180F) * entityIn.getHeadRotation().getX(); - this.head.yRot = ((float) Math.PI / 180F) * entityIn.getHeadRotation().getY(); - this.head.zRot = ((float) Math.PI / 180F) * entityIn.getHeadRotation().getZ(); - this.body.xRot = ((float) Math.PI / 180F) * entityIn.getBodyRotation().getX(); - this.body.yRot = ((float) Math.PI / 180F) * entityIn.getBodyRotation().getY(); - this.body.zRot = ((float) Math.PI / 180F) * entityIn.getBodyRotation().getZ(); - this.leftArm.xRot = ((float) Math.PI / 180F) * entityIn.getLeftArmRotation().getX(); - this.leftArm.yRot = ((float) Math.PI / 180F) * entityIn.getLeftArmRotation().getY(); - this.leftArm.zRot = ((float) Math.PI / 180F) * entityIn.getLeftArmRotation().getZ(); - this.rightArm.xRot = ((float) Math.PI / 180F) * entityIn.getRightArmRotation().getX(); - this.rightArm.yRot = ((float) Math.PI / 180F) * entityIn.getRightArmRotation().getY(); - this.rightArm.zRot = ((float) Math.PI / 180F) * entityIn.getRightArmRotation().getZ(); - this.leftLeg.xRot = ((float) Math.PI / 180F) * entityIn.getLeftLegRotation().getX(); - this.leftLeg.yRot = ((float) Math.PI / 180F) * entityIn.getLeftLegRotation().getY(); - this.leftLeg.zRot = ((float) Math.PI / 180F) * entityIn.getLeftLegRotation().getZ(); - this.rightLeg.xRot = ((float) Math.PI / 180F) * entityIn.getRightLegRotation().getX(); - this.rightLeg.yRot = ((float) Math.PI / 180F) * entityIn.getRightLegRotation().getY(); - this.rightLeg.zRot = ((float) Math.PI / 180F) * entityIn.getRightLegRotation().getZ(); + public void setupAnim(PlayerStatueRenderState renderState) { + this.body.visible = true; + this.rightArm.visible = true; + this.leftArm.visible = true; + this.rightLeg.visible = true; + this.leftLeg.visible = true; + super.setupAnim(renderState); + this.head.xRot = (float) (Math.PI / 180.0) * renderState.headPose.getX(); + this.head.yRot = (float) (Math.PI / 180.0) * renderState.headPose.getY(); + this.head.zRot = (float) (Math.PI / 180.0) * renderState.headPose.getZ(); + this.body.xRot = (float) (Math.PI / 180.0) * renderState.bodyPose.getX(); + this.body.yRot = (float) (Math.PI / 180.0) * renderState.bodyPose.getY(); + this.body.zRot = (float) (Math.PI / 180.0) * renderState.bodyPose.getZ(); + this.leftArm.xRot = (float) (Math.PI / 180.0) * renderState.leftArmPose.getX(); + this.leftArm.yRot = (float) (Math.PI / 180.0) * renderState.leftArmPose.getY(); + this.leftArm.zRot = (float) (Math.PI / 180.0) * renderState.leftArmPose.getZ(); + this.rightArm.xRot = (float) (Math.PI / 180.0) * renderState.rightArmPose.getX(); + this.rightArm.yRot = (float) (Math.PI / 180.0) * renderState.rightArmPose.getY(); + this.rightArm.zRot = (float) (Math.PI / 180.0) * renderState.rightArmPose.getZ(); + this.leftLeg.xRot = (float) (Math.PI / 180.0) * renderState.leftLegPose.getX(); + this.leftLeg.yRot = (float) (Math.PI / 180.0) * renderState.leftLegPose.getY(); + this.leftLeg.zRot = (float) (Math.PI / 180.0) * renderState.leftLegPose.getZ(); + this.rightLeg.xRot = (float) (Math.PI / 180.0) * renderState.rightLegPose.getX(); + this.rightLeg.yRot = (float) (Math.PI / 180.0) * renderState.rightLegPose.getY(); + this.rightLeg.zRot = (float) (Math.PI / 180.0) * renderState.rightLegPose.getZ(); this.hat.copyFrom(this.head); this.jacket.copyFrom(this.body); this.leftSleeve.copyFrom(this.leftArm); @@ -62,7 +88,26 @@ public void setupAnim(PlayerStatue entityIn, float limbSwing, float limbSwingAmo } @Override - protected Iterable headParts() { - return ImmutableList.of(this.head, this.hat); + public void setAllVisible(boolean visible) { + super.setAllVisible(visible); + this.leftSleeve.visible = visible; + this.rightSleeve.visible = visible; + this.leftPants.visible = visible; + this.rightPants.visible = visible; + this.jacket.visible = visible; + } + + @Override + public void translateToHand(HumanoidArm side, PoseStack poseStack) { + this.root().translateAndRotate(poseStack); + ModelPart modelpart = this.getArm(side); + if (this.slim) { + float f = 0.5F * (float) (side == HumanoidArm.RIGHT ? 1 : -1); + modelpart.x += f; + modelpart.translateAndRotate(poseStack); + modelpart.x -= f; + } else { + modelpart.translateAndRotate(poseStack); + } } } diff --git a/src/main/java/com/shynieke/statues/client/model/StatueBatModel.java b/src/main/java/com/shynieke/statues/client/model/StatueBatModel.java index 0fb461bb..b85fcafc 100644 --- a/src/main/java/com/shynieke/statues/client/model/StatueBatModel.java +++ b/src/main/java/com/shynieke/statues/client/model/StatueBatModel.java @@ -1,15 +1,15 @@ package com.shynieke.statues.client.model; -import com.shynieke.statues.entity.StatueBatEntity; +import com.shynieke.statues.client.model.state.StatueBatRenderState; import net.minecraft.client.animation.definitions.BatAnimation; -import net.minecraft.client.model.HierarchicalModel; +import net.minecraft.client.model.EntityModel; import net.minecraft.client.model.geom.ModelPart; import net.minecraft.client.renderer.RenderType; /** * Because vanilla BatModel doesn't allow any other class than BatEntity */ -public class StatueBatModel extends HierarchicalModel { +public class StatueBatModel extends EntityModel { private final ModelPart root; private final ModelPart head; private final ModelPart body; @@ -20,7 +20,7 @@ public class StatueBatModel extends HierarchicalModel { private final ModelPart feet; public StatueBatModel(ModelPart root) { - super(RenderType::entityCutout); + super(root, RenderType::entityCutout); this.root = root; this.body = root.getChild("body"); this.head = root.getChild("head"); @@ -31,23 +31,18 @@ public StatueBatModel(ModelPart root) { this.feet = this.body.getChild("feet"); } - @Override - public ModelPart root() { - return this.root; - } - /** * Sets this entity's model rotation angles */ @Override - public void setupAnim(StatueBatEntity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { - this.root().getAllParts().forEach(ModelPart::resetPose); - if (entity.isResting()) { - this.applyHeadRotation(netHeadYaw); + public void setupAnim(StatueBatRenderState statueBatRenderState) { + super.setupAnim(statueBatRenderState); + if (statueBatRenderState.isResting) { + this.applyHeadRotation(statueBatRenderState.yRot); } - this.animate(entity.flyAnimationState, BatAnimation.BAT_FLYING, ageInTicks, 1.0F); - this.animate(entity.restAnimationState, BatAnimation.BAT_RESTING, ageInTicks, 1.0F); + this.animate(statueBatRenderState.flyAnimationState, BatAnimation.BAT_FLYING, statueBatRenderState.ageInTicks, 1.0F); + this.animate(statueBatRenderState.restAnimationState, BatAnimation.BAT_RESTING, statueBatRenderState.ageInTicks, 1.0F); } private void applyHeadRotation(float headRotation) { diff --git a/src/main/java/com/shynieke/statues/client/model/StatuePlayerTileModel.java b/src/main/java/com/shynieke/statues/client/model/StatuePlayerTileModel.java index 3c925859..229ab758 100644 --- a/src/main/java/com/shynieke/statues/client/model/StatuePlayerTileModel.java +++ b/src/main/java/com/shynieke/statues/client/model/StatuePlayerTileModel.java @@ -1,12 +1,9 @@ package com.shynieke.statues.client.model; -import com.mojang.blaze3d.vertex.PoseStack; -import com.mojang.blaze3d.vertex.VertexConsumer; -import net.minecraft.client.model.PlayerModel; +import com.shynieke.statues.client.model.state.PlayerStatueRenderState; import net.minecraft.client.model.geom.ModelPart; -import net.minecraft.world.entity.LivingEntity; -public class StatuePlayerTileModel extends PlayerModel { +public class StatuePlayerTileModel extends PlayerStatueModel { public StatuePlayerTileModel(ModelPart part, boolean slim) { super(part, slim); this.hat.setPos(0.0F, -1.75F, 0.0F); @@ -14,7 +11,8 @@ public StatuePlayerTileModel(ModelPart part, boolean slim) { } @Override - public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int p_102036_, int p_102037_, int p_350361_) { + public void setupAnim(PlayerStatueRenderState renderState) { + super.setupAnim(renderState); this.setAllVisible(true); this.hat.visible = true; this.jacket.visible = true; @@ -22,6 +20,5 @@ public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, i this.rightPants.visible = true; this.leftSleeve.visible = true; this.rightSleeve.visible = true; - super.renderToBuffer(poseStack, vertexConsumer, p_102036_, p_102037_, p_350361_); } } diff --git a/src/main/java/com/shynieke/statues/client/model/state/PlayerStatueRenderState.java b/src/main/java/com/shynieke/statues/client/model/state/PlayerStatueRenderState.java new file mode 100644 index 00000000..16a09127 --- /dev/null +++ b/src/main/java/com/shynieke/statues/client/model/state/PlayerStatueRenderState.java @@ -0,0 +1,15 @@ +package com.shynieke.statues.client.model.state; + +import net.minecraft.client.renderer.entity.state.ArmorStandRenderState; +import net.minecraft.client.resources.DefaultPlayerSkin; +import net.minecraft.client.resources.PlayerSkin; + +public class PlayerStatueRenderState extends ArmorStandRenderState { + public PlayerSkin skin = DefaultPlayerSkin.getDefaultSkin(); + public int id; + public String name = "Steve"; + public int clientLock; + public float yOffset; + public boolean supporter; + public boolean upsideDown; +} diff --git a/src/main/java/com/shynieke/statues/client/model/state/StatueBatRenderState.java b/src/main/java/com/shynieke/statues/client/model/state/StatueBatRenderState.java new file mode 100644 index 00000000..18e67ff6 --- /dev/null +++ b/src/main/java/com/shynieke/statues/client/model/state/StatueBatRenderState.java @@ -0,0 +1,6 @@ +package com.shynieke.statues.client.model.state; + +import net.minecraft.client.renderer.entity.state.BatRenderState; + +public class StatueBatRenderState extends BatRenderState { +} diff --git a/src/main/java/com/shynieke/statues/client/property/StatueCompassAngle.java b/src/main/java/com/shynieke/statues/client/property/StatueCompassAngle.java new file mode 100644 index 00000000..6e51e29d --- /dev/null +++ b/src/main/java/com/shynieke/statues/client/property/StatueCompassAngle.java @@ -0,0 +1,33 @@ +package com.shynieke.statues.client.property; + +import com.mojang.serialization.MapCodec; +import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.client.renderer.item.properties.numeric.RangeSelectItemModelProperty; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.item.ItemStack; + +import javax.annotation.Nullable; + +public class StatueCompassAngle implements RangeSelectItemModelProperty { + public static final MapCodec MAP_CODEC = StatueCompassAngleState.MAP_CODEC.xmap(StatueCompassAngle::new, + angle -> angle.state); + private final StatueCompassAngleState state; + + public StatueCompassAngle(boolean b) { + this(new StatueCompassAngleState(b)); + } + + private StatueCompassAngle(StatueCompassAngleState p_388477_) { + this.state = p_388477_; + } + + @Override + public float get(ItemStack stack, @Nullable ClientLevel level, @Nullable LivingEntity livingEntity, int p_387210_) { + return this.state.get(stack, level, livingEntity, p_387210_); + } + + @Override + public MapCodec type() { + return MAP_CODEC; + } +} diff --git a/src/main/java/com/shynieke/statues/client/property/StatueCompassAngleState.java b/src/main/java/com/shynieke/statues/client/property/StatueCompassAngleState.java new file mode 100644 index 00000000..e2fe248d --- /dev/null +++ b/src/main/java/com/shynieke/statues/client/property/StatueCompassAngleState.java @@ -0,0 +1,96 @@ +package com.shynieke.statues.client.property; + +import com.mojang.serialization.Codec; +import com.mojang.serialization.MapCodec; +import com.mojang.serialization.codecs.RecordCodecBuilder; +import com.shynieke.statues.datacomponent.PlayerCompassData; +import com.shynieke.statues.registry.StatueDataComponents; +import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.client.renderer.item.properties.numeric.NeedleDirectionHelper; +import net.minecraft.core.BlockPos; +import net.minecraft.core.GlobalPos; +import net.minecraft.util.Mth; +import net.minecraft.util.RandomSource; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.phys.Vec3; + +import javax.annotation.Nullable; + +public class StatueCompassAngleState extends NeedleDirectionHelper { + public static final MapCodec MAP_CODEC = RecordCodecBuilder.mapCodec( + p_387422_ -> p_387422_.group( + Codec.BOOL.optionalFieldOf("wobble", Boolean.valueOf(true)).forGetter(StatueCompassAngleState::wobble) + ) + .apply(p_387422_, StatueCompassAngleState::new) + ); + private final NeedleDirectionHelper.Wobbler wobbler; + private final NeedleDirectionHelper.Wobbler noTargetWobbler; + private final RandomSource random = RandomSource.create(); + + public StatueCompassAngleState(boolean wobble) { + super(wobble); + this.wobbler = this.newWobbler(0.8F); + this.noTargetWobbler = this.newWobbler(0.8F); + } + + @Override + protected boolean wobble() { + return super.wobble(); + } + + @Override + protected float calculate(ItemStack stack, ClientLevel level, int p_388073_, Entity p_388489_) { + PlayerCompassData compassData = stack.get(StatueDataComponents.PLAYER_COMPASS_DATA.get()); + GlobalPos globalpos = compassData != null ? compassData.globalPos() : null; + long i = level.getGameTime(); + return !isValidCompassTargetPos(p_388489_, globalpos) + ? this.getRandomlySpinningRotation(p_388073_, i) + : this.getRotationTowardsCompassTarget(p_388489_, i, globalpos.pos()); + } + + private float getRandomlySpinningRotation(int p_388932_, long p_387198_) { + if (this.noTargetWobbler.shouldUpdate(p_387198_)) { + this.noTargetWobbler.update(p_387198_, this.random.nextFloat()); + } + + float f = this.noTargetWobbler.rotation() + (float) hash(p_388932_) / 2.1474836E9F; + return Mth.positiveModulo(f, 1.0F); + } + + private float getRotationTowardsCompassTarget(Entity p_387599_, long p_387654_, BlockPos p_388263_) { + float f = (float) getAngleFromEntityToPos(p_387599_, p_388263_); + float f1 = getWrappedVisualRotationY(p_387599_); + if (p_387599_ instanceof Player player && player.isLocalPlayer() && player.level().tickRateManager().runsNormally()) { + if (this.wobbler.shouldUpdate(p_387654_)) { + this.wobbler.update(p_387654_, 0.5F - (f1 - 0.25F)); + } + + float f3 = f + this.wobbler.rotation(); + return Mth.positiveModulo(f3, 1.0F); + } + + float f2 = 0.5F - (f1 - 0.25F - f); + return Mth.positiveModulo(f2, 1.0F); + } + + private static boolean isValidCompassTargetPos(Entity p_386563_, @Nullable GlobalPos p_387891_) { + return p_387891_ != null + && p_387891_.dimension() == p_386563_.level().dimension() + && !(p_387891_.pos().distToCenterSqr(p_386563_.position()) < 1.0E-5F); + } + + private static double getAngleFromEntityToPos(Entity p_388327_, BlockPos p_387426_) { + Vec3 vec3 = Vec3.atCenterOf(p_387426_); + return Math.atan2(vec3.z() - p_388327_.getZ(), vec3.x() - p_388327_.getX()) / (float) (Math.PI * 2); + } + + private static float getWrappedVisualRotationY(Entity p_386969_) { + return Mth.positiveModulo(p_386969_.getVisualRotationYInDegrees() / 360.0F, 1.0F); + } + + private static int hash(int p_387430_) { + return p_387430_ * 1327217883; + } +} \ No newline at end of file diff --git a/src/main/java/com/shynieke/statues/client/render/PlayerBER.java b/src/main/java/com/shynieke/statues/client/render/PlayerBER.java index 791f3d65..e9e2cd4d 100644 --- a/src/main/java/com/shynieke/statues/client/render/PlayerBER.java +++ b/src/main/java/com/shynieke/statues/client/render/PlayerBER.java @@ -7,6 +7,7 @@ import com.shynieke.statues.blocks.statues.PlayerStatueBlock; import com.shynieke.statues.client.ClientHandler; import com.shynieke.statues.client.model.StatuePlayerTileModel; +import com.shynieke.statues.client.model.state.PlayerStatueRenderState; import net.minecraft.ChatFormatting; import net.minecraft.Util; import net.minecraft.client.Minecraft; @@ -88,6 +89,7 @@ public void render(@Nullable Direction direction, @Nullable ResolvableProfile pr VertexConsumer vertexConsumer = bufferSource.getBuffer(getRenderType(profile)); StatuePlayerTileModel playerModel = isSlim ? slimModel : model; + playerModel.setupAnim(new PlayerStatueRenderState()); playerModel.renderToBuffer(poseStack, vertexConsumer, light, OverlayTexture.NO_OVERLAY); poseStack.popPose(); diff --git a/src/main/java/com/shynieke/statues/client/render/PlayerBEWLR.java b/src/main/java/com/shynieke/statues/client/render/PlayerBEWLR.java index 25376791..75537e63 100644 --- a/src/main/java/com/shynieke/statues/client/render/PlayerBEWLR.java +++ b/src/main/java/com/shynieke/statues/client/render/PlayerBEWLR.java @@ -1,129 +1,132 @@ -package com.shynieke.statues.client.render; - -import com.mojang.authlib.GameProfile; -import com.mojang.blaze3d.vertex.PoseStack; -import com.mojang.blaze3d.vertex.VertexConsumer; -import com.mojang.math.Axis; -import com.shynieke.statues.Statues; -import com.shynieke.statues.blockentities.PlayerBlockEntity; -import com.shynieke.statues.client.ClientHandler; -import com.shynieke.statues.client.model.StatuePlayerTileModel; -import net.minecraft.ChatFormatting; -import net.minecraft.Util; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.BlockEntityWithoutLevelRenderer; -import net.minecraft.client.renderer.MultiBufferSource; -import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; -import net.minecraft.client.renderer.texture.OverlayTexture; -import net.minecraft.client.resources.SkinManager; -import net.minecraft.core.component.DataComponents; -import net.minecraft.world.item.ItemDisplayContext; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.component.ResolvableProfile; - -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; - -public class PlayerBEWLR extends BlockEntityWithoutLevelRenderer { - private final StatuePlayerTileModel model; - private final StatuePlayerTileModel slimModel; - public boolean isSlim = false; - - public PlayerBEWLR(BlockEntityRendererProvider.Context context) { - super(Minecraft.getInstance().getBlockEntityRenderDispatcher(), Minecraft.getInstance().getEntityModels()); - this.model = new StatuePlayerTileModel(context.bakeLayer(ClientHandler.PLAYER_STATUE), false); - this.slimModel = new StatuePlayerTileModel(context.bakeLayer(ClientHandler.PLAYER_STATUE_SLIM), false); - } - - @Override - public void renderByItem(ItemStack stack, ItemDisplayContext transformType, PoseStack poseStack, MultiBufferSource bufferSource, int combinedLight, int combinedOverlay) { - renderPlayerItem(stack, poseStack, bufferSource, combinedLight); - } - - private static final Map GAMEPROFILE_CACHE = new HashMap<>(); - - public void renderPlayerItem(ItemStack stack, PoseStack poseStack, MultiBufferSource bufferSource, int combinedLight) { - poseStack.pushPose(); - if (stack != null) { - ResolvableProfile gameprofile = null; - - if (stack.has(DataComponents.CUSTOM_NAME)) { - String stackName = stack.getHoverName().getString().toLowerCase(Locale.ROOT); - boolean validFlag = !stackName.isEmpty() && !stackName.contains(" "); - - if (validFlag) { - if (GAMEPROFILE_CACHE.containsKey(stackName)) gameprofile = GAMEPROFILE_CACHE.get(stackName); - - if (!stack.has(DataComponents.PROFILE)) { - stack.set(DataComponents.PROFILE, gameprofile); - } - if (stack.has(DataComponents.PROFILE) && gameprofile == null) { - ResolvableProfile resolvableProfile = stack.get(DataComponents.PROFILE); - if (resolvableProfile != null && !resolvableProfile.isResolved()) { - stack.remove(DataComponents.PROFILE); - PlayerBlockEntity.resolve(resolvableProfile).thenAcceptAsync(profile -> - stack.set(DataComponents.PROFILE, profile), Minecraft.getInstance()); - } - } - - if (gameprofile == null) { - PlayerBlockEntity.fetchGameProfile(stackName).thenAccept((profile) -> { - if (profile.isPresent()) { - GameProfile profile1 = profile.orElse(new GameProfile(Util.NIL_UUID, stackName)); - ResolvableProfile resolvableProfile = new ResolvableProfile(profile1); - stack.set(DataComponents.PROFILE, resolvableProfile); - GAMEPROFILE_CACHE.put(profile1.getName().toLowerCase(), resolvableProfile); - } - }); - } - } else { - if (GAMEPROFILE_CACHE.containsKey("steve")) gameprofile = GAMEPROFILE_CACHE.get("steve"); - - if (gameprofile == null) { - Statues.LOGGER.error("Could not find profile for {}, defaulting to steve!", stackName); - PlayerBlockEntity.fetchGameProfile("steve").thenAccept((profile) -> { - if (profile.isPresent()) { - GameProfile profile1 = profile.orElse(new GameProfile(Util.NIL_UUID, "steve")); - GAMEPROFILE_CACHE.put(profile1.getName().toLowerCase(), new ResolvableProfile(profile1)); - } - }); - } - } - } - - poseStack.translate(0.5D, 1.4D, 0.5D); - poseStack.scale(-1.0F, -1.0F, 1.0F); - renderItem(gameprofile, poseStack, bufferSource, combinedLight); - } - poseStack.popPose(); - } - - public void renderItem(ResolvableProfile resolvableProfile, PoseStack poseStack, MultiBufferSource bufferSource, int combinedLight) { - SkinManager skinmanager = Minecraft.getInstance().getSkinManager(); - if (resolvableProfile != null && isSlim != skinmanager.getInsecureSkin(resolvableProfile.gameProfile()).model().id().equals("slim")) - isSlim = !isSlim; - - VertexConsumer vertexConsumer = bufferSource.getBuffer(PlayerBER.getRenderType(resolvableProfile)); - boolean isSupporter = false; - if (resolvableProfile != null) { - final String s = ChatFormatting.stripFormatting(resolvableProfile.name().orElse("Steve")); - if ("Dinnerbone".equalsIgnoreCase(s) || "Grumm".equalsIgnoreCase(s)) { - poseStack.translate(0.0D, 1.85D, 0.0D); - poseStack.mulPose(Axis.ZP.rotationDegrees(180.0F)); - } - isSupporter = ClientHandler.SUPPORTER.contains(resolvableProfile.id().orElse(Util.NIL_UUID)); - } - - int light = isSupporter ? 15728880 : combinedLight; - if (isSlim) { - if (slimModel != null) { - slimModel.renderToBuffer(poseStack, vertexConsumer, light, OverlayTexture.NO_OVERLAY); - } - } else { - if (model != null) { - model.renderToBuffer(poseStack, vertexConsumer, light, OverlayTexture.NO_OVERLAY); - } - } - } -} \ No newline at end of file +//package com.shynieke.statues.client.render; +// +//import com.mojang.authlib.GameProfile; +//import com.mojang.blaze3d.vertex.PoseStack; +//import com.mojang.blaze3d.vertex.VertexConsumer; +//import com.mojang.math.Axis; +//import com.shynieke.statues.Statues; +//import com.shynieke.statues.blockentities.PlayerBlockEntity; +//import com.shynieke.statues.client.ClientHandler; +//import com.shynieke.statues.client.model.StatuePlayerTileModel; +//import com.shynieke.statues.client.model.state.PlayerStatueRenderState; +//import net.minecraft.ChatFormatting; +//import net.minecraft.Util; +//import net.minecraft.client.Minecraft; +//import net.minecraft.client.renderer.BlockEntityWithoutLevelRenderer; +//import net.minecraft.client.renderer.MultiBufferSource; +//import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; +//import net.minecraft.client.renderer.texture.OverlayTexture; +//import net.minecraft.client.resources.SkinManager; +//import net.minecraft.core.component.DataComponents; +//import net.minecraft.world.item.ItemDisplayContext; +//import net.minecraft.world.item.ItemStack; +//import net.minecraft.world.item.component.ResolvableProfile; +// +//import java.util.HashMap; +//import java.util.Locale; +//import java.util.Map; +// +//public class PlayerBEWLR extends BlockEntityWithoutLevelRenderer { TODO: Figure out how to re-implement this +// private final StatuePlayerTileModel model; +// private final StatuePlayerTileModel slimModel; +// public boolean isSlim = false; +// +// public PlayerBEWLR(BlockEntityRendererProvider.Context context) { +// super(Minecraft.getInstance().getBlockEntityRenderDispatcher(), Minecraft.getInstance().getEntityModels()); +// this.model = new StatuePlayerTileModel(context.bakeLayer(ClientHandler.PLAYER_STATUE), false); +// this.slimModel = new StatuePlayerTileModel(context.bakeLayer(ClientHandler.PLAYER_STATUE_SLIM), false); +// } +// +// @Override +// public void renderByItem(ItemStack stack, ItemDisplayContext transformType, PoseStack poseStack, MultiBufferSource bufferSource, int combinedLight, int combinedOverlay) { +// renderPlayerItem(stack, poseStack, bufferSource, combinedLight); +// } +// +// private static final Map GAMEPROFILE_CACHE = new HashMap<>(); +// +// public void renderPlayerItem(ItemStack stack, PoseStack poseStack, MultiBufferSource bufferSource, int combinedLight) { +// poseStack.pushPose(); +// if (stack != null) { +// ResolvableProfile gameprofile = null; +// +// if (stack.has(DataComponents.CUSTOM_NAME)) { +// String stackName = stack.getHoverName().getString().toLowerCase(Locale.ROOT); +// boolean validFlag = !stackName.isEmpty() && !stackName.contains(" "); +// +// if (validFlag) { +// if (GAMEPROFILE_CACHE.containsKey(stackName)) gameprofile = GAMEPROFILE_CACHE.get(stackName); +// +// if (!stack.has(DataComponents.PROFILE)) { +// stack.set(DataComponents.PROFILE, gameprofile); +// } +// if (stack.has(DataComponents.PROFILE) && gameprofile == null) { +// ResolvableProfile resolvableProfile = stack.get(DataComponents.PROFILE); +// if (resolvableProfile != null && !resolvableProfile.isResolved()) { +// stack.remove(DataComponents.PROFILE); +// PlayerBlockEntity.resolve(resolvableProfile).thenAcceptAsync(profile -> +// stack.set(DataComponents.PROFILE, profile), Minecraft.getInstance()); +// } +// } +// +// if (gameprofile == null) { +// PlayerBlockEntity.fetchGameProfile(stackName).thenAccept((profile) -> { +// if (profile.isPresent()) { +// GameProfile profile1 = profile.orElse(new GameProfile(Util.NIL_UUID, stackName)); +// ResolvableProfile resolvableProfile = new ResolvableProfile(profile1); +// stack.set(DataComponents.PROFILE, resolvableProfile); +// GAMEPROFILE_CACHE.put(profile1.getName().toLowerCase(), resolvableProfile); +// } +// }); +// } +// } else { +// if (GAMEPROFILE_CACHE.containsKey("steve")) gameprofile = GAMEPROFILE_CACHE.get("steve"); +// +// if (gameprofile == null) { +// Statues.LOGGER.error("Could not find profile for {}, defaulting to steve!", stackName); +// PlayerBlockEntity.fetchGameProfile("steve").thenAccept((profile) -> { +// if (profile.isPresent()) { +// GameProfile profile1 = profile.orElse(new GameProfile(Util.NIL_UUID, "steve")); +// GAMEPROFILE_CACHE.put(profile1.getName().toLowerCase(), new ResolvableProfile(profile1)); +// } +// }); +// } +// } +// } +// +// poseStack.translate(0.5D, 1.4D, 0.5D); +// poseStack.scale(-1.0F, -1.0F, 1.0F); +// renderItem(gameprofile, poseStack, bufferSource, combinedLight); +// } +// poseStack.popPose(); +// } +// +// public void renderItem(ResolvableProfile resolvableProfile, PoseStack poseStack, MultiBufferSource bufferSource, int combinedLight) { +// SkinManager skinmanager = Minecraft.getInstance().getSkinManager(); +// if (resolvableProfile != null && isSlim != skinmanager.getInsecureSkin(resolvableProfile.gameProfile()).model().id().equals("slim")) +// isSlim = !isSlim; +// +// VertexConsumer vertexConsumer = bufferSource.getBuffer(PlayerBER.getRenderType(resolvableProfile)); +// boolean isSupporter = false; +// if (resolvableProfile != null) { +// final String s = ChatFormatting.stripFormatting(resolvableProfile.name().orElse("Steve")); +// if ("Dinnerbone".equalsIgnoreCase(s) || "Grumm".equalsIgnoreCase(s)) { +// poseStack.translate(0.0D, 1.85D, 0.0D); +// poseStack.mulPose(Axis.ZP.rotationDegrees(180.0F)); +// } +// isSupporter = ClientHandler.SUPPORTER.contains(resolvableProfile.id().orElse(Util.NIL_UUID)); +// } +// +// int light = isSupporter ? 15728880 : combinedLight; +// if (isSlim) { +// if (slimModel != null) { +// slimModel.setupAnim(new PlayerStatueRenderState()); +// slimModel.renderToBuffer(poseStack, vertexConsumer, light, OverlayTexture.NO_OVERLAY); +// } +// } else { +// if (model != null) { +// model.setupAnim(new PlayerStatueRenderState()); +// model.renderToBuffer(poseStack, vertexConsumer, light, OverlayTexture.NO_OVERLAY); +// } +// } +// } +//} \ No newline at end of file diff --git a/src/main/java/com/shynieke/statues/client/render/PlayerStatueRenderer.java b/src/main/java/com/shynieke/statues/client/render/PlayerStatueRenderer.java index eedef286..8d750e18 100644 --- a/src/main/java/com/shynieke/statues/client/render/PlayerStatueRenderer.java +++ b/src/main/java/com/shynieke/statues/client/render/PlayerStatueRenderer.java @@ -4,101 +4,134 @@ import com.mojang.math.Axis; import com.shynieke.statues.client.ClientHandler; import com.shynieke.statues.client.model.PlayerStatueModel; +import com.shynieke.statues.client.model.state.PlayerStatueRenderState; import com.shynieke.statues.entity.PlayerStatue; import net.minecraft.ChatFormatting; import net.minecraft.Util; import net.minecraft.client.Minecraft; -import net.minecraft.client.model.HumanoidModel; +import net.minecraft.client.model.HumanoidArmorModel; import net.minecraft.client.model.geom.ModelLayers; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.entity.EntityRendererProvider; +import net.minecraft.client.renderer.entity.HumanoidMobRenderer; import net.minecraft.client.renderer.entity.LivingEntityRenderer; import net.minecraft.client.renderer.entity.layers.CustomHeadLayer; -import net.minecraft.client.renderer.entity.layers.ElytraLayer; import net.minecraft.client.renderer.entity.layers.HumanoidArmorLayer; import net.minecraft.client.renderer.entity.layers.ItemInHandLayer; +import net.minecraft.client.renderer.entity.layers.WingsLayer; import net.minecraft.client.resources.DefaultPlayerSkin; +import net.minecraft.client.resources.PlayerSkin; +import net.minecraft.client.resources.PlayerSkin.Model; import net.minecraft.client.resources.SkinManager; import net.minecraft.resources.ResourceLocation; import net.minecraft.util.Mth; import net.minecraft.world.item.component.ResolvableProfile; +import org.jetbrains.annotations.Nullable; -public class PlayerStatueRenderer extends LivingEntityRenderer { +public class PlayerStatueRenderer extends LivingEntityRenderer { private final PlayerStatueModel playerModel; private final PlayerStatueModel slimPlayerModel; - public static final ResourceLocation defaultTexture = DefaultPlayerSkin.getDefaultTexture(); + public static final PlayerSkin defaultSkin = DefaultPlayerSkin.getDefaultSkin(); public boolean isSlim = false; public PlayerStatueRenderer(EntityRendererProvider.Context context) { this(context, false); } + @Override + public PlayerStatueRenderState createRenderState() { + return new PlayerStatueRenderState(); + } + + @Override + public void extractRenderState(PlayerStatue statue, PlayerStatueRenderState statueRenderState, float partialTick) { + super.extractRenderState(statue, statueRenderState, partialTick); + HumanoidMobRenderer.extractHumanoidRenderState(statue, statueRenderState, partialTick, this.itemModelResolver); + statueRenderState.yRot = Mth.rotLerp(partialTick, statue.yRotO, statue.getYRot()); + statueRenderState.isSmall = statue.isSmall(); + statueRenderState.bodyPose = statue.getBodyRotation(); + statueRenderState.headPose = statue.getHeadRotation(); + statueRenderState.leftArmPose = statue.getLeftArmRotation(); + statueRenderState.rightArmPose = statue.getRightArmRotation(); + statueRenderState.leftLegPose = statue.getLeftLegRotation(); + statueRenderState.rightLegPose = statue.getRightLegRotation(); + statueRenderState.wiggle = (float)(statue.level().getGameTime() - statue.punchCooldown) + partialTick; + + statueRenderState.skin = getSkin(statue.getGameProfile().orElse(null)); + statueRenderState.id = statue.getId(); + statueRenderState.name = statue.getGameProfile().isPresent() ? + statue.getGameProfile().get().gameProfile().getName() : "unknown"; + statueRenderState.clientLock = statue.clientLock; + statueRenderState.yOffset = statue.getYOffsetData(); + statueRenderState.supporter = isSupporter(statue); + statueRenderState.upsideDown = isPlayerUpsideDown(statue); + } + + private PlayerSkin getSkin(@Nullable ResolvableProfile profile) { + SkinManager skinmanager = Minecraft.getInstance().getSkinManager(); + if (profile != null) { + return skinmanager.getInsecureSkin(profile.gameProfile()); + } else { + return defaultSkin; + } + } + public PlayerStatueRenderer(EntityRendererProvider.Context context, boolean slim) { super(context, new PlayerStatueModel(context.bakeLayer(ModelLayers.PLAYER), slim), 0.0F); this.playerModel = new PlayerStatueModel(context.bakeLayer(ModelLayers.PLAYER), false); this.slimPlayerModel = new PlayerStatueModel(context.bakeLayer(ModelLayers.PLAYER_SLIM), true); - - this.addLayer(new HumanoidArmorLayer<>(this, - new HumanoidModel(context.bakeLayer(slim ? ModelLayers.PLAYER_SLIM_INNER_ARMOR : ModelLayers.PLAYER_INNER_ARMOR)), - new HumanoidModel(context.bakeLayer(slim ? ModelLayers.PLAYER_SLIM_OUTER_ARMOR : ModelLayers.PLAYER_OUTER_ARMOR)), context.getModelManager())); - this.addLayer(new ItemInHandLayer<>(this, context.getItemInHandRenderer())); - this.addLayer(new ElytraLayer<>(this, context.getModelSet())); - this.addLayer(new CustomHeadLayer<>(this, context.getModelSet(), context.getItemInHandRenderer())); + this.addLayer( + new HumanoidArmorLayer<>( + this, + new HumanoidArmorModel(context.bakeLayer(slim ? ModelLayers.PLAYER_SLIM_INNER_ARMOR : ModelLayers.PLAYER_INNER_ARMOR)), + new HumanoidArmorModel(context.bakeLayer(slim ? ModelLayers.PLAYER_SLIM_OUTER_ARMOR : ModelLayers.PLAYER_OUTER_ARMOR)), + context.getEquipmentRenderer() + ) + ); + this.addLayer(new ItemInHandLayer<>(this)); + this.addLayer(new WingsLayer<>(this, context.getModelSet(), context.getEquipmentRenderer())); + this.addLayer(new CustomHeadLayer<>(this, context.getModelSet())); } @Override - public ResourceLocation getTextureLocation(PlayerStatue playerStatue) { - return playerStatue.getGameProfile() - .map(this::getSkin) - .orElse(defaultTexture); - } - - private ResourceLocation getSkin(ResolvableProfile resolvableProfile) { - SkinManager skinmanager = Minecraft.getInstance().getSkinManager(); - if (resolvableProfile != null) - return skinmanager.getInsecureSkin(resolvableProfile.gameProfile()).texture(); - else - return defaultTexture; + public ResourceLocation getTextureLocation(PlayerStatueRenderState statueRenderState) { + return statueRenderState.skin.texture(); } @Override - public void render(PlayerStatue playerStatue, float entityYaw, float partialTicks, PoseStack poseStack, MultiBufferSource bufferSource, int packedLightIn) { - SkinManager skinmanager = Minecraft.getInstance().getSkinManager(); - if (playerStatue.getGameProfile().isPresent()) { - if (isSlim != skinmanager.getInsecureSkin(playerStatue.getGameProfile().get().gameProfile()).model().id().equals("slim")) - isSlim = !isSlim; + public void render(PlayerStatueRenderState statueRenderState, PoseStack poseStack, MultiBufferSource bufferSource, int packedLightIn) { + if (statueRenderState.skin != null && statueRenderState.skin.model() == Model.SLIM) { + isSlim = !isSlim; } this.model = isSlim ? this.slimPlayerModel : playerModel; - poseStack.translate(0, playerStatue.getYOffsetData(), 0); - if (playerStatue.clientLock > 0) { - playerStatue.xRotO = playerStatue.yBodyRot; - playerStatue.yHeadRotO = playerStatue.yHeadRot; + poseStack.translate(0, statueRenderState.yOffset, 0); + if (statueRenderState.clientLock > 0) { + statueRenderState.xRot = statueRenderState.bodyRot; } - super.render(playerStatue, entityYaw, partialTicks, poseStack, bufferSource, isSupporter(playerStatue) ? 15728880 : packedLightIn); + super.render(statueRenderState, poseStack, bufferSource, statueRenderState.supporter ? 15728880 : packedLightIn); } @Override - protected boolean shouldShowName(PlayerStatue playerStatue) { - return playerStatue.isCustomNameVisible(); + protected boolean shouldShowName(PlayerStatue statue, double offset) { + return statue.isCustomNameVisible(); } @Override - protected void setupRotations(PlayerStatue playerStatue, PoseStack poseStack, float ageInTicks, float rotationYaw, float partialTicks, float scale) { - poseStack.mulPose(Axis.YP.rotationDegrees(180.0F - rotationYaw)); - float f = (float) (playerStatue.level().getGameTime() - playerStatue.punchCooldown) + partialTicks; - if (f < 5.0F) { - poseStack.mulPose(Axis.YP.rotationDegrees(Mth.sin(f / 1.5F * (float) Math.PI) * 3.0F)); + protected void setupRotations(PlayerStatueRenderState statueRenderState, PoseStack poseStack, float partialTicks, float scale) { + poseStack.mulPose(Axis.YP.rotationDegrees(180.0F - partialTicks)); + if (statueRenderState.wiggle < 5.0F) { + poseStack.mulPose(Axis.YP.rotationDegrees(Mth.sin(statueRenderState.wiggle / 1.5F * (float) Math.PI) * 3.0F)); } - if (isPlayerUpsideDown(playerStatue)) { - poseStack.translate(0.0D, (double) (playerStatue.getBbHeight() + 0.1F), 0.0D); + if (statueRenderState.upsideDown) { + poseStack.translate(0.0D, (double) (statueRenderState.boundingBoxHeight + 0.1F), 0.0D); poseStack.mulPose(Axis.ZP.rotationDegrees(180.0F)); } } @Override - protected void scale(PlayerStatue playerStatue, PoseStack poseStack, float partialTickTime) { + protected void scale(PlayerStatueRenderState statueRenderState, PoseStack poseStack) { float f = 0.9375F; poseStack.scale(f, f, f); } diff --git a/src/main/java/com/shynieke/statues/client/render/StatueBatRenderer.java b/src/main/java/com/shynieke/statues/client/render/StatueBatRenderer.java index 4e323872..1f34124c 100644 --- a/src/main/java/com/shynieke/statues/client/render/StatueBatRenderer.java +++ b/src/main/java/com/shynieke/statues/client/render/StatueBatRenderer.java @@ -2,24 +2,39 @@ import com.shynieke.statues.Reference; import com.shynieke.statues.client.model.StatueBatModel; +import com.shynieke.statues.client.model.state.StatueBatRenderState; import com.shynieke.statues.entity.StatueBatEntity; import net.minecraft.client.model.geom.ModelLayers; import net.minecraft.client.renderer.entity.EntityRendererProvider.Context; import net.minecraft.client.renderer.entity.MobRenderer; +import net.minecraft.client.renderer.entity.state.BatRenderState; import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.ambient.Bat; -public class StatueBatRenderer extends MobRenderer { - private static final ResourceLocation BAT_TEXTURES = ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "textures/entity/statue_bat.png"); +public class StatueBatRenderer extends MobRenderer { + private static final ResourceLocation BAT_TEXTURES = Reference.modLoc("textures/entity/statue_bat.png"); public StatueBatRenderer(Context context) { super(context, new StatueBatModel(context.bakeLayer(ModelLayers.BAT)), 0.25F); } + @Override + public StatueBatRenderState createRenderState() { + return new StatueBatRenderState(); + } + + public void extractRenderState(StatueBatEntity statueBatEntity, StatueBatRenderState renderState, float partialTicks) { + super.extractRenderState(statueBatEntity, renderState, partialTicks); + renderState.isResting = statueBatEntity.isResting(); + renderState.flyAnimationState.copyFrom(statueBatEntity.flyAnimationState); + renderState.restAnimationState.copyFrom(statueBatEntity.restAnimationState); + } + /** * Returns the location of an entity's texture. */ @Override - public ResourceLocation getTextureLocation(StatueBatEntity statueBat) { + public ResourceLocation getTextureLocation(StatueBatRenderState renderState) { return BAT_TEXTURES; } } diff --git a/src/main/java/com/shynieke/statues/client/screen/PlayerPoseScreen.java b/src/main/java/com/shynieke/statues/client/screen/PlayerPoseScreen.java index 5c0a6408..1a42aaa2 100644 --- a/src/main/java/com/shynieke/statues/client/screen/PlayerPoseScreen.java +++ b/src/main/java/com/shynieke/statues/client/screen/PlayerPoseScreen.java @@ -26,6 +26,7 @@ import net.neoforged.api.distmarker.OnlyIn; import net.neoforged.neoforge.network.PacketDistributor; +@SuppressWarnings("rawtypes") @OnlyIn(Dist.CLIENT) public class PlayerPoseScreen extends Screen { private final PlayerStatue playerStatueEntity; diff --git a/src/main/java/com/shynieke/statues/client/screen/ShulkerStatueScreen.java b/src/main/java/com/shynieke/statues/client/screen/ShulkerStatueScreen.java index 8701f405..f70d8e97 100644 --- a/src/main/java/com/shynieke/statues/client/screen/ShulkerStatueScreen.java +++ b/src/main/java/com/shynieke/statues/client/screen/ShulkerStatueScreen.java @@ -4,12 +4,13 @@ import com.shynieke.statues.menu.ShulkerStatueMenu; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; +import net.minecraft.client.renderer.RenderType; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; public class ShulkerStatueScreen extends AbstractContainerScreen { - private final ResourceLocation TEXTURE = ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "textures/gui/container/shulker_statue.png"); + private final ResourceLocation TEXTURE = Reference.modLoc("textures/gui/container/shulker_statue.png"); public ShulkerStatueScreen(ShulkerStatueMenu screenContainer, Inventory inv, Component titleIn) { @@ -35,6 +36,6 @@ public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partia @Override protected void renderBg(GuiGraphics guiGraphics, float partialTicks, int x, int y) { - guiGraphics.blit(TEXTURE, this.leftPos, this.topPos, 0, 0, this.imageWidth, this.imageHeight); + guiGraphics.blit(RenderType::guiTextured, TEXTURE, this.leftPos, this.topPos, 0.0F, 0.0F, this.imageWidth, this.imageHeight, 256, 256); } } \ No newline at end of file diff --git a/src/main/java/com/shynieke/statues/client/screen/StatueTableScreen.java b/src/main/java/com/shynieke/statues/client/screen/StatueTableScreen.java index a398bece..8a8d3fe7 100644 --- a/src/main/java/com/shynieke/statues/client/screen/StatueTableScreen.java +++ b/src/main/java/com/shynieke/statues/client/screen/StatueTableScreen.java @@ -7,6 +7,7 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.Button; import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; +import net.minecraft.client.renderer.RenderType; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; @@ -17,7 +18,7 @@ public class StatueTableScreen extends AbstractContainerScreen { - private final ResourceLocation TEXTURE = ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "textures/gui/container/statue_table.png"); + private final ResourceLocation TEXTURE = Reference.modLoc("textures/gui/container/statue_table.png"); private Button buttonChisel; public StatueTableScreen(StatueTableMenu screenContainer, Inventory inv, Component titleIn) { @@ -55,7 +56,7 @@ public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partia @Override protected void renderBg(GuiGraphics guiGraphics, float partialTicks, int x, int y) { - guiGraphics.blit(TEXTURE, this.leftPos, this.topPos, 0, 0, this.imageWidth, this.imageHeight); + guiGraphics.blit(RenderType::guiTextured, TEXTURE, this.leftPos, this.topPos, 0.0F, 0.0F, this.imageWidth, this.imageHeight, 256, 256); } @Override diff --git a/src/main/java/com/shynieke/statues/client/screen/widget/EnumCycleButton.java b/src/main/java/com/shynieke/statues/client/screen/widget/EnumCycleButton.java index fdffb5d5..8b026993 100644 --- a/src/main/java/com/shynieke/statues/client/screen/widget/EnumCycleButton.java +++ b/src/main/java/com/shynieke/statues/client/screen/widget/EnumCycleButton.java @@ -10,7 +10,7 @@ public class EnumCycleButton> extends Button { private final String translationPrefix; private T value; - private T[] options; + private final T[] options; public EnumCycleButton(int x, int y, int width, int height, String translationPrefix, T defaultValue, T[] options, OnPress onPress, CreateNarration createNarration) { super(x, y, width, height, Component.translatable("statues." + translationPrefix + "." + defaultValue), onPress, createNarration); diff --git a/src/main/java/com/shynieke/statues/commands/StatuesCommands.java b/src/main/java/com/shynieke/statues/commands/StatuesCommands.java index 2bc2d1f5..2c4c6a52 100644 --- a/src/main/java/com/shynieke/statues/commands/StatuesCommands.java +++ b/src/main/java/com/shynieke/statues/commands/StatuesCommands.java @@ -76,12 +76,12 @@ private static int upgradeStatue(CommandContext ctx) throws upgrade.apply(heldStack, i); } ctx.getSource().sendSuccess( - () -> Component.translatable("commands.statues.upgrade.success", I18n.get(heldStack.getDescriptionId())).withStyle(ChatFormatting.GREEN), + () -> Component.translatable("commands.statues.upgrade.success", Component.translatable(heldStack.getItem().getDescriptionId()).getString()).withStyle(ChatFormatting.GREEN), true ); } else { ctx.getSource().sendFailure( - Component.translatable("commands.statues.upgrade.invalid", I18n.get(heldStack.getDescriptionId())).withStyle(ChatFormatting.RED) + Component.translatable("commands.statues.upgrade.invalid", Component.translatable(heldStack.getItem().getDescriptionId()).getString()).withStyle(ChatFormatting.RED) ); } return 0; diff --git a/src/main/java/com/shynieke/statues/commands/StatuesDevCommands.java b/src/main/java/com/shynieke/statues/commands/StatuesDevCommands.java index 3348f3df..cdc693f3 100644 --- a/src/main/java/com/shynieke/statues/commands/StatuesDevCommands.java +++ b/src/main/java/com/shynieke/statues/commands/StatuesDevCommands.java @@ -36,18 +36,18 @@ static int checkLoot(CommandContext ctx) { beBlocks.addAll(StatueBlockEntities.SHULKER_STATUE.get().getValidBlocks()); beBlocks.addAll(StatueBlockEntities.TROPICAL_FISH.get().getValidBlocks()); List missingBlocks = new ArrayList<>(); - ctx.getSource().getLevel().getRecipeManager().getAllRecipesFor(StatuesRecipes.LOOT_RECIPE.get()).forEach(recipe -> { - if (recipe.id().getNamespace().equals(Reference.MOD_ID)) { - for (Ingredient ingredient : recipe.value().getIngredients()) { - for (ItemStack stack : ingredient.getItems()) { - if (stack.getItem() instanceof BlockItem blockItem) { - if (!beBlocks.contains(blockItem.getBlock())) - missingBlocks.add(BuiltInRegistries.BLOCK.getKey(blockItem.getBlock())); - } - } - } - } - }); +// ctx.getSource().getLevel().getRecipeManager().getAllRecipesFor(StatuesRecipes.LOOT_RECIPE.get()).forEach(recipe -> { TODO: Fix this check loot command! +// if (recipe.id().getNamespace().equals(Reference.MOD_ID)) { +// for (Ingredient ingredient : recipe.value().getIngredients()) { +// for (ItemStack stack : ingredient.getItems()) { +// if (stack.getItem() instanceof BlockItem blockItem) { +// if (!beBlocks.contains(blockItem.getBlock())) +// missingBlocks.add(BuiltInRegistries.BLOCK.getKey(blockItem.getBlock())); +// } +// } +// } +// } +// }); if (missingBlocks.isEmpty()) { ctx.getSource().sendSuccess(() -> Component.literal("No blocks with loot are missing from the Statue block entity valid blocks"), false); } else { diff --git a/src/main/java/com/shynieke/statues/compat/curios/client/StatueCurioRenderer.java b/src/main/java/com/shynieke/statues/compat/curios/client/StatueCurioRenderer.java index aae249cc..d560010f 100644 --- a/src/main/java/com/shynieke/statues/compat/curios/client/StatueCurioRenderer.java +++ b/src/main/java/com/shynieke/statues/compat/curios/client/StatueCurioRenderer.java @@ -1,48 +1,48 @@ -package com.shynieke.statues.compat.curios.client; - -import com.mojang.blaze3d.vertex.PoseStack; -import com.mojang.math.Axis; -import com.shynieke.statues.items.StatueBlockItem; -import net.minecraft.client.Minecraft; -import net.minecraft.client.model.EntityModel; -import net.minecraft.client.player.AbstractClientPlayer; -import net.minecraft.client.renderer.MultiBufferSource; -import net.minecraft.client.renderer.entity.RenderLayerParent; -import net.minecraft.client.renderer.entity.player.PlayerRenderer; -import net.minecraft.client.renderer.texture.OverlayTexture; -import net.minecraft.core.registries.BuiltInRegistries; -import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemDisplayContext; -import net.minecraft.world.item.ItemStack; -import top.theillusivec4.curios.api.SlotContext; -import top.theillusivec4.curios.api.client.CuriosRendererRegistry; -import top.theillusivec4.curios.api.client.ICurioRenderer; - -public class StatueCurioRenderer implements ICurioRenderer { - public static void setupRenderer() { - for (Item item : BuiltInRegistries.ITEM.stream().toList()) { - if (item instanceof StatueBlockItem) { - CuriosRendererRegistry.register(item, StatueCurioRenderer::new); - } - } - } - - @Override - public > void render(ItemStack stack, SlotContext slotContext, PoseStack poseStack, - RenderLayerParent renderLayerParent, MultiBufferSource bufferSource, - int light, float limbSwing, float limbSwingAmount, float partialTicks, - float ageInTicks, float netHeadYaw, float headPitch) { - poseStack.pushPose(); - - Minecraft mc = Minecraft.getInstance(); - PlayerRenderer playerrenderer = (PlayerRenderer) mc.getEntityRenderDispatcher().getRenderer(mc.player); - playerrenderer.getModel().getHead().translateAndRotate(poseStack); - poseStack.translate(0.0D, -0.25D, 0.0D); - poseStack.mulPose(Axis.YP.rotationDegrees(180.0F)); - poseStack.scale(0.65F, -0.65F, -0.65F); - - mc.getItemRenderer().renderStatic(stack, ItemDisplayContext.HEAD, light, OverlayTexture.NO_OVERLAY, poseStack, bufferSource, mc.level, 0); - poseStack.popPose(); - } -} +//package com.shynieke.statues.compat.curios.client; +// +//import com.mojang.blaze3d.vertex.PoseStack; +//import com.mojang.math.Axis; +//import com.shynieke.statues.items.StatueBlockItem; +//import net.minecraft.client.Minecraft; +//import net.minecraft.client.model.EntityModel; +//import net.minecraft.client.player.AbstractClientPlayer; +//import net.minecraft.client.renderer.MultiBufferSource; +//import net.minecraft.client.renderer.entity.RenderLayerParent; +//import net.minecraft.client.renderer.entity.player.PlayerRenderer; +//import net.minecraft.client.renderer.texture.OverlayTexture; +//import net.minecraft.core.registries.BuiltInRegistries; +//import net.minecraft.world.entity.LivingEntity; +//import net.minecraft.world.item.Item; +//import net.minecraft.world.item.ItemDisplayContext; +//import net.minecraft.world.item.ItemStack; +//import top.theillusivec4.curios.api.SlotContext; +//import top.theillusivec4.curios.api.client.CuriosRendererRegistry; +//import top.theillusivec4.curios.api.client.ICurioRenderer; +// +//public class StatueCurioRenderer implements ICurioRenderer { +// public static void setupRenderer() { +// for (Item item : BuiltInRegistries.ITEM.stream().toList()) { +// if (item instanceof StatueBlockItem) { +// CuriosRendererRegistry.register(item, StatueCurioRenderer::new); +// } +// } +// } +// +// @Override +// public > void render(ItemStack stack, SlotContext slotContext, PoseStack poseStack, +// RenderLayerParent renderLayerParent, MultiBufferSource bufferSource, +// int light, float limbSwing, float limbSwingAmount, float partialTicks, +// float ageInTicks, float netHeadYaw, float headPitch) { +// poseStack.pushPose(); +// +// Minecraft mc = Minecraft.getInstance(); +// PlayerRenderer playerrenderer = (PlayerRenderer) mc.getEntityRenderDispatcher().getRenderer(mc.player); +// playerrenderer.getModel().getHead().translateAndRotate(poseStack); +// poseStack.translate(0.0D, -0.25D, 0.0D); +// poseStack.mulPose(Axis.YP.rotationDegrees(180.0F)); +// poseStack.scale(0.65F, -0.65F, -0.65F); +// +// mc.getItemRenderer().renderStatic(stack, ItemDisplayContext.HEAD, light, OverlayTexture.NO_OVERLAY, poseStack, bufferSource, mc.level, 0); +// poseStack.popPose(); +// } +//} diff --git a/src/main/java/com/shynieke/statues/compat/jade/JadeCompat.java b/src/main/java/com/shynieke/statues/compat/jade/JadeCompat.java index 01d4bfc5..48b06091 100644 --- a/src/main/java/com/shynieke/statues/compat/jade/JadeCompat.java +++ b/src/main/java/com/shynieke/statues/compat/jade/JadeCompat.java @@ -1,76 +1,76 @@ -package com.shynieke.statues.compat.jade; - -import com.shynieke.statues.Reference; -import com.shynieke.statues.blockentities.AbstractStatueBlockEntity; -import com.shynieke.statues.blocks.AbstractStatueBase; -import net.minecraft.ChatFormatting; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; -import net.minecraft.resources.ResourceLocation; -import snownee.jade.api.BlockAccessor; -import snownee.jade.api.IBlockComponentProvider; -import snownee.jade.api.ITooltip; -import snownee.jade.api.IWailaClientRegistration; -import snownee.jade.api.IWailaCommonRegistration; -import snownee.jade.api.IWailaPlugin; -import snownee.jade.api.WailaPlugin; -import snownee.jade.api.config.IPluginConfig; - -@WailaPlugin -public class JadeCompat implements IWailaPlugin { - - @Override - public void register(IWailaCommonRegistration registration) { - } - - @Override - public void registerClient(IWailaClientRegistration registration) { - registration.registerBlockComponent(PastryBodyHandler.INSTANCE, AbstractStatueBase.class); - } - - public static class PastryBodyHandler implements IBlockComponentProvider { - private static final ResourceLocation BITES = ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "upgrades"); - - public static final PastryBodyHandler INSTANCE = new PastryBodyHandler(); - - @Override - public void appendTooltip(ITooltip iTooltip, BlockAccessor blockAccessor, IPluginConfig iPluginConfig) { - if (blockAccessor.getBlockEntity() instanceof AbstractStatueBlockEntity statueBlockEntity) { - iTooltip.add(Component.translatable("statues.info.level").withStyle(ChatFormatting.GOLD) - .append(" ").append( - Component.literal(String.valueOf(statueBlockEntity.getStatueLevel())).withStyle(ChatFormatting.YELLOW) - ) - ); - iTooltip.add(Component.translatable("statues.info.kills").withStyle(ChatFormatting.GOLD) - .append(" ").append( - Component.literal(String.valueOf(statueBlockEntity.getKillCount())).withStyle(ChatFormatting.YELLOW) - ) - ); - iTooltip.add(Component.translatable("statues.info.upgrade_slots").withStyle(ChatFormatting.GOLD) - .append(" ").append( - Component.literal(String.valueOf(statueBlockEntity.getUpgradeSlots())).withStyle(ChatFormatting.YELLOW) - ) - ); - for (var entry : statueBlockEntity.getUpgrades().entrySet()) { - iTooltip.add(getUpgradeName(entry.getKey(), (int) entry.getValue())); - } - } - } - - private MutableComponent getUpgradeName(String id, int level) { - String descriptionID = "statues.upgrade." + id + ".name"; - MutableComponent mutablecomponent = Component.translatable(descriptionID).withStyle(ChatFormatting.GRAY); - - if (level > 0) { - mutablecomponent.append(" ").append(Component.translatable("enchantment.level." + level)); - } - - return mutablecomponent; - } - - @Override - public ResourceLocation getUid() { - return BITES; - } - } -} +//package com.shynieke.statues.compat.jade; +// +//import com.shynieke.statues.Reference; +//import com.shynieke.statues.blockentities.AbstractStatueBlockEntity; +//import com.shynieke.statues.blocks.AbstractStatueBase; +//import net.minecraft.ChatFormatting; +//import net.minecraft.network.chat.Component; +//import net.minecraft.network.chat.MutableComponent; +//import net.minecraft.resources.ResourceLocation; +//import snownee.jade.api.BlockAccessor; +//import snownee.jade.api.IBlockComponentProvider; +//import snownee.jade.api.ITooltip; +//import snownee.jade.api.IWailaClientRegistration; +//import snownee.jade.api.IWailaCommonRegistration; +//import snownee.jade.api.IWailaPlugin; +//import snownee.jade.api.WailaPlugin; +//import snownee.jade.api.config.IPluginConfig; +// +//@WailaPlugin +//public class JadeCompat implements IWailaPlugin { +// +// @Override +// public void register(IWailaCommonRegistration registration) { +// } +// +// @Override +// public void registerClient(IWailaClientRegistration registration) { +// registration.registerBlockComponent(PastryBodyHandler.INSTANCE, AbstractStatueBase.class); +// } +// +// public static class PastryBodyHandler implements IBlockComponentProvider { +// private static final ResourceLocation BITES = Reference.modLoc("upgrades"); +// +// public static final PastryBodyHandler INSTANCE = new PastryBodyHandler(); +// +// @Override +// public void appendTooltip(ITooltip iTooltip, BlockAccessor blockAccessor, IPluginConfig iPluginConfig) { +// if (blockAccessor.getBlockEntity() instanceof AbstractStatueBlockEntity statueBlockEntity) { +// iTooltip.add(Component.translatable("statues.info.level").withStyle(ChatFormatting.GOLD) +// .append(" ").append( +// Component.literal(String.valueOf(statueBlockEntity.getStatueLevel())).withStyle(ChatFormatting.YELLOW) +// ) +// ); +// iTooltip.add(Component.translatable("statues.info.kills").withStyle(ChatFormatting.GOLD) +// .append(" ").append( +// Component.literal(String.valueOf(statueBlockEntity.getKillCount())).withStyle(ChatFormatting.YELLOW) +// ) +// ); +// iTooltip.add(Component.translatable("statues.info.upgrade_slots").withStyle(ChatFormatting.GOLD) +// .append(" ").append( +// Component.literal(String.valueOf(statueBlockEntity.getUpgradeSlots())).withStyle(ChatFormatting.YELLOW) +// ) +// ); +// for (var entry : statueBlockEntity.getUpgrades().entrySet()) { +// iTooltip.add(getUpgradeName(entry.getKey(), (int) entry.getValue())); +// } +// } +// } +// +// private MutableComponent getUpgradeName(String id, int level) { +// String descriptionID = "statues.upgrade." + id + ".name"; +// MutableComponent mutablecomponent = Component.translatable(descriptionID).withStyle(ChatFormatting.GRAY); +// +// if (level > 0) { +// mutablecomponent.append(" ").append(Component.translatable("enchantment.level." + level)); +// } +// +// return mutablecomponent; +// } +// +// @Override +// public ResourceLocation getUid() { +// return BITES; +// } +// } +//} diff --git a/src/main/java/com/shynieke/statues/compat/jei/JEIPlugin.java b/src/main/java/com/shynieke/statues/compat/jei/JEIPlugin.java index 239c7e40..b0a47302 100644 --- a/src/main/java/com/shynieke/statues/compat/jei/JEIPlugin.java +++ b/src/main/java/com/shynieke/statues/compat/jei/JEIPlugin.java @@ -1,125 +1,125 @@ -package com.shynieke.statues.compat.jei; - -import com.shynieke.statues.Reference; -import com.shynieke.statues.Statues; -import com.shynieke.statues.blocks.AbstractStatueBase; -import com.shynieke.statues.compat.jei.category.LootCategory; -import com.shynieke.statues.compat.jei.category.UpgradeCategory; -import com.shynieke.statues.config.StatuesConfig; -import com.shynieke.statues.items.StatueBlockItem; -import com.shynieke.statues.recipe.LootRecipe; -import com.shynieke.statues.recipe.StatuesRecipes; -import com.shynieke.statues.recipe.UpgradeRecipe; -import com.shynieke.statues.registry.StatueRegistry; -import mezz.jei.api.IModPlugin; -import mezz.jei.api.JeiPlugin; -import mezz.jei.api.helpers.IGuiHelper; -import mezz.jei.api.helpers.IJeiHelpers; -import mezz.jei.api.recipe.RecipeType; -import mezz.jei.api.recipe.category.IRecipeCategory; -import mezz.jei.api.registration.IRecipeCatalystRegistration; -import mezz.jei.api.registration.IRecipeCategoryRegistration; -import mezz.jei.api.registration.IRecipeRegistration; -import net.minecraft.ChatFormatting; -import net.minecraft.client.Minecraft; -import net.minecraft.client.multiplayer.ClientLevel; -import net.minecraft.core.registries.BuiltInRegistries; -import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.entity.EntityType; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.crafting.RecipeHolder; -import org.jetbrains.annotations.Nullable; - -import java.util.List; -import java.util.Objects; - -@JeiPlugin -public class JEIPlugin implements IModPlugin { - - public static final ResourceLocation PLUGIN_UID = ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "main"); - - public static final ResourceLocation LOOT_BACKGROUND = ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "textures/gui/jei/loot.png"); - public static final RecipeType LOOT_TYPE = RecipeType.create(Reference.MOD_ID, "loot", LootRecipe.class); - - public static final ResourceLocation UPGRADE_BACKGROUND = ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "textures/gui/jei/upgrade.png"); - public static final RecipeType UPGRADE_TYPE = RecipeType.create(Reference.MOD_ID, "upgrade", UpgradeRecipe.class); - - @Nullable - private IRecipeCategory lootCategory; - - @Nullable - private IRecipeCategory upgradeCategory; - - @Override - public ResourceLocation getPluginUid() { - return PLUGIN_UID; - } - - @Override - public void registerRecipeCatalysts(IRecipeCatalystRegistration registration) { - registration.addRecipeCatalyst(new ItemStack(StatueRegistry.STATUE_TABLE.get()), LOOT_TYPE); - registration.addRecipeCatalyst(new ItemStack(StatueRegistry.STATUE_TABLE.get()), UPGRADE_TYPE); - } - - @Override - public void registerCategories(IRecipeCategoryRegistration registration) { - IJeiHelpers jeiHelpers = registration.getJeiHelpers(); - IGuiHelper guiHelper = jeiHelpers.getGuiHelper(); - registration.addRecipeCategories( - lootCategory = new LootCategory(guiHelper), - upgradeCategory = new UpgradeCategory(guiHelper) - ); - } - - @Override - public void registerRecipes(IRecipeRegistration registration) { - ClientLevel clientLevel = Objects.requireNonNull(Minecraft.getInstance().level); - registration.addRecipes(LOOT_TYPE, clientLevel.getRecipeManager().getAllRecipesFor(StatuesRecipes.LOOT_RECIPE.get()).stream().map(RecipeHolder::value).toList()); - registration.addRecipes(UPGRADE_TYPE, clientLevel.getRecipeManager().getAllRecipesFor(StatuesRecipes.UPGRADE_RECIPE.get()).stream().map(RecipeHolder::value).toList()); - - List statues = StatueRegistry.ITEMS.getEntries().stream() - .filter(registryObject -> registryObject.get() instanceof StatueBlockItem statueBlock && - statueBlock.getBlock() instanceof AbstractStatueBase statueBase && !statueBase.isHiddenStatue()) - .map(registryObject -> (StatueBlockItem) registryObject.get()).toList(); - double chance = StatuesConfig.COMMON.statueDropChance.get(); - for (StatueBlockItem statue : statues) { - if (statue.getEntity() == null) { - Statues.LOGGER.error("Tried adding info to statue but statue {} has no entity linked", BuiltInRegistries.ITEM.getKey(statue)); - } else { - int chancePercentage = (int) (chance * 100); - if (statue.getEntity() == EntityType.WARDEN || statue.getEntity() == EntityType.ELDER_GUARDIAN) { - chancePercentage = 100; - } else if (statue.getEntity() == EntityType.RAVAGER) { - chancePercentage = 25; - } - registration.addItemStackInfo(statue.getDefaultInstance(), - Component.translatable("statues.gui.jei.statue.info", - Component.translatable(statue.getDescriptionId()).withStyle(ChatFormatting.YELLOW).withStyle(ChatFormatting.BOLD), - Component.literal(chancePercentage + "%").withStyle(ChatFormatting.DARK_GREEN).withStyle(ChatFormatting.BOLD), - Component.translatable(statue.getEntity().getDescriptionId()).withStyle(ChatFormatting.RED).withStyle(ChatFormatting.BOLD) - ) - ); - } - } - registration.addItemStackInfo(StatueRegistry.STATUE_CORE.get().getDefaultInstance(), - Component.translatable("statues.gui.jei.statue_core.info", - Component.translatable(StatueRegistry.STATUE_CORE.get().getDescriptionId()).withStyle(ChatFormatting.YELLOW).withStyle(ChatFormatting.BOLD), - Component.translatable(StatueRegistry.STATUE_BAT.get().getDescriptionId()).withStyle(ChatFormatting.RED).withStyle(ChatFormatting.BOLD) - ), - Component.translatable("statues.gui.jei.statue_core.info2", - Component.translatable(StatueRegistry.STATUE_BAT.get().getDescriptionId()).withStyle(ChatFormatting.RED).withStyle(ChatFormatting.BOLD) - ) - ); - registration.addItemStackInfo(StatueRegistry.STATUE_TABLE.get().asItem().getDefaultInstance(), - Component.translatable("statues.gui.jei.statue_table.info"), - Component.translatable("statues.gui.jei.statue_table.info2"), - Component.translatable("statues.gui.jei.statue_table.info3"), - Component.translatable("statues.gui.jei.statue_table.info4"), - Component.translatable("statues.gui.jei.statue_table.info5"), - Component.translatable("statues.gui.jei.statue_table.info6"), - Component.translatable("statues.gui.jei.statue_table.info7"), - Component.translatable("statues.gui.jei.statue_table.info8") - ); - } -} +//package com.shynieke.statues.compat.jei; +// +//import com.shynieke.statues.Reference; +//import com.shynieke.statues.Statues; +//import com.shynieke.statues.blocks.AbstractStatueBase; +//import com.shynieke.statues.compat.jei.category.LootCategory; +//import com.shynieke.statues.compat.jei.category.UpgradeCategory; +//import com.shynieke.statues.config.StatuesConfig; +//import com.shynieke.statues.items.StatueBlockItem; +//import com.shynieke.statues.recipe.LootRecipe; +//import com.shynieke.statues.recipe.StatuesRecipes; +//import com.shynieke.statues.recipe.UpgradeRecipe; +//import com.shynieke.statues.registry.StatueRegistry; +//import mezz.jei.api.IModPlugin; +//import mezz.jei.api.JeiPlugin; +//import mezz.jei.api.helpers.IGuiHelper; +//import mezz.jei.api.helpers.IJeiHelpers; +//import mezz.jei.api.recipe.RecipeType; +//import mezz.jei.api.recipe.category.IRecipeCategory; +//import mezz.jei.api.registration.IRecipeCatalystRegistration; +//import mezz.jei.api.registration.IRecipeCategoryRegistration; +//import mezz.jei.api.registration.IRecipeRegistration; +//import net.minecraft.ChatFormatting; +//import net.minecraft.client.Minecraft; +//import net.minecraft.client.multiplayer.ClientLevel; +//import net.minecraft.core.registries.BuiltInRegistries; +//import net.minecraft.network.chat.Component; +//import net.minecraft.resources.ResourceLocation; +//import net.minecraft.world.entity.EntityType; +//import net.minecraft.world.item.ItemStack; +//import net.minecraft.world.item.crafting.RecipeHolder; +//import org.jetbrains.annotations.Nullable; +// +//import java.util.List; +//import java.util.Objects; +// +//@JeiPlugin +//public class JEIPlugin implements IModPlugin { +// +// public static final ResourceLocation PLUGIN_UID = Reference.modLoc("main"); +// +// public static final ResourceLocation LOOT_BACKGROUND = Reference.modLoc("textures/gui/jei/loot.png"); +// public static final RecipeType LOOT_TYPE = RecipeType.create(Reference.MOD_ID, "loot", LootRecipe.class); +// +// public static final ResourceLocation UPGRADE_BACKGROUND = Reference.modLoc("textures/gui/jei/upgrade.png"); +// public static final RecipeType UPGRADE_TYPE = RecipeType.create(Reference.MOD_ID, "upgrade", UpgradeRecipe.class); +// +// @Nullable +// private IRecipeCategory lootCategory; +// +// @Nullable +// private IRecipeCategory upgradeCategory; +// +// @Override +// public ResourceLocation getPluginUid() { +// return PLUGIN_UID; +// } +// +// @Override +// public void registerRecipeCatalysts(IRecipeCatalystRegistration registration) { +// registration.addRecipeCatalyst(new ItemStack(StatueRegistry.STATUE_TABLE.get()), LOOT_TYPE); +// registration.addRecipeCatalyst(new ItemStack(StatueRegistry.STATUE_TABLE.get()), UPGRADE_TYPE); +// } +// +// @Override +// public void registerCategories(IRecipeCategoryRegistration registration) { +// IJeiHelpers jeiHelpers = registration.getJeiHelpers(); +// IGuiHelper guiHelper = jeiHelpers.getGuiHelper(); +// registration.addRecipeCategories( +// lootCategory = new LootCategory(guiHelper), +// upgradeCategory = new UpgradeCategory(guiHelper) +// ); +// } +// +// @Override +// public void registerRecipes(IRecipeRegistration registration) { +// ClientLevel clientLevel = Objects.requireNonNull(Minecraft.getInstance().level); +// registration.addRecipes(LOOT_TYPE, clientLevel.getRecipeManager().getAllRecipesFor(StatuesRecipes.LOOT_RECIPE.get()).stream().map(RecipeHolder::value).toList()); +// registration.addRecipes(UPGRADE_TYPE, clientLevel.getRecipeManager().getAllRecipesFor(StatuesRecipes.UPGRADE_RECIPE.get()).stream().map(RecipeHolder::value).toList()); +// +// List statues = StatueRegistry.ITEMS.getEntries().stream() +// .filter(registryObject -> registryObject.get() instanceof StatueBlockItem statueBlock && +// statueBlock.getBlock() instanceof AbstractStatueBase statueBase && !statueBase.isHiddenStatue()) +// .map(registryObject -> (StatueBlockItem) registryObject.get()).toList(); +// double chance = StatuesConfig.COMMON.statueDropChance.get(); +// for (StatueBlockItem statue : statues) { +// if (statue.getEntity() == null) { +// Statues.LOGGER.error("Tried adding info to statue but statue {} has no entity linked", BuiltInRegistries.ITEM.getKey(statue)); +// } else { +// int chancePercentage = (int) (chance * 100); +// if (statue.getEntity() == EntityType.WARDEN || statue.getEntity() == EntityType.ELDER_GUARDIAN) { +// chancePercentage = 100; +// } else if (statue.getEntity() == EntityType.RAVAGER) { +// chancePercentage = 25; +// } +// registration.addItemStackInfo(statue.getDefaultInstance(), +// Component.translatable("statues.gui.jei.statue.info", +// Component.translatable(statue.getDescriptionId()).withStyle(ChatFormatting.YELLOW).withStyle(ChatFormatting.BOLD), +// Component.literal(chancePercentage + "%").withStyle(ChatFormatting.DARK_GREEN).withStyle(ChatFormatting.BOLD), +// Component.translatable(statue.getEntity().getDescriptionId()).withStyle(ChatFormatting.RED).withStyle(ChatFormatting.BOLD) +// ) +// ); +// } +// } +// registration.addItemStackInfo(StatueRegistry.STATUE_CORE.get().getDefaultInstance(), +// Component.translatable("statues.gui.jei.statue_core.info", +// Component.translatable(StatueRegistry.STATUE_CORE.get().getDescriptionId()).withStyle(ChatFormatting.YELLOW).withStyle(ChatFormatting.BOLD), +// Component.translatable(StatueRegistry.STATUE_BAT.get().getDescriptionId()).withStyle(ChatFormatting.RED).withStyle(ChatFormatting.BOLD) +// ), +// Component.translatable("statues.gui.jei.statue_core.info2", +// Component.translatable(StatueRegistry.STATUE_BAT.get().getDescriptionId()).withStyle(ChatFormatting.RED).withStyle(ChatFormatting.BOLD) +// ) +// ); +// registration.addItemStackInfo(StatueRegistry.STATUE_TABLE.get().asItem().getDefaultInstance(), +// Component.translatable("statues.gui.jei.statue_table.info"), +// Component.translatable("statues.gui.jei.statue_table.info2"), +// Component.translatable("statues.gui.jei.statue_table.info3"), +// Component.translatable("statues.gui.jei.statue_table.info4"), +// Component.translatable("statues.gui.jei.statue_table.info5"), +// Component.translatable("statues.gui.jei.statue_table.info6"), +// Component.translatable("statues.gui.jei.statue_table.info7"), +// Component.translatable("statues.gui.jei.statue_table.info8") +// ); +// } +//} diff --git a/src/main/java/com/shynieke/statues/compat/jei/category/LootCategory.java b/src/main/java/com/shynieke/statues/compat/jei/category/LootCategory.java index c401fe42..e99208e0 100644 --- a/src/main/java/com/shynieke/statues/compat/jei/category/LootCategory.java +++ b/src/main/java/com/shynieke/statues/compat/jei/category/LootCategory.java @@ -1,81 +1,81 @@ -package com.shynieke.statues.compat.jei.category; - -import com.shynieke.statues.compat.jei.JEIPlugin; -import com.shynieke.statues.recipe.LootRecipe; -import com.shynieke.statues.registry.StatueRegistry; -import mezz.jei.api.constants.VanillaTypes; -import mezz.jei.api.gui.builder.IRecipeLayoutBuilder; -import mezz.jei.api.gui.drawable.IDrawable; -import mezz.jei.api.gui.ingredient.IRecipeSlotsView; -import mezz.jei.api.helpers.IGuiHelper; -import mezz.jei.api.recipe.IFocusGroup; -import mezz.jei.api.recipe.RecipeIngredientRole; -import mezz.jei.api.recipe.RecipeType; -import mezz.jei.api.recipe.category.IRecipeCategory; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Font; -import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.client.multiplayer.ClientLevel; -import net.minecraft.core.RegistryAccess; -import net.minecraft.network.chat.Component; -import net.minecraft.world.item.ItemStack; - -public class LootCategory implements IRecipeCategory { - private final IDrawable background; - private final IDrawable icon; - private final Component localizedName; - - public LootCategory(IGuiHelper guiHelper) { - this.background = guiHelper.createDrawable(JEIPlugin.LOOT_BACKGROUND, 0, 0, 100, 62); - this.icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(StatueRegistry.STATUE_TABLE.get())); - this.localizedName = Component.translatable("statues.gui.jei.category.loot"); - } - - @Override - public RecipeType getRecipeType() { - return JEIPlugin.LOOT_TYPE; - } - - @SuppressWarnings("removal") - @Override - public IDrawable getBackground() { - return background; - } - - @Override - public IDrawable getIcon() { - return icon; - } - - @Override - public void setRecipe(IRecipeLayoutBuilder builder, LootRecipe recipe, IFocusGroup focuses) { - Minecraft minecraft = Minecraft.getInstance(); - ClientLevel level = minecraft.level; - if (level == null) { - throw new NullPointerException("level must not be null."); - } - RegistryAccess registryAccess = level.registryAccess(); - - builder.addSlot(RecipeIngredientRole.INPUT, 1, 23).addIngredients(recipe.getIngredients().getFirst()); - - builder.addSlot(RecipeIngredientRole.OUTPUT, 55, 5).addItemStack(recipe.getResultItem(registryAccess)); - builder.addSlot(RecipeIngredientRole.OUTPUT, 55, 23).addItemStack(recipe.getResultItem2(registryAccess)); - builder.addSlot(RecipeIngredientRole.OUTPUT, 55, 41).addItemStack(recipe.getResultItem3(registryAccess)); - } - - @Override - public void draw(LootRecipe recipe, IRecipeSlotsView recipeSlotsView, GuiGraphics guiGraphics, double mouseX, double mouseY) { - IRecipeCategory.super.draw(recipe, recipeSlotsView, guiGraphics, mouseX, mouseY); - - Minecraft minecraft = Minecraft.getInstance(); - Font font = minecraft.font; - guiGraphics.drawString(font, Component.literal((int) (100 * recipe.getChance1()) + "%"), 74, 8, 0, false); - guiGraphics.drawString(font, Component.literal((int) (100 * recipe.getChance2()) + "%"), 74, 27, 0, false); - guiGraphics.drawString(font, Component.literal((int) (100 * recipe.getChance3()) + "%"), 74, 45, 0, false); - } - - @Override - public Component getTitle() { - return localizedName; - } -} +//package com.shynieke.statues.compat.jei.category; +// +//import com.shynieke.statues.compat.jei.JEIPlugin; +//import com.shynieke.statues.recipe.LootRecipe; +//import com.shynieke.statues.registry.StatueRegistry; +//import mezz.jei.api.constants.VanillaTypes; +//import mezz.jei.api.gui.builder.IRecipeLayoutBuilder; +//import mezz.jei.api.gui.drawable.IDrawable; +//import mezz.jei.api.gui.ingredient.IRecipeSlotsView; +//import mezz.jei.api.helpers.IGuiHelper; +//import mezz.jei.api.recipe.IFocusGroup; +//import mezz.jei.api.recipe.RecipeIngredientRole; +//import mezz.jei.api.recipe.RecipeType; +//import mezz.jei.api.recipe.category.IRecipeCategory; +//import net.minecraft.client.Minecraft; +//import net.minecraft.client.gui.Font; +//import net.minecraft.client.gui.GuiGraphics; +//import net.minecraft.client.multiplayer.ClientLevel; +//import net.minecraft.core.RegistryAccess; +//import net.minecraft.network.chat.Component; +//import net.minecraft.world.item.ItemStack; +// +//public class LootCategory implements IRecipeCategory { +// private final IDrawable background; +// private final IDrawable icon; +// private final Component localizedName; +// +// public LootCategory(IGuiHelper guiHelper) { +// this.background = guiHelper.createDrawable(JEIPlugin.LOOT_BACKGROUND, 0, 0, 100, 62); +// this.icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(StatueRegistry.STATUE_TABLE.get())); +// this.localizedName = Component.translatable("statues.gui.jei.category.loot"); +// } +// +// @Override +// public RecipeType getRecipeType() { +// return JEIPlugin.LOOT_TYPE; +// } +// +// @SuppressWarnings("removal") +// @Override +// public IDrawable getBackground() { +// return background; +// } +// +// @Override +// public IDrawable getIcon() { +// return icon; +// } +// +// @Override +// public void setRecipe(IRecipeLayoutBuilder builder, LootRecipe recipe, IFocusGroup focuses) { +// Minecraft minecraft = Minecraft.getInstance(); +// ClientLevel level = minecraft.level; +// if (level == null) { +// throw new NullPointerException("level must not be null."); +// } +// RegistryAccess registryAccess = level.registryAccess(); +// +// builder.addSlot(RecipeIngredientRole.INPUT, 1, 23).addIngredients(recipe.getIngredients().getFirst()); +// +// builder.addSlot(RecipeIngredientRole.OUTPUT, 55, 5).addItemStack(recipe.getResultItem(registryAccess)); +// builder.addSlot(RecipeIngredientRole.OUTPUT, 55, 23).addItemStack(recipe.getResultItem2(registryAccess)); +// builder.addSlot(RecipeIngredientRole.OUTPUT, 55, 41).addItemStack(recipe.getResultItem3(registryAccess)); +// } +// +// @Override +// public void draw(LootRecipe recipe, IRecipeSlotsView recipeSlotsView, GuiGraphics guiGraphics, double mouseX, double mouseY) { +// IRecipeCategory.super.draw(recipe, recipeSlotsView, guiGraphics, mouseX, mouseY); +// +// Minecraft minecraft = Minecraft.getInstance(); +// Font font = minecraft.font; +// guiGraphics.drawString(font, Component.literal((int) (100 * recipe.getChance1()) + "%"), 74, 8, 0, false); +// guiGraphics.drawString(font, Component.literal((int) (100 * recipe.getChance2()) + "%"), 74, 27, 0, false); +// guiGraphics.drawString(font, Component.literal((int) (100 * recipe.getChance3()) + "%"), 74, 45, 0, false); +// } +// +// @Override +// public Component getTitle() { +// return localizedName; +// } +//} diff --git a/src/main/java/com/shynieke/statues/compat/jei/category/UpgradeCategory.java b/src/main/java/com/shynieke/statues/compat/jei/category/UpgradeCategory.java index 6943e0f9..a93cb6a4 100644 --- a/src/main/java/com/shynieke/statues/compat/jei/category/UpgradeCategory.java +++ b/src/main/java/com/shynieke/statues/compat/jei/category/UpgradeCategory.java @@ -1,198 +1,198 @@ -package com.shynieke.statues.compat.jei.category; - -import com.shynieke.statues.compat.jei.JEIPlugin; -import com.shynieke.statues.datacomponent.StatueStats; -import com.shynieke.statues.recipe.UpgradeRecipe; -import com.shynieke.statues.recipe.UpgradeType; -import com.shynieke.statues.registry.StatueDataComponents; -import com.shynieke.statues.registry.StatueRegistry; -import com.shynieke.statues.registry.StatueTags; -import mezz.jei.api.constants.VanillaTypes; -import mezz.jei.api.gui.builder.IRecipeLayoutBuilder; -import mezz.jei.api.gui.builder.ITooltipBuilder; -import mezz.jei.api.gui.drawable.IDrawable; -import mezz.jei.api.gui.ingredient.IRecipeSlotRichTooltipCallback; -import mezz.jei.api.gui.ingredient.IRecipeSlotView; -import mezz.jei.api.gui.ingredient.IRecipeSlotsView; -import mezz.jei.api.helpers.IGuiHelper; -import mezz.jei.api.recipe.IFocus; -import mezz.jei.api.recipe.IFocusGroup; -import mezz.jei.api.recipe.RecipeIngredientRole; -import mezz.jei.api.recipe.RecipeType; -import mezz.jei.api.recipe.category.IRecipeCategory; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.client.multiplayer.ClientLevel; -import net.minecraft.core.RegistryAccess; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.crafting.Ingredient; - -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - -public class UpgradeCategory implements IRecipeCategory { - private final IDrawable background; - private final IDrawable icon; - private final Component localizedName; - - public UpgradeCategory(IGuiHelper guiHelper) { - this.background = guiHelper.createDrawable(JEIPlugin.UPGRADE_BACKGROUND, 0, 0, 148, 62); - this.icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(StatueRegistry.STATUE_TABLE.get())); - this.localizedName = Component.translatable("statues.gui.jei.category.upgrade"); - } - - @Override - public RecipeType getRecipeType() { - return JEIPlugin.UPGRADE_TYPE; - } - - @SuppressWarnings("removal") - @Override - public IDrawable getBackground() { - return background; - } - - @Override - public IDrawable getIcon() { - return icon; - } - - @Override - public void setRecipe(IRecipeLayoutBuilder builder, UpgradeRecipe recipe, IFocusGroup focuses) { - UpgradeTooltipCallback callback = new UpgradeTooltipCallback(recipe); - Minecraft minecraft = Minecraft.getInstance(); - ClientLevel level = minecraft.level; - if (level == null) { - throw new NullPointerException("level must not be null."); - } - RegistryAccess registryAccess = level.registryAccess(); - - final Optional> focused = focuses.getAllFocuses().stream().findFirst(); - final int tier = recipe.getTier(); - if (focused.isPresent() && focused.get().getTypedValue().getIngredient() instanceof ItemStack focusStack && - recipe.getCenter().test(focusStack)) { - ItemStack centerStack = focusStack.copy(); - //Make sure if the center is focused that it doesn't scroll through more stacks - fillInTag(centerStack, recipe); - if (recipe.getUpgradeType() == UpgradeType.UNGLOWING) { - UpgradeType.GLOWING.apply(centerStack, -1); - } - if (tier > -1) { - for (int i = 0; i < tier; i++) { - recipe.getUpgradeType().apply(centerStack, i); - } - } - if (recipe.getUpgradeType() == UpgradeType.UPGRADE) { - setUpgradeSlots(centerStack, 0); - } else { - setUpgradeSlots(centerStack, 1); - } - builder.addSlot(RecipeIngredientRole.INPUT, 73, 23).addItemStack(centerStack); - - if (recipe.getResultItem(registryAccess).isEmpty()) { - ItemStack outputStack = centerStack.copy(); - recipe.getUpgradeType().apply(outputStack, tier); - if (recipe.getUpgradeType() == UpgradeType.UPGRADE) { - setUpgradeSlots(outputStack, 0); - } else { - setUpgradeSlots(outputStack, 1); - } - builder.addSlot(RecipeIngredientRole.OUTPUT, 127, 23).addItemStack(outputStack).addRichTooltipCallback(callback); - } else { - builder.addSlot(RecipeIngredientRole.OUTPUT, 127, 23).addItemStack(recipe.getResultItem(registryAccess)).addRichTooltipCallback(callback); - } - } else { - List centerList = new ArrayList<>(); - for (ItemStack centerStack : recipe.getCenter().getItems()) { - ItemStack stack = centerStack.copy(); - fillInTag(stack, recipe); - if (recipe.getUpgradeType() == UpgradeType.UNGLOWING) { - UpgradeType.GLOWING.apply(stack, -1); - } - if (tier > -1) { - for (int i = 0; i < tier; i++) { - recipe.getUpgradeType().apply(stack, i); - } - } - if (recipe.getUpgradeType() == UpgradeType.UPGRADE) { - setUpgradeSlots(stack, 0); - } else { - setUpgradeSlots(stack, 1); - } - centerList.add(stack); - } - builder.addSlot(RecipeIngredientRole.INPUT, 73, 23).addItemStacks(centerList); - - if (recipe.getResultItem(registryAccess).isEmpty()) { - List stackList = new ArrayList<>(); - for (ItemStack centerStack : centerList) { - ItemStack stack = centerStack.copy(); - recipe.getUpgradeType().apply(stack, tier); - if (recipe.getUpgradeType() == UpgradeType.UPGRADE) { - setUpgradeSlots(stack, 1); - } else { - setUpgradeSlots(stack, 0); - } - stackList.add(stack); - } - builder.addSlot(RecipeIngredientRole.OUTPUT, 127, 23).addItemStacks(stackList).addRichTooltipCallback(callback); - } else { - builder.addSlot(RecipeIngredientRole.OUTPUT, 127, 23).addItemStack(recipe.getResultItem(registryAccess)).addRichTooltipCallback(callback); - } - } - - builder.addSlot(RecipeIngredientRole.CATALYST, 1, 41).addIngredients(recipe.requiresCore() ? Ingredient.of(StatueTags.STATUE_CORE) : Ingredient.EMPTY); - List catalysts = recipe.getCatalysts(); - if (catalysts.size() > 0) { - builder.addSlot(RecipeIngredientRole.CATALYST, 55, 5).addIngredients(catalysts.get(0)); - if (catalysts.size() > 1) { - builder.addSlot(RecipeIngredientRole.CATALYST, 91, 5).addIngredients(catalysts.get(1)); - if (catalysts.size() > 2) { - builder.addSlot(RecipeIngredientRole.CATALYST, 55, 41).addIngredients(catalysts.get(2)); - if (catalysts.size() > 3) { - builder.addSlot(RecipeIngredientRole.CATALYST, 91, 41).addIngredients(catalysts.get(3)); - } - } - } - } - } - - private void fillInTag(ItemStack stack, UpgradeRecipe recipe) { - int tier = recipe.getTier(); - int actualTier = tier == -1 ? recipe.getUpgradeType() == UpgradeType.UPGRADE ? 0 : 1 : tier + 1; - StatueStats stats = new StatueStats(actualTier, actualTier * 10, 20); - stack.set(StatueDataComponents.STATS, stats); - stack.set(StatueDataComponents.UPGRADED, true); - } - - private void setUpgradeSlots(ItemStack stack, int count) { - StatueStats stats = stack.getOrDefault(StatueDataComponents.STATS, StatueStats.empty()); - stack.set(StatueDataComponents.STATS, new StatueStats(stats.level(), count, stats.killCount())); - } - - @Override - public void draw(UpgradeRecipe recipe, IRecipeSlotsView recipeSlotsView, GuiGraphics guiGraphics, double mouseX, double mouseY) { - IRecipeCategory.super.draw(recipe, recipeSlotsView, guiGraphics, mouseX, mouseY); - } - - public static class UpgradeTooltipCallback implements IRecipeSlotRichTooltipCallback { - public final MutableComponent component; - - public UpgradeTooltipCallback(UpgradeRecipe recipe) { - this.component = recipe.getUpgradeName(); - } - - @Override - public void onRichTooltip(IRecipeSlotView recipeSlotView, ITooltipBuilder tooltip) { - tooltip.add(component); - } - } - - @Override - public Component getTitle() { - return localizedName; - } -} +//package com.shynieke.statues.compat.jei.category; +// +//import com.shynieke.statues.compat.jei.JEIPlugin; +//import com.shynieke.statues.datacomponent.StatueStats; +//import com.shynieke.statues.recipe.UpgradeRecipe; +//import com.shynieke.statues.recipe.UpgradeType; +//import com.shynieke.statues.registry.StatueDataComponents; +//import com.shynieke.statues.registry.StatueRegistry; +//import com.shynieke.statues.registry.StatueTags; +//import mezz.jei.api.constants.VanillaTypes; +//import mezz.jei.api.gui.builder.IRecipeLayoutBuilder; +//import mezz.jei.api.gui.builder.ITooltipBuilder; +//import mezz.jei.api.gui.drawable.IDrawable; +//import mezz.jei.api.gui.ingredient.IRecipeSlotRichTooltipCallback; +//import mezz.jei.api.gui.ingredient.IRecipeSlotView; +//import mezz.jei.api.gui.ingredient.IRecipeSlotsView; +//import mezz.jei.api.helpers.IGuiHelper; +//import mezz.jei.api.recipe.IFocus; +//import mezz.jei.api.recipe.IFocusGroup; +//import mezz.jei.api.recipe.RecipeIngredientRole; +//import mezz.jei.api.recipe.RecipeType; +//import mezz.jei.api.recipe.category.IRecipeCategory; +//import net.minecraft.client.Minecraft; +//import net.minecraft.client.gui.GuiGraphics; +//import net.minecraft.client.multiplayer.ClientLevel; +//import net.minecraft.core.RegistryAccess; +//import net.minecraft.network.chat.Component; +//import net.minecraft.network.chat.MutableComponent; +//import net.minecraft.world.item.ItemStack; +//import net.minecraft.world.item.crafting.Ingredient; +// +//import java.util.ArrayList; +//import java.util.List; +//import java.util.Optional; +// +//public class UpgradeCategory implements IRecipeCategory { +// private final IDrawable background; +// private final IDrawable icon; +// private final Component localizedName; +// +// public UpgradeCategory(IGuiHelper guiHelper) { +// this.background = guiHelper.createDrawable(JEIPlugin.UPGRADE_BACKGROUND, 0, 0, 148, 62); +// this.icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(StatueRegistry.STATUE_TABLE.get())); +// this.localizedName = Component.translatable("statues.gui.jei.category.upgrade"); +// } +// +// @Override +// public RecipeType getRecipeType() { +// return JEIPlugin.UPGRADE_TYPE; +// } +// +// @SuppressWarnings("removal") +// @Override +// public IDrawable getBackground() { +// return background; +// } +// +// @Override +// public IDrawable getIcon() { +// return icon; +// } +// +// @Override +// public void setRecipe(IRecipeLayoutBuilder builder, UpgradeRecipe recipe, IFocusGroup focuses) { +// UpgradeTooltipCallback callback = new UpgradeTooltipCallback(recipe); +// Minecraft minecraft = Minecraft.getInstance(); +// ClientLevel level = minecraft.level; +// if (level == null) { +// throw new NullPointerException("level must not be null."); +// } +// RegistryAccess registryAccess = level.registryAccess(); +// +// final Optional> focused = focuses.getAllFocuses().stream().findFirst(); +// final int tier = recipe.getTier(); +// if (focused.isPresent() && focused.get().getTypedValue().getIngredient() instanceof ItemStack focusStack && +// recipe.getCenter().test(focusStack)) { +// ItemStack centerStack = focusStack.copy(); +// //Make sure if the center is focused that it doesn't scroll through more stacks +// fillInTag(centerStack, recipe); +// if (recipe.getUpgradeType() == UpgradeType.UNGLOWING) { +// UpgradeType.GLOWING.apply(centerStack, -1); +// } +// if (tier > -1) { +// for (int i = 0; i < tier; i++) { +// recipe.getUpgradeType().apply(centerStack, i); +// } +// } +// if (recipe.getUpgradeType() == UpgradeType.UPGRADE) { +// setUpgradeSlots(centerStack, 0); +// } else { +// setUpgradeSlots(centerStack, 1); +// } +// builder.addSlot(RecipeIngredientRole.INPUT, 73, 23).addItemStack(centerStack); +// +// if (recipe.getResultItem(registryAccess).isEmpty()) { +// ItemStack outputStack = centerStack.copy(); +// recipe.getUpgradeType().apply(outputStack, tier); +// if (recipe.getUpgradeType() == UpgradeType.UPGRADE) { +// setUpgradeSlots(outputStack, 0); +// } else { +// setUpgradeSlots(outputStack, 1); +// } +// builder.addSlot(RecipeIngredientRole.OUTPUT, 127, 23).addItemStack(outputStack).addRichTooltipCallback(callback); +// } else { +// builder.addSlot(RecipeIngredientRole.OUTPUT, 127, 23).addItemStack(recipe.getResultItem(registryAccess)).addRichTooltipCallback(callback); +// } +// } else { +// List centerList = new ArrayList<>(); +// for (ItemStack centerStack : recipe.getCenter().getItems()) { +// ItemStack stack = centerStack.copy(); +// fillInTag(stack, recipe); +// if (recipe.getUpgradeType() == UpgradeType.UNGLOWING) { +// UpgradeType.GLOWING.apply(stack, -1); +// } +// if (tier > -1) { +// for (int i = 0; i < tier; i++) { +// recipe.getUpgradeType().apply(stack, i); +// } +// } +// if (recipe.getUpgradeType() == UpgradeType.UPGRADE) { +// setUpgradeSlots(stack, 0); +// } else { +// setUpgradeSlots(stack, 1); +// } +// centerList.add(stack); +// } +// builder.addSlot(RecipeIngredientRole.INPUT, 73, 23).addItemStacks(centerList); +// +// if (recipe.getResultItem(registryAccess).isEmpty()) { +// List stackList = new ArrayList<>(); +// for (ItemStack centerStack : centerList) { +// ItemStack stack = centerStack.copy(); +// recipe.getUpgradeType().apply(stack, tier); +// if (recipe.getUpgradeType() == UpgradeType.UPGRADE) { +// setUpgradeSlots(stack, 1); +// } else { +// setUpgradeSlots(stack, 0); +// } +// stackList.add(stack); +// } +// builder.addSlot(RecipeIngredientRole.OUTPUT, 127, 23).addItemStacks(stackList).addRichTooltipCallback(callback); +// } else { +// builder.addSlot(RecipeIngredientRole.OUTPUT, 127, 23).addItemStack(recipe.getResultItem(registryAccess)).addRichTooltipCallback(callback); +// } +// } +// +// builder.addSlot(RecipeIngredientRole.CATALYST, 1, 41).addIngredients(recipe.requiresCore() ? Ingredient.of(StatueTags.STATUE_CORE) : Ingredient.EMPTY); +// List catalysts = recipe.getCatalysts(); +// if (catalysts.size() > 0) { +// builder.addSlot(RecipeIngredientRole.CATALYST, 55, 5).addIngredients(catalysts.get(0)); +// if (catalysts.size() > 1) { +// builder.addSlot(RecipeIngredientRole.CATALYST, 91, 5).addIngredients(catalysts.get(1)); +// if (catalysts.size() > 2) { +// builder.addSlot(RecipeIngredientRole.CATALYST, 55, 41).addIngredients(catalysts.get(2)); +// if (catalysts.size() > 3) { +// builder.addSlot(RecipeIngredientRole.CATALYST, 91, 41).addIngredients(catalysts.get(3)); +// } +// } +// } +// } +// } +// +// private void fillInTag(ItemStack stack, UpgradeRecipe recipe) { +// int tier = recipe.getTier(); +// int actualTier = tier == -1 ? recipe.getUpgradeType() == UpgradeType.UPGRADE ? 0 : 1 : tier + 1; +// StatueStats stats = new StatueStats(actualTier, actualTier * 10, 20); +// stack.set(StatueDataComponents.STATS, stats); +// stack.set(StatueDataComponents.UPGRADED, true); +// } +// +// private void setUpgradeSlots(ItemStack stack, int count) { +// StatueStats stats = stack.getOrDefault(StatueDataComponents.STATS, StatueStats.empty()); +// stack.set(StatueDataComponents.STATS, new StatueStats(stats.level(), count, stats.killCount())); +// } +// +// @Override +// public void draw(UpgradeRecipe recipe, IRecipeSlotsView recipeSlotsView, GuiGraphics guiGraphics, double mouseX, double mouseY) { +// IRecipeCategory.super.draw(recipe, recipeSlotsView, guiGraphics, mouseX, mouseY); +// } +// +// public static class UpgradeTooltipCallback implements IRecipeSlotRichTooltipCallback { +// public final MutableComponent component; +// +// public UpgradeTooltipCallback(UpgradeRecipe recipe) { +// this.component = recipe.getUpgradeName(); +// } +// +// @Override +// public void onRichTooltip(IRecipeSlotView recipeSlotView, ITooltipBuilder tooltip) { +// tooltip.add(component); +// } +// } +// +// @Override +// public Component getTitle() { +// return localizedName; +// } +//} diff --git a/src/main/java/com/shynieke/statues/compat/patchouli/PatchouliCompat.java b/src/main/java/com/shynieke/statues/compat/patchouli/PatchouliCompat.java index edd546a3..36515805 100644 --- a/src/main/java/com/shynieke/statues/compat/patchouli/PatchouliCompat.java +++ b/src/main/java/com/shynieke/statues/compat/patchouli/PatchouliCompat.java @@ -1,29 +1,29 @@ -package com.shynieke.statues.compat.patchouli; - -import com.shynieke.statues.Reference; -import net.minecraft.core.registries.BuiltInRegistries; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.sounds.SoundEvents; -import net.minecraft.sounds.SoundSource; -import net.minecraft.world.entity.item.ItemEntity; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; - -public class PatchouliCompat { - public static void convertBook(Player playerIn) { - Item guideBook = BuiltInRegistries.ITEM.get(ResourceLocation.fromNamespaceAndPath("patchouli", "guide_book")); - if (guideBook != null) { - playerIn.getMainHandItem().shrink(1); - ItemStack patchouliBook = new ItemStack(guideBook); - patchouliBook.set(vazkii.patchouli.common.item.PatchouliDataComponents.BOOK, - ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "statues")); - Level level = playerIn.level(); - if (!playerIn.addItem(patchouliBook)) { - level.addFreshEntity(new ItemEntity(level, playerIn.getX(), playerIn.getY(), playerIn.getZ(), patchouliBook)); - } - level.playSound(null, playerIn.blockPosition(), SoundEvents.CHICKEN_EGG, SoundSource.MASTER, 0.5F, 1.0F); - } - } -} +//package com.shynieke.statues.compat.patchouli; +// +//import com.shynieke.statues.Reference; +//import net.minecraft.core.registries.BuiltInRegistries; +//import net.minecraft.resources.ResourceLocation; +//import net.minecraft.sounds.SoundEvents; +//import net.minecraft.sounds.SoundSource; +//import net.minecraft.world.entity.item.ItemEntity; +//import net.minecraft.world.entity.player.Player; +//import net.minecraft.world.item.Item; +//import net.minecraft.world.item.ItemStack; +//import net.minecraft.world.level.Level; +// +//public class PatchouliCompat { +// public static void convertBook(Player playerIn) { +// Item guideBook = BuiltInRegistries.ITEM.get(ResourceLocation.fromNamespaceAndPath("patchouli", "guide_book")); +// if (guideBook != null) { +// playerIn.getMainHandItem().shrink(1); +// ItemStack patchouliBook = new ItemStack(guideBook); +// patchouliBook.set(vazkii.patchouli.common.item.PatchouliDataComponents.BOOK, +// Reference.modLoc("statues")); +// Level level = playerIn.level(); +// if (!playerIn.addItem(patchouliBook)) { +// level.addFreshEntity(new ItemEntity(level, playerIn.getX(), playerIn.getY(), playerIn.getZ(), patchouliBook)); +// } +// level.playSound(null, playerIn.blockPosition(), SoundEvents.CHICKEN_EGG, SoundSource.MASTER, 0.5F, 1.0F); +// } +// } +//} diff --git a/src/main/java/com/shynieke/statues/compat/rei/REIPlugin.java b/src/main/java/com/shynieke/statues/compat/rei/REIPlugin.java index 00386f92..1ebd140a 100644 --- a/src/main/java/com/shynieke/statues/compat/rei/REIPlugin.java +++ b/src/main/java/com/shynieke/statues/compat/rei/REIPlugin.java @@ -1,199 +1,199 @@ -package com.shynieke.statues.compat.rei; - -import com.shynieke.statues.Reference; -import com.shynieke.statues.Statues; -import com.shynieke.statues.blocks.AbstractStatueBase; -import com.shynieke.statues.compat.rei.category.LootCategory; -import com.shynieke.statues.compat.rei.category.UpgradeCategory; -import com.shynieke.statues.compat.rei.display.LootDisplay; -import com.shynieke.statues.compat.rei.display.UpgradeDisplay; -import com.shynieke.statues.config.StatuesConfig; -import com.shynieke.statues.datacomponent.StatueStats; -import com.shynieke.statues.items.StatueBlockItem; -import com.shynieke.statues.recipe.LootRecipe; -import com.shynieke.statues.recipe.StatuesRecipes; -import com.shynieke.statues.recipe.UpgradeRecipe; -import com.shynieke.statues.recipe.UpgradeType; -import com.shynieke.statues.registry.StatueDataComponents; -import com.shynieke.statues.registry.StatueRegistry; -import me.shedaniel.rei.api.client.plugins.REIClientPlugin; -import me.shedaniel.rei.api.client.registry.category.CategoryRegistry; -import me.shedaniel.rei.api.client.registry.display.DisplayRegistry; -import me.shedaniel.rei.api.common.category.CategoryIdentifier; -import me.shedaniel.rei.api.common.util.EntryStacks; -import me.shedaniel.rei.forge.REIPluginClient; -import me.shedaniel.rei.plugin.client.BuiltinClientPlugin; -import net.minecraft.ChatFormatting; -import net.minecraft.client.Minecraft; -import net.minecraft.client.multiplayer.ClientLevel; -import net.minecraft.core.RegistryAccess; -import net.minecraft.core.registries.BuiltInRegistries; -import net.minecraft.network.chat.Component; -import net.minecraft.world.entity.EntityType; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.crafting.RecipeHolder; - -import java.util.ArrayList; -import java.util.List; - -@REIPluginClient -public class REIPlugin implements REIClientPlugin { - public static final CategoryIdentifier LOOT = CategoryIdentifier.of(Reference.MOD_ID, "plugins/loot"); - public static final CategoryIdentifier UPGRADE = CategoryIdentifier.of(Reference.MOD_ID, "plugins/upgrade"); - - @Override - public void registerCategories(CategoryRegistry registry) { - registry.add(new LootCategory()); - registry.add(new UpgradeCategory()); - - registry.addWorkstations(LOOT, EntryStacks.of(StatueRegistry.STATUE_TABLE.get())); - registry.addWorkstations(UPGRADE, EntryStacks.of(StatueRegistry.STATUE_TABLE.get())); - } - - @Override - public void registerDisplays(DisplayRegistry registry) { - Minecraft minecraft = Minecraft.getInstance(); - ClientLevel level = minecraft.level; - if (level == null) { - throw new NullPointerException("level must not be null."); - } - RegistryAccess registryAccess = level.registryAccess(); - - List> lootHolders = registry.getRecipeManager().getAllRecipesFor(StatuesRecipes.LOOT_RECIPE.get()); - lootHolders.forEach((holder) -> { - LootRecipe recipe = holder.value(); - registry.add(new LootDisplay( - recipe.getIngredients().getFirst(), - recipe.getResultItem(registryAccess), - recipe.getChance1(), - recipe.getResultItem2(registryAccess), - recipe.getChance2(), - recipe.getResultItem3(registryAccess), - recipe.getChance3()) - ); - }); - - - List> upgradeHolders = registry.getRecipeManager().getAllRecipesFor(StatuesRecipes.UPGRADE_RECIPE.get()); - upgradeHolders.forEach((holder) -> { - UpgradeRecipe recipe = holder.value(); - int tier = recipe.getTier(); - List centerList = new ArrayList<>(); - for (ItemStack centerStack : recipe.getCenter().getItems()) { - ItemStack stack = centerStack.copy(); - if (recipe.getUpgradeType() != UpgradeType.UPGRADE) - fillInTag(stack, recipe); - - if (recipe.getUpgradeType() != UpgradeType.UPGRADE) { - setUpgradeSlots(stack, 1); - } - if (recipe.getUpgradeType() == UpgradeType.UNGLOWING) { - UpgradeType.GLOWING.apply(stack, -1); - } - - if (tier > -1) { - for (int i = 0; i < tier; i++) { - recipe.getUpgradeType().apply(stack, i); - } - } - - centerList.add(stack); - } - ItemStack result = recipe.getResultItem(registryAccess).copy(); - List stacks = new ArrayList<>(); - if (result.isEmpty()) { - for (ItemStack centerStack : centerList) { - ItemStack stack = centerStack.copy(); - - recipe.getUpgradeType().apply(stack, tier); - - if (recipe.getUpgradeType().isSubsequentUsesSlot()) - setUpgradeSlots(stack, 0); - stacks.add(stack); - } - } else { - stacks.add(result); - } - - registry.add(new UpgradeDisplay( - centerList, - recipe.getCatalysts(), - stacks, - recipe.requiresCore(), - recipe.getUpgradeType(), - tier) - ); - }); - - - BuiltinClientPlugin clientPlugin = BuiltinClientPlugin.getInstance(); - List statues = StatueRegistry.ITEMS.getEntries().stream() - .filter(registryObject -> registryObject.get() instanceof StatueBlockItem statueBlock && - statueBlock.getBlock() instanceof AbstractStatueBase statueBase && !statueBase.isHiddenStatue()) - .map(registryObject -> (StatueBlockItem) registryObject.get()).toList(); - double chance = StatuesConfig.COMMON.statueDropChance.get(); - for (StatueBlockItem statue : statues) { - if (statue.getEntity() == null) { - Statues.LOGGER.error("Tried adding info to statue but statue {} has no entity linked", BuiltInRegistries.ITEM.getKey(statue)); - } else { - clientPlugin.registerInformation(EntryStacks.of(statue.getDefaultInstance()), Component.empty(), - list -> { - int chancePercentage = (int) (chance * 100); - if (statue.getEntity() == EntityType.WARDEN || statue.getEntity() == EntityType.ELDER_GUARDIAN) { - chancePercentage = 100; - } else if (statue.getEntity() == EntityType.RAVAGER) { - chancePercentage = 25; - } - list.add(Component.translatable("statues.gui.jei.statue.info", - Component.translatable(statue.getDescriptionId()).withStyle(ChatFormatting.YELLOW).withStyle(ChatFormatting.BOLD), - Component.literal(chancePercentage + "%").withStyle(ChatFormatting.DARK_GREEN).withStyle(ChatFormatting.BOLD), - Component.translatable(statue.getEntity().getDescriptionId()).withStyle(ChatFormatting.RED).withStyle(ChatFormatting.BOLD))); - return list; - } - ); - } - } - clientPlugin.registerInformation(EntryStacks.of(StatueRegistry.STATUE_CORE.get().getDefaultInstance()), Component.empty(), - list -> { - list.add(Component.translatable("statues.gui.jei.statue_core.info", - Component.translatable(StatueRegistry.STATUE_CORE.get().getDescriptionId()).withStyle(ChatFormatting.YELLOW).withStyle(ChatFormatting.BOLD), - Component.translatable(StatueRegistry.STATUE_BAT.get().getDescriptionId()).withStyle(ChatFormatting.RED).withStyle(ChatFormatting.BOLD) - )); - list.add(Component.translatable("statues.gui.jei.statue_core.info2", - Component.translatable(StatueRegistry.STATUE_BAT.get().getDescriptionId()).withStyle(ChatFormatting.RED).withStyle(ChatFormatting.BOLD) - )); - return list; - } - ); - clientPlugin.registerInformation(EntryStacks.of(StatueRegistry.STATUE_TABLE.get().asItem().getDefaultInstance()), Component.empty(), - list -> { - list.add(Component.translatable("statues.gui.jei.statue_table.info")); - list.add(Component.translatable("statues.gui.jei.statue_table.info2")); - list.add(Component.translatable("statues.gui.jei.statue_table.info3")); - list.add(Component.translatable("statues.gui.jei.statue_table.info4")); - list.add(Component.translatable("statues.gui.jei.statue_table.info5")); - list.add(Component.translatable("statues.gui.jei.statue_table.info6")); - list.add(Component.translatable("statues.gui.jei.statue_table.info7")); - list.add(Component.translatable("statues.gui.jei.statue_table.info8")); - return list; - } - ); - } - - - private void fillInTag(ItemStack stack, UpgradeRecipe recipe) { - int tier = recipe.getTier(); - stack.set(StatueDataComponents.UPGRADED.get(), true); - - StatueStats stats = stack.getOrDefault(StatueDataComponents.STATS.get(), StatueStats.empty()); - stats.setLevel(tier == -1 ? 0 : tier + 1); - stats.setUpgradeSlots(20); - stack.set(StatueDataComponents.STATS.get(), stats); - } - - private void setUpgradeSlots(ItemStack stack, int count) { - StatueStats stats = stack.getOrDefault(StatueDataComponents.STATS.get(), StatueStats.empty()); - stats.setUpgradeSlots(count); - stack.set(StatueDataComponents.STATS.get(), stats); - } -} +//package com.shynieke.statues.compat.rei; +// +//import com.shynieke.statues.Reference; +//import com.shynieke.statues.Statues; +//import com.shynieke.statues.blocks.AbstractStatueBase; +//import com.shynieke.statues.compat.rei.category.LootCategory; +//import com.shynieke.statues.compat.rei.category.UpgradeCategory; +//import com.shynieke.statues.compat.rei.display.LootDisplay; +//import com.shynieke.statues.compat.rei.display.UpgradeDisplay; +//import com.shynieke.statues.config.StatuesConfig; +//import com.shynieke.statues.datacomponent.StatueStats; +//import com.shynieke.statues.items.StatueBlockItem; +//import com.shynieke.statues.recipe.LootRecipe; +//import com.shynieke.statues.recipe.StatuesRecipes; +//import com.shynieke.statues.recipe.UpgradeRecipe; +//import com.shynieke.statues.recipe.UpgradeType; +//import com.shynieke.statues.registry.StatueDataComponents; +//import com.shynieke.statues.registry.StatueRegistry; +//import me.shedaniel.rei.api.client.plugins.REIClientPlugin; +//import me.shedaniel.rei.api.client.registry.category.CategoryRegistry; +//import me.shedaniel.rei.api.client.registry.display.DisplayRegistry; +//import me.shedaniel.rei.api.common.category.CategoryIdentifier; +//import me.shedaniel.rei.api.common.util.EntryStacks; +//import me.shedaniel.rei.forge.REIPluginClient; +//import me.shedaniel.rei.plugin.client.BuiltinClientPlugin; +//import net.minecraft.ChatFormatting; +//import net.minecraft.client.Minecraft; +//import net.minecraft.client.multiplayer.ClientLevel; +//import net.minecraft.core.RegistryAccess; +//import net.minecraft.core.registries.BuiltInRegistries; +//import net.minecraft.network.chat.Component; +//import net.minecraft.world.entity.EntityType; +//import net.minecraft.world.item.ItemStack; +//import net.minecraft.world.item.crafting.RecipeHolder; +// +//import java.util.ArrayList; +//import java.util.List; +// +//@REIPluginClient +//public class REIPlugin implements REIClientPlugin { +// public static final CategoryIdentifier LOOT = CategoryIdentifier.of(Reference.MOD_ID, "plugins/loot"); +// public static final CategoryIdentifier UPGRADE = CategoryIdentifier.of(Reference.MOD_ID, "plugins/upgrade"); +// +// @Override +// public void registerCategories(CategoryRegistry registry) { +// registry.add(new LootCategory()); +// registry.add(new UpgradeCategory()); +// +// registry.addWorkstations(LOOT, EntryStacks.of(StatueRegistry.STATUE_TABLE.get())); +// registry.addWorkstations(UPGRADE, EntryStacks.of(StatueRegistry.STATUE_TABLE.get())); +// } +// +// @Override +// public void registerDisplays(DisplayRegistry registry) { +// Minecraft minecraft = Minecraft.getInstance(); +// ClientLevel level = minecraft.level; +// if (level == null) { +// throw new NullPointerException("level must not be null."); +// } +// RegistryAccess registryAccess = level.registryAccess(); +// +// List> lootHolders = registry.getRecipeManager().getAllRecipesFor(StatuesRecipes.LOOT_RECIPE.get()); +// lootHolders.forEach((holder) -> { +// LootRecipe recipe = holder.value(); +// registry.add(new LootDisplay( +// recipe.getIngredients().getFirst(), +// recipe.getResultItem(registryAccess), +// recipe.getChance1(), +// recipe.getResultItem2(registryAccess), +// recipe.getChance2(), +// recipe.getResultItem3(registryAccess), +// recipe.getChance3()) +// ); +// }); +// +// +// List> upgradeHolders = registry.getRecipeManager().getAllRecipesFor(StatuesRecipes.UPGRADE_RECIPE.get()); +// upgradeHolders.forEach((holder) -> { +// UpgradeRecipe recipe = holder.value(); +// int tier = recipe.getTier(); +// List centerList = new ArrayList<>(); +// for (ItemStack centerStack : recipe.getCenter().getItems()) { +// ItemStack stack = centerStack.copy(); +// if (recipe.getUpgradeType() != UpgradeType.UPGRADE) +// fillInTag(stack, recipe); +// +// if (recipe.getUpgradeType() != UpgradeType.UPGRADE) { +// setUpgradeSlots(stack, 1); +// } +// if (recipe.getUpgradeType() == UpgradeType.UNGLOWING) { +// UpgradeType.GLOWING.apply(stack, -1); +// } +// +// if (tier > -1) { +// for (int i = 0; i < tier; i++) { +// recipe.getUpgradeType().apply(stack, i); +// } +// } +// +// centerList.add(stack); +// } +// ItemStack result = recipe.getResultItem(registryAccess).copy(); +// List stacks = new ArrayList<>(); +// if (result.isEmpty()) { +// for (ItemStack centerStack : centerList) { +// ItemStack stack = centerStack.copy(); +// +// recipe.getUpgradeType().apply(stack, tier); +// +// if (recipe.getUpgradeType().isSubsequentUsesSlot()) +// setUpgradeSlots(stack, 0); +// stacks.add(stack); +// } +// } else { +// stacks.add(result); +// } +// +// registry.add(new UpgradeDisplay( +// centerList, +// recipe.getCatalysts(), +// stacks, +// recipe.requiresCore(), +// recipe.getUpgradeType(), +// tier) +// ); +// }); +// +// +// BuiltinClientPlugin clientPlugin = BuiltinClientPlugin.getInstance(); +// List statues = StatueRegistry.ITEMS.getEntries().stream() +// .filter(registryObject -> registryObject.get() instanceof StatueBlockItem statueBlock && +// statueBlock.getBlock() instanceof AbstractStatueBase statueBase && !statueBase.isHiddenStatue()) +// .map(registryObject -> (StatueBlockItem) registryObject.get()).toList(); +// double chance = StatuesConfig.COMMON.statueDropChance.get(); +// for (StatueBlockItem statue : statues) { +// if (statue.getEntity() == null) { +// Statues.LOGGER.error("Tried adding info to statue but statue {} has no entity linked", BuiltInRegistries.ITEM.getKey(statue)); +// } else { +// clientPlugin.registerInformation(EntryStacks.of(statue.getDefaultInstance()), Component.empty(), +// list -> { +// int chancePercentage = (int) (chance * 100); +// if (statue.getEntity() == EntityType.WARDEN || statue.getEntity() == EntityType.ELDER_GUARDIAN) { +// chancePercentage = 100; +// } else if (statue.getEntity() == EntityType.RAVAGER) { +// chancePercentage = 25; +// } +// list.add(Component.translatable("statues.gui.jei.statue.info", +// Component.translatable(statue.getDescriptionId()).withStyle(ChatFormatting.YELLOW).withStyle(ChatFormatting.BOLD), +// Component.literal(chancePercentage + "%").withStyle(ChatFormatting.DARK_GREEN).withStyle(ChatFormatting.BOLD), +// Component.translatable(statue.getEntity().getDescriptionId()).withStyle(ChatFormatting.RED).withStyle(ChatFormatting.BOLD))); +// return list; +// } +// ); +// } +// } +// clientPlugin.registerInformation(EntryStacks.of(StatueRegistry.STATUE_CORE.get().getDefaultInstance()), Component.empty(), +// list -> { +// list.add(Component.translatable("statues.gui.jei.statue_core.info", +// Component.translatable(StatueRegistry.STATUE_CORE.get().getDescriptionId()).withStyle(ChatFormatting.YELLOW).withStyle(ChatFormatting.BOLD), +// Component.translatable(StatueRegistry.STATUE_BAT.get().getDescriptionId()).withStyle(ChatFormatting.RED).withStyle(ChatFormatting.BOLD) +// )); +// list.add(Component.translatable("statues.gui.jei.statue_core.info2", +// Component.translatable(StatueRegistry.STATUE_BAT.get().getDescriptionId()).withStyle(ChatFormatting.RED).withStyle(ChatFormatting.BOLD) +// )); +// return list; +// } +// ); +// clientPlugin.registerInformation(EntryStacks.of(StatueRegistry.STATUE_TABLE.get().asItem().getDefaultInstance()), Component.empty(), +// list -> { +// list.add(Component.translatable("statues.gui.jei.statue_table.info")); +// list.add(Component.translatable("statues.gui.jei.statue_table.info2")); +// list.add(Component.translatable("statues.gui.jei.statue_table.info3")); +// list.add(Component.translatable("statues.gui.jei.statue_table.info4")); +// list.add(Component.translatable("statues.gui.jei.statue_table.info5")); +// list.add(Component.translatable("statues.gui.jei.statue_table.info6")); +// list.add(Component.translatable("statues.gui.jei.statue_table.info7")); +// list.add(Component.translatable("statues.gui.jei.statue_table.info8")); +// return list; +// } +// ); +// } +// +// +// private void fillInTag(ItemStack stack, UpgradeRecipe recipe) { +// int tier = recipe.getTier(); +// stack.set(StatueDataComponents.UPGRADED.get(), true); +// +// StatueStats stats = stack.getOrDefault(StatueDataComponents.STATS.get(), StatueStats.empty()); +// stats.setLevel(tier == -1 ? 0 : tier + 1); +// stats.setUpgradeSlots(20); +// stack.set(StatueDataComponents.STATS.get(), stats); +// } +// +// private void setUpgradeSlots(ItemStack stack, int count) { +// StatueStats stats = stack.getOrDefault(StatueDataComponents.STATS.get(), StatueStats.empty()); +// stats.setUpgradeSlots(count); +// stack.set(StatueDataComponents.STATS.get(), stats); +// } +//} diff --git a/src/main/java/com/shynieke/statues/compat/rei/category/LootCategory.java b/src/main/java/com/shynieke/statues/compat/rei/category/LootCategory.java index a450fc13..911a133b 100644 --- a/src/main/java/com/shynieke/statues/compat/rei/category/LootCategory.java +++ b/src/main/java/com/shynieke/statues/compat/rei/category/LootCategory.java @@ -1,72 +1,72 @@ -package com.shynieke.statues.compat.rei.category; - -import com.mojang.blaze3d.vertex.PoseStack; -import com.shynieke.statues.compat.rei.REIPlugin; -import com.shynieke.statues.compat.rei.display.LootDisplay; -import com.shynieke.statues.registry.StatueRegistry; -import me.shedaniel.math.Point; -import me.shedaniel.math.Rectangle; -import me.shedaniel.rei.api.client.gui.Renderer; -import me.shedaniel.rei.api.client.gui.widgets.Widget; -import me.shedaniel.rei.api.client.gui.widgets.Widgets; -import me.shedaniel.rei.api.client.registry.display.DisplayCategory; -import me.shedaniel.rei.api.common.category.CategoryIdentifier; -import me.shedaniel.rei.api.common.util.EntryStacks; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Font; -import net.minecraft.network.chat.Component; - -import java.util.ArrayList; -import java.util.List; - -public class LootCategory implements DisplayCategory { - @Override - public CategoryIdentifier getCategoryIdentifier() { - return REIPlugin.LOOT; - } - - @Override - public Component getTitle() { - return Component.translatable("statues.gui.jei.category.loot"); - } - - @Override - public Renderer getIcon() { - return EntryStacks.of(StatueRegistry.STATUE_TABLE.get()); - } - - @Override - public List setupDisplay(LootDisplay display, Rectangle bounds) { - Point centerPoint = new Point(bounds.getCenterX(), bounds.getCenterY()); - List widgets = new ArrayList<>(); - widgets.add(Widgets.createRecipeBase(bounds)); - widgets.add(Widgets.createArrow(new Point(centerPoint.x - 20, centerPoint.y - 7))); - - widgets.add(Widgets.createSlot(new Point(bounds.getMinX() + 8, centerPoint.y - 7)).entries(display.getInputEntries().getFirst()).markInput()); - if (display.getOutputEntries().size() != 3) { - throw new IndexOutOfBoundsException("A Loot Recipe must have 3 outputs!, found " + display.getOutputEntries().size() + " outputs!. Please report this to the mod author!"); - } else { - widgets.add(Widgets.createSlot(new Point(centerPoint.x + 8, bounds.getMinY() + 5)).entries(display.getOutputEntries().get(0)).markOutput()); - widgets.add(Widgets.createSlot(new Point(centerPoint.x + 8, bounds.getMinY() + 24)).entries(display.getOutputEntries().get(1)).markOutput()); - widgets.add(Widgets.createSlot(new Point(centerPoint.x + 8, bounds.getMinY() + 43)).entries(display.getOutputEntries().get(2)).markOutput()); - } - widgets.add(Widgets.withTranslate(Widgets.createDrawableWidget((guiGraphics, mouseX, mouseY, v) -> { - // Draw entity name - PoseStack poseStack = guiGraphics.pose(); - poseStack.pushPose(); - Font font = Minecraft.getInstance().font; - guiGraphics.drawString(font, Component.literal((int) (100 * display.getChance1()) + "%"), 74, 8, 0, false); - guiGraphics.drawString(font, Component.literal((int) (100 * display.getChance2()) + "%"), 74, 27, 0, false); - guiGraphics.drawString(font, Component.literal((int) (100 * display.getChance3()) + "%"), 74, 45, 0, false); - - poseStack.popPose(); - }), bounds.x + 3, bounds.y + 3, 0)); - - return widgets; - } - - @Override - public int getDisplayWidth(LootDisplay display) { - return 100; - } -} +//package com.shynieke.statues.compat.rei.category; +// +//import com.mojang.blaze3d.vertex.PoseStack; +//import com.shynieke.statues.compat.rei.REIPlugin; +//import com.shynieke.statues.compat.rei.display.LootDisplay; +//import com.shynieke.statues.registry.StatueRegistry; +//import me.shedaniel.math.Point; +//import me.shedaniel.math.Rectangle; +//import me.shedaniel.rei.api.client.gui.Renderer; +//import me.shedaniel.rei.api.client.gui.widgets.Widget; +//import me.shedaniel.rei.api.client.gui.widgets.Widgets; +//import me.shedaniel.rei.api.client.registry.display.DisplayCategory; +//import me.shedaniel.rei.api.common.category.CategoryIdentifier; +//import me.shedaniel.rei.api.common.util.EntryStacks; +//import net.minecraft.client.Minecraft; +//import net.minecraft.client.gui.Font; +//import net.minecraft.network.chat.Component; +// +//import java.util.ArrayList; +//import java.util.List; +// +//public class LootCategory implements DisplayCategory { +// @Override +// public CategoryIdentifier getCategoryIdentifier() { +// return REIPlugin.LOOT; +// } +// +// @Override +// public Component getTitle() { +// return Component.translatable("statues.gui.jei.category.loot"); +// } +// +// @Override +// public Renderer getIcon() { +// return EntryStacks.of(StatueRegistry.STATUE_TABLE.get()); +// } +// +// @Override +// public List setupDisplay(LootDisplay display, Rectangle bounds) { +// Point centerPoint = new Point(bounds.getCenterX(), bounds.getCenterY()); +// List widgets = new ArrayList<>(); +// widgets.add(Widgets.createRecipeBase(bounds)); +// widgets.add(Widgets.createArrow(new Point(centerPoint.x - 20, centerPoint.y - 7))); +// +// widgets.add(Widgets.createSlot(new Point(bounds.getMinX() + 8, centerPoint.y - 7)).entries(display.getInputEntries().getFirst()).markInput()); +// if (display.getOutputEntries().size() != 3) { +// throw new IndexOutOfBoundsException("A Loot Recipe must have 3 outputs!, found " + display.getOutputEntries().size() + " outputs!. Please report this to the mod author!"); +// } else { +// widgets.add(Widgets.createSlot(new Point(centerPoint.x + 8, bounds.getMinY() + 5)).entries(display.getOutputEntries().get(0)).markOutput()); +// widgets.add(Widgets.createSlot(new Point(centerPoint.x + 8, bounds.getMinY() + 24)).entries(display.getOutputEntries().get(1)).markOutput()); +// widgets.add(Widgets.createSlot(new Point(centerPoint.x + 8, bounds.getMinY() + 43)).entries(display.getOutputEntries().get(2)).markOutput()); +// } +// widgets.add(Widgets.withTranslate(Widgets.createDrawableWidget((guiGraphics, mouseX, mouseY, v) -> { +// // Draw entity name +// PoseStack poseStack = guiGraphics.pose(); +// poseStack.pushPose(); +// Font font = Minecraft.getInstance().font; +// guiGraphics.drawString(font, Component.literal((int) (100 * display.getChance1()) + "%"), 74, 8, 0, false); +// guiGraphics.drawString(font, Component.literal((int) (100 * display.getChance2()) + "%"), 74, 27, 0, false); +// guiGraphics.drawString(font, Component.literal((int) (100 * display.getChance3()) + "%"), 74, 45, 0, false); +// +// poseStack.popPose(); +// }), bounds.x + 3, bounds.y + 3, 0)); +// +// return widgets; +// } +// +// @Override +// public int getDisplayWidth(LootDisplay display) { +// return 100; +// } +//} diff --git a/src/main/java/com/shynieke/statues/compat/rei/category/UpgradeCategory.java b/src/main/java/com/shynieke/statues/compat/rei/category/UpgradeCategory.java index 3e7e232a..87960fb7 100644 --- a/src/main/java/com/shynieke/statues/compat/rei/category/UpgradeCategory.java +++ b/src/main/java/com/shynieke/statues/compat/rei/category/UpgradeCategory.java @@ -1,108 +1,108 @@ -package com.shynieke.statues.compat.rei.category; - -import com.mojang.blaze3d.vertex.PoseStack; -import com.shynieke.statues.Reference; -import com.shynieke.statues.compat.rei.REIPlugin; -import com.shynieke.statues.compat.rei.display.UpgradeDisplay; -import com.shynieke.statues.registry.StatueRegistry; -import me.shedaniel.math.Point; -import me.shedaniel.math.Rectangle; -import me.shedaniel.rei.api.client.gui.Renderer; -import me.shedaniel.rei.api.client.gui.widgets.Widget; -import me.shedaniel.rei.api.client.gui.widgets.Widgets; -import me.shedaniel.rei.api.client.registry.display.DisplayCategory; -import me.shedaniel.rei.api.common.category.CategoryIdentifier; -import me.shedaniel.rei.api.common.entry.EntryIngredient; -import me.shedaniel.rei.api.common.util.EntryStacks; -import net.minecraft.ChatFormatting; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Font; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.MutableComponent; -import net.minecraft.resources.ResourceLocation; - -import java.util.ArrayList; -import java.util.List; - -public class UpgradeCategory implements DisplayCategory { - private static final ResourceLocation TEXTURE = ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "textures/gui/jei/upgrade.png"); - - @Override - public CategoryIdentifier getCategoryIdentifier() { - return REIPlugin.UPGRADE; - } - - @Override - public Component getTitle() { - return Component.translatable("statues.gui.jei.category.upgrade"); - } - - @Override - public Renderer getIcon() { - return EntryStacks.of(StatueRegistry.STATUE_TABLE.get()); - } - - @Override - public List setupDisplay(UpgradeDisplay display, Rectangle bounds) { - Point centerPoint = new Point(bounds.getCenterX(), bounds.getCenterY()); - List widgets = new ArrayList<>(); - widgets.add(Widgets.createRecipeBase(bounds)); - - if (display.isRequireCore()) - widgets.add(Widgets.createSlot(new Point(bounds.getMinX() + 9, bounds.getMaxY() - 24)).entries(display.getCore()).markInput()); - else - widgets.add(Widgets.createTexturedWidget(TEXTURE, bounds.getMinX() + 8, bounds.getMaxY() - 25, 0, 40, 18, 18)); - - widgets.add(Widgets.createSlot(new Point(centerPoint.x, centerPoint.y - 7)).entries(display.getCenter()).markInput()); - - widgets.add(Widgets.createSlotBackground(new Point(centerPoint.x - 18, centerPoint.y - 25))); - widgets.add(Widgets.createSlotBackground(new Point(centerPoint.x + 18, centerPoint.y - 25))); - widgets.add(Widgets.createSlotBackground(new Point(centerPoint.x - 18, centerPoint.y + 11))); - widgets.add(Widgets.createSlotBackground(new Point(centerPoint.x + 18, centerPoint.y + 11))); - - - List catalysts = display.getCatalysts(); - if (!catalysts.isEmpty()) { - widgets.add(Widgets.createSlot(new Point(centerPoint.x - 18, centerPoint.y - 25)).entries(catalysts.get(0)).disableBackground().markInput()); - if (catalysts.size() > 1) { - widgets.add(Widgets.createSlot(new Point(centerPoint.x + 18, centerPoint.y - 25)).entries(catalysts.get(1)).disableBackground().markInput()); - if (catalysts.size() > 2) { - widgets.add(Widgets.createSlot(new Point(centerPoint.x - 18, centerPoint.y + 11)).entries(catalysts.get(2)).disableBackground().markInput()); - if (catalysts.size() > 3) { - widgets.add(Widgets.createSlot(new Point(centerPoint.x + 18, centerPoint.y + 11)).entries(catalysts.get(3)).disableBackground().markInput()); - } - } - } - } - - widgets.add(Widgets.createSlot(new Point(centerPoint.x + 46, centerPoint.y - 7)).entries(display.getResult()).markOutput()); - - widgets.add(Widgets.withTranslate(Widgets.createDrawableWidget((guiGraphics, mouseX, mouseY, v) -> { - // Draw entity name - PoseStack poseStack = guiGraphics.pose(); - poseStack.pushPose(); - Font font = Minecraft.getInstance().font; - guiGraphics.drawString(font, getUpgradeName(display.getUpgradeType().getSerializedName(), display.getTier() + 1).withStyle(ChatFormatting.DARK_GRAY), 3, 25, 0, false); - - poseStack.popPose(); - }), bounds.x + 3, bounds.y + 3, 0)); - - return widgets; - } - - private MutableComponent getUpgradeName(String id, int level) { - String descriptionID = "statues.upgrade." + id + ".name"; - MutableComponent mutablecomponent = Component.translatable(descriptionID).withStyle(ChatFormatting.GRAY); - - if (level > 0) { - mutablecomponent.append(" ").append(Component.translatable("enchantment.level." + level)); - } - - return mutablecomponent; - } - - @Override - public int getDisplayWidth(UpgradeDisplay display) { - return 148; - } -} +//package com.shynieke.statues.compat.rei.category; +// +//import com.mojang.blaze3d.vertex.PoseStack; +//import com.shynieke.statues.Reference; +//import com.shynieke.statues.compat.rei.REIPlugin; +//import com.shynieke.statues.compat.rei.display.UpgradeDisplay; +//import com.shynieke.statues.registry.StatueRegistry; +//import me.shedaniel.math.Point; +//import me.shedaniel.math.Rectangle; +//import me.shedaniel.rei.api.client.gui.Renderer; +//import me.shedaniel.rei.api.client.gui.widgets.Widget; +//import me.shedaniel.rei.api.client.gui.widgets.Widgets; +//import me.shedaniel.rei.api.client.registry.display.DisplayCategory; +//import me.shedaniel.rei.api.common.category.CategoryIdentifier; +//import me.shedaniel.rei.api.common.entry.EntryIngredient; +//import me.shedaniel.rei.api.common.util.EntryStacks; +//import net.minecraft.ChatFormatting; +//import net.minecraft.client.Minecraft; +//import net.minecraft.client.gui.Font; +//import net.minecraft.network.chat.Component; +//import net.minecraft.network.chat.MutableComponent; +//import net.minecraft.resources.ResourceLocation; +// +//import java.util.ArrayList; +//import java.util.List; +// +//public class UpgradeCategory implements DisplayCategory { +// private static final ResourceLocation TEXTURE = Reference.modLoc("textures/gui/jei/upgrade.png"); +// +// @Override +// public CategoryIdentifier getCategoryIdentifier() { +// return REIPlugin.UPGRADE; +// } +// +// @Override +// public Component getTitle() { +// return Component.translatable("statues.gui.jei.category.upgrade"); +// } +// +// @Override +// public Renderer getIcon() { +// return EntryStacks.of(StatueRegistry.STATUE_TABLE.get()); +// } +// +// @Override +// public List setupDisplay(UpgradeDisplay display, Rectangle bounds) { +// Point centerPoint = new Point(bounds.getCenterX(), bounds.getCenterY()); +// List widgets = new ArrayList<>(); +// widgets.add(Widgets.createRecipeBase(bounds)); +// +// if (display.isRequireCore()) +// widgets.add(Widgets.createSlot(new Point(bounds.getMinX() + 9, bounds.getMaxY() - 24)).entries(display.getCore()).markInput()); +// else +// widgets.add(Widgets.createTexturedWidget(TEXTURE, bounds.getMinX() + 8, bounds.getMaxY() - 25, 0, 40, 18, 18)); +// +// widgets.add(Widgets.createSlot(new Point(centerPoint.x, centerPoint.y - 7)).entries(display.getCenter()).markInput()); +// +// widgets.add(Widgets.createSlotBackground(new Point(centerPoint.x - 18, centerPoint.y - 25))); +// widgets.add(Widgets.createSlotBackground(new Point(centerPoint.x + 18, centerPoint.y - 25))); +// widgets.add(Widgets.createSlotBackground(new Point(centerPoint.x - 18, centerPoint.y + 11))); +// widgets.add(Widgets.createSlotBackground(new Point(centerPoint.x + 18, centerPoint.y + 11))); +// +// +// List catalysts = display.getCatalysts(); +// if (!catalysts.isEmpty()) { +// widgets.add(Widgets.createSlot(new Point(centerPoint.x - 18, centerPoint.y - 25)).entries(catalysts.get(0)).disableBackground().markInput()); +// if (catalysts.size() > 1) { +// widgets.add(Widgets.createSlot(new Point(centerPoint.x + 18, centerPoint.y - 25)).entries(catalysts.get(1)).disableBackground().markInput()); +// if (catalysts.size() > 2) { +// widgets.add(Widgets.createSlot(new Point(centerPoint.x - 18, centerPoint.y + 11)).entries(catalysts.get(2)).disableBackground().markInput()); +// if (catalysts.size() > 3) { +// widgets.add(Widgets.createSlot(new Point(centerPoint.x + 18, centerPoint.y + 11)).entries(catalysts.get(3)).disableBackground().markInput()); +// } +// } +// } +// } +// +// widgets.add(Widgets.createSlot(new Point(centerPoint.x + 46, centerPoint.y - 7)).entries(display.getResult()).markOutput()); +// +// widgets.add(Widgets.withTranslate(Widgets.createDrawableWidget((guiGraphics, mouseX, mouseY, v) -> { +// // Draw entity name +// PoseStack poseStack = guiGraphics.pose(); +// poseStack.pushPose(); +// Font font = Minecraft.getInstance().font; +// guiGraphics.drawString(font, getUpgradeName(display.getUpgradeType().getSerializedName(), display.getTier() + 1).withStyle(ChatFormatting.DARK_GRAY), 3, 25, 0, false); +// +// poseStack.popPose(); +// }), bounds.x + 3, bounds.y + 3, 0)); +// +// return widgets; +// } +// +// private MutableComponent getUpgradeName(String id, int level) { +// String descriptionID = "statues.upgrade." + id + ".name"; +// MutableComponent mutablecomponent = Component.translatable(descriptionID).withStyle(ChatFormatting.GRAY); +// +// if (level > 0) { +// mutablecomponent.append(" ").append(Component.translatable("enchantment.level." + level)); +// } +// +// return mutablecomponent; +// } +// +// @Override +// public int getDisplayWidth(UpgradeDisplay display) { +// return 148; +// } +//} diff --git a/src/main/java/com/shynieke/statues/compat/rei/display/LootDisplay.java b/src/main/java/com/shynieke/statues/compat/rei/display/LootDisplay.java index e0ddba79..9df194f8 100644 --- a/src/main/java/com/shynieke/statues/compat/rei/display/LootDisplay.java +++ b/src/main/java/com/shynieke/statues/compat/rei/display/LootDisplay.java @@ -1,65 +1,65 @@ -package com.shynieke.statues.compat.rei.display; - -import com.shynieke.statues.compat.rei.REIPlugin; -import me.shedaniel.rei.api.common.category.CategoryIdentifier; -import me.shedaniel.rei.api.common.display.Display; -import me.shedaniel.rei.api.common.entry.EntryIngredient; -import me.shedaniel.rei.api.common.entry.type.VanillaEntryTypes; -import me.shedaniel.rei.api.common.util.EntryIngredients; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.crafting.Ingredient; - -import java.util.ArrayList; -import java.util.List; - -public final class LootDisplay implements Display { - private final float chance1; - private final float chance2; - private final float chance3; - - private final List inputEntries; - private final List outputEntries; - - public LootDisplay(Ingredient ingredient, - ItemStack stack1, float chance1, - ItemStack stack2, float chance2, - ItemStack stack3, float chance3) { - this.chance1 = chance1; - this.chance2 = chance2; - this.chance3 = chance3; - - this.inputEntries = List.of(EntryIngredients.ofIngredient(ingredient)); - - this.outputEntries = new ArrayList<>(); - this.outputEntries.add(EntryIngredients.of(VanillaEntryTypes.ITEM, List.of(stack1))); - this.outputEntries.add(EntryIngredients.of(VanillaEntryTypes.ITEM, List.of(stack2))); - this.outputEntries.add(EntryIngredients.of(VanillaEntryTypes.ITEM, List.of(stack3))); - } - - public float getChance1() { - return chance1; - } - - public float getChance2() { - return chance2; - } - - public float getChance3() { - return chance3; - } - - @Override - public List getInputEntries() { - return inputEntries; - } - - @Override - public List getOutputEntries() { - return outputEntries; - } - - @Override - public CategoryIdentifier getCategoryIdentifier() { - return REIPlugin.LOOT; - } -} +//package com.shynieke.statues.compat.rei.display; +// +//import com.shynieke.statues.compat.rei.REIPlugin; +//import me.shedaniel.rei.api.common.category.CategoryIdentifier; +//import me.shedaniel.rei.api.common.display.Display; +//import me.shedaniel.rei.api.common.entry.EntryIngredient; +//import me.shedaniel.rei.api.common.entry.type.VanillaEntryTypes; +//import me.shedaniel.rei.api.common.util.EntryIngredients; +//import net.minecraft.world.item.ItemStack; +//import net.minecraft.world.item.crafting.Ingredient; +// +//import java.util.ArrayList; +//import java.util.List; +// +//public final class LootDisplay implements Display { +// private final float chance1; +// private final float chance2; +// private final float chance3; +// +// private final List inputEntries; +// private final List outputEntries; +// +// public LootDisplay(Ingredient ingredient, +// ItemStack stack1, float chance1, +// ItemStack stack2, float chance2, +// ItemStack stack3, float chance3) { +// this.chance1 = chance1; +// this.chance2 = chance2; +// this.chance3 = chance3; +// +// this.inputEntries = List.of(EntryIngredients.ofIngredient(ingredient)); +// +// this.outputEntries = new ArrayList<>(); +// this.outputEntries.add(EntryIngredients.of(VanillaEntryTypes.ITEM, List.of(stack1))); +// this.outputEntries.add(EntryIngredients.of(VanillaEntryTypes.ITEM, List.of(stack2))); +// this.outputEntries.add(EntryIngredients.of(VanillaEntryTypes.ITEM, List.of(stack3))); +// } +// +// public float getChance1() { +// return chance1; +// } +// +// public float getChance2() { +// return chance2; +// } +// +// public float getChance3() { +// return chance3; +// } +// +// @Override +// public List getInputEntries() { +// return inputEntries; +// } +// +// @Override +// public List getOutputEntries() { +// return outputEntries; +// } +// +// @Override +// public CategoryIdentifier getCategoryIdentifier() { +// return REIPlugin.LOOT; +// } +//} diff --git a/src/main/java/com/shynieke/statues/compat/rei/display/UpgradeDisplay.java b/src/main/java/com/shynieke/statues/compat/rei/display/UpgradeDisplay.java index 384e5970..b78f72db 100644 --- a/src/main/java/com/shynieke/statues/compat/rei/display/UpgradeDisplay.java +++ b/src/main/java/com/shynieke/statues/compat/rei/display/UpgradeDisplay.java @@ -1,92 +1,92 @@ -package com.shynieke.statues.compat.rei.display; - -import com.shynieke.statues.compat.rei.REIPlugin; -import com.shynieke.statues.recipe.UpgradeType; -import com.shynieke.statues.registry.StatueTags; -import me.shedaniel.rei.api.common.category.CategoryIdentifier; -import me.shedaniel.rei.api.common.display.Display; -import me.shedaniel.rei.api.common.entry.EntryIngredient; -import me.shedaniel.rei.api.common.util.EntryIngredients; -import net.minecraft.core.NonNullList; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.crafting.Ingredient; - -import java.util.ArrayList; -import java.util.List; - -public final class UpgradeDisplay implements Display { - private final boolean requireCore; - private final UpgradeType upgradeType; - private final int tier; - - private final List inputEntries; - private final List outputEntries; - - private final EntryIngredient centerEntry; - private final List catalystsEntries; - private final EntryIngredient resultEntry; - private final EntryIngredient coreEntry; - - public UpgradeDisplay(List centerStacks, NonNullList catalysts, List stacks, boolean requireCore, - UpgradeType upgradeType, int tier) { - this.requireCore = requireCore; - this.upgradeType = upgradeType; - this.tier = tier; - - this.inputEntries = new ArrayList<>(); - this.inputEntries.add(EntryIngredients.ofItemStacks(centerStacks)); - if (requireCore) - this.inputEntries.add(EntryIngredients.ofIngredient(Ingredient.of(StatueTags.STATUE_CORE))); - this.inputEntries.addAll(EntryIngredients.ofIngredients(catalysts)); - - this.outputEntries = List.of(EntryIngredients.ofItemStacks(stacks)); - - this.centerEntry = EntryIngredients.ofItemStacks(centerStacks); - this.catalystsEntries = EntryIngredients.ofIngredients(catalysts); - this.resultEntry = EntryIngredients.ofItemStacks(stacks); - this.coreEntry = EntryIngredients.ofIngredient(Ingredient.of(StatueTags.STATUE_CORE)); - } - - public EntryIngredient getCenter() { - return centerEntry; - } - - public List getCatalysts() { - return catalystsEntries; - } - - public EntryIngredient getResult() { - return resultEntry; - } - - public boolean isRequireCore() { - return requireCore; - } - - public EntryIngredient getCore() { - return coreEntry; - } - - public UpgradeType getUpgradeType() { - return upgradeType; - } - - public int getTier() { - return tier; - } - - @Override - public List getInputEntries() { - return inputEntries; - } - - @Override - public List getOutputEntries() { - return outputEntries; - } - - @Override - public CategoryIdentifier getCategoryIdentifier() { - return REIPlugin.UPGRADE; - } -} +//package com.shynieke.statues.compat.rei.display; +// +//import com.shynieke.statues.compat.rei.REIPlugin; +//import com.shynieke.statues.recipe.UpgradeType; +//import com.shynieke.statues.registry.StatueTags; +//import me.shedaniel.rei.api.common.category.CategoryIdentifier; +//import me.shedaniel.rei.api.common.display.Display; +//import me.shedaniel.rei.api.common.entry.EntryIngredient; +//import me.shedaniel.rei.api.common.util.EntryIngredients; +//import net.minecraft.core.NonNullList; +//import net.minecraft.world.item.ItemStack; +//import net.minecraft.world.item.crafting.Ingredient; +// +//import java.util.ArrayList; +//import java.util.List; +// +//public final class UpgradeDisplay implements Display { +// private final boolean requireCore; +// private final UpgradeType upgradeType; +// private final int tier; +// +// private final List inputEntries; +// private final List outputEntries; +// +// private final EntryIngredient centerEntry; +// private final List catalystsEntries; +// private final EntryIngredient resultEntry; +// private final EntryIngredient coreEntry; +// +// public UpgradeDisplay(List centerStacks, NonNullList catalysts, List stacks, boolean requireCore, +// UpgradeType upgradeType, int tier) { +// this.requireCore = requireCore; +// this.upgradeType = upgradeType; +// this.tier = tier; +// +// this.inputEntries = new ArrayList<>(); +// this.inputEntries.add(EntryIngredients.ofItemStacks(centerStacks)); +// if (requireCore) +// this.inputEntries.add(EntryIngredients.ofIngredient(Ingredient.of(StatueTags.STATUE_CORE))); +// this.inputEntries.addAll(EntryIngredients.ofIngredients(catalysts)); +// +// this.outputEntries = List.of(EntryIngredients.ofItemStacks(stacks)); +// +// this.centerEntry = EntryIngredients.ofItemStacks(centerStacks); +// this.catalystsEntries = EntryIngredients.ofIngredients(catalysts); +// this.resultEntry = EntryIngredients.ofItemStacks(stacks); +// this.coreEntry = EntryIngredients.ofIngredient(Ingredient.of(StatueTags.STATUE_CORE)); +// } +// +// public EntryIngredient getCenter() { +// return centerEntry; +// } +// +// public List getCatalysts() { +// return catalystsEntries; +// } +// +// public EntryIngredient getResult() { +// return resultEntry; +// } +// +// public boolean isRequireCore() { +// return requireCore; +// } +// +// public EntryIngredient getCore() { +// return coreEntry; +// } +// +// public UpgradeType getUpgradeType() { +// return upgradeType; +// } +// +// public int getTier() { +// return tier; +// } +// +// @Override +// public List getInputEntries() { +// return inputEntries; +// } +// +// @Override +// public List getOutputEntries() { +// return outputEntries; +// } +// +// @Override +// public CategoryIdentifier getCategoryIdentifier() { +// return REIPlugin.UPGRADE; +// } +//} diff --git a/src/main/java/com/shynieke/statues/datacomponent/PlayerCompassData.java b/src/main/java/com/shynieke/statues/datacomponent/PlayerCompassData.java index 99b50434..df7d7c9f 100644 --- a/src/main/java/com/shynieke/statues/datacomponent/PlayerCompassData.java +++ b/src/main/java/com/shynieke/statues/datacomponent/PlayerCompassData.java @@ -3,12 +3,13 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.core.BlockPos; +import net.minecraft.core.GlobalPos; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.codec.StreamCodec; -public record PlayerCompassData(BlockPos pos, String name) { +public record PlayerCompassData(GlobalPos globalPos, String name) { public static final Codec CODEC = RecordCodecBuilder.create(inst -> inst.group( - BlockPos.CODEC.fieldOf("pos").forGetter(PlayerCompassData::pos), + GlobalPos.CODEC.fieldOf("globalPos").forGetter(PlayerCompassData::globalPos), Codec.STRING.fieldOf("name").forGetter(PlayerCompassData::name)) .apply(inst, PlayerCompassData::new)); public static final StreamCodec STREAM_CODEC = StreamCodec.of( @@ -16,13 +17,13 @@ public record PlayerCompassData(BlockPos pos, String name) { ); private static PlayerCompassData fromNetwork(RegistryFriendlyByteBuf byteBuf) { - BlockPos pos = BlockPos.STREAM_CODEC.decode(byteBuf); + GlobalPos pos = GlobalPos.STREAM_CODEC.decode(byteBuf); String name = byteBuf.readUtf(32767); return new PlayerCompassData(pos, name); } private static void toNetwork(RegistryFriendlyByteBuf byteBuf, PlayerCompassData playerCompassData) { - BlockPos.STREAM_CODEC.encode(byteBuf, playerCompassData.pos()); + GlobalPos.STREAM_CODEC.encode(byteBuf, playerCompassData.globalPos()); byteBuf.writeUtf(playerCompassData.name()); } } diff --git a/src/main/java/com/shynieke/statues/datagen/StatuesDataGenerator.java b/src/main/java/com/shynieke/statues/datagen/StatuesDataGenerator.java index 0a0874dc..7700eba1 100644 --- a/src/main/java/com/shynieke/statues/datagen/StatuesDataGenerator.java +++ b/src/main/java/com/shynieke/statues/datagen/StatuesDataGenerator.java @@ -13,7 +13,6 @@ import com.shynieke.statues.datagen.server.StatueItemTagProvider; import com.shynieke.statues.datagen.server.StatueLootProvider; import com.shynieke.statues.datagen.server.StatueRecipeProvider; -import com.shynieke.statues.datagen.server.patchouli.StatuePatchouliProvider; import com.shynieke.statues.registry.StatueJukeboxSongs; import com.shynieke.statues.registry.StatueTrims; import net.minecraft.core.Cloner; @@ -38,32 +37,29 @@ @EventBusSubscriber(bus = EventBusSubscriber.Bus.MOD) public class StatuesDataGenerator { @SubscribeEvent - public static void gatherData(GatherDataEvent event) { + public static void gatherData(GatherDataEvent.Client event) { DataGenerator generator = event.getGenerator(); PackOutput packOutput = generator.getPackOutput(); CompletableFuture lookupProvider = event.getLookupProvider(); ExistingFileHelper helper = event.getExistingFileHelper(); - if (event.includeServer()) { - generator.addProvider(event.includeServer(), new StatueLootProvider(packOutput, lookupProvider)); - generator.addProvider(event.includeServer(), new StatueRecipeProvider(packOutput, lookupProvider)); - StatueBlockTagProvider blockTags = new StatueBlockTagProvider(packOutput, lookupProvider, helper); - generator.addProvider(event.includeServer(), blockTags); - generator.addProvider(event.includeServer(), new StatueItemTagProvider(packOutput, lookupProvider, blockTags, helper)); - generator.addProvider(event.includeServer(), new StatueBiomeTagProvider(packOutput, lookupProvider, helper)); - generator.addProvider(event.includeServer(), new StatueGLMProvider(packOutput, lookupProvider)); - generator.addProvider(event.includeServer(), new StatuePatchouliProvider(packOutput, lookupProvider)); - generator.addProvider(event.includeServer(), new StatueAdvancementProvider(packOutput, lookupProvider, helper)); + generator.addProvider(true, new StatueLanguageProvider(packOutput)); + generator.addProvider(true, new StatueSoundProvider(packOutput, helper)); + generator.addProvider(true, new StatueBlockstateProvider(packOutput, helper)); + generator.addProvider(true, new StatueItemModelProvider(packOutput, helper)); - generator.addProvider(event.includeServer(), new DatapackBuiltinEntriesProvider( - packOutput, CompletableFuture.supplyAsync(StatuesDataGenerator::getProvider), Set.of(Reference.MOD_ID))); - } - if (event.includeClient()) { - generator.addProvider(event.includeClient(), new StatueLanguageProvider(packOutput)); - generator.addProvider(event.includeClient(), new StatueSoundProvider(packOutput, helper)); - generator.addProvider(event.includeClient(), new StatueBlockstateProvider(packOutput, helper)); - generator.addProvider(event.includeClient(), new StatueItemModelProvider(packOutput, helper)); - } + generator.addProvider(true, new StatueLootProvider(packOutput, lookupProvider)); + generator.addProvider(true, new StatueRecipeProvider.Runner(packOutput, lookupProvider)); + StatueBlockTagProvider blockTags = new StatueBlockTagProvider(packOutput, lookupProvider, helper); + generator.addProvider(true, blockTags); + generator.addProvider(true, new StatueItemTagProvider(packOutput, lookupProvider, blockTags, helper)); + generator.addProvider(true, new StatueBiomeTagProvider(packOutput, lookupProvider, helper)); + generator.addProvider(true, new StatueGLMProvider(packOutput, lookupProvider)); +// generator.addProvider(true, new StatuePatchouliProvider(packOutput, lookupProvider)); + generator.addProvider(true, new StatueAdvancementProvider(packOutput, lookupProvider, helper)); + + generator.addProvider(true, new DatapackBuiltinEntriesProvider( + packOutput, CompletableFuture.supplyAsync(StatuesDataGenerator::getProvider), Set.of(Reference.MOD_ID))); } private static RegistrySetBuilder.PatchedRegistries getProvider() { diff --git a/src/main/java/com/shynieke/statues/datagen/client/StatueItemModelProvider.java b/src/main/java/com/shynieke/statues/datagen/client/StatueItemModelProvider.java index 26e69b2e..2219554c 100644 --- a/src/main/java/com/shynieke/statues/datagen/client/StatueItemModelProvider.java +++ b/src/main/java/com/shynieke/statues/datagen/client/StatueItemModelProvider.java @@ -7,7 +7,6 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemNameBlockItem; import net.minecraft.world.item.SpawnEggItem; import net.neoforged.neoforge.client.model.generators.ItemModelBuilder; import net.neoforged.neoforge.client.model.generators.ItemModelProvider; @@ -23,12 +22,12 @@ public StatueItemModelProvider(PackOutput packOutput, ExistingFileHelper helper) protected void registerModels() { for (DeferredHolder registryObject : StatueRegistry.ITEMS.getEntries()) { if (registryObject.get() instanceof BlockItem blockItem) { - if (blockItem instanceof ItemNameBlockItem) { + if (blockItem.getBlock() == StatueRegistry.CORE_FLOWER_CROP.get()) { generatedItem(registryObject.getId()); } else { if (registryObject.getId().equals(StatueRegistry.CORE_FLOWER_ITEM.getId())) singleTexture(registryObject.getId().getPath(), ResourceLocation.withDefaultNamespace("item/generated"), - "layer0", ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "block/" + registryObject.getId().getPath())); + "layer0", Reference.modLoc("block/" + registryObject.getId().getPath())); else withBlockParent(registryObject.getId()); } @@ -50,7 +49,7 @@ private void withBlockParent(ResourceLocation location) { private void generatedItem(ResourceLocation location) { singleTexture(location.getPath(), ResourceLocation.withDefaultNamespace("item/generated"), - "layer0", ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "item/" + location.getPath())); + "layer0", Reference.modLoc("item/" + location.getPath())); } private void generateStatueCompass(ResourceLocation location, ResourceLocation textureLocation) { diff --git a/src/main/java/com/shynieke/statues/datagen/client/StatueLanguageProvider.java b/src/main/java/com/shynieke/statues/datagen/client/StatueLanguageProvider.java index 2707c538..7edaeee8 100644 --- a/src/main/java/com/shynieke/statues/datagen/client/StatueLanguageProvider.java +++ b/src/main/java/com/shynieke/statues/datagen/client/StatueLanguageProvider.java @@ -426,7 +426,7 @@ public void addSubtitle(Supplier sound, String text) { * @param text The subtitle text */ public void addSubtitle(SoundEvent sound, String text) { - String path = Reference.MOD_ID + ".subtitle." + sound.getLocation().getPath(); + String path = Reference.MOD_ID + ".subtitle." + sound.location().getPath(); this.add(path, text); } diff --git a/src/main/java/com/shynieke/statues/datagen/client/StatueSoundProvider.java b/src/main/java/com/shynieke/statues/datagen/client/StatueSoundProvider.java index a1e1d59a..c1e64f5d 100644 --- a/src/main/java/com/shynieke/statues/datagen/client/StatueSoundProvider.java +++ b/src/main/java/com/shynieke/statues/datagen/client/StatueSoundProvider.java @@ -177,6 +177,6 @@ public String modSubtitle(ResourceLocation id) { } public ResourceLocation modLoc(String name) { - return ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, name); + return Reference.modLoc(name); } } diff --git a/src/main/java/com/shynieke/statues/datagen/server/StatueAdvancementProvider.java b/src/main/java/com/shynieke/statues/datagen/server/StatueAdvancementProvider.java index 2f65acb5..e284ca89 100644 --- a/src/main/java/com/shynieke/statues/datagen/server/StatueAdvancementProvider.java +++ b/src/main/java/com/shynieke/statues/datagen/server/StatueAdvancementProvider.java @@ -10,14 +10,11 @@ import net.minecraft.advancements.Criterion; import net.minecraft.advancements.DisplayInfo; import net.minecraft.advancements.critereon.EnterBlockTrigger; -import net.minecraft.advancements.critereon.EntityPredicate; import net.minecraft.advancements.critereon.InventoryChangeTrigger; -import net.minecraft.advancements.critereon.KilledTrigger; import net.minecraft.core.HolderLookup; import net.minecraft.data.PackOutput; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.entity.EntityType; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.ItemLike; @@ -368,16 +365,6 @@ protected static DisplayInfo hiddenDisplay(ItemLike icon, String name, Advanceme Optional.empty(), type, true, true, true); } - /** - * Get a trigger instance for killing an entity. - * - * @param entityType The entity type. - * @return The trigger instance. - */ - protected static Criterion onKill(EntityType entityType) { - return KilledTrigger.TriggerInstance.playerKilledEntity(EntityPredicate.Builder.entity().of(entityType)); - } - /** * Get a trigger instance for holding items. * @@ -395,7 +382,7 @@ protected static Criterion onHeldItems(I * @return The ResourceLocation. */ private static ResourceLocation modLoc(String path) { - return ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, path); + return Reference.modLoc(path); } /** diff --git a/src/main/java/com/shynieke/statues/datagen/server/StatueBiomeModifiers.java b/src/main/java/com/shynieke/statues/datagen/server/StatueBiomeModifiers.java index f461932e..06b7d774 100644 --- a/src/main/java/com/shynieke/statues/datagen/server/StatueBiomeModifiers.java +++ b/src/main/java/com/shynieke/statues/datagen/server/StatueBiomeModifiers.java @@ -17,10 +17,10 @@ public class StatueBiomeModifiers { protected static final ResourceKey ADD_SPAWN_MODIFIER = ResourceKey.create(NeoForgeRegistries.Keys.BIOME_MODIFIERS, - ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "add_statue_bat_spawn")); + Reference.modLoc("add_statue_bat_spawn")); protected static final ResourceKey ADD_FEWER_SPAWN_MODIFIER = ResourceKey.create(NeoForgeRegistries.Keys.BIOME_MODIFIERS, - ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "add_fewer_statue_bat_spawn")); + Reference.modLoc("add_fewer_statue_bat_spawn")); public static void bootstrap(BootstrapContext context) { HolderGetter biomeGetter = context.lookup(Registries.BIOME); diff --git a/src/main/java/com/shynieke/statues/datagen/server/StatueLootProvider.java b/src/main/java/com/shynieke/statues/datagen/server/StatueLootProvider.java index b22a05e0..10743d3d 100644 --- a/src/main/java/com/shynieke/statues/datagen/server/StatueLootProvider.java +++ b/src/main/java/com/shynieke/statues/datagen/server/StatueLootProvider.java @@ -129,11 +129,6 @@ public void generate() { .when(LootItemKilledByPlayerCondition.killedByPlayer()))); } - @Override - protected boolean canHaveLootTable(EntityType entitytype) { - return true; - } - @Override protected Stream> getKnownEntityTypes() { return StatueRegistry.ENTITIES.getEntries().stream().map(holder -> holder.get()); diff --git a/src/main/java/com/shynieke/statues/datagen/server/StatueRecipeProvider.java b/src/main/java/com/shynieke/statues/datagen/server/StatueRecipeProvider.java index 7c31aad4..707cd6a0 100644 --- a/src/main/java/com/shynieke/statues/datagen/server/StatueRecipeProvider.java +++ b/src/main/java/com/shynieke/statues/datagen/server/StatueRecipeProvider.java @@ -2,31 +2,35 @@ import com.shynieke.statues.Reference; import com.shynieke.statues.Statues; +import com.shynieke.statues.datagen.StatuesDataGenerator; +import com.shynieke.statues.datagen.server.recipe.HardcoreRecipeBuilder; import com.shynieke.statues.datagen.server.recipe.LootRecipeBuilder; import com.shynieke.statues.datagen.server.recipe.UpgradeRecipeBuilder; import com.shynieke.statues.recipe.UpgradeType; import com.shynieke.statues.registry.StatueRegistry; import com.shynieke.statues.registry.StatueTags; import net.minecraft.ChatFormatting; -import net.minecraft.advancements.AdvancementHolder; import net.minecraft.core.Holder; import net.minecraft.core.HolderLookup; +import net.minecraft.core.HolderLookup.Provider; +import net.minecraft.core.HolderSet; import net.minecraft.core.component.DataComponentPredicate; import net.minecraft.core.component.DataComponents; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.Registries; -import net.minecraft.data.CachedOutput; import net.minecraft.data.PackOutput; import net.minecraft.data.recipes.RecipeCategory; import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.data.recipes.RecipeProvider; -import net.minecraft.data.recipes.ShapedRecipeBuilder; -import net.minecraft.data.recipes.ShapelessRecipeBuilder; import net.minecraft.data.recipes.SingleItemRecipeBuilder; +import net.minecraft.data.recipes.packs.VanillaRecipeProvider; import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.ItemTags; +import net.minecraft.tags.TagKey; +import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; +import net.minecraft.world.item.component.ItemLore; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.enchantment.Enchantment; import net.minecraft.world.item.enchantment.Enchantments; @@ -40,247 +44,266 @@ import java.util.concurrent.CompletableFuture; public class StatueRecipeProvider extends RecipeProvider { - public StatueRecipeProvider(PackOutput packOutput, CompletableFuture lookupProvider) { - super(packOutput, lookupProvider); + public StatueRecipeProvider(HolderLookup.Provider provider, RecipeOutput recipeOutput) { + super(provider, recipeOutput); } @Override - protected void buildRecipes(RecipeOutput consumer, HolderLookup.Provider provider) { + protected void buildRecipes() { + ItemStack hardcorePlayer = new ItemStack(StatueRegistry.PLAYER_STATUE.get()); + ItemLore lore = ItemLore.EMPTY; + lore = lore.withLineAdded(Component.literal("Only craftable in Hardcore Mode").withStyle(ChatFormatting.DARK_PURPLE)); + hardcorePlayer.set(DataComponents.LORE, lore); + HardcoreRecipeBuilder.hardcore(this.items, RecipeCategory.MISC, hardcorePlayer); + LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.BABY_ZOMBIE_STATUE.get())) - .result1(Items.ROTTEN_FLESH).result2(Items.IRON_NUGGET).save(consumer); + .result1(Items.ROTTEN_FLESH).result2(Items.IRON_NUGGET).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.BEE_STATUE.get(), StatueRegistry.ANGRY_BEE_STATUE.get(), StatueRegistry.TRANS_BEE_STATUE.get())) - .result2(Items.HONEYCOMB).save(consumer); + .result2(Items.HONEYCOMB).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.BLAZE_STATUE.get())) - .result1(Items.BLAZE_POWDER).result2(Items.BLAZE_ROD).save(consumer); + .result1(Items.BLAZE_POWDER).result2(Items.BLAZE_ROD).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.CAT_BLACK_STATUE.get(), StatueRegistry.CAT_BRITISH_SHORTHAIR_STATUE.get(), StatueRegistry.CAT_CALICO_STATUE.get(), StatueRegistry.CAT_JELLIE_STATUE.get(), StatueRegistry.CAT_PERSIAN_STATUE.get(), StatueRegistry.CAT_RAGDOLL_STATUE.get(), StatueRegistry.CAT_RED_STATUE.get(), StatueRegistry.CAT_SIAMESE_STATUE.get(), StatueRegistry.CAT_TABBY_STATUE.get(), StatueRegistry.CAT_TUXEDO_STATUE.get(), StatueRegistry.CAT_WHITE_STATUE.get())) - .result1(Items.STRING).result3(getIOU()).save(consumer, - ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "loot/cat_statue")); //TODO: Allow the sleeping loot table + .result1(Items.STRING).result3(getIOU()).save(this.output, + Reference.modLoc("loot/cat_statue")); //TODO: Allow the sleeping loot table LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.CHICKEN_STATUE.get())) - .result1(Items.FEATHER).result2(Items.CHICKEN).result3(Items.EGG).save(consumer); + .result1(Items.FEATHER).result2(Items.CHICKEN).result3(Items.EGG).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.CHICKEN_JOCKEY_STATUE.get())) - .result1(Items.ROTTEN_FLESH).result2(Items.FEATHER).save(consumer); + .result1(Items.ROTTEN_FLESH).result2(Items.FEATHER).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.KING_CLUCK_STATUE.get())) - .result1(StatueRegistry.NUGGET.get()).result3(Items.GOLD_NUGGET).save(consumer); + .result1(StatueRegistry.NUGGET.get()).result3(Items.GOLD_NUGGET).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.COW_STATUE.get())) - .result1(Items.BEEF).result3(Items.LEATHER).save(consumer); + .result1(Items.BEEF).result3(Items.LEATHER).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.CREEPER_STATUE.get())) - .result1(Items.GUNPOWDER).save(consumer); + .result1(Items.GUNPOWDER).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.COD_STATUE.get())) - .result1(Items.COD).result2(Items.BONE_MEAL).save(consumer); + .result1(Items.COD).result2(Items.BONE_MEAL).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.DOLPHIN_STATUE.get())) - .result1(Items.COD).save(consumer); + .result1(Items.COD).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.ENDERMAN_STATUE.get())) .result1(new ItemStack(StatueRegistry.PEBBLE.get(), 16)) - .result2(Items.ENDER_PEARL).save(consumer); + .result2(Items.ENDER_PEARL).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.ELDER_GUARDIAN_STATUE.get())) - .result1(Items.PRISMARINE_CRYSTALS, 0.75F).result2(Items.WET_SPONGE).result3(Items.PRISMARINE_CRYSTALS, 0.25F).save(consumer); + .result1(Items.PRISMARINE_CRYSTALS, 0.75F).result2(Items.WET_SPONGE).result3(Items.PRISMARINE_CRYSTALS, 0.25F).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.FLOOD_STATUE.get())) - .result1(Items.FIREWORK_ROCKET).result2(Items.ROTTEN_FLESH).result3(Items.EMERALD).save(consumer); + .result1(Items.FIREWORK_ROCKET).result2(Items.ROTTEN_FLESH).result3(Items.EMERALD).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.FOX_STATUE.get(), StatueRegistry.FOX_SNOW_STATUE.get())) - .result1(Items.SWEET_BERRIES).save(consumer); + .result1(Items.SWEET_BERRIES).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.GHAST_STATUE.get())) - .result1(Items.GUNPOWDER).result3(Items.GHAST_TEAR).save(consumer); + .result1(Items.GUNPOWDER).result3(Items.GHAST_TEAR).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.GUARDIAN_STATUE.get())) - .result1(Items.COD).result2(Items.PRISMARINE_SHARD).result3(Items.PRISMARINE_CRYSTALS).save(consumer); + .result1(Items.COD).result2(Items.PRISMARINE_SHARD).result3(Items.PRISMARINE_CRYSTALS).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.HUSK_STATUE.get())).group("zombie") - .result1(Items.ROTTEN_FLESH).result3(Items.IRON_INGOT).save(consumer); + .result1(Items.ROTTEN_FLESH).result3(Items.IRON_INGOT).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.DROWNED_STATUE.get())).group("zombie") - .result1(Items.ROTTEN_FLESH).result3(Items.COPPER_INGOT).save(consumer); + .result1(Items.ROTTEN_FLESH).result3(Items.COPPER_INGOT).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.MAGMA_STATUE.get())) - .result1(Items.MAGMA_CREAM).save(consumer); + .result1(Items.MAGMA_CREAM).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.PIG_STATUE.get())) - .result3(Items.PORKCHOP).save(consumer); + .result3(Items.PORKCHOP).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.PANDA_ANGRY_STATUE.get(), StatueRegistry.PANDA_BROWN_STATUE.get(), StatueRegistry.PANDA_LAZY_STATUE.get(), StatueRegistry.PANDA_NORMAL_STATUE.get(), StatueRegistry.PANDA_PLAYFUL_STATUE.get(), StatueRegistry.PANDA_WEAK_STATUE.get(), StatueRegistry.PANDA_WORRIED_STATUE.get())) - .result1(Items.BAMBOO).save(consumer, - ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "loot/panda_statue")); + .result1(Items.BAMBOO).save(this.output, + Reference.modLoc("loot/panda_statue")); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.PILLAGER_STATUE.get())) - .result1(Items.ARROW).result2(Items.CROSSBOW, 0.25F).result3(Items.EMERALD, 0.05F).save(consumer); + .result1(Items.ARROW).result2(Items.CROSSBOW, 0.25F).result3(Items.EMERALD, 0.05F).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.RABBIT_BR_STATUE.get(), StatueRegistry.RABBIT_BS_STATUE.get(), StatueRegistry.RABBIT_BW_STATUE.get(), StatueRegistry.RABBIT_GO_STATUE.get(), StatueRegistry.RABBIT_WH_STATUE.get(), StatueRegistry.RABBIT_WS_STATUE.get() )) - .result1(Items.RABBIT_HIDE).result2(Items.RABBIT).result3(Items.RABBIT_FOOT).save(consumer, - ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "loot/rabbit_statue")); + .result1(Items.RABBIT_HIDE).result2(Items.RABBIT).result3(Items.RABBIT_FOOT).save(this.output, + Reference.modLoc("loot/rabbit_statue")); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.RAVAGER_STATUE.get())) - .result3(Items.SADDLE).save(consumer); + .result3(Items.SADDLE).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.SALMON_STATUE.get())) - .result1(Items.SALMON).result2(Items.BONE_MEAL).save(consumer); + .result1(Items.SALMON).result2(Items.BONE_MEAL).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.TROPICAL_FISH_B.get(), StatueRegistry.TROPICAL_FISH_BB.get(), StatueRegistry.TROPICAL_FISH_BE.get(), StatueRegistry.TROPICAL_FISH_BM.get(), StatueRegistry.TROPICAL_FISH_BMB.get(), StatueRegistry.TROPICAL_FISH_BMS.get(), StatueRegistry.TROPICAL_FISH_E.get(), StatueRegistry.TROPICAL_FISH_ES.get(), StatueRegistry.TROPICAL_FISH_HB.get(), StatueRegistry.TROPICAL_FISH_SB.get(), StatueRegistry.TROPICAL_FISH_SD.get(), StatueRegistry.TROPICAL_FISH_SS.get())) - .result1(Items.TROPICAL_FISH).result2(Items.BONE_MEAL).save(consumer, - ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "loot/tropical_fish")); + .result1(Items.TROPICAL_FISH).result2(Items.BONE_MEAL).save(this.output, + Reference.modLoc("loot/tropical_fish")); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.SHULKER_STATUE.get())) - .result3(Items.SHULKER_SHELL).save(consumer); + .result3(Items.SHULKER_SHELL).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.SHEEP_STATUE_WHITE.get())).group("sheep") - .result1(Blocks.WHITE_WOOL).result3(Items.MUTTON).save(consumer); + .result1(Blocks.WHITE_WOOL).result3(Items.MUTTON).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.SHEEP_STATUE_ORANGE.get())).group("sheep") - .result1(Blocks.ORANGE_WOOL).result3(Items.MUTTON).save(consumer); + .result1(Blocks.ORANGE_WOOL).result3(Items.MUTTON).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.SHEEP_STATUE_MAGENTA.get())).group("sheep") - .result1(Blocks.MAGENTA_WOOL).result3(Items.MUTTON).save(consumer); + .result1(Blocks.MAGENTA_WOOL).result3(Items.MUTTON).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.SHEEP_STATUE_LIGHT_BLUE.get())).group("sheep") - .result1(Blocks.LIGHT_BLUE_WOOL).result3(Items.MUTTON).save(consumer); + .result1(Blocks.LIGHT_BLUE_WOOL).result3(Items.MUTTON).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.SHEEP_STATUE_YELLOW.get())).group("sheep") - .result1(Blocks.YELLOW_WOOL).result3(Items.MUTTON).save(consumer); + .result1(Blocks.YELLOW_WOOL).result3(Items.MUTTON).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.SHEEP_STATUE_LIME.get())).group("sheep") - .result1(Blocks.LIME_WOOL).result3(Items.MUTTON).save(consumer); + .result1(Blocks.LIME_WOOL).result3(Items.MUTTON).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.SHEEP_STATUE_PINK.get())).group("sheep") - .result1(Blocks.PINK_WOOL).result3(Items.MUTTON).save(consumer); + .result1(Blocks.PINK_WOOL).result3(Items.MUTTON).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.SHEEP_STATUE_GRAY.get())).group("sheep") - .result1(Blocks.GRAY_WOOL).result3(Items.MUTTON).save(consumer); + .result1(Blocks.GRAY_WOOL).result3(Items.MUTTON).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.SHEEP_STATUE_LIGHT_GRAY.get())).group("sheep") - .result1(Blocks.LIGHT_GRAY_WOOL).result3(Items.MUTTON).save(consumer); + .result1(Blocks.LIGHT_GRAY_WOOL).result3(Items.MUTTON).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.SHEEP_STATUE_CYAN.get())).group("sheep") - .result1(Blocks.CYAN_WOOL).result3(Items.MUTTON).save(consumer); + .result1(Blocks.CYAN_WOOL).result3(Items.MUTTON).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.SHEEP_STATUE_PURPLE.get())).group("sheep") - .result1(Blocks.PURPLE_WOOL).result3(Items.MUTTON).save(consumer); + .result1(Blocks.PURPLE_WOOL).result3(Items.MUTTON).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.SHEEP_STATUE_BLUE.get())).group("sheep") - .result1(Blocks.BLUE_WOOL).result3(Items.MUTTON).save(consumer); + .result1(Blocks.BLUE_WOOL).result3(Items.MUTTON).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.SHEEP_STATUE_BROWN.get())).group("sheep") - .result1(Blocks.BROWN_WOOL).result3(Items.MUTTON).save(consumer); + .result1(Blocks.BROWN_WOOL).result3(Items.MUTTON).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.SHEEP_STATUE_GREEN.get())).group("sheep") - .result1(Blocks.GREEN_WOOL).result3(Items.MUTTON).save(consumer); + .result1(Blocks.GREEN_WOOL).result3(Items.MUTTON).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.SHEEP_STATUE_RED.get())).group("sheep") - .result1(Blocks.RED_WOOL).result3(Items.MUTTON).save(consumer); + .result1(Blocks.RED_WOOL).result3(Items.MUTTON).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.SHEEP_STATUE_BLACK.get())).group("sheep") - .result1(Blocks.BLACK_WOOL).result3(Items.MUTTON).save(consumer); + .result1(Blocks.BLACK_WOOL).result3(Items.MUTTON).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.SHEEP_SHAVEN_STATUE.get())).group("sheep") - .result3(Items.MUTTON).save(consumer); + .result3(Items.MUTTON).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.SLIME_STATUE.get())) - .result2(Items.SLIME_BALL).save(consumer); + .result2(Items.SLIME_BALL).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.SNOW_GOLEM_STATUE.get())) - .result1(Items.SNOWBALL).result3(Items.PUMPKIN).save(consumer); + .result1(Items.SNOWBALL).result3(Items.PUMPKIN).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.SQUID_STATUE.get())) - .result2(Items.INK_SAC).save(consumer); + .result2(Items.INK_SAC).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.VILLAGER_BR_STATUE.get(), StatueRegistry.VILLAGER_GR_STATUE.get(), StatueRegistry.VILLAGER_PU_STATUE.get(), StatueRegistry.VILLAGER_WH_STATUE.get())) - .result3(Items.EMERALD).save(consumer, ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "loot/villager_statue")); //TODO: Use trading in future + .result3(Items.EMERALD).save(this.output, Reference.modLoc("loot/villager_statue")); //TODO: Use trading in future LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.WITCH_STATUE.get())) - .result1(Items.GLOWSTONE_DUST).result2(Items.REDSTONE).result3(Items.GLASS_BOTTLE).save(consumer); + .result1(Items.GLOWSTONE_DUST).result2(Items.REDSTONE).result3(Items.GLASS_BOTTLE).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.WASTELAND_STATUE.get())) - .result1(StatueRegistry.TEA.get()).result2(getWastelandBlock(provider)).save(consumer); + .result1(StatueRegistry.TEA.get()).result2(getWastelandBlock(this.registries)).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.ZOMBIE_STATUE.get())).group("zombie") - .result1(Items.ROTTEN_FLESH).result3(Items.IRON_INGOT).save(consumer); + .result1(Items.ROTTEN_FLESH).result3(Items.IRON_INGOT).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.PUFFERFISH_STATUE.get(), StatueRegistry.PUFFERFISH_MEDIUM_STATUE.get(), StatueRegistry.PUFFERFISH_SMALL_STATUE.get())) - .result2(Items.PUFFERFISH).save(consumer); + .result2(Items.PUFFERFISH).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.SPIDER_STATUE.get())) - .result1(Items.STRING).result2(Items.SPIDER_EYE).save(consumer); + .result1(Items.STRING).result2(Items.SPIDER_EYE).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.EVOKER_STATUE.get())) - .result3(Items.TOTEM_OF_UNDYING).save(consumer); + .result3(Items.TOTEM_OF_UNDYING).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.CAMPFIRE_STATUE.get())) - .result1(StatueRegistry.MARSHMALLOW.get()).save(consumer); + .result1(StatueRegistry.MARSHMALLOW.get()).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.TURTLE_STATUE.get())) - .result1(Items.SEAGRASS).result2(Items.BOWL).result3(Items.TURTLE_SCUTE).save(consumer); + .result1(Items.SEAGRASS).result2(Items.BOWL).result3(Items.TURTLE_SCUTE).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.MOOSHROOM_STATUE.get())) - .result1(Items.BEEF).result2(Items.RED_MUSHROOM).result3(Items.RED_MUSHROOM_BLOCK).save(consumer); + .result1(Items.BEEF).result2(Items.RED_MUSHROOM).result3(Items.RED_MUSHROOM_BLOCK).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.BROWN_MOOSHROOM_STATUE.get())) - .result1(Items.BEEF).result2(Items.BROWN_MUSHROOM).result3(Items.BROWN_MUSHROOM_BLOCK).save(consumer); + .result1(Items.BEEF).result2(Items.BROWN_MUSHROOM).result3(Items.BROWN_MUSHROOM_BLOCK).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.VINDICATOR_STATUE.get())) - .result2(Items.EMERALD).save(consumer); + .result2(Items.EMERALD).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.ALLAY_STATUE.get())) - .result1(Items.LIGHT_BLUE_DYE).result2(Items.LIGHT_BLUE_DYE).result3(Items.LIGHT_BLUE_DYE).save(consumer); - LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.AXOLOTL_LUCY_STATUE.get())).result1(Items.TROPICAL_FISH).save(consumer); - LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.AXOLOTL_WILD_STATUE.get())).result1(Items.TROPICAL_FISH).save(consumer); - LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.AXOLOTL_GOLD_STATUE.get())).result1(Items.TROPICAL_FISH).save(consumer); - LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.AXOLOTL_CYAN_STATUE.get())).result1(Items.TROPICAL_FISH).save(consumer); - LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.AXOLOTL_BLUE_STATUE.get())).result1(Items.TROPICAL_FISH).save(consumer); + .result1(Items.LIGHT_BLUE_DYE).result2(Items.LIGHT_BLUE_DYE).result3(Items.LIGHT_BLUE_DYE).save(this.output); + LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.AXOLOTL_LUCY_STATUE.get())).result1(Items.TROPICAL_FISH).save(this.output); + LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.AXOLOTL_WILD_STATUE.get())).result1(Items.TROPICAL_FISH).save(this.output); + LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.AXOLOTL_GOLD_STATUE.get())).result1(Items.TROPICAL_FISH).save(this.output); + LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.AXOLOTL_CYAN_STATUE.get())).result1(Items.TROPICAL_FISH).save(this.output); + LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.AXOLOTL_BLUE_STATUE.get())).result1(Items.TROPICAL_FISH).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.FROG_TEMPERATE_STATUE.get())) - .result1(Items.SLIME_BALL).result3(Items.OCHRE_FROGLIGHT).save(consumer); + .result1(Items.SLIME_BALL).result3(Items.OCHRE_FROGLIGHT).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.FROG_WARM_STATUE.get())) - .result1(Items.SLIME_BALL).result3(Items.PEARLESCENT_FROGLIGHT).save(consumer); + .result1(Items.SLIME_BALL).result3(Items.PEARLESCENT_FROGLIGHT).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.FROG_COLD_STATUE.get())) - .result1(Items.SLIME_BALL).result3(Items.VERDANT_FROGLIGHT).save(consumer); + .result1(Items.SLIME_BALL).result3(Items.VERDANT_FROGLIGHT).save(this.output); LootRecipeBuilder.loot(Ingredient.of(StatueRegistry.WARDEN_STATUE.get())) - .result1(Items.SCULK_SENSOR).result2(Items.SCULK_SHRIEKER).result3(Items.SCULK_CATALYST).save(consumer); + .result1(Items.SCULK_SENSOR).result2(Items.SCULK_SHRIEKER).result3(Items.SCULK_CATALYST).save(this.output); - UpgradeRecipeBuilder.upgrade(Ingredient.of(StatueTags.UPGRADEABLE_STATUES), new ArrayList<>()) - .requiresCore().upgradeType(UpgradeType.UPGRADE).save(consumer, ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "upgrade/statue_upgrade")); + HolderSet upgradeableStatues = tagSet(StatueTags.UPGRADEABLE_STATUES); + UpgradeRecipeBuilder.upgrade(Ingredient.of(upgradeableStatues), new ArrayList<>()) + .requiresCore().upgradeType(UpgradeType.UPGRADE).save(this.output, Reference.modLoc("upgrade/statue_upgrade")); - UpgradeRecipeBuilder.upgrade(Ingredient.of(StatueTags.UPGRADEABLE_STATUES), List.of(Ingredient.of(Items.GLOW_INK_SAC))) - .upgradeType(UpgradeType.GLOWING).save(consumer, ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "upgrade/glowing")); + UpgradeRecipeBuilder.upgrade(Ingredient.of(upgradeableStatues), List.of(Ingredient.of(Items.GLOW_INK_SAC))) + .upgradeType(UpgradeType.GLOWING).save(this.output, Reference.modLoc("upgrade/glowing")); - UpgradeRecipeBuilder.upgrade(Ingredient.of(StatueTags.UPGRADEABLE_STATUES), List.of(Ingredient.of(Items.INK_SAC))) - .upgradeType(UpgradeType.UNGLOWING).save(consumer, ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "upgrade/unglowing")); + UpgradeRecipeBuilder.upgrade(Ingredient.of(upgradeableStatues), List.of(Ingredient.of(Items.INK_SAC))) + .upgradeType(UpgradeType.UNGLOWING).save(this.output, Reference.modLoc("upgrade/unglowing")); - UpgradeRecipeBuilder.upgrade(Ingredient.of(StatueTags.UPGRADEABLE_STATUES), List.of(Ingredient.of(Items.ECHO_SHARD), - Ingredient.of(Tags.Items.EGGS), Ingredient.of(Tags.Items.ENDER_PEARLS), Ingredient.of(ItemTags.SOUL_FIRE_BASE_BLOCKS))) - .upgradeType(UpgradeType.SPAWNER).save(consumer, ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "upgrade/spawner")); + UpgradeRecipeBuilder.upgrade(Ingredient.of(upgradeableStatues), List.of(Ingredient.of(Items.ECHO_SHARD), + Ingredient.of(tagSet(Tags.Items.EGGS)), + Ingredient.of(tagSet(Tags.Items.ENDER_PEARLS)), + Ingredient.of(tagSet(ItemTags.SOUL_FIRE_BASE_BLOCKS))) + ) + .upgradeType(UpgradeType.SPAWNER).save(this.output, Reference.modLoc("upgrade/spawner")); - UpgradeRecipeBuilder.upgrade(Ingredient.of(StatueTags.UPGRADEABLE_STATUES), List.of(Ingredient.of(ItemTags.SKULLS), - Ingredient.of(Items.MYCELIUM), Ingredient.of(Items.LANTERN))) - .upgradeType(UpgradeType.DESPAWNER).save(consumer, ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "upgrade/despawner")); + UpgradeRecipeBuilder.upgrade(Ingredient.of(upgradeableStatues), List.of( + Ingredient.of(tagSet(ItemTags.SKULLS)), + Ingredient.of(Items.MYCELIUM), Ingredient.of(Items.LANTERN)) + ) + .upgradeType(UpgradeType.DESPAWNER).save(this.output, Reference.modLoc("upgrade/despawner")); - UpgradeRecipeBuilder.upgrade(Ingredient.of(StatueTags.UPGRADEABLE_STATUES), List.of(Ingredient.of(Items.DIAMOND_SWORD))).tier(0) - .upgradeType(UpgradeType.MOB_KILLER).save(consumer, ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "upgrade/mob_killer")); + UpgradeRecipeBuilder.upgrade(Ingredient.of(upgradeableStatues), List.of(Ingredient.of(Items.DIAMOND_SWORD))).tier(0) + .upgradeType(UpgradeType.MOB_KILLER).save(this.output, Reference.modLoc("upgrade/mob_killer")); - UpgradeRecipeBuilder.upgrade(Ingredient.of(StatueTags.UPGRADEABLE_STATUES), List.of(Ingredient.of(Tags.Items.STORAGE_BLOCKS_LAPIS), - Ingredient.of(Tags.Items.STORAGE_BLOCKS_LAPIS), Ingredient.of(Tags.Items.STORAGE_BLOCKS_LAPIS), + UpgradeRecipeBuilder.upgrade(Ingredient.of(upgradeableStatues), List.of( + Ingredient.of(tagSet(Tags.Items.STORAGE_BLOCKS_LAPIS)), + Ingredient.of(tagSet(Tags.Items.STORAGE_BLOCKS_LAPIS)), + Ingredient.of(tagSet(Tags.Items.STORAGE_BLOCKS_LAPIS)), DataComponentIngredient.of(false, DataComponentPredicate.builder().build(), Items.ENCHANTED_BOOK))).tier(1) - .upgradeType(UpgradeType.MOB_KILLER).save(consumer, ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "upgrade/mob_killer_2")); + .upgradeType(UpgradeType.MOB_KILLER).save(this.output, Reference.modLoc("upgrade/mob_killer_2")); - UpgradeRecipeBuilder.upgrade(Ingredient.of(StatueTags.UPGRADEABLE_STATUES), List.of(Ingredient.of(Items.EXPERIENCE_BOTTLE))).tier(2) - .upgradeType(UpgradeType.MOB_KILLER).save(consumer, ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "upgrade/mob_killer_3")); + UpgradeRecipeBuilder.upgrade(Ingredient.of(upgradeableStatues), List.of(Ingredient.of(Items.EXPERIENCE_BOTTLE))).tier(2) + .upgradeType(UpgradeType.MOB_KILLER).save(this.output, Reference.modLoc("upgrade/mob_killer_3")); - UpgradeRecipeBuilder.upgrade(Ingredient.of(StatueTags.LOOTABLE_STATUES), List.of(Ingredient.of(Tags.Items.ENDER_PEARLS), - Ingredient.of(Tags.Items.GUNPOWDERS), Ingredient.of(Tags.Items.BONES), Ingredient.of(Items.ROTTEN_FLESH))) - .upgradeType(UpgradeType.LOOTING).save(consumer, ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "upgrade/looting")); + HolderSet lootableStatues = tagSet(StatueTags.LOOTABLE_STATUES); + UpgradeRecipeBuilder.upgrade(Ingredient.of(lootableStatues), List.of(Ingredient.of(tagSet(Tags.Items.ENDER_PEARLS)), + Ingredient.of(tagSet(Tags.Items.GUNPOWDERS)), Ingredient.of(tagSet(Tags.Items.BONES)), Ingredient.of(Items.ROTTEN_FLESH))) + .upgradeType(UpgradeType.LOOTING).save(this.output, Reference.modLoc("upgrade/looting")); - UpgradeRecipeBuilder.upgrade(Ingredient.of(StatueTags.LOOTABLE_STATUES), List.of(Ingredient.of(Items.HOPPER), Ingredient.of(Items.OBSERVER))) - .upgradeType(UpgradeType.AUTOMATION).save(consumer, ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "upgrade/automation")); + UpgradeRecipeBuilder.upgrade(Ingredient.of(lootableStatues), List.of(Ingredient.of(Items.HOPPER), Ingredient.of(Items.OBSERVER))) + .upgradeType(UpgradeType.AUTOMATION).save(this.output, Reference.modLoc("upgrade/automation")); - UpgradeRecipeBuilder.upgrade(Ingredient.of(StatueTags.UPGRADEABLE_STATUES), List.of(Ingredient.of(Tags.Items.DUSTS_REDSTONE), + UpgradeRecipeBuilder.upgrade(Ingredient.of(upgradeableStatues), List.of(Ingredient.of(tagSet(Tags.Items.DUSTS_REDSTONE)), Ingredient.of(Items.SUGAR), Ingredient.of(Items.CLOCK))) - .upgradeType(UpgradeType.SPEED).save(consumer, ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "upgrade/speed")); + .upgradeType(UpgradeType.SPEED).save(this.output, Reference.modLoc("upgrade/speed")); - UpgradeRecipeBuilder.upgrade(Ingredient.of(StatueTags.STATUE_INTERACTABLE), List.of(Ingredient.of(Items.SCULK_SENSOR))) - .upgradeType(UpgradeType.INTERACTION).save(consumer, ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "upgrade/interaction")); + UpgradeRecipeBuilder.upgrade(Ingredient.of(tagSet(StatueTags.STATUE_INTERACTABLE)), List.of(Ingredient.of(Items.SCULK_SENSOR))) + .upgradeType(UpgradeType.INTERACTION).save(this.output, Reference.modLoc("upgrade/interaction")); - UpgradeRecipeBuilder.upgrade(Ingredient.of(StatueTags.UPGRADEABLE_STATUES), List.of(Ingredient.of(Items.NOTE_BLOCK), + UpgradeRecipeBuilder.upgrade(Ingredient.of(upgradeableStatues), List.of(Ingredient.of(Items.NOTE_BLOCK), Ingredient.of(Items.AMETHYST_SHARD))) - .upgradeType(UpgradeType.SOUND).save(consumer, ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "upgrade/sound")); + .upgradeType(UpgradeType.SOUND).save(this.output, Reference.modLoc("upgrade/sound")); + - ShapedRecipeBuilder.shaped(RecipeCategory.MISC, StatueRegistry.STATUE_TABLE.get()) + shaped(RecipeCategory.MISC, StatueRegistry.STATUE_TABLE.get()) .pattern(" P ") .pattern("DCD") .pattern("DDD") .define('P', Items.PISTON) .define('C', Tags.Items.CHESTS_WOODEN) .define('D', Tags.Items.COBBLESTONES_DEEPSLATE) - .unlockedBy("has_wooden_chest", has(Tags.Items.CHESTS_WOODEN)).save(consumer); + .unlockedBy("has_wooden_chest", has(Tags.Items.CHESTS_WOODEN)).save(this.output); - ShapedRecipeBuilder.shaped(RecipeCategory.MISC, StatueRegistry.INFO_STATUE.get()) + shaped(RecipeCategory.MISC, StatueRegistry.INFO_STATUE.get()) .pattern(" R ").pattern("BCB").pattern("CCC") .define('C', Tags.Items.COBBLESTONES) .define('B', Items.BOOK) .define('R', Tags.Items.DYES_RED) - .unlockedBy("has_book", has(Items.BOOK)).save(consumer); + .unlockedBy("has_book", has(Items.BOOK)).save(this.output); SingleItemRecipeBuilder.stonecutting(Ingredient.of(Items.QUARTZ_BLOCK), RecipeCategory.DECORATIONS, StatueRegistry.DISPLAY_STAND.get(), 2) .unlockedBy("has_quartz_block", has(Items.QUARTZ_BLOCK)) - .save(consumer, ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "display_stand_from_quartz_block_stonecutting")); + .save(this.output, Reference.modLoc("display_stand_from_quartz_block_stonecutting").toString()); - ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, StatueRegistry.STATUE_CORE) + shapeless(RecipeCategory.MISC, StatueRegistry.STATUE_CORE) .requires(StatueRegistry.CORE_FLOWER_ITEM) .unlockedBy("has_core_flower", has(StatueRegistry.CORE_FLOWER_ITEM)) - .save(consumer); + .save(this.output); } + private HolderSet tagSet(TagKey tagKey) { + return this.registries.lookupOrThrow(Registries.ITEM).getOrThrow(tagKey); + } private ItemStack getIOU() { ItemStack paperStack = new ItemStack(Items.PAPER); @@ -306,8 +329,19 @@ private ItemStack getWastelandBlock(HolderLookup.Provider provider) { return wasteland; } - @Override - protected CompletableFuture buildAdvancement(CachedOutput p_253674_, HolderLookup.Provider p_323646_, AdvancementHolder p_301116_) { - return null; + public static class Runner extends RecipeProvider.Runner { + public Runner(PackOutput output, CompletableFuture completableFuture) { + super(output, completableFuture); + } + + @Override + protected RecipeProvider createRecipeProvider(HolderLookup.Provider provider, RecipeOutput recipeOutput) { + return new StatueRecipeProvider(provider, recipeOutput); + } + + @Override + public String getName() { + return "Statues Recipes"; + } } } diff --git a/src/main/java/com/shynieke/statues/datagen/server/patchouli/StatuePatchouliProvider.java b/src/main/java/com/shynieke/statues/datagen/server/patchouli/StatuePatchouliProvider.java index 71e1781e..01f0efca 100644 --- a/src/main/java/com/shynieke/statues/datagen/server/patchouli/StatuePatchouliProvider.java +++ b/src/main/java/com/shynieke/statues/datagen/server/patchouli/StatuePatchouliProvider.java @@ -1,67 +1,67 @@ -package com.shynieke.statues.datagen.server.patchouli; - -import com.shynieke.statues.Reference; -import com.shynieke.statues.registry.StatueRegistry; -import net.minecraft.core.HolderLookup; -import net.minecraft.data.PackOutput; -import net.minecraft.world.item.ItemStack; -import xyz.brassgoggledcoders.patchouliprovider.BookBuilder; -import xyz.brassgoggledcoders.patchouliprovider.PatchouliBookProvider; - -import java.util.concurrent.CompletableFuture; -import java.util.function.Consumer; - -public class StatuePatchouliProvider extends PatchouliBookProvider { - public StatuePatchouliProvider(PackOutput output, CompletableFuture registries) { - super(output, Reference.MOD_ID, "en_us", registries); - } - - @Override - protected void addBooks(Consumer consumer, HolderLookup.Provider provider) { - BookBuilder bookBuilder = createBookBuilder("statues", - "info.statues.book.name", "info.statues.book.landing", provider) - .setSubtitle("info.statues.book.subtitle") - .setCreativeTab("statues.items") - .setModel("patchouli:book_gray") - .setBookTexture("patchouli:textures/gui/book_gray.png") - .setShowProgress(false) - .setUseBlockyFont(true) - .setI18n(true) - .addMacro("$(item)", "$(#c47567)") - .setUseResourcePack(true); //Datapack support is being deprecated in 1.19.4 to be removed - - //Info category - bookBuilder = bookBuilder.addCategory("info", "info.statues.book.info.name", - "info.statues.book.info.desc", "statues:info_statue") - - //Add Statue Core entry - .addEntry("info/core", "info.statues.book.core.entry.name", StatueRegistry.STATUE_CORE.getId().toString()) - .addTextPage("info.statues.book.core.text1").build() - .addEntityPage("statues:statue_bat").build() - .addSpotlightPage(new ItemStack(StatueRegistry.STATUE_CORE.get())).build() - .build() - - //Add S.T.A.T.U.E. entry - .addEntry("info/statue_table", "info.statues.book.statue_table.entry.name", StatueRegistry.STATUE_TABLE.getId().toString()) - .addTextPage("info.statues.book.statue_table.text1").build() - .addSpotlightPage(new ItemStack(StatueRegistry.STATUE_TABLE.get())).build() - .build() - - //Add Upgrading entry - .addEntry("info/upgrading", "info.statues.book.upgrading.entry.name", StatueRegistry.SLIME_STATUE.getId().toString()) - .addTextPage("info.statues.book.upgrading.text1").build() - .addTextPage("info.statues.book.upgrading.text2").build() - .addTextPage("info.statues.book.upgrading.text3").build() - .addTextPage("info.statues.book.upgrading.text4").build() - .addTextPage("info.statues.book.upgrading.text5").build() - .addTextPage("info.statues.book.upgrading.text6").build() - .addTextPage("info.statues.book.upgrading.text7").build() - .build() - - .build(); //Back to the bookbuilder - - - //Finish book - bookBuilder.build(consumer); - } -} +//package com.shynieke.statues.datagen.server.patchouli; +// +//import com.shynieke.statues.Reference; +//import com.shynieke.statues.registry.StatueRegistry; +//import net.minecraft.core.HolderLookup; +//import net.minecraft.data.PackOutput; +//import net.minecraft.world.item.ItemStack; +//import xyz.brassgoggledcoders.patchouliprovider.BookBuilder; +//import xyz.brassgoggledcoders.patchouliprovider.PatchouliBookProvider; +// +//import java.util.concurrent.CompletableFuture; +//import java.util.function.Consumer; +// +//public class StatuePatchouliProvider extends PatchouliBookProvider { +// public StatuePatchouliProvider(PackOutput output, CompletableFuture registries) { +// super(output, Reference.MOD_ID, "en_us", registries); +// } +// +// @Override +// protected void addBooks(Consumer consumer, HolderLookup.Provider provider) { +// BookBuilder bookBuilder = createBookBuilder("statues", +// "info.statues.book.name", "info.statues.book.landing", provider) +// .setSubtitle("info.statues.book.subtitle") +// .setCreativeTab("statues.items") +// .setModel("patchouli:book_gray") +// .setBookTexture("patchouli:textures/gui/book_gray.png") +// .setShowProgress(false) +// .setUseBlockyFont(true) +// .setI18n(true) +// .addMacro("$(item)", "$(#c47567)") +// .setUseResourcePack(true); //Datapack support is being deprecated in 1.19.4 to be removed +// +// //Info category +// bookBuilder = bookBuilder.addCategory("info", "info.statues.book.info.name", +// "info.statues.book.info.desc", "statues:info_statue") +// +// //Add Statue Core entry +// .addEntry("info/core", "info.statues.book.core.entry.name", StatueRegistry.STATUE_CORE.getId().toString()) +// .addTextPage("info.statues.book.core.text1").build() +// .addEntityPage("statues:statue_bat").build() +// .addSpotlightPage(new ItemStack(StatueRegistry.STATUE_CORE.get())).build() +// .build() +// +// //Add S.T.A.T.U.E. entry +// .addEntry("info/statue_table", "info.statues.book.statue_table.entry.name", StatueRegistry.STATUE_TABLE.getId().toString()) +// .addTextPage("info.statues.book.statue_table.text1").build() +// .addSpotlightPage(new ItemStack(StatueRegistry.STATUE_TABLE.get())).build() +// .build() +// +// //Add Upgrading entry +// .addEntry("info/upgrading", "info.statues.book.upgrading.entry.name", StatueRegistry.SLIME_STATUE.getId().toString()) +// .addTextPage("info.statues.book.upgrading.text1").build() +// .addTextPage("info.statues.book.upgrading.text2").build() +// .addTextPage("info.statues.book.upgrading.text3").build() +// .addTextPage("info.statues.book.upgrading.text4").build() +// .addTextPage("info.statues.book.upgrading.text5").build() +// .addTextPage("info.statues.book.upgrading.text6").build() +// .addTextPage("info.statues.book.upgrading.text7").build() +// .build() +// +// .build(); //Back to the bookbuilder +// +// +// //Finish book +// bookBuilder.build(consumer); +// } +//} diff --git a/src/main/java/com/shynieke/statues/datagen/server/recipe/HardcoreRecipeBuilder.java b/src/main/java/com/shynieke/statues/datagen/server/recipe/HardcoreRecipeBuilder.java new file mode 100644 index 00000000..ccb95be1 --- /dev/null +++ b/src/main/java/com/shynieke/statues/datagen/server/recipe/HardcoreRecipeBuilder.java @@ -0,0 +1,150 @@ +package com.shynieke.statues.datagen.server.recipe; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.shynieke.statues.recipe.HardcoreRecipe; +import net.minecraft.advancements.Advancement; +import net.minecraft.advancements.AdvancementRequirements; +import net.minecraft.advancements.AdvancementRewards; +import net.minecraft.advancements.Criterion; +import net.minecraft.advancements.critereon.RecipeUnlockedTrigger; +import net.minecraft.core.HolderGetter; +import net.minecraft.data.recipes.RecipeBuilder; +import net.minecraft.data.recipes.RecipeCategory; +import net.minecraft.data.recipes.RecipeOutput; +import net.minecraft.resources.ResourceKey; +import net.minecraft.tags.TagKey; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.Ingredient; +import net.minecraft.world.item.crafting.Recipe; +import net.minecraft.world.item.crafting.ShapedRecipePattern; +import net.minecraft.world.level.ItemLike; +import org.jetbrains.annotations.Nullable; + +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +public class HardcoreRecipeBuilder implements RecipeBuilder { + private final HolderGetter items; + private final RecipeCategory category; + private final Item result; + private final ItemStack resultStack; // Neo: add stack result support + private final List rows = Lists.newArrayList(); + private final Map key = Maps.newLinkedHashMap(); + private final Map> criteria = new LinkedHashMap<>(); + @Nullable + private String group; + private boolean showNotification = true; + + private HardcoreRecipeBuilder(HolderGetter p_365072_, RecipeCategory p_249996_, ItemLike p_251475_, int p_248948_) { + this(p_365072_, p_249996_, new ItemStack(p_251475_, p_248948_)); + } + + private HardcoreRecipeBuilder(HolderGetter p_365072_, RecipeCategory p_249996_, ItemStack result) { + this.items = p_365072_; + this.category = p_249996_; + this.result = result.getItem(); + this.resultStack = result; + } + + public static HardcoreRecipeBuilder hardcore(HolderGetter p_364036_, RecipeCategory p_250853_, ItemLike p_249747_) { + return hardcore(p_364036_, p_250853_, p_249747_, 1); + } + + public static HardcoreRecipeBuilder hardcore(HolderGetter p_365019_, RecipeCategory p_251325_, ItemLike p_250636_, int p_249081_) { + return new HardcoreRecipeBuilder(p_365019_, p_251325_, p_250636_, p_249081_); + } + + public static HardcoreRecipeBuilder hardcore(HolderGetter p_365019_, RecipeCategory p_251325_, ItemStack result) { + return new HardcoreRecipeBuilder(p_365019_, p_251325_, result); + } + + /** + * Adds a key to the recipe pattern. + */ + public HardcoreRecipeBuilder define(Character symbol, TagKey tag) { + return this.define(symbol, Ingredient.of(this.items.getOrThrow(tag))); + } + + /** + * Adds a key to the recipe pattern. + */ + public HardcoreRecipeBuilder define(Character symbol, ItemLike item) { + return this.define(symbol, Ingredient.of(item)); + } + + /** + * Adds a key to the recipe pattern. + */ + public HardcoreRecipeBuilder define(Character symbol, Ingredient ingredient) { + if (this.key.containsKey(symbol)) { + throw new IllegalArgumentException("Symbol '" + symbol + "' is already defined!"); + } else if (symbol == ' ') { + throw new IllegalArgumentException("Symbol ' ' (whitespace) is reserved and cannot be defined"); + } else { + this.key.put(symbol, ingredient); + return this; + } + } + + /** + * Adds a new entry to the patterns for this recipe. + */ + public HardcoreRecipeBuilder pattern(String pattern) { + if (!this.rows.isEmpty() && pattern.length() != this.rows.get(0).length()) { + throw new IllegalArgumentException("Pattern must be the same width on every line!"); + } else { + this.rows.add(pattern); + return this; + } + } + + public HardcoreRecipeBuilder unlockedBy(String name, Criterion criterion) { + this.criteria.put(name, criterion); + return this; + } + + public HardcoreRecipeBuilder group(@Nullable String groupName) { + this.group = groupName; + return this; + } + + public HardcoreRecipeBuilder showNotification(boolean showNotification) { + this.showNotification = showNotification; + return this; + } + + @Override + public Item getResult() { + return this.result; + } + + @Override + public void save(RecipeOutput recipeOutput, ResourceKey> resourceKey) { + ShapedRecipePattern shapedrecipepattern = this.ensureValid(resourceKey); + Advancement.Builder advancement$builder = recipeOutput.advancement() + .addCriterion("has_the_recipe", RecipeUnlockedTrigger.unlocked(resourceKey)) + .rewards(AdvancementRewards.Builder.recipe(resourceKey)) + .requirements(AdvancementRequirements.Strategy.OR); + this.criteria.forEach(advancement$builder::addCriterion); + HardcoreRecipe hardcoreRecipe = new HardcoreRecipe( + Objects.requireNonNullElse(this.group, ""), + RecipeBuilder.determineBookCategory(this.category), + shapedrecipepattern, + this.resultStack, + this.showNotification + ); + recipeOutput.accept(resourceKey, hardcoreRecipe, advancement$builder.build(resourceKey.location().withPrefix("recipes/" + this.category.getFolderName() + "/"))); + } + + private ShapedRecipePattern ensureValid(ResourceKey> p_380175_) { + if (this.criteria.isEmpty()) { + throw new IllegalStateException("No way of obtaining recipe " + p_380175_.location()); + } else { + return ShapedRecipePattern.of(this.key, this.rows); + } + } +} diff --git a/src/main/java/com/shynieke/statues/datagen/server/recipe/LootRecipeBuilder.java b/src/main/java/com/shynieke/statues/datagen/server/recipe/LootRecipeBuilder.java index e4170caa..af2ca097 100644 --- a/src/main/java/com/shynieke/statues/datagen/server/recipe/LootRecipeBuilder.java +++ b/src/main/java/com/shynieke/statues/datagen/server/recipe/LootRecipeBuilder.java @@ -3,13 +3,16 @@ import com.shynieke.statues.recipe.LootRecipe; import net.minecraft.advancements.Criterion; import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.core.registries.Registries; import net.minecraft.data.recipes.RecipeBuilder; import net.minecraft.data.recipes.RecipeOutput; +import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.Ingredient; +import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.level.ItemLike; import org.jetbrains.annotations.Nullable; @@ -120,16 +123,25 @@ public Item getResult() { return Items.AIR; } + @Override public void save(RecipeOutput recipeOutput) { - ResourceLocation itemKey = BuiltInRegistries.ITEM.getKey(this.statueIngredient.getItems()[0].getItem()); + ResourceLocation itemKey = this.statueIngredient.getValues().get(0).getKey().location(); ResourceLocation recipeID = ResourceLocation.fromNamespaceAndPath(itemKey.getNamespace(), "loot/" + itemKey.getPath()); - save(recipeOutput, recipeID); + save(recipeOutput, ResourceKey.create(Registries.RECIPE, recipeID)); + } + + static ResourceLocation getDefaultRecipeId(ItemLike itemLike) { + return BuiltInRegistries.ITEM.getKey(itemLike.asItem()); + } + + public void save(RecipeOutput recipeOutput, ResourceLocation recipeID) { + save(recipeOutput, ResourceKey.create(Registries.RECIPE, recipeID)); } @Override - public void save(RecipeOutput recipeOutput, ResourceLocation id) { + public void save(RecipeOutput recipeOutput, ResourceKey> resourceKey) { LootRecipe lootRecipe = new LootRecipe( Objects.requireNonNullElse(this.group, ""), this.statueIngredient, @@ -141,6 +153,6 @@ public void save(RecipeOutput recipeOutput, ResourceLocation id) { this.result3Chance, this.showNotification); - recipeOutput.accept(id, lootRecipe, null); + recipeOutput.accept(resourceKey, lootRecipe, null); } } diff --git a/src/main/java/com/shynieke/statues/datagen/server/recipe/UpgradeRecipeBuilder.java b/src/main/java/com/shynieke/statues/datagen/server/recipe/UpgradeRecipeBuilder.java index e19f5548..4d54725a 100644 --- a/src/main/java/com/shynieke/statues/datagen/server/recipe/UpgradeRecipeBuilder.java +++ b/src/main/java/com/shynieke/statues/datagen/server/recipe/UpgradeRecipeBuilder.java @@ -4,21 +4,25 @@ import com.shynieke.statues.recipe.UpgradeType; import net.minecraft.advancements.Criterion; import net.minecraft.core.NonNullList; +import net.minecraft.core.registries.Registries; import net.minecraft.data.recipes.RecipeBuilder; import net.minecraft.data.recipes.RecipeOutput; +import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; +import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.level.ItemLike; import org.jetbrains.annotations.Nullable; +import java.util.ArrayList; import java.util.List; import java.util.Objects; public class UpgradeRecipeBuilder implements RecipeBuilder { private final Ingredient center; - private final NonNullList catalysts = NonNullList.create(); + private final List catalysts = new ArrayList<>(); private ItemStack result = ItemStack.EMPTY; private boolean requireCore = false; private UpgradeType upgradeType = UpgradeType.CRAFTING; @@ -81,12 +85,16 @@ public Item getResult() { return result.getItem(); } + public void save(RecipeOutput recipeOutput, ResourceLocation recipeID) { + save(recipeOutput, ResourceKey.create(Registries.RECIPE, recipeID)); + } + @Override - public void save(RecipeOutput recipeOutput, ResourceLocation id) { + public void save(RecipeOutput recipeOutput, ResourceKey> resourceKey) { UpgradeRecipe upgradeRecipe = new UpgradeRecipe( Objects.requireNonNullElse(this.group, ""), center, catalysts, result, requireCore, upgradeType, tier, showNotification); - recipeOutput.accept(id, upgradeRecipe, null); + recipeOutput.accept(resourceKey, upgradeRecipe, null); } } diff --git a/src/main/java/com/shynieke/statues/entity/PlayerStatue.java b/src/main/java/com/shynieke/statues/entity/PlayerStatue.java index 3ad40b85..f32c4ada 100644 --- a/src/main/java/com/shynieke/statues/entity/PlayerStatue.java +++ b/src/main/java/com/shynieke/statues/entity/PlayerStatue.java @@ -49,8 +49,6 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; import net.minecraft.world.phys.Vec3; -import net.neoforged.api.distmarker.Dist; -import net.neoforged.api.distmarker.OnlyIn; import org.jetbrains.annotations.Nullable; import java.util.Locale; @@ -230,6 +228,11 @@ public ItemStack getItemBySlot(EquipmentSlot slotIn) { } } + @Override + public boolean canUseSlot(EquipmentSlot slot) { + return slot != EquipmentSlot.BODY && !this.isDisabled(slot); + } + @Override public void setItemSlot(EquipmentSlot slotIn, ItemStack stack) { this.verifyEquippedItem(stack); @@ -237,13 +240,6 @@ public void setItemSlot(EquipmentSlot slotIn, ItemStack stack) { case HAND -> this.onEquipItem(slotIn, this.handItems.set(slotIn.getIndex(), stack), stack); case HUMANOID_ARMOR -> this.onEquipItem(slotIn, this.armorItems.set(slotIn.getIndex(), stack), stack); } - - } - - @Override - public boolean canTakeItem(ItemStack itemstackIn) { - EquipmentSlot equipmentSlot = getEquipmentSlotForItem(itemstackIn); - return this.getItemBySlot(equipmentSlot).isEmpty() && !this.isDisabled(equipmentSlot); } @Override @@ -489,14 +485,14 @@ private EquipmentSlot getClickedSlot(Vec3 clicked) { } private boolean isDisabled(EquipmentSlot slotIn) { - return (this.disabledSlots & 1 << slotIn.getFilterFlag()) != 0; + return (this.disabledSlots & 1 << slotIn.getFilterBit(0)) != 0; } private boolean swapItem(Player player, EquipmentSlot slot, ItemStack stack, InteractionHand hand) { ItemStack itemstack = this.getItemBySlot(slot); - if (!itemstack.isEmpty() && (this.disabledSlots & 1 << slot.getFilterFlag() + 8) != 0) { + if (!itemstack.isEmpty() && (this.disabledSlots & 1 << slot.getFilterBit(8)) != 0) { return false; - } else if (itemstack.isEmpty() && (this.disabledSlots & 1 << slot.getFilterFlag() + 16) != 0) { + } else if (itemstack.isEmpty() && (this.disabledSlots & 1 << slot.getFilterBit(16)) != 0) { return false; } else if (player.hasInfiniteMaterials() && itemstack.isEmpty() && !stack.isEmpty()) { ItemStack itemstack2 = stack.copy(); @@ -526,25 +522,25 @@ public boolean isInvulnerable() { } @Override - public boolean isInvulnerableTo(DamageSource source) { + public boolean isInvulnerableTo(ServerLevel serverLevel, DamageSource source) { if (isLocked()) { return true; } - return super.isInvulnerableTo(source); + return super.isInvulnerableTo(serverLevel, source); } /** * Called when the entity is attacked. */ - public boolean hurt(DamageSource source, float amount) { + public boolean hurtServer(ServerLevel serverLevel, DamageSource source, float amount) { if (this.isRemoved()) { return false; } else if (this.level() instanceof ServerLevel serverlevel) { if (source.is(DamageTypeTags.BYPASSES_INVULNERABILITY)) { this.remove(RemovalReason.DISCARDED); return false; - } else if (!this.isInvulnerableTo(source)) { + } else if (!this.isInvulnerableTo(serverLevel, source)) { if (source.is(DamageTypeTags.IS_EXPLOSION)) { this.brokenByAnything(serverlevel, source); this.remove(RemovalReason.KILLED); @@ -595,7 +591,6 @@ public boolean hurt(DamageSource source, float amount) { } } - @OnlyIn(Dist.CLIENT) public void handleEntityEvent(byte id) { if (id == 32) { if (this.level().isClientSide) { @@ -611,7 +606,6 @@ public void handleEntityEvent(byte id) { /** * Checks if the entity is in range to render. */ - @OnlyIn(Dist.CLIENT) public boolean shouldRenderAtSqrDistance(double distance) { double d0 = this.getBoundingBox().getSize() * 4.0D; if (Double.isNaN(d0) || d0 == 0.0D) { @@ -866,22 +860,22 @@ public Rotations getBodyRotation() { return this.bodyRotation; } - @OnlyIn(Dist.CLIENT) + public Rotations getLeftArmRotation() { return this.leftArmRotation; } - @OnlyIn(Dist.CLIENT) + public Rotations getRightArmRotation() { return this.rightArmRotation; } - @OnlyIn(Dist.CLIENT) + public Rotations getLeftLegRotation() { return this.leftLegRotation; } - @OnlyIn(Dist.CLIENT) + public Rotations getRightLegRotation() { return this.rightLegRotation; } diff --git a/src/main/java/com/shynieke/statues/entity/StatueBatEntity.java b/src/main/java/com/shynieke/statues/entity/StatueBatEntity.java index 3ea1e1e0..31e0dc85 100644 --- a/src/main/java/com/shynieke/statues/entity/StatueBatEntity.java +++ b/src/main/java/com/shynieke/statues/entity/StatueBatEntity.java @@ -2,15 +2,17 @@ import com.shynieke.statues.config.StatuesConfig; import net.minecraft.core.BlockPos; +import net.minecraft.server.level.ServerLevel; import net.minecraft.tags.DamageTypeTags; import net.minecraft.util.RandomSource; import net.minecraft.world.DifficultyInstance; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.effect.MobEffects; +import net.minecraft.world.entity.EntitySpawnReason; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.entity.MobSpawnType; +import net.minecraft.world.entity.EntitySpawnReason; import net.minecraft.world.entity.SpawnGroupData; import net.minecraft.world.entity.ai.attributes.AttributeSupplier; import net.minecraft.world.entity.ai.attributes.Attributes; @@ -33,7 +35,7 @@ public static AttributeSupplier.Builder createAttributes() { @Nullable @Override - public SpawnGroupData finalizeSpawn(ServerLevelAccessor level, DifficultyInstance difficultyIn, MobSpawnType reason, @Nullable SpawnGroupData spawnDataIn) { + public SpawnGroupData finalizeSpawn(ServerLevelAccessor level, DifficultyInstance difficultyIn, EntitySpawnReason reason, @Nullable SpawnGroupData spawnDataIn) { SpawnGroupData data = super.finalizeSpawn(level, difficultyIn, reason, spawnDataIn); int random = getRandom().nextInt(10); if (random < 5) { @@ -43,16 +45,16 @@ public SpawnGroupData finalizeSpawn(ServerLevelAccessor level, DifficultyInstanc } @Override - public boolean hurt(DamageSource source, float amount) { + public boolean hurtServer(ServerLevel serverLevel, DamageSource source, float amount) { if (!source.is(DamageTypeTags.AVOIDS_GUARDIAN_THORNS) && source.getDirectEntity() instanceof LivingEntity livingEntity) { - livingEntity.hurt(this.damageSources().thorns(this), 2.0F); + livingEntity.hurtServer(serverLevel, this.damageSources().thorns(this), 2.0F); } - return super.hurt(source, amount); + return super.hurtServer(serverLevel, source, amount); } - public static boolean canSpawnHere(EntityType batIn, LevelAccessor levelAccessor, MobSpawnType reason, BlockPos pos, RandomSource randomIn) { + public static boolean canSpawnHere(EntityType batIn, LevelAccessor levelAccessor, EntitySpawnReason reason, BlockPos pos, RandomSource randomIn) { if (!StatuesConfig.COMMON.statueBatSpawning.get()) { return false; } @@ -61,7 +63,7 @@ public static boolean canSpawnHere(EntityType batIn, LevelAcces } else { int i = levelAccessor.getMaxLocalRawBrightness(pos); int j = 4; - if (isNearHalloween()) { + if (isHalloween()) { j = 7; } else if (randomIn.nextBoolean()) { return false; @@ -71,7 +73,7 @@ public static boolean canSpawnHere(EntityType batIn, LevelAcces } } - private static boolean isNearHalloween() { + private static boolean isHalloween() { LocalDate localdate = LocalDate.now(); int i = localdate.getDayOfMonth(); int j = localdate.getMonthValue(); diff --git a/src/main/java/com/shynieke/statues/handlers/DropHandler.java b/src/main/java/com/shynieke/statues/handlers/DropHandler.java index b9ad8570..272d99da 100644 --- a/src/main/java/com/shynieke/statues/handlers/DropHandler.java +++ b/src/main/java/com/shynieke/statues/handlers/DropHandler.java @@ -17,9 +17,9 @@ import net.minecraft.world.entity.animal.Cat; import net.minecraft.world.entity.animal.CatVariant; import net.minecraft.world.entity.animal.Fox; -import net.minecraft.world.entity.animal.Fox.Type; import net.minecraft.world.entity.animal.FrogVariant; import net.minecraft.world.entity.animal.MushroomCow; +import net.minecraft.world.entity.animal.MushroomCow.Variant; import net.minecraft.world.entity.animal.Panda; import net.minecraft.world.entity.animal.Rabbit; import net.minecraft.world.entity.animal.Sheep; @@ -163,13 +163,13 @@ public void onLivingDrop(LivingDropsEvent event) { } } else if (entity instanceof MushroomCow mooshroom) { ItemStack itemStackToDrop = new ItemStack(StatueRegistry.MOOSHROOM_STATUE.get()); - if (mooshroom.getVariant() == MushroomCow.MushroomType.BROWN) { + if (mooshroom.getVariant() == Variant.BROWN) { itemStackToDrop = new ItemStack(StatueRegistry.BROWN_MOOSHROOM_STATUE.get()); } dropLootStatues(entity, itemStackToDrop, source, event); } else if (entity instanceof Fox fox) { ItemStack itemStackToDrop = new ItemStack(StatueRegistry.FOX_STATUE.get()); - if (fox.getVariant() == Type.SNOW) { + if (fox.getVariant() == Fox.Variant.SNOW) { itemStackToDrop = new ItemStack(StatueRegistry.FOX_SNOW_STATUE.get()); } dropLootStatues(entity, itemStackToDrop, source, event); diff --git a/src/main/java/com/shynieke/statues/handlers/StatueHandler.java b/src/main/java/com/shynieke/statues/handlers/StatueHandler.java index 40364f41..03192fb5 100644 --- a/src/main/java/com/shynieke/statues/handlers/StatueHandler.java +++ b/src/main/java/com/shynieke/statues/handlers/StatueHandler.java @@ -9,9 +9,9 @@ import net.minecraft.core.BlockPos; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EntitySpawnReason; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.Mob; -import net.minecraft.world.entity.MobSpawnType; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; @@ -63,8 +63,8 @@ public int getLevel(int killedMobs) { @SubscribeEvent public void onLivingSpawnEvent(FinalizeSpawnEvent event) { - MobSpawnType spawnReason = event.getSpawnType(); - if (spawnReason == MobSpawnType.NATURAL || spawnReason == MobSpawnType.REINFORCEMENT || spawnReason == MobSpawnType.EVENT) { + EntitySpawnReason spawnReason = event.getSpawnType(); + if (spawnReason == EntitySpawnReason.NATURAL || spawnReason == EntitySpawnReason.REINFORCEMENT || spawnReason == EntitySpawnReason.EVENT) { Mob mob = event.getEntity(); BlockPos nearestDespawner = StatueSavedData.get().getNearestDespawner(mob.level().dimension(), mob.blockPosition(), 32); if (nearestDespawner != null) { diff --git a/src/main/java/com/shynieke/statues/items/PlayerStatueBlockItem.java b/src/main/java/com/shynieke/statues/items/PlayerStatueBlockItem.java index 5afb342e..ed108911 100644 --- a/src/main/java/com/shynieke/statues/items/PlayerStatueBlockItem.java +++ b/src/main/java/com/shynieke/statues/items/PlayerStatueBlockItem.java @@ -1,18 +1,11 @@ package com.shynieke.statues.items; import com.shynieke.statues.blockentities.PlayerBlockEntity; -import com.shynieke.statues.client.render.PlayerBEWLR; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.BlockEntityWithoutLevelRenderer; -import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; import net.minecraft.core.component.DataComponents; import net.minecraft.network.chat.Component; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.component.ResolvableProfile; import net.minecraft.world.level.block.Block; -import net.neoforged.neoforge.client.extensions.common.IClientItemExtensions; - -import java.util.function.Consumer; public class PlayerStatueBlockItem extends StatueBlockItem { @@ -36,22 +29,4 @@ public void verifyComponentsAfterLoad(ItemStack stack) { .thenAcceptAsync(profile -> stack.set(DataComponents.PROFILE, profile), PlayerBlockEntity.CHECKED_MAIN_THREAD_EXECUTOR); } } - - @SuppressWarnings("removal") - @Override - public void initializeClient(Consumer consumer) { - consumer.accept(new IClientItemExtensions() { - @Override - public BlockEntityWithoutLevelRenderer getCustomRenderer() { - return new PlayerBEWLR(new BlockEntityRendererProvider.Context( - Minecraft.getInstance().getBlockEntityRenderDispatcher(), - Minecraft.getInstance().getBlockRenderer(), - Minecraft.getInstance().getItemRenderer(), - Minecraft.getInstance().getEntityRenderDispatcher(), - Minecraft.getInstance().getEntityModels(), - Minecraft.getInstance().font - )); - } - }); - } } diff --git a/src/main/java/com/shynieke/statues/items/PlayerStatueSpawnItem.java b/src/main/java/com/shynieke/statues/items/PlayerStatueSpawnItem.java index 031c8d2a..e4a67a61 100644 --- a/src/main/java/com/shynieke/statues/items/PlayerStatueSpawnItem.java +++ b/src/main/java/com/shynieke/statues/items/PlayerStatueSpawnItem.java @@ -12,7 +12,7 @@ import net.minecraft.util.RandomSource; import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.EntityType; -import net.minecraft.world.entity.MobSpawnType; +import net.minecraft.world.entity.EntitySpawnReason; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.component.ResolvableProfile; @@ -48,7 +48,7 @@ public InteractionResult useOn(UseOnContext context) { } EntityType type = StatueRegistry.PLAYER_STATUE_ENTITY.get(); - if (type.spawn((ServerLevel) level, stack, context.getPlayer(), relativePos, MobSpawnType.SPAWN_EGG, true, !Objects.equals(pos, relativePos) && direction == Direction.UP) instanceof PlayerStatue playerStatue) { + if (type.spawn((ServerLevel) level, stack, context.getPlayer(), relativePos, EntitySpawnReason.SPAWN_ITEM_USE, true, !Objects.equals(pos, relativePos) && direction == Direction.UP) instanceof PlayerStatue playerStatue) { applyRandomRotations(playerStatue, level.random); if (!stack.has(DataComponents.CUSTOM_NAME)) { if (context.getPlayer() != null) { diff --git a/src/main/java/com/shynieke/statues/items/StatueBlockItem.java b/src/main/java/com/shynieke/statues/items/StatueBlockItem.java index c10b4965..0a19bdcf 100644 --- a/src/main/java/com/shynieke/statues/items/StatueBlockItem.java +++ b/src/main/java/com/shynieke/statues/items/StatueBlockItem.java @@ -55,10 +55,9 @@ protected BlockState getPlacementState(BlockPlaceContext context) { BlockState state = super.getPlacementState(context); ItemStack stack = context.getItemInHand(); if (state != null && state.getBlock() instanceof AbstractStatueBase) { - if (stack.has(StatueDataComponents.UPGRADED)) { - if (stack.get(StatueDataComponents.UPGRADED)) { - state = state.setValue(AbstractStatueBase.INTERACTIVE, true); - } + boolean upgraded = stack.getOrDefault(StatueDataComponents.UPGRADED, false); + if (upgraded) { + state = state.setValue(AbstractStatueBase.INTERACTIVE, true); } } return state; diff --git a/src/main/java/com/shynieke/statues/items/StatueCharredMarshmallow.java b/src/main/java/com/shynieke/statues/items/StatueCharredMarshmallow.java index 8df353b4..d3a65eba 100644 --- a/src/main/java/com/shynieke/statues/items/StatueCharredMarshmallow.java +++ b/src/main/java/com/shynieke/statues/items/StatueCharredMarshmallow.java @@ -3,6 +3,7 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.RecipeType; +import net.minecraft.world.level.block.entity.FuelValues; import org.jetbrains.annotations.Nullable; public class StatueCharredMarshmallow extends Item { @@ -11,7 +12,7 @@ public StatueCharredMarshmallow(Properties builder) { } @Override - public int getBurnTime(ItemStack itemStack, @Nullable RecipeType recipeType) { + public int getBurnTime(ItemStack itemStack, @Nullable RecipeType recipeType, FuelValues fuelValues) { return 500; } } diff --git a/src/main/java/com/shynieke/statues/items/StatueGoldenMarshmallow.java b/src/main/java/com/shynieke/statues/items/StatueGoldenMarshmallow.java index edd1b03d..728036e1 100644 --- a/src/main/java/com/shynieke/statues/items/StatueGoldenMarshmallow.java +++ b/src/main/java/com/shynieke/statues/items/StatueGoldenMarshmallow.java @@ -11,6 +11,7 @@ import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.component.Consumable; import net.minecraft.world.level.Level; import java.util.List; @@ -26,7 +27,7 @@ public ItemStack finishUsingItem(ItemStack stack, Level level, LivingEntity enti if (stack.has(DataComponents.FOOD)) { if (!level.isClientSide) { if (this == StatueRegistry.MARSHMALLOW_GOLDEN.get()) { - List> effectList = BuiltInRegistries.MOB_EFFECT.holders().collect(Collectors.toList()); + List> effectList = BuiltInRegistries.MOB_EFFECT.listElements().collect(Collectors.toList()); effectList.remove(MobEffects.CONFUSION); int i = level.random.nextInt(effectList.size()); @@ -36,7 +37,12 @@ public ItemStack finishUsingItem(ItemStack stack, Level level, LivingEntity enti entityIn.addEffect(randomEffect); } } - return entityIn.eat(level, stack); + Consumable consumable = stack.get(DataComponents.CONSUMABLE); + if (consumable != null) { + consumable.onConsume(level, entityIn, stack); + } + + return stack; } return stack; diff --git a/src/main/java/com/shynieke/statues/items/StatueMooshroomSoup.java b/src/main/java/com/shynieke/statues/items/StatueMooshroomSoup.java index 7bc3be94..e84a744d 100644 --- a/src/main/java/com/shynieke/statues/items/StatueMooshroomSoup.java +++ b/src/main/java/com/shynieke/statues/items/StatueMooshroomSoup.java @@ -2,6 +2,8 @@ import com.shynieke.statues.registry.StatueFoods; import net.minecraft.advancements.CriteriaTriggers; +import net.minecraft.core.component.DataComponents; +import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Inventory; @@ -9,6 +11,7 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; +import net.minecraft.world.item.component.Consumable; import net.minecraft.world.level.Level; public class StatueMooshroomSoup extends Item { @@ -22,7 +25,10 @@ public ItemStack finishUsingItem(ItemStack stack, Level level, LivingEntity enti if (entityIn instanceof Player playerIn && !playerIn.hasInfiniteMaterials()) { ItemStack bowlStack = new ItemStack(Items.BOWL); Inventory playerInv = playerIn.getInventory(); - playerIn.eat(level, stack); + Consumable consumable = stack.get(DataComponents.CONSUMABLE); + if (consumable != null) { + consumable.onConsume(level, playerIn, stack); + } if (playerIn instanceof ServerPlayer) { CriteriaTriggers.CONSUME_ITEM.trigger((ServerPlayer) playerIn, stack); @@ -30,7 +36,7 @@ public ItemStack finishUsingItem(ItemStack stack, Level level, LivingEntity enti if (!level.isClientSide) { if (playerInv.getFreeSlot() == -1) { - playerIn.spawnAtLocation(bowlStack, 0F); + playerIn.spawnAtLocation((ServerLevel)level, bowlStack, 0F); } else { playerInv.add(bowlStack); } diff --git a/src/main/java/com/shynieke/statues/items/StatueTeaItem.java b/src/main/java/com/shynieke/statues/items/StatueTeaItem.java index c310223a..09800f80 100644 --- a/src/main/java/com/shynieke/statues/items/StatueTeaItem.java +++ b/src/main/java/com/shynieke/statues/items/StatueTeaItem.java @@ -2,6 +2,7 @@ import com.shynieke.statues.registry.StatueRegistry; import net.minecraft.advancements.CriteriaTriggers; +import net.minecraft.core.component.DataComponents; import net.minecraft.server.level.ServerPlayer; import net.minecraft.stats.Stats; import net.minecraft.world.entity.LivingEntity; @@ -9,6 +10,7 @@ import net.minecraft.world.food.FoodProperties; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.component.Consumable; import net.minecraft.world.level.Level; public class StatueTeaItem extends Item { @@ -18,13 +20,15 @@ public StatueTeaItem(Properties builder, FoodProperties food) { } @Override - public ItemStack finishUsingItem(ItemStack stack, Level level, LivingEntity entityIn) { - if (entityIn instanceof Player) { - Player playerIn = entityIn instanceof Player ? (Player) entityIn : null; - playerIn.eat(level, stack); + public ItemStack finishUsingItem(ItemStack stack, Level level, LivingEntity livingEntity) { + if (livingEntity instanceof Player playerIn) { + Consumable consumable = stack.get(DataComponents.CONSUMABLE); + if (consumable != null) { + consumable.onConsume(level, playerIn, stack); + } - if (playerIn instanceof ServerPlayer) { - CriteriaTriggers.CONSUME_ITEM.trigger((ServerPlayer) playerIn, stack); + if (playerIn instanceof ServerPlayer serverPlayer) { + CriteriaTriggers.CONSUME_ITEM.trigger(serverPlayer, stack); } playerIn.awardStat(Stats.ITEM_USED.get(this)); diff --git a/src/main/java/com/shynieke/statues/lootmodifiers/CityStatuesLootModifier.java b/src/main/java/com/shynieke/statues/lootmodifiers/CityStatuesLootModifier.java index 442e97fb..ca0bfc04 100644 --- a/src/main/java/com/shynieke/statues/lootmodifiers/CityStatuesLootModifier.java +++ b/src/main/java/com/shynieke/statues/lootmodifiers/CityStatuesLootModifier.java @@ -37,7 +37,7 @@ public CityStatuesLootModifier(LootItemCondition[] conditionsIn) { @Override protected ObjectArrayList doApply(ObjectArrayList generatedLoot, LootContext context) { if (StatuesConfig.COMMON.ancientCityLoot.get()) { - Optional> optionalTag = BuiltInRegistries.ITEM.getTag(StatueTags.STATUES_ITEMS); + Optional> optionalTag = BuiltInRegistries.ITEM.get(StatueTags.STATUES_ITEMS); if (optionalTag.isPresent()) { HolderSet.Named tag = optionalTag.get(); RandomSource random = context.getRandom(); diff --git a/src/main/java/com/shynieke/statues/network/message/PlayerStatueScreenData.java b/src/main/java/com/shynieke/statues/network/message/PlayerStatueScreenData.java index 061c14ab..8d1d2d6f 100644 --- a/src/main/java/com/shynieke/statues/network/message/PlayerStatueScreenData.java +++ b/src/main/java/com/shynieke/statues/network/message/PlayerStatueScreenData.java @@ -11,7 +11,7 @@ public record PlayerStatueScreenData(int entityID) implements CustomPacketPayloa public static final StreamCodec CODEC = CustomPacketPayload.codec( PlayerStatueScreenData::write, PlayerStatueScreenData::new); - public static final Type ID = new Type<>(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "statue_screen")); + public static final Type ID = new Type<>(Reference.modLoc("statue_screen")); public PlayerStatueScreenData(FriendlyByteBuf buf) { diff --git a/src/main/java/com/shynieke/statues/network/message/PlayerStatueSyncData.java b/src/main/java/com/shynieke/statues/network/message/PlayerStatueSyncData.java index 3a7b00e7..3920ed83 100644 --- a/src/main/java/com/shynieke/statues/network/message/PlayerStatueSyncData.java +++ b/src/main/java/com/shynieke/statues/network/message/PlayerStatueSyncData.java @@ -13,7 +13,7 @@ public record PlayerStatueSyncData(UUID playerUUID, CompoundTag tag) implements public static final StreamCodec CODEC = CustomPacketPayload.codec( PlayerStatueSyncData::write, PlayerStatueSyncData::new); - public static final Type ID = new Type<>(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "statue_sync")); + public static final Type ID = new Type<>(Reference.modLoc("statue_sync")); public PlayerStatueSyncData(final FriendlyByteBuf buf) { this(buf.readUUID(), buf.readNbt()); diff --git a/src/main/java/com/shynieke/statues/network/message/StatueTableData.java b/src/main/java/com/shynieke/statues/network/message/StatueTableData.java index 4e9ac16a..47a71d20 100644 --- a/src/main/java/com/shynieke/statues/network/message/StatueTableData.java +++ b/src/main/java/com/shynieke/statues/network/message/StatueTableData.java @@ -10,7 +10,7 @@ public record StatueTableData(boolean isButtonPressed) implements CustomPacketPa public static final StreamCodec CODEC = CustomPacketPayload.codec( StatueTableData::write, StatueTableData::new); - public static final Type ID = new Type<>(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "table_message")); + public static final Type ID = new Type<>(Reference.modLoc("table_message")); public StatueTableData(final FriendlyByteBuf packetBuffer) { this(packetBuffer.readBoolean()); diff --git a/src/main/java/com/shynieke/statues/recipe/HardcoreRecipe.java b/src/main/java/com/shynieke/statues/recipe/HardcoreRecipe.java index 86f3c817..b4ad1336 100644 --- a/src/main/java/com/shynieke/statues/recipe/HardcoreRecipe.java +++ b/src/main/java/com/shynieke/statues/recipe/HardcoreRecipe.java @@ -35,25 +35,25 @@ public HardcoreRecipe(String group, CraftingBookCategory category, ShapedRecipeP } @Override - public RecipeSerializer getSerializer() { + public RecipeSerializer getSerializer() { return StatuesRecipes.HARDCORE_SHAPED_SERIALIZER.get(); } @Override public boolean matches(CraftingInput craftingInput, Level level) { - return super.matches(craftingInput, level) && level != null && level.getLevelData().isHardcore(); + return super.matches(craftingInput, level) && level.getLevelData().isHardcore(); } - @Override - public ItemStack getResultItem(HolderLookup.Provider lookupProvider) { - ItemStack resultStack = super.getResultItem(lookupProvider); - - ItemLore lore = ItemLore.EMPTY; - lore = lore.withLineAdded(Component.literal("Only craftable in Hardcore Mode").withStyle(ChatFormatting.DARK_PURPLE)); - resultStack.set(DataComponents.LORE, lore); - - return resultStack; - } +// @Override +// public ItemStack getResultItem(HolderLookup.Provider lookupProvider) { +// ItemStack resultStack = super.getResultItem(lookupProvider); +// +// ItemLore lore = ItemLore.EMPTY; +// lore = lore.withLineAdded(Component.literal("Only craftable in Hardcore Mode").withStyle(ChatFormatting.DARK_PURPLE)); +// resultStack.set(DataComponents.LORE, lore); +// +// return resultStack; +// } @Override public ItemStack assemble(CraftingInput craftingInput, HolderLookup.Provider lookupProvider) { diff --git a/src/main/java/com/shynieke/statues/recipe/LootRecipe.java b/src/main/java/com/shynieke/statues/recipe/LootRecipe.java index 8a6cb3ce..43cbe704 100644 --- a/src/main/java/com/shynieke/statues/recipe/LootRecipe.java +++ b/src/main/java/com/shynieke/statues/recipe/LootRecipe.java @@ -4,13 +4,16 @@ import com.mojang.serialization.MapCodec; import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.core.HolderLookup; +import net.minecraft.core.HolderLookup.Provider; import net.minecraft.core.NonNullList; import net.minecraft.core.RegistryAccess; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.codec.StreamCodec; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; +import net.minecraft.world.item.crafting.PlacementInfo; import net.minecraft.world.item.crafting.Recipe; +import net.minecraft.world.item.crafting.RecipeBookCategory; import net.minecraft.world.item.crafting.RecipeInput; import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.item.crafting.RecipeType; @@ -57,10 +60,10 @@ public ItemStack assemble(RecipeInput recipeInput, HolderLookup.Provider lookupP return this.getResultItem(lookupProvider).copy(); } - @Override - public boolean canCraftInDimensions(int x, int y) { - return false; - } +// @Override +// public boolean canCraftInDimensions(int x, int y) { +// return false; +// } @Override public boolean isSpecial() { @@ -70,7 +73,6 @@ public boolean isSpecial() { /** * @return the first result item */ - @Override public ItemStack getResultItem(HolderLookup.Provider lookupProvider) { return this.result; } @@ -111,20 +113,30 @@ public float getChance3() { } @Override - public RecipeSerializer getSerializer() { + public RecipeSerializer> getSerializer() { return StatuesRecipes.LOOT_SERIALIZER.get(); } @Override - public RecipeType getType() { + public RecipeType> getType() { return StatuesRecipes.LOOT_RECIPE.get(); } + @Override + public PlacementInfo placementInfo() { + return null; + } + + @Override + public RecipeBookCategory recipeBookCategory() { + return null; + } + public static class Serializer implements RecipeSerializer { private static final MapCodec CODEC = RecordCodecBuilder.mapCodec( instance -> instance.group( Codec.STRING.optionalFieldOf("group", "").forGetter(recipe -> recipe.group), - Ingredient.CODEC_NONEMPTY.fieldOf("ingredient").forGetter(recipe -> recipe.ingredient), + Ingredient.CODEC.fieldOf("ingredient").forGetter(recipe -> recipe.ingredient), ItemStack.STRICT_CODEC.optionalFieldOf("result", ItemStack.EMPTY).forGetter(recipe -> recipe.result), Codec.FLOAT.optionalFieldOf("result_chance", 1.0F).forGetter(recipe -> recipe.resultChance), ItemStack.STRICT_CODEC.optionalFieldOf("result2", ItemStack.EMPTY).forGetter(recipe -> recipe.result2), diff --git a/src/main/java/com/shynieke/statues/recipe/UpgradeRecipe.java b/src/main/java/com/shynieke/statues/recipe/UpgradeRecipe.java index dc5a336a..451785c4 100644 --- a/src/main/java/com/shynieke/statues/recipe/UpgradeRecipe.java +++ b/src/main/java/com/shynieke/statues/recipe/UpgradeRecipe.java @@ -1,7 +1,6 @@ package com.shynieke.statues.recipe; import com.mojang.serialization.Codec; -import com.mojang.serialization.DataResult; import com.mojang.serialization.MapCodec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.shynieke.statues.datacomponent.StatueStats; @@ -12,32 +11,37 @@ import net.minecraft.ChatFormatting; import net.minecraft.core.HolderLookup; import net.minecraft.core.NonNullList; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.network.RegistryFriendlyByteBuf; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; import net.minecraft.network.codec.StreamCodec; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; +import net.minecraft.world.item.crafting.PlacementInfo; import net.minecraft.world.item.crafting.Recipe; +import net.minecraft.world.item.crafting.RecipeBookCategory; import net.minecraft.world.item.crafting.RecipeInput; import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.item.crafting.RecipeType; import net.minecraft.world.level.Level; import net.neoforged.neoforge.common.util.RecipeMatcher; +import java.util.ArrayList; +import java.util.List; import java.util.Locale; public class UpgradeRecipe implements Recipe { protected final String group; protected final Ingredient center; - protected final NonNullList catalysts; + protected final List catalysts; protected final ItemStack result; protected final boolean requireCore; private final UpgradeType upgradeType; private final int tier; protected final boolean showNotification; - public UpgradeRecipe(String group, Ingredient center, NonNullList catalysts, + public UpgradeRecipe(String group, Ingredient center, List catalysts, ItemStack stack, boolean requireCore, UpgradeType upgradeType, int tier, boolean showNotification) { this.group = group; this.center = center; @@ -53,7 +57,7 @@ public NonNullList getIngredients() { NonNullList nonnulllist = NonNullList.create(); nonnulllist.add(center); if (requireCore) - nonnulllist.add(Ingredient.of(StatueTags.STATUE_CORE)); + nonnulllist.add(Ingredient.of(BuiltInRegistries.ITEM.getOrThrow(StatueTags.STATUE_CORE))); nonnulllist.addAll(catalysts); return nonnulllist; } @@ -67,7 +71,7 @@ public Ingredient getCenter() { return center; } - public NonNullList getCatalysts() { + public List getCatalysts() { return catalysts; } @@ -159,10 +163,10 @@ public ItemStack assemble(RecipeInput recipeInput, HolderLookup.Provider lookupP return this.getResultItem(lookupProvider).copy(); } - @Override - public boolean canCraftInDimensions(int x, int y) { - return false; - } +// @Override +// public boolean canCraftInDimensions(int x, int y) { +// return false; +// } @Override public boolean isSpecial() { @@ -172,40 +176,36 @@ public boolean isSpecial() { /** * @return the first result item */ - @Override public ItemStack getResultItem(HolderLookup.Provider lookupProvider) { return this.result; } @Override - public RecipeSerializer getSerializer() { + public RecipeSerializer> getSerializer() { return StatuesRecipes.UPGRADE_SERIALIZER.get(); } @Override - public RecipeType getType() { + public RecipeType> getType() { return StatuesRecipes.UPGRADE_RECIPE.get(); } + @Override + public PlacementInfo placementInfo() { + return null; + } + + @Override + public RecipeBookCategory recipeBookCategory() { + return null; + } + public static class Serializer implements RecipeSerializer { private static final MapCodec CODEC = RecordCodecBuilder.mapCodec( instance -> instance.group( Codec.STRING.optionalFieldOf("group", "").forGetter(recipe -> recipe.group), - Ingredient.CODEC_NONEMPTY.fieldOf("center").forGetter(recipe -> recipe.center), - Ingredient.CODEC_NONEMPTY - .listOf() - .fieldOf("catalysts") - .flatXmap( - array -> { - Ingredient[] aingredient = array - .toArray(Ingredient[]::new); //Forge skip the empty check and immediately create the array. - return aingredient.length > 4 - ? DataResult.error(() -> "Too many ingredients for shapeless recipe. The maximum is: %s".formatted(4)) - : DataResult.success(NonNullList.of(Ingredient.EMPTY, aingredient)); - }, - DataResult::success - ) - .forGetter(recipe -> recipe.catalysts), + Ingredient.CODEC.fieldOf("center").forGetter(recipe -> recipe.center), + Codec.lazyInitialized(() -> Ingredient.CODEC.listOf(0, 4)).fieldOf("catalysts").forGetter(p_360071_ -> p_360071_.catalysts), ItemStack.SINGLE_ITEM_CODEC.optionalFieldOf("result", ItemStack.EMPTY).forGetter(recipe -> recipe.result), Codec.BOOL.optionalFieldOf("requireCore", false).forGetter(recipe -> recipe.requireCore), UpgradeType.CODEC.optionalFieldOf("upgradeType", UpgradeType.CRAFTING).forGetter(recipe -> recipe.upgradeType), @@ -233,9 +233,9 @@ public static UpgradeRecipe fromNetwork(RegistryFriendlyByteBuf byteBuf) { Ingredient center = Ingredient.CONTENTS_STREAM_CODEC.decode(byteBuf); int i = byteBuf.readVarInt(); - NonNullList catalist = NonNullList.withSize(i, Ingredient.EMPTY); //You get it? As it's a list of catalysts + List catalist = new ArrayList<>(); - for (int j = 0; j < catalist.size(); ++j) { + for (int j = 0; j < i; ++j) { catalist.set(j, Ingredient.CONTENTS_STREAM_CODEC.decode(byteBuf)); } diff --git a/src/main/java/com/shynieke/statues/registry/StatueBlockEntities.java b/src/main/java/com/shynieke/statues/registry/StatueBlockEntities.java index fc0879d8..99c6d925 100644 --- a/src/main/java/com/shynieke/statues/registry/StatueBlockEntities.java +++ b/src/main/java/com/shynieke/statues/registry/StatueBlockEntities.java @@ -17,7 +17,7 @@ public class StatueBlockEntities { public static final DeferredRegister> BLOCK_ENTITIES = DeferredRegister.create(Registries.BLOCK_ENTITY_TYPE, Reference.MOD_ID); - public static final Supplier> STATUE = BLOCK_ENTITIES.register("statue", () -> BlockEntityType.Builder.of(StatueBlockEntity::new, + public static final Supplier> STATUE = BLOCK_ENTITIES.register("statue", () -> new BlockEntityType<>(StatueBlockEntity::new, StatueRegistry.ANGRY_BEE_STATUE.get(), StatueRegistry.TRANS_BEE_STATUE.get(), StatueRegistry.BABY_ZOMBIE_STATUE.get(), StatueRegistry.BEE_STATUE.get(), StatueRegistry.BLAZE_STATUE.get(), StatueRegistry.BROWN_MOOSHROOM_STATUE.get(), StatueRegistry.CAMPFIRE_STATUE.get(), StatueRegistry.CAT_BLACK_STATUE.get(), StatueRegistry.CAT_BRITISH_SHORTHAIR_STATUE.get(), StatueRegistry.CAT_CALICO_STATUE.get(), @@ -55,22 +55,22 @@ public class StatueBlockEntities { StatueRegistry.WARDEN_STATUE.get(), StatueRegistry.ALLAY_STATUE.get(), StatueRegistry.AXOLOTL_LUCY_STATUE.get(), StatueRegistry.AXOLOTL_WILD_STATUE.get(), StatueRegistry.AXOLOTL_GOLD_STATUE.get(), StatueRegistry.AXOLOTL_CYAN_STATUE.get(), StatueRegistry.AXOLOTL_BLUE_STATUE.get(), StatueRegistry.FROG_TEMPERATE_STATUE.get(), StatueRegistry.FROG_WARM_STATUE.get(), - StatueRegistry.FROG_COLD_STATUE.get(), StatueRegistry.TADPOLE_STATUE.get()).build(null)); + StatueRegistry.FROG_COLD_STATUE.get(), StatueRegistry.TADPOLE_STATUE.get())); public static final Supplier> SHULKER_STATUE = BLOCK_ENTITIES.register("shulker_statue", () -> - BlockEntityType.Builder.of(ShulkerStatueBlockEntity::new, StatueRegistry.SHULKER_STATUE.get()).build(null)); + new BlockEntityType<>(ShulkerStatueBlockEntity::new, StatueRegistry.SHULKER_STATUE.get())); public static final Supplier> TROPICAL_FISH = BLOCK_ENTITIES.register("tropical_fish", () -> - BlockEntityType.Builder.of(TropicalFishBlockEntity::new, StatueRegistry.TROPICAL_FISH_B.get(), StatueRegistry.TROPICAL_FISH_BB.get(), + new BlockEntityType<>(TropicalFishBlockEntity::new, StatueRegistry.TROPICAL_FISH_B.get(), StatueRegistry.TROPICAL_FISH_BB.get(), StatueRegistry.TROPICAL_FISH_BE.get(), StatueRegistry.TROPICAL_FISH_BM.get(), StatueRegistry.TROPICAL_FISH_BMB.get(), StatueRegistry.TROPICAL_FISH_BMS.get(), StatueRegistry.TROPICAL_FISH_E.get(), StatueRegistry.TROPICAL_FISH_ES.get(), StatueRegistry.TROPICAL_FISH_HB.get(), StatueRegistry.TROPICAL_FISH_SB.get(), - StatueRegistry.TROPICAL_FISH_SD.get(), StatueRegistry.TROPICAL_FISH_SS.get()).build(null)); + StatueRegistry.TROPICAL_FISH_SD.get(), StatueRegistry.TROPICAL_FISH_SS.get())); - public static final Supplier> PLAYER = BLOCK_ENTITIES.register("player", () -> BlockEntityType.Builder.of(PlayerBlockEntity::new, - StatueRegistry.PLAYER_STATUE.get()).build(null)); + public static final Supplier> PLAYER = BLOCK_ENTITIES.register("player", () -> new BlockEntityType<>(PlayerBlockEntity::new, + StatueRegistry.PLAYER_STATUE.get())); - public static final Supplier> STATUE_TABLE = BLOCK_ENTITIES.register("statue_table", () -> BlockEntityType.Builder.of(StatueTableBlockEntity::new, - StatueRegistry.STATUE_TABLE.get()).build(null)); + public static final Supplier> STATUE_TABLE = BLOCK_ENTITIES.register("statue_table", () -> new BlockEntityType<>(StatueTableBlockEntity::new, + StatueRegistry.STATUE_TABLE.get())); public static void registerCapabilities(RegisterCapabilitiesEvent event) { event.registerBlockEntity(Capabilities.ItemHandler.BLOCK, SHULKER_STATUE.get(), ShulkerStatueBlockEntity::getHandler); diff --git a/src/main/java/com/shynieke/statues/registry/StatueEntities.java b/src/main/java/com/shynieke/statues/registry/StatueEntities.java index 8b866f8c..cb4de211 100644 --- a/src/main/java/com/shynieke/statues/registry/StatueEntities.java +++ b/src/main/java/com/shynieke/statues/registry/StatueEntities.java @@ -9,7 +9,10 @@ public class StatueEntities { public static void registerSpawnPlacements(RegisterSpawnPlacementsEvent event) { - event.register(StatueRegistry.STATUE_BAT.get(), SpawnPlacementTypes.ON_GROUND, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, StatueBatEntity::canSpawnHere, RegisterSpawnPlacementsEvent.Operation.AND); + event.register(StatueRegistry.STATUE_BAT.get(), + SpawnPlacementTypes.ON_GROUND, + Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, + StatueBatEntity::canSpawnHere, RegisterSpawnPlacementsEvent.Operation.AND); } public static void registerEntityAttributes(EntityAttributeCreationEvent event) { diff --git a/src/main/java/com/shynieke/statues/registry/StatueJukeboxSongs.java b/src/main/java/com/shynieke/statues/registry/StatueJukeboxSongs.java index 723af9cb..d36a80c3 100644 --- a/src/main/java/com/shynieke/statues/registry/StatueJukeboxSongs.java +++ b/src/main/java/com/shynieke/statues/registry/StatueJukeboxSongs.java @@ -16,7 +16,7 @@ public class StatueJukeboxSongs { public static final ResourceKey CREDITS = create("credits"); private static ResourceKey create(String path) { - return ResourceKey.create(Registries.JUKEBOX_SONG, ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, path)); + return ResourceKey.create(Registries.JUKEBOX_SONG, Reference.modLoc(path)); } public static void bootstrap(BootstrapContext context) { diff --git a/src/main/java/com/shynieke/statues/registry/StatuePatterns.java b/src/main/java/com/shynieke/statues/registry/StatuePatterns.java index 525c15ce..fef7987b 100644 --- a/src/main/java/com/shynieke/statues/registry/StatuePatterns.java +++ b/src/main/java/com/shynieke/statues/registry/StatuePatterns.java @@ -16,7 +16,7 @@ public class StatuePatterns { public static final ResourceKey STATUE_CORE = create("statue_core_pottery_pattern"); private static ResourceKey create(String path) { - return ResourceKey.create(Registries.DECORATED_POT_PATTERN, ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, path)); + return ResourceKey.create(Registries.DECORATED_POT_PATTERN, Reference.modLoc(path)); } public static void expandVanillaDefinitions() { diff --git a/src/main/java/com/shynieke/statues/registry/StatueRegistry.java b/src/main/java/com/shynieke/statues/registry/StatueRegistry.java index e6983676..d631a9cf 100644 --- a/src/main/java/com/shynieke/statues/registry/StatueRegistry.java +++ b/src/main/java/com/shynieke/statues/registry/StatueRegistry.java @@ -83,6 +83,7 @@ import com.shynieke.statues.menu.StatueTableMenu; import net.minecraft.core.registries.Registries; import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceKey; import net.minecraft.world.effect.MobEffects; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.MobCategory; @@ -93,16 +94,16 @@ import net.minecraft.world.item.CreativeModeTabs; import net.minecraft.world.item.DyeColor; import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemNameBlockItem; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Rarity; import net.minecraft.world.item.SmithingTemplateItem; +import net.minecraft.world.item.SpawnEggItem; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.FlowerBlock; import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.material.MapColor; import net.minecraft.world.level.material.PushReaction; -import net.neoforged.neoforge.common.DeferredSpawnEggItem; import net.neoforged.neoforge.common.extensions.IMenuTypeExtension; import net.neoforged.neoforge.registries.DeferredBlock; import net.neoforged.neoforge.registries.DeferredItem; @@ -131,148 +132,156 @@ public class StatueRegistry { .vehicleAttachment(Player.DEFAULT_VEHICLE_ATTACHMENT) .clientTrackingRange(32) .updateInterval(2) - .build("player_statue")); + .build(statuesEntityId("player_statue")) + ); public static final Supplier> STATUE_BAT = ENTITIES.register("statue_bat", () -> EntityType.Builder.of(StatueBatEntity::new, MobCategory.AMBIENT) - .sized(0.5F, 0.9F).eyeHeight(0.45F).clientTrackingRange(5).build("statue_bat")); + .sized(0.5F, 0.9F) + .eyeHeight(0.45F) + .clientTrackingRange(5) + .build(statuesEntityId("statue_bat")) + ); - public static final DeferredBlock STATUE_TABLE = registerStatue("statue_table", () -> new StatueTableBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock ANGRY_BEE_STATUE = registerStatue("angry_bee_statue", () -> new AngryBeeStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock BABY_ZOMBIE_STATUE = registerStatue("baby_zombie_statue", () -> new BabyZombieStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock BEE_STATUE = registerBeeStatue("bee_statue", () -> new BeeStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock TRANS_BEE_STATUE = registerStatue("trans_bee_statue", () -> new BeeStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock BLAZE_STATUE = registerStatue("blaze_statue", () -> new BlazeStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock BROWN_MOOSHROOM_STATUE = registerStatue("brown_mooshroom_statue", () -> new BrownMooshroomStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock CAMPFIRE_STATUE = registerStatue("campfire_statue", () -> new CampfireStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock CAT_BLACK_STATUE = registerStatue("cat_black_statue", () -> new CatStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock CAT_BRITISH_SHORTHAIR_STATUE = registerStatue("cat_british_shorthair_statue", () -> new CatStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock CAT_CALICO_STATUE = registerStatue("cat_calico_statue", () -> new CatStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock CAT_JELLIE_STATUE = registerStatue("cat_jellie_statue", () -> new CatStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock CAT_PERSIAN_STATUE = registerStatue("cat_persian_statue", () -> new CatStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock CAT_RAGDOLL_STATUE = registerStatue("cat_ragdoll_statue", () -> new CatStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock CAT_RED_STATUE = registerStatue("cat_red_statue", () -> new CatStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock CAT_SIAMESE_STATUE = registerStatue("cat_siamese_statue", () -> new CatStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock CAT_TABBY_STATUE = registerStatue("cat_tabby_statue", () -> new CatStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock CAT_TUXEDO_STATUE = registerStatue("cat_tuxedo_statue", () -> new CatStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock CAT_WHITE_STATUE = registerStatue("cat_white_statue", () -> new CatStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock CHICKEN_JOCKEY_STATUE = registerStatue("chicken_jockey_statue", () -> new ChickenJockeyStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock CHICKEN_STATUE = registerStatue("chicken_statue", () -> new ChickenStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock COD_STATUE = registerStatue("cod_statue", () -> new CodStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock COW_STATUE = registerStatue("cow_statue", () -> new CowStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock CREEPER_STATUE = registerStatue("creeper_statue", () -> new CreeperStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock DETECTIVE_PLATYPUS = registerStatue("detective_platypus_statue", () -> new DetectivePlatypusStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock DOLPHIN_STATUE = registerStatue("dolphin_statue", () -> new DolphinStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock DROWNED_STATUE = registerStatue("drowned_statue", () -> new DrownedStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock ELDER_GUARDIAN_STATUE = registerStatue("elder_guardian_statue", () -> new ElderGuardianStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock ENDERMAN_STATUE = registerStatue("enderman_statue", () -> new EndermanStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock ENDERMITE_STATUE = registerStatue("endermite_statue", () -> new EndermiteStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock EVOKER_STATUE = registerStatue("evoker_statue", () -> new EvokerStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock FLOOD_STATUE = registerStatue("flood_statue", () -> new FloodStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock FOX_SNOW_STATUE = registerStatue("fox_snow_statue", () -> new FoxStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock FOX_STATUE = registerStatue("fox_statue", () -> new FoxStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock GHAST_STATUE = registerStatue("ghast_statue", () -> new GhastStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock GUARDIAN_STATUE = registerStatue("guardian_statue", () -> new GuardianStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock HUSK_STATUE = registerStatue("husk_statue", () -> new HuskStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock INFO_STATUE = registerStatue("info_statue", () -> new InfoStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock KING_CLUCK_STATUE = registerStatue("king_cluck_statue", () -> new KingCluckStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock MAGMA_STATUE = registerStatue("magma_statue", () -> new MagmaStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock MOOSHROOM_STATUE = registerStatue("mooshroom_statue", () -> new MooshroomStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock PANDA_ANGRY_STATUE = registerStatue("panda_angry_statue", () -> new PandaStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock PANDA_BROWN_STATUE = registerStatue("panda_brown_statue", () -> new PandaStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock PANDA_LAZY_STATUE = registerStatue("panda_lazy_statue", () -> new PandaStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock PANDA_NORMAL_STATUE = registerStatue("panda_normal_statue", () -> new PandaStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock PANDA_PLAYFUL_STATUE = registerStatue("panda_playful_statue", () -> new PandaStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock PANDA_WEAK_STATUE = registerStatue("panda_weak_statue", () -> new PandaStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock PANDA_WORRIED_STATUE = registerStatue("panda_worried_statue", () -> new PandaStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock PIG_STATUE = registerStatue("pig_statue", () -> new PigStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock PILLAGER_STATUE = registerStatue("pillager_statue", () -> new PillagerStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock PLAYER_STATUE = registerPlayerStatue("player_statue", () -> new PlayerStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock PUFFERFISH_MEDIUM_STATUE = registerStatue("pufferfish_medium_statue", () -> new PufferfishStatueBlock(blockBuilder(), 1), blockItemBuilder()); - public static final DeferredBlock PUFFERFISH_SMALL_STATUE = registerStatue("pufferfish_small_statue", () -> new PufferfishStatueBlock(blockBuilder(), 0), blockItemBuilder()); - public static final DeferredBlock PUFFERFISH_STATUE = registerStatue("pufferfish_statue", () -> new PufferfishStatueBlock(blockBuilder(), 2), blockItemBuilder()); - public static final DeferredBlock RABBIT_BR_STATUE = registerStatue("rabbit_br_statue", () -> new RabbitStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock RABBIT_BS_STATUE = registerStatue("rabbit_bs_statue", () -> new RabbitStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock RABBIT_BW_STATUE = registerStatue("rabbit_bw_statue", () -> new RabbitStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock RABBIT_GO_STATUE = registerStatue("rabbit_go_statue", () -> new RabbitStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock RABBIT_WH_STATUE = registerStatue("rabbit_wh_statue", () -> new RabbitStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock RABBIT_WS_STATUE = registerStatue("rabbit_ws_statue", () -> new RabbitStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock RAVAGER_STATUE = registerStatue("ravager_statue", () -> new RavagerStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock SALMON_STATUE = registerStatue("salmon_statue", () -> new SalmonStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock SHEEP_SHAVEN_STATUE = registerStatue("sheep_shaven_statue", () -> new SheepShavenStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock SHEEP_STATUE_BLACK = registerStatue("sheep_statue_black", () -> new SheepStatueBlock(blockBuilder(), DyeColor.BLACK), blockItemBuilder()); - public static final DeferredBlock SHEEP_STATUE_BLUE = registerStatue("sheep_statue_blue", () -> new SheepStatueBlock(blockBuilder(), DyeColor.BLUE), blockItemBuilder()); - public static final DeferredBlock SHEEP_STATUE_BROWN = registerStatue("sheep_statue_brown", () -> new SheepStatueBlock(blockBuilder(), DyeColor.BROWN), blockItemBuilder()); - public static final DeferredBlock SHEEP_STATUE_CYAN = registerStatue("sheep_statue_cyan", () -> new SheepStatueBlock(blockBuilder(), DyeColor.CYAN), blockItemBuilder()); - public static final DeferredBlock SHEEP_STATUE_GRAY = registerStatue("sheep_statue_gray", () -> new SheepStatueBlock(blockBuilder(), DyeColor.GRAY), blockItemBuilder()); - public static final DeferredBlock SHEEP_STATUE_GREEN = registerStatue("sheep_statue_green", () -> new SheepStatueBlock(blockBuilder(), DyeColor.GREEN), blockItemBuilder()); - public static final DeferredBlock SHEEP_STATUE_LIGHT_BLUE = registerStatue("sheep_statue_light_blue", () -> new SheepStatueBlock(blockBuilder(), DyeColor.LIGHT_BLUE), blockItemBuilder()); - public static final DeferredBlock SHEEP_STATUE_LIGHT_GRAY = registerStatue("sheep_statue_light_gray", () -> new SheepStatueBlock(blockBuilder(), DyeColor.LIGHT_GRAY), blockItemBuilder()); - public static final DeferredBlock SHEEP_STATUE_LIME = registerStatue("sheep_statue_lime", () -> new SheepStatueBlock(blockBuilder(), DyeColor.LIME), blockItemBuilder()); - public static final DeferredBlock SHEEP_STATUE_MAGENTA = registerStatue("sheep_statue_magenta", () -> new SheepStatueBlock(blockBuilder(), DyeColor.MAGENTA), blockItemBuilder()); - public static final DeferredBlock SHEEP_STATUE_ORANGE = registerStatue("sheep_statue_orange", () -> new SheepStatueBlock(blockBuilder(), DyeColor.ORANGE), blockItemBuilder()); - public static final DeferredBlock SHEEP_STATUE_PINK = registerStatue("sheep_statue_pink", () -> new SheepStatueBlock(blockBuilder(), DyeColor.PINK), blockItemBuilder()); - public static final DeferredBlock SHEEP_STATUE_PURPLE = registerStatue("sheep_statue_purple", () -> new SheepStatueBlock(blockBuilder(), DyeColor.PURPLE), blockItemBuilder()); - public static final DeferredBlock SHEEP_STATUE_RED = registerStatue("sheep_statue_red", () -> new SheepStatueBlock(blockBuilder(), DyeColor.RED), blockItemBuilder()); - public static final DeferredBlock SHEEP_STATUE_WHITE = registerStatue("sheep_statue_white", () -> new SheepStatueBlock(blockBuilder(), DyeColor.WHITE), blockItemBuilder()); - public static final DeferredBlock SHEEP_STATUE_YELLOW = registerStatue("sheep_statue_yellow", () -> new SheepStatueBlock(blockBuilder(), DyeColor.YELLOW), blockItemBuilder()); - public static final DeferredBlock SHULKER_STATUE = registerStatue("shulker_statue", () -> new ShulkerStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock SLIME_STATUE = registerStatue("slime_statue", () -> new SlimeStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock SNOW_GOLEM_STATUE = registerStatue("snow_golem_statue", () -> new SnowGolemStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock SPIDER_STATUE = registerStatue("spider_statue", () -> new SpiderStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock SQUID_STATUE = registerStatue("squid_statue", () -> new SquidStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock TOTEM_OF_UNDYING_STATUE = registerStatue("totem_of_undying_statue", () -> new TotemOfUndyingStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock TROPICAL_FISH_B = registerStatue("tropical_fish_b", () -> new FishStatueBlock(blockBuilder(), 1), blockItemBuilder()); - public static final DeferredBlock TROPICAL_FISH_BB = registerStatue("tropical_fish_bb", () -> new FishStatueBlock(blockBuilder(), 0), blockItemBuilder()); - public static final DeferredBlock TROPICAL_FISH_BE = registerStatue("tropical_fish_be", () -> new FishStatueBlock(blockBuilder(), 0), blockItemBuilder()); - public static final DeferredBlock TROPICAL_FISH_BM = registerStatue("tropical_fish_bm", () -> new FishStatueBlock(blockBuilder(), 1), blockItemBuilder()); - public static final DeferredBlock TROPICAL_FISH_BMB = registerStatue("tropical_fish_bmb", () -> new FishStatueBlock(blockBuilder(), 1), blockItemBuilder()); - public static final DeferredBlock TROPICAL_FISH_BMS = registerStatue("tropical_fish_bms", () -> new FishStatueBlock(blockBuilder(), 0), blockItemBuilder()); - public static final DeferredBlock TROPICAL_FISH_E = registerStatue("tropical_fish_e", () -> new FishStatueBlock(blockBuilder(), 1), blockItemBuilder()); - public static final DeferredBlock TROPICAL_FISH_ES = registerStatue("tropical_fish_es", () -> new FishStatueBlock(blockBuilder(), 0), blockItemBuilder()); - public static final DeferredBlock TROPICAL_FISH_HB = registerStatue("tropical_fish_hb", () -> new FishStatueBlock(blockBuilder(), 1), blockItemBuilder()); - public static final DeferredBlock TROPICAL_FISH_SB = registerStatue("tropical_fish_sb", () -> new FishStatueBlock(blockBuilder(), 1), blockItemBuilder()); - public static final DeferredBlock TROPICAL_FISH_SD = registerStatue("tropical_fish_sd", () -> new FishStatueBlock(blockBuilder(), 0), blockItemBuilder()); - public static final DeferredBlock TROPICAL_FISH_SS = registerStatue("tropical_fish_ss", () -> new FishStatueBlock(blockBuilder(), 0), blockItemBuilder()); - public static final DeferredBlock TURTLE_STATUE = registerStatue("turtle_statue", () -> new TurtleStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock VILLAGER_BR_STATUE = registerStatue("villager_br_statue", () -> new VillagerStatue(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock VILLAGER_GR_STATUE = registerStatue("villager_gr_statue", () -> new VillagerStatue(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock VILLAGER_PU_STATUE = registerStatue("villager_pu_statue", () -> new VillagerStatue(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock VILLAGER_WH_STATUE = registerStatue("villager_wh_statue", () -> new VillagerStatue(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock VINDICATOR_STATUE = registerStatue("vindicator_statue", () -> new VindicatorStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock WASTELAND_STATUE = registerStatue("wasteland_statue", () -> new WastelandStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock WITCH_STATUE = registerStatue("witch_statue", () -> new WitchStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock ZOMBIE_STATUE = registerStatue("zombie_statue", () -> new ZombieStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock ALLAY_STATUE = registerStatue("allay_statue", () -> new AllayStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock AXOLOTL_LUCY_STATUE = registerStatue("axolotl_lucy_statue", () -> new AxolotlStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock AXOLOTL_WILD_STATUE = registerStatue("axolotl_wild_statue", () -> new AxolotlStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock AXOLOTL_GOLD_STATUE = registerStatue("axolotl_gold_statue", () -> new AxolotlStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock AXOLOTL_CYAN_STATUE = registerStatue("axolotl_cyan_statue", () -> new AxolotlStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock AXOLOTL_BLUE_STATUE = registerStatue("axolotl_blue_statue", () -> new AxolotlStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock FROG_TEMPERATE_STATUE = registerStatue("frog_temperate_statue", () -> new FrogStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock FROG_WARM_STATUE = registerStatue("frog_warm_statue", () -> new FrogStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock FROG_COLD_STATUE = registerStatue("frog_cold_statue", () -> new FrogStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock TADPOLE_STATUE = registerStatue("tadpole_statue", () -> new TadpoleStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock WARDEN_STATUE = registerStatue("warden_statue", () -> new WardenStatueBlock(blockBuilder()), blockItemBuilder()); + private static ResourceKey> statuesEntityId(String p_368595_) { + return ResourceKey.create(Registries.ENTITY_TYPE, Reference.modLoc(p_368595_)); + } + + public static final DeferredBlock STATUE_TABLE = registerStatue("statue_table", () -> new StatueTableBlock(blockBuilder("statue_table"))); + public static final DeferredBlock ANGRY_BEE_STATUE = registerStatue("angry_bee_statue", () -> new AngryBeeStatueBlock(blockBuilder("angry_bee_statue"))); + public static final DeferredBlock BABY_ZOMBIE_STATUE = registerStatue("baby_zombie_statue", () -> new BabyZombieStatueBlock(blockBuilder("baby_zombie_statue"))); + public static final DeferredBlock BEE_STATUE = registerBeeStatue("bee_statue", () -> new BeeStatueBlock(blockBuilder("bee_statue"))); + public static final DeferredBlock TRANS_BEE_STATUE = registerStatue("trans_bee_statue", () -> new BeeStatueBlock(blockBuilder("trans_bee_statue"))); + public static final DeferredBlock BLAZE_STATUE = registerStatue("blaze_statue", () -> new BlazeStatueBlock(blockBuilder("blaze_statue"))); + public static final DeferredBlock BROWN_MOOSHROOM_STATUE = registerStatue("brown_mooshroom_statue", () -> new BrownMooshroomStatueBlock(blockBuilder("brown_mooshroom_statue"))); + public static final DeferredBlock CAMPFIRE_STATUE = registerStatue("campfire_statue", () -> new CampfireStatueBlock(blockBuilder("campfire_statue"))); + public static final DeferredBlock CAT_BLACK_STATUE = registerStatue("cat_black_statue", () -> new CatStatueBlock(blockBuilder("cat_black_statue"))); + public static final DeferredBlock CAT_BRITISH_SHORTHAIR_STATUE = registerStatue("cat_british_shorthair_statue", () -> new CatStatueBlock(blockBuilder("cat_british_shorthair_statue"))); + public static final DeferredBlock CAT_CALICO_STATUE = registerStatue("cat_calico_statue", () -> new CatStatueBlock(blockBuilder("cat_calico_statue"))); + public static final DeferredBlock CAT_JELLIE_STATUE = registerStatue("cat_jellie_statue", () -> new CatStatueBlock(blockBuilder("cat_jellie_statue"))); + public static final DeferredBlock CAT_PERSIAN_STATUE = registerStatue("cat_persian_statue", () -> new CatStatueBlock(blockBuilder("cat_persian_statue"))); + public static final DeferredBlock CAT_RAGDOLL_STATUE = registerStatue("cat_ragdoll_statue", () -> new CatStatueBlock(blockBuilder("cat_ragdoll_statue"))); + public static final DeferredBlock CAT_RED_STATUE = registerStatue("cat_red_statue", () -> new CatStatueBlock(blockBuilder("cat_red_statue"))); + public static final DeferredBlock CAT_SIAMESE_STATUE = registerStatue("cat_siamese_statue", () -> new CatStatueBlock(blockBuilder("cat_siamese_statue"))); + public static final DeferredBlock CAT_TABBY_STATUE = registerStatue("cat_tabby_statue", () -> new CatStatueBlock(blockBuilder("cat_tabby_statue"))); + public static final DeferredBlock CAT_TUXEDO_STATUE = registerStatue("cat_tuxedo_statue", () -> new CatStatueBlock(blockBuilder("cat_tuxedo_statue"))); + public static final DeferredBlock CAT_WHITE_STATUE = registerStatue("cat_white_statue", () -> new CatStatueBlock(blockBuilder("cat_white_statue"))); + public static final DeferredBlock CHICKEN_JOCKEY_STATUE = registerStatue("chicken_jockey_statue", () -> new ChickenJockeyStatueBlock(blockBuilder("chicken_jockey_statue"))); + public static final DeferredBlock CHICKEN_STATUE = registerStatue("chicken_statue", () -> new ChickenStatueBlock(blockBuilder("chicken_statue"))); + public static final DeferredBlock COD_STATUE = registerStatue("cod_statue", () -> new CodStatueBlock(blockBuilder("cod_statue"))); + public static final DeferredBlock COW_STATUE = registerStatue("cow_statue", () -> new CowStatueBlock(blockBuilder("cow_statue"))); + public static final DeferredBlock CREEPER_STATUE = registerStatue("creeper_statue", () -> new CreeperStatueBlock(blockBuilder("creeper_statue"))); + public static final DeferredBlock DETECTIVE_PLATYPUS = registerStatue("detective_platypus_statue", () -> new DetectivePlatypusStatueBlock(blockBuilder("detective_platypus_statue"))); + public static final DeferredBlock DOLPHIN_STATUE = registerStatue("dolphin_statue", () -> new DolphinStatueBlock(blockBuilder("dolphin_statue"))); + public static final DeferredBlock DROWNED_STATUE = registerStatue("drowned_statue", () -> new DrownedStatueBlock(blockBuilder("drowned_statue"))); + public static final DeferredBlock ELDER_GUARDIAN_STATUE = registerStatue("elder_guardian_statue", () -> new ElderGuardianStatueBlock(blockBuilder("elder_guardian_statue"))); + public static final DeferredBlock ENDERMAN_STATUE = registerStatue("enderman_statue", () -> new EndermanStatueBlock(blockBuilder("enderman_statue"))); + public static final DeferredBlock ENDERMITE_STATUE = registerStatue("endermite_statue", () -> new EndermiteStatueBlock(blockBuilder("endermite_statue"))); + public static final DeferredBlock EVOKER_STATUE = registerStatue("evoker_statue", () -> new EvokerStatueBlock(blockBuilder("evoker_statue"))); + public static final DeferredBlock FLOOD_STATUE = registerStatue("flood_statue", () -> new FloodStatueBlock(blockBuilder("flood_statue"))); + public static final DeferredBlock FOX_SNOW_STATUE = registerStatue("fox_snow_statue", () -> new FoxStatueBlock(blockBuilder("fox_snow_statue"))); + public static final DeferredBlock FOX_STATUE = registerStatue("fox_statue", () -> new FoxStatueBlock(blockBuilder("fox_statue"))); + public static final DeferredBlock GHAST_STATUE = registerStatue("ghast_statue", () -> new GhastStatueBlock(blockBuilder("ghast_statue"))); + public static final DeferredBlock GUARDIAN_STATUE = registerStatue("guardian_statue", () -> new GuardianStatueBlock(blockBuilder("guardian_statue"))); + public static final DeferredBlock HUSK_STATUE = registerStatue("husk_statue", () -> new HuskStatueBlock(blockBuilder("husk_statue"))); + public static final DeferredBlock INFO_STATUE = registerStatue("info_statue", () -> new InfoStatueBlock(blockBuilder("info_statue"))); + public static final DeferredBlock KING_CLUCK_STATUE = registerStatue("king_cluck_statue", () -> new KingCluckStatueBlock(blockBuilder("king_cluck_statue"))); + public static final DeferredBlock MAGMA_STATUE = registerStatue("magma_statue", () -> new MagmaStatueBlock(blockBuilder("magma_statue"))); + public static final DeferredBlock MOOSHROOM_STATUE = registerStatue("mooshroom_statue", () -> new MooshroomStatueBlock(blockBuilder("mooshroom_statue"))); + public static final DeferredBlock PANDA_ANGRY_STATUE = registerStatue("panda_angry_statue", () -> new PandaStatueBlock(blockBuilder("panda_angry_statue"))); + public static final DeferredBlock PANDA_BROWN_STATUE = registerStatue("panda_brown_statue", () -> new PandaStatueBlock(blockBuilder("panda_brown_statue"))); + public static final DeferredBlock PANDA_LAZY_STATUE = registerStatue("panda_lazy_statue", () -> new PandaStatueBlock(blockBuilder("panda_lazy_statue"))); + public static final DeferredBlock PANDA_NORMAL_STATUE = registerStatue("panda_normal_statue", () -> new PandaStatueBlock(blockBuilder("panda_normal_statue"))); + public static final DeferredBlock PANDA_PLAYFUL_STATUE = registerStatue("panda_playful_statue", () -> new PandaStatueBlock(blockBuilder("panda_playful_statue"))); + public static final DeferredBlock PANDA_WEAK_STATUE = registerStatue("panda_weak_statue", () -> new PandaStatueBlock(blockBuilder("panda_weak_statue"))); + public static final DeferredBlock PANDA_WORRIED_STATUE = registerStatue("panda_worried_statue", () -> new PandaStatueBlock(blockBuilder("panda_worried_statue"))); + public static final DeferredBlock PIG_STATUE = registerStatue("pig_statue", () -> new PigStatueBlock(blockBuilder("pig_statue"))); + public static final DeferredBlock PILLAGER_STATUE = registerStatue("pillager_statue", () -> new PillagerStatueBlock(blockBuilder("pillager_statue"))); + public static final DeferredBlock PLAYER_STATUE = registerPlayerStatue("player_statue", () -> new PlayerStatueBlock(blockBuilder("player_statue"))); + public static final DeferredBlock PUFFERFISH_MEDIUM_STATUE = registerStatue("pufferfish_medium_statue", () -> new PufferfishStatueBlock(blockBuilder("pufferfish_medium_statue"), 1)); + public static final DeferredBlock PUFFERFISH_SMALL_STATUE = registerStatue("pufferfish_small_statue", () -> new PufferfishStatueBlock(blockBuilder("pufferfish_small_statue"), 0)); + public static final DeferredBlock PUFFERFISH_STATUE = registerStatue("pufferfish_statue", () -> new PufferfishStatueBlock(blockBuilder("pufferfish_statue"), 2)); + public static final DeferredBlock RABBIT_BR_STATUE = registerStatue("rabbit_br_statue", () -> new RabbitStatueBlock(blockBuilder("rabbit_br_statue"))); + public static final DeferredBlock RABBIT_BS_STATUE = registerStatue("rabbit_bs_statue", () -> new RabbitStatueBlock(blockBuilder("rabbit_bs_statue"))); + public static final DeferredBlock RABBIT_BW_STATUE = registerStatue("rabbit_bw_statue", () -> new RabbitStatueBlock(blockBuilder("rabbit_bw_statue"))); + public static final DeferredBlock RABBIT_GO_STATUE = registerStatue("rabbit_go_statue", () -> new RabbitStatueBlock(blockBuilder("rabbit_go_statue"))); + public static final DeferredBlock RABBIT_WH_STATUE = registerStatue("rabbit_wh_statue", () -> new RabbitStatueBlock(blockBuilder("rabbit_wh_statue"))); + public static final DeferredBlock RABBIT_WS_STATUE = registerStatue("rabbit_ws_statue", () -> new RabbitStatueBlock(blockBuilder("rabbit_ws_statue"))); + public static final DeferredBlock RAVAGER_STATUE = registerStatue("ravager_statue", () -> new RavagerStatueBlock(blockBuilder("ravager_statue"))); + public static final DeferredBlock SALMON_STATUE = registerStatue("salmon_statue", () -> new SalmonStatueBlock(blockBuilder("salmon_statue"))); + public static final DeferredBlock SHEEP_SHAVEN_STATUE = registerStatue("sheep_shaven_statue", () -> new SheepShavenStatueBlock(blockBuilder("sheep_shaven_statue"))); + public static final DeferredBlock SHEEP_STATUE_BLACK = registerStatue("sheep_statue_black", () -> new SheepStatueBlock(blockBuilder("sheep_statue_black"), DyeColor.BLACK)); + public static final DeferredBlock SHEEP_STATUE_BLUE = registerStatue("sheep_statue_blue", () -> new SheepStatueBlock(blockBuilder("sheep_statue_blue"), DyeColor.BLUE)); + public static final DeferredBlock SHEEP_STATUE_BROWN = registerStatue("sheep_statue_brown", () -> new SheepStatueBlock(blockBuilder("sheep_statue_brown"), DyeColor.BROWN)); + public static final DeferredBlock SHEEP_STATUE_CYAN = registerStatue("sheep_statue_cyan", () -> new SheepStatueBlock(blockBuilder("sheep_statue_cyan"), DyeColor.CYAN)); + public static final DeferredBlock SHEEP_STATUE_GRAY = registerStatue("sheep_statue_gray", () -> new SheepStatueBlock(blockBuilder("sheep_statue_gray"), DyeColor.GRAY)); + public static final DeferredBlock SHEEP_STATUE_GREEN = registerStatue("sheep_statue_green", () -> new SheepStatueBlock(blockBuilder("sheep_statue_green"), DyeColor.GREEN)); + public static final DeferredBlock SHEEP_STATUE_LIGHT_BLUE = registerStatue("sheep_statue_light_blue", () -> new SheepStatueBlock(blockBuilder("sheep_statue_light_blue"), DyeColor.LIGHT_BLUE)); + public static final DeferredBlock SHEEP_STATUE_LIGHT_GRAY = registerStatue("sheep_statue_light_gray", () -> new SheepStatueBlock(blockBuilder("sheep_statue_light_gray"), DyeColor.LIGHT_GRAY)); + public static final DeferredBlock SHEEP_STATUE_LIME = registerStatue("sheep_statue_lime", () -> new SheepStatueBlock(blockBuilder("sheep_statue_lime"), DyeColor.LIME)); + public static final DeferredBlock SHEEP_STATUE_MAGENTA = registerStatue("sheep_statue_magenta", () -> new SheepStatueBlock(blockBuilder("sheep_statue_magenta"), DyeColor.MAGENTA)); + public static final DeferredBlock SHEEP_STATUE_ORANGE = registerStatue("sheep_statue_orange", () -> new SheepStatueBlock(blockBuilder("sheep_statue_orange"), DyeColor.ORANGE)); + public static final DeferredBlock SHEEP_STATUE_PINK = registerStatue("sheep_statue_pink", () -> new SheepStatueBlock(blockBuilder("sheep_statue_pink"), DyeColor.PINK)); + public static final DeferredBlock SHEEP_STATUE_PURPLE = registerStatue("sheep_statue_purple", () -> new SheepStatueBlock(blockBuilder("sheep_statue_purple"), DyeColor.PURPLE)); + public static final DeferredBlock SHEEP_STATUE_RED = registerStatue("sheep_statue_red", () -> new SheepStatueBlock(blockBuilder("sheep_statue_red"), DyeColor.RED)); + public static final DeferredBlock SHEEP_STATUE_WHITE = registerStatue("sheep_statue_white", () -> new SheepStatueBlock(blockBuilder("sheep_statue_white"), DyeColor.WHITE)); + public static final DeferredBlock SHEEP_STATUE_YELLOW = registerStatue("sheep_statue_yellow", () -> new SheepStatueBlock(blockBuilder("sheep_statue_yellow"), DyeColor.YELLOW)); + public static final DeferredBlock SHULKER_STATUE = registerStatue("shulker_statue", () -> new ShulkerStatueBlock(blockBuilder("shulker_statue"))); + public static final DeferredBlock SLIME_STATUE = registerStatue("slime_statue", () -> new SlimeStatueBlock(blockBuilder("slime_statue"))); + public static final DeferredBlock SNOW_GOLEM_STATUE = registerStatue("snow_golem_statue", () -> new SnowGolemStatueBlock(blockBuilder("snow_golem_statue"))); + public static final DeferredBlock SPIDER_STATUE = registerStatue("spider_statue", () -> new SpiderStatueBlock(blockBuilder("spider_statue"))); + public static final DeferredBlock SQUID_STATUE = registerStatue("squid_statue", () -> new SquidStatueBlock(blockBuilder("squid_statue"))); + public static final DeferredBlock TOTEM_OF_UNDYING_STATUE = registerStatue("totem_of_undying_statue", () -> new TotemOfUndyingStatueBlock(blockBuilder("totem_of_undying_statue"))); + public static final DeferredBlock TROPICAL_FISH_B = registerStatue("tropical_fish_b", () -> new FishStatueBlock(blockBuilder("tropical_fish_b"), 1)); + public static final DeferredBlock TROPICAL_FISH_BB = registerStatue("tropical_fish_bb", () -> new FishStatueBlock(blockBuilder("tropical_fish_bb"), 0)); + public static final DeferredBlock TROPICAL_FISH_BE = registerStatue("tropical_fish_be", () -> new FishStatueBlock(blockBuilder("tropical_fish_be"), 0)); + public static final DeferredBlock TROPICAL_FISH_BM = registerStatue("tropical_fish_bm", () -> new FishStatueBlock(blockBuilder("tropical_fish_bm"), 1)); + public static final DeferredBlock TROPICAL_FISH_BMB = registerStatue("tropical_fish_bmb", () -> new FishStatueBlock(blockBuilder("tropical_fish_bmb"), 1)); + public static final DeferredBlock TROPICAL_FISH_BMS = registerStatue("tropical_fish_bms", () -> new FishStatueBlock(blockBuilder("tropical_fish_bms"), 0)); + public static final DeferredBlock TROPICAL_FISH_E = registerStatue("tropical_fish_e", () -> new FishStatueBlock(blockBuilder("tropical_fish_e"), 1)); + public static final DeferredBlock TROPICAL_FISH_ES = registerStatue("tropical_fish_es", () -> new FishStatueBlock(blockBuilder("tropical_fish_es"), 0)); + public static final DeferredBlock TROPICAL_FISH_HB = registerStatue("tropical_fish_hb", () -> new FishStatueBlock(blockBuilder("tropical_fish_hb"), 1)); + public static final DeferredBlock TROPICAL_FISH_SB = registerStatue("tropical_fish_sb", () -> new FishStatueBlock(blockBuilder("tropical_fish_sb"), 1)); + public static final DeferredBlock TROPICAL_FISH_SD = registerStatue("tropical_fish_sd", () -> new FishStatueBlock(blockBuilder("tropical_fish_sd"), 0)); + public static final DeferredBlock TROPICAL_FISH_SS = registerStatue("tropical_fish_ss", () -> new FishStatueBlock(blockBuilder("tropical_fish_ss"), 0)); + public static final DeferredBlock TURTLE_STATUE = registerStatue("turtle_statue", () -> new TurtleStatueBlock(blockBuilder("turtle_statue"))); + public static final DeferredBlock VILLAGER_BR_STATUE = registerStatue("villager_br_statue", () -> new VillagerStatue(blockBuilder("villager_br_statue"))); + public static final DeferredBlock VILLAGER_GR_STATUE = registerStatue("villager_gr_statue", () -> new VillagerStatue(blockBuilder("villager_gr_statue"))); + public static final DeferredBlock VILLAGER_PU_STATUE = registerStatue("villager_pu_statue", () -> new VillagerStatue(blockBuilder("villager_pu_statue"))); + public static final DeferredBlock VILLAGER_WH_STATUE = registerStatue("villager_wh_statue", () -> new VillagerStatue(blockBuilder("villager_wh_statue"))); + public static final DeferredBlock VINDICATOR_STATUE = registerStatue("vindicator_statue", () -> new VindicatorStatueBlock(blockBuilder("vindicator_statue"))); + public static final DeferredBlock WASTELAND_STATUE = registerStatue("wasteland_statue", () -> new WastelandStatueBlock(blockBuilder("wasteland_statue"))); + public static final DeferredBlock WITCH_STATUE = registerStatue("witch_statue", () -> new WitchStatueBlock(blockBuilder("witch_statue"))); + public static final DeferredBlock ZOMBIE_STATUE = registerStatue("zombie_statue", () -> new ZombieStatueBlock(blockBuilder("zombie_statue"))); + public static final DeferredBlock ALLAY_STATUE = registerStatue("allay_statue", () -> new AllayStatueBlock(blockBuilder("allay_statue"))); + public static final DeferredBlock AXOLOTL_LUCY_STATUE = registerStatue("axolotl_lucy_statue", () -> new AxolotlStatueBlock(blockBuilder("axolotl_lucy_statue"))); + public static final DeferredBlock AXOLOTL_WILD_STATUE = registerStatue("axolotl_wild_statue", () -> new AxolotlStatueBlock(blockBuilder("axolotl_wild_statue"))); + public static final DeferredBlock AXOLOTL_GOLD_STATUE = registerStatue("axolotl_gold_statue", () -> new AxolotlStatueBlock(blockBuilder("axolotl_gold_statue"))); + public static final DeferredBlock AXOLOTL_CYAN_STATUE = registerStatue("axolotl_cyan_statue", () -> new AxolotlStatueBlock(blockBuilder("axolotl_cyan_statue"))); + public static final DeferredBlock AXOLOTL_BLUE_STATUE = registerStatue("axolotl_blue_statue", () -> new AxolotlStatueBlock(blockBuilder("axolotl_blue_statue"))); + public static final DeferredBlock FROG_TEMPERATE_STATUE = registerStatue("frog_temperate_statue", () -> new FrogStatueBlock(blockBuilder("frog_temperate_statue"))); + public static final DeferredBlock FROG_WARM_STATUE = registerStatue("frog_warm_statue", () -> new FrogStatueBlock(blockBuilder("frog_warm_statue"))); + public static final DeferredBlock FROG_COLD_STATUE = registerStatue("frog_cold_statue", () -> new FrogStatueBlock(blockBuilder("frog_cold_statue"))); + public static final DeferredBlock TADPOLE_STATUE = registerStatue("tadpole_statue", () -> new TadpoleStatueBlock(blockBuilder("tadpole_statue"))); + public static final DeferredBlock WARDEN_STATUE = registerStatue("warden_statue", () -> new WardenStatueBlock(blockBuilder("warden_statue"))); - public static final DeferredBlock DISPLAY_STAND = registerBlock("display_stand", () -> new DisplayStandBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock BUMBO_STATUE = registerBlock("bumbo_statue", () -> new BumboStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock PEBBLE = registerBlock("pebble", () -> new PebbleBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock SOMBRERO = registerBlock("sombrero", () -> new SombreroBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock TROPIBEE = registerBlock("tropibee", () -> new TropiBeeStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock EAGLE_RAY = registerBlock("eagle_ray", () -> new EagleRayStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock SLABFISH = registerBlock("slabfish", () -> new SlabFishStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock AZZARO = registerBlock("azzaro", () -> new AzzaroStatueBlock(blockBuilder()), blockItemBuilder()); - public static final DeferredBlock CORE_FLOWER = BLOCKS.register("core_flower", () -> new FlowerBlock( - MobEffects.MOVEMENT_SLOWDOWN, - 5, + public static final DeferredBlock DISPLAY_STAND = registerBlock("display_stand", () -> new DisplayStandBlock(blockBuilder("display_stand"))); + public static final DeferredBlock BUMBO_STATUE = registerBlock("bumbo_statue", () -> new BumboStatueBlock(blockBuilder("bumbo_statue"))); + public static final DeferredBlock PEBBLE = registerBlock("pebble", () -> new PebbleBlock(blockBuilder("pebble"))); + public static final DeferredBlock SOMBRERO = registerBlock("sombrero", () -> new SombreroBlock(blockBuilder("sombrero"))); + public static final DeferredBlock TROPIBEE = registerBlock("tropibee", () -> new TropiBeeStatueBlock(blockBuilder("tropibee"))); + public static final DeferredBlock EAGLE_RAY = registerBlock("eagle_ray", () -> new EagleRayStatueBlock(blockBuilder("eagle_ray"))); + public static final DeferredBlock SLABFISH = registerBlock("slabfish", () -> new SlabFishStatueBlock(blockBuilder("slabfish"))); + public static final DeferredBlock AZZARO = registerBlock("azzaro", () -> new AzzaroStatueBlock(blockBuilder("azzaro"))); + public static final DeferredBlock CORE_FLOWER = BLOCKS.registerBlock("core_flower", (properties) -> new FlowerBlock( + MobEffects.MOVEMENT_SLOWDOWN, 5, properties), BlockBehaviour.Properties.of() - .mapColor(MapColor.PLANT) - .noCollission() - .instabreak() - .sound(SoundType.GRASS) - .offsetType(BlockBehaviour.OffsetType.XZ) - .pushReaction(PushReaction.DESTROY))); + .mapColor(MapColor.PLANT) + .noCollission() + .instabreak() + .sound(SoundType.GRASS) + .offsetType(BlockBehaviour.OffsetType.XZ) + .pushReaction(PushReaction.DESTROY)); public static final DeferredBlock CORE_FLOWER_CROP = BLOCKS.registerBlock("core_flower_crop", CoreFlowerCropBlock::new, BlockBehaviour.Properties.of() .mapColor(MapColor.PLANT) @@ -282,58 +291,58 @@ public class StatueRegistry { .sound(SoundType.CROP) .pushReaction(PushReaction.DESTROY)); - public static final DeferredItem CUP = ITEMS.register("cup", () -> new Item(itemBuilder().food(StatueFoods.CUP))); - public static final DeferredItem MARSHMALLOW = ITEMS.register("marshmallow", () -> new Item(itemBuilder().food(StatueFoods.MARSHMALLOW))); - public static final DeferredItem MARSHMALLOW_CHARRED = ITEMS.register("marshmallow_charred", () -> new StatueCharredMarshmallow(itemBuilder())); - public static final DeferredItem MARSHMALLOW_COOKED = ITEMS.register("marshmallow_cooked", () -> new Item(itemBuilder().food(StatueFoods.COOKED_MARSHMALLOW))); - public static final DeferredItem MARSHMALLOW_GOLDEN = ITEMS.register("marshmallow_golden", () -> new StatueGoldenMarshmallow(itemBuilder())); - public static final DeferredItem NUGGET = ITEMS.register("royal_nugget", () -> new Item(itemBuilder().food(StatueFoods.ROYAL_NUGGET))); - public static final DeferredItem PLAYER_COMPASS = ITEMS.register("player_compass", () -> new PlayerCompassItem(itemBuilder())); - public static final DeferredItem SOUP = ITEMS.register("mooshroom_soup", () -> new StatueMooshroomSoup(itemBuilder())); - public static final DeferredItem STATUE_CORE = ITEMS.register("statue_core", () -> new StatueCoreItem(itemBuilder().jukeboxPlayable(StatueJukeboxSongs.CREDITS))); - public static final DeferredItem TEA = ITEMS.register("tea", () -> new StatueTeaItem(itemBuilder(), StatueFoods.TEA)); - public static final DeferredItem CORE_ARMOR_TRIM_SMITHING_TEMPLATE = ITEMS.register("core_armor_trim_smithing_template", () -> SmithingTemplateItem.createArmorTrimTemplate(StatueTrims.CORE)); - public static final DeferredItem CORE_FLOWER_SEED = ITEMS.register("core_flower_seed", () -> new ItemNameBlockItem(CORE_FLOWER_CROP.get(), itemBuilder())); - public static final DeferredItem CORE_FLOWER_ITEM = ITEMS.register("core_flower", () -> new BlockItem(CORE_FLOWER.get(), itemBuilder())); - public static final DeferredItem STATUE_CORE_POTTERY_SHERD = ITEMS.register("statue_core_pottery_sherd", () -> SmithingTemplateItem.createArmorTrimTemplate(StatueTrims.CORE)); + public static final DeferredItem CUP = ITEMS.registerItem("cup", (properties) -> new Item(properties.food(StatueFoods.CUP)), itemBuilder()); + public static final DeferredItem MARSHMALLOW = ITEMS.registerItem("marshmallow", (properties) -> new Item(properties.food(StatueFoods.MARSHMALLOW)), itemBuilder()); + public static final DeferredItem MARSHMALLOW_CHARRED = ITEMS.registerItem("marshmallow_charred", StatueCharredMarshmallow::new, itemBuilder()); + public static final DeferredItem MARSHMALLOW_COOKED = ITEMS.registerItem("marshmallow_cooked", (properties) -> new Item(properties.food(StatueFoods.COOKED_MARSHMALLOW)), itemBuilder()); + public static final DeferredItem MARSHMALLOW_GOLDEN = ITEMS.registerItem("marshmallow_golden", StatueGoldenMarshmallow::new, itemBuilder()); + public static final DeferredItem NUGGET = ITEMS.registerItem("royal_nugget", (properties) -> new Item(properties.food(StatueFoods.ROYAL_NUGGET)), itemBuilder()); + public static final DeferredItem PLAYER_COMPASS = ITEMS.registerItem("player_compass", PlayerCompassItem::new, itemBuilder()); + public static final DeferredItem SOUP = ITEMS.registerItem("mooshroom_soup", StatueMooshroomSoup::new, itemBuilder()); + public static final DeferredItem STATUE_CORE = ITEMS.registerItem("statue_core", (properties) -> new StatueCoreItem(properties.jukeboxPlayable(StatueJukeboxSongs.CREDITS)), itemBuilder()); + public static final DeferredItem TEA = ITEMS.registerItem("tea", (properties) -> new StatueTeaItem(properties, StatueFoods.TEA), itemBuilder()); + public static final DeferredItem CORE_ARMOR_TRIM_SMITHING_TEMPLATE = ITEMS.registerItem("core_armor_trim_smithing_template", (properties) -> SmithingTemplateItem.createArmorTrimTemplate(properties.rarity(Rarity.RARE)), itemBuilder()); + public static final DeferredItem CORE_FLOWER_SEED = ITEMS.registerSimpleBlockItem("core_flower_seed", CORE_FLOWER_CROP, itemBuilder()); + public static final DeferredItem CORE_FLOWER_ITEM = ITEMS.registerItem("core_flower", (properties) -> new BlockItem(CORE_FLOWER.get(), properties), itemBuilder()); + public static final DeferredItem STATUE_CORE_POTTERY_SHERD = ITEMS.registerItem("statue_core_pottery_sherd", (properties) -> SmithingTemplateItem.createArmorTrimTemplate(properties.rarity(Rarity.RARE)), itemBuilder()); - public static final DeferredItem PLAYER_STATUE_SPAWN_EGG = ITEMS.register("player_statue_spawn_egg", () -> new PlayerStatueSpawnItem(itemBuilder())); - public static final DeferredItem STATUE_BAT_SPANW_EGG = ITEMS.register("statue_bat_spawn_egg", () -> new DeferredSpawnEggItem(StatueRegistry.STATUE_BAT::get, 3421236, 3556687, itemBuilder())); + public static final DeferredItem PLAYER_STATUE_SPAWN_EGG = ITEMS.registerItem("player_statue_spawn_egg", PlayerStatueSpawnItem::new, itemBuilder()); + public static final DeferredItem STATUE_BAT_SPANW_EGG = ITEMS.registerItem("statue_bat_spawn_egg", (properties) -> new SpawnEggItem(StatueRegistry.STATUE_BAT.get(), properties), itemBuilder()); //3421236, 3556687 - public static DeferredBlock registerStatue(String name, Supplier supplier, Item.Properties properties) { + public static DeferredBlock registerStatue(String name, Supplier supplier) { DeferredBlock block = StatueRegistry.BLOCKS.register(name, supplier); - ITEMS.register(name, () -> new StatueBlockItem(block.get(), properties)); + ITEMS.registerItem(name, props -> new StatueBlockItem(block.get(), props)); return block; } - public static DeferredBlock registerBeeStatue(String name, Supplier supplier, Item.Properties properties) { + public static DeferredBlock registerBeeStatue(String name, Supplier supplier) { DeferredBlock block = StatueRegistry.BLOCKS.register(name, supplier); - ITEMS.register(name, () -> new StatueBeeItem(block.get(), properties)); + ITEMS.registerItem(name, props -> new StatueBeeItem(block.get(), props)); return block; } - public static DeferredBlock registerBlock(String name, Supplier supplier, Item.Properties properties) { + public static DeferredBlock registerBlock(String name, Supplier supplier) { DeferredBlock block = StatueRegistry.BLOCKS.register(name, supplier); - ITEMS.register(name, () -> new StatueBlockItem(block.get(), properties)); + ITEMS.registerItem(name, props -> new StatueBlockItem(block.get(), props)); return block; } - public static DeferredBlock registerPlayerStatue(String name, Supplier supplier, Item.Properties properties) { + public static DeferredBlock registerPlayerStatue(String name, Supplier supplier) { DeferredBlock block = StatueRegistry.BLOCKS.register(name, supplier); - ITEMS.register(name, () -> new PlayerStatueBlockItem(block.get(), properties)); + ITEMS.registerItem(name, props -> new PlayerStatueBlockItem(block.get(), props)); return block; } - private static Item.Properties blockItemBuilder() { + private static Item.Properties itemBuilder() { return new Item.Properties(); } - private static Item.Properties itemBuilder() { - return new Item.Properties(); + private static Block.Properties blockBuilder(String path) { + return Block.Properties.of().mapColor(MapColor.COLOR_PURPLE).setId(blockKey(path)); } - private static Block.Properties blockBuilder() { - return Block.Properties.of().mapColor(MapColor.COLOR_PURPLE); + private static ResourceKey blockKey(String path) { + return ResourceKey.create(Registries.BLOCK, Reference.modLoc(path)); } diff --git a/src/main/java/com/shynieke/statues/registry/StatueSounds.java b/src/main/java/com/shynieke/statues/registry/StatueSounds.java index ebff9595..be4f9573 100644 --- a/src/main/java/com/shynieke/statues/registry/StatueSounds.java +++ b/src/main/java/com/shynieke/statues/registry/StatueSounds.java @@ -11,87 +11,87 @@ public class StatueSounds { public static final DeferredRegister SOUND_EVENTS = DeferredRegister.create(Registries.SOUND_EVENT, Reference.MOD_ID); public static final DeferredHolder WASTELAND_HELLO = SOUND_EVENTS.register("wasteland.hello", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "wasteland.hello"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("wasteland.hello"))); public static final DeferredHolder WASTELAND_ONWARDS = SOUND_EVENTS.register("wasteland.onwards", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "wasteland.onwards"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("wasteland.onwards"))); public static final DeferredHolder WASTELAND_TEA = SOUND_EVENTS.register("wasteland.tea", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "wasteland.tea"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("wasteland.tea"))); public static final DeferredHolder CAMPFIRE_HELLO = SOUND_EVENTS.register("campfire.hello", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.hello"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.hello"))); public static final DeferredHolder CAMPFIRE_HELLO_2 = SOUND_EVENTS.register("campfire.hello2", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.hello2"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.hello2"))); public static final DeferredHolder CAMPFIRE_HELLO_3 = SOUND_EVENTS.register("campfire.hello3", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.hello3"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.hello3"))); public static final DeferredHolder CAMPFIRE_HELLO_4 = SOUND_EVENTS.register("campfire.hello4", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.hello4"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.hello4"))); public static final DeferredHolder CAMPFIRE_HELLO_5 = SOUND_EVENTS.register("campfire.hello5", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.hello5"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.hello5"))); public static final DeferredHolder CAMPFIRE_HELLO_6 = SOUND_EVENTS.register("campfire.hello6", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.hello6"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.hello6"))); public static final DeferredHolder CAMPFIRE_HELLO_7 = SOUND_EVENTS.register("campfire.hello7", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.hello7"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.hello7"))); public static final DeferredHolder CAMPFIRE_HELLO_8 = SOUND_EVENTS.register("campfire.hello8", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.hello8"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.hello8"))); public static final DeferredHolder CAMPFIRE_HELLO_9 = SOUND_EVENTS.register("campfire.hello9", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.hello9"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.hello9"))); public static final DeferredHolder CAMPFIRE_HELLO_RANDOM = SOUND_EVENTS.register("campfire.hello.random", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.hello.random"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.hello.random"))); public static final DeferredHolder CAMPFIRE_GREETINGS = SOUND_EVENTS.register("campfire.greetings", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.greetings"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.greetings"))); public static final DeferredHolder CAMPFIRE_GREETINGS_2 = SOUND_EVENTS.register("campfire.greetings2", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.greetings2"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.greetings2"))); public static final DeferredHolder CAMPFIRE_GREETINGS_3 = SOUND_EVENTS.register("campfire.greetings3", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.greetings3"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.greetings3"))); public static final DeferredHolder CAMPFIRE_GREETINGS_RANDOM = SOUND_EVENTS.register("campfire.greetings.random", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.greetings.random"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.greetings.random"))); public static final DeferredHolder CAMPFIRE_BYE = SOUND_EVENTS.register("campfire.bye", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.bye"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.bye"))); public static final DeferredHolder CAMPFIRE_BYE_2 = SOUND_EVENTS.register("campfire.bye2", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.bye2"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.bye2"))); public static final DeferredHolder CAMPFIRE_BYE_RANDOM = SOUND_EVENTS.register("campfire.bye.random", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.bye.random"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.bye.random"))); public static final DeferredHolder CAMPFIRE_COLD = SOUND_EVENTS.register("campfire.cold", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.cold"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.cold"))); public static final DeferredHolder CAMPFIRE_COLD_2 = SOUND_EVENTS.register("campfire.cold2", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.cold2"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.cold2"))); public static final DeferredHolder CAMPFIRE_COLD_3 = SOUND_EVENTS.register("campfire.cold3", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.cold3"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.cold3"))); public static final DeferredHolder CAMPFIRE_COLD_RANDOM = SOUND_EVENTS.register("campfire.cold.random", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.cold.random"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.cold.random"))); public static final DeferredHolder CAMPFIRE_SNACKS = SOUND_EVENTS.register("campfire.snacks", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.snacks"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.snacks"))); public static final DeferredHolder CAMPFIRE_SNACKS_2 = SOUND_EVENTS.register("campfire.snacks2", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.snacks2"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.snacks2"))); public static final DeferredHolder CAMPFIRE_SNACKS_3 = SOUND_EVENTS.register("campfire.snacks3", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.snacks3"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.snacks3"))); public static final DeferredHolder CAMPFIRE_SNACKS_4 = SOUND_EVENTS.register("campfire.snacks4", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.snacks4"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.snacks4"))); public static final DeferredHolder CAMPFIRE_SNACKS_RANDOM = SOUND_EVENTS.register("campfire.snacks.random", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.snacks.random"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.snacks.random"))); public static final DeferredHolder CAMPFIRE_MARSHMALLOW = SOUND_EVENTS.register("campfire.marshmallow", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.marshmallow"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.marshmallow"))); public static final DeferredHolder CAMPFIRE_MARSHMALLOW_2 = SOUND_EVENTS.register("campfire.marshmallow2", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.marshmallow2"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.marshmallow2"))); public static final DeferredHolder CAMPFIRE_MARSHMALLOW_3 = SOUND_EVENTS.register("campfire.marshmallow3", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.marshmallow3"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.marshmallow3"))); public static final DeferredHolder CAMPFIRE_MARSHMALLOW_4 = SOUND_EVENTS.register("campfire.marshmallow4", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.marshmallow4"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.marshmallow4"))); public static final DeferredHolder CAMPFIRE_MARSHMALLOW_5 = SOUND_EVENTS.register("campfire.marshmallow5", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.marshmallow5"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.marshmallow5"))); public static final DeferredHolder CAMPFIRE_MARSHMALLOW_6 = SOUND_EVENTS.register("campfire.marshmallow6", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.marshmallow6"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.marshmallow6"))); public static final DeferredHolder CAMPFIRE_MARSHMALLOW_7 = SOUND_EVENTS.register("campfire.marshmallow7", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.marshmallow7"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.marshmallow7"))); public static final DeferredHolder CAMPFIRE_MARSHMALLOW_8 = SOUND_EVENTS.register("campfire.marshmallow8", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.marshmallow8"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.marshmallow8"))); public static final DeferredHolder CAMPFIRE_MARSHMALLOW_9 = SOUND_EVENTS.register("campfire.marshmallow9", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.marshmallow9"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.marshmallow9"))); public static final DeferredHolder CAMPFIRE_MARSHMALLOW_RANDOM = SOUND_EVENTS.register("campfire.marshmallow.random", () -> - SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "campfire.marshmallow.random"))); + SoundEvent.createVariableRangeEvent(Reference.modLoc("campfire.marshmallow.random"))); } diff --git a/src/main/java/com/shynieke/statues/registry/StatueTags.java b/src/main/java/com/shynieke/statues/registry/StatueTags.java index 702526bb..41fe4935 100644 --- a/src/main/java/com/shynieke/statues/registry/StatueTags.java +++ b/src/main/java/com/shynieke/statues/registry/StatueTags.java @@ -13,18 +13,18 @@ public class StatueTags { public static final TagKey CURIOS_STATUE = ItemTags.create(ResourceLocation.fromNamespaceAndPath("curios", "statue")); - public static final TagKey STATUES_ITEMS = ItemTags.create(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "statues")); - public static final TagKey UPGRADEABLE_STATUES = ItemTags.create(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "statues/upgradeable")); - public static final TagKey LOOTABLE_STATUES = ItemTags.create(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "statues/lootable")); - public static final TagKey STATUE_INTERACTABLE = ItemTags.create(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "statues/interactable")); + public static final TagKey STATUES_ITEMS = ItemTags.create(Reference.modLoc("statues")); + public static final TagKey UPGRADEABLE_STATUES = ItemTags.create(Reference.modLoc("statues/upgradeable")); + public static final TagKey LOOTABLE_STATUES = ItemTags.create(Reference.modLoc("statues/lootable")); + public static final TagKey STATUE_INTERACTABLE = ItemTags.create(Reference.modLoc("statues/interactable")); - public static final TagKey STATUE_BLOCKS = BlockTags.create(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "statues")); - public static final TagKey IS_TROPICAL_FISH = BlockTags.create(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "is_tropical_fish")); + public static final TagKey STATUE_BLOCKS = BlockTags.create(Reference.modLoc("statues")); + public static final TagKey IS_TROPICAL_FISH = BlockTags.create(Reference.modLoc("is_tropical_fish")); - public static final TagKey PLAYER_UPGRADE_ITEM = ItemTags.create(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "player_upgrade_item")); - public static final TagKey STATUE_CORE = ItemTags.create(ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "core")); + public static final TagKey PLAYER_UPGRADE_ITEM = ItemTags.create(Reference.modLoc("player_upgrade_item")); + public static final TagKey STATUE_CORE = ItemTags.create(Reference.modLoc("core")); - public static final TagKey CAN_SPAWN_STATUE_BAT = TagKey.create(Registries.BIOME, ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "can_spawn_statue_bat")); - public static final TagKey CAN_SPAWN_FEWER_STATUE_BAT = TagKey.create(Registries.BIOME, ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "can_spawn_fewer_statue_bat")); + public static final TagKey CAN_SPAWN_STATUE_BAT = TagKey.create(Registries.BIOME, Reference.modLoc("can_spawn_statue_bat")); + public static final TagKey CAN_SPAWN_FEWER_STATUE_BAT = TagKey.create(Registries.BIOME, Reference.modLoc("can_spawn_fewer_statue_bat")); } diff --git a/src/main/java/com/shynieke/statues/registry/StatueTrims.java b/src/main/java/com/shynieke/statues/registry/StatueTrims.java index 28140636..c8d46123 100644 --- a/src/main/java/com/shynieke/statues/registry/StatueTrims.java +++ b/src/main/java/com/shynieke/statues/registry/StatueTrims.java @@ -7,15 +7,14 @@ import net.minecraft.data.worldgen.BootstrapContext; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceKey; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; -import net.minecraft.world.item.armortrim.TrimPattern; +import net.minecraft.world.item.equipment.trim.TrimPattern; public class StatueTrims { public static final ResourceKey CORE = registerKey("core"); private static ResourceKey registerKey(String name) { - return ResourceKey.create(Registries.TRIM_PATTERN, ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, name)); + return ResourceKey.create(Registries.TRIM_PATTERN, Reference.modLoc(name)); } public static void bootstrap(BootstrapContext context) { diff --git a/src/main/java/com/shynieke/statues/util/LootHelper.java b/src/main/java/com/shynieke/statues/util/LootHelper.java index 5c022149..cc144cb6 100644 --- a/src/main/java/com/shynieke/statues/util/LootHelper.java +++ b/src/main/java/com/shynieke/statues/util/LootHelper.java @@ -5,6 +5,7 @@ import net.minecraft.ChatFormatting; import net.minecraft.core.component.DataComponents; import net.minecraft.network.chat.Component; +import net.minecraft.server.level.ServerLevel; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.RecipeHolder; @@ -20,11 +21,11 @@ public static ItemStack getFloodBucket() { return floodBucket; } - public static RecipeHolder getMatchingLoot(Level level, ItemStack stack) { - return level.getRecipeManager().getRecipeFor(StatuesRecipes.LOOT_RECIPE.get(), new SingleRecipeInput(stack), level).orElse(null); + public static RecipeHolder getMatchingLoot(ServerLevel serverLevel, ItemStack stack) { + return serverLevel.recipeAccess().getRecipeFor(StatuesRecipes.LOOT_RECIPE.get(), new SingleRecipeInput(stack), serverLevel).orElse(null); } - public static boolean hasLoot(Level level, ItemStack stack) { - return getMatchingLoot(level, stack) != null; + public static boolean hasLoot(ServerLevel serverLevel, ItemStack stack) { + return getMatchingLoot(serverLevel, stack) != null; } } diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg index 2269c083..c0c8399b 100644 --- a/src/main/resources/META-INF/accesstransformer.cfg +++ b/src/main/resources/META-INF/accesstransformer.cfg @@ -3,4 +3,7 @@ public net.minecraft.client.model.HumanoidModel hat #hat public-f net.minecraft.world.level.block.entity.DecoratedPotPatterns ITEM_TO_POT_TEXTURE -public net.minecraft.server.MinecraftServer services # services \ No newline at end of file +public net.minecraft.server.MinecraftServer services # services + +public net.minecraft.data.recipes.RecipeProvider output # output +public net.minecraft.data.recipes.RecipeProvider items # items \ No newline at end of file diff --git a/src/main/resources/META-INF/neoforge.mods.toml b/src/main/resources/META-INF/neoforge.mods.toml index 06fa1106..185c6980 100644 --- a/src/main/resources/META-INF/neoforge.mods.toml +++ b/src/main/resources/META-INF/neoforge.mods.toml @@ -15,12 +15,12 @@ Just a little functional decoration. [[dependencies.statues]] modId="minecraft" type="REQUIRED" -versionRange="[1.21,1.22)" +versionRange="[1.21.4,1.22)" ordering="NONE" side="BOTH" [[dependencies.statues]] modId="neoforge" type="REQUIRED" -versionRange="[21.0.110-beta,)" +versionRange="[21.4.0-beta,)" ordering="NONE" side="BOTH" \ No newline at end of file diff --git a/src/main/resources/data/statues/recipe/player_statue.json b/src/main/resources/data/statues/recipe/player_statue.json deleted file mode 100644 index 73ca8527..00000000 --- a/src/main/resources/data/statues/recipe/player_statue.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "type": "statues:hardcore_shaped", - "category": "misc", - "pattern": [ - "ECE", - "LZL", - "ELE" - ], - "key": { - "E": { - "item": "minecraft:experience_bottle" - }, - "C": { - "item": "statues:statue_core" - }, - "L": { - "tag": "c:storage_blocks/lapis" - }, - "Z": { - "item": "statues:zombie_statue" - } - }, - "result": { - "id": "statues:player_statue" - }, - "show_notification": true -} \ No newline at end of file