From d0153ea30e5dbbbbfe11e564b3b4fd6751868cf9 Mon Sep 17 00:00:00 2001 From: P3pp3rF1y Date: Mon, 1 Apr 2024 18:46:18 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=201.20.4=20port?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 194 ++- gradle.properties | 32 +- gradle/wrapper/gradle-wrapper.jar | Bin 51106 -> 43462 bytes gradle/wrapper/gradle-wrapper.properties | 5 +- .../tags/blocks/wall_post_override.json | 5 + .../loot_modifiers/global_loot_modifiers.json | 0 .../recipes/misc/alkahestry_altar.json | 7 +- .../recipes/misc/alkahestry_tome.json | 39 + .../recipes/misc/angelheart_vial.json | 7 +- .../recipes/misc/angelic_feather.json | 7 +- .../recipes/misc/aphrodite_potion.json | 39 + .../recipes/misc/apothecary_cauldron.json | 39 + .../recipes/misc/apothecary_mortar.json | 39 + .../recipes/misc/barrel_assembly.json | 39 + .../advancements/recipes/misc/bat_wing.json | 37 + .../recipes/misc/bullets/blaze_bullet.json | 39 + .../recipes/misc/bullets/buster_bullet.json | 39 + .../misc/bullets/concussive_bullet.json | 39 + .../recipes/misc/bullets/ender_bullet.json | 39 + .../recipes/misc/bullets/exorcism_bullet.json | 39 + .../recipes/misc/bullets/neutral_bullet.json | 39 + .../recipes/misc/bullets/sand_bullet.json | 39 + .../recipes/misc/bullets/seeker_bullet.json | 39 + .../recipes/misc/bullets/storm_bullet.json | 39 + .../recipes/misc/catalyzing_gland.json | 37 + .../advancements/recipes/misc/chelicerae.json | 37 + .../recipes/misc/crimson_cloth.json | 7 +- .../recipes/misc/destruction_catalyst.json | 7 +- .../recipes/misc/emperor_chalice.json | 7 +- .../recipes/misc/empty_potion_vial.json | 39 + .../recipes/misc/ender_staff.json | 7 +- .../recipes/misc/eye_of_the_storm.json | 39 + .../recipes/misc/fertile_essence.json | 7 +- .../recipes/misc/fertile_lily_pad.json | 7 +- .../recipes/misc/fertile_potion.json | 39 + .../recipes/misc/fortune_coin.json | 7 +- .../recipes/misc/frozen_core.json | 39 + .../recipes/misc/glacial_staff.json | 7 +- .../recipes/misc/glowing_bread.json | 7 +- .../recipes/misc/glowing_water.json | 7 +- .../misc/glowing_water_from_potion_vial.json | 7 +- .../recipes/misc/gold_nugget.json | 7 +- .../recipes/misc/grip_assembly.json | 39 + .../recipes/misc/guardian_spike.json | 37 + .../recipes/misc/hammer_assembly.json | 39 + .../advancements/recipes/misc/handgun.json | 39 + .../recipes/misc/harvest_rod.json | 7 +- .../recipes/misc/hero_medallion.json | 7 +- .../recipes/misc/holy_hand_grenade.json | 7 +- .../recipes/misc/ice_magus_rod.json | 7 +- .../recipes/misc/infernal_chalice.json | 7 +- .../recipes/misc/infernal_claw.json | 7 +- .../recipes/misc/infernal_claws.json | 7 +- .../recipes/misc/infernal_tear.json | 7 +- .../recipes/misc/interdiction_torch.json | 7 +- .../recipes/misc/kraken_shell.json | 7 +- .../recipes/misc/kraken_shell_fragment.json | 7 +- .../recipes/misc/lantern_of_paranoia.json | 7 +- .../misc/magazines/empty_magazine.json | 39 + .../advancements/recipes/misc/magicbane.json | 7 +- .../recipes/misc/mercy_cross.json | 7 +- .../recipes/misc/midas_touchstone.json | 7 +- .../recipes/misc/mob_charm_belt.json | 7 +- .../misc/mob_charm_fragments/blaze.json | 7 +- .../misc/mob_charm_fragments/cave_spider.json | 7 +- .../misc/mob_charm_fragments/creeper.json | 7 +- .../misc/mob_charm_fragments/enderman.json | 7 +- .../misc/mob_charm_fragments/ghast.json | 7 +- .../misc/mob_charm_fragments/guardian.json | 7 +- .../misc/mob_charm_fragments/magma_cube.json | 7 +- .../misc/mob_charm_fragments/skeleton.json | 7 +- .../misc/mob_charm_fragments/slime.json | 7 +- .../misc/mob_charm_fragments/spider.json | 7 +- .../misc/mob_charm_fragments/witch.json | 7 +- .../mob_charm_fragments/wither_skeleton.json | 7 +- .../misc/mob_charm_fragments/zombie.json | 7 +- .../mob_charm_fragments/zombified_piglin.json | 7 +- .../recipes/misc/molten_core.json | 39 + .../recipes/misc/nebulous_heart.json | 37 + .../misc/pedestals/black_pedestal.json | 39 + .../recipes/misc/pedestals/blue_pedestal.json | 39 + .../misc/pedestals/brown_pedestal.json | 39 + .../recipes/misc/pedestals/cyan_pedestal.json | 39 + .../recipes/misc/pedestals/gray_pedestal.json | 39 + .../misc/pedestals/green_pedestal.json | 39 + .../misc/pedestals/light_blue_pedestal.json | 39 + .../misc/pedestals/light_gray_pedestal.json | 39 + .../recipes/misc/pedestals/lime_pedestal.json | 39 + .../misc/pedestals/magenta_pedestal.json | 39 + .../misc/pedestals/orange_pedestal.json | 39 + .../passive/black_passive_pedestal.json | 39 + .../passive/blue_passive_pedestal.json | 39 + .../passive/brown_passive_pedestal.json | 39 + .../passive/cyan_passive_pedestal.json | 39 + .../passive/gray_passive_pedestal.json | 39 + .../passive/green_passive_pedestal.json | 39 + .../passive/light_blue_passive_pedestal.json | 39 + .../passive/light_gray_passive_pedestal.json | 39 + .../passive/lime_passive_pedestal.json | 39 + .../passive/magenta_passive_pedestal.json | 39 + .../passive/orange_passive_pedestal.json | 39 + .../passive/pink_passive_pedestal.json | 39 + .../passive/purple_passive_pedestal.json | 39 + .../passive/red_passive_pedestal.json | 39 + .../passive/white_passive_pedestal.json | 39 + .../passive/yellow_passive_pedestal.json | 39 + .../recipes/misc/pedestals/pink_pedestal.json | 39 + .../misc/pedestals/purple_pedestal.json | 39 + .../recipes/misc/pedestals/red_pedestal.json | 39 + .../misc/pedestals/white_pedestal.json | 39 + .../misc/pedestals/yellow_pedestal.json | 39 + .../recipes/misc/phoenix_down.json | 7 +- .../recipes/misc/pyromancer_staff.json | 7 +- .../recipes/misc/rending_gale.json | 7 +- .../advancements/recipes/misc/rib_bone.json | 37 + .../recipes/misc/rod_of_lyssa.json | 7 +- .../recipes/misc/salamander_eye.json | 7 +- .../recipes/misc/serpent_staff.json | 7 +- .../recipes/misc/shears_of_winter.json | 7 +- .../recipes/misc/slime_pearl.json | 37 + .../recipes/misc/sojourner_staff.json | 7 +- .../advancements/recipes/misc/squid_beak.json | 39 + .../recipes/misc/twilight_cloak.json | 7 +- .../recipes/misc/uncrafting/blaze_rod.json | 7 +- .../recipes/misc/uncrafting/bone.json | 7 +- .../recipes/misc/uncrafting/ender_pearl.json | 7 +- .../recipes/misc/uncrafting/ghast_tear.json | 7 +- .../recipes/misc/uncrafting/glass_bottle.json | 7 +- .../misc/uncrafting/glowstone_dust.json | 7 +- .../recipes/misc/uncrafting/gold_nugget.json | 7 +- .../uncrafting/gunpowder_creeper_gland.json | 7 +- .../misc/uncrafting/gunpowder_storm_eye.json | 7 +- .../misc/uncrafting/gunpowder_witch_hat.json | 7 +- .../recipes/misc/uncrafting/ink_sac.json | 7 +- .../recipes/misc/uncrafting/magma_cream.json | 7 +- .../recipes/misc/uncrafting/packed_ice.json | 7 +- .../misc/uncrafting/prismarine_crystals.json | 7 +- .../misc/uncrafting/prismarine_shard.json | 7 +- .../recipes/misc/uncrafting/redstone.json | 7 +- .../recipes/misc/uncrafting/rotten_flesh.json | 7 +- .../recipes/misc/uncrafting/slime_ball.json | 7 +- .../recipes/misc/uncrafting/snowball.json | 7 +- .../recipes/misc/uncrafting/spider_eye.json | 7 +- .../recipes/misc/uncrafting/stick.json | 7 +- .../recipes/misc/uncrafting/string.json | 7 +- .../recipes/misc/uncrafting/sugar.json | 7 +- .../uncrafting/wither_skeleton_skull.json | 7 +- .../advancements/recipes/misc/void_tear.json | 7 +- .../recipes/misc/withered_rib.json | 39 + .../recipes/misc/witherless_rose.json | 7 +- .../recipes/misc/wraith_node.json | 7 +- .../recipes/misc/zombie_heart.json | 39 + .../spawn_egg.json} | 16 +- .../chests/abandoned_mineshaft.json | 2 +- .../loot_modifiers/chests/desert_pyramid.json | 2 +- .../chests/end_city_treasure.json | 2 +- .../loot_modifiers/chests/igloo_chest.json | 2 +- .../loot_modifiers/chests/jungle_temple.json | 2 +- .../loot_modifiers/chests/nether_bridge.json | 2 +- .../loot_modifiers/chests/simple_dungeon.json | 2 +- .../chests/stronghold_corridor.json | 2 +- .../chests/stronghold_crossing.json | 2 +- .../chests/stronghold_library.json | 2 +- .../chests/village/village_weaponsmith.json | 2 +- .../loot_modifiers/entities/bat.json | 2 +- .../loot_modifiers/entities/blaze.json | 2 +- .../loot_modifiers/entities/cave_spider.json | 2 +- .../loot_modifiers/entities/creeper.json | 2 +- .../loot_modifiers/entities/enderman.json | 2 +- .../loot_modifiers/entities/ghast.json | 2 +- .../loot_modifiers/entities/guardian.json | 2 +- .../loot_modifiers/entities/husk.json | 2 +- .../loot_modifiers/entities/magma_cube.json | 2 +- .../loot_modifiers/entities/skeleton.json | 2 +- .../loot_modifiers/entities/slime.json | 2 +- .../loot_modifiers/entities/snow_golem.json | 2 +- .../loot_modifiers/entities/spider.json | 2 +- .../loot_modifiers/entities/squid.json | 2 +- .../loot_modifiers/entities/stray.json | 2 +- .../loot_modifiers/entities/witch.json | 2 +- .../entities/wither_skeleton.json | 2 +- .../loot_modifiers/entities/zombie.json | 2 +- .../entities/zombie_villager.json | 2 +- .../entities/zombified_piglin.json | 2 +- .../alkahestry/charging/glowstone.json | 23 +- .../alkahestry/charging/glowstone_dust.json | 23 +- .../recipes/alkahestry/charging/redstone.json | 23 +- .../alkahestry/charging/redstone_block.json | 23 +- .../recipes/alkahestry/crafting/charcoal.json | 25 +- .../recipes/alkahestry/crafting/clay.json | 25 +- .../alkahestry/crafting/copper_ingot.json | 37 +- .../recipes/alkahestry/crafting/diamond.json | 25 +- .../recipes/alkahestry/crafting/dirt.json | 25 +- .../recipes/alkahestry/crafting/emerald.json | 25 +- .../alkahestry/crafting/end_stone.json | 25 +- .../recipes/alkahestry/crafting/flint.json | 25 +- .../alkahestry/crafting/gold_ingot.json | 25 +- .../recipes/alkahestry/crafting/gravel.json | 25 +- .../alkahestry/crafting/gunpowder.json | 25 +- .../alkahestry/crafting/iron_ingot.json | 25 +- .../alkahestry/crafting/lapis_lazuli.json | 25 +- .../alkahestry/crafting/nether_star.json | 25 +- .../alkahestry/crafting/netherrack.json | 25 +- .../recipes/alkahestry/crafting/obsidian.json | 25 +- .../recipes/alkahestry/crafting/sand.json | 25 +- .../alkahestry/crafting/sandstone.json | 25 +- .../alkahestry/crafting/silver_ingot.json | 37 +- .../alkahestry/crafting/soul_sand.json | 25 +- .../alkahestry/crafting/steel_ingot.json | 37 +- .../alkahestry/crafting/tin_ingot.json | 37 +- .../recipes/alkahestry/drain/redstone.json | 24 +- .../reliquary/recipes/alkahestry_tome.json | 83 +- .../reliquary/recipes/angelheart_vial.json | 3 +- .../reliquary/recipes/aphrodite_potion.json | 68 +- .../recipes/apothecary_cauldron.json | 68 +- .../reliquary/recipes/apothecary_mortar.json | 50 +- .../reliquary/recipes/barrel_assembly.json | 56 +- .../data/reliquary/recipes/bat_wing.json | 50 +- .../recipes/bullets/blaze_bullet.json | 53 +- .../recipes/bullets/blaze_bullet_potion.json | 59 +- .../recipes/bullets/buster_bullet.json | 85 +- .../recipes/bullets/buster_bullet_potion.json | 56 +- .../recipes/bullets/concussive_bullet.json | 53 +- .../bullets/concussive_bullet_potion.json | 56 +- .../recipes/bullets/ender_bullet.json | 85 +- .../recipes/bullets/ender_bullet_potion.json | 56 +- .../recipes/bullets/exorcism_bullet.json | 85 +- .../bullets/exorcism_bullet_potion.json | 56 +- .../recipes/bullets/neutral_bullet.json | 53 +- .../bullets/neutral_bullet_potion.json | 59 +- .../recipes/bullets/sand_bullet.json | 53 +- .../recipes/bullets/sand_bullet_potion.json | 56 +- .../recipes/bullets/seeker_bullet.json | 53 +- .../recipes/bullets/seeker_bullet_potion.json | 59 +- .../recipes/bullets/storm_bullet.json | 59 +- .../recipes/bullets/storm_bullet_potion.json | 56 +- .../reliquary/recipes/catalyzing_gland.json | 50 +- .../data/reliquary/recipes/chelicerae.json | 50 +- .../reliquary/recipes/emperor_chalice.json | 7 +- .../reliquary/recipes/empty_potion_vial.json | 44 +- .../data/reliquary/recipes/ender_staff.json | 10 +- .../reliquary/recipes/eye_of_the_storm.json | 50 +- .../reliquary/recipes/fertile_potion.json | 68 +- .../data/reliquary/recipes/frozen_core.json | 56 +- .../data/reliquary/recipes/glacial_staff.json | 7 +- .../data/reliquary/recipes/glowing_water.json | 3 +- .../data/reliquary/recipes/grip_assembly.json | 56 +- .../reliquary/recipes/guardian_spike.json | 50 +- .../reliquary/recipes/hammer_assembly.json | 62 +- .../data/reliquary/recipes/handgun.json | 68 +- .../data/reliquary/recipes/harvest_rod.json | 10 +- .../data/reliquary/recipes/ice_magus_rod.json | 10 +- .../data/reliquary/recipes/infernal_tear.json | 7 +- .../recipes/lantern_of_paranoia.json | 3 +- .../recipes/magazines/blaze_magazine.json | 54 +- .../recipes/magazines/buster_magazine.json | 54 +- .../magazines/concussive_magazine.json | 54 +- .../recipes/magazines/empty_magazine.json | 56 +- .../recipes/magazines/ender_magazine.json | 54 +- .../recipes/magazines/exorcism_magazine.json | 54 +- .../recipes/magazines/neutral_magazine.json | 54 +- .../recipes/magazines/sand_magazine.json | 54 +- .../recipes/magazines/seeker_magazine.json | 54 +- .../recipes/magazines/storm_magazine.json | 54 +- .../data/reliquary/recipes/magicbane.json | 3 +- .../data/reliquary/recipes/mercy_cross.json | 3 +- .../reliquary/recipes/midas_touchstone.json | 7 +- .../data/reliquary/recipes/mob_charm.json | 35 +- .../reliquary/recipes/mob_charm_belt.json | 3 +- .../recipes/mob_charm_fragments/blaze.json | 1 + .../mob_charm_fragments/cave_spider.json | 7 +- .../recipes/mob_charm_fragments/creeper.json | 1 + .../recipes/mob_charm_fragments/enderman.json | 1 + .../recipes/mob_charm_fragments/ghast.json | 1 + .../recipes/mob_charm_fragments/guardian.json | 1 + .../mob_charm_fragments/magma_cube.json | 1 + .../recipes/mob_charm_fragments/skeleton.json | 1 + .../recipes/mob_charm_fragments/slime.json | 1 + .../recipes/mob_charm_fragments/spider.json | 1 + .../recipes/mob_charm_fragments/witch.json | 1 + .../mob_charm_fragments/wither_skeleton.json | 1 + .../recipes/mob_charm_fragments/zombie.json | 1 + .../mob_charm_fragments/zombified_piglin.json | 1 + .../data/reliquary/recipes/molten_core.json | 50 +- .../reliquary/recipes/nebulous_heart.json | 50 +- .../recipes/pedestals/black_pedestal.json | 50 +- .../recipes/pedestals/blue_pedestal.json | 50 +- .../recipes/pedestals/brown_pedestal.json | 50 +- .../recipes/pedestals/cyan_pedestal.json | 50 +- .../recipes/pedestals/gray_pedestal.json | 50 +- .../recipes/pedestals/green_pedestal.json | 50 +- .../pedestals/light_blue_pedestal.json | 50 +- .../pedestals/light_gray_pedestal.json | 50 +- .../recipes/pedestals/lime_pedestal.json | 50 +- .../recipes/pedestals/magenta_pedestal.json | 50 +- .../recipes/pedestals/orange_pedestal.json | 50 +- .../passive/black_passive_pedestal.json | 62 +- .../passive/blue_passive_pedestal.json | 62 +- .../passive/brown_passive_pedestal.json | 62 +- .../passive/cyan_passive_pedestal.json | 62 +- .../passive/gray_passive_pedestal.json | 62 +- .../passive/green_passive_pedestal.json | 62 +- .../passive/light_blue_passive_pedestal.json | 62 +- .../passive/light_gray_passive_pedestal.json | 62 +- .../passive/lime_passive_pedestal.json | 62 +- .../passive/magenta_passive_pedestal.json | 62 +- .../passive/orange_passive_pedestal.json | 62 +- .../passive/pink_passive_pedestal.json | 62 +- .../passive/purple_passive_pedestal.json | 62 +- .../passive/red_passive_pedestal.json | 62 +- .../passive/white_passive_pedestal.json | 62 +- .../passive/yellow_passive_pedestal.json | 62 +- .../recipes/pedestals/pink_pedestal.json | 50 +- .../recipes/pedestals/purple_pedestal.json | 50 +- .../recipes/pedestals/red_pedestal.json | 50 +- .../recipes/pedestals/white_pedestal.json | 50 +- .../recipes/pedestals/yellow_pedestal.json | 50 +- .../data/reliquary/recipes/rending_gale.json | 10 +- .../data/reliquary/recipes/rib_bone.json | 50 +- .../data/reliquary/recipes/serpent_staff.json | 3 +- .../data/reliquary/recipes/slime_pearl.json | 50 +- .../reliquary/recipes/sojourner_staff.json | 7 +- .../data/reliquary/recipes/squid_beak.json | 50 +- .../data/reliquary/recipes/tipped_arrow.json | 59 +- .../reliquary/recipes/twilight_cloak.json | 3 +- .../recipes/uncrafting/glass_bottle.json | 3 +- .../recipes/uncrafting/glowstone_dust.json | 3 +- .../uncrafting/gunpowder_witch_hat.json | 3 +- .../recipes/uncrafting/packed_ice.json | 3 +- .../recipes/uncrafting/redstone.json | 3 +- .../recipes/uncrafting/spawn_egg.json | 44 +- .../reliquary/recipes/uncrafting/sugar.json | 3 +- .../data/reliquary/recipes/withered_rib.json | 50 +- .../reliquary/recipes/witherless_rose.json | 3 +- .../data/reliquary/recipes/zombie_heart.json | 50 +- src/main/java/reliquary/Reliquary.java | 52 +- src/main/java/reliquary/api/IPedestal.java | 6 +- .../blocks/AlkahestryAltarBlock.java | 4 +- .../blocks/ApothecaryCauldronBlock.java | 4 +- .../blocks/ApothecaryMortarBlock.java | 10 +- .../reliquary/blocks/FertileLilyPadBlock.java | 40 +- .../blocks/InterdictionTorchBlock.java | 24 +- .../blocks/PassivePedestalBlock.java | 47 +- .../java/reliquary/blocks/PedestalBlock.java | 9 +- .../tile/AlkahestryAltarBlockEntity.java | 10 +- .../tile/ApothecaryCauldronBlockEntity.java | 40 +- .../tile/ApothecaryMortarBlockEntity.java | 18 +- .../tile/PassivePedestalBlockEntity.java | 24 +- .../blocks/tile/PedestalBlockEntity.java | 81 +- .../blocks/tile/PedestalFluidHandler.java | 17 +- .../java/reliquary/client/gui/GuiBase.java | 2 +- .../reliquary/client/gui/MobCharmBeltGui.java | 39 +- .../reliquary/client/gui/hud/CharmPane.java | 6 +- .../reliquary/client/init/ItemModels.java | 2 +- .../reliquary/client/init/ModBlockColors.java | 2 +- .../reliquary/client/init/ModItemColors.java | 19 +- .../reliquary/client/init/ModParticles.java | 17 +- .../reliquary/client/model/VoidTearModel.java | 2 +- .../particle/CauldronBubbleParticle.java | 10 +- .../particle/CauldronSteamParticle.java | 10 +- .../client/particle/ColorParticleData.java | 7 +- .../client/render/PedestalRenderer.java | 10 + .../reliquary/client/render/ShotRenderer.java | 3 - .../compat/botania/BotaniaCompat.java | 5 + .../curios/CuriosBaubleItemWrapper.java | 11 +- .../curios/CuriosCharmInventoryHandler.java | 6 +- .../reliquary/compat/curios/CuriosCompat.java | 91 +- .../compat/curios/CuriosCompatClient.java | 20 + .../curios/CuriosFortuneCoinToggler.java | 11 +- .../jade/provider/CachedBodyDataProvider.java | 4 +- .../jade/provider/DataProviderAltar.java | 6 +- .../jade/provider/DataProviderCauldron.java | 25 +- .../jade/provider/DataProviderMortar.java | 5 +- .../compat/jei/ItemDescriptionBuilder.java | 7 +- .../compat/jei/MobCharmRecipeMaker.java | 15 +- .../reliquary/compat/jei/ReliquaryPlugin.java | 47 +- .../compat/jei/SpawnEggRecipeMaker.java | 11 +- .../AlkahestryCraftingRecipeCategory.java | 3 +- .../InfernalTearRecipeCategory.java | 2 +- .../infernaltear/InfernalTearRecipeMaker.java | 11 +- .../jei/lingering/ArrowShotRecipeMaker.java | 15 +- .../jei/magazines/MagazineRecipeMaker.java | 30 +- .../compat/tconstruct/TConstructCompat.java | 8 +- .../crafting/AlkahestryChargingRecipe.java | 42 +- .../crafting/AlkahestryCraftingRecipe.java | 46 +- .../crafting/AlkahestryDrainRecipe.java | 39 +- .../crafting/AlkahestryRecipeRegistry.java | 2 +- .../crafting/FragmentRecipeHelper.java | 8 +- .../crafting/FragmentToSpawnEggRecipe.java | 18 +- .../reliquary/crafting/MobCharmRecipe.java | 18 +- .../crafting/MobCharmRecipeBuilder.java | 154 +- .../crafting/MobCharmRepairRecipe.java | 11 +- .../crafting/NbtShapedRecipeBuilder.java | 4 +- .../crafting/PotionEffectsRecipe.java | 77 +- .../crafting/PotionEffectsRecipeBuilder.java | 137 +- .../crafting/SpawnEggRecipeBuilder.java | 97 +- .../alkahestry/ChargingRecipeBuilder.java | 59 +- .../alkahestry/CraftingRecipeBuilder.java | 77 +- .../alkahestry/DrainRecipeBuilder.java | 62 +- .../AlkahestryEnabledCondition.java | 25 +- .../conditions/HandgunEnabledCondition.java | 25 +- .../MobDropsCraftableCondition.java | 20 +- .../PassivePedestalEnabledCondition.java | 20 +- .../conditions/PedestalEnabledCondition.java | 20 +- .../conditions/PotionsEnabledCondition.java | 20 +- .../conditions/SimpleConditionSerializer.java | 33 - .../conditions/SpawnEggEnabledCondition.java | 20 +- .../reliquary/data/BlockLootSubProvider.java | 6 +- .../java/reliquary/data/BlockTagProvider.java | 11 +- .../data/ChestLootEnabledCondition.java | 22 +- .../java/reliquary/data/DataGenerators.java | 2 +- .../data/EntityLootEnabledCondition.java | 23 +- .../java/reliquary/data/ItemTagProvider.java | 2 +- .../reliquary/data/ModFluidTagsProvider.java | 2 +- .../reliquary/data/ModRecipeProvider.java | 1307 ++++++++--------- .../RandomChanceLootingSeveringCondition.java | 35 +- .../data/ReliquaryLootModifierProvider.java | 8 +- .../entities/ConcussiveExplosion.java | 24 +- .../entities/EnderStaffProjectileEntity.java | 22 +- .../entities/EntityXRFakePlayer.java | 2 +- .../entities/GlowingWaterEntity.java | 26 +- .../entities/HolyHandGrenadeEntity.java | 14 - .../reliquary/entities/KrakenSlimeEntity.java | 9 - .../java/reliquary/entities/LyssaHook.java | 59 +- .../entities/SpecialSnowballEntity.java | 20 +- .../entities/XRTippedArrowEntity.java | 21 +- .../entities/potion/ThrownPotionEntity.java | 19 +- .../entities/potion/ThrownXRPotionEntity.java | 23 +- .../entities/shot/ShotEntityBase.java | 44 +- .../reliquary/handler/ClientEventHandler.java | 139 +- .../reliquary/handler/CommonEventHandler.java | 21 +- .../handler/IPlayerDeathHandler.java | 2 +- .../reliquary/handler/IPlayerHurtHandler.java | 2 +- src/main/java/reliquary/init/ModBlocks.java | 97 +- .../java/reliquary/init/ModCapabilities.java | 22 - src/main/java/reliquary/init/ModCompat.java | 43 +- .../java/reliquary/init/ModEnchantments.java | 18 +- src/main/java/reliquary/init/ModEntities.java | 68 +- src/main/java/reliquary/init/ModFluids.java | 35 +- src/main/java/reliquary/init/ModItems.java | 393 +++-- .../java/reliquary/init/ModItemsClient.java | 12 + src/main/java/reliquary/init/ModPotions.java | 17 +- src/main/java/reliquary/init/ModSounds.java | 20 +- .../reliquary/items/AlkahestryTomeItem.java | 12 +- .../reliquary/items/AngelheartVialItem.java | 17 +- .../reliquary/items/AngelicFeatherItem.java | 8 +- .../reliquary/items/AphroditePotionItem.java | 4 +- src/main/java/reliquary/items/BulletItem.java | 9 +- .../items/DestructionCatalystItem.java | 23 +- .../reliquary/items/ElsewhereFlaskItem.java | 5 +- .../reliquary/items/EmperorChaliceItem.java | 46 +- .../java/reliquary/items/EnderStaffItem.java | 179 ++- .../reliquary/items/FertilePotionItem.java | 4 +- .../java/reliquary/items/FortuneCoinItem.java | 12 +- .../reliquary/items/FortuneCoinToggler.java | 16 +- .../reliquary/items/GlacialStaffItem.java | 3 - .../reliquary/items/GlowingWaterItem.java | 3 - .../java/reliquary/items/HandgunItem.java | 29 +- .../java/reliquary/items/HarvestRodItem.java | 209 +-- .../reliquary/items/HeroMedallionItem.java | 30 +- .../reliquary/items/HolyHandGrenadeItem.java | 3 - .../java/reliquary/items/IceMagusRodItem.java | 11 +- .../reliquary/items/InfernalChaliceItem.java | 39 +- .../reliquary/items/InfernalClawsItem.java | 9 +- .../reliquary/items/InfernalTearItem.java | 18 +- src/main/java/reliquary/items/ItemBase.java | 4 - .../java/reliquary/items/KrakenShellItem.java | 9 +- .../items/LanternOfParanoiaItem.java | 17 +- .../java/reliquary/items/MagicbaneItem.java | 9 +- .../java/reliquary/items/MercyCrossItem.java | 21 +- .../reliquary/items/MidasTouchstoneItem.java | 47 +- .../reliquary/items/MobCharmBeltItem.java | 7 +- .../reliquary/items/MobCharmDefinition.java | 26 +- .../reliquary/items/MobCharmFragmentItem.java | 12 +- .../java/reliquary/items/MobCharmItem.java | 75 +- .../reliquary/items/MobCharmRegistry.java | 21 +- .../java/reliquary/items/MobDropItem.java | 4 +- .../java/reliquary/items/PhoenixDownItem.java | 23 +- .../reliquary/items/PotionEssenceItem.java | 7 +- .../java/reliquary/items/PotionItemBase.java | 7 +- .../reliquary/items/PyromancerStaffItem.java | 21 +- .../java/reliquary/items/RendingGaleItem.java | 106 +- .../java/reliquary/items/RodOfLyssaItem.java | 5 +- .../reliquary/items/SalamanderEyeItem.java | 3 - .../reliquary/items/SerpentStaffItem.java | 3 - .../reliquary/items/ShearsOfWinterItem.java | 17 +- .../reliquary/items/SojournerStaffItem.java | 36 +- .../java/reliquary/items/TippedArrowItem.java | 6 +- .../java/reliquary/items/ToggleableItem.java | 9 +- .../reliquary/items/TwilightCloakItem.java | 18 +- .../java/reliquary/items/VoidTearItem.java | 185 +-- .../java/reliquary/items/WitchHatItem.java | 2 +- .../reliquary/items/WitherlessRoseItem.java | 17 +- .../reliquary/items/block/BlockItemBase.java | 3 - .../util/FilteredItemHandlerProvider.java | 34 - .../items/util/FilteredItemStack.java | 6 +- .../items/util/FilteredItemStackHandler.java | 18 +- .../reliquary/items/util/HarvestRodCache.java | 22 +- .../util/HarvestRodItemStackHandler.java | 10 +- .../items/util/IHarvestRodCache.java | 21 - .../items/util/VoidTearItemStackHandler.java | 8 +- .../fluid/FluidHandlerEmperorChalice.java | 20 +- .../util/fluid/FluidHandlerHeroMedallion.java | 18 +- .../fluid/FluidHandlerInfernalChalice.java | 8 +- ...va => FortuneCoinTogglePressedPacket.java} | 60 +- .../network/MobCharmDamagePacket.java | 43 + .../network/PacketFXConcussiveExplosion.java | 50 - .../network/PacketFXThrownPotionImpact.java | 73 - .../java/reliquary/network/PacketHandler.java | 52 +- .../network/PacketMobCharmDamage.java | 42 - .../network/PacketPedestalFishHook.java | 63 - .../network/PedestalFishHookPacket.java | 64 + .../reliquary/network/ScrolledItemPacket.java | 40 +- .../SpawnAngelheartVialParticlesPacket.java | 38 +- ...awnConcussiveExplosionParticlesPacket.java | 47 + .../SpawnPhoenixDownParticlesPacket.java | 40 +- ...pawnThrownPotionImpactParticlesPacket.java | 78 + .../reliquary/pedestal/PedestalRegistry.java | 9 +- .../wrappers/PedestalBucketWrapper.java | 22 +- .../wrappers/PedestalFishingRodWrapper.java | 48 +- .../wrappers/PedestalHarvestRodWrapper.java | 30 +- .../wrappers/PedestalMeleeWeaponWrapper.java | 8 +- .../wrappers/PedestalRedstoneWrapper.java | 6 +- .../wrappers/PedestalRendingGaleWrapper.java | 8 +- .../wrappers/PedestalShearsWrapper.java | 18 +- .../java/reliquary/potions/CurePotion.java | 22 +- .../java/reliquary/potions/FlightPotion.java | 28 +- .../reliquary/potions/PacificationPotion.java | 2 +- .../reliquary/reference/ClientReference.java | 11 - .../reference/{Settings.java => Config.java} | 188 +-- .../java/reliquary/reference/Reference.java | 1 + .../reliquary/util/CombinedItemHandler.java | 4 +- .../java/reliquary/util/InventoryHelper.java | 99 +- .../java/reliquary/util/RegistryHelper.java | 21 +- src/main/java/reliquary/util/StackHelper.java | 20 - .../java/reliquary/util/TooltipBuilder.java | 68 +- .../util/potions/PotionIngredient.java | 4 +- .../reliquary/util/potions/PotionMap.java | 45 +- .../util/potions/XRPotionHelper.java | 15 +- .../resources/META-INF/accesstransformer.cfg | 25 +- src/main/resources/META-INF/mods.toml | 88 +- .../assets/reliquary/lang/en_us.json | 2 +- .../reliquary/curios/entities/entities.json | 10 + .../util/FilteredItemStackHandlerTest.java | 2 +- 544 files changed, 8379 insertions(+), 8260 deletions(-) create mode 100644 src/generated/resources/data/minecraft/tags/blocks/wall_post_override.json rename src/generated/resources/data/{forge => neoforge}/loot_modifiers/global_loot_modifiers.json (100%) create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/alkahestry_tome.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/aphrodite_potion.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/apothecary_cauldron.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/apothecary_mortar.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/barrel_assembly.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/bat_wing.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/blaze_bullet.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/buster_bullet.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/concussive_bullet.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/ender_bullet.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/exorcism_bullet.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/neutral_bullet.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/sand_bullet.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/seeker_bullet.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/storm_bullet.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/catalyzing_gland.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/chelicerae.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/empty_potion_vial.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/eye_of_the_storm.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/fertile_potion.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/frozen_core.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/grip_assembly.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/guardian_spike.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/hammer_assembly.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/handgun.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/magazines/empty_magazine.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/molten_core.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/nebulous_heart.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/black_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/blue_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/brown_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/cyan_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/gray_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/green_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/light_blue_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/light_gray_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/lime_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/magenta_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/orange_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/black_passive_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/blue_passive_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/brown_passive_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/cyan_passive_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/gray_passive_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/green_passive_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/light_blue_passive_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/light_gray_passive_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/lime_passive_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/magenta_passive_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/orange_passive_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/pink_passive_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/purple_passive_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/red_passive_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/white_passive_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/yellow_passive_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/pink_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/purple_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/red_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/white_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/yellow_pedestal.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/rib_bone.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/slime_pearl.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/squid_beak.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/withered_rib.json create mode 100644 src/generated/resources/data/reliquary/advancements/recipes/misc/zombie_heart.json rename src/generated/resources/data/reliquary/advancements/recipes/{mob_charm.json => uncrafting/spawn_egg.json} (67%) create mode 100644 src/main/java/reliquary/compat/curios/CuriosCompatClient.java delete mode 100644 src/main/java/reliquary/crafting/conditions/SimpleConditionSerializer.java delete mode 100644 src/main/java/reliquary/init/ModCapabilities.java create mode 100644 src/main/java/reliquary/init/ModItemsClient.java delete mode 100644 src/main/java/reliquary/items/util/FilteredItemHandlerProvider.java delete mode 100644 src/main/java/reliquary/items/util/IHarvestRodCache.java rename src/main/java/reliquary/network/{PacketFortuneCoinTogglePressed.java => FortuneCoinTogglePressedPacket.java} (54%) create mode 100644 src/main/java/reliquary/network/MobCharmDamagePacket.java delete mode 100644 src/main/java/reliquary/network/PacketFXConcussiveExplosion.java delete mode 100644 src/main/java/reliquary/network/PacketFXThrownPotionImpact.java delete mode 100644 src/main/java/reliquary/network/PacketMobCharmDamage.java delete mode 100644 src/main/java/reliquary/network/PacketPedestalFishHook.java create mode 100644 src/main/java/reliquary/network/PedestalFishHookPacket.java create mode 100644 src/main/java/reliquary/network/SpawnConcussiveExplosionParticlesPacket.java create mode 100644 src/main/java/reliquary/network/SpawnThrownPotionImpactParticlesPacket.java rename src/main/java/reliquary/reference/{Settings.java => Config.java} (91%) delete mode 100644 src/main/java/reliquary/util/StackHelper.java create mode 100644 src/main/resources/data/reliquary/curios/entities/entities.json diff --git a/build.gradle b/build.gradle index 912d35da..0ef76190 100755 --- a/build.gradle +++ b/build.gradle @@ -1,29 +1,25 @@ -buildscript { - repositories { - maven { - name = "forge" - url = "https://maven.minecraftforge.net" - } - maven { url = 'https://maven.parchmentmc.org' } - mavenCentral() - } - dependencies { - classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true - classpath group: 'org.parchmentmc', name: 'librarian', version: '1.+', changing: true - } -} - plugins { + id 'java-library' + id 'idea' + id 'maven-publish' + id 'net.neoforged.gradle.userdev' version '7.0.101' id "org.sonarqube" version "3.3" - id "maven-publish" } -apply plugin: 'net.minecraftforge.gradle' -apply plugin: 'org.parchmentmc.librarian.forgegradle' -apply plugin: 'idea' +idea { + module { + downloadJavadoc = true + downloadSources = true + } +} + +apply from: 'https://gist.githubusercontent.com/Technici4n/facbcdf18ce1a556b76e6027180c32ce/raw/059ab3d504a590461746fc6e3065159f4932a960/classremapper.gradle' + +version = "${project.minecraft_version}-${project.mod_version}.${getBuildNumber()}${getStable()}" +group = mod_group_id repositories { - mavenCentral() + mavenLocal() maven { url "https://dvs1.progwml6.com/files/maven" } maven { url "https://maven.latmod.com/" } maven { url "https://maven.thiakil.com" } @@ -37,67 +33,49 @@ repositories { } } -group = 'reliquary' -version = "${project.minecraft_version}-${project.mod_version}.${getBuildNumber()}${getStable()}" -archivesBaseName = 'reliquary' +base { + archivesName = mod_id +} -sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '17' +java.toolchain.languageVersion = JavaLanguageVersion.of(17) minecraft { - mappings channel: 'parchment', version: "$parchment_version" - accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') - runs { - client { - properties 'forge.logging.markers': 'SCAN,REGISTRIES,REGISTRYDUMP' - properties 'forge.logging.console.level': 'debug' - property 'mixin.env.disableRefMap', 'true' - jvmArg '-XX:+AllowEnhancedClassRedefinition' - jvmArg '-XX:HotswapAgent=fatjar' - workingDirectory project.file('run') - mods { - reliquary { - source sourceSets.main - } - } - } - server { - properties 'forge.logging.markers': 'SCAN,REGISTRIES,REGISTRYDUMP' - properties 'forge.logging.console.level': 'debug' - property 'mixin.env.disableRefMap', 'true' - jvmArg '-XX:+AllowEnhancedClassRedefinition' - jvmArg '-XX:HotswapAgent=fatjar' - workingDirectory project.file('run') - mods { - reliquary { - source sourceSets.main - } - } - } - data { - properties 'forge.logging.markers': 'REGISTRIES,REGISTRYDUMP' - properties 'forge.logging.console.level': 'debug' - property 'mixin.env.disableRefMap', 'true' - properties 'fml.earlyprogresswindow': 'false' - workingDirectory project.file('run') - mods { - reliquary { - source sourceSets.main - } - } - args '--mod', 'reliquary', '--all', '--output', file('src/generated/resources/') - } + accessTransformers { + file('src/main/resources/META-INF/accesstransformer.cfg') + //entry('public net.minecraft.world.item.crafting.ShapelessRecipe result #result') } } -sourceSets.main.resources { - srcDir 'src/generated/resources' +runs { + configureEach { + systemProperty 'forge.logging.markers', 'REGISTRIES' + systemProperty 'forge.logging.console.level', 'debug' + systemProperty 'mixin.env.disableRefMap', 'true' + modSource project.sourceSets.main + } + + client { + systemProperty 'forge.enabledGameTestNamespaces', project.mod_id + } + + server { + systemProperty 'forge.enabledGameTestNamespaces', project.mod_id + programArgument '--nogui' + } + + data { + programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath() + } } +sourceSets.main.resources { srcDir 'src/generated/resources' } + + dependencies { - minecraft "net.minecraftforge:forge:${project.minecraft_version}-${project.forge_version}" + implementation "net.neoforged:neoforge:${neo_version}" - compileOnly fg.deobf("mezz.jei:jei-${jei_mc_version}:${jei_version}") - runtimeOnly fg.deobf("mezz.jei:jei-${jei_mc_version}:${jei_version}") + compileOnly "mezz.jei:jei-${jei_mc_version}:${jei_version}" + runtimeOnly "mezz.jei:jei-${jei_mc_version}:${jei_version}" //compileOnly fg.deobf("vazkii.botania:Botania:${botania_version}:api") //runtimeOnly fg.deobf("vazkii.botania:Botania:${botania_version}") //compileOnly fg.deobf("vazkii.patchouli:Patchouli:${patchouli_version}:api") @@ -106,47 +84,60 @@ dependencies { //deobfCompile "jeresources:JustEnoughResources-${minecraft_version}:${jer_version}" //deobfCompile "slimeknights.mantle:Mantle:${mantle_version}" //deobfCompile "slimeknights:TConstruct:${tconstruct_version}" - compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}:api") - runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}") - compileOnly fg.deobf("curse.maven:jade-324717:${jade_cf_file_id}") - runtimeOnly fg.deobf("curse.maven:jade-324717:${jade_cf_file_id}") - runtimeOnly fg.deobf("curse.maven:twilightforest-227639:4337394") - -// compileOnly fg.deobf("curse.maven:tinkers-74072:3576393") -// runtimeOnly fg.deobf("curse.maven:tinkers-74072:3576393") -// compileOnly fg.deobf("curse.maven:mantle-74924:3576386") -// runtimeOnly fg.deobf("curse.maven:mantle-74924:3576386") + compileOnly "top.theillusivec4.curios:curios-neoforge:${curios_version}:api" + runtimeOnly "top.theillusivec4.curios:curios-neoforge:${curios_version}" + compileOnly "curse.maven:jade-324717:${jade_cf_file_id}" + runtimeOnly "curse.maven:jade-324717:${jade_cf_file_id}" + runtimeOnly "curse.maven:twilightforest-227639:5182539" } -task generateSources(type: Copy) { - from 'src/replaceme/java' - into "$buildDir/generated-src" - filter { line -> line.replaceAll('@MOD_VERSION@', '${project.version}') } +tasks.withType(ProcessResources).configureEach { + var replaceProperties = [ + minecraft_version : minecraft_version, minecraft_version_range: minecraft_version_range, + neo_version : neo_version, neo_version_range: neo_version_range, + loader_version_range: loader_version_range, + mod_id : mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version, + mod_issue_tracker_url: mod_issue_tracker_url, mod_logo_file: mod_logo_file, mod_credits: mod_credits, + mod_authors : mod_authors, mod_description: mod_description, mod_display_url: mod_display_url, + mod_full_version : "${project.mod_version}.${getBuildNumber()}${getStable()}" + + ] + inputs.properties replaceProperties + + filesMatching(['META-INF/mods.toml']) { + expand replaceProperties + [project: project] + } +} + +publishing { + publications { + register('mavenJava', MavenPublication) { + from components.java + } + } + repositories { + maven { + url "file://${project.projectDir}/repo" + } + } +} + +tasks.withType(JavaCompile).configureEach { + options.encoding = 'UTF-8' } jar { manifest { - attributes(["Specification-Title" : "reliquary", - "Specification-Vendor" : "reliquary", + attributes(["Specification-Title" : project.mod_id, + "Specification-Vendor" : project.mod_id, "Specification-Version" : "1", "Implementation-Title" : project.name, "Implementation-Version" : "${version}", - "Implementation-Vendor" : "reliquary", + "Implementation-Vendor" : project.mod_id, "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")],) } } -processResources { - // Exclude datagenerator .cache directory - exclude '.cache' - - filesMatching('META-INF/mods.toml') { - filter { - it.replaceAll("project_version", project.version.toString()) - } - } -} - static def getBuildNumber() { if (System.getenv("GITHUB_RUN_NUMBER") != null) { return Integer.valueOf(Integer.parseInt(System.getenv("GITHUB_RUN_NUMBER")) + 950).toString() @@ -156,7 +147,7 @@ static def getBuildNumber() { static def getStable() { if ((System.getenv("GITHUB_REF") == null || System.getenv("GITHUB_REF").endsWith("-dev"))) { - return "unstable" + return "-SNAPSHOT" } return "" } @@ -187,3 +178,6 @@ sonarqube { } } +task printVersionName { + println "version:" + project.version +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index b8044258..0efd6691 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,12 +1,32 @@ org.gradle.jvmargs=-Xmx2048m -minecraft_version=1.20.1 -forge_version=47.1.42 +org.gradle.daemon=false +org.gradle.debug=false + +neogradle.subsystems.parchment.minecraftVersion=1.20.3 +neogradle.subsystems.parchment.mappingsVersion=2023.12.31 +minecraft_version=1.20.4 +minecraft_version_range=[1.20.4,1.21) +neo_version=20.4.204 +neo_version_range=[20.4,) +loader_version_range=[2,) + +mod_id=reliquary +mod_name=Reliquary +mod_license=GNU General Public License v3.0 mod_version=2.0.36 -jei_mc_version=1.20.1-forge -jei_version=15.1.0.19 -curios_version=5.2.0-beta.3+1.20.1 +mod_group_id=reliquary +mod_authors=x3n0ph0b3, TheMike, P3pp3rF1y +mod_description=Two words: magical swag. Oh, and a gun. +mod_credits=Originally made by x3n0ph0b3 and TheMike, now maintained by P3pp3rF1y. +mod_logo_file=xrlogo.png +mod_display_url=https://www.curseforge.com/minecraft/mc-mods/reliquary-reincarnations +mod_issue_tracker_url=https://github.com/p3pp3rF1y/reliquary/issues + +jei_mc_version=1.20.4-neoforge +jei_version=17.3.0.49 +curios_version=7.3.4+1.20.4 # botania_version=1.16.5-415-SNAPSHOT parchment_version=2023.07.16-1.20.1 -jade_cf_file_id=4654448 +jade_cf_file_id=5109393 # hwyla_version = 1.8.20-B35_1.12 # jer_version = 0.8.7.41 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 3c7abdf12790879c06b07176de29647f77aa4129..d64cd4917707c1f8861d8cb53dd15194d4248596 100755 GIT binary patch literal 43462 zcma&NWl&^owk(X(xVyW%ySuwf;qI=D6|RlDJ2cR^yEKh!@I- zp9QeisK*rlxC>+~7Dk4IxIRsKBHqdR9b3+fyL=ynHmI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(NJ11uzdpje53aqj2Pl@BFjGwu%)@axTU43z15$g7lj2V zKmmq0X+R@?JAeM`srCZ&**`%8)Njq~Z2>pA1dYw~d31I4ZEYpAEwl~)ijD9z@497P zjaq=b!vRQs&HLMzeafJpIwK>sD?+MjcLy}TKC z48Tjp0~`YUf|-Q>zcrW^KxO|A8UEgne_(&h^q(u@X{gn|psT&=0b~9jaDPsfKMxX5gVOwji&p&aeD`C_{NtSW_xydk>iION z%uhffrT-mb<|)dzRDjq2KhL+=EZ?7RQxBo?FQxpZzVbBj(?~6UC9n39{XOwtjs$;O zUq3OXK81f8(&8t4fZA_)`y1?!ogm%sz42SUJq;f56V*=rU!eX&D2b=}f2z~}lgU=| zUoidMl?YHetG}!EKc#vqlm3%RQ|F(k{)cG#Q~0NP-#_6mbpHwdM@#&Z`u9_+r`n-E zsgTV61=aUT`@gE|sq*4a5;n_!LGsT!j89ASRH*JJnX}D5k^TL6`6=d8nWUeXQcnMb z`J+L;Lx2D0Z>M!nS)S_g{A3Y#`Hkg2XuqrTJjHyfI`9*-(d&22f3HFCl;`P9_@6vs zKELt&K6w1Ad+|>>pI&JG$;syTe{=qMxO(b#`xA3F{{O}#`rQflX{MjLIQ}G9N%|KA ze;=j(T!N<#Wp#72PtU}EB2VP}hWvYH z`VRf)6Y{5pczP81ld32GpQ!$ix%BDr+D};F!heGOF<|_|VcXLJJT=1qWC|($jp^x< z|8I5oe-!AcVfZJFX8CV4e}nx|pzmM*F!nvQ68^-mto#@F|J!Exw7#C2K7JAj*8X>4 c_`eJx(qi9shu`*Bw9mQ#s%Zm&B+s7xKi|i_5dZ)H diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4c73306d..a80b22ce 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ -#Sat Sep 05 10:21:38 EDT 2015 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-bin.zip diff --git a/src/generated/resources/data/minecraft/tags/blocks/wall_post_override.json b/src/generated/resources/data/minecraft/tags/blocks/wall_post_override.json new file mode 100644 index 00000000..163db7ce --- /dev/null +++ b/src/generated/resources/data/minecraft/tags/blocks/wall_post_override.json @@ -0,0 +1,5 @@ +{ + "values": [ + "reliquary:interdiction_torch" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/forge/loot_modifiers/global_loot_modifiers.json b/src/generated/resources/data/neoforge/loot_modifiers/global_loot_modifiers.json similarity index 100% rename from src/generated/resources/data/forge/loot_modifiers/global_loot_modifiers.json rename to src/generated/resources/data/neoforge/loot_modifiers/global_loot_modifiers.json diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/alkahestry_altar.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/alkahestry_altar.json index dfdb67af..e7191c12 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/alkahestry_altar.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/alkahestry_altar.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_nebulous_heart", - "has_the_recipe" + "has_the_recipe", + "has_nebulous_heart" ] ], "rewards": { "recipes": [ "reliquary:alkahestry_altar" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/alkahestry_tome.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/alkahestry_tome.json new file mode 100644 index 00000000..b231d148 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/alkahestry_tome.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:alkahestry_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:alkahestry_tome" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_witch_hat": { + "conditions": { + "items": [ + { + "items": [ + "reliquary:witch_hat" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_witch_hat" + ] + ], + "rewards": { + "recipes": [ + "reliquary:alkahestry_tome" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/angelheart_vial.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/angelheart_vial.json index c8f81c98..d632cba6 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/angelheart_vial.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/angelheart_vial.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_fertile_essence", - "has_the_recipe" + "has_the_recipe", + "has_fertile_essence" ] ], "rewards": { "recipes": [ "reliquary:angelheart_vial" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/angelic_feather.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/angelic_feather.json index 8292367e..57ca2d0e 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/angelic_feather.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/angelic_feather.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_nebulous_heart", - "has_the_recipe" + "has_the_recipe", + "has_nebulous_heart" ] ], "rewards": { "recipes": [ "reliquary:angelic_feather" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/aphrodite_potion.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/aphrodite_potion.json new file mode 100644 index 00000000..a39f7247 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/aphrodite_potion.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:potions_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_fertile_essence": { + "conditions": { + "items": [ + { + "items": [ + "reliquary:fertile_essence" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:aphrodite_potion" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_fertile_essence" + ] + ], + "rewards": { + "recipes": [ + "reliquary:aphrodite_potion" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/apothecary_cauldron.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/apothecary_cauldron.json new file mode 100644 index 00000000..40dadb4f --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/apothecary_cauldron.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:potions_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_nebulous_heart": { + "conditions": { + "items": [ + { + "items": [ + "reliquary:nebulous_heart" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:apothecary_cauldron" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_nebulous_heart" + ] + ], + "rewards": { + "recipes": [ + "reliquary:apothecary_cauldron" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/apothecary_mortar.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/apothecary_mortar.json new file mode 100644 index 00000000..f9b0ce82 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/apothecary_mortar.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:potions_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_catalyzing_gland": { + "conditions": { + "items": [ + { + "items": [ + "reliquary:catalyzing_gland" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:apothecary_mortar" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_catalyzing_gland" + ] + ], + "rewards": { + "recipes": [ + "reliquary:apothecary_mortar" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/barrel_assembly.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/barrel_assembly.json new file mode 100644 index 00000000..aafe478b --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/barrel_assembly.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:handgun_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_nebulous_heart": { + "conditions": { + "items": [ + { + "items": [ + "reliquary:nebulous_heart" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:barrel_assembly" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_nebulous_heart" + ] + ], + "rewards": { + "recipes": [ + "reliquary:barrel_assembly" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/bat_wing.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/bat_wing.json new file mode 100644 index 00000000..146ef927 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/bat_wing.json @@ -0,0 +1,37 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:mob_drops_craftable" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_feather": { + "conditions": { + "items": [ + { + "tag": "forge:feathers" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:bat_wing" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_feather" + ] + ], + "rewards": { + "recipes": [ + "reliquary:bat_wing" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/blaze_bullet.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/blaze_bullet.json new file mode 100644 index 00000000..09b4b53f --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/blaze_bullet.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:handgun_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_blaze_rod": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:blaze_rod" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:bullets/blaze_bullet" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_blaze_rod" + ] + ], + "rewards": { + "recipes": [ + "reliquary:bullets/blaze_bullet" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/buster_bullet.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/buster_bullet.json new file mode 100644 index 00000000..6eb7c86e --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/buster_bullet.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:handgun_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_concussive_bullet": { + "conditions": { + "items": [ + { + "items": [ + "reliquary:bullets/concussive_bullet" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:bullets/buster_bullet" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_concussive_bullet" + ] + ], + "rewards": { + "recipes": [ + "reliquary:bullets/buster_bullet" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/concussive_bullet.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/concussive_bullet.json new file mode 100644 index 00000000..8fd29965 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/concussive_bullet.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:handgun_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_gunpowder": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:gunpowder" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:bullets/concussive_bullet" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_gunpowder" + ] + ], + "rewards": { + "recipes": [ + "reliquary:bullets/concussive_bullet" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/ender_bullet.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/ender_bullet.json new file mode 100644 index 00000000..286de703 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/ender_bullet.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:handgun_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_seeker_bullet": { + "conditions": { + "items": [ + { + "items": [ + "reliquary:bullets/seeker_bullet" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:bullets/ender_bullet" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_seeker_bullet" + ] + ], + "rewards": { + "recipes": [ + "reliquary:bullets/ender_bullet" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/exorcism_bullet.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/exorcism_bullet.json new file mode 100644 index 00000000..69f90955 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/exorcism_bullet.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:handgun_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_neutral_bullet": { + "conditions": { + "items": [ + { + "items": [ + "reliquary:bullets/neutral_bullet" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:bullets/exorcism_bullet" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_neutral_bullet" + ] + ], + "rewards": { + "recipes": [ + "reliquary:bullets/exorcism_bullet" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/neutral_bullet.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/neutral_bullet.json new file mode 100644 index 00000000..0a4b71fd --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/neutral_bullet.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:handgun_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_gunpowder": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:gunpowder" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:bullets/neutral_bullet" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_gunpowder" + ] + ], + "rewards": { + "recipes": [ + "reliquary:bullets/neutral_bullet" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/sand_bullet.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/sand_bullet.json new file mode 100644 index 00000000..b997ed7a --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/sand_bullet.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:handgun_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_gunpowder": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:gunpowder" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:bullets/sand_bullet" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_gunpowder" + ] + ], + "rewards": { + "recipes": [ + "reliquary:bullets/sand_bullet" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/seeker_bullet.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/seeker_bullet.json new file mode 100644 index 00000000..b62b3eeb --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/seeker_bullet.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:handgun_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_gunpowder": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:gunpowder" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:bullets/seeker_bullet" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_gunpowder" + ] + ], + "rewards": { + "recipes": [ + "reliquary:bullets/seeker_bullet" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/storm_bullet.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/storm_bullet.json new file mode 100644 index 00000000..462873b9 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/bullets/storm_bullet.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:handgun_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_gunpowder": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:gunpowder" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:bullets/storm_bullet" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_gunpowder" + ] + ], + "rewards": { + "recipes": [ + "reliquary:bullets/storm_bullet" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/catalyzing_gland.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/catalyzing_gland.json new file mode 100644 index 00000000..9dbc0a61 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/catalyzing_gland.json @@ -0,0 +1,37 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:mob_drops_craftable" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_gunpowder": { + "conditions": { + "items": [ + { + "tag": "forge:gunpowder" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:catalyzing_gland" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_gunpowder" + ] + ], + "rewards": { + "recipes": [ + "reliquary:catalyzing_gland" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/chelicerae.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/chelicerae.json new file mode 100644 index 00000000..2d96dae0 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/chelicerae.json @@ -0,0 +1,37 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:mob_drops_craftable" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_string": { + "conditions": { + "items": [ + { + "tag": "forge:string" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:chelicerae" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_string" + ] + ], + "rewards": { + "recipes": [ + "reliquary:chelicerae" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/crimson_cloth.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/crimson_cloth.json index d39f3680..45175611 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/crimson_cloth.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/crimson_cloth.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_nebulous_heart", - "has_the_recipe" + "has_the_recipe", + "has_nebulous_heart" ] ], "rewards": { "recipes": [ "reliquary:crimson_cloth" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/destruction_catalyst.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/destruction_catalyst.json index ebde7b3d..8b0fc793 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/destruction_catalyst.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/destruction_catalyst.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_molten_core", - "has_the_recipe" + "has_the_recipe", + "has_molten_core" ] ], "rewards": { "recipes": [ "reliquary:destruction_catalyst" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/emperor_chalice.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/emperor_chalice.json index a0dc7b75..828f0853 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/emperor_chalice.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/emperor_chalice.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_void_tear", - "has_the_recipe" + "has_the_recipe", + "has_void_tear" ] ], "rewards": { "recipes": [ "reliquary:emperor_chalice" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/empty_potion_vial.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/empty_potion_vial.json new file mode 100644 index 00000000..0ce170e3 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/empty_potion_vial.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:potions_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_glass_pane": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:glass_pane" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:empty_potion_vial" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_glass_pane" + ] + ], + "rewards": { + "recipes": [ + "reliquary:empty_potion_vial" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/ender_staff.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/ender_staff.json index 74947f76..9dd288f2 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/ender_staff.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/ender_staff.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_nebulous_heart", - "has_the_recipe" + "has_the_recipe", + "has_nebulous_heart" ] ], "rewards": { "recipes": [ "reliquary:ender_staff" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/eye_of_the_storm.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/eye_of_the_storm.json new file mode 100644 index 00000000..f962dd51 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/eye_of_the_storm.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:mob_drops_craftable" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_catalyzing_gland": { + "conditions": { + "items": [ + { + "items": [ + "reliquary:catalyzing_gland" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:eye_of_the_storm" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_catalyzing_gland" + ] + ], + "rewards": { + "recipes": [ + "reliquary:eye_of_the_storm" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/fertile_essence.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/fertile_essence.json index cc539f59..17db9dfd 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/fertile_essence.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/fertile_essence.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_slime_pearl", - "has_the_recipe" + "has_the_recipe", + "has_slime_pearl" ] ], "rewards": { "recipes": [ "reliquary:fertile_essence" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/fertile_lily_pad.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/fertile_lily_pad.json index eec8224e..68c8abe7 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/fertile_lily_pad.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/fertile_lily_pad.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_fertile_essence", - "has_the_recipe" + "has_the_recipe", + "has_fertile_essence" ] ], "rewards": { "recipes": [ "reliquary:fertile_lily_pad" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/fertile_potion.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/fertile_potion.json new file mode 100644 index 00000000..663126c7 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/fertile_potion.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:potions_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_fertile_essence": { + "conditions": { + "items": [ + { + "items": [ + "reliquary:fertile_essence" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:fertile_potion" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_fertile_essence" + ] + ], + "rewards": { + "recipes": [ + "reliquary:fertile_potion" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/fortune_coin.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/fortune_coin.json index 86c4930c..e3d9bbce 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/fortune_coin.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/fortune_coin.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_nebulous_heart", - "has_the_recipe" + "has_the_recipe", + "has_nebulous_heart" ] ], "rewards": { "recipes": [ "reliquary:fortune_coin" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/frozen_core.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/frozen_core.json new file mode 100644 index 00000000..b37a6e06 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/frozen_core.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:mob_drops_craftable" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_snow": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:snow" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:frozen_core" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_snow" + ] + ], + "rewards": { + "recipes": [ + "reliquary:frozen_core" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/glacial_staff.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/glacial_staff.json index d067780b..f37e56c1 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/glacial_staff.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/glacial_staff.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_void_tear", - "has_the_recipe" + "has_the_recipe", + "has_void_tear" ] ], "rewards": { "recipes": [ "reliquary:glacial_staff" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/glowing_bread.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/glowing_bread.json index 1a6bb577..638ee32f 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/glowing_bread.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/glowing_bread.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_glowing_water", - "has_the_recipe" + "has_the_recipe", + "has_glowing_water" ] ], "rewards": { "recipes": [ "reliquary:glowing_bread" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/glowing_water.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/glowing_water.json index b344453e..ac3210c5 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/glowing_water.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/glowing_water.json @@ -20,14 +20,13 @@ }, "requirements": [ [ - "has_nether_wart", - "has_the_recipe" + "has_the_recipe", + "has_nether_wart" ] ], "rewards": { "recipes": [ "reliquary:glowing_water" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/glowing_water_from_potion_vial.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/glowing_water_from_potion_vial.json index 6d2dddae..2dd9e3be 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/glowing_water_from_potion_vial.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/glowing_water_from_potion_vial.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_empty_potion_vial", - "has_the_recipe" + "has_the_recipe", + "has_empty_potion_vial" ] ], "rewards": { "recipes": [ "reliquary:glowing_water_from_potion_vial" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/gold_nugget.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/gold_nugget.json index aef8fcf0..01bcbcfe 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/gold_nugget.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/gold_nugget.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_empty_bullet", - "has_the_recipe" + "has_the_recipe", + "has_empty_bullet" ] ], "rewards": { "recipes": [ "reliquary:gold_nugget" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/grip_assembly.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/grip_assembly.json new file mode 100644 index 00000000..62812778 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/grip_assembly.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:handgun_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_magma_cream": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:magma_cream" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:grip_assembly" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_magma_cream" + ] + ], + "rewards": { + "recipes": [ + "reliquary:grip_assembly" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/guardian_spike.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/guardian_spike.json new file mode 100644 index 00000000..d258dab1 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/guardian_spike.json @@ -0,0 +1,37 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:mob_drops_craftable" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_prismarine": { + "conditions": { + "items": [ + { + "tag": "forge:dusts/prismarine" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:guardian_spike" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_prismarine" + ] + ], + "rewards": { + "recipes": [ + "reliquary:guardian_spike" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/hammer_assembly.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/hammer_assembly.json new file mode 100644 index 00000000..f6e6252e --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/hammer_assembly.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:handgun_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_molten_core": { + "conditions": { + "items": [ + { + "items": [ + "reliquary:molten_core" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:hammer_assembly" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_molten_core" + ] + ], + "rewards": { + "recipes": [ + "reliquary:hammer_assembly" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/handgun.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/handgun.json new file mode 100644 index 00000000..a46462e8 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/handgun.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:handgun_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_barrel_assembly": { + "conditions": { + "items": [ + { + "items": [ + "reliquary:barrel_assembly" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:handgun" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_barrel_assembly" + ] + ], + "rewards": { + "recipes": [ + "reliquary:handgun" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/harvest_rod.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/harvest_rod.json index c0f4ef01..a60bf817 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/harvest_rod.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/harvest_rod.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_void_tear", - "has_the_recipe" + "has_the_recipe", + "has_void_tear" ] ], "rewards": { "recipes": [ "reliquary:harvest_rod" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/hero_medallion.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/hero_medallion.json index e486ab3d..8311dd8c 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/hero_medallion.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/hero_medallion.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_infernal_tear", - "has_the_recipe" + "has_the_recipe", + "has_infernal_tear" ] ], "rewards": { "recipes": [ "reliquary:hero_medallion" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/holy_hand_grenade.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/holy_hand_grenade.json index 1d39a7ff..2705f6a5 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/holy_hand_grenade.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/holy_hand_grenade.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_glowing_water", - "has_the_recipe" + "has_the_recipe", + "has_glowing_water" ] ], "rewards": { "recipes": [ "reliquary:holy_hand_grenade" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/ice_magus_rod.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/ice_magus_rod.json index 0a37f4ad..7295e27a 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/ice_magus_rod.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/ice_magus_rod.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_frozen_core", - "has_the_recipe" + "has_the_recipe", + "has_frozen_core" ] ], "rewards": { "recipes": [ "reliquary:ice_magus_rod" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/infernal_chalice.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/infernal_chalice.json index 6229d54b..fb712ffc 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/infernal_chalice.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/infernal_chalice.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_emperor_chalice", - "has_the_recipe" + "has_the_recipe", + "has_emperor_chalice" ] ], "rewards": { "recipes": [ "reliquary:infernal_chalice" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/infernal_claw.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/infernal_claw.json index 0e287b87..c426bbf9 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/infernal_claw.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/infernal_claw.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_slime_pearl", - "has_the_recipe" + "has_the_recipe", + "has_slime_pearl" ] ], "rewards": { "recipes": [ "reliquary:infernal_claw" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/infernal_claws.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/infernal_claws.json index 5b2eda52..2cfc0680 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/infernal_claws.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/infernal_claws.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_infernal_claw", - "has_the_recipe" + "has_the_recipe", + "has_infernal_claw" ] ], "rewards": { "recipes": [ "reliquary:infernal_claws" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/infernal_tear.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/infernal_tear.json index 7735c13a..5a5fe2f6 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/infernal_tear.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/infernal_tear.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_infernal_claw", - "has_the_recipe" + "has_the_recipe", + "has_infernal_claw" ] ], "rewards": { "recipes": [ "reliquary:infernal_tear" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/interdiction_torch.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/interdiction_torch.json index b62736ee..8c78553a 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/interdiction_torch.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/interdiction_torch.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_molten_core", - "has_the_recipe" + "has_the_recipe", + "has_molten_core" ] ], "rewards": { "recipes": [ "reliquary:interdiction_torch" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/kraken_shell.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/kraken_shell.json index d1fb5d88..aa3182cc 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/kraken_shell.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/kraken_shell.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_kraken_shell_fragment", - "has_the_recipe" + "has_the_recipe", + "has_kraken_shell_fragment" ] ], "rewards": { "recipes": [ "reliquary:kraken_shell" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/kraken_shell_fragment.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/kraken_shell_fragment.json index e14b11fd..c689ecde 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/kraken_shell_fragment.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/kraken_shell_fragment.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_squid_beak", - "has_the_recipe" + "has_the_recipe", + "has_squid_beak" ] ], "rewards": { "recipes": [ "reliquary:kraken_shell_fragment" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/lantern_of_paranoia.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/lantern_of_paranoia.json index 1f4d920a..bfed5d98 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/lantern_of_paranoia.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/lantern_of_paranoia.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_molten_core", - "has_the_recipe" + "has_the_recipe", + "has_molten_core" ] ], "rewards": { "recipes": [ "reliquary:lantern_of_paranoia" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/magazines/empty_magazine.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/magazines/empty_magazine.json new file mode 100644 index 00000000..c8d91e52 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/magazines/empty_magazine.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:handgun_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_iron_ingot": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:iron_ingot" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:magazines/empty_magazine" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_iron_ingot" + ] + ], + "rewards": { + "recipes": [ + "reliquary:magazines/empty_magazine" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/magicbane.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/magicbane.json index 3ec10168..01645dba 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/magicbane.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/magicbane.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_nebulous_heart", - "has_the_recipe" + "has_the_recipe", + "has_nebulous_heart" ] ], "rewards": { "recipes": [ "reliquary:magicbane" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/mercy_cross.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/mercy_cross.json index a2a339d9..c8529f83 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/mercy_cross.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/mercy_cross.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_withered_rib", - "has_the_recipe" + "has_the_recipe", + "has_withered_rib" ] ], "rewards": { "recipes": [ "reliquary:mercy_cross" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/midas_touchstone.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/midas_touchstone.json index 9afdee92..1b5c00c4 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/midas_touchstone.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/midas_touchstone.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_molten_core", - "has_the_recipe" + "has_the_recipe", + "has_molten_core" ] ], "rewards": { "recipes": [ "reliquary:midas_touchstone" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_belt.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_belt.json index 90dc3b8f..817654af 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_belt.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_belt.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_mob_charm_fragment", - "has_the_recipe" + "has_the_recipe", + "has_mob_charm_fragment" ] ], "rewards": { "recipes": [ "reliquary:mob_charm_belt" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/blaze.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/blaze.json index ea89bef6..a17011bc 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/blaze.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/blaze.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_molten_core", - "has_the_recipe" + "has_the_recipe", + "has_molten_core" ] ], "rewards": { "recipes": [ "reliquary:mob_charm_fragments/blaze" ] - }, - "sends_telemetry_event": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/cave_spider.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/cave_spider.json index 9d586444..6fcb0b8c 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/cave_spider.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/cave_spider.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_chelicerae", - "has_the_recipe" + "has_the_recipe", + "has_chelicerae" ] ], "rewards": { "recipes": [ "reliquary:mob_charm_fragments/cave_spider" ] - }, - "sends_telemetry_event": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/creeper.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/creeper.json index bc8d83dc..9892478e 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/creeper.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/creeper.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_catalyzing_gland", - "has_the_recipe" + "has_the_recipe", + "has_catalyzing_gland" ] ], "rewards": { "recipes": [ "reliquary:mob_charm_fragments/creeper" ] - }, - "sends_telemetry_event": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/enderman.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/enderman.json index eea4df0e..c0975f95 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/enderman.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/enderman.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_nebulous_heart", - "has_the_recipe" + "has_the_recipe", + "has_nebulous_heart" ] ], "rewards": { "recipes": [ "reliquary:mob_charm_fragments/enderman" ] - }, - "sends_telemetry_event": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/ghast.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/ghast.json index 92c057e8..4a3aff4d 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/ghast.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/ghast.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_catalyzing_gland", - "has_the_recipe" + "has_the_recipe", + "has_catalyzing_gland" ] ], "rewards": { "recipes": [ "reliquary:mob_charm_fragments/ghast" ] - }, - "sends_telemetry_event": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/guardian.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/guardian.json index da088d6f..26811361 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/guardian.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/guardian.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_guardian_spike", - "has_the_recipe" + "has_the_recipe", + "has_guardian_spike" ] ], "rewards": { "recipes": [ "reliquary:mob_charm_fragments/guardian" ] - }, - "sends_telemetry_event": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/magma_cube.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/magma_cube.json index 1d70ec73..e1f30e11 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/magma_cube.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/magma_cube.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_molten_core", - "has_the_recipe" + "has_the_recipe", + "has_molten_core" ] ], "rewards": { "recipes": [ "reliquary:mob_charm_fragments/magma_cube" ] - }, - "sends_telemetry_event": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/skeleton.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/skeleton.json index 94d552c0..5dc03357 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/skeleton.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/skeleton.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_rib_bone", - "has_the_recipe" + "has_the_recipe", + "has_rib_bone" ] ], "rewards": { "recipes": [ "reliquary:mob_charm_fragments/skeleton" ] - }, - "sends_telemetry_event": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/slime.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/slime.json index a24b53e4..d4082951 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/slime.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/slime.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_slime_pearl", - "has_the_recipe" + "has_the_recipe", + "has_slime_pearl" ] ], "rewards": { "recipes": [ "reliquary:mob_charm_fragments/slime" ] - }, - "sends_telemetry_event": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/spider.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/spider.json index 1748d0dc..a3639cde 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/spider.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/spider.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_chelicerae", - "has_the_recipe" + "has_the_recipe", + "has_chelicerae" ] ], "rewards": { "recipes": [ "reliquary:mob_charm_fragments/spider" ] - }, - "sends_telemetry_event": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/witch.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/witch.json index a76636d9..db47b6d0 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/witch.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/witch.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_witch_hat", - "has_the_recipe" + "has_the_recipe", + "has_witch_hat" ] ], "rewards": { "recipes": [ "reliquary:mob_charm_fragments/witch" ] - }, - "sends_telemetry_event": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/wither_skeleton.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/wither_skeleton.json index 2e89f363..c31097a9 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/wither_skeleton.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/wither_skeleton.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_withered_rib", - "has_the_recipe" + "has_the_recipe", + "has_withered_rib" ] ], "rewards": { "recipes": [ "reliquary:mob_charm_fragments/wither_skeleton" ] - }, - "sends_telemetry_event": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/zombie.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/zombie.json index 84e544f2..e4152a76 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/zombie.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/zombie.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_zombie_heart", - "has_the_recipe" + "has_the_recipe", + "has_zombie_heart" ] ], "rewards": { "recipes": [ "reliquary:mob_charm_fragments/zombie" ] - }, - "sends_telemetry_event": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/zombified_piglin.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/zombified_piglin.json index adbadab1..f186f467 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/zombified_piglin.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/mob_charm_fragments/zombified_piglin.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_zombie_heart", - "has_the_recipe" + "has_the_recipe", + "has_zombie_heart" ] ], "rewards": { "recipes": [ "reliquary:mob_charm_fragments/zombified_piglin" ] - }, - "sends_telemetry_event": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/molten_core.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/molten_core.json new file mode 100644 index 00000000..54c7328d --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/molten_core.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:mob_drops_craftable" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_magma_cream": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:magma_cream" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:molten_core" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_magma_cream" + ] + ], + "rewards": { + "recipes": [ + "reliquary:molten_core" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/nebulous_heart.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/nebulous_heart.json new file mode 100644 index 00000000..54dc728a --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/nebulous_heart.json @@ -0,0 +1,37 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:mob_drops_craftable" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_ender_pearl": { + "conditions": { + "items": [ + { + "tag": "forge:ender_pearls" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:nebulous_heart" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_ender_pearl" + ] + ], + "rewards": { + "recipes": [ + "reliquary:nebulous_heart" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/black_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/black_pedestal.json new file mode 100644 index 00000000..2ee47ba5 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/black_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_passive_pedestal": { + "conditions": { + "items": [ + { + "items": [ + "reliquary:pedestals/passive/white_passive_pedestal" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/black_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_passive_pedestal" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/black_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/blue_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/blue_pedestal.json new file mode 100644 index 00000000..ee784b2f --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/blue_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_passive_pedestal": { + "conditions": { + "items": [ + { + "items": [ + "reliquary:pedestals/passive/white_passive_pedestal" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/blue_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_passive_pedestal" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/blue_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/brown_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/brown_pedestal.json new file mode 100644 index 00000000..7da4bd2b --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/brown_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_passive_pedestal": { + "conditions": { + "items": [ + { + "items": [ + "reliquary:pedestals/passive/white_passive_pedestal" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/brown_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_passive_pedestal" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/brown_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/cyan_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/cyan_pedestal.json new file mode 100644 index 00000000..151e1034 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/cyan_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_passive_pedestal": { + "conditions": { + "items": [ + { + "items": [ + "reliquary:pedestals/passive/white_passive_pedestal" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/cyan_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_passive_pedestal" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/cyan_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/gray_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/gray_pedestal.json new file mode 100644 index 00000000..685a3d11 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/gray_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_passive_pedestal": { + "conditions": { + "items": [ + { + "items": [ + "reliquary:pedestals/passive/white_passive_pedestal" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/gray_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_passive_pedestal" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/gray_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/green_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/green_pedestal.json new file mode 100644 index 00000000..e3ac7b3a --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/green_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_passive_pedestal": { + "conditions": { + "items": [ + { + "items": [ + "reliquary:pedestals/passive/white_passive_pedestal" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/green_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_passive_pedestal" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/green_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/light_blue_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/light_blue_pedestal.json new file mode 100644 index 00000000..e44f55c5 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/light_blue_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_passive_pedestal": { + "conditions": { + "items": [ + { + "items": [ + "reliquary:pedestals/passive/white_passive_pedestal" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/light_blue_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_passive_pedestal" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/light_blue_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/light_gray_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/light_gray_pedestal.json new file mode 100644 index 00000000..f2bd14df --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/light_gray_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_passive_pedestal": { + "conditions": { + "items": [ + { + "items": [ + "reliquary:pedestals/passive/white_passive_pedestal" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/light_gray_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_passive_pedestal" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/light_gray_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/lime_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/lime_pedestal.json new file mode 100644 index 00000000..fe57a73b --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/lime_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_passive_pedestal": { + "conditions": { + "items": [ + { + "items": [ + "reliquary:pedestals/passive/white_passive_pedestal" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/lime_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_passive_pedestal" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/lime_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/magenta_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/magenta_pedestal.json new file mode 100644 index 00000000..1688066f --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/magenta_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_passive_pedestal": { + "conditions": { + "items": [ + { + "items": [ + "reliquary:pedestals/passive/white_passive_pedestal" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/magenta_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_passive_pedestal" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/magenta_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/orange_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/orange_pedestal.json new file mode 100644 index 00000000..e7204589 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/orange_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_passive_pedestal": { + "conditions": { + "items": [ + { + "items": [ + "reliquary:pedestals/passive/white_passive_pedestal" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/orange_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_passive_pedestal" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/orange_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/black_passive_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/black_passive_pedestal.json new file mode 100644 index 00000000..bbd8ac32 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/black_passive_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:passive_pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_quartz_block": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:quartz_block" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/passive/black_passive_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_quartz_block" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/passive/black_passive_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/blue_passive_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/blue_passive_pedestal.json new file mode 100644 index 00000000..5f4e9e51 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/blue_passive_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:passive_pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_quartz_block": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:quartz_block" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/passive/blue_passive_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_quartz_block" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/passive/blue_passive_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/brown_passive_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/brown_passive_pedestal.json new file mode 100644 index 00000000..5e5d193d --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/brown_passive_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:passive_pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_quartz_block": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:quartz_block" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/passive/brown_passive_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_quartz_block" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/passive/brown_passive_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/cyan_passive_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/cyan_passive_pedestal.json new file mode 100644 index 00000000..b470b49d --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/cyan_passive_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:passive_pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_quartz_block": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:quartz_block" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/passive/cyan_passive_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_quartz_block" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/passive/cyan_passive_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/gray_passive_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/gray_passive_pedestal.json new file mode 100644 index 00000000..43d308fd --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/gray_passive_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:passive_pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_quartz_block": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:quartz_block" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/passive/gray_passive_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_quartz_block" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/passive/gray_passive_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/green_passive_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/green_passive_pedestal.json new file mode 100644 index 00000000..d42ec98a --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/green_passive_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:passive_pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_quartz_block": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:quartz_block" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/passive/green_passive_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_quartz_block" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/passive/green_passive_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/light_blue_passive_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/light_blue_passive_pedestal.json new file mode 100644 index 00000000..40153816 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/light_blue_passive_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:passive_pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_quartz_block": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:quartz_block" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/passive/light_blue_passive_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_quartz_block" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/passive/light_blue_passive_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/light_gray_passive_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/light_gray_passive_pedestal.json new file mode 100644 index 00000000..7a4479d7 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/light_gray_passive_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:passive_pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_quartz_block": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:quartz_block" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/passive/light_gray_passive_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_quartz_block" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/passive/light_gray_passive_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/lime_passive_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/lime_passive_pedestal.json new file mode 100644 index 00000000..58a777ee --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/lime_passive_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:passive_pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_quartz_block": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:quartz_block" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/passive/lime_passive_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_quartz_block" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/passive/lime_passive_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/magenta_passive_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/magenta_passive_pedestal.json new file mode 100644 index 00000000..2c072503 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/magenta_passive_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:passive_pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_quartz_block": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:quartz_block" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/passive/magenta_passive_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_quartz_block" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/passive/magenta_passive_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/orange_passive_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/orange_passive_pedestal.json new file mode 100644 index 00000000..9871fadf --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/orange_passive_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:passive_pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_quartz_block": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:quartz_block" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/passive/orange_passive_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_quartz_block" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/passive/orange_passive_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/pink_passive_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/pink_passive_pedestal.json new file mode 100644 index 00000000..4d951a4c --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/pink_passive_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:passive_pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_quartz_block": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:quartz_block" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/passive/pink_passive_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_quartz_block" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/passive/pink_passive_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/purple_passive_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/purple_passive_pedestal.json new file mode 100644 index 00000000..b26c8b1d --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/purple_passive_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:passive_pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_quartz_block": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:quartz_block" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/passive/purple_passive_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_quartz_block" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/passive/purple_passive_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/red_passive_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/red_passive_pedestal.json new file mode 100644 index 00000000..edbc0a32 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/red_passive_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:passive_pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_quartz_block": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:quartz_block" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/passive/red_passive_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_quartz_block" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/passive/red_passive_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/white_passive_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/white_passive_pedestal.json new file mode 100644 index 00000000..a50f0b9e --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/white_passive_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:passive_pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_quartz_block": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:quartz_block" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/passive/white_passive_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_quartz_block" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/passive/white_passive_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/yellow_passive_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/yellow_passive_pedestal.json new file mode 100644 index 00000000..56c1ec7e --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/passive/yellow_passive_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:passive_pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_quartz_block": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:quartz_block" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/passive/yellow_passive_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_quartz_block" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/passive/yellow_passive_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/pink_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/pink_pedestal.json new file mode 100644 index 00000000..60e7fd0b --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/pink_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_passive_pedestal": { + "conditions": { + "items": [ + { + "items": [ + "reliquary:pedestals/passive/white_passive_pedestal" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/pink_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_passive_pedestal" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/pink_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/purple_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/purple_pedestal.json new file mode 100644 index 00000000..f1eeba9f --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/purple_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_passive_pedestal": { + "conditions": { + "items": [ + { + "items": [ + "reliquary:pedestals/passive/white_passive_pedestal" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/purple_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_passive_pedestal" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/purple_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/red_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/red_pedestal.json new file mode 100644 index 00000000..b38941f3 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/red_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_passive_pedestal": { + "conditions": { + "items": [ + { + "items": [ + "reliquary:pedestals/passive/white_passive_pedestal" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/red_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_passive_pedestal" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/red_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/white_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/white_pedestal.json new file mode 100644 index 00000000..df208a55 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/white_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_passive_pedestal": { + "conditions": { + "items": [ + { + "items": [ + "reliquary:pedestals/passive/white_passive_pedestal" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/white_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_passive_pedestal" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/white_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/yellow_pedestal.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/yellow_pedestal.json new file mode 100644 index 00000000..4f03be04 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pedestals/yellow_pedestal.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:pedestal_enabled" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_passive_pedestal": { + "conditions": { + "items": [ + { + "items": [ + "reliquary:pedestals/passive/white_passive_pedestal" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:pedestals/yellow_pedestal" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_passive_pedestal" + ] + ], + "rewards": { + "recipes": [ + "reliquary:pedestals/yellow_pedestal" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/phoenix_down.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/phoenix_down.json index 9f17abfb..89d397ed 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/phoenix_down.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/phoenix_down.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_angelic_feather", - "has_the_recipe" + "has_the_recipe", + "has_angelic_feather" ] ], "rewards": { "recipes": [ "reliquary:phoenix_down" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/pyromancer_staff.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/pyromancer_staff.json index 755e312f..523ef6fb 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/pyromancer_staff.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/pyromancer_staff.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_infernal_claws", - "has_the_recipe" + "has_the_recipe", + "has_infernal_claws" ] ], "rewards": { "recipes": [ "reliquary:pyromancer_staff" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/rending_gale.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/rending_gale.json index 4ad0ac15..d82f2858 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/rending_gale.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/rending_gale.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_eye_of_the_storm", - "has_the_recipe" + "has_the_recipe", + "has_eye_of_the_storm" ] ], "rewards": { "recipes": [ "reliquary:rending_gale" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/rib_bone.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/rib_bone.json new file mode 100644 index 00000000..d09211cd --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/rib_bone.json @@ -0,0 +1,37 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:mob_drops_craftable" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_bone": { + "conditions": { + "items": [ + { + "tag": "forge:bones" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:rib_bone" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_bone" + ] + ], + "rewards": { + "recipes": [ + "reliquary:rib_bone" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/rod_of_lyssa.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/rod_of_lyssa.json index 43ec577a..d706e05e 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/rod_of_lyssa.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/rod_of_lyssa.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_infernal_claw", - "has_the_recipe" + "has_the_recipe", + "has_infernal_claw" ] ], "rewards": { "recipes": [ "reliquary:rod_of_lyssa" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/salamander_eye.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/salamander_eye.json index 9a3eda39..d7c3eeed 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/salamander_eye.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/salamander_eye.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_molten_core", - "has_the_recipe" + "has_the_recipe", + "has_molten_core" ] ], "rewards": { "recipes": [ "reliquary:salamander_eye" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/serpent_staff.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/serpent_staff.json index d23e4fac..49929735 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/serpent_staff.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/serpent_staff.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_kraken_shell_fragment", - "has_the_recipe" + "has_the_recipe", + "has_kraken_shell_fragment" ] ], "rewards": { "recipes": [ "reliquary:serpent_staff" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/shears_of_winter.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/shears_of_winter.json index 9de27564..e349ae5d 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/shears_of_winter.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/shears_of_winter.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_frozen_core", - "has_the_recipe" + "has_the_recipe", + "has_frozen_core" ] ], "rewards": { "recipes": [ "reliquary:shears_of_winter" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/slime_pearl.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/slime_pearl.json new file mode 100644 index 00000000..be90a995 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/slime_pearl.json @@ -0,0 +1,37 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:mob_drops_craftable" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_slimeball": { + "conditions": { + "items": [ + { + "tag": "forge:slimeballs" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:slime_pearl" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_slimeball" + ] + ], + "rewards": { + "recipes": [ + "reliquary:slime_pearl" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/sojourner_staff.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/sojourner_staff.json index e4305353..a5602efd 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/sojourner_staff.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/sojourner_staff.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_void_tear", - "has_the_recipe" + "has_the_recipe", + "has_void_tear" ] ], "rewards": { "recipes": [ "reliquary:sojourner_staff" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/squid_beak.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/squid_beak.json new file mode 100644 index 00000000..4aca7a7c --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/squid_beak.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:mob_drops_craftable" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_ink_sac": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:ink_sac" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:squid_beak" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_ink_sac" + ] + ], + "rewards": { + "recipes": [ + "reliquary:squid_beak" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/twilight_cloak.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/twilight_cloak.json index 45809efa..1eb585bd 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/twilight_cloak.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/twilight_cloak.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_crimson_cloth", - "has_the_recipe" + "has_the_recipe", + "has_crimson_cloth" ] ], "rewards": { "recipes": [ "reliquary:twilight_cloak" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/blaze_rod.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/blaze_rod.json index 29c4f8fe..63b47629 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/blaze_rod.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/blaze_rod.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_molten_core", - "has_the_recipe" + "has_the_recipe", + "has_molten_core" ] ], "rewards": { "recipes": [ "reliquary:uncrafting/blaze_rod" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/bone.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/bone.json index dd85feec..4e570be5 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/bone.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/bone.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_rib_bone", - "has_the_recipe" + "has_the_recipe", + "has_rib_bone" ] ], "rewards": { "recipes": [ "reliquary:uncrafting/bone" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/ender_pearl.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/ender_pearl.json index 79220048..9aa52452 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/ender_pearl.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/ender_pearl.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_nebulous_heart", - "has_the_recipe" + "has_the_recipe", + "has_nebulous_heart" ] ], "rewards": { "recipes": [ "reliquary:uncrafting/ender_pearl" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/ghast_tear.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/ghast_tear.json index eba824de..6f41db51 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/ghast_tear.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/ghast_tear.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_catalyzing_gland", - "has_the_recipe" + "has_the_recipe", + "has_catalyzing_gland" ] ], "rewards": { "recipes": [ "reliquary:uncrafting/ghast_tear" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/glass_bottle.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/glass_bottle.json index a71b6bf8..370abb71 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/glass_bottle.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/glass_bottle.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_witch_hat", - "has_the_recipe" + "has_the_recipe", + "has_witch_hat" ] ], "rewards": { "recipes": [ "reliquary:uncrafting/glass_bottle" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/glowstone_dust.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/glowstone_dust.json index 867cb82f..3e24ea8c 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/glowstone_dust.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/glowstone_dust.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_witch_hat", - "has_the_recipe" + "has_the_recipe", + "has_witch_hat" ] ], "rewards": { "recipes": [ "reliquary:uncrafting/glowstone_dust" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/gold_nugget.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/gold_nugget.json index b5eda3d1..4b61388e 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/gold_nugget.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/gold_nugget.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_zombie_heart", - "has_the_recipe" + "has_the_recipe", + "has_zombie_heart" ] ], "rewards": { "recipes": [ "reliquary:uncrafting/gold_nugget" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/gunpowder_creeper_gland.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/gunpowder_creeper_gland.json index 5344527b..78ed8600 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/gunpowder_creeper_gland.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/gunpowder_creeper_gland.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_catalyzing_gland", - "has_the_recipe" + "has_the_recipe", + "has_catalyzing_gland" ] ], "rewards": { "recipes": [ "reliquary:uncrafting/gunpowder_creeper_gland" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/gunpowder_storm_eye.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/gunpowder_storm_eye.json index 4ec80361..4a3411f1 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/gunpowder_storm_eye.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/gunpowder_storm_eye.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_eye_of_the_storm", - "has_the_recipe" + "has_the_recipe", + "has_eye_of_the_storm" ] ], "rewards": { "recipes": [ "reliquary:uncrafting/gunpowder_storm_eye" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/gunpowder_witch_hat.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/gunpowder_witch_hat.json index e60b5ef5..77276017 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/gunpowder_witch_hat.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/gunpowder_witch_hat.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_witch_hat", - "has_the_recipe" + "has_the_recipe", + "has_witch_hat" ] ], "rewards": { "recipes": [ "reliquary:uncrafting/gunpowder_witch_hat" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/ink_sac.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/ink_sac.json index 3c89404a..925b548b 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/ink_sac.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/ink_sac.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_squid_beak", - "has_the_recipe" + "has_the_recipe", + "has_squid_beak" ] ], "rewards": { "recipes": [ "reliquary:uncrafting/ink_sac" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/magma_cream.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/magma_cream.json index 4ee050d8..de55e1a5 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/magma_cream.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/magma_cream.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_molten_core", - "has_the_recipe" + "has_the_recipe", + "has_molten_core" ] ], "rewards": { "recipes": [ "reliquary:uncrafting/magma_cream" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/packed_ice.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/packed_ice.json index 1928926e..ebc7f172 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/packed_ice.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/packed_ice.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_frozen_core", - "has_the_recipe" + "has_the_recipe", + "has_frozen_core" ] ], "rewards": { "recipes": [ "reliquary:uncrafting/packed_ice" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/prismarine_crystals.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/prismarine_crystals.json index 8201e3fe..262d54ac 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/prismarine_crystals.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/prismarine_crystals.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_guardian_spike", - "has_the_recipe" + "has_the_recipe", + "has_guardian_spike" ] ], "rewards": { "recipes": [ "reliquary:uncrafting/prismarine_crystals" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/prismarine_shard.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/prismarine_shard.json index 5abe7934..16f1d49e 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/prismarine_shard.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/prismarine_shard.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_guardian_spike", - "has_the_recipe" + "has_the_recipe", + "has_guardian_spike" ] ], "rewards": { "recipes": [ "reliquary:uncrafting/prismarine_shard" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/redstone.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/redstone.json index 9e61ebb9..8748cb70 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/redstone.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/redstone.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_witch_hat", - "has_the_recipe" + "has_the_recipe", + "has_witch_hat" ] ], "rewards": { "recipes": [ "reliquary:uncrafting/redstone" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/rotten_flesh.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/rotten_flesh.json index f9b327b2..03d5a74a 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/rotten_flesh.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/rotten_flesh.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_zombie_heart", - "has_the_recipe" + "has_the_recipe", + "has_zombie_heart" ] ], "rewards": { "recipes": [ "reliquary:uncrafting/rotten_flesh" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/slime_ball.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/slime_ball.json index 693461b0..839e70d1 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/slime_ball.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/slime_ball.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_slime_pearl", - "has_the_recipe" + "has_the_recipe", + "has_slime_pearl" ] ], "rewards": { "recipes": [ "reliquary:uncrafting/slime_ball" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/snowball.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/snowball.json index d566db05..4e9708cc 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/snowball.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/snowball.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_frozen_core", - "has_the_recipe" + "has_the_recipe", + "has_frozen_core" ] ], "rewards": { "recipes": [ "reliquary:uncrafting/snowball" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/spider_eye.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/spider_eye.json index 94b26c49..16c8e686 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/spider_eye.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/spider_eye.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_chelicerae", - "has_the_recipe" + "has_the_recipe", + "has_chelicerae" ] ], "rewards": { "recipes": [ "reliquary:uncrafting/spider_eye" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/stick.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/stick.json index 7459a392..210f727b 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/stick.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/stick.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_witch_hat", - "has_the_recipe" + "has_the_recipe", + "has_witch_hat" ] ], "rewards": { "recipes": [ "reliquary:uncrafting/stick" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/string.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/string.json index 1c484fa4..a3de91f2 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/string.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/string.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_chelicerae", - "has_the_recipe" + "has_the_recipe", + "has_chelicerae" ] ], "rewards": { "recipes": [ "reliquary:uncrafting/string" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/sugar.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/sugar.json index a30fc7ac..2e190ea6 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/sugar.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/sugar.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_witch_hat", - "has_the_recipe" + "has_the_recipe", + "has_witch_hat" ] ], "rewards": { "recipes": [ "reliquary:uncrafting/sugar" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/wither_skeleton_skull.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/wither_skeleton_skull.json index 3e44e072..d54122b2 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/wither_skeleton_skull.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/uncrafting/wither_skeleton_skull.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_withered_rib", - "has_the_recipe" + "has_the_recipe", + "has_withered_rib" ] ], "rewards": { "recipes": [ "reliquary:uncrafting/wither_skeleton_skull" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/void_tear.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/void_tear.json index 138dfc05..4869a842 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/void_tear.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/void_tear.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_nebulous_heart", - "has_the_recipe" + "has_the_recipe", + "has_nebulous_heart" ] ], "rewards": { "recipes": [ "reliquary:void_tear" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/withered_rib.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/withered_rib.json new file mode 100644 index 00000000..80cd6100 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/withered_rib.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:mob_drops_craftable" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_skeleton_skull": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:skeleton_skull" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:withered_rib" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_skeleton_skull" + ] + ], + "rewards": { + "recipes": [ + "reliquary:withered_rib" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/witherless_rose.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/witherless_rose.json index 3c72bd4e..4409fabc 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/witherless_rose.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/witherless_rose.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_fertile_essence", - "has_the_recipe" + "has_the_recipe", + "has_fertile_essence" ] ], "rewards": { "recipes": [ "reliquary:witherless_rose" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/wraith_node.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/wraith_node.json index 54a61653..304bb38a 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/misc/wraith_node.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/wraith_node.json @@ -22,14 +22,13 @@ }, "requirements": [ [ - "has_nebulous_heart", - "has_the_recipe" + "has_the_recipe", + "has_nebulous_heart" ] ], "rewards": { "recipes": [ "reliquary:wraith_node" ] - }, - "sends_telemetry_event": false + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/misc/zombie_heart.json b/src/generated/resources/data/reliquary/advancements/recipes/misc/zombie_heart.json new file mode 100644 index 00000000..6ddf09f5 --- /dev/null +++ b/src/generated/resources/data/reliquary/advancements/recipes/misc/zombie_heart.json @@ -0,0 +1,39 @@ +{ + "neoforge:conditions": [ + { + "type": "reliquary:mob_drops_craftable" + } + ], + "parent": "minecraft:recipes/root", + "criteria": { + "has_rotten_flesh": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:rotten_flesh" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "reliquary:zombie_heart" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_rotten_flesh" + ] + ], + "rewards": { + "recipes": [ + "reliquary:zombie_heart" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/advancements/recipes/mob_charm.json b/src/generated/resources/data/reliquary/advancements/recipes/uncrafting/spawn_egg.json similarity index 67% rename from src/generated/resources/data/reliquary/advancements/recipes/mob_charm.json rename to src/generated/resources/data/reliquary/advancements/recipes/uncrafting/spawn_egg.json index 3d0d0e0d..05e27085 100644 --- a/src/generated/resources/data/reliquary/advancements/recipes/mob_charm.json +++ b/src/generated/resources/data/reliquary/advancements/recipes/uncrafting/spawn_egg.json @@ -1,4 +1,9 @@ { + "neoforge:conditions": [ + { + "type": "reliquary:spawn_egg_enabled" + } + ], "parent": "minecraft:recipes/root", "criteria": { "has_mob_charm_fragment": { @@ -15,21 +20,20 @@ }, "has_the_recipe": { "conditions": { - "recipe": "reliquary:mob_charm" + "recipe": "reliquary:uncrafting/spawn_egg" }, "trigger": "minecraft:recipe_unlocked" } }, "requirements": [ [ - "has_mob_charm_fragment", - "has_the_recipe" + "has_the_recipe", + "has_mob_charm_fragment" ] ], "rewards": { "recipes": [ - "reliquary:mob_charm" + "reliquary:uncrafting/spawn_egg" ] - }, - "sends_telemetry_event": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/loot_modifiers/chests/abandoned_mineshaft.json b/src/generated/resources/data/reliquary/loot_modifiers/chests/abandoned_mineshaft.json index fd7b3628..7dc6280f 100644 --- a/src/generated/resources/data/reliquary/loot_modifiers/chests/abandoned_mineshaft.json +++ b/src/generated/resources/data/reliquary/loot_modifiers/chests/abandoned_mineshaft.json @@ -5,7 +5,7 @@ "condition": "reliquary:chest_loot_enabled" }, { - "condition": "forge:loot_table_id", + "condition": "neoforge:loot_table_id", "loot_table_id": "minecraft:chests/abandoned_mineshaft" } ], diff --git a/src/generated/resources/data/reliquary/loot_modifiers/chests/desert_pyramid.json b/src/generated/resources/data/reliquary/loot_modifiers/chests/desert_pyramid.json index 978253bd..7a15900e 100644 --- a/src/generated/resources/data/reliquary/loot_modifiers/chests/desert_pyramid.json +++ b/src/generated/resources/data/reliquary/loot_modifiers/chests/desert_pyramid.json @@ -5,7 +5,7 @@ "condition": "reliquary:chest_loot_enabled" }, { - "condition": "forge:loot_table_id", + "condition": "neoforge:loot_table_id", "loot_table_id": "minecraft:chests/desert_pyramid" } ], diff --git a/src/generated/resources/data/reliquary/loot_modifiers/chests/end_city_treasure.json b/src/generated/resources/data/reliquary/loot_modifiers/chests/end_city_treasure.json index 63caad35..4375d2a4 100644 --- a/src/generated/resources/data/reliquary/loot_modifiers/chests/end_city_treasure.json +++ b/src/generated/resources/data/reliquary/loot_modifiers/chests/end_city_treasure.json @@ -5,7 +5,7 @@ "condition": "reliquary:chest_loot_enabled" }, { - "condition": "forge:loot_table_id", + "condition": "neoforge:loot_table_id", "loot_table_id": "minecraft:chests/end_city_treasure" } ], diff --git a/src/generated/resources/data/reliquary/loot_modifiers/chests/igloo_chest.json b/src/generated/resources/data/reliquary/loot_modifiers/chests/igloo_chest.json index b7a5031a..9015fb95 100644 --- a/src/generated/resources/data/reliquary/loot_modifiers/chests/igloo_chest.json +++ b/src/generated/resources/data/reliquary/loot_modifiers/chests/igloo_chest.json @@ -5,7 +5,7 @@ "condition": "reliquary:chest_loot_enabled" }, { - "condition": "forge:loot_table_id", + "condition": "neoforge:loot_table_id", "loot_table_id": "minecraft:chests/igloo_chest" } ], diff --git a/src/generated/resources/data/reliquary/loot_modifiers/chests/jungle_temple.json b/src/generated/resources/data/reliquary/loot_modifiers/chests/jungle_temple.json index aa9c2948..b6fb136e 100644 --- a/src/generated/resources/data/reliquary/loot_modifiers/chests/jungle_temple.json +++ b/src/generated/resources/data/reliquary/loot_modifiers/chests/jungle_temple.json @@ -5,7 +5,7 @@ "condition": "reliquary:chest_loot_enabled" }, { - "condition": "forge:loot_table_id", + "condition": "neoforge:loot_table_id", "loot_table_id": "minecraft:chests/jungle_temple" } ], diff --git a/src/generated/resources/data/reliquary/loot_modifiers/chests/nether_bridge.json b/src/generated/resources/data/reliquary/loot_modifiers/chests/nether_bridge.json index 6eda5d07..90739a89 100644 --- a/src/generated/resources/data/reliquary/loot_modifiers/chests/nether_bridge.json +++ b/src/generated/resources/data/reliquary/loot_modifiers/chests/nether_bridge.json @@ -5,7 +5,7 @@ "condition": "reliquary:chest_loot_enabled" }, { - "condition": "forge:loot_table_id", + "condition": "neoforge:loot_table_id", "loot_table_id": "minecraft:chests/nether_bridge" } ], diff --git a/src/generated/resources/data/reliquary/loot_modifiers/chests/simple_dungeon.json b/src/generated/resources/data/reliquary/loot_modifiers/chests/simple_dungeon.json index 5aa6b6a9..1b3fde22 100644 --- a/src/generated/resources/data/reliquary/loot_modifiers/chests/simple_dungeon.json +++ b/src/generated/resources/data/reliquary/loot_modifiers/chests/simple_dungeon.json @@ -5,7 +5,7 @@ "condition": "reliquary:chest_loot_enabled" }, { - "condition": "forge:loot_table_id", + "condition": "neoforge:loot_table_id", "loot_table_id": "minecraft:chests/simple_dungeon" } ], diff --git a/src/generated/resources/data/reliquary/loot_modifiers/chests/stronghold_corridor.json b/src/generated/resources/data/reliquary/loot_modifiers/chests/stronghold_corridor.json index 4b791a60..49173339 100644 --- a/src/generated/resources/data/reliquary/loot_modifiers/chests/stronghold_corridor.json +++ b/src/generated/resources/data/reliquary/loot_modifiers/chests/stronghold_corridor.json @@ -5,7 +5,7 @@ "condition": "reliquary:chest_loot_enabled" }, { - "condition": "forge:loot_table_id", + "condition": "neoforge:loot_table_id", "loot_table_id": "minecraft:chests/stronghold_corridor" } ], diff --git a/src/generated/resources/data/reliquary/loot_modifiers/chests/stronghold_crossing.json b/src/generated/resources/data/reliquary/loot_modifiers/chests/stronghold_crossing.json index a4bfd546..65039a56 100644 --- a/src/generated/resources/data/reliquary/loot_modifiers/chests/stronghold_crossing.json +++ b/src/generated/resources/data/reliquary/loot_modifiers/chests/stronghold_crossing.json @@ -5,7 +5,7 @@ "condition": "reliquary:chest_loot_enabled" }, { - "condition": "forge:loot_table_id", + "condition": "neoforge:loot_table_id", "loot_table_id": "minecraft:chests/stronghold_crossing" } ], diff --git a/src/generated/resources/data/reliquary/loot_modifiers/chests/stronghold_library.json b/src/generated/resources/data/reliquary/loot_modifiers/chests/stronghold_library.json index a465a848..3f1df876 100644 --- a/src/generated/resources/data/reliquary/loot_modifiers/chests/stronghold_library.json +++ b/src/generated/resources/data/reliquary/loot_modifiers/chests/stronghold_library.json @@ -5,7 +5,7 @@ "condition": "reliquary:chest_loot_enabled" }, { - "condition": "forge:loot_table_id", + "condition": "neoforge:loot_table_id", "loot_table_id": "minecraft:chests/stronghold_library" } ], diff --git a/src/generated/resources/data/reliquary/loot_modifiers/chests/village/village_weaponsmith.json b/src/generated/resources/data/reliquary/loot_modifiers/chests/village/village_weaponsmith.json index 68f195a9..3b49b31d 100644 --- a/src/generated/resources/data/reliquary/loot_modifiers/chests/village/village_weaponsmith.json +++ b/src/generated/resources/data/reliquary/loot_modifiers/chests/village/village_weaponsmith.json @@ -5,7 +5,7 @@ "condition": "reliquary:chest_loot_enabled" }, { - "condition": "forge:loot_table_id", + "condition": "neoforge:loot_table_id", "loot_table_id": "minecraft:chests/village/village_weaponsmith" } ], diff --git a/src/generated/resources/data/reliquary/loot_modifiers/entities/bat.json b/src/generated/resources/data/reliquary/loot_modifiers/entities/bat.json index ae3230c7..b84c2f6b 100644 --- a/src/generated/resources/data/reliquary/loot_modifiers/entities/bat.json +++ b/src/generated/resources/data/reliquary/loot_modifiers/entities/bat.json @@ -5,7 +5,7 @@ "condition": "reliquary:entity_loot_enabled" }, { - "condition": "forge:loot_table_id", + "condition": "neoforge:loot_table_id", "loot_table_id": "minecraft:entities/bat" } ], diff --git a/src/generated/resources/data/reliquary/loot_modifiers/entities/blaze.json b/src/generated/resources/data/reliquary/loot_modifiers/entities/blaze.json index cda3f24f..cd26b5e9 100644 --- a/src/generated/resources/data/reliquary/loot_modifiers/entities/blaze.json +++ b/src/generated/resources/data/reliquary/loot_modifiers/entities/blaze.json @@ -5,7 +5,7 @@ "condition": "reliquary:entity_loot_enabled" }, { - "condition": "forge:loot_table_id", + "condition": "neoforge:loot_table_id", "loot_table_id": "minecraft:entities/blaze" } ], diff --git a/src/generated/resources/data/reliquary/loot_modifiers/entities/cave_spider.json b/src/generated/resources/data/reliquary/loot_modifiers/entities/cave_spider.json index dd2e9d66..1f23694e 100644 --- a/src/generated/resources/data/reliquary/loot_modifiers/entities/cave_spider.json +++ b/src/generated/resources/data/reliquary/loot_modifiers/entities/cave_spider.json @@ -5,7 +5,7 @@ "condition": "reliquary:entity_loot_enabled" }, { - "condition": "forge:loot_table_id", + "condition": "neoforge:loot_table_id", "loot_table_id": "minecraft:entities/cave_spider" } ], diff --git a/src/generated/resources/data/reliquary/loot_modifiers/entities/creeper.json b/src/generated/resources/data/reliquary/loot_modifiers/entities/creeper.json index 0903fbd6..e16e5870 100644 --- a/src/generated/resources/data/reliquary/loot_modifiers/entities/creeper.json +++ b/src/generated/resources/data/reliquary/loot_modifiers/entities/creeper.json @@ -5,7 +5,7 @@ "condition": "reliquary:entity_loot_enabled" }, { - "condition": "forge:loot_table_id", + "condition": "neoforge:loot_table_id", "loot_table_id": "minecraft:entities/creeper" } ], diff --git a/src/generated/resources/data/reliquary/loot_modifiers/entities/enderman.json b/src/generated/resources/data/reliquary/loot_modifiers/entities/enderman.json index e933e0d5..e7b24fa9 100644 --- a/src/generated/resources/data/reliquary/loot_modifiers/entities/enderman.json +++ b/src/generated/resources/data/reliquary/loot_modifiers/entities/enderman.json @@ -5,7 +5,7 @@ "condition": "reliquary:entity_loot_enabled" }, { - "condition": "forge:loot_table_id", + "condition": "neoforge:loot_table_id", "loot_table_id": "minecraft:entities/enderman" } ], diff --git a/src/generated/resources/data/reliquary/loot_modifiers/entities/ghast.json b/src/generated/resources/data/reliquary/loot_modifiers/entities/ghast.json index de4de90e..bee8e41c 100644 --- a/src/generated/resources/data/reliquary/loot_modifiers/entities/ghast.json +++ b/src/generated/resources/data/reliquary/loot_modifiers/entities/ghast.json @@ -5,7 +5,7 @@ "condition": "reliquary:entity_loot_enabled" }, { - "condition": "forge:loot_table_id", + "condition": "neoforge:loot_table_id", "loot_table_id": "minecraft:entities/ghast" } ], diff --git a/src/generated/resources/data/reliquary/loot_modifiers/entities/guardian.json b/src/generated/resources/data/reliquary/loot_modifiers/entities/guardian.json index d6221209..2c3d113d 100644 --- a/src/generated/resources/data/reliquary/loot_modifiers/entities/guardian.json +++ b/src/generated/resources/data/reliquary/loot_modifiers/entities/guardian.json @@ -5,7 +5,7 @@ "condition": "reliquary:entity_loot_enabled" }, { - "condition": "forge:loot_table_id", + "condition": "neoforge:loot_table_id", "loot_table_id": "minecraft:entities/guardian" } ], diff --git a/src/generated/resources/data/reliquary/loot_modifiers/entities/husk.json b/src/generated/resources/data/reliquary/loot_modifiers/entities/husk.json index 2c8d5628..73c410f4 100644 --- a/src/generated/resources/data/reliquary/loot_modifiers/entities/husk.json +++ b/src/generated/resources/data/reliquary/loot_modifiers/entities/husk.json @@ -5,7 +5,7 @@ "condition": "reliquary:entity_loot_enabled" }, { - "condition": "forge:loot_table_id", + "condition": "neoforge:loot_table_id", "loot_table_id": "minecraft:entities/husk" } ], diff --git a/src/generated/resources/data/reliquary/loot_modifiers/entities/magma_cube.json b/src/generated/resources/data/reliquary/loot_modifiers/entities/magma_cube.json index 84b89f67..53a79cc6 100644 --- a/src/generated/resources/data/reliquary/loot_modifiers/entities/magma_cube.json +++ b/src/generated/resources/data/reliquary/loot_modifiers/entities/magma_cube.json @@ -5,7 +5,7 @@ "condition": "reliquary:entity_loot_enabled" }, { - "condition": "forge:loot_table_id", + "condition": "neoforge:loot_table_id", "loot_table_id": "minecraft:entities/magma_cube" } ], diff --git a/src/generated/resources/data/reliquary/loot_modifiers/entities/skeleton.json b/src/generated/resources/data/reliquary/loot_modifiers/entities/skeleton.json index 5f77cd0f..0af67f17 100644 --- a/src/generated/resources/data/reliquary/loot_modifiers/entities/skeleton.json +++ b/src/generated/resources/data/reliquary/loot_modifiers/entities/skeleton.json @@ -5,7 +5,7 @@ "condition": "reliquary:entity_loot_enabled" }, { - "condition": "forge:loot_table_id", + "condition": "neoforge:loot_table_id", "loot_table_id": "minecraft:entities/skeleton" } ], diff --git a/src/generated/resources/data/reliquary/loot_modifiers/entities/slime.json b/src/generated/resources/data/reliquary/loot_modifiers/entities/slime.json index d3a40618..3e99ff79 100644 --- a/src/generated/resources/data/reliquary/loot_modifiers/entities/slime.json +++ b/src/generated/resources/data/reliquary/loot_modifiers/entities/slime.json @@ -5,7 +5,7 @@ "condition": "reliquary:entity_loot_enabled" }, { - "condition": "forge:loot_table_id", + "condition": "neoforge:loot_table_id", "loot_table_id": "minecraft:entities/slime" } ], diff --git a/src/generated/resources/data/reliquary/loot_modifiers/entities/snow_golem.json b/src/generated/resources/data/reliquary/loot_modifiers/entities/snow_golem.json index c6e1957a..898f6f04 100644 --- a/src/generated/resources/data/reliquary/loot_modifiers/entities/snow_golem.json +++ b/src/generated/resources/data/reliquary/loot_modifiers/entities/snow_golem.json @@ -5,7 +5,7 @@ "condition": "reliquary:entity_loot_enabled" }, { - "condition": "forge:loot_table_id", + "condition": "neoforge:loot_table_id", "loot_table_id": "minecraft:entities/snow_golem" } ], diff --git a/src/generated/resources/data/reliquary/loot_modifiers/entities/spider.json b/src/generated/resources/data/reliquary/loot_modifiers/entities/spider.json index 0c883ace..5f1ce2bb 100644 --- a/src/generated/resources/data/reliquary/loot_modifiers/entities/spider.json +++ b/src/generated/resources/data/reliquary/loot_modifiers/entities/spider.json @@ -5,7 +5,7 @@ "condition": "reliquary:entity_loot_enabled" }, { - "condition": "forge:loot_table_id", + "condition": "neoforge:loot_table_id", "loot_table_id": "minecraft:entities/spider" } ], diff --git a/src/generated/resources/data/reliquary/loot_modifiers/entities/squid.json b/src/generated/resources/data/reliquary/loot_modifiers/entities/squid.json index 3a3621b3..7cddb212 100644 --- a/src/generated/resources/data/reliquary/loot_modifiers/entities/squid.json +++ b/src/generated/resources/data/reliquary/loot_modifiers/entities/squid.json @@ -5,7 +5,7 @@ "condition": "reliquary:entity_loot_enabled" }, { - "condition": "forge:loot_table_id", + "condition": "neoforge:loot_table_id", "loot_table_id": "minecraft:entities/squid" } ], diff --git a/src/generated/resources/data/reliquary/loot_modifiers/entities/stray.json b/src/generated/resources/data/reliquary/loot_modifiers/entities/stray.json index 2dd0c074..9800df0f 100644 --- a/src/generated/resources/data/reliquary/loot_modifiers/entities/stray.json +++ b/src/generated/resources/data/reliquary/loot_modifiers/entities/stray.json @@ -5,7 +5,7 @@ "condition": "reliquary:entity_loot_enabled" }, { - "condition": "forge:loot_table_id", + "condition": "neoforge:loot_table_id", "loot_table_id": "minecraft:entities/stray" } ], diff --git a/src/generated/resources/data/reliquary/loot_modifiers/entities/witch.json b/src/generated/resources/data/reliquary/loot_modifiers/entities/witch.json index e68ab74b..85928789 100644 --- a/src/generated/resources/data/reliquary/loot_modifiers/entities/witch.json +++ b/src/generated/resources/data/reliquary/loot_modifiers/entities/witch.json @@ -5,7 +5,7 @@ "condition": "reliquary:entity_loot_enabled" }, { - "condition": "forge:loot_table_id", + "condition": "neoforge:loot_table_id", "loot_table_id": "minecraft:entities/witch" } ], diff --git a/src/generated/resources/data/reliquary/loot_modifiers/entities/wither_skeleton.json b/src/generated/resources/data/reliquary/loot_modifiers/entities/wither_skeleton.json index e5873392..1514d993 100644 --- a/src/generated/resources/data/reliquary/loot_modifiers/entities/wither_skeleton.json +++ b/src/generated/resources/data/reliquary/loot_modifiers/entities/wither_skeleton.json @@ -5,7 +5,7 @@ "condition": "reliquary:entity_loot_enabled" }, { - "condition": "forge:loot_table_id", + "condition": "neoforge:loot_table_id", "loot_table_id": "minecraft:entities/wither_skeleton" } ], diff --git a/src/generated/resources/data/reliquary/loot_modifiers/entities/zombie.json b/src/generated/resources/data/reliquary/loot_modifiers/entities/zombie.json index 8b4575b7..14d457aa 100644 --- a/src/generated/resources/data/reliquary/loot_modifiers/entities/zombie.json +++ b/src/generated/resources/data/reliquary/loot_modifiers/entities/zombie.json @@ -5,7 +5,7 @@ "condition": "reliquary:entity_loot_enabled" }, { - "condition": "forge:loot_table_id", + "condition": "neoforge:loot_table_id", "loot_table_id": "minecraft:entities/zombie" } ], diff --git a/src/generated/resources/data/reliquary/loot_modifiers/entities/zombie_villager.json b/src/generated/resources/data/reliquary/loot_modifiers/entities/zombie_villager.json index 0051354d..6b76dd84 100644 --- a/src/generated/resources/data/reliquary/loot_modifiers/entities/zombie_villager.json +++ b/src/generated/resources/data/reliquary/loot_modifiers/entities/zombie_villager.json @@ -5,7 +5,7 @@ "condition": "reliquary:entity_loot_enabled" }, { - "condition": "forge:loot_table_id", + "condition": "neoforge:loot_table_id", "loot_table_id": "minecraft:entities/zombie_villager" } ], diff --git a/src/generated/resources/data/reliquary/loot_modifiers/entities/zombified_piglin.json b/src/generated/resources/data/reliquary/loot_modifiers/entities/zombified_piglin.json index a86acb5f..2a4a88f3 100644 --- a/src/generated/resources/data/reliquary/loot_modifiers/entities/zombified_piglin.json +++ b/src/generated/resources/data/reliquary/loot_modifiers/entities/zombified_piglin.json @@ -5,7 +5,7 @@ "condition": "reliquary:entity_loot_enabled" }, { - "condition": "forge:loot_table_id", + "condition": "neoforge:loot_table_id", "loot_table_id": "minecraft:entities/zombified_piglin" } ], diff --git a/src/generated/resources/data/reliquary/recipes/alkahestry/charging/glowstone.json b/src/generated/resources/data/reliquary/recipes/alkahestry/charging/glowstone.json index 36973add..678753f0 100644 --- a/src/generated/resources/data/reliquary/recipes/alkahestry/charging/glowstone.json +++ b/src/generated/resources/data/reliquary/recipes/alkahestry/charging/glowstone.json @@ -1,19 +1,12 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:alkahestry_enabled" - } - ], - "recipe": { - "type": "reliquary:alkahestry_charging", - "charge": 4, - "ingredient": { - "item": "minecraft:glowstone" - } - } + "type": "reliquary:alkahestry_enabled" } - ] + ], + "type": "reliquary:alkahestry_charging", + "charge": 4, + "ingredient": { + "item": "minecraft:glowstone" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/alkahestry/charging/glowstone_dust.json b/src/generated/resources/data/reliquary/recipes/alkahestry/charging/glowstone_dust.json index a30f31cd..6fefae26 100644 --- a/src/generated/resources/data/reliquary/recipes/alkahestry/charging/glowstone_dust.json +++ b/src/generated/resources/data/reliquary/recipes/alkahestry/charging/glowstone_dust.json @@ -1,19 +1,12 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:alkahestry_enabled" - } - ], - "recipe": { - "type": "reliquary:alkahestry_charging", - "charge": 1, - "ingredient": { - "item": "minecraft:glowstone_dust" - } - } + "type": "reliquary:alkahestry_enabled" } - ] + ], + "type": "reliquary:alkahestry_charging", + "charge": 1, + "ingredient": { + "item": "minecraft:glowstone_dust" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/alkahestry/charging/redstone.json b/src/generated/resources/data/reliquary/recipes/alkahestry/charging/redstone.json index 2e62c30b..de9fb114 100644 --- a/src/generated/resources/data/reliquary/recipes/alkahestry/charging/redstone.json +++ b/src/generated/resources/data/reliquary/recipes/alkahestry/charging/redstone.json @@ -1,19 +1,12 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:alkahestry_enabled" - } - ], - "recipe": { - "type": "reliquary:alkahestry_charging", - "charge": 1, - "ingredient": { - "item": "minecraft:redstone" - } - } + "type": "reliquary:alkahestry_enabled" } - ] + ], + "type": "reliquary:alkahestry_charging", + "charge": 1, + "ingredient": { + "item": "minecraft:redstone" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/alkahestry/charging/redstone_block.json b/src/generated/resources/data/reliquary/recipes/alkahestry/charging/redstone_block.json index fbfbd3cf..43bf8cf7 100644 --- a/src/generated/resources/data/reliquary/recipes/alkahestry/charging/redstone_block.json +++ b/src/generated/resources/data/reliquary/recipes/alkahestry/charging/redstone_block.json @@ -1,19 +1,12 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:alkahestry_enabled" - } - ], - "recipe": { - "type": "reliquary:alkahestry_charging", - "charge": 9, - "ingredient": { - "item": "minecraft:redstone_block" - } - } + "type": "reliquary:alkahestry_enabled" } - ] + ], + "type": "reliquary:alkahestry_charging", + "charge": 9, + "ingredient": { + "item": "minecraft:redstone_block" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/charcoal.json b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/charcoal.json index 58c8a693..86a7cb39 100644 --- a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/charcoal.json +++ b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/charcoal.json @@ -1,20 +1,13 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:alkahestry_enabled" - } - ], - "recipe": { - "type": "reliquary:alkahestry_crafting", - "charge": 4, - "ingredient": { - "item": "minecraft:charcoal" - }, - "result_count": 5 - } + "type": "reliquary:alkahestry_enabled" } - ] + ], + "type": "reliquary:alkahestry_crafting", + "charge": 4, + "ingredient": { + "item": "minecraft:charcoal" + }, + "result_count": 5 } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/clay.json b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/clay.json index 2209bb07..d32c3e5a 100644 --- a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/clay.json +++ b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/clay.json @@ -1,20 +1,13 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:alkahestry_enabled" - } - ], - "recipe": { - "type": "reliquary:alkahestry_crafting", - "charge": 4, - "ingredient": { - "item": "minecraft:clay" - }, - "result_count": 3 - } + "type": "reliquary:alkahestry_enabled" } - ] + ], + "type": "reliquary:alkahestry_crafting", + "charge": 4, + "ingredient": { + "item": "minecraft:clay" + }, + "result_count": 3 } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/copper_ingot.json b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/copper_ingot.json index 36c4697d..582c5adb 100644 --- a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/copper_ingot.json +++ b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/copper_ingot.json @@ -1,27 +1,20 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:alkahestry_enabled" - }, - { - "type": "forge:not", - "value": { - "type": "forge:tag_empty", - "tag": "forge:ingots/copper" - } - } - ], - "recipe": { - "type": "reliquary:alkahestry_crafting", - "charge": 8, - "ingredient": { - "tag": "forge:ingots/copper" - }, - "result_count": 5 + "type": "neoforge:not", + "value": { + "type": "neoforge:tag_empty", + "tag": "forge:ingots/copper" } + }, + { + "type": "reliquary:alkahestry_enabled" } - ] + ], + "type": "reliquary:alkahestry_crafting", + "charge": 8, + "ingredient": { + "tag": "forge:ingots/copper" + }, + "result_count": 5 } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/diamond.json b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/diamond.json index 85dbdca5..2878ad98 100644 --- a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/diamond.json +++ b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/diamond.json @@ -1,20 +1,13 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:alkahestry_enabled" - } - ], - "recipe": { - "type": "reliquary:alkahestry_crafting", - "charge": 64, - "ingredient": { - "tag": "forge:gems/diamond" - }, - "result_count": 2 - } + "type": "reliquary:alkahestry_enabled" } - ] + ], + "type": "reliquary:alkahestry_crafting", + "charge": 64, + "ingredient": { + "tag": "forge:gems/diamond" + }, + "result_count": 2 } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/dirt.json b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/dirt.json index 511a2ef3..3dd32af6 100644 --- a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/dirt.json +++ b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/dirt.json @@ -1,20 +1,13 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:alkahestry_enabled" - } - ], - "recipe": { - "type": "reliquary:alkahestry_crafting", - "charge": 4, - "ingredient": { - "item": "minecraft:dirt" - }, - "result_count": 33 - } + "type": "reliquary:alkahestry_enabled" } - ] + ], + "type": "reliquary:alkahestry_crafting", + "charge": 4, + "ingredient": { + "item": "minecraft:dirt" + }, + "result_count": 33 } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/emerald.json b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/emerald.json index c3ef3fae..699c41e4 100644 --- a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/emerald.json +++ b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/emerald.json @@ -1,20 +1,13 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:alkahestry_enabled" - } - ], - "recipe": { - "type": "reliquary:alkahestry_crafting", - "charge": 32, - "ingredient": { - "tag": "forge:gems/emerald" - }, - "result_count": 2 - } + "type": "reliquary:alkahestry_enabled" } - ] + ], + "type": "reliquary:alkahestry_crafting", + "charge": 32, + "ingredient": { + "tag": "forge:gems/emerald" + }, + "result_count": 2 } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/end_stone.json b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/end_stone.json index ae5ff15e..c17818b0 100644 --- a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/end_stone.json +++ b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/end_stone.json @@ -1,20 +1,13 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:alkahestry_enabled" - } - ], - "recipe": { - "type": "reliquary:alkahestry_crafting", - "charge": 8, - "ingredient": { - "tag": "forge:end_stones" - }, - "result_count": 17 - } + "type": "reliquary:alkahestry_enabled" } - ] + ], + "type": "reliquary:alkahestry_crafting", + "charge": 8, + "ingredient": { + "tag": "forge:end_stones" + }, + "result_count": 17 } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/flint.json b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/flint.json index 97f38f90..858e340f 100644 --- a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/flint.json +++ b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/flint.json @@ -1,20 +1,13 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:alkahestry_enabled" - } - ], - "recipe": { - "type": "reliquary:alkahestry_crafting", - "charge": 8, - "ingredient": { - "item": "minecraft:flint" - }, - "result_count": 9 - } + "type": "reliquary:alkahestry_enabled" } - ] + ], + "type": "reliquary:alkahestry_crafting", + "charge": 8, + "ingredient": { + "item": "minecraft:flint" + }, + "result_count": 9 } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/gold_ingot.json b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/gold_ingot.json index 1c35d150..edc8e9a3 100644 --- a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/gold_ingot.json +++ b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/gold_ingot.json @@ -1,20 +1,13 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:alkahestry_enabled" - } - ], - "recipe": { - "type": "reliquary:alkahestry_crafting", - "charge": 32, - "ingredient": { - "tag": "forge:ingots/gold" - }, - "result_count": 2 - } + "type": "reliquary:alkahestry_enabled" } - ] + ], + "type": "reliquary:alkahestry_crafting", + "charge": 32, + "ingredient": { + "tag": "forge:ingots/gold" + }, + "result_count": 2 } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/gravel.json b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/gravel.json index a7ee77ed..2121dc8c 100644 --- a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/gravel.json +++ b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/gravel.json @@ -1,20 +1,13 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:alkahestry_enabled" - } - ], - "recipe": { - "type": "reliquary:alkahestry_crafting", - "charge": 4, - "ingredient": { - "tag": "forge:gravel" - }, - "result_count": 17 - } + "type": "reliquary:alkahestry_enabled" } - ] + ], + "type": "reliquary:alkahestry_crafting", + "charge": 4, + "ingredient": { + "tag": "forge:gravel" + }, + "result_count": 17 } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/gunpowder.json b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/gunpowder.json index 6d9f8320..1c498e81 100644 --- a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/gunpowder.json +++ b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/gunpowder.json @@ -1,20 +1,13 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:alkahestry_enabled" - } - ], - "recipe": { - "type": "reliquary:alkahestry_crafting", - "charge": 8, - "ingredient": { - "tag": "forge:gunpowder" - }, - "result_count": 3 - } + "type": "reliquary:alkahestry_enabled" } - ] + ], + "type": "reliquary:alkahestry_crafting", + "charge": 8, + "ingredient": { + "tag": "forge:gunpowder" + }, + "result_count": 3 } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/iron_ingot.json b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/iron_ingot.json index e128a09f..dca6e2f9 100644 --- a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/iron_ingot.json +++ b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/iron_ingot.json @@ -1,20 +1,13 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:alkahestry_enabled" - } - ], - "recipe": { - "type": "reliquary:alkahestry_crafting", - "charge": 32, - "ingredient": { - "tag": "forge:ingots/iron" - }, - "result_count": 2 - } + "type": "reliquary:alkahestry_enabled" } - ] + ], + "type": "reliquary:alkahestry_crafting", + "charge": 32, + "ingredient": { + "tag": "forge:ingots/iron" + }, + "result_count": 2 } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/lapis_lazuli.json b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/lapis_lazuli.json index c425fe94..3313e850 100644 --- a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/lapis_lazuli.json +++ b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/lapis_lazuli.json @@ -1,20 +1,13 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:alkahestry_enabled" - } - ], - "recipe": { - "type": "reliquary:alkahestry_crafting", - "charge": 4, - "ingredient": { - "tag": "forge:gems/lapis" - }, - "result_count": 2 - } + "type": "reliquary:alkahestry_enabled" } - ] + ], + "type": "reliquary:alkahestry_crafting", + "charge": 4, + "ingredient": { + "tag": "forge:gems/lapis" + }, + "result_count": 2 } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/nether_star.json b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/nether_star.json index 10f2ca4b..9c66fb66 100644 --- a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/nether_star.json +++ b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/nether_star.json @@ -1,20 +1,13 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:alkahestry_enabled" - } - ], - "recipe": { - "type": "reliquary:alkahestry_crafting", - "charge": 256, - "ingredient": { - "tag": "forge:nether_stars" - }, - "result_count": 2 - } + "type": "reliquary:alkahestry_enabled" } - ] + ], + "type": "reliquary:alkahestry_crafting", + "charge": 256, + "ingredient": { + "tag": "forge:nether_stars" + }, + "result_count": 2 } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/netherrack.json b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/netherrack.json index bb603e7c..40c89ef9 100644 --- a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/netherrack.json +++ b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/netherrack.json @@ -1,20 +1,13 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:alkahestry_enabled" - } - ], - "recipe": { - "type": "reliquary:alkahestry_crafting", - "charge": 4, - "ingredient": { - "tag": "forge:netherrack" - }, - "result_count": 9 - } + "type": "reliquary:alkahestry_enabled" } - ] + ], + "type": "reliquary:alkahestry_crafting", + "charge": 4, + "ingredient": { + "tag": "forge:netherrack" + }, + "result_count": 9 } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/obsidian.json b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/obsidian.json index d41c61a8..148b7cf5 100644 --- a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/obsidian.json +++ b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/obsidian.json @@ -1,20 +1,13 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:alkahestry_enabled" - } - ], - "recipe": { - "type": "reliquary:alkahestry_crafting", - "charge": 8, - "ingredient": { - "tag": "forge:obsidian" - }, - "result_count": 5 - } + "type": "reliquary:alkahestry_enabled" } - ] + ], + "type": "reliquary:alkahestry_crafting", + "charge": 8, + "ingredient": { + "tag": "forge:obsidian" + }, + "result_count": 5 } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/sand.json b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/sand.json index a3c2bc39..3ea25277 100644 --- a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/sand.json +++ b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/sand.json @@ -1,20 +1,13 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:alkahestry_enabled" - } - ], - "recipe": { - "type": "reliquary:alkahestry_crafting", - "charge": 4, - "ingredient": { - "tag": "forge:sand" - }, - "result_count": 33 - } + "type": "reliquary:alkahestry_enabled" } - ] + ], + "type": "reliquary:alkahestry_crafting", + "charge": 4, + "ingredient": { + "tag": "forge:sand" + }, + "result_count": 33 } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/sandstone.json b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/sandstone.json index 1cce75fb..fe6e616d 100644 --- a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/sandstone.json +++ b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/sandstone.json @@ -1,20 +1,13 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:alkahestry_enabled" - } - ], - "recipe": { - "type": "reliquary:alkahestry_crafting", - "charge": 4, - "ingredient": { - "tag": "forge:sandstone" - }, - "result_count": 9 - } + "type": "reliquary:alkahestry_enabled" } - ] + ], + "type": "reliquary:alkahestry_crafting", + "charge": 4, + "ingredient": { + "tag": "forge:sandstone" + }, + "result_count": 9 } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/silver_ingot.json b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/silver_ingot.json index 1985e009..985328aa 100644 --- a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/silver_ingot.json +++ b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/silver_ingot.json @@ -1,27 +1,20 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:alkahestry_enabled" - }, - { - "type": "forge:not", - "value": { - "type": "forge:tag_empty", - "tag": "forge:ingots/silver" - } - } - ], - "recipe": { - "type": "reliquary:alkahestry_crafting", - "charge": 32, - "ingredient": { - "tag": "forge:ingots/silver" - }, - "result_count": 2 + "type": "neoforge:not", + "value": { + "type": "neoforge:tag_empty", + "tag": "forge:ingots/silver" } + }, + { + "type": "reliquary:alkahestry_enabled" } - ] + ], + "type": "reliquary:alkahestry_crafting", + "charge": 32, + "ingredient": { + "tag": "forge:ingots/silver" + }, + "result_count": 2 } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/soul_sand.json b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/soul_sand.json index c5b95fc2..c09e7d3d 100644 --- a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/soul_sand.json +++ b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/soul_sand.json @@ -1,20 +1,13 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:alkahestry_enabled" - } - ], - "recipe": { - "type": "reliquary:alkahestry_crafting", - "charge": 8, - "ingredient": { - "item": "minecraft:soul_sand" - }, - "result_count": 9 - } + "type": "reliquary:alkahestry_enabled" } - ] + ], + "type": "reliquary:alkahestry_crafting", + "charge": 8, + "ingredient": { + "item": "minecraft:soul_sand" + }, + "result_count": 9 } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/steel_ingot.json b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/steel_ingot.json index 686d1599..e577e9dd 100644 --- a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/steel_ingot.json +++ b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/steel_ingot.json @@ -1,27 +1,20 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:alkahestry_enabled" - }, - { - "type": "forge:not", - "value": { - "type": "forge:tag_empty", - "tag": "forge:ingots/steel" - } - } - ], - "recipe": { - "type": "reliquary:alkahestry_crafting", - "charge": 32, - "ingredient": { - "tag": "forge:ingots/steel" - }, - "result_count": 2 + "type": "neoforge:not", + "value": { + "type": "neoforge:tag_empty", + "tag": "forge:ingots/steel" } + }, + { + "type": "reliquary:alkahestry_enabled" } - ] + ], + "type": "reliquary:alkahestry_crafting", + "charge": 32, + "ingredient": { + "tag": "forge:ingots/steel" + }, + "result_count": 2 } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/tin_ingot.json b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/tin_ingot.json index 58d8cdec..12263416 100644 --- a/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/tin_ingot.json +++ b/src/generated/resources/data/reliquary/recipes/alkahestry/crafting/tin_ingot.json @@ -1,27 +1,20 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:alkahestry_enabled" - }, - { - "type": "forge:not", - "value": { - "type": "forge:tag_empty", - "tag": "forge:ingots/tin" - } - } - ], - "recipe": { - "type": "reliquary:alkahestry_crafting", - "charge": 32, - "ingredient": { - "tag": "forge:ingots/tin" - }, - "result_count": 2 + "type": "neoforge:not", + "value": { + "type": "neoforge:tag_empty", + "tag": "forge:ingots/tin" } + }, + { + "type": "reliquary:alkahestry_enabled" } - ] + ], + "type": "reliquary:alkahestry_crafting", + "charge": 32, + "ingredient": { + "tag": "forge:ingots/tin" + }, + "result_count": 2 } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/alkahestry/drain/redstone.json b/src/generated/resources/data/reliquary/recipes/alkahestry/drain/redstone.json index 89628efe..6e76302f 100644 --- a/src/generated/resources/data/reliquary/recipes/alkahestry/drain/redstone.json +++ b/src/generated/resources/data/reliquary/recipes/alkahestry/drain/redstone.json @@ -1,19 +1,13 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:alkahestry_enabled" - } - ], - "recipe": { - "type": "reliquary:alkahestry_drain", - "charge": 1, - "result": { - "item": "minecraft:redstone" - } - } + "type": "reliquary:alkahestry_enabled" } - ] + ], + "type": "reliquary:alkahestry_drain", + "charge": 1, + "result": { + "Count": 1, + "id": "minecraft:redstone" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/alkahestry_tome.json b/src/generated/resources/data/reliquary/recipes/alkahestry_tome.json index 9363edc9..1dece013 100644 --- a/src/generated/resources/data/reliquary/recipes/alkahestry_tome.json +++ b/src/generated/resources/data/reliquary/recipes/alkahestry_tome.json @@ -1,48 +1,41 @@ { - "type": "forge:conditional", - "recipes": [ - { - "conditions": [ - { - "type": "reliquary:alkahestry_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shapeless", - "category": "misc", - "ingredients": [ - { - "item": "reliquary:molten_core" - }, - { - "item": "reliquary:witch_hat" - }, - { - "item": "reliquary:eye_of_the_storm" - }, - { - "item": "reliquary:catalyzing_gland" - }, - { - "item": "minecraft:book" - }, - { - "item": "reliquary:slime_pearl" - }, - { - "item": "reliquary:chelicerae" - }, - { - "item": "minecraft:wither_skeleton_skull" - }, - { - "item": "reliquary:nebulous_heart" - } - ], - "result": { - "item": "reliquary:alkahestry_tome" - } - } + "neoforge:conditions": [ + { + "type": "reliquary:alkahestry_enabled" + } + ], + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "item": "reliquary:molten_core" + }, + { + "item": "reliquary:witch_hat" + }, + { + "item": "reliquary:eye_of_the_storm" + }, + { + "item": "reliquary:catalyzing_gland" + }, + { + "item": "minecraft:book" + }, + { + "item": "reliquary:slime_pearl" + }, + { + "item": "reliquary:chelicerae" + }, + { + "item": "minecraft:wither_skeleton_skull" + }, + { + "item": "reliquary:nebulous_heart" } - ] + ], + "result": { + "item": "reliquary:alkahestry_tome" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/angelheart_vial.json b/src/generated/resources/data/reliquary/recipes/angelheart_vial.json index b5f4ce3f..764573f8 100644 --- a/src/generated/resources/data/reliquary/recipes/angelheart_vial.json +++ b/src/generated/resources/data/reliquary/recipes/angelheart_vial.json @@ -22,6 +22,5 @@ ], "result": { "item": "reliquary:angelheart_vial" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/aphrodite_potion.json b/src/generated/resources/data/reliquary/recipes/aphrodite_potion.json index 850682fa..e6e22b44 100644 --- a/src/generated/resources/data/reliquary/recipes/aphrodite_potion.json +++ b/src/generated/resources/data/reliquary/recipes/aphrodite_potion.json @@ -1,42 +1,34 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:potions_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "B": { - "item": "minecraft:water_bucket" - }, - "C": { - "item": "minecraft:cocoa_beans" - }, - "F": { - "item": "reliquary:fertile_essence" - }, - "G": { - "tag": "forge:glass_panes" - }, - "R": { - "tag": "forge:dyes/red" - } - }, - "pattern": [ - "GBG", - "GFG", - "RGC" - ], - "result": { - "item": "reliquary:aphrodite_potion" - }, - "show_notification": true - } + "type": "reliquary:potions_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "B": { + "item": "minecraft:water_bucket" + }, + "C": { + "item": "minecraft:cocoa_beans" + }, + "F": { + "item": "reliquary:fertile_essence" + }, + "G": { + "tag": "forge:glass_panes" + }, + "R": { + "tag": "forge:dyes/red" + } + }, + "pattern": [ + "GBG", + "GFG", + "RGC" + ], + "result": { + "item": "reliquary:aphrodite_potion" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/apothecary_cauldron.json b/src/generated/resources/data/reliquary/recipes/apothecary_cauldron.json index 77e8aad3..df90cc3f 100644 --- a/src/generated/resources/data/reliquary/recipes/apothecary_cauldron.json +++ b/src/generated/resources/data/reliquary/recipes/apothecary_cauldron.json @@ -1,42 +1,34 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:potions_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "item": "minecraft:cauldron" - }, - "G": { - "item": "reliquary:catalyzing_gland" - }, - "I": { - "item": "reliquary:infernal_claw" - }, - "M": { - "item": "reliquary:molten_core" - }, - "N": { - "item": "reliquary:nebulous_heart" - } - }, - "pattern": [ - "GNG", - "ICI", - "NMN" - ], - "result": { - "item": "reliquary:apothecary_cauldron" - }, - "show_notification": true - } + "type": "reliquary:potions_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "item": "minecraft:cauldron" + }, + "G": { + "item": "reliquary:catalyzing_gland" + }, + "I": { + "item": "reliquary:infernal_claw" + }, + "M": { + "item": "reliquary:molten_core" + }, + "N": { + "item": "reliquary:nebulous_heart" + } + }, + "pattern": [ + "GNG", + "ICI", + "NMN" + ], + "result": { + "item": "reliquary:apothecary_cauldron" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/apothecary_mortar.json b/src/generated/resources/data/reliquary/recipes/apothecary_mortar.json index e8eb1f66..3370420d 100644 --- a/src/generated/resources/data/reliquary/recipes/apothecary_mortar.json +++ b/src/generated/resources/data/reliquary/recipes/apothecary_mortar.json @@ -1,33 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:potions_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "G": { - "item": "reliquary:catalyzing_gland" - }, - "N": { - "tag": "forge:storage_blocks/quartz" - } - }, - "pattern": [ - "GNG", - "NGN", - "NNN" - ], - "result": { - "item": "reliquary:apothecary_mortar" - }, - "show_notification": true - } + "type": "reliquary:potions_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "G": { + "item": "reliquary:catalyzing_gland" + }, + "N": { + "tag": "forge:storage_blocks/quartz" + } + }, + "pattern": [ + "GNG", + "NGN", + "NNN" + ], + "result": { + "item": "reliquary:apothecary_mortar" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/barrel_assembly.json b/src/generated/resources/data/reliquary/recipes/barrel_assembly.json index 8ac798bd..9f493977 100644 --- a/src/generated/resources/data/reliquary/recipes/barrel_assembly.json +++ b/src/generated/resources/data/reliquary/recipes/barrel_assembly.json @@ -1,36 +1,28 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "E": { - "item": "reliquary:nebulous_heart" - }, - "I": { - "tag": "forge:ingots/iron" - }, - "M": { - "item": "minecraft:magma_cream" - } - }, - "pattern": [ - "III", - "EME", - "III" - ], - "result": { - "item": "reliquary:barrel_assembly" - }, - "show_notification": true - } + "type": "reliquary:handgun_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "E": { + "item": "reliquary:nebulous_heart" + }, + "I": { + "tag": "forge:ingots/iron" + }, + "M": { + "item": "minecraft:magma_cream" + } + }, + "pattern": [ + "III", + "EME", + "III" + ], + "result": { + "item": "reliquary:barrel_assembly" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/bat_wing.json b/src/generated/resources/data/reliquary/recipes/bat_wing.json index 749666a7..976b70e5 100644 --- a/src/generated/resources/data/reliquary/recipes/bat_wing.json +++ b/src/generated/resources/data/reliquary/recipes/bat_wing.json @@ -1,33 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:mob_drops_craftable" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "F": { - "tag": "forge:feathers" - }, - "G": { - "tag": "forge:ingots/gold" - } - }, - "pattern": [ - "GGG", - "GFG", - "GGG" - ], - "result": { - "item": "reliquary:bat_wing" - }, - "show_notification": true - } + "type": "reliquary:mob_drops_craftable" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "F": { + "tag": "forge:feathers" + }, + "G": { + "tag": "forge:ingots/gold" + } + }, + "pattern": [ + "GGG", + "GFG", + "GGG" + ], + "result": { + "item": "reliquary:bat_wing" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/bullets/blaze_bullet.json b/src/generated/resources/data/reliquary/recipes/bullets/blaze_bullet.json index 1ad04642..ab1c99a7 100644 --- a/src/generated/resources/data/reliquary/recipes/bullets/blaze_bullet.json +++ b/src/generated/resources/data/reliquary/recipes/bullets/blaze_bullet.json @@ -1,34 +1,27 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shapeless", - "category": "misc", - "ingredients": [ - { - "item": "minecraft:blaze_powder" - }, - { - "tag": "forge:rods/blaze" - }, - { - "tag": "forge:nuggets/gold" - }, - { - "tag": "forge:nuggets/gold" - } - ], - "result": { - "count": 8, - "item": "reliquary:bullets/blaze_bullet" - } - } + "type": "reliquary:handgun_enabled" } - ] + ], + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "item": "minecraft:blaze_powder" + }, + { + "tag": "forge:rods/blaze" + }, + { + "tag": "forge:nuggets/gold" + }, + { + "tag": "forge:nuggets/gold" + } + ], + "result": { + "count": 8, + "item": "reliquary:bullets/blaze_bullet" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/bullets/blaze_bullet_potion.json b/src/generated/resources/data/reliquary/recipes/bullets/blaze_bullet_potion.json index f61d942c..51ef0260 100644 --- a/src/generated/resources/data/reliquary/recipes/bullets/blaze_bullet_potion.json +++ b/src/generated/resources/data/reliquary/recipes/bullets/blaze_bullet_potion.json @@ -1,38 +1,29 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:potions_enabled" - }, - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "reliquary:potion_effects", - "category": "misc", - "duration_factor": 0.2, - "key": { - "B": { - "item": "reliquary:bullets/blaze_bullet" - }, - "P": { - "item": "reliquary:lingering_potion" - } - }, - "pattern": [ - "BBB", - "BPB", - "BBB" - ], - "result": { - "count": 8, - "item": "reliquary:bullets/blaze_bullet" - }, - "show_notification": true - } + "type": "reliquary:handgun_enabled" + }, + { + "type": "reliquary:potions_enabled" + } + ], + "type": "reliquary:potion_effects", + "duration_factor": 0.2, + "key": { + "B": { + "item": "reliquary:bullets/blaze_bullet" + }, + "P": { + "item": "reliquary:lingering_potion" } - ] + }, + "pattern": [ + "BBB", + "BPB", + "BBB" + ], + "result": { + "count": 8, + "item": "reliquary:bullets/blaze_bullet" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/bullets/buster_bullet.json b/src/generated/resources/data/reliquary/recipes/bullets/buster_bullet.json index 35ac890a..dfa04ef3 100644 --- a/src/generated/resources/data/reliquary/recipes/bullets/buster_bullet.json +++ b/src/generated/resources/data/reliquary/recipes/bullets/buster_bullet.json @@ -1,49 +1,42 @@ { - "type": "forge:conditional", - "recipes": [ - { - "conditions": [ - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shapeless", - "category": "misc", - "ingredients": [ - { - "item": "reliquary:bullets/concussive_bullet" - }, - { - "item": "reliquary:bullets/concussive_bullet" - }, - { - "item": "reliquary:bullets/concussive_bullet" - }, - { - "item": "reliquary:bullets/concussive_bullet" - }, - { - "item": "reliquary:bullets/concussive_bullet" - }, - { - "item": "reliquary:bullets/concussive_bullet" - }, - { - "item": "reliquary:bullets/concussive_bullet" - }, - { - "item": "reliquary:bullets/concussive_bullet" - }, - { - "item": "reliquary:catalyzing_gland" - } - ], - "result": { - "count": 8, - "item": "reliquary:bullets/buster_bullet" - } - } + "neoforge:conditions": [ + { + "type": "reliquary:handgun_enabled" + } + ], + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "item": "reliquary:bullets/concussive_bullet" + }, + { + "item": "reliquary:bullets/concussive_bullet" + }, + { + "item": "reliquary:bullets/concussive_bullet" + }, + { + "item": "reliquary:bullets/concussive_bullet" + }, + { + "item": "reliquary:bullets/concussive_bullet" + }, + { + "item": "reliquary:bullets/concussive_bullet" + }, + { + "item": "reliquary:bullets/concussive_bullet" + }, + { + "item": "reliquary:bullets/concussive_bullet" + }, + { + "item": "reliquary:catalyzing_gland" } - ] + ], + "result": { + "count": 8, + "item": "reliquary:bullets/buster_bullet" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/bullets/buster_bullet_potion.json b/src/generated/resources/data/reliquary/recipes/bullets/buster_bullet_potion.json index 849c1bc5..17c86868 100644 --- a/src/generated/resources/data/reliquary/recipes/bullets/buster_bullet_potion.json +++ b/src/generated/resources/data/reliquary/recipes/bullets/buster_bullet_potion.json @@ -1,38 +1,26 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:potions_enabled" - }, - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "reliquary:potion_effects", - "category": "misc", - "duration_factor": 0.2, - "key": { - "B": { - "item": "reliquary:bullets/buster_bullet" - }, - "P": { - "item": "reliquary:lingering_potion" - } - }, - "pattern": [ - "BBB", - "BPB", - "BBB" - ], - "result": { - "count": 8, - "item": "reliquary:bullets/buster_bullet" - }, - "show_notification": true - } + "type": "reliquary:potions_enabled" } - ] + ], + "type": "reliquary:potion_effects", + "duration_factor": 0.2, + "key": { + "B": { + "item": "reliquary:bullets/buster_bullet" + }, + "P": { + "item": "reliquary:lingering_potion" + } + }, + "pattern": [ + "BBB", + "BPB", + "BBB" + ], + "result": { + "count": 8, + "item": "reliquary:bullets/buster_bullet" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/bullets/concussive_bullet.json b/src/generated/resources/data/reliquary/recipes/bullets/concussive_bullet.json index 16725c98..886ed72e 100644 --- a/src/generated/resources/data/reliquary/recipes/bullets/concussive_bullet.json +++ b/src/generated/resources/data/reliquary/recipes/bullets/concussive_bullet.json @@ -1,34 +1,27 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shapeless", - "category": "misc", - "ingredients": [ - { - "tag": "forge:slimeballs" - }, - { - "tag": "forge:nuggets/gold" - }, - { - "tag": "forge:nuggets/gold" - }, - { - "tag": "forge:gunpowder" - } - ], - "result": { - "count": 8, - "item": "reliquary:bullets/concussive_bullet" - } - } + "type": "reliquary:handgun_enabled" } - ] + ], + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "forge:slimeballs" + }, + { + "tag": "forge:nuggets/gold" + }, + { + "tag": "forge:nuggets/gold" + }, + { + "tag": "forge:gunpowder" + } + ], + "result": { + "count": 8, + "item": "reliquary:bullets/concussive_bullet" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/bullets/concussive_bullet_potion.json b/src/generated/resources/data/reliquary/recipes/bullets/concussive_bullet_potion.json index 08144486..f80a2363 100644 --- a/src/generated/resources/data/reliquary/recipes/bullets/concussive_bullet_potion.json +++ b/src/generated/resources/data/reliquary/recipes/bullets/concussive_bullet_potion.json @@ -1,38 +1,26 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:potions_enabled" - }, - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "reliquary:potion_effects", - "category": "misc", - "duration_factor": 0.2, - "key": { - "B": { - "item": "reliquary:bullets/concussive_bullet" - }, - "P": { - "item": "reliquary:lingering_potion" - } - }, - "pattern": [ - "BBB", - "BPB", - "BBB" - ], - "result": { - "count": 8, - "item": "reliquary:bullets/concussive_bullet" - }, - "show_notification": true - } + "type": "reliquary:potions_enabled" } - ] + ], + "type": "reliquary:potion_effects", + "duration_factor": 0.2, + "key": { + "B": { + "item": "reliquary:bullets/concussive_bullet" + }, + "P": { + "item": "reliquary:lingering_potion" + } + }, + "pattern": [ + "BBB", + "BPB", + "BBB" + ], + "result": { + "count": 8, + "item": "reliquary:bullets/concussive_bullet" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/bullets/ender_bullet.json b/src/generated/resources/data/reliquary/recipes/bullets/ender_bullet.json index 055bacbb..73a90e71 100644 --- a/src/generated/resources/data/reliquary/recipes/bullets/ender_bullet.json +++ b/src/generated/resources/data/reliquary/recipes/bullets/ender_bullet.json @@ -1,49 +1,42 @@ { - "type": "forge:conditional", - "recipes": [ - { - "conditions": [ - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shapeless", - "category": "misc", - "ingredients": [ - { - "item": "reliquary:bullets/seeker_bullet" - }, - { - "item": "reliquary:bullets/seeker_bullet" - }, - { - "item": "reliquary:bullets/seeker_bullet" - }, - { - "item": "reliquary:bullets/seeker_bullet" - }, - { - "item": "reliquary:bullets/seeker_bullet" - }, - { - "item": "reliquary:bullets/seeker_bullet" - }, - { - "item": "reliquary:bullets/seeker_bullet" - }, - { - "item": "reliquary:bullets/seeker_bullet" - }, - { - "item": "reliquary:nebulous_heart" - } - ], - "result": { - "count": 8, - "item": "reliquary:bullets/ender_bullet" - } - } + "neoforge:conditions": [ + { + "type": "reliquary:handgun_enabled" + } + ], + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "item": "reliquary:bullets/seeker_bullet" + }, + { + "item": "reliquary:bullets/seeker_bullet" + }, + { + "item": "reliquary:bullets/seeker_bullet" + }, + { + "item": "reliquary:bullets/seeker_bullet" + }, + { + "item": "reliquary:bullets/seeker_bullet" + }, + { + "item": "reliquary:bullets/seeker_bullet" + }, + { + "item": "reliquary:bullets/seeker_bullet" + }, + { + "item": "reliquary:bullets/seeker_bullet" + }, + { + "item": "reliquary:nebulous_heart" } - ] + ], + "result": { + "count": 8, + "item": "reliquary:bullets/ender_bullet" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/bullets/ender_bullet_potion.json b/src/generated/resources/data/reliquary/recipes/bullets/ender_bullet_potion.json index d2bb879f..96598805 100644 --- a/src/generated/resources/data/reliquary/recipes/bullets/ender_bullet_potion.json +++ b/src/generated/resources/data/reliquary/recipes/bullets/ender_bullet_potion.json @@ -1,38 +1,26 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:potions_enabled" - }, - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "reliquary:potion_effects", - "category": "misc", - "duration_factor": 0.2, - "key": { - "B": { - "item": "reliquary:bullets/ender_bullet" - }, - "P": { - "item": "reliquary:lingering_potion" - } - }, - "pattern": [ - "BBB", - "BPB", - "BBB" - ], - "result": { - "count": 8, - "item": "reliquary:bullets/ender_bullet" - }, - "show_notification": true - } + "type": "reliquary:potions_enabled" } - ] + ], + "type": "reliquary:potion_effects", + "duration_factor": 0.2, + "key": { + "B": { + "item": "reliquary:bullets/ender_bullet" + }, + "P": { + "item": "reliquary:lingering_potion" + } + }, + "pattern": [ + "BBB", + "BPB", + "BBB" + ], + "result": { + "count": 8, + "item": "reliquary:bullets/ender_bullet" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/bullets/exorcism_bullet.json b/src/generated/resources/data/reliquary/recipes/bullets/exorcism_bullet.json index 8cdab8ec..784ce5a3 100644 --- a/src/generated/resources/data/reliquary/recipes/bullets/exorcism_bullet.json +++ b/src/generated/resources/data/reliquary/recipes/bullets/exorcism_bullet.json @@ -1,49 +1,42 @@ { - "type": "forge:conditional", - "recipes": [ - { - "conditions": [ - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shapeless", - "category": "misc", - "ingredients": [ - { - "item": "reliquary:bullets/neutral_bullet" - }, - { - "item": "reliquary:bullets/neutral_bullet" - }, - { - "item": "reliquary:bullets/neutral_bullet" - }, - { - "item": "reliquary:bullets/neutral_bullet" - }, - { - "item": "reliquary:bullets/neutral_bullet" - }, - { - "item": "reliquary:bullets/neutral_bullet" - }, - { - "item": "reliquary:bullets/neutral_bullet" - }, - { - "item": "reliquary:bullets/neutral_bullet" - }, - { - "item": "reliquary:zombie_heart" - } - ], - "result": { - "count": 8, - "item": "reliquary:bullets/exorcism_bullet" - } - } + "neoforge:conditions": [ + { + "type": "reliquary:handgun_enabled" + } + ], + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "item": "reliquary:bullets/neutral_bullet" + }, + { + "item": "reliquary:bullets/neutral_bullet" + }, + { + "item": "reliquary:bullets/neutral_bullet" + }, + { + "item": "reliquary:bullets/neutral_bullet" + }, + { + "item": "reliquary:bullets/neutral_bullet" + }, + { + "item": "reliquary:bullets/neutral_bullet" + }, + { + "item": "reliquary:bullets/neutral_bullet" + }, + { + "item": "reliquary:bullets/neutral_bullet" + }, + { + "item": "reliquary:zombie_heart" } - ] + ], + "result": { + "count": 8, + "item": "reliquary:bullets/exorcism_bullet" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/bullets/exorcism_bullet_potion.json b/src/generated/resources/data/reliquary/recipes/bullets/exorcism_bullet_potion.json index e3541c39..c4d20285 100644 --- a/src/generated/resources/data/reliquary/recipes/bullets/exorcism_bullet_potion.json +++ b/src/generated/resources/data/reliquary/recipes/bullets/exorcism_bullet_potion.json @@ -1,38 +1,26 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:potions_enabled" - }, - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "reliquary:potion_effects", - "category": "misc", - "duration_factor": 0.2, - "key": { - "B": { - "item": "reliquary:bullets/exorcism_bullet" - }, - "P": { - "item": "reliquary:lingering_potion" - } - }, - "pattern": [ - "BBB", - "BPB", - "BBB" - ], - "result": { - "count": 8, - "item": "reliquary:bullets/exorcism_bullet" - }, - "show_notification": true - } + "type": "reliquary:potions_enabled" } - ] + ], + "type": "reliquary:potion_effects", + "duration_factor": 0.2, + "key": { + "B": { + "item": "reliquary:bullets/exorcism_bullet" + }, + "P": { + "item": "reliquary:lingering_potion" + } + }, + "pattern": [ + "BBB", + "BPB", + "BBB" + ], + "result": { + "count": 8, + "item": "reliquary:bullets/exorcism_bullet" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/bullets/neutral_bullet.json b/src/generated/resources/data/reliquary/recipes/bullets/neutral_bullet.json index 958f9dc3..148433dd 100644 --- a/src/generated/resources/data/reliquary/recipes/bullets/neutral_bullet.json +++ b/src/generated/resources/data/reliquary/recipes/bullets/neutral_bullet.json @@ -1,34 +1,27 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shapeless", - "category": "misc", - "ingredients": [ - { - "item": "minecraft:flint" - }, - { - "tag": "forge:nuggets/gold" - }, - { - "tag": "forge:nuggets/gold" - }, - { - "tag": "forge:gunpowder" - } - ], - "result": { - "count": 8, - "item": "reliquary:bullets/neutral_bullet" - } - } + "type": "reliquary:handgun_enabled" } - ] + ], + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "item": "minecraft:flint" + }, + { + "tag": "forge:nuggets/gold" + }, + { + "tag": "forge:nuggets/gold" + }, + { + "tag": "forge:gunpowder" + } + ], + "result": { + "count": 8, + "item": "reliquary:bullets/neutral_bullet" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/bullets/neutral_bullet_potion.json b/src/generated/resources/data/reliquary/recipes/bullets/neutral_bullet_potion.json index 2cee0bd2..6c2ef4e6 100644 --- a/src/generated/resources/data/reliquary/recipes/bullets/neutral_bullet_potion.json +++ b/src/generated/resources/data/reliquary/recipes/bullets/neutral_bullet_potion.json @@ -1,38 +1,29 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:potions_enabled" - }, - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "reliquary:potion_effects", - "category": "misc", - "duration_factor": 0.2, - "key": { - "B": { - "item": "reliquary:bullets/neutral_bullet" - }, - "P": { - "item": "reliquary:lingering_potion" - } - }, - "pattern": [ - "BBB", - "BPB", - "BBB" - ], - "result": { - "count": 8, - "item": "reliquary:bullets/neutral_bullet" - }, - "show_notification": true - } + "type": "reliquary:handgun_enabled" + }, + { + "type": "reliquary:potions_enabled" + } + ], + "type": "reliquary:potion_effects", + "duration_factor": 0.2, + "key": { + "B": { + "item": "reliquary:bullets/neutral_bullet" + }, + "P": { + "item": "reliquary:lingering_potion" } - ] + }, + "pattern": [ + "BBB", + "BPB", + "BBB" + ], + "result": { + "count": 8, + "item": "reliquary:bullets/neutral_bullet" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/bullets/sand_bullet.json b/src/generated/resources/data/reliquary/recipes/bullets/sand_bullet.json index a03a54ef..d99acc8c 100644 --- a/src/generated/resources/data/reliquary/recipes/bullets/sand_bullet.json +++ b/src/generated/resources/data/reliquary/recipes/bullets/sand_bullet.json @@ -1,34 +1,27 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shapeless", - "category": "misc", - "ingredients": [ - { - "tag": "forge:sandstone" - }, - { - "tag": "forge:slimeballs" - }, - { - "tag": "forge:nuggets/gold" - }, - { - "tag": "forge:gunpowder" - } - ], - "result": { - "count": 8, - "item": "reliquary:bullets/sand_bullet" - } - } + "type": "reliquary:handgun_enabled" } - ] + ], + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "forge:sandstone" + }, + { + "tag": "forge:slimeballs" + }, + { + "tag": "forge:nuggets/gold" + }, + { + "tag": "forge:gunpowder" + } + ], + "result": { + "count": 8, + "item": "reliquary:bullets/sand_bullet" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/bullets/sand_bullet_potion.json b/src/generated/resources/data/reliquary/recipes/bullets/sand_bullet_potion.json index 87ea75ce..f38e1b9b 100644 --- a/src/generated/resources/data/reliquary/recipes/bullets/sand_bullet_potion.json +++ b/src/generated/resources/data/reliquary/recipes/bullets/sand_bullet_potion.json @@ -1,38 +1,26 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:potions_enabled" - }, - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "reliquary:potion_effects", - "category": "misc", - "duration_factor": 0.2, - "key": { - "B": { - "item": "reliquary:bullets/sand_bullet" - }, - "P": { - "item": "reliquary:lingering_potion" - } - }, - "pattern": [ - "BBB", - "BPB", - "BBB" - ], - "result": { - "count": 8, - "item": "reliquary:bullets/sand_bullet" - }, - "show_notification": true - } + "type": "reliquary:potions_enabled" } - ] + ], + "type": "reliquary:potion_effects", + "duration_factor": 0.2, + "key": { + "B": { + "item": "reliquary:bullets/sand_bullet" + }, + "P": { + "item": "reliquary:lingering_potion" + } + }, + "pattern": [ + "BBB", + "BPB", + "BBB" + ], + "result": { + "count": 8, + "item": "reliquary:bullets/sand_bullet" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/bullets/seeker_bullet.json b/src/generated/resources/data/reliquary/recipes/bullets/seeker_bullet.json index 97b29a5e..d125a1bd 100644 --- a/src/generated/resources/data/reliquary/recipes/bullets/seeker_bullet.json +++ b/src/generated/resources/data/reliquary/recipes/bullets/seeker_bullet.json @@ -1,34 +1,27 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shapeless", - "category": "misc", - "ingredients": [ - { - "tag": "forge:gems/lapis" - }, - { - "tag": "forge:nuggets/gold" - }, - { - "tag": "forge:nuggets/gold" - }, - { - "tag": "forge:gunpowder" - } - ], - "result": { - "count": 8, - "item": "reliquary:bullets/seeker_bullet" - } - } + "type": "reliquary:handgun_enabled" } - ] + ], + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "tag": "forge:gems/lapis" + }, + { + "tag": "forge:nuggets/gold" + }, + { + "tag": "forge:nuggets/gold" + }, + { + "tag": "forge:gunpowder" + } + ], + "result": { + "count": 8, + "item": "reliquary:bullets/seeker_bullet" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/bullets/seeker_bullet_potion.json b/src/generated/resources/data/reliquary/recipes/bullets/seeker_bullet_potion.json index 370485db..f8564e64 100644 --- a/src/generated/resources/data/reliquary/recipes/bullets/seeker_bullet_potion.json +++ b/src/generated/resources/data/reliquary/recipes/bullets/seeker_bullet_potion.json @@ -1,38 +1,29 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:potions_enabled" - }, - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "reliquary:potion_effects", - "category": "misc", - "duration_factor": 0.2, - "key": { - "B": { - "item": "reliquary:bullets/seeker_bullet" - }, - "P": { - "item": "reliquary:lingering_potion" - } - }, - "pattern": [ - "BBB", - "BPB", - "BBB" - ], - "result": { - "count": 8, - "item": "reliquary:bullets/seeker_bullet" - }, - "show_notification": true - } + "type": "reliquary:handgun_enabled" + }, + { + "type": "reliquary:potions_enabled" + } + ], + "type": "reliquary:potion_effects", + "duration_factor": 0.2, + "key": { + "B": { + "item": "reliquary:bullets/seeker_bullet" + }, + "P": { + "item": "reliquary:lingering_potion" } - ] + }, + "pattern": [ + "BBB", + "BPB", + "BBB" + ], + "result": { + "count": 8, + "item": "reliquary:bullets/seeker_bullet" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/bullets/storm_bullet.json b/src/generated/resources/data/reliquary/recipes/bullets/storm_bullet.json index 4fc262ce..7783aed5 100644 --- a/src/generated/resources/data/reliquary/recipes/bullets/storm_bullet.json +++ b/src/generated/resources/data/reliquary/recipes/bullets/storm_bullet.json @@ -1,37 +1,30 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shapeless", - "category": "misc", - "ingredients": [ - { - "item": "reliquary:catalyzing_gland" - }, - { - "item": "reliquary:catalyzing_gland" - }, - { - "tag": "forge:nuggets/gold" - }, - { - "tag": "forge:nuggets/gold" - }, - { - "tag": "forge:gunpowder" - } - ], - "result": { - "count": 8, - "item": "reliquary:bullets/storm_bullet" - } - } + "type": "reliquary:handgun_enabled" } - ] + ], + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "item": "reliquary:catalyzing_gland" + }, + { + "item": "reliquary:catalyzing_gland" + }, + { + "tag": "forge:nuggets/gold" + }, + { + "tag": "forge:nuggets/gold" + }, + { + "tag": "forge:gunpowder" + } + ], + "result": { + "count": 8, + "item": "reliquary:bullets/storm_bullet" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/bullets/storm_bullet_potion.json b/src/generated/resources/data/reliquary/recipes/bullets/storm_bullet_potion.json index ba9a5b9e..3abafcb5 100644 --- a/src/generated/resources/data/reliquary/recipes/bullets/storm_bullet_potion.json +++ b/src/generated/resources/data/reliquary/recipes/bullets/storm_bullet_potion.json @@ -1,38 +1,26 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:potions_enabled" - }, - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "reliquary:potion_effects", - "category": "misc", - "duration_factor": 0.2, - "key": { - "B": { - "item": "reliquary:bullets/storm_bullet" - }, - "P": { - "item": "reliquary:lingering_potion" - } - }, - "pattern": [ - "BBB", - "BPB", - "BBB" - ], - "result": { - "count": 8, - "item": "reliquary:bullets/storm_bullet" - }, - "show_notification": true - } + "type": "reliquary:potions_enabled" } - ] + ], + "type": "reliquary:potion_effects", + "duration_factor": 0.2, + "key": { + "B": { + "item": "reliquary:bullets/storm_bullet" + }, + "P": { + "item": "reliquary:lingering_potion" + } + }, + "pattern": [ + "BBB", + "BPB", + "BBB" + ], + "result": { + "count": 8, + "item": "reliquary:bullets/storm_bullet" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/catalyzing_gland.json b/src/generated/resources/data/reliquary/recipes/catalyzing_gland.json index da9902b7..791daa09 100644 --- a/src/generated/resources/data/reliquary/recipes/catalyzing_gland.json +++ b/src/generated/resources/data/reliquary/recipes/catalyzing_gland.json @@ -1,33 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:mob_drops_craftable" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "G": { - "tag": "forge:ingots/gold" - }, - "P": { - "tag": "forge:gunpowder" - } - }, - "pattern": [ - "GGG", - "GPG", - "GGG" - ], - "result": { - "item": "reliquary:catalyzing_gland" - }, - "show_notification": true - } + "type": "reliquary:mob_drops_craftable" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "G": { + "tag": "forge:ingots/gold" + }, + "P": { + "tag": "forge:gunpowder" + } + }, + "pattern": [ + "GGG", + "GPG", + "GGG" + ], + "result": { + "item": "reliquary:catalyzing_gland" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/chelicerae.json b/src/generated/resources/data/reliquary/recipes/chelicerae.json index 114799d2..a8ab2074 100644 --- a/src/generated/resources/data/reliquary/recipes/chelicerae.json +++ b/src/generated/resources/data/reliquary/recipes/chelicerae.json @@ -1,33 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:mob_drops_craftable" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "G": { - "tag": "forge:ingots/gold" - }, - "S": { - "tag": "forge:string" - } - }, - "pattern": [ - "GGG", - "GSG", - "GGG" - ], - "result": { - "item": "reliquary:chelicerae" - }, - "show_notification": true - } + "type": "reliquary:mob_drops_craftable" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "G": { + "tag": "forge:ingots/gold" + }, + "S": { + "tag": "forge:string" + } + }, + "pattern": [ + "GGG", + "GSG", + "GGG" + ], + "result": { + "item": "reliquary:chelicerae" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/emperor_chalice.json b/src/generated/resources/data/reliquary/recipes/emperor_chalice.json index a5e936a3..fba49d96 100644 --- a/src/generated/resources/data/reliquary/recipes/emperor_chalice.json +++ b/src/generated/resources/data/reliquary/recipes/emperor_chalice.json @@ -12,9 +12,10 @@ "item": "minecraft:bucket" }, { - "type": "forge:nbt", - "count": 1, - "item": "reliquary:void_tear" + "type": "neoforge:nbt", + "item": "reliquary:void_tear", + "strict": true, + "tag": "{}" } ], "result": { diff --git a/src/generated/resources/data/reliquary/recipes/empty_potion_vial.json b/src/generated/resources/data/reliquary/recipes/empty_potion_vial.json index 9c331815..e4298585 100644 --- a/src/generated/resources/data/reliquary/recipes/empty_potion_vial.json +++ b/src/generated/resources/data/reliquary/recipes/empty_potion_vial.json @@ -1,30 +1,22 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:potions_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "G": { - "tag": "forge:glass_panes" - } - }, - "pattern": [ - "G G", - "G G", - " G " - ], - "result": { - "item": "reliquary:empty_potion_vial" - }, - "show_notification": true - } + "type": "reliquary:potions_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "G": { + "tag": "forge:glass_panes" + } + }, + "pattern": [ + "G G", + "G G", + " G " + ], + "result": { + "item": "reliquary:empty_potion_vial" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/ender_staff.json b/src/generated/resources/data/reliquary/recipes/ender_staff.json index 468c79e4..479be0d4 100644 --- a/src/generated/resources/data/reliquary/recipes/ender_staff.json +++ b/src/generated/resources/data/reliquary/recipes/ender_staff.json @@ -15,9 +15,10 @@ "item": "minecraft:stick" }, "V": { - "type": "forge:nbt", - "count": 1, - "item": "reliquary:void_tear" + "type": "neoforge:nbt", + "item": "reliquary:void_tear", + "strict": true, + "tag": "{}" } }, "pattern": [ @@ -27,6 +28,5 @@ ], "result": { "item": "reliquary:ender_staff" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/eye_of_the_storm.json b/src/generated/resources/data/reliquary/recipes/eye_of_the_storm.json index 03637269..0a44400f 100644 --- a/src/generated/resources/data/reliquary/recipes/eye_of_the_storm.json +++ b/src/generated/resources/data/reliquary/recipes/eye_of_the_storm.json @@ -1,33 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:mob_drops_craftable" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "item": "reliquary:catalyzing_gland" - }, - "G": { - "tag": "forge:ingots/gold" - } - }, - "pattern": [ - "GGG", - "GCG", - "GGG" - ], - "result": { - "item": "reliquary:eye_of_the_storm" - }, - "show_notification": true - } + "type": "reliquary:mob_drops_craftable" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "item": "reliquary:catalyzing_gland" + }, + "G": { + "tag": "forge:ingots/gold" + } + }, + "pattern": [ + "GGG", + "GCG", + "GGG" + ], + "result": { + "item": "reliquary:eye_of_the_storm" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/fertile_potion.json b/src/generated/resources/data/reliquary/recipes/fertile_potion.json index 0c3efd7c..db7da34b 100644 --- a/src/generated/resources/data/reliquary/recipes/fertile_potion.json +++ b/src/generated/resources/data/reliquary/recipes/fertile_potion.json @@ -1,42 +1,34 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:potions_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "B": { - "item": "minecraft:water_bucket" - }, - "C": { - "tag": "forge:dyes/green" - }, - "F": { - "item": "reliquary:fertile_essence" - }, - "G": { - "tag": "forge:glass_panes" - }, - "Y": { - "tag": "forge:dyes/yellow" - } - }, - "pattern": [ - "GBG", - "GFG", - "CGY" - ], - "result": { - "item": "reliquary:fertile_potion" - }, - "show_notification": true - } + "type": "reliquary:potions_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "B": { + "item": "minecraft:water_bucket" + }, + "C": { + "tag": "forge:dyes/green" + }, + "F": { + "item": "reliquary:fertile_essence" + }, + "G": { + "tag": "forge:glass_panes" + }, + "Y": { + "tag": "forge:dyes/yellow" + } + }, + "pattern": [ + "GBG", + "GFG", + "CGY" + ], + "result": { + "item": "reliquary:fertile_potion" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/frozen_core.json b/src/generated/resources/data/reliquary/recipes/frozen_core.json index a19aa625..2f3f6787 100644 --- a/src/generated/resources/data/reliquary/recipes/frozen_core.json +++ b/src/generated/resources/data/reliquary/recipes/frozen_core.json @@ -1,36 +1,28 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:mob_drops_craftable" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "G": { - "tag": "forge:ingots/gold" - }, - "P": { - "item": "minecraft:pumpkin" - }, - "S": { - "item": "minecraft:snow" - } - }, - "pattern": [ - "GPG", - "GSG", - "GSG" - ], - "result": { - "item": "reliquary:frozen_core" - }, - "show_notification": true - } + "type": "reliquary:mob_drops_craftable" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "G": { + "tag": "forge:ingots/gold" + }, + "P": { + "item": "minecraft:pumpkin" + }, + "S": { + "item": "minecraft:snow" + } + }, + "pattern": [ + "GPG", + "GSG", + "GSG" + ], + "result": { + "item": "reliquary:frozen_core" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/glacial_staff.json b/src/generated/resources/data/reliquary/recipes/glacial_staff.json index 889f0578..810446eb 100644 --- a/src/generated/resources/data/reliquary/recipes/glacial_staff.json +++ b/src/generated/resources/data/reliquary/recipes/glacial_staff.json @@ -6,9 +6,10 @@ "item": "reliquary:ice_magus_rod" }, { - "type": "forge:nbt", - "count": 1, - "item": "reliquary:void_tear" + "type": "neoforge:nbt", + "item": "reliquary:void_tear", + "strict": true, + "tag": "{}" }, { "item": "reliquary:frozen_core" diff --git a/src/generated/resources/data/reliquary/recipes/glowing_water.json b/src/generated/resources/data/reliquary/recipes/glowing_water.json index 4733a75e..bd58495b 100644 --- a/src/generated/resources/data/reliquary/recipes/glowing_water.json +++ b/src/generated/resources/data/reliquary/recipes/glowing_water.json @@ -25,6 +25,5 @@ ], "result": { "item": "reliquary:glowing_water" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/grip_assembly.json b/src/generated/resources/data/reliquary/recipes/grip_assembly.json index 2f559a21..bc05681c 100644 --- a/src/generated/resources/data/reliquary/recipes/grip_assembly.json +++ b/src/generated/resources/data/reliquary/recipes/grip_assembly.json @@ -1,36 +1,28 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "item": "reliquary:magazines/empty_magazine" - }, - "I": { - "tag": "forge:ingots/iron" - }, - "M": { - "item": "minecraft:magma_cream" - } - }, - "pattern": [ - "III", - "IMI", - "ICI" - ], - "result": { - "item": "reliquary:grip_assembly" - }, - "show_notification": true - } + "type": "reliquary:handgun_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "item": "reliquary:magazines/empty_magazine" + }, + "I": { + "tag": "forge:ingots/iron" + }, + "M": { + "item": "minecraft:magma_cream" + } + }, + "pattern": [ + "III", + "IMI", + "ICI" + ], + "result": { + "item": "reliquary:grip_assembly" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/guardian_spike.json b/src/generated/resources/data/reliquary/recipes/guardian_spike.json index 86a83b9a..275bdadb 100644 --- a/src/generated/resources/data/reliquary/recipes/guardian_spike.json +++ b/src/generated/resources/data/reliquary/recipes/guardian_spike.json @@ -1,33 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:mob_drops_craftable" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "G": { - "tag": "forge:ingots/gold" - }, - "P": { - "tag": "forge:dusts/prismarine" - } - }, - "pattern": [ - "GGG", - "GPG", - "GGG" - ], - "result": { - "item": "reliquary:guardian_spike" - }, - "show_notification": true - } + "type": "reliquary:mob_drops_craftable" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "G": { + "tag": "forge:ingots/gold" + }, + "P": { + "tag": "forge:dusts/prismarine" + } + }, + "pattern": [ + "GGG", + "GPG", + "GGG" + ], + "result": { + "item": "reliquary:guardian_spike" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/hammer_assembly.json b/src/generated/resources/data/reliquary/recipes/hammer_assembly.json index 71ed6214..505bb2ba 100644 --- a/src/generated/resources/data/reliquary/recipes/hammer_assembly.json +++ b/src/generated/resources/data/reliquary/recipes/hammer_assembly.json @@ -1,39 +1,31 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "B": { - "item": "minecraft:stone_button" - }, - "I": { - "tag": "forge:ingots/iron" - }, - "M": { - "item": "reliquary:molten_core" - }, - "R": { - "tag": "forge:rods/blaze" - } - }, - "pattern": [ - "IIB", - "RMI", - "III" - ], - "result": { - "item": "reliquary:hammer_assembly" - }, - "show_notification": true - } + "type": "reliquary:handgun_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "B": { + "item": "minecraft:stone_button" + }, + "I": { + "tag": "forge:ingots/iron" + }, + "M": { + "item": "reliquary:molten_core" + }, + "R": { + "tag": "forge:rods/blaze" + } + }, + "pattern": [ + "IIB", + "RMI", + "III" + ], + "result": { + "item": "reliquary:hammer_assembly" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/handgun.json b/src/generated/resources/data/reliquary/recipes/handgun.json index a01c3f1a..09254202 100644 --- a/src/generated/resources/data/reliquary/recipes/handgun.json +++ b/src/generated/resources/data/reliquary/recipes/handgun.json @@ -1,42 +1,34 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "B": { - "item": "reliquary:barrel_assembly" - }, - "G": { - "item": "reliquary:grip_assembly" - }, - "I": { - "tag": "forge:ingots/iron" - }, - "M": { - "item": "reliquary:hammer_assembly" - }, - "S": { - "item": "reliquary:slime_pearl" - } - }, - "pattern": [ - "BIM", - "ISI", - "IGI" - ], - "result": { - "item": "reliquary:handgun" - }, - "show_notification": true - } + "type": "reliquary:handgun_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "B": { + "item": "reliquary:barrel_assembly" + }, + "G": { + "item": "reliquary:grip_assembly" + }, + "I": { + "tag": "forge:ingots/iron" + }, + "M": { + "item": "reliquary:hammer_assembly" + }, + "S": { + "item": "reliquary:slime_pearl" + } + }, + "pattern": [ + "BIM", + "ISI", + "IGI" + ], + "result": { + "item": "reliquary:handgun" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/harvest_rod.json b/src/generated/resources/data/reliquary/recipes/harvest_rod.json index cf064491..031242ed 100644 --- a/src/generated/resources/data/reliquary/recipes/harvest_rod.json +++ b/src/generated/resources/data/reliquary/recipes/harvest_rod.json @@ -12,9 +12,10 @@ "item": "minecraft:stick" }, "T": { - "type": "forge:nbt", - "count": 1, - "item": "reliquary:void_tear" + "type": "neoforge:nbt", + "item": "reliquary:void_tear", + "strict": true, + "tag": "{}" }, "V": { "item": "minecraft:vine" @@ -27,6 +28,5 @@ ], "result": { "item": "reliquary:harvest_rod" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/ice_magus_rod.json b/src/generated/resources/data/reliquary/recipes/ice_magus_rod.json index 7ccdd082..6cd062a5 100644 --- a/src/generated/resources/data/reliquary/recipes/ice_magus_rod.json +++ b/src/generated/resources/data/reliquary/recipes/ice_magus_rod.json @@ -12,9 +12,10 @@ "tag": "forge:ingots/iron" }, "V": { - "type": "forge:nbt", - "count": 1, - "item": "reliquary:void_tear" + "type": "neoforge:nbt", + "item": "reliquary:void_tear", + "strict": true, + "tag": "{}" } }, "pattern": [ @@ -24,6 +25,5 @@ ], "result": { "item": "reliquary:ice_magus_rod" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/infernal_tear.json b/src/generated/resources/data/reliquary/recipes/infernal_tear.json index 3f2a0131..e5fd2f6a 100644 --- a/src/generated/resources/data/reliquary/recipes/infernal_tear.json +++ b/src/generated/resources/data/reliquary/recipes/infernal_tear.json @@ -3,9 +3,10 @@ "category": "misc", "ingredients": [ { - "type": "forge:nbt", - "count": 1, - "item": "reliquary:void_tear" + "type": "neoforge:nbt", + "item": "reliquary:void_tear", + "strict": true, + "tag": "{}" }, { "item": "reliquary:witch_hat" diff --git a/src/generated/resources/data/reliquary/recipes/lantern_of_paranoia.json b/src/generated/resources/data/reliquary/recipes/lantern_of_paranoia.json index 7688169b..e4db20f1 100644 --- a/src/generated/resources/data/reliquary/recipes/lantern_of_paranoia.json +++ b/src/generated/resources/data/reliquary/recipes/lantern_of_paranoia.json @@ -22,6 +22,5 @@ ], "result": { "item": "reliquary:lantern_of_paranoia" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/magazines/blaze_magazine.json b/src/generated/resources/data/reliquary/recipes/magazines/blaze_magazine.json index 0151173e..10f6e38e 100644 --- a/src/generated/resources/data/reliquary/recipes/magazines/blaze_magazine.json +++ b/src/generated/resources/data/reliquary/recipes/magazines/blaze_magazine.json @@ -1,37 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:potions_enabled" - }, - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "reliquary:potion_effects", - "category": "misc", - "duration_factor": 1.0, - "key": { - "B": { - "item": "reliquary:bullets/blaze_bullet" - }, - "M": { - "item": "reliquary:magazines/empty_magazine" - } - }, - "pattern": [ - "BBB", - "BMB", - "BBB" - ], - "result": { - "item": "reliquary:magazines/blaze_magazine" - }, - "show_notification": true - } + "type": "reliquary:potions_enabled" } - ] + ], + "type": "reliquary:potion_effects", + "duration_factor": 1.0, + "key": { + "B": { + "item": "reliquary:bullets/blaze_bullet" + }, + "M": { + "item": "reliquary:magazines/empty_magazine" + } + }, + "pattern": [ + "BBB", + "BMB", + "BBB" + ], + "result": { + "item": "reliquary:magazines/blaze_magazine" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/magazines/buster_magazine.json b/src/generated/resources/data/reliquary/recipes/magazines/buster_magazine.json index 9ab73f56..80d9e304 100644 --- a/src/generated/resources/data/reliquary/recipes/magazines/buster_magazine.json +++ b/src/generated/resources/data/reliquary/recipes/magazines/buster_magazine.json @@ -1,37 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:potions_enabled" - }, - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "reliquary:potion_effects", - "category": "misc", - "duration_factor": 1.0, - "key": { - "B": { - "item": "reliquary:bullets/buster_bullet" - }, - "M": { - "item": "reliquary:magazines/empty_magazine" - } - }, - "pattern": [ - "BBB", - "BMB", - "BBB" - ], - "result": { - "item": "reliquary:magazines/buster_magazine" - }, - "show_notification": true - } + "type": "reliquary:potions_enabled" } - ] + ], + "type": "reliquary:potion_effects", + "duration_factor": 1.0, + "key": { + "B": { + "item": "reliquary:bullets/buster_bullet" + }, + "M": { + "item": "reliquary:magazines/empty_magazine" + } + }, + "pattern": [ + "BBB", + "BMB", + "BBB" + ], + "result": { + "item": "reliquary:magazines/buster_magazine" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/magazines/concussive_magazine.json b/src/generated/resources/data/reliquary/recipes/magazines/concussive_magazine.json index 59fde789..b438a4ba 100644 --- a/src/generated/resources/data/reliquary/recipes/magazines/concussive_magazine.json +++ b/src/generated/resources/data/reliquary/recipes/magazines/concussive_magazine.json @@ -1,37 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:potions_enabled" - }, - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "reliquary:potion_effects", - "category": "misc", - "duration_factor": 1.0, - "key": { - "B": { - "item": "reliquary:bullets/concussive_bullet" - }, - "M": { - "item": "reliquary:magazines/empty_magazine" - } - }, - "pattern": [ - "BBB", - "BMB", - "BBB" - ], - "result": { - "item": "reliquary:magazines/concussive_magazine" - }, - "show_notification": true - } + "type": "reliquary:potions_enabled" } - ] + ], + "type": "reliquary:potion_effects", + "duration_factor": 1.0, + "key": { + "B": { + "item": "reliquary:bullets/concussive_bullet" + }, + "M": { + "item": "reliquary:magazines/empty_magazine" + } + }, + "pattern": [ + "BBB", + "BMB", + "BBB" + ], + "result": { + "item": "reliquary:magazines/concussive_magazine" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/magazines/empty_magazine.json b/src/generated/resources/data/reliquary/recipes/magazines/empty_magazine.json index 611efd92..5fd678e5 100644 --- a/src/generated/resources/data/reliquary/recipes/magazines/empty_magazine.json +++ b/src/generated/resources/data/reliquary/recipes/magazines/empty_magazine.json @@ -1,36 +1,28 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "G": { - "tag": "forge:glass" - }, - "I": { - "tag": "forge:ingots/iron" - }, - "S": { - "tag": "forge:stone" - } - }, - "pattern": [ - "I I", - "IGI", - "SIS" - ], - "result": { - "item": "reliquary:magazines/empty_magazine" - }, - "show_notification": true - } + "type": "reliquary:handgun_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "G": { + "tag": "forge:glass" + }, + "I": { + "tag": "forge:ingots/iron" + }, + "S": { + "tag": "forge:stone" + } + }, + "pattern": [ + "I I", + "IGI", + "SIS" + ], + "result": { + "item": "reliquary:magazines/empty_magazine" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/magazines/ender_magazine.json b/src/generated/resources/data/reliquary/recipes/magazines/ender_magazine.json index 979ed1aa..b1541696 100644 --- a/src/generated/resources/data/reliquary/recipes/magazines/ender_magazine.json +++ b/src/generated/resources/data/reliquary/recipes/magazines/ender_magazine.json @@ -1,37 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:potions_enabled" - }, - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "reliquary:potion_effects", - "category": "misc", - "duration_factor": 1.0, - "key": { - "B": { - "item": "reliquary:bullets/ender_bullet" - }, - "M": { - "item": "reliquary:magazines/empty_magazine" - } - }, - "pattern": [ - "BBB", - "BMB", - "BBB" - ], - "result": { - "item": "reliquary:magazines/ender_magazine" - }, - "show_notification": true - } + "type": "reliquary:potions_enabled" } - ] + ], + "type": "reliquary:potion_effects", + "duration_factor": 1.0, + "key": { + "B": { + "item": "reliquary:bullets/ender_bullet" + }, + "M": { + "item": "reliquary:magazines/empty_magazine" + } + }, + "pattern": [ + "BBB", + "BMB", + "BBB" + ], + "result": { + "item": "reliquary:magazines/ender_magazine" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/magazines/exorcism_magazine.json b/src/generated/resources/data/reliquary/recipes/magazines/exorcism_magazine.json index 222e4e61..580634f6 100644 --- a/src/generated/resources/data/reliquary/recipes/magazines/exorcism_magazine.json +++ b/src/generated/resources/data/reliquary/recipes/magazines/exorcism_magazine.json @@ -1,37 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:potions_enabled" - }, - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "reliquary:potion_effects", - "category": "misc", - "duration_factor": 1.0, - "key": { - "B": { - "item": "reliquary:bullets/exorcism_bullet" - }, - "M": { - "item": "reliquary:magazines/empty_magazine" - } - }, - "pattern": [ - "BBB", - "BMB", - "BBB" - ], - "result": { - "item": "reliquary:magazines/exorcism_magazine" - }, - "show_notification": true - } + "type": "reliquary:potions_enabled" } - ] + ], + "type": "reliquary:potion_effects", + "duration_factor": 1.0, + "key": { + "B": { + "item": "reliquary:bullets/exorcism_bullet" + }, + "M": { + "item": "reliquary:magazines/empty_magazine" + } + }, + "pattern": [ + "BBB", + "BMB", + "BBB" + ], + "result": { + "item": "reliquary:magazines/exorcism_magazine" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/magazines/neutral_magazine.json b/src/generated/resources/data/reliquary/recipes/magazines/neutral_magazine.json index 6f807594..5af5e25c 100644 --- a/src/generated/resources/data/reliquary/recipes/magazines/neutral_magazine.json +++ b/src/generated/resources/data/reliquary/recipes/magazines/neutral_magazine.json @@ -1,37 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:potions_enabled" - }, - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "reliquary:potion_effects", - "category": "misc", - "duration_factor": 1.0, - "key": { - "B": { - "item": "reliquary:bullets/neutral_bullet" - }, - "M": { - "item": "reliquary:magazines/empty_magazine" - } - }, - "pattern": [ - "BBB", - "BMB", - "BBB" - ], - "result": { - "item": "reliquary:magazines/neutral_magazine" - }, - "show_notification": true - } + "type": "reliquary:potions_enabled" } - ] + ], + "type": "reliquary:potion_effects", + "duration_factor": 1.0, + "key": { + "B": { + "item": "reliquary:bullets/neutral_bullet" + }, + "M": { + "item": "reliquary:magazines/empty_magazine" + } + }, + "pattern": [ + "BBB", + "BMB", + "BBB" + ], + "result": { + "item": "reliquary:magazines/neutral_magazine" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/magazines/sand_magazine.json b/src/generated/resources/data/reliquary/recipes/magazines/sand_magazine.json index 7ba6c7db..601ad69a 100644 --- a/src/generated/resources/data/reliquary/recipes/magazines/sand_magazine.json +++ b/src/generated/resources/data/reliquary/recipes/magazines/sand_magazine.json @@ -1,37 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:potions_enabled" - }, - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "reliquary:potion_effects", - "category": "misc", - "duration_factor": 1.0, - "key": { - "B": { - "item": "reliquary:bullets/sand_bullet" - }, - "M": { - "item": "reliquary:magazines/empty_magazine" - } - }, - "pattern": [ - "BBB", - "BMB", - "BBB" - ], - "result": { - "item": "reliquary:magazines/sand_magazine" - }, - "show_notification": true - } + "type": "reliquary:potions_enabled" } - ] + ], + "type": "reliquary:potion_effects", + "duration_factor": 1.0, + "key": { + "B": { + "item": "reliquary:bullets/sand_bullet" + }, + "M": { + "item": "reliquary:magazines/empty_magazine" + } + }, + "pattern": [ + "BBB", + "BMB", + "BBB" + ], + "result": { + "item": "reliquary:magazines/sand_magazine" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/magazines/seeker_magazine.json b/src/generated/resources/data/reliquary/recipes/magazines/seeker_magazine.json index fac4b8ea..a9dda5e2 100644 --- a/src/generated/resources/data/reliquary/recipes/magazines/seeker_magazine.json +++ b/src/generated/resources/data/reliquary/recipes/magazines/seeker_magazine.json @@ -1,37 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:potions_enabled" - }, - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "reliquary:potion_effects", - "category": "misc", - "duration_factor": 1.0, - "key": { - "B": { - "item": "reliquary:bullets/seeker_bullet" - }, - "M": { - "item": "reliquary:magazines/empty_magazine" - } - }, - "pattern": [ - "BBB", - "BMB", - "BBB" - ], - "result": { - "item": "reliquary:magazines/seeker_magazine" - }, - "show_notification": true - } + "type": "reliquary:potions_enabled" } - ] + ], + "type": "reliquary:potion_effects", + "duration_factor": 1.0, + "key": { + "B": { + "item": "reliquary:bullets/seeker_bullet" + }, + "M": { + "item": "reliquary:magazines/empty_magazine" + } + }, + "pattern": [ + "BBB", + "BMB", + "BBB" + ], + "result": { + "item": "reliquary:magazines/seeker_magazine" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/magazines/storm_magazine.json b/src/generated/resources/data/reliquary/recipes/magazines/storm_magazine.json index af3adcee..f9e200c8 100644 --- a/src/generated/resources/data/reliquary/recipes/magazines/storm_magazine.json +++ b/src/generated/resources/data/reliquary/recipes/magazines/storm_magazine.json @@ -1,37 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:potions_enabled" - }, - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "reliquary:potion_effects", - "category": "misc", - "duration_factor": 1.0, - "key": { - "B": { - "item": "reliquary:bullets/storm_bullet" - }, - "M": { - "item": "reliquary:magazines/empty_magazine" - } - }, - "pattern": [ - "BBB", - "BMB", - "BBB" - ], - "result": { - "item": "reliquary:magazines/storm_magazine" - }, - "show_notification": true - } + "type": "reliquary:potions_enabled" } - ] + ], + "type": "reliquary:potion_effects", + "duration_factor": 1.0, + "key": { + "B": { + "item": "reliquary:bullets/storm_bullet" + }, + "M": { + "item": "reliquary:magazines/empty_magazine" + } + }, + "pattern": [ + "BBB", + "BMB", + "BBB" + ], + "result": { + "item": "reliquary:magazines/storm_magazine" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/magicbane.json b/src/generated/resources/data/reliquary/recipes/magicbane.json index 3e21803a..05987f75 100644 --- a/src/generated/resources/data/reliquary/recipes/magicbane.json +++ b/src/generated/resources/data/reliquary/recipes/magicbane.json @@ -18,6 +18,5 @@ ], "result": { "item": "reliquary:magicbane" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/mercy_cross.json b/src/generated/resources/data/reliquary/recipes/mercy_cross.json index 4b4e2d3e..34e9da6a 100644 --- a/src/generated/resources/data/reliquary/recipes/mercy_cross.json +++ b/src/generated/resources/data/reliquary/recipes/mercy_cross.json @@ -28,6 +28,5 @@ ], "result": { "item": "reliquary:mercy_cross" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/midas_touchstone.json b/src/generated/resources/data/reliquary/recipes/midas_touchstone.json index 560fb22e..b08d4007 100644 --- a/src/generated/resources/data/reliquary/recipes/midas_touchstone.json +++ b/src/generated/resources/data/reliquary/recipes/midas_touchstone.json @@ -27,9 +27,10 @@ "item": "reliquary:catalyzing_gland" }, { - "type": "forge:nbt", - "count": 1, - "item": "reliquary:void_tear" + "type": "neoforge:nbt", + "item": "reliquary:void_tear", + "strict": true, + "tag": "{}" } ], "result": { diff --git a/src/generated/resources/data/reliquary/recipes/mob_charm.json b/src/generated/resources/data/reliquary/recipes/mob_charm.json index 13aa8b35..6e49b291 100644 --- a/src/generated/resources/data/reliquary/recipes/mob_charm.json +++ b/src/generated/resources/data/reliquary/recipes/mob_charm.json @@ -1,22 +1,25 @@ { "type": "reliquary:mob_charm", - "key": { - "F": { - "item": "reliquary:mob_charm_fragment" + "value": { + "category": "misc", + "key": { + "F": { + "item": "reliquary:mob_charm_fragment" + }, + "L": { + "tag": "forge:leather" + }, + "S": { + "tag": "forge:string" + } }, - "L": { - "tag": "forge:leather" - }, - "S": { - "tag": "forge:string" + "pattern": [ + "FLF", + "FSF", + "F F" + ], + "result": { + "item": "reliquary:mob_charm" } - }, - "pattern": [ - "FLF", - "FSF", - "F F" - ], - "result": { - "item": "reliquary:mob_charm" } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/mob_charm_belt.json b/src/generated/resources/data/reliquary/recipes/mob_charm_belt.json index a288f262..85b55d13 100644 --- a/src/generated/resources/data/reliquary/recipes/mob_charm_belt.json +++ b/src/generated/resources/data/reliquary/recipes/mob_charm_belt.json @@ -16,6 +16,5 @@ ], "result": { "item": "reliquary:mob_charm_belt" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/blaze.json b/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/blaze.json index 305d2de4..ae014a9b 100644 --- a/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/blaze.json +++ b/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/blaze.json @@ -1,5 +1,6 @@ { "type": "minecraft:crafting_shaped", + "category": "misc", "key": { "P": { "item": "reliquary:molten_core" diff --git a/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/cave_spider.json b/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/cave_spider.json index bf2fc002..b6d43e76 100644 --- a/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/cave_spider.json +++ b/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/cave_spider.json @@ -1,5 +1,6 @@ { "type": "minecraft:crafting_shaped", + "category": "misc", "key": { "P": { "item": "reliquary:chelicerae" @@ -8,10 +9,10 @@ "tag": "forge:string" }, "T": { - "type": "forge:nbt", - "count": 1, + "type": "neoforge:nbt", "item": "minecraft:potion", - "nbt": "{Potion:\"minecraft:poison\"}" + "strict": true, + "tag": "{Potion:\"minecraft:poison\"}" } }, "pattern": [ diff --git a/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/creeper.json b/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/creeper.json index 59514851..23c86a6f 100644 --- a/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/creeper.json +++ b/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/creeper.json @@ -1,5 +1,6 @@ { "type": "minecraft:crafting_shaped", + "category": "misc", "key": { "P": { "item": "reliquary:catalyzing_gland" diff --git a/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/enderman.json b/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/enderman.json index b3df9808..ba88ab04 100644 --- a/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/enderman.json +++ b/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/enderman.json @@ -1,5 +1,6 @@ { "type": "minecraft:crafting_shaped", + "category": "misc", "key": { "P": { "item": "reliquary:nebulous_heart" diff --git a/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/ghast.json b/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/ghast.json index f14c4cf1..89cc20d4 100644 --- a/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/ghast.json +++ b/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/ghast.json @@ -1,5 +1,6 @@ { "type": "minecraft:crafting_shaped", + "category": "misc", "key": { "P": { "item": "minecraft:ghast_tear" diff --git a/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/guardian.json b/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/guardian.json index f9afca95..321aece9 100644 --- a/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/guardian.json +++ b/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/guardian.json @@ -1,5 +1,6 @@ { "type": "minecraft:crafting_shaped", + "category": "misc", "key": { "P": { "item": "reliquary:guardian_spike" diff --git a/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/magma_cube.json b/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/magma_cube.json index 3aa91f31..2eeab07e 100644 --- a/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/magma_cube.json +++ b/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/magma_cube.json @@ -1,5 +1,6 @@ { "type": "minecraft:crafting_shaped", + "category": "misc", "key": { "P": { "item": "reliquary:molten_core" diff --git a/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/skeleton.json b/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/skeleton.json index ff84e523..aa531017 100644 --- a/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/skeleton.json +++ b/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/skeleton.json @@ -1,5 +1,6 @@ { "type": "minecraft:crafting_shaped", + "category": "misc", "key": { "P": { "item": "reliquary:rib_bone" diff --git a/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/slime.json b/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/slime.json index 88bc52bf..a5d8a7cf 100644 --- a/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/slime.json +++ b/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/slime.json @@ -1,5 +1,6 @@ { "type": "minecraft:crafting_shaped", + "category": "misc", "key": { "P": { "item": "reliquary:slime_pearl" diff --git a/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/spider.json b/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/spider.json index 3f7de667..be9debff 100644 --- a/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/spider.json +++ b/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/spider.json @@ -1,5 +1,6 @@ { "type": "minecraft:crafting_shaped", + "category": "misc", "key": { "P": { "item": "reliquary:chelicerae" diff --git a/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/witch.json b/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/witch.json index 72059045..f5d15acf 100644 --- a/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/witch.json +++ b/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/witch.json @@ -1,5 +1,6 @@ { "type": "minecraft:crafting_shaped", + "category": "misc", "key": { "P": { "item": "reliquary:witch_hat" diff --git a/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/wither_skeleton.json b/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/wither_skeleton.json index 9414b629..4c3485c1 100644 --- a/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/wither_skeleton.json +++ b/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/wither_skeleton.json @@ -1,5 +1,6 @@ { "type": "minecraft:crafting_shaped", + "category": "misc", "key": { "P": { "item": "reliquary:withered_rib" diff --git a/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/zombie.json b/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/zombie.json index ae3d4dcb..a906b507 100644 --- a/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/zombie.json +++ b/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/zombie.json @@ -1,5 +1,6 @@ { "type": "minecraft:crafting_shaped", + "category": "misc", "key": { "P": { "item": "reliquary:zombie_heart" diff --git a/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/zombified_piglin.json b/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/zombified_piglin.json index ead8683f..ebe6a1e5 100644 --- a/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/zombified_piglin.json +++ b/src/generated/resources/data/reliquary/recipes/mob_charm_fragments/zombified_piglin.json @@ -1,5 +1,6 @@ { "type": "minecraft:crafting_shaped", + "category": "misc", "key": { "P": { "item": "reliquary:zombie_heart" diff --git a/src/generated/resources/data/reliquary/recipes/molten_core.json b/src/generated/resources/data/reliquary/recipes/molten_core.json index 99bcda87..ea2dc365 100644 --- a/src/generated/resources/data/reliquary/recipes/molten_core.json +++ b/src/generated/resources/data/reliquary/recipes/molten_core.json @@ -1,33 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:mob_drops_craftable" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "G": { - "tag": "forge:ingots/gold" - }, - "M": { - "item": "minecraft:magma_cream" - } - }, - "pattern": [ - "GGG", - "GMG", - "GGG" - ], - "result": { - "item": "reliquary:molten_core" - }, - "show_notification": true - } + "type": "reliquary:mob_drops_craftable" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "G": { + "tag": "forge:ingots/gold" + }, + "M": { + "item": "minecraft:magma_cream" + } + }, + "pattern": [ + "GGG", + "GMG", + "GGG" + ], + "result": { + "item": "reliquary:molten_core" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/nebulous_heart.json b/src/generated/resources/data/reliquary/recipes/nebulous_heart.json index e8b86b73..2cc8a947 100644 --- a/src/generated/resources/data/reliquary/recipes/nebulous_heart.json +++ b/src/generated/resources/data/reliquary/recipes/nebulous_heart.json @@ -1,33 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:mob_drops_craftable" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "E": { - "tag": "forge:ender_pearls" - }, - "G": { - "tag": "forge:ingots/gold" - } - }, - "pattern": [ - "GGG", - "GEG", - "GGG" - ], - "result": { - "item": "reliquary:nebulous_heart" - }, - "show_notification": true - } + "type": "reliquary:mob_drops_craftable" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "E": { + "tag": "forge:ender_pearls" + }, + "G": { + "tag": "forge:ingots/gold" + } + }, + "pattern": [ + "GGG", + "GEG", + "GGG" + ], + "result": { + "item": "reliquary:nebulous_heart" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/black_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/black_pedestal.json index d8ebc7e4..4558453a 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/black_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/black_pedestal.json @@ -1,33 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "D": { - "tag": "forge:gems/diamond" - }, - "P": { - "item": "reliquary:pedestals/passive/black_passive_pedestal" - } - }, - "pattern": [ - "D D", - " P ", - "D D" - ], - "result": { - "item": "reliquary:pedestals/black_pedestal" - }, - "show_notification": true - } + "type": "reliquary:pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "D": { + "tag": "forge:gems/diamond" + }, + "P": { + "item": "reliquary:pedestals/passive/black_passive_pedestal" + } + }, + "pattern": [ + "D D", + " P ", + "D D" + ], + "result": { + "item": "reliquary:pedestals/black_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/blue_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/blue_pedestal.json index f9359427..589f3fe8 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/blue_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/blue_pedestal.json @@ -1,33 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "D": { - "tag": "forge:gems/diamond" - }, - "P": { - "item": "reliquary:pedestals/passive/blue_passive_pedestal" - } - }, - "pattern": [ - "D D", - " P ", - "D D" - ], - "result": { - "item": "reliquary:pedestals/blue_pedestal" - }, - "show_notification": true - } + "type": "reliquary:pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "D": { + "tag": "forge:gems/diamond" + }, + "P": { + "item": "reliquary:pedestals/passive/blue_passive_pedestal" + } + }, + "pattern": [ + "D D", + " P ", + "D D" + ], + "result": { + "item": "reliquary:pedestals/blue_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/brown_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/brown_pedestal.json index a52f45c4..b7e9bae9 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/brown_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/brown_pedestal.json @@ -1,33 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "D": { - "tag": "forge:gems/diamond" - }, - "P": { - "item": "reliquary:pedestals/passive/brown_passive_pedestal" - } - }, - "pattern": [ - "D D", - " P ", - "D D" - ], - "result": { - "item": "reliquary:pedestals/brown_pedestal" - }, - "show_notification": true - } + "type": "reliquary:pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "D": { + "tag": "forge:gems/diamond" + }, + "P": { + "item": "reliquary:pedestals/passive/brown_passive_pedestal" + } + }, + "pattern": [ + "D D", + " P ", + "D D" + ], + "result": { + "item": "reliquary:pedestals/brown_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/cyan_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/cyan_pedestal.json index c2e0f70e..d54c63a2 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/cyan_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/cyan_pedestal.json @@ -1,33 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "D": { - "tag": "forge:gems/diamond" - }, - "P": { - "item": "reliquary:pedestals/passive/cyan_passive_pedestal" - } - }, - "pattern": [ - "D D", - " P ", - "D D" - ], - "result": { - "item": "reliquary:pedestals/cyan_pedestal" - }, - "show_notification": true - } + "type": "reliquary:pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "D": { + "tag": "forge:gems/diamond" + }, + "P": { + "item": "reliquary:pedestals/passive/cyan_passive_pedestal" + } + }, + "pattern": [ + "D D", + " P ", + "D D" + ], + "result": { + "item": "reliquary:pedestals/cyan_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/gray_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/gray_pedestal.json index 21515036..6a41b696 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/gray_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/gray_pedestal.json @@ -1,33 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "D": { - "tag": "forge:gems/diamond" - }, - "P": { - "item": "reliquary:pedestals/passive/gray_passive_pedestal" - } - }, - "pattern": [ - "D D", - " P ", - "D D" - ], - "result": { - "item": "reliquary:pedestals/gray_pedestal" - }, - "show_notification": true - } + "type": "reliquary:pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "D": { + "tag": "forge:gems/diamond" + }, + "P": { + "item": "reliquary:pedestals/passive/gray_passive_pedestal" + } + }, + "pattern": [ + "D D", + " P ", + "D D" + ], + "result": { + "item": "reliquary:pedestals/gray_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/green_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/green_pedestal.json index 7cc52c5e..464646bc 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/green_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/green_pedestal.json @@ -1,33 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "D": { - "tag": "forge:gems/diamond" - }, - "P": { - "item": "reliquary:pedestals/passive/green_passive_pedestal" - } - }, - "pattern": [ - "D D", - " P ", - "D D" - ], - "result": { - "item": "reliquary:pedestals/green_pedestal" - }, - "show_notification": true - } + "type": "reliquary:pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "D": { + "tag": "forge:gems/diamond" + }, + "P": { + "item": "reliquary:pedestals/passive/green_passive_pedestal" + } + }, + "pattern": [ + "D D", + " P ", + "D D" + ], + "result": { + "item": "reliquary:pedestals/green_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/light_blue_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/light_blue_pedestal.json index 25da0649..7f3dd22f 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/light_blue_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/light_blue_pedestal.json @@ -1,33 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "D": { - "tag": "forge:gems/diamond" - }, - "P": { - "item": "reliquary:pedestals/passive/light_blue_passive_pedestal" - } - }, - "pattern": [ - "D D", - " P ", - "D D" - ], - "result": { - "item": "reliquary:pedestals/light_blue_pedestal" - }, - "show_notification": true - } + "type": "reliquary:pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "D": { + "tag": "forge:gems/diamond" + }, + "P": { + "item": "reliquary:pedestals/passive/light_blue_passive_pedestal" + } + }, + "pattern": [ + "D D", + " P ", + "D D" + ], + "result": { + "item": "reliquary:pedestals/light_blue_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/light_gray_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/light_gray_pedestal.json index 298b2fd2..0861df73 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/light_gray_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/light_gray_pedestal.json @@ -1,33 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "D": { - "tag": "forge:gems/diamond" - }, - "P": { - "item": "reliquary:pedestals/passive/light_gray_passive_pedestal" - } - }, - "pattern": [ - "D D", - " P ", - "D D" - ], - "result": { - "item": "reliquary:pedestals/light_gray_pedestal" - }, - "show_notification": true - } + "type": "reliquary:pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "D": { + "tag": "forge:gems/diamond" + }, + "P": { + "item": "reliquary:pedestals/passive/light_gray_passive_pedestal" + } + }, + "pattern": [ + "D D", + " P ", + "D D" + ], + "result": { + "item": "reliquary:pedestals/light_gray_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/lime_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/lime_pedestal.json index 38811261..28d9796c 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/lime_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/lime_pedestal.json @@ -1,33 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "D": { - "tag": "forge:gems/diamond" - }, - "P": { - "item": "reliquary:pedestals/passive/lime_passive_pedestal" - } - }, - "pattern": [ - "D D", - " P ", - "D D" - ], - "result": { - "item": "reliquary:pedestals/lime_pedestal" - }, - "show_notification": true - } + "type": "reliquary:pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "D": { + "tag": "forge:gems/diamond" + }, + "P": { + "item": "reliquary:pedestals/passive/lime_passive_pedestal" + } + }, + "pattern": [ + "D D", + " P ", + "D D" + ], + "result": { + "item": "reliquary:pedestals/lime_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/magenta_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/magenta_pedestal.json index 140c4a52..4ea80bf8 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/magenta_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/magenta_pedestal.json @@ -1,33 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "D": { - "tag": "forge:gems/diamond" - }, - "P": { - "item": "reliquary:pedestals/passive/magenta_passive_pedestal" - } - }, - "pattern": [ - "D D", - " P ", - "D D" - ], - "result": { - "item": "reliquary:pedestals/magenta_pedestal" - }, - "show_notification": true - } + "type": "reliquary:pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "D": { + "tag": "forge:gems/diamond" + }, + "P": { + "item": "reliquary:pedestals/passive/magenta_passive_pedestal" + } + }, + "pattern": [ + "D D", + " P ", + "D D" + ], + "result": { + "item": "reliquary:pedestals/magenta_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/orange_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/orange_pedestal.json index ccf408fd..3ffbe31b 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/orange_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/orange_pedestal.json @@ -1,33 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "D": { - "tag": "forge:gems/diamond" - }, - "P": { - "item": "reliquary:pedestals/passive/orange_passive_pedestal" - } - }, - "pattern": [ - "D D", - " P ", - "D D" - ], - "result": { - "item": "reliquary:pedestals/orange_pedestal" - }, - "show_notification": true - } + "type": "reliquary:pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "D": { + "tag": "forge:gems/diamond" + }, + "P": { + "item": "reliquary:pedestals/passive/orange_passive_pedestal" + } + }, + "pattern": [ + "D D", + " P ", + "D D" + ], + "result": { + "item": "reliquary:pedestals/orange_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/passive/black_passive_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/passive/black_passive_pedestal.json index 685a730c..5ecc9d21 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/passive/black_passive_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/passive/black_passive_pedestal.json @@ -1,39 +1,31 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:passive_pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "item": "minecraft:black_carpet" - }, - "G": { - "tag": "forge:nuggets/gold" - }, - "Q": { - "tag": "forge:storage_blocks/quartz" - }, - "S": { - "item": "minecraft:quartz_slab" - } - }, - "pattern": [ - " C ", - "GQG", - "SSS" - ], - "result": { - "item": "reliquary:pedestals/passive/black_passive_pedestal" - }, - "show_notification": true - } + "type": "reliquary:passive_pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "item": "minecraft:black_carpet" + }, + "G": { + "tag": "forge:nuggets/gold" + }, + "Q": { + "tag": "forge:storage_blocks/quartz" + }, + "S": { + "item": "minecraft:quartz_slab" + } + }, + "pattern": [ + " C ", + "GQG", + "SSS" + ], + "result": { + "item": "reliquary:pedestals/passive/black_passive_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/passive/blue_passive_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/passive/blue_passive_pedestal.json index a07fdbcc..5892c379 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/passive/blue_passive_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/passive/blue_passive_pedestal.json @@ -1,39 +1,31 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:passive_pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "item": "minecraft:blue_carpet" - }, - "G": { - "tag": "forge:nuggets/gold" - }, - "Q": { - "tag": "forge:storage_blocks/quartz" - }, - "S": { - "item": "minecraft:quartz_slab" - } - }, - "pattern": [ - " C ", - "GQG", - "SSS" - ], - "result": { - "item": "reliquary:pedestals/passive/blue_passive_pedestal" - }, - "show_notification": true - } + "type": "reliquary:passive_pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "item": "minecraft:blue_carpet" + }, + "G": { + "tag": "forge:nuggets/gold" + }, + "Q": { + "tag": "forge:storage_blocks/quartz" + }, + "S": { + "item": "minecraft:quartz_slab" + } + }, + "pattern": [ + " C ", + "GQG", + "SSS" + ], + "result": { + "item": "reliquary:pedestals/passive/blue_passive_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/passive/brown_passive_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/passive/brown_passive_pedestal.json index 30f078f0..2b345b77 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/passive/brown_passive_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/passive/brown_passive_pedestal.json @@ -1,39 +1,31 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:passive_pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "item": "minecraft:brown_carpet" - }, - "G": { - "tag": "forge:nuggets/gold" - }, - "Q": { - "tag": "forge:storage_blocks/quartz" - }, - "S": { - "item": "minecraft:quartz_slab" - } - }, - "pattern": [ - " C ", - "GQG", - "SSS" - ], - "result": { - "item": "reliquary:pedestals/passive/brown_passive_pedestal" - }, - "show_notification": true - } + "type": "reliquary:passive_pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "item": "minecraft:brown_carpet" + }, + "G": { + "tag": "forge:nuggets/gold" + }, + "Q": { + "tag": "forge:storage_blocks/quartz" + }, + "S": { + "item": "minecraft:quartz_slab" + } + }, + "pattern": [ + " C ", + "GQG", + "SSS" + ], + "result": { + "item": "reliquary:pedestals/passive/brown_passive_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/passive/cyan_passive_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/passive/cyan_passive_pedestal.json index 7561d3a6..8c36ad73 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/passive/cyan_passive_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/passive/cyan_passive_pedestal.json @@ -1,39 +1,31 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:passive_pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "item": "minecraft:cyan_carpet" - }, - "G": { - "tag": "forge:nuggets/gold" - }, - "Q": { - "tag": "forge:storage_blocks/quartz" - }, - "S": { - "item": "minecraft:quartz_slab" - } - }, - "pattern": [ - " C ", - "GQG", - "SSS" - ], - "result": { - "item": "reliquary:pedestals/passive/cyan_passive_pedestal" - }, - "show_notification": true - } + "type": "reliquary:passive_pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "item": "minecraft:cyan_carpet" + }, + "G": { + "tag": "forge:nuggets/gold" + }, + "Q": { + "tag": "forge:storage_blocks/quartz" + }, + "S": { + "item": "minecraft:quartz_slab" + } + }, + "pattern": [ + " C ", + "GQG", + "SSS" + ], + "result": { + "item": "reliquary:pedestals/passive/cyan_passive_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/passive/gray_passive_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/passive/gray_passive_pedestal.json index 624e3cec..11ff9ab4 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/passive/gray_passive_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/passive/gray_passive_pedestal.json @@ -1,39 +1,31 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:passive_pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "item": "minecraft:gray_carpet" - }, - "G": { - "tag": "forge:nuggets/gold" - }, - "Q": { - "tag": "forge:storage_blocks/quartz" - }, - "S": { - "item": "minecraft:quartz_slab" - } - }, - "pattern": [ - " C ", - "GQG", - "SSS" - ], - "result": { - "item": "reliquary:pedestals/passive/gray_passive_pedestal" - }, - "show_notification": true - } + "type": "reliquary:passive_pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "item": "minecraft:gray_carpet" + }, + "G": { + "tag": "forge:nuggets/gold" + }, + "Q": { + "tag": "forge:storage_blocks/quartz" + }, + "S": { + "item": "minecraft:quartz_slab" + } + }, + "pattern": [ + " C ", + "GQG", + "SSS" + ], + "result": { + "item": "reliquary:pedestals/passive/gray_passive_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/passive/green_passive_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/passive/green_passive_pedestal.json index bba10db5..9e309770 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/passive/green_passive_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/passive/green_passive_pedestal.json @@ -1,39 +1,31 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:passive_pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "item": "minecraft:green_carpet" - }, - "G": { - "tag": "forge:nuggets/gold" - }, - "Q": { - "tag": "forge:storage_blocks/quartz" - }, - "S": { - "item": "minecraft:quartz_slab" - } - }, - "pattern": [ - " C ", - "GQG", - "SSS" - ], - "result": { - "item": "reliquary:pedestals/passive/green_passive_pedestal" - }, - "show_notification": true - } + "type": "reliquary:passive_pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "item": "minecraft:green_carpet" + }, + "G": { + "tag": "forge:nuggets/gold" + }, + "Q": { + "tag": "forge:storage_blocks/quartz" + }, + "S": { + "item": "minecraft:quartz_slab" + } + }, + "pattern": [ + " C ", + "GQG", + "SSS" + ], + "result": { + "item": "reliquary:pedestals/passive/green_passive_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/passive/light_blue_passive_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/passive/light_blue_passive_pedestal.json index feaee66b..eb00800c 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/passive/light_blue_passive_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/passive/light_blue_passive_pedestal.json @@ -1,39 +1,31 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:passive_pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "item": "minecraft:light_blue_carpet" - }, - "G": { - "tag": "forge:nuggets/gold" - }, - "Q": { - "tag": "forge:storage_blocks/quartz" - }, - "S": { - "item": "minecraft:quartz_slab" - } - }, - "pattern": [ - " C ", - "GQG", - "SSS" - ], - "result": { - "item": "reliquary:pedestals/passive/light_blue_passive_pedestal" - }, - "show_notification": true - } + "type": "reliquary:passive_pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "item": "minecraft:light_blue_carpet" + }, + "G": { + "tag": "forge:nuggets/gold" + }, + "Q": { + "tag": "forge:storage_blocks/quartz" + }, + "S": { + "item": "minecraft:quartz_slab" + } + }, + "pattern": [ + " C ", + "GQG", + "SSS" + ], + "result": { + "item": "reliquary:pedestals/passive/light_blue_passive_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/passive/light_gray_passive_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/passive/light_gray_passive_pedestal.json index 90d5cf62..f8cc7738 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/passive/light_gray_passive_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/passive/light_gray_passive_pedestal.json @@ -1,39 +1,31 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:passive_pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "item": "minecraft:light_gray_carpet" - }, - "G": { - "tag": "forge:nuggets/gold" - }, - "Q": { - "tag": "forge:storage_blocks/quartz" - }, - "S": { - "item": "minecraft:quartz_slab" - } - }, - "pattern": [ - " C ", - "GQG", - "SSS" - ], - "result": { - "item": "reliquary:pedestals/passive/light_gray_passive_pedestal" - }, - "show_notification": true - } + "type": "reliquary:passive_pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "item": "minecraft:light_gray_carpet" + }, + "G": { + "tag": "forge:nuggets/gold" + }, + "Q": { + "tag": "forge:storage_blocks/quartz" + }, + "S": { + "item": "minecraft:quartz_slab" + } + }, + "pattern": [ + " C ", + "GQG", + "SSS" + ], + "result": { + "item": "reliquary:pedestals/passive/light_gray_passive_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/passive/lime_passive_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/passive/lime_passive_pedestal.json index 15c08762..51a7da46 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/passive/lime_passive_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/passive/lime_passive_pedestal.json @@ -1,39 +1,31 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:passive_pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "item": "minecraft:lime_carpet" - }, - "G": { - "tag": "forge:nuggets/gold" - }, - "Q": { - "tag": "forge:storage_blocks/quartz" - }, - "S": { - "item": "minecraft:quartz_slab" - } - }, - "pattern": [ - " C ", - "GQG", - "SSS" - ], - "result": { - "item": "reliquary:pedestals/passive/lime_passive_pedestal" - }, - "show_notification": true - } + "type": "reliquary:passive_pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "item": "minecraft:lime_carpet" + }, + "G": { + "tag": "forge:nuggets/gold" + }, + "Q": { + "tag": "forge:storage_blocks/quartz" + }, + "S": { + "item": "minecraft:quartz_slab" + } + }, + "pattern": [ + " C ", + "GQG", + "SSS" + ], + "result": { + "item": "reliquary:pedestals/passive/lime_passive_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/passive/magenta_passive_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/passive/magenta_passive_pedestal.json index 20e41e4f..ebd789bb 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/passive/magenta_passive_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/passive/magenta_passive_pedestal.json @@ -1,39 +1,31 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:passive_pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "item": "minecraft:magenta_carpet" - }, - "G": { - "tag": "forge:nuggets/gold" - }, - "Q": { - "tag": "forge:storage_blocks/quartz" - }, - "S": { - "item": "minecraft:quartz_slab" - } - }, - "pattern": [ - " C ", - "GQG", - "SSS" - ], - "result": { - "item": "reliquary:pedestals/passive/magenta_passive_pedestal" - }, - "show_notification": true - } + "type": "reliquary:passive_pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "item": "minecraft:magenta_carpet" + }, + "G": { + "tag": "forge:nuggets/gold" + }, + "Q": { + "tag": "forge:storage_blocks/quartz" + }, + "S": { + "item": "minecraft:quartz_slab" + } + }, + "pattern": [ + " C ", + "GQG", + "SSS" + ], + "result": { + "item": "reliquary:pedestals/passive/magenta_passive_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/passive/orange_passive_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/passive/orange_passive_pedestal.json index 5367f88e..be9b0c34 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/passive/orange_passive_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/passive/orange_passive_pedestal.json @@ -1,39 +1,31 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:passive_pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "item": "minecraft:orange_carpet" - }, - "G": { - "tag": "forge:nuggets/gold" - }, - "Q": { - "tag": "forge:storage_blocks/quartz" - }, - "S": { - "item": "minecraft:quartz_slab" - } - }, - "pattern": [ - " C ", - "GQG", - "SSS" - ], - "result": { - "item": "reliquary:pedestals/passive/orange_passive_pedestal" - }, - "show_notification": true - } + "type": "reliquary:passive_pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "item": "minecraft:orange_carpet" + }, + "G": { + "tag": "forge:nuggets/gold" + }, + "Q": { + "tag": "forge:storage_blocks/quartz" + }, + "S": { + "item": "minecraft:quartz_slab" + } + }, + "pattern": [ + " C ", + "GQG", + "SSS" + ], + "result": { + "item": "reliquary:pedestals/passive/orange_passive_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/passive/pink_passive_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/passive/pink_passive_pedestal.json index c1ab771b..fdc6fc61 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/passive/pink_passive_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/passive/pink_passive_pedestal.json @@ -1,39 +1,31 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:passive_pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "item": "minecraft:pink_carpet" - }, - "G": { - "tag": "forge:nuggets/gold" - }, - "Q": { - "tag": "forge:storage_blocks/quartz" - }, - "S": { - "item": "minecraft:quartz_slab" - } - }, - "pattern": [ - " C ", - "GQG", - "SSS" - ], - "result": { - "item": "reliquary:pedestals/passive/pink_passive_pedestal" - }, - "show_notification": true - } + "type": "reliquary:passive_pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "item": "minecraft:pink_carpet" + }, + "G": { + "tag": "forge:nuggets/gold" + }, + "Q": { + "tag": "forge:storage_blocks/quartz" + }, + "S": { + "item": "minecraft:quartz_slab" + } + }, + "pattern": [ + " C ", + "GQG", + "SSS" + ], + "result": { + "item": "reliquary:pedestals/passive/pink_passive_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/passive/purple_passive_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/passive/purple_passive_pedestal.json index 70f99165..388e5851 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/passive/purple_passive_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/passive/purple_passive_pedestal.json @@ -1,39 +1,31 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:passive_pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "item": "minecraft:purple_carpet" - }, - "G": { - "tag": "forge:nuggets/gold" - }, - "Q": { - "tag": "forge:storage_blocks/quartz" - }, - "S": { - "item": "minecraft:quartz_slab" - } - }, - "pattern": [ - " C ", - "GQG", - "SSS" - ], - "result": { - "item": "reliquary:pedestals/passive/purple_passive_pedestal" - }, - "show_notification": true - } + "type": "reliquary:passive_pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "item": "minecraft:purple_carpet" + }, + "G": { + "tag": "forge:nuggets/gold" + }, + "Q": { + "tag": "forge:storage_blocks/quartz" + }, + "S": { + "item": "minecraft:quartz_slab" + } + }, + "pattern": [ + " C ", + "GQG", + "SSS" + ], + "result": { + "item": "reliquary:pedestals/passive/purple_passive_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/passive/red_passive_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/passive/red_passive_pedestal.json index fbe2ea1f..d5b151cf 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/passive/red_passive_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/passive/red_passive_pedestal.json @@ -1,39 +1,31 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:passive_pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "item": "minecraft:red_carpet" - }, - "G": { - "tag": "forge:nuggets/gold" - }, - "Q": { - "tag": "forge:storage_blocks/quartz" - }, - "S": { - "item": "minecraft:quartz_slab" - } - }, - "pattern": [ - " C ", - "GQG", - "SSS" - ], - "result": { - "item": "reliquary:pedestals/passive/red_passive_pedestal" - }, - "show_notification": true - } + "type": "reliquary:passive_pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "item": "minecraft:red_carpet" + }, + "G": { + "tag": "forge:nuggets/gold" + }, + "Q": { + "tag": "forge:storage_blocks/quartz" + }, + "S": { + "item": "minecraft:quartz_slab" + } + }, + "pattern": [ + " C ", + "GQG", + "SSS" + ], + "result": { + "item": "reliquary:pedestals/passive/red_passive_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/passive/white_passive_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/passive/white_passive_pedestal.json index 6dfab1f0..77611398 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/passive/white_passive_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/passive/white_passive_pedestal.json @@ -1,39 +1,31 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:passive_pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "item": "minecraft:white_carpet" - }, - "G": { - "tag": "forge:nuggets/gold" - }, - "Q": { - "tag": "forge:storage_blocks/quartz" - }, - "S": { - "item": "minecraft:quartz_slab" - } - }, - "pattern": [ - " C ", - "GQG", - "SSS" - ], - "result": { - "item": "reliquary:pedestals/passive/white_passive_pedestal" - }, - "show_notification": true - } + "type": "reliquary:passive_pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "item": "minecraft:white_carpet" + }, + "G": { + "tag": "forge:nuggets/gold" + }, + "Q": { + "tag": "forge:storage_blocks/quartz" + }, + "S": { + "item": "minecraft:quartz_slab" + } + }, + "pattern": [ + " C ", + "GQG", + "SSS" + ], + "result": { + "item": "reliquary:pedestals/passive/white_passive_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/passive/yellow_passive_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/passive/yellow_passive_pedestal.json index 119895af..0320d017 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/passive/yellow_passive_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/passive/yellow_passive_pedestal.json @@ -1,39 +1,31 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:passive_pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "C": { - "item": "minecraft:yellow_carpet" - }, - "G": { - "tag": "forge:nuggets/gold" - }, - "Q": { - "tag": "forge:storage_blocks/quartz" - }, - "S": { - "item": "minecraft:quartz_slab" - } - }, - "pattern": [ - " C ", - "GQG", - "SSS" - ], - "result": { - "item": "reliquary:pedestals/passive/yellow_passive_pedestal" - }, - "show_notification": true - } + "type": "reliquary:passive_pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "C": { + "item": "minecraft:yellow_carpet" + }, + "G": { + "tag": "forge:nuggets/gold" + }, + "Q": { + "tag": "forge:storage_blocks/quartz" + }, + "S": { + "item": "minecraft:quartz_slab" + } + }, + "pattern": [ + " C ", + "GQG", + "SSS" + ], + "result": { + "item": "reliquary:pedestals/passive/yellow_passive_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/pink_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/pink_pedestal.json index 21ac7189..869734ab 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/pink_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/pink_pedestal.json @@ -1,33 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "D": { - "tag": "forge:gems/diamond" - }, - "P": { - "item": "reliquary:pedestals/passive/pink_passive_pedestal" - } - }, - "pattern": [ - "D D", - " P ", - "D D" - ], - "result": { - "item": "reliquary:pedestals/pink_pedestal" - }, - "show_notification": true - } + "type": "reliquary:pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "D": { + "tag": "forge:gems/diamond" + }, + "P": { + "item": "reliquary:pedestals/passive/pink_passive_pedestal" + } + }, + "pattern": [ + "D D", + " P ", + "D D" + ], + "result": { + "item": "reliquary:pedestals/pink_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/purple_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/purple_pedestal.json index 675ad3a6..d99e5de0 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/purple_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/purple_pedestal.json @@ -1,33 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "D": { - "tag": "forge:gems/diamond" - }, - "P": { - "item": "reliquary:pedestals/passive/purple_passive_pedestal" - } - }, - "pattern": [ - "D D", - " P ", - "D D" - ], - "result": { - "item": "reliquary:pedestals/purple_pedestal" - }, - "show_notification": true - } + "type": "reliquary:pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "D": { + "tag": "forge:gems/diamond" + }, + "P": { + "item": "reliquary:pedestals/passive/purple_passive_pedestal" + } + }, + "pattern": [ + "D D", + " P ", + "D D" + ], + "result": { + "item": "reliquary:pedestals/purple_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/red_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/red_pedestal.json index fbd315e5..3bca065b 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/red_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/red_pedestal.json @@ -1,33 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "D": { - "tag": "forge:gems/diamond" - }, - "P": { - "item": "reliquary:pedestals/passive/red_passive_pedestal" - } - }, - "pattern": [ - "D D", - " P ", - "D D" - ], - "result": { - "item": "reliquary:pedestals/red_pedestal" - }, - "show_notification": true - } + "type": "reliquary:pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "D": { + "tag": "forge:gems/diamond" + }, + "P": { + "item": "reliquary:pedestals/passive/red_passive_pedestal" + } + }, + "pattern": [ + "D D", + " P ", + "D D" + ], + "result": { + "item": "reliquary:pedestals/red_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/white_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/white_pedestal.json index b42ba630..9c89f310 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/white_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/white_pedestal.json @@ -1,33 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "D": { - "tag": "forge:gems/diamond" - }, - "P": { - "item": "reliquary:pedestals/passive/white_passive_pedestal" - } - }, - "pattern": [ - "D D", - " P ", - "D D" - ], - "result": { - "item": "reliquary:pedestals/white_pedestal" - }, - "show_notification": true - } + "type": "reliquary:pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "D": { + "tag": "forge:gems/diamond" + }, + "P": { + "item": "reliquary:pedestals/passive/white_passive_pedestal" + } + }, + "pattern": [ + "D D", + " P ", + "D D" + ], + "result": { + "item": "reliquary:pedestals/white_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/pedestals/yellow_pedestal.json b/src/generated/resources/data/reliquary/recipes/pedestals/yellow_pedestal.json index caafa76e..5c6d7cb0 100644 --- a/src/generated/resources/data/reliquary/recipes/pedestals/yellow_pedestal.json +++ b/src/generated/resources/data/reliquary/recipes/pedestals/yellow_pedestal.json @@ -1,33 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:pedestal_enabled" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "D": { - "tag": "forge:gems/diamond" - }, - "P": { - "item": "reliquary:pedestals/passive/yellow_passive_pedestal" - } - }, - "pattern": [ - "D D", - " P ", - "D D" - ], - "result": { - "item": "reliquary:pedestals/yellow_pedestal" - }, - "show_notification": true - } + "type": "reliquary:pedestal_enabled" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "D": { + "tag": "forge:gems/diamond" + }, + "P": { + "item": "reliquary:pedestals/passive/yellow_passive_pedestal" + } + }, + "pattern": [ + "D D", + " P ", + "D D" + ], + "result": { + "item": "reliquary:pedestals/yellow_pedestal" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/rending_gale.json b/src/generated/resources/data/reliquary/recipes/rending_gale.json index 78e39e68..eeab72ba 100644 --- a/src/generated/resources/data/reliquary/recipes/rending_gale.json +++ b/src/generated/resources/data/reliquary/recipes/rending_gale.json @@ -15,9 +15,10 @@ "item": "minecraft:stick" }, "V": { - "type": "forge:nbt", - "count": 1, - "item": "reliquary:void_tear" + "type": "neoforge:nbt", + "item": "reliquary:void_tear", + "strict": true, + "tag": "{}" } }, "pattern": [ @@ -27,6 +28,5 @@ ], "result": { "item": "reliquary:rending_gale" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/rib_bone.json b/src/generated/resources/data/reliquary/recipes/rib_bone.json index ebc37c76..5f700f44 100644 --- a/src/generated/resources/data/reliquary/recipes/rib_bone.json +++ b/src/generated/resources/data/reliquary/recipes/rib_bone.json @@ -1,33 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:mob_drops_craftable" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "B": { - "tag": "forge:bones" - }, - "I": { - "tag": "forge:ingots/iron" - } - }, - "pattern": [ - "III", - "IBI", - "III" - ], - "result": { - "item": "reliquary:rib_bone" - }, - "show_notification": true - } + "type": "reliquary:mob_drops_craftable" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "B": { + "tag": "forge:bones" + }, + "I": { + "tag": "forge:ingots/iron" + } + }, + "pattern": [ + "III", + "IBI", + "III" + ], + "result": { + "item": "reliquary:rib_bone" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/serpent_staff.json b/src/generated/resources/data/reliquary/recipes/serpent_staff.json index c62bee12..fde91d19 100644 --- a/src/generated/resources/data/reliquary/recipes/serpent_staff.json +++ b/src/generated/resources/data/reliquary/recipes/serpent_staff.json @@ -22,6 +22,5 @@ ], "result": { "item": "reliquary:serpent_staff" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/slime_pearl.json b/src/generated/resources/data/reliquary/recipes/slime_pearl.json index 28d81c67..f6fb174e 100644 --- a/src/generated/resources/data/reliquary/recipes/slime_pearl.json +++ b/src/generated/resources/data/reliquary/recipes/slime_pearl.json @@ -1,33 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:mob_drops_craftable" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "I": { - "tag": "forge:ingots/iron" - }, - "S": { - "tag": "forge:slimeballs" - } - }, - "pattern": [ - "III", - "ISI", - "III" - ], - "result": { - "item": "reliquary:slime_pearl" - }, - "show_notification": true - } + "type": "reliquary:mob_drops_craftable" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "I": { + "tag": "forge:ingots/iron" + }, + "S": { + "tag": "forge:slimeballs" + } + }, + "pattern": [ + "III", + "ISI", + "III" + ], + "result": { + "item": "reliquary:slime_pearl" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/sojourner_staff.json b/src/generated/resources/data/reliquary/recipes/sojourner_staff.json index 386901bd..cc4ef8f7 100644 --- a/src/generated/resources/data/reliquary/recipes/sojourner_staff.json +++ b/src/generated/resources/data/reliquary/recipes/sojourner_staff.json @@ -12,9 +12,10 @@ "tag": "forge:rods/blaze" }, { - "type": "forge:nbt", - "count": 1, - "item": "reliquary:void_tear" + "type": "neoforge:nbt", + "item": "reliquary:void_tear", + "strict": true, + "tag": "{}" } ], "result": { diff --git a/src/generated/resources/data/reliquary/recipes/squid_beak.json b/src/generated/resources/data/reliquary/recipes/squid_beak.json index e798d2aa..0641c025 100644 --- a/src/generated/resources/data/reliquary/recipes/squid_beak.json +++ b/src/generated/resources/data/reliquary/recipes/squid_beak.json @@ -1,33 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:mob_drops_craftable" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "G": { - "tag": "forge:ingots/gold" - }, - "I": { - "item": "minecraft:ink_sac" - } - }, - "pattern": [ - "GGG", - "GIG", - "GGG" - ], - "result": { - "item": "reliquary:squid_beak" - }, - "show_notification": true - } + "type": "reliquary:mob_drops_craftable" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "G": { + "tag": "forge:ingots/gold" + }, + "I": { + "item": "minecraft:ink_sac" + } + }, + "pattern": [ + "GGG", + "GIG", + "GGG" + ], + "result": { + "item": "reliquary:squid_beak" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/tipped_arrow.json b/src/generated/resources/data/reliquary/recipes/tipped_arrow.json index 97d1c24a..71b342dc 100644 --- a/src/generated/resources/data/reliquary/recipes/tipped_arrow.json +++ b/src/generated/resources/data/reliquary/recipes/tipped_arrow.json @@ -1,38 +1,29 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:potions_enabled" - }, - { - "type": "reliquary:handgun_enabled" - } - ], - "recipe": { - "type": "reliquary:potion_effects", - "category": "misc", - "duration_factor": 0.125, - "key": { - "A": { - "item": "minecraft:arrow" - }, - "P": { - "item": "reliquary:lingering_potion" - } - }, - "pattern": [ - "AAA", - "APA", - "AAA" - ], - "result": { - "count": 8, - "item": "reliquary:tipped_arrow" - }, - "show_notification": true - } + "type": "reliquary:potions_enabled" + }, + { + "type": "reliquary:potions_enabled" + } + ], + "type": "reliquary:potion_effects", + "duration_factor": 0.125, + "key": { + "A": { + "item": "minecraft:arrow" + }, + "P": { + "item": "reliquary:lingering_potion" } - ] + }, + "pattern": [ + "AAA", + "APA", + "AAA" + ], + "result": { + "count": 8, + "item": "reliquary:tipped_arrow" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/twilight_cloak.json b/src/generated/resources/data/reliquary/recipes/twilight_cloak.json index 628b32b8..ca7379d6 100644 --- a/src/generated/resources/data/reliquary/recipes/twilight_cloak.json +++ b/src/generated/resources/data/reliquary/recipes/twilight_cloak.json @@ -19,6 +19,5 @@ ], "result": { "item": "reliquary:twilight_cloak" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/uncrafting/glass_bottle.json b/src/generated/resources/data/reliquary/recipes/uncrafting/glass_bottle.json index 9fbeed2c..dfe59763 100644 --- a/src/generated/resources/data/reliquary/recipes/uncrafting/glass_bottle.json +++ b/src/generated/resources/data/reliquary/recipes/uncrafting/glass_bottle.json @@ -13,6 +13,5 @@ "result": { "count": 6, "item": "minecraft:glass_bottle" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/uncrafting/glowstone_dust.json b/src/generated/resources/data/reliquary/recipes/uncrafting/glowstone_dust.json index b0af49a2..7b6d5b4d 100644 --- a/src/generated/resources/data/reliquary/recipes/uncrafting/glowstone_dust.json +++ b/src/generated/resources/data/reliquary/recipes/uncrafting/glowstone_dust.json @@ -14,6 +14,5 @@ "result": { "count": 6, "item": "minecraft:glowstone_dust" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/uncrafting/gunpowder_witch_hat.json b/src/generated/resources/data/reliquary/recipes/uncrafting/gunpowder_witch_hat.json index a3b42d68..f01a4c60 100644 --- a/src/generated/resources/data/reliquary/recipes/uncrafting/gunpowder_witch_hat.json +++ b/src/generated/resources/data/reliquary/recipes/uncrafting/gunpowder_witch_hat.json @@ -14,6 +14,5 @@ "result": { "count": 6, "item": "minecraft:gunpowder" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/uncrafting/packed_ice.json b/src/generated/resources/data/reliquary/recipes/uncrafting/packed_ice.json index a5bcf4be..f2723948 100644 --- a/src/generated/resources/data/reliquary/recipes/uncrafting/packed_ice.json +++ b/src/generated/resources/data/reliquary/recipes/uncrafting/packed_ice.json @@ -16,6 +16,5 @@ ], "result": { "item": "minecraft:packed_ice" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/uncrafting/redstone.json b/src/generated/resources/data/reliquary/recipes/uncrafting/redstone.json index a1ac2d25..215fd29d 100644 --- a/src/generated/resources/data/reliquary/recipes/uncrafting/redstone.json +++ b/src/generated/resources/data/reliquary/recipes/uncrafting/redstone.json @@ -14,6 +14,5 @@ "result": { "count": 6, "item": "minecraft:redstone" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/uncrafting/spawn_egg.json b/src/generated/resources/data/reliquary/recipes/uncrafting/spawn_egg.json index 0ffffa13..ca78ed31 100644 --- a/src/generated/resources/data/reliquary/recipes/uncrafting/spawn_egg.json +++ b/src/generated/resources/data/reliquary/recipes/uncrafting/spawn_egg.json @@ -1,29 +1,23 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:spawn_egg_enabled" - } - ], - "recipe": { - "type": "reliquary:fragment_to_spawn_egg", - "ingredients": [ - { - "item": "reliquary:mob_charm_fragment" - }, - { - "item": "reliquary:mob_charm_fragment" - }, - { - "item": "minecraft:egg" - } - ], - "result": { - "item": "minecraft:chicken_spawn_egg" - } - } + "type": "reliquary:spawn_egg_enabled" } - ] + ], + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "item": "reliquary:mob_charm_fragment" + }, + { + "item": "reliquary:mob_charm_fragment" + }, + { + "item": "minecraft:egg" + } + ], + "result": { + "item": "minecraft:chicken_spawn_egg" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/uncrafting/sugar.json b/src/generated/resources/data/reliquary/recipes/uncrafting/sugar.json index c62fd2f1..fc7e8ba6 100644 --- a/src/generated/resources/data/reliquary/recipes/uncrafting/sugar.json +++ b/src/generated/resources/data/reliquary/recipes/uncrafting/sugar.json @@ -12,6 +12,5 @@ "result": { "count": 6, "item": "minecraft:sugar" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/withered_rib.json b/src/generated/resources/data/reliquary/recipes/withered_rib.json index c6a55d34..6f3cedba 100644 --- a/src/generated/resources/data/reliquary/recipes/withered_rib.json +++ b/src/generated/resources/data/reliquary/recipes/withered_rib.json @@ -1,33 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:mob_drops_craftable" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "D": { - "tag": "forge:gems/diamond" - }, - "S": { - "item": "minecraft:skeleton_skull" - } - }, - "pattern": [ - "D D", - " S ", - "D D" - ], - "result": { - "item": "reliquary:withered_rib" - }, - "show_notification": true - } + "type": "reliquary:mob_drops_craftable" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "D": { + "tag": "forge:gems/diamond" + }, + "S": { + "item": "minecraft:skeleton_skull" + } + }, + "pattern": [ + "D D", + " S ", + "D D" + ], + "result": { + "item": "reliquary:withered_rib" + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/witherless_rose.json b/src/generated/resources/data/reliquary/recipes/witherless_rose.json index 05d8fb20..f0886a8e 100644 --- a/src/generated/resources/data/reliquary/recipes/witherless_rose.json +++ b/src/generated/resources/data/reliquary/recipes/witherless_rose.json @@ -19,6 +19,5 @@ ], "result": { "item": "reliquary:witherless_rose" - }, - "show_notification": true + } } \ No newline at end of file diff --git a/src/generated/resources/data/reliquary/recipes/zombie_heart.json b/src/generated/resources/data/reliquary/recipes/zombie_heart.json index 356f87db..48fe5046 100644 --- a/src/generated/resources/data/reliquary/recipes/zombie_heart.json +++ b/src/generated/resources/data/reliquary/recipes/zombie_heart.json @@ -1,33 +1,25 @@ { - "type": "forge:conditional", - "recipes": [ + "neoforge:conditions": [ { - "conditions": [ - { - "type": "reliquary:mob_drops_craftable" - } - ], - "recipe": { - "type": "minecraft:crafting_shaped", - "category": "misc", - "key": { - "F": { - "item": "minecraft:rotten_flesh" - }, - "I": { - "tag": "forge:ingots/iron" - } - }, - "pattern": [ - "III", - "IFI", - "III" - ], - "result": { - "item": "reliquary:zombie_heart" - }, - "show_notification": true - } + "type": "reliquary:mob_drops_craftable" } - ] + ], + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "F": { + "item": "minecraft:rotten_flesh" + }, + "I": { + "tag": "forge:ingots/iron" + } + }, + "pattern": [ + "III", + "IFI", + "III" + ], + "result": { + "item": "reliquary:zombie_heart" + } } \ No newline at end of file diff --git a/src/main/java/reliquary/Reliquary.java b/src/main/java/reliquary/Reliquary.java index da50fc19..ddf5b340 100644 --- a/src/main/java/reliquary/Reliquary.java +++ b/src/main/java/reliquary/Reliquary.java @@ -1,77 +1,65 @@ package reliquary; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.common.ForgeMod; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.fml.ModLoadingContext; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.config.ModConfig; -import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; -import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent; -import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; -import net.minecraftforge.fml.loading.FMLEnvironment; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.fml.ModLoadingContext; +import net.neoforged.fml.common.Mod; +import net.neoforged.fml.config.ModConfig; +import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent; +import net.neoforged.fml.event.lifecycle.FMLLoadCompleteEvent; +import net.neoforged.fml.loading.FMLEnvironment; +import net.neoforged.neoforge.common.NeoForge; +import net.neoforged.neoforge.common.NeoForgeMod; import reliquary.client.init.ModParticles; import reliquary.crafting.AlkahestryRecipeRegistry; import reliquary.data.DataGenerators; import reliquary.handler.ClientEventHandler; import reliquary.handler.CommonEventHandler; -import reliquary.init.ModBlocks; -import reliquary.init.ModCapabilities; -import reliquary.init.ModCompat; -import reliquary.init.ModEnchantments; -import reliquary.init.ModEntities; -import reliquary.init.ModFluids; -import reliquary.init.ModItems; -import reliquary.init.ModPotions; -import reliquary.init.ModSounds; -import reliquary.init.PedestalItems; +import reliquary.init.*; import reliquary.items.MobCharmRegistry; import reliquary.network.PacketHandler; +import reliquary.reference.Config; import reliquary.reference.Reference; -import reliquary.reference.Settings; import reliquary.util.potions.PotionMap; @Mod(Reference.MOD_ID) public class Reliquary { @SuppressWarnings("java:S1118") //needs to be public for mod to work - public Reliquary() { - ForgeMod.enableMilkFluid(); - IEventBus modBus = FMLJavaModLoadingContext.get().getModEventBus(); + public Reliquary(IEventBus modBus) { + NeoForgeMod.enableMilkFluid(); if (FMLEnvironment.dist == Dist.CLIENT) { ClientEventHandler.registerHandlers(); } modBus.addListener(Reliquary::setup); modBus.addListener(Reliquary::loadComplete); - modBus.addListener(Settings::onFileChange); + modBus.addListener(Config::onFileChange); modBus.addListener(DataGenerators::gatherData); + modBus.addListener(PacketHandler::registerPackets); ModFluids.registerHandlers(modBus); ModItems.registerListeners(modBus); ModBlocks.registerListeners(modBus); ModEntities.registerListeners(modBus); - ModCapabilities.registerListeners(modBus); ModPotions.registerListeners(modBus); ModSounds.registerListeners(modBus); ModEnchantments.register(modBus); ModParticles.registerListeners(modBus); - ModLoadingContext.get().registerConfig(ModConfig.Type.CLIENT, Settings.CLIENT_SPEC); - ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, Settings.COMMON_SPEC); + ModLoadingContext.get().registerConfig(ModConfig.Type.CLIENT, Config.CLIENT_SPEC); + ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, Config.COMMON_SPEC); - IEventBus eventBus = MinecraftForge.EVENT_BUS; + IEventBus eventBus = NeoForge.EVENT_BUS; CommonEventHandler.registerEventBusListeners(eventBus); eventBus.addListener(MobCharmRegistry::handleAddingFragmentDrops); eventBus.addListener(AlkahestryRecipeRegistry::onResourceReload); - ModCompat.initCompats(); + ModCompat.initCompats(modBus); } public static void setup(FMLCommonSetupEvent event) { event.enqueueWork(ModItems::registerDispenseBehaviors); PotionMap.initPotionMap(); - PacketHandler.init(); ModItems.registerHandgunMagazines(); PedestalItems.init(); } diff --git a/src/main/java/reliquary/api/IPedestal.java b/src/main/java/reliquary/api/IPedestal.java index 4389e916..688fe5c1 100644 --- a/src/main/java/reliquary/api/IPedestal.java +++ b/src/main/java/reliquary/api/IPedestal.java @@ -3,9 +3,9 @@ import net.minecraft.core.BlockPos; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; -import net.minecraftforge.common.util.FakePlayer; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.capability.IFluidHandler; +import net.neoforged.neoforge.common.util.FakePlayer; +import net.neoforged.neoforge.fluids.FluidStack; +import net.neoforged.neoforge.fluids.capability.IFluidHandler; import javax.annotation.Nullable; import java.util.List; diff --git a/src/main/java/reliquary/blocks/AlkahestryAltarBlock.java b/src/main/java/reliquary/blocks/AlkahestryAltarBlock.java index b6df0774..f311d9c3 100644 --- a/src/main/java/reliquary/blocks/AlkahestryAltarBlock.java +++ b/src/main/java/reliquary/blocks/AlkahestryAltarBlock.java @@ -27,7 +27,7 @@ import reliquary.init.ModBlocks; import reliquary.items.AlkahestryTomeItem; import reliquary.items.ICreativeTabItemGenerator; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.BlockEntityHelper; import javax.annotation.Nullable; @@ -52,7 +52,7 @@ public int getLightEmission(BlockState state, BlockGetter level, BlockPos pos) { } private static int getAltarActiveLightLevel() { - return Settings.COMMON.blocks.altar.outputLightLevelWhileActive.get(); + return Config.COMMON.blocks.altar.outputLightLevelWhileActive.get(); } @Override diff --git a/src/main/java/reliquary/blocks/ApothecaryCauldronBlock.java b/src/main/java/reliquary/blocks/ApothecaryCauldronBlock.java index 485d0572..dc39f986 100644 --- a/src/main/java/reliquary/blocks/ApothecaryCauldronBlock.java +++ b/src/main/java/reliquary/blocks/ApothecaryCauldronBlock.java @@ -26,7 +26,7 @@ import reliquary.blocks.tile.ApothecaryCauldronBlockEntity; import reliquary.init.ModBlocks; import reliquary.items.ICreativeTabItemGenerator; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.BlockEntityHelper; import reliquary.util.WorldHelper; @@ -65,7 +65,7 @@ public ApothecaryCauldronBlock() { @Override public void addCreativeTabItems(Consumer itemConsumer) { - if (Boolean.TRUE.equals(Settings.COMMON.disable.disablePotions.get())) { + if (Boolean.TRUE.equals(Config.COMMON.disable.disablePotions.get())) { return; } itemConsumer.accept(new ItemStack(this)); diff --git a/src/main/java/reliquary/blocks/ApothecaryMortarBlock.java b/src/main/java/reliquary/blocks/ApothecaryMortarBlock.java index 13fa982d..b6b09f49 100644 --- a/src/main/java/reliquary/blocks/ApothecaryMortarBlock.java +++ b/src/main/java/reliquary/blocks/ApothecaryMortarBlock.java @@ -25,7 +25,7 @@ import reliquary.blocks.tile.ApothecaryMortarBlockEntity; import reliquary.init.ModItems; import reliquary.items.ICreativeTabItemGenerator; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.InventoryHelper; import reliquary.util.WorldHelper; @@ -52,7 +52,7 @@ public ApothecaryMortarBlock() { @Override public void addCreativeTabItems(Consumer itemConsumer) { - if (Boolean.TRUE.equals(Settings.COMMON.disable.disablePotions.get())) { + if (Boolean.TRUE.equals(Config.COMMON.disable.disablePotions.get())) { return; } itemConsumer.accept(new ItemStack(this)); @@ -84,7 +84,7 @@ public InteractionResult use(BlockState state, Level level, BlockPos pos, Player if (heldItem.isEmpty()) { if (player.isCrouching()) { - InventoryHelper.getItemHandlerFrom(mortar).ifPresent(itemHandler -> InventoryHelper.tryRemovingLastStack(itemHandler, level, mortar.getBlockPos())); + InventoryHelper.executeOnItemHandlerAt(level, pos, state, mortar, itemHandler -> InventoryHelper.tryRemovingLastStack(itemHandler, level, mortar.getBlockPos())); return InteractionResult.SUCCESS; } boolean done = mortar.usePestle(level); @@ -101,13 +101,13 @@ public InteractionResult use(BlockState state, Level level, BlockPos pos, Player ItemStack stackToAdd = heldItem.copy(); stackToAdd.setCount(1); - boolean putItemInSlot = InventoryHelper.getItemHandlerFrom(mortar).map(itemHandler -> { + boolean putItemInSlot = InventoryHelper.executeOnItemHandlerAt(level, pos, state, mortar, itemHandler -> { if (InventoryHelper.insertIntoInventory(stackToAdd, itemHandler) == 1) { heldItem.shrink(1); return true; } return false; - }).orElse(false); + }, false); if (!putItemInSlot) { mortar.usePestle(level); diff --git a/src/main/java/reliquary/blocks/FertileLilyPadBlock.java b/src/main/java/reliquary/blocks/FertileLilyPadBlock.java index 36292341..33c886f2 100644 --- a/src/main/java/reliquary/blocks/FertileLilyPadBlock.java +++ b/src/main/java/reliquary/blocks/FertileLilyPadBlock.java @@ -1,5 +1,6 @@ package reliquary.blocks; +import com.mojang.serialization.MapCodec; import net.minecraft.core.BlockPos; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.resources.ResourceKey; @@ -10,22 +11,17 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.block.BonemealableBlock; -import net.minecraft.world.level.block.BushBlock; -import net.minecraft.world.level.block.DoublePlantBlock; -import net.minecraft.world.level.block.IceBlock; +import net.minecraft.world.level.block.*; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.material.FluidState; import net.minecraft.world.level.material.Fluids; import net.minecraft.world.level.material.MapColor; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; -import net.minecraftforge.common.IPlantable; -import net.minecraftforge.common.PlantType; +import net.neoforged.neoforge.common.IPlantable; +import net.neoforged.neoforge.common.PlantType; import reliquary.items.ICreativeTabItemGenerator; -import reliquary.reference.Settings; +import reliquary.reference.Config; import java.util.HashMap; import java.util.HashSet; @@ -34,6 +30,7 @@ import java.util.function.Consumer; public class FertileLilyPadBlock extends BushBlock implements ICreativeTabItemGenerator { + public static final MapCodec CODEC = simpleCodec(FertileLilyPadBlock::new); private static final Map, Long> currentDimensionTicks = new HashMap<>(); private static final Map, Set> dimensionPositionsTicked = new HashMap<>(); private static final VoxelShape AABB = Block.box(1.0D, 0.0D, 1.0D, 15.0D, 1.5D, 15.0D); @@ -44,7 +41,10 @@ public PlantType getPlantType(BlockGetter world, BlockPos pos) { } public FertileLilyPadBlock() { - super(Properties.of().mapColor(MapColor.PLANT).randomTicks()); + super(Properties.of().mapColor(MapColor.PLANT)); + } + private FertileLilyPadBlock(Properties properties) { + super(properties); } @Override @@ -52,6 +52,15 @@ public void addCreativeTabItems(Consumer itemConsumer) { itemConsumer.accept(new ItemStack(this)); } + @Override + public void onPlace(BlockState state, Level level, BlockPos pos, BlockState oldState, boolean movedByPiston) { + super.onPlace(state, level, pos, oldState, movedByPiston); + + if (!level.isClientSide()) { + level.scheduleTick(pos, this, 1); + } + } + @SuppressWarnings("deprecation") @Override public void tick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) { @@ -72,15 +81,15 @@ public void animateTick(BlockState state, Level world, BlockPos pos, RandomSourc } private int secondsBetweenGrowthTicks() { - return Settings.COMMON.blocks.fertileLilypad.secondsBetweenGrowthTicks.get(); + return Config.COMMON.blocks.fertileLilypad.secondsBetweenGrowthTicks.get(); } private int tileRange() { - return Settings.COMMON.blocks.fertileLilypad.tileRange.get(); + return Config.COMMON.blocks.fertileLilypad.tileRange.get(); } private int fullPotencyRange() { - return Settings.COMMON.blocks.fertileLilypad.fullPotencyRange.get(); + return Config.COMMON.blocks.fertileLilypad.fullPotencyRange.get(); } @SuppressWarnings("deprecation") @@ -131,6 +140,11 @@ public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, return AABB; } + @Override + protected MapCodec codec() { + return CODEC; + } + @Override protected boolean mayPlaceOn(BlockState state, BlockGetter worldIn, BlockPos pos) { FluidState ifluidstate = worldIn.getFluidState(pos); diff --git a/src/main/java/reliquary/blocks/InterdictionTorchBlock.java b/src/main/java/reliquary/blocks/InterdictionTorchBlock.java index 394e964d..4df9f042 100644 --- a/src/main/java/reliquary/blocks/InterdictionTorchBlock.java +++ b/src/main/java/reliquary/blocks/InterdictionTorchBlock.java @@ -3,6 +3,7 @@ import net.minecraft.ChatFormatting; import net.minecraft.core.BlockPos; import net.minecraft.core.particles.ParticleTypes; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.network.chat.MutableComponent; import net.minecraft.server.level.ServerLevel; import net.minecraft.util.RandomSource; @@ -18,12 +19,9 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.Vec3; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.registries.ForgeRegistries; import reliquary.entities.shot.ShotEntityBase; import reliquary.items.ICreativeTabItemGenerator; -import reliquary.reference.Settings; +import reliquary.reference.Config; import java.util.List; import java.util.function.Consumer; @@ -32,7 +30,7 @@ public class InterdictionTorchBlock extends TorchBlock implements ICreativeTabIt protected static final int TICK_RATE = 1; public InterdictionTorchBlock() { - super(Properties.of().strength(0).lightLevel(value -> 15).randomTicks().sound(SoundType.WOOD).noCollission(), ParticleTypes.FLAME); + super(ParticleTypes.FLAME, Properties.of().strength(0).lightLevel(value -> 15).randomTicks().sound(SoundType.WOOD).noCollission()); } @Override @@ -60,7 +58,7 @@ public void tick(BlockState state, ServerLevel world, BlockPos pos, RandomSource if (world.isClientSide) { return; } - int radius = Settings.COMMON.blocks.interdictionTorch.pushRadius.get(); + int radius = Config.COMMON.blocks.interdictionTorch.pushRadius.get(); List entities = world.getEntitiesOfClass(Entity.class, new AABB(pos).inflate(radius), e -> (e instanceof Mob || e instanceof Projectile)); for (Entity entity : entities) { @@ -103,25 +101,19 @@ private void moveEntity(BlockPos pos, Entity entity, double distance) { } private boolean isBlacklistedEntity(Entity entity) { - if (ForgeRegistries.ENTITY_TYPES.getKey(entity.getType()) == null) { - return false; - } - - //noinspection ConstantConditions - String entityName = ForgeRegistries.ENTITY_TYPES.getKey(entity.getType()).toString(); - return isBlacklistedLivingEntity(entity, entityName) || Settings.COMMON.blocks.interdictionTorch.canPushProjectiles.get() && isBlacklistedProjectile(entity, entityName); + String entityName = BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType()).toString(); + return isBlacklistedLivingEntity(entity, entityName) || Config.COMMON.blocks.interdictionTorch.canPushProjectiles.get() && isBlacklistedProjectile(entity, entityName); } private boolean isBlacklistedProjectile(Entity entity, String entityName) { - return entity instanceof Projectile && Settings.COMMON.blocks.interdictionTorch.pushableProjectilesBlacklist.get().contains(entityName); + return entity instanceof Projectile && Config.COMMON.blocks.interdictionTorch.pushableProjectilesBlacklist.get().contains(entityName); } private boolean isBlacklistedLivingEntity(Entity entity, String entityName) { - return entity instanceof Mob && Settings.COMMON.blocks.interdictionTorch.pushableEntitiesBlacklist.get().contains(entityName); + return entity instanceof Mob && Config.COMMON.blocks.interdictionTorch.pushableEntitiesBlacklist.get().contains(entityName); } @Override - @OnlyIn(Dist.CLIENT) public void animateTick(BlockState state, Level world, BlockPos pos, RandomSource random) { double xOffset = pos.getX() + 0.5F; double yOffset = pos.getY() + 0.7F; diff --git a/src/main/java/reliquary/blocks/PassivePedestalBlock.java b/src/main/java/reliquary/blocks/PassivePedestalBlock.java index 9529460c..c0e1e795 100644 --- a/src/main/java/reliquary/blocks/PassivePedestalBlock.java +++ b/src/main/java/reliquary/blocks/PassivePedestalBlock.java @@ -9,22 +9,28 @@ import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.EntityBlock; +import net.minecraft.world.level.block.SimpleWaterloggedBlock; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; 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.material.FluidState; +import net.minecraft.world.level.material.Fluids; import net.minecraft.world.level.material.MapColor; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.shapes.BooleanOp; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; +import net.neoforged.neoforge.event.entity.player.PlayerInteractEvent; import reliquary.blocks.tile.PassivePedestalBlockEntity; import reliquary.items.ICreativeTabItemGenerator; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.InventoryHelper; import reliquary.util.WorldHelper; @@ -33,8 +39,9 @@ import java.util.function.Consumer; import java.util.stream.Stream; -public class PassivePedestalBlock extends Block implements EntityBlock, ICreativeTabItemGenerator { +public class PassivePedestalBlock extends Block implements EntityBlock, ICreativeTabItemGenerator, SimpleWaterloggedBlock { static final DirectionProperty FACING = DirectionProperty.create("facing", Direction.Plane.HORIZONTAL); + static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; private static final VoxelShape SHAPE = Stream.of( Block.box(4, 10, 4, 12, 11, 12), Block.box(3, 0, 3, 13, 1, 13), @@ -48,8 +55,8 @@ public class PassivePedestalBlock extends Block implements EntityBlock, ICreativ ).reduce((v1, v2) -> Shapes.join(v1, v2, BooleanOp.OR)).get(); public PassivePedestalBlock() { - super(Properties.of().mapColor(MapColor.STONE).strength(1.5F, 2.0F)); - registerDefaultState(stateDefinition.any().setValue(FACING, Direction.NORTH)); + super(Properties.of().mapColor(MapColor.STONE).strength(1.5F, 2.0F).forceSolidOn()); + registerDefaultState(stateDefinition.any().setValue(FACING, Direction.NORTH).setValue(WATERLOGGED, false)); } @Override @@ -62,12 +69,12 @@ public void addCreativeTabItems(Consumer itemConsumer) { } protected boolean isDisabled() { - return Boolean.TRUE.equals(Settings.COMMON.disable.disablePassivePedestal.get()); + return Boolean.TRUE.equals(Config.COMMON.disable.disablePassivePedestal.get()); } @Override protected void createBlockStateDefinition(StateDefinition.Builder builder) { - builder.add(FACING); + builder.add(FACING, WATERLOGGED); } @Nullable @@ -76,7 +83,23 @@ public BlockState getStateForPlacement(BlockPlaceContext context) { if (context.getPlayer() == null) { return defaultBlockState(); } - return defaultBlockState().setValue(FACING, context.getPlayer().getDirection()); + return defaultBlockState() + .setValue(FACING, context.getPlayer().getDirection()) + .setValue(WATERLOGGED, context.getLevel().getFluidState(context.getClickedPos()).getType() == Fluids.WATER); + } + + @Override + public FluidState getFluidState(BlockState state) { + return Boolean.TRUE.equals(state.getValue(WATERLOGGED)) ? Fluids.WATER.getSource(false) : super.getFluidState(state); + } + + @Override + public BlockState updateShape(BlockState state, Direction facing, BlockState facingState, LevelAccessor level, BlockPos currentPos, BlockPos facingPos) { + if (facing != Direction.DOWN && Boolean.TRUE.equals(state.getValue(WATERLOGGED))) { + level.scheduleTick(currentPos, Fluids.WATER, Fluids.WATER.getTickDelay(level)); + } + + return super.updateShape(state, facing, facingState, level, currentPos, facingPos); } @SuppressWarnings("deprecation") @@ -100,9 +123,11 @@ public InteractionResult use(BlockState state, Level level, BlockPos pos, Player return InteractionResult.FAIL; } } else { - return pedestal.map(ped -> InventoryHelper.getItemHandlerFrom(ped) - .map(itemHandler -> InventoryHelper.tryAddingPlayerCurrentItem(player, itemHandler, InteractionHand.MAIN_HAND) ? InteractionResult.SUCCESS : InteractionResult.CONSUME) - .orElse(InteractionResult.CONSUME)).orElse(InteractionResult.CONSUME); + return pedestal.map(ped -> + InventoryHelper.executeOnItemHandlerAt(level, pos, state, ped, itemHandler -> + InventoryHelper.tryAddingPlayerCurrentItem(player, itemHandler, InteractionHand.MAIN_HAND) ? InteractionResult.SUCCESS : InteractionResult.CONSUME, InteractionResult.CONSUME + ) + ).orElse(InteractionResult.CONSUME); } } diff --git a/src/main/java/reliquary/blocks/PedestalBlock.java b/src/main/java/reliquary/blocks/PedestalBlock.java index 9f083055..5bb920f2 100644 --- a/src/main/java/reliquary/blocks/PedestalBlock.java +++ b/src/main/java/reliquary/blocks/PedestalBlock.java @@ -25,12 +25,10 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; import reliquary.blocks.tile.PedestalBlockEntity; import reliquary.init.ModBlocks; import reliquary.pedestal.PedestalRegistry; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.BlockEntityHelper; import reliquary.util.WorldHelper; @@ -67,7 +65,7 @@ protected void createBlockStateDefinition(StateDefinition.Builder { diff --git a/src/main/java/reliquary/blocks/tile/AlkahestryAltarBlockEntity.java b/src/main/java/reliquary/blocks/tile/AlkahestryAltarBlockEntity.java index 495a3497..b8fad8a7 100644 --- a/src/main/java/reliquary/blocks/tile/AlkahestryAltarBlockEntity.java +++ b/src/main/java/reliquary/blocks/tile/AlkahestryAltarBlockEntity.java @@ -7,7 +7,7 @@ import net.minecraft.world.level.block.state.BlockState; import reliquary.blocks.AlkahestryAltarBlock; import reliquary.init.ModBlocks; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.WorldHelper; public class AlkahestryAltarBlockEntity extends BlockEntityBase { @@ -36,9 +36,9 @@ public void serverTick(Level level, BlockPos pos) { public void startCycle(Level level) { //grabs the cycle time from the configs - int defaultCycleTime = Settings.COMMON.blocks.altar.timeInMinutes.get() * 60 * 20; - int maximumVariance = Settings.COMMON.blocks.altar.maximumTimeVarianceInMinutes.get() * 60 * 20; - cycleTime = (int) (defaultCycleTime + (double) maximumVariance * level.random.nextGaussian()); + int defaultCycleTime = Config.COMMON.blocks.altar.timeInMinutes.get() * 60 * 20; + int maximumVariance = Config.COMMON.blocks.altar.maximumTimeVarianceInMinutes.get() * 60 * 20; + cycleTime = (int) (defaultCycleTime + maximumVariance * level.random.nextGaussian()); redstoneCount = 0; isActive = true; } @@ -72,7 +72,7 @@ public void addRedstone(Level level, BlockPos pos) { } private static int getRedstoneCost() { - return Settings.COMMON.blocks.altar.redstoneCost.get(); + return Config.COMMON.blocks.altar.redstoneCost.get(); } public int getRedstoneCount() { diff --git a/src/main/java/reliquary/blocks/tile/ApothecaryCauldronBlockEntity.java b/src/main/java/reliquary/blocks/tile/ApothecaryCauldronBlockEntity.java index 474c56bb..dc3df22d 100644 --- a/src/main/java/reliquary/blocks/tile/ApothecaryCauldronBlockEntity.java +++ b/src/main/java/reliquary/blocks/tile/ApothecaryCauldronBlockEntity.java @@ -4,6 +4,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.particles.DustParticleOptions; import net.minecraft.core.particles.ParticleTypes; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.Connection; import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket; @@ -26,13 +27,10 @@ import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.material.Fluids; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.capability.IFluidHandler; -import net.minecraftforge.fluids.capability.IFluidHandlerItem; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.fluids.FluidStack; +import net.neoforged.neoforge.fluids.capability.IFluidHandler; +import net.neoforged.neoforge.fluids.capability.IFluidHandlerItem; import reliquary.blocks.ApothecaryCauldronBlock; import reliquary.client.particle.BubbleColorParticleData; import reliquary.client.particle.SteamColorParticleData; @@ -40,7 +38,7 @@ import reliquary.init.ModBlocks; import reliquary.init.ModItems; import reliquary.items.PotionEssenceItem; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.InventoryHelper; import reliquary.util.potions.XRPotionHelper; @@ -101,7 +99,6 @@ private void spawnParticles(Level level, BlockPos pos) { } } - @OnlyIn(Dist.CLIENT) private void spawnBoilingParticles(Level level, BlockPos pos) { if (level.random.nextInt(getTotalCookTime() * getTotalCookTime()) > cookTime * cookTime) { return; @@ -127,7 +124,6 @@ private float getRenderLiquidLevel() { return (6 + 3 * j) / 16.0F; } - @OnlyIn(Dist.CLIENT) private void spawnGunpowderParticles(Level level, BlockPos pos) { if (level.random.nextInt(8) > 0) { return; @@ -137,7 +133,6 @@ private void spawnGunpowderParticles(Level level, BlockPos pos) { level.addParticle(ParticleTypes.SMOKE, pos.getX() + 0.5D + xOffset, pos.getY() + getRenderLiquidLevel(), pos.getZ() + 0.5D + zOffset, 0.0D, 0.1D, 0.0D); } - @OnlyIn(Dist.CLIENT) private void spawnDragonBreathParticles(Level level, BlockPos pos) { if (level.random.nextInt(8) > 0) { return; @@ -147,7 +142,6 @@ private void spawnDragonBreathParticles(Level level, BlockPos pos) { level.addParticle(ParticleTypes.DRAGON_BREATH, pos.getX() + 0.5D + xOffset, pos.getY() + getRenderLiquidLevel(), pos.getZ() + 0.5D + zOffset, 0.0D, 0.1D, 0.0D); } - @OnlyIn(Dist.CLIENT) private void spawnGlowstoneParticles(Level level, BlockPos pos) { if (level.random.nextInt(8) > 0) { return; @@ -158,7 +152,6 @@ private void spawnGlowstoneParticles(Level level, BlockPos pos) { level.addParticle(ParticleTypes.ENTITY_EFFECT, pos.getX() + 0.5D + xOffset, pos.getY() + getRenderLiquidLevel(), pos.getZ() + 0.5D + zOffset, gauss, gauss, 0.0F); } - @OnlyIn(Dist.CLIENT) private void spawnNetherwartParticles(Level level, BlockPos pos) { if (level.random.nextInt(8) > 0) { return; @@ -169,7 +162,6 @@ private void spawnNetherwartParticles(Level level, BlockPos pos) { level.addParticle(ParticleTypes.ENTITY_EFFECT, pos.getX() + 0.5D + xOffset, pos.getY() + getRenderLiquidLevel(), pos.getZ() + 0.5D + zOffset, gauss, 0.0F, gauss); } - @OnlyIn(Dist.CLIENT) private void spawnRedstoneParticles(Level level, BlockPos pos) { if (level.random.nextInt(10) / redstoneCount > 0) { return; @@ -179,7 +171,6 @@ private void spawnRedstoneParticles(Level level, BlockPos pos) { level.addParticle(DustParticleOptions.REDSTONE, pos.getX() + 0.5D + xOffset, pos.getY() + getRenderLiquidLevel(), pos.getZ() + 0.5D + zOffset, 1D, 0D, 0D); } - @OnlyIn(Dist.CLIENT) private void spawnFinishedParticles(Level level, BlockPos pos) { if (level.random.nextInt(8) > 0) { return; @@ -293,18 +284,18 @@ private void addItem(ItemStack stack, Level level, BlockPos pos) { } private int getGlowstoneAmpLimit() { - return Settings.COMMON.blocks.apothecaryCauldron.glowstoneLimit.get(); + return Config.COMMON.blocks.apothecaryCauldron.glowstoneLimit.get(); } private int getRedstoneAmpLimit() { - return Settings.COMMON.blocks.apothecaryCauldron.redstoneLimit.get(); + return Config.COMMON.blocks.apothecaryCauldron.redstoneLimit.get(); } private Set getHeatSources() { Set heatSources = new HashSet<>(); - List heatSourceBlockNames = Settings.COMMON.blocks.apothecaryCauldron.heatSources.get(); + List heatSourceBlockNames = Config.COMMON.blocks.apothecaryCauldron.heatSources.get(); - heatSourceBlockNames.forEach(blockName -> heatSources.add(ForgeRegistries.BLOCKS.getValue(new ResourceLocation(blockName)))); + heatSourceBlockNames.forEach(blockName -> heatSources.add(BuiltInRegistries.BLOCK.get(new ResourceLocation(blockName)))); //defaults that can't be removed. heatSources.add(Blocks.LAVA); heatSources.add(Blocks.FIRE); @@ -316,7 +307,7 @@ private Set getHeatSources() { } private int getTotalCookTime() { - return Settings.COMMON.blocks.apothecaryCauldron.cookTime.get(); + return Config.COMMON.blocks.apothecaryCauldron.cookTime.get(); } public List getEffects() { @@ -429,7 +420,7 @@ private InteractionResult addIngredient(Level level, Player player, ItemStack it addItem(itemStack, level, pos); if (itemStack.getItem() == Items.DRAGON_BREATH - && InventoryHelper.getItemHandlerFrom(player).map(handler -> InventoryHelper.tryToAddToInventory(new ItemStack(Items.GLASS_BOTTLE), handler, 1)).orElse(0) != 1) { + && InventoryHelper.tryToAddToInventory(new ItemStack(Items.GLASS_BOTTLE), InventoryHelper.getItemHandlerFrom(player), 1) != 1) { Containers.dropItemStack(level, worldPosition.getX() + 0.5f, worldPosition.getY() + 1.5f, worldPosition.getZ() + 0.5f, new ItemStack(Items.GLASS_BOTTLE)); } @@ -460,8 +451,11 @@ private InteractionResult fillWithWater(Player player, InteractionHand hand, Ite if (!player.isCreative()) { player.setItemInHand(hand, new ItemStack(Items.BUCKET)); } - } else if (Boolean.FALSE.equals(itemStack.getCapability(ForgeCapabilities.FLUID_HANDLER_ITEM, null).map(fh -> drainWater(player, fh)).orElse(false))) { - return InteractionResult.CONSUME; + } else { + IFluidHandlerItem fluidHandlerCapability = itemStack.getCapability(Capabilities.FluidHandler.ITEM); + if (fluidHandlerCapability == null || !drainWater(player, fluidHandlerCapability)) { + return InteractionResult.CONSUME; + } } setLiquidLevel(3); diff --git a/src/main/java/reliquary/blocks/tile/ApothecaryMortarBlockEntity.java b/src/main/java/reliquary/blocks/tile/ApothecaryMortarBlockEntity.java index 3c9c35dc..9b997bf4 100644 --- a/src/main/java/reliquary/blocks/tile/ApothecaryMortarBlockEntity.java +++ b/src/main/java/reliquary/blocks/tile/ApothecaryMortarBlockEntity.java @@ -1,7 +1,6 @@ package reliquary.blocks.tile; import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; import net.minecraft.core.NonNullList; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.nbt.CompoundTag; @@ -10,10 +9,8 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.items.ItemStackHandler; +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.items.ItemStackHandler; import reliquary.compat.jade.provider.IJadeDataChangeIndicator; import reliquary.init.ModBlocks; import reliquary.init.ModItems; @@ -22,7 +19,6 @@ import reliquary.util.potions.PotionIngredient; import reliquary.util.potions.XRPotionHelper; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; @@ -160,14 +156,8 @@ public boolean getDataChanged() { return ret; } - - @Override - public LazyOptional getCapability(Capability cap, @Nullable Direction side) { - if (cap == ForgeCapabilities.ITEM_HANDLER) { - return ForgeCapabilities.ITEM_HANDLER.orEmpty(cap, LazyOptional.of(() -> items)); - } - - return super.getCapability(cap, side); + public IItemHandler getItems() { + return items; } public void dropItems(Level level) { diff --git a/src/main/java/reliquary/blocks/tile/PassivePedestalBlockEntity.java b/src/main/java/reliquary/blocks/tile/PassivePedestalBlockEntity.java index 72c66ff6..97b07ddb 100644 --- a/src/main/java/reliquary/blocks/tile/PassivePedestalBlockEntity.java +++ b/src/main/java/reliquary/blocks/tile/PassivePedestalBlockEntity.java @@ -1,7 +1,6 @@ package reliquary.blocks.tile; import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.Container; import net.minecraft.world.entity.item.ItemEntity; @@ -10,18 +9,14 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.items.IItemHandler; -import net.minecraftforge.items.wrapper.InvWrapper; +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.items.wrapper.InvWrapper; import reliquary.init.ModBlocks; import reliquary.util.InventoryHelper; -import javax.annotation.Nullable; - public class PassivePedestalBlockEntity extends BlockEntityBase implements Container { protected ItemStack item; + private final IItemHandler inventoryWrapper = new InvWrapper(this); public ItemStack getItem() { @@ -37,6 +32,10 @@ public PassivePedestalBlockEntity(BlockPos pos, BlockState state) { item = ItemStack.EMPTY; } + public IItemHandler getItemHandler() { + return inventoryWrapper; + } + public void dropPedestalInventory(Level level) { if (!item.isEmpty()) { InventoryHelper.spawnItemStack(level, worldPosition, item); @@ -160,13 +159,4 @@ public void clearContent() { public boolean isEmpty() { return item.isEmpty(); } - - - @Override - public LazyOptional getCapability(Capability cap, @Nullable Direction side) { - if (cap == ForgeCapabilities.ITEM_HANDLER) { - return ForgeCapabilities.ITEM_HANDLER.orEmpty(cap, LazyOptional.of(() -> inventoryWrapper)); - } - return super.getCapability(cap, side); - } } diff --git a/src/main/java/reliquary/blocks/tile/PedestalBlockEntity.java b/src/main/java/reliquary/blocks/tile/PedestalBlockEntity.java index aee359ee..e4f82d8c 100644 --- a/src/main/java/reliquary/blocks/tile/PedestalBlockEntity.java +++ b/src/main/java/reliquary/blocks/tile/PedestalBlockEntity.java @@ -10,14 +10,12 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.phys.AABB; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.FakePlayer; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.capability.IFluidHandler; -import net.minecraftforge.items.IItemHandler; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.common.util.FakePlayer; +import net.neoforged.neoforge.fluids.FluidStack; +import net.neoforged.neoforge.fluids.capability.IFluidHandler; +import net.neoforged.neoforge.fluids.capability.IFluidHandlerItem; +import net.neoforged.neoforge.items.IItemHandler; import reliquary.api.IPedestal; import reliquary.api.IPedestalActionItem; import reliquary.api.IPedestalRedstoneItem; @@ -28,10 +26,8 @@ import reliquary.pedestal.PedestalRegistry; import reliquary.util.CombinedItemHandler; import reliquary.util.InventoryHelper; -import reliquary.util.WorldHelper; import reliquary.util.XRFakePlayerFactory; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; @@ -48,7 +44,7 @@ public class PedestalBlockEntity extends PassivePedestalBlockEntity implements I @Nullable private IItemHandler itemHandler = null; @Nullable - private LazyOptional combinedHandler = null; + private IItemHandler combinedHandler = null; private ItemStack fluidContainer = ItemStack.EMPTY; private boolean switchedOn = false; private final List onSwitches = new ArrayList<>(); @@ -121,27 +117,26 @@ public void onLoad() { super.onLoad(); } - @Nonnull @Override - public LazyOptional getCapability(Capability cap, @Nullable Direction side) { - if (cap == ForgeCapabilities.FLUID_HANDLER) { - if (pedestalFluidHandler == null) { - pedestalFluidHandler = new PedestalFluidHandler(this); - } - return ForgeCapabilities.FLUID_HANDLER.orEmpty(cap, LazyOptional.of(() -> pedestalFluidHandler)); - } else if (cap == ForgeCapabilities.ITEM_HANDLER && itemHandler != null) { - if (combinedHandler == null) { - combinedHandler = LazyOptional.of(() -> super.getCapability(ForgeCapabilities.ITEM_HANDLER, side) - .map(superHandler -> (IItemHandler) new CombinedItemHandler(superHandler, itemHandler)) - .orElse(itemHandler)); - } - return combinedHandler.cast(); + public IItemHandler getItemHandler() { + IItemHandler superInventory = super.getItemHandler(); + if (itemHandler == null) { + return superInventory; } + if (combinedHandler == null) { + combinedHandler = new CombinedItemHandler(superInventory, itemHandler); + } + return combinedHandler; + } - return super.getCapability(cap, side); + public IFluidHandler getFluidHandler() { + if (pedestalFluidHandler == null) { + pedestalFluidHandler = new PedestalFluidHandler(this); + } + return pedestalFluidHandler; } - private void executeOnActionItem(Consumer execute) { + public void executeOnActionItem(Consumer execute) { if (actionItem == null) { return; } @@ -162,7 +157,10 @@ private void updateSpecialItems() { return; } - item.getCapability(ForgeCapabilities.ITEM_HANDLER, null).ifPresent(ih -> itemHandler = ih); + IItemHandler ih = item.getCapability(Capabilities.ItemHandler.ITEM); + if (ih != null) { + itemHandler = ih; + } if (item.getItem() instanceof IPedestalActionItem pedestalActionItem) { tickable = true; @@ -181,8 +179,11 @@ private void updateSpecialItems() { }); } - item.getCapability(ForgeCapabilities.FLUID_HANDLER, null).ifPresent(fh -> fluidContainer = item); - item.getCapability(ForgeCapabilities.FLUID_HANDLER_ITEM, null).ifPresent(fh -> fluidContainer = item); + + IFluidHandlerItem itemFluidHandler = item.getCapability(Capabilities.FluidHandler.ITEM); + if (itemFluidHandler != null) { + fluidContainer = item; + } actionCooldown = 0; } @@ -194,7 +195,7 @@ private void resetSpecialItems() { redstoneItem = null; itemHandler = null; if (combinedHandler != null) { - combinedHandler.invalidate(); + level.invalidateCapabilities(getBlockPos()); } combinedHandler = null; } @@ -245,10 +246,7 @@ public BlockPos getBlockPosition() { public int addToConnectedInventory(Level level, ItemStack stack) { int numberAdded = 0; for (Direction side : Direction.values()) { - LazyOptional inventory = InventoryHelper.getInventoryAtPos(level, worldPosition.offset(side.getNormal()), side.getOpposite()); - - int finalNumberAdded = numberAdded; - numberAdded += inventory.map(handler -> InventoryHelper.tryToAddToInventory(stack, handler, stack.getCount() - finalNumberAdded)).orElse(0); + numberAdded += InventoryHelper.tryToAddToInventoryAtPos(stack, level, worldPosition.offset(side.getNormal()), side.getOpposite(), stack.getCount() - numberAdded); if (numberAdded >= stack.getCount()) { break; } @@ -399,7 +397,10 @@ private List getAdjacentTanks() { } private void addIfTank(List adjacentTanks, BlockPos tankPos, Direction tankDirection) { - WorldHelper.getBlockEntity(level, tankPos).ifPresent(te -> te.getCapability(ForgeCapabilities.FLUID_HANDLER, tankDirection).ifPresent(adjacentTanks::add)); + IFluidHandler fh = level.getCapability(Capabilities.FluidHandler.BLOCK, tankPos, tankDirection); + if (fh != null) { + adjacentTanks.add(fh); + } } public void removeSpecialItems(Level level) { @@ -491,12 +492,4 @@ ItemStack getFluidContainer() { public boolean isEnabled() { return getBlockState().getValue(PedestalBlock.ENABLED); } - - @Override - public AABB getRenderBoundingBox() { - BlockPos pos = getBlockPos(); - AABB aabb = new AABB(pos.offset(-1, 0, -1), pos.offset(1, 1, 1)); - executeOnActionItem(ai -> ai.getRenderBoundingBoxOuterPosition().ifPresent(aabb::expandTowards)); - return aabb; - } } \ No newline at end of file diff --git a/src/main/java/reliquary/blocks/tile/PedestalFluidHandler.java b/src/main/java/reliquary/blocks/tile/PedestalFluidHandler.java index a1694bad..a45d79e2 100644 --- a/src/main/java/reliquary/blocks/tile/PedestalFluidHandler.java +++ b/src/main/java/reliquary/blocks/tile/PedestalFluidHandler.java @@ -1,11 +1,10 @@ package reliquary.blocks.tile; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.capability.IFluidHandler; -import net.minecraftforge.fluids.capability.IFluidHandlerItem; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.fluids.FluidStack; +import net.neoforged.neoforge.fluids.capability.IFluidHandler; +import net.neoforged.neoforge.fluids.capability.IFluidHandlerItem; import org.jetbrains.annotations.NotNull; import java.util.Optional; @@ -66,11 +65,7 @@ private Optional getFluidHandlerValue(Function mapValue if (fluidContainer.isEmpty()) { return Optional.empty(); } - LazyOptional cap = fluidContainer.getCapability(ForgeCapabilities.FLUID_HANDLER); - if (cap.isPresent()) { - return cap.map(fh -> Optional.of(mapValue.apply(fh))).orElse(Optional.empty()); - } - return fluidContainer.getCapability(ForgeCapabilities.FLUID_HANDLER_ITEM).map(fh -> Optional.of(mapValue.apply(fh))).orElse(Optional.empty()); - + IFluidHandler fh = fluidContainer.getCapability(Capabilities.FluidHandler.ITEM); + return Optional.ofNullable(mapValue.apply(fh)); } } diff --git a/src/main/java/reliquary/client/gui/GuiBase.java b/src/main/java/reliquary/client/gui/GuiBase.java index 075b2ad5..f85bf039 100644 --- a/src/main/java/reliquary/client/gui/GuiBase.java +++ b/src/main/java/reliquary/client/gui/GuiBase.java @@ -32,7 +32,7 @@ void drawItemStack(GuiGraphics guiGraphics, ItemStack stack, int x, int y) { @Override public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) { - renderBackground(guiGraphics); + renderBackground(guiGraphics, mouseX, mouseY, partialTicks); super.render(guiGraphics, mouseX, mouseY, partialTicks); } } diff --git a/src/main/java/reliquary/client/gui/MobCharmBeltGui.java b/src/main/java/reliquary/client/gui/MobCharmBeltGui.java index 0bf6b23d..717f0cfc 100644 --- a/src/main/java/reliquary/client/gui/MobCharmBeltGui.java +++ b/src/main/java/reliquary/client/gui/MobCharmBeltGui.java @@ -6,16 +6,11 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.inventory.Slot; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.fml.util.ObfuscationReflectionHelper; import reliquary.common.gui.MobCharmBeltMenu; import reliquary.init.ModItems; import reliquary.items.MobCharmRegistry; import reliquary.reference.Reference; -import reliquary.util.LogHelper; - -import java.lang.reflect.Field; @SuppressWarnings("squid:MaximumInheritanceDepth") public class MobCharmBeltGui extends GuiBase { @@ -77,38 +72,14 @@ private void updateMobCharmSlots(GuiGraphics guiGraphics, int centerX, int cente RenderSystem.disableBlend(); - setSlotXPos(menu.slots.get(i - 1), x - centerX + 88); - setSlotYPos(menu.slots.get(i - 1), y - centerY + 40); + menu.slots.get(i - 1).x = x - centerX + 88; + menu.slots.get(i - 1).y = y - centerY + 40; } - setSlotXPos(menu.slots.get(slots), 80); - setSlotYPos(menu.slots.get(slots), -12); + menu.slots.get(slots).x = 80; + menu.slots.get(slots).y = -12; for (int i = slots + 1; i < MobCharmRegistry.getRegisteredNames().size() + 1; i++) { - setSlotXPos(menu.slots.get(i), -999); - } - } - - private static final Field SLOT_X_POS = ObfuscationReflectionHelper.findField(Slot.class, "f_40220_"); - - @SuppressWarnings("java:S3011") //the use of reflection to bypass field invisiblity is intentional and necessary here - private static void setSlotXPos(Slot slot, int xPos) { - try { - SLOT_X_POS.set(slot, xPos); - } - catch (IllegalAccessException e) { - LogHelper.error("Error setting xPos of Slot: ", e); - } - } - - private static final Field SLOT_Y_POS = ObfuscationReflectionHelper.findField(Slot.class, "f_40221_"); - - @SuppressWarnings("java:S3011") //the use of reflection to bypass field invisiblity is intentional and necessary here - private static void setSlotYPos(Slot slot, int yPos) { - try { - SLOT_Y_POS.set(slot, yPos); - } - catch (IllegalAccessException e) { - LogHelper.error("Error setting yPos of Slot: ", e); + menu.slots.get(i).x = -999; } } diff --git a/src/main/java/reliquary/client/gui/hud/CharmPane.java b/src/main/java/reliquary/client/gui/hud/CharmPane.java index 25f298cf..cd2c2f08 100644 --- a/src/main/java/reliquary/client/gui/hud/CharmPane.java +++ b/src/main/java/reliquary/client/gui/hud/CharmPane.java @@ -5,7 +5,7 @@ import reliquary.client.gui.components.Box; import reliquary.client.gui.components.Component; import reliquary.client.gui.components.ItemStackPane; -import reliquary.reference.Settings; +import reliquary.reference.Config; import java.util.HashMap; import java.util.Iterator; @@ -77,7 +77,7 @@ ItemStack getCharm() { } public static void addCharmToDraw(ItemStack charm, int slot) { - int maxMobCharmsToDisplay = Settings.COMMON.items.mobCharm.maxCharmsToDisplay.get(); + int maxMobCharmsToDisplay = Config.COMMON.items.mobCharm.maxCharmsToDisplay.get(); lock.lock(); if (charmsToDraw.size() == maxMobCharmsToDisplay) { charmsToDraw.remove(0); @@ -99,7 +99,7 @@ private static void removeExpiredMobCharms() { for (Iterator> iterator = charmsToDraw.entrySet().iterator(); iterator.hasNext(); ) { Map.Entry entry = iterator.next(); CharmToDraw charmToDraw = entry.getValue(); - if (Boolean.TRUE.equals(Settings.COMMON.items.mobCharm.keepAlmostDestroyedDisplayed.get()) && charmToDraw.getCharm().getDamageValue() >= (charmToDraw.getCharm().getMaxDamage() * 0.9)) { + if (Boolean.TRUE.equals(Config.COMMON.items.mobCharm.keepAlmostDestroyedDisplayed.get()) && charmToDraw.getCharm().getDamageValue() >= (charmToDraw.getCharm().getMaxDamage() * 0.9)) { continue; } diff --git a/src/main/java/reliquary/client/init/ItemModels.java b/src/main/java/reliquary/client/init/ItemModels.java index 4d302c57..773d5c56 100644 --- a/src/main/java/reliquary/client/init/ItemModels.java +++ b/src/main/java/reliquary/client/init/ItemModels.java @@ -1,7 +1,7 @@ package reliquary.client.init; import net.minecraft.client.resources.model.ModelResourceLocation; -import net.minecraftforge.client.event.ModelEvent; +import net.neoforged.neoforge.client.event.ModelEvent; import reliquary.client.model.VoidTearModel; import reliquary.init.ModItems; import reliquary.util.RegistryHelper; diff --git a/src/main/java/reliquary/client/init/ModBlockColors.java b/src/main/java/reliquary/client/init/ModBlockColors.java index c1f4fd98..d13f0c5d 100644 --- a/src/main/java/reliquary/client/init/ModBlockColors.java +++ b/src/main/java/reliquary/client/init/ModBlockColors.java @@ -1,6 +1,6 @@ package reliquary.client.init; -import net.minecraftforge.client.event.RegisterColorHandlersEvent; +import net.neoforged.neoforge.client.event.RegisterColorHandlersEvent; import reliquary.blocks.tile.ApothecaryCauldronBlockEntity; import reliquary.init.ModBlocks; diff --git a/src/main/java/reliquary/client/init/ModItemColors.java b/src/main/java/reliquary/client/init/ModItemColors.java index 628985ea..34a9802a 100644 --- a/src/main/java/reliquary/client/init/ModItemColors.java +++ b/src/main/java/reliquary/client/init/ModItemColors.java @@ -2,16 +2,13 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.screens.Screen; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.SpawnEggItem; import net.minecraft.world.item.alchemy.PotionUtils; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.client.event.RegisterColorHandlersEvent; -import net.minecraftforge.common.ForgeSpawnEggItem; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.neoforge.client.event.RegisterColorHandlersEvent; import reliquary.items.BulletItem; import reliquary.items.MobCharmFragmentItem; import reliquary.items.MobCharmItem; @@ -24,9 +21,9 @@ import static reliquary.init.ModItems.*; -@OnlyIn(Dist.CLIENT) public class ModItemColors { - private ModItemColors() {} + private ModItemColors() { + } public static void registerItemColors(RegisterColorHandlersEvent.Item event) { registerMobCharmItemColors(event); @@ -41,7 +38,7 @@ public static void registerItemColors(RegisterColorHandlersEvent.Item event) { private static void registerVoidTearItemColors(RegisterColorHandlersEvent.Item event) { event.register((stack, tintIndex) -> { if (Screen.hasShiftDown()) { - ItemStack containedStack = VoidTearItem.getTearContents(stack, true); + ItemStack containedStack = VoidTearItem.getTearContents(stack); if (!containedStack.isEmpty()) { return Minecraft.getInstance().getItemColors().getColor(containedStack, tintIndex); } @@ -111,8 +108,10 @@ private static void registerMobCharmItemColors(RegisterColorHandlersEvent.Item e } private static Optional getEgg(ResourceLocation entityName) { - return Optional.ofNullable(ForgeSpawnEggItem.fromEntityType(ForgeRegistries.ENTITY_TYPES.getValue(entityName))); + return Optional.ofNullable(SpawnEggItem.byId(BuiltInRegistries.ENTITY_TYPE.get(entityName))); } - private static int getColor(ItemStack stack) {return PotionUtils.getColor(((IPotionItem) stack.getItem()).getEffects(stack));} + private static int getColor(ItemStack stack) { + return PotionUtils.getColor(((IPotionItem) stack.getItem()).getEffects(stack)); + } } diff --git a/src/main/java/reliquary/client/init/ModParticles.java b/src/main/java/reliquary/client/init/ModParticles.java index 4b309114..72b75479 100644 --- a/src/main/java/reliquary/client/init/ModParticles.java +++ b/src/main/java/reliquary/client/init/ModParticles.java @@ -1,23 +1,24 @@ package reliquary.client.init; import net.minecraft.core.particles.ParticleType; -import net.minecraftforge.client.event.RegisterParticleProvidersEvent; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; +import net.minecraft.core.registries.BuiltInRegistries; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.client.event.RegisterParticleProvidersEvent; +import net.neoforged.neoforge.registries.DeferredRegister; import reliquary.client.particle.CauldronBubbleParticle; import reliquary.client.particle.CauldronBubbleParticleType; import reliquary.client.particle.CauldronSteamParticle; import reliquary.client.particle.CauldronSteamParticleType; import reliquary.reference.Reference; +import java.util.function.Supplier; + public class ModParticles { private ModParticles() {} - private static final DeferredRegister> PARTICLES = DeferredRegister.create(ForgeRegistries.PARTICLE_TYPES, Reference.MOD_ID); - public static final RegistryObject CAULDRON_STEAM = PARTICLES.register("cauldron_steam", CauldronSteamParticleType::new); - public static final RegistryObject CAULDRON_BUBBLE = PARTICLES.register("cauldron_bubble", CauldronBubbleParticleType::new); + private static final DeferredRegister> PARTICLES = DeferredRegister.create(BuiltInRegistries.PARTICLE_TYPE, Reference.MOD_ID); + public static final Supplier CAULDRON_STEAM = PARTICLES.register("cauldron_steam", CauldronSteamParticleType::new); + public static final Supplier CAULDRON_BUBBLE = PARTICLES.register("cauldron_bubble", CauldronBubbleParticleType::new); public static void registerListeners(IEventBus modBus) { PARTICLES.register(modBus); diff --git a/src/main/java/reliquary/client/model/VoidTearModel.java b/src/main/java/reliquary/client/model/VoidTearModel.java index a59c7ddd..85e18e1c 100644 --- a/src/main/java/reliquary/client/model/VoidTearModel.java +++ b/src/main/java/reliquary/client/model/VoidTearModel.java @@ -71,7 +71,7 @@ public ItemOverrides getOverrides() { @Override public BakedModel resolve(BakedModel model, ItemStack stack, @Nullable ClientLevel world, @Nullable LivingEntity entity, int seed) { if (Screen.hasShiftDown()) { - ItemStack containedStack = VoidTearItem.getTearContents(stack, true); + ItemStack containedStack = VoidTearItem.getTearContents(stack); if (!containedStack.isEmpty()) { BakedModel bakedModel = Minecraft.getInstance().getItemRenderer().getModel(containedStack, world, entity, seed); if (!bakedModel.isCustomRenderer()) { diff --git a/src/main/java/reliquary/client/particle/CauldronBubbleParticle.java b/src/main/java/reliquary/client/particle/CauldronBubbleParticle.java index d25e339b..9f6a8534 100644 --- a/src/main/java/reliquary/client/particle/CauldronBubbleParticle.java +++ b/src/main/java/reliquary/client/particle/CauldronBubbleParticle.java @@ -1,17 +1,10 @@ package reliquary.client.particle; import net.minecraft.client.multiplayer.ClientLevel; -import net.minecraft.client.particle.Particle; -import net.minecraft.client.particle.ParticleProvider; -import net.minecraft.client.particle.ParticleRenderType; -import net.minecraft.client.particle.SpriteSet; -import net.minecraft.client.particle.TextureSheetParticle; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraft.client.particle.*; import javax.annotation.Nullable; -@OnlyIn(Dist.CLIENT) public class CauldronBubbleParticle extends TextureSheetParticle { private static final int FRAMES_OF_EACH_POP_STAGE = 2; private static final int POP_STAGES = 3; @@ -66,7 +59,6 @@ public ParticleRenderType getRenderType() { return ParticleRenderType.PARTICLE_SHEET_OPAQUE; } - @OnlyIn(Dist.CLIENT) public static class Provider implements ParticleProvider { private final SpriteSet spriteSet; diff --git a/src/main/java/reliquary/client/particle/CauldronSteamParticle.java b/src/main/java/reliquary/client/particle/CauldronSteamParticle.java index 744ce5bb..a6289b85 100644 --- a/src/main/java/reliquary/client/particle/CauldronSteamParticle.java +++ b/src/main/java/reliquary/client/particle/CauldronSteamParticle.java @@ -1,17 +1,10 @@ package reliquary.client.particle; import net.minecraft.client.multiplayer.ClientLevel; -import net.minecraft.client.particle.Particle; -import net.minecraft.client.particle.ParticleProvider; -import net.minecraft.client.particle.ParticleRenderType; -import net.minecraft.client.particle.SpriteSet; -import net.minecraft.client.particle.TextureSheetParticle; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraft.client.particle.*; import javax.annotation.Nullable; -@OnlyIn(Dist.CLIENT) public class CauldronSteamParticle extends TextureSheetParticle { private final SpriteSet spriteSet; @@ -59,7 +52,6 @@ public ParticleRenderType getRenderType() { return ParticleRenderType.PARTICLE_SHEET_TRANSLUCENT; } - @OnlyIn(Dist.CLIENT) public static class Provider implements ParticleProvider { private final SpriteSet spriteSet; diff --git a/src/main/java/reliquary/client/particle/ColorParticleData.java b/src/main/java/reliquary/client/particle/ColorParticleData.java index f5732be3..499af69e 100644 --- a/src/main/java/reliquary/client/particle/ColorParticleData.java +++ b/src/main/java/reliquary/client/particle/ColorParticleData.java @@ -3,8 +3,8 @@ import com.mojang.brigadier.StringReader; import com.mojang.brigadier.exceptions.CommandSyntaxException; import net.minecraft.core.particles.ParticleOptions; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.network.FriendlyByteBuf; -import net.minecraftforge.registries.ForgeRegistries; import java.util.Locale; @@ -28,7 +28,7 @@ public void writeToNetwork(FriendlyByteBuf packetBuffer) { @Override public String writeToString() { - return String.format(Locale.ROOT, "%s %.2f %.2f %.2f", ForgeRegistries.PARTICLE_TYPES.getKey(getType()), red, green, blue); + return String.format(Locale.ROOT, "%s %.2f %.2f %.2f", BuiltInRegistries.PARTICLE_TYPE.getKey(getType()), red, green, blue); } public interface IColorParticleDataInitializer { @@ -36,7 +36,8 @@ public interface IColorParticleDataInitializer { } public static class DeserializationHelper { - private DeserializationHelper() {} + private DeserializationHelper() { + } public static T deserialize(IColorParticleDataInitializer initializer, StringReader stringReader) throws CommandSyntaxException { diff --git a/src/main/java/reliquary/client/render/PedestalRenderer.java b/src/main/java/reliquary/client/render/PedestalRenderer.java index a493c4c6..b0a861f2 100644 --- a/src/main/java/reliquary/client/render/PedestalRenderer.java +++ b/src/main/java/reliquary/client/render/PedestalRenderer.java @@ -6,9 +6,11 @@ import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.blockentity.BlockEntityRenderer; import net.minecraft.client.renderer.texture.OverlayTexture; +import net.minecraft.core.BlockPos; import net.minecraft.util.Mth; import net.minecraft.world.item.ItemDisplayContext; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.phys.AABB; import reliquary.blocks.tile.PedestalBlockEntity; import reliquary.client.registry.PedestalClientRegistry; @@ -28,4 +30,12 @@ public void render(PedestalBlockEntity te, float partialTicks, PoseStack matrixS PedestalClientRegistry.getItemRenderer(stack).ifPresent(extraRenderer -> extraRenderer.doRender(te, partialTicks, matrixStack, buffer, packedLight, packedOverlay)); } } + + @Override + public AABB getRenderBoundingBox(PedestalBlockEntity blockEntity) { + BlockPos pos = blockEntity.getBlockPos(); + AABB aabb = new AABB(pos.getX() - 1, pos.getY(), pos.getZ() - 1, pos.getX() + 1, pos.getY() + 1, pos.getZ() + 1); + blockEntity.executeOnActionItem(ai -> ai.getRenderBoundingBoxOuterPosition().ifPresent(aabb::expandTowards)); + return aabb; + } } diff --git a/src/main/java/reliquary/client/render/ShotRenderer.java b/src/main/java/reliquary/client/render/ShotRenderer.java index 3932d61e..85578a61 100644 --- a/src/main/java/reliquary/client/render/ShotRenderer.java +++ b/src/main/java/reliquary/client/render/ShotRenderer.java @@ -9,8 +9,6 @@ import net.minecraft.client.renderer.texture.OverlayTexture; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.EntityType; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; import org.joml.Matrix3f; import org.joml.Matrix4f; import reliquary.entities.shot.ShotEntityBase; @@ -18,7 +16,6 @@ import java.util.HashMap; import java.util.Map; -@OnlyIn(Dist.CLIENT) public class ShotRenderer extends EntityRenderer { private final Map, RenderType> entityCutOuts = new HashMap<>(); diff --git a/src/main/java/reliquary/compat/botania/BotaniaCompat.java b/src/main/java/reliquary/compat/botania/BotaniaCompat.java index 6f3ab9c9..f6693af6 100644 --- a/src/main/java/reliquary/compat/botania/BotaniaCompat.java +++ b/src/main/java/reliquary/compat/botania/BotaniaCompat.java @@ -1,6 +1,11 @@ package reliquary.compat.botania; +import net.neoforged.bus.api.IEventBus; + public class BotaniaCompat { + + public BotaniaCompat(IEventBus modBus) { + } public void setup() { //TODO readd when botania is ported //FortuneCoinItem.addFortuneCoinPickupChecker(itemEntity -> !BotaniaAPI.instance().hasSolegnoliaAround(itemEntity)); diff --git a/src/main/java/reliquary/compat/curios/CuriosBaubleItemWrapper.java b/src/main/java/reliquary/compat/curios/CuriosBaubleItemWrapper.java index 94c55c7b..7db46c2b 100644 --- a/src/main/java/reliquary/compat/curios/CuriosBaubleItemWrapper.java +++ b/src/main/java/reliquary/compat/curios/CuriosBaubleItemWrapper.java @@ -1,6 +1,5 @@ package reliquary.compat.curios; -import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.item.ItemStack; import reliquary.items.util.ICuriosItem; import top.theillusivec4.curios.api.SlotContext; @@ -22,16 +21,16 @@ public ItemStack getStack() { @Override public void onEquip(SlotContext slotContext, ItemStack prevStack) { - curiosItem.onEquipped(slotContext.getIdentifier(), slotContext.getWearer()); + curiosItem.onEquipped(slotContext.identifier(), slotContext.entity()); } @Override - public void curioTick(String identifier, int index, LivingEntity livingEntity) { - CuriosCompat.getStackInSlot(livingEntity, identifier, index).ifPresent(stack -> curiosItem.onWornTick(stack, livingEntity)); + public void curioTick(SlotContext slotContext) { + CuriosCompat.getStackInSlot(slotContext.entity(), slotContext.identifier(), slotContext.index()).ifPresent(stack -> curiosItem.onWornTick(stack, slotContext.entity())); } @Override - public boolean canEquip(String identifier, LivingEntity livingEntity) { - return curiosItem.getCuriosType().getIdentifier().equals(identifier); + public boolean canEquip(SlotContext slotContext) { + return curiosItem.getCuriosType().getIdentifier().equals(slotContext.identifier()); } } diff --git a/src/main/java/reliquary/compat/curios/CuriosCharmInventoryHandler.java b/src/main/java/reliquary/compat/curios/CuriosCharmInventoryHandler.java index 1b5b7669..336910f2 100644 --- a/src/main/java/reliquary/compat/curios/CuriosCharmInventoryHandler.java +++ b/src/main/java/reliquary/compat/curios/CuriosCharmInventoryHandler.java @@ -15,7 +15,7 @@ public boolean playerHasMobCharm(Player player, MobCharmDefinition charmDefiniti if (super.playerHasMobCharm(player, charmDefinition)) { return true; } - return CuriosApi.getCuriosHelper().getCuriosHandler(player).map(handler -> handler.getStacksHandler(ICuriosItem.Type.BELT.getIdentifier()).map(stackHandler -> { + return CuriosApi.getCuriosInventory(player).map(handler -> handler.getStacksHandler(ICuriosItem.Type.BELT.getIdentifier()).map(stackHandler -> { for (int slot = 0; slot < stackHandler.getSlots(); slot++) { ItemStack baubleStack = stackHandler.getStacks().getStackInSlot(slot); if (!baubleStack.isEmpty() && baubleStack.getItem() == ModItems.MOB_CHARM_BELT.get() && ModItems.MOB_CHARM_BELT.get().hasCharm(baubleStack, charmDefinition.getRegistryName())) { @@ -27,11 +27,11 @@ public boolean playerHasMobCharm(Player player, MobCharmDefinition charmDefiniti } @Override - public boolean damagePlayersMobCharm(Player player, String entityRegistryName) { + public boolean damagePlayersMobCharm(ServerPlayer player, String entityRegistryName) { if (super.damagePlayersMobCharm(player, entityRegistryName)) { return true; } - return CuriosApi.getCuriosHelper().getCuriosHandler(player).map(handler -> handler.getStacksHandler(ICuriosItem.Type.BELT.getIdentifier()).map(stackHandler -> { + return CuriosApi.getCuriosInventory(player).map(handler -> handler.getStacksHandler(ICuriosItem.Type.BELT.getIdentifier()).map(stackHandler -> { for (int slot = 0; slot < stackHandler.getSlots(); slot++) { ItemStack baubleStack = stackHandler.getStacks().getStackInSlot(slot); diff --git a/src/main/java/reliquary/compat/curios/CuriosCompat.java b/src/main/java/reliquary/compat/curios/CuriosCompat.java index f3ba24b8..126cd5e6 100644 --- a/src/main/java/reliquary/compat/curios/CuriosCompat.java +++ b/src/main/java/reliquary/compat/curios/CuriosCompat.java @@ -1,106 +1,59 @@ package reliquary.compat.curios; -import net.minecraft.core.Direction; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.client.event.EntityRenderersEvent; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.ICapabilityProvider; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.event.AttachCapabilitiesEvent; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.fml.DistExecutor; -import net.minecraftforge.fml.InterModComms; -import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; -import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent; -import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; -import net.minecraftforge.items.ItemStackHandler; -import reliquary.client.model.MobCharmBeltModel; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent; +import net.neoforged.fml.loading.FMLEnvironment; +import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent; +import net.neoforged.neoforge.items.ItemStackHandler; import reliquary.init.ModItems; -import reliquary.items.util.ICuriosItem; -import reliquary.reference.Compatibility; -import reliquary.reference.Reference; import reliquary.util.InventoryHelper; -import reliquary.util.RegistryHelper; import top.theillusivec4.curios.api.CuriosApi; import top.theillusivec4.curios.api.CuriosCapability; -import top.theillusivec4.curios.api.SlotTypeMessage; -import top.theillusivec4.curios.api.SlotTypePreset; -import top.theillusivec4.curios.api.client.CuriosRendererRegistry; import top.theillusivec4.curios.api.type.inventory.ICurioStacksHandler; import top.theillusivec4.curios.api.type.inventory.IDynamicStackHandler; import javax.annotation.Nonnull; -import javax.annotation.Nullable; import java.util.Optional; public class CuriosCompat { private static final EmptyCuriosHandler EMPTY_HANDLER = new EmptyCuriosHandler(); - public CuriosCompat() { - IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); - modEventBus.addListener(this::sendImc); - modEventBus.addListener(this::setup); - IEventBus eventBus = MinecraftForge.EVENT_BUS; - eventBus.addGenericListener(ItemStack.class, this::onAttachCapabilities); + public CuriosCompat(IEventBus modBus) { + modBus.addListener(this::setup); + modBus.addListener(this::onRegisterCapabilities); - DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> modEventBus.addListener(this::registerLayerDefinitions)); - } - - private void registerLayerDefinitions(EntityRenderersEvent.RegisterLayerDefinitions event) { - event.registerLayerDefinition(MobCharmBeltRenderer.MOB_CHARM_BELT_LAYER, MobCharmBeltModel::createBodyLayer); - CuriosRendererRegistry.register(ModItems.MOB_CHARM_BELT.get(), MobCharmBeltRenderer::new); - } - - private void sendImc(InterModEnqueueEvent evt) { - InterModComms.sendTo(Compatibility.ModIds.CURIOS, SlotTypeMessage.REGISTER_TYPE, () -> SlotTypePreset.NECKLACE.getMessageBuilder().build()); - InterModComms.sendTo(Compatibility.ModIds.CURIOS, SlotTypeMessage.REGISTER_TYPE, () -> SlotTypePreset.BODY.getMessageBuilder().build()); - InterModComms.sendTo(Compatibility.ModIds.CURIOS, SlotTypeMessage.REGISTER_TYPE, () -> SlotTypePreset.BELT.getMessageBuilder().build()); - } - - public void onAttachCapabilities(AttachCapabilitiesEvent evt) { - ItemStack stack = evt.getObject(); - Item item = stack.getItem(); - if (isCuriosItem(item)) { - addCuriosCapability(evt, stack); + if (FMLEnvironment.dist.isClient()) { + CuriosCompatClient.registerLayerDefinitions(modBus); } } - private boolean isCuriosItem(Item item) { - return RegistryHelper.getRegistryName(item).getNamespace().equals(Reference.MOD_ID) && item instanceof ICuriosItem; - } - - private void addCuriosCapability(AttachCapabilitiesEvent evt, ItemStack stack) { - //noinspection ConstantConditions - item.getRegistryName() isn't null at this point - that is checked in the other method - evt.addCapability(new ResourceLocation(Reference.MOD_ID, RegistryHelper.getRegistryName(stack.getItem()).getPath() + "_curios"), new ICapabilityProvider() { - @Nonnull - @Override - public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { - return CuriosCapability.ITEM.orEmpty(cap, LazyOptional.of(() -> new CuriosBaubleItemWrapper(stack))); - } - }); + public void onRegisterCapabilities(RegisterCapabilitiesEvent evt) { + evt.registerItem( + CuriosCapability.ITEM, + (itemStack, unused) -> new CuriosBaubleItemWrapper(itemStack), + ModItems.FORTUNE_COIN.get(), ModItems.MOB_CHARM_BELT.get(), ModItems.TWILIGHT_CLOAK.get()); } @SuppressWarnings("unused") //event type parameter needed for addListener to know when to call this method private void setup(FMLCommonSetupEvent event) { - DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> new CuriosFortuneCoinToggler().registerSelf()); + if (FMLEnvironment.dist.isClient()) { + CuriosCompatClient.registerFortuneCoinToggler(); + } ModItems.MOB_CHARM.get().setCharmInventoryHandler(new CuriosCharmInventoryHandler()); - InventoryHelper.addBaublesItemHandlerFactory((player, type) -> (CuriosApi.getCuriosHelper().getCuriosHandler(player) + InventoryHelper.addBaublesItemHandlerFactory((player, type) -> (CuriosApi.getCuriosInventory(player) .map(handler -> handler.getStacksHandler(type.getIdentifier()).map(ICurioStacksHandler::getStacks).orElse(EMPTY_HANDLER)).orElse(EMPTY_HANDLER))); } public static Optional getStackInSlot(LivingEntity entity, String slotName, int slot) { - return CuriosApi.getCuriosHelper().getCuriosHandler(entity).map(handler -> handler.getStacksHandler(slotName) - .map(sh -> sh.getStacks().getStackInSlot(slot))).orElse(Optional.empty()); + return CuriosApi.getCuriosInventory(entity).flatMap(handler -> handler.getStacksHandler(slotName) + .map(sh -> sh.getStacks().getStackInSlot(slot))); } public static void setStackInSlot(LivingEntity entity, String slotName, int slot, ItemStack stack) { - CuriosApi.getCuriosHelper().getCuriosHandler(entity).ifPresent(handler -> handler.getStacksHandler(slotName).ifPresent(sh -> sh.getStacks().setStackInSlot(slot, stack))); + CuriosApi.getCuriosInventory(entity).flatMap(handler -> handler.getStacksHandler(slotName)).ifPresent(sh -> sh.getStacks().setStackInSlot(slot, stack)); } private static class EmptyCuriosHandler extends ItemStackHandler implements IDynamicStackHandler { diff --git a/src/main/java/reliquary/compat/curios/CuriosCompatClient.java b/src/main/java/reliquary/compat/curios/CuriosCompatClient.java new file mode 100644 index 00000000..b52ca8e2 --- /dev/null +++ b/src/main/java/reliquary/compat/curios/CuriosCompatClient.java @@ -0,0 +1,20 @@ +package reliquary.compat.curios; + +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.client.event.EntityRenderersEvent; +import reliquary.client.model.MobCharmBeltModel; +import reliquary.init.ModItems; +import top.theillusivec4.curios.api.client.CuriosRendererRegistry; + +public class CuriosCompatClient { + public static void registerLayerDefinitions(IEventBus modEventBus) { + modEventBus.addListener(EntityRenderersEvent.RegisterLayerDefinitions.class, event -> { + event.registerLayerDefinition(MobCharmBeltRenderer.MOB_CHARM_BELT_LAYER, MobCharmBeltModel::createBodyLayer); + CuriosRendererRegistry.register(ModItems.MOB_CHARM_BELT.get(), MobCharmBeltRenderer::new); + }); + } + + public static void registerFortuneCoinToggler() { + new CuriosFortuneCoinToggler().registerSelf(); + } +} diff --git a/src/main/java/reliquary/compat/curios/CuriosFortuneCoinToggler.java b/src/main/java/reliquary/compat/curios/CuriosFortuneCoinToggler.java index 883a422f..5c7841c9 100644 --- a/src/main/java/reliquary/compat/curios/CuriosFortuneCoinToggler.java +++ b/src/main/java/reliquary/compat/curios/CuriosFortuneCoinToggler.java @@ -2,24 +2,21 @@ import net.minecraft.client.Minecraft; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; +import net.neoforged.neoforge.network.PacketDistributor; import reliquary.init.ModItems; import reliquary.items.FortuneCoinToggler; -import reliquary.network.PacketFortuneCoinTogglePressed; -import reliquary.network.PacketHandler; +import reliquary.network.FortuneCoinTogglePressedPacket; import top.theillusivec4.curios.api.CuriosApi; import java.util.concurrent.atomic.AtomicBoolean; -@OnlyIn(Dist.CLIENT) class CuriosFortuneCoinToggler extends FortuneCoinToggler { @Override public boolean findAndToggle() { if (super.findAndToggle()) { return true; } - return CuriosApi.getCuriosHelper().getCuriosHandler(Minecraft.getInstance().player).map(handler -> { + return CuriosApi.getCuriosInventory(Minecraft.getInstance().player).map(handler -> { AtomicBoolean result = new AtomicBoolean(false); handler.getCurios().forEach((identifier, stackHandler) -> { for (int slot = 0; slot < stackHandler.getSlots(); slot++) { @@ -28,7 +25,7 @@ public boolean findAndToggle() { if (baubleStack.getItem() == ModItems.FORTUNE_COIN.get()) { ModItems.FORTUNE_COIN.get().toggle(baubleStack); stackHandler.getStacks().setStackInSlot(slot, baubleStack); - PacketHandler.sendToServer(new PacketFortuneCoinTogglePressed(PacketFortuneCoinTogglePressed.InventoryType.CURIOS, identifier, slot)); + PacketDistributor.SERVER.noArg().send(new FortuneCoinTogglePressedPacket(FortuneCoinTogglePressedPacket.InventoryType.CURIOS, identifier, slot)); result.set(true); return; } diff --git a/src/main/java/reliquary/compat/jade/provider/CachedBodyDataProvider.java b/src/main/java/reliquary/compat/jade/provider/CachedBodyDataProvider.java index 56d4b5e1..e72dd43c 100644 --- a/src/main/java/reliquary/compat/jade/provider/CachedBodyDataProvider.java +++ b/src/main/java/reliquary/compat/jade/provider/CachedBodyDataProvider.java @@ -3,7 +3,7 @@ import net.minecraft.ChatFormatting; import net.minecraft.core.BlockPos; import net.minecraft.network.chat.Component; -import reliquary.reference.Settings; +import reliquary.reference.Config; import snownee.jade.api.BlockAccessor; import snownee.jade.api.IBlockComponentProvider; import snownee.jade.api.ITooltip; @@ -20,7 +20,7 @@ public abstract class CachedBodyDataProvider implements IBlockComponentProvider @Override public void appendTooltip(ITooltip tooltip, BlockAccessor accessor, IPluginConfig pluginConfig) { - if (Boolean.TRUE.equals(Settings.CLIENT.wailaShiftForInfo.get()) && !accessor.getPlayer().isCrouching()) { + if (Boolean.TRUE.equals(Config.CLIENT.wailaShiftForInfo.get()) && !accessor.getPlayer().isCrouching()) { tooltip.add(Component.translatable("waila.reliquary.shift_for_more").withStyle(ChatFormatting.ITALIC)); return; } diff --git a/src/main/java/reliquary/compat/jade/provider/DataProviderAltar.java b/src/main/java/reliquary/compat/jade/provider/DataProviderAltar.java index f1f9f2d8..fb50b842 100644 --- a/src/main/java/reliquary/compat/jade/provider/DataProviderAltar.java +++ b/src/main/java/reliquary/compat/jade/provider/DataProviderAltar.java @@ -9,8 +9,8 @@ import org.jetbrains.annotations.Nullable; import reliquary.blocks.AlkahestryAltarBlock; import reliquary.blocks.tile.AlkahestryAltarBlockEntity; +import reliquary.reference.Config; import reliquary.reference.Reference; -import reliquary.reference.Settings; import snownee.jade.api.BlockAccessor; import snownee.jade.api.IBlockComponentProvider; import snownee.jade.api.IServerDataProvider; @@ -33,7 +33,7 @@ public class DataProviderAltar implements IBlockComponentProvider, IServerDataPr @Override public void appendTooltip(ITooltip tooltip, BlockAccessor accessor, IPluginConfig pluginConfig) { - if (Boolean.TRUE.equals(Settings.CLIENT.wailaShiftForInfo.get()) && !accessor.getPlayer().isCrouching()) { + if (Boolean.TRUE.equals(Config.CLIENT.wailaShiftForInfo.get()) && !accessor.getPlayer().isCrouching()) { tooltip.add(Component.translatable("waila.reliquary.shift_for_more").withStyle(ChatFormatting.ITALIC)); return; } @@ -48,7 +48,7 @@ public void appendTooltip(ITooltip tooltip, BlockAccessor accessor, IPluginConfi Vec2 delta = new Vec2(0, -4); IElement redstoneIcon = helper.item(Items.REDSTONE.getDefaultInstance(), JadeHelper.ITEM_ICON_SCALE); - IElement requirementText = helper.text(Component.literal(String.format("%d / %d", altar.getRedstoneCount(), Settings.COMMON.blocks.altar.redstoneCost.get()))); + IElement requirementText = helper.text(Component.literal(String.format("%d / %d", altar.getRedstoneCount(), Config.COMMON.blocks.altar.redstoneCost.get()))); redstoneIcon.size(redstoneIcon.getSize().add(delta)).translate(delta); requirementText.size(requirementText.getSize().add(delta)).translate(delta.add(new Vec2(0, (redstoneIcon.getSize().y - requirementText.getSize().y) / 2))); diff --git a/src/main/java/reliquary/compat/jade/provider/DataProviderCauldron.java b/src/main/java/reliquary/compat/jade/provider/DataProviderCauldron.java index 2e13154c..43698c31 100644 --- a/src/main/java/reliquary/compat/jade/provider/DataProviderCauldron.java +++ b/src/main/java/reliquary/compat/jade/provider/DataProviderCauldron.java @@ -6,23 +6,21 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.material.Fluids; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidType; +import net.neoforged.neoforge.fluids.FluidStack; +import net.neoforged.neoforge.fluids.FluidType; import reliquary.blocks.ApothecaryCauldronBlock; import reliquary.blocks.tile.ApothecaryCauldronBlockEntity; import reliquary.reference.Reference; import reliquary.util.TooltipBuilder; +import reliquary.util.potions.XRPotionHelper; import snownee.jade.api.BlockAccessor; import snownee.jade.api.config.IPluginConfig; import snownee.jade.api.fluid.JadeFluidObject; -import snownee.jade.api.ui.BoxStyle; -import snownee.jade.api.ui.IDisplayHelper; -import snownee.jade.api.ui.IElement; -import snownee.jade.api.ui.IElementHelper; -import snownee.jade.api.ui.IProgressStyle; +import snownee.jade.api.ui.*; import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; public class DataProviderCauldron extends CachedBodyDataProvider { @Override @@ -79,8 +77,9 @@ public List> getWailaBodyToCache(IElementHelper helper, BlockAcce lines.add(createTank(helper, fluidPlaceHolder, FluidType.BUCKET_VOLUME, potionType)); List components = new ArrayList<>(); - TooltipBuilder.of(components).potionEffects(cauldron.getEffects()); - lines.add(components.stream().map(helper::text).toList()); + TooltipBuilder.of(components).potionEffects(XRPotionHelper.augmentPotionEffects(cauldron.getEffects(), cauldron.getRedstoneCount(), cauldron.getGlowstoneCount())); + + lines.add(components.stream().map(helper::text).collect(Collectors.toList())); return lines; } @@ -88,7 +87,9 @@ public static List createTank(IElementHelper helper, FluidStack fluidS if (displayName == FormattedText.EMPTY) { displayName = fluidStack.getDisplayName(); } - if (capacity <= 0) {return List.of();} + if (capacity <= 0) { + return List.of(); + } Component text; if (fluidStack.isEmpty()) { text = Component.translatable("jade.fluid.empty"); @@ -96,10 +97,10 @@ public static List createTank(IElementHelper helper, FluidStack fluidS String amountText = IDisplayHelper.get().humanReadableNumber(fluidStack.getAmount(), "B", true); text = Component.translatable("jade.fluid", displayName, amountText); } - IProgressStyle progressStyle = helper.progressStyle(); + ProgressStyle progressStyle = helper.progressStyle(); progressStyle.overlay(helper.fluid(JadeFluidObject.of(fluidStack.getFluid()))); - IElement tank = helper.progress((float) fluidStack.getAmount() / capacity, text, progressStyle, BoxStyle.DEFAULT, false); + IElement tank = helper.progress((float) fluidStack.getAmount() / capacity, text, progressStyle, BoxStyle.getNestedBox(), false); return List.of(tank); } diff --git a/src/main/java/reliquary/compat/jade/provider/DataProviderMortar.java b/src/main/java/reliquary/compat/jade/provider/DataProviderMortar.java index a071779e..bbf03b51 100644 --- a/src/main/java/reliquary/compat/jade/provider/DataProviderMortar.java +++ b/src/main/java/reliquary/compat/jade/provider/DataProviderMortar.java @@ -18,7 +18,6 @@ import snownee.jade.api.config.IPluginConfig; import snownee.jade.api.ui.IElement; import snownee.jade.api.ui.IElementHelper; -import snownee.jade.impl.ui.ProgressArrowElement; import java.util.ArrayList; import java.util.List; @@ -55,7 +54,7 @@ public List> getWailaBodyToCache(IElementHelper helper, BlockAcce lines.add(createPestleProgress(helper, pestleUsedCounter)); TooltipBuilder.of(effectTooltips).potionEffects(effects); - lines.addAll(effectTooltips.stream().map(text -> List.of(helper.text(text))).toList()); + lines.addAll(effectTooltips.stream().map(text -> List.of(helper.text(text))).toList()); } return lines; } @@ -65,7 +64,7 @@ public List createPestleProgress(IElementHelper helper, int pestleUsed XRPotionHelper.addPotionEffectsToStack(stack, effects); return List.of( - new ProgressArrowElement((float) pestleUsedCounter / ApothecaryMortarBlockEntity.PESTLE_USAGE_MAX), + helper.progress((float) pestleUsedCounter / ApothecaryMortarBlockEntity.PESTLE_USAGE_MAX), helper.item(stack) ); } diff --git a/src/main/java/reliquary/compat/jei/ItemDescriptionBuilder.java b/src/main/java/reliquary/compat/jei/ItemDescriptionBuilder.java index 7b5a3444..76a18663 100644 --- a/src/main/java/reliquary/compat/jei/ItemDescriptionBuilder.java +++ b/src/main/java/reliquary/compat/jei/ItemDescriptionBuilder.java @@ -3,12 +3,12 @@ import mezz.jei.api.constants.VanillaTypes; import mezz.jei.api.registration.IRecipeRegistration; import net.minecraft.core.NonNullList; +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.Item; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.registries.ForgeRegistries; import reliquary.init.ModBlocks; import reliquary.init.ModItems; import reliquary.items.ICreativeTabItemGenerator; @@ -174,10 +174,7 @@ private static void registerCharmBa NonNullList subItems = NonNullList.create(); item.addCreativeTabItems(subItems::add); for (ItemStack subItem : subItems) { - EntityType entityType = ForgeRegistries.ENTITY_TYPES.getValue(getEntityRegistryName.apply(subItem)); - if (entityType == null) { - continue; - } + EntityType entityType = BuiltInRegistries.ENTITY_TYPE.get(getEntityRegistryName.apply(subItem)); String path = RegistryHelper.getRegistryName(item).getPath(); String itemDescriptionKey = String.format("jei.%s.description.%s", Reference.MOD_ID, path.replace('/', '.')); String entityName = entityType.getDescription().getString(); diff --git a/src/main/java/reliquary/compat/jei/MobCharmRecipeMaker.java b/src/main/java/reliquary/compat/jei/MobCharmRecipeMaker.java index d969ebea..efb3403a 100644 --- a/src/main/java/reliquary/compat/jei/MobCharmRecipeMaker.java +++ b/src/main/java/reliquary/compat/jei/MobCharmRecipeMaker.java @@ -3,10 +3,7 @@ import net.minecraft.core.NonNullList; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.crafting.CraftingBookCategory; -import net.minecraft.world.item.crafting.CraftingRecipe; -import net.minecraft.world.item.crafting.Ingredient; -import net.minecraft.world.item.crafting.ShapedRecipe; +import net.minecraft.world.item.crafting.*; import reliquary.crafting.MobCharmRecipe; import reliquary.init.ModItems; import reliquary.items.MobCharmFragmentItem; @@ -16,18 +13,19 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Optional; public class MobCharmRecipeMaker { private MobCharmRecipeMaker() { } - public static List getRecipes() { - List recipes = new ArrayList<>(); + public static List> getRecipes() { + List> recipes = new ArrayList<>(); MobCharmRecipe.REGISTERED_RECIPES.forEach(baseRecipe -> addMobCharmRecipes(recipes, baseRecipe)); return recipes; } - private static void addMobCharmRecipes(List recipes, MobCharmRecipe baseRecipe) { + private static void addMobCharmRecipes(List> recipes, MobCharmRecipe baseRecipe) { for (String regName : MobCharmRegistry.getRegisteredNames()) { NonNullList inputs = NonNullList.create(); @@ -50,8 +48,9 @@ private static void addMobCharmRecipes(List recipes, MobCharmRec }); ItemStack output = ModItems.MOB_CHARM.get().getStackFor(regName); + ShapedRecipePattern pattern = new ShapedRecipePattern(3, 3, inputs, Optional.empty()); ResourceLocation id = new ResourceLocation(Reference.MOD_ID, "mob_charm_" + regName.replace(':', '_')); - recipes.add(new ShapedRecipe(id, "reliquary.mob_charm", CraftingBookCategory.MISC, 3, 3, inputs, output)); + recipes.add(new RecipeHolder<>(id, new ShapedRecipe("reliquary.mob_charm", CraftingBookCategory.MISC, pattern, output))); } } } diff --git a/src/main/java/reliquary/compat/jei/ReliquaryPlugin.java b/src/main/java/reliquary/compat/jei/ReliquaryPlugin.java index 47fd10fe..78fa4887 100644 --- a/src/main/java/reliquary/compat/jei/ReliquaryPlugin.java +++ b/src/main/java/reliquary/compat/jei/ReliquaryPlugin.java @@ -13,9 +13,7 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; -import net.minecraft.world.item.crafting.CraftingBookCategory; -import net.minecraft.world.item.crafting.Ingredient; -import net.minecraft.world.item.crafting.ShapedRecipe; +import net.minecraft.world.item.crafting.*; import net.minecraft.world.level.block.Blocks; import reliquary.compat.jei.alkahestry.AlkahestryChargingRecipeCategory; import reliquary.compat.jei.alkahestry.AlkahestryCraftingRecipeCategory; @@ -30,10 +28,11 @@ import reliquary.crafting.AlkahestryRecipeRegistry; import reliquary.init.ModBlocks; import reliquary.init.ModItems; +import reliquary.reference.Config; import reliquary.reference.Reference; -import reliquary.reference.Settings; import java.util.Collections; +import java.util.Optional; @SuppressWarnings("unused") //plugin class is used by JEI's reflection @JeiPlugin @@ -44,7 +43,7 @@ public class ReliquaryPlugin implements IModPlugin { public void registerItemSubtypes(ISubtypeRegistration registration) { registerNbtSubtypeInterpreter(registration, ModItems.MOB_CHARM_FRAGMENT.get(), "entity"); registerNbtSubtypeInterpreter(registration, ModItems.MOB_CHARM.get(), "entity"); - if (Boolean.FALSE.equals(Settings.COMMON.disable.disablePotions.get())) { + if (Boolean.FALSE.equals(Config.COMMON.disable.disablePotions.get())) { registerNbtSubtypeInterpreter(registration, ModItems.POTION_ESSENCE.get(), EFFECTS_TAG); registerNbtSubtypeInterpreter(registration, ModItems.POTION.get(), EFFECTS_TAG); registerNbtSubtypeInterpreter(registration, ModItems.SPLASH_POTION.get(), EFFECTS_TAG); @@ -59,12 +58,12 @@ public void registerItemSubtypes(ISubtypeRegistration registration) { public void registerCategories(IRecipeCategoryRegistration registration) { IGuiHelper guiHelper = registration.getJeiHelpers().getGuiHelper(); - if (Boolean.FALSE.equals(Settings.COMMON.disable.disableAlkahestry.get())) { + if (Boolean.FALSE.equals(Config.COMMON.disable.disableAlkahestry.get())) { registration.addRecipeCategories(new AlkahestryCraftingRecipeCategory(guiHelper)); registration.addRecipeCategories(new AlkahestryChargingRecipeCategory(guiHelper)); } - if (Boolean.FALSE.equals(Settings.COMMON.disable.disablePotions.get())) { + if (Boolean.FALSE.equals(Config.COMMON.disable.disablePotions.get())) { registration.addRecipeCategories(new MortarRecipeCategory(guiHelper)); registration.addRecipeCategories(new CauldronRecipeCategory(guiHelper)); } @@ -82,21 +81,21 @@ public void registerRecipeCatalysts(IRecipeCatalystRegistration registration) { @Override public void registerRecipes(IRecipeRegistration registration) { - if (Boolean.FALSE.equals(Settings.COMMON.disable.disableAlkahestry.get())) { + if (Boolean.FALSE.equals(Config.COMMON.disable.disableAlkahestry.get())) { registration.addRecipes(AlkahestryCraftingRecipeCategory.TYPE, AlkahestryRecipeRegistry.getCraftingRecipes()); registration.addRecipes(AlkahestryChargingRecipeCategory.TYPE, AlkahestryRecipeRegistry.getChargingRecipes()); } - if (Boolean.FALSE.equals(Settings.COMMON.disable.disablePotions.get())) { + if (Boolean.FALSE.equals(Config.COMMON.disable.disablePotions.get())) { registration.addRecipes(MortarRecipeCategory.TYPE, MortarRecipeMaker.getRecipes()); registration.addRecipes(CauldronRecipeCategory.TYPE, CauldronRecipeMaker.getRecipes()); registration.addRecipes(RecipeTypes.CRAFTING, ArrowShotRecipeMaker.getRecipes(new ItemStack(ModItems.TIPPED_ARROW.get()), new ItemStack(Items.ARROW), 0.125F, "arrow")); registration.addRecipes(RecipeTypes.CRAFTING, ArrowShotRecipeMaker.getRecipes(new ItemStack(ModItems.NEUTRAL_BULLET.get()), "bullet")); } - if (Boolean.FALSE.equals(Settings.COMMON.disable.disableHandgun.get())) { + if (Boolean.FALSE.equals(Config.COMMON.disable.disableHandgun.get())) { registration.addRecipes(RecipeTypes.CRAFTING, MagazineRecipeMaker.getRecipes()); } registration.addRecipes(RecipeTypes.CRAFTING, MobCharmRecipeMaker.getRecipes()); - if (Boolean.FALSE.equals(Settings.COMMON.disable.disableSpawnEggRecipes.get())) { + if (Boolean.FALSE.equals(Config.COMMON.disable.disableSpawnEggRecipes.get())) { registration.addRecipes(RecipeTypes.CRAFTING, SpawnEggRecipeMaker.getRecipes()); } registration.addRecipes(InfernalTearRecipeCategory.TYPE, InfernalTearRecipeMaker.getRecipes()); @@ -110,18 +109,20 @@ private void registerMobCharmBeltRecipe(IRecipeRegistration registration) { ModItems.MOB_CHARM_FRAGMENT.get().addCreativeTabItems(fragments::add); ItemStack[] fragmentStacks = fragments.toArray(new ItemStack[0]); - registration.addRecipes(RecipeTypes.CRAFTING, Collections.singletonList(new ShapedRecipe(new ResourceLocation(Reference.MOD_ID, "items/mob_charm_belt"), "", CraftingBookCategory.MISC, 3, 3, - NonNullList.of(Ingredient.EMPTY, - Ingredient.of(() -> Items.LEATHER), - Ingredient.of(() -> Items.LEATHER), - Ingredient.of(() -> Items.LEATHER), - Ingredient.of(fragmentStacks), - Ingredient.EMPTY, - Ingredient.of(fragmentStacks), - Ingredient.of(fragmentStacks), - Ingredient.of(fragmentStacks), - Ingredient.of(fragmentStacks) - ), new ItemStack(ModItems.MOB_CHARM_BELT.get())))); + ShapedRecipePattern pattern = new ShapedRecipePattern(3, 3, NonNullList.of(Ingredient.EMPTY, + Ingredient.of(() -> Items.LEATHER), + Ingredient.of(() -> Items.LEATHER), + Ingredient.of(() -> Items.LEATHER), + Ingredient.of(fragmentStacks), + Ingredient.EMPTY, + Ingredient.of(fragmentStacks), + Ingredient.of(fragmentStacks), + Ingredient.of(fragmentStacks), + Ingredient.of(fragmentStacks) + ), Optional.empty()); + + registration.addRecipes(RecipeTypes.CRAFTING, Collections.singletonList(new RecipeHolder<>(new ResourceLocation(Reference.MOD_ID, "items/mob_charm_belt"), + new ShapedRecipe("", CraftingBookCategory.MISC, pattern, new ItemStack(ModItems.MOB_CHARM_BELT.get()))))); } private void registerNbtSubtypeInterpreter(ISubtypeRegistration registration, Item item, String... keys) { diff --git a/src/main/java/reliquary/compat/jei/SpawnEggRecipeMaker.java b/src/main/java/reliquary/compat/jei/SpawnEggRecipeMaker.java index dad9174f..75263562 100644 --- a/src/main/java/reliquary/compat/jei/SpawnEggRecipeMaker.java +++ b/src/main/java/reliquary/compat/jei/SpawnEggRecipeMaker.java @@ -4,10 +4,7 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; -import net.minecraft.world.item.crafting.CraftingBookCategory; -import net.minecraft.world.item.crafting.CraftingRecipe; -import net.minecraft.world.item.crafting.Ingredient; -import net.minecraft.world.item.crafting.ShapelessRecipe; +import net.minecraft.world.item.crafting.*; import reliquary.crafting.FragmentRecipeHelper; import reliquary.init.ModItems; import reliquary.items.MobCharmRegistry; @@ -20,8 +17,8 @@ public class SpawnEggRecipeMaker { private SpawnEggRecipeMaker() { } - public static List getRecipes() { - List recipes = new ArrayList<>(); + public static List> getRecipes() { + List> recipes = new ArrayList<>(); for (String regName : MobCharmRegistry.getRegisteredNames()) { Ingredient fragmentIngredient = Ingredient.of(ModItems.MOB_CHARM_FRAGMENT.get().getStackFor(regName)); @@ -35,7 +32,7 @@ public static List getRecipes() { ItemStack output = FragmentRecipeHelper.getSpawnEggStack(regName); ResourceLocation id = new ResourceLocation(Reference.MOD_ID, "reliquary.fragment_to_spawn_egg." + output.getDescriptionId()); - recipes.add(new ShapelessRecipe(id, "reliquary.fragment_to_spawn_egg", CraftingBookCategory.MISC, output, inputs)); + recipes.add(new RecipeHolder<>(id, new ShapelessRecipe("reliquary.fragment_to_spawn_egg", CraftingBookCategory.MISC, output, inputs))); } return recipes; diff --git a/src/main/java/reliquary/compat/jei/alkahestry/AlkahestryCraftingRecipeCategory.java b/src/main/java/reliquary/compat/jei/alkahestry/AlkahestryCraftingRecipeCategory.java index e0624afc..92e3305a 100644 --- a/src/main/java/reliquary/compat/jei/alkahestry/AlkahestryCraftingRecipeCategory.java +++ b/src/main/java/reliquary/compat/jei/alkahestry/AlkahestryCraftingRecipeCategory.java @@ -19,7 +19,6 @@ import reliquary.init.ModItems; import reliquary.items.AlkahestryTomeItem; import reliquary.reference.Reference; -import reliquary.reference.Settings; public class AlkahestryCraftingRecipeCategory extends AlkahestryRecipeCategory { public static final RecipeType TYPE = RecipeType.create(Reference.MOD_ID, "alkahestry_crafting", AlkahestryCraftingRecipe.class); @@ -54,7 +53,7 @@ public void setRecipe(IRecipeLayoutBuilder builder, AlkahestryCraftingRecipe rec ItemStack tome = ingredientsInputs.get(1).getItems()[0]; ItemStack output = recipe.getResult(); ItemStack tomeOutput = AlkahestryTomeItem.setCharge(new ItemStack(ModItems.ALKAHESTRY_TOME.get()), - Settings.COMMON.items.alkahestryTome.chargeLimit.get() - recipe.getChargeNeeded()); + AlkahestryTomeItem.getChargeLimit() - recipe.getChargeNeeded()); builder.addSlot(RecipeIngredientRole.INPUT, 1, 1).addItemStack(input); builder.addSlot(RecipeIngredientRole.INPUT, 19, 1).addItemStack(tome); diff --git a/src/main/java/reliquary/compat/jei/infernaltear/InfernalTearRecipeCategory.java b/src/main/java/reliquary/compat/jei/infernaltear/InfernalTearRecipeCategory.java index 161cbba5..e3e8df10 100644 --- a/src/main/java/reliquary/compat/jei/infernaltear/InfernalTearRecipeCategory.java +++ b/src/main/java/reliquary/compat/jei/infernaltear/InfernalTearRecipeCategory.java @@ -74,7 +74,7 @@ public void draw(InfernalTearRecipe recipe, IRecipeSlotsView recipeSlotsView, Gu String points = experiencePoints + " " + Language.getInstance().getOrDefault("jei.reliquary.recipe.infernal_tear.xp"); Font fontRenderer = Minecraft.getInstance().font; int stringWidth = fontRenderer.width(points); - guiGraphics.drawString(fontRenderer, points, (int) ((double) background.getWidth() / 2 + (((double) background.getWidth() / 2 + 16 - stringWidth) / 2)), 5, -8355712); + guiGraphics.drawString(fontRenderer, points, (int) ((double) background.getWidth() / 2 + (((double) background.getWidth() / 2 + 16 - stringWidth) / 2)), 5, 8453920); drawLevels(guiGraphics, experiencePoints, fontRenderer); } diff --git a/src/main/java/reliquary/compat/jei/infernaltear/InfernalTearRecipeMaker.java b/src/main/java/reliquary/compat/jei/infernaltear/InfernalTearRecipeMaker.java index 47aa2154..1560f681 100644 --- a/src/main/java/reliquary/compat/jei/infernaltear/InfernalTearRecipeMaker.java +++ b/src/main/java/reliquary/compat/jei/infernaltear/InfernalTearRecipeMaker.java @@ -1,10 +1,11 @@ package reliquary.compat.jei.infernaltear; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.registries.ForgeRegistries; -import reliquary.reference.Settings; +import net.minecraft.world.item.Items; +import reliquary.reference.Config; import java.util.ArrayList; import java.util.List; @@ -16,10 +17,10 @@ private InfernalTearRecipeMaker() {} public static List getRecipes() { ArrayList recipes = new ArrayList<>(); - for (Map.Entry entry : Settings.COMMON.items.infernalTear.getItemExperiences().entrySet()) { - Item item = ForgeRegistries.ITEMS.getValue(new ResourceLocation(entry.getKey())); + for (Map.Entry entry : Config.COMMON.items.infernalTear.getItemExperiences().entrySet()) { + Item item = BuiltInRegistries.ITEM.get(new ResourceLocation(entry.getKey())); - if (item != null) { + if (item != Items.AIR) { recipes.add(new InfernalTearRecipe(new ItemStack(item), entry.getValue())); } } diff --git a/src/main/java/reliquary/compat/jei/lingering/ArrowShotRecipeMaker.java b/src/main/java/reliquary/compat/jei/lingering/ArrowShotRecipeMaker.java index aaa745b5..d1e7e17b 100644 --- a/src/main/java/reliquary/compat/jei/lingering/ArrowShotRecipeMaker.java +++ b/src/main/java/reliquary/compat/jei/lingering/ArrowShotRecipeMaker.java @@ -2,10 +2,7 @@ import net.minecraft.core.NonNullList; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.crafting.CraftingBookCategory; -import net.minecraft.world.item.crafting.CraftingRecipe; -import net.minecraft.world.item.crafting.Ingredient; -import net.minecraft.world.item.crafting.ShapedRecipe; +import net.minecraft.world.item.crafting.*; import reliquary.init.ModItems; import reliquary.util.RegistryHelper; import reliquary.util.potions.PotionEssence; @@ -15,17 +12,18 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.Optional; public class ArrowShotRecipeMaker { private ArrowShotRecipeMaker() { } - public static List getRecipes(ItemStack output, String itemName) { + public static List> getRecipes(ItemStack output, String itemName) { return getRecipes(output, output, 0.2F, itemName); } - public static List getRecipes(ItemStack output, ItemStack itemStack, float durationFactor, String itemName) { - ArrayList recipes = new ArrayList<>(); + public static List> getRecipes(ItemStack output, ItemStack itemStack, float durationFactor, String itemName) { + ArrayList> recipes = new ArrayList<>(); String group = "reliquary.potion." + itemName; for (PotionEssence essence : PotionMap.uniquePotions) { @@ -42,7 +40,8 @@ public static List getRecipes(ItemStack output, ItemStack itemSt ingredients.add(Ingredient.of(potion)); ingredients.addAll(Collections.nCopies(4, Ingredient.of(itemStack))); - recipes.add(new ShapedRecipe(RegistryHelper.getRegistryName(output.getItem()), group, CraftingBookCategory.MISC, 3, 3, ingredients, outputCopy)); + ShapedRecipePattern pattern = new ShapedRecipePattern(3, 3, ingredients, Optional.empty()); + recipes.add(new RecipeHolder<>(RegistryHelper.getRegistryName(output.getItem()), new ShapedRecipe(group, CraftingBookCategory.MISC, pattern, outputCopy))); } return recipes; diff --git a/src/main/java/reliquary/compat/jei/magazines/MagazineRecipeMaker.java b/src/main/java/reliquary/compat/jei/magazines/MagazineRecipeMaker.java index 6fb144bd..8f29cf5b 100644 --- a/src/main/java/reliquary/compat/jei/magazines/MagazineRecipeMaker.java +++ b/src/main/java/reliquary/compat/jei/magazines/MagazineRecipeMaker.java @@ -4,22 +4,16 @@ import net.minecraft.core.NonNullList; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.crafting.CraftingBookCategory; -import net.minecraft.world.item.crafting.CraftingRecipe; -import net.minecraft.world.item.crafting.Ingredient; -import net.minecraft.world.item.crafting.ShapedRecipe; +import net.minecraft.world.item.crafting.*; import reliquary.items.BulletItem; import reliquary.items.MagazineItem; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.RegistryHelper; import reliquary.util.potions.PotionEssence; import reliquary.util.potions.PotionMap; import reliquary.util.potions.XRPotionHelper; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; +import java.util.*; import static reliquary.init.ModItems.*; @@ -28,18 +22,18 @@ public class MagazineRecipeMaker { private MagazineRecipeMaker() { } - public static List getRecipes() { - ArrayList recipes = new ArrayList<>(); + public static List> getRecipes() { + List> recipes = new ArrayList<>(); addRegularMagazines(recipes); - if (Boolean.FALSE.equals(Settings.COMMON.disable.disablePotions.get())) { + if (Boolean.FALSE.equals(Config.COMMON.disable.disablePotions.get())) { addPotionMagazines(recipes); } return recipes; } - private static void addRegularMagazines(ArrayList recipes) { + private static void addRegularMagazines(List> recipes) { Map bulletMagazines = new ImmutableMap.Builder() .put(NEUTRAL_BULLET.get(), NEUTRAL_MAGAZINE.get()) .put(EXORCISM_BULLET.get(), EXORCISM_MAGAZINE.get()) @@ -60,11 +54,13 @@ private static void addRegularMagazines(ArrayList recipes) { ItemStack output = new ItemStack(bulletMagazine.getValue()); - recipes.add(new ShapedRecipe(RegistryHelper.getRegistryName(output.getItem()), "reliquary.magazine", CraftingBookCategory.MISC, 3, 3, inputs, output)); + ShapedRecipePattern pattern = new ShapedRecipePattern(3, 3, inputs, Optional.empty()); + + recipes.add(new RecipeHolder<>(RegistryHelper.getRegistryName(output.getItem()), new ShapedRecipe("reliquary.magazine", CraftingBookCategory.MISC, pattern, output))); } } - private static void addPotionMagazines(ArrayList recipes) { + private static void addPotionMagazines(List> recipes) { for (PotionEssence essence : PotionMap.uniquePotions) { List effects = XRPotionHelper.changePotionEffectsDuration(essence.getEffects(), 0.2F); @@ -76,7 +72,9 @@ private static void addPotionMagazines(ArrayList recipes) { ItemStack output = new ItemStack(NEUTRAL_MAGAZINE.get()); XRPotionHelper.addPotionEffectsToStack(output, effects); - recipes.add(new ShapedRecipe(RegistryHelper.getRegistryName(output.getItem()), "reliquary.potion.magazine", CraftingBookCategory.MISC, 3, 3, inputs, output)); + ShapedRecipePattern pattern = new ShapedRecipePattern(3, 3, inputs, Optional.empty()); + + recipes.add(new RecipeHolder<>(RegistryHelper.getRegistryName(output.getItem()), new ShapedRecipe("reliquary.potion.magazine", CraftingBookCategory.MISC, pattern, output))); } } diff --git a/src/main/java/reliquary/compat/tconstruct/TConstructCompat.java b/src/main/java/reliquary/compat/tconstruct/TConstructCompat.java index 85352714..92a1a0c1 100644 --- a/src/main/java/reliquary/compat/tconstruct/TConstructCompat.java +++ b/src/main/java/reliquary/compat/tconstruct/TConstructCompat.java @@ -1,7 +1,13 @@ package reliquary.compat.tconstruct; +import net.neoforged.bus.api.IEventBus; + public class TConstructCompat { - public void setup() { + public TConstructCompat(IEventBus iEventBus) { + + } + + public void setup() { /* PedestalRegistry.registerItemWrapper(SwordTool.class, PedestalMeleeWeaponWrapper::new); PedestalRegistry.registerItemWrapper(ScytheTool.class, PedestalMeleeWeaponWrapper::new); diff --git a/src/main/java/reliquary/crafting/AlkahestryChargingRecipe.java b/src/main/java/reliquary/crafting/AlkahestryChargingRecipe.java index 47cbce70..41e48659 100644 --- a/src/main/java/reliquary/crafting/AlkahestryChargingRecipe.java +++ b/src/main/java/reliquary/crafting/AlkahestryChargingRecipe.java @@ -1,12 +1,10 @@ package reliquary.crafting; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.core.NonNullList; import net.minecraft.core.RegistryAccess; import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.util.GsonHelper; import net.minecraft.world.inventory.CraftingContainer; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.CraftingBookCategory; @@ -14,21 +12,16 @@ import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.level.Level; -import net.minecraftforge.common.crafting.CraftingHelper; import reliquary.init.ModItems; import reliquary.items.AlkahestryTomeItem; -import javax.annotation.Nullable; - public class AlkahestryChargingRecipe implements CraftingRecipe { private final Ingredient chargingIngredient; private final int chargeToAdd; private final ItemStack recipeOutput; - private final ResourceLocation id; private final Ingredient tomeIngredient; - private AlkahestryChargingRecipe(ResourceLocation id, Ingredient chargingIngredient, int chargeToAdd) { - this.id = id; + public AlkahestryChargingRecipe(Ingredient chargingIngredient, int chargeToAdd) { this.chargingIngredient = chargingIngredient; this.chargeToAdd = chargeToAdd; tomeIngredient = Ingredient.of(AlkahestryTomeItem.setCharge(new ItemStack(ModItems.ALKAHESTRY_TOME.get()), 0)); @@ -108,11 +101,6 @@ public ItemStack getResultItem(RegistryAccess registryAccess) { return recipeOutput; } - @Override - public ResourceLocation getId() { - return id; - } - @Override public RecipeSerializer getSerializer() { return ModItems.ALKAHESTRY_CHARGING_SERIALIZER.get(); @@ -132,23 +120,21 @@ public CraftingBookCategory category() { } public static class Serializer implements RecipeSerializer { - @Override - public AlkahestryChargingRecipe fromJson(ResourceLocation recipeId, JsonObject json) { - if (!json.has("ingredient")) { - throw new JsonParseException("No ingredient for alkahestry charging recipe"); - } - - Ingredient ingredient = CraftingHelper.getIngredient(json.get("ingredient"), false); + private final Codec codec = RecordCodecBuilder.create( + instance -> instance.group( + Ingredient.CODEC_NONEMPTY.fieldOf("ingredient").forGetter(recipe -> recipe.chargingIngredient), + Codec.INT.fieldOf("charge").forGetter(recipe -> recipe.chargeToAdd) + ) + .apply(instance, AlkahestryChargingRecipe::new)); - int chargeToAdd = GsonHelper.getAsInt(json, "charge"); - - return new AlkahestryChargingRecipe(recipeId, ingredient, chargeToAdd); + @Override + public Codec codec() { + return codec; } - @Nullable @Override - public AlkahestryChargingRecipe fromNetwork(ResourceLocation recipeId, FriendlyByteBuf buffer) { - return new AlkahestryChargingRecipe(recipeId, Ingredient.fromNetwork(buffer), buffer.readInt()); + public AlkahestryChargingRecipe fromNetwork(FriendlyByteBuf pBuffer) { + return new AlkahestryChargingRecipe(Ingredient.fromNetwork(pBuffer), pBuffer.readInt()); } @Override diff --git a/src/main/java/reliquary/crafting/AlkahestryCraftingRecipe.java b/src/main/java/reliquary/crafting/AlkahestryCraftingRecipe.java index 3710f9a2..623a3031 100644 --- a/src/main/java/reliquary/crafting/AlkahestryCraftingRecipe.java +++ b/src/main/java/reliquary/crafting/AlkahestryCraftingRecipe.java @@ -1,12 +1,10 @@ package reliquary.crafting; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.core.NonNullList; import net.minecraft.core.RegistryAccess; import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.util.GsonHelper; import net.minecraft.world.inventory.CraftingContainer; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.CraftingBookCategory; @@ -14,26 +12,20 @@ import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.level.Level; -import net.minecraftforge.common.crafting.CraftingHelper; import reliquary.init.ModItems; import reliquary.items.AlkahestryTomeItem; -import reliquary.reference.Settings; - -import javax.annotation.Nullable; public class AlkahestryCraftingRecipe implements CraftingRecipe { private final Ingredient craftingIngredient; private final int chargeNeeded; private final int resultCount; private ItemStack result = ItemStack.EMPTY; - private final ResourceLocation id; private final Ingredient tomeIngredient; - private AlkahestryCraftingRecipe(ResourceLocation id, Ingredient craftingIngredient, int chargeNeeded, int resultCount) { - this.id = id; + public AlkahestryCraftingRecipe(Ingredient craftingIngredient, int chargeNeeded, int resultCount) { this.craftingIngredient = craftingIngredient; this.chargeNeeded = chargeNeeded; - tomeIngredient = Ingredient.of(AlkahestryTomeItem.setCharge(new ItemStack(ModItems.ALKAHESTRY_TOME.get()), Settings.COMMON.items.alkahestryTome.chargeLimit.get())); + tomeIngredient = Ingredient.of(AlkahestryTomeItem.setCharge(new ItemStack(ModItems.ALKAHESTRY_TOME.get()), AlkahestryTomeItem.getChargeLimit())); this.resultCount = resultCount; AlkahestryRecipeRegistry.registerCraftingRecipe(this); @@ -108,11 +100,6 @@ public ItemStack getResultItem(RegistryAccess registryAccess) { return getResult(); } - @Override - public ResourceLocation getId() { - return id; - } - @Override public RecipeSerializer getSerializer() { return ModItems.ALKAHESTRY_CRAFTING_SERIALIZER.get(); @@ -156,23 +143,22 @@ public CraftingBookCategory category() { } public static class Serializer implements RecipeSerializer { - @Override - public AlkahestryCraftingRecipe fromJson(ResourceLocation recipeId, JsonObject json) { - if (!json.has("ingredient")) { - throw new JsonParseException("No ingredient for alkahestry crafting recipe"); - } + private final Codec codec = RecordCodecBuilder.create( + instance -> instance.group( + Ingredient.CODEC_NONEMPTY.fieldOf("ingredient").forGetter(recipe -> recipe.craftingIngredient), + Codec.INT.fieldOf("charge").forGetter(recipe -> recipe.chargeNeeded), + Codec.INT.fieldOf("result_count").forGetter(recipe -> recipe.resultCount) + ) + .apply(instance, AlkahestryCraftingRecipe::new)); - Ingredient ingredient = CraftingHelper.getIngredient(json.get("ingredient"), false); - int resultCount = GsonHelper.getAsInt(json, "result_count"); - int chargeNeeded = GsonHelper.getAsInt(json, "charge"); - - return new AlkahestryCraftingRecipe(recipeId, ingredient, chargeNeeded, resultCount); + @Override + public Codec codec() { + return codec; } - @Nullable @Override - public AlkahestryCraftingRecipe fromNetwork(ResourceLocation recipeId, FriendlyByteBuf buffer) { - return new AlkahestryCraftingRecipe(recipeId, Ingredient.fromNetwork(buffer), buffer.readInt(), buffer.readInt()); + public AlkahestryCraftingRecipe fromNetwork(FriendlyByteBuf buffer) { + return new AlkahestryCraftingRecipe(Ingredient.fromNetwork(buffer), buffer.readInt(), buffer.readInt()); } @Override diff --git a/src/main/java/reliquary/crafting/AlkahestryDrainRecipe.java b/src/main/java/reliquary/crafting/AlkahestryDrainRecipe.java index 8e8915c0..cd8b7851 100644 --- a/src/main/java/reliquary/crafting/AlkahestryDrainRecipe.java +++ b/src/main/java/reliquary/crafting/AlkahestryDrainRecipe.java @@ -1,11 +1,10 @@ package reliquary.crafting; -import com.google.gson.JsonObject; +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.core.NonNullList; import net.minecraft.core.RegistryAccess; import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.util.GsonHelper; import net.minecraft.world.inventory.CraftingContainer; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.CraftingBookCategory; @@ -13,24 +12,18 @@ import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.level.Level; -import net.minecraftforge.common.crafting.CraftingHelper; import reliquary.init.ModItems; import reliquary.items.AlkahestryTomeItem; -import reliquary.reference.Settings; - -import javax.annotation.Nullable; public class AlkahestryDrainRecipe implements CraftingRecipe { private final int chargeToDrain; private final ItemStack result; - private final ResourceLocation id; private final Ingredient tomeIngredient; - private AlkahestryDrainRecipe(ResourceLocation id, int chargeToDrain, ItemStack result) { + public AlkahestryDrainRecipe(int chargeToDrain, ItemStack result) { this.chargeToDrain = chargeToDrain; this.result = result; - this.id = id; - tomeIngredient = Ingredient.of(AlkahestryTomeItem.setCharge(new ItemStack(ModItems.ALKAHESTRY_TOME.get()), Settings.COMMON.items.alkahestryTome.chargeLimit.get())); + tomeIngredient = Ingredient.of(AlkahestryTomeItem.setCharge(new ItemStack(ModItems.ALKAHESTRY_TOME.get()), AlkahestryTomeItem.getChargeLimit())); AlkahestryRecipeRegistry.setDrainRecipe(this); } @@ -96,11 +89,6 @@ public ItemStack getResultItem(RegistryAccess registryAccess) { return result; } - @Override - public ResourceLocation getId() { - return id; - } - @Override public NonNullList getRemainingItems(CraftingContainer inv) { NonNullList ret = CraftingRecipe.super.getRemainingItems(inv); @@ -129,18 +117,21 @@ public CraftingBookCategory category() { } public static class Serializer implements RecipeSerializer { - @Override - public AlkahestryDrainRecipe fromJson(ResourceLocation recipeId, JsonObject json) { - int chargeToDrain = GsonHelper.getAsInt(json, "charge"); - ItemStack result = CraftingHelper.getItemStack(GsonHelper.getAsJsonObject(json, "result"), true); + private final Codec codec = RecordCodecBuilder.create( + instance -> instance.group( + Codec.INT.fieldOf("charge").forGetter(recipe -> recipe.chargeToDrain), + ItemStack.CODEC.fieldOf("result").forGetter(recipe -> recipe.result) + ) + .apply(instance, AlkahestryDrainRecipe::new)); - return new AlkahestryDrainRecipe(recipeId, chargeToDrain, result); + @Override + public Codec codec() { + return codec; } - @Nullable @Override - public AlkahestryDrainRecipe fromNetwork(ResourceLocation recipeId, FriendlyByteBuf buffer) { - return new AlkahestryDrainRecipe(recipeId, buffer.readInt(), buffer.readItem()); + public AlkahestryDrainRecipe fromNetwork(FriendlyByteBuf buffer) { + return new AlkahestryDrainRecipe(buffer.readInt(), buffer.readItem()); } @Override diff --git a/src/main/java/reliquary/crafting/AlkahestryRecipeRegistry.java b/src/main/java/reliquary/crafting/AlkahestryRecipeRegistry.java index 51e833fc..7ee39644 100644 --- a/src/main/java/reliquary/crafting/AlkahestryRecipeRegistry.java +++ b/src/main/java/reliquary/crafting/AlkahestryRecipeRegistry.java @@ -1,6 +1,6 @@ package reliquary.crafting; -import net.minecraftforge.event.AddReloadListenerEvent; +import net.neoforged.neoforge.event.AddReloadListenerEvent; import javax.annotation.Nullable; import java.util.ArrayList; diff --git a/src/main/java/reliquary/crafting/FragmentRecipeHelper.java b/src/main/java/reliquary/crafting/FragmentRecipeHelper.java index d56beb8e..2ac40f3a 100644 --- a/src/main/java/reliquary/crafting/FragmentRecipeHelper.java +++ b/src/main/java/reliquary/crafting/FragmentRecipeHelper.java @@ -1,20 +1,20 @@ package reliquary.crafting; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.inventory.CraftingContainer; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.item.SpawnEggItem; -import net.minecraftforge.common.ForgeSpawnEggItem; -import net.minecraftforge.registries.ForgeRegistries; import reliquary.init.ModItems; import reliquary.items.MobCharmFragmentItem; import java.util.Optional; public class FragmentRecipeHelper { - private FragmentRecipeHelper() {} + private FragmentRecipeHelper() { + } public static final Item FALL_BACK_SPAWN_EGG = Items.CHICKEN_SPAWN_EGG; @@ -49,7 +49,7 @@ public static Optional getRegistryName(CraftingContainer inv) { } public static ItemStack getSpawnEggStack(String regName) { - SpawnEggItem spawnEggItem = ForgeSpawnEggItem.fromEntityType(ForgeRegistries.ENTITY_TYPES.getValue(new ResourceLocation(regName))); + SpawnEggItem spawnEggItem = SpawnEggItem.byId(BuiltInRegistries.ENTITY_TYPE.get(new ResourceLocation(regName))); return new ItemStack(spawnEggItem == null ? FALL_BACK_SPAWN_EGG : spawnEggItem); } } diff --git a/src/main/java/reliquary/crafting/FragmentToSpawnEggRecipe.java b/src/main/java/reliquary/crafting/FragmentToSpawnEggRecipe.java index b312106b..1443fa0b 100644 --- a/src/main/java/reliquary/crafting/FragmentToSpawnEggRecipe.java +++ b/src/main/java/reliquary/crafting/FragmentToSpawnEggRecipe.java @@ -1,9 +1,8 @@ package reliquary.crafting; -import com.google.gson.JsonObject; +import com.mojang.serialization.Codec; import net.minecraft.core.RegistryAccess; import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.inventory.CraftingContainer; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.CraftingBookCategory; @@ -11,14 +10,12 @@ import net.minecraft.world.item.crafting.ShapelessRecipe; import net.minecraft.world.level.Level; -import javax.annotation.Nullable; - public class FragmentToSpawnEggRecipe extends ShapelessRecipe { public static final Serializer SERIALIZER = new Serializer(); private final ShapelessRecipe recipeDelegate; public FragmentToSpawnEggRecipe(ShapelessRecipe recipeDelegate) { - super(recipeDelegate.getId(), recipeDelegate.getGroup(), CraftingBookCategory.MISC, recipeDelegate.result, recipeDelegate.getIngredients()); + super(recipeDelegate.getGroup(), CraftingBookCategory.MISC, recipeDelegate.result, recipeDelegate.getIngredients()); this.recipeDelegate = recipeDelegate; } @@ -39,17 +36,16 @@ public boolean isSpecial() { } public static class Serializer implements RecipeSerializer { + private final Codec codec = RecipeSerializer.SHAPELESS_RECIPE.codec().xmap(FragmentToSpawnEggRecipe::new, recipe -> recipe.recipeDelegate); @Override - public FragmentToSpawnEggRecipe fromJson(ResourceLocation recipeId, JsonObject json) { - return new FragmentToSpawnEggRecipe(RecipeSerializer.SHAPELESS_RECIPE.fromJson(recipeId, json)); + public Codec codec() { + return codec; } - @Nullable @Override - public FragmentToSpawnEggRecipe fromNetwork(ResourceLocation recipeId, FriendlyByteBuf buffer) { - //noinspection ConstantConditions - shapeless crafting recipe serializer always returns an instance here so no need to check for null - return new FragmentToSpawnEggRecipe(RecipeSerializer.SHAPELESS_RECIPE.fromNetwork(recipeId, buffer)); + public FragmentToSpawnEggRecipe fromNetwork(FriendlyByteBuf buffer) { + return new FragmentToSpawnEggRecipe(RecipeSerializer.SHAPELESS_RECIPE.fromNetwork(buffer)); } @Override diff --git a/src/main/java/reliquary/crafting/MobCharmRecipe.java b/src/main/java/reliquary/crafting/MobCharmRecipe.java index ed2a6b3e..f3298c05 100644 --- a/src/main/java/reliquary/crafting/MobCharmRecipe.java +++ b/src/main/java/reliquary/crafting/MobCharmRecipe.java @@ -1,9 +1,8 @@ package reliquary.crafting; -import com.google.gson.JsonObject; +import com.mojang.serialization.Codec; import net.minecraft.core.RegistryAccess; import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.inventory.CraftingContainer; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.CraftingBookCategory; @@ -13,7 +12,6 @@ import reliquary.init.ModItems; import reliquary.items.MobCharmItem; -import javax.annotation.Nullable; import java.util.HashSet; import java.util.Set; @@ -23,7 +21,7 @@ public class MobCharmRecipe extends ShapedRecipe { private final ShapedRecipe compose; public MobCharmRecipe(ShapedRecipe compose) { - super(compose.getId(), compose.getGroup(), CraftingBookCategory.MISC, compose.getRecipeWidth(), compose.getRecipeHeight(), compose.getIngredients(), compose.result); + super(compose.getGroup(), CraftingBookCategory.MISC, compose.pattern, compose.result); this.compose = compose; REGISTERED_RECIPES.add(this); } @@ -55,16 +53,16 @@ public RecipeSerializer getSerializer() { } public static class Serializer implements RecipeSerializer { + private final Codec codec = RecipeSerializer.SHAPED_RECIPE.codec().xmap(MobCharmRecipe::new, recipe -> recipe.compose); + @Override - public MobCharmRecipe fromJson(ResourceLocation recipeId, JsonObject json) { - return new MobCharmRecipe(RecipeSerializer.SHAPED_RECIPE.fromJson(recipeId, json)); + public Codec codec() { + return codec; } - @Nullable @Override - public MobCharmRecipe fromNetwork(ResourceLocation recipeId, FriendlyByteBuf buffer) { - //noinspection ConstantConditions - shaped recipe serializer always returns an instance of recipe despite RecipeSerializer's null allowing contract - return new MobCharmRecipe(RecipeSerializer.SHAPED_RECIPE.fromNetwork(recipeId, buffer)); + public MobCharmRecipe fromNetwork(FriendlyByteBuf buffer) { + return new MobCharmRecipe(RecipeSerializer.SHAPED_RECIPE.fromNetwork(buffer)); } @Override diff --git a/src/main/java/reliquary/crafting/MobCharmRecipeBuilder.java b/src/main/java/reliquary/crafting/MobCharmRecipeBuilder.java index 34983d3a..3713a221 100644 --- a/src/main/java/reliquary/crafting/MobCharmRecipeBuilder.java +++ b/src/main/java/reliquary/crafting/MobCharmRecipeBuilder.java @@ -2,74 +2,71 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import com.google.common.collect.Sets; -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; import net.minecraft.advancements.Advancement; +import net.minecraft.advancements.AdvancementRequirements; import net.minecraft.advancements.AdvancementRewards; -import net.minecraft.advancements.CriterionTriggerInstance; -import net.minecraft.advancements.RequirementsStrategy; +import net.minecraft.advancements.Criterion; import net.minecraft.advancements.critereon.RecipeUnlockedTrigger; -import net.minecraft.data.recipes.FinishedRecipe; +import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.TagKey; import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.CraftingBookCategory; import net.minecraft.world.item.crafting.Ingredient; -import net.minecraft.world.item.crafting.RecipeSerializer; +import net.minecraft.world.item.crafting.ShapedRecipe; +import net.minecraft.world.item.crafting.ShapedRecipePattern; import net.minecraft.world.level.ItemLike; import reliquary.init.ModItems; import reliquary.reference.Reference; -import reliquary.util.RegistryHelper; -import javax.annotation.Nullable; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.function.Consumer; public class MobCharmRecipeBuilder { - private final List pattern = Lists.newArrayList(); + private final List rows = Lists.newArrayList(); private final Map key = Maps.newLinkedHashMap(); - private final Advancement.Builder advancementBuilder = Advancement.Builder.advancement(); + private final Map> criteria = new LinkedHashMap<>(); private String group; - private MobCharmRecipeBuilder() {} + private MobCharmRecipeBuilder() { + } public static MobCharmRecipeBuilder charmRecipe() { return new MobCharmRecipeBuilder(); } - public MobCharmRecipeBuilder key(Character symbol, TagKey tagIn) { - return key(symbol, Ingredient.of(tagIn)); + public MobCharmRecipeBuilder define(Character pSymbol, TagKey pTag) { + return define(pSymbol, Ingredient.of(pTag)); } - public MobCharmRecipeBuilder key(Character symbol, ItemLike itemIn) { - return key(symbol, Ingredient.of(itemIn)); + public MobCharmRecipeBuilder define(Character pSymbol, ItemLike pItem) { + return define(pSymbol, Ingredient.of(pItem)); } - public MobCharmRecipeBuilder key(Character symbol, Ingredient ingredientIn) { - if (key.containsKey(symbol)) { - throw new IllegalArgumentException("Symbol '" + symbol + "' is already defined!"); - } else if (symbol == ' ') { + public MobCharmRecipeBuilder define(Character pSymbol, Ingredient pIngredient) { + if (key.containsKey(pSymbol)) { + throw new IllegalArgumentException("Symbol '" + pSymbol + "' is already defined!"); + } else if (pSymbol == ' ') { throw new IllegalArgumentException("Symbol ' ' (whitespace) is reserved and cannot be defined"); } else { - key.put(symbol, ingredientIn); + key.put(pSymbol, pIngredient); return this; } } - public MobCharmRecipeBuilder patternLine(String patternIn) { - if (!pattern.isEmpty() && patternIn.length() != pattern.get(0).length()) { + public MobCharmRecipeBuilder pattern(String pPattern) { + if (!rows.isEmpty() && pPattern.length() != rows.get(0).length()) { throw new IllegalArgumentException("Pattern must be the same width on every line!"); } else { - pattern.add(patternIn); + rows.add(pPattern); return this; } } - public MobCharmRecipeBuilder addCriterion(String name, CriterionTriggerInstance criterionIn) { - advancementBuilder.addCriterion(name, criterionIn); + public MobCharmRecipeBuilder unlockedBy(String pName, Criterion pCriterion) { + criteria.put(pName, pCriterion); return this; } @@ -78,98 +75,21 @@ public MobCharmRecipeBuilder setGroup(String groupIn) { return this; } - public void build(Consumer consumerIn) { + public void save(RecipeOutput recipeOutput) { ResourceLocation id = new ResourceLocation(Reference.MOD_ID, "mob_charm"); - validate(id); - advancementBuilder.parent(new ResourceLocation("recipes/root")).addCriterion("has_the_recipe", RecipeUnlockedTrigger.unlocked(id)).rewards(AdvancementRewards.Builder.recipe(id)).requirements(RequirementsStrategy.OR); - consumerIn.accept(new Result(id, group == null ? "" : group, pattern, key, advancementBuilder, new ResourceLocation(id.getNamespace(), "recipes/" + id.getPath()))); + Advancement.Builder advancementBuilder = recipeOutput.advancement() + .addCriterion("has_the_recipe", RecipeUnlockedTrigger.unlocked(id)) + .rewards(AdvancementRewards.Builder.recipe(id)) + .requirements(AdvancementRequirements.Strategy.OR); + criteria.forEach(advancementBuilder::addCriterion); + recipeOutput.accept(id, new MobCharmRecipe(new ShapedRecipe(group == null ? "" : group, CraftingBookCategory.MISC, ensureValid(id), new ItemStack(ModItems.MOB_CHARM.get()))), null); } - private void validate(ResourceLocation id) { - if (pattern.isEmpty()) { - throw new IllegalStateException("No pattern is defined for shaped recipe " + id + "!"); + private ShapedRecipePattern ensureValid(ResourceLocation id) { + if (criteria.isEmpty()) { + throw new IllegalStateException("No way of obtaining recipe " + id); } else { - Set set = Sets.newHashSet(key.keySet()); - set.remove(' '); - - for (String s : pattern) { - for (int i = 0; i < s.length(); ++i) { - char c0 = s.charAt(i); - if (!key.containsKey(c0) && c0 != ' ') { - throw new IllegalStateException("Pattern in recipe " + id + " uses undefined symbol '" + c0 + "'"); - } - - set.remove(c0); - } - } - - if (!set.isEmpty()) { - throw new IllegalStateException("Ingredients are defined but not used in pattern for recipe " + id); - } else if (pattern.size() == 1 && pattern.get(0).length() == 1) { - throw new IllegalStateException("Shaped recipe " + id + " only takes in a single item - should it be a shapeless recipe instead?"); - } else if (advancementBuilder.getCriteria().isEmpty()) { - throw new IllegalStateException("No way of obtaining recipe " + id); - } - } - } - - public static class Result implements FinishedRecipe { - private final ResourceLocation id; - private final String group; - private final List pattern; - private final Map key; - private final Advancement.Builder advancementBuilder; - private final ResourceLocation advancementId; - - public Result(ResourceLocation idIn, String groupIn, List patternIn, Map keyIn, Advancement.Builder advancementBuilderIn, ResourceLocation advancementIdIn) { - id = idIn; - group = groupIn; - pattern = patternIn; - key = keyIn; - advancementBuilder = advancementBuilderIn; - advancementId = advancementIdIn; - } - - public void serializeRecipeData(JsonObject json) { - if (!group.isEmpty()) { - json.addProperty("group", group); - } - - JsonArray jsonarray = new JsonArray(); - - for (String s : pattern) { - jsonarray.add(s); - } - - json.add("pattern", jsonarray); - JsonObject jsonobject = new JsonObject(); - - for (Entry entry : key.entrySet()) { - jsonobject.add(String.valueOf(entry.getKey()), entry.getValue().toJson()); - } - - json.add("key", jsonobject); - JsonObject jsonobject1 = new JsonObject(); - jsonobject1.addProperty("item", RegistryHelper.getRegistryName(ModItems.MOB_CHARM.get()).toString()); - json.add("result", jsonobject1); - } - - public RecipeSerializer getType() { - return ModItems.MOB_CHARM_RECIPE_SERIALIZER.get(); - } - - public ResourceLocation getId() { - return id; - } - - @Nullable - public JsonObject serializeAdvancement() { - return advancementBuilder.serializeToJson(); - } - - @Nullable - public ResourceLocation getAdvancementId() { - return advancementId; + return ShapedRecipePattern.of(key, rows); } } } diff --git a/src/main/java/reliquary/crafting/MobCharmRepairRecipe.java b/src/main/java/reliquary/crafting/MobCharmRepairRecipe.java index ea76a3b3..0e335124 100644 --- a/src/main/java/reliquary/crafting/MobCharmRepairRecipe.java +++ b/src/main/java/reliquary/crafting/MobCharmRepairRecipe.java @@ -2,7 +2,6 @@ import net.minecraft.core.NonNullList; import net.minecraft.core.RegistryAccess; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.inventory.CraftingContainer; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.CraftingBookCategory; @@ -12,15 +11,15 @@ import reliquary.init.ModItems; import reliquary.items.MobCharmDefinition; import reliquary.items.MobCharmRegistry; -import reliquary.reference.Settings; +import reliquary.reference.Config; import java.util.Optional; public class MobCharmRepairRecipe extends CustomRecipe { private static final int PER_FRAGMENT_MULTIPLIER = 6; - public MobCharmRepairRecipe(ResourceLocation registryName, CraftingBookCategory category) { - super(registryName, category); + public MobCharmRepairRecipe(CraftingBookCategory category) { + super(category); } @Override @@ -63,7 +62,7 @@ public boolean matches(CraftingContainer inv, Level worldIn) { MobCharmDefinition charmDefinition = cd.get(); int repairMultiplier = charmDefinition.isDynamicallyCreated() ? PER_FRAGMENT_MULTIPLIER : 1; - int durabilityRepaired = Settings.COMMON.items.mobCharm.dropDurabilityRepair.get() * repairMultiplier; + int durabilityRepaired = Config.COMMON.items.mobCharm.dropDurabilityRepair.get() * repairMultiplier; return mobCharm.getDamageValue() >= durabilityRepaired * (numberIngredients - 1) && charmDefinition.isRepairItem(finalIngredient); } @@ -89,7 +88,7 @@ public ItemStack assemble(CraftingContainer inv, RegistryAccess registryAccess) ItemStack resultingMobCharm = mobCharm.copy(); - resultingMobCharm.setDamageValue(Math.max(resultingMobCharm.getDamageValue() - (Settings.COMMON.items.mobCharm.dropDurabilityRepair.get() * numberIngredients), 0)); + resultingMobCharm.setDamageValue(Math.max(resultingMobCharm.getDamageValue() - (Config.COMMON.items.mobCharm.dropDurabilityRepair.get() * numberIngredients), 0)); return resultingMobCharm; } diff --git a/src/main/java/reliquary/crafting/NbtShapedRecipeBuilder.java b/src/main/java/reliquary/crafting/NbtShapedRecipeBuilder.java index f1bd7210..7049a785 100644 --- a/src/main/java/reliquary/crafting/NbtShapedRecipeBuilder.java +++ b/src/main/java/reliquary/crafting/NbtShapedRecipeBuilder.java @@ -1,3 +1,4 @@ +/* package reliquary.crafting; import com.google.common.collect.Lists; @@ -28,7 +29,7 @@ import java.util.Set; import java.util.function.Consumer; -public class NbtShapedRecipeBuilder { +public class NbtShapedRecipeBuilder { shouldn't be necessary anymore' private final Item result; private final int count; private final List pattern = Lists.newArrayList(); @@ -221,3 +222,4 @@ public ResourceLocation getAdvancementId() { } } } +*/ diff --git a/src/main/java/reliquary/crafting/PotionEffectsRecipe.java b/src/main/java/reliquary/crafting/PotionEffectsRecipe.java index dd2359d6..a1c6baa3 100644 --- a/src/main/java/reliquary/crafting/PotionEffectsRecipe.java +++ b/src/main/java/reliquary/crafting/PotionEffectsRecipe.java @@ -1,41 +1,40 @@ package reliquary.crafting; -import com.google.gson.JsonObject; +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.core.NonNullList; import net.minecraft.core.RegistryAccess; import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.util.GsonHelper; +import net.minecraft.util.ExtraCodecs; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.inventory.CraftingContainer; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.crafting.CraftingBookCategory; -import net.minecraft.world.item.crafting.CraftingRecipe; -import net.minecraft.world.item.crafting.Ingredient; -import net.minecraft.world.item.crafting.RecipeSerializer; -import net.minecraft.world.item.crafting.ShapedRecipe; +import net.minecraft.world.item.crafting.*; import net.minecraft.world.level.Level; import reliquary.init.ModItems; import reliquary.items.util.IPotionItem; import reliquary.util.potions.XRPotionHelper; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; import java.util.Optional; public class PotionEffectsRecipe implements CraftingRecipe { - private final ShapedRecipe compose; + private final ShapedRecipePattern pattern; + private final ItemStack result; + private final String group; private final float potionDurationFactor; - private PotionEffectsRecipe(ShapedRecipe compose, float potionDurationFactor) { - this.compose = compose; + public PotionEffectsRecipe(String group, ShapedRecipePattern pattern, ItemStack result, float potionDurationFactor) { + this.group = group; + this.pattern = pattern; + this.result = result; this.potionDurationFactor = potionDurationFactor; } @Override public ItemStack assemble(CraftingContainer inv, RegistryAccess registryAccess) { - ItemStack newOutput = compose.getResultItem(registryAccess).copy(); + ItemStack newOutput = result.copy(); findMatchAndUpdateEffects(inv).ifPresent(targetEffects -> XRPotionHelper.addPotionEffectsToStack(newOutput, targetEffects)); @@ -44,13 +43,13 @@ public ItemStack assemble(CraftingContainer inv, RegistryAccess registryAccess) @Override public boolean canCraftInDimensions(int width, int height) { - return width >= compose.getRecipeWidth() && height >= compose.getRecipeHeight(); + return width >= pattern.width() && height >= pattern.height(); } private Optional> findMatchAndUpdateEffects(CraftingContainer inv) { List targetEffects; - for (int startX = 0; startX <= inv.getWidth() - compose.getRecipeWidth(); startX++) { - for (int startY = 0; startY <= inv.getHeight() - compose.getRecipeHeight(); ++startY) { + for (int startX = 0; startX <= inv.getWidth() - pattern.width(); startX++) { + for (int startY = 0; startY <= inv.getHeight() - pattern.height(); ++startY) { targetEffects = new ArrayList<>(); if (checkMatchAndUpdateEffects(inv, targetEffects, startX, startY, false)) { return Optional.of(targetEffects); @@ -65,8 +64,8 @@ private Optional> findMatchAndUpdateEffects(CraftingCont } private boolean checkMatchAndUpdateEffects(CraftingContainer inv, List targetEffects, int startX, int startY, boolean mirror) { - for (int x = 0; x < compose.getRecipeWidth(); x++) { - for (int y = 0; y < compose.getRecipeHeight(); y++) { + for (int x = 0; x < pattern.width(); x++) { + for (int y = 0; y < pattern.height(); y++) { int subX = x - startX; int subY = y - startY; @@ -84,8 +83,8 @@ private boolean checkMatchAndUpdateEffects(CraftingContainer inv, List getIngredients() { - return compose.getIngredients(); - } - - @Override - public ResourceLocation getId() { - return compose.getId(); + return pattern.ingredients(); } private Ingredient getTarget(int subX, int subY, boolean mirror) { - if (subX >= 0 && subY >= 0 && subX < compose.getRecipeWidth() && subY < compose.getRecipeHeight()) { + if (subX >= 0 && subY >= 0 && subX < pattern.width() && subY < pattern.height()) { if (mirror) { - return compose.getIngredients().get(compose.getRecipeWidth() - subX - 1 + subY * compose.getRecipeWidth()); + return pattern.ingredients().get(pattern.width() - subX - 1 + subY * pattern.width()); } else { - return compose.getIngredients().get(subX + subY * compose.getRecipeWidth()); + return pattern.ingredients().get(subX + subY * pattern.width()); } } return Ingredient.EMPTY; @@ -179,21 +173,30 @@ public CraftingBookCategory category() { } public static class Serializer implements RecipeSerializer { + private final Codec codec = RecordCodecBuilder.create( + instance -> instance.group( + ExtraCodecs.strictOptionalField(Codec.STRING, "group", "").forGetter(recipe -> recipe.group), + ShapedRecipePattern.MAP_CODEC.forGetter(recipe -> recipe.pattern), + ItemStack.ITEM_WITH_COUNT_CODEC.fieldOf("result").forGetter(recipe -> recipe.result), + Codec.FLOAT.fieldOf("duration_factor").forGetter(recipe -> recipe.potionDurationFactor) + ) + .apply(instance, PotionEffectsRecipe::new)); + @Override - public PotionEffectsRecipe fromJson(ResourceLocation recipeId, JsonObject json) { - return new PotionEffectsRecipe(RecipeSerializer.SHAPED_RECIPE.fromJson(recipeId, json), GsonHelper.getAsFloat(json, "duration_factor", 1.0f)); + public Codec codec() { + return codec; } - @Nullable @Override - public PotionEffectsRecipe fromNetwork(ResourceLocation recipeId, FriendlyByteBuf buffer) { - //noinspection ConstantConditions - shaped recipe serializer always returns an instance of recipe despite RecipeSerializer's null allowing contract - return new PotionEffectsRecipe(RecipeSerializer.SHAPED_RECIPE.fromNetwork(recipeId, buffer), buffer.readFloat()); + public PotionEffectsRecipe fromNetwork(FriendlyByteBuf buffer) { + return new PotionEffectsRecipe(buffer.readUtf(), ShapedRecipePattern.fromNetwork(buffer), buffer.readItem(), buffer.readFloat()); } @Override public void toNetwork(FriendlyByteBuf buffer, PotionEffectsRecipe recipe) { - RecipeSerializer.SHAPED_RECIPE.toNetwork(buffer, recipe.compose); + buffer.writeUtf(recipe.group); + recipe.pattern.toNetwork(buffer); + buffer.writeItem(recipe.result); buffer.writeFloat(recipe.potionDurationFactor); } } diff --git a/src/main/java/reliquary/crafting/PotionEffectsRecipeBuilder.java b/src/main/java/reliquary/crafting/PotionEffectsRecipeBuilder.java index a28f47ce..224ee306 100644 --- a/src/main/java/reliquary/crafting/PotionEffectsRecipeBuilder.java +++ b/src/main/java/reliquary/crafting/PotionEffectsRecipeBuilder.java @@ -1,33 +1,41 @@ package reliquary.crafting; -import com.google.gson.JsonObject; -import net.minecraft.advancements.CriterionTriggerInstance; -import net.minecraft.data.recipes.FinishedRecipe; -import net.minecraft.data.recipes.RecipeCategory; -import net.minecraft.data.recipes.ShapedRecipeBuilder; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +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.data.recipes.RecipeOutput; import net.minecraft.resources.ResourceLocation; 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.RecipeSerializer; +import net.minecraft.world.item.crafting.ShapedRecipePattern; import net.minecraft.world.level.ItemLike; -import net.minecraftforge.common.crafting.ConditionalRecipe; -import net.minecraftforge.common.crafting.conditions.ICondition; import reliquary.crafting.conditions.PotionsEnabledCondition; -import reliquary.init.ModItems; import javax.annotation.Nullable; -import java.util.ArrayList; +import java.util.LinkedHashMap; import java.util.List; -import java.util.function.Consumer; +import java.util.Map; +import java.util.Objects; public class PotionEffectsRecipeBuilder { - private final ShapedRecipeBuilder shapedRecipeBuilder; - private final List additionalConditions = new ArrayList<>(); + private final Item result; + private final int count; + private final List rows = Lists.newArrayList(); + private final Map key = Maps.newLinkedHashMap(); + private final Map> criteria = new LinkedHashMap<>(); + @Nullable + private String group; private final float durationFactor; - private PotionEffectsRecipeBuilder(ItemLike item, int count, float durationFactor) { - shapedRecipeBuilder = ShapedRecipeBuilder.shaped(RecipeCategory.MISC, item, count); + private PotionEffectsRecipeBuilder(ItemLike result, int count, float durationFactor) { + this.result = result.asItem(); + this.count = count; this.durationFactor = durationFactor; } @@ -35,79 +43,64 @@ public static PotionEffectsRecipeBuilder potionEffectsRecipe(ItemLike item, int return new PotionEffectsRecipeBuilder(item, count, durationFactor); } - public PotionEffectsRecipeBuilder addCondition(ICondition condition) { - additionalConditions.add(condition); - return this; + public PotionEffectsRecipeBuilder define(Character pSymbol, TagKey pTag) { + return define(pSymbol, Ingredient.of(pTag)); } - public PotionEffectsRecipeBuilder key(Character symbol, TagKey tagIn) { - return key(symbol, Ingredient.of(tagIn)); + public PotionEffectsRecipeBuilder define(Character pSymbol, ItemLike pItem) { + return define(pSymbol, Ingredient.of(pItem)); } - public PotionEffectsRecipeBuilder key(Character symbol, ItemLike itemIn) { - return key(symbol, Ingredient.of(itemIn)); + public PotionEffectsRecipeBuilder define(Character pSymbol, Ingredient pIngredient) { + if (key.containsKey(pSymbol)) { + throw new IllegalArgumentException("Symbol '" + pSymbol + "' is already defined!"); + } else if (pSymbol == ' ') { + throw new IllegalArgumentException("Symbol ' ' (whitespace) is reserved and cannot be defined"); + } else { + key.put(pSymbol, pIngredient); + return this; + } } - public PotionEffectsRecipeBuilder key(Character symbol, Ingredient ingredient) { - shapedRecipeBuilder.define(symbol, ingredient); + public PotionEffectsRecipeBuilder unlockedBy(String pName, Criterion pCriterion) { + criteria.put(pName, pCriterion); return this; } - public PotionEffectsRecipeBuilder patternLine(String pattern) { - shapedRecipeBuilder.pattern(pattern); - return this; + public PotionEffectsRecipeBuilder pattern(String pPattern) { + if (!rows.isEmpty() && pPattern.length() != rows.get(0).length()) { + throw new IllegalArgumentException("Pattern must be the same width on every line!"); + } else { + rows.add(pPattern); + return this; + } } - public PotionEffectsRecipeBuilder addCriterion(String name, CriterionTriggerInstance criterion) { - shapedRecipeBuilder.unlockedBy(name, criterion); + public PotionEffectsRecipeBuilder group(@Nullable String pGroupName) { + group = pGroupName; return this; } - public void build(Consumer consumer, ResourceLocation id) { - ConditionalRecipe.Builder builder = ConditionalRecipe.builder() - .addCondition(new PotionsEnabledCondition()); - additionalConditions.forEach(builder::addCondition); - shapedRecipeBuilder.save(shapedResult -> builder.addRecipe(conditionalConsumer -> conditionalConsumer.accept(new Result(id, shapedResult, durationFactor)))); - builder.build(consumer, id); + public void save(RecipeOutput recipeOutput, ResourceLocation id) { + Advancement.Builder advancementBuilder = recipeOutput.advancement() + .addCriterion("has_the_recipe", RecipeUnlockedTrigger.unlocked(id)) + .rewards(AdvancementRewards.Builder.recipe(id)) + .requirements(AdvancementRequirements.Strategy.OR); + criteria.forEach(advancementBuilder::addCriterion); + recipeOutput.withConditions(new PotionsEnabledCondition()).accept(id, + new PotionEffectsRecipe( + Objects.requireNonNullElse(group, ""), + ensureValid(id), + new ItemStack(result, count), + durationFactor + ), null); } - public static class Result implements FinishedRecipe { - private final ResourceLocation id; - private final FinishedRecipe shapedResult; - private final float durationFactor; - - public Result(ResourceLocation id, FinishedRecipe shapedResult, float durationFactor) { - this.id = id; - this.shapedResult = shapedResult; - this.durationFactor = durationFactor; - } - - @Override - public void serializeRecipeData(JsonObject json) { - shapedResult.serializeRecipeData(json); - json.addProperty("duration_factor", durationFactor); - } - - @Override - public ResourceLocation getId() { - return id; - } - - @Override - public RecipeSerializer getType() { - return ModItems.POTION_EFFECTS_SERIALIZER.get(); - } - - @Nullable - @Override - public JsonObject serializeAdvancement() { - return null; - } - - @Nullable - @Override - public ResourceLocation getAdvancementId() { - return null; + private ShapedRecipePattern ensureValid(ResourceLocation id) { + if (criteria.isEmpty()) { + throw new IllegalStateException("No way of obtaining recipe " + id); + } else { + return ShapedRecipePattern.of(key, rows); } } } diff --git a/src/main/java/reliquary/crafting/SpawnEggRecipeBuilder.java b/src/main/java/reliquary/crafting/SpawnEggRecipeBuilder.java index 699bf898..3fba9eb3 100644 --- a/src/main/java/reliquary/crafting/SpawnEggRecipeBuilder.java +++ b/src/main/java/reliquary/crafting/SpawnEggRecipeBuilder.java @@ -1,29 +1,29 @@ package reliquary.crafting; -import com.google.common.collect.Lists; -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; import net.minecraft.advancements.Advancement; +import net.minecraft.advancements.AdvancementRequirements; import net.minecraft.advancements.AdvancementRewards; -import net.minecraft.advancements.CriterionTriggerInstance; -import net.minecraft.advancements.RequirementsStrategy; +import net.minecraft.advancements.Criterion; import net.minecraft.advancements.critereon.RecipeUnlockedTrigger; -import net.minecraft.data.recipes.FinishedRecipe; +import net.minecraft.core.NonNullList; +import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; +import net.minecraft.world.item.crafting.CraftingBookCategory; import net.minecraft.world.item.crafting.Ingredient; -import net.minecraft.world.item.crafting.RecipeSerializer; +import net.minecraft.world.item.crafting.ShapelessRecipe; import net.minecraft.world.level.ItemLike; -import reliquary.init.ModItems; -import javax.annotation.Nullable; -import java.util.List; -import java.util.function.Consumer; +import java.util.LinkedHashMap; +import java.util.Map; public class SpawnEggRecipeBuilder { - private final List ingredients = Lists.newArrayList(); - private final Advancement.Builder advancementBuilder = Advancement.Builder.advancement(); + private final NonNullList ingredients = NonNullList.create(); + private final Map> criteria = new LinkedHashMap<>(); - private SpawnEggRecipeBuilder() {} + private SpawnEggRecipeBuilder() { + } public static SpawnEggRecipeBuilder spawnEggRecipe() { return new SpawnEggRecipeBuilder(); @@ -34,67 +34,24 @@ public SpawnEggRecipeBuilder addIngredient(ItemLike itemProvider) { return this; } - public SpawnEggRecipeBuilder addCriterion(String name, CriterionTriggerInstance criterionIn) { - advancementBuilder.addCriterion(name, criterionIn); + public SpawnEggRecipeBuilder unlockedBy(String name, Criterion criterionIn) { + criteria.put(name, criterionIn); return this; } - public void build(Consumer consumerIn, ResourceLocation id) { - if (advancementBuilder.getCriteria().isEmpty()) { - throw new IllegalStateException("No way of obtaining recipe " + id); - } - advancementBuilder.parent(new ResourceLocation("recipes/root")).addCriterion("has_the_recipe", RecipeUnlockedTrigger.unlocked(id)).rewards(AdvancementRewards.Builder.recipe(id)).requirements(RequirementsStrategy.OR); - consumerIn.accept(new Result(id, ingredients, advancementBuilder, new ResourceLocation(id.getNamespace(), "recipes/" + id.getPath()))); - + public void build(RecipeOutput recipeOutput, ResourceLocation id) { + ensureValid(id); + Advancement.Builder advancementBuilder = recipeOutput.advancement() + .addCriterion("has_the_recipe", RecipeUnlockedTrigger.unlocked(id)) + .rewards(AdvancementRewards.Builder.recipe(id)) + .requirements(AdvancementRequirements.Strategy.OR); + criteria.forEach(advancementBuilder::addCriterion); + recipeOutput.accept(id, new FragmentToSpawnEggRecipe(new ShapelessRecipe("", CraftingBookCategory.MISC, new ItemStack(Items.CHICKEN_SPAWN_EGG), ingredients)), advancementBuilder.build(id.withPrefix("recipes/"))); } - public static class Result implements FinishedRecipe { - private final List ingredients; - private final Advancement.Builder advancementBuilder; - private final ResourceLocation advancementId; - private final ResourceLocation id; - - public Result(ResourceLocation id, List ingredients, Advancement.Builder advancementBuilder, ResourceLocation advancementId) { - this.id = id; - this.ingredients = ingredients; - this.advancementBuilder = advancementBuilder; - this.advancementId = advancementId; - } - - @Override - public void serializeRecipeData(JsonObject json) { - JsonArray jsonarray = new JsonArray(); - - for (Ingredient ingredient : ingredients) { - jsonarray.add(ingredient.toJson()); - } - - json.add("ingredients", jsonarray); - JsonObject jsonobject = new JsonObject(); - jsonobject.addProperty("item", "minecraft:chicken_spawn_egg"); - json.add("result", jsonobject); - } - - @Override - public ResourceLocation getId() { - return id; - } - - @Override - public RecipeSerializer getType() { - return ModItems.FRAGMENT_TO_SPAWN_EGG_SERIALIZER.get(); - } - - @Nullable - @Override - public JsonObject serializeAdvancement() { - return advancementBuilder.serializeToJson(); - } - - @Nullable - @Override - public ResourceLocation getAdvancementId() { - return advancementId; + private void ensureValid(ResourceLocation pId) { + if (criteria.isEmpty()) { + throw new IllegalStateException("No way of obtaining recipe " + pId); } } } diff --git a/src/main/java/reliquary/crafting/alkahestry/ChargingRecipeBuilder.java b/src/main/java/reliquary/crafting/alkahestry/ChargingRecipeBuilder.java index 83c15b55..ce6aa447 100644 --- a/src/main/java/reliquary/crafting/alkahestry/ChargingRecipeBuilder.java +++ b/src/main/java/reliquary/crafting/alkahestry/ChargingRecipeBuilder.java @@ -1,19 +1,13 @@ package reliquary.crafting.alkahestry; -import com.google.gson.JsonObject; -import net.minecraft.data.recipes.FinishedRecipe; +import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.crafting.Ingredient; -import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.level.ItemLike; -import net.minecraftforge.common.crafting.ConditionalRecipe; +import reliquary.crafting.AlkahestryChargingRecipe; import reliquary.crafting.conditions.AlkahestryEnabledCondition; -import reliquary.init.ModItems; import reliquary.reference.Reference; -import javax.annotation.Nullable; -import java.util.function.Consumer; - public class ChargingRecipeBuilder { private final Ingredient ingredient; private final int charge; @@ -27,52 +21,9 @@ public static ChargingRecipeBuilder chargingRecipe(ItemLike result, int charge) return new ChargingRecipeBuilder(result, charge); } - public void build(Consumer consumer, ResourceLocation id) { + public void build(RecipeOutput recipeOutput, ResourceLocation id) { ResourceLocation fullId = new ResourceLocation(Reference.MOD_ID, "alkahestry/charging/" + id.getPath()); - ConditionalRecipe.builder() - .addCondition(new AlkahestryEnabledCondition()) - .addRecipe(conditionalConsumer -> conditionalConsumer.accept(new Result(fullId, ingredient, charge))) - .build(consumer, fullId); - } - - public static class Result implements FinishedRecipe { - private final Ingredient ingredient; - private final int charge; - private final ResourceLocation id; - - public Result(ResourceLocation id, Ingredient ingredient, int charge) { - this.id = id; - this.ingredient = ingredient; - this.charge = charge; - } - - @Override - public void serializeRecipeData(JsonObject json) { - json.addProperty("charge", charge); - json.add("ingredient", ingredient.toJson()); - } - - @Override - public ResourceLocation getId() { - return id; - } - - @Override - public RecipeSerializer getType() { - return ModItems.ALKAHESTRY_CHARGING_SERIALIZER.get(); - } - - @Nullable - @Override - public JsonObject serializeAdvancement() { - return null; - } - - @Nullable - @Override - public ResourceLocation getAdvancementId() { - return null; - } + recipeOutput.withConditions(new AlkahestryEnabledCondition()) + .accept(fullId, new AlkahestryChargingRecipe(ingredient, charge), null); } - } diff --git a/src/main/java/reliquary/crafting/alkahestry/CraftingRecipeBuilder.java b/src/main/java/reliquary/crafting/alkahestry/CraftingRecipeBuilder.java index cd46d1d2..76e6b587 100644 --- a/src/main/java/reliquary/crafting/alkahestry/CraftingRecipeBuilder.java +++ b/src/main/java/reliquary/crafting/alkahestry/CraftingRecipeBuilder.java @@ -1,32 +1,22 @@ package reliquary.crafting.alkahestry; -import com.google.gson.JsonObject; -import net.minecraft.data.recipes.FinishedRecipe; +import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.TagKey; import net.minecraft.world.item.Item; import net.minecraft.world.item.crafting.Ingredient; -import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.level.ItemLike; -import net.minecraftforge.common.crafting.ConditionalRecipe; -import net.minecraftforge.common.crafting.conditions.ICondition; +import reliquary.crafting.AlkahestryCraftingRecipe; import reliquary.crafting.conditions.AlkahestryEnabledCondition; -import reliquary.init.ModItems; import reliquary.reference.Reference; -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.List; -import java.util.function.Consumer; - public class CraftingRecipeBuilder { - private final Ingredient item; + private final Ingredient ingredient; private final int charge; private final int resultCount; - private final List additionalConditions = new ArrayList<>(); - private CraftingRecipeBuilder(Ingredient item, int charge, int resultCount) { - this.item = item; + private CraftingRecipeBuilder(Ingredient ingredient, int charge, int resultCount) { + this.ingredient = ingredient; this.charge = charge; this.resultCount = resultCount; } @@ -39,60 +29,9 @@ public static CraftingRecipeBuilder craftingRecipe(TagKey tag, int charge, return new CraftingRecipeBuilder(Ingredient.of(tag), charge, resultCount); } - public CraftingRecipeBuilder addCondition(ICondition condition) { - additionalConditions.add(condition); - return this; - } - - public void build(Consumer consumer, ResourceLocation id) { + public void save(RecipeOutput recipeOutput, ResourceLocation id) { ResourceLocation fullId = new ResourceLocation(Reference.MOD_ID, "alkahestry/crafting/" + id.getPath()); - ConditionalRecipe.Builder builder = ConditionalRecipe.builder() - .addCondition(new AlkahestryEnabledCondition()); - additionalConditions.forEach(builder::addCondition); - builder.addRecipe(conditionalConsumer -> conditionalConsumer.accept(new Result(fullId, item, charge, resultCount))); - builder.build(consumer, fullId); - } - - public static class Result implements FinishedRecipe { - private final Ingredient item; - private final int charge; - private final int resultCount; - private final ResourceLocation id; - - public Result(ResourceLocation id, Ingredient item, int charge, int resultCount) { - this.id = id; - this.item = item; - this.charge = charge; - this.resultCount = resultCount; - } - - @Override - public void serializeRecipeData(JsonObject json) { - json.addProperty("charge", charge); - json.add("ingredient", item.toJson()); - json.addProperty("result_count", resultCount); - } - - @Override - public ResourceLocation getId() { - return id; - } - - @Override - public RecipeSerializer getType() { - return ModItems.ALKAHESTRY_CRAFTING_SERIALIZER.get(); - } - - @Nullable - @Override - public JsonObject serializeAdvancement() { - return null; - } - - @Nullable - @Override - public ResourceLocation getAdvancementId() { - return null; - } + recipeOutput.withConditions(new AlkahestryEnabledCondition()) + .accept(fullId, new AlkahestryCraftingRecipe(ingredient, charge, resultCount), null); } } diff --git a/src/main/java/reliquary/crafting/alkahestry/DrainRecipeBuilder.java b/src/main/java/reliquary/crafting/alkahestry/DrainRecipeBuilder.java index 5622ba87..5becb3e0 100644 --- a/src/main/java/reliquary/crafting/alkahestry/DrainRecipeBuilder.java +++ b/src/main/java/reliquary/crafting/alkahestry/DrainRecipeBuilder.java @@ -1,19 +1,13 @@ package reliquary.crafting.alkahestry; -import com.google.gson.JsonObject; -import net.minecraft.data.recipes.FinishedRecipe; +import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; -import net.minecraft.world.item.crafting.RecipeSerializer; +import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.ItemLike; -import net.minecraftforge.common.crafting.ConditionalRecipe; +import reliquary.crafting.AlkahestryDrainRecipe; import reliquary.crafting.conditions.AlkahestryEnabledCondition; -import reliquary.init.ModItems; import reliquary.reference.Reference; -import reliquary.util.RegistryHelper; - -import javax.annotation.Nullable; -import java.util.function.Consumer; public class DrainRecipeBuilder { private final Item itemResult; @@ -28,53 +22,9 @@ public static DrainRecipeBuilder drainRecipe(ItemLike result, int charge) { return new DrainRecipeBuilder(result, charge); } - public void build(Consumer consumer, ResourceLocation id) { + public void build(RecipeOutput recipeOutput, ResourceLocation id) { ResourceLocation fullId = new ResourceLocation(Reference.MOD_ID, "alkahestry/drain/" + id.getPath()); - ConditionalRecipe.builder() - .addCondition(new AlkahestryEnabledCondition()) - .addRecipe(conditionalConsumer -> conditionalConsumer.accept(new DrainRecipeBuilder.Result(fullId, itemResult, charge))) - .build(consumer, fullId); - } - - public static class Result implements FinishedRecipe { - private final Item itemResult; - private final int charge; - private final ResourceLocation id; - - public Result(ResourceLocation id, Item itemResult, int charge) { - this.id = id; - this.itemResult = itemResult; - this.charge = charge; - } - - @Override - public void serializeRecipeData(JsonObject json) { - json.addProperty("charge", charge); - JsonObject resultObject = new JsonObject(); - resultObject.addProperty("item", RegistryHelper.getItemRegistryName(itemResult)); - json.add("result", resultObject); - } - - @Override - public ResourceLocation getId() { - return id; - } - - @Override - public RecipeSerializer getType() { - return ModItems.ALKAHESTRY_DRAIN_SERIALIZER.get(); - } - - @Nullable - @Override - public JsonObject serializeAdvancement() { - return null; - } - - @Nullable - @Override - public ResourceLocation getAdvancementId() { - return null; - } + recipeOutput.withConditions(new AlkahestryEnabledCondition()) + .accept(fullId, new AlkahestryDrainRecipe(charge, new ItemStack(itemResult)), null); } } diff --git a/src/main/java/reliquary/crafting/conditions/AlkahestryEnabledCondition.java b/src/main/java/reliquary/crafting/conditions/AlkahestryEnabledCondition.java index a41f621f..a463ef33 100644 --- a/src/main/java/reliquary/crafting/conditions/AlkahestryEnabledCondition.java +++ b/src/main/java/reliquary/crafting/conditions/AlkahestryEnabledCondition.java @@ -1,21 +1,26 @@ package reliquary.crafting.conditions; -import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.common.crafting.conditions.ICondition; -import reliquary.reference.Reference; -import reliquary.reference.Settings; +import com.mojang.serialization.Codec; +import com.mojang.serialization.MapCodec; +import net.neoforged.neoforge.common.conditions.ICondition; +import reliquary.reference.Config; public class AlkahestryEnabledCondition implements ICondition { - private static final ResourceLocation ID = new ResourceLocation(Reference.MOD_ID, "alkahestry_enabled"); - public static final SimpleConditionSerializer SERIALIZER = new SimpleConditionSerializer<>(ID, AlkahestryEnabledCondition::new); + private static final AlkahestryEnabledCondition INSTANCE = new AlkahestryEnabledCondition(); + public static final Codec CODEC = MapCodec.unit(INSTANCE).stable().codec(); @Override - public ResourceLocation getID() { - return ID; + public boolean test(IContext context) { + return !Config.COMMON.disable.disableAlkahestry.get(); } @Override - public boolean test(IContext context) { - return !Settings.COMMON.disable.disableAlkahestry.get(); + public Codec codec() { + return CODEC; + } + + @Override + public String toString() { + return "alkahestry_enabled"; } } diff --git a/src/main/java/reliquary/crafting/conditions/HandgunEnabledCondition.java b/src/main/java/reliquary/crafting/conditions/HandgunEnabledCondition.java index 16edc8d1..35ea05a5 100644 --- a/src/main/java/reliquary/crafting/conditions/HandgunEnabledCondition.java +++ b/src/main/java/reliquary/crafting/conditions/HandgunEnabledCondition.java @@ -1,21 +1,26 @@ package reliquary.crafting.conditions; -import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.common.crafting.conditions.ICondition; -import reliquary.reference.Reference; -import reliquary.reference.Settings; +import com.mojang.serialization.Codec; +import com.mojang.serialization.MapCodec; +import net.neoforged.neoforge.common.conditions.ICondition; +import reliquary.reference.Config; public class HandgunEnabledCondition implements ICondition { - private static final ResourceLocation ID = new ResourceLocation(Reference.MOD_ID, "handgun_enabled"); - public static final SimpleConditionSerializer SERIALIZER = new SimpleConditionSerializer<>(ID, HandgunEnabledCondition::new); + private static final HandgunEnabledCondition INSTANCE = new HandgunEnabledCondition(); + public static final Codec CODEC = MapCodec.unit(INSTANCE).stable().codec();; @Override - public ResourceLocation getID() { - return ID; + public boolean test(IContext context) { + return !Config.COMMON.disable.disableHandgun.get(); } @Override - public boolean test(IContext context) { - return !Settings.COMMON.disable.disableHandgun.get(); + public Codec codec() { + return CODEC; + } + + @Override + public String toString() { + return "handgun_enabled"; } } diff --git a/src/main/java/reliquary/crafting/conditions/MobDropsCraftableCondition.java b/src/main/java/reliquary/crafting/conditions/MobDropsCraftableCondition.java index 70b9307a..ad961934 100644 --- a/src/main/java/reliquary/crafting/conditions/MobDropsCraftableCondition.java +++ b/src/main/java/reliquary/crafting/conditions/MobDropsCraftableCondition.java @@ -1,21 +1,21 @@ package reliquary.crafting.conditions; -import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.common.crafting.conditions.ICondition; -import reliquary.reference.Reference; -import reliquary.reference.Settings; +import com.mojang.serialization.Codec; +import com.mojang.serialization.MapCodec; +import net.neoforged.neoforge.common.conditions.ICondition; +import reliquary.reference.Config; public class MobDropsCraftableCondition implements ICondition { - private static final ResourceLocation ID = new ResourceLocation(Reference.MOD_ID, "mob_drops_craftable"); - public static final SimpleConditionSerializer SERIALIZER = new SimpleConditionSerializer<>(ID, MobDropsCraftableCondition::new); + private static final MobDropsCraftableCondition INSTANCE = new MobDropsCraftableCondition(); + public static final Codec CODEC = MapCodec.unit(INSTANCE).stable().codec(); @Override - public ResourceLocation getID() { - return ID; + public boolean test(IContext context) { + return Config.COMMON.dropCraftingRecipesEnabled.get(); } @Override - public boolean test(IContext context) { - return Settings.COMMON.dropCraftingRecipesEnabled.get(); + public Codec codec() { + return CODEC; } } diff --git a/src/main/java/reliquary/crafting/conditions/PassivePedestalEnabledCondition.java b/src/main/java/reliquary/crafting/conditions/PassivePedestalEnabledCondition.java index 29d08b48..a0701226 100644 --- a/src/main/java/reliquary/crafting/conditions/PassivePedestalEnabledCondition.java +++ b/src/main/java/reliquary/crafting/conditions/PassivePedestalEnabledCondition.java @@ -1,21 +1,21 @@ package reliquary.crafting.conditions; -import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.common.crafting.conditions.ICondition; -import reliquary.reference.Reference; -import reliquary.reference.Settings; +import com.mojang.serialization.Codec; +import com.mojang.serialization.MapCodec; +import net.neoforged.neoforge.common.conditions.ICondition; +import reliquary.reference.Config; public class PassivePedestalEnabledCondition implements ICondition { - private static final ResourceLocation ID = new ResourceLocation(Reference.MOD_ID, "passive_pedestal_enabled"); - public static final SimpleConditionSerializer SERIALIZER = new SimpleConditionSerializer<>(ID, PassivePedestalEnabledCondition::new); + private static final PassivePedestalEnabledCondition INSTANCE = new PassivePedestalEnabledCondition(); + public static final Codec CODEC = MapCodec.unit(INSTANCE).stable().codec(); @Override - public ResourceLocation getID() { - return ID; + public boolean test(IContext context) { + return !Config.COMMON.disable.disablePassivePedestal.get(); } @Override - public boolean test(IContext context) { - return !Settings.COMMON.disable.disablePassivePedestal.get(); + public Codec codec() { + return CODEC; } } diff --git a/src/main/java/reliquary/crafting/conditions/PedestalEnabledCondition.java b/src/main/java/reliquary/crafting/conditions/PedestalEnabledCondition.java index 42cf7da4..62268115 100644 --- a/src/main/java/reliquary/crafting/conditions/PedestalEnabledCondition.java +++ b/src/main/java/reliquary/crafting/conditions/PedestalEnabledCondition.java @@ -1,21 +1,21 @@ package reliquary.crafting.conditions; -import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.common.crafting.conditions.ICondition; -import reliquary.reference.Reference; -import reliquary.reference.Settings; +import com.mojang.serialization.Codec; +import com.mojang.serialization.MapCodec; +import net.neoforged.neoforge.common.conditions.ICondition; +import reliquary.reference.Config; public class PedestalEnabledCondition implements ICondition { - private static final ResourceLocation ID = new ResourceLocation(Reference.MOD_ID, "pedestal_enabled"); - public static final SimpleConditionSerializer SERIALIZER = new SimpleConditionSerializer<>(ID, PedestalEnabledCondition::new); + private static final PedestalEnabledCondition INSTANCE = new PedestalEnabledCondition(); + public static final Codec CODEC = MapCodec.unit(INSTANCE).stable().codec(); @Override - public ResourceLocation getID() { - return ID; + public boolean test(IContext context) { + return !Config.COMMON.disable.disablePedestal.get(); } @Override - public boolean test(IContext context) { - return !Settings.COMMON.disable.disablePedestal.get(); + public Codec codec() { + return CODEC; } } diff --git a/src/main/java/reliquary/crafting/conditions/PotionsEnabledCondition.java b/src/main/java/reliquary/crafting/conditions/PotionsEnabledCondition.java index 0ee20dbb..17b923da 100644 --- a/src/main/java/reliquary/crafting/conditions/PotionsEnabledCondition.java +++ b/src/main/java/reliquary/crafting/conditions/PotionsEnabledCondition.java @@ -1,21 +1,21 @@ package reliquary.crafting.conditions; -import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.common.crafting.conditions.ICondition; -import reliquary.reference.Reference; -import reliquary.reference.Settings; +import com.mojang.serialization.Codec; +import com.mojang.serialization.MapCodec; +import net.neoforged.neoforge.common.conditions.ICondition; +import reliquary.reference.Config; public class PotionsEnabledCondition implements ICondition { - private static final ResourceLocation ID = new ResourceLocation(Reference.MOD_ID, "potions_enabled"); - public static final SimpleConditionSerializer SERIALIZER = new SimpleConditionSerializer<>(ID, PotionsEnabledCondition::new); + private static final PotionsEnabledCondition INSTANCE = new PotionsEnabledCondition(); + public static final Codec CODEC = MapCodec.unit(INSTANCE).stable().codec(); @Override - public ResourceLocation getID() { - return ID; + public boolean test(IContext context) { + return !Config.COMMON.disable.disablePotions.get(); } @Override - public boolean test(IContext context) { - return !Settings.COMMON.disable.disablePotions.get(); + public Codec codec() { + return CODEC; } } diff --git a/src/main/java/reliquary/crafting/conditions/SimpleConditionSerializer.java b/src/main/java/reliquary/crafting/conditions/SimpleConditionSerializer.java deleted file mode 100644 index d9272c59..00000000 --- a/src/main/java/reliquary/crafting/conditions/SimpleConditionSerializer.java +++ /dev/null @@ -1,33 +0,0 @@ -package reliquary.crafting.conditions; - -import com.google.gson.JsonObject; -import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.common.crafting.conditions.ICondition; -import net.minecraftforge.common.crafting.conditions.IConditionSerializer; - -import java.util.function.Supplier; - -public class SimpleConditionSerializer implements IConditionSerializer { - private final ResourceLocation id; - private final Supplier instantiate; - - public SimpleConditionSerializer(ResourceLocation id, Supplier instantiate) { - this.id = id; - this.instantiate = instantiate; - } - - @Override - public void write(JsonObject json, T value) { - //noop - } - - @Override - public T read(JsonObject json) { - return instantiate.get(); - } - - @Override - public ResourceLocation getID() { - return id; - } -} diff --git a/src/main/java/reliquary/crafting/conditions/SpawnEggEnabledCondition.java b/src/main/java/reliquary/crafting/conditions/SpawnEggEnabledCondition.java index dd61bfb0..61f5c05f 100644 --- a/src/main/java/reliquary/crafting/conditions/SpawnEggEnabledCondition.java +++ b/src/main/java/reliquary/crafting/conditions/SpawnEggEnabledCondition.java @@ -1,21 +1,21 @@ package reliquary.crafting.conditions; -import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.common.crafting.conditions.ICondition; -import reliquary.reference.Reference; -import reliquary.reference.Settings; +import com.mojang.serialization.Codec; +import com.mojang.serialization.MapCodec; +import net.neoforged.neoforge.common.conditions.ICondition; +import reliquary.reference.Config; public class SpawnEggEnabledCondition implements ICondition { - private static final ResourceLocation ID = new ResourceLocation(Reference.MOD_ID, "spawn_egg_enabled"); - public static final SimpleConditionSerializer SERIALIZER = new SimpleConditionSerializer<>(ID, SpawnEggEnabledCondition::new); + private static final SpawnEggEnabledCondition INSTANCE = new SpawnEggEnabledCondition(); + public static final Codec CODEC = MapCodec.unit(INSTANCE).stable().codec(); @Override - public ResourceLocation getID() { - return ID; + public boolean test(IContext context) { + return !Config.COMMON.disable.disableSpawnEggRecipes.get(); } @Override - public boolean test(IContext context) { - return !Settings.COMMON.disable.disableSpawnEggRecipes.get(); + public Codec codec() { + return CODEC; } } diff --git a/src/main/java/reliquary/data/BlockLootSubProvider.java b/src/main/java/reliquary/data/BlockLootSubProvider.java index ffec9471..26ecd465 100644 --- a/src/main/java/reliquary/data/BlockLootSubProvider.java +++ b/src/main/java/reliquary/data/BlockLootSubProvider.java @@ -1,8 +1,8 @@ package reliquary.data; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.world.flag.FeatureFlags; import net.minecraft.world.level.block.Block; -import net.minecraftforge.registries.ForgeRegistries; import reliquary.reference.Reference; import java.util.Map; @@ -15,14 +15,14 @@ protected BlockLootSubProvider() { @Override public void generate() { - ForgeRegistries.BLOCKS.getEntries().stream() + BuiltInRegistries.BLOCK.entrySet().stream() .filter(e -> e.getKey().location().getNamespace().equals(Reference.MOD_ID)) .map(Map.Entry::getValue).forEach(this::dropSelf); } @Override protected Iterable getKnownBlocks() { - return ForgeRegistries.BLOCKS.getEntries().stream() + return BuiltInRegistries.BLOCK.entrySet().stream() .filter(e -> e.getKey().location().getNamespace().equals(Reference.MOD_ID)) .map(Map.Entry::getValue) .toList(); diff --git a/src/main/java/reliquary/data/BlockTagProvider.java b/src/main/java/reliquary/data/BlockTagProvider.java index f8b528c8..e0fedfe4 100644 --- a/src/main/java/reliquary/data/BlockTagProvider.java +++ b/src/main/java/reliquary/data/BlockTagProvider.java @@ -3,9 +3,8 @@ import net.minecraft.core.HolderLookup; import net.minecraft.data.PackOutput; import net.minecraft.tags.BlockTags; -import net.minecraftforge.common.data.BlockTagsProvider; -import net.minecraftforge.common.data.ExistingFileHelper; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.neoforge.common.data.BlockTagsProvider; +import net.neoforged.neoforge.common.data.ExistingFileHelper; import reliquary.blocks.PassivePedestalBlock; import reliquary.blocks.PedestalBlock; import reliquary.init.ModBlocks; @@ -13,6 +12,7 @@ import javax.annotation.Nullable; import java.util.concurrent.CompletableFuture; +import java.util.function.Supplier; public class BlockTagProvider extends BlockTagsProvider { public BlockTagProvider(PackOutput output, CompletableFuture lookupProvider, @Nullable ExistingFileHelper existingFileHelper) { @@ -21,8 +21,9 @@ public BlockTagProvider(PackOutput output, CompletableFuture CODEC = Codec.unit(INSTANCE); private ChestLootEnabledCondition() { } @@ -21,7 +21,7 @@ public LootItemConditionType getType() { @Override public boolean test(LootContext lootContext) { - return Boolean.TRUE.equals(Settings.COMMON.chestLootEnabled.get()); + return Boolean.TRUE.equals(Config.COMMON.chestLootEnabled.get()); } public static Builder builder() { @@ -34,16 +34,4 @@ public LootItemCondition build() { return new ChestLootEnabledCondition(); } } - - public static class Serializer implements net.minecraft.world.level.storage.loot.Serializer { - @Override - public void serialize(JsonObject object, ChestLootEnabledCondition instance, JsonSerializationContext ctx) { - //nothing to serialize - } - - @Override - public ChestLootEnabledCondition deserialize(JsonObject object, JsonDeserializationContext ctx) { - return new ChestLootEnabledCondition(); - } - } } diff --git a/src/main/java/reliquary/data/DataGenerators.java b/src/main/java/reliquary/data/DataGenerators.java index 832e68ec..ca19af8f 100644 --- a/src/main/java/reliquary/data/DataGenerators.java +++ b/src/main/java/reliquary/data/DataGenerators.java @@ -2,7 +2,7 @@ import net.minecraft.data.DataGenerator; import net.minecraft.data.PackOutput; -import net.minecraftforge.data.event.GatherDataEvent; +import net.neoforged.neoforge.data.event.GatherDataEvent; public class DataGenerators { private DataGenerators() {} diff --git a/src/main/java/reliquary/data/EntityLootEnabledCondition.java b/src/main/java/reliquary/data/EntityLootEnabledCondition.java index 7d087a6d..7597e5f8 100644 --- a/src/main/java/reliquary/data/EntityLootEnabledCondition.java +++ b/src/main/java/reliquary/data/EntityLootEnabledCondition.java @@ -1,16 +1,15 @@ package reliquary.data; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonObject; -import com.google.gson.JsonSerializationContext; +import com.mojang.serialization.Codec; import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.predicates.LootItemCondition; import net.minecraft.world.level.storage.loot.predicates.LootItemConditionType; import reliquary.init.ModItems; -import reliquary.reference.Settings; +import reliquary.reference.Config; public class EntityLootEnabledCondition implements LootItemCondition { - + private static final EntityLootEnabledCondition INSTANCE = new EntityLootEnabledCondition(); + public static final Codec CODEC = Codec.unit(() -> INSTANCE); private EntityLootEnabledCondition() { } @@ -21,7 +20,7 @@ public LootItemConditionType getType() { @Override public boolean test(LootContext lootContext) { - return Boolean.TRUE.equals(Settings.COMMON.mobDropsEnabled.get()); + return Boolean.TRUE.equals(Config.COMMON.mobDropsEnabled.get()); } public static Builder builder() { @@ -34,16 +33,4 @@ public LootItemCondition build() { return new EntityLootEnabledCondition(); } } - - public static class Serializer implements net.minecraft.world.level.storage.loot.Serializer { - @Override - public void serialize(JsonObject object, EntityLootEnabledCondition instance, JsonSerializationContext ctx) { - //nothing to serialize - } - - @Override - public EntityLootEnabledCondition deserialize(JsonObject object, JsonDeserializationContext ctx) { - return new EntityLootEnabledCondition(); - } - } } diff --git a/src/main/java/reliquary/data/ItemTagProvider.java b/src/main/java/reliquary/data/ItemTagProvider.java index aa2345e7..42fdfc9c 100644 --- a/src/main/java/reliquary/data/ItemTagProvider.java +++ b/src/main/java/reliquary/data/ItemTagProvider.java @@ -5,7 +5,7 @@ import net.minecraft.data.tags.ItemTagsProvider; import net.minecraft.tags.ItemTags; import net.minecraft.world.level.block.Block; -import net.minecraftforge.common.data.ExistingFileHelper; +import net.neoforged.neoforge.common.data.ExistingFileHelper; import reliquary.init.ModItems; import reliquary.reference.Reference; diff --git a/src/main/java/reliquary/data/ModFluidTagsProvider.java b/src/main/java/reliquary/data/ModFluidTagsProvider.java index 0e65fb46..da422317 100644 --- a/src/main/java/reliquary/data/ModFluidTagsProvider.java +++ b/src/main/java/reliquary/data/ModFluidTagsProvider.java @@ -3,7 +3,7 @@ import net.minecraft.core.HolderLookup; import net.minecraft.data.PackOutput; import net.minecraft.data.tags.FluidTagsProvider; -import net.minecraftforge.common.data.ExistingFileHelper; +import net.neoforged.neoforge.common.data.ExistingFileHelper; import reliquary.init.ModFluids; import reliquary.reference.Reference; diff --git a/src/main/java/reliquary/data/ModRecipeProvider.java b/src/main/java/reliquary/data/ModRecipeProvider.java index 793945d9..3dabbd5f 100644 --- a/src/main/java/reliquary/data/ModRecipeProvider.java +++ b/src/main/java/reliquary/data/ModRecipeProvider.java @@ -1,42 +1,26 @@ package reliquary.data; -import net.minecraft.advancements.critereon.InventoryChangeTrigger; +import net.minecraft.advancements.Criterion; import net.minecraft.advancements.critereon.ItemPredicate; +import net.minecraft.core.registries.Registries; import net.minecraft.data.PackOutput; -import net.minecraft.data.recipes.FinishedRecipe; -import net.minecraft.data.recipes.RecipeCategory; -import net.minecraft.data.recipes.RecipeProvider; -import net.minecraft.data.recipes.ShapedRecipeBuilder; -import net.minecraft.data.recipes.ShapelessRecipeBuilder; +import net.minecraft.data.recipes.*; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.TagKey; -import net.minecraft.world.item.BlockItem; -import net.minecraft.world.item.DyeColor; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Items; +import net.minecraft.world.item.*; import net.minecraft.world.item.alchemy.PotionUtils; import net.minecraft.world.item.alchemy.Potions; -import net.minecraftforge.common.Tags; -import net.minecraftforge.common.crafting.ConditionalRecipe; -import net.minecraftforge.common.crafting.StrictNBTIngredient; -import net.minecraftforge.common.crafting.conditions.NotCondition; -import net.minecraftforge.common.crafting.conditions.TagEmptyCondition; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.neoforge.common.Tags; +import net.neoforged.neoforge.common.conditions.NotCondition; +import net.neoforged.neoforge.common.conditions.TagEmptyCondition; +import net.neoforged.neoforge.common.crafting.NBTIngredient; import reliquary.crafting.MobCharmRecipeBuilder; -import reliquary.crafting.NbtShapedRecipeBuilder; import reliquary.crafting.PotionEffectsRecipeBuilder; import reliquary.crafting.SpawnEggRecipeBuilder; import reliquary.crafting.alkahestry.ChargingRecipeBuilder; import reliquary.crafting.alkahestry.CraftingRecipeBuilder; import reliquary.crafting.alkahestry.DrainRecipeBuilder; -import reliquary.crafting.conditions.AlkahestryEnabledCondition; -import reliquary.crafting.conditions.HandgunEnabledCondition; -import reliquary.crafting.conditions.MobDropsCraftableCondition; -import reliquary.crafting.conditions.PassivePedestalEnabledCondition; -import reliquary.crafting.conditions.PedestalEnabledCondition; -import reliquary.crafting.conditions.PotionsEnabledCondition; -import reliquary.crafting.conditions.SpawnEggEnabledCondition; +import reliquary.crafting.conditions.*; import reliquary.init.ModBlocks; import reliquary.init.ModItems; import reliquary.items.BulletItem; @@ -48,10 +32,10 @@ import java.util.function.Consumer; public class ModRecipeProvider extends RecipeProvider { - private static final TagKey INGOTS_COPPER = TagKey.create(ForgeRegistries.Keys.ITEMS, new ResourceLocation("forge:ingots/copper")); - private static final TagKey INGOTS_STEEL = TagKey.create(ForgeRegistries.Keys.ITEMS, new ResourceLocation("forge:ingots/steel")); - private static final TagKey INGOTS_SILVER = TagKey.create(ForgeRegistries.Keys.ITEMS, new ResourceLocation("forge:ingots/silver")); - private static final TagKey INGOTS_TIN = TagKey.create(ForgeRegistries.Keys.ITEMS, new ResourceLocation("forge:ingots/tin")); + private static final TagKey INGOTS_COPPER = TagKey.create(Registries.ITEM, new ResourceLocation("forge:ingots/copper")); + private static final TagKey INGOTS_STEEL = TagKey.create(Registries.ITEM, new ResourceLocation("forge:ingots/steel")); + private static final TagKey INGOTS_SILVER = TagKey.create(Registries.ITEM, new ResourceLocation("forge:ingots/silver")); + private static final TagKey INGOTS_TIN = TagKey.create(Registries.ITEM, new ResourceLocation("forge:ingots/tin")); private static final String HAS_GUNPOWDER_CRITERION = "has_gunpowder"; private static final String HAS_NEBULOUS_HEART_CRITERION = "has_nebulous_heart"; private static final String HAS_FERTILE_ESSENCE_CRITERION = "has_fertile_essence"; @@ -75,11 +59,11 @@ public ModRecipeProvider(PackOutput packOutput) { } @Override - protected void buildRecipes(Consumer consumer) { - registerHandgunRecipes(consumer); - registerAlkahestryRecipes(consumer); - registerPotionRecipes(consumer); - registerPedestalRecipes(consumer); + protected void buildRecipes(RecipeOutput recipeOutput) { + registerHandgunRecipes(recipeOutput); + registerAlkahestryRecipes(recipeOutput); + registerPotionRecipes(recipeOutput); + registerPedestalRecipes(recipeOutput); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModBlocks.ALKAHESTRY_ALTAR_ITEM.get()) .requires(Tags.Items.OBSIDIAN) @@ -87,7 +71,7 @@ protected void buildRecipes(Consumer consumer) { .requires(ModItems.NEBULOUS_HEART.get()) .requires(ModItems.CATALYZING_GLAND.get()) .unlockedBy(HAS_NEBULOUS_HEART_CRITERION, has(ModItems.NEBULOUS_HEART.get())) - .save(consumer); + .save(recipeOutput); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModBlocks.FERTILE_LILY_PAD_ITEM.get()) .requires(ModItems.FERTILE_ESSENCE.get()) @@ -95,7 +79,7 @@ protected void buildRecipes(Consumer consumer) { .requires(ModItems.FERTILE_ESSENCE.get()) .requires(Items.LILY_PAD) .unlockedBy(HAS_FERTILE_ESSENCE_CRITERION, has(ModItems.FERTILE_ESSENCE.get())) - .save(consumer); + .save(recipeOutput); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModBlocks.INTERDICTION_TORCH_ITEM.get()) .requires(ModItems.BAT_WING.get()) @@ -103,18 +87,18 @@ protected void buildRecipes(Consumer consumer) { .requires(ModItems.MOLTEN_CORE.get()) .requires(ModItems.NEBULOUS_HEART.get()) .unlockedBy(HAS_MOLTEN_CORE_CRITERION, has(ModItems.MOLTEN_CORE.get())) - .save(consumer); + .save(recipeOutput); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModBlocks.WRAITH_NODE_ITEM.get()) .requires(ModItems.NEBULOUS_HEART.get()) .requires(Tags.Items.GEMS_EMERALD) .unlockedBy(HAS_NEBULOUS_HEART_CRITERION, has(ModItems.NEBULOUS_HEART.get())) - .save(consumer); + .save(recipeOutput); - registerCraftableMobDropRecipes(consumer); - registerCharmFragmentRecipes(consumer); - registerIngredientRecipes(consumer); - registerUncraftingRecipes(consumer); + registerCraftableMobDropRecipes(recipeOutput); + registerCharmFragmentRecipes(recipeOutput); + registerIngredientRecipes(recipeOutput); + registerUncraftingRecipes(recipeOutput); ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.ANGELHEART_VIAL.get()) .pattern("GBG") @@ -125,7 +109,7 @@ protected void buildRecipes(Consumer consumer) { .define('C', ModItems.INFERNAL_CLAW.get()) .define('F', ModItems.FERTILE_ESSENCE.get()) .unlockedBy(HAS_FERTILE_ESSENCE_CRITERION, has(ModItems.FERTILE_ESSENCE.get())) - .save(consumer); + .save(recipeOutput); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.ANGELIC_FEATHER.get()) .requires(Tags.Items.FEATHERS) @@ -133,7 +117,7 @@ protected void buildRecipes(Consumer consumer) { .requires(ModItems.BAT_WING.get()) .requires(ModItems.FERTILE_ESSENCE.get()) .unlockedBy(HAS_NEBULOUS_HEART_CRITERION, has(ModItems.NEBULOUS_HEART.get())) - .save(consumer); + .save(recipeOutput); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.DESTRUCTION_CATALYST.get()) .requires(Items.FLINT_AND_STEEL) @@ -141,15 +125,15 @@ protected void buildRecipes(Consumer consumer) { .requires(ModItems.CATALYZING_GLAND.get()) .requires(ModItems.INFERNAL_TEAR.get()) .unlockedBy(HAS_MOLTEN_CORE_CRITERION, has(ModItems.MOLTEN_CORE.get())) - .save(consumer); + .save(recipeOutput); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.EMPEROR_CHALICE.get()) .requires(Tags.Items.GEMS_EMERALD) .requires(Tags.Items.INGOTS_GOLD) .requires(Items.BUCKET) - .requires(instantiateNBTIngredient(new ItemStack(ModItems.VOID_TEAR.get()))) + .requires(NBTIngredient.of(true, new ItemStack(ModItems.VOID_TEAR.get()))) .unlockedBy(HAS_VOID_TEAR_CRITERION, has(ModItems.VOID_TEAR.get())) - .save(consumer); + .save(recipeOutput); ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.ENDER_STAFF.get()) .pattern(" BE") @@ -158,10 +142,10 @@ protected void buildRecipes(Consumer consumer) { .define('B', ModItems.BAT_WING.get()) .define('S', Items.STICK) .define('E', Items.ENDER_EYE) - .define('V', instantiateNBTIngredient(new ItemStack(ModItems.VOID_TEAR.get()))) + .define('V', NBTIngredient.of(true, new ItemStack(ModItems.VOID_TEAR.get()))) .define('N', ModItems.NEBULOUS_HEART.get()) .unlockedBy(HAS_NEBULOUS_HEART_CRITERION, has(ModItems.NEBULOUS_HEART.get())) - .save(consumer); + .save(recipeOutput); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.FORTUNE_COIN.get()) .requires(ModItems.NEBULOUS_HEART.get()) @@ -169,15 +153,15 @@ protected void buildRecipes(Consumer consumer) { .requires(ModItems.SLIME_PEARL.get()) .requires(ModItems.BAT_WING.get()) .unlockedBy(HAS_NEBULOUS_HEART_CRITERION, has(ModItems.NEBULOUS_HEART.get())) - .save(consumer); + .save(recipeOutput); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.GLACIAL_STAFF.get()) .requires(ModItems.ICE_MAGUS_ROD.get()) - .requires(instantiateNBTIngredient(new ItemStack(ModItems.VOID_TEAR.get()))) + .requires(NBTIngredient.of(true, new ItemStack(ModItems.VOID_TEAR.get()))) .requires(ModItems.FROZEN_CORE.get()) .requires(ModItems.SHEARS_OF_WINTER.get()) .unlockedBy(HAS_VOID_TEAR_CRITERION, has(ModItems.VOID_TEAR.get())) - .save(consumer); + .save(recipeOutput); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.GLOWING_BREAD.get(), 3) .requires(Items.BREAD) @@ -185,7 +169,7 @@ protected void buildRecipes(Consumer consumer) { .requires(Items.BREAD) .requires(ModItems.GLOWING_WATER.get()) .unlockedBy("has_glowing_water", has(ModItems.GLOWING_WATER.get())) - .save(consumer); + .save(recipeOutput); ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.GLOWING_WATER.get()) .pattern("GBG") @@ -197,7 +181,7 @@ protected void buildRecipes(Consumer consumer) { .define('P', Tags.Items.GUNPOWDER) .define('N', Tags.Items.CROPS_NETHER_WART) .unlockedBy("has_nether_wart", hasTag(Tags.Items.CROPS_NETHER_WART)) - .save(consumer); + .save(recipeOutput); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.GLOWING_WATER.get()) .requires(ModItems.EMPTY_POTION_VIAL.get()) @@ -206,7 +190,7 @@ protected void buildRecipes(Consumer consumer) { .requires(Tags.Items.GUNPOWDER) .requires(Tags.Items.CROPS_NETHER_WART) .unlockedBy("has_empty_potion_vial", has(ModItems.EMPTY_POTION_VIAL.get())) - .save(consumer, new ResourceLocation(Reference.MOD_ID, "glowing_water_from_potion_vial")); + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, "glowing_water_from_potion_vial")); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, Items.GOLD_NUGGET) .requires(ModItems.EMPTY_BULLET.get()) @@ -214,7 +198,7 @@ protected void buildRecipes(Consumer consumer) { .requires(ModItems.EMPTY_BULLET.get()) .requires(ModItems.EMPTY_BULLET.get()) .unlockedBy("has_empty_bullet", has(ModItems.EMPTY_BULLET.get())) - .save(consumer, new ResourceLocation(Reference.MOD_ID, "gold_nugget")); + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, "gold_nugget")); ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.HARVEST_ROD.get()) .pattern(" RF") @@ -223,10 +207,10 @@ protected void buildRecipes(Consumer consumer) { .define('R', Items.ROSE_BUSH) .define('F', ModItems.FERTILE_ESSENCE.get()) .define('V', Items.VINE) - .define('T', instantiateNBTIngredient(new ItemStack(ModItems.VOID_TEAR.get()))) + .define('T', NBTIngredient.of(true, new ItemStack(ModItems.VOID_TEAR.get()))) .define('S', Items.STICK) .unlockedBy(HAS_VOID_TEAR_CRITERION, has(ModItems.VOID_TEAR.get())) - .save(consumer); + .save(recipeOutput); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.HERO_MEDALLION.get()) .requires(ModItems.NEBULOUS_HEART.get()) @@ -234,7 +218,7 @@ protected void buildRecipes(Consumer consumer) { .requires(ModItems.WITCH_HAT.get()) .requires(ModItems.INFERNAL_TEAR.get()) .unlockedBy("has_infernal_tear", has(ModItems.INFERNAL_TEAR.get())) - .save(consumer); + .save(recipeOutput); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.HOLY_HAND_GRENADE.get(), 4) .requires(ModItems.GLOWING_WATER.get()) @@ -242,7 +226,7 @@ protected void buildRecipes(Consumer consumer) { .requires(Items.TNT) .requires(ModItems.CATALYZING_GLAND.get()) .unlockedBy("has_glowing_water", has(ModItems.GLOWING_WATER.get())) - .save(consumer); + .save(recipeOutput); ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.ICE_MAGUS_ROD.get()) .pattern(" DF") @@ -250,10 +234,10 @@ protected void buildRecipes(Consumer consumer) { .pattern("I ") .define('D', Tags.Items.GEMS_DIAMOND) .define('F', ModItems.FROZEN_CORE.get()) - .define('V', instantiateNBTIngredient(new ItemStack(ModItems.VOID_TEAR.get()))) + .define('V', NBTIngredient.of(true, new ItemStack(ModItems.VOID_TEAR.get()))) .define('I', Tags.Items.INGOTS_IRON) .unlockedBy(HAS_FROZEN_CORE_CRITERION, has(ModItems.FROZEN_CORE.get())) - .save(consumer); + .save(recipeOutput); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.INFERNAL_CHALICE.get()) .requires(ModItems.INFERNAL_CLAWS.get()) @@ -261,7 +245,7 @@ protected void buildRecipes(Consumer consumer) { .requires(ModItems.INFERNAL_TEAR.get()) .requires(ModItems.MOLTEN_CORE.get()) .unlockedBy("has_emperor_chalice", has(ModItems.EMPEROR_CHALICE.get())) - .save(consumer); + .save(recipeOutput); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.INFERNAL_CLAWS.get()) .requires(ModItems.INFERNAL_CLAW.get()) @@ -269,15 +253,15 @@ protected void buildRecipes(Consumer consumer) { .requires(ModItems.INFERNAL_CLAW.get()) .requires(ModItems.SLIME_PEARL.get()) .unlockedBy(HAS_INFERNAL_CLAW_CRITERION, has(ModItems.INFERNAL_CLAW.get())) - .save(consumer); + .save(recipeOutput); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.INFERNAL_TEAR.get()) - .requires(instantiateNBTIngredient(new ItemStack(ModItems.VOID_TEAR.get()))) + .requires(NBTIngredient.of(true, new ItemStack(ModItems.VOID_TEAR.get()))) .requires(ModItems.WITCH_HAT.get()) .requires(ModItems.MOLTEN_CORE.get()) .requires(ModItems.INFERNAL_CLAW.get()) .unlockedBy(HAS_INFERNAL_CLAW_CRITERION, has(ModItems.INFERNAL_CLAW.get())) - .save(consumer); + .save(recipeOutput); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.KRAKEN_SHELL.get()) .requires(ModItems.KRAKEN_SHELL_FRAGMENT.get()) @@ -285,7 +269,7 @@ protected void buildRecipes(Consumer consumer) { .requires(ModItems.KRAKEN_SHELL_FRAGMENT.get()) .requires(ModItems.NEBULOUS_HEART.get()) .unlockedBy("has_kraken_shell_fragment", has(ModItems.KRAKEN_SHELL_FRAGMENT.get())) - .save(consumer); + .save(recipeOutput); ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.LANTERN_OF_PARANOIA.get()) .pattern("ISI") @@ -296,7 +280,7 @@ protected void buildRecipes(Consumer consumer) { .define('I', Tags.Items.INGOTS_IRON) .define('M', ModItems.MOLTEN_CORE.get()) .unlockedBy(HAS_MOLTEN_CORE_CRITERION, has(ModItems.MOLTEN_CORE.get())) - .save(consumer); + .save(recipeOutput); ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.MAGICBANE.get()) .pattern("NG") @@ -305,7 +289,7 @@ protected void buildRecipes(Consumer consumer) { .define('I', Tags.Items.INGOTS_IRON) .define('N', ModItems.NEBULOUS_HEART.get()) .unlockedBy(HAS_NEBULOUS_HEART_CRITERION, has(ModItems.NEBULOUS_HEART.get())) - .save(consumer); + .save(recipeOutput); ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.MERCY_CROSS.get()) .pattern("WGR") @@ -318,7 +302,7 @@ protected void buildRecipes(Consumer consumer) { .define('S', Items.WITHER_SKELETON_SKULL) .define('Z', ModItems.ZOMBIE_HEART.get()) .unlockedBy(HAS_WITHERED_RIB_CRITERION, has(ModItems.WITHERED_RIB.get())) - .save(consumer); + .save(recipeOutput); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.MIDAS_TOUCHSTONE.get()) .requires(Items.ANVIL) @@ -329,19 +313,19 @@ protected void buildRecipes(Consumer consumer) { .requires(ModItems.MOLTEN_CORE.get()) .requires(ModItems.CATALYZING_GLAND.get()) .requires(ModItems.CATALYZING_GLAND.get()) - .requires(instantiateNBTIngredient(new ItemStack(ModItems.VOID_TEAR.get()))) + .requires(NBTIngredient.of(true, new ItemStack(ModItems.VOID_TEAR.get()))) .unlockedBy(HAS_MOLTEN_CORE_CRITERION, has(ModItems.MOLTEN_CORE.get())) - .save(consumer); + .save(recipeOutput); MobCharmRecipeBuilder.charmRecipe() - .patternLine("FLF") - .patternLine("FSF") - .patternLine("F F") - .key('F', ModItems.MOB_CHARM_FRAGMENT.get()) - .key('L', Tags.Items.LEATHER) - .key('S', Tags.Items.STRING) - .addCriterion(HAS_MOB_CHARM_FRAGMENT_CRITERION, has(ModItems.MOB_CHARM_FRAGMENT.get())) - .build(consumer); + .pattern("FLF") + .pattern("FSF") + .pattern("F F") + .define('F', ModItems.MOB_CHARM_FRAGMENT.get()) + .define('L', Tags.Items.LEATHER) + .define('S', Tags.Items.STRING) + .unlockedBy(HAS_MOB_CHARM_FRAGMENT_CRITERION, has(ModItems.MOB_CHARM_FRAGMENT.get())) + .save(recipeOutput); ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.MOB_CHARM_BELT.get()) .pattern("LLL") @@ -350,7 +334,7 @@ protected void buildRecipes(Consumer consumer) { .define('L', Tags.Items.LEATHER) .define('F', ModItems.MOB_CHARM_FRAGMENT.get()) .unlockedBy(HAS_MOB_CHARM_FRAGMENT_CRITERION, has(ModItems.MOB_CHARM_FRAGMENT.get())) - .save(consumer); + .save(recipeOutput); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.PHOENIX_DOWN.get()) .requires(ModItems.ANGELHEART_VIAL.get()) @@ -358,7 +342,7 @@ protected void buildRecipes(Consumer consumer) { .requires(ModItems.ANGELHEART_VIAL.get()) .requires(ModItems.ANGELIC_FEATHER.get()) .unlockedBy("has_angelic_feather", has(ModItems.ANGELIC_FEATHER.get())) - .save(consumer); + .save(recipeOutput); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.PYROMANCER_STAFF.get()) .requires(ModItems.INFERNAL_CLAWS.get()) @@ -366,7 +350,7 @@ protected void buildRecipes(Consumer consumer) { .requires(ModItems.INFERNAL_TEAR.get()) .requires(ModItems.SALAMANDER_EYE.get()) .unlockedBy("has_infernal_claws", has(ModItems.INFERNAL_CLAWS.get())) - .save(consumer); + .save(recipeOutput); ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.RENDING_GALE.get()) .pattern(" BE") @@ -375,10 +359,10 @@ protected void buildRecipes(Consumer consumer) { .define('B', ModItems.BAT_WING.get()) .define('S', Items.STICK) .define('E', ModItems.EYE_OF_THE_STORM.get()) - .define('V', instantiateNBTIngredient(new ItemStack(ModItems.VOID_TEAR.get()))) + .define('V', NBTIngredient.of(true, new ItemStack(ModItems.VOID_TEAR.get()))) .define('G', Tags.Items.INGOTS_GOLD) .unlockedBy("has_eye_of_the_storm", has(ModItems.EYE_OF_THE_STORM.get())) - .save(consumer); + .save(recipeOutput); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.ROD_OF_LYSSA.get()) .requires(ModItems.INFERNAL_CLAW.get()) @@ -386,7 +370,7 @@ protected void buildRecipes(Consumer consumer) { .requires(ModItems.NEBULOUS_HEART.get()) .requires(Items.FISHING_ROD) .unlockedBy(HAS_INFERNAL_CLAW_CRITERION, has(ModItems.INFERNAL_CLAW.get())) - .save(consumer); + .save(recipeOutput); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.SALAMANDER_EYE.get()) .requires(Items.ENDER_EYE) @@ -394,7 +378,7 @@ protected void buildRecipes(Consumer consumer) { .requires(ModItems.FROZEN_CORE.get()) .requires(ModItems.NEBULOUS_HEART.get()) .unlockedBy(HAS_MOLTEN_CORE_CRITERION, has(ModItems.MOLTEN_CORE.get())) - .save(consumer); + .save(recipeOutput); ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.SERPENT_STAFF.get()) .pattern(" CE") @@ -405,7 +389,7 @@ protected void buildRecipes(Consumer consumer) { .define('E', Items.ENDER_EYE) .define('K', ModItems.KRAKEN_SHELL_FRAGMENT.get()) .unlockedBy("has_kraken_shell_fragment", has(ModItems.KRAKEN_SHELL_FRAGMENT.get())) - .save(consumer); + .save(recipeOutput); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.SHEARS_OF_WINTER.get()) .requires(ModItems.FROZEN_CORE.get()) @@ -413,15 +397,15 @@ protected void buildRecipes(Consumer consumer) { .requires(Tags.Items.GEMS_DIAMOND) .requires(Tags.Items.GEMS_DIAMOND) .unlockedBy(HAS_FROZEN_CORE_CRITERION, has(ModItems.FROZEN_CORE.get())) - .save(consumer); + .save(recipeOutput); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.SOJOURNER_STAFF.get()) .requires(ModItems.MOLTEN_CORE.get()) .requires(Tags.Items.INGOTS_GOLD) .requires(Tags.Items.RODS_BLAZE) - .requires(instantiateNBTIngredient(new ItemStack(ModItems.VOID_TEAR.get()))) + .requires(NBTIngredient.of(true, new ItemStack(ModItems.VOID_TEAR.get()))) .unlockedBy(HAS_VOID_TEAR_CRITERION, has(ModItems.VOID_TEAR.get())) - .save(consumer); + .save(recipeOutput); ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.TWILIGHT_CLOAK.get()) .pattern("ICI") @@ -431,7 +415,7 @@ protected void buildRecipes(Consumer consumer) { .define('B', Items.BLACK_WOOL) .define('C', ModItems.CRIMSON_CLOTH.get()) .unlockedBy("has_crimson_cloth", has(ModItems.CRIMSON_CLOTH.get())) - .save(consumer); + .save(recipeOutput); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.VOID_TEAR.get()) .requires(Items.GHAST_TEAR) @@ -439,7 +423,7 @@ protected void buildRecipes(Consumer consumer) { .requires(ModItems.SLIME_PEARL.get()) .requires(Tags.Items.GEMS_LAPIS) .unlockedBy(HAS_NEBULOUS_HEART_CRITERION, has(ModItems.NEBULOUS_HEART.get())) - .save(consumer); + .save(recipeOutput); ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.WITHERLESS_ROSE.get()) .pattern("FNF") @@ -449,39 +433,39 @@ protected void buildRecipes(Consumer consumer) { .define('N', Tags.Items.NETHER_STARS) .define('R', Items.ROSE_BUSH) .unlockedBy(HAS_FERTILE_ESSENCE_CRITERION, has(ModItems.FERTILE_ESSENCE.get())) - .save(consumer); + .save(recipeOutput); } - private void registerUncraftingRecipes(Consumer consumer) { + private void registerUncraftingRecipes(RecipeOutput recipeOutput) { ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, Items.BLAZE_ROD, 4) .requires(ModItems.MOLTEN_CORE.get()) .requires(ModItems.MOLTEN_CORE.get()) .unlockedBy(HAS_MOLTEN_CORE_CRITERION, has(ModItems.MOLTEN_CORE.get())) - .save(consumer, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "blaze_rod")); + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "blaze_rod")); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, Items.BONE, 5) .requires(ModItems.RIB_BONE.get()) .unlockedBy("has_rib_bone", has(ModItems.RIB_BONE.get())) - .save(consumer, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "bone")); + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "bone")); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, Items.ENDER_PEARL, 3) .requires(ModItems.NEBULOUS_HEART.get()) .unlockedBy(HAS_NEBULOUS_HEART_CRITERION, has(ModItems.NEBULOUS_HEART.get())) - .save(consumer, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "ender_pearl")); + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "ender_pearl")); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, Items.GHAST_TEAR) .requires(ModItems.CATALYZING_GLAND.get()) .requires(ModItems.CATALYZING_GLAND.get()) .requires(ModItems.CATALYZING_GLAND.get()) .unlockedBy(HAS_CATALYZING_GLAND_CRITERIION, has(ModItems.CATALYZING_GLAND.get())) - .save(consumer, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "ghast_tear")); + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "ghast_tear")); ShapedRecipeBuilder.shaped(RecipeCategory.MISC, Items.GLASS_BOTTLE, 6) .pattern("W W") .pattern(" W ") .define('W', ModItems.WITCH_HAT.get()) .unlockedBy(HAS_WITCH_HAT_CRITERION, has(ModItems.WITCH_HAT.get())) - .save(consumer, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "glass_bottle")); + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "glass_bottle")); ShapedRecipeBuilder.shaped(RecipeCategory.MISC, Items.GLOWSTONE_DUST, 6) .pattern("W ") @@ -489,23 +473,23 @@ private void registerUncraftingRecipes(Consumer consumer) { .pattern(" W ") .define('W', ModItems.WITCH_HAT.get()) .unlockedBy(HAS_WITCH_HAT_CRITERION, has(ModItems.WITCH_HAT.get())) - .save(consumer, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "glowstone_dust")); + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "glowstone_dust")); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, Items.GOLD_NUGGET, 6) .requires(ModItems.ZOMBIE_HEART.get()) .requires(ModItems.ZOMBIE_HEART.get()) .unlockedBy(HAS_ZOMBIE_HEART_CRITERION, has(ModItems.ZOMBIE_HEART.get())) - .save(consumer, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "gold_nugget")); + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "gold_nugget")); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, Items.GUNPOWDER, 6) .requires(ModItems.CATALYZING_GLAND.get()) .unlockedBy(HAS_CATALYZING_GLAND_CRITERIION, has(ModItems.CATALYZING_GLAND.get())) - .save(consumer, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "gunpowder_creeper_gland")); + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "gunpowder_creeper_gland")); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, Items.GUNPOWDER, 10) .requires(ModItems.EYE_OF_THE_STORM.get()) .unlockedBy("has_eye_of_the_storm", has(ModItems.EYE_OF_THE_STORM.get())) - .save(consumer, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "gunpowder_storm_eye")); + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "gunpowder_storm_eye")); ShapedRecipeBuilder.shaped(RecipeCategory.MISC, Items.GUNPOWDER, 6) .pattern("W ") @@ -513,17 +497,17 @@ private void registerUncraftingRecipes(Consumer consumer) { .pattern(" W") .define('W', ModItems.WITCH_HAT.get()) .unlockedBy(HAS_WITCH_HAT_CRITERION, has(ModItems.WITCH_HAT.get())) - .save(consumer, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "gunpowder_witch_hat")); + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "gunpowder_witch_hat")); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, Items.INK_SAC, 6) .requires(ModItems.SQUID_BEAK.get()) .unlockedBy("has_squid_beak", has(ModItems.SQUID_BEAK.get())) - .save(consumer, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "ink_sac")); + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "ink_sac")); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, Items.MAGMA_CREAM, 3) .requires(ModItems.MOLTEN_CORE.get()) .unlockedBy(HAS_MOLTEN_CORE_CRITERION, has(ModItems.MOLTEN_CORE.get())) - .save(consumer, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "magma_cream")); + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "magma_cream")); ShapedRecipeBuilder.shaped(RecipeCategory.MISC, Items.PACKED_ICE) .pattern("III") @@ -532,18 +516,18 @@ private void registerUncraftingRecipes(Consumer consumer) { .define('I', Items.ICE) .define('C', ModItems.FROZEN_CORE.get()) .unlockedBy(HAS_FROZEN_CORE_CRITERION, has(ModItems.FROZEN_CORE.get())) - .save(consumer, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "packed_ice")); + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "packed_ice")); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, Items.PRISMARINE_CRYSTALS, 10) .requires(ModItems.GUARDIAN_SPIKE.get()) .requires(ModItems.GUARDIAN_SPIKE.get()) .unlockedBy(HAS_GUARDIAN_SPIKE_CRITERION, has(ModItems.GUARDIAN_SPIKE.get())) - .save(consumer, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "prismarine_crystals")); + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "prismarine_crystals")); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, Items.PRISMARINE_SHARD, 5) .requires(ModItems.GUARDIAN_SPIKE.get()) .unlockedBy(HAS_GUARDIAN_SPIKE_CRITERION, has(ModItems.GUARDIAN_SPIKE.get())) - .save(consumer, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "prismarine_shard")); + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "prismarine_shard")); ShapedRecipeBuilder.shaped(RecipeCategory.MISC, Items.REDSTONE, 6) .pattern("W") @@ -551,44 +535,44 @@ private void registerUncraftingRecipes(Consumer consumer) { .pattern("W") .define('W', ModItems.WITCH_HAT.get()) .unlockedBy(HAS_WITCH_HAT_CRITERION, has(ModItems.WITCH_HAT.get())) - .save(consumer, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "redstone")); + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "redstone")); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, Items.ROTTEN_FLESH, 6) .requires(ModItems.ZOMBIE_HEART.get()) .unlockedBy(HAS_ZOMBIE_HEART_CRITERION, has(ModItems.ZOMBIE_HEART.get())) - .save(consumer, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "rotten_flesh")); + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "rotten_flesh")); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, Items.SLIME_BALL, 6) .requires(ModItems.SLIME_PEARL.get()) .unlockedBy(HAS_SLIME_PEARL_CRITERION, has(ModItems.SLIME_PEARL.get())) - .save(consumer, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "slime_ball")); + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "slime_ball")); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, Items.SNOWBALL, 5) .requires(ModItems.FROZEN_CORE.get()) .unlockedBy(HAS_FROZEN_CORE_CRITERION, has(ModItems.FROZEN_CORE.get())) - .save(consumer, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "snowball")); + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "snowball")); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, Items.SPIDER_EYE, 2) .requires(ModItems.CHELICERAE.get()) .requires(ModItems.CHELICERAE.get()) .unlockedBy(HAS_CHELICERAE_CRITERION, has(ModItems.CHELICERAE.get())) - .save(consumer, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "spider_eye")); + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "spider_eye")); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, Items.STICK, 4) .requires(ModItems.WITCH_HAT.get()) .unlockedBy(HAS_WITCH_HAT_CRITERION, has(ModItems.WITCH_HAT.get())) - .save(consumer, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "stick")); + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "stick")); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, Items.STRING, 6) .requires(ModItems.CHELICERAE.get()) .unlockedBy(HAS_CHELICERAE_CRITERION, has(ModItems.CHELICERAE.get())) - .save(consumer, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "string")); + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "string")); ShapedRecipeBuilder.shaped(RecipeCategory.MISC, Items.SUGAR, 6) .pattern("WWW") .define('W', ModItems.WITCH_HAT.get()) .unlockedBy(HAS_WITCH_HAT_CRITERION, has(ModItems.WITCH_HAT.get())) - .save(consumer, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "sugar")); + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "sugar")); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, Items.WITHER_SKELETON_SKULL) .requires(ModItems.WITHERED_RIB.get()) @@ -596,407 +580,322 @@ private void registerUncraftingRecipes(Consumer consumer) { .requires(ModItems.WITHERED_RIB.get()) .requires(Items.SKELETON_SKULL) .unlockedBy(HAS_WITHERED_RIB_CRITERION, has(ModItems.WITHERED_RIB.get())) - .save(consumer, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "wither_skeleton_skull")); + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "wither_skeleton_skull")); ResourceLocation spawnEggId = new ResourceLocation(Reference.MOD_ID, UNCRAFTING_FOLDER + "spawn_egg"); - ConditionalRecipe.builder() - .addCondition(new SpawnEggEnabledCondition()) - .addRecipe(conditionalConsumer -> - SpawnEggRecipeBuilder.spawnEggRecipe() - .addIngredient(ModItems.MOB_CHARM_FRAGMENT.get()) - .addIngredient(ModItems.MOB_CHARM_FRAGMENT.get()) - .addIngredient(Items.EGG) - .addCriterion(HAS_MOB_CHARM_FRAGMENT_CRITERION, has(ModItems.MOB_CHARM_FRAGMENT.get())) - .build(conditionalConsumer, spawnEggId)) - .build(consumer, spawnEggId); + SpawnEggRecipeBuilder.spawnEggRecipe() + .addIngredient(ModItems.MOB_CHARM_FRAGMENT.get()) + .addIngredient(ModItems.MOB_CHARM_FRAGMENT.get()) + .addIngredient(Items.EGG) + .unlockedBy(HAS_MOB_CHARM_FRAGMENT_CRITERION, has(ModItems.MOB_CHARM_FRAGMENT.get())) + .build(recipeOutput.withConditions(new SpawnEggEnabledCondition()), spawnEggId); } - private void registerHandgunRecipes(Consumer consumer) { - ConditionalRecipe.builder() - .addCondition(new HandgunEnabledCondition()) - .addRecipe(conditionalConsumer -> - ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.HANDGUN.get()) - .pattern("BIM") - .pattern("ISI") - .pattern("IGI") - .define('I', Tags.Items.INGOTS_IRON) - .define('B', ModItems.BARREL_ASSEMBLY.get()) - .define('M', ModItems.HAMMER_ASSEMBLY.get()) - .define('G', ModItems.GRIP_ASSEMBLY.get()) - .define('S', ModItems.SLIME_PEARL.get()) - .unlockedBy("has_barrel_assembly", has(ModItems.BARREL_ASSEMBLY.get())) - .save(conditionalConsumer)) - .build(consumer, RegistryHelper.getRegistryName(ModItems.HANDGUN.get())); - - ConditionalRecipe.builder() - .addCondition(new HandgunEnabledCondition()) - .addRecipe(conditionalConsumer -> - ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.BARREL_ASSEMBLY.get()) - .pattern("III") - .pattern("EME") - .pattern("III") - .define('I', Tags.Items.INGOTS_IRON) - .define('E', ModItems.NEBULOUS_HEART.get()) - .define('M', Items.MAGMA_CREAM) - .unlockedBy(HAS_NEBULOUS_HEART_CRITERION, has(ModItems.NEBULOUS_HEART.get())) - .save(conditionalConsumer)) - .build(consumer, RegistryHelper.getRegistryName(ModItems.BARREL_ASSEMBLY.get())); - - ConditionalRecipe.builder() - .addCondition(new HandgunEnabledCondition()) - .addRecipe(conditionalConsumer -> - ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.GRIP_ASSEMBLY.get()) - .pattern("III") - .pattern("IMI") - .pattern("ICI") - .define('I', Tags.Items.INGOTS_IRON) - .define('C', ModItems.EMPTY_MAGAZINE.get()) - .define('M', Items.MAGMA_CREAM) - .unlockedBy("has_magma_cream", has(Items.MAGMA_CREAM)) - .save(conditionalConsumer)) - .build(consumer, RegistryHelper.getRegistryName(ModItems.GRIP_ASSEMBLY.get())); - - ConditionalRecipe.builder() - .addCondition(new HandgunEnabledCondition()) - .addRecipe(conditionalConsumer -> - ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.EMPTY_MAGAZINE.get()) - .pattern("I I") - .pattern("IGI") - .pattern("SIS") - .define('S', Tags.Items.STONE) - .define('I', Tags.Items.INGOTS_IRON) - .define('G', Tags.Items.GLASS) - .unlockedBy("has_iron_ingot", has(Items.IRON_INGOT)) - .save(conditionalConsumer)) - .build(consumer, RegistryHelper.getRegistryName(ModItems.EMPTY_MAGAZINE.get())); - - ConditionalRecipe.builder() - .addCondition(new HandgunEnabledCondition()) - .addRecipe(conditionalConsumer -> - ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.HAMMER_ASSEMBLY.get()) - .pattern("IIB") - .pattern("RMI") - .pattern("III") - .define('I', Tags.Items.INGOTS_IRON) - .define('B', Items.STONE_BUTTON) - .define('R', Tags.Items.RODS_BLAZE) - .define('M', ModItems.MOLTEN_CORE.get()) - .unlockedBy(HAS_MOLTEN_CORE_CRITERION, has(ModItems.MOLTEN_CORE.get())) - .save(conditionalConsumer)) - .build(consumer, RegistryHelper.getRegistryName(ModItems.HAMMER_ASSEMBLY.get())); - - ConditionalRecipe.builder() - .addCondition(new HandgunEnabledCondition()) - .addRecipe(conditionalConsumer -> - ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.BLAZE_BULLET.get(), 8) - .requires(Items.BLAZE_POWDER) - .requires(Tags.Items.RODS_BLAZE) - .requires(Tags.Items.NUGGETS_GOLD) - .requires(Tags.Items.NUGGETS_GOLD) - .unlockedBy("has_blaze_rod", has(Items.BLAZE_ROD)) - .save(conditionalConsumer)) - .build(consumer, RegistryHelper.getRegistryName(ModItems.BLAZE_BULLET.get())); - - addBulletPotionRecipe(consumer, ModItems.BLAZE_BULLET.get()); - - ConditionalRecipe.builder() - .addCondition(new HandgunEnabledCondition()) - .addRecipe(conditionalConsumer -> - ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.BUSTER_BULLET.get(), 8) - .requires(ModItems.CONCUSSIVE_BULLET.get()) - .requires(ModItems.CONCUSSIVE_BULLET.get()) - .requires(ModItems.CONCUSSIVE_BULLET.get()) - .requires(ModItems.CONCUSSIVE_BULLET.get()) - .requires(ModItems.CONCUSSIVE_BULLET.get()) - .requires(ModItems.CONCUSSIVE_BULLET.get()) - .requires(ModItems.CONCUSSIVE_BULLET.get()) - .requires(ModItems.CONCUSSIVE_BULLET.get()) - .requires(ModItems.CATALYZING_GLAND.get()) - .unlockedBy("has_concussive_bullet", has(ModItems.CONCUSSIVE_BULLET.get())) - .save(conditionalConsumer)) - .build(consumer, RegistryHelper.getRegistryName(ModItems.BUSTER_BULLET.get())); - - addBulletPotionRecipe(consumer, ModItems.BUSTER_BULLET.get()); - - ConditionalRecipe.builder() - .addCondition(new HandgunEnabledCondition()) - .addRecipe(conditionalConsumer -> - ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.CONCUSSIVE_BULLET.get(), 8) - .requires(Tags.Items.SLIMEBALLS) - .requires(Tags.Items.NUGGETS_GOLD) - .requires(Tags.Items.NUGGETS_GOLD) - .requires(Tags.Items.GUNPOWDER) - .unlockedBy(HAS_GUNPOWDER_CRITERION, has(Items.GUNPOWDER)) - .save(conditionalConsumer)) - .build(consumer, RegistryHelper.getRegistryName(ModItems.CONCUSSIVE_BULLET.get())); - - addBulletPotionRecipe(consumer, ModItems.CONCUSSIVE_BULLET.get()); - - ConditionalRecipe.builder() - .addCondition(new HandgunEnabledCondition()) - .addRecipe(conditionalConsumer -> - ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.ENDER_BULLET.get(), 8) - .requires(ModItems.SEEKER_BULLET.get()) - .requires(ModItems.SEEKER_BULLET.get()) - .requires(ModItems.SEEKER_BULLET.get()) - .requires(ModItems.SEEKER_BULLET.get()) - .requires(ModItems.SEEKER_BULLET.get()) - .requires(ModItems.SEEKER_BULLET.get()) - .requires(ModItems.SEEKER_BULLET.get()) - .requires(ModItems.SEEKER_BULLET.get()) - .requires(ModItems.NEBULOUS_HEART.get()) - .unlockedBy("has_seeker_bullet", has(ModItems.SEEKER_BULLET.get())) - .save(conditionalConsumer)) - .build(consumer, RegistryHelper.getRegistryName(ModItems.ENDER_BULLET.get())); - - addBulletPotionRecipe(consumer, ModItems.ENDER_BULLET.get()); - - ConditionalRecipe.builder() - .addCondition(new HandgunEnabledCondition()) - .addRecipe(conditionalConsumer -> - ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.EXORCISM_BULLET.get(), 8) - .requires(ModItems.NEUTRAL_BULLET.get()) - .requires(ModItems.NEUTRAL_BULLET.get()) - .requires(ModItems.NEUTRAL_BULLET.get()) - .requires(ModItems.NEUTRAL_BULLET.get()) - .requires(ModItems.NEUTRAL_BULLET.get()) - .requires(ModItems.NEUTRAL_BULLET.get()) - .requires(ModItems.NEUTRAL_BULLET.get()) - .requires(ModItems.NEUTRAL_BULLET.get()) - .requires(ModItems.ZOMBIE_HEART.get()) - .unlockedBy("has_neutral_bullet", has(ModItems.NEUTRAL_BULLET.get())) - .save(conditionalConsumer)) - .build(consumer, RegistryHelper.getRegistryName(ModItems.EXORCISM_BULLET.get())); - - addBulletPotionRecipe(consumer, ModItems.EXORCISM_BULLET.get()); - - ConditionalRecipe.builder() - .addCondition(new HandgunEnabledCondition()) - .addRecipe(conditionalConsumer -> - ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.NEUTRAL_BULLET.get(), 8) - .requires(Items.FLINT) - .requires(Tags.Items.NUGGETS_GOLD) - .requires(Tags.Items.NUGGETS_GOLD) - .requires(Tags.Items.GUNPOWDER) - .unlockedBy(HAS_GUNPOWDER_CRITERION, has(Items.GUNPOWDER)) - .save(conditionalConsumer)) - .build(consumer, RegistryHelper.getRegistryName(ModItems.NEUTRAL_BULLET.get())); - - addBulletPotionRecipe(consumer, ModItems.NEUTRAL_BULLET.get()); - - ConditionalRecipe.builder() - .addCondition(new HandgunEnabledCondition()) - .addRecipe(conditionalConsumer -> - ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.SAND_BULLET.get(), 8) - .requires(Tags.Items.SANDSTONE) - .requires(Tags.Items.SLIMEBALLS) - .requires(Tags.Items.NUGGETS_GOLD) - .requires(Tags.Items.GUNPOWDER) - .unlockedBy(HAS_GUNPOWDER_CRITERION, has(Items.GUNPOWDER)) - .save(conditionalConsumer)) - .build(consumer, RegistryHelper.getRegistryName(ModItems.SAND_BULLET.get())); - - addBulletPotionRecipe(consumer, ModItems.SAND_BULLET.get()); - - ConditionalRecipe.builder() - .addCondition(new HandgunEnabledCondition()) - .addRecipe(conditionalConsumer -> - ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.SEEKER_BULLET.get(), 8) - .requires(Tags.Items.GEMS_LAPIS) - .requires(Tags.Items.NUGGETS_GOLD) - .requires(Tags.Items.NUGGETS_GOLD) - .requires(Tags.Items.GUNPOWDER) - .unlockedBy(HAS_GUNPOWDER_CRITERION, has(Items.GUNPOWDER)) - .save(conditionalConsumer)) - .build(consumer, RegistryHelper.getRegistryName(ModItems.SEEKER_BULLET.get())); - - addBulletPotionRecipe(consumer, ModItems.SEEKER_BULLET.get()); - - ConditionalRecipe.builder() - .addCondition(new HandgunEnabledCondition()) - .addRecipe(conditionalConsumer -> - ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.STORM_BULLET.get(), 8) - .requires(ModItems.CATALYZING_GLAND.get()) - .requires(ModItems.CATALYZING_GLAND.get()) - .requires(Tags.Items.NUGGETS_GOLD) - .requires(Tags.Items.NUGGETS_GOLD) - .requires(Tags.Items.GUNPOWDER) - .unlockedBy(HAS_GUNPOWDER_CRITERION, has(Items.GUNPOWDER)) - .save(conditionalConsumer)) - .build(consumer, RegistryHelper.getRegistryName(ModItems.STORM_BULLET.get())); - - addBulletPotionRecipe(consumer, ModItems.STORM_BULLET.get()); - - addMagazineRecipe(consumer, ModItems.BLAZE_BULLET.get(), ModItems.BLAZE_MAGAZINE.get()); - addMagazineRecipe(consumer, ModItems.BUSTER_BULLET.get(), ModItems.BUSTER_MAGAZINE.get()); - addMagazineRecipe(consumer, ModItems.CONCUSSIVE_BULLET.get(), ModItems.CONCUSSIVE_MAGAZINE.get()); - addMagazineRecipe(consumer, ModItems.ENDER_BULLET.get(), ModItems.ENDER_MAGAZINE.get()); - addMagazineRecipe(consumer, ModItems.EXORCISM_BULLET.get(), ModItems.EXORCISM_MAGAZINE.get()); - addMagazineRecipe(consumer, ModItems.NEUTRAL_BULLET.get(), ModItems.NEUTRAL_MAGAZINE.get()); - addMagazineRecipe(consumer, ModItems.SAND_BULLET.get(), ModItems.SAND_MAGAZINE.get()); - addMagazineRecipe(consumer, ModItems.SEEKER_BULLET.get(), ModItems.SEEKER_MAGAZINE.get()); - addMagazineRecipe(consumer, ModItems.STORM_BULLET.get(), ModItems.STORM_MAGAZINE.get()); + private void registerHandgunRecipes(RecipeOutput recipeOutput) { + RecipeOutput conditionalHandgunRecipeOutput = recipeOutput.withConditions(new HandgunEnabledCondition()); + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.HANDGUN.get()) + .pattern("BIM") + .pattern("ISI") + .pattern("IGI") + .define('I', Tags.Items.INGOTS_IRON) + .define('B', ModItems.BARREL_ASSEMBLY.get()) + .define('M', ModItems.HAMMER_ASSEMBLY.get()) + .define('G', ModItems.GRIP_ASSEMBLY.get()) + .define('S', ModItems.SLIME_PEARL.get()) + .unlockedBy("has_barrel_assembly", has(ModItems.BARREL_ASSEMBLY.get())) + .save(conditionalHandgunRecipeOutput); + + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.BARREL_ASSEMBLY.get()) + .pattern("III") + .pattern("EME") + .pattern("III") + .define('I', Tags.Items.INGOTS_IRON) + .define('E', ModItems.NEBULOUS_HEART.get()) + .define('M', Items.MAGMA_CREAM) + .unlockedBy(HAS_NEBULOUS_HEART_CRITERION, has(ModItems.NEBULOUS_HEART.get())) + .save(conditionalHandgunRecipeOutput); + + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.GRIP_ASSEMBLY.get()) + .pattern("III") + .pattern("IMI") + .pattern("ICI") + .define('I', Tags.Items.INGOTS_IRON) + .define('C', ModItems.EMPTY_MAGAZINE.get()) + .define('M', Items.MAGMA_CREAM) + .unlockedBy("has_magma_cream", has(Items.MAGMA_CREAM)) + .save(conditionalHandgunRecipeOutput); + + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.EMPTY_MAGAZINE.get()) + .pattern("I I") + .pattern("IGI") + .pattern("SIS") + .define('S', Tags.Items.STONE) + .define('I', Tags.Items.INGOTS_IRON) + .define('G', Tags.Items.GLASS) + .unlockedBy("has_iron_ingot", has(Items.IRON_INGOT)) + .save(conditionalHandgunRecipeOutput); + + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.HAMMER_ASSEMBLY.get()) + .pattern("IIB") + .pattern("RMI") + .pattern("III") + .define('I', Tags.Items.INGOTS_IRON) + .define('B', Items.STONE_BUTTON) + .define('R', Tags.Items.RODS_BLAZE) + .define('M', ModItems.MOLTEN_CORE.get()) + .unlockedBy(HAS_MOLTEN_CORE_CRITERION, has(ModItems.MOLTEN_CORE.get())) + .save(conditionalHandgunRecipeOutput); + + ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.BLAZE_BULLET.get(), 8) + .requires(Items.BLAZE_POWDER) + .requires(Tags.Items.RODS_BLAZE) + .requires(Tags.Items.NUGGETS_GOLD) + .requires(Tags.Items.NUGGETS_GOLD) + .unlockedBy("has_blaze_rod", has(Items.BLAZE_ROD)) + .save(conditionalHandgunRecipeOutput); + + addBulletPotionRecipe(conditionalHandgunRecipeOutput, ModItems.BLAZE_BULLET.get()); + + ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.BUSTER_BULLET.get(), 8) + .requires(ModItems.CONCUSSIVE_BULLET.get()) + .requires(ModItems.CONCUSSIVE_BULLET.get()) + .requires(ModItems.CONCUSSIVE_BULLET.get()) + .requires(ModItems.CONCUSSIVE_BULLET.get()) + .requires(ModItems.CONCUSSIVE_BULLET.get()) + .requires(ModItems.CONCUSSIVE_BULLET.get()) + .requires(ModItems.CONCUSSIVE_BULLET.get()) + .requires(ModItems.CONCUSSIVE_BULLET.get()) + .requires(ModItems.CATALYZING_GLAND.get()) + .unlockedBy("has_concussive_bullet", has(ModItems.CONCUSSIVE_BULLET.get())) + .save(conditionalHandgunRecipeOutput); + + addBulletPotionRecipe(recipeOutput, ModItems.BUSTER_BULLET.get()); + + ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.CONCUSSIVE_BULLET.get(), 8) + .requires(Tags.Items.SLIMEBALLS) + .requires(Tags.Items.NUGGETS_GOLD) + .requires(Tags.Items.NUGGETS_GOLD) + .requires(Tags.Items.GUNPOWDER) + .unlockedBy(HAS_GUNPOWDER_CRITERION, has(Items.GUNPOWDER)) + .save(conditionalHandgunRecipeOutput); + + addBulletPotionRecipe(recipeOutput, ModItems.CONCUSSIVE_BULLET.get()); + + ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.ENDER_BULLET.get(), 8) + .requires(ModItems.SEEKER_BULLET.get()) + .requires(ModItems.SEEKER_BULLET.get()) + .requires(ModItems.SEEKER_BULLET.get()) + .requires(ModItems.SEEKER_BULLET.get()) + .requires(ModItems.SEEKER_BULLET.get()) + .requires(ModItems.SEEKER_BULLET.get()) + .requires(ModItems.SEEKER_BULLET.get()) + .requires(ModItems.SEEKER_BULLET.get()) + .requires(ModItems.NEBULOUS_HEART.get()) + .unlockedBy("has_seeker_bullet", has(ModItems.SEEKER_BULLET.get())) + .save(conditionalHandgunRecipeOutput); + + addBulletPotionRecipe(recipeOutput, ModItems.ENDER_BULLET.get()); + + ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.EXORCISM_BULLET.get(), 8) + .requires(ModItems.NEUTRAL_BULLET.get()) + .requires(ModItems.NEUTRAL_BULLET.get()) + .requires(ModItems.NEUTRAL_BULLET.get()) + .requires(ModItems.NEUTRAL_BULLET.get()) + .requires(ModItems.NEUTRAL_BULLET.get()) + .requires(ModItems.NEUTRAL_BULLET.get()) + .requires(ModItems.NEUTRAL_BULLET.get()) + .requires(ModItems.NEUTRAL_BULLET.get()) + .requires(ModItems.ZOMBIE_HEART.get()) + .unlockedBy("has_neutral_bullet", has(ModItems.NEUTRAL_BULLET.get())) + .save(conditionalHandgunRecipeOutput); + + addBulletPotionRecipe(recipeOutput, ModItems.EXORCISM_BULLET.get()); + + ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.NEUTRAL_BULLET.get(), 8) + .requires(Items.FLINT) + .requires(Tags.Items.NUGGETS_GOLD) + .requires(Tags.Items.NUGGETS_GOLD) + .requires(Tags.Items.GUNPOWDER) + .unlockedBy(HAS_GUNPOWDER_CRITERION, has(Items.GUNPOWDER)) + .save(conditionalHandgunRecipeOutput); + + addBulletPotionRecipe(conditionalHandgunRecipeOutput, ModItems.NEUTRAL_BULLET.get()); + + ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.SAND_BULLET.get(), 8) + .requires(Tags.Items.SANDSTONE) + .requires(Tags.Items.SLIMEBALLS) + .requires(Tags.Items.NUGGETS_GOLD) + .requires(Tags.Items.GUNPOWDER) + .unlockedBy(HAS_GUNPOWDER_CRITERION, has(Items.GUNPOWDER)) + .save(conditionalHandgunRecipeOutput); + + addBulletPotionRecipe(recipeOutput, ModItems.SAND_BULLET.get()); + + ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.SEEKER_BULLET.get(), 8) + .requires(Tags.Items.GEMS_LAPIS) + .requires(Tags.Items.NUGGETS_GOLD) + .requires(Tags.Items.NUGGETS_GOLD) + .requires(Tags.Items.GUNPOWDER) + .unlockedBy(HAS_GUNPOWDER_CRITERION, has(Items.GUNPOWDER)) + .save(conditionalHandgunRecipeOutput); + + addBulletPotionRecipe(conditionalHandgunRecipeOutput, ModItems.SEEKER_BULLET.get()); + + ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.STORM_BULLET.get(), 8) + .requires(ModItems.CATALYZING_GLAND.get()) + .requires(ModItems.CATALYZING_GLAND.get()) + .requires(Tags.Items.NUGGETS_GOLD) + .requires(Tags.Items.NUGGETS_GOLD) + .requires(Tags.Items.GUNPOWDER) + .unlockedBy(HAS_GUNPOWDER_CRITERION, has(Items.GUNPOWDER)) + .save(conditionalHandgunRecipeOutput); + + addBulletPotionRecipe(recipeOutput, ModItems.STORM_BULLET.get()); + + addMagazineRecipe(recipeOutput, ModItems.BLAZE_BULLET.get(), ModItems.BLAZE_MAGAZINE.get()); + addMagazineRecipe(recipeOutput, ModItems.BUSTER_BULLET.get(), ModItems.BUSTER_MAGAZINE.get()); + addMagazineRecipe(recipeOutput, ModItems.CONCUSSIVE_BULLET.get(), ModItems.CONCUSSIVE_MAGAZINE.get()); + addMagazineRecipe(recipeOutput, ModItems.ENDER_BULLET.get(), ModItems.ENDER_MAGAZINE.get()); + addMagazineRecipe(recipeOutput, ModItems.EXORCISM_BULLET.get(), ModItems.EXORCISM_MAGAZINE.get()); + addMagazineRecipe(recipeOutput, ModItems.NEUTRAL_BULLET.get(), ModItems.NEUTRAL_MAGAZINE.get()); + addMagazineRecipe(recipeOutput, ModItems.SAND_BULLET.get(), ModItems.SAND_MAGAZINE.get()); + addMagazineRecipe(recipeOutput, ModItems.SEEKER_BULLET.get(), ModItems.SEEKER_MAGAZINE.get()); + addMagazineRecipe(recipeOutput, ModItems.STORM_BULLET.get(), ModItems.STORM_MAGAZINE.get()); } - private void registerAlkahestryRecipes(Consumer consumer) { - ConditionalRecipe.builder() - .addCondition(new AlkahestryEnabledCondition()) - .addRecipe(conditionalConsumer -> - ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.ALKAHESTRY_TOME.get()) - .requires(ModItems.MOLTEN_CORE.get()) - .requires(ModItems.WITCH_HAT.get()) - .requires(ModItems.EYE_OF_THE_STORM.get()) - .requires(ModItems.CATALYZING_GLAND.get()) - .requires(Items.BOOK) - .requires(ModItems.SLIME_PEARL.get()) - .requires(ModItems.CHELICERAE.get()) - .requires(Items.WITHER_SKELETON_SKULL) - .requires(ModItems.NEBULOUS_HEART.get()) - .unlockedBy(HAS_WITCH_HAT_CRITERION, has(ModItems.WITCH_HAT.get())) - .save(conditionalConsumer)) - .build(consumer, RegistryHelper.getRegistryName(ModItems.ALKAHESTRY_TOME.get())); - - ChargingRecipeBuilder.chargingRecipe(Items.GLOWSTONE_DUST, 1).build(consumer, RegistryHelper.getRegistryName(Items.GLOWSTONE_DUST)); - ChargingRecipeBuilder.chargingRecipe(Items.GLOWSTONE, 4).build(consumer, RegistryHelper.getRegistryName(Items.GLOWSTONE)); - ChargingRecipeBuilder.chargingRecipe(Items.REDSTONE, 1).build(consumer, RegistryHelper.getRegistryName(Items.REDSTONE)); - ChargingRecipeBuilder.chargingRecipe(Items.REDSTONE_BLOCK, 9).build(consumer, RegistryHelper.getRegistryName(Items.REDSTONE_BLOCK)); - - DrainRecipeBuilder.drainRecipe(Items.REDSTONE, 1).build(consumer, RegistryHelper.getRegistryName(Items.REDSTONE)); - - CraftingRecipeBuilder.craftingRecipe(Items.CHARCOAL, 4, 5).build(consumer, RegistryHelper.getRegistryName(Items.CHARCOAL)); - CraftingRecipeBuilder.craftingRecipe(Items.CLAY, 4, 3).build(consumer, RegistryHelper.getRegistryName(Items.CLAY)); + private void registerAlkahestryRecipes(RecipeOutput recipeOutput) { + ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.ALKAHESTRY_TOME.get()) + .requires(ModItems.MOLTEN_CORE.get()) + .requires(ModItems.WITCH_HAT.get()) + .requires(ModItems.EYE_OF_THE_STORM.get()) + .requires(ModItems.CATALYZING_GLAND.get()) + .requires(Items.BOOK) + .requires(ModItems.SLIME_PEARL.get()) + .requires(ModItems.CHELICERAE.get()) + .requires(Items.WITHER_SKELETON_SKULL) + .requires(ModItems.NEBULOUS_HEART.get()) + .unlockedBy(HAS_WITCH_HAT_CRITERION, has(ModItems.WITCH_HAT.get())) + .save(recipeOutput.withConditions(new AlkahestryEnabledCondition())); + + ChargingRecipeBuilder.chargingRecipe(Items.GLOWSTONE_DUST, 1).build(recipeOutput, RegistryHelper.getRegistryName(Items.GLOWSTONE_DUST)); + ChargingRecipeBuilder.chargingRecipe(Items.GLOWSTONE, 4).build(recipeOutput, RegistryHelper.getRegistryName(Items.GLOWSTONE)); + ChargingRecipeBuilder.chargingRecipe(Items.REDSTONE, 1).build(recipeOutput, RegistryHelper.getRegistryName(Items.REDSTONE)); + ChargingRecipeBuilder.chargingRecipe(Items.REDSTONE_BLOCK, 9).build(recipeOutput, RegistryHelper.getRegistryName(Items.REDSTONE_BLOCK)); + + DrainRecipeBuilder.drainRecipe(Items.REDSTONE, 1).build(recipeOutput, RegistryHelper.getRegistryName(Items.REDSTONE)); + + CraftingRecipeBuilder.craftingRecipe(Items.CHARCOAL, 4, 5).save(recipeOutput, RegistryHelper.getRegistryName(Items.CHARCOAL)); + CraftingRecipeBuilder.craftingRecipe(Items.CLAY, 4, 3).save(recipeOutput, RegistryHelper.getRegistryName(Items.CLAY)); CraftingRecipeBuilder.craftingRecipe(INGOTS_COPPER, 8, 5) - .addCondition(new NotCondition(new TagEmptyCondition(INGOTS_COPPER.location()))) - .build(consumer, new ResourceLocation("copper_ingot")); - CraftingRecipeBuilder.craftingRecipe(Tags.Items.GEMS_DIAMOND, 64, 2).build(consumer, RegistryHelper.getRegistryName(Items.DIAMOND)); - CraftingRecipeBuilder.craftingRecipe(Items.DIRT, 4, 33).build(consumer, RegistryHelper.getRegistryName(Items.DIRT)); - CraftingRecipeBuilder.craftingRecipe(Tags.Items.GEMS_EMERALD, 32, 2).build(consumer, RegistryHelper.getRegistryName(Items.EMERALD)); - CraftingRecipeBuilder.craftingRecipe(Tags.Items.END_STONES, 8, 17).build(consumer, RegistryHelper.getRegistryName(Items.END_STONE)); - CraftingRecipeBuilder.craftingRecipe(Items.FLINT, 8, 9).build(consumer, RegistryHelper.getRegistryName(Items.FLINT)); - CraftingRecipeBuilder.craftingRecipe(Tags.Items.INGOTS_GOLD, 32, 2).build(consumer, RegistryHelper.getRegistryName(Items.GOLD_INGOT)); - CraftingRecipeBuilder.craftingRecipe(Tags.Items.GRAVEL, 4, 17).build(consumer, RegistryHelper.getRegistryName(Items.GRAVEL)); - CraftingRecipeBuilder.craftingRecipe(Tags.Items.GUNPOWDER, 8, 3).build(consumer, RegistryHelper.getRegistryName(Items.GUNPOWDER)); - CraftingRecipeBuilder.craftingRecipe(Tags.Items.INGOTS_IRON, 32, 2).build(consumer, RegistryHelper.getRegistryName(Items.IRON_INGOT)); - CraftingRecipeBuilder.craftingRecipe(Tags.Items.GEMS_LAPIS, 4, 2).build(consumer, RegistryHelper.getRegistryName(Items.LAPIS_LAZULI)); - CraftingRecipeBuilder.craftingRecipe(Tags.Items.NETHER_STARS, 256, 2).build(consumer, RegistryHelper.getRegistryName(Items.NETHER_STAR)); - CraftingRecipeBuilder.craftingRecipe(Tags.Items.NETHERRACK, 4, 9).build(consumer, RegistryHelper.getRegistryName(Items.NETHERRACK)); - CraftingRecipeBuilder.craftingRecipe(Tags.Items.OBSIDIAN, 8, 5).build(consumer, RegistryHelper.getRegistryName(Items.OBSIDIAN)); - CraftingRecipeBuilder.craftingRecipe(Tags.Items.SAND, 4, 33).build(consumer, RegistryHelper.getRegistryName(Items.SAND)); - CraftingRecipeBuilder.craftingRecipe(Tags.Items.SANDSTONE, 4, 9).build(consumer, RegistryHelper.getRegistryName(Items.SANDSTONE)); + .save(recipeOutput.withConditions(new NotCondition(new TagEmptyCondition(INGOTS_COPPER.location()))), new ResourceLocation("copper_ingot")); + CraftingRecipeBuilder.craftingRecipe(Tags.Items.GEMS_DIAMOND, 64, 2).save(recipeOutput, RegistryHelper.getRegistryName(Items.DIAMOND)); + CraftingRecipeBuilder.craftingRecipe(Items.DIRT, 4, 33).save(recipeOutput, RegistryHelper.getRegistryName(Items.DIRT)); + CraftingRecipeBuilder.craftingRecipe(Tags.Items.GEMS_EMERALD, 32, 2).save(recipeOutput, RegistryHelper.getRegistryName(Items.EMERALD)); + CraftingRecipeBuilder.craftingRecipe(Tags.Items.END_STONES, 8, 17).save(recipeOutput, RegistryHelper.getRegistryName(Items.END_STONE)); + CraftingRecipeBuilder.craftingRecipe(Items.FLINT, 8, 9).save(recipeOutput, RegistryHelper.getRegistryName(Items.FLINT)); + CraftingRecipeBuilder.craftingRecipe(Tags.Items.INGOTS_GOLD, 32, 2).save(recipeOutput, RegistryHelper.getRegistryName(Items.GOLD_INGOT)); + CraftingRecipeBuilder.craftingRecipe(Tags.Items.GRAVEL, 4, 17).save(recipeOutput, RegistryHelper.getRegistryName(Items.GRAVEL)); + CraftingRecipeBuilder.craftingRecipe(Tags.Items.GUNPOWDER, 8, 3).save(recipeOutput, RegistryHelper.getRegistryName(Items.GUNPOWDER)); + CraftingRecipeBuilder.craftingRecipe(Tags.Items.INGOTS_IRON, 32, 2).save(recipeOutput, RegistryHelper.getRegistryName(Items.IRON_INGOT)); + CraftingRecipeBuilder.craftingRecipe(Tags.Items.GEMS_LAPIS, 4, 2).save(recipeOutput, RegistryHelper.getRegistryName(Items.LAPIS_LAZULI)); + CraftingRecipeBuilder.craftingRecipe(Tags.Items.NETHER_STARS, 256, 2).save(recipeOutput, RegistryHelper.getRegistryName(Items.NETHER_STAR)); + CraftingRecipeBuilder.craftingRecipe(Tags.Items.NETHERRACK, 4, 9).save(recipeOutput, RegistryHelper.getRegistryName(Items.NETHERRACK)); + CraftingRecipeBuilder.craftingRecipe(Tags.Items.OBSIDIAN, 8, 5).save(recipeOutput, RegistryHelper.getRegistryName(Items.OBSIDIAN)); + CraftingRecipeBuilder.craftingRecipe(Tags.Items.SAND, 4, 33).save(recipeOutput, RegistryHelper.getRegistryName(Items.SAND)); + CraftingRecipeBuilder.craftingRecipe(Tags.Items.SANDSTONE, 4, 9).save(recipeOutput, RegistryHelper.getRegistryName(Items.SANDSTONE)); CraftingRecipeBuilder.craftingRecipe(INGOTS_SILVER, 32, 2) - .addCondition(new NotCondition(new TagEmptyCondition(INGOTS_SILVER.location()))) - .build(consumer, new ResourceLocation("silver_ingot")); - CraftingRecipeBuilder.craftingRecipe(Items.SOUL_SAND, 8, 9).build(consumer, RegistryHelper.getRegistryName(Items.SOUL_SAND)); + .save(recipeOutput.withConditions(new NotCondition(new TagEmptyCondition(INGOTS_SILVER.location()))), new ResourceLocation("silver_ingot")); + CraftingRecipeBuilder.craftingRecipe(Items.SOUL_SAND, 8, 9).save(recipeOutput, RegistryHelper.getRegistryName(Items.SOUL_SAND)); CraftingRecipeBuilder.craftingRecipe(INGOTS_STEEL, 32, 2) - .addCondition(new NotCondition(new TagEmptyCondition(INGOTS_STEEL.location()))) - .build(consumer, new ResourceLocation("steel_ingot")); + .save(recipeOutput.withConditions(new NotCondition(new TagEmptyCondition(INGOTS_STEEL.location()))), new ResourceLocation("steel_ingot")); CraftingRecipeBuilder.craftingRecipe(INGOTS_TIN, 32, 2) - .addCondition(new NotCondition(new TagEmptyCondition(INGOTS_TIN.location()))) - .build(consumer, new ResourceLocation("tin_ingot")); + .save(recipeOutput.withConditions(new NotCondition(new TagEmptyCondition(INGOTS_TIN.location()))), new ResourceLocation("tin_ingot")); } - private void registerPotionRecipes(Consumer consumer) { - ConditionalRecipe.builder() - .addCondition(new PotionsEnabledCondition()) - .addRecipe(conditionalConsumer -> - ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.EMPTY_POTION_VIAL.get()) - .pattern("G G") - .pattern("G G") - .pattern(" G ") - .define('G', Tags.Items.GLASS_PANES) - .unlockedBy("has_glass_pane", has(Items.GLASS_PANE)) - .save(conditionalConsumer)) - .build(consumer, RegistryHelper.getRegistryName(ModItems.EMPTY_POTION_VIAL.get())); - - ConditionalRecipe.builder() - .addCondition(new PotionsEnabledCondition()) - .addRecipe(conditionalConsumer -> - ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.APHRODITE_POTION.get()) - .pattern("GBG") - .pattern("GFG") - .pattern("RGC") - .define('G', Tags.Items.GLASS_PANES) - .define('B', Items.WATER_BUCKET) - .define('F', ModItems.FERTILE_ESSENCE.get()) - .define('R', Tags.Items.DYES_RED) - .define('C', Items.COCOA_BEANS) - .unlockedBy(HAS_FERTILE_ESSENCE_CRITERION, has(ModItems.FERTILE_ESSENCE.get())) - .save(conditionalConsumer)) - .build(consumer, RegistryHelper.getRegistryName(ModItems.APHRODITE_POTION.get())); - - ConditionalRecipe.builder() - .addCondition(new PotionsEnabledCondition()) - .addRecipe(conditionalConsumer -> - ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.FERTILE_POTION.get()) - .pattern("GBG") - .pattern("GFG") - .pattern("CGY") - .define('G', Tags.Items.GLASS_PANES) - .define('B', Items.WATER_BUCKET) - .define('F', ModItems.FERTILE_ESSENCE.get()) - .define('C', Tags.Items.DYES_GREEN) - .define('Y', Tags.Items.DYES_YELLOW) - .unlockedBy(HAS_FERTILE_ESSENCE_CRITERION, has(ModItems.FERTILE_ESSENCE.get())) - .save(conditionalConsumer)) - .build(consumer, RegistryHelper.getRegistryName(ModItems.FERTILE_POTION.get())); - - addItemPotionRecipe(consumer, Items.ARROW, ModItems.TIPPED_ARROW.get(), 0.125f, 'A', false); - - ConditionalRecipe.builder() - .addCondition(new PotionsEnabledCondition()) - .addRecipe(conditionalConsumer -> - ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModBlocks.APOTHECARY_CAULDRON_ITEM.get()) - .pattern("GNG") - .pattern("ICI") - .pattern("NMN") - .define('G', ModItems.CATALYZING_GLAND.get()) - .define('N', ModItems.NEBULOUS_HEART.get()) - .define('I', ModItems.INFERNAL_CLAW.get()) - .define('C', Items.CAULDRON) - .define('M', ModItems.MOLTEN_CORE.get()) - .unlockedBy(HAS_NEBULOUS_HEART_CRITERION, has(ModItems.NEBULOUS_HEART.get())) - .save(conditionalConsumer)) - .build(consumer, RegistryHelper.getRegistryName(ModBlocks.APOTHECARY_CAULDRON_ITEM.get())); - - ConditionalRecipe.builder() - .addCondition(new PotionsEnabledCondition()) - .addRecipe(conditionalConsumer -> - ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModBlocks.APOTHECARY_MORTAR_ITEM.get()) - .pattern("GNG") - .pattern("NGN") - .pattern("NNN") - .define('G', ModItems.CATALYZING_GLAND.get()) - .define('N', Tags.Items.STORAGE_BLOCKS_QUARTZ) - .unlockedBy(HAS_CATALYZING_GLAND_CRITERIION, has(ModItems.CATALYZING_GLAND.get())) - .save(conditionalConsumer)) - .build(consumer, RegistryHelper.getRegistryName(ModBlocks.APOTHECARY_MORTAR_ITEM.get())); + private void registerPotionRecipes(RecipeOutput recipeOutput) { + RecipeOutput potionsEnabledRecipeOutput = recipeOutput.withConditions(new PotionsEnabledCondition()); + + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.EMPTY_POTION_VIAL.get()) + .pattern("G G") + .pattern("G G") + .pattern(" G ") + .define('G', Tags.Items.GLASS_PANES) + .unlockedBy("has_glass_pane", has(Items.GLASS_PANE)) + .save(potionsEnabledRecipeOutput); + + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.APHRODITE_POTION.get()) + .pattern("GBG") + .pattern("GFG") + .pattern("RGC") + .define('G', Tags.Items.GLASS_PANES) + .define('B', Items.WATER_BUCKET) + .define('F', ModItems.FERTILE_ESSENCE.get()) + .define('R', Tags.Items.DYES_RED) + .define('C', Items.COCOA_BEANS) + .unlockedBy(HAS_FERTILE_ESSENCE_CRITERION, has(ModItems.FERTILE_ESSENCE.get())) + .save(potionsEnabledRecipeOutput); + + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.FERTILE_POTION.get()) + .pattern("GBG") + .pattern("GFG") + .pattern("CGY") + .define('G', Tags.Items.GLASS_PANES) + .define('B', Items.WATER_BUCKET) + .define('F', ModItems.FERTILE_ESSENCE.get()) + .define('C', Tags.Items.DYES_GREEN) + .define('Y', Tags.Items.DYES_YELLOW) + .unlockedBy(HAS_FERTILE_ESSENCE_CRITERION, has(ModItems.FERTILE_ESSENCE.get())) + .save(potionsEnabledRecipeOutput); + + addItemPotionRecipe(potionsEnabledRecipeOutput, Items.ARROW, ModItems.TIPPED_ARROW.get(), 0.125f, 'A', false); + + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModBlocks.APOTHECARY_CAULDRON_ITEM.get()) + .pattern("GNG") + .pattern("ICI") + .pattern("NMN") + .define('G', ModItems.CATALYZING_GLAND.get()) + .define('N', ModItems.NEBULOUS_HEART.get()) + .define('I', ModItems.INFERNAL_CLAW.get()) + .define('C', Items.CAULDRON) + .define('M', ModItems.MOLTEN_CORE.get()) + .unlockedBy(HAS_NEBULOUS_HEART_CRITERION, has(ModItems.NEBULOUS_HEART.get())) + .save(potionsEnabledRecipeOutput); + + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModBlocks.APOTHECARY_MORTAR_ITEM.get()) + .pattern("GNG") + .pattern("NGN") + .pattern("NNN") + .define('G', ModItems.CATALYZING_GLAND.get()) + .define('N', Tags.Items.STORAGE_BLOCKS_QUARTZ) + .unlockedBy(HAS_CATALYZING_GLAND_CRITERIION, has(ModItems.CATALYZING_GLAND.get())) + .save(potionsEnabledRecipeOutput); } - private void registerPedestalRecipes(Consumer consumer) { - addPassivePedestalRecipe(consumer, Items.WHITE_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.WHITE).get()); - addPassivePedestalRecipe(consumer, Items.ORANGE_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.ORANGE).get()); - addPassivePedestalRecipe(consumer, Items.MAGENTA_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.MAGENTA).get()); - addPassivePedestalRecipe(consumer, Items.LIGHT_BLUE_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.LIGHT_BLUE).get()); - addPassivePedestalRecipe(consumer, Items.YELLOW_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.YELLOW).get()); - addPassivePedestalRecipe(consumer, Items.LIME_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.LIME).get()); - addPassivePedestalRecipe(consumer, Items.PINK_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.PINK).get()); - addPassivePedestalRecipe(consumer, Items.GRAY_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.GRAY).get()); - addPassivePedestalRecipe(consumer, Items.LIGHT_GRAY_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.LIGHT_GRAY).get()); - addPassivePedestalRecipe(consumer, Items.CYAN_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.CYAN).get()); - addPassivePedestalRecipe(consumer, Items.PURPLE_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.PURPLE).get()); - addPassivePedestalRecipe(consumer, Items.BLUE_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.BLUE).get()); - addPassivePedestalRecipe(consumer, Items.BROWN_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.BROWN).get()); - addPassivePedestalRecipe(consumer, Items.GREEN_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.GREEN).get()); - addPassivePedestalRecipe(consumer, Items.RED_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.RED).get()); - addPassivePedestalRecipe(consumer, Items.BLACK_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.BLACK).get()); + private void registerPedestalRecipes(RecipeOutput recipeOutput) { + addPassivePedestalRecipe(recipeOutput, Items.WHITE_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.WHITE).get()); + addPassivePedestalRecipe(recipeOutput, Items.ORANGE_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.ORANGE).get()); + addPassivePedestalRecipe(recipeOutput, Items.MAGENTA_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.MAGENTA).get()); + addPassivePedestalRecipe(recipeOutput, Items.LIGHT_BLUE_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.LIGHT_BLUE).get()); + addPassivePedestalRecipe(recipeOutput, Items.YELLOW_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.YELLOW).get()); + addPassivePedestalRecipe(recipeOutput, Items.LIME_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.LIME).get()); + addPassivePedestalRecipe(recipeOutput, Items.PINK_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.PINK).get()); + addPassivePedestalRecipe(recipeOutput, Items.GRAY_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.GRAY).get()); + addPassivePedestalRecipe(recipeOutput, Items.LIGHT_GRAY_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.LIGHT_GRAY).get()); + addPassivePedestalRecipe(recipeOutput, Items.CYAN_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.CYAN).get()); + addPassivePedestalRecipe(recipeOutput, Items.PURPLE_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.PURPLE).get()); + addPassivePedestalRecipe(recipeOutput, Items.BLUE_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.BLUE).get()); + addPassivePedestalRecipe(recipeOutput, Items.BROWN_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.BROWN).get()); + addPassivePedestalRecipe(recipeOutput, Items.GREEN_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.GREEN).get()); + addPassivePedestalRecipe(recipeOutput, Items.RED_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.RED).get()); + addPassivePedestalRecipe(recipeOutput, Items.BLACK_CARPET, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.BLACK).get()); for (DyeColor color : DyeColor.values()) { - addPedestalRecipe(consumer, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(color).get(), ModBlocks.PEDESTAL_ITEMS.get(color).get()); + addPedestalRecipe(recipeOutput, ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(color).get(), ModBlocks.PEDESTAL_ITEMS.get(color).get()); } } - private void registerCraftableMobDropRecipes(Consumer consumer) { - addCraftableMobDropRecipe(consumer, ModItems.BAT_WING.get(), builder -> + private void registerCraftableMobDropRecipes(RecipeOutput recipeOutput) { + addCraftableMobDropRecipe(recipeOutput, ModItems.BAT_WING.get(), builder -> builder .pattern("GGG") .pattern("GFG") @@ -1006,7 +905,7 @@ private void registerCraftableMobDropRecipes(Consumer consumer) .unlockedBy("has_feather", hasTag(Tags.Items.FEATHERS)) ); - addCraftableMobDropRecipe(consumer, ModItems.CATALYZING_GLAND.get(), builder -> + addCraftableMobDropRecipe(recipeOutput, ModItems.CATALYZING_GLAND.get(), builder -> builder .pattern("GGG") .pattern("GPG") @@ -1016,7 +915,7 @@ private void registerCraftableMobDropRecipes(Consumer consumer) .unlockedBy(HAS_GUNPOWDER_CRITERION, hasTag(Tags.Items.GUNPOWDER)) ); - addCraftableMobDropRecipe(consumer, ModItems.CHELICERAE.get(), builder -> + addCraftableMobDropRecipe(recipeOutput, ModItems.CHELICERAE.get(), builder -> builder .pattern("GGG") .pattern("GSG") @@ -1026,7 +925,7 @@ private void registerCraftableMobDropRecipes(Consumer consumer) .unlockedBy("has_string", hasTag(Tags.Items.STRING)) ); - addCraftableMobDropRecipe(consumer, ModItems.FROZEN_CORE.get(), builder -> + addCraftableMobDropRecipe(recipeOutput, ModItems.FROZEN_CORE.get(), builder -> builder .pattern("GPG") .pattern("GSG") @@ -1037,7 +936,7 @@ private void registerCraftableMobDropRecipes(Consumer consumer) .unlockedBy("has_snow", has(Items.SNOW)) ); - addCraftableMobDropRecipe(consumer, ModItems.GUARDIAN_SPIKE.get(), builder -> + addCraftableMobDropRecipe(recipeOutput, ModItems.GUARDIAN_SPIKE.get(), builder -> builder .pattern("GGG") .pattern("GPG") @@ -1047,7 +946,7 @@ private void registerCraftableMobDropRecipes(Consumer consumer) .unlockedBy("has_prismarine", hasTag(Tags.Items.DUSTS_PRISMARINE)) ); - addCraftableMobDropRecipe(consumer, ModItems.MOLTEN_CORE.get(), builder -> + addCraftableMobDropRecipe(recipeOutput, ModItems.MOLTEN_CORE.get(), builder -> builder .pattern("GGG") .pattern("GMG") @@ -1057,7 +956,7 @@ private void registerCraftableMobDropRecipes(Consumer consumer) .unlockedBy("has_magma_cream", has(Items.MAGMA_CREAM)) ); - addCraftableMobDropRecipe(consumer, ModItems.NEBULOUS_HEART.get(), builder -> + addCraftableMobDropRecipe(recipeOutput, ModItems.NEBULOUS_HEART.get(), builder -> builder .pattern("GGG") .pattern("GEG") @@ -1067,7 +966,7 @@ private void registerCraftableMobDropRecipes(Consumer consumer) .unlockedBy("has_ender_pearl", hasTag(Tags.Items.ENDER_PEARLS)) ); - addCraftableMobDropRecipe(consumer, ModItems.RIB_BONE.get(), builder -> + addCraftableMobDropRecipe(recipeOutput, ModItems.RIB_BONE.get(), builder -> builder .pattern("III") .pattern("IBI") @@ -1077,7 +976,7 @@ private void registerCraftableMobDropRecipes(Consumer consumer) .unlockedBy("has_bone", hasTag(Tags.Items.BONES)) ); - addCraftableMobDropRecipe(consumer, ModItems.SLIME_PEARL.get(), builder -> + addCraftableMobDropRecipe(recipeOutput, ModItems.SLIME_PEARL.get(), builder -> builder .pattern("III") .pattern("ISI") @@ -1087,7 +986,7 @@ private void registerCraftableMobDropRecipes(Consumer consumer) .unlockedBy("has_slimeball", hasTag(Tags.Items.SLIMEBALLS)) ); - addCraftableMobDropRecipe(consumer, ModItems.SQUID_BEAK.get(), builder -> + addCraftableMobDropRecipe(recipeOutput, ModItems.SQUID_BEAK.get(), builder -> builder .pattern("GGG") .pattern("GIG") @@ -1097,7 +996,7 @@ private void registerCraftableMobDropRecipes(Consumer consumer) .unlockedBy("has_ink_sac", has(Items.INK_SAC)) ); - addCraftableMobDropRecipe(consumer, ModItems.EYE_OF_THE_STORM.get(), builder -> + addCraftableMobDropRecipe(recipeOutput, ModItems.EYE_OF_THE_STORM.get(), builder -> builder .pattern("GGG") .pattern("GCG") @@ -1107,7 +1006,7 @@ private void registerCraftableMobDropRecipes(Consumer consumer) .unlockedBy(HAS_CATALYZING_GLAND_CRITERIION, has(ModItems.CATALYZING_GLAND.get())) ); - addCraftableMobDropRecipe(consumer, ModItems.WITHERED_RIB.get(), builder -> + addCraftableMobDropRecipe(recipeOutput, ModItems.WITHERED_RIB.get(), builder -> builder .pattern("D D") .pattern(" S ") @@ -1117,7 +1016,7 @@ private void registerCraftableMobDropRecipes(Consumer consumer) .unlockedBy("has_skeleton_skull", has(Items.SKELETON_SKULL)) ); - addCraftableMobDropRecipe(consumer, ModItems.ZOMBIE_HEART.get(), builder -> + addCraftableMobDropRecipe(recipeOutput, ModItems.ZOMBIE_HEART.get(), builder -> builder .pattern("III") .pattern("IFI") @@ -1128,14 +1027,14 @@ private void registerCraftableMobDropRecipes(Consumer consumer) ); } - private void registerIngredientRecipes(Consumer consumer) { + private void registerIngredientRecipes(RecipeOutput recipeOutput) { ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.CRIMSON_CLOTH.get()) .requires(Items.RED_WOOL) .requires(Items.BLACK_WOOL) .requires(ModItems.NEBULOUS_HEART.get()) .requires(ModItems.NEBULOUS_HEART.get()) .unlockedBy(HAS_NEBULOUS_HEART_CRITERION, has(ModItems.NEBULOUS_HEART.get())) - .save(consumer); + .save(recipeOutput); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.FERTILE_ESSENCE.get()) .requires(ModItems.RIB_BONE.get()) @@ -1143,7 +1042,7 @@ private void registerIngredientRecipes(Consumer consumer) { .requires(Tags.Items.DYES_GREEN) .requires(ModItems.SLIME_PEARL.get()) .unlockedBy(HAS_SLIME_PEARL_CRITERION, has(ModItems.SLIME_PEARL.get())) - .save(consumer); + .save(recipeOutput); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.INFERNAL_CLAW.get()) .requires(Tags.Items.LEATHER) @@ -1151,7 +1050,7 @@ private void registerIngredientRecipes(Consumer consumer) { .requires(ModItems.RIB_BONE.get()) .requires(ModItems.SLIME_PEARL.get()) .unlockedBy(HAS_SLIME_PEARL_CRITERION, has(ModItems.SLIME_PEARL.get())) - .save(consumer); + .save(recipeOutput); ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.KRAKEN_SHELL_FRAGMENT.get()) .requires(ModItems.SQUID_BEAK.get()) @@ -1159,227 +1058,209 @@ private void registerIngredientRecipes(Consumer consumer) { .requires(ModItems.SQUID_BEAK.get()) .requires(ModItems.SLIME_PEARL.get()) .unlockedBy("has_squid_beak", has(ModItems.SQUID_BEAK.get())) - .save(consumer); + .save(recipeOutput); } - private void registerCharmFragmentRecipes(Consumer consumer) { - NbtShapedRecipeBuilder.shapedRecipe(ModItems.MOB_CHARM_FRAGMENT.get().getStackFor("minecraft:blaze")) - .patternLine("PPP") - .patternLine("STS") - .patternLine("PPP") - .key('P', ModItems.MOLTEN_CORE.get()) - .key('S', Tags.Items.RODS_BLAZE) - .key('T', Items.BLAZE_POWDER) - .addCriterion(HAS_MOLTEN_CORE_CRITERION, has(ModItems.MOLTEN_CORE.get())) - .build(consumer, new ResourceLocation(Reference.MOD_ID, MOB_CHARM_FRAGMENTS_FOLDER + "blaze")); - - NbtShapedRecipeBuilder.shapedRecipe(ModItems.MOB_CHARM_FRAGMENT.get().getStackFor("minecraft:cave_spider")) - .patternLine("PPP") - .patternLine("STS") - .patternLine("PPP") - .key('P', ModItems.CHELICERAE.get()) - .key('S', Tags.Items.STRING) - .key('T', instantiateNBTIngredient(PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.POISON))) - .addCriterion(HAS_CHELICERAE_CRITERION, has(ModItems.CHELICERAE.get())) - .build(consumer, new ResourceLocation(Reference.MOD_ID, MOB_CHARM_FRAGMENTS_FOLDER + "cave_spider")); - - NbtShapedRecipeBuilder.shapedRecipe(ModItems.MOB_CHARM_FRAGMENT.get().getStackFor("minecraft:creeper")) - .patternLine("PPP") - .patternLine("STS") - .patternLine("PPP") - .key('P', ModItems.CATALYZING_GLAND.get()) - .key('S', Tags.Items.GUNPOWDER) - .key('T', Items.BONE) - .addCriterion(HAS_CATALYZING_GLAND_CRITERIION, has(ModItems.CATALYZING_GLAND.get())) - .build(consumer, new ResourceLocation(Reference.MOD_ID, MOB_CHARM_FRAGMENTS_FOLDER + "creeper")); - - NbtShapedRecipeBuilder.shapedRecipe(ModItems.MOB_CHARM_FRAGMENT.get().getStackFor("minecraft:enderman")) - .patternLine("PPP") - .patternLine("SPS") - .patternLine("PPP") - .key('P', ModItems.NEBULOUS_HEART.get()) - .key('S', Tags.Items.ENDER_PEARLS) - .addCriterion(HAS_NEBULOUS_HEART_CRITERION, has(ModItems.NEBULOUS_HEART.get())) - .build(consumer, new ResourceLocation(Reference.MOD_ID, MOB_CHARM_FRAGMENTS_FOLDER + "enderman")); - - NbtShapedRecipeBuilder.shapedRecipe(ModItems.MOB_CHARM_FRAGMENT.get().getStackFor("minecraft:ghast")) - .patternLine("PPP") - .patternLine("STS") - .patternLine("PPP") - .key('P', Items.GHAST_TEAR) - .key('S', Tags.Items.GUNPOWDER) - .key('T', ModItems.CATALYZING_GLAND.get()) - .addCriterion(HAS_CATALYZING_GLAND_CRITERIION, has(ModItems.CATALYZING_GLAND.get())) - .build(consumer, new ResourceLocation(Reference.MOD_ID, MOB_CHARM_FRAGMENTS_FOLDER + "ghast")); - - NbtShapedRecipeBuilder.shapedRecipe(ModItems.MOB_CHARM_FRAGMENT.get().getStackFor("minecraft:guardian")) - .patternLine("PPP") - .patternLine("STS") - .patternLine("PPP") - .key('P', ModItems.GUARDIAN_SPIKE.get()) - .key('S', Tags.Items.DUSTS_PRISMARINE) - .key('T', Items.COD) - .addCriterion(HAS_GUARDIAN_SPIKE_CRITERION, has(ModItems.GUARDIAN_SPIKE.get())) - .build(consumer, new ResourceLocation(Reference.MOD_ID, MOB_CHARM_FRAGMENTS_FOLDER + "guardian")); - - NbtShapedRecipeBuilder.shapedRecipe(ModItems.MOB_CHARM_FRAGMENT.get().getStackFor("minecraft:magma_cube")) - .patternLine("PPP") - .patternLine("SSS") - .patternLine("PPP") - .key('P', ModItems.MOLTEN_CORE.get()) - .key('S', Items.MAGMA_CREAM) - .addCriterion(HAS_MOLTEN_CORE_CRITERION, has(ModItems.MOLTEN_CORE.get())) - .build(consumer, new ResourceLocation(Reference.MOD_ID, MOB_CHARM_FRAGMENTS_FOLDER + "magma_cube")); - - NbtShapedRecipeBuilder.shapedRecipe(ModItems.MOB_CHARM_FRAGMENT.get().getStackFor("minecraft:skeleton")) - .patternLine("PPP") - .patternLine("STS") - .patternLine("PPP") - .key('P', ModItems.RIB_BONE.get()) - .key('S', Items.BONE) - .key('T', Items.FLINT) - .addCriterion("has_rib_bone", has(ModItems.RIB_BONE.get())) - .build(consumer, new ResourceLocation(Reference.MOD_ID, MOB_CHARM_FRAGMENTS_FOLDER + "skeleton")); - - NbtShapedRecipeBuilder.shapedRecipe(ModItems.MOB_CHARM_FRAGMENT.get().getStackFor("minecraft:slime")) - .patternLine("PPP") - .patternLine("SSS") - .patternLine("PPP") - .key('P', ModItems.SLIME_PEARL.get()) - .key('S', Tags.Items.SLIMEBALLS) - .addCriterion(HAS_SLIME_PEARL_CRITERION, has(ModItems.SLIME_PEARL.get())) - .build(consumer, new ResourceLocation(Reference.MOD_ID, MOB_CHARM_FRAGMENTS_FOLDER + "slime")); - - NbtShapedRecipeBuilder.shapedRecipe(ModItems.MOB_CHARM_FRAGMENT.get().getStackFor("minecraft:spider")) - .patternLine("PPP") - .patternLine("STS") - .patternLine("PPP") - .key('P', ModItems.CHELICERAE.get()) - .key('S', Tags.Items.STRING) - .key('T', Items.SPIDER_EYE) - .addCriterion(HAS_CHELICERAE_CRITERION, has(ModItems.CHELICERAE.get())) - .build(consumer, new ResourceLocation(Reference.MOD_ID, MOB_CHARM_FRAGMENTS_FOLDER + "spider")); - - NbtShapedRecipeBuilder.shapedRecipe(ModItems.MOB_CHARM_FRAGMENT.get().getStackFor("minecraft:witch")) - .patternLine("PPP") - .patternLine("STS") - .patternLine("PPP") - .key('P', ModItems.WITCH_HAT.get()) - .key('S', Items.GLASS_BOTTLE) - .key('T', Items.SPIDER_EYE) - .addCriterion(HAS_WITCH_HAT_CRITERION, has(ModItems.WITCH_HAT.get())) - .build(consumer, new ResourceLocation(Reference.MOD_ID, MOB_CHARM_FRAGMENTS_FOLDER + "witch")); - - NbtShapedRecipeBuilder.shapedRecipe(ModItems.MOB_CHARM_FRAGMENT.get().getStackFor("minecraft:wither_skeleton")) - .patternLine("PPP") - .patternLine("STS") - .patternLine("PPP") - .key('P', ModItems.WITHERED_RIB.get()) - .key('S', Items.BONE) - .key('T', Items.WITHER_SKELETON_SKULL) - .addCriterion(HAS_WITHERED_RIB_CRITERION, has(ModItems.WITHERED_RIB.get())) - .build(consumer, new ResourceLocation(Reference.MOD_ID, MOB_CHARM_FRAGMENTS_FOLDER + "wither_skeleton")); - - NbtShapedRecipeBuilder.shapedRecipe(ModItems.MOB_CHARM_FRAGMENT.get().getStackFor("minecraft:zombie")) - .patternLine("PPP") - .patternLine("STS") - .patternLine("PPP") - .key('P', ModItems.ZOMBIE_HEART.get()) - .key('S', Items.ROTTEN_FLESH) - .key('T', Items.BONE) - .addCriterion(HAS_ZOMBIE_HEART_CRITERION, has(ModItems.ZOMBIE_HEART.get())) - .build(consumer, new ResourceLocation(Reference.MOD_ID, MOB_CHARM_FRAGMENTS_FOLDER + "zombie")); - - NbtShapedRecipeBuilder.shapedRecipe(ModItems.MOB_CHARM_FRAGMENT.get().getStackFor("minecraft:zombified_piglin")) - .patternLine("PPP") - .patternLine("STS") - .patternLine("PPP") - .key('P', ModItems.ZOMBIE_HEART.get()) - .key('S', Items.ROTTEN_FLESH) - .key('T', Items.GOLDEN_SWORD) - .addCriterion(HAS_ZOMBIE_HEART_CRITERION, has(ModItems.ZOMBIE_HEART.get())) - .build(consumer, new ResourceLocation(Reference.MOD_ID, MOB_CHARM_FRAGMENTS_FOLDER + "zombified_piglin")); + private void registerCharmFragmentRecipes(RecipeOutput recipeOutput) { + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.MOB_CHARM_FRAGMENT.get().getStackFor("minecraft:blaze")) + .pattern("PPP") + .pattern("STS") + .pattern("PPP") + .define('P', ModItems.MOLTEN_CORE.get()) + .define('S', Tags.Items.RODS_BLAZE) + .define('T', Items.BLAZE_POWDER) + .unlockedBy(HAS_MOLTEN_CORE_CRITERION, has(ModItems.MOLTEN_CORE.get())) + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, MOB_CHARM_FRAGMENTS_FOLDER + "blaze")); + + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.MOB_CHARM_FRAGMENT.get().getStackFor("minecraft:cave_spider")) + .pattern("PPP") + .pattern("STS") + .pattern("PPP") + .define('P', ModItems.CHELICERAE.get()) + .define('S', Tags.Items.STRING) + .define('T', NBTIngredient.of(true, PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.POISON))) + .unlockedBy(HAS_CHELICERAE_CRITERION, has(ModItems.CHELICERAE.get())) + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, MOB_CHARM_FRAGMENTS_FOLDER + "cave_spider")); + + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.MOB_CHARM_FRAGMENT.get().getStackFor("minecraft:creeper")) + .pattern("PPP") + .pattern("STS") + .pattern("PPP") + .define('P', ModItems.CATALYZING_GLAND.get()) + .define('S', Tags.Items.GUNPOWDER) + .define('T', Items.BONE) + .unlockedBy(HAS_CATALYZING_GLAND_CRITERIION, has(ModItems.CATALYZING_GLAND.get())) + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, MOB_CHARM_FRAGMENTS_FOLDER + "creeper")); + + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.MOB_CHARM_FRAGMENT.get().getStackFor("minecraft:enderman")) + .pattern("PPP") + .pattern("SPS") + .pattern("PPP") + .define('P', ModItems.NEBULOUS_HEART.get()) + .define('S', Tags.Items.ENDER_PEARLS) + .unlockedBy(HAS_NEBULOUS_HEART_CRITERION, has(ModItems.NEBULOUS_HEART.get())) + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, MOB_CHARM_FRAGMENTS_FOLDER + "enderman")); + + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.MOB_CHARM_FRAGMENT.get().getStackFor("minecraft:ghast")) + .pattern("PPP") + .pattern("STS") + .pattern("PPP") + .define('P', Items.GHAST_TEAR) + .define('S', Tags.Items.GUNPOWDER) + .define('T', ModItems.CATALYZING_GLAND.get()) + .unlockedBy(HAS_CATALYZING_GLAND_CRITERIION, has(ModItems.CATALYZING_GLAND.get())) + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, MOB_CHARM_FRAGMENTS_FOLDER + "ghast")); + + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.MOB_CHARM_FRAGMENT.get().getStackFor("minecraft:guardian")) + .pattern("PPP") + .pattern("STS") + .pattern("PPP") + .define('P', ModItems.GUARDIAN_SPIKE.get()) + .define('S', Tags.Items.DUSTS_PRISMARINE) + .define('T', Items.COD) + .unlockedBy(HAS_GUARDIAN_SPIKE_CRITERION, has(ModItems.GUARDIAN_SPIKE.get())) + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, MOB_CHARM_FRAGMENTS_FOLDER + "guardian")); + + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.MOB_CHARM_FRAGMENT.get().getStackFor("minecraft:magma_cube")) + .pattern("PPP") + .pattern("SSS") + .pattern("PPP") + .define('P', ModItems.MOLTEN_CORE.get()) + .define('S', Items.MAGMA_CREAM) + .unlockedBy(HAS_MOLTEN_CORE_CRITERION, has(ModItems.MOLTEN_CORE.get())) + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, MOB_CHARM_FRAGMENTS_FOLDER + "magma_cube")); + + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.MOB_CHARM_FRAGMENT.get().getStackFor("minecraft:skeleton")) + .pattern("PPP") + .pattern("STS") + .pattern("PPP") + .define('P', ModItems.RIB_BONE.get()) + .define('S', Items.BONE) + .define('T', Items.FLINT) + .unlockedBy("has_rib_bone", has(ModItems.RIB_BONE.get())) + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, MOB_CHARM_FRAGMENTS_FOLDER + "skeleton")); + + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.MOB_CHARM_FRAGMENT.get().getStackFor("minecraft:slime")) + .pattern("PPP") + .pattern("SSS") + .pattern("PPP") + .define('P', ModItems.SLIME_PEARL.get()) + .define('S', Tags.Items.SLIMEBALLS) + .unlockedBy(HAS_SLIME_PEARL_CRITERION, has(ModItems.SLIME_PEARL.get())) + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, MOB_CHARM_FRAGMENTS_FOLDER + "slime")); + + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.MOB_CHARM_FRAGMENT.get().getStackFor("minecraft:spider")) + .pattern("PPP") + .pattern("STS") + .pattern("PPP") + .define('P', ModItems.CHELICERAE.get()) + .define('S', Tags.Items.STRING) + .define('T', Items.SPIDER_EYE) + .unlockedBy(HAS_CHELICERAE_CRITERION, has(ModItems.CHELICERAE.get())) + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, MOB_CHARM_FRAGMENTS_FOLDER + "spider")); + + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.MOB_CHARM_FRAGMENT.get().getStackFor("minecraft:witch")) + .pattern("PPP") + .pattern("STS") + .pattern("PPP") + .define('P', ModItems.WITCH_HAT.get()) + .define('S', Items.GLASS_BOTTLE) + .define('T', Items.SPIDER_EYE) + .unlockedBy(HAS_WITCH_HAT_CRITERION, has(ModItems.WITCH_HAT.get())) + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, MOB_CHARM_FRAGMENTS_FOLDER + "witch")); + + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.MOB_CHARM_FRAGMENT.get().getStackFor("minecraft:wither_skeleton")) + .pattern("PPP") + .pattern("STS") + .pattern("PPP") + .define('P', ModItems.WITHERED_RIB.get()) + .define('S', Items.BONE) + .define('T', Items.WITHER_SKELETON_SKULL) + .unlockedBy(HAS_WITHERED_RIB_CRITERION, has(ModItems.WITHERED_RIB.get())) + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, MOB_CHARM_FRAGMENTS_FOLDER + "wither_skeleton")); + + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.MOB_CHARM_FRAGMENT.get().getStackFor("minecraft:zombie")) + .pattern("PPP") + .pattern("STS") + .pattern("PPP") + .define('P', ModItems.ZOMBIE_HEART.get()) + .define('S', Items.ROTTEN_FLESH) + .define('T', Items.BONE) + .unlockedBy(HAS_ZOMBIE_HEART_CRITERION, has(ModItems.ZOMBIE_HEART.get())) + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, MOB_CHARM_FRAGMENTS_FOLDER + "zombie")); + + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.MOB_CHARM_FRAGMENT.get().getStackFor("minecraft:zombified_piglin")) + .pattern("PPP") + .pattern("STS") + .pattern("PPP") + .define('P', ModItems.ZOMBIE_HEART.get()) + .define('S', Items.ROTTEN_FLESH) + .define('T', Items.GOLDEN_SWORD) + .unlockedBy(HAS_ZOMBIE_HEART_CRITERION, has(ModItems.ZOMBIE_HEART.get())) + .save(recipeOutput, new ResourceLocation(Reference.MOD_ID, MOB_CHARM_FRAGMENTS_FOLDER + "zombified_piglin")); } - private InventoryChangeTrigger.TriggerInstance hasTag(TagKey tag) { + private Criterion hasTag(TagKey tag) { return inventoryTrigger(ItemPredicate.Builder.item().of(tag).build()); } - private StrictNBTIngredient instantiateNBTIngredient(ItemStack stack) { - return StrictNBTIngredient.of(stack); - } - - private void addCraftableMobDropRecipe(Consumer consumer, ItemBase item, Consumer setRecipe) { + private void addCraftableMobDropRecipe(RecipeOutput recipeOutput, ItemBase item, Consumer setRecipe) { ShapedRecipeBuilder builder = ShapedRecipeBuilder.shaped(RecipeCategory.MISC, item); setRecipe.accept(builder); - - ConditionalRecipe.builder() - .addCondition(new MobDropsCraftableCondition()) - .addRecipe(builder::save) - .build(consumer, RegistryHelper.getRegistryName(item)); + builder.save(recipeOutput.withConditions(new MobDropsCraftableCondition()), RegistryHelper.getRegistryName(item)); } - private void addPedestalRecipe(Consumer consumer, BlockItem passivePedestalItem, BlockItem pedestalItem) { - ConditionalRecipe.builder() - .addCondition(new PedestalEnabledCondition()) - .addRecipe(conditionalConsumer -> - ShapedRecipeBuilder.shaped(RecipeCategory.MISC, pedestalItem) - .pattern("D D") - .pattern(" P ") - .pattern("D D") - .define('D', Tags.Items.GEMS_DIAMOND) - .define('P', passivePedestalItem) - .unlockedBy("has_passive_pedestal", has(ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.WHITE).get())) - .save(conditionalConsumer)) - .build(consumer, RegistryHelper.getRegistryName(pedestalItem)); + private void addPedestalRecipe(RecipeOutput recipeOutput, BlockItem passivePedestalItem, BlockItem pedestalItem) { + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, pedestalItem) + .pattern("D D") + .pattern(" P ") + .pattern("D D") + .define('D', Tags.Items.GEMS_DIAMOND) + .define('P', passivePedestalItem) + .unlockedBy("has_passive_pedestal", has(ModBlocks.PASSIVE_PEDESTAL_ITEMS.get(DyeColor.WHITE).get())) + .save(recipeOutput.withConditions(new PedestalEnabledCondition())); } - private void addPassivePedestalRecipe(Consumer consumer, Item carpetItem, BlockItem pedestalItem) { - ConditionalRecipe.builder() - .addCondition(new PassivePedestalEnabledCondition()) - .addRecipe(conditionalConsumer -> - ShapedRecipeBuilder.shaped(RecipeCategory.MISC, pedestalItem) - .pattern(" C ") - .pattern("GQG") - .pattern("SSS") - .define('C', carpetItem) - .define('G', Tags.Items.NUGGETS_GOLD) - .define('Q', Tags.Items.STORAGE_BLOCKS_QUARTZ) - .define('S', Items.QUARTZ_SLAB) - .unlockedBy("has_quartz_block", has(Items.QUARTZ_BLOCK)) - .save(conditionalConsumer)) - .build(consumer, RegistryHelper.getRegistryName(pedestalItem)); + private void addPassivePedestalRecipe(RecipeOutput recipeOutput, Item carpetItem, BlockItem pedestalItem) { + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, pedestalItem) + .pattern(" C ") + .pattern("GQG") + .pattern("SSS") + .define('C', carpetItem) + .define('G', Tags.Items.NUGGETS_GOLD) + .define('Q', Tags.Items.STORAGE_BLOCKS_QUARTZ) + .define('S', Items.QUARTZ_SLAB) + .unlockedBy("has_quartz_block", has(Items.QUARTZ_BLOCK)) + .save(recipeOutput.withConditions(new PassivePedestalEnabledCondition())); } - private void addBulletPotionRecipe(Consumer consumer, Item item) { - addItemPotionRecipe(consumer, item, item, (float) 0.2, 'B', true); + private void addBulletPotionRecipe(RecipeOutput recipeOutput, Item item) { + addItemPotionRecipe(recipeOutput, item, item, (float) 0.2, 'B', true); } - private void addItemPotionRecipe(Consumer consumer, Item itemIngredient, Item item, float durationFactor, char itemKey, boolean includeSuffix) { + private void addItemPotionRecipe(RecipeOutput recipeOutput, Item itemIngredient, Item item, float durationFactor, char itemKey, boolean includeSuffix) { ResourceLocation registryName = RegistryHelper.getRegistryName(item); String path = registryName.getPath(); ResourceLocation id = includeSuffix ? new ResourceLocation(registryName.getNamespace(), registryName.getPath() + "_potion") : registryName; PotionEffectsRecipeBuilder.potionEffectsRecipe(item, 8, durationFactor) - .addCondition(new HandgunEnabledCondition()) - .patternLine(String.valueOf(itemKey) + itemKey + itemKey) - .patternLine(itemKey + "P" + itemKey) - .patternLine(String.valueOf(itemKey) + itemKey + itemKey) - .key(itemKey, itemIngredient) - .key('P', ModItems.LINGERING_POTION.get()) - .addCriterion("has_" + (path.lastIndexOf('/') > -1 ? path.substring(path.indexOf('/') + 1) : path), has(item)) - .build(consumer, id); + .pattern(String.valueOf(itemKey) + itemKey + itemKey) + .pattern(itemKey + "P" + itemKey) + .pattern(String.valueOf(itemKey) + itemKey + itemKey) + .define(itemKey, itemIngredient) + .define('P', ModItems.LINGERING_POTION.get()) + .unlockedBy("has_" + (path.lastIndexOf('/') > -1 ? path.substring(path.indexOf('/') + 1) : path), has(item)) + .save(recipeOutput, id); } - private void addMagazineRecipe(Consumer consumer, BulletItem bulletItem, MagazineItem magazineItem) { + private void addMagazineRecipe(RecipeOutput recipeOutput, BulletItem bulletItem, MagazineItem magazineItem) { String path = RegistryHelper.getRegistryName(bulletItem).getPath(); PotionEffectsRecipeBuilder.potionEffectsRecipe(magazineItem, 1, 1) - .addCondition(new HandgunEnabledCondition()) - .patternLine("BBB") - .patternLine("BMB") - .patternLine("BBB") - .key('B', bulletItem) - .key('M', ModItems.EMPTY_MAGAZINE.get()) - .addCriterion("has_" + (path.lastIndexOf('/') > -1 ? path.substring(path.indexOf('/') + 1) : path), has(bulletItem)) - .build(consumer, RegistryHelper.getRegistryName(magazineItem)); + .pattern("BBB") + .pattern("BMB") + .pattern("BBB") + .define('B', bulletItem) + .define('M', ModItems.EMPTY_MAGAZINE.get()) + .unlockedBy("has_" + (path.lastIndexOf('/') > -1 ? path.substring(path.indexOf('/') + 1) : path), has(bulletItem)) + .save(recipeOutput, RegistryHelper.getRegistryName(magazineItem)); } } diff --git a/src/main/java/reliquary/data/RandomChanceLootingSeveringCondition.java b/src/main/java/reliquary/data/RandomChanceLootingSeveringCondition.java index 565657d4..cd86469f 100644 --- a/src/main/java/reliquary/data/RandomChanceLootingSeveringCondition.java +++ b/src/main/java/reliquary/data/RandomChanceLootingSeveringCondition.java @@ -1,9 +1,7 @@ package reliquary.data; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonObject; -import com.google.gson.JsonSerializationContext; -import net.minecraft.util.GsonHelper; +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.item.ItemStack; @@ -20,12 +18,20 @@ import java.util.Set; public class RandomChanceLootingSeveringCondition implements LootItemCondition { - final float percent; + public static final Codec CODEC = RecordCodecBuilder.create( + p_298496_ -> p_298496_.group( + Codec.FLOAT.fieldOf("chance").forGetter(condition -> condition.chance), + Codec.FLOAT.fieldOf("looting_multiplier").forGetter(condition -> condition.lootingMultiplier), + Codec.FLOAT.fieldOf("severing_multiplier").forGetter(condition -> condition.severingMultiplier) + ) + .apply(p_298496_, RandomChanceLootingSeveringCondition::new) + ); + final float chance; final float lootingMultiplier; private final float severingMultiplier; - RandomChanceLootingSeveringCondition(float percent, float lootingMultiplier, float severingMultiplier) { - this.percent = percent; + RandomChanceLootingSeveringCondition(float chance, float lootingMultiplier, float severingMultiplier) { + this.chance = chance; this.lootingMultiplier = lootingMultiplier; this.severingMultiplier = severingMultiplier; } @@ -41,7 +47,7 @@ public Set> getReferencedContextParams() { public boolean test(LootContext lootContext) { int i = lootContext.getLootingModifier(); - return lootContext.getRandom().nextFloat() < percent + i * lootingMultiplier + getSeveringModifier(lootContext) * severingMultiplier; + return lootContext.getRandom().nextFloat() < chance + i * lootingMultiplier + getSeveringModifier(lootContext) * severingMultiplier; } private int getSeveringModifier(LootContext lootContext) { @@ -70,17 +76,4 @@ private int getSeveringModifier(LootContext lootContext) { public static Builder randomChanceLootingSevering(float percent, float lootingMultiplier, float severingMultiplier) { return () -> new RandomChanceLootingSeveringCondition(percent, lootingMultiplier, severingMultiplier); } - - public static class Serializer implements net.minecraft.world.level.storage.loot.Serializer { - public void serialize(JsonObject jsonObject, RandomChanceLootingSeveringCondition condition, JsonSerializationContext context) { - jsonObject.addProperty("chance", condition.percent); - jsonObject.addProperty("looting_multiplier", condition.lootingMultiplier); - jsonObject.addProperty("severing_multiplier", condition.severingMultiplier); - } - - public RandomChanceLootingSeveringCondition deserialize(JsonObject jsonObject, JsonDeserializationContext context) { - return new RandomChanceLootingSeveringCondition(GsonHelper.getAsFloat(jsonObject, "chance"), GsonHelper.getAsFloat(jsonObject, "looting_multiplier") - , GsonHelper.getAsFloat(jsonObject, "severing_multiplier")); - } - } } diff --git a/src/main/java/reliquary/data/ReliquaryLootModifierProvider.java b/src/main/java/reliquary/data/ReliquaryLootModifierProvider.java index d024a1b1..dd4e9d3e 100644 --- a/src/main/java/reliquary/data/ReliquaryLootModifierProvider.java +++ b/src/main/java/reliquary/data/ReliquaryLootModifierProvider.java @@ -9,10 +9,10 @@ import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.LootTable; import net.minecraft.world.level.storage.loot.predicates.LootItemCondition; -import net.minecraftforge.common.data.GlobalLootModifierProvider; -import net.minecraftforge.common.loot.IGlobalLootModifier; -import net.minecraftforge.common.loot.LootModifier; -import net.minecraftforge.common.loot.LootTableIdCondition; +import net.neoforged.neoforge.common.data.GlobalLootModifierProvider; +import net.neoforged.neoforge.common.loot.IGlobalLootModifier; +import net.neoforged.neoforge.common.loot.LootModifier; +import net.neoforged.neoforge.common.loot.LootTableIdCondition; import reliquary.init.ModItems; import reliquary.reference.Reference; diff --git a/src/main/java/reliquary/entities/ConcussiveExplosion.java b/src/main/java/reliquary/entities/ConcussiveExplosion.java index b9a81411..63259ee5 100644 --- a/src/main/java/reliquary/entities/ConcussiveExplosion.java +++ b/src/main/java/reliquary/entities/ConcussiveExplosion.java @@ -12,9 +12,8 @@ import net.minecraft.world.level.Level; import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.Vec3; -import net.minecraftforge.network.PacketDistributor; -import reliquary.network.PacketFXConcussiveExplosion; import reliquary.network.PacketHandler; +import reliquary.network.SpawnConcussiveExplosionParticlesPacket; import reliquary.util.RandHelper; import javax.annotation.Nullable; @@ -22,7 +21,7 @@ import java.util.Map; public class ConcussiveExplosion extends Explosion { - private final Level world; + private final Level level; private final Vec3 pos; protected final Entity exploder; private float explosionSize; @@ -30,8 +29,9 @@ public class ConcussiveExplosion extends Explosion { private final Player shootingEntity; public ConcussiveExplosion(Level level, @Nullable Entity entity, @Nullable Player player, Vec3 pos, float size, boolean isFlaming) { - super(level, entity, null, null, pos.x(), pos.y(), pos.z(), size, isFlaming, BlockInteraction.DESTROY); - this.world = level; + super(level, entity, null, null, pos.x(), pos.y(), pos.z(), size, isFlaming, + BlockInteraction.DESTROY, ParticleTypes.EXPLOSION, ParticleTypes.EXPLOSION_EMITTER, SoundEvents.GENERIC_EXPLODE); + this.level = level; exploder = entity; shootingEntity = player; this.pos = pos; @@ -47,7 +47,7 @@ public void explode() { float var1 = explosionSize; explosionSize *= 2.0F; - List var9 = world.getEntities(exploder, + List var9 = level.getEntities(exploder, new AABB(pos.add(-explosionSize - 1.0D, -explosionSize - 1.0D, -explosionSize - 1.0D), pos.add(explosionSize + 1.0D, explosionSize + 1.0D, explosionSize + 1.0D))); @@ -92,12 +92,12 @@ protected boolean affectEntity(Entity entity) { */ @Override public void finalizeExplosion(boolean spawnParticles) { - world.playSound(null, BlockPos.containing(pos.x(), pos.y(), pos.z()), SoundEvents.GENERIC_EXPLODE, SoundSource.BLOCKS, 4.0F, (1.0F + RandHelper.getRandomMinusOneToOne(world.random) * 0.2F) * 0.7F); + level.playSound(null, BlockPos.containing(pos.x(), pos.y(), pos.z()), SoundEvents.GENERIC_EXPLODE, SoundSource.BLOCKS, 4.0F, (1.0F + RandHelper.getRandomMinusOneToOne(level.random) * 0.2F) * 0.7F); if (explosionSize >= 2.0F) { - world.addParticle(ParticleTypes.EXPLOSION_EMITTER, pos.x(), pos.y(), pos.z(), 1.0D, 0.0D, 0.0D); + level.addParticle(ParticleTypes.EXPLOSION_EMITTER, pos.x(), pos.y(), pos.z(), 1.0D, 0.0D, 0.0D); } else { - world.addParticle(ParticleTypes.EXPLOSION, pos.x(), pos.y(), pos.z(), 1.0D, 0.0D, 0.0D); + level.addParticle(ParticleTypes.EXPLOSION, pos.x(), pos.y(), pos.z(), 1.0D, 0.0D, 0.0D); } } @@ -131,8 +131,7 @@ public static void customConcussiveExplosion(Entity entity, Player player, Vec3 var11.explode(); var11.finalizeExplosion(false); - PacketHandler.sendToAllAround(new PacketFXConcussiveExplosion(size, pos), new PacketDistributor.TargetPoint(entity.getX(), entity.getY(), entity.getZ(), 96.0D, entity.getCommandSenderWorld().dimension())); - + PacketHandler.sendToAllNear(entity, new SpawnConcussiveExplosionParticlesPacket(size, pos), 96.0D); } static void grenadeConcussiveExplosion(Entity entity, Player player, Vec3 pos) { @@ -140,8 +139,7 @@ static void grenadeConcussiveExplosion(Entity entity, Player player, Vec3 pos) { var11.explode(); var11.finalizeExplosion(false); - PacketHandler.sendToAllAround(new PacketFXConcussiveExplosion((float) 4.0, pos), new PacketDistributor.TargetPoint(entity.getX(), entity.getY(), entity.getZ(), 96.0D, entity.getCommandSenderWorld().dimension())); - + PacketHandler.sendToAllNear(entity, new SpawnConcussiveExplosionParticlesPacket((float) 4.0, pos), 96.0D); } } diff --git a/src/main/java/reliquary/entities/EnderStaffProjectileEntity.java b/src/main/java/reliquary/entities/EnderStaffProjectileEntity.java index 1b43352a..032d5fde 100644 --- a/src/main/java/reliquary/entities/EnderStaffProjectileEntity.java +++ b/src/main/java/reliquary/entities/EnderStaffProjectileEntity.java @@ -4,8 +4,6 @@ import net.minecraft.core.Direction; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.network.protocol.Packet; -import net.minecraft.network.protocol.game.ClientGamePacketListener; import net.minecraft.server.level.ServerPlayer; import net.minecraft.sounds.SoundEvents; import net.minecraft.world.entity.Entity; @@ -21,19 +19,12 @@ import net.minecraft.world.phys.EntityHitResult; import net.minecraft.world.phys.HitResult; import net.minecraft.world.phys.Vec3; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.entity.IEntityAdditionalSpawnData; -import net.minecraftforge.event.ForgeEventFactory; -import net.minecraftforge.network.NetworkHooks; +import net.neoforged.neoforge.entity.IEntityWithComplexSpawn; +import net.neoforged.neoforge.event.EventHooks; import reliquary.init.ModEntities; @SuppressWarnings("squid:S2160") -@OnlyIn( - value = Dist.CLIENT, - _interface = ItemSupplier.class -) -public class EnderStaffProjectileEntity extends ThrowableProjectile implements ItemSupplier, IEntityAdditionalSpawnData { +public class EnderStaffProjectileEntity extends ThrowableProjectile implements ItemSupplier, IEntityWithComplexSpawn { public EnderStaffProjectileEntity(EntityType entityType, Level world) { super(entityType, world); } @@ -127,7 +118,7 @@ private void onThrowableCollision(HitResult result) { float targetY = y + 0.5F; float targetZ = z + 0.5F; if (thrower instanceof ServerPlayer serverPlayer) { - ForgeEventFactory.onEnderPearlLand(serverPlayer, targetX, targetY, targetZ, new ThrownEnderpearl(level(), serverPlayer), 0, result); + EventHooks.onEnderPearlLand(serverPlayer, targetX, targetY, targetZ, new ThrownEnderpearl(level(), serverPlayer), 0, result); } thrower.playSound(SoundEvents.ENDERMAN_TELEPORT, 1.0f, 1.0f); @@ -141,11 +132,6 @@ public ItemStack getItem() { return new ItemStack(Items.ENDER_PEARL); } - @Override - public Packet getAddEntityPacket() { - return NetworkHooks.getEntitySpawningPacket(this); - } - @Override public void writeSpawnData(FriendlyByteBuf buffer) { buffer.writeBoolean(normalGravity); diff --git a/src/main/java/reliquary/entities/EntityXRFakePlayer.java b/src/main/java/reliquary/entities/EntityXRFakePlayer.java index cab37be1..9080268a 100644 --- a/src/main/java/reliquary/entities/EntityXRFakePlayer.java +++ b/src/main/java/reliquary/entities/EntityXRFakePlayer.java @@ -9,7 +9,7 @@ import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.item.ItemStack; import net.minecraft.world.phys.Vec3; -import net.minecraftforge.common.util.FakePlayer; +import net.neoforged.neoforge.common.util.FakePlayer; import javax.annotation.Nullable; import java.util.UUID; diff --git a/src/main/java/reliquary/entities/GlowingWaterEntity.java b/src/main/java/reliquary/entities/GlowingWaterEntity.java index dcbdcde0..a9cc1386 100644 --- a/src/main/java/reliquary/entities/GlowingWaterEntity.java +++ b/src/main/java/reliquary/entities/GlowingWaterEntity.java @@ -2,15 +2,9 @@ import net.minecraft.core.particles.ItemParticleOption; import net.minecraft.core.particles.ParticleTypes; -import net.minecraft.network.protocol.Packet; -import net.minecraft.network.protocol.game.ClientGamePacketListener; import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundSource; -import net.minecraft.world.entity.Entity; -import net.minecraft.world.entity.EntityType; -import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.entity.Mob; -import net.minecraft.world.entity.MobType; +import net.minecraft.world.entity.*; import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.projectile.ItemSupplier; import net.minecraft.world.entity.projectile.ThrowableProjectile; @@ -18,22 +12,14 @@ import net.minecraft.world.level.Level; import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.HitResult; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.network.NetworkHooks; -import net.minecraftforge.network.PacketDistributor; import reliquary.init.ModEntities; import reliquary.init.ModItems; -import reliquary.network.PacketFXThrownPotionImpact; import reliquary.network.PacketHandler; +import reliquary.network.SpawnThrownPotionImpactParticlesPacket; import reliquary.reference.Colors; import java.util.List; -@OnlyIn( - value = Dist.CLIENT, - _interface = ItemSupplier.class -) public class GlowingWaterEntity extends ThrowableProjectile implements ItemSupplier { public GlowingWaterEntity(EntityType entityType, Level world) { super(entityType, world); @@ -94,8 +80,7 @@ private void spawnParticles() { } level().playSound(null, blockPosition(), SoundEvents.GLASS_BREAK, SoundSource.NEUTRAL, 1.0F, level().random.nextFloat() * 0.1F + 0.9F); - PacketHandler.sendToAllAround(new PacketFXThrownPotionImpact(Colors.get(Colors.BLUE), getX(), getY(), getZ()), new PacketDistributor.TargetPoint(getX(), getY(), getZ(), 32.0D, level().dimension())); - + PacketHandler.sendToAllNear(this, new SpawnThrownPotionImpactParticlesPacket(Colors.get(Colors.BLUE), getX(), getY(), getZ()), 32.0D); } @Override @@ -107,9 +92,4 @@ protected void defineSynchedData() { public ItemStack getItem() { return new ItemStack(ModItems.GLOWING_WATER.get()); } - - @Override - public Packet getAddEntityPacket() { - return NetworkHooks.getEntitySpawningPacket(this); - } } diff --git a/src/main/java/reliquary/entities/HolyHandGrenadeEntity.java b/src/main/java/reliquary/entities/HolyHandGrenadeEntity.java index f02861a9..09840c11 100644 --- a/src/main/java/reliquary/entities/HolyHandGrenadeEntity.java +++ b/src/main/java/reliquary/entities/HolyHandGrenadeEntity.java @@ -2,8 +2,6 @@ import net.minecraft.core.particles.ParticleTypes; import net.minecraft.network.chat.Component; -import net.minecraft.network.protocol.Packet; -import net.minecraft.network.protocol.game.ClientGamePacketListener; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.projectile.ItemSupplier; @@ -12,17 +10,10 @@ import net.minecraft.world.level.Level; import net.minecraft.world.phys.EntityHitResult; import net.minecraft.world.phys.HitResult; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.network.NetworkHooks; import reliquary.init.ModEntities; import reliquary.init.ModItems; @SuppressWarnings("squid:S2160") -@OnlyIn( - value = Dist.CLIENT, - _interface = ItemSupplier.class -) public class HolyHandGrenadeEntity extends ThrowableProjectile implements ItemSupplier { private int count = 0; private Player playerThrower; @@ -88,9 +79,4 @@ protected void onHit(HitResult result) { public ItemStack getItem() { return new ItemStack(ModItems.HOLY_HAND_GRENADE.get()); } - - @Override - public Packet getAddEntityPacket() { - return NetworkHooks.getEntitySpawningPacket(this); - } } diff --git a/src/main/java/reliquary/entities/KrakenSlimeEntity.java b/src/main/java/reliquary/entities/KrakenSlimeEntity.java index c3d4673f..fbcd48db 100644 --- a/src/main/java/reliquary/entities/KrakenSlimeEntity.java +++ b/src/main/java/reliquary/entities/KrakenSlimeEntity.java @@ -1,8 +1,6 @@ package reliquary.entities; import net.minecraft.core.particles.ParticleTypes; -import net.minecraft.network.protocol.Packet; -import net.minecraft.network.protocol.game.ClientGamePacketListener; import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundSource; import net.minecraft.world.effect.MobEffectInstance; @@ -17,7 +15,6 @@ import net.minecraft.world.level.Level; import net.minecraft.world.phys.EntityHitResult; import net.minecraft.world.phys.HitResult; -import net.minecraftforge.network.NetworkHooks; import reliquary.init.ModEntities; import reliquary.init.ModPotions; @@ -89,10 +86,4 @@ public void tick() { discard(); } } - - @Override - public Packet getAddEntityPacket() { - return NetworkHooks.getEntitySpawningPacket(this); - } - } diff --git a/src/main/java/reliquary/entities/LyssaHook.java b/src/main/java/reliquary/entities/LyssaHook.java index 619e731a..2fa513ea 100644 --- a/src/main/java/reliquary/entities/LyssaHook.java +++ b/src/main/java/reliquary/entities/LyssaHook.java @@ -2,15 +2,9 @@ import net.minecraft.core.BlockPos; import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.network.protocol.Packet; -import net.minecraft.network.protocol.game.ClientGamePacketListener; import net.minecraft.tags.FluidTags; import net.minecraft.util.Mth; -import net.minecraft.world.entity.Entity; -import net.minecraft.world.entity.EntityType; -import net.minecraft.world.entity.EquipmentSlot; -import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.entity.Mob; +import net.minecraft.world.entity.*; import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.projectile.FishingHook; @@ -18,21 +12,15 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.material.FluidState; import net.minecraft.world.phys.Vec3; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.entity.IEntityAdditionalSpawnData; -import net.minecraftforge.fml.util.ObfuscationReflectionHelper; -import net.minecraftforge.network.NetworkHooks; +import net.neoforged.neoforge.entity.IEntityWithComplexSpawn; import reliquary.init.ModEntities; import reliquary.init.ModItems; -import reliquary.reference.Settings; -import reliquary.util.LogHelper; +import reliquary.reference.Config; -import java.lang.reflect.Field; import java.util.List; import java.util.Optional; -public class LyssaHook extends FishingHook implements IEntityAdditionalSpawnData { +public class LyssaHook extends FishingHook implements IEntityWithComplexSpawn { public LyssaHook(EntityType entityType, Level world) { this(entityType, world, 0, 0); } @@ -72,7 +60,6 @@ private void shoot(Player fishingPlayer) { xRotO = getXRot(); } - @OnlyIn(Dist.CLIENT) @Override public boolean shouldRenderAtSqrDistance(double distance) { //much higher visible range than regular hook @@ -183,7 +170,7 @@ private void bringInHookedEntity() { private boolean canStealFromEntity() { Entity hookedIn = getHookedIn(); - return hookedIn instanceof LivingEntity && (Settings.COMMON.items.rodOfLyssa.stealFromPlayers.get() || !(hookedIn instanceof Player)) && Settings.COMMON.items.rodOfLyssa.canStealFromEntity(hookedIn); + return hookedIn instanceof LivingEntity && (Config.COMMON.items.rodOfLyssa.stealFromPlayers.get() || !(hookedIn instanceof Player)) && Config.COMMON.items.rodOfLyssa.canStealFromEntity(hookedIn); } private void pullItemEntitiesWithHook() { @@ -208,7 +195,7 @@ private void stealFromLivingEntity() { EquipmentSlot slotBeingStolenFrom = EquipmentSlot.values()[level().random.nextInt(EquipmentSlot.values().length)]; ItemStack stolenStack = livingEntity.getItemBySlot(slotBeingStolenFrom); - if (stolenStack.isEmpty() && Boolean.TRUE.equals(Settings.COMMON.items.rodOfLyssa.stealFromVacantSlots.get())) { + if (stolenStack.isEmpty() && Boolean.TRUE.equals(Config.COMMON.items.rodOfLyssa.stealFromVacantSlots.get())) { for (EquipmentSlot slot : EquipmentSlot.values()) { stolenStack = livingEntity.getItemBySlot(slot); if (!stolenStack.isEmpty() && canDropFromSlot(livingEntity, slot)) { @@ -228,18 +215,19 @@ private void stealFromLivingEntity() { Player fishingPlayer = p.get(); - if (Boolean.TRUE.equals(Settings.COMMON.items.rodOfLyssa.useLeveledFailureRate.get())) { - failProbabilityFactor = 1F / ((float) Math.sqrt(Math.max(1, Math.min(fishingPlayer.experienceLevel, Settings.COMMON.items.rodOfLyssa.levelCapForLeveledFormula.get()))) * 2); + if (Boolean.TRUE.equals(Config.COMMON.items.rodOfLyssa.useLeveledFailureRate.get())) { + failProbabilityFactor = 1F / ((float) Math.sqrt(Math.max(1, Math.min(fishingPlayer.experienceLevel, Config.COMMON.items.rodOfLyssa.levelCapForLeveledFormula.get()))) * 2); } else { - failProbabilityFactor = Settings.COMMON.items.rodOfLyssa.flatStealFailurePercentRate.get() / 100F; + failProbabilityFactor = Config.COMMON.items.rodOfLyssa.flatStealFailurePercentRate.get() / 100F; } - if ((random.nextFloat() <= failProbabilityFactor || (stolenStack.isEmpty() && Settings.COMMON.items.rodOfLyssa.failStealFromVacantSlots.get())) && Boolean.TRUE.equals(Settings.COMMON.items.rodOfLyssa.angerOnStealFailure.get())) { + if ((random.nextFloat() <= failProbabilityFactor || (stolenStack.isEmpty() && Config.COMMON.items.rodOfLyssa.failStealFromVacantSlots.get())) && Boolean.TRUE.equals(Config.COMMON.items.rodOfLyssa.angerOnStealFailure.get())) { livingEntity.hurt(damageSources().playerAttack(fishingPlayer), 0.0F); } if (!stolenStack.isEmpty()) { int randomItemDamage = level().random.nextInt(3); - stolenStack.hurtAndBreak(randomItemDamage, livingEntity, e -> {}); + stolenStack.hurtAndBreak(randomItemDamage, livingEntity, e -> { + }); ItemEntity entityitem = new ItemEntity(level(), getX(), getY(), getZ(), stolenStack); entityitem.setPickUpDelay(5); double d1 = fishingPlayer.getX() - getX(); @@ -259,25 +247,10 @@ private boolean canDropFromSlot(LivingEntity entity, EquipmentSlot slot) { return true; } - try { - if (slot.getType() == EquipmentSlot.Type.HAND) { - return ((float[]) HANDS_CHANCES.get(mob))[slot.getIndex()] > -1; - } else { - return ((float[]) ARMOR_CHANCES.get(mob))[slot.getIndex()] > -1; - } - } - catch (IllegalAccessException e) { - LogHelper.error(e); + if (slot.getType() == EquipmentSlot.Type.HAND) { + return mob.handDropChances[slot.getIndex()] > -1; + } else { + return mob.armorDropChances[slot.getIndex()] > -1; } - - return false; - } - - private static final Field HANDS_CHANCES = ObfuscationReflectionHelper.findField(Mob.class, "f_21347_"); - private static final Field ARMOR_CHANCES = ObfuscationReflectionHelper.findField(Mob.class, "f_21348_"); - - @Override - public Packet getAddEntityPacket() { - return NetworkHooks.getEntitySpawningPacket(this); } } diff --git a/src/main/java/reliquary/entities/SpecialSnowballEntity.java b/src/main/java/reliquary/entities/SpecialSnowballEntity.java index a6e39a31..3e80e460 100644 --- a/src/main/java/reliquary/entities/SpecialSnowballEntity.java +++ b/src/main/java/reliquary/entities/SpecialSnowballEntity.java @@ -4,8 +4,6 @@ import net.minecraft.core.particles.ItemParticleOption; import net.minecraft.core.particles.ParticleOptions; import net.minecraft.core.particles.ParticleTypes; -import net.minecraft.network.protocol.Packet; -import net.minecraft.network.protocol.game.ClientGamePacketListener; import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundSource; import net.minecraft.world.entity.Entity; @@ -22,11 +20,8 @@ import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.EntityHitResult; import net.minecraft.world.phys.HitResult; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.network.NetworkHooks; import reliquary.init.ModEntities; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.RandHelper; import static reliquary.items.IceMagusRodItem.ICE_PARTICLE; @@ -45,15 +40,15 @@ public SpecialSnowballEntity(Level world, LivingEntity entity, boolean b) { } private int getSnowballDamage() { - return fromGlacialStaff ? Settings.COMMON.items.glacialStaff.snowballDamage.get() : Settings.COMMON.items.iceMagusRod.snowballDamage.get(); + return fromGlacialStaff ? Config.COMMON.items.glacialStaff.snowballDamage.get() : Config.COMMON.items.iceMagusRod.snowballDamage.get(); } private int getSnowballDamageFireImmuneBonus() { - return fromGlacialStaff ? Settings.COMMON.items.glacialStaff.snowballDamageBonusFireImmune.get() : Settings.COMMON.items.iceMagusRod.snowballDamageBonusFireImmune.get(); + return fromGlacialStaff ? Config.COMMON.items.glacialStaff.snowballDamageBonusFireImmune.get() : Config.COMMON.items.iceMagusRod.snowballDamageBonusFireImmune.get(); } private int getSnowballDamageBlazeBonus() { - return fromGlacialStaff ? Settings.COMMON.items.glacialStaff.snowballDamageBonusBlaze.get() : Settings.COMMON.items.iceMagusRod.snowballDamageBonusBlaze.get(); + return fromGlacialStaff ? Config.COMMON.items.glacialStaff.snowballDamageBonusBlaze.get() : Config.COMMON.items.iceMagusRod.snowballDamageBonusBlaze.get(); } /** @@ -113,7 +108,6 @@ protected Item getDefaultItem() { } @Override - @OnlyIn(Dist.CLIENT) public void handleEntityEvent(byte id) { if (id == 3) { ItemStack stack = getItemRaw(); @@ -125,12 +119,6 @@ public void handleEntityEvent(byte id) { } } - @Override - public Packet getAddEntityPacket() { - return NetworkHooks.getEntitySpawningPacket(this); - } - - @OnlyIn(Dist.CLIENT) @Override public boolean shouldRenderAtSqrDistance(double distance) { double d0 = 4.0D; diff --git a/src/main/java/reliquary/entities/XRTippedArrowEntity.java b/src/main/java/reliquary/entities/XRTippedArrowEntity.java index 464fb26e..fd83ec9a 100644 --- a/src/main/java/reliquary/entities/XRTippedArrowEntity.java +++ b/src/main/java/reliquary/entities/XRTippedArrowEntity.java @@ -3,8 +3,6 @@ import com.google.common.collect.Lists; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.nbt.CompoundTag; -import net.minecraft.network.protocol.Packet; -import net.minecraft.network.protocol.game.ClientGamePacketListener; import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.SynchedEntityData; @@ -17,9 +15,6 @@ import net.minecraft.world.item.Items; import net.minecraft.world.item.alchemy.PotionUtils; import net.minecraft.world.level.Level; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.network.NetworkHooks; import reliquary.init.ModEntities; import reliquary.init.ModItems; import reliquary.util.potions.XRPotionHelper; @@ -32,15 +27,15 @@ public class XRTippedArrowEntity extends AbstractArrow { private List effects = Lists.newArrayList(); public XRTippedArrowEntity(EntityType entityType, Level world) { - super(entityType, world); + super(entityType, world, new ItemStack(ModItems.TIPPED_ARROW.get())); } - public XRTippedArrowEntity(Level world, double x, double y, double z) { - super(ModEntities.TIPPED_ARROW.get(), x, y, z, world); + public XRTippedArrowEntity(Level world, double x, double y, double z, ItemStack pickupItemStack) { + super(ModEntities.TIPPED_ARROW.get(), x, y, z, world, pickupItemStack); } - public XRTippedArrowEntity(Level world, LivingEntity shooter) { - super(ModEntities.TIPPED_ARROW.get(), shooter, world); + public XRTippedArrowEntity(Level world, LivingEntity shooter, ItemStack pickupItemStack) { + super(ModEntities.TIPPED_ARROW.get(), shooter, world, pickupItemStack); } public void setPotionEffect(ItemStack stack) { @@ -129,7 +124,6 @@ protected ItemStack getPickupItem() { } @Override - @OnlyIn(Dist.CLIENT) public void handleEntityEvent(byte id) { if (id == 0) { int i = getColor(); @@ -147,9 +141,4 @@ public void handleEntityEvent(byte id) { super.handleEntityEvent(id); } } - - @Override - public Packet getAddEntityPacket() { - return NetworkHooks.getEntitySpawningPacket(this); - } } diff --git a/src/main/java/reliquary/entities/potion/ThrownPotionEntity.java b/src/main/java/reliquary/entities/potion/ThrownPotionEntity.java index 77a9a156..f6d78e19 100644 --- a/src/main/java/reliquary/entities/potion/ThrownPotionEntity.java +++ b/src/main/java/reliquary/entities/potion/ThrownPotionEntity.java @@ -2,8 +2,6 @@ import net.minecraft.core.particles.ItemParticleOption; import net.minecraft.core.particles.ParticleTypes; -import net.minecraft.network.protocol.Packet; -import net.minecraft.network.protocol.game.ClientGamePacketListener; import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.SynchedEntityData; @@ -19,20 +17,12 @@ import net.minecraft.world.level.Level; import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.HitResult; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.network.NetworkHooks; -import net.minecraftforge.network.PacketDistributor; -import reliquary.network.PacketFXThrownPotionImpact; import reliquary.network.PacketHandler; +import reliquary.network.SpawnThrownPotionImpactParticlesPacket; import reliquary.util.LogHelper; import java.util.List; -@OnlyIn( - value = Dist.CLIENT, - _interface = ItemSupplier.class -) public abstract class ThrownPotionEntity extends ThrowableProjectile implements ItemSupplier { private static final EntityDataAccessor ITEM = SynchedEntityData.defineId(ThrownPotionEntity.class, EntityDataSerializers.ITEM_STACK); @@ -95,7 +85,7 @@ private void spawnParticles() { level().playSound(null, blockPosition(), SoundEvents.GLASS_BREAK, SoundSource.BLOCKS, 1.0F, level().random.nextFloat() * 0.1F + 0.9F); - PacketHandler.sendToAllAround(new PacketFXThrownPotionImpact(getColor(), getX(), getY(), getZ()), new PacketDistributor.TargetPoint(getX(), getY(), getZ(), 32D, level().dimension())); + PacketHandler.sendToAllNear(this, new SpawnThrownPotionImpactParticlesPacket(getColor(), getX(), getY(), getZ()), 32D); } // this gets called inside the on-impact method on EVERY living entity @@ -122,9 +112,4 @@ public ItemStack getItem() { return stack; } } - - @Override - public Packet getAddEntityPacket() { - return NetworkHooks.getEntitySpawningPacket(this); - } } diff --git a/src/main/java/reliquary/entities/potion/ThrownXRPotionEntity.java b/src/main/java/reliquary/entities/potion/ThrownXRPotionEntity.java index f79719c3..52a4299a 100644 --- a/src/main/java/reliquary/entities/potion/ThrownXRPotionEntity.java +++ b/src/main/java/reliquary/entities/potion/ThrownXRPotionEntity.java @@ -4,8 +4,6 @@ import net.minecraft.core.particles.ParticleTypes; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.network.protocol.Packet; -import net.minecraft.network.protocol.game.ClientGamePacketListener; import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.SynchedEntityData; @@ -25,25 +23,17 @@ import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.EntityHitResult; import net.minecraft.world.phys.HitResult; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.entity.IEntityAdditionalSpawnData; -import net.minecraftforge.network.NetworkHooks; -import net.minecraftforge.network.PacketDistributor; +import net.neoforged.neoforge.entity.IEntityWithComplexSpawn; import reliquary.init.ModEntities; import reliquary.init.ModItems; import reliquary.items.util.IPotionItem; -import reliquary.network.PacketFXThrownPotionImpact; import reliquary.network.PacketHandler; +import reliquary.network.SpawnThrownPotionImpactParticlesPacket; import reliquary.util.potions.XRPotionHelper; import java.util.List; -@OnlyIn( - value = Dist.CLIENT, - _interface = ItemSupplier.class -) -public class ThrownXRPotionEntity extends ThrowableProjectile implements IEntityAdditionalSpawnData, ItemSupplier { +public class ThrownXRPotionEntity extends ThrowableProjectile implements IEntityWithComplexSpawn, ItemSupplier { private static final EntityDataAccessor ITEM = SynchedEntityData.defineId(ThrownXRPotionEntity.class, EntityDataSerializers.ITEM_STACK); public ThrownXRPotionEntity(EntityType entityType, Level world) { @@ -146,7 +136,7 @@ private void spawnParticles(int color) { } level().playSound(null, blockPosition(), SoundEvents.GLASS_BREAK, SoundSource.BLOCKS, 1.0F, level().random.nextFloat() * 0.1F + 0.9F); - PacketHandler.sendToAllAround(new PacketFXThrownPotionImpact(color, getX(), getY(), getZ()), new PacketDistributor.TargetPoint(getX(), getY(), getZ(), 32.0D, level().dimension())); + PacketHandler.sendToAllNear(this, new SpawnThrownPotionImpactParticlesPacket(color, getX(), getY(), getZ()), 32.0D); } @Override @@ -184,10 +174,5 @@ public void writeSpawnData(FriendlyByteBuf buffer) { public void readSpawnData(FriendlyByteBuf additionalData) { setItem(additionalData.readItem()); } - - @Override - public Packet getAddEntityPacket() { - return NetworkHooks.getEntitySpawningPacket(this); - } } diff --git a/src/main/java/reliquary/entities/shot/ShotEntityBase.java b/src/main/java/reliquary/entities/shot/ShotEntityBase.java index 2565c664..4bd326c7 100644 --- a/src/main/java/reliquary/entities/shot/ShotEntityBase.java +++ b/src/main/java/reliquary/entities/shot/ShotEntityBase.java @@ -4,8 +4,6 @@ import net.minecraft.core.particles.ParticleOptions; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.nbt.CompoundTag; -import net.minecraft.network.protocol.Packet; -import net.minecraft.network.protocol.game.ClientGamePacketListener; import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.SynchedEntityData; @@ -23,16 +21,9 @@ import net.minecraft.world.item.alchemy.PotionUtils; import net.minecraft.world.level.ClipContext; import net.minecraft.world.level.Level; -import net.minecraft.world.phys.AABB; -import net.minecraft.world.phys.BlockHitResult; -import net.minecraft.world.phys.EntityHitResult; -import net.minecraft.world.phys.HitResult; -import net.minecraft.world.phys.Vec3; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.network.NetworkHooks; +import net.minecraft.world.phys.*; import reliquary.init.ModEntities; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.RegistryHelper; import reliquary.util.potions.XRPotionHelper; @@ -111,17 +102,6 @@ public void shoot(double motionX, double motionY, double motionZ, float velocity } @Override - @OnlyIn(Dist.CLIENT) - public void lerpTo(double x, double y, double z, float yaw, float pitch, int posRotationIncrements, boolean teleport) { - setPos(x, y, z); - setRot(yaw, pitch); - } - - /** - * Sets the velocity to the args. Args: x, y, z - */ - @Override - @OnlyIn(Dist.CLIENT) public void lerpMotion(double motionX, double motionY, double motionZ) { setDeltaMovement(motionX, motionY, motionZ); @@ -265,7 +245,6 @@ protected MovementEmission getMovementEmission() { return MovementEmission.NONE; } - @OnlyIn(Dist.CLIENT) @Override public boolean shouldRenderAtSqrDistance(double distance) { double d0 = 64.0D; @@ -376,10 +355,14 @@ private void ricochet(Direction sideHit) { scheduledForDeath = true; for (int particles = 0; particles < 4; particles++) { switch (sideHit) { - case DOWN -> level().addParticle(ParticleTypes.SMOKE, getX(), getY(), getZ(), gaussian(0.1D), -gaussian(0.1D), gaussian(0.1D)); - case UP, SOUTH, EAST -> level().addParticle(ParticleTypes.SMOKE, getX(), getY(), getZ(), gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); - case NORTH -> level().addParticle(ParticleTypes.SMOKE, getX(), getY(), getZ(), gaussian(0.1D), gaussian(0.1D), -gaussian(0.1D)); - case WEST -> level().addParticle(ParticleTypes.SMOKE, getX(), getY(), getZ(), -gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); + case DOWN -> + level().addParticle(ParticleTypes.SMOKE, getX(), getY(), getZ(), gaussian(0.1D), -gaussian(0.1D), gaussian(0.1D)); + case UP, SOUTH, EAST -> + level().addParticle(ParticleTypes.SMOKE, getX(), getY(), getZ(), gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); + case NORTH -> + level().addParticle(ParticleTypes.SMOKE, getX(), getY(), getZ(), gaussian(0.1D), gaussian(0.1D), -gaussian(0.1D)); + case WEST -> + level().addParticle(ParticleTypes.SMOKE, getX(), getY(), getZ(), -gaussian(0.1D), gaussian(0.1D), gaussian(0.1D)); default -> {/*noop*/} } } @@ -393,7 +376,7 @@ private void ricochet(Direction sideHit) { */ void seekTarget() { Entity closestTarget = null; - List huntableEntitiesBlacklist = Settings.COMMON.items.seekerShot.huntableEntitiesBlacklist.get(); + List huntableEntitiesBlacklist = Config.COMMON.items.seekerShot.huntableEntitiesBlacklist.get(); List targetsList = level().getEntities(this, new AABB(getX() - 5, getY() - 5, getZ() - 5, getX() + 5, getY() + 5, getZ() + 5), Mob.class::isInstance); @@ -514,9 +497,4 @@ protected void onHit(HitResult result) { // used by the renderer to pull the shot texture directly from the entity. // This might not work. public abstract ResourceLocation getShotTexture(); - - @Override - public Packet getAddEntityPacket() { - return NetworkHooks.getEntitySpawningPacket(this); - } } diff --git a/src/main/java/reliquary/handler/ClientEventHandler.java b/src/main/java/reliquary/handler/ClientEventHandler.java index 027da350..ccf19e54 100644 --- a/src/main/java/reliquary/handler/ClientEventHandler.java +++ b/src/main/java/reliquary/handler/ClientEventHandler.java @@ -25,30 +25,20 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; -import net.minecraftforge.client.event.EntityRenderersEvent; -import net.minecraftforge.client.event.InputEvent; -import net.minecraftforge.client.event.RegisterGuiOverlaysEvent; -import net.minecraftforge.client.event.RegisterKeyMappingsEvent; -import net.minecraftforge.client.event.RenderLivingEvent; -import net.minecraftforge.client.gui.overlay.VanillaGuiOverlay; -import net.minecraftforge.client.settings.KeyConflictContext; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; -import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent; -import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.fml.ModLoadingContext; +import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; +import net.neoforged.fml.event.lifecycle.FMLLoadCompleteEvent; +import net.neoforged.neoforge.client.event.*; +import net.neoforged.neoforge.client.gui.overlay.VanillaGuiOverlay; +import net.neoforged.neoforge.client.settings.KeyConflictContext; +import net.neoforged.neoforge.common.NeoForge; +import net.neoforged.neoforge.network.PacketDistributor; import reliquary.client.gui.components.Box; import reliquary.client.gui.components.Component; import reliquary.client.gui.components.ItemStackPane; import reliquary.client.gui.components.TextPane; -import reliquary.client.gui.hud.ChargePane; -import reliquary.client.gui.hud.ChargeableItemInfoPane; -import reliquary.client.gui.hud.CharmPane; -import reliquary.client.gui.hud.DynamicChargePane; -import reliquary.client.gui.hud.HUDPosition; -import reliquary.client.gui.hud.HUDRenderrer; -import reliquary.client.gui.hud.HandgunPane; -import reliquary.client.gui.hud.HeroMedallionPane; +import reliquary.client.gui.hud.*; import reliquary.client.init.ItemModels; import reliquary.client.init.ModBlockColors; import reliquary.client.init.ModItemColors; @@ -56,30 +46,16 @@ import reliquary.client.model.MobCharmBeltModel; import reliquary.client.model.WitchHatModel; import reliquary.client.registry.PedestalClientRegistry; -import reliquary.client.render.ApothecaryMortarRenderer; -import reliquary.client.render.LyssaHookRenderer; -import reliquary.client.render.PassivePedestalRenderer; -import reliquary.client.render.PedestalFishHookRenderer; -import reliquary.client.render.PedestalRenderer; -import reliquary.client.render.ShotRenderer; -import reliquary.client.render.XRTippedArrowRenderer; +import reliquary.client.render.*; import reliquary.init.ModBlocks; import reliquary.init.ModEntities; import reliquary.init.ModItems; -import reliquary.items.EnderStaffItem; -import reliquary.items.FortuneCoinToggler; -import reliquary.items.HarvestRodItem; -import reliquary.items.InfernalTearItem; -import reliquary.items.PyromancerStaffItem; -import reliquary.items.RendingGaleItem; -import reliquary.items.RodOfLyssaItem; -import reliquary.items.VoidTearItem; +import reliquary.items.*; import reliquary.items.util.IScrollableItem; -import reliquary.network.PacketHandler; import reliquary.network.ScrolledItemPacket; import reliquary.reference.Colors; +import reliquary.reference.Config; import reliquary.reference.Reference; -import reliquary.reference.Settings; import reliquary.util.InventoryHelper; import reliquary.util.NBTHelper; import reliquary.util.potions.XRPotionHelper; @@ -88,7 +64,8 @@ import java.util.Map; public class ClientEventHandler { - private ClientEventHandler() {} + private ClientEventHandler() { + } private static final int KEY_UNKNOWN = -1; public static final KeyMapping FORTUNE_COIN_TOGGLE_KEYBIND = new KeyMapping("keybind.reliquary.fortune_coin", KeyConflictContext.UNIVERSAL, InputConstants.Type.KEYSYM.getOrCreate(KEY_UNKNOWN), "keybind.reliquary.category"); @@ -97,7 +74,11 @@ private ClientEventHandler() {} public static final ModelLayerLocation MOB_CHARM_BELT_LAYER = new ModelLayerLocation(new ResourceLocation(Reference.MOD_ID, "mob_charm_belt"), "main"); public static void registerHandlers() { - IEventBus modBus = FMLJavaModLoadingContext.get().getModEventBus(); + IEventBus modBus = ModLoadingContext.get().getActiveContainer().getEventBus(); + if (modBus == null) { + return; + } + modBus.addListener(ClientEventHandler::clientSetup); modBus.addListener(ClientEventHandler::registerKeyMappings); modBus.addListener(ClientEventHandler::loadComplete); @@ -109,7 +90,7 @@ public static void registerHandlers() { modBus.addListener(ModItemColors::registerItemColors); modBus.addListener(ClientEventHandler::registerOverlay); - IEventBus eventBus = MinecraftForge.EVENT_BUS; + IEventBus eventBus = NeoForge.EVENT_BUS; eventBus.addListener(ClientEventHandler::onRenderLiving); eventBus.addListener(ClientEventHandler::onMouseScrolled); } @@ -182,7 +163,7 @@ private static boolean isValidTimeFrame(Level world, ItemStack handgun) { private static final List> hudComponents = Lists.newArrayList(); private static void registerOverlay(RegisterGuiOverlaysEvent event) { - event.registerAbove(VanillaGuiOverlay.HOTBAR.id(), "reliquary_hud", (gui, guiGraphics, partialTick, screenWidth, screenHeight) -> { + event.registerAbove(VanillaGuiOverlay.HOTBAR.id(), new ResourceLocation(Reference.MOD_ID, "reliquary_hud"), (gui, guiGraphics, partialTick, screenWidth, screenHeight) -> { if (hudComponents.isEmpty()) { initHUDComponents(); } @@ -200,9 +181,9 @@ private static void onMouseScrolled(InputEvent.MouseScrollingEvent evt) { return; } ItemStack stack = player.getMainHandItem(); - double scrollDelta = evt.getScrollDelta(); + double scrollDelta = evt.getScrollDeltaY(); if (stack.getItem() instanceof IScrollableItem scrollableItem && scrollableItem.onMouseScrolled(stack, player, scrollDelta) == InteractionResult.PASS) { - PacketHandler.sendToServer(new ScrolledItemPacket(scrollDelta)); + PacketDistributor.SERVER.noArg().send(new ScrolledItemPacket(scrollDelta)); evt.setCanceled(true); } } @@ -214,54 +195,54 @@ private static void renderHUDComponents(GuiGraphics guiGraphics) { } private static void initHUDComponents() { - hudComponents.add(new Tuple<>(new ChargeableItemInfoPane(ModItems.ALKAHESTRY_TOME.get(), Settings.CLIENT.hudPositions.alkahestryTome.get(), new ItemStack(Items.REDSTONE), is -> NBTHelper.getInt("charge", is)), - Settings.CLIENT.hudPositions.alkahestryTome.get())); + hudComponents.add(new Tuple<>(new ChargeableItemInfoPane(ModItems.ALKAHESTRY_TOME.get(), Config.CLIENT.hudPositions.alkahestryTome.get(), new ItemStack(Items.REDSTONE), is -> NBTHelper.getInt("charge", is)), + Config.CLIENT.hudPositions.alkahestryTome.get())); - hudComponents.add(new Tuple<>(new ChargeableItemInfoPane(ModItems.DESTRUCTION_CATALYST.get(), Settings.CLIENT.hudPositions.destructionCatalyst.get(), new ItemStack(Items.GUNPOWDER), is -> NBTHelper.getInt("gunpowder", is)), - Settings.CLIENT.hudPositions.destructionCatalyst.get())); + hudComponents.add(new Tuple<>(new ChargeableItemInfoPane(ModItems.DESTRUCTION_CATALYST.get(), Config.CLIENT.hudPositions.destructionCatalyst.get(), new ItemStack(Items.GUNPOWDER), is -> NBTHelper.getInt("gunpowder", is)), + Config.CLIENT.hudPositions.destructionCatalyst.get())); - hudComponents.add(new Tuple<>(new ChargeableItemInfoPane(ModItems.MIDAS_TOUCHSTONE.get(), Settings.CLIENT.hudPositions.midasTouchstone.get(), new ItemStack(Items.GLOWSTONE_DUST), is -> NBTHelper.getInt("glowstone", is)), - Settings.CLIENT.hudPositions.midasTouchstone.get())); + hudComponents.add(new Tuple<>(new ChargeableItemInfoPane(ModItems.MIDAS_TOUCHSTONE.get(), Config.CLIENT.hudPositions.midasTouchstone.get(), new ItemStack(Items.GLOWSTONE_DUST), is -> NBTHelper.getInt("glowstone", is)), + Config.CLIENT.hudPositions.midasTouchstone.get())); - hudComponents.add(new Tuple<>(new ChargeableItemInfoPane(ModItems.INFERNAL_CHALICE.get(), Settings.CLIENT.hudPositions.infernalChalice.get(), new ItemStack(Items.LAVA_BUCKET), is -> NBTHelper.getInt("fluidStacks", is) / 1000, Colors.get(Colors.RED)), - Settings.CLIENT.hudPositions.infernalChalice.get())); + hudComponents.add(new Tuple<>(new ChargeableItemInfoPane(ModItems.INFERNAL_CHALICE.get(), Config.CLIENT.hudPositions.infernalChalice.get(), new ItemStack(Items.LAVA_BUCKET), is -> NBTHelper.getInt("fluidStacks", is) / 1000, Colors.get(Colors.RED)), + Config.CLIENT.hudPositions.infernalChalice.get())); - hudComponents.add(new Tuple<>(new ChargeableItemInfoPane(ModItems.ICE_MAGUS_ROD.get(), Settings.CLIENT.hudPositions.iceMagusRod.get(), new ItemStack(Items.SNOWBALL), is -> NBTHelper.getInt("snowballs", is)), - Settings.CLIENT.hudPositions.iceMagusRod.get())); + hudComponents.add(new Tuple<>(new ChargeableItemInfoPane(ModItems.ICE_MAGUS_ROD.get(), Config.CLIENT.hudPositions.iceMagusRod.get(), new ItemStack(Items.SNOWBALL), is -> NBTHelper.getInt("snowballs", is)), + Config.CLIENT.hudPositions.iceMagusRod.get())); - hudComponents.add(new Tuple<>(new ChargeableItemInfoPane(ModItems.GLACIAL_STAFF.get(), Settings.CLIENT.hudPositions.glacialStaff.get(), new ItemStack(Items.SNOWBALL), is -> NBTHelper.getInt("snowballs", is)), - Settings.CLIENT.hudPositions.glacialStaff.get())); + hudComponents.add(new Tuple<>(new ChargeableItemInfoPane(ModItems.GLACIAL_STAFF.get(), Config.CLIENT.hudPositions.glacialStaff.get(), new ItemStack(Items.SNOWBALL), is -> NBTHelper.getInt("snowballs", is)), + Config.CLIENT.hudPositions.glacialStaff.get())); - hudComponents.add(new Tuple<>(new ChargeableItemInfoPane(ModItems.ENDER_STAFF.get(), Settings.CLIENT.hudPositions.enderStaff.get(), is -> ModItems.ENDER_STAFF.get().getMode(is).getSerializedName(), + hudComponents.add(new Tuple<>(new ChargeableItemInfoPane(ModItems.ENDER_STAFF.get(), Config.CLIENT.hudPositions.enderStaff.get(), is -> ModItems.ENDER_STAFF.get().getMode(is).getSerializedName(), Map.of( - EnderStaffItem.Mode.CAST.getSerializedName(), new ChargePane(ModItems.ENDER_STAFF.get(), new ItemStack(Items.ENDER_PEARL), is -> ModItems.ENDER_STAFF.get().getPearlCount(is, true)), - EnderStaffItem.Mode.NODE_WARP.getSerializedName(), new ChargePane(ModItems.ENDER_STAFF.get(), new ItemStack(ModBlocks.WRAITH_NODE.get()), is -> ModItems.ENDER_STAFF.get().getPearlCount(is, true)), - EnderStaffItem.Mode.LONG_CAST.getSerializedName(), new ChargePane(ModItems.ENDER_STAFF.get(), new ItemStack(Items.ENDER_EYE), is -> ModItems.ENDER_STAFF.get().getPearlCount(is, true)) - )), Settings.CLIENT.hudPositions.enderStaff.get())); + EnderStaffItem.Mode.CAST.getSerializedName(), new ChargePane(ModItems.ENDER_STAFF.get(), new ItemStack(Items.ENDER_PEARL), is -> ModItems.ENDER_STAFF.get().getPearlCount(is)), + EnderStaffItem.Mode.NODE_WARP.getSerializedName(), new ChargePane(ModItems.ENDER_STAFF.get(), new ItemStack(ModBlocks.WRAITH_NODE.get()), is -> ModItems.ENDER_STAFF.get().getPearlCount(is)), + EnderStaffItem.Mode.LONG_CAST.getSerializedName(), new ChargePane(ModItems.ENDER_STAFF.get(), new ItemStack(Items.ENDER_EYE), is -> ModItems.ENDER_STAFF.get().getPearlCount(is)) + )), Config.CLIENT.hudPositions.enderStaff.get())); - hudComponents.add(new Tuple<>(new ChargeableItemInfoPane(ModItems.PYROMANCER_STAFF.get(), Settings.CLIENT.hudPositions.pyromancerStaff.get(), is -> ModItems.PYROMANCER_STAFF.get().getMode(is).getSerializedName(), + hudComponents.add(new Tuple<>(new ChargeableItemInfoPane(ModItems.PYROMANCER_STAFF.get(), Config.CLIENT.hudPositions.pyromancerStaff.get(), is -> ModItems.PYROMANCER_STAFF.get().getMode(is).getSerializedName(), Map.of( PyromancerStaffItem.Mode.BLAZE.getSerializedName(), new ChargePane(ModItems.PYROMANCER_STAFF.get(), new ItemStack(Items.BLAZE_POWDER), is -> ModItems.PYROMANCER_STAFF.get().getInternalStorageItemCount(is, Items.BLAZE_POWDER)), PyromancerStaffItem.Mode.FIRE_CHARGE.getSerializedName(), new ChargePane(ModItems.PYROMANCER_STAFF.get(), new ItemStack(Items.FIRE_CHARGE), is -> ModItems.PYROMANCER_STAFF.get().getInternalStorageItemCount(is, Items.FIRE_CHARGE)), PyromancerStaffItem.Mode.ERUPTION.getSerializedName(), Box.createVertical(Box.Alignment.RIGHT, new TextPane("ERUPT"), new ChargePane(ModItems.PYROMANCER_STAFF.get(), new ItemStack(Items.BLAZE_POWDER), is -> ModItems.PYROMANCER_STAFF.get().getInternalStorageItemCount(is, Items.BLAZE_POWDER))), PyromancerStaffItem.Mode.FLINT_AND_STEEL.getSerializedName(), new ItemStackPane(Items.FLINT_AND_STEEL) - )), Settings.CLIENT.hudPositions.pyromancerStaff.get())); + )), Config.CLIENT.hudPositions.pyromancerStaff.get())); ChargePane rendingGaleFeatherPane = new ChargePane(ModItems.RENDING_GALE.get(), new ItemStack(Items.FEATHER), is -> { LocalPlayer player = Minecraft.getInstance().player; return player == null ? 0 : ModItems.RENDING_GALE.get().getFeatherCountClient(is, player) / 100; }); - hudComponents.add(new Tuple<>(new ChargeableItemInfoPane(ModItems.RENDING_GALE.get(), Settings.CLIENT.hudPositions.rendingGale.get(), is -> ModItems.RENDING_GALE.get().getMode(is).getSerializedName(), + hudComponents.add(new Tuple<>(new ChargeableItemInfoPane(ModItems.RENDING_GALE.get(), Config.CLIENT.hudPositions.rendingGale.get(), is -> ModItems.RENDING_GALE.get().getMode(is).getSerializedName(), Map.of( RendingGaleItem.Mode.PUSH.getSerializedName(), Box.createVertical(Box.Alignment.RIGHT, new TextPane("PUSH"), rendingGaleFeatherPane), RendingGaleItem.Mode.PULL.getSerializedName(), Box.createVertical(Box.Alignment.RIGHT, new TextPane("PULL"), rendingGaleFeatherPane), RendingGaleItem.Mode.BOLT.getSerializedName(), Box.createVertical(Box.Alignment.RIGHT, new TextPane("BOLT"), rendingGaleFeatherPane), RendingGaleItem.Mode.FLIGHT.getSerializedName(), Box.createVertical(Box.Alignment.RIGHT, new TextPane("FLIGHT"), rendingGaleFeatherPane) - )), Settings.CLIENT.hudPositions.rendingGale.get())); + )), Config.CLIENT.hudPositions.rendingGale.get())); Component contentsPane = new DynamicChargePane(ModItems.VOID_TEAR.get(), - is -> VoidTearItem.getTearContents(is, true), is -> VoidTearItem.getTearContents(is, true).getCount()); - hudComponents.add(new Tuple<>(new ChargeableItemInfoPane(ModItems.VOID_TEAR.get(), Settings.CLIENT.hudPositions.voidTear.get(), is -> ModItems.VOID_TEAR.get().getMode(is).getSerializedName(), + VoidTearItem::getTearContents, is -> VoidTearItem.getTearContents(is).getCount()); + hudComponents.add(new Tuple<>(new ChargeableItemInfoPane(ModItems.VOID_TEAR.get(), Config.CLIENT.hudPositions.voidTear.get(), is -> ModItems.VOID_TEAR.get().getMode(is).getSerializedName(), Map.of( VoidTearItem.Mode.FULL_INVENTORY.getSerializedName(), Box.createVertical(Box.Alignment.RIGHT, new TextPane(Language.getInstance().getOrDefault(VOID_TEAR_MODE_TRANSLATION + VoidTearItem.Mode.FULL_INVENTORY.getSerializedName().toLowerCase())), contentsPane), VoidTearItem.Mode.NO_REFILL.getSerializedName(), Box.createVertical(Box.Alignment.RIGHT, new TextPane(Language.getInstance().getOrDefault(VOID_TEAR_MODE_TRANSLATION + VoidTearItem.Mode.NO_REFILL.getSerializedName().toLowerCase())), contentsPane), @@ -270,27 +251,27 @@ private static void initHUDComponents() { @Override public boolean shouldRender() { LocalPlayer player = Minecraft.getInstance().player; - return player != null && !VoidTearItem.isEmpty(InventoryHelper.getCorrectItemFromEitherHand(player, ModItems.VOID_TEAR.get()), true); + return player != null && !ModItems.VOID_TEAR.get().isEmpty(InventoryHelper.getCorrectItemFromEitherHand(player, ModItems.VOID_TEAR.get())); } - }, Settings.CLIENT.hudPositions.voidTear.get())); + }, Config.CLIENT.hudPositions.voidTear.get())); - hudComponents.add(new Tuple<>(new ChargeableItemInfoPane(ModItems.HARVEST_ROD.get(), Settings.CLIENT.hudPositions.harvestRod.get(), is -> ModItems.HARVEST_ROD.get().getMode(is).getSerializedName(), + hudComponents.add(new Tuple<>(new ChargeableItemInfoPane(ModItems.HARVEST_ROD.get(), Config.CLIENT.hudPositions.harvestRod.get(), is -> ModItems.HARVEST_ROD.get().getMode(is).getSerializedName(), Map.of( - HarvestRodItem.Mode.BONE_MEAL.getSerializedName(), new ChargePane(ModItems.HARVEST_ROD.get(), new ItemStack(Items.BONE_MEAL), is -> ModItems.HARVEST_ROD.get().getBoneMealCount(is, true)), + HarvestRodItem.Mode.BONE_MEAL.getSerializedName(), new ChargePane(ModItems.HARVEST_ROD.get(), new ItemStack(Items.BONE_MEAL), is -> ModItems.HARVEST_ROD.get().getBoneMealCount(is)), HarvestRodItem.Mode.HOE.getSerializedName(), new ItemStackPane(Items.WOODEN_HOE), - ChargeableItemInfoPane.DYNAMIC_PANE, new DynamicChargePane(ModItems.HARVEST_ROD.get(), is -> ModItems.HARVEST_ROD.get().getCurrentPlantable(is, true), is -> ModItems.HARVEST_ROD.get().getPlantableQuantity(is, ModItems.HARVEST_ROD.get().getCurrentPlantableSlot(is), true)) - )), Settings.CLIENT.hudPositions.harvestRod.get())); + ChargeableItemInfoPane.DYNAMIC_PANE, new DynamicChargePane(ModItems.HARVEST_ROD.get(), is -> ModItems.HARVEST_ROD.get().getCurrentPlantable(is), is -> ModItems.HARVEST_ROD.get().getPlantableQuantity(is, ModItems.HARVEST_ROD.get().getCurrentPlantableSlot(is))) + )), Config.CLIENT.hudPositions.harvestRod.get())); - hudComponents.add(new Tuple<>(new ChargeableItemInfoPane(ModItems.SOJOURNER_STAFF.get(), Settings.CLIENT.hudPositions.sojournerStaff.get(), is -> ChargeableItemInfoPane.DYNAMIC_PANE, + hudComponents.add(new Tuple<>(new ChargeableItemInfoPane(ModItems.SOJOURNER_STAFF.get(), Config.CLIENT.hudPositions.sojournerStaff.get(), is -> ChargeableItemInfoPane.DYNAMIC_PANE, Map.of( ChargeableItemInfoPane.DYNAMIC_PANE, new DynamicChargePane(ModItems.SOJOURNER_STAFF.get(), ModItems.SOJOURNER_STAFF.get()::getCurrentTorch, ModItems.SOJOURNER_STAFF.get()::getTorchCount) - )), Settings.CLIENT.hudPositions.sojournerStaff.get())); + )), Config.CLIENT.hudPositions.sojournerStaff.get())); - hudComponents.add(new Tuple<>(new HeroMedallionPane(), Settings.CLIENT.hudPositions.heroMedallion.get())); + hudComponents.add(new Tuple<>(new HeroMedallionPane(), Config.CLIENT.hudPositions.heroMedallion.get())); - hudComponents.add(new Tuple<>(Box.createVertical(Box.Alignment.RIGHT, new HandgunPane(InteractionHand.OFF_HAND), new HandgunPane(InteractionHand.MAIN_HAND)), Settings.CLIENT.hudPositions.handgun.get())); + hudComponents.add(new Tuple<>(Box.createVertical(Box.Alignment.RIGHT, new HandgunPane(InteractionHand.OFF_HAND), new HandgunPane(InteractionHand.MAIN_HAND)), Config.CLIENT.hudPositions.handgun.get())); - hudComponents.add(new Tuple<>(new CharmPane(), Settings.CLIENT.hudPositions.mobCharm.get())); + hudComponents.add(new Tuple<>(new CharmPane(), Config.CLIENT.hudPositions.mobCharm.get())); } private static void registerEntityRenderers(EntityRenderersEvent.RegisterRenderers event) { @@ -336,7 +317,7 @@ private static void registerBulletAndMagazineItemProperties() { private static void registerVoidTearItemProperties() { ItemProperties.register(ModItems.VOID_TEAR.get(), new ResourceLocation("empty"), - (stack, level, entity, seed) -> VoidTearItem.isEmpty(stack, true) ? 1.0F : 0.0F); + (stack, level, entity, seed) -> ModItems.VOID_TEAR.get().isEmpty(stack) ? 1.0F : 0.0F); } private static void registerInfernalTearItemProperties() { @@ -375,7 +356,7 @@ private static boolean isPotionAttached(ItemStack stack) { private static void loadComplete(FMLLoadCompleteEvent event) { event.enqueueWork(() -> { PedestalClientRegistry.registerItemRenderer(FishingRodItem.class, PedestalFishHookRenderer::new); - MinecraftForge.EVENT_BUS.addListener(FortuneCoinToggler::handleKeyInputEvent); + NeoForge.EVENT_BUS.addListener(FortuneCoinToggler::handleKeyInputEvent); }); } } diff --git a/src/main/java/reliquary/handler/CommonEventHandler.java b/src/main/java/reliquary/handler/CommonEventHandler.java index f88fb6cb..2c6494af 100644 --- a/src/main/java/reliquary/handler/CommonEventHandler.java +++ b/src/main/java/reliquary/handler/CommonEventHandler.java @@ -9,14 +9,14 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.enchantment.EnchantmentHelper; import net.minecraft.world.item.enchantment.Enchantments; -import net.minecraftforge.event.AnvilUpdateEvent; -import net.minecraftforge.event.TickEvent; -import net.minecraftforge.event.entity.living.LivingAttackEvent; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.player.PlayerEvent; -import net.minecraftforge.event.level.LevelEvent; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.fml.LogicalSide; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.fml.LogicalSide; +import net.neoforged.neoforge.event.AnvilUpdateEvent; +import net.neoforged.neoforge.event.TickEvent; +import net.neoforged.neoforge.event.entity.living.LivingAttackEvent; +import net.neoforged.neoforge.event.entity.living.LivingDeathEvent; +import net.neoforged.neoforge.event.entity.player.PlayerEvent; +import net.neoforged.neoforge.event.level.LevelEvent; import reliquary.blocks.PassivePedestalBlock; import reliquary.init.ModItems; import reliquary.items.RendingGaleItem; @@ -29,7 +29,8 @@ import java.util.UUID; public class CommonEventHandler { - private CommonEventHandler() {} + private CommonEventHandler() { + } private static final Set playerHurtHandlers = Sets.newTreeSet(new HandlerPriorityComparator()); private static final Set playerDeathHandlers = Sets.newTreeSet(new HandlerPriorityComparator()); @@ -94,7 +95,6 @@ public static void beforePlayerHurt(LivingAttackEvent event) { if (cancel) { event.setCanceled(true); - event.setResult(null); } } @@ -114,7 +114,6 @@ public static void beforePlayerDeath(LivingDeathEvent event) { if (cancel) { event.setCanceled(true); - event.setResult(null); } } diff --git a/src/main/java/reliquary/handler/IPlayerDeathHandler.java b/src/main/java/reliquary/handler/IPlayerDeathHandler.java index 1713d779..017901b8 100644 --- a/src/main/java/reliquary/handler/IPlayerDeathHandler.java +++ b/src/main/java/reliquary/handler/IPlayerDeathHandler.java @@ -1,7 +1,7 @@ package reliquary.handler; import net.minecraft.world.entity.player.Player; -import net.minecraftforge.event.entity.living.LivingDeathEvent; +import net.neoforged.neoforge.event.entity.living.LivingDeathEvent; public interface IPlayerDeathHandler extends IPrioritizedHandler { boolean canApply(Player player, LivingDeathEvent event); diff --git a/src/main/java/reliquary/handler/IPlayerHurtHandler.java b/src/main/java/reliquary/handler/IPlayerHurtHandler.java index 93529e12..830278bd 100644 --- a/src/main/java/reliquary/handler/IPlayerHurtHandler.java +++ b/src/main/java/reliquary/handler/IPlayerHurtHandler.java @@ -1,7 +1,7 @@ package reliquary.handler; import net.minecraft.world.entity.player.Player; -import net.minecraftforge.event.entity.living.LivingAttackEvent; +import net.neoforged.neoforge.event.entity.living.LivingAttackEvent; public interface IPlayerHurtHandler extends IPrioritizedHandler { boolean canApply(Player player, LivingAttackEvent event); diff --git a/src/main/java/reliquary/init/ModBlocks.java b/src/main/java/reliquary/init/ModBlocks.java index 8fa7ca04..5659f64d 100644 --- a/src/main/java/reliquary/init/ModBlocks.java +++ b/src/main/java/reliquary/init/ModBlocks.java @@ -1,6 +1,7 @@ package reliquary.init; import com.google.common.collect.ImmutableMap; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.network.chat.Component; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.DyeColor; @@ -9,37 +10,26 @@ import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; -import reliquary.blocks.AlkahestryAltarBlock; -import reliquary.blocks.ApothecaryCauldronBlock; -import reliquary.blocks.ApothecaryMortarBlock; -import reliquary.blocks.FertileLilyPadBlock; -import reliquary.blocks.InterdictionTorchBlock; -import reliquary.blocks.PassivePedestalBlock; -import reliquary.blocks.PedestalBlock; -import reliquary.blocks.WallInterdictionTorchBlock; -import reliquary.blocks.WraithNodeBlock; -import reliquary.blocks.tile.AlkahestryAltarBlockEntity; -import reliquary.blocks.tile.ApothecaryCauldronBlockEntity; -import reliquary.blocks.tile.ApothecaryMortarBlockEntity; -import reliquary.blocks.tile.PassivePedestalBlockEntity; -import reliquary.blocks.tile.PedestalBlockEntity; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent; +import net.neoforged.neoforge.registries.DeferredRegister; +import reliquary.blocks.*; +import reliquary.blocks.tile.*; import reliquary.items.block.BlockItemBase; import reliquary.items.block.FertileLilyPadItem; import reliquary.items.block.InterdictionTorchItem; import reliquary.reference.Reference; import java.util.Map; +import java.util.function.Supplier; public class ModBlocks { private ModBlocks() {} - public static final DeferredRegister ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, Reference.MOD_ID); - private static final DeferredRegister BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, Reference.MOD_ID); - private static final DeferredRegister> BLOCK_ENTITY_TYPES = DeferredRegister.create(ForgeRegistries.BLOCK_ENTITY_TYPES, Reference.MOD_ID); + public static final DeferredRegister ITEMS = DeferredRegister.create(BuiltInRegistries.ITEM, Reference.MOD_ID); + private static final DeferredRegister BLOCKS = DeferredRegister.create(BuiltInRegistries.BLOCK, Reference.MOD_ID); + private static final DeferredRegister> BLOCK_ENTITY_TYPES = DeferredRegister.create(BuiltInRegistries.BLOCK_ENTITY_TYPE, Reference.MOD_ID); private static final String ALKAHESTRY_ALTAR_REGISTRY_NAME = "alkahestry_altar"; private static final String INTERDICTION_TORCH_REGISTRY_NAME = "interdiction_torch"; @@ -48,20 +38,20 @@ private ModBlocks() {} private static final String FERTILE_LILY_PAD_REGISTRY_NAME = "fertile_lily_pad"; private static final String WRAITH_NODE_REGISTRY_NAME = "wraith_node"; - public static final RegistryObject ALKAHESTRY_ALTAR = BLOCKS.register(ALKAHESTRY_ALTAR_REGISTRY_NAME, AlkahestryAltarBlock::new); - public static final RegistryObject APOTHECARY_CAULDRON = BLOCKS.register(APOTHECARY_CAULDRON_REGISTRY_NAME, ApothecaryCauldronBlock::new); - public static final RegistryObject APOTHECARY_MORTAR = BLOCKS.register(APOTHECARY_MORTAR_REGISTRY_NAME, ApothecaryMortarBlock::new); - public static final RegistryObject FERTILE_LILY_PAD = BLOCKS.register(FERTILE_LILY_PAD_REGISTRY_NAME, FertileLilyPadBlock::new); - public static final RegistryObject INTERDICTION_TORCH = BLOCKS.register(INTERDICTION_TORCH_REGISTRY_NAME, InterdictionTorchBlock::new); - public static final RegistryObject WALL_INTERDICTION_TORCH = BLOCKS.register("wall_interdiction_torch", WallInterdictionTorchBlock::new); - public static final RegistryObject WRAITH_NODE = BLOCKS.register(WRAITH_NODE_REGISTRY_NAME, WraithNodeBlock::new); + public static final Supplier ALKAHESTRY_ALTAR = BLOCKS.register(ALKAHESTRY_ALTAR_REGISTRY_NAME, AlkahestryAltarBlock::new); + public static final Supplier APOTHECARY_CAULDRON = BLOCKS.register(APOTHECARY_CAULDRON_REGISTRY_NAME, ApothecaryCauldronBlock::new); + public static final Supplier APOTHECARY_MORTAR = BLOCKS.register(APOTHECARY_MORTAR_REGISTRY_NAME, ApothecaryMortarBlock::new); + public static final Supplier FERTILE_LILY_PAD = BLOCKS.register(FERTILE_LILY_PAD_REGISTRY_NAME, FertileLilyPadBlock::new); + public static final Supplier INTERDICTION_TORCH = BLOCKS.register(INTERDICTION_TORCH_REGISTRY_NAME, InterdictionTorchBlock::new); + public static final Supplier WALL_INTERDICTION_TORCH = BLOCKS.register("wall_interdiction_torch", WallInterdictionTorchBlock::new); + public static final Supplier WRAITH_NODE = BLOCKS.register(WRAITH_NODE_REGISTRY_NAME, WraithNodeBlock::new); - public static final Map> PASSIVE_PEDESTALS; - public static final Map> PEDESTALS; + public static final Map> PASSIVE_PEDESTALS; + public static final Map> PEDESTALS; static { - ImmutableMap.Builder> passiveBuilder = ImmutableMap.builder(); - ImmutableMap.Builder> activeBuilder = ImmutableMap.builder(); + ImmutableMap.Builder> passiveBuilder = ImmutableMap.builder(); + ImmutableMap.Builder> activeBuilder = ImmutableMap.builder(); for (DyeColor color : DyeColor.values()) { passiveBuilder.put(color, BLOCKS.register("pedestals/passive/" + color.getName() + "_passive_pedestal", PassivePedestalBlock::new)); activeBuilder.put(color, BLOCKS.register("pedestals/" + color.getName() + "_pedestal", PedestalBlock::new)); @@ -70,31 +60,31 @@ private ModBlocks() {} PEDESTALS = activeBuilder.build(); } - public static final RegistryObject> ALKAHESTRY_ALTAR_TILE_TYPE = BLOCK_ENTITY_TYPES.register(ALKAHESTRY_ALTAR_REGISTRY_NAME, + public static final Supplier> ALKAHESTRY_ALTAR_TILE_TYPE = BLOCK_ENTITY_TYPES.register(ALKAHESTRY_ALTAR_REGISTRY_NAME, () -> getTileEntityType(AlkahestryAltarBlockEntity::new, ALKAHESTRY_ALTAR.get())); - public static final RegistryObject> PEDESTAL_TILE_TYPE = BLOCK_ENTITY_TYPES.register("pedestal", - () -> getTileEntityType(PedestalBlockEntity::new, PEDESTALS.values().stream().map(RegistryObject::get).toArray(PedestalBlock[]::new))); - public static final RegistryObject> PASSIVE_PEDESTAL_TILE_TYPE = BLOCK_ENTITY_TYPES.register("passive_pedestal", - () -> getTileEntityType(PassivePedestalBlockEntity::new, PASSIVE_PEDESTALS.values().stream().map(RegistryObject::get).toArray(PassivePedestalBlock[]::new))); - public static final RegistryObject> APOTHECARY_CAULDRON_TILE_TYPE = BLOCK_ENTITY_TYPES.register(APOTHECARY_CAULDRON_REGISTRY_NAME, + public static final Supplier> PEDESTAL_TILE_TYPE = BLOCK_ENTITY_TYPES.register("pedestal", + () -> getTileEntityType(PedestalBlockEntity::new, PEDESTALS.values().stream().map(Supplier::get).toArray(PedestalBlock[]::new))); + public static final Supplier> PASSIVE_PEDESTAL_TILE_TYPE = BLOCK_ENTITY_TYPES.register("passive_pedestal", + () -> getTileEntityType(PassivePedestalBlockEntity::new, PASSIVE_PEDESTALS.values().stream().map(Supplier::get).toArray(PassivePedestalBlock[]::new))); + public static final Supplier> APOTHECARY_CAULDRON_TILE_TYPE = BLOCK_ENTITY_TYPES.register(APOTHECARY_CAULDRON_REGISTRY_NAME, () -> getTileEntityType(ApothecaryCauldronBlockEntity::new, APOTHECARY_CAULDRON.get())); - public static final RegistryObject> APOTHECARY_MORTAR_TILE_TYPE = BLOCK_ENTITY_TYPES.register(APOTHECARY_MORTAR_REGISTRY_NAME, + public static final Supplier> APOTHECARY_MORTAR_TILE_TYPE = BLOCK_ENTITY_TYPES.register(APOTHECARY_MORTAR_REGISTRY_NAME, () -> getTileEntityType(ApothecaryMortarBlockEntity::new, APOTHECARY_MORTAR.get())); - public static final RegistryObject ALKAHESTRY_ALTAR_ITEM = ITEMS.register(ALKAHESTRY_ALTAR_REGISTRY_NAME, () -> new BlockItemBase(ALKAHESTRY_ALTAR.get())); - public static final RegistryObject APOTHECARY_CAULDRON_ITEM = ITEMS.register(APOTHECARY_CAULDRON_REGISTRY_NAME, () -> new BlockItemBase(APOTHECARY_CAULDRON.get())); - public static final RegistryObject APOTHECARY_MORTAR_ITEM = ITEMS.register(APOTHECARY_MORTAR_REGISTRY_NAME, () -> new BlockItemBase(APOTHECARY_MORTAR.get())); - public static final RegistryObject FERTILE_LILY_PAD_ITEM = ITEMS.register(FERTILE_LILY_PAD_REGISTRY_NAME, FertileLilyPadItem::new); - public static final RegistryObject WRAITH_NODE_ITEM = ITEMS.register(WRAITH_NODE_REGISTRY_NAME, () -> new BlockItemBase(WRAITH_NODE.get())); - public static final RegistryObject INTERDICTION_TORCH_ITEM = ITEMS.register(INTERDICTION_TORCH_REGISTRY_NAME, InterdictionTorchItem::new); - public static final Map> PEDESTAL_ITEMS; - public static final Map> PASSIVE_PEDESTAL_ITEMS; + public static final Supplier ALKAHESTRY_ALTAR_ITEM = ITEMS.register(ALKAHESTRY_ALTAR_REGISTRY_NAME, () -> new BlockItemBase(ALKAHESTRY_ALTAR.get())); + public static final Supplier APOTHECARY_CAULDRON_ITEM = ITEMS.register(APOTHECARY_CAULDRON_REGISTRY_NAME, () -> new BlockItemBase(APOTHECARY_CAULDRON.get())); + public static final Supplier APOTHECARY_MORTAR_ITEM = ITEMS.register(APOTHECARY_MORTAR_REGISTRY_NAME, () -> new BlockItemBase(APOTHECARY_MORTAR.get())); + public static final Supplier FERTILE_LILY_PAD_ITEM = ITEMS.register(FERTILE_LILY_PAD_REGISTRY_NAME, FertileLilyPadItem::new); + public static final Supplier WRAITH_NODE_ITEM = ITEMS.register(WRAITH_NODE_REGISTRY_NAME, () -> new BlockItemBase(WRAITH_NODE.get())); + public static final Supplier INTERDICTION_TORCH_ITEM = ITEMS.register(INTERDICTION_TORCH_REGISTRY_NAME, InterdictionTorchItem::new); + public static final Map> PEDESTAL_ITEMS; + public static final Map> PASSIVE_PEDESTAL_ITEMS; private static final String BLOCK_PREFIX = "block."; static { - ImmutableMap.Builder> passiveBuilder = ImmutableMap.builder(); - ImmutableMap.Builder> activeBuilder = ImmutableMap.builder(); + ImmutableMap.Builder> passiveBuilder = ImmutableMap.builder(); + ImmutableMap.Builder> activeBuilder = ImmutableMap.builder(); for (DyeColor color : DyeColor.values()) { passiveBuilder.put(color, ITEMS.register("pedestals/passive/" + color.getName() + "_passive_pedestal", () -> new BlockItemBase(PASSIVE_PEDESTALS.get(color).get(), new Item.Properties()) { @Override @@ -127,10 +117,19 @@ public static void registerListeners(IEventBus modBus) { ITEMS.register(modBus); BLOCKS.register(modBus); BLOCK_ENTITY_TYPES.register(modBus); + modBus.addListener(ModBlocks::registerCapabilities); } @SuppressWarnings({"squid:S4449", "ConstantConditions"}) // no datafixer is defined for any of the tile entities so this is moot private static BlockEntityType getTileEntityType(BlockEntityType.BlockEntitySupplier tileFactory, Block... validBlocks) { return BlockEntityType.Builder.of(tileFactory, validBlocks).build(null); } + + private static void registerCapabilities(RegisterCapabilitiesEvent event) { + event.registerBlockEntity(Capabilities.ItemHandler.BLOCK, APOTHECARY_MORTAR_TILE_TYPE.get(), (mortar, direction) -> mortar.getItems()); + event.registerBlockEntity(Capabilities.ItemHandler.BLOCK, PASSIVE_PEDESTAL_TILE_TYPE.get(), (pedestal, direction) -> pedestal.getItemHandler()); + event.registerBlockEntity(Capabilities.ItemHandler.BLOCK, PEDESTAL_TILE_TYPE.get(), (pedestal, direction) -> pedestal.getItemHandler()); + + event.registerBlockEntity(Capabilities.FluidHandler.BLOCK, PEDESTAL_TILE_TYPE.get(), (pedestal, direction) -> pedestal.getFluidHandler()); + } } diff --git a/src/main/java/reliquary/init/ModCapabilities.java b/src/main/java/reliquary/init/ModCapabilities.java deleted file mode 100644 index d8ed3698..00000000 --- a/src/main/java/reliquary/init/ModCapabilities.java +++ /dev/null @@ -1,22 +0,0 @@ -package reliquary.init; - -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.CapabilityManager; -import net.minecraftforge.common.capabilities.CapabilityToken; -import net.minecraftforge.common.capabilities.RegisterCapabilitiesEvent; -import net.minecraftforge.eventbus.api.IEventBus; -import reliquary.items.util.IHarvestRodCache; - -public class ModCapabilities { - private ModCapabilities() {} - - public static final Capability HARVEST_ROD_CACHE = CapabilityManager.get(new CapabilityToken<>() {}); - - public static void registerListeners(IEventBus modBus) { - modBus.addListener(ModCapabilities::onRegister); - } - - public static void onRegister(RegisterCapabilitiesEvent event) { - event.register(IHarvestRodCache.class); - } -} diff --git a/src/main/java/reliquary/init/ModCompat.java b/src/main/java/reliquary/init/ModCompat.java index d14134c9..33a7c0d9 100644 --- a/src/main/java/reliquary/init/ModCompat.java +++ b/src/main/java/reliquary/init/ModCompat.java @@ -1,6 +1,7 @@ package reliquary.init; -import net.minecraftforge.fml.ModList; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.fml.ModList; import reliquary.compat.botania.BotaniaCompat; import reliquary.compat.curios.CuriosCompat; import reliquary.compat.tconstruct.TConstructCompat; @@ -9,28 +10,30 @@ import java.util.HashMap; import java.util.Map; +import java.util.function.Consumer; import java.util.function.Supplier; public class ModCompat { - private ModCompat() {} + private ModCompat() { + } - private static final Map> compatFactories = new HashMap<>(); - static { - compatFactories.put(Compatibility.ModIds.CURIOS, () -> CuriosCompat::new); - compatFactories.put(Compatibility.ModIds.BOTANIA, () -> BotaniaCompat::new); - compatFactories.put(Compatibility.ModIds.TINKERS_CONSTRUCT, () -> TConstructCompat::new); - } + private static final Map>> compatFactories = new HashMap<>(); - public static void initCompats() { - for(Map.Entry> entry : compatFactories.entrySet()) { - if (ModList.get().isLoaded(entry.getKey())) { - try { - entry.getValue().get().run(); - } - catch (Exception e) { - LogHelper.error("Error instantiating compatibility ", e); - } - } - } - } + static { + compatFactories.put(Compatibility.ModIds.CURIOS, () -> CuriosCompat::new); + compatFactories.put(Compatibility.ModIds.BOTANIA, () -> BotaniaCompat::new); + compatFactories.put(Compatibility.ModIds.TINKERS_CONSTRUCT, () -> TConstructCompat::new); + } + + public static void initCompats(IEventBus modBus) { + for (Map.Entry>> entry : compatFactories.entrySet()) { + if (ModList.get().isLoaded(entry.getKey())) { + try { + entry.getValue().get().accept(modBus); + } catch (Exception e) { + LogHelper.error("Error instantiating compatibility ", e); + } + } + } + } } diff --git a/src/main/java/reliquary/init/ModEnchantments.java b/src/main/java/reliquary/init/ModEnchantments.java index d0233b46..19d28329 100644 --- a/src/main/java/reliquary/init/ModEnchantments.java +++ b/src/main/java/reliquary/init/ModEnchantments.java @@ -1,19 +1,21 @@ package reliquary.init; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.item.enchantment.Enchantment; import net.minecraft.world.item.enchantment.EnchantmentCategory; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.registries.DeferredRegister; import reliquary.reference.Reference; +import java.util.function.Supplier; + public class ModEnchantments { - private ModEnchantments() {} + private ModEnchantments() { + } - private static final DeferredRegister ENCHANTMENTS = DeferredRegister.create(ForgeRegistries.ENCHANTMENTS, Reference.MOD_ID); - public static final RegistryObject SEVERING = ENCHANTMENTS.register("severing", SeveringEnchantment::new); + private static final DeferredRegister ENCHANTMENTS = DeferredRegister.create(BuiltInRegistries.ENCHANTMENT, Reference.MOD_ID); + public static final Supplier SEVERING = ENCHANTMENTS.register("severing", SeveringEnchantment::new); public static void register(IEventBus modBus) { ENCHANTMENTS.register(modBus); @@ -21,7 +23,7 @@ public static void register(IEventBus modBus) { public static class SeveringEnchantment extends Enchantment { protected SeveringEnchantment() { - super(Rarity.RARE, EnchantmentCategory.WEAPON, new EquipmentSlot[] {EquipmentSlot.MAINHAND}); + super(Rarity.RARE, EnchantmentCategory.WEAPON, new EquipmentSlot[]{EquipmentSlot.MAINHAND}); } @Override diff --git a/src/main/java/reliquary/init/ModEntities.java b/src/main/java/reliquary/init/ModEntities.java index 24695b15..233afda8 100644 --- a/src/main/java/reliquary/init/ModEntities.java +++ b/src/main/java/reliquary/init/ModEntities.java @@ -1,5 +1,6 @@ package reliquary.init; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.Registries; import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; @@ -7,54 +8,39 @@ import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.MobCategory; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; -import reliquary.entities.EnderStaffProjectileEntity; -import reliquary.entities.GlowingWaterEntity; -import reliquary.entities.HolyHandGrenadeEntity; -import reliquary.entities.KrakenSlimeEntity; -import reliquary.entities.LyssaHook; -import reliquary.entities.SpecialSnowballEntity; -import reliquary.entities.XRTippedArrowEntity; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.registries.DeferredRegister; +import reliquary.entities.*; import reliquary.entities.potion.AphroditePotionEntity; import reliquary.entities.potion.FertilePotionEntity; import reliquary.entities.potion.ThrownXRPotionEntity; -import reliquary.entities.shot.BlazeShotEntity; -import reliquary.entities.shot.BusterShotEntity; -import reliquary.entities.shot.ConcussiveShotEntity; -import reliquary.entities.shot.EnderShotEntity; -import reliquary.entities.shot.ExorcismShotEntity; -import reliquary.entities.shot.NeutralShotEntity; -import reliquary.entities.shot.SandShotEntity; -import reliquary.entities.shot.SeekerShotEntity; -import reliquary.entities.shot.ShotEntityBase; -import reliquary.entities.shot.StormShotEntity; +import reliquary.entities.shot.*; import reliquary.reference.Reference; +import java.util.function.Supplier; + public class ModEntities { - private static final DeferredRegister> ENTITY_TYPES = DeferredRegister.create(ForgeRegistries.ENTITY_TYPES, Reference.MOD_ID); + private static final DeferredRegister> ENTITY_TYPES = DeferredRegister.create(BuiltInRegistries.ENTITY_TYPE, Reference.MOD_ID); - public static final RegistryObject> APHRODITE_POTION = ENTITY_TYPES.register("aphrodite_potion", () -> getDefaultSizeEntityType(AphroditePotionEntity::new)); - public static final RegistryObject> FERTILE_POTION = ENTITY_TYPES.register("fertile_potion", () -> getDefaultSizeEntityType(FertilePotionEntity::new)); - public static final RegistryObject> THROWN_POTION = ENTITY_TYPES.register("thrown_potion", () -> getDefaultSizeEntityType(ThrownXRPotionEntity::new)); - public static final RegistryObject> BLAZE_SHOT = ENTITY_TYPES.register("blaze_shot", () -> getShotEntityType(BlazeShotEntity::new)); - public static final RegistryObject> BUSTER_SHOT = ENTITY_TYPES.register("buster_shot", () -> getShotEntityType(BusterShotEntity::new)); - public static final RegistryObject> CONCUSSIVE_SHOT = ENTITY_TYPES.register("concussive_shot", () -> getShotEntityType(ConcussiveShotEntity::new)); - public static final RegistryObject> ENDER_SHOT = ENTITY_TYPES.register("ender_shot", () -> getShotEntityType(EnderShotEntity::new)); - public static final RegistryObject> EXORCISM_SHOT = ENTITY_TYPES.register("exorcism_shot", () -> getShotEntityType(ExorcismShotEntity::new)); - public static final RegistryObject> NEUTRAL_SHOT = ENTITY_TYPES.register("neutral_shot", () -> getShotEntityType(NeutralShotEntity::new)); - public static final RegistryObject> SAND_SHOT = ENTITY_TYPES.register("sand_shot", () -> getShotEntityType(SandShotEntity::new)); - public static final RegistryObject> SEEKER_SHOT = ENTITY_TYPES.register("seeker_shot", () -> getShotEntityType(SeekerShotEntity::new)); - public static final RegistryObject> STORM_SHOT = ENTITY_TYPES.register("storm_shot", () -> getShotEntityType(StormShotEntity::new)); - public static final RegistryObject> ENDER_STAFF_PROJECTILE = ENTITY_TYPES.register("ender_staff_projectile", () -> getEntityType(EnderStaffProjectileEntity::new, 0.25F, 0.25F, 256)); - public static final RegistryObject> GLOWING_WATER = ENTITY_TYPES.register("glowing_water", () -> getDefaultSizeEntityType(GlowingWaterEntity::new)); - public static final RegistryObject> HOLY_HAND_GRENADE = ENTITY_TYPES.register("holy_hand_grenade", () -> getDefaultSizeEntityType(HolyHandGrenadeEntity::new)); - public static final RegistryObject> KRAKEN_SLIME = ENTITY_TYPES.register("kraken_slime", () -> getDefaultSizeEntityType(KrakenSlimeEntity::new)); - public static final RegistryObject> LYSSA_HOOK = ENTITY_TYPES.register("lyssa_hook", () -> getDefaultSizeEntityType(LyssaHook::new)); - public static final RegistryObject> TIPPED_ARROW = ENTITY_TYPES.register("tipped_arrow", () -> getDefaultSizeEntityType(XRTippedArrowEntity::new)); - public static final RegistryObject> SPECIAL_SNOWBALL = ENTITY_TYPES.register("special_snowball", () -> getEntityType(SpecialSnowballEntity::new, 0.01F, 0.01F)); + public static final Supplier> APHRODITE_POTION = ENTITY_TYPES.register("aphrodite_potion", () -> getDefaultSizeEntityType(AphroditePotionEntity::new)); + public static final Supplier> FERTILE_POTION = ENTITY_TYPES.register("fertile_potion", () -> getDefaultSizeEntityType(FertilePotionEntity::new)); + public static final Supplier> THROWN_POTION = ENTITY_TYPES.register("thrown_potion", () -> getDefaultSizeEntityType(ThrownXRPotionEntity::new)); + public static final Supplier> BLAZE_SHOT = ENTITY_TYPES.register("blaze_shot", () -> getShotEntityType(BlazeShotEntity::new)); + public static final Supplier> BUSTER_SHOT = ENTITY_TYPES.register("buster_shot", () -> getShotEntityType(BusterShotEntity::new)); + public static final Supplier> CONCUSSIVE_SHOT = ENTITY_TYPES.register("concussive_shot", () -> getShotEntityType(ConcussiveShotEntity::new)); + public static final Supplier> ENDER_SHOT = ENTITY_TYPES.register("ender_shot", () -> getShotEntityType(EnderShotEntity::new)); + public static final Supplier> EXORCISM_SHOT = ENTITY_TYPES.register("exorcism_shot", () -> getShotEntityType(ExorcismShotEntity::new)); + public static final Supplier> NEUTRAL_SHOT = ENTITY_TYPES.register("neutral_shot", () -> getShotEntityType(NeutralShotEntity::new)); + public static final Supplier> SAND_SHOT = ENTITY_TYPES.register("sand_shot", () -> getShotEntityType(SandShotEntity::new)); + public static final Supplier> SEEKER_SHOT = ENTITY_TYPES.register("seeker_shot", () -> getShotEntityType(SeekerShotEntity::new)); + public static final Supplier> STORM_SHOT = ENTITY_TYPES.register("storm_shot", () -> getShotEntityType(StormShotEntity::new)); + public static final Supplier> ENDER_STAFF_PROJECTILE = ENTITY_TYPES.register("ender_staff_projectile", () -> getEntityType(EnderStaffProjectileEntity::new, 0.25F, 0.25F, 256)); + public static final Supplier> GLOWING_WATER = ENTITY_TYPES.register("glowing_water", () -> getDefaultSizeEntityType(GlowingWaterEntity::new)); + public static final Supplier> HOLY_HAND_GRENADE = ENTITY_TYPES.register("holy_hand_grenade", () -> getDefaultSizeEntityType(HolyHandGrenadeEntity::new)); + public static final Supplier> KRAKEN_SLIME = ENTITY_TYPES.register("kraken_slime", () -> getDefaultSizeEntityType(KrakenSlimeEntity::new)); + public static final Supplier> LYSSA_HOOK = ENTITY_TYPES.register("lyssa_hook", () -> getDefaultSizeEntityType(LyssaHook::new)); + public static final Supplier> TIPPED_ARROW = ENTITY_TYPES.register("tipped_arrow", () -> getDefaultSizeEntityType(XRTippedArrowEntity::new)); + public static final Supplier> SPECIAL_SNOWBALL = ENTITY_TYPES.register("special_snowball", () -> getEntityType(SpecialSnowballEntity::new, 0.01F, 0.01F)); public static final ResourceKey BULLET_DAMAGE_TYPE = ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation(Reference.MOD_ID, "bullet")); diff --git a/src/main/java/reliquary/init/ModFluids.java b/src/main/java/reliquary/init/ModFluids.java index c2412248..6c61e888 100644 --- a/src/main/java/reliquary/init/ModFluids.java +++ b/src/main/java/reliquary/init/ModFluids.java @@ -1,35 +1,38 @@ package reliquary.init; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.core.registries.Registries; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.TagKey; import net.minecraft.world.level.material.FlowingFluid; import net.minecraft.world.level.material.Fluid; -import net.minecraftforge.client.extensions.common.IClientFluidTypeExtensions; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.fluids.FluidType; -import net.minecraftforge.fluids.ForgeFlowingFluid; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.client.extensions.common.IClientFluidTypeExtensions; +import net.neoforged.neoforge.fluids.BaseFlowingFluid; +import net.neoforged.neoforge.fluids.FluidType; +import net.neoforged.neoforge.registries.DeferredRegister; +import net.neoforged.neoforge.registries.NeoForgeRegistries; import reliquary.reference.Reference; import java.util.function.Consumer; +import java.util.function.Supplier; public class ModFluids { - private ModFluids() {} + private ModFluids() { + } - private static ForgeFlowingFluid.Properties fluidProperties() { - return new ForgeFlowingFluid.Properties(XP_JUICE_FLUID_TYPE, XP_JUICE_STILL, XP_JUICE_FLOWING); + private static BaseFlowingFluid.Properties fluidProperties() { + return new BaseFlowingFluid.Properties(XP_JUICE_FLUID_TYPE, XP_JUICE_STILL, XP_JUICE_FLOWING); } public static final ResourceLocation EXPERIENCE_TAG_NAME = new ResourceLocation("forge:experience"); - public static final TagKey EXPERIENCE_TAG = TagKey.create(ForgeRegistries.Keys.FLUIDS, EXPERIENCE_TAG_NAME); - public static final DeferredRegister FLUIDS = DeferredRegister.create(ForgeRegistries.FLUIDS, Reference.MOD_ID); - public static final DeferredRegister FLUID_TYPES = DeferredRegister.create(ForgeRegistries.Keys.FLUID_TYPES, Reference.MOD_ID); - public static final RegistryObject XP_JUICE_STILL = FLUIDS.register("xp_juice_still", () -> new ForgeFlowingFluid.Source(fluidProperties())); - public static final RegistryObject XP_JUICE_FLOWING = FLUIDS.register("xp_juice_flowing", () -> new ForgeFlowingFluid.Flowing(fluidProperties())); + public static final TagKey EXPERIENCE_TAG = TagKey.create(Registries.FLUID, EXPERIENCE_TAG_NAME); + public static final DeferredRegister FLUIDS = DeferredRegister.create(BuiltInRegistries.FLUID, Reference.MOD_ID); + public static final DeferredRegister FLUID_TYPES = DeferredRegister.create(NeoForgeRegistries.FLUID_TYPES, Reference.MOD_ID); + public static final Supplier XP_JUICE_STILL = FLUIDS.register("xp_juice_still", () -> new BaseFlowingFluid.Source(fluidProperties())); + public static final Supplier XP_JUICE_FLOWING = FLUIDS.register("xp_juice_flowing", () -> new BaseFlowingFluid.Flowing(fluidProperties())); - public static final RegistryObject XP_JUICE_FLUID_TYPE = FLUID_TYPES.register("xp_juice", () -> new FluidType(FluidType.Properties.create().lightLevel(10).density(800).viscosity(1500)) { + public static final Supplier XP_JUICE_FLUID_TYPE = FLUID_TYPES.register("xp_juice", () -> new FluidType(FluidType.Properties.create().lightLevel(10).density(800).viscosity(1500)) { @Override public void initializeClient(Consumer consumer) { consumer.accept(new IClientFluidTypeExtensions() { diff --git a/src/main/java/reliquary/init/ModItems.java b/src/main/java/reliquary/init/ModItems.java index e6b7425c..f927fd90 100644 --- a/src/main/java/reliquary/init/ModItems.java +++ b/src/main/java/reliquary/init/ModItems.java @@ -1,56 +1,40 @@ package reliquary.init; import com.mojang.serialization.Codec; -import net.minecraft.client.gui.screens.MenuScreens; -import net.minecraft.core.BlockSource; import net.minecraft.core.Position; import net.minecraft.core.dispenser.AbstractProjectileDispenseBehavior; +import net.minecraft.core.dispenser.BlockSource; import net.minecraft.core.dispenser.DispenseItemBehavior; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.Registries; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.projectile.AbstractArrow; import net.minecraft.world.entity.projectile.Projectile; import net.minecraft.world.food.FoodProperties; import net.minecraft.world.inventory.MenuType; -import net.minecraft.world.item.CreativeModeTab; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Rarity; +import net.minecraft.world.item.*; import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.item.crafting.SimpleCraftingRecipeSerializer; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.DispenserBlock; import net.minecraft.world.level.storage.loot.predicates.LootItemConditionType; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.crafting.CraftingHelper; -import net.minecraftforge.common.extensions.IForgeMenuType; -import net.minecraftforge.common.loot.IGlobalLootModifier; -import net.minecraftforge.event.AddReloadListenerEvent; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.fml.DistExecutor; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegisterEvent; -import net.minecraftforge.registries.RegistryObject; -import reliquary.client.gui.AlkahestryTomeGui; -import reliquary.client.gui.MobCharmBeltGui; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.fml.loading.FMLEnvironment; +import net.neoforged.neoforge.attachment.AttachmentType; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent; +import net.neoforged.neoforge.common.NeoForge; +import net.neoforged.neoforge.common.conditions.ICondition; +import net.neoforged.neoforge.common.extensions.IMenuTypeExtension; +import net.neoforged.neoforge.common.loot.IGlobalLootModifier; +import net.neoforged.neoforge.event.AddReloadListenerEvent; +import net.neoforged.neoforge.registries.DeferredRegister; +import net.neoforged.neoforge.registries.NeoForgeRegistries; +import net.neoforged.neoforge.registries.RegisterEvent; import reliquary.common.gui.AlkahestTomeMenu; import reliquary.common.gui.MobCharmBeltMenu; -import reliquary.crafting.AlkahestryChargingRecipe; -import reliquary.crafting.AlkahestryCraftingRecipe; -import reliquary.crafting.AlkahestryDrainRecipe; -import reliquary.crafting.FragmentToSpawnEggRecipe; -import reliquary.crafting.MobCharmRecipe; -import reliquary.crafting.MobCharmRepairRecipe; -import reliquary.crafting.PotionEffectsRecipe; -import reliquary.crafting.conditions.AlkahestryEnabledCondition; -import reliquary.crafting.conditions.HandgunEnabledCondition; -import reliquary.crafting.conditions.MobDropsCraftableCondition; -import reliquary.crafting.conditions.PassivePedestalEnabledCondition; -import reliquary.crafting.conditions.PedestalEnabledCondition; -import reliquary.crafting.conditions.PotionsEnabledCondition; -import reliquary.crafting.conditions.SpawnEggEnabledCondition; +import reliquary.crafting.*; +import reliquary.crafting.conditions.*; import reliquary.data.ChestLootEnabledCondition; import reliquary.data.EntityLootEnabledCondition; import reliquary.data.RandomChanceLootingSeveringCondition; @@ -61,204 +45,176 @@ import reliquary.entities.potion.AphroditePotionEntity; import reliquary.entities.potion.FertilePotionEntity; import reliquary.entities.potion.ThrownXRPotionEntity; -import reliquary.entities.shot.BlazeShotEntity; -import reliquary.entities.shot.BusterShotEntity; -import reliquary.entities.shot.ConcussiveShotEntity; -import reliquary.entities.shot.EnderShotEntity; -import reliquary.entities.shot.ExorcismShotEntity; -import reliquary.entities.shot.NeutralShotEntity; -import reliquary.entities.shot.SandShotEntity; -import reliquary.entities.shot.SeekerShotEntity; -import reliquary.entities.shot.StormShotEntity; -import reliquary.items.AlkahestryTomeItem; -import reliquary.items.AngelheartVialItem; -import reliquary.items.AngelicFeatherItem; -import reliquary.items.AphroditePotionItem; -import reliquary.items.BulletItem; -import reliquary.items.DestructionCatalystItem; -import reliquary.items.EmperorChaliceItem; -import reliquary.items.EnderStaffItem; -import reliquary.items.FertilePotionItem; -import reliquary.items.FortuneCoinItem; -import reliquary.items.GlacialStaffItem; -import reliquary.items.GlowingWaterItem; -import reliquary.items.HandgunItem; -import reliquary.items.HarvestRodItem; -import reliquary.items.HeroMedallionItem; -import reliquary.items.HolyHandGrenadeItem; -import reliquary.items.ICreativeTabItemGenerator; -import reliquary.items.IceMagusRodItem; -import reliquary.items.InfernalChaliceItem; -import reliquary.items.InfernalClawsItem; -import reliquary.items.InfernalTearItem; -import reliquary.items.ItemBase; -import reliquary.items.KrakenShellItem; -import reliquary.items.LanternOfParanoiaItem; -import reliquary.items.MagazineItem; -import reliquary.items.MagicbaneItem; -import reliquary.items.MercyCrossItem; -import reliquary.items.MidasTouchstoneItem; -import reliquary.items.MobCharmBeltItem; -import reliquary.items.MobCharmFragmentItem; -import reliquary.items.MobCharmItem; -import reliquary.items.MobDropItem; -import reliquary.items.PhoenixDownItem; -import reliquary.items.PotionEssenceItem; +import reliquary.entities.shot.*; import reliquary.items.PotionItem; -import reliquary.items.PotionItemBase; -import reliquary.items.PyromancerStaffItem; -import reliquary.items.RendingGaleItem; -import reliquary.items.RodOfLyssaItem; -import reliquary.items.SalamanderEyeItem; -import reliquary.items.SerpentStaffItem; -import reliquary.items.ShearsOfWinterItem; -import reliquary.items.SojournerStaffItem; -import reliquary.items.ThrownPotionItem; import reliquary.items.TippedArrowItem; -import reliquary.items.TwilightCloakItem; -import reliquary.items.VoidTearItem; -import reliquary.items.WitchHatItem; -import reliquary.items.WitherlessRoseItem; +import reliquary.items.*; +import reliquary.items.util.*; +import reliquary.items.util.fluid.FluidHandlerEmperorChalice; +import reliquary.items.util.fluid.FluidHandlerHeroMedallion; +import reliquary.items.util.fluid.FluidHandlerInfernalChalice; import reliquary.reference.Colors; +import reliquary.reference.Config; import reliquary.reference.Reference; -import reliquary.reference.Settings; import reliquary.util.RegistryHelper; +import java.util.function.Supplier; + public class ModItems { - private static final DeferredRegister ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, Reference.MOD_ID); + private static final DeferredRegister ITEMS = DeferredRegister.create(BuiltInRegistries.ITEM, Reference.MOD_ID); public static final DeferredRegister CREATIVE_MODE_TABS = DeferredRegister.create(Registries.CREATIVE_MODE_TAB.location(), Reference.MOD_ID); - private static final DeferredRegister> MENU_TYPES = DeferredRegister.create(ForgeRegistries.MENU_TYPES, Reference.MOD_ID); - private static final DeferredRegister> RECIPE_SERIALIZERS = DeferredRegister.create(ForgeRegistries.RECIPE_SERIALIZERS, Reference.MOD_ID); + private static final DeferredRegister> MENU_TYPES = DeferredRegister.create(BuiltInRegistries.MENU, Reference.MOD_ID); + private static final DeferredRegister> CONDITION_CODECS = DeferredRegister.create(NeoForgeRegistries.Keys.CONDITION_CODECS, Reference.MOD_ID); + private static final DeferredRegister> RECIPE_SERIALIZERS = DeferredRegister.create(BuiltInRegistries.RECIPE_SERIALIZER, Reference.MOD_ID); public static final DeferredRegister LOOT_CONDITION_TYPES = DeferredRegister.create(Registries.LOOT_CONDITION_TYPE.location(), Reference.MOD_ID); - public static final DeferredRegister> LOOT_MODIFIERS = DeferredRegister.create(ForgeRegistries.Keys.GLOBAL_LOOT_MODIFIER_SERIALIZERS, Reference.MOD_ID); + public static final DeferredRegister> LOOT_MODIFIERS = DeferredRegister.create(NeoForgeRegistries.Keys.GLOBAL_LOOT_MODIFIER_SERIALIZERS, Reference.MOD_ID); - public static final RegistryObject ALKAHESTRY_TOME = ITEMS.register("alkahestry_tome", AlkahestryTomeItem::new); - public static final RegistryObject MERCY_CROSS = ITEMS.register("mercy_cross", MercyCrossItem::new); - public static final RegistryObject ANGELHEART_VIAL = ITEMS.register("angelheart_vial", AngelheartVialItem::new); - public static final RegistryObject ANGELIC_FEATHER = ITEMS.register("angelic_feather", AngelicFeatherItem::new); - public static final RegistryObject APHRODITE_POTION = ITEMS.register("aphrodite_potion", AphroditePotionItem::new); - public static final RegistryObject POTION_ESSENCE = ITEMS.register("potion_essence", PotionEssenceItem::new); - public static final RegistryObject DESTRUCTION_CATALYST = ITEMS.register("destruction_catalyst", DestructionCatalystItem::new); - public static final RegistryObject EMPEROR_CHALICE = ITEMS.register("emperor_chalice", EmperorChaliceItem::new); - public static final RegistryObject ENDER_STAFF = ITEMS.register("ender_staff", EnderStaffItem::new); - public static final RegistryObject FERTILE_POTION = ITEMS.register("fertile_potion", FertilePotionItem::new); - public static final RegistryObject FORTUNE_COIN = ITEMS.register("fortune_coin", FortuneCoinItem::new); - public static final RegistryObject GLACIAL_STAFF = ITEMS.register("glacial_staff", GlacialStaffItem::new); - public static final RegistryObject GLOWING_WATER = ITEMS.register("glowing_water", GlowingWaterItem::new); - public static final RegistryObject HOLY_HAND_GRENADE = ITEMS.register("holy_hand_grenade", HolyHandGrenadeItem::new); - public static final RegistryObject HANDGUN = ITEMS.register("handgun", HandgunItem::new); - public static final RegistryObject GRIP_ASSEMBLY = ITEMS.register("grip_assembly", () -> new ItemBase(new Item.Properties().stacksTo(4), Settings.COMMON.disable.disableHandgun)); - public static final RegistryObject BARREL_ASSEMBLY = ITEMS.register("barrel_assembly", () -> new ItemBase(new Item.Properties().stacksTo(4), Settings.COMMON.disable.disableHandgun)); - public static final RegistryObject HAMMER_ASSEMBLY = ITEMS.register("hammer_assembly", () -> new ItemBase(new Item.Properties().stacksTo(4), Settings.COMMON.disable.disableHandgun)); - public static final RegistryObject HARVEST_ROD = ITEMS.register("harvest_rod", HarvestRodItem::new); - public static final RegistryObject MOB_CHARM_FRAGMENT = ITEMS.register("mob_charm_fragment", MobCharmFragmentItem::new); - public static final RegistryObject HERO_MEDALLION = ITEMS.register("hero_medallion", HeroMedallionItem::new); - public static final RegistryObject ICE_MAGUS_ROD = ITEMS.register("ice_magus_rod", IceMagusRodItem::new); - public static final RegistryObject INFERNAL_CHALICE = ITEMS.register("infernal_chalice", InfernalChaliceItem::new); - public static final RegistryObject INFERNAL_CLAWS = ITEMS.register("infernal_claws", InfernalClawsItem::new); - public static final RegistryObject INFERNAL_TEAR = ITEMS.register("infernal_tear", InfernalTearItem::new); - public static final RegistryObject KRAKEN_SHELL = ITEMS.register("kraken_shell", KrakenShellItem::new); - public static final RegistryObject MIDAS_TOUCHSTONE = ITEMS.register("midas_touchstone", MidasTouchstoneItem::new); - public static final RegistryObject PHOENIX_DOWN = ITEMS.register("phoenix_down", PhoenixDownItem::new); - public static final RegistryObject PYROMANCER_STAFF = ITEMS.register("pyromancer_staff", PyromancerStaffItem::new); - public static final RegistryObject RENDING_GALE = ITEMS.register("rending_gale", RendingGaleItem::new); - public static final RegistryObject ROD_OF_LYSSA = ITEMS.register("rod_of_lyssa", RodOfLyssaItem::new); - public static final RegistryObject SOJOURNER_STAFF = ITEMS.register("sojourner_staff", SojournerStaffItem::new); - public static final RegistryObject TIPPED_ARROW = ITEMS.register("tipped_arrow", TippedArrowItem::new); - public static final RegistryObject VOID_TEAR = ITEMS.register("void_tear", VoidTearItem::new); - public static final RegistryObject WITCH_HAT = ITEMS.register("witch_hat", WitchHatItem::new); - public static final RegistryObject WITHERLESS_ROSE = ITEMS.register("witherless_rose", WitherlessRoseItem::new); - public static final RegistryObject EMPTY_POTION_VIAL = ITEMS.register("empty_potion_vial", () -> new ItemBase(Settings.COMMON.disable.disablePotions)); - public static final RegistryObject POTION = ITEMS.register("potion", PotionItem::new); - public static final RegistryObject SPLASH_POTION = ITEMS.register("splash_potion", ThrownPotionItem::new); - public static final RegistryObject LINGERING_POTION = ITEMS.register("lingering_potion", ThrownPotionItem::new); - public static final RegistryObject MOB_CHARM_BELT = ITEMS.register("mob_charm_belt", MobCharmBeltItem::new); - public static final RegistryObject MOB_CHARM = ITEMS.register("mob_charm", MobCharmItem::new); - public static final RegistryObject EMPTY_MAGAZINE = ITEMS.register("magazines/empty_magazine", () -> + public static final Supplier ALKAHESTRY_TOME = ITEMS.register("alkahestry_tome", AlkahestryTomeItem::new); + public static final Supplier MERCY_CROSS = ITEMS.register("mercy_cross", MercyCrossItem::new); + public static final Supplier ANGELHEART_VIAL = ITEMS.register("angelheart_vial", AngelheartVialItem::new); + public static final Supplier ANGELIC_FEATHER = ITEMS.register("angelic_feather", AngelicFeatherItem::new); + public static final Supplier APHRODITE_POTION = ITEMS.register("aphrodite_potion", AphroditePotionItem::new); + public static final Supplier POTION_ESSENCE = ITEMS.register("potion_essence", PotionEssenceItem::new); + public static final Supplier DESTRUCTION_CATALYST = ITEMS.register("destruction_catalyst", DestructionCatalystItem::new); + public static final Supplier EMPEROR_CHALICE = ITEMS.register("emperor_chalice", EmperorChaliceItem::new); + public static final Supplier ENDER_STAFF = ITEMS.register("ender_staff", EnderStaffItem::new); + public static final Supplier FERTILE_POTION = ITEMS.register("fertile_potion", FertilePotionItem::new); + public static final Supplier FORTUNE_COIN = ITEMS.register("fortune_coin", FortuneCoinItem::new); + public static final Supplier GLACIAL_STAFF = ITEMS.register("glacial_staff", GlacialStaffItem::new); + public static final Supplier GLOWING_WATER = ITEMS.register("glowing_water", GlowingWaterItem::new); + public static final Supplier HOLY_HAND_GRENADE = ITEMS.register("holy_hand_grenade", HolyHandGrenadeItem::new); + public static final Supplier HANDGUN = ITEMS.register("handgun", HandgunItem::new); + public static final Supplier GRIP_ASSEMBLY = ITEMS.register("grip_assembly", () -> new ItemBase(new Item.Properties().stacksTo(4), Config.COMMON.disable.disableHandgun)); + public static final Supplier BARREL_ASSEMBLY = ITEMS.register("barrel_assembly", () -> new ItemBase(new Item.Properties().stacksTo(4), Config.COMMON.disable.disableHandgun)); + public static final Supplier HAMMER_ASSEMBLY = ITEMS.register("hammer_assembly", () -> new ItemBase(new Item.Properties().stacksTo(4), Config.COMMON.disable.disableHandgun)); + public static final Supplier HARVEST_ROD = ITEMS.register("harvest_rod", HarvestRodItem::new); + public static final Supplier MOB_CHARM_FRAGMENT = ITEMS.register("mob_charm_fragment", MobCharmFragmentItem::new); + public static final Supplier HERO_MEDALLION = ITEMS.register("hero_medallion", HeroMedallionItem::new); + public static final Supplier ICE_MAGUS_ROD = ITEMS.register("ice_magus_rod", IceMagusRodItem::new); + public static final Supplier INFERNAL_CHALICE = ITEMS.register("infernal_chalice", InfernalChaliceItem::new); + public static final Supplier INFERNAL_CLAWS = ITEMS.register("infernal_claws", InfernalClawsItem::new); + public static final Supplier INFERNAL_TEAR = ITEMS.register("infernal_tear", InfernalTearItem::new); + public static final Supplier KRAKEN_SHELL = ITEMS.register("kraken_shell", KrakenShellItem::new); + public static final Supplier MIDAS_TOUCHSTONE = ITEMS.register("midas_touchstone", MidasTouchstoneItem::new); + public static final Supplier PHOENIX_DOWN = ITEMS.register("phoenix_down", PhoenixDownItem::new); + public static final Supplier PYROMANCER_STAFF = ITEMS.register("pyromancer_staff", PyromancerStaffItem::new); + public static final Supplier RENDING_GALE = ITEMS.register("rending_gale", RendingGaleItem::new); + public static final Supplier ROD_OF_LYSSA = ITEMS.register("rod_of_lyssa", RodOfLyssaItem::new); + public static final Supplier SOJOURNER_STAFF = ITEMS.register("sojourner_staff", SojournerStaffItem::new); + public static final Supplier TIPPED_ARROW = ITEMS.register("tipped_arrow", TippedArrowItem::new); + public static final Supplier VOID_TEAR = ITEMS.register("void_tear", VoidTearItem::new); + public static final Supplier WITCH_HAT = ITEMS.register("witch_hat", WitchHatItem::new); + public static final Supplier WITHERLESS_ROSE = ITEMS.register("witherless_rose", WitherlessRoseItem::new); + public static final Supplier EMPTY_POTION_VIAL = ITEMS.register("empty_potion_vial", () -> new ItemBase(Config.COMMON.disable.disablePotions)); + public static final Supplier POTION = ITEMS.register("potion", PotionItem::new); + public static final Supplier SPLASH_POTION = ITEMS.register("splash_potion", ThrownPotionItem::new); + public static final Supplier LINGERING_POTION = ITEMS.register("lingering_potion", ThrownPotionItem::new); + public static final Supplier MOB_CHARM_BELT = ITEMS.register("mob_charm_belt", MobCharmBeltItem::new); + public static final Supplier MOB_CHARM = ITEMS.register("mob_charm", MobCharmItem::new); + public static final Supplier EMPTY_MAGAZINE = ITEMS.register("magazines/empty_magazine", () -> new MagazineItem(false, Integer.parseInt(Colors.DARKEST, 16))); - public static final RegistryObject NEUTRAL_MAGAZINE = ITEMS.register("magazines/neutral_magazine", () -> + public static final Supplier NEUTRAL_MAGAZINE = ITEMS.register("magazines/neutral_magazine", () -> new MagazineItem(true, Integer.parseInt(Colors.NEUTRAL_SHOT_COLOR, 16))); - public static final RegistryObject EXORCISM_MAGAZINE = ITEMS.register("magazines/exorcism_magazine", () -> + public static final Supplier EXORCISM_MAGAZINE = ITEMS.register("magazines/exorcism_magazine", () -> new MagazineItem(false, Integer.parseInt(Colors.EXORCISM_SHOT_COLOR, 16))); - public static final RegistryObject BLAZE_MAGAZINE = ITEMS.register("magazines/blaze_magazine", () -> + public static final Supplier BLAZE_MAGAZINE = ITEMS.register("magazines/blaze_magazine", () -> new MagazineItem(false, Integer.parseInt(Colors.BLAZE_SHOT_COLOR, 16))); - public static final RegistryObject ENDER_MAGAZINE = ITEMS.register("magazines/ender_magazine", () -> + public static final Supplier ENDER_MAGAZINE = ITEMS.register("magazines/ender_magazine", () -> new MagazineItem(false, Integer.parseInt(Colors.ENDER_SHOT_COLOR, 16))); - public static final RegistryObject CONCUSSIVE_MAGAZINE = ITEMS.register("magazines/concussive_magazine", () -> + public static final Supplier CONCUSSIVE_MAGAZINE = ITEMS.register("magazines/concussive_magazine", () -> new MagazineItem(false, Integer.parseInt(Colors.CONCUSSIVE_SHOT_COLOR, 16))); - public static final RegistryObject BUSTER_MAGAZINE = ITEMS.register("magazines/buster_magazine", () -> + public static final Supplier BUSTER_MAGAZINE = ITEMS.register("magazines/buster_magazine", () -> new MagazineItem(false, Integer.parseInt(Colors.BUSTER_SHOT_COLOR, 16))); - public static final RegistryObject SEEKER_MAGAZINE = ITEMS.register("magazines/seeker_magazine", () -> + public static final Supplier SEEKER_MAGAZINE = ITEMS.register("magazines/seeker_magazine", () -> new MagazineItem(false, Integer.parseInt(Colors.SEEKER_SHOT_COLOR, 16))); - public static final RegistryObject SAND_MAGAZINE = ITEMS.register("magazines/sand_magazine", () -> + public static final Supplier SAND_MAGAZINE = ITEMS.register("magazines/sand_magazine", () -> new MagazineItem(false, Integer.parseInt(Colors.SAND_SHOT_COLOR, 16))); - public static final RegistryObject STORM_MAGAZINE = ITEMS.register("magazines/storm_magazine", () -> + public static final Supplier STORM_MAGAZINE = ITEMS.register("magazines/storm_magazine", () -> new MagazineItem(false, Integer.parseInt(Colors.STORM_SHOT_COLOR, 16))); - public static final RegistryObject EMPTY_BULLET = ITEMS.register("bullets/empty_bullet", () -> + public static final Supplier EMPTY_BULLET = ITEMS.register("bullets/empty_bullet", () -> new BulletItem(false, false, Integer.parseInt(Colors.DARKEST, 16))); - public static final RegistryObject NEUTRAL_BULLET = ITEMS.register("bullets/neutral_bullet", () -> + public static final Supplier NEUTRAL_BULLET = ITEMS.register("bullets/neutral_bullet", () -> new BulletItem(false, true, Integer.parseInt(Colors.NEUTRAL_SHOT_COLOR, 16))); - public static final RegistryObject EXORCISM_BULLET = ITEMS.register("bullets/exorcism_bullet", () -> + public static final Supplier EXORCISM_BULLET = ITEMS.register("bullets/exorcism_bullet", () -> new BulletItem(true, false, Integer.parseInt(Colors.EXORCISM_SHOT_COLOR, 16))); - public static final RegistryObject BLAZE_BULLET = ITEMS.register("bullets/blaze_bullet", () -> + public static final Supplier BLAZE_BULLET = ITEMS.register("bullets/blaze_bullet", () -> new BulletItem(true, false, Integer.parseInt(Colors.BLAZE_SHOT_COLOR, 16))); - public static final RegistryObject ENDER_BULLET = ITEMS.register("bullets/ender_bullet", () -> + public static final Supplier ENDER_BULLET = ITEMS.register("bullets/ender_bullet", () -> new BulletItem(true, false, Integer.parseInt(Colors.ENDER_SHOT_COLOR, 16))); - public static final RegistryObject CONCUSSIVE_BULLET = ITEMS.register("bullets/concussive_bullet", () -> + public static final Supplier CONCUSSIVE_BULLET = ITEMS.register("bullets/concussive_bullet", () -> new BulletItem(true, false, Integer.parseInt(Colors.CONCUSSIVE_SHOT_COLOR, 16))); - public static final RegistryObject BUSTER_BULLET = ITEMS.register("bullets/buster_bullet", () -> + public static final Supplier BUSTER_BULLET = ITEMS.register("bullets/buster_bullet", () -> new BulletItem(true, false, Integer.parseInt(Colors.BUSTER_SHOT_COLOR, 16))); - public static final RegistryObject SEEKER_BULLET = ITEMS.register("bullets/seeker_bullet", () -> + public static final Supplier SEEKER_BULLET = ITEMS.register("bullets/seeker_bullet", () -> new BulletItem(true, false, Integer.parseInt(Colors.SEEKER_SHOT_COLOR, 16))); - public static final RegistryObject SAND_BULLET = ITEMS.register("bullets/sand_bullet", () -> + public static final Supplier SAND_BULLET = ITEMS.register("bullets/sand_bullet", () -> new BulletItem(true, false, Integer.parseInt(Colors.SAND_SHOT_COLOR, 16))); - public static final RegistryObject STORM_BULLET = ITEMS.register("bullets/storm_bullet", () -> + public static final Supplier STORM_BULLET = ITEMS.register("bullets/storm_bullet", () -> new BulletItem(true, false, Integer.parseInt(Colors.STORM_SHOT_COLOR, 16))); - public static final RegistryObject ZOMBIE_HEART = ITEMS.register("zombie_heart", MobDropItem::new); - public static final RegistryObject SQUID_BEAK = ITEMS.register("squid_beak", MobDropItem::new); - public static final RegistryObject RIB_BONE = ITEMS.register("rib_bone", MobDropItem::new); - public static final RegistryObject CATALYZING_GLAND = ITEMS.register("catalyzing_gland", MobDropItem::new); - public static final RegistryObject CHELICERAE = ITEMS.register("chelicerae", MobDropItem::new); - public static final RegistryObject SLIME_PEARL = ITEMS.register("slime_pearl", MobDropItem::new); - public static final RegistryObject KRAKEN_SHELL_FRAGMENT = ITEMS.register("kraken_shell_fragment", ItemBase::new); - public static final RegistryObject BAT_WING = ITEMS.register("bat_wing", MobDropItem::new); - public static final RegistryObject WITHERED_RIB = ITEMS.register("withered_rib", MobDropItem::new); - public static final RegistryObject MOLTEN_CORE = ITEMS.register("molten_core", MobDropItem::new); - public static final RegistryObject EYE_OF_THE_STORM = ITEMS.register("eye_of_the_storm", MobDropItem::new); - public static final RegistryObject FERTILE_ESSENCE = ITEMS.register("fertile_essence", ItemBase::new); - public static final RegistryObject FROZEN_CORE = ITEMS.register("frozen_core", MobDropItem::new); - public static final RegistryObject NEBULOUS_HEART = ITEMS.register("nebulous_heart", MobDropItem::new); - public static final RegistryObject INFERNAL_CLAW = ITEMS.register("infernal_claw", ItemBase::new); - public static final RegistryObject GUARDIAN_SPIKE = ITEMS.register("guardian_spike", MobDropItem::new); - public static final RegistryObject CRIMSON_CLOTH = ITEMS.register("crimson_cloth", ItemBase::new); - public static final RegistryObject LANTERN_OF_PARANOIA = ITEMS.register("lantern_of_paranoia", LanternOfParanoiaItem::new); - public static final RegistryObject MAGICBANE = ITEMS.register("magicbane", MagicbaneItem::new); - public static final RegistryObject SALAMANDER_EYE = ITEMS.register("salamander_eye", SalamanderEyeItem::new); - public static final RegistryObject SERPENT_STAFF = ITEMS.register("serpent_staff", SerpentStaffItem::new); - public static final RegistryObject SHEARS_OF_WINTER = ITEMS.register("shears_of_winter", ShearsOfWinterItem::new); - public static final RegistryObject TWILIGHT_CLOAK = ITEMS.register("twilight_cloak", TwilightCloakItem::new); - public static final RegistryObject GLOWING_BREAD = ITEMS.register("glowing_bread", () -> + public static final Supplier ZOMBIE_HEART = ITEMS.register("zombie_heart", MobDropItem::new); + public static final Supplier SQUID_BEAK = ITEMS.register("squid_beak", MobDropItem::new); + public static final Supplier RIB_BONE = ITEMS.register("rib_bone", MobDropItem::new); + public static final Supplier CATALYZING_GLAND = ITEMS.register("catalyzing_gland", MobDropItem::new); + public static final Supplier CHELICERAE = ITEMS.register("chelicerae", MobDropItem::new); + public static final Supplier SLIME_PEARL = ITEMS.register("slime_pearl", MobDropItem::new); + public static final Supplier KRAKEN_SHELL_FRAGMENT = ITEMS.register("kraken_shell_fragment", () -> new ItemBase()); + public static final Supplier BAT_WING = ITEMS.register("bat_wing", MobDropItem::new); + public static final Supplier WITHERED_RIB = ITEMS.register("withered_rib", MobDropItem::new); + public static final Supplier MOLTEN_CORE = ITEMS.register("molten_core", MobDropItem::new); + public static final Supplier EYE_OF_THE_STORM = ITEMS.register("eye_of_the_storm", MobDropItem::new); + public static final Supplier FERTILE_ESSENCE = ITEMS.register("fertile_essence", () -> new ItemBase()); + public static final Supplier FROZEN_CORE = ITEMS.register("frozen_core", MobDropItem::new); + public static final Supplier NEBULOUS_HEART = ITEMS.register("nebulous_heart", MobDropItem::new); + public static final Supplier INFERNAL_CLAW = ITEMS.register("infernal_claw", () -> new ItemBase()); + public static final Supplier GUARDIAN_SPIKE = ITEMS.register("guardian_spike", MobDropItem::new); + public static final Supplier CRIMSON_CLOTH = ITEMS.register("crimson_cloth", () -> new ItemBase()); + public static final Supplier LANTERN_OF_PARANOIA = ITEMS.register("lantern_of_paranoia", LanternOfParanoiaItem::new); + public static final Supplier MAGICBANE = ITEMS.register("magicbane", MagicbaneItem::new); + public static final Supplier SALAMANDER_EYE = ITEMS.register("salamander_eye", SalamanderEyeItem::new); + public static final Supplier SERPENT_STAFF = ITEMS.register("serpent_staff", SerpentStaffItem::new); + public static final Supplier SHEARS_OF_WINTER = ITEMS.register("shears_of_winter", ShearsOfWinterItem::new); + public static final Supplier TWILIGHT_CLOAK = ITEMS.register("twilight_cloak", TwilightCloakItem::new); + public static final Supplier GLOWING_BREAD = ITEMS.register("glowing_bread", () -> new ItemBase(new Item.Properties().rarity(Rarity.RARE).food(new FoodProperties.Builder().nutrition(20).saturationMod(1F).fast().build()))); - public static final RegistryObject> ALKAHEST_TOME_MENU_TYPE = MENU_TYPES.register("alkahest_tome", - () -> IForgeMenuType.create((windowId, inv, data) -> AlkahestTomeMenu.fromBuffer(windowId))); + public static final Supplier> ALKAHEST_TOME_MENU_TYPE = MENU_TYPES.register("alkahest_tome", + () -> IMenuTypeExtension.create((windowId, inv, data) -> AlkahestTomeMenu.fromBuffer(windowId))); + + public static final Supplier> MOB_CHAR_BELT_MENU_TYPE = MENU_TYPES.register("mob_char_belt", + () -> IMenuTypeExtension.create(MobCharmBeltMenu::fromBuffer)); + - public static final RegistryObject> MOB_CHAR_BELT_MENU_TYPE = MENU_TYPES.register("mob_char_belt", - () -> IForgeMenuType.create(MobCharmBeltMenu::fromBuffer)); + public static final Supplier> ALKAHESTRY_ENABLED_CONDITION = CONDITION_CODECS.register("alkahestry_enabled", () -> AlkahestryEnabledCondition.CODEC); + public static final Supplier> MOB_DROPS_CRAFTABLE_CONDITION = CONDITION_CODECS.register("mob_drops_craftable", () -> MobDropsCraftableCondition.CODEC); + public static final Supplier> HANDGUN_ENABLED_CONDITION = CONDITION_CODECS.register("handgun_enabled", () -> HandgunEnabledCondition.CODEC); + public static final Supplier> POTIONS_ENABLED_CONDITION = CONDITION_CODECS.register("potions_enabled", () -> PotionsEnabledCondition.CODEC); + public static final Supplier> PASSIVE_PEDESTAL_ENABLED_CONDITION = CONDITION_CODECS.register("passive_pedestal_enabled", () -> PassivePedestalEnabledCondition.CODEC); + public static final Supplier> PEDESTAL_ENABLED_CONDITION = CONDITION_CODECS.register("pedestal_enabled", () -> PedestalEnabledCondition.CODEC); + public static final Supplier> SPAWN_EGG_ENABLED_CONDITION = CONDITION_CODECS.register("spawn_egg_enabled", () -> SpawnEggEnabledCondition.CODEC); - public static final RegistryObject> MOB_CHARM_RECIPE_SERIALIZER = RECIPE_SERIALIZERS.register("mob_charm", MobCharmRecipe.Serializer::new); - public static final RegistryObject> FRAGMENT_TO_SPAWN_EGG_SERIALIZER = RECIPE_SERIALIZERS.register("fragment_to_spawn_egg", FragmentToSpawnEggRecipe.Serializer::new); - public static final RegistryObject> MOB_CHARM_REPAIR_SERIALIZER = RECIPE_SERIALIZERS.register("mob_charm_repair", () -> new SimpleCraftingRecipeSerializer<>(MobCharmRepairRecipe::new)); - public static final RegistryObject> ALKAHESTRY_CHARGING_SERIALIZER = RECIPE_SERIALIZERS.register("alkahestry_charging", AlkahestryChargingRecipe.Serializer::new); - public static final RegistryObject> ALKAHESTRY_CRAFTING_SERIALIZER = RECIPE_SERIALIZERS.register("alkahestry_crafting", AlkahestryCraftingRecipe.Serializer::new); - public static final RegistryObject> ALKAHESTRY_DRAIN_SERIALIZER = RECIPE_SERIALIZERS.register("alkahestry_drain", AlkahestryDrainRecipe.Serializer::new); - public static final RegistryObject> POTION_EFFECTS_SERIALIZER = RECIPE_SERIALIZERS.register("potion_effects", PotionEffectsRecipe.Serializer::new); - public static final RegistryObject CHEST_LOOT_ENABLED_CONDITION = LOOT_CONDITION_TYPES.register("chest_loot_enabled", () -> new LootItemConditionType(new ChestLootEnabledCondition.Serializer())); - public static final RegistryObject ENTITY_LOOT_ENABLED_CONDITION = LOOT_CONDITION_TYPES.register("entity_loot_enabled", () -> new LootItemConditionType(new EntityLootEnabledCondition.Serializer())); - public static final RegistryObject RANDOM_CHANCE_LOOTING_SEVERING = LOOT_CONDITION_TYPES.register("random_chance_looting_severing", () -> new LootItemConditionType(new RandomChanceLootingSeveringCondition.Serializer())); - public static final RegistryObject> INJECT_LOOT = LOOT_MODIFIERS.register("inject_loot", () -> ReliquaryLootModifierProvider.InjectLootModifier.CODEC); + public static final Supplier> MOB_CHARM_RECIPE_SERIALIZER = RECIPE_SERIALIZERS.register("mob_charm", MobCharmRecipe.Serializer::new); + public static final Supplier> FRAGMENT_TO_SPAWN_EGG_SERIALIZER = RECIPE_SERIALIZERS.register("fragment_to_spawn_egg", FragmentToSpawnEggRecipe.Serializer::new); + public static final Supplier> MOB_CHARM_REPAIR_SERIALIZER = RECIPE_SERIALIZERS.register("mob_charm_repair", () -> new SimpleCraftingRecipeSerializer<>(MobCharmRepairRecipe::new)); + public static final Supplier> ALKAHESTRY_CHARGING_SERIALIZER = RECIPE_SERIALIZERS.register("alkahestry_charging", AlkahestryChargingRecipe.Serializer::new); + public static final Supplier> ALKAHESTRY_CRAFTING_SERIALIZER = RECIPE_SERIALIZERS.register("alkahestry_crafting", AlkahestryCraftingRecipe.Serializer::new); + public static final Supplier> ALKAHESTRY_DRAIN_SERIALIZER = RECIPE_SERIALIZERS.register("alkahestry_drain", AlkahestryDrainRecipe.Serializer::new); + public static final Supplier> POTION_EFFECTS_SERIALIZER = RECIPE_SERIALIZERS.register("potion_effects", PotionEffectsRecipe.Serializer::new); + public static final Supplier CHEST_LOOT_ENABLED_CONDITION = LOOT_CONDITION_TYPES.register("chest_loot_enabled", () -> new LootItemConditionType(ChestLootEnabledCondition.CODEC)); + public static final Supplier ENTITY_LOOT_ENABLED_CONDITION = LOOT_CONDITION_TYPES.register("entity_loot_enabled", () -> new LootItemConditionType(EntityLootEnabledCondition.CODEC)); + public static final Supplier RANDOM_CHANCE_LOOTING_SEVERING = LOOT_CONDITION_TYPES.register("random_chance_looting_severing", () -> new LootItemConditionType(RandomChanceLootingSeveringCondition.CODEC)); + public static final Supplier> INJECT_LOOT = LOOT_MODIFIERS.register("inject_loot", () -> ReliquaryLootModifierProvider.InjectLootModifier.CODEC); - public static RegistryObject CREATIVE_TAB = CREATIVE_MODE_TABS.register("main", () -> + private static final DeferredRegister> ATTACHMENT_TYPES = DeferredRegister.create(NeoForgeRegistries.Keys.ATTACHMENT_TYPES, Reference.MOD_ID); + private static final Supplier> HARVEST_ROD_ITEM_STACK_HANDLER = ATTACHMENT_TYPES.register( + "harvest_rod_handler", () -> AttachmentType.serializable(HarvestRodItemStackHandler::new).build()); + private static final Supplier> VOID_TEAR_ITEM_STACK_HANDLER = ATTACHMENT_TYPES.register( + "void_tear_handler", () -> AttachmentType.serializable(VoidTearItemStackHandler::new).build()); + private static final Supplier> ENDER_STAFF_ITEM_STACK_HANDLER = ATTACHMENT_TYPES.register( + "ender_staff_handler", () -> AttachmentType.serializable(() -> new FilteredItemStackHandler(new FilteredItemStack(Items.ENDER_PEARL, Config.COMMON.items.enderStaff.enderPearlLimit.get(), Config.COMMON.items.enderStaff.enderPearlWorth.get(), false))).build()); + private static final Supplier> RENDING_GALE_ITEM_STACK_HANDLER = ATTACHMENT_TYPES.register( + "rending_gale_handler", () -> AttachmentType.serializable(() -> new FilteredItemStackHandler(new FilteredItemStack(Items.FEATHER, Config.COMMON.items.rendingGale.chargeLimit.get(), Config.COMMON.items.rendingGale.chargeFeatherWorth.get(), false))).build()); + public static final Supplier> HARVEST_ROD_CACHE = ATTACHMENT_TYPES.register("harvest_rod_cache", () -> AttachmentType.builder(HarvestRodCache::new).build()); + public static final Supplier CREATIVE_TAB = CREATIVE_MODE_TABS.register("main", () -> CreativeModeTab.builder().icon(() -> new ItemStack(ModItems.MERCY_CROSS.get())) .title(Component.translatable("itemGroup.reliquary")) .displayItems((featureFlags, output) -> { @@ -270,18 +226,17 @@ public class ModItems { ).build()); public static void registerContainers(RegisterEvent event) { - if (!event.getRegistryKey().equals(ForgeRegistries.Keys.MENU_TYPES)) { + if (!event.getRegistryKey().equals(Registries.MENU)) { return; } - DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> { - MenuScreens.register(ALKAHEST_TOME_MENU_TYPE.get(), AlkahestryTomeGui::new); - MenuScreens.register(MOB_CHAR_BELT_MENU_TYPE.get(), MobCharmBeltGui::new); - }); + if (FMLEnvironment.dist.isClient()) { + ModItemsClient.registerMenuScreens(); + } } public static void registerDispenseBehaviors() { - if (Boolean.FALSE.equals(Settings.COMMON.disable.disablePotions.get())) { + if (Boolean.FALSE.equals(Config.COMMON.disable.disablePotions.get())) { DispenserBlock.registerBehavior(ModItems.SPLASH_POTION.get(), new BehaviorDefaultProjectileDispense() { @Override ProjectileEntityFactory getProjectileEntityFactory() { @@ -313,7 +268,7 @@ ProjectileEntityFactory getProjectileEntityFactory() { DispenserBlock.registerBehavior(ModItems.TIPPED_ARROW.get(), new AbstractProjectileDispenseBehavior() { @Override protected Projectile getProjectile(Level world, Position position, ItemStack stack) { - XRTippedArrowEntity entitytippedarrow = new XRTippedArrowEntity(world, position.x(), position.y(), position.z()); + XRTippedArrowEntity entitytippedarrow = new XRTippedArrowEntity(world, position.x(), position.y(), position.z(), stack); entitytippedarrow.setPotionEffect(stack); entitytippedarrow.pickup = AbstractArrow.Pickup.ALLOWED; return entitytippedarrow; @@ -335,18 +290,6 @@ ProjectileEntityFactory getProjectileEntityFactory() { }); } - public static void registerRecipeSerializers(RegisterEvent event) { - if (event.getRegistryKey().equals(ForgeRegistries.Keys.RECIPE_SERIALIZERS)) { - CraftingHelper.register(MobDropsCraftableCondition.SERIALIZER); - CraftingHelper.register(AlkahestryEnabledCondition.SERIALIZER); - CraftingHelper.register(HandgunEnabledCondition.SERIALIZER); - CraftingHelper.register(PotionsEnabledCondition.SERIALIZER); - CraftingHelper.register(PassivePedestalEnabledCondition.SERIALIZER); - CraftingHelper.register(PedestalEnabledCondition.SERIALIZER); - CraftingHelper.register(SpawnEggEnabledCondition.SERIALIZER); - } - } - public static void registerHandgunMagazines() { HandgunItem handgun = HANDGUN.get(); handgun.registerMagazine(RegistryHelper.getRegistryName(NEUTRAL_MAGAZINE.get()).toString(), NeutralShotEntity::new, NEUTRAL_BULLET); @@ -364,12 +307,14 @@ public static void registerListeners(IEventBus modBus) { ITEMS.register(modBus); MENU_TYPES.register(modBus); RECIPE_SERIALIZERS.register(modBus); + CONDITION_CODECS.register(modBus); LOOT_CONDITION_TYPES.register(modBus); LOOT_MODIFIERS.register(modBus); CREATIVE_MODE_TABS.register(modBus); - modBus.addListener(ModItems::registerRecipeSerializers); + ATTACHMENT_TYPES.register(modBus); modBus.addListener(ModItems::registerContainers); - MinecraftForge.EVENT_BUS.addListener(ModItems::onResourceReload); + modBus.addListener(ModItems::registerCapabilities); + NeoForge.EVENT_BUS.addListener(ModItems::onResourceReload); } private abstract static class BehaviorDefaultProjectileDispense implements DispenseItemBehavior { @@ -401,6 +346,18 @@ private static void onResourceReload(AddReloadListenerEvent event) { MobCharmRecipe.REGISTERED_RECIPES.clear(); } + private static void registerCapabilities(RegisterCapabilitiesEvent event) { + event.registerItem(Capabilities.FluidHandler.ITEM, (itemStack, context) -> new FluidHandlerHeroMedallion(itemStack) + , HERO_MEDALLION.get()); + event.registerItem(Capabilities.ItemHandler.ITEM, (itemStack, context) -> itemStack.getData(VOID_TEAR_ITEM_STACK_HANDLER), VOID_TEAR.get()); + event.registerItem(Capabilities.ItemHandler.ITEM, (itemStack, context) -> itemStack.getData(HARVEST_ROD_ITEM_STACK_HANDLER), HARVEST_ROD.get()); + event.registerItem(Capabilities.ItemHandler.ITEM, (itemStack, context) -> itemStack.getData(ENDER_STAFF_ITEM_STACK_HANDLER), ENDER_STAFF.get()); + event.registerItem(Capabilities.ItemHandler.ITEM, (itemStack, context) -> itemStack.getData(RENDING_GALE_ITEM_STACK_HANDLER), RENDING_GALE.get()); + event.registerItem(Capabilities.FluidHandler.ITEM, (itemStack, context) -> new FluidHandlerEmperorChalice(itemStack), EMPEROR_CHALICE.get()); + event.registerItem(Capabilities.FluidHandler.ITEM, (itemStack, context) -> new FluidHandlerHeroMedallion(itemStack), HERO_MEDALLION.get()); + event.registerItem(Capabilities.FluidHandler.ITEM, (itemStack, context) -> new FluidHandlerInfernalChalice(itemStack), INFERNAL_CHALICE.get()); + } + private interface ProjectileEntityFactory { Projectile createProjectileEntity(Level world, Position position, ItemStack stack); } diff --git a/src/main/java/reliquary/init/ModItemsClient.java b/src/main/java/reliquary/init/ModItemsClient.java new file mode 100644 index 00000000..47c3b953 --- /dev/null +++ b/src/main/java/reliquary/init/ModItemsClient.java @@ -0,0 +1,12 @@ +package reliquary.init; + +import net.minecraft.client.gui.screens.MenuScreens; +import reliquary.client.gui.AlkahestryTomeGui; +import reliquary.client.gui.MobCharmBeltGui; + +public class ModItemsClient { + public static void registerMenuScreens() { + MenuScreens.register(ModItems.ALKAHEST_TOME_MENU_TYPE.get(), AlkahestryTomeGui::new); + MenuScreens.register(ModItems.MOB_CHAR_BELT_MENU_TYPE.get(), MobCharmBeltGui::new); + } +} diff --git a/src/main/java/reliquary/init/ModPotions.java b/src/main/java/reliquary/init/ModPotions.java index a089c1f9..71e3f96d 100644 --- a/src/main/java/reliquary/init/ModPotions.java +++ b/src/main/java/reliquary/init/ModPotions.java @@ -1,23 +1,24 @@ package reliquary.init; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.world.effect.MobEffect; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.registries.DeferredRegister; import reliquary.potions.CurePotion; import reliquary.potions.FlightPotion; import reliquary.potions.PacificationPotion; import reliquary.reference.Reference; +import java.util.function.Supplier; + public class ModPotions { private ModPotions() {} - private static final DeferredRegister MOB_EFFECTS = DeferredRegister.create(ForgeRegistries.MOB_EFFECTS, Reference.MOD_ID); + private static final DeferredRegister MOB_EFFECTS = DeferredRegister.create(BuiltInRegistries.MOB_EFFECT, Reference.MOD_ID); - public static RegistryObject FLIGHT_POTION = MOB_EFFECTS.register("flight", FlightPotion::new); - public static RegistryObject PACIFICATION_POTION = MOB_EFFECTS.register("pacification", PacificationPotion::new); - public static RegistryObject CURE_POTION = MOB_EFFECTS.register("cure", CurePotion::new); + public static Supplier FLIGHT_POTION = MOB_EFFECTS.register("flight", FlightPotion::new); + public static Supplier PACIFICATION_POTION = MOB_EFFECTS.register("pacification", PacificationPotion::new); + public static Supplier CURE_POTION = MOB_EFFECTS.register("cure", CurePotion::new); public static void registerListeners(IEventBus modBus) { MOB_EFFECTS.register(modBus); diff --git a/src/main/java/reliquary/init/ModSounds.java b/src/main/java/reliquary/init/ModSounds.java index 6380030e..3ae7aae9 100644 --- a/src/main/java/reliquary/init/ModSounds.java +++ b/src/main/java/reliquary/init/ModSounds.java @@ -1,21 +1,23 @@ package reliquary.init; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.sounds.SoundEvent; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.registries.DeferredRegister; import reliquary.reference.Reference; +import java.util.function.Supplier; + public class ModSounds { - private ModSounds() {} + private ModSounds() { + } - private static final DeferredRegister SOUND_EVENTS = DeferredRegister.create(ForgeRegistries.SOUND_EVENTS, Reference.MOD_ID); + private static final DeferredRegister SOUND_EVENTS = DeferredRegister.create(BuiltInRegistries.SOUND_EVENT, Reference.MOD_ID); - public static final RegistryObject BOOK = SOUND_EVENTS.register("book", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(Reference.MOD_ID, "book"))); - public static final RegistryObject HANDGUN_LOAD = SOUND_EVENTS.register("handgun_load", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(Reference.MOD_ID, "handgun_load"))); - public static final RegistryObject HANDGUN_SHOT = SOUND_EVENTS.register("handgun_shot", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(Reference.MOD_ID, "handgun_shot"))); + public static final Supplier BOOK = SOUND_EVENTS.register("book", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(Reference.MOD_ID, "book"))); + public static final Supplier HANDGUN_LOAD = SOUND_EVENTS.register("handgun_load", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(Reference.MOD_ID, "handgun_load"))); + public static final Supplier HANDGUN_SHOT = SOUND_EVENTS.register("handgun_shot", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(Reference.MOD_ID, "handgun_shot"))); public static void registerListeners(IEventBus modBus) { SOUND_EVENTS.register(modBus); diff --git a/src/main/java/reliquary/items/AlkahestryTomeItem.java b/src/main/java/reliquary/items/AlkahestryTomeItem.java index b4c5f31e..dcdd9dad 100644 --- a/src/main/java/reliquary/items/AlkahestryTomeItem.java +++ b/src/main/java/reliquary/items/AlkahestryTomeItem.java @@ -12,14 +12,11 @@ import net.minecraft.world.item.enchantment.Enchantment; import net.minecraft.world.item.enchantment.EnchantmentCategory; import net.minecraft.world.level.Level; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.network.NetworkHooks; import reliquary.common.gui.AlkahestTomeMenu; import reliquary.crafting.AlkahestryChargingRecipe; import reliquary.crafting.AlkahestryRecipeRegistry; import reliquary.init.ModSounds; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.NBTHelper; import reliquary.util.TooltipBuilder; @@ -27,7 +24,7 @@ public class AlkahestryTomeItem extends ToggleableItem { public AlkahestryTomeItem() { - super(new Properties().setNoRepair().rarity(Rarity.EPIC).stacksTo(1), Settings.COMMON.disable.disableAlkahestry); + super(new Properties().setNoRepair().rarity(Rarity.EPIC).stacksTo(1), Config.COMMON.disable.disableAlkahestry); } @Override @@ -60,7 +57,7 @@ public InteractionResultHolder use(Level world, Player player, Intera player.playSound(ModSounds.BOOK.get(), 1.0f, 1.0f); if (!world.isClientSide && player instanceof ServerPlayer serverPlayer) { - NetworkHooks.openScreen(serverPlayer, new SimpleMenuProvider((w, p, pl) -> new AlkahestTomeMenu(w), stack.getHoverName())); + serverPlayer.openMenu(new SimpleMenuProvider((w, p, pl) -> new AlkahestTomeMenu(w), stack.getHoverName())); } return new InteractionResultHolder<>(InteractionResult.SUCCESS, stack); } @@ -82,7 +79,6 @@ public void inventoryTick(ItemStack tome, Level world, Entity entity, int itemSl } @Override - @OnlyIn(Dist.CLIENT) protected void addMoreInformation(ItemStack tome, @Nullable Level level, TooltipBuilder tooltipBuilder) { if (level == null) { return; @@ -104,7 +100,7 @@ protected boolean hasMoreInformation(ItemStack stack) { } public static int getChargeLimit() { - return Settings.COMMON.items.alkahestryTome.chargeLimit.get(); + return Config.getOrDefault(Config.COMMON.items.alkahestryTome.chargeLimit, Config.COMMON_SPEC); } public static ItemStack setCharge(ItemStack tome, int charge) { diff --git a/src/main/java/reliquary/items/AngelheartVialItem.java b/src/main/java/reliquary/items/AngelheartVialItem.java index 01fc9fa1..662fba42 100644 --- a/src/main/java/reliquary/items/AngelheartVialItem.java +++ b/src/main/java/reliquary/items/AngelheartVialItem.java @@ -1,20 +1,17 @@ package reliquary.items; -import net.minecraft.server.level.ServerPlayer; import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundSource; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.event.entity.living.LivingDeathEvent; +import net.neoforged.neoforge.event.entity.living.LivingDeathEvent; import reliquary.handler.CommonEventHandler; import reliquary.handler.HandlerPriority; import reliquary.handler.IPlayerDeathHandler; import reliquary.init.ModItems; import reliquary.network.PacketHandler; import reliquary.network.SpawnAngelheartVialParticlesPacket; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.EntityHelper; import reliquary.util.InventoryHelper; @@ -28,24 +25,25 @@ public boolean canApply(Player player, LivingDeathEvent event) { return InventoryHelper.playerHasItem(player, ModItems.ANGELHEART_VIAL.get()); } - @SuppressWarnings({"java:S2440", "InstantiationOfUtilityClass"}) //instantiating the packet for its type to be used as identifier for the packet + @SuppressWarnings({"java:S2440", "InstantiationOfUtilityClass"}) + //instantiating the packet for its type to be used as identifier for the packet @Override public boolean apply(Player player, LivingDeathEvent event) { decreaseAngelHeartByOne(player); // player should see a vial "shatter" effect and hear the glass break to // let them know they lost a vial. - PacketHandler.sendToClient((ServerPlayer) player, new SpawnAngelheartVialParticlesPacket()); + PacketHandler.sendToAllNear(player, new SpawnAngelheartVialParticlesPacket(), 64); // play some glass breaking effects at the player location player.level().playSound(null, player.blockPosition(), SoundEvents.GLASS_BREAK, SoundSource.NEUTRAL, 1.0F, player.level().random.nextFloat() * 0.1F + 0.9F); // gives the player a few hearts, sparing them from death. - float amountHealed = player.getMaxHealth() * (float) Settings.COMMON.items.angelHeartVial.healPercentageOfMaxLife.get() / 100F; + float amountHealed = player.getMaxHealth() * (float) Config.COMMON.items.angelHeartVial.healPercentageOfMaxLife.get() / 100F; player.setHealth(amountHealed); // if the player had any negative status effects [vanilla only for now], remove them: - if (Boolean.TRUE.equals(Settings.COMMON.items.angelHeartVial.removeNegativeStatus.get())) { + if (Boolean.TRUE.equals(Config.COMMON.items.angelHeartVial.removeNegativeStatus.get())) { EntityHelper.removeNegativeStatusEffects(player); } @@ -60,7 +58,6 @@ public HandlerPriority getPriority() { } @Override - @OnlyIn(Dist.CLIENT) public boolean isFoil(ItemStack stack) { return true; } diff --git a/src/main/java/reliquary/items/AngelicFeatherItem.java b/src/main/java/reliquary/items/AngelicFeatherItem.java index ec9b5ec2..c156f95f 100644 --- a/src/main/java/reliquary/items/AngelicFeatherItem.java +++ b/src/main/java/reliquary/items/AngelicFeatherItem.java @@ -7,12 +7,12 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Rarity; import net.minecraft.world.level.Level; -import net.minecraftforge.event.entity.living.LivingAttackEvent; +import net.neoforged.neoforge.event.entity.living.LivingAttackEvent; import reliquary.handler.CommonEventHandler; import reliquary.handler.HandlerPriority; import reliquary.handler.IPlayerHurtHandler; import reliquary.init.ModItems; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.InventoryHelper; public class AngelicFeatherItem extends ItemBase { @@ -29,7 +29,7 @@ public boolean canApply(Player player, LivingAttackEvent event) { @Override public boolean apply(Player player, LivingAttackEvent event) { - float hungerDamage = event.getAmount() * ((float) Settings.COMMON.items.angelicFeather.hungerCostPercent.get() / 100F); + float hungerDamage = event.getAmount() * ((float) Config.COMMON.items.angelicFeather.hungerCostPercent.get() / 100F); player.causeFoodExhaustion(hungerDamage); return true; } @@ -44,7 +44,7 @@ public HandlerPriority getPriority() { // minor jump buff @Override public void inventoryTick(ItemStack stack, Level world, Entity entity, int itemSlot, boolean isSelected) { - int potency = this instanceof PhoenixDownItem ? Settings.COMMON.items.phoenixDown.leapingPotency.get() : Settings.COMMON.items.angelicFeather.leapingPotency.get(); + int potency = this instanceof PhoenixDownItem ? Config.COMMON.items.phoenixDown.leapingPotency.get() : Config.COMMON.items.angelicFeather.leapingPotency.get(); if (potency == 0) { return; } diff --git a/src/main/java/reliquary/items/AphroditePotionItem.java b/src/main/java/reliquary/items/AphroditePotionItem.java index 5f9ba0c9..a8dfbfd8 100644 --- a/src/main/java/reliquary/items/AphroditePotionItem.java +++ b/src/main/java/reliquary/items/AphroditePotionItem.java @@ -10,12 +10,12 @@ import net.minecraft.world.level.Level; import reliquary.entities.potion.AphroditePotionEntity; import reliquary.init.ModItems; -import reliquary.reference.Settings; +import reliquary.reference.Config; public class AphroditePotionItem extends ItemBase { public AphroditePotionItem() { - super(new Properties(), Settings.COMMON.disable.disablePotions); + super(new Properties(), Config.COMMON.disable.disablePotions); } @Override diff --git a/src/main/java/reliquary/items/BulletItem.java b/src/main/java/reliquary/items/BulletItem.java index 60bbd02c..b0d74c07 100644 --- a/src/main/java/reliquary/items/BulletItem.java +++ b/src/main/java/reliquary/items/BulletItem.java @@ -5,10 +5,8 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.Level; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; import reliquary.items.util.IPotionItem; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.TooltipBuilder; import reliquary.util.potions.PotionEssence; import reliquary.util.potions.PotionMap; @@ -31,7 +29,6 @@ public BulletItem(boolean hasTooltip, boolean addPotionBulletsInItemGroup, int c } @Override - @OnlyIn(Dist.CLIENT) public void appendHoverText(ItemStack stack, @Nullable Level world, List tooltip, TooltipFlag flag) { TooltipBuilder tooltipBuilder = TooltipBuilder.of(tooltip); if (hasTooltip) { @@ -42,13 +39,13 @@ public void appendHoverText(ItemStack stack, @Nullable Level world, List itemConsumer) { - if (Boolean.TRUE.equals(Settings.COMMON.disable.disableHandgun.get())) { + if (Boolean.TRUE.equals(Config.COMMON.disable.disableHandgun.get())) { return; } itemConsumer.accept(new ItemStack(this)); - if (!addPotionBulletsInItemGroup || Boolean.TRUE.equals(Settings.COMMON.disable.disablePotions.get())) { + if (!addPotionBulletsInItemGroup || Boolean.TRUE.equals(Config.COMMON.disable.disablePotions.get())) { return; } diff --git a/src/main/java/reliquary/items/DestructionCatalystItem.java b/src/main/java/reliquary/items/DestructionCatalystItem.java index aacab0f0..c13e0052 100644 --- a/src/main/java/reliquary/items/DestructionCatalystItem.java +++ b/src/main/java/reliquary/items/DestructionCatalystItem.java @@ -3,6 +3,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.particles.ParticleTypes; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundSource; import net.minecraft.world.InteractionResult; @@ -13,10 +14,7 @@ import net.minecraft.world.item.context.UseOnContext; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Blocks; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.registries.ForgeRegistries; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.NBTHelper; import reliquary.util.RandHelper; import reliquary.util.TooltipBuilder; @@ -32,7 +30,6 @@ public DestructionCatalystItem() { } @Override - @OnlyIn(Dist.CLIENT) protected void addMoreInformation(ItemStack catalyst, @Nullable Level world, TooltipBuilder tooltipBuilder) { tooltipBuilder.charge(this, ".tooltip2", NBTHelper.getInt(GUNPOWDER_TAG, catalyst)); @@ -82,18 +79,18 @@ public void inventoryTick(ItemStack catalyst, Level world, Entity e, int itemSlo } private int getExplosionRadius() { - return Settings.COMMON.items.destructionCatalyst.explosionRadius.get(); + return Config.COMMON.items.destructionCatalyst.explosionRadius.get(); } private boolean perfectCube() { - return Settings.COMMON.items.destructionCatalyst.perfectCube.get(); + return Config.COMMON.items.destructionCatalyst.perfectCube.get(); } private boolean doExplosion(Level world, BlockPos pos, Direction direction) { boolean destroyedSomething = false; boolean playOnce = true; BlockPos origin = pos; - if (Boolean.FALSE.equals(Settings.COMMON.items.destructionCatalyst.centeredExplosion.get())) { + if (Boolean.FALSE.equals(Config.COMMON.items.destructionCatalyst.centeredExplosion.get())) { origin = pos.relative(direction.getOpposite(), getExplosionRadius()); } for (BlockPos target : BlockPos.betweenClosed(origin.offset(-getExplosionRadius(), -getExplosionRadius(), -getExplosionRadius()), @@ -106,7 +103,7 @@ private boolean doExplosion(Level world, BlockPos pos, Direction direction) { } //noinspection ConstantConditions - if (isBreakable(ForgeRegistries.BLOCKS.getKey(world.getBlockState(target).getBlock()).toString())) { + if (isBreakable(BuiltInRegistries.BLOCK.getKey(world.getBlockState(target).getBlock()).toString())) { world.setBlockAndUpdate(target, Blocks.AIR.defaultBlockState()); if (world.random.nextInt(2) == 0) { world.addParticle(ParticleTypes.EXPLOSION, target.getX() + (world.random.nextFloat() - 0.5F), target.getY() + (world.random.nextFloat() - 0.5F), target.getZ() + (world.random.nextFloat() - 0.5F), 0.0D, 0.0D, 0.0D); @@ -122,18 +119,18 @@ private boolean doExplosion(Level world, BlockPos pos, Direction direction) { } private boolean isBreakable(String id) { - return Settings.COMMON.items.destructionCatalyst.mundaneBlocks.get().contains(id); + return Config.COMMON.items.destructionCatalyst.mundaneBlocks.get().contains(id); } private int gunpowderCost() { - return Settings.COMMON.items.destructionCatalyst.gunpowderCost.get(); + return Config.COMMON.items.destructionCatalyst.gunpowderCost.get(); } private int gunpowderWorth() { - return Settings.COMMON.items.destructionCatalyst.gunpowderWorth.get(); + return Config.COMMON.items.destructionCatalyst.gunpowderWorth.get(); } private int gunpowderLimit() { - return Settings.COMMON.items.destructionCatalyst.gunpowderLimit.get(); + return Config.COMMON.items.destructionCatalyst.gunpowderLimit.get(); } } diff --git a/src/main/java/reliquary/items/ElsewhereFlaskItem.java b/src/main/java/reliquary/items/ElsewhereFlaskItem.java index 4ed91fbd..05e6f77b 100644 --- a/src/main/java/reliquary/items/ElsewhereFlaskItem.java +++ b/src/main/java/reliquary/items/ElsewhereFlaskItem.java @@ -4,8 +4,8 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; +import net.neoforged.fml.relauncher.Side; +import net.neoforged.fml.relauncher.SideOnly; import reliquary.Reliquary; import reliquary.reference.Names; @@ -71,7 +71,6 @@ public void formatPotionList(ImmutableMap toFormat, ItemStack st @Override - @OnlyIn(Dist.CLIENT) public EnumRarity getRarity(ItemStack stack) { return EnumRarity.EPIC; } diff --git a/src/main/java/reliquary/items/EmperorChaliceItem.java b/src/main/java/reliquary/items/EmperorChaliceItem.java index 749aa5ab..f18f0f9c 100644 --- a/src/main/java/reliquary/items/EmperorChaliceItem.java +++ b/src/main/java/reliquary/items/EmperorChaliceItem.java @@ -1,6 +1,5 @@ package reliquary.items; -import net.minecraft.nbt.CompoundTag; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.InteractionResultHolder; @@ -17,19 +16,15 @@ import net.minecraft.world.level.material.Fluids; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.HitResult; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.capabilities.ICapabilityProvider; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; -import net.minecraftforge.eventbus.api.Event; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidType; -import net.minecraftforge.fluids.FluidUtil; -import net.minecraftforge.fluids.capability.IFluidHandlerItem; -import reliquary.items.util.fluid.FluidHandlerEmperorChalice; -import reliquary.reference.Settings; +import net.neoforged.bus.api.Event; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.common.NeoForge; +import net.neoforged.neoforge.event.entity.player.PlayerInteractEvent; +import net.neoforged.neoforge.fluids.FluidStack; +import net.neoforged.neoforge.fluids.FluidType; +import net.neoforged.neoforge.fluids.FluidUtil; +import net.neoforged.neoforge.fluids.capability.IFluidHandlerItem; +import reliquary.reference.Config; import reliquary.util.TooltipBuilder; import javax.annotation.Nullable; @@ -38,11 +33,10 @@ public class EmperorChaliceItem extends ToggleableItem { public EmperorChaliceItem() { super(new Properties().stacksTo(1).setNoRepair().rarity(Rarity.EPIC)); - MinecraftForge.EVENT_BUS.addListener(this::onBlockRightClick); + NeoForge.EVENT_BUS.addListener(this::onBlockRightClick); } @Override - @OnlyIn(Dist.CLIENT) protected void addMoreInformation(ItemStack stack, @Nullable Level world, TooltipBuilder tooltipBuilder) { tooltipBuilder.description(this, ".tooltip2"); } @@ -57,11 +51,6 @@ public int getUseDuration(ItemStack stack) { return 16; } - @Override - public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable CompoundTag nbt) { - return new FluidHandlerEmperorChalice(stack); - } - @Override public UseAnim getUseAnimation(ItemStack stack) { return UseAnim.DRINK; @@ -77,7 +66,7 @@ public ItemStack finishUsingItem(ItemStack stack, Level world, LivingEntity enti return stack; } - int multiplier = Settings.COMMON.items.emperorChalice.hungerSatiationMultiplier.get(); + int multiplier = Config.COMMON.items.emperorChalice.hungerSatiationMultiplier.get(); player.getFoodData().eat(1, (float) multiplier / 2); player.hurt(player.damageSources().drown(), multiplier); return stack; @@ -103,14 +92,17 @@ public InteractionResultHolder use(Level world, Player player, Intera return new InteractionResultHolder<>(InteractionResult.FAIL, emperorChalice); } - if (emperorChalice.getCapability(ForgeCapabilities.FLUID_HANDLER_ITEM).map(fluidHandler -> { + IFluidHandlerItem fluidHandler = emperorChalice.getCapability(Capabilities.FluidHandler.ITEM); + if (fluidHandler != null) { + boolean success; if (!isEnabled(emperorChalice)) { - return placeWater(world, player, hand, fluidHandler, result); + success = placeWater(world, player, hand, fluidHandler, result); } else { - return FluidUtil.tryPickUpFluid(emperorChalice, player, world, result.getBlockPos(), result.getDirection()).isSuccess(); + success = FluidUtil.tryPickUpFluid(emperorChalice, player, world, result.getBlockPos(), result.getDirection()).isSuccess(); + } + if (success) { + return new InteractionResultHolder<>(InteractionResult.SUCCESS, emperorChalice); } - }).orElse(false)) { - return new InteractionResultHolder<>(InteractionResult.SUCCESS, emperorChalice); } } diff --git a/src/main/java/reliquary/items/EnderStaffItem.java b/src/main/java/reliquary/items/EnderStaffItem.java index daded06f..55c41991 100644 --- a/src/main/java/reliquary/items/EnderStaffItem.java +++ b/src/main/java/reliquary/items/EnderStaffItem.java @@ -1,11 +1,14 @@ package reliquary.items; import com.google.common.collect.ImmutableMap; -import net.minecraft.ChatFormatting; import net.minecraft.core.BlockPos; import net.minecraft.core.particles.ParticleTypes; +import net.minecraft.core.registries.Registries; import net.minecraft.nbt.CompoundTag; -import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceKey; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.server.level.ServerPlayer; import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundSource; import net.minecraft.util.StringRepresentable; @@ -21,26 +24,23 @@ import net.minecraft.world.item.UseAnim; import net.minecraft.world.item.context.UseOnContext; import net.minecraft.world.level.Level; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.capabilities.ICapabilityProvider; +import net.minecraft.world.level.portal.PortalInfo; +import net.minecraft.world.phys.Vec3; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.common.util.ITeleporter; import reliquary.entities.EnderStaffProjectileEntity; import reliquary.init.ModBlocks; -import reliquary.items.util.FilteredItemHandlerProvider; -import reliquary.items.util.FilteredItemStack; import reliquary.items.util.FilteredItemStackHandler; import reliquary.items.util.IScrollableItem; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.NBTHelper; import reliquary.util.TooltipBuilder; import javax.annotation.Nullable; -import java.util.ArrayList; import java.util.Map; +import java.util.function.Function; public class EnderStaffItem extends ToggleableItem implements IScrollableItem { - private static final String DIMENSION_TAG = "dimensionID"; private static final String NODE_X_TAG = "nodeX"; private static final String NODE_Y_TAG = "nodeY"; @@ -51,23 +51,23 @@ public EnderStaffItem() { } private int getEnderStaffPearlCost() { - return Settings.COMMON.items.enderStaff.enderPearlCastCost.get(); + return Config.COMMON.items.enderStaff.enderPearlCastCost.get(); } private int getEnderStaffNodeWarpCost() { - return Settings.COMMON.items.enderStaff.enderPearlNodeWarpCost.get(); + return Config.COMMON.items.enderStaff.enderPearlNodeWarpCost.get(); } private int getEnderPearlWorth() { - return Settings.COMMON.items.enderStaff.enderPearlWorth.get(); + return Config.COMMON.items.enderStaff.enderPearlWorth.get(); } private int getEnderPearlLimit() { - return Settings.COMMON.items.enderStaff.enderPearlLimit.get(); + return Config.COMMON.items.enderStaff.enderPearlLimit.get(); } private int getNodeWarpCastTime() { - return Settings.COMMON.items.enderStaff.nodeWarpCastTime.get(); + return Config.COMMON.items.enderStaff.nodeWarpCastTime.get(); } public Mode getMode(ItemStack stack) { @@ -95,14 +95,6 @@ public InteractionResult onMouseScrolled(ItemStack stack, Player player, double return InteractionResult.SUCCESS; } - @Override - public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable CompoundTag nbt) { - ArrayList filteredStacks = new ArrayList<>(); - filteredStacks.add(new FilteredItemStack(Items.ENDER_PEARL, Settings.COMMON.items.enderStaff.enderPearlLimit.get(), - Settings.COMMON.items.enderStaff.enderPearlWorth.get(), false)); - return new FilteredItemHandlerProvider(filteredStacks); - } - @Override public void inventoryTick(ItemStack staff, Level world, Entity entity, int itemSlot, boolean isSelected) { if (world.isClientSide || world.getGameTime() % 10 != 0) { @@ -123,29 +115,17 @@ public void inventoryTick(ItemStack staff, Level world, Entity entity, int itemS } private void setPearlCount(ItemStack stack, int count) { - stack.getCapability(ForgeCapabilities.ITEM_HANDLER, null).ifPresent(itemHandler -> { - if (!(itemHandler instanceof FilteredItemStackHandler filteredHandler)) { - return; - } - filteredHandler.setTotalCount(0, count); - }); - } - - private int getPearlCount(ItemStack staff) { - return getPearlCount(staff, false); + if (!(stack.getCapability(Capabilities.ItemHandler.ITEM) instanceof FilteredItemStackHandler filteredHandler)) { + return; + } + filteredHandler.setTotalCount(0, count); } - public int getPearlCount(ItemStack staff, boolean isClient) { - if (isClient) { - return NBTHelper.getInt("count", staff); + public int getPearlCount(ItemStack staff) { + if (!(staff.getCapability(Capabilities.ItemHandler.ITEM) instanceof FilteredItemStackHandler filteredHandler)) { + return 0; } - - return staff.getCapability(ForgeCapabilities.ITEM_HANDLER, null).map(itemHandler -> { - if (!(itemHandler instanceof FilteredItemStackHandler filteredHandler)) { - return 0; - } - return filteredHandler.getTotalAmount(0); - }).orElse(0); + return filteredHandler.getTotalAmount(0); } @Override @@ -212,47 +192,68 @@ private void shootEnderStaffProjectile(Level world, Player player, InteractionHa } } - private void doWraithNodeWarpCheck(ItemStack stack, Level world, Player player) { + private void doWraithNodeWarpCheck(ItemStack stack, Level level, Player player) { CompoundTag tag = stack.getTag(); if (tag == null || (getPearlCount(stack) < getEnderStaffNodeWarpCost() && !player.isCreative())) { return; } - if (!tag.getString(DIMENSION_TAG).equals(getDimension(world))) { - if (!world.isClientSide) { - player.sendSystemMessage(Component.literal(ChatFormatting.DARK_RED + "Out of range!")); + String wraithNodeDimension = tag.getString(DIMENSION_TAG); + BlockPos wraithNodePos = new BlockPos(tag.getInt(NODE_X_TAG), tag.getInt(NODE_Y_TAG), tag.getInt(NODE_Z_TAG)); + if (!player.level().dimension().location().toString().equals(wraithNodeDimension) && player.level() instanceof ServerLevel serverLevel) { + ServerLevel destination = serverLevel.getServer().getLevel(ResourceKey.create(Registries.DIMENSION, new ResourceLocation(wraithNodeDimension))); + if (destination != null && canTeleport(destination, wraithNodePos)) { + teleportToDimension(player, destination, wraithNodePos); + if (!player.isCreative() && !player.level().isClientSide) { + setPearlCount(stack, getPearlCount(stack) - getEnderStaffNodeWarpCost()); + } + } + } else { + if (canTeleport(level, wraithNodePos)) { + teleportPlayer(level, wraithNodePos, player); + if (!player.isCreative() && !player.level().isClientSide) { + setPearlCount(stack, getPearlCount(stack) - getEnderStaffNodeWarpCost()); + } } - return; } + } - BlockPos wraithNodePos = new BlockPos(tag.getInt(NODE_X_TAG + getDimension(world)), tag.getInt(NODE_Y_TAG + getDimension(world)), tag.getInt(NODE_Z_TAG + getDimension(world))); - if (world.getBlockState(wraithNodePos).getBlock() == ModBlocks.WRAITH_NODE.get() && canTeleport(world, wraithNodePos)) { - teleportPlayer(world, wraithNodePos, player); - if (!player.isCreative() && !player.level().isClientSide) { - setPearlCount(stack, getPearlCount(stack) - getEnderStaffNodeWarpCost()); + private static void teleportToDimension(Player player, ServerLevel destination, BlockPos wraithNodePos) { + player.changeDimension(destination, new WraithNodeTeleporter() { + @Override + public PortalInfo getPortalInfo(Entity entity, ServerLevel destWorld, Function defaultPortalInfo) { + return new PortalInfo(new Vec3(wraithNodePos.getX() + 0.5, wraithNodePos.getY() + 0.875, wraithNodePos.getZ() + 0.5), Vec3.ZERO, entity.getYRot(), entity.getXRot()); } - return; - } - if (tag.contains(DIMENSION_TAG)) { - tag.remove(DIMENSION_TAG); - tag.remove(NODE_X_TAG); - tag.remove(NODE_Y_TAG); - tag.remove(NODE_Z_TAG); - if (!world.isClientSide) { - player.sendSystemMessage(Component.literal(ChatFormatting.DARK_RED + "Node doesn't exist!")); - } else { - player.playSound(SoundEvents.ENDERMAN_DEATH, 1.0f, 1.0f); + @Override + public Entity placeEntity(Entity entity, ServerLevel currentWorld, ServerLevel destWorld, float yaw, Function repositionEntity) { + return repositionEntity.apply(false); } - } + }); } - private boolean canTeleport(Level world, BlockPos pos) { + private static boolean canTeleport(Level level, BlockPos pos) { + if (level.getBlockState(pos).getBlock() != ModBlocks.WRAITH_NODE.get()) { + return false; + } + BlockPos up = pos.above(); - return world.isEmptyBlock(up) && world.isEmptyBlock(up.above()); + return level.isEmptyBlock(up) && level.isEmptyBlock(up.above()); + } + + private abstract static class WraithNodeTeleporter implements ITeleporter { + @Override + public boolean isVanilla() { + return false; + } + + @Override + public boolean playTeleportSound(ServerPlayer player, ServerLevel sourceWorld, ServerLevel destWorld) { + return false; + } } - private void teleportPlayer(Level world, BlockPos pos, Player player) { + private static void teleportPlayer(Level world, BlockPos pos, Player player) { player.teleportTo(pos.getX() + 0.5, pos.getY() + 0.875, pos.getZ() + 0.5); player.playSound(SoundEvents.ENDERMAN_TELEPORT, 1.0f, 1.0f); for (int particles = 0; particles < 2; particles++) { @@ -261,17 +262,17 @@ private void teleportPlayer(Level world, BlockPos pos, Player player) { } @Override - @OnlyIn(Dist.CLIENT) protected void addMoreInformation(ItemStack staff, @Nullable Level world, TooltipBuilder tooltipBuilder) { tooltipBuilder.description(this, ".tooltip2"); - tooltipBuilder.charge(this, ".tooltip.charge", getPearlCount(staff, true)); - - if (staff.getTag() != null && staff.getTag().contains(NODE_X_TAG + getDimension(world)) && staff.getTag().contains(NODE_Y_TAG + getDimension(world)) && staff.getTag().contains(NODE_Z_TAG + getDimension(world))) { - if (staff.getTag() != null && !staff.getTag().getString(DIMENSION_TAG).equals(getDimension(world))) { - tooltipBuilder.warning(this, ".tooltip.position.out_of_range"); - } else { - tooltipBuilder.data(this, ".tooltip.position", staff.getTag().getInt(NODE_X_TAG + getDimension(world)), staff.getTag().getInt(NODE_Y_TAG + getDimension(world)), staff.getTag().getInt(NODE_Z_TAG + getDimension(world))); - } + tooltipBuilder.charge(this, ".tooltip.charge", getPearlCount(staff)); + + if (staff.getTag() != null && staff.getTag().contains(NODE_X_TAG) && staff.getTag().contains(NODE_Y_TAG) && staff.getTag().contains(NODE_Z_TAG)) { + tooltipBuilder.data(this, ".tooltip.position", + staff.getTag().getInt(NODE_X_TAG), + staff.getTag().getInt(NODE_Y_TAG), + staff.getTag().getInt(NODE_Z_TAG), + staff.getTag().getString(DIMENSION_TAG) + ); } else { tooltipBuilder.description(this, ".tooltip.position.nowhere"); } @@ -295,7 +296,7 @@ public InteractionResult useOn(UseOnContext itemUseContext) { BlockPos pos = itemUseContext.getClickedPos(); // if right clicking on a wraith node, bind the eye to that wraith node. - if ((stack.getTag() == null || !(stack.getTag().contains(DIMENSION_TAG))) && world.getBlockState(pos).getBlock() == ModBlocks.WRAITH_NODE.get()) { + if (world.getBlockState(pos).getBlock() == ModBlocks.WRAITH_NODE.get()) { setWraithNode(stack, pos, getDimension(world)); Player player = itemUseContext.getPlayer(); @@ -312,28 +313,16 @@ public InteractionResult useOn(UseOnContext itemUseContext) { } private String getDimension(@Nullable Level world) { - return world != null ? world.dimension().registry().toString() : Level.OVERWORLD.location().toString(); + return world != null ? world.dimension().location().toString() : Level.OVERWORLD.location().toString(); } private void setWraithNode(ItemStack eye, BlockPos pos, String dimension) { - NBTHelper.putInt(NODE_X_TAG + dimension, eye, pos.getX()); - NBTHelper.putInt(NODE_Y_TAG + dimension, eye, pos.getY()); - NBTHelper.putInt(NODE_Z_TAG + dimension, eye, pos.getZ()); + NBTHelper.putInt(NODE_X_TAG, eye, pos.getX()); + NBTHelper.putInt(NODE_Y_TAG, eye, pos.getY()); + NBTHelper.putInt(NODE_Z_TAG, eye, pos.getZ()); NBTHelper.putString(DIMENSION_TAG, eye, dimension); } - @Nullable - @Override - public CompoundTag getShareTag(ItemStack staff) { - CompoundTag nbt = super.getShareTag(staff); - if (nbt == null) { - nbt = new CompoundTag(); - } - nbt.putInt("count", getPearlCount(staff)); - - return nbt; - } - public enum Mode implements StringRepresentable { CAST("cast"), LONG_CAST("long_cast"), diff --git a/src/main/java/reliquary/items/FertilePotionItem.java b/src/main/java/reliquary/items/FertilePotionItem.java index a6251f5f..4b7eca96 100644 --- a/src/main/java/reliquary/items/FertilePotionItem.java +++ b/src/main/java/reliquary/items/FertilePotionItem.java @@ -10,11 +10,11 @@ import net.minecraft.world.level.Level; import reliquary.entities.potion.FertilePotionEntity; import reliquary.init.ModItems; -import reliquary.reference.Settings; +import reliquary.reference.Config; public class FertilePotionItem extends ItemBase { public FertilePotionItem() { - super(new Properties(), Settings.COMMON.disable.disablePotions::get); + super(new Properties(), Config.COMMON.disable.disablePotions::get); } @Override diff --git a/src/main/java/reliquary/items/FortuneCoinItem.java b/src/main/java/reliquary/items/FortuneCoinItem.java index 48392b8d..405d7836 100644 --- a/src/main/java/reliquary/items/FortuneCoinItem.java +++ b/src/main/java/reliquary/items/FortuneCoinItem.java @@ -19,9 +19,7 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.phys.AABB; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.fluids.FluidStack; +import net.neoforged.neoforge.fluids.FluidStack; import reliquary.api.IPedestal; import reliquary.api.IPedestalActionItem; import reliquary.blocks.tile.PedestalBlockEntity; @@ -29,7 +27,7 @@ import reliquary.init.ModItems; import reliquary.items.util.ICuriosItem; import reliquary.pedestal.PedestalRegistry; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.NBTHelper; import reliquary.util.RandHelper; import reliquary.util.TooltipBuilder; @@ -77,7 +75,6 @@ public void onWornTick(ItemStack stack, LivingEntity player) { } @Override - @OnlyIn(Dist.CLIENT) protected void addMoreInformation(ItemStack stack, @Nullable Level world, TooltipBuilder tooltipBuilder) { tooltipBuilder.description(this, ".tooltip2"); } @@ -93,7 +90,6 @@ public Rarity getRarity(ItemStack stack) { } @Override - @OnlyIn(Dist.CLIENT) public boolean isFoil(ItemStack stack) { return isEnabled(stack); } @@ -223,11 +219,11 @@ public void onUseTick(Level level, LivingEntity livingEntity, ItemStack stack, i } private double getLongRangePullDistance() { - return Settings.COMMON.items.fortuneCoin.longRangePullDistance.get(); + return Config.COMMON.items.fortuneCoin.longRangePullDistance.get(); } private double getStandardPullDistance() { - return Settings.COMMON.items.fortuneCoin.standardPullDistance.get(); + return Config.COMMON.items.fortuneCoin.standardPullDistance.get(); } @Override diff --git a/src/main/java/reliquary/items/FortuneCoinToggler.java b/src/main/java/reliquary/items/FortuneCoinToggler.java index ee1e70ff..281b08a5 100644 --- a/src/main/java/reliquary/items/FortuneCoinToggler.java +++ b/src/main/java/reliquary/items/FortuneCoinToggler.java @@ -3,25 +3,19 @@ import net.minecraft.client.Minecraft; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.event.TickEvent; +import net.neoforged.neoforge.event.TickEvent; +import net.neoforged.neoforge.network.PacketDistributor; import reliquary.handler.ClientEventHandler; import reliquary.init.ModItems; -import reliquary.network.PacketFortuneCoinTogglePressed; -import reliquary.network.PacketHandler; +import reliquary.network.FortuneCoinTogglePressedPacket; -@OnlyIn(Dist.CLIENT) public class FortuneCoinToggler { - @OnlyIn(Dist.CLIENT) private static FortuneCoinToggler coinToggler = new FortuneCoinToggler(); - @OnlyIn(Dist.CLIENT) public static void setCoinToggler(FortuneCoinToggler toggler) { coinToggler = toggler; } - @OnlyIn(Dist.CLIENT) @SuppressWarnings({"squid:S1172", "unused"}) //used in addListener reflection code public static void handleKeyInputEvent(TickEvent.ClientTickEvent event) { if (ClientEventHandler.FORTUNE_COIN_TOGGLE_KEYBIND.consumeClick()) { @@ -38,14 +32,14 @@ public boolean findAndToggle() { for (int slot = 0; slot < player.getInventory().items.size(); slot++) { ItemStack stack = player.getInventory().items.get(slot); if (stack.getItem() == ModItems.FORTUNE_COIN.get()) { - PacketHandler.sendToServer(new PacketFortuneCoinTogglePressed(PacketFortuneCoinTogglePressed.InventoryType.MAIN, slot)); + PacketDistributor.SERVER.noArg().send(new FortuneCoinTogglePressedPacket(FortuneCoinTogglePressedPacket.InventoryType.MAIN, slot)); ModItems.FORTUNE_COIN.get().toggle(stack); return true; } } if (player.getInventory().offhand.get(0).getItem() == ModItems.FORTUNE_COIN.get()) { - PacketHandler.sendToServer(new PacketFortuneCoinTogglePressed(PacketFortuneCoinTogglePressed.InventoryType.OFF_HAND, 0)); + PacketDistributor.SERVER.noArg().send(new FortuneCoinTogglePressedPacket(FortuneCoinTogglePressedPacket.InventoryType.OFF_HAND, 0)); ModItems.FORTUNE_COIN.get().toggle(player.getInventory().offhand.get(0)); return true; } diff --git a/src/main/java/reliquary/items/GlacialStaffItem.java b/src/main/java/reliquary/items/GlacialStaffItem.java index 272864eb..6064a67b 100644 --- a/src/main/java/reliquary/items/GlacialStaffItem.java +++ b/src/main/java/reliquary/items/GlacialStaffItem.java @@ -18,8 +18,6 @@ import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.LiquidBlock; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; import reliquary.util.NBTHelper; import reliquary.util.TooltipBuilder; @@ -38,7 +36,6 @@ public GlacialStaffItem() { } @Override - @OnlyIn(Dist.CLIENT) protected void addMoreInformation(ItemStack staff, @Nullable Level world, TooltipBuilder tooltipBuilder) { tooltipBuilder.charge(this, ".tooltip2", NBTHelper.getInt(SNOWBALLS_TAG, staff)); if (isEnabled(staff)) { diff --git a/src/main/java/reliquary/items/GlowingWaterItem.java b/src/main/java/reliquary/items/GlowingWaterItem.java index 5bec6e01..2e42b46e 100644 --- a/src/main/java/reliquary/items/GlowingWaterItem.java +++ b/src/main/java/reliquary/items/GlowingWaterItem.java @@ -8,8 +8,6 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; import reliquary.entities.GlowingWaterEntity; import reliquary.init.ModItems; @@ -29,7 +27,6 @@ public boolean hasCraftingRemainingItem(ItemStack stack) { } @Override - @OnlyIn(Dist.CLIENT) public boolean isFoil(ItemStack stack) { return true; } diff --git a/src/main/java/reliquary/items/HandgunItem.java b/src/main/java/reliquary/items/HandgunItem.java index 274f1cb6..becedaf9 100644 --- a/src/main/java/reliquary/items/HandgunItem.java +++ b/src/main/java/reliquary/items/HandgunItem.java @@ -1,5 +1,6 @@ package reliquary.items; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.sounds.SoundSource; import net.minecraft.util.Mth; @@ -11,26 +12,20 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; import net.minecraft.world.item.UseAnim; import net.minecraft.world.level.Level; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.registries.ForgeRegistries; import reliquary.entities.shot.ShotEntityBase; import reliquary.init.ModItems; import reliquary.init.ModSounds; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.NBTHelper; import reliquary.util.RegistryHelper; import reliquary.util.TooltipBuilder; import reliquary.util.potions.XRPotionHelper; import javax.annotation.Nullable; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; +import java.util.*; import java.util.function.Supplier; public class HandgunItem extends ItemBase { @@ -51,7 +46,7 @@ public void registerMagazine(String magazineRegistryName, IShotEntityFactory fac } public HandgunItem() { - super(new Properties().stacksTo(1), Settings.COMMON.disable.disableHandgun::get); + super(new Properties().stacksTo(1), Config.COMMON.disable.disableHandgun); } private short getBulletCount(ItemStack handgun) { @@ -105,9 +100,7 @@ private void setPotionEffects(ItemStack handgun, List potionE } @Override - @OnlyIn(Dist.CLIENT) protected void addMoreInformation(ItemStack handgun, @Nullable Level world, TooltipBuilder tooltipBuilder) { - ItemStack bullets = getBulletStack(handgun); if (hasAmmo(handgun)) { tooltipBuilder .data(this, ".tooltip2", getBulletCount(handgun), getMagazineName(handgun)) @@ -121,8 +114,8 @@ protected boolean hasMoreInformation(ItemStack handgun) { } private String getMagazineName(ItemStack handgun) { - Item item = ForgeRegistries.ITEMS.getValue(new ResourceLocation(getMagazineType(handgun))); - return item != null ? item.getName(new ItemStack(item)).getString() : ""; + Item item = BuiltInRegistries.ITEM.get(new ResourceLocation(getMagazineType(handgun))); + return item != Items.AIR ? item.getName(new ItemStack(item)).getString() : ""; } @Override @@ -246,12 +239,12 @@ private void setFiringCooldown(ItemStack handgun, Level worldIn, Player player) } private int getPlayerFiringCooldown(Player player) { - return Settings.COMMON.items.handgun.maxSkillLevel.get() + HANDGUN_COOLDOWN_SKILL_OFFSET - - Math.min(player.experienceLevel, Settings.COMMON.items.handgun.maxSkillLevel.get()); + return Config.COMMON.items.handgun.maxSkillLevel.get() + HANDGUN_COOLDOWN_SKILL_OFFSET + - Math.min(player.experienceLevel, Config.COMMON.items.handgun.maxSkillLevel.get()); } private int getItemUseDuration() { - return HANDGUN_RELOAD_SKILL_OFFSET + Settings.COMMON.items.handgun.maxSkillLevel.get(); + return HANDGUN_RELOAD_SKILL_OFFSET + Config.COMMON.items.handgun.maxSkillLevel.get(); } private void fireBullet(ItemStack handgun, Level world, Player player, InteractionHand hand) { @@ -320,6 +313,6 @@ private Optional getMagazineSlot(Player player) { } private int getPlayerReloadDelay(Player player) { - return Settings.COMMON.items.handgun.maxSkillLevel.get() + HANDGUN_RELOAD_SKILL_OFFSET - Math.min(player.experienceLevel, Settings.COMMON.items.handgun.maxSkillLevel.get()); + return Config.COMMON.items.handgun.maxSkillLevel.get() + HANDGUN_RELOAD_SKILL_OFFSET - Math.min(player.experienceLevel, Config.COMMON.items.handgun.maxSkillLevel.get()); } } diff --git a/src/main/java/reliquary/items/HarvestRodItem.java b/src/main/java/reliquary/items/HarvestRodItem.java index 12212752..760e7f60 100644 --- a/src/main/java/reliquary/items/HarvestRodItem.java +++ b/src/main/java/reliquary/items/HarvestRodItem.java @@ -4,7 +4,6 @@ import net.minecraft.ChatFormatting; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; -import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.MutableComponent; import net.minecraft.server.level.ServerLevel; import net.minecraft.sounds.SoundEvents; @@ -18,12 +17,7 @@ import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.BlockItem; -import net.minecraft.world.item.BoneMealItem; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Items; -import net.minecraft.world.item.UseAnim; +import net.minecraft.world.item.*; import net.minecraft.world.level.ClipContext; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; @@ -32,30 +26,17 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.HitResult; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.common.IPlantable; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.capabilities.ICapabilityProvider; -import net.minecraftforge.common.capabilities.ICapabilitySerializable; -import net.minecraftforge.common.util.LazyOptional; +import net.neoforged.neoforge.common.IPlantable; +import net.neoforged.neoforge.items.IItemHandler; import reliquary.blocks.FertileLilyPadBlock; import reliquary.entities.EntityXRFakePlayer; -import reliquary.init.ModCapabilities; +import reliquary.init.ModItems; import reliquary.items.util.HarvestRodCache; import reliquary.items.util.HarvestRodItemStackHandler; -import reliquary.items.util.IHarvestRodCache; import reliquary.items.util.IScrollableItem; -import reliquary.reference.Settings; -import reliquary.util.InventoryHelper; -import reliquary.util.ItemHelper; -import reliquary.util.NBTHelper; -import reliquary.util.RandHelper; -import reliquary.util.TooltipBuilder; -import reliquary.util.XRFakePlayerFactory; - -import javax.annotation.Nonnull; +import reliquary.reference.Config; +import reliquary.util.*; + import javax.annotation.Nullable; import java.util.List; import java.util.Optional; @@ -78,12 +59,11 @@ public MutableComponent getName(ItemStack stack) { } @Override - @OnlyIn(Dist.CLIENT) protected void addMoreInformation(ItemStack rod, @Nullable Level world, TooltipBuilder tooltipBuilder) { - tooltipBuilder.charge(this, ".tooltip2", getBoneMealCount(rod, true)); - for (int slot = 1; slot < getCountPlantable(rod, true); slot++) { - ItemStack plantable = getPlantableInSlot(rod, slot, true); - tooltipBuilder.charge(this, ".tooltip3", plantable.getItem().getName(plantable).getString(), getPlantableQuantity(rod, slot, true)); + tooltipBuilder.charge(this, ".tooltip2", getBoneMealCount(rod)); + for (int slot = 1; slot < getCountPlantable(rod); slot++) { + ItemStack plantable = getPlantableInSlot(rod, slot); + tooltipBuilder.charge(this, ".tooltip3", plantable.getItem().getName(plantable).getString(), getPlantableQuantity(rod, slot)); } if (isEnabled(rod)) { @@ -104,57 +84,27 @@ public UseAnim getUseAnimation(ItemStack stack) { } private int getBonemealLimit() { - return Settings.COMMON.items.harvestRod.boneMealLimit.get(); + return Config.COMMON.items.harvestRod.boneMealLimit.get(); } private int getBonemealWorth() { - return Settings.COMMON.items.harvestRod.boneMealWorth.get(); + return Config.COMMON.items.harvestRod.boneMealWorth.get(); } public int getBonemealCost() { - return Settings.COMMON.items.harvestRod.boneMealCost.get(); + return Config.COMMON.items.harvestRod.boneMealCost.get(); } public int getLuckRolls() { - return Settings.COMMON.items.harvestRod.boneMealLuckRolls.get(); + return Config.COMMON.items.harvestRod.boneMealLuckRolls.get(); } public int getLuckPercent() { - return Settings.COMMON.items.harvestRod.boneMealLuckPercentChance.get(); + return Config.COMMON.items.harvestRod.boneMealLuckPercentChance.get(); } private int getBreakRadius() { - return Settings.COMMON.items.harvestRod.aoeRadius.get(); - } - - @Override - public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable CompoundTag nbt) { - return new ICapabilitySerializable() { - final HarvestRodItemStackHandler itemHandler = new HarvestRodItemStackHandler(); - final IHarvestRodCache harvestRodCache = new HarvestRodCache(); - - @Override - public CompoundTag serializeNBT() { - return itemHandler.serializeNBT(); - } - - @Override - public void deserializeNBT(CompoundTag tagCompound) { - itemHandler.deserializeNBT(tagCompound); - } - - @Nonnull - @Override - public LazyOptional getCapability(Capability capability, @Nullable Direction side) { - if (capability == ForgeCapabilities.ITEM_HANDLER) { - return ForgeCapabilities.ITEM_HANDLER.orEmpty(capability, LazyOptional.of(() -> itemHandler)); - } else if (capability == ModCapabilities.HARVEST_ROD_CACHE) { - return ModCapabilities.HARVEST_ROD_CACHE.orEmpty(capability, LazyOptional.of(() -> harvestRodCache)); - } - - return LazyOptional.empty(); - } - }; + return Config.COMMON.items.harvestRod.aoeRadius.get(); } @Override @@ -265,6 +215,7 @@ private void boneMealBlock(ItemStack stack, Player player, Level world, BlockPos if (!usedRod) { usedRod = true; } + player.level().levelEvent(1505, pos, 0); player.level().playSound(null, player.blockPosition(), SoundEvents.EXPERIENCE_ORB_PICKUP, SoundSource.NEUTRAL, 0.1F, 0.5F * (RandHelper.getRandomMinusOneToOne(player.level().random) * 0.7F + 1.2F)); } } @@ -275,13 +226,6 @@ private void boneMealBlock(ItemStack stack, Player player, Level world, BlockPos } public int getBoneMealCount(ItemStack stack) { - return getBoneMealCount(stack, false); - } - - public int getBoneMealCount(ItemStack stack, boolean isClient) { - if (isClient) { - return NBTHelper.getContainedStackCount(stack, 0); - } return getFromHandler(stack, HarvestRodItemStackHandler::getBoneMealCount).orElse(0); } @@ -294,30 +238,19 @@ private void runOnHandler(ItemStack harvestRod, Consumer { - h.setBoneMealCount(boneMealCount); - updateContainedItemNBT(harvestRod, (short) 0, ItemStack.EMPTY, boneMealCount); - }); + runOnHandler(harvestRod, h -> h.setBoneMealCount(boneMealCount)); } private int incrementPlantable(ItemStack harvestRod, ItemStack plantable, int maxCount) { return getFromHandler(harvestRod, h -> { ItemStack plantableCopy = plantable.copy(); plantableCopy.setCount(Math.min(maxCount, plantableCopy.getCount())); - return h.insertPlantable(plantableCopy).map(plantableSlotInserted -> { - updateContainedItemNBT(harvestRod, (short) plantableSlotInserted.getSlot(), plantableCopy, getPlantableQuantity(harvestRod, plantableSlotInserted.getSlot())); - return plantableSlotInserted.getCountInserted(); - }).orElse(0); + return h.insertPlantable(plantableCopy).map(HarvestRodItemStackHandler.PlantableSlotInserted::getCountInserted).orElse(0); }).orElse(0); } - private void updateContainedItemNBT(ItemStack harvestRod, short slot, ItemStack stack, int count) { - NBTHelper.updateContainedStack(harvestRod, slot, stack, count); - } - private void decrementPlantable(ItemStack harvestRod, byte slot) { - getFromHandler(harvestRod, h -> h.getStackInSlot(slot).getCount()).flatMap(amount -> setPlantableQuantityAndGetPlantableStack(harvestRod, slot, amount - 1)) - .ifPresent(plantable -> updateContainedItemNBT(harvestRod, slot, plantable, plantable.getCount())); + getFromHandler(harvestRod, h -> h.getStackInSlot(slot).getCount()).ifPresent(amount -> setPlantableQuantity(harvestRod, slot, amount - 1)); } @Override @@ -332,12 +265,6 @@ public InteractionResultHolder use(Level world, Player player, Intera return new InteractionResultHolder<>(InteractionResult.SUCCESS, stack); } - @Override - void toggleEnabled(ItemStack stack) { - super.toggleEnabled(stack); - updateContainedStacks(stack); - } - @Override public int getUseDuration(ItemStack stack) { return 300; @@ -352,7 +279,8 @@ public void releaseUsing(ItemStack harvestRod, Level world, LivingEntity entity, BlockHitResult result = getPlayerPOVHitResult(player.level(), player, ClipContext.Fluid.ANY); if (result.getType() == HitResult.Type.BLOCK) { - harvestRod.getCapability(ModCapabilities.HARVEST_ROD_CACHE, null).ifPresent(IHarvestRodCache::reset); + HarvestRodCache harvestRodCache = harvestRod.getData(ModItems.HARVEST_ROD_CACHE); + harvestRodCache.reset(); BlockPos pos = result.getBlockPos(); switch (getMode(harvestRod)) { @@ -391,14 +319,16 @@ private void removeStackFromCurrent(ItemStack stack, Player player) { if (getMode(stack) == Mode.BONE_MEAL && getBoneMealCount(stack) > 0) { ItemStack boneMealStack = new ItemStack(Items.BONE_MEAL); int numberToAdd = Math.min(boneMealStack.getMaxStackSize(), getBoneMealCount(stack)); - int numberAdded = InventoryHelper.getItemHandlerFrom(player).map(handler -> InventoryHelper.tryToAddToInventory(boneMealStack, handler, numberToAdd)).orElse(0); + IItemHandler playerInventory = InventoryHelper.getItemHandlerFrom(player); + int numberAdded = InventoryHelper.tryToAddToInventory(boneMealStack, playerInventory, numberToAdd); setBoneMealCount(stack, getBoneMealCount(stack) - numberAdded); } else if (getMode(stack) == Mode.PLANTABLE) { byte plantableSlot = getCurrentPlantableSlot(stack); ItemStack plantableStack = getCurrentPlantable(stack); int plantableQuantity = getPlantableQuantity(stack, plantableSlot); int numberToAdd = Math.min(plantableStack.getMaxStackSize(), plantableQuantity); - int numberAdded = InventoryHelper.getItemHandlerFrom(player).map(handler -> InventoryHelper.tryToAddToInventory(plantableStack, handler, numberToAdd)).orElse(0); + IItemHandler playerInventory = InventoryHelper.getItemHandlerFrom(player); + int numberAdded = InventoryHelper.tryToAddToInventory(plantableStack, playerInventory, numberToAdd); int updatedPlantableQuantity = getPlantableQuantity(stack, plantableSlot) - numberAdded; @@ -430,28 +360,12 @@ private void plantItem(ItemStack harvestRod, Player player, BlockPos pos, Intera } } - private ItemStack getCurrentPlantable(ItemStack harvestRod) { - return getCurrentPlantable(harvestRod, false); - } - - public ItemStack getCurrentPlantable(ItemStack harvestRod, boolean isClient) { + public ItemStack getCurrentPlantable(ItemStack harvestRod) { int currentSlot = getCurrentPlantableSlot(harvestRod); - if (isClient) { - return NBTHelper.getContainedStack(harvestRod, currentSlot); - } - return getPlantableInSlot(harvestRod, currentSlot); } public ItemStack getPlantableInSlot(ItemStack harvestRod, int slot) { - return getPlantableInSlot(harvestRod, slot, false); - } - - private ItemStack getPlantableInSlot(ItemStack harvestRod, int slot, boolean isClient) { - if (isClient) { - return NBTHelper.getContainedStack(harvestRod, slot); - } - return getFromHandler(harvestRod, h -> h.getStackInSlot(slot)).orElse(ItemStack.EMPTY); } @@ -465,17 +379,17 @@ public void onUseTick(Level level, LivingEntity livingEntity, ItemStack harvestR BlockHitResult result = getPlayerPOVHitResult(player.level(), player, ClipContext.Fluid.ANY); if (result.getType() == HitResult.Type.BLOCK) { Level world = player.level(); - harvestRod.getCapability(ModCapabilities.HARVEST_ROD_CACHE, null) - .ifPresent(cache -> doAction(harvestRod, player, world, cache, result.getBlockPos())); + HarvestRodCache harvestRodCache = harvestRod.getData(ModItems.HARVEST_ROD_CACHE); + doAction(harvestRod, player, world, harvestRodCache, result.getBlockPos()); } } } - private void doAction(ItemStack harvestRod, Player player, Level world, IHarvestRodCache cache, BlockPos pos) { + private void doAction(ItemStack harvestRod, Player player, Level world, HarvestRodCache cache, BlockPos pos) { switch (getMode(harvestRod)) { case BONE_MEAL: if (getBoneMealCount(harvestRod) >= getBonemealCost() || player.isCreative()) { - getNextBlockToBoneMeal(world, cache, pos, Settings.COMMON.items.harvestRod.aoeRadius.get()) + getNextBlockToBoneMeal(world, cache, pos, Config.COMMON.items.harvestRod.aoeRadius.get()) .ifPresent(blockToBoneMeal -> boneMealBlock(harvestRod, player, world, blockToBoneMeal)); } break; @@ -484,12 +398,12 @@ private void doAction(ItemStack harvestRod, Player player, Level world, IHarvest clearPlantableIfNoLongerValid(harvestRod, getCurrentPlantableSlot(harvestRod)); } if (getPlantableQuantity(harvestRod, getCurrentPlantableSlot(harvestRod)) >= 1 || player.isCreative()) { - getNextBlockToPlantOn(world, cache, pos, Settings.COMMON.items.harvestRod.aoeRadius.get(), (IPlantable) ((BlockItem) getCurrentPlantable(harvestRod).getItem()).getBlock()) + getNextBlockToPlantOn(world, cache, pos, Config.COMMON.items.harvestRod.aoeRadius.get(), (IPlantable) ((BlockItem) getCurrentPlantable(harvestRod).getItem()).getBlock()) .ifPresent(blockToPlantOn -> plantItem(harvestRod, player, blockToPlantOn, player.getUsedItemHand())); } break; case HOE: - getNextBlockToHoe(world, cache, pos, Settings.COMMON.items.harvestRod.aoeRadius.get()).ifPresent(blockToHoe -> hoeLand(world, blockToHoe)); + getNextBlockToHoe(world, cache, pos, Config.COMMON.items.harvestRod.aoeRadius.get()).ifPresent(blockToHoe -> hoeLand(world, blockToHoe)); break; default: break; @@ -498,11 +412,11 @@ private void doAction(ItemStack harvestRod, Player player, Level world, IHarvest public void clearPlantableIfNoLongerValid(ItemStack harvestRod, byte slot) { if (getPlantableInSlot(harvestRod, slot).isEmpty()) { - setPlantableQuantityAndGetPlantableStack(harvestRod, slot, 0); + setPlantableQuantity(harvestRod, slot, 0); } } - private Optional getNextBlockToHoe(Level world, IHarvestRodCache cache, BlockPos pos, int range) { + private Optional getNextBlockToHoe(Level world, HarvestRodCache cache, BlockPos pos, int range) { if (cache.isQueueEmpty() || !pos.equals(cache.getStartBlockPos())) { fillQueue(cache, pos, range, currentPos -> { BlockState blockState = world.getBlockState(currentPos); @@ -515,7 +429,7 @@ private Optional getNextBlockToHoe(Level world, IHarvestRodCache cache return cache.getNextBlockInQueue(); } - private void fillQueue(IHarvestRodCache cache, BlockPos pos, int range, Predicate isValidBlock) { + private void fillQueue(HarvestRodCache cache, BlockPos pos, int range, Predicate isValidBlock) { cache.setStartBlockPos(pos); cache.clearBlockQueue(); BlockPos.betweenClosedStream(pos.offset(-range, -range, -range), pos.offset(range, range, range)) @@ -526,7 +440,7 @@ private void fillQueue(IHarvestRodCache cache, BlockPos pos, int range, Predicat }); } - private Optional getNextBlockToPlantOn(Level world, IHarvestRodCache cache, BlockPos pos, int range, IPlantable plantable) { + private Optional getNextBlockToPlantOn(Level world, HarvestRodCache cache, BlockPos pos, int range, IPlantable plantable) { if (cache.isQueueEmpty() || !pos.equals(cache.getStartBlockPos())) { fillQueueToPlant(world, cache, pos, range, plantable); } @@ -534,7 +448,7 @@ private Optional getNextBlockToPlantOn(Level world, IHarvestRodCache c return cache.getNextBlockInQueue(); } - private void fillQueueToPlant(Level world, IHarvestRodCache cache, BlockPos pos, int range, IPlantable plantable) { + private void fillQueueToPlant(Level world, HarvestRodCache cache, BlockPos pos, int range, IPlantable plantable) { boolean checkerboard = false; boolean bothOddOrEven = false; @@ -563,14 +477,14 @@ public InteractionResult onMouseScrolled(ItemStack stack, Player player, double } private boolean isCoolDownOver(ItemStack stack, int count) { - return getUseDuration(stack) - count >= AOE_START_COOLDOWN && (getUseDuration(stack) - count) % Settings.COMMON.items.harvestRod.aoeCooldown.get() == 0; + return getUseDuration(stack) - count >= AOE_START_COOLDOWN && (getUseDuration(stack) - count) % Config.COMMON.items.harvestRod.aoeCooldown.get() == 0; } - private Optional getNextBlockToBoneMeal(Level world, IHarvestRodCache cache, BlockPos pos, int range) { + private Optional getNextBlockToBoneMeal(Level world, HarvestRodCache cache, BlockPos pos, int range) { if (cache.isQueueEmpty() || !pos.equals(cache.getStartBlockPos())) { fillQueue(cache, pos, range, currentPos -> { BlockState blockState = world.getBlockState(currentPos); - return blockState.getBlock() instanceof BonemealableBlock bonemealableBlock && bonemealableBlock.isValidBonemealTarget(world, currentPos, blockState, world.isClientSide); + return blockState.getBlock() instanceof BonemealableBlock bonemealableBlock && bonemealableBlock.isValidBonemealTarget(world, currentPos, blockState); }); } @@ -620,14 +534,6 @@ private void setNextMode(ItemStack harvestRod, Mode currentMode, int plantableCo } public int getCountPlantable(ItemStack harvestRod) { - return getCountPlantable(harvestRod, false); - } - - private int getCountPlantable(ItemStack harvestRod, boolean isClient) { - if (isClient) { - return NBTHelper.getCountContainedStacks(harvestRod); - } - return getFromHandler(harvestRod, HarvestRodItemStackHandler::getCountPlantable).orElse(0); } @@ -640,51 +546,28 @@ private void setCurrentPlantableSlot(ItemStack stack, byte index) { if (stack.hasTag()) { //noinspection ConstantConditions stack.getTag().putByte(PLANTABLE_INDEX_NBT_TAG, index); - updateContainedStacks(stack); } } private void setMode(ItemStack stack, Mode mode) { NBTHelper.putString(MODE_NBT_TAG, stack, mode.getSerializedName()); - updateContainedStacks(stack); - } - - public void updateContainedStacks(ItemStack stack) { - NBTHelper.removeContainedStacks(stack); - NBTHelper.updateContainedStack(stack, (short) HarvestRodItemStackHandler.BONEMEAL_SLOT, ItemStack.EMPTY, getBoneMealCount(stack)); - for (short slot = 1; slot < getCountPlantable(stack) + 1; slot++) { - NBTHelper.updateContainedStack(stack, slot, getPlantableInSlot(stack, slot), getPlantableQuantity(stack, slot)); - } } public Mode getMode(ItemStack stack) { return NBTHelper.getEnumConstant(stack, MODE_NBT_TAG, Mode::valueOf).orElse(Mode.BONE_MEAL); } - public int getPlantableQuantity(ItemStack harvestRod, int parentSlot) { - return getPlantableQuantity(harvestRod, parentSlot, false); - } - - public int getPlantableQuantity(ItemStack harvestRod, int slot, boolean isClient) { - if (isClient) { - return NBTHelper.getContainedStackCount(harvestRod, slot); - } - + public int getPlantableQuantity(ItemStack harvestRod, int slot) { return getFromHandler(harvestRod, h -> h.getTotalAmount(slot)).orElse(0); } - public Optional setPlantableQuantityAndGetPlantableStack(ItemStack harvestRod, byte plantableSlot, int quantity) { + public void setPlantableQuantity(ItemStack harvestRod, byte plantableSlot, int quantity) { runOnHandler(harvestRod, h -> h.setTotalCount(plantableSlot, quantity)); if (quantity == 0) { shiftModeOnEmptyPlantable(harvestRod, plantableSlot); - return Optional.empty(); + return; } - return getFromHandler(harvestRod, h -> h.getStackInSlot(plantableSlot)); - } - - private void setPlantableQuantity(ItemStack harvestRod, byte plantableSlot, int quantity) { - setPlantableQuantityAndGetPlantableStack(harvestRod, plantableSlot, quantity) - .ifPresent(plantableStack -> updateContainedItemNBT(harvestRod, plantableSlot, plantableStack, plantableStack.getCount())); + getFromHandler(harvestRod, h -> h.getStackInSlot(plantableSlot)); } public enum Mode implements StringRepresentable { diff --git a/src/main/java/reliquary/items/HeroMedallionItem.java b/src/main/java/reliquary/items/HeroMedallionItem.java index 41042d3c..1707b4d3 100644 --- a/src/main/java/reliquary/items/HeroMedallionItem.java +++ b/src/main/java/reliquary/items/HeroMedallionItem.java @@ -3,7 +3,6 @@ import net.minecraft.ChatFormatting; import net.minecraft.core.BlockPos; import net.minecraft.core.NonNullList; -import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; @@ -20,16 +19,12 @@ import net.minecraft.world.level.Level; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.HitResult; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.common.capabilities.ICapabilityProvider; -import net.minecraftforge.items.IItemHandler; +import net.neoforged.neoforge.items.IItemHandler; import reliquary.api.IPedestal; import reliquary.api.IPedestalActionItem; import reliquary.items.util.IScrollableItem; -import reliquary.items.util.fluid.FluidHandlerHeroMedallion; +import reliquary.reference.Config; import reliquary.reference.Reference; -import reliquary.reference.Settings; import reliquary.util.InventoryHelper; import reliquary.util.NBTHelper; import reliquary.util.TooltipBuilder; @@ -51,7 +46,6 @@ public Rarity getRarity(ItemStack stack) { } @Override - @OnlyIn(Dist.CLIENT) public boolean isFoil(ItemStack stack) { return NBTHelper.getBoolean("enabled", stack); } @@ -62,7 +56,6 @@ public UseAnim getUseAnimation(ItemStack stack) { } @Override - @OnlyIn(Dist.CLIENT) protected void addMoreInformation(ItemStack medallion, @Nullable Level world, TooltipBuilder tooltipBuilder) { int experience = NBTHelper.getInt(EXPERIENCE_TAG, medallion); int levels = XpHelper.getLevelForExperience(experience); @@ -104,12 +97,18 @@ private void drainExperienceLevel(ItemStack stack, Player player) { } private void decreasePlayerExperience(Player player, int pointsToRemove) { + correctTotalExperience(player); player.totalExperience -= pointsToRemove; int newLevel = XpHelper.getLevelForExperience(player.totalExperience); player.experienceLevel = newLevel; player.experienceProgress = (float) (player.totalExperience - XpHelper.getExperienceForLevel(newLevel)) / player.getXpNeededForNextLevel(); } + private static void correctTotalExperience(Player player) { + //even vanilla doesn't seem to update this value properly when removing levels for enchanting / in anvil so fixing before working with it + player.totalExperience = XpHelper.getExperienceForLevel(player.experienceLevel) + (int) (XpHelper.getExperienceLimitOnLevel(player.experienceLevel) * player.experienceProgress); + } + private void decreaseMedallionExperience(ItemStack stack, int experience) { setExperience(stack, getExperience(stack) - experience); } @@ -185,20 +184,15 @@ private void spawnXpOnGround(ItemStack stack, Level world, BlockPos hitPos, int } } - @Override - public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable CompoundTag nbt) { - return new FluidHandlerHeroMedallion(stack); - } - @Override public void update(ItemStack stack, Level level, IPedestal pedestal) { - List posInRange = pedestal.getPedestalsInRange(level, Settings.COMMON.items.heroMedallion.pedestalRange.get()); + List posInRange = pedestal.getPedestalsInRange(level, Config.COMMON.items.heroMedallion.pedestalRange.get()); for (BlockPos pedestalPos : posInRange) { - InventoryHelper.getInventoryAtPos(level, pedestalPos).ifPresent(pedestalInventory -> { + InventoryHelper.runOnInventoryAt(level, pedestalPos, pedestalInventory -> { List toRepair = getMendingItemsForRepair(pedestalInventory); for (ItemStack itemToRepair : toRepair) { - int xpToRepair = Math.min(Settings.COMMON.items.heroMedallion.pedestalRepairStepXP.get(), getExperience(stack)); + int xpToRepair = Math.min(Config.COMMON.items.heroMedallion.pedestalRepairStepXP.get(), getExperience(stack)); int durabilityToRepair = Math.min(XpHelper.xpToDurability(xpToRepair), itemToRepair.getDamageValue()); setExperience(stack, getExperience(stack) - XpHelper.durabilityToXp(durabilityToRepair)); @@ -206,7 +200,7 @@ public void update(ItemStack stack, Level level, IPedestal pedestal) { } }); } - pedestal.setActionCoolDown(Settings.COMMON.items.heroMedallion.pedestalCoolDown.get()); + pedestal.setActionCoolDown(Config.COMMON.items.heroMedallion.pedestalCoolDown.get()); } private List getMendingItemsForRepair(IItemHandler inventory) { diff --git a/src/main/java/reliquary/items/HolyHandGrenadeItem.java b/src/main/java/reliquary/items/HolyHandGrenadeItem.java index e5a8d0b4..9d9bbf22 100644 --- a/src/main/java/reliquary/items/HolyHandGrenadeItem.java +++ b/src/main/java/reliquary/items/HolyHandGrenadeItem.java @@ -9,8 +9,6 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Rarity; import net.minecraft.world.level.Level; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; import reliquary.entities.HolyHandGrenadeEntity; public class HolyHandGrenadeItem extends ItemBase { @@ -25,7 +23,6 @@ public Rarity getRarity(ItemStack stack) { } @Override - @OnlyIn(Dist.CLIENT) public boolean isFoil(ItemStack stack) { return true; } diff --git a/src/main/java/reliquary/items/IceMagusRodItem.java b/src/main/java/reliquary/items/IceMagusRodItem.java index 17d7f8b6..c8752509 100644 --- a/src/main/java/reliquary/items/IceMagusRodItem.java +++ b/src/main/java/reliquary/items/IceMagusRodItem.java @@ -12,11 +12,9 @@ import net.minecraft.world.item.Items; import net.minecraft.world.item.Rarity; import net.minecraft.world.level.Level; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; import org.joml.Vector3f; import reliquary.entities.SpecialSnowballEntity; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.NBTHelper; import reliquary.util.TooltipBuilder; @@ -31,7 +29,6 @@ public IceMagusRodItem() { } @Override - @OnlyIn(Dist.CLIENT) protected void addMoreInformation(ItemStack rod, @Nullable Level world, TooltipBuilder tooltipBuilder) { tooltipBuilder.charge(this, ".tooltip2", getSnowballCharge(rod)); if (isEnabled(rod)) { @@ -51,15 +48,15 @@ protected boolean hasMoreInformation(ItemStack stack) { } private int getSnowballCap() { - return this instanceof GlacialStaffItem ? Settings.COMMON.items.glacialStaff.snowballLimit.get() : Settings.COMMON.items.iceMagusRod.snowballLimit.get(); + return this instanceof GlacialStaffItem ? Config.COMMON.items.glacialStaff.snowballLimit.get() : Config.COMMON.items.iceMagusRod.snowballLimit.get(); } int getSnowballCost() { - return this instanceof GlacialStaffItem ? Settings.COMMON.items.glacialStaff.snowballCost.get() : Settings.COMMON.items.iceMagusRod.snowballCost.get(); + return this instanceof GlacialStaffItem ? Config.COMMON.items.glacialStaff.snowballCost.get() : Config.COMMON.items.iceMagusRod.snowballCost.get(); } private int getSnowballWorth() { - return this instanceof GlacialStaffItem ? Settings.COMMON.items.glacialStaff.snowballWorth.get() : Settings.COMMON.items.iceMagusRod.snowballWorth.get(); + return this instanceof GlacialStaffItem ? Config.COMMON.items.glacialStaff.snowballWorth.get() : Config.COMMON.items.iceMagusRod.snowballWorth.get(); } @Override diff --git a/src/main/java/reliquary/items/InfernalChaliceItem.java b/src/main/java/reliquary/items/InfernalChaliceItem.java index 509e9da8..97c5a3ec 100644 --- a/src/main/java/reliquary/items/InfernalChaliceItem.java +++ b/src/main/java/reliquary/items/InfernalChaliceItem.java @@ -2,7 +2,6 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; -import net.minecraft.nbt.CompoundTag; import net.minecraft.tags.DamageTypeTags; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; @@ -17,22 +16,17 @@ import net.minecraft.world.level.material.Fluids; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.HitResult; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.capabilities.ICapabilityProvider; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.event.entity.living.LivingAttackEvent; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidType; -import net.minecraftforge.fluids.capability.IFluidHandler; -import net.minecraftforge.fluids.capability.IFluidHandlerItem; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.event.entity.living.LivingAttackEvent; +import net.neoforged.neoforge.fluids.FluidStack; +import net.neoforged.neoforge.fluids.FluidType; +import net.neoforged.neoforge.fluids.capability.IFluidHandler; +import net.neoforged.neoforge.fluids.capability.IFluidHandlerItem; import reliquary.handler.CommonEventHandler; import reliquary.handler.HandlerPriority; import reliquary.handler.IPlayerHurtHandler; import reliquary.init.ModItems; -import reliquary.items.util.fluid.FluidHandlerInfernalChalice; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.InventoryHelper; import reliquary.util.NBTHelper; import reliquary.util.TooltipBuilder; @@ -53,7 +47,7 @@ public boolean canApply(Player player, LivingAttackEvent event) { @Override public boolean apply(Player player, LivingAttackEvent event) { - player.causeFoodExhaustion(event.getAmount() * ((float) Settings.COMMON.items.infernalChalice.hungerCostPercent.get() / 100F)); + player.causeFoodExhaustion(event.getAmount() * ((float) Config.COMMON.items.infernalChalice.hungerCostPercent.get() / 100F)); return true; } @@ -65,7 +59,6 @@ public HandlerPriority getPriority() { } @Override - @OnlyIn(Dist.CLIENT) protected void addMoreInformation(ItemStack chalice, @Nullable Level world, TooltipBuilder tooltipBuilder) { tooltipBuilder.charge(this, ".tooltip2", NBTHelper.getInt("fluidStacks", chalice)); if (isEnabled(chalice)) { @@ -102,7 +95,12 @@ public InteractionResultHolder use(Level world, Player player, Intera return new InteractionResultHolder<>(InteractionResult.PASS, stack); } - return getFluidHandler(stack).map(fluidHandler -> interactWithFluidHandler(world, player, stack, pos, face, fluidHandler)).orElse(new InteractionResultHolder<>(InteractionResult.FAIL, stack)); + IFluidHandlerItem fluidHandler = stack.getCapability(Capabilities.FluidHandler.ITEM); + if (fluidHandler == null) { + return new InteractionResultHolder<>(InteractionResult.FAIL, stack); + } + + return interactWithFluidHandler(world, player, stack, pos, face, fluidHandler); } } @@ -127,10 +125,6 @@ private InteractionResultHolder interactWithFluidHandler(Level world, return new InteractionResultHolder<>(InteractionResult.PASS, stack); } - private LazyOptional getFluidHandler(ItemStack stack) { - return stack.getCapability(ForgeCapabilities.FLUID_HANDLER_ITEM, null); - } - private boolean tryPlaceContainedLiquid(Level world, BlockPos pos) { BlockState blockState = world.getBlockState(pos); if (!world.isEmptyBlock(pos) && blockState.isSolid()) { @@ -140,9 +134,4 @@ private boolean tryPlaceContainedLiquid(Level world, BlockPos pos) { return true; } } - - @Override - public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable CompoundTag nbt) { - return new FluidHandlerInfernalChalice(stack); - } } diff --git a/src/main/java/reliquary/items/InfernalClawsItem.java b/src/main/java/reliquary/items/InfernalClawsItem.java index a2a1f46e..59c999d0 100644 --- a/src/main/java/reliquary/items/InfernalClawsItem.java +++ b/src/main/java/reliquary/items/InfernalClawsItem.java @@ -4,14 +4,12 @@ import net.minecraft.network.chat.MutableComponent; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.event.entity.living.LivingAttackEvent; +import net.neoforged.neoforge.event.entity.living.LivingAttackEvent; import reliquary.handler.CommonEventHandler; import reliquary.handler.HandlerPriority; import reliquary.handler.IPlayerHurtHandler; import reliquary.init.ModItems; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.InventoryHelper; public class InfernalClawsItem extends ItemBase { @@ -29,7 +27,7 @@ public boolean canApply(Player player, LivingAttackEvent event) { @Override public boolean apply(Player player, LivingAttackEvent event) { - player.causeFoodExhaustion(event.getAmount() * ((float) Settings.COMMON.items.infernalClaws.hungerCostPercent.get() / 100F)); + player.causeFoodExhaustion(event.getAmount() * ((float) Config.COMMON.items.infernalClaws.hungerCostPercent.get() / 100F)); return true; } @@ -46,7 +44,6 @@ public MutableComponent getName(ItemStack stack) { } @Override - @OnlyIn(Dist.CLIENT) public boolean isFoil(ItemStack stack) { return true; } diff --git a/src/main/java/reliquary/items/InfernalTearItem.java b/src/main/java/reliquary/items/InfernalTearItem.java index 358a92f8..94d464a7 100644 --- a/src/main/java/reliquary/items/InfernalTearItem.java +++ b/src/main/java/reliquary/items/InfernalTearItem.java @@ -13,12 +13,10 @@ import net.minecraft.world.item.Rarity; import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.Level; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.items.IItemHandler; -import net.minecraftforge.items.ItemHandlerHelper; +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.items.ItemHandlerHelper; +import reliquary.reference.Config; import reliquary.reference.Reference; -import reliquary.reference.Settings; import reliquary.util.InventoryHelper; import reliquary.util.NBTHelper; import reliquary.util.RegistryHelper; @@ -54,7 +52,7 @@ public void inventoryTick(ItemStack stack, Level world, Entity entity, int itemS return; } - Optional experience = Settings.COMMON.items.infernalTear.getItemExperience(RegistryHelper.getItemRegistryName(tearStack.getItem())); + Optional experience = Config.COMMON.items.infernalTear.getItemExperience(RegistryHelper.getItemRegistryName(tearStack.getItem())); if (experience.isEmpty()) { resetTear(stack); return; @@ -85,7 +83,6 @@ public void appendHoverText(ItemStack stack, @Nullable Level world, List use(Level world, Player player, Intera //if user is sneaking or just enabled the tear, let's fill it if (player.isShiftKeyDown() || !isEnabled(itemStack)) { - ItemStack returnStack = InventoryHelper.getItemHandlerFrom(player).map(handler -> buildTear(itemStack, handler)).orElse(ItemStack.EMPTY); + IItemHandler playerInventory = InventoryHelper.getItemHandlerFrom(player); + ItemStack returnStack = buildTear(itemStack, playerInventory); if (!returnStack.isEmpty()) { return new InteractionResultHolder<>(InteractionResult.SUCCESS, returnStack); } @@ -168,7 +166,7 @@ private ItemStack buildTear(ItemStack stack, IItemHandler inventory) { setTearTarget(tear, target); - if (Boolean.TRUE.equals(Settings.COMMON.items.infernalTear.absorbWhenCreated.get())) { + if (Boolean.TRUE.equals(Config.COMMON.items.infernalTear.absorbWhenCreated.get())) { NBTHelper.putBoolean(ENABLED_TAG, stack, true); } @@ -185,7 +183,7 @@ private ItemStack getTargetAlkahestItem(ItemStack self, IItemHandler inventory) for (int slot = 0; slot < inventory.getSlots(); slot++) { ItemStack stack = inventory.getStackInSlot(slot); if (stack.isEmpty() || self.getItem() == stack.getItem() || stack.getMaxStackSize() == 1 || stack.getTag() != null - || Settings.COMMON.items.infernalTear.getItemExperience(RegistryHelper.getItemRegistryName(stack.getItem())).isEmpty()) { + || Config.COMMON.items.infernalTear.getItemExperience(RegistryHelper.getItemRegistryName(stack.getItem())).isEmpty()) { continue; } if (InventoryHelper.getItemQuantity(stack, inventory) > itemQuantity) { diff --git a/src/main/java/reliquary/items/ItemBase.java b/src/main/java/reliquary/items/ItemBase.java index 598bb206..21944fe2 100644 --- a/src/main/java/reliquary/items/ItemBase.java +++ b/src/main/java/reliquary/items/ItemBase.java @@ -7,8 +7,6 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.Level; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; import reliquary.util.TooltipBuilder; import javax.annotation.Nullable; @@ -46,7 +44,6 @@ public void addCreativeTabItems(Consumer itemConsumer) { } @Override - @OnlyIn(Dist.CLIENT) public void appendHoverText(ItemStack stack, @Nullable Level world, List tooltip, TooltipFlag flag) { TooltipBuilder tooltipBuilder = TooltipBuilder.of(tooltip).itemTooltip(this); @@ -63,7 +60,6 @@ protected boolean hasMoreInformation(ItemStack stack) { return false; } - @OnlyIn(Dist.CLIENT) protected void addMoreInformation(ItemStack stack, @Nullable Level world, TooltipBuilder tooltipBuilder) { //overriden in child classes } diff --git a/src/main/java/reliquary/items/KrakenShellItem.java b/src/main/java/reliquary/items/KrakenShellItem.java index 18b7ca17..63d852f6 100644 --- a/src/main/java/reliquary/items/KrakenShellItem.java +++ b/src/main/java/reliquary/items/KrakenShellItem.java @@ -6,14 +6,12 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.event.entity.living.LivingAttackEvent; +import net.neoforged.neoforge.event.entity.living.LivingAttackEvent; import reliquary.handler.CommonEventHandler; import reliquary.handler.HandlerPriority; import reliquary.handler.IPlayerHurtHandler; import reliquary.init.ModItems; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.InventoryHelper; public class KrakenShellItem extends ItemBase { @@ -30,7 +28,7 @@ public boolean canApply(Player player, LivingAttackEvent event) { @Override public boolean apply(Player player, LivingAttackEvent event) { - float hungerDamage = event.getAmount() * ((float) Settings.COMMON.items.krakenShell.hungerCostPercent.get() / 100F); + float hungerDamage = event.getAmount() * ((float) Config.COMMON.items.krakenShell.hungerCostPercent.get() / 100F); player.causeFoodExhaustion(hungerDamage); return true; } @@ -43,7 +41,6 @@ public HandlerPriority getPriority() { } @Override - @OnlyIn(Dist.CLIENT) public boolean isFoil(ItemStack stack) { return true; } diff --git a/src/main/java/reliquary/items/LanternOfParanoiaItem.java b/src/main/java/reliquary/items/LanternOfParanoiaItem.java index 1d3d4fc7..191f63a6 100644 --- a/src/main/java/reliquary/items/LanternOfParanoiaItem.java +++ b/src/main/java/reliquary/items/LanternOfParanoiaItem.java @@ -5,6 +5,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.particles.ParticleTypes; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.network.chat.MutableComponent; import net.minecraft.resources.ResourceLocation; import net.minecraft.sounds.SoundSource; @@ -19,6 +20,7 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.LightLayer; import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.LiquidBlock; import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.state.BlockState; @@ -26,9 +28,8 @@ import net.minecraft.world.phys.HitResult; import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.shapes.CollisionContext; -import net.minecraftforge.registries.ForgeRegistries; import reliquary.init.ModItems; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.InventoryHelper; import javax.annotation.Nullable; @@ -59,7 +60,7 @@ public Rarity getRarity(ItemStack stack) { } public int getRange() { - return Settings.COMMON.items.lanternOfParanoia.placementScanRadius.get(); + return Config.COMMON.items.lanternOfParanoia.placementScanRadius.get(); } @Override @@ -82,7 +83,7 @@ private Stream getPositionsInRange(Player player) { private boolean tryToPlaceAtPos(ItemStack stack, Level world, Player player, BlockPos pos) { int lightLevel = player.level().getBrightness(LightLayer.BLOCK, pos); - if (lightLevel > Settings.COMMON.items.lanternOfParanoia.minLightLevel.get()) { + if (lightLevel > Config.COMMON.items.lanternOfParanoia.minLightLevel.get()) { return false; } @@ -128,7 +129,7 @@ private boolean tryToPlaceTorchAround(ItemStack stack, BlockPos pos, Player play return false; } - for (String torchRegistryName : Settings.COMMON.items.lanternOfParanoia.torches.get()) { + for (String torchRegistryName : Config.COMMON.items.lanternOfParanoia.torches.get()) { if (getTorchBlock(torchRegistryName).map(torch -> tryToPlaceTorchBlock(stack, pos, player, world, torch)).orElse(false)) { return true; } @@ -177,7 +178,11 @@ private boolean findAndDrainSojournersStaff(Player player, Item torchItem) { } private Optional getTorchBlock(String registryName) { - return Optional.ofNullable(TORCH_BLOCKS.computeIfAbsent(registryName, rn -> ForgeRegistries.BLOCKS.getValue(new ResourceLocation(rn)))); + Block block = BuiltInRegistries.BLOCK.get(new ResourceLocation(registryName)); + if (block == Blocks.AIR) { + return Optional.empty(); + } + return Optional.of(TORCH_BLOCKS.computeIfAbsent(registryName, rn -> BuiltInRegistries.BLOCK.get(new ResourceLocation(rn)))); } @Nullable diff --git a/src/main/java/reliquary/items/MagicbaneItem.java b/src/main/java/reliquary/items/MagicbaneItem.java index c5701d03..3308e314 100644 --- a/src/main/java/reliquary/items/MagicbaneItem.java +++ b/src/main/java/reliquary/items/MagicbaneItem.java @@ -11,16 +11,10 @@ import net.minecraft.world.entity.ai.attributes.Attribute; import net.minecraft.world.entity.ai.attributes.AttributeModifier; import net.minecraft.world.entity.ai.attributes.Attributes; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Rarity; -import net.minecraft.world.item.SwordItem; -import net.minecraft.world.item.Tiers; -import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.item.*; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; import reliquary.util.TooltipBuilder; import javax.annotation.Nullable; @@ -45,7 +39,6 @@ public Rarity getRarity(ItemStack stack) { } @Override - @OnlyIn(Dist.CLIENT) public boolean isFoil(ItemStack stack) { return true; } diff --git a/src/main/java/reliquary/items/MercyCrossItem.java b/src/main/java/reliquary/items/MercyCrossItem.java index 4bcf3723..ac4147ac 100644 --- a/src/main/java/reliquary/items/MercyCrossItem.java +++ b/src/main/java/reliquary/items/MercyCrossItem.java @@ -5,26 +5,16 @@ import net.minecraft.ChatFormatting; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.network.chat.Component; -import net.minecraft.world.entity.Entity; -import net.minecraft.world.entity.EquipmentSlot; -import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.entity.Mob; -import net.minecraft.world.entity.MobType; +import net.minecraft.world.entity.*; import net.minecraft.world.entity.ai.attributes.Attribute; import net.minecraft.world.entity.ai.attributes.AttributeInstance; import net.minecraft.world.entity.ai.attributes.AttributeModifier; import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Rarity; -import net.minecraft.world.item.SwordItem; -import net.minecraft.world.item.Tiers; -import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.item.*; import net.minecraft.world.level.Level; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.player.AttackEntityEvent; +import net.neoforged.neoforge.common.NeoForge; +import net.neoforged.neoforge.event.entity.player.AttackEntityEvent; import javax.annotation.Nullable; import java.util.List; @@ -35,7 +25,7 @@ public class MercyCrossItem extends SwordItem implements ICreativeTabItemGenerat public MercyCrossItem() { super(Tiers.GOLD, 3, -2.4F, new Properties().stacksTo(1).durability(64)); - MinecraftForge.EVENT_BUS.addListener(this::handleDamage); + NeoForge.EVENT_BUS.addListener(this::handleDamage); } @Override @@ -49,7 +39,6 @@ public Rarity getRarity(ItemStack stack) { } @Override - @OnlyIn(Dist.CLIENT) public void appendHoverText(ItemStack cross, @Nullable Level world, List tooltip, TooltipFlag flag) { tooltip.add(Component.translatable(getDescriptionId() + ".tooltip").withStyle(ChatFormatting.GRAY)); } diff --git a/src/main/java/reliquary/items/MidasTouchstoneItem.java b/src/main/java/reliquary/items/MidasTouchstoneItem.java index c378ec49..71a54d34 100644 --- a/src/main/java/reliquary/items/MidasTouchstoneItem.java +++ b/src/main/java/reliquary/items/MidasTouchstoneItem.java @@ -3,20 +3,10 @@ import com.google.common.collect.ImmutableMap; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.ArmorItem; -import net.minecraft.world.item.ArmorMaterial; -import net.minecraft.world.item.ArmorMaterials; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Items; -import net.minecraft.world.item.Rarity; -import net.minecraft.world.item.Tier; -import net.minecraft.world.item.TieredItem; -import net.minecraft.world.item.Tiers; +import net.minecraft.world.item.*; import net.minecraft.world.level.Level; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import reliquary.reference.Settings; +import net.neoforged.neoforge.items.IItemHandler; +import reliquary.reference.Config; import reliquary.util.InventoryHelper; import reliquary.util.NBTHelper; import reliquary.util.RegistryHelper; @@ -45,7 +35,6 @@ public MidasTouchstoneItem() { } @Override - @OnlyIn(Dist.CLIENT) protected void addMoreInformation(ItemStack touchstone, @Nullable Level world, TooltipBuilder tooltipBuilder) { tooltipBuilder.charge(this, ".tooltip2", NBTHelper.getInt(GLOWSTONE_TAG, touchstone)); if (isEnabled(touchstone)) { @@ -81,20 +70,22 @@ public void inventoryTick(ItemStack stack, Level world, Entity e, int i, boolean } private void doRepairAndDamageTouchstone(ItemStack touchstone, Player player) { - List goldItems = Settings.COMMON.items.midasTouchstone.goldItems.get(); + List goldItems = Config.COMMON.items.midasTouchstone.goldItems.get(); - InventoryHelper.getItemHandlerFrom(player, null).ifPresent(itemHandler -> { - for (int slot = 0; slot < itemHandler.getSlots(); slot++) { - ItemStack stack = itemHandler.getStackInSlot(slot); - Item item = stack.getItem(); - - if (stack.getDamageValue() <= 0 || !stack.getItem().canBeDepleted()) { - continue; - } + IItemHandler playerInventory = InventoryHelper.getItemHandlerFrom(player, null); + if (playerInventory == null) { + return; + } + for (int slot = 0; slot < playerInventory.getSlots(); slot++) { + ItemStack stack = playerInventory.getStackInSlot(slot); + Item item = stack.getItem(); - tryRepairingItem(touchstone, player, goldItems, stack, item); + if (stack.getDamageValue() <= 0 || !stack.getItem().canBeDepleted()) { + continue; } - }); + + tryRepairingItem(touchstone, player, goldItems, stack, item); + } } private void tryRepairingItem(ItemStack touchstone, Player player, List goldItems, ItemStack stack, Item item) { @@ -122,15 +113,15 @@ private boolean reduceTouchStoneCharge(ItemStack stack, Player player) { } private int getGlowStoneCost() { - return Settings.COMMON.items.midasTouchstone.glowstoneCost.get(); + return Config.COMMON.items.midasTouchstone.glowstoneCost.get(); } private int getGlowStoneWorth() { - return Settings.COMMON.items.midasTouchstone.glowstoneWorth.get(); + return Config.COMMON.items.midasTouchstone.glowstoneWorth.get(); } private int getGlowstoneLimit() { - return Settings.COMMON.items.midasTouchstone.glowstoneLimit.get(); + return Config.COMMON.items.midasTouchstone.glowstoneLimit.get(); } private Optional getRepairableItem(Class item) { diff --git a/src/main/java/reliquary/items/MobCharmBeltItem.java b/src/main/java/reliquary/items/MobCharmBeltItem.java index 1c3c3867..a752ea4e 100644 --- a/src/main/java/reliquary/items/MobCharmBeltItem.java +++ b/src/main/java/reliquary/items/MobCharmBeltItem.java @@ -14,10 +14,9 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; -import net.minecraftforge.network.NetworkHooks; import reliquary.common.gui.MobCharmBeltMenu; import reliquary.items.util.ICuriosItem; -import reliquary.reference.Settings; +import reliquary.reference.Config; public class MobCharmBeltItem extends ItemBase implements ICuriosItem { private static final String SLOTS_TAG = "Slots"; @@ -52,7 +51,7 @@ public InteractionResultHolder use(Level world, Player player, Intera } if (!world.isClientSide && player instanceof ServerPlayer serverPlayer) { - NetworkHooks.openScreen(serverPlayer, new SimpleMenuProvider((w, p, pl) -> new MobCharmBeltMenu(w, p, stack), stack.getHoverName()), buf -> buf.writeBoolean(hand == InteractionHand.MAIN_HAND)); + serverPlayer.openMenu(new SimpleMenuProvider((w, p, pl) -> new MobCharmBeltMenu(w, p, stack), stack.getHoverName()), buf -> buf.writeBoolean(hand == InteractionHand.MAIN_HAND)); } return new InteractionResultHolder<>(InteractionResult.SUCCESS, stack); @@ -164,7 +163,7 @@ ItemStack damageCharm(Player player, ItemStack belt, String entityRegistryName) ItemStack charmStack = ItemStack.of(mobCharms.getCompound(i)); if (MobCharmItem.isCharmFor(charmStack, entityRegistryName)) { - charmStack.hurtAndBreak(Settings.COMMON.items.mobCharm.damagePerKill.get(), player, p -> p.broadcastBreakEvent(EquipmentSlot.CHEST)); + charmStack.hurtAndBreak(Config.COMMON.items.mobCharm.damagePerKill.get(), player, p -> p.broadcastBreakEvent(EquipmentSlot.CHEST)); if (charmStack.isEmpty()) { removeMobCharmInSlot(belt, i); return ItemStack.EMPTY; diff --git a/src/main/java/reliquary/items/MobCharmDefinition.java b/src/main/java/reliquary/items/MobCharmDefinition.java index c2745658..4dbaf055 100644 --- a/src/main/java/reliquary/items/MobCharmDefinition.java +++ b/src/main/java/reliquary/items/MobCharmDefinition.java @@ -15,21 +15,20 @@ public class MobCharmDefinition { static final MobCharmDefinition WITHER_SKELETON = new MobCharmDefinition("minecraft:wither_skeleton", ModItems.WITHERED_RIB.get(), "minecraft:wither_skeleton"); static final MobCharmDefinition CREEPER = new MobCharmDefinition("minecraft:creeper", ModItems.CATALYZING_GLAND.get(), "minecraft:creeper"); static final MobCharmDefinition WITCH = new MobCharmDefinition("minecraft:witch", ModItems.WITCH_HAT.get(), "minecraft:witch"); - static final MobCharmDefinition ZOMBIFIED_PIGLIN = new MobCharmDefinition("minecraft:zombified_piglin", ModItems.ZOMBIE_HEART.get(), "minecraft:zombified_piglin").setResetTargetInLivingTickEvent(true); + static final MobCharmDefinition ZOMBIFIED_PIGLIN = new MobCharmDefinition("minecraft:zombified_piglin", ModItems.ZOMBIE_HEART.get(), "minecraft:zombified_piglin"); static final MobCharmDefinition CAVE_SPIDER = new MobCharmDefinition("minecraft:cave_spider", ModItems.CHELICERAE.get(), "minecraft:cave_spider"); static final MobCharmDefinition SPIDER = new MobCharmDefinition("minecraft:spider", ModItems.CHELICERAE.get(), "minecraft:spider"); - static final MobCharmDefinition ENDERMAN = new MobCharmDefinition("minecraft:enderman", ModItems.NEBULOUS_HEART.get(), "minecraft:enderman").setResetTargetInLivingTickEvent(true); - static final MobCharmDefinition GHAST = new MobCharmDefinition("minecraft:ghast", ModItems.CATALYZING_GLAND.get(), "minecraft:ghast").setResetTargetInLivingTickEvent(true); - static final MobCharmDefinition SLIME = new MobCharmDefinition("minecraft:slime", ModItems.SLIME_PEARL.get(), "minecraft:slime").setResetTargetInLivingTickEvent(true); - static final MobCharmDefinition MAGMA_CUBE = new MobCharmDefinition("minecraft:magma_cube", ModItems.MOLTEN_CORE.get(), "minecraft:magma_cube").setResetTargetInLivingTickEvent(true); + static final MobCharmDefinition ENDERMAN = new MobCharmDefinition("minecraft:enderman", ModItems.NEBULOUS_HEART.get(), "minecraft:enderman"); + static final MobCharmDefinition GHAST = new MobCharmDefinition("minecraft:ghast", ModItems.CATALYZING_GLAND.get(), "minecraft:ghast"); + static final MobCharmDefinition SLIME = new MobCharmDefinition("minecraft:slime", ModItems.SLIME_PEARL.get(), "minecraft:slime"); + static final MobCharmDefinition MAGMA_CUBE = new MobCharmDefinition("minecraft:magma_cube", ModItems.MOLTEN_CORE.get(), "minecraft:magma_cube"); static final MobCharmDefinition BLAZE = new MobCharmDefinition("minecraft:blaze", ModItems.MOLTEN_CORE.get(), "minecraft:blaze"); static final MobCharmDefinition GUARDIAN = new MobCharmDefinition("minecraft:guardian", ModItems.GUARDIAN_SPIKE.get(), "minecraft:guardian"); - static final MobCharmDefinition PIGLIN = new MobCharmDefinition("minecraft:piglin", null, "minecraft:piglin").setResetTargetInLivingTickEvent(true); - static final MobCharmDefinition PIGLIN_BRUTE = new MobCharmDefinition("minecraft:piglin_brute", null, "minecraft:piglin_brute").setResetTargetInLivingTickEvent(true); - static final MobCharmDefinition HOGLIN = new MobCharmDefinition("minecraft:hoglin", null, "minecraft:hoglin").setResetTargetInLivingTickEvent(true); + static final MobCharmDefinition PIGLIN = new MobCharmDefinition("minecraft:piglin", null, "minecraft:piglin"); + static final MobCharmDefinition PIGLIN_BRUTE = new MobCharmDefinition("minecraft:piglin_brute", null, "minecraft:piglin_brute"); + static final MobCharmDefinition HOGLIN = new MobCharmDefinition("minecraft:hoglin", null, "minecraft:hoglin"); private final Set applicableToEntities = new HashSet<>(); - private boolean resetTargetInLivingTickEvent = false; private final String registryName; private final Item repairItem; private boolean dynamicallyCreated = false; @@ -49,15 +48,6 @@ public String getRegistryName() { return registryName; } - public MobCharmDefinition setResetTargetInLivingTickEvent(boolean resetTargetInLivingTickEvent) { - this.resetTargetInLivingTickEvent = resetTargetInLivingTickEvent; - return this; - } - - public boolean resetTargetInLivingTickEvent() { - return resetTargetInLivingTickEvent; - } - public Set getEntities() { return applicableToEntities; } diff --git a/src/main/java/reliquary/items/MobCharmFragmentItem.java b/src/main/java/reliquary/items/MobCharmFragmentItem.java index 5c1011ef..033b2640 100644 --- a/src/main/java/reliquary/items/MobCharmFragmentItem.java +++ b/src/main/java/reliquary/items/MobCharmFragmentItem.java @@ -1,12 +1,11 @@ package reliquary.items; import net.minecraft.ChatFormatting; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.entity.EntityType; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.registries.ForgeRegistries; import reliquary.util.NBTHelper; import java.util.function.Consumer; @@ -39,10 +38,9 @@ public static ResourceLocation getEntityEggRegistryName(ItemStack charm) { @Override public MutableComponent getName(ItemStack stack) { - EntityType entityType = ForgeRegistries.ENTITY_TYPES.getValue(getEntityEggRegistryName(stack)); - if (entityType == null) { - return super.getName(stack); - } - return Component.translatable(getDescriptionId(), entityType.getDescription().getString()).withStyle(ChatFormatting.GREEN); + ResourceLocation entityEggRegistryName = getEntityEggRegistryName(stack); + return BuiltInRegistries.ENTITY_TYPE.getOptional(entityEggRegistryName) + .map(entityType -> Component.translatable(getDescriptionId(), entityType.getDescription().getString()).withStyle(ChatFormatting.GREEN)) + .orElseGet(() -> super.getName(stack)); } } diff --git a/src/main/java/reliquary/items/MobCharmItem.java b/src/main/java/reliquary/items/MobCharmItem.java index 05e5dca5..07599460 100644 --- a/src/main/java/reliquary/items/MobCharmItem.java +++ b/src/main/java/reliquary/items/MobCharmItem.java @@ -2,11 +2,11 @@ import net.minecraft.ChatFormatting; import net.minecraft.core.BlockPos; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.Mob; import net.minecraft.world.entity.player.Player; @@ -15,20 +15,17 @@ import net.minecraft.world.item.enchantment.Enchantment; import net.minecraft.world.item.enchantment.EnchantmentCategory; import net.minecraft.world.level.Level; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.FakePlayer; -import net.minecraftforge.event.entity.living.LivingChangeTargetEvent; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.living.LivingEvent; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.neoforge.common.NeoForge; +import net.neoforged.neoforge.common.util.FakePlayer; +import net.neoforged.neoforge.event.entity.living.LivingChangeTargetEvent; +import net.neoforged.neoforge.event.entity.living.LivingDeathEvent; +import net.neoforged.neoforge.event.entity.living.LivingEvent; import reliquary.blocks.tile.PedestalBlockEntity; import reliquary.init.ModItems; +import reliquary.network.MobCharmDamagePacket; import reliquary.network.PacketHandler; -import reliquary.network.PacketMobCharmDamage; import reliquary.pedestal.PedestalRegistry; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.MobHelper; import reliquary.util.NBTHelper; import reliquary.util.WorldHelper; @@ -41,9 +38,9 @@ public class MobCharmItem extends ItemBase { public MobCharmItem() { super(new Properties().stacksTo(1).setNoRepair()); - MinecraftForge.EVENT_BUS.addListener(this::onEntityTargetedEvent); - MinecraftForge.EVENT_BUS.addListener(this::onLivingUpdate); - MinecraftForge.EVENT_BUS.addListener(this::onLivingDeath); + NeoForge.EVENT_BUS.addListener(this::onEntityTargetedEvent); + NeoForge.EVENT_BUS.addListener(this::onLivingUpdate); + NeoForge.EVENT_BUS.addListener(this::onLivingDeath); } @Override @@ -53,27 +50,21 @@ public boolean canBeDepleted() { @Override public int getMaxDamage(ItemStack stack) { - return Settings.COMMON.items.mobCharm.durability.get(); + return Config.COMMON.items.mobCharm.durability.get(); } @Override - @OnlyIn(Dist.CLIENT) public void appendHoverText(ItemStack stack, @Nullable Level world, List tooltip, TooltipFlag flag) { - EntityType entityType = ForgeRegistries.ENTITY_TYPES.getValue(getEntityEggRegistryName(stack)); - if (entityType == null) { - return; - } - - tooltip.add(Component.translatable(getDescriptionId() + ".tooltip", entityType.getDescription().getString()).withStyle(ChatFormatting.GRAY)); + BuiltInRegistries.ENTITY_TYPE.getOptional(getEntityEggRegistryName(stack)).ifPresent(entityType -> + tooltip.add(Component.translatable(getDescriptionId() + ".tooltip", entityType.getDescription().getString()).withStyle(ChatFormatting.GRAY)) + ); } @Override public MutableComponent getName(ItemStack stack) { - EntityType entityType = ForgeRegistries.ENTITY_TYPES.getValue(getEntityEggRegistryName(stack)); - if (entityType == null) { - return super.getName(stack); - } - return Component.translatable(getDescriptionId(), entityType.getDescription().getString()).withStyle(ChatFormatting.GREEN); + return BuiltInRegistries.ENTITY_TYPE.getOptional(getEntityEggRegistryName(stack)) + .map(entityType -> Component.translatable(getDescriptionId(), entityType.getDescription().getString()).withStyle(ChatFormatting.GREEN)) + .orElseGet(() -> super.getName(stack)); } @Override @@ -96,7 +87,7 @@ private void onEntityTargetedEvent(LivingChangeTargetEvent event) { MobCharmRegistry.getCharmDefinitionFor(entity).ifPresent(charmDefinition -> { if (isMobCharmPresent(player, charmDefinition)) { - event.setNewTarget(null); + event.setCanceled(true); } }); } @@ -119,7 +110,7 @@ private void onLivingUpdate(LivingEvent.LivingTickEvent event) { } Player finalPlayer = player; - MobCharmRegistry.getCharmDefinitionFor(entity).filter(MobCharmDefinition::resetTargetInLivingTickEvent).ifPresent(charmDefinition -> { + MobCharmRegistry.getCharmDefinitionFor(entity).ifPresent(charmDefinition -> { if (isMobCharmPresent(finalPlayer, charmDefinition)) { MobHelper.resetTarget(entity, true); } @@ -131,7 +122,7 @@ private Optional getRealPlayer(@Nullable LivingEntity livingEntity) { } private void onLivingDeath(LivingDeathEvent event) { - if (event.getSource() == null || event.getSource().getEntity() == null || !(event.getSource().getEntity() instanceof Player player)) { + if (event.getSource().getEntity() == null || !(event.getSource().getEntity() instanceof ServerPlayer player)) { return; } @@ -143,7 +134,7 @@ private void onLivingDeath(LivingDeathEvent event) { } private void damageMobCharmInPedestal(Player player, String entityRegistryName) { - List pedestalPositions = PedestalRegistry.getPositionsInRange(player.level().dimension().registry(), player.blockPosition(), Settings.COMMON.items.mobCharm.pedestalRange.get()); + List pedestalPositions = PedestalRegistry.getPositionsInRange(player.level().dimension().registry(), player.blockPosition(), Config.COMMON.items.mobCharm.pedestalRange.get()); Level world = player.getCommandSenderWorld(); for (BlockPos pos : pedestalPositions) { @@ -155,10 +146,10 @@ private void damageMobCharmInPedestal(Player player, String entityRegistryName, if (pedestal.isEnabled()) { ItemStack pedestalItem = pedestal.getItem(); if (isCharmFor(pedestalItem, entityRegistryName)) { - if (pedestalItem.getDamageValue() + Settings.COMMON.items.mobCharm.damagePerKill.get() > pedestalItem.getMaxDamage()) { + if (pedestalItem.getDamageValue() + Config.COMMON.items.mobCharm.damagePerKill.get() > pedestalItem.getMaxDamage()) { pedestal.destroyItem(); } else { - pedestalItem.setDamageValue(pedestalItem.getDamageValue() + Settings.COMMON.items.mobCharm.damagePerKill.get()); + pedestalItem.setDamageValue(pedestalItem.getDamageValue() + Config.COMMON.items.mobCharm.damagePerKill.get()); } } else if (pedestalItem.getItem() == ModItems.MOB_CHARM_BELT.get()) { ModItems.MOB_CHARM_BELT.get().damageCharm(player, pedestalItem, entityRegistryName); @@ -179,7 +170,7 @@ static boolean isCharmFor(ItemStack slotStack, String registryName) { } private boolean pedestalWithCharmInRange(Player player, MobCharmDefinition charmDefinition) { - List pedestalPositions = PedestalRegistry.getPositionsInRange(player.level().dimension().registry(), player.blockPosition(), Settings.COMMON.items.mobCharm.pedestalRange.get()); + List pedestalPositions = PedestalRegistry.getPositionsInRange(player.level().dimension().registry(), player.blockPosition(), Config.COMMON.items.mobCharm.pedestalRange.get()); Level world = player.getCommandSenderWorld(); @@ -239,7 +230,7 @@ public boolean playerHasMobCharm(Player player, MobCharmDefinition charmDefiniti return false; } - public boolean damagePlayersMobCharm(Player player, String entityRegistryName) { + public boolean damagePlayersMobCharm(ServerPlayer player, String entityRegistryName) { if (player.isCreative()) { return true; } @@ -247,7 +238,7 @@ public boolean damagePlayersMobCharm(Player player, String entityRegistryName) { return damageCharmInPlayersInventory(player, entityRegistryName); } - private Boolean damageCharmInPlayersInventory(Player player, String entityRegistryName) { + private boolean damageCharmInPlayersInventory(ServerPlayer player, String entityRegistryName) { for (int slot = 0; slot < player.getInventory().items.size(); slot++) { ItemStack stack = player.getInventory().items.get(slot); @@ -255,16 +246,16 @@ private Boolean damageCharmInPlayersInventory(Player player, String entityRegist continue; } if (isCharmFor(stack, entityRegistryName)) { - if (stack.getDamageValue() + Settings.COMMON.items.mobCharm.damagePerKill.get() > stack.getMaxDamage()) { + if (stack.getDamageValue() + Config.COMMON.items.mobCharm.damagePerKill.get() > stack.getMaxDamage()) { player.getInventory().items.set(slot, ItemStack.EMPTY); - PacketHandler.sendToClient((ServerPlayer) player, new PacketMobCharmDamage(ItemStack.EMPTY, slot)); + PacketHandler.sendToPlayer(player, new MobCharmDamagePacket(ItemStack.EMPTY, slot)); } else { - stack.setDamageValue(stack.getDamageValue() + Settings.COMMON.items.mobCharm.damagePerKill.get()); - PacketHandler.sendToClient((ServerPlayer) player, new PacketMobCharmDamage(stack, slot)); + stack.setDamageValue(stack.getDamageValue() + Config.COMMON.items.mobCharm.damagePerKill.get()); + PacketHandler.sendToPlayer(player, new MobCharmDamagePacket(stack, slot)); } return true; } - if (damageMobCharmInBelt((ServerPlayer) player, entityRegistryName, stack)) { + if (damageMobCharmInBelt(player, entityRegistryName, stack)) { return true; } } @@ -276,7 +267,7 @@ protected boolean damageMobCharmInBelt(ServerPlayer player, String entityRegistr ItemStack charmStack = ModItems.MOB_CHARM_BELT.get().damageCharm(player, belt, entityRegistryName); if (!charmStack.isEmpty()) { - PacketHandler.sendToClient(player, new PacketMobCharmDamage(charmStack, -1)); + PacketHandler.sendToPlayer(player, new MobCharmDamagePacket(charmStack, -1)); return true; } } diff --git a/src/main/java/reliquary/items/MobCharmRegistry.java b/src/main/java/reliquary/items/MobCharmRegistry.java index 266d3e77..6db9de11 100644 --- a/src/main/java/reliquary/items/MobCharmRegistry.java +++ b/src/main/java/reliquary/items/MobCharmRegistry.java @@ -1,5 +1,6 @@ package reliquary.items; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; @@ -7,22 +8,18 @@ import net.minecraft.world.entity.MobCategory; import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.event.entity.living.LivingDropsEvent; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.neoforge.event.entity.living.LivingDropsEvent; import reliquary.init.ModItems; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.RegistryHelper; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Optional; -import java.util.Set; +import java.util.*; import static reliquary.items.MobCharmDefinition.*; public class MobCharmRegistry { - private MobCharmRegistry() {} + private MobCharmRegistry() { + } private static final Map REGISTERED_CHARM_DEFINITIONS = new HashMap<>(); private static final Map ENTITY_NAME_CHARM_DEFINITIONS = new HashMap<>(); @@ -72,9 +69,9 @@ public static Set getRegisteredNames() { } public static void registerDynamicCharmDefinitions() { - for (EntityType entityType : ForgeRegistries.ENTITY_TYPES) { + for (EntityType entityType : BuiltInRegistries.ENTITY_TYPE) { String registryName = RegistryHelper.getRegistryName(entityType).toString(); - Set blockedEntities = new HashSet<>(Settings.COMMON.items.mobCharm.entityBlockList.get()); + Set blockedEntities = new HashSet<>(Config.COMMON.items.mobCharm.entityBlockList.get()); if (!ENTITY_NAME_CHARM_DEFINITIONS.containsKey(registryName) && entityType.getCategory() == MobCategory.MONSTER && !blockedEntities.contains(registryName)) { registerMobCharmDefinition(new MobCharmDefinition(registryName)); DYNAMICALLY_REGISTERED.add(registryName); @@ -93,7 +90,7 @@ public static void handleAddingFragmentDrops(LivingDropsEvent evt) { return; } - double dynamicDropChance = Settings.COMMON.items.mobCharmFragment.dropChance.get() + evt.getLootingLevel() * Settings.COMMON.items.mobCharmFragment.lootingMultiplier.get(); + double dynamicDropChance = Config.COMMON.items.mobCharmFragment.dropChance.get() + evt.getLootingLevel() * Config.COMMON.items.mobCharmFragment.lootingMultiplier.get(); if (entity.level().random.nextFloat() < dynamicDropChance) { ItemEntity fragmentItemEntity = new ItemEntity(entity.level(), entity.getX(), entity.getY(), entity.getZ(), ModItems.MOB_CHARM_FRAGMENT.get().getStackFor(regName.toString())); diff --git a/src/main/java/reliquary/items/MobDropItem.java b/src/main/java/reliquary/items/MobDropItem.java index a9505643..5e058c56 100644 --- a/src/main/java/reliquary/items/MobDropItem.java +++ b/src/main/java/reliquary/items/MobDropItem.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.Level; -import reliquary.reference.Settings; +import reliquary.reference.Config; import javax.annotation.Nullable; import java.util.List; @@ -12,7 +12,7 @@ public class MobDropItem extends ItemBase { @Override public void appendHoverText(ItemStack stack, @Nullable Level world, List tooltip, TooltipFlag flag) { - if (Boolean.TRUE.equals(Settings.COMMON.mobDropsEnabled.get())) { + if (Boolean.TRUE.equals(Config.COMMON.mobDropsEnabled.get())) { super.appendHoverText(stack, world, tooltip, flag); } } diff --git a/src/main/java/reliquary/items/PhoenixDownItem.java b/src/main/java/reliquary/items/PhoenixDownItem.java index c5c19c57..9a51f6ec 100644 --- a/src/main/java/reliquary/items/PhoenixDownItem.java +++ b/src/main/java/reliquary/items/PhoenixDownItem.java @@ -1,12 +1,11 @@ package reliquary.items; -import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.effect.MobEffects; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.event.entity.living.LivingAttackEvent; -import net.minecraftforge.event.entity.living.LivingDeathEvent; +import net.neoforged.neoforge.event.entity.living.LivingAttackEvent; +import net.neoforged.neoforge.event.entity.living.LivingDeathEvent; import reliquary.handler.CommonEventHandler; import reliquary.handler.HandlerPriority; import reliquary.handler.IPlayerDeathHandler; @@ -14,7 +13,7 @@ import reliquary.init.ModItems; import reliquary.network.PacketHandler; import reliquary.network.SpawnPhoenixDownParticlesPacket; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.EntityHelper; import reliquary.util.InventoryHelper; @@ -34,7 +33,7 @@ public boolean canApply(Player player, LivingAttackEvent event) { @Override public boolean apply(Player player, LivingAttackEvent event) { - float hungerDamage = event.getAmount() * ((float) Settings.COMMON.items.phoenixDown.hungerCostPercent.get() / 100F); + float hungerDamage = event.getAmount() * ((float) Config.COMMON.items.phoenixDown.hungerCostPercent.get() / 100F); player.causeFoodExhaustion(hungerDamage); return true; } @@ -57,30 +56,30 @@ public boolean apply(Player player, LivingDeathEvent event) { revertPhoenixDownToAngelicFeather(player); // gives the player a few hearts, sparing them from death. - float amountHealed = player.getMaxHealth() * (float) Settings.COMMON.items.phoenixDown.healPercentageOfMaxLife.get() / 100F; + float amountHealed = player.getMaxHealth() * (float) Config.COMMON.items.phoenixDown.healPercentageOfMaxLife.get() / 100F; player.setHealth(amountHealed); // if the player had any negative status effects [vanilla only for now], remove them: - if (Boolean.TRUE.equals(Settings.COMMON.items.phoenixDown.removeNegativeStatus.get())) { + if (Boolean.TRUE.equals(Config.COMMON.items.phoenixDown.removeNegativeStatus.get())) { EntityHelper.removeNegativeStatusEffects(player); } // added bonus, has some extra effects when drowning or dying to lava - if (event.getSource() == player.damageSources().lava() && Boolean.TRUE.equals(Settings.COMMON.items.phoenixDown.giveTemporaryFireResistanceIfFireDamageKilledYou.get())) { + if (event.getSource() == player.damageSources().lava() && Boolean.TRUE.equals(Config.COMMON.items.phoenixDown.giveTemporaryFireResistanceIfFireDamageKilledYou.get())) { player.addEffect(new MobEffectInstance(MobEffects.FIRE_RESISTANCE, 200, 0)); } - if (event.getSource() == player.damageSources().drown() && Boolean.TRUE.equals(Settings.COMMON.items.phoenixDown.giveTemporaryWaterBreathingIfDrowningKilledYou.get())) { + if (event.getSource() == player.damageSources().drown() && Boolean.TRUE.equals(Config.COMMON.items.phoenixDown.giveTemporaryWaterBreathingIfDrowningKilledYou.get())) { player.setAirSupply(10); player.addEffect(new MobEffectInstance(MobEffects.WATER_BREATHING, 200, 0)); } // give the player temporary resistance to other damages. - if (Boolean.TRUE.equals(Settings.COMMON.items.phoenixDown.giveTemporaryDamageResistance.get())) { + if (Boolean.TRUE.equals(Config.COMMON.items.phoenixDown.giveTemporaryDamageResistance.get())) { player.addEffect(new MobEffectInstance(MobEffects.DAMAGE_RESISTANCE, 200, 1)); } // give the player temporary regeneration. - if (Boolean.TRUE.equals(Settings.COMMON.items.phoenixDown.giveTemporaryRegeneration.get())) { + if (Boolean.TRUE.equals(Config.COMMON.items.phoenixDown.giveTemporaryRegeneration.get())) { player.addEffect(new MobEffectInstance(MobEffects.REGENERATION, 200, 1)); } @@ -110,6 +109,6 @@ private static void revertPhoenixDownToAngelicFeather(Player player) { } private static void spawnPhoenixResurrectionParticles(Player player) { - PacketHandler.sendToClient((ServerPlayer) player, SpawnPhoenixDownParticlesPacket.INSTANCE); + PacketHandler.sendToAllNear(player, new SpawnPhoenixDownParticlesPacket(), 64); } } diff --git a/src/main/java/reliquary/items/PotionEssenceItem.java b/src/main/java/reliquary/items/PotionEssenceItem.java index d90452b8..b856f373 100644 --- a/src/main/java/reliquary/items/PotionEssenceItem.java +++ b/src/main/java/reliquary/items/PotionEssenceItem.java @@ -5,10 +5,8 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.Level; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; import reliquary.items.util.IPotionItem; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.TooltipBuilder; import reliquary.util.potions.PotionEssence; import reliquary.util.potions.PotionMap; @@ -26,7 +24,7 @@ public PotionEssenceItem() { @Override public void addCreativeTabItems(Consumer itemConsumer) { - if (Boolean.TRUE.equals(Settings.COMMON.disable.disablePotions.get())) { + if (Boolean.TRUE.equals(Config.COMMON.disable.disablePotions.get())) { return; } @@ -39,7 +37,6 @@ public void addCreativeTabItems(Consumer itemConsumer) { } @Override - @OnlyIn(Dist.CLIENT) public void appendHoverText(ItemStack stack, @Nullable Level world, List tooltip, TooltipFlag flag) { TooltipBuilder.of(tooltip).potionEffects(stack); } diff --git a/src/main/java/reliquary/items/PotionItemBase.java b/src/main/java/reliquary/items/PotionItemBase.java index dfab531c..1fbd7116 100644 --- a/src/main/java/reliquary/items/PotionItemBase.java +++ b/src/main/java/reliquary/items/PotionItemBase.java @@ -5,10 +5,8 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.Level; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; import reliquary.items.util.IPotionItem; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.TooltipBuilder; import reliquary.util.potions.PotionEssence; import reliquary.util.potions.PotionMap; @@ -31,14 +29,13 @@ public boolean hasCraftingRemainingItem(ItemStack stack) { } @Override - @OnlyIn(Dist.CLIENT) public void appendHoverText(ItemStack potion, @Nullable Level world, List tooltip, TooltipFlag flag) { TooltipBuilder.of(tooltip).potionEffects(potion); } @Override public void addCreativeTabItems(Consumer itemConsumer) { - if (Boolean.TRUE.equals(Settings.COMMON.disable.disablePotions.get())) { + if (Boolean.TRUE.equals(Config.COMMON.disable.disablePotions.get())) { return; } diff --git a/src/main/java/reliquary/items/PyromancerStaffItem.java b/src/main/java/reliquary/items/PyromancerStaffItem.java index a3cfbcfd..346f7e70 100644 --- a/src/main/java/reliquary/items/PyromancerStaffItem.java +++ b/src/main/java/reliquary/items/PyromancerStaffItem.java @@ -30,10 +30,8 @@ import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.HitResult; import net.minecraft.world.phys.Vec3; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; import reliquary.items.util.IScrollableItem; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.NBTHelper; import reliquary.util.RandHelper; import reliquary.util.RegistryHelper; @@ -72,7 +70,6 @@ public void inventoryTick(ItemStack stack, Level world, Entity e, int i, boolean } @Override - @OnlyIn(Dist.CLIENT) protected void addMoreInformation(ItemStack staff, @Nullable Level world, TooltipBuilder tooltipBuilder) { AtomicInteger charges = new AtomicInteger(0); AtomicInteger blaze = new AtomicInteger(0); @@ -286,35 +283,35 @@ private void scanForFireChargeAndBlazePowder(ItemStack staff, Player player) { } private int getFireChargeWorth() { - return Settings.COMMON.items.pyromancerStaff.fireChargeWorth.get(); + return Config.COMMON.items.pyromancerStaff.fireChargeWorth.get(); } private int getFireChargeCost() { - return Settings.COMMON.items.pyromancerStaff.fireChargeCost.get(); + return Config.COMMON.items.pyromancerStaff.fireChargeCost.get(); } private int getFireChargeLimit() { - return Settings.COMMON.items.pyromancerStaff.fireChargeLimit.get(); + return Config.COMMON.items.pyromancerStaff.fireChargeLimit.get(); } private int getBlazePowderWorth() { - return Settings.COMMON.items.pyromancerStaff.blazePowderWorth.get(); + return Config.COMMON.items.pyromancerStaff.blazePowderWorth.get(); } private int getBlazePowderCost() { - return Settings.COMMON.items.pyromancerStaff.blazePowderCost.get(); + return Config.COMMON.items.pyromancerStaff.blazePowderCost.get(); } private int getBlazePowderLimit() { - return Settings.COMMON.items.pyromancerStaff.blazePowderLimit.get(); + return Config.COMMON.items.pyromancerStaff.blazePowderLimit.get(); } private int getBlazeAbsorbWorth() { - return Settings.COMMON.items.pyromancerStaff.blazeAbsorbWorth.get(); + return Config.COMMON.items.pyromancerStaff.blazeAbsorbWorth.get(); } private int getGhastAbsorbWorth() { - return Settings.COMMON.items.pyromancerStaff.ghastAbsorbWorth.get(); + return Config.COMMON.items.pyromancerStaff.ghastAbsorbWorth.get(); } private void doExtinguishEffect(Player player) { diff --git a/src/main/java/reliquary/items/RendingGaleItem.java b/src/main/java/reliquary/items/RendingGaleItem.java index 2742cc9d..a9df909e 100644 --- a/src/main/java/reliquary/items/RendingGaleItem.java +++ b/src/main/java/reliquary/items/RendingGaleItem.java @@ -5,19 +5,13 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.particles.BlockParticleOption; import net.minecraft.core.particles.ParticleTypes; -import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.MutableComponent; import net.minecraft.util.Mth; import net.minecraft.util.StringRepresentable; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.InteractionResultHolder; -import net.minecraft.world.entity.Entity; -import net.minecraft.world.entity.EntityType; -import net.minecraft.world.entity.LightningBolt; -import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.entity.Mob; -import net.minecraft.world.entity.MoverType; +import net.minecraft.world.entity.*; import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.projectile.Projectile; import net.minecraft.world.item.ItemStack; @@ -30,28 +24,18 @@ import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.HitResult; import net.minecraft.world.phys.Vec3; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.capabilities.ICapabilityProvider; -import net.minecraftforge.fml.util.ObfuscationReflectionHelper; -import reliquary.items.util.FilteredItemHandlerProvider; -import reliquary.items.util.FilteredItemStack; +import net.neoforged.neoforge.capabilities.Capabilities; import reliquary.items.util.FilteredItemStackHandler; import reliquary.items.util.IScrollableItem; -import reliquary.reference.Settings; -import reliquary.util.LogHelper; +import reliquary.reference.Config; import reliquary.util.NBTHelper; import reliquary.util.RegistryHelper; import reliquary.util.TooltipBuilder; import javax.annotation.Nullable; -import java.lang.reflect.Field; -import java.util.ArrayList; import java.util.List; public class RendingGaleItem extends ToggleableItem implements IScrollableItem { - private static final String COUNT_TAG = "count"; private static final int NO_DAMAGE_ELYTRA_TICKS = 3; public RendingGaleItem() { @@ -64,9 +48,8 @@ public MutableComponent getName(ItemStack stack) { } @Override - @OnlyIn(Dist.CLIENT) protected void addMoreInformation(ItemStack rendingGale, @Nullable Level world, TooltipBuilder tooltipBuilder) { - tooltipBuilder.charge(this, ".tooltip2", getFeatherCount(rendingGale, true) / 100); + tooltipBuilder.charge(this, ".tooltip2", getFeatherCount(rendingGale) / 100); tooltipBuilder.description(this, ".tooltip.controls"); if (isEnabled(rendingGale)) { tooltipBuilder.absorbActive(Items.FEATHER.getName(new ItemStack(Items.FEATHER)).getString()); @@ -81,27 +64,27 @@ protected boolean hasMoreInformation(ItemStack stack) { } private static int getChargeLimit() { - return Settings.COMMON.items.rendingGale.chargeLimit.get(); + return Config.COMMON.items.rendingGale.chargeLimit.get(); } public static int getChargeCost() { - return Settings.COMMON.items.rendingGale.castChargeCost.get(); + return Config.COMMON.items.rendingGale.castChargeCost.get(); } private static int getFeathersWorth() { - return Settings.COMMON.items.rendingGale.chargeFeatherWorth.get(); + return Config.COMMON.items.rendingGale.chargeFeatherWorth.get(); } private static int getBoltChargeCost() { - return Settings.COMMON.items.rendingGale.boltChargeCost.get(); + return Config.COMMON.items.rendingGale.boltChargeCost.get(); } private static int getBoltTargetRange() { - return Settings.COMMON.items.rendingGale.blockTargetRange.get(); + return Config.COMMON.items.rendingGale.blockTargetRange.get(); } private static int getRadialPushRadius() { - return Settings.COMMON.items.rendingGale.pushPullRadius.get(); + return Config.COMMON.items.rendingGale.pushPullRadius.get(); } private void attemptFlight(LivingEntity entityLiving) { @@ -123,19 +106,7 @@ private void attemptFlight(LivingEntity entityLiving) { player.fallDistance = 0.0F; if (player.isFallFlying()) { - preventElytraDamage(player); - } - } - - private static final Field TICKS_ELYTRA_FLYING = ObfuscationReflectionHelper.findField(LivingEntity.class, "f_20937_"); - - @SuppressWarnings("java:S3011") //the reflection accessibility bypass here is the only way one can set the value - private static void preventElytraDamage(Player player) { - try { - TICKS_ELYTRA_FLYING.set(player, NO_DAMAGE_ELYTRA_TICKS); - } - catch (IllegalAccessException e) { - LogHelper.error("Error setting ticksElytraFlying on player ", e); + player.fallFlyTicks = NO_DAMAGE_ELYTRA_TICKS; } } @@ -148,7 +119,7 @@ public void inventoryTick(ItemStack rendingGale, Level world, Entity entity, int if (isEnabled(rendingGale)) { int currentFeatherCharge = getFeatherCount(rendingGale); consumeAndCharge(player, getChargeLimit() - currentFeatherCharge, getFeathersWorth(), Items.FEATHER, 16, - chargeToAdd -> setFeatherCount(rendingGale, currentFeatherCharge + chargeToAdd, !player.isUsingItem())); + chargeToAdd -> setFeatherCount(rendingGale, currentFeatherCharge + chargeToAdd)); } } @@ -178,14 +149,6 @@ public InteractionResult onMouseScrolled(ItemStack stack, Player player, double return InteractionResult.SUCCESS; } - @Override - public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable CompoundTag nbt) { - ArrayList filteredStacks = new ArrayList<>(); - filteredStacks.add(new FilteredItemStack(Items.FEATHER, Settings.COMMON.items.rendingGale.chargeLimit.get(), - Settings.COMMON.items.rendingGale.chargeFeatherWorth.get(), false)); - return new FilteredItemHandlerProvider(filteredStacks); - } - @Override public int getUseDuration(ItemStack par1ItemStack) { return 6000; @@ -213,7 +176,7 @@ public void onUseTick(Level level, LivingEntity livingEntity, ItemStack rendingG return; } - if (getFeatherCount(rendingGale, player.level().isClientSide) <= 0) { + if (getFeatherCount(rendingGale) <= 0) { player.releaseUsingItem(); return; } @@ -232,7 +195,7 @@ public void onUseTick(Level level, LivingEntity livingEntity, ItemStack rendingG doRadialPush(player.level(), player.getX(), player.getY(), player.getZ(), player, true); } if (!player.level().isClientSide) { - setFeatherCount(rendingGale, Math.max(0, getFeatherCount(rendingGale) - getChargeCost()), false); + setFeatherCount(rendingGale, Math.max(0, getFeatherCount(rendingGale) - getChargeCost())); } } } @@ -251,45 +214,28 @@ private void spawnBolt(ItemStack rendingGale, Player player) { if (bolt != null) { bolt.moveTo(pos.getX(), pos.getY(), pos.getZ()); player.level().addFreshEntity(bolt); - setFeatherCount(rendingGale, Math.max(0, getFeatherCount(rendingGale) - (getBoltChargeCost())), false); + setFeatherCount(rendingGale, Math.max(0, getFeatherCount(rendingGale) - (getBoltChargeCost()))); } } } } - @Override - public void releaseUsing(ItemStack rendingGale, Level world, LivingEntity entityLiving, int timeLeft) { - if (world.isClientSide) { - return; - } - NBTHelper.putInt(COUNT_TAG, rendingGale, getFeatherCount(rendingGale)); - } - public boolean hasFlightCharge(ItemStack stack) { return getFeatherCount(stack) > 0; } public int getFeatherCount(ItemStack rendingGale) { - return getFeatherCount(rendingGale, false); - } - - private int getFeatherCount(ItemStack rendingGale, boolean isClient) { - if (isClient) { - return NBTHelper.getInt(COUNT_TAG, rendingGale); + if (rendingGale.getCapability(Capabilities.ItemHandler.ITEM) instanceof FilteredItemStackHandler filteredItemStackHandler) { + return filteredItemStackHandler.getTotalAmount(0); } - return rendingGale.getCapability(ForgeCapabilities.ITEM_HANDLER, null) - .filter(FilteredItemStackHandler.class::isInstance).map(handler -> ((FilteredItemStackHandler) handler).getTotalAmount(0)).orElse(0); + return 0; } - public void setFeatherCount(ItemStack stack, int featherCount, boolean updateNBT) { - stack.getCapability(ForgeCapabilities.ITEM_HANDLER, null).filter(FilteredItemStackHandler.class::isInstance) - .ifPresent(handler -> { - ((FilteredItemStackHandler) handler).setTotalCount(0, featherCount); - if (updateNBT) { - NBTHelper.putInt(COUNT_TAG, stack, featherCount); - } - }); + public void setFeatherCount(ItemStack stack, int featherCount) { + if (stack.getCapability(Capabilities.ItemHandler.ITEM) instanceof FilteredItemStackHandler filteredItemStackHandler) { + filteredItemStackHandler.setTotalCount(0, featherCount); + } } public void doRadialPush(Level world, double posX, double posY, double posZ, @Nullable Player player, boolean pull) { @@ -331,15 +277,15 @@ public void doRadialPush(Level world, double posX, double posY, double posZ, @Nu private boolean isBlacklistedEntity(Entity entity) { String entityName = RegistryHelper.getRegistryName(entity).toString(); - return isBlacklistedLivingEntity(entity, entityName) || Settings.COMMON.items.rendingGale.canPushProjectiles.get() && isBlacklistedProjectile(entity, entityName); + return isBlacklistedLivingEntity(entity, entityName) || Config.COMMON.items.rendingGale.canPushProjectiles.get() && isBlacklistedProjectile(entity, entityName); } private boolean isBlacklistedProjectile(Entity entity, String entityName) { - return entity instanceof Projectile && Settings.COMMON.items.rendingGale.pushableProjectilesBlacklist.get().contains(entityName); + return entity instanceof Projectile && Config.COMMON.items.rendingGale.pushableProjectilesBlacklist.get().contains(entityName); } private boolean isBlacklistedLivingEntity(Entity entity, String entityName) { - return entity instanceof Mob && Settings.COMMON.items.rendingGale.pushableEntitiesBlacklist.get().contains(entityName); + return entity instanceof Mob && Config.COMMON.items.rendingGale.pushableEntitiesBlacklist.get().contains(entityName); } private float getDistanceToEntity(double posX, double posY, double posZ, Entity entityIn) { @@ -387,7 +333,7 @@ private void spawnRadialHurricaneParticles(Level world, double posX, double posY } public int getFeatherCountClient(ItemStack rendingGale, Player player) { - int featherCount = getFeatherCount(rendingGale, true); + int featherCount = getFeatherCount(rendingGale); Mode mode = getMode(rendingGale); int ticksInUse = getUseDuration(rendingGale) - player.getUseItemRemainingTicks(); if (player.isUsingItem()) { diff --git a/src/main/java/reliquary/items/RodOfLyssaItem.java b/src/main/java/reliquary/items/RodOfLyssaItem.java index b78010f7..468b6d87 100644 --- a/src/main/java/reliquary/items/RodOfLyssaItem.java +++ b/src/main/java/reliquary/items/RodOfLyssaItem.java @@ -7,7 +7,6 @@ import net.minecraft.world.InteractionResultHolder; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.enchantment.EnchantmentHelper; import net.minecraft.world.item.enchantment.Enchantments; import net.minecraft.world.level.Level; import reliquary.entities.LyssaHook; @@ -35,8 +34,8 @@ public InteractionResultHolder use(Level level, Player player, Intera if (!level.isClientSide) { - int lureLevel = EnchantmentHelper.getItemEnchantmentLevel(Enchantments.FISHING_SPEED, stack); - int luckOfTheSeaLevel = EnchantmentHelper.getItemEnchantmentLevel(Enchantments.FISHING_LUCK, stack); + int lureLevel = stack.getEnchantmentLevel(Enchantments.FISHING_SPEED); + int luckOfTheSeaLevel = stack.getEnchantmentLevel(Enchantments.FISHING_LUCK); LyssaHook hook = new LyssaHook(level, player, lureLevel, luckOfTheSeaLevel); level.addFreshEntity(hook); diff --git a/src/main/java/reliquary/items/SalamanderEyeItem.java b/src/main/java/reliquary/items/SalamanderEyeItem.java index 204b342c..01a6b0aa 100644 --- a/src/main/java/reliquary/items/SalamanderEyeItem.java +++ b/src/main/java/reliquary/items/SalamanderEyeItem.java @@ -14,8 +14,6 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.BaseFireBlock; import net.minecraft.world.level.block.Blocks; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; import reliquary.util.RandHelper; import java.util.List; @@ -31,7 +29,6 @@ public Rarity getRarity(ItemStack stack) { } @Override - @OnlyIn(Dist.CLIENT) public boolean isFoil(ItemStack stack) { return true; } diff --git a/src/main/java/reliquary/items/SerpentStaffItem.java b/src/main/java/reliquary/items/SerpentStaffItem.java index 2075646b..bf793ae7 100644 --- a/src/main/java/reliquary/items/SerpentStaffItem.java +++ b/src/main/java/reliquary/items/SerpentStaffItem.java @@ -13,8 +13,6 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.UseAnim; import net.minecraft.world.level.Level; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; import reliquary.entities.KrakenSlimeEntity; public class SerpentStaffItem extends ItemBase { @@ -28,7 +26,6 @@ public MutableComponent getName(ItemStack stack) { } @Override - @OnlyIn(Dist.CLIENT) public boolean isFoil(ItemStack stack) { return true; } diff --git a/src/main/java/reliquary/items/ShearsOfWinterItem.java b/src/main/java/reliquary/items/ShearsOfWinterItem.java index 3a081d9f..70e2e90e 100644 --- a/src/main/java/reliquary/items/ShearsOfWinterItem.java +++ b/src/main/java/reliquary/items/ShearsOfWinterItem.java @@ -17,11 +17,7 @@ import net.minecraft.world.entity.Mob; import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Items; -import net.minecraft.world.item.ShearsItem; -import net.minecraft.world.item.TooltipFlag; -import net.minecraft.world.item.UseAnim; +import net.minecraft.world.item.*; import net.minecraft.world.item.context.UseOnContext; import net.minecraft.world.item.enchantment.Enchantments; import net.minecraft.world.level.Level; @@ -32,9 +28,7 @@ import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.Vec3; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.common.IForgeShearable; +import net.neoforged.neoforge.common.IShearable; import reliquary.entities.EntityXRFakePlayer; import reliquary.util.RandHelper; import reliquary.util.TooltipBuilder; @@ -133,7 +127,6 @@ private void shearBlocks(Player player, Vec3 lookVector) { } @Override - @OnlyIn(Dist.CLIENT) public void appendHoverText(ItemStack shears, @Nullable Level world, List tooltip, TooltipFlag flag) { TooltipBuilder.of(tooltip).itemTooltip(this); } @@ -151,7 +144,7 @@ private void shearBlockAt(BlockPos pos, Player player) { Level world = player.level(); BlockState blockState = world.getBlockState(pos); Block block = blockState.getBlock(); - if (block instanceof IForgeShearable target) { + if (block instanceof IShearable target) { ItemStack dummyShears = new ItemStack(Items.SHEARS); if (target.isShearable(dummyShears, world, pos) && removeBlock(player, pos, blockState.canHarvestBlock(world, pos, player))) { player.awardStat(Stats.BLOCK_MINED.get(block)); @@ -201,14 +194,14 @@ private void doEntityShearableCheck(ItemStack stack, Player player, Vec3 lookVec if (!e.is(player)) { e.addEffect(new MobEffectInstance(MobEffects.MOVEMENT_SLOWDOWN, 120, 1)); } - if (e instanceof IForgeShearable) { + if (e instanceof IShearable) { shearEntity(stack, player, rand, e); } } } private void shearEntity(ItemStack stack, Player player, RandomSource rand, Mob e) { - IForgeShearable target = (IForgeShearable) e; + IShearable target = (IShearable) e; BlockPos pos = e.blockPosition(); if (target.isShearable(new ItemStack(Items.SHEARS), e.level(), pos)) { List drops = target.onSheared(player, stack, e.level(), pos, stack.getEnchantmentLevel(Enchantments.BLOCK_FORTUNE)); diff --git a/src/main/java/reliquary/items/SojournerStaffItem.java b/src/main/java/reliquary/items/SojournerStaffItem.java index d4a3b8fb..1980b68c 100644 --- a/src/main/java/reliquary/items/SojournerStaffItem.java +++ b/src/main/java/reliquary/items/SojournerStaffItem.java @@ -3,6 +3,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.particles.ParticleTypes; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.ListTag; import net.minecraft.resources.ResourceLocation; @@ -12,11 +13,7 @@ import net.minecraft.world.InteractionResultHolder; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.BlockItem; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Items; -import net.minecraft.world.item.Rarity; +import net.minecraft.world.item.*; import net.minecraft.world.item.context.UseOnContext; import net.minecraft.world.level.ClipContext; import net.minecraft.world.level.Level; @@ -25,17 +22,9 @@ import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.HitResult; import net.minecraft.world.phys.Vec3; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.registries.ForgeRegistries; import reliquary.items.util.IScrollableItem; -import reliquary.reference.Settings; -import reliquary.util.InventoryHelper; -import reliquary.util.NBTHelper; -import reliquary.util.NoPlayerBlockItemUseContext; -import reliquary.util.RegistryHelper; -import reliquary.util.TooltipBuilder; +import reliquary.reference.Config; +import reliquary.util.*; import javax.annotation.Nullable; import java.util.StringJoiner; @@ -77,8 +66,8 @@ public InteractionResult onMouseScrolled(ItemStack stack, Player player, double } private void scanForMatchingTorchesToFillInternalStorage(ItemStack stack, Player player) { - for (String torch : Settings.COMMON.items.sojournerStaff.torches.get()) { - consumeAndCharge(player, Settings.COMMON.items.sojournerStaff.maxCapacityPerItemType.get() - getInternalStorageItemCount(stack, torch), 1, ist -> RegistryHelper.getItemRegistryName(ist.getItem()).equals(torch), 16, + for (String torch : Config.COMMON.items.sojournerStaff.torches.get()) { + consumeAndCharge(player, Config.COMMON.items.sojournerStaff.maxCapacityPerItemType.get() - getInternalStorageItemCount(stack, torch), 1, ist -> RegistryHelper.getItemRegistryName(ist.getItem()).equals(torch), 16, chargeToAdd -> addItemToInternalStorage(stack, torch, chargeToAdd)); } } @@ -129,7 +118,6 @@ private int getCurrentIndex(CompoundTag tagCompound, ListTag tagList) { } @Override - @OnlyIn(Dist.CLIENT) protected void addMoreInformation(ItemStack staff, @Nullable Level world, TooltipBuilder tooltipBuilder) { StringJoiner joiner = new StringJoiner(";"); iterateItems(staff, tag -> { @@ -156,7 +144,7 @@ protected boolean hasMoreInformation(ItemStack stack) { } private static ItemStack getItem(CompoundTag tagItemData) { - return new ItemStack(ForgeRegistries.ITEMS.getValue(new ResourceLocation(tagItemData.getString(ITEM_NAME_TAG)))); + return new ItemStack(BuiltInRegistries.ITEM.get(new ResourceLocation(tagItemData.getString(ITEM_NAME_TAG)))); } @Override @@ -200,7 +188,7 @@ private InteractionResult placeTorch(UseOnContext context) { private boolean removeTorches(Player player, ItemStack staff, ItemStack torch, BlockPos placeBlockAt) { if (!player.isCreative()) { int distance = (int) player.getEyePosition(1).distanceTo(new Vec3(placeBlockAt.getX(), placeBlockAt.getY(), placeBlockAt.getZ())); - int cost = 1 + distance / Settings.COMMON.items.sojournerStaff.tilePerCostMultiplier.get(); + int cost = 1 + distance / Config.COMMON.items.sojournerStaff.tilePerCostMultiplier.get(); Item torchItem = torch.getItem(); boolean result = removeItemFromInternalStorage(staff, torchItem, cost, false, player); @@ -225,10 +213,8 @@ public InteractionResultHolder use(Level world, Player player, Intera ItemStack torch = getItem(torchTag); int count = torchTag.getInt(QUANTITY_TAG); torch.setCount(Math.min(count, torch.getMaxStackSize())); - player.getCapability(ForgeCapabilities.ITEM_HANDLER, Direction.UP).ifPresent(playerInventory -> { - int inserted = InventoryHelper.insertIntoInventory(torch, playerInventory); - removeItemFromInternalStorage(staff, torch.getItem(), inserted, false, player); - }); + int inserted = InventoryHelper.insertIntoInventory(torch, InventoryHelper.getItemHandlerFrom(player)); + removeItemFromInternalStorage(staff, torch.getItem(), inserted, false, player); } } return super.use(world, player, hand); @@ -244,7 +230,7 @@ private HitResult longRayTrace(Level worldIn, Player player) { float f5 = Mth.sin(-f * ((float) Math.PI / 180F)); float f6 = f3 * f4; float f7 = f2 * f4; - double d0 = Settings.COMMON.items.sojournerStaff.maxRange.get(); + double d0 = Config.COMMON.items.sojournerStaff.maxRange.get(); Vec3 vec3d1 = vec3d.add(f6 * d0, f5 * d0, f7 * d0); return worldIn.clip(new ClipContext(vec3d, vec3d1, ClipContext.Block.OUTLINE, ClipContext.Fluid.ANY, player)); } diff --git a/src/main/java/reliquary/items/TippedArrowItem.java b/src/main/java/reliquary/items/TippedArrowItem.java index d59d0faf..5e175e84 100644 --- a/src/main/java/reliquary/items/TippedArrowItem.java +++ b/src/main/java/reliquary/items/TippedArrowItem.java @@ -10,7 +10,7 @@ import net.minecraft.world.level.Level; import reliquary.entities.XRTippedArrowEntity; import reliquary.items.util.IPotionItem; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.TooltipBuilder; import reliquary.util.potions.PotionEssence; import reliquary.util.potions.PotionMap; @@ -27,14 +27,14 @@ public TippedArrowItem() { @Override public AbstractArrow createArrow(Level world, ItemStack stack, LivingEntity shooter) { - XRTippedArrowEntity entitytippedarrow = new XRTippedArrowEntity(world, shooter); + XRTippedArrowEntity entitytippedarrow = new XRTippedArrowEntity(world, shooter, stack); entitytippedarrow.setPotionEffect(stack); return entitytippedarrow; } @Override public void addCreativeTabItems(Consumer itemConsumer) { - if (Boolean.TRUE.equals(Settings.COMMON.disable.disablePotions.get())) { + if (Boolean.TRUE.equals(Config.COMMON.disable.disablePotions.get())) { return; } diff --git a/src/main/java/reliquary/items/ToggleableItem.java b/src/main/java/reliquary/items/ToggleableItem.java index d67352eb..3e53cff9 100644 --- a/src/main/java/reliquary/items/ToggleableItem.java +++ b/src/main/java/reliquary/items/ToggleableItem.java @@ -13,8 +13,6 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; import reliquary.util.InventoryHelper; import reliquary.util.NBTHelper; import reliquary.util.RandHelper; @@ -22,11 +20,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; -import java.util.function.BooleanSupplier; -import java.util.function.Consumer; -import java.util.function.IntConsumer; -import java.util.function.Predicate; -import java.util.function.Supplier; +import java.util.function.*; public abstract class ToggleableItem extends ItemBase { @@ -45,7 +39,6 @@ protected ToggleableItem(Properties properties) { } @Override - @OnlyIn(Dist.CLIENT) public boolean isFoil(ItemStack stack) { return isEnabled(stack); } diff --git a/src/main/java/reliquary/items/TwilightCloakItem.java b/src/main/java/reliquary/items/TwilightCloakItem.java index 0118fce0..145ea5ec 100644 --- a/src/main/java/reliquary/items/TwilightCloakItem.java +++ b/src/main/java/reliquary/items/TwilightCloakItem.java @@ -9,11 +9,11 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Rarity; import net.minecraft.world.level.Level; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.living.LivingChangeTargetEvent; -import net.minecraftforge.event.entity.living.LivingEvent; +import net.neoforged.neoforge.common.NeoForge; +import net.neoforged.neoforge.event.entity.living.LivingChangeTargetEvent; +import net.neoforged.neoforge.event.entity.living.LivingEvent; import reliquary.items.util.ICuriosItem; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.InventoryHelper; import reliquary.util.MobHelper; @@ -22,8 +22,8 @@ public class TwilightCloakItem extends ToggleableItem implements ICuriosItem { public TwilightCloakItem() { super(new Properties().stacksTo(1)); - MinecraftForge.EVENT_BUS.addListener(this::onEntityTargetedEvent); - MinecraftForge.EVENT_BUS.addListener(this::onLivingUpdate); + NeoForge.EVENT_BUS.addListener(this::onEntityTargetedEvent); + NeoForge.EVENT_BUS.addListener(this::onLivingUpdate); } @Override @@ -47,7 +47,7 @@ private void updateInvisibility(ItemStack twilightCloak, Player player) { //toggled effect, makes player invisible based on light level (configurable) - if (player.level().getMaxLocalRawBrightness(player.blockPosition()) > Settings.COMMON.items.twilightCloak.maxLightLevel.get()) { + if (player.level().getMaxLocalRawBrightness(player.blockPosition()) > Config.COMMON.items.twilightCloak.maxLightLevel.get()) { return; } @@ -69,7 +69,7 @@ public void onWornTick(ItemStack twilightCloak, LivingEntity player) { private void onEntityTargetedEvent(LivingChangeTargetEvent event) { if (shouldResetTarget(event.getNewTarget())) { - event.setNewTarget(null); + event.setCanceled(true); } } @@ -88,6 +88,6 @@ private boolean shouldResetTarget(@Nullable Entity target) { return false; } - return InventoryHelper.playerHasItem(player, this, true, Type.BODY) && player.level().getMaxLocalRawBrightness(player.blockPosition()) <= Settings.COMMON.items.twilightCloak.maxLightLevel.get(); + return InventoryHelper.playerHasItem(player, this, true, Type.BODY) && player.level().getMaxLocalRawBrightness(player.blockPosition()) <= Config.COMMON.items.twilightCloak.maxLightLevel.get(); } } diff --git a/src/main/java/reliquary/items/VoidTearItem.java b/src/main/java/reliquary/items/VoidTearItem.java index 99515913..79d8b7f7 100644 --- a/src/main/java/reliquary/items/VoidTearItem.java +++ b/src/main/java/reliquary/items/VoidTearItem.java @@ -5,7 +5,6 @@ import net.minecraft.client.Minecraft; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; -import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundSource; @@ -24,41 +23,26 @@ import net.minecraft.world.level.Level; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.HitResult; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.capabilities.ICapabilityProvider; -import net.minecraftforge.common.capabilities.ICapabilitySerializable; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.event.entity.player.EntityItemPickupEvent; -import net.minecraftforge.items.IItemHandler; -import net.minecraftforge.items.ItemHandlerHelper; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.common.NeoForge; +import net.neoforged.neoforge.event.entity.player.EntityItemPickupEvent; +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.items.ItemHandlerHelper; import reliquary.blocks.PedestalBlock; import reliquary.items.util.IScrollableItem; import reliquary.items.util.VoidTearItemStackHandler; -import reliquary.reference.Settings; -import reliquary.util.InventoryHelper; -import reliquary.util.NBTHelper; -import reliquary.util.NoPlayerBlockItemUseContext; -import reliquary.util.RandHelper; -import reliquary.util.TooltipBuilder; -import reliquary.util.TranslationHelper; -import reliquary.util.WorldHelper; - -import javax.annotation.Nonnull; +import reliquary.reference.Config; +import reliquary.util.*; + import javax.annotation.Nullable; import java.util.Optional; import java.util.function.Consumer; import java.util.function.Function; public class VoidTearItem extends ToggleableItem implements IScrollableItem { - private static final String CONTENTS_TAG = "contents"; - public VoidTearItem() { super(new Properties()); - MinecraftForge.EVENT_BUS.addListener(this::onItemPickup); + NeoForge.EVENT_BUS.addListener(this::onItemPickup); } @Override @@ -67,40 +51,15 @@ public int getMaxStackSize(ItemStack stack) { } @Override - public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable CompoundTag nbt) { - return new ICapabilitySerializable() { - final VoidTearItemStackHandler itemHandler = new VoidTearItemStackHandler(); - - @Override - public CompoundTag serializeNBT() { - return itemHandler.serializeNBT(); - } - - @Override - public void deserializeNBT(CompoundTag nbt) { - itemHandler.deserializeNBT(nbt); - } - - @Nonnull - @Override - public LazyOptional getCapability(Capability capability, @Nullable Direction side) { - return ForgeCapabilities.ITEM_HANDLER.orEmpty(capability, LazyOptional.of(() -> itemHandler)); - } - }; - } - - @Override - @OnlyIn(Dist.CLIENT) public boolean isFoil(ItemStack stack) { return !(Minecraft.getInstance().options.keyShift.isDown()) && super.isFoil(stack); } @Override - @OnlyIn(Dist.CLIENT) protected void addMoreInformation(ItemStack voidTear, @Nullable Level world, TooltipBuilder tooltipBuilder) { - ItemStack contents = getTearContents(voidTear, true); + ItemStack contents = getTearContents(voidTear); - if (isEmpty(voidTear, true)) { + if (isEmpty(voidTear)) { return; } @@ -118,7 +77,7 @@ protected void addMoreInformation(ItemStack voidTear, @Nullable Level world, Too @Override protected boolean hasMoreInformation(ItemStack stack) { - return !isEmpty(stack, true); + return !isEmpty(stack); } @Override @@ -148,7 +107,8 @@ public InteractionResultHolder use(Level world, Player player, Intera return super.use(world, player, hand); } - if (Boolean.TRUE.equals(InventoryHelper.getItemHandlerFrom(player).map(h -> attemptToEmptyIntoInventory(voidTear, player, h)).orElse(false))) { + IItemHandler playerInventory = InventoryHelper.getItemHandlerFrom(player); + if (attemptToEmptyIntoInventory(voidTear, player, playerInventory)) { player.level().playSound(null, player.blockPosition(), SoundEvents.EXPERIENCE_ORB_PICKUP, SoundSource.PLAYERS, 0.1F, 0.5F * (RandHelper.getRandomMinusOneToOne(player.level().random) * 0.7F + 1.2F)); setEmpty(voidTear); return new InteractionResultHolder<>(InteractionResult.SUCCESS, voidTear); @@ -158,31 +118,30 @@ public InteractionResultHolder use(Level world, Player player, Intera } private boolean hasPlaceableBlock(ItemStack voidTear) { - return !isEmpty(voidTear) && getTearContents(voidTear, false).getItem() instanceof BlockItem; + return !isEmpty(voidTear) && getTearContents(voidTear).getItem() instanceof BlockItem; } private InteractionResultHolder rightClickEmpty(ItemStack emptyVoidTear, Player player) { - return InventoryHelper.getItemHandlerFrom(player).map(playerInventory -> { - ItemStack target = InventoryHelper.getTargetItem(emptyVoidTear, playerInventory); - if (!target.isEmpty()) { - ItemStack filledTear; - if (emptyVoidTear.getCount() > 1) { - emptyVoidTear.shrink(1); - filledTear = new ItemStack(this); - } else { - filledTear = emptyVoidTear; - } - buildTear(filledTear, target, player, playerInventory, true); - player.level().playSound(null, player.blockPosition(), SoundEvents.EXPERIENCE_ORB_PICKUP, SoundSource.PLAYERS, 0.1F, 0.5F * (RandHelper.getRandomMinusOneToOne(player.level().random) * 0.7F + 1.2F)); - if (emptyVoidTear.getCount() == 1) { - return new InteractionResultHolder<>(InteractionResult.SUCCESS, filledTear); - } else { - InventoryHelper.addItemToPlayerInventory(player, filledTear); - return new InteractionResultHolder<>(InteractionResult.SUCCESS, emptyVoidTear); - } + IItemHandler playerInventory = InventoryHelper.getItemHandlerFrom(player); + ItemStack target = InventoryHelper.getTargetItem(emptyVoidTear, playerInventory); + if (!target.isEmpty()) { + ItemStack filledTear; + if (emptyVoidTear.getCount() > 1) { + emptyVoidTear.shrink(1); + filledTear = new ItemStack(this); + } else { + filledTear = emptyVoidTear; } - return new InteractionResultHolder<>(InteractionResult.PASS, emptyVoidTear); - }).orElse(new InteractionResultHolder<>(InteractionResult.PASS, emptyVoidTear)); + buildTear(filledTear, target, player, playerInventory, true); + player.level().playSound(null, player.blockPosition(), SoundEvents.EXPERIENCE_ORB_PICKUP, SoundSource.PLAYERS, 0.1F, 0.5F * (RandHelper.getRandomMinusOneToOne(player.level().random) * 0.7F + 1.2F)); + if (emptyVoidTear.getCount() == 1) { + return new InteractionResultHolder<>(InteractionResult.SUCCESS, filledTear); + } else { + InventoryHelper.addItemToPlayerInventory(player, filledTear); + return new InteractionResultHolder<>(InteractionResult.SUCCESS, emptyVoidTear); + } + } + return new InteractionResultHolder<>(InteractionResult.PASS, emptyVoidTear); } private void buildTear(ItemStack voidTear, ItemStack target, Player player, IItemHandler inventory, boolean isPlayerInventory) { @@ -196,13 +155,13 @@ private void buildTear(ItemStack voidTear, ItemStack target, Player player, IIte quantity = 1; } } else { - quantity = InventoryHelper.tryToRemoveFromInventory(target, inventory, Settings.COMMON.items.voidTear.itemLimit.get()); + quantity = InventoryHelper.tryToRemoveFromInventory(target, inventory, Config.COMMON.items.voidTear.itemLimit.get()); } setItemStack(voidTear, target); setItemQuantity(voidTear, quantity); //configurable auto-drain when created. - NBTHelper.putBoolean("enabled", voidTear, Settings.COMMON.items.voidTear.absorbWhenCreated.get()); + NBTHelper.putBoolean("enabled", voidTear, Config.COMMON.items.voidTear.absorbWhenCreated.get()); } @Override @@ -230,10 +189,11 @@ public void inventoryTick(ItemStack voidTear, Level world, Entity entity, int sl } private void fillTear(ItemStack voidTear, Player player, ItemStack contents) { - int itemQuantity = InventoryHelper.getItemHandlerFrom(player).map(h -> InventoryHelper.getItemQuantity(contents, h)).orElse(9); + IItemHandler playerInventory = InventoryHelper.getItemHandlerFrom(player); + int itemQuantity = InventoryHelper.getItemQuantity(contents, playerInventory); //doesn't absorb in creative mode.. this is mostly for testing, it prevents the item from having unlimited *whatever* for eternity. - if (getItemQuantity(voidTear) <= Settings.COMMON.items.voidTear.itemLimit.get() && itemQuantity > getKeepQuantity(voidTear) && InventoryHelper.consumeItem(contents, player, getKeepQuantity(voidTear), itemQuantity - getKeepQuantity(voidTear)) && !player.isCreative()) { + if (getItemQuantity(voidTear) <= Config.COMMON.items.voidTear.itemLimit.get() && itemQuantity > getKeepQuantity(voidTear) && InventoryHelper.consumeItem(contents, player, getKeepQuantity(voidTear), itemQuantity - getKeepQuantity(voidTear)) && !player.isCreative()) { setItemQuantity(voidTear, getItemQuantity(voidTear) + itemQuantity - getKeepQuantity(voidTear)); } if (getMode(voidTear) != Mode.NO_REFILL) { @@ -242,7 +202,8 @@ private void fillTear(ItemStack voidTear, Player player, ItemStack contents) { } private void attemptToReplenish(Player player, ItemStack voidTear) { - if (Boolean.TRUE.equals(InventoryHelper.getItemHandlerFrom(player).map(h -> fillFirstFirstStackFound(voidTear, h)).orElse(false))) { + IItemHandler playerInventory = InventoryHelper.getItemHandlerFrom(player); + if (fillFirstFirstStackFound(voidTear, playerInventory)) { return; } @@ -282,22 +243,22 @@ public InteractionResult onItemUseFirst(ItemStack stack, UseOnContext context) { return InteractionResult.PASS; } InteractionHand hand = context.getHand(); - Level world = context.getLevel(); + Level level = context.getLevel(); BlockPos pos = context.getClickedPos(); ItemStack voidTear = player.getItemInHand(hand); - if (world.getBlockState(pos).getBlock() instanceof PedestalBlock) { + if (level.getBlockState(pos).getBlock() instanceof PedestalBlock) { return InteractionResult.PASS; } - LazyOptional handler = WorldHelper.getBlockEntity(world, pos).map(InventoryHelper::getItemHandlerFrom).orElse(LazyOptional.empty()); - if (handler.isPresent()) { - return handler.map(h -> processItemHandlerInteraction(player, hand, world, voidTear, h)).orElse(InteractionResult.FAIL); - } else if (!world.isClientSide && hasPlaceableBlock(voidTear) && getItemQuantity(voidTear) > 0) { + IItemHandler handler = level.getCapability(Capabilities.ItemHandler.BLOCK, pos, null); + if (handler != null) { + return processItemHandlerInteraction(player, hand, level, voidTear, handler); + } else if (!level.isClientSide && hasPlaceableBlock(voidTear) && getItemQuantity(voidTear) > 0) { ItemStack containerItem = getTearContents(voidTear); BlockItem itemBlock = (BlockItem) containerItem.getItem(); Direction face = context.getClickedFace(); - NoPlayerBlockItemUseContext noPlayerBlockItemUseContext = new NoPlayerBlockItemUseContext(world, pos, new ItemStack(itemBlock), face); + NoPlayerBlockItemUseContext noPlayerBlockItemUseContext = new NoPlayerBlockItemUseContext(level, pos, new ItemStack(itemBlock), face); if (noPlayerBlockItemUseContext.canPlace() && itemBlock.place(noPlayerBlockItemUseContext).consumesAction()) { setItemQuantity(voidTear, getItemQuantity(voidTear) - 1); } @@ -376,7 +337,7 @@ private void drainInventory(ItemStack stack, Player player, IItemHandler invento ItemStack contents = getTearContents(stack); int quantity = getItemQuantity(stack); - int quantityDrained = InventoryHelper.tryToRemoveFromInventory(contents, inventory, Settings.COMMON.items.voidTear.itemLimit.get() - quantity); + int quantityDrained = InventoryHelper.tryToRemoveFromInventory(contents, inventory, Config.COMMON.items.voidTear.itemLimit.get() - quantity); if (quantityDrained <= 0) { return; @@ -387,40 +348,7 @@ private void drainInventory(ItemStack stack, Player player, IItemHandler invento setItemQuantity(stack, quantity + quantityDrained); } - @Nullable - @Override - public CompoundTag getShareTag(ItemStack voidTear) { - CompoundTag nbt = super.getShareTag(voidTear); - - if (isEmpty(voidTear)) { - return nbt; - } - - if (nbt == null) { - nbt = new CompoundTag(); - } - nbt.putInt("count", getItemQuantity(voidTear)); - nbt.put(CONTENTS_TAG, getTearContents(voidTear).save(new CompoundTag())); - - return nbt; - } - - public ItemStack getTearContents(ItemStack voidTear) { - return getTearContents(voidTear, false); - } - - public static ItemStack getTearContents(ItemStack voidTear, boolean isClient) { - if (isClient) { - CompoundTag nbt = voidTear.getTag(); - if (nbt == null || !nbt.contains(CONTENTS_TAG)) { - return ItemStack.EMPTY; - } - ItemStack contents = ItemStack.of(nbt.getCompound(CONTENTS_TAG)); - contents.setCount(nbt.getInt("count")); - - return contents; - } - + public static ItemStack getTearContents(ItemStack voidTear) { return getFromHandler(voidTear, VoidTearItemStackHandler::getTotalAmountStack).orElse(ItemStack.EMPTY); } @@ -532,7 +460,8 @@ private void onItemPickup(EntityItemPickupEvent event) { private boolean tryToPickupWithTear(EntityItemPickupEvent event, ItemStack pickedUpStack, Player player, ItemEntity itemEntity, ItemStack tearStack) { int tearItemQuantity = getItemQuantity(tearStack); if (canAbsorbStack(pickedUpStack, tearStack)) { - int playerItemQuantity = InventoryHelper.getItemHandlerFrom(player).map(h -> InventoryHelper.getItemQuantity(pickedUpStack, h)).orElse(0); + IItemHandler playerInventory = InventoryHelper.getItemHandlerFrom(player); + int playerItemQuantity = InventoryHelper.getItemQuantity(pickedUpStack, playerInventory); if (playerItemQuantity + pickedUpStack.getCount() >= getKeepQuantity(tearStack) || player.getInventory().getFreeSlot() == -1) { setItemQuantity(tearStack, tearItemQuantity + pickedUpStack.getCount()); @@ -549,18 +478,10 @@ private boolean tryToPickupWithTear(EntityItemPickupEvent event, ItemStack picke } boolean canAbsorbStack(ItemStack pickedUpStack, ItemStack tearStack) { - return ItemHandlerHelper.canItemStacksStack(getTearContents(tearStack), pickedUpStack) && getItemQuantity(tearStack) + pickedUpStack.getCount() <= Settings.COMMON.items.voidTear.itemLimit.get(); + return ItemHandlerHelper.canItemStacksStack(getTearContents(tearStack), pickedUpStack) && getItemQuantity(tearStack) + pickedUpStack.getCount() <= Config.COMMON.items.voidTear.itemLimit.get(); } public boolean isEmpty(ItemStack voidTear) { - return isEmpty(voidTear, false); - } - - public static boolean isEmpty(ItemStack voidTear, boolean isClient) { - if (isClient) { - return getTearContents(voidTear, true).isEmpty(); - } - return !hasEnabledTag(voidTear) || getFromHandler(voidTear, h -> h.getStackSlots() <= 0 || h.getContainedAmount() <= 0).orElse(true); } diff --git a/src/main/java/reliquary/items/WitchHatItem.java b/src/main/java/reliquary/items/WitchHatItem.java index 19f88913..6a6f0422 100644 --- a/src/main/java/reliquary/items/WitchHatItem.java +++ b/src/main/java/reliquary/items/WitchHatItem.java @@ -13,7 +13,7 @@ import net.minecraft.world.item.ArmorMaterial; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; -import net.minecraftforge.client.extensions.common.IClientItemExtensions; +import net.neoforged.neoforge.client.extensions.common.IClientItemExtensions; import reliquary.client.model.WitchHatModel; import reliquary.handler.ClientEventHandler; import reliquary.reference.Reference; diff --git a/src/main/java/reliquary/items/WitherlessRoseItem.java b/src/main/java/reliquary/items/WitherlessRoseItem.java index e2e8678a..0fde5a3a 100644 --- a/src/main/java/reliquary/items/WitherlessRoseItem.java +++ b/src/main/java/reliquary/items/WitherlessRoseItem.java @@ -8,19 +8,17 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Rarity; import net.minecraft.world.level.Level; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.living.LivingAttackEvent; -import net.minecraftforge.event.entity.living.MobEffectEvent; -import net.minecraftforge.eventbus.api.Event; +import net.neoforged.bus.api.Event; +import net.neoforged.neoforge.common.NeoForge; +import net.neoforged.neoforge.event.entity.living.LivingAttackEvent; +import net.neoforged.neoforge.event.entity.living.MobEffectEvent; import reliquary.util.InventoryHelper; public class WitherlessRoseItem extends ItemBase { public WitherlessRoseItem() { super(new Properties().stacksTo(1)); - MinecraftForge.EVENT_BUS.addListener(this::preventWither); - MinecraftForge.EVENT_BUS.addListener(this::preventWitherAttack); + NeoForge.EVENT_BUS.addListener(this::preventWither); + NeoForge.EVENT_BUS.addListener(this::preventWitherAttack); } @Override @@ -29,14 +27,13 @@ public Rarity getRarity(ItemStack stack) { } @Override - @OnlyIn(Dist.CLIENT) public boolean isFoil(ItemStack stack) { return true; } private void preventWither(MobEffectEvent.Applicable event) { LivingEntity entityLiving = event.getEntity(); - if (entityLiving instanceof Player player && event.getEffectInstance().getEffect() == MobEffects.WITHER && InventoryHelper.playerHasItem(player, this)) { + if (entityLiving instanceof Player player && event.getEffectInstance() != null && event.getEffectInstance().getEffect() == MobEffects.WITHER && InventoryHelper.playerHasItem(player, this)) { event.setResult(Event.Result.DENY); addPreventParticles((Player) entityLiving); } diff --git a/src/main/java/reliquary/items/block/BlockItemBase.java b/src/main/java/reliquary/items/block/BlockItemBase.java index 4a1bcadd..7e12d8dc 100644 --- a/src/main/java/reliquary/items/block/BlockItemBase.java +++ b/src/main/java/reliquary/items/block/BlockItemBase.java @@ -7,8 +7,6 @@ import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; import reliquary.items.ICreativeTabItemGenerator; import javax.annotation.Nullable; @@ -33,7 +31,6 @@ public BlockItemBase(Block block, Properties builder) { } @Override - @OnlyIn(Dist.CLIENT) public void appendHoverText(ItemStack stack, @Nullable Level world, List tooltip, TooltipFlag flag) { tooltip.add(Component.translatable(getDescriptionId() + ".tooltip").withStyle(ChatFormatting.GRAY)); } diff --git a/src/main/java/reliquary/items/util/FilteredItemHandlerProvider.java b/src/main/java/reliquary/items/util/FilteredItemHandlerProvider.java deleted file mode 100644 index a28a3698..00000000 --- a/src/main/java/reliquary/items/util/FilteredItemHandlerProvider.java +++ /dev/null @@ -1,34 +0,0 @@ -package reliquary.items.util; - -import net.minecraft.core.Direction; -import net.minecraft.nbt.CompoundTag; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.capabilities.ICapabilitySerializable; -import net.minecraftforge.common.util.LazyOptional; - -import javax.annotation.Nullable; -import java.util.List; - -public class FilteredItemHandlerProvider implements ICapabilitySerializable { - private final FilteredItemStackHandler itemHandler; - - public FilteredItemHandlerProvider(List filteredItemStacks) { - itemHandler = new FilteredItemStackHandler(filteredItemStacks); - } - - @Override - public CompoundTag serializeNBT() { - return itemHandler.serializeNBT(); - } - - @Override - public void deserializeNBT(CompoundTag tagCompound) { - itemHandler.deserializeNBT(tagCompound); - } - - @Override - public LazyOptional getCapability(Capability capability, @Nullable Direction side) { - return ForgeCapabilities.ITEM_HANDLER.orEmpty(capability, LazyOptional.of(() -> itemHandler)); - } -} diff --git a/src/main/java/reliquary/items/util/FilteredItemStack.java b/src/main/java/reliquary/items/util/FilteredItemStack.java index 9103a258..cf8ca443 100644 --- a/src/main/java/reliquary/items/util/FilteredItemStack.java +++ b/src/main/java/reliquary/items/util/FilteredItemStack.java @@ -3,8 +3,8 @@ import net.minecraft.nbt.CompoundTag; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.common.util.INBTSerializable; -import net.minecraftforge.items.ItemHandlerHelper; +import net.neoforged.neoforge.common.util.INBTSerializable; +import net.neoforged.neoforge.items.ItemHandlerHelper; public class FilteredItemStack implements INBTSerializable { private ItemStack filter; @@ -50,7 +50,7 @@ public ItemStack getStack() { @Override public CompoundTag serializeNBT() { CompoundTag ret = new CompoundTag(); - ret.put("filter", filter.serializeNBT()); + ret.put("filter", filter.save(new CompoundTag())); ret.putInt("amount", count); return ret; } diff --git a/src/main/java/reliquary/items/util/FilteredItemStackHandler.java b/src/main/java/reliquary/items/util/FilteredItemStackHandler.java index 59883c3c..4910ab94 100644 --- a/src/main/java/reliquary/items/util/FilteredItemStackHandler.java +++ b/src/main/java/reliquary/items/util/FilteredItemStackHandler.java @@ -4,12 +4,14 @@ import net.minecraft.nbt.ListTag; import net.minecraft.nbt.Tag; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.common.util.INBTSerializable; -import net.minecraftforge.items.IItemHandler; -import net.minecraftforge.items.IItemHandlerModifiable; -import net.minecraftforge.items.ItemHandlerHelper; +import net.neoforged.neoforge.common.util.INBTSerializable; +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.items.IItemHandlerModifiable; +import net.neoforged.neoforge.items.ItemHandlerHelper; import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.Collections; import java.util.List; public class FilteredItemStackHandler implements IItemHandler, IItemHandlerModifiable, INBTSerializable { @@ -17,7 +19,12 @@ public class FilteredItemStackHandler implements IItemHandler, IItemHandlerModif private final List filteredItemStacks; private static final String NOT_IN_RANGE_ERROR = "%s %d not in valid range - (0, %d)"; - FilteredItemStackHandler(List filteredItemStacks) { + public FilteredItemStackHandler(FilteredItemStack... filteredItemStacks) { + this.filteredItemStacks = new ArrayList<>(); + Collections.addAll(this.filteredItemStacks, filteredItemStacks); + } + + public FilteredItemStackHandler(List filteredItemStacks) { this.filteredItemStacks = filteredItemStacks; } @@ -34,6 +41,7 @@ public int getTotalAmount(int stackSlot) { return filteredItemStacks.get(stackSlot).getCount(); } + private void validateStackSlot(int stackSlot) { if (stackSlot < 0 || stackSlot >= filteredItemStacks.size()) { throw new IllegalArgumentException(String.format(NOT_IN_RANGE_ERROR, "Big Stack Slot", stackSlot, filteredItemStacks.size() - 1)); diff --git a/src/main/java/reliquary/items/util/HarvestRodCache.java b/src/main/java/reliquary/items/util/HarvestRodCache.java index daba31e5..9ceff6de 100644 --- a/src/main/java/reliquary/items/util/HarvestRodCache.java +++ b/src/main/java/reliquary/items/util/HarvestRodCache.java @@ -2,50 +2,50 @@ import net.minecraft.core.BlockPos; +import javax.annotation.Nullable; import java.util.ArrayDeque; import java.util.Optional; import java.util.Queue; -public class HarvestRodCache implements IHarvestRodCache { - +public class HarvestRodCache { + @Nullable private BlockPos startBlockPos; private final Queue blockQueue; + private HarvestRodCache(Queue blockQueue, @Nullable BlockPos startBlockPos) { + this.blockQueue = blockQueue; + this.startBlockPos = startBlockPos; + } + public HarvestRodCache() { - blockQueue = new ArrayDeque<>(); + this(new ArrayDeque<>(), null); } - @Override public void setStartBlockPos(BlockPos pos) { startBlockPos = pos; } - @Override + @Nullable public BlockPos getStartBlockPos() { return startBlockPos; } - @Override public void addBlockToQueue(BlockPos pos) { blockQueue.add(pos); } - @Override public Optional getNextBlockInQueue() { return Optional.ofNullable(blockQueue.poll()); } - @Override public void clearBlockQueue() { blockQueue.clear(); } - @Override public boolean isQueueEmpty() { - return blockQueue.isEmpty(); + return blockQueue.isEmpty() || startBlockPos == null; } - @Override public void reset() { startBlockPos = null; blockQueue.clear(); diff --git a/src/main/java/reliquary/items/util/HarvestRodItemStackHandler.java b/src/main/java/reliquary/items/util/HarvestRodItemStackHandler.java index 2aa1eced..1d70fbf4 100644 --- a/src/main/java/reliquary/items/util/HarvestRodItemStackHandler.java +++ b/src/main/java/reliquary/items/util/HarvestRodItemStackHandler.java @@ -5,8 +5,8 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.block.BonemealableBlock; -import net.minecraftforge.common.IPlantable; -import reliquary.reference.Settings; +import net.neoforged.neoforge.common.IPlantable; +import reliquary.reference.Config; import java.util.ArrayList; import java.util.List; @@ -17,8 +17,8 @@ public class HarvestRodItemStackHandler extends FilteredItemStackHandler { private static List getDefaultStacks() { List stacks = new ArrayList<>(); - stacks.add(new FilteredItemStack(Items.BONE_MEAL, Settings.COMMON.items.harvestRod.boneMealLimit.get(), - Settings.COMMON.items.harvestRod.boneMealWorth.get(), false)); + stacks.add(new FilteredItemStack(Items.BONE_MEAL, Config.COMMON.items.harvestRod.boneMealLimit.get(), + Config.COMMON.items.harvestRod.boneMealWorth.get(), false)); return stacks; } @@ -29,7 +29,7 @@ public HarvestRodItemStackHandler() { @Override protected int getDynamicStackLimit() { - return Settings.COMMON.items.harvestRod.maxCapacityPerPlantable.get(); + return Config.COMMON.items.harvestRod.maxCapacityPerPlantable.get(); } @Override diff --git a/src/main/java/reliquary/items/util/IHarvestRodCache.java b/src/main/java/reliquary/items/util/IHarvestRodCache.java deleted file mode 100644 index 565d3b41..00000000 --- a/src/main/java/reliquary/items/util/IHarvestRodCache.java +++ /dev/null @@ -1,21 +0,0 @@ -package reliquary.items.util; - -import net.minecraft.core.BlockPos; - -import java.util.Optional; - -public interface IHarvestRodCache { - void setStartBlockPos(BlockPos pos); - - BlockPos getStartBlockPos(); - - void addBlockToQueue(BlockPos pos); - - Optional getNextBlockInQueue(); - - void clearBlockQueue(); - - boolean isQueueEmpty(); - - void reset(); -} diff --git a/src/main/java/reliquary/items/util/VoidTearItemStackHandler.java b/src/main/java/reliquary/items/util/VoidTearItemStackHandler.java index 154fba88..358610a2 100644 --- a/src/main/java/reliquary/items/util/VoidTearItemStackHandler.java +++ b/src/main/java/reliquary/items/util/VoidTearItemStackHandler.java @@ -1,19 +1,17 @@ package reliquary.items.util; import net.minecraft.world.item.ItemStack; -import reliquary.reference.Settings; - -import java.util.ArrayList; +import reliquary.reference.Config; public class VoidTearItemStackHandler extends FilteredItemStackHandler { private static final int FIRST_SLOT = 0; public VoidTearItemStackHandler() { - super(new ArrayList<>()); + super(new FilteredItemStack(ItemStack.EMPTY, Config.COMMON.items.voidTear.itemLimit.get(), true)); } public void setContainedStack(ItemStack stack) { - setFilteredStack(FIRST_SLOT, new FilteredItemStack(stack, Settings.COMMON.items.voidTear.itemLimit.get(), true)); + setFilteredStack(FIRST_SLOT, new FilteredItemStack(stack, Config.COMMON.items.voidTear.itemLimit.get(), true)); } public void setContainedStackAmount(int amount) { diff --git a/src/main/java/reliquary/items/util/fluid/FluidHandlerEmperorChalice.java b/src/main/java/reliquary/items/util/fluid/FluidHandlerEmperorChalice.java index f6b19f90..6778abbd 100644 --- a/src/main/java/reliquary/items/util/fluid/FluidHandlerEmperorChalice.java +++ b/src/main/java/reliquary/items/util/fluid/FluidHandlerEmperorChalice.java @@ -1,20 +1,13 @@ package reliquary.items.util.fluid; -import net.minecraft.core.Direction; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.material.Fluids; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.capabilities.ICapabilityProvider; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidType; -import net.minecraftforge.fluids.capability.IFluidHandlerItem; +import net.neoforged.neoforge.fluids.FluidStack; +import net.neoforged.neoforge.fluids.FluidType; +import net.neoforged.neoforge.fluids.capability.IFluidHandlerItem; import reliquary.init.ModItems; -import javax.annotation.Nullable; - -public class FluidHandlerEmperorChalice implements IFluidHandlerItem, ICapabilityProvider { +public class FluidHandlerEmperorChalice implements IFluidHandlerItem { public static final FluidStack BUCKET_OF_WATER = new FluidStack(Fluids.WATER, FluidType.BUCKET_VOLUME); private final ItemStack chalice; @@ -23,11 +16,6 @@ public FluidHandlerEmperorChalice(ItemStack chalice) { this.chalice = chalice; } - @Override - public LazyOptional getCapability(Capability cap, @Nullable Direction side) { - return ForgeCapabilities.FLUID_HANDLER_ITEM.orEmpty(cap, LazyOptional.of(() -> this)); - } - @Override public ItemStack getContainer() { return chalice; diff --git a/src/main/java/reliquary/items/util/fluid/FluidHandlerHeroMedallion.java b/src/main/java/reliquary/items/util/fluid/FluidHandlerHeroMedallion.java index c0b2dc20..00ea687e 100644 --- a/src/main/java/reliquary/items/util/fluid/FluidHandlerHeroMedallion.java +++ b/src/main/java/reliquary/items/util/fluid/FluidHandlerHeroMedallion.java @@ -1,20 +1,13 @@ package reliquary.items.util.fluid; -import net.minecraft.core.Direction; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.capabilities.ICapabilityProvider; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.capability.IFluidHandlerItem; +import net.neoforged.neoforge.fluids.FluidStack; +import net.neoforged.neoforge.fluids.capability.IFluidHandlerItem; import reliquary.init.ModFluids; import reliquary.init.ModItems; import reliquary.util.XpHelper; -import javax.annotation.Nullable; - -public class FluidHandlerHeroMedallion implements IFluidHandlerItem, ICapabilityProvider { +public class FluidHandlerHeroMedallion implements IFluidHandlerItem { private static final int MAX_CAPACITY = Integer.MAX_VALUE; private final ItemStack heroMedallion; @@ -27,11 +20,6 @@ public ItemStack getContainer() { return heroMedallion; } - @Override - public LazyOptional getCapability(Capability cap, @Nullable Direction side) { - return ForgeCapabilities.FLUID_HANDLER_ITEM.orEmpty(cap, LazyOptional.of(() -> this)); - } - @Override public int getTanks() { return 1; diff --git a/src/main/java/reliquary/items/util/fluid/FluidHandlerInfernalChalice.java b/src/main/java/reliquary/items/util/fluid/FluidHandlerInfernalChalice.java index 6f0f7ffc..cf4ddf2c 100644 --- a/src/main/java/reliquary/items/util/fluid/FluidHandlerInfernalChalice.java +++ b/src/main/java/reliquary/items/util/fluid/FluidHandlerInfernalChalice.java @@ -4,16 +4,16 @@ import net.minecraft.tags.FluidTags; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.material.Fluids; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.capability.templates.FluidHandlerItemStack; +import net.neoforged.neoforge.fluids.FluidStack; +import net.neoforged.neoforge.fluids.capability.templates.FluidHandlerItemStack; import reliquary.init.ModItems; -import reliquary.reference.Settings; +import reliquary.reference.Config; public class FluidHandlerInfernalChalice extends FluidHandlerItemStack { private static final String FLUID_STACKS_TAG = "fluidStacks"; public FluidHandlerInfernalChalice(ItemStack chalice) { - super(chalice, Settings.COMMON.items.infernalChalice.fluidLimit.get()); + super(chalice, Config.COMMON.items.infernalChalice.fluidLimit.get()); } @Override diff --git a/src/main/java/reliquary/network/PacketFortuneCoinTogglePressed.java b/src/main/java/reliquary/network/FortuneCoinTogglePressedPacket.java similarity index 54% rename from src/main/java/reliquary/network/PacketFortuneCoinTogglePressed.java rename to src/main/java/reliquary/network/FortuneCoinTogglePressedPacket.java index a195f6b0..6f7a6eac 100644 --- a/src/main/java/reliquary/network/PacketFortuneCoinTogglePressed.java +++ b/src/main/java/reliquary/network/FortuneCoinTogglePressedPacket.java @@ -3,54 +3,46 @@ import net.minecraft.ChatFormatting; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.chat.Component; -import net.minecraft.server.level.ServerPlayer; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.network.NetworkEvent; +import net.neoforged.neoforge.network.handling.PlayPayloadContext; import reliquary.compat.curios.CuriosCompat; import reliquary.init.ModItems; import reliquary.items.FortuneCoinItem; +import reliquary.reference.Reference; -import javax.annotation.Nullable; import java.util.function.Supplier; -public class PacketFortuneCoinTogglePressed { - +public class FortuneCoinTogglePressedPacket implements CustomPacketPayload { + public static final ResourceLocation ID = new ResourceLocation(Reference.MOD_ID, "fortune_coin_toggle_pressed"); private final InventoryType inventoryType; private final int slot; private final String identifier; - public PacketFortuneCoinTogglePressed(InventoryType inventoryType, int slot) { + public FortuneCoinTogglePressedPacket(InventoryType inventoryType, int slot) { this(inventoryType, "", slot); } - public PacketFortuneCoinTogglePressed(InventoryType inventoryType, String identifier, int slot) { + + public FortuneCoinTogglePressedPacket(InventoryType inventoryType, String identifier, int slot) { this.inventoryType = inventoryType; this.identifier = identifier; this.slot = slot; } - static void encode(PacketFortuneCoinTogglePressed msg, FriendlyByteBuf packetBuffer) { - packetBuffer.writeByte(msg.inventoryType.ordinal()); - packetBuffer.writeUtf(msg.identifier); - packetBuffer.writeInt(msg.slot); + public FortuneCoinTogglePressedPacket(FriendlyByteBuf packetBuffer) { + this(InventoryType.values()[packetBuffer.readByte()], packetBuffer.readUtf(), packetBuffer.readInt()); } - static PacketFortuneCoinTogglePressed decode(FriendlyByteBuf packetBuffer) { - return new PacketFortuneCoinTogglePressed(InventoryType.values()[packetBuffer.readByte()], packetBuffer.readUtf(), packetBuffer.readInt()); + public void handle(PlayPayloadContext context) { + context.workHandler().execute(() -> context.player().ifPresent(p -> handleMessage(p, inventoryType, slot, identifier))); } - static void onMessage(PacketFortuneCoinTogglePressed msg, Supplier contextSupplier) { - NetworkEvent.Context context = contextSupplier.get(); - context.enqueueWork(() -> handleMessage(msg, context.getSender())); - context.setPacketHandled(true); - } - - private static void handleMessage(PacketFortuneCoinTogglePressed message, @Nullable ServerPlayer player) { - if (player == null) { - return; - } - switch (message.inventoryType) { + private static void handleMessage(Player player, InventoryType inventoryType, int slot, String identifier) { + switch (inventoryType) { case MAIN -> { - ItemStack stack2 = player.getInventory().items.get(message.slot); + ItemStack stack2 = player.getInventory().items.get(slot); if (stack2.getItem() == ModItems.FORTUNE_COIN.get()) { ModItems.FORTUNE_COIN.get().toggle(stack2); showMessage(player, stack2); @@ -63,18 +55,18 @@ private static void handleMessage(PacketFortuneCoinTogglePressed message, @Nulla showMessage(player, stack1); } } - case CURIOS -> run(() -> () -> CuriosCompat.getStackInSlot(player, message.identifier, message.slot) + case CURIOS -> run(() -> () -> CuriosCompat.getStackInSlot(player, identifier, slot) .ifPresent(stack -> { if (stack.getItem() == ModItems.FORTUNE_COIN.get()) { ModItems.FORTUNE_COIN.get().toggle(stack); showMessage(player, stack); - CuriosCompat.setStackInSlot(player, message.identifier, message.slot, stack); + CuriosCompat.setStackInSlot(player, identifier, slot, stack); } })); } } - private static void showMessage(ServerPlayer player, ItemStack fortuneCoin) { + private static void showMessage(Player player, ItemStack fortuneCoin) { player.displayClientMessage(Component.translatable("chat.reliquary.fortune_coin.toggle", FortuneCoinItem.isEnabled(fortuneCoin) ? Component.translatable("chat.reliquary.fortune_coin.on").withStyle(ChatFormatting.GREEN) @@ -86,6 +78,18 @@ private static void run(Supplier toRun) { toRun.get().run(); } + @Override + public void write(FriendlyByteBuf buffer) { + buffer.writeByte(inventoryType.ordinal()); + buffer.writeUtf(identifier); + buffer.writeInt(slot); + } + + @Override + public ResourceLocation id() { + return ID; + } + public enum InventoryType { MAIN, OFF_HAND, diff --git a/src/main/java/reliquary/network/MobCharmDamagePacket.java b/src/main/java/reliquary/network/MobCharmDamagePacket.java new file mode 100644 index 00000000..bc268ff4 --- /dev/null +++ b/src/main/java/reliquary/network/MobCharmDamagePacket.java @@ -0,0 +1,43 @@ +package reliquary.network; + +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.ItemStack; +import net.neoforged.neoforge.network.handling.PlayPayloadContext; +import reliquary.client.gui.hud.CharmPane; +import reliquary.reference.Reference; + +public class MobCharmDamagePacket implements CustomPacketPayload { + public static final ResourceLocation ID = new ResourceLocation(Reference.MOD_ID, "mob_charm_damage"); + private final ItemStack mobCharm; + private final int slot; + + public MobCharmDamagePacket(ItemStack mobCharm, int slot) { + this.mobCharm = mobCharm; + this.slot = slot; + } + + public MobCharmDamagePacket(FriendlyByteBuf packetBuffer) { + this(packetBuffer.readItem(), packetBuffer.readByte()); + } + + public void handle(PlayPayloadContext context) { + context.workHandler().execute(() -> handleMessage(mobCharm, slot)); + } + + private static void handleMessage(ItemStack mobCharm, int slot) { + CharmPane.addCharmToDraw(mobCharm, slot); + } + + @Override + public void write(FriendlyByteBuf buffer) { + buffer.writeItem(mobCharm); + buffer.writeByte(slot); + } + + @Override + public ResourceLocation id() { + return ID; + } +} diff --git a/src/main/java/reliquary/network/PacketFXConcussiveExplosion.java b/src/main/java/reliquary/network/PacketFXConcussiveExplosion.java deleted file mode 100644 index 038c3677..00000000 --- a/src/main/java/reliquary/network/PacketFXConcussiveExplosion.java +++ /dev/null @@ -1,50 +0,0 @@ -package reliquary.network; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.multiplayer.ClientLevel; -import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.world.phys.Vec3; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.network.NetworkEvent; -import reliquary.entities.ConcussiveExplosion; - -import java.util.function.Supplier; - -public class PacketFXConcussiveExplosion { - private final float size; - private final Vec3 pos; - - public PacketFXConcussiveExplosion(float size, Vec3 pos) { - this.size = size; - this.pos = pos; - } - - static void encode(PacketFXConcussiveExplosion msg, FriendlyByteBuf packetBuffer) { - packetBuffer.writeFloat(msg.size); - packetBuffer.writeDouble(msg.pos.x()); - packetBuffer.writeDouble(msg.pos.y()); - packetBuffer.writeDouble(msg.pos.z()); - } - - static PacketFXConcussiveExplosion decode(FriendlyByteBuf packetBuffer) { - return new PacketFXConcussiveExplosion(packetBuffer.readFloat(), new Vec3(packetBuffer.readDouble(), packetBuffer.readDouble(), packetBuffer.readDouble())); - } - - static void onMessage(PacketFXConcussiveExplosion msg, Supplier contextSupplier) { - NetworkEvent.Context context = contextSupplier.get(); - context.enqueueWork(() -> handleMessage(msg)); - context.setPacketHandled(true); - } - - @OnlyIn(Dist.CLIENT) - private static void handleMessage(PacketFXConcussiveExplosion message) { - ClientLevel level = Minecraft.getInstance().level; - if (level == null) { - return; - } - - ConcussiveExplosion explosion = new ConcussiveExplosion(level, null, null, message.pos, message.size, false); - explosion.finalizeExplosion(false); - } -} diff --git a/src/main/java/reliquary/network/PacketFXThrownPotionImpact.java b/src/main/java/reliquary/network/PacketFXThrownPotionImpact.java deleted file mode 100644 index eacd385b..00000000 --- a/src/main/java/reliquary/network/PacketFXThrownPotionImpact.java +++ /dev/null @@ -1,73 +0,0 @@ -package reliquary.network; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.particle.Particle; -import net.minecraft.core.particles.ParticleTypes; -import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.util.RandomSource; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.network.NetworkEvent; - -import java.util.function.Supplier; - -public class PacketFXThrownPotionImpact { - private final int color; - private final double posX; - private final double posY; - private final double posZ; - - public PacketFXThrownPotionImpact(int color, double x, double y, double z) { - this.color = color; - posX = x; - posY = y; - posZ = z; - } - - static void encode(PacketFXThrownPotionImpact msg, FriendlyByteBuf packetBuffer) { - packetBuffer.writeInt(msg.color); - packetBuffer.writeDouble(msg.posX); - packetBuffer.writeDouble(msg.posY); - packetBuffer.writeDouble(msg.posZ); - } - - static PacketFXThrownPotionImpact decode(FriendlyByteBuf packetBuffer) { - return new PacketFXThrownPotionImpact(packetBuffer.readInt(), packetBuffer.readDouble(), packetBuffer.readDouble(), packetBuffer.readDouble()); - } - - static void onMessage(PacketFXThrownPotionImpact msg, Supplier contextSupplier) { - NetworkEvent.Context context = contextSupplier.get(); - context.enqueueWork(() -> handleMessage(msg)); - context.setPacketHandled(true); - } - - @OnlyIn(Dist.CLIENT) - private static void handleMessage(PacketFXThrownPotionImpact message) { - Minecraft mc = Minecraft.getInstance(); - if (mc.level == null) { - return; - } - - int color = message.color; - RandomSource rand = mc.level.random; - - float red = (((color >> 16) & 255) / 256F); - float green = (((color >> 8) & 255) / 256F); - float blue = ((color & 255) / 256F); - - for (int i = 0; i < 100; ++i) { - double var39 = rand.nextDouble() * 4.0D; - double angle = rand.nextDouble() * Math.PI * 2.0D; - double xSpeed = Math.cos(angle) * var39; - double ySpeed = 0.01D + rand.nextDouble() * 0.5D; - double zSpeed = Math.sin(angle) * var39; - - Particle particle = mc.particleEngine.createParticle(ParticleTypes.EFFECT, message.posX + xSpeed * 0.1D, message.posY + 0.3D, message.posZ + zSpeed * 0.1D, xSpeed, ySpeed, zSpeed); - if (particle != null) { - float var32 = 0.75F + rand.nextFloat() * 0.25F; - particle.setColor(red * var32, green * var32, blue * var32); - particle.setPower((float) var39); - } - } - } -} diff --git a/src/main/java/reliquary/network/PacketHandler.java b/src/main/java/reliquary/network/PacketHandler.java index cacd8c70..4e5ab4c5 100644 --- a/src/main/java/reliquary/network/PacketHandler.java +++ b/src/main/java/reliquary/network/PacketHandler.java @@ -1,43 +1,37 @@ package reliquary.network; -import net.minecraft.resources.ResourceLocation; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; import net.minecraft.server.level.ServerPlayer; -import net.minecraftforge.network.NetworkDirection; -import net.minecraftforge.network.NetworkRegistry; -import net.minecraftforge.network.PacketDistributor; -import net.minecraftforge.network.simple.SimpleChannel; +import net.minecraft.world.entity.Entity; +import net.neoforged.neoforge.network.PacketDistributor; +import net.neoforged.neoforge.network.event.RegisterPayloadHandlerEvent; +import net.neoforged.neoforge.network.registration.IPayloadRegistrar; import reliquary.reference.Reference; public class PacketHandler { - private PacketHandler() {} - - private static SimpleChannel networkWrapper; - private static final String PROTOCOL = "1"; - - public static void init() { - networkWrapper = NetworkRegistry.newSimpleChannel(new ResourceLocation(Reference.MOD_ID, "channel"), - () -> PROTOCOL, PROTOCOL::equals, PROTOCOL::equals); - - int idx = 0; - networkWrapper.registerMessage(idx++, PacketFXThrownPotionImpact.class, PacketFXThrownPotionImpact::encode, PacketFXThrownPotionImpact::decode, PacketFXThrownPotionImpact::onMessage); - networkWrapper.registerMessage(idx++, PacketFXConcussiveExplosion.class, PacketFXConcussiveExplosion::encode, PacketFXConcussiveExplosion::decode, PacketFXConcussiveExplosion::onMessage); - networkWrapper.registerMessage(idx++, PacketMobCharmDamage.class, PacketMobCharmDamage::encode, PacketMobCharmDamage::decode, PacketMobCharmDamage::onMessage); - networkWrapper.registerMessage(idx++, PacketPedestalFishHook.class, PacketPedestalFishHook::encode, PacketPedestalFishHook::decode, PacketPedestalFishHook::onMessage); - networkWrapper.registerMessage(idx++, PacketFortuneCoinTogglePressed.class, PacketFortuneCoinTogglePressed::encode, PacketFortuneCoinTogglePressed::decode, PacketFortuneCoinTogglePressed::onMessage); - networkWrapper.registerMessage(idx++, SpawnAngelheartVialParticlesPacket.class, (msg, packetBuffer) -> SpawnAngelheartVialParticlesPacket.encode(), packetBuffer1 -> SpawnAngelheartVialParticlesPacket.decode(), (spawnAngelheartVialParticlesPacket, contextSupplier) -> SpawnAngelheartVialParticlesPacket.onMessage(contextSupplier)); - networkWrapper.registerMessage(idx++, SpawnPhoenixDownParticlesPacket.class, SpawnPhoenixDownParticlesPacket::encode, packetBuffer2 -> SpawnPhoenixDownParticlesPacket.decode(), SpawnPhoenixDownParticlesPacket::onMessage); - networkWrapper.registerMessage(idx, ScrolledItemPacket.class, ScrolledItemPacket::encode, ScrolledItemPacket::decode, ScrolledItemPacket::onMessage); + private PacketHandler() { } - public static void sendToClient(ServerPlayer player, M message) { - networkWrapper.sendTo(message, player.connection.connection, NetworkDirection.PLAY_TO_CLIENT); + public static void registerPackets(final RegisterPayloadHandlerEvent event) { + final IPayloadRegistrar registrar = event.registrar(Reference.MOD_ID).versioned("1.0"); + registrar.play(SpawnThrownPotionImpactParticlesPacket.ID, SpawnThrownPotionImpactParticlesPacket::new, play -> play.client(SpawnThrownPotionImpactParticlesPacket::handle)); + registrar.play(SpawnAngelheartVialParticlesPacket.ID, SpawnAngelheartVialParticlesPacket::new, play -> play.client(SpawnAngelheartVialParticlesPacket::handle)); + registrar.play(SpawnPhoenixDownParticlesPacket.ID, buffer -> new SpawnPhoenixDownParticlesPacket(), play -> play.client(SpawnPhoenixDownParticlesPacket::handle)); + registrar.play(ScrolledItemPacket.ID, ScrolledItemPacket::new, play -> play.server(ScrolledItemPacket::handle)); + registrar.play(SpawnConcussiveExplosionParticlesPacket.ID, SpawnConcussiveExplosionParticlesPacket::new, play -> play.client(SpawnConcussiveExplosionParticlesPacket::handle)); + registrar.play(MobCharmDamagePacket.ID, MobCharmDamagePacket::new, play -> play.client(MobCharmDamagePacket::handle)); + registrar.play(PedestalFishHookPacket.ID, PedestalFishHookPacket::new, play -> play.client(PedestalFishHookPacket::handle)); + registrar.play(FortuneCoinTogglePressedPacket.ID, FortuneCoinTogglePressedPacket::new, play -> play.server(FortuneCoinTogglePressedPacket::handle)); + } - public static void sendToServer(M message) { - networkWrapper.sendToServer(message); + public static void sendToAllNear(Entity entity, CustomPacketPayload packet, double range) { + PacketDistributor.NEAR.with( + PacketDistributor.TargetPoint.p(entity.getX(), entity.getY(), entity.getZ(), range, entity.level().dimension()).get() + ).send(packet); } - public static void sendToAllAround(M message, PacketDistributor.TargetPoint targetPoint) { - networkWrapper.send(PacketDistributor.NEAR.with(() -> targetPoint), message); + public static void sendToPlayer(ServerPlayer player, CustomPacketPayload packet) { + PacketDistributor.PLAYER.with(player).send(packet); } } diff --git a/src/main/java/reliquary/network/PacketMobCharmDamage.java b/src/main/java/reliquary/network/PacketMobCharmDamage.java deleted file mode 100644 index bc7077ce..00000000 --- a/src/main/java/reliquary/network/PacketMobCharmDamage.java +++ /dev/null @@ -1,42 +0,0 @@ -package reliquary.network; - -import net.minecraft.nbt.CompoundTag; -import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.world.item.ItemStack; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.network.NetworkEvent; -import reliquary.client.gui.hud.CharmPane; - -import java.util.function.Supplier; - -public class PacketMobCharmDamage { - private final ItemStack mobCharm; - private final int slot; - - public PacketMobCharmDamage(ItemStack mobCharm, int slot) { - this.mobCharm = mobCharm; - this.slot = slot; - } - - static void encode(PacketMobCharmDamage msg, FriendlyByteBuf packetBuffer) { - packetBuffer.writeNbt(msg.mobCharm.save(new CompoundTag())); - packetBuffer.writeByte(msg.slot); - } - - static PacketMobCharmDamage decode(FriendlyByteBuf packetBuffer) { - CompoundTag stackNbt = packetBuffer.readNbt(); - return new PacketMobCharmDamage(stackNbt == null ? ItemStack.EMPTY : ItemStack.of(stackNbt), packetBuffer.readByte()); - } - - static void onMessage(PacketMobCharmDamage msg, Supplier contextSupplier) { - NetworkEvent.Context context = contextSupplier.get(); - context.enqueueWork(() -> handleMessage(msg)); - context.setPacketHandled(true); - } - - @OnlyIn(Dist.CLIENT) - private static void handleMessage(PacketMobCharmDamage message) { - CharmPane.addCharmToDraw(message.mobCharm, message.slot); - } -} diff --git a/src/main/java/reliquary/network/PacketPedestalFishHook.java b/src/main/java/reliquary/network/PacketPedestalFishHook.java deleted file mode 100644 index d4977c07..00000000 --- a/src/main/java/reliquary/network/PacketPedestalFishHook.java +++ /dev/null @@ -1,63 +0,0 @@ -package reliquary.network; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.multiplayer.ClientLevel; -import net.minecraft.core.BlockPos; -import net.minecraft.network.FriendlyByteBuf; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.network.NetworkEvent; -import reliquary.api.IPedestal; -import reliquary.client.render.PedestalFishHookRenderer; -import reliquary.util.WorldHelper; - -import java.util.function.Supplier; - -public class PacketPedestalFishHook { - - private final BlockPos pedestalPos; - private final double hookX; - private final double hookY; - private final double hookZ; - - public PacketPedestalFishHook(BlockPos pedestalPos, double hookX, double hookY, double hookZ) { - - this.pedestalPos = pedestalPos; - this.hookX = hookX; - this.hookY = hookY; - this.hookZ = hookZ; - } - - static void encode(PacketPedestalFishHook msg, FriendlyByteBuf packetBuffer) { - packetBuffer.writeInt(msg.pedestalPos.getX()); - packetBuffer.writeInt(msg.pedestalPos.getY()); - packetBuffer.writeInt(msg.pedestalPos.getZ()); - packetBuffer.writeDouble(msg.hookX); - packetBuffer.writeDouble(msg.hookY); - packetBuffer.writeDouble(msg.hookZ); - } - - static PacketPedestalFishHook decode(FriendlyByteBuf packetBuffer) { - return new PacketPedestalFishHook(new BlockPos(packetBuffer.readInt(), packetBuffer.readInt(), packetBuffer.readInt()), - packetBuffer.readDouble(), packetBuffer.readDouble(), packetBuffer.readDouble()); - } - - static void onMessage(PacketPedestalFishHook msg, Supplier contextSupplier) { - NetworkEvent.Context context = contextSupplier.get(); - context.enqueueWork(() -> handleMessage(msg)); - context.setPacketHandled(true); - } - - @OnlyIn(Dist.CLIENT) - private static void handleMessage(PacketPedestalFishHook message) { - ClientLevel world = Minecraft.getInstance().level; - WorldHelper.getBlockEntity(world, message.pedestalPos, IPedestal.class).ifPresent(pedestal -> { - PedestalFishHookRenderer.HookRenderingData data = null; - if (message.hookY > 0) { - data = new PedestalFishHookRenderer.HookRenderingData(message.hookX, message.hookY, message.hookZ); - } - - pedestal.setItemData(data); - }); - } -} diff --git a/src/main/java/reliquary/network/PedestalFishHookPacket.java b/src/main/java/reliquary/network/PedestalFishHookPacket.java new file mode 100644 index 00000000..ef81c847 --- /dev/null +++ b/src/main/java/reliquary/network/PedestalFishHookPacket.java @@ -0,0 +1,64 @@ +package reliquary.network; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.core.BlockPos; +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; +import net.minecraft.resources.ResourceLocation; +import net.neoforged.neoforge.network.handling.PlayPayloadContext; +import reliquary.api.IPedestal; +import reliquary.client.render.PedestalFishHookRenderer; +import reliquary.reference.Reference; +import reliquary.util.WorldHelper; + +public class PedestalFishHookPacket implements CustomPacketPayload { + public static final ResourceLocation ID = new ResourceLocation(Reference.MOD_ID, "pedestal_fish_hook"); + private final BlockPos pedestalPos; + private final double hookX; + private final double hookY; + private final double hookZ; + + public PedestalFishHookPacket(BlockPos pedestalPos, double hookX, double hookY, double hookZ) { + this.pedestalPos = pedestalPos; + this.hookX = hookX; + this.hookY = hookY; + this.hookZ = hookZ; + } + + public PedestalFishHookPacket(FriendlyByteBuf packetBuffer) { + this(new BlockPos(packetBuffer.readInt(), packetBuffer.readInt(), packetBuffer.readInt()), + packetBuffer.readDouble(), packetBuffer.readDouble(), packetBuffer.readDouble()); + } + + public void handle(PlayPayloadContext context) { + context.workHandler().execute(() -> handleMessage(pedestalPos, hookX, hookY, hookZ)); + } + + private static void handleMessage(BlockPos pedestalPos, double hookX, double hookY, double hookZ) { + ClientLevel world = Minecraft.getInstance().level; + WorldHelper.getBlockEntity(world, pedestalPos, IPedestal.class).ifPresent(pedestal -> { + PedestalFishHookRenderer.HookRenderingData data = null; + if (hookY > 0) { + data = new PedestalFishHookRenderer.HookRenderingData(hookX, hookY, hookZ); + } + + pedestal.setItemData(data); + }); + } + + @Override + public void write(FriendlyByteBuf buffer) { + buffer.writeInt(pedestalPos.getX()); + buffer.writeInt(pedestalPos.getY()); + buffer.writeInt(pedestalPos.getZ()); + buffer.writeDouble(hookX); + buffer.writeDouble(hookY); + buffer.writeDouble(hookZ); + } + + @Override + public ResourceLocation id() { + return ID; + } +} diff --git a/src/main/java/reliquary/network/ScrolledItemPacket.java b/src/main/java/reliquary/network/ScrolledItemPacket.java index 86490570..6f92db74 100644 --- a/src/main/java/reliquary/network/ScrolledItemPacket.java +++ b/src/main/java/reliquary/network/ScrolledItemPacket.java @@ -1,40 +1,46 @@ package reliquary.network; import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.server.level.ServerPlayer; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.network.NetworkEvent; +import net.neoforged.neoforge.network.handling.PlayPayloadContext; import reliquary.items.util.IScrollableItem; +import reliquary.reference.Reference; -import java.util.function.Supplier; +public class ScrolledItemPacket implements CustomPacketPayload { -public class ScrolledItemPacket { + public static final ResourceLocation ID = new ResourceLocation(Reference.MOD_ID, "scrolled_item"); private final double scrollDelta; public ScrolledItemPacket(double scrollDelta) { this.scrollDelta = scrollDelta; } - static void encode(ScrolledItemPacket msg, FriendlyByteBuf buffer) { - buffer.writeDouble(msg.scrollDelta); + public ScrolledItemPacket(FriendlyByteBuf buffer) { + this(buffer.readDouble()); } - static ScrolledItemPacket decode(FriendlyByteBuf packetBuffer) { - return new ScrolledItemPacket(packetBuffer.readDouble()); + public void handle(PlayPayloadContext context) { + context.workHandler().execute(() -> context.player().ifPresent(player -> handleMessage(player, scrollDelta))); } - static void onMessage(ScrolledItemPacket msg, Supplier contextSupplier) { - NetworkEvent.Context context = contextSupplier.get(); - //noinspection ConstantConditions - always runs on server where sender is available - context.enqueueWork(() -> handleMessage(msg, contextSupplier.get().getSender())); - context.setPacketHandled(true); - } - - private static void handleMessage(ScrolledItemPacket msg, ServerPlayer sender) { + private void handleMessage(Player sender, double scrollDelta) { ItemStack stack = sender.getMainHandItem(); if (stack.getItem() instanceof IScrollableItem leftClickableItem) { - leftClickableItem.onMouseScrolled(stack, sender, msg.scrollDelta); + leftClickableItem.onMouseScrolled(stack, sender, scrollDelta); } } + + @Override + public void write(FriendlyByteBuf buffer) { + buffer.writeDouble(scrollDelta); + } + + @Override + public ResourceLocation id() { + return ID; + } } diff --git a/src/main/java/reliquary/network/SpawnAngelheartVialParticlesPacket.java b/src/main/java/reliquary/network/SpawnAngelheartVialParticlesPacket.java index cdd3ba2f..91f8e9a8 100644 --- a/src/main/java/reliquary/network/SpawnAngelheartVialParticlesPacket.java +++ b/src/main/java/reliquary/network/SpawnAngelheartVialParticlesPacket.java @@ -5,33 +5,31 @@ import net.minecraft.client.player.LocalPlayer; import net.minecraft.core.particles.ItemParticleOption; import net.minecraft.core.particles.ParticleTypes; +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; +import net.minecraft.resources.ResourceLocation; import net.minecraft.util.RandomSource; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.network.NetworkEvent; +import net.neoforged.neoforge.network.handling.PlayPayloadContext; import reliquary.init.ModItems; +import reliquary.reference.Reference; -import java.util.function.Supplier; +public class SpawnAngelheartVialParticlesPacket implements CustomPacketPayload { + public static final ResourceLocation ID = new ResourceLocation(Reference.MOD_ID, "angelheart_vial_particles"); -@SuppressWarnings({"java:S1118", "InstantiationOfUtilityClass"}) // need to instantiate this for its type to be used as identifier for this message -public class SpawnAngelheartVialParticlesPacket { - static void encode() { + public SpawnAngelheartVialParticlesPacket() { //noop } - static SpawnAngelheartVialParticlesPacket decode() { - return new SpawnAngelheartVialParticlesPacket(); + public SpawnAngelheartVialParticlesPacket(FriendlyByteBuf buffer) { + //noop } - static void onMessage(Supplier contextSupplier) { - NetworkEvent.Context context = contextSupplier.get(); - context.enqueueWork(SpawnAngelheartVialParticlesPacket::handleMessage); - context.setPacketHandled(true); + public void handle(PlayPayloadContext context) { + context.workHandler().execute(this::handleMessage); } - @OnlyIn(Dist.CLIENT) - private static void handleMessage() { + private void handleMessage() { LocalPlayer player = Minecraft.getInstance().player; if (player == null) { return; @@ -67,4 +65,14 @@ private static void handleMessage() { } } } + + @Override + public void write(FriendlyByteBuf buffer) { + //noop + } + + @Override + public ResourceLocation id() { + return ID; + } } diff --git a/src/main/java/reliquary/network/SpawnConcussiveExplosionParticlesPacket.java b/src/main/java/reliquary/network/SpawnConcussiveExplosionParticlesPacket.java new file mode 100644 index 00000000..eacdb44f --- /dev/null +++ b/src/main/java/reliquary/network/SpawnConcussiveExplosionParticlesPacket.java @@ -0,0 +1,47 @@ +package reliquary.network; + +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.level.Level; +import net.minecraft.world.phys.Vec3; +import net.neoforged.neoforge.network.handling.PlayPayloadContext; +import reliquary.entities.ConcussiveExplosion; +import reliquary.reference.Reference; + +public class SpawnConcussiveExplosionParticlesPacket implements CustomPacketPayload { + public static final ResourceLocation ID = new ResourceLocation(Reference.MOD_ID, "spawn_concussive_explosion_particles"); + private final float size; + private final Vec3 pos; + + public SpawnConcussiveExplosionParticlesPacket(float size, Vec3 pos) { + this.size = size; + this.pos = pos; + } + + public SpawnConcussiveExplosionParticlesPacket(FriendlyByteBuf packetBuffer) { + this(packetBuffer.readFloat(), new Vec3(packetBuffer.readDouble(), packetBuffer.readDouble(), packetBuffer.readDouble())); + } + + public void handle(PlayPayloadContext context) { + context.workHandler().execute(() -> context.level().ifPresent(level -> handleMessage(level, pos, size))); + } + + private static void handleMessage(Level level, Vec3 pos, float size) { + ConcussiveExplosion explosion = new ConcussiveExplosion(level, null, null, pos, size, false); + explosion.finalizeExplosion(false); + } + + @Override + public void write(FriendlyByteBuf pBuffer) { + pBuffer.writeFloat(size); + pBuffer.writeDouble(pos.x()); + pBuffer.writeDouble(pos.y()); + pBuffer.writeDouble(pos.z()); + } + + @Override + public ResourceLocation id() { + return ID; + } +} diff --git a/src/main/java/reliquary/network/SpawnPhoenixDownParticlesPacket.java b/src/main/java/reliquary/network/SpawnPhoenixDownParticlesPacket.java index de7e2031..a03f16a1 100644 --- a/src/main/java/reliquary/network/SpawnPhoenixDownParticlesPacket.java +++ b/src/main/java/reliquary/network/SpawnPhoenixDownParticlesPacket.java @@ -4,37 +4,37 @@ import net.minecraft.client.player.LocalPlayer; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.network.FriendlyByteBuf; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.network.NetworkEvent; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; +import net.minecraft.resources.ResourceLocation; +import net.neoforged.neoforge.network.handling.PlayPayloadContext; +import reliquary.reference.Reference; -import java.util.function.Supplier; +public class SpawnPhoenixDownParticlesPacket implements CustomPacketPayload { + public static final ResourceLocation ID = new ResourceLocation(Reference.MOD_ID, "spawn_phoenix_down_particles"); -public class SpawnPhoenixDownParticlesPacket { - public static final SpawnPhoenixDownParticlesPacket INSTANCE = new SpawnPhoenixDownParticlesPacket(); - - private SpawnPhoenixDownParticlesPacket() {} - - static void encode(SpawnPhoenixDownParticlesPacket msg, FriendlyByteBuf packetBuffer) { + public SpawnPhoenixDownParticlesPacket() { //noop } - static SpawnPhoenixDownParticlesPacket decode() { - return SpawnPhoenixDownParticlesPacket.INSTANCE; - } - - static void onMessage(SpawnPhoenixDownParticlesPacket msg, Supplier contextSupplier) { - NetworkEvent.Context context = contextSupplier.get(); - context.enqueueWork(() -> handleMessage(msg)); - context.setPacketHandled(true); + public void handle(PlayPayloadContext context) { + context.workHandler().execute(this::handleMessage); } @SuppressWarnings("ConstantConditions") // the player isn't null when particles are spawned - @OnlyIn(Dist.CLIENT) - private static void handleMessage(SpawnPhoenixDownParticlesPacket msg) { + private void handleMessage() { LocalPlayer player = Minecraft.getInstance().player; for (int particles = 0; particles <= 400; particles++) { player.level().addParticle(ParticleTypes.FLAME, player.getX(), player.getY(), player.getZ(), player.level().random.nextGaussian() * 8, player.level().random.nextGaussian() * 8, player.level().random.nextGaussian() * 8); } } + + @Override + public void write(FriendlyByteBuf pBuffer) { + //noop + } + + @Override + public ResourceLocation id() { + return ID; + } } diff --git a/src/main/java/reliquary/network/SpawnThrownPotionImpactParticlesPacket.java b/src/main/java/reliquary/network/SpawnThrownPotionImpactParticlesPacket.java new file mode 100644 index 00000000..b26687a5 --- /dev/null +++ b/src/main/java/reliquary/network/SpawnThrownPotionImpactParticlesPacket.java @@ -0,0 +1,78 @@ +package reliquary.network; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.particle.Particle; +import net.minecraft.core.particles.ParticleTypes; +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.util.RandomSource; +import net.neoforged.neoforge.network.handling.PlayPayloadContext; +import reliquary.reference.Reference; + +public class SpawnThrownPotionImpactParticlesPacket implements CustomPacketPayload { + public static final ResourceLocation ID = new ResourceLocation(Reference.MOD_ID, "thrown_potion_impact_particles"); + private final int color; + private final double posX; + private final double posY; + private final double posZ; + + public SpawnThrownPotionImpactParticlesPacket(int color, double x, double y, double z) { + this.color = color; + posX = x; + posY = y; + posZ = z; + } + + public SpawnThrownPotionImpactParticlesPacket(FriendlyByteBuf buffer) { + color = buffer.readInt(); + posX = buffer.readDouble(); + posY = buffer.readDouble(); + posZ = buffer.readDouble(); + } + + public void handle(PlayPayloadContext context) { + context.workHandler().execute(() -> handleMessage(color, posX, posY, posZ)); + } + + private void handleMessage(int color, double posX, double posY, double posZ) { + Minecraft mc = Minecraft.getInstance(); + if (mc.level == null) { + return; + } + + RandomSource rand = mc.level.random; + + float red = (((color >> 16) & 255) / 256F); + float green = (((color >> 8) & 255) / 256F); + float blue = ((color & 255) / 256F); + + for (int i = 0; i < 100; ++i) { + double var39 = rand.nextDouble() * 4.0D; + double angle = rand.nextDouble() * Math.PI * 2.0D; + double xSpeed = Math.cos(angle) * var39; + double ySpeed = 0.01D + rand.nextDouble() * 0.5D; + double zSpeed = Math.sin(angle) * var39; + + Particle particle = mc.particleEngine.createParticle(ParticleTypes.EFFECT, posX + xSpeed * 0.1D, posY + 0.3D, posZ + zSpeed * 0.1D, xSpeed, ySpeed, zSpeed); + if (particle != null) { + float var32 = 0.75F + rand.nextFloat() * 0.25F; + particle.setColor(red * var32, green * var32, blue * var32); + particle.setPower((float) var39); + } + } + } + + @Override + public void write(FriendlyByteBuf buffer) { + buffer.writeInt(color); + buffer.writeDouble(posX); + buffer.writeDouble(posY); + buffer.writeDouble(posZ); + } + + @Override + public ResourceLocation id() { + return ID; + } +} diff --git a/src/main/java/reliquary/pedestal/PedestalRegistry.java b/src/main/java/reliquary/pedestal/PedestalRegistry.java index 404f042d..486ead00 100644 --- a/src/main/java/reliquary/pedestal/PedestalRegistry.java +++ b/src/main/java/reliquary/pedestal/PedestalRegistry.java @@ -6,15 +6,10 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.Block; -import net.minecraftforge.event.server.ServerStoppedEvent; +import net.neoforged.neoforge.event.server.ServerStoppedEvent; import reliquary.api.IPedestalItemWrapper; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; +import java.util.*; import java.util.function.Supplier; public class PedestalRegistry { diff --git a/src/main/java/reliquary/pedestal/wrappers/PedestalBucketWrapper.java b/src/main/java/reliquary/pedestal/wrappers/PedestalBucketWrapper.java index acccd4dc..da5c1460 100644 --- a/src/main/java/reliquary/pedestal/wrappers/PedestalBucketWrapper.java +++ b/src/main/java/reliquary/pedestal/wrappers/PedestalBucketWrapper.java @@ -14,15 +14,15 @@ import net.minecraft.world.level.material.Fluid; import net.minecraft.world.level.material.Fluids; import net.minecraft.world.phys.AABB; -import net.minecraftforge.common.ForgeMod; -import net.minecraftforge.common.util.FakePlayer; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidType; -import net.minecraftforge.fluids.IFluidBlock; -import net.minecraftforge.fluids.capability.IFluidHandler; +import net.neoforged.neoforge.common.NeoForgeMod; +import net.neoforged.neoforge.common.util.FakePlayer; +import net.neoforged.neoforge.fluids.FluidStack; +import net.neoforged.neoforge.fluids.FluidType; +import net.neoforged.neoforge.fluids.IFluidBlock; +import net.neoforged.neoforge.fluids.capability.IFluidHandler; import reliquary.api.IPedestal; import reliquary.api.IPedestalActionItemWrapper; -import reliquary.reference.Settings; +import reliquary.reference.Config; import java.util.ArrayList; import java.util.Iterator; @@ -39,14 +39,14 @@ public class PedestalBucketWrapper implements IPedestalActionItemWrapper { @Override public void update(ItemStack stack, Level level, IPedestal pedestal) { BlockPos pos = pedestal.getBlockPosition(); - int bucketRange = Settings.COMMON.blocks.pedestal.bucketWrapperRange.get(); + int bucketRange = Config.COMMON.blocks.pedestal.bucketWrapperRange.get(); if (!milkCows(level, pedestal, pos, bucketRange, stack) && !drainLiquid(level, pedestal, pos, bucketRange)) { - pedestal.setActionCoolDown(2 * Settings.COMMON.blocks.pedestal.bucketWrapperCooldown.get()); + pedestal.setActionCoolDown(2 * Config.COMMON.blocks.pedestal.bucketWrapperCooldown.get()); return; } - pedestal.setActionCoolDown(Settings.COMMON.blocks.pedestal.bucketWrapperCooldown.get()); + pedestal.setActionCoolDown(Config.COMMON.blocks.pedestal.bucketWrapperCooldown.get()); } @Override @@ -177,7 +177,7 @@ private void milkCow(Level level, IPedestal pedestal, BlockPos pos, ItemStack st //put milk in the adjacent tanks if (fakePlayer.getItemInHand(InteractionHand.MAIN_HAND).getItem() == Items.MILK_BUCKET) { - int fluidAdded = pedestal.fillConnectedTank(new FluidStack(ForgeMod.MILK.get(), FluidType.BUCKET_VOLUME)); + int fluidAdded = pedestal.fillConnectedTank(new FluidStack(NeoForgeMod.MILK.get(), FluidType.BUCKET_VOLUME)); //replace bucket in the pedestals with milk one if the tanks can't hold it if (fluidAdded == 0) { if (stack.getCount() == 1) { diff --git a/src/main/java/reliquary/pedestal/wrappers/PedestalFishingRodWrapper.java b/src/main/java/reliquary/pedestal/wrappers/PedestalFishingRodWrapper.java index e4e15dcc..6edd71e9 100644 --- a/src/main/java/reliquary/pedestal/wrappers/PedestalFishingRodWrapper.java +++ b/src/main/java/reliquary/pedestal/wrappers/PedestalFishingRodWrapper.java @@ -17,18 +17,14 @@ import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.HitResult; import net.minecraft.world.phys.Vec3; -import net.minecraftforge.fml.util.ObfuscationReflectionHelper; -import net.minecraftforge.network.PacketDistributor; +import net.neoforged.neoforge.network.PacketDistributor; import reliquary.api.IPedestal; import reliquary.api.IPedestalActionItemWrapper; import reliquary.entities.EntityXRFakePlayer; -import reliquary.network.PacketHandler; -import reliquary.network.PacketPedestalFishHook; -import reliquary.reference.Settings; -import reliquary.util.LogHelper; +import reliquary.network.PedestalFishHookPacket; +import reliquary.reference.Config; import javax.annotation.Nullable; -import java.lang.reflect.Field; import java.util.ArrayList; import java.util.List; import java.util.Optional; @@ -70,7 +66,7 @@ public void update(ItemStack stack, Level level, IPedestal pedestal) { private void handleHookStates(ItemStack stack, Level level, IPedestal pedestal) { if (retractFail) { //take care of failed retract - if (getTicksCatchable(fakePlayer.fishing) == 0) { + if (fakePlayer.fishing.nibble == 0) { retractHook(pedestal, stack); retractFail = false; } @@ -78,7 +74,7 @@ private void handleHookStates(ItemStack stack, Level level, IPedestal pedestal) //when hook doesn't land in water retract it after some time FishingHook fishingHook = fakePlayer.fishing; //noinspection ConstantConditions - if (getCurrentState(fishingHook) != FishingHook.FishHookState.BOBBING) { + if (fishingHook.currentState != FishingHook.FishHookState.BOBBING) { retractHook(pedestal, stack); } else { badThrowChecked = true; @@ -87,8 +83,8 @@ private void handleHookStates(ItemStack stack, Level level, IPedestal pedestal) //sometimes hook can get stuck in a bad state so take care of that retractHook(pedestal, stack); } else //noinspection ConstantConditions - if (getTicksCatchable(fakePlayer.fishing) > 0 || fakePlayer.fishing.getHookedIn() != null) { - if (level.random.nextInt(100) <= Settings.COMMON.blocks.pedestal.fishingWrapperSuccessRate.get()) { + if (fakePlayer.fishing.nibble > 0 || fakePlayer.fishing.getHookedIn() != null) { + if (level.random.nextInt(100) <= Config.COMMON.blocks.pedestal.fishingWrapperSuccessRate.get()) { retractHook(pedestal, stack); } else { retractFail = true; @@ -111,13 +107,14 @@ private void retractHook(IPedestal pedestal, ItemStack stack) { //noinspection ConstantConditions int i = fakePlayer.fishing.retrieve(stack); fakePlayer.fishing = null; - stack.hurtAndBreak(i, fakePlayer, p -> {}); + stack.hurtAndBreak(i, fakePlayer, p -> { + }); //destroy the item when it gets used up if (stack.getCount() == 0) { pedestal.destroyItem(); } - pedestal.setActionCoolDown(Settings.COMMON.blocks.pedestal.fishingWrapperRetractDelay.get() * 20); + pedestal.setActionCoolDown(Config.COMMON.blocks.pedestal.fishingWrapperRetractDelay.get() * 20); } private Optional getBestWaterBlock(Level level, IPedestal pedestal) { @@ -229,18 +226,6 @@ private void checkForWaterAndSearchNeighbors(Level level, IPedestal pedestal, Li } } - private static final Field BOBBER_CURRENT_STATE = ObfuscationReflectionHelper.findField(FishingHook.class, "f_37095_"); - - private FishingHook.FishHookState getCurrentState(FishingHook fishingHook) { - try { - return (FishingHook.FishHookState) BOBBER_CURRENT_STATE.get(fishingHook); - } - catch (IllegalAccessException e) { - LogHelper.error("Error getting fishing bobber state", e); - } - return FishingHook.FishHookState.FLYING; - } - private void addNeighboringWater(Level level, IPedestal pedestal, List visitedBlocks, List group, BlockPos pedestalPos, BlockPos blockPos) { if (!visitedBlocks.contains(blockPos)) { checkForWaterAndSearchNeighbors(level, pedestal, visitedBlocks, pedestalPos, blockPos, group); @@ -269,9 +254,11 @@ private void syncHookData(Level level, IPedestal pedestal) { BlockPos pedestalPos = pedestal.getBlockPosition(); if (hook == null) { - PacketHandler.sendToAllAround(new PacketPedestalFishHook(pedestal.getBlockPosition(), -1, -1, -1), new PacketDistributor.TargetPoint(pedestalPos.getX(), pedestalPos.getY(), pedestalPos.getZ(), PACKET_RANGE, level.dimension())); + PacketDistributor.NEAR.with(PacketDistributor.TargetPoint.p(pedestalPos.getX(), pedestalPos.getY(), pedestalPos.getZ(), PACKET_RANGE, level.dimension()).get()) + .send(new PedestalFishHookPacket(pedestal.getBlockPosition(), -1, -1, -1)); } else { - PacketHandler.sendToAllAround(new PacketPedestalFishHook(pedestal.getBlockPosition(), hook.getX(), hook.getY(), hook.getZ()), new PacketDistributor.TargetPoint(pedestalPos.getX(), pedestalPos.getY(), pedestalPos.getZ(), PACKET_RANGE, level.dimension())); + PacketDistributor.NEAR.with(PacketDistributor.TargetPoint.p(pedestalPos.getX(), pedestalPos.getY(), pedestalPos.getZ(), PACKET_RANGE, level.dimension()).get()) + .send(new PedestalFishHookPacket(pedestal.getBlockPosition(), hook.getX(), hook.getY(), hook.getZ())); } } @@ -293,15 +280,10 @@ public void stop(ItemStack stack, Level level, IPedestal pedestal) { private void setupFakePlayer(Level world, BlockPos pos) { if (fakePlayer == null) { fakePlayer = new EntityXRFakePlayer((ServerLevel) world); - fakePlayer.setPos( pos.getX() + 0.5, (double) pos.getY() + 2, pos.getZ() + 0.5); + fakePlayer.setPos(pos.getX() + 0.5, (double) pos.getY() + 2, pos.getZ() + 0.5); } } - private int getTicksCatchable(@Nullable FishingHook hook) { - //noinspection ConstantConditions - return ObfuscationReflectionHelper.getPrivateValue(FishingHook.class, hook, "f_37089_"); - } - private void setPitchYaw(BlockPos pos) { int x = pos.getX(); int y = pos.getY(); diff --git a/src/main/java/reliquary/pedestal/wrappers/PedestalHarvestRodWrapper.java b/src/main/java/reliquary/pedestal/wrappers/PedestalHarvestRodWrapper.java index eb8bcebd..5113c214 100644 --- a/src/main/java/reliquary/pedestal/wrappers/PedestalHarvestRodWrapper.java +++ b/src/main/java/reliquary/pedestal/wrappers/PedestalHarvestRodWrapper.java @@ -4,7 +4,6 @@ import net.minecraft.core.Direction; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.InteractionHand; -import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.BlockItem; @@ -12,21 +11,16 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.block.BonemealableBlock; -import net.minecraft.world.level.block.CropBlock; -import net.minecraft.world.level.block.NetherWartBlock; -import net.minecraft.world.level.block.SweetBerryBushBlock; +import net.minecraft.world.level.block.*; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.IPlantable; -import net.minecraftforge.common.util.FakePlayer; +import net.neoforged.neoforge.common.IPlantable; +import net.neoforged.neoforge.common.util.FakePlayer; import reliquary.api.IPedestal; import reliquary.api.IPedestalActionItemWrapper; import reliquary.blocks.FertileLilyPadBlock; import reliquary.init.ModItems; import reliquary.items.HarvestRodItem; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.ItemHelper; import java.util.ArrayDeque; @@ -59,9 +53,9 @@ public PedestalHarvestRodWrapper() { @Override public void update(ItemStack stack, Level level, IPedestal pedestal) { BlockPos pos = pedestal.getBlockPosition(); - int cooldown = Settings.COMMON.items.harvestRod.pedestalCooldown.get(); + int cooldown = Config.COMMON.items.harvestRod.pedestalCooldown.get(); pedestal.getFakePlayer().ifPresent(fakePlayer -> { - int range = Settings.COMMON.items.harvestRod.pedestalRange.get(); + int range = Config.COMMON.items.harvestRod.pedestalRange.get(); hoeLand(level, fakePlayer, pos, range); @@ -77,9 +71,7 @@ public void update(ItemStack stack, Level level, IPedestal pedestal) { @Override public void onRemoved(ItemStack stack, Level level, IPedestal pedestal) { - if (!level.isClientSide) { - harvestRod.updateContainedStacks(stack); - } + //noop } @Override @@ -182,8 +174,8 @@ private void plantItem(Player player, BlockPos pos, ItemStack stack, byte idx) { fakePlantableStack.setCount(1); player.setItemInHand(InteractionHand.MAIN_HAND, fakePlantableStack); - if (fakePlantableStack.useOn(ItemHelper.getItemUseContext(pos, player)) == InteractionResult.SUCCESS) { - harvestRod.setPlantableQuantityAndGetPlantableStack(stack, idx, harvestRod.getPlantableQuantity(stack, idx) - 1); + if (fakePlantableStack.useOn(ItemHelper.getItemUseContext(pos, player)).consumesAction()) { + harvestRod.setPlantableQuantity(stack, idx, harvestRod.getPlantableQuantity(stack, idx) - 1); } } @@ -222,7 +214,7 @@ private void fillQueueToBreak(Level world, BlockPos pos, int range) { Block block = state.getBlock(); if (block instanceof IPlantable || block == Blocks.MELON || block == Blocks.PUMPKIN) { if (block instanceof FertileLilyPadBlock || block == Blocks.PUMPKIN_STEM || block == Blocks.MELON_STEM - || block instanceof CropBlock cropBlock && cropBlock.isValidBonemealTarget(world, currentPos, state, false) + || block instanceof CropBlock cropBlock && cropBlock.isValidBonemealTarget(world, currentPos, state) || block instanceof NetherWartBlock && state.getValue(NetherWartBlock.AGE) < 3 || block instanceof SweetBerryBushBlock && state.getValue(SweetBerryBushBlock.AGE) < 3) { return; @@ -304,7 +296,7 @@ private void fillQueueToBoneMeal(Level world, BlockPos pos, int range) { p -> { BlockPos currentPos = p.immutable(); BlockState blockState = world.getBlockState(currentPos); - if (blockState.getBlock() != Blocks.GRASS_BLOCK && blockState.getBlock() instanceof BonemealableBlock bonemealableBlock && bonemealableBlock.isValidBonemealTarget(world, currentPos, blockState, world.isClientSide)) { + if (blockState.getBlock() != Blocks.GRASS_BLOCK && blockState.getBlock() instanceof BonemealableBlock bonemealableBlock && bonemealableBlock.isValidBonemealTarget(world, currentPos, blockState)) { queueToBoneMeal.add(currentPos); } }); diff --git a/src/main/java/reliquary/pedestal/wrappers/PedestalMeleeWeaponWrapper.java b/src/main/java/reliquary/pedestal/wrappers/PedestalMeleeWeaponWrapper.java index e1691e2f..d7c30cc5 100644 --- a/src/main/java/reliquary/pedestal/wrappers/PedestalMeleeWeaponWrapper.java +++ b/src/main/java/reliquary/pedestal/wrappers/PedestalMeleeWeaponWrapper.java @@ -10,10 +10,10 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.phys.AABB; -import net.minecraftforge.common.util.FakePlayer; +import net.neoforged.neoforge.common.util.FakePlayer; import reliquary.api.IPedestal; import reliquary.api.IPedestalActionItemWrapper; -import reliquary.reference.Settings; +import reliquary.reference.Config; import java.util.List; @@ -21,13 +21,13 @@ public class PedestalMeleeWeaponWrapper implements IPedestalActionItemWrapper { private final int cooldownAfterSwing; public PedestalMeleeWeaponWrapper() { - cooldownAfterSwing = Settings.COMMON.blocks.pedestal.meleeWrapperCooldown.get(); + cooldownAfterSwing = Config.COMMON.blocks.pedestal.meleeWrapperCooldown.get(); } @Override public void update(ItemStack stack, Level level, IPedestal pedestal) { BlockPos pos = pedestal.getBlockPosition(); - int meleeRange = Settings.COMMON.blocks.pedestal.meleeWrapperRange.get(); + int meleeRange = Config.COMMON.blocks.pedestal.meleeWrapperRange.get(); List entities = level.getEntitiesOfClass(Mob.class, new AABB((double) pos.getX() - meleeRange, (double) pos.getY() - meleeRange, (double) pos.getZ() - meleeRange, (double) pos.getX() + meleeRange, (double) pos.getY() + meleeRange, (double) pos.getZ() + meleeRange)); diff --git a/src/main/java/reliquary/pedestal/wrappers/PedestalRedstoneWrapper.java b/src/main/java/reliquary/pedestal/wrappers/PedestalRedstoneWrapper.java index 00fd187d..d125749e 100644 --- a/src/main/java/reliquary/pedestal/wrappers/PedestalRedstoneWrapper.java +++ b/src/main/java/reliquary/pedestal/wrappers/PedestalRedstoneWrapper.java @@ -5,7 +5,7 @@ import net.minecraft.world.level.Level; import reliquary.api.IPedestal; import reliquary.api.IPedestalRedstoneItemWrapper; -import reliquary.reference.Settings; +import reliquary.reference.Config; import reliquary.util.WorldHelper; import java.util.List; @@ -31,7 +31,7 @@ private PedestalRedstoneWrapper(boolean powered) { @Override public void updateRedstone(ItemStack stack, Level level, IPedestal pedestal) { - List pedestalsInRange = pedestal.getPedestalsInRange(level, Settings.COMMON.blocks.pedestal.redstoneWrapperRange.get()); + List pedestalsInRange = pedestal.getPedestalsInRange(level, Config.COMMON.blocks.pedestal.redstoneWrapperRange.get()); BlockPos thisPos = pedestal.getBlockPosition(); boolean buttonEnabled = pedestal.switchedOn(); @@ -53,7 +53,7 @@ public void updateRedstone(ItemStack stack, Level level, IPedestal pedestal) { @Override public void onRemoved(ItemStack stack, Level level, IPedestal pedestal) { - List pedestalsInRange = pedestal.getPedestalsInRange(level, Settings.COMMON.blocks.pedestal.redstoneWrapperRange.get()); + List pedestalsInRange = pedestal.getPedestalsInRange(level, Config.COMMON.blocks.pedestal.redstoneWrapperRange.get()); BlockPos thisPos = pedestal.getBlockPosition(); for (BlockPos pos : pedestalsInRange) { diff --git a/src/main/java/reliquary/pedestal/wrappers/PedestalRendingGaleWrapper.java b/src/main/java/reliquary/pedestal/wrappers/PedestalRendingGaleWrapper.java index 97841162..ace23a0c 100644 --- a/src/main/java/reliquary/pedestal/wrappers/PedestalRendingGaleWrapper.java +++ b/src/main/java/reliquary/pedestal/wrappers/PedestalRendingGaleWrapper.java @@ -11,7 +11,7 @@ import reliquary.init.ModItems; import reliquary.init.ModPotions; import reliquary.items.RendingGaleItem; -import reliquary.reference.Settings; +import reliquary.reference.Config; import java.util.List; @@ -52,11 +52,11 @@ public void update(ItemStack stack, Level level, IPedestal pedestal) { private void pushEntities(ItemStack stack, Level world, BlockPos pos, RendingGaleItem rendingGale, boolean b) { rendingGale.doRadialPush(world, pos.getX(), pos.getY(), pos.getZ(), null, b); - ModItems.RENDING_GALE.get().setFeatherCount(stack, ModItems.RENDING_GALE.get().getFeatherCount(stack) - (int) (TICKS_BETWEEN_PUSH_PULL_CHECKS / 20F * Settings.COMMON.items.rendingGale.pedestalCostPerSecond.get()), true); + ModItems.RENDING_GALE.get().setFeatherCount(stack, ModItems.RENDING_GALE.get().getFeatherCount(stack) - (int) (TICKS_BETWEEN_PUSH_PULL_CHECKS / 20F * Config.COMMON.items.rendingGale.pedestalCostPerSecond.get())); } private void buffPlayersWithFlight(ItemStack stack, Level world, BlockPos pos) { - int flightRange = Settings.COMMON.items.rendingGale.pedestalFlightRange.get(); + int flightRange = Config.COMMON.items.rendingGale.pedestalFlightRange.get(); if (ModItems.RENDING_GALE.get().getFeatherCount(stack) >= (RendingGaleItem.getChargeCost() * SECONDS_BETWEEN_BUFF_CHECKS)) { List players = world.getEntitiesOfClass(Player.class, new AABB((double) pos.getX() - flightRange, (double) pos.getY() - flightRange, (double) pos.getZ() - flightRange, (double) pos.getX() + flightRange, (double) pos.getY() + flightRange, (double) pos.getZ() + flightRange)); @@ -65,7 +65,7 @@ private void buffPlayersWithFlight(ItemStack stack, Level world, BlockPos pos) { for (Player player : players) { player.addEffect(new MobEffectInstance(ModPotions.FLIGHT_POTION.get(), 20 * 20)); } - ModItems.RENDING_GALE.get().setFeatherCount(stack, ModItems.RENDING_GALE.get().getFeatherCount(stack) - (SECONDS_BETWEEN_BUFF_CHECKS * Settings.COMMON.items.rendingGale.pedestalCostPerSecond.get()), true); + ModItems.RENDING_GALE.get().setFeatherCount(stack, ModItems.RENDING_GALE.get().getFeatherCount(stack) - (SECONDS_BETWEEN_BUFF_CHECKS * Config.COMMON.items.rendingGale.pedestalCostPerSecond.get())); } } } diff --git a/src/main/java/reliquary/pedestal/wrappers/PedestalShearsWrapper.java b/src/main/java/reliquary/pedestal/wrappers/PedestalShearsWrapper.java index f1ee90a6..b8363bfb 100644 --- a/src/main/java/reliquary/pedestal/wrappers/PedestalShearsWrapper.java +++ b/src/main/java/reliquary/pedestal/wrappers/PedestalShearsWrapper.java @@ -13,11 +13,11 @@ import net.minecraft.world.level.block.entity.BeehiveBlockEntity; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.AABB; -import net.minecraftforge.common.IForgeShearable; -import net.minecraftforge.common.util.FakePlayer; +import net.neoforged.neoforge.common.IShearable; +import net.neoforged.neoforge.common.util.FakePlayer; import reliquary.api.IPedestal; import reliquary.api.IPedestalActionItemWrapper; -import reliquary.reference.Settings; +import reliquary.reference.Config; import java.util.ArrayDeque; import java.util.List; @@ -31,14 +31,14 @@ public class PedestalShearsWrapper implements IPedestalActionItemWrapper { @Override public void update(ItemStack stack, Level level, IPedestal pedestal) { BlockPos pos = pedestal.getBlockPosition(); - int shearsRange = Settings.COMMON.blocks.pedestal.shearsWrapperRange.get(); + int shearsRange = Config.COMMON.blocks.pedestal.shearsWrapperRange.get(); if (shearAnimals(stack, level, pedestal, pos, shearsRange)) { return; } if (!isShearingBlock) { - pedestal.setActionCoolDown(Settings.COMMON.blocks.pedestal.shearsWrapperCooldown.get()); + pedestal.setActionCoolDown(Config.COMMON.blocks.pedestal.shearsWrapperCooldown.get()); } if (stack.getCount() == 0) { @@ -91,7 +91,7 @@ private boolean shearBlocks(ItemStack stack, Level world, IPedestal pedestal, Fa shearBeehive(world, blockPosBeingSheared, blockState, stack); } else { if (world.removeBlock(blockPosBeingSheared, false)) { - Block.dropResources(blockState, world, pos, null, fakePlayer, new ItemStack(Items.SHEARS)); + Block.dropResources(blockState, world, blockPosBeingSheared, null, fakePlayer, new ItemStack(Items.SHEARS)); world.levelEvent(2001, blockPosBeingSheared, Block.getId(blockState)); stack.hurt(1, world.getRandom(), null); } @@ -104,7 +104,7 @@ private boolean shearBlocks(ItemStack stack, Level world, IPedestal pedestal, Fa private boolean isShearableBlock(ItemStack stack, Level world, BlockState blockState) { Block block = blockState.getBlock(); - return (block instanceof IForgeShearable shearable && shearable.isShearable(stack, world, blockPosBeingSheared)) + return (block instanceof IShearable shearable && shearable.isShearable(stack, world, blockPosBeingSheared)) || (block instanceof BeehiveBlock && blockState.getValue(BeehiveBlock.HONEY_LEVEL) >= 5); } @@ -134,10 +134,10 @@ private void updateQueue(ItemStack stack, Level world, BlockPos pos, int shearsR private boolean shearAnimals(ItemStack stack, Level world, FakePlayer fakePlayer, BlockPos pos, int shearsRange) { List entities = world.getEntitiesOfClass(Animal.class, - new AABB(pos.offset(-shearsRange, -shearsRange, -shearsRange), pos.offset(shearsRange, shearsRange, shearsRange))); + AABB.encapsulatingFullBlocks(pos.offset(-shearsRange, -shearsRange, -shearsRange), pos.offset(shearsRange, shearsRange, shearsRange))); for (Animal animal : entities) { - if (animal instanceof IForgeShearable shearable && shearable.isShearable(stack, world, animal.blockPosition())) { + if (animal instanceof IShearable shearable && shearable.isShearable(stack, world, animal.blockPosition())) { fakePlayer.setItemInHand(InteractionHand.MAIN_HAND, stack); fakePlayer.interactOn(animal, InteractionHand.MAIN_HAND); return true; diff --git a/src/main/java/reliquary/potions/CurePotion.java b/src/main/java/reliquary/potions/CurePotion.java index e7b2a4c8..974acb8e 100644 --- a/src/main/java/reliquary/potions/CurePotion.java +++ b/src/main/java/reliquary/potions/CurePotion.java @@ -5,13 +5,7 @@ import net.minecraft.world.effect.MobEffects; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.monster.ZombieVillager; -import net.minecraftforge.fml.util.ObfuscationReflectionHelper; import reliquary.init.ModPotions; -import reliquary.util.LogHelper; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.UUID; public class CurePotion extends MobEffect { @@ -20,27 +14,15 @@ public CurePotion() { } @Override - public boolean isDurationEffectTick(int duration, int amplifier) { + public boolean shouldApplyEffectTickThisTick(int duration, int amplifier) { return true; } - private static final Method START_CONVERTING = ObfuscationReflectionHelper - .findMethod(ZombieVillager.class, "m_34383_", UUID.class, int.class); - - private static void startConverting(ZombieVillager zombieVillager, int conversionTime) { - try { - START_CONVERTING.invoke(zombieVillager, null, conversionTime); - } - catch (InvocationTargetException | IllegalAccessException e) { - LogHelper.error("Error running startConverting on zombie villager", e); - } - } - @Override public void applyEffectTick(LivingEntity entityLivingBase, int potency) { if (entityLivingBase instanceof ZombieVillager zombieVillager) { if (!zombieVillager.isConverting() && entityLivingBase.hasEffect(MobEffects.WEAKNESS)) { - startConverting(zombieVillager, (entityLivingBase.level().random.nextInt(2401) + 3600) / (potency + 2)); + zombieVillager.startConverting(null, (entityLivingBase.level().random.nextInt(2401) + 3600) / (potency + 2)); entityLivingBase.removeEffect(ModPotions.CURE_POTION.get()); } } else { diff --git a/src/main/java/reliquary/potions/FlightPotion.java b/src/main/java/reliquary/potions/FlightPotion.java index d46fa956..898e9c8b 100644 --- a/src/main/java/reliquary/potions/FlightPotion.java +++ b/src/main/java/reliquary/potions/FlightPotion.java @@ -4,19 +4,25 @@ import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.effect.MobEffect; import net.minecraft.world.effect.MobEffectCategory; +import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.ai.attributes.AttributeMap; import net.minecraft.world.entity.player.Player; +import net.neoforged.neoforge.common.NeoForge; +import net.neoforged.neoforge.event.entity.living.MobEffectEvent; +import org.jetbrains.annotations.Nullable; import reliquary.init.ModPotions; public class FlightPotion extends MobEffect { public FlightPotion() { - super(MobEffectCategory.BENEFICIAL, 0); + super(MobEffectCategory.BENEFICIAL, 0xFFFFFF); + NeoForge.EVENT_BUS.addListener(this::onEffectExpired); + NeoForge.EVENT_BUS.addListener(this::onEffectRemoved); } @Override - public boolean isDurationEffectTick(int duration, int amplifier) { + public boolean shouldApplyEffectTickThisTick(int duration, int amplifier) { return true; } @@ -34,14 +40,24 @@ public void applyEffectTick(LivingEntity entityLivingBase, int amplifier) { } @Override - public void removeAttributeModifiers(LivingEntity entityLivingBase, AttributeMap attributeMap, int amplifier) { - super.removeAttributeModifiers(entityLivingBase, attributeMap, amplifier); + public void removeAttributeModifiers(AttributeMap pAttributeMap) { + super.removeAttributeModifiers(pAttributeMap); + } + + private void onEffectExpired(MobEffectEvent.Expired event) { + removeFlight(event.getEntity(), event.getEffectInstance()); + } + + private void onEffectRemoved(MobEffectEvent.Remove event) { + removeFlight(event.getEntity(), event.getEffectInstance()); + } - if (!(entityLivingBase instanceof Player player)) { + private static void removeFlight(LivingEntity entity, @Nullable MobEffectInstance effectInstance) { + if (effectInstance == null || effectInstance.getEffect() != ModPotions.FLIGHT_POTION.get()) { return; } - if (player.hasEffect(ModPotions.FLIGHT_POTION.get())) { + if (!(entity instanceof Player player)) { return; } diff --git a/src/main/java/reliquary/potions/PacificationPotion.java b/src/main/java/reliquary/potions/PacificationPotion.java index f2a21b42..4442f133 100644 --- a/src/main/java/reliquary/potions/PacificationPotion.java +++ b/src/main/java/reliquary/potions/PacificationPotion.java @@ -13,7 +13,7 @@ public PacificationPotion() { } @Override - public boolean isDurationEffectTick(int duration, int amplifier) { + public boolean shouldApplyEffectTickThisTick(int duration, int amplifier) { return true; } diff --git a/src/main/java/reliquary/reference/ClientReference.java b/src/main/java/reliquary/reference/ClientReference.java index 1c0e9a42..56786910 100644 --- a/src/main/java/reliquary/reference/ClientReference.java +++ b/src/main/java/reliquary/reference/ClientReference.java @@ -1,27 +1,16 @@ package reliquary.reference; import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; public class ClientReference { - @OnlyIn(Dist.CLIENT) public static final ResourceLocation NEUTRAL = new ResourceLocation(Reference.MOD_ID, Reference.ART_PATH_ENTITIES + "neutral_shot.png"); - @OnlyIn(Dist.CLIENT) public static final ResourceLocation EXORCISM = new ResourceLocation(Reference.MOD_ID, Reference.ART_PATH_ENTITIES + "exorcism_shot.png"); - @OnlyIn(Dist.CLIENT) public static final ResourceLocation BLAZE = new ResourceLocation(Reference.MOD_ID, Reference.ART_PATH_ENTITIES + "blaze_shot.png"); - @OnlyIn(Dist.CLIENT) public static final ResourceLocation ENDER = new ResourceLocation(Reference.MOD_ID, Reference.ART_PATH_ENTITIES + "ender_shot.png"); - @OnlyIn(Dist.CLIENT) public static final ResourceLocation CONCUSSIVE = new ResourceLocation(Reference.MOD_ID, Reference.ART_PATH_ENTITIES + "concussive_shot.png"); - @OnlyIn(Dist.CLIENT) public static final ResourceLocation BUSTER = new ResourceLocation(Reference.MOD_ID, Reference.ART_PATH_ENTITIES + "buster_shot.png"); - @OnlyIn(Dist.CLIENT) public static final ResourceLocation SEEKER = new ResourceLocation(Reference.MOD_ID, Reference.ART_PATH_ENTITIES + "seeker_shot.png"); - @OnlyIn(Dist.CLIENT) public static final ResourceLocation SAND = new ResourceLocation(Reference.MOD_ID, Reference.ART_PATH_ENTITIES + "sand_shot.png"); - @OnlyIn(Dist.CLIENT) public static final ResourceLocation STORM = new ResourceLocation(Reference.MOD_ID, Reference.ART_PATH_ENTITIES + "storm_shot.png"); } diff --git a/src/main/java/reliquary/reference/Settings.java b/src/main/java/reliquary/reference/Config.java similarity index 91% rename from src/main/java/reliquary/reference/Settings.java rename to src/main/java/reliquary/reference/Config.java index c645babb..3add22d7 100644 --- a/src/main/java/reliquary/reference/Settings.java +++ b/src/main/java/reliquary/reference/Config.java @@ -1,39 +1,37 @@ package reliquary.reference; import com.google.common.collect.Lists; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.item.Items; -import net.minecraftforge.common.ForgeConfigSpec; -import net.minecraftforge.common.ForgeConfigSpec.BooleanValue; -import net.minecraftforge.common.ForgeConfigSpec.ConfigValue; -import net.minecraftforge.common.ForgeConfigSpec.DoubleValue; -import net.minecraftforge.common.ForgeConfigSpec.EnumValue; -import net.minecraftforge.common.ForgeConfigSpec.IntValue; -import net.minecraftforge.fml.event.config.ModConfigEvent; -import net.minecraftforge.registries.ForgeRegistries; +import net.minecraft.world.level.block.Blocks; +import net.neoforged.fml.event.config.ModConfigEvent; +import net.neoforged.neoforge.common.ModConfigSpec; +import net.neoforged.neoforge.common.ModConfigSpec.*; import org.apache.commons.lang3.tuple.Pair; import reliquary.client.gui.hud.HUDPosition; import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; +import java.util.*; +import java.util.stream.Stream; import static reliquary.util.RegistryHelper.getItemRegistryName; @SuppressWarnings("squid:S1192") //no issue repeating the same string literal as they are independent -public class Settings { - private Settings() {} +public class Config { + private Config() { + } private static final int ITEM_CAP = 9999; - @SuppressWarnings("unused") // parameter needs to stay for addListener logic to recognize what this method is listening to + public static T getOrDefault(ModConfigSpec.ConfigValue value, ModConfigSpec configSpec) { + return configSpec.isLoaded() ? value.get() : value.getDefault(); + } + + @SuppressWarnings("unused") + // parameter needs to stay for addListener logic to recognize what this method is listening to public static void onFileChange(ModConfigEvent.Reloading configEvent) { COMMON.items.infernalTear.resetCache(); } @@ -59,7 +57,7 @@ public static class HudPos { public final EnumValue rendingGale; public final EnumValue mobCharm; - HudPos(ForgeConfigSpec.Builder builder) { + HudPos(ModConfigSpec.Builder builder) { builder.comment("Position of mode and/or item display on the screen - used by some of the tools and weapons.") .push("hudPositions"); @@ -113,7 +111,7 @@ public static class HudPos { } } - Client(ForgeConfigSpec.Builder builder) { + Client(ModConfigSpec.Builder builder) { builder.comment("Client Settings").push("client"); hudPositions = new HudPos(builder); wailaShiftForInfo = builder @@ -124,10 +122,10 @@ public static class HudPos { } public static final Client CLIENT; - public static final ForgeConfigSpec CLIENT_SPEC; + public static final ModConfigSpec CLIENT_SPEC; static { - final Pair specPair = new ForgeConfigSpec.Builder().configure(Client::new); + final Pair specPair = new ModConfigSpec.Builder().configure(Client::new); CLIENT_SPEC = specPair.getRight(); CLIENT = specPair.getLeft(); } @@ -149,7 +147,7 @@ public static class DisableSettings { public final BooleanValue disablePassivePedestal; public final BooleanValue disableSpawnEggRecipes; - DisableSettings(ForgeConfigSpec.Builder builder) { + DisableSettings(ModConfigSpec.Builder builder) { builder.comment("Disable sections of the mod") .push("disable"); @@ -187,7 +185,7 @@ public static class DisableSettings { } } - Common(ForgeConfigSpec.Builder builder) { + Common(ModConfigSpec.Builder builder) { chestLootEnabled = builder .comment("Determines whether Reliquary items will be generated in chest loot (mostly mob drops, very rarely some lower level items)") .worldRestart() @@ -215,7 +213,7 @@ public static class PotionSettings { public final BooleanValue differentDurations; public final BooleanValue redstoneAndGlowstone; - PotionSettings(ForgeConfigSpec.Builder builder) { + PotionSettings(ModConfigSpec.Builder builder) { builder.comment("Potions related settings").push("potions"); potionMap = builder @@ -243,7 +241,7 @@ public static class PotionSettings { } public static class ItemSettings { - ItemSettings(ForgeConfigSpec.Builder builder) { + ItemSettings(ModConfigSpec.Builder builder) { builder.push("items"); alkahestryTome = new AlkahestryTomeSettings(builder); @@ -283,7 +281,7 @@ public static class ItemSettings { public static class AlkahestryTomeSettings { public final IntValue chargeLimit; - AlkahestryTomeSettings(ForgeConfigSpec.Builder builder) { + AlkahestryTomeSettings(ModConfigSpec.Builder builder) { builder.comment("Alkahestry Tome settings") .push("alkahestryTome"); @@ -299,7 +297,7 @@ public static class MobCharmFragmentSettings { public final DoubleValue dropChance; public final DoubleValue lootingMultiplier; - MobCharmFragmentSettings(ForgeConfigSpec.Builder builder) { + MobCharmFragmentSettings(ModConfigSpec.Builder builder) { builder.comment("Mob Charm Fragment Settings") .push("mobCharmFragment"); @@ -316,7 +314,7 @@ public static class AngelicFeatherSettings { public final IntValue hungerCostPercent; public final IntValue leapingPotency; - AngelicFeatherSettings(ForgeConfigSpec.Builder builder) { + AngelicFeatherSettings(ModConfigSpec.Builder builder) { builder.comment("Angelic Feather settings").push("angelicFeather"); hungerCostPercent = builder @@ -336,7 +334,7 @@ public static class AngelHeartVialSettings { public final IntValue healPercentageOfMaxLife; public final BooleanValue removeNegativeStatus; - AngelHeartVialSettings(ForgeConfigSpec.Builder builder) { + AngelHeartVialSettings(ModConfigSpec.Builder builder) { builder.comment("Angelheart Vial settings").push("angelheartVial"); healPercentageOfMaxLife = builder @@ -362,29 +360,12 @@ public static class DestructionCatalystSettings { public final BooleanValue centeredExplosion; public final BooleanValue perfectCube; - DestructionCatalystSettings(ForgeConfigSpec.Builder builder) { + DestructionCatalystSettings(ModConfigSpec.Builder builder) { builder.comment("Destruction Catalyst settings").push("destructionCatalyst"); mundaneBlocks = builder .comment("List of mundane blocks the catalyst will break") - .define("mundaneBlocks", Lists.newArrayList( - "minecraft:dirt", - "minecraft:coarse_dirt", - "minecraft:podzol", - "minecraft:mycelium", - "minecraft:grass_block", - "minecraft:gravel", - "minecraft:cobblestone", - "minecraft:stone", - "minecraft:granite", - "minecraft:diorite", - "minecraft:andesite", - "minecraft:sand", - "minecraft:sandstone", - "minecraft:snow", - "minecraft:soul_sand", - "minecraft:netherrack", - "minecraft:end_stone")); + .define("mundaneBlocks", getMundaneBlocksDefault()); gunpowderCost = builder .comment("Number of gunpowder it costs per catalyst use") @@ -412,6 +393,30 @@ public static class DestructionCatalystSettings { builder.pop(); } + + private static List getMundaneBlocksDefault() { + return Stream.of( + Blocks.DIRT, + Blocks.COARSE_DIRT, + Blocks.PODZOL, + Blocks.MYCELIUM, + Blocks.GRASS_BLOCK, + Blocks.GRAVEL, + Blocks.COBBLESTONE, + Blocks.STONE, + Blocks.GRANITE, + Blocks.DIORITE, + Blocks.ANDESITE, + Blocks.SAND, + Blocks.SANDSTONE, + Blocks.SNOW, + Blocks.SOUL_SAND, + Blocks.NETHERRACK, + Blocks.END_STONE, + Blocks.DEEPSLATE, + Blocks.TUFF + ).map(b -> BuiltInRegistries.BLOCK.getKey(b).toString()).toList(); + } } public final EmperorChaliceSettings emperorChalice; @@ -419,7 +424,7 @@ public static class DestructionCatalystSettings { public static class EmperorChaliceSettings { public final IntValue hungerSatiationMultiplier; - EmperorChaliceSettings(ForgeConfigSpec.Builder builder) { + EmperorChaliceSettings(ModConfigSpec.Builder builder) { builder.comment("Emperor Chalice settings").push("emperorChalice"); hungerSatiationMultiplier = builder @@ -439,7 +444,7 @@ public static class EnderStaffSettings { public final IntValue enderPearlLimit; public final IntValue nodeWarpCastTime; - EnderStaffSettings(ForgeConfigSpec.Builder builder) { + EnderStaffSettings(ModConfigSpec.Builder builder) { builder.comment("Ender Staff settings").push("enderStaff"); enderPearlCastCost = builder @@ -472,7 +477,7 @@ public static class FortuneCoinSettings { public final IntValue standardPullDistance; public final IntValue longRangePullDistance; - FortuneCoinSettings(ForgeConfigSpec.Builder builder) { + FortuneCoinSettings(ModConfigSpec.Builder builder) { builder.comment("Fortune Coin settings").push("fortuneCoin"); standardPullDistance = builder @@ -497,7 +502,7 @@ public static class GlacialStaffSettings { public final IntValue snowballDamageBonusFireImmune; public final IntValue snowballDamageBonusBlaze; - GlacialStaffSettings(ForgeConfigSpec.Builder builder) { + GlacialStaffSettings(ModConfigSpec.Builder builder) { builder.comment("Glacial Staff settings").push("glacialStaff"); snowballLimit = builder @@ -533,7 +538,7 @@ public static class GlacialStaffSettings { public static class HandgunSettings { public final IntValue maxSkillLevel; - public HandgunSettings(ForgeConfigSpec.Builder builder) { + public HandgunSettings(ModConfigSpec.Builder builder) { builder.comment("Handgun settings").push("handgun"); maxSkillLevel = builder @@ -558,7 +563,7 @@ public static class HarvestRodSettings { public final IntValue pedestalRange; public final IntValue pedestalCooldown; - HarvestRodSettings(ForgeConfigSpec.Builder builder) { + HarvestRodSettings(ModConfigSpec.Builder builder) { builder.comment("Harvest Rod settings").push("harvestRod"); boneMealLimit = builder @@ -612,7 +617,7 @@ public static class HeroMedallionSettings { public final IntValue pedestalRange; public final IntValue pedestalRepairStepXP; - HeroMedallionSettings(ForgeConfigSpec.Builder builder) { + HeroMedallionSettings(ModConfigSpec.Builder builder) { builder.comment("Hero Medallion settings").push("heroMedallion"); pedestalCoolDown = builder @@ -641,7 +646,7 @@ public static class IceMagusRodSettings { public final IntValue snowballDamageBonusFireImmune; public final IntValue snowballDamageBonusBlaze; - IceMagusRodSettings(ForgeConfigSpec.Builder builder) { + IceMagusRodSettings(ModConfigSpec.Builder builder) { builder.comment("Ice Magus Rod settings").push("iceMagusRod"); snowballLimit = builder @@ -678,7 +683,7 @@ public static class InfernalChaliceSettings { public final IntValue hungerCostPercent; public final IntValue fluidLimit; - InfernalChaliceSettings(ForgeConfigSpec.Builder builder) { + InfernalChaliceSettings(ModConfigSpec.Builder builder) { builder.comment("Infernal Chalice settings").push("infernalChalice"); hungerCostPercent = builder @@ -698,7 +703,7 @@ public static class InfernalChaliceSettings { public static class InfernalClawsSettings { public final IntValue hungerCostPercent; - InfernalClawsSettings(ForgeConfigSpec.Builder builder) { + InfernalClawsSettings(ModConfigSpec.Builder builder) { builder.comment("Infernal Claws settings").push("infernalClaws"); hungerCostPercent = builder @@ -714,12 +719,13 @@ public static class InfernalClawsSettings { public static class InfernalTearSettings { private static final String ITEM_EXPERIENCE_MATCHER = "([a-z1-9_.-]+:[a-z1-9_/.-]+)\\|\\d+"; public final BooleanValue absorbWhenCreated; - @SuppressWarnings("java:S4968") // ? extends String is the type parameter returned from defineList so it can't be just String here - public final ForgeConfigSpec.ConfigValue> itemExperienceList; + @SuppressWarnings("java:S4968") + // ? extends String is the type parameter returned from defineList so it can't be just String here + public final ModConfigSpec.ConfigValue> itemExperienceList; @Nullable private Map itemExperience = null; - InfernalTearSettings(ForgeConfigSpec.Builder builder) { + InfernalTearSettings(ModConfigSpec.Builder builder) { builder.comment("Infernal Tear settings").push("infernalTear"); absorbWhenCreated = builder @@ -780,7 +786,7 @@ public void resetCache() { public static class KrakenShellSettings { public final IntValue hungerCostPercent; - KrakenShellSettings(ForgeConfigSpec.Builder builder) { + KrakenShellSettings(ModConfigSpec.Builder builder) { builder.comment("Kraken Shell settings").push("krakenShell"); hungerCostPercent = builder @@ -798,7 +804,7 @@ public static class LanternOfParanoiaSettings { public final IntValue minLightLevel; public final IntValue placementScanRadius; - LanternOfParanoiaSettings(ForgeConfigSpec.Builder builder) { + LanternOfParanoiaSettings(ModConfigSpec.Builder builder) { builder.comment("Lantern of Paranoia settings").push("lanternOfParanoia"); torches = builder @@ -824,7 +830,7 @@ public static class MidasTouchstoneSettings { public final IntValue glowstoneWorth; public final IntValue glowstoneLimit; - MidasTouchstoneSettings(ForgeConfigSpec.Builder builder) { + MidasTouchstoneSettings(ModConfigSpec.Builder builder) { builder.comment("Midas Touchstone settings").push("midasTouchstone"); goldItems = builder @@ -858,10 +864,11 @@ public static class MobCharmSettings { public final IntValue maxCharmsToDisplay; public final IntValue pedestalRange; public final BooleanValue keepAlmostDestroyedDisplayed; - @SuppressWarnings("java:S4968") // ? extends String is the type parameter returned from defineList so it can't be just String here + @SuppressWarnings("java:S4968") + // ? extends String is the type parameter returned from defineList so it can't be just String here public final ConfigValue> entityBlockList; - MobCharmSettings(ForgeConfigSpec.Builder builder) { + MobCharmSettings(ModConfigSpec.Builder builder) { builder.comment("Mob Charm settings").push("mobCharm"); durability = builder @@ -913,7 +920,7 @@ public static class PhoenixDownSettings { public final BooleanValue giveTemporaryFireResistanceIfFireDamageKilledYou; public final BooleanValue giveTemporaryWaterBreathingIfDrowningKilledYou; - PhoenixDownSettings(ForgeConfigSpec.Builder builder) { + PhoenixDownSettings(ModConfigSpec.Builder builder) { builder.comment("Phoenix Down settings").push("PhoenixDown"); hungerCostPercent = builder @@ -964,7 +971,7 @@ public static class PyromancerStaffSettings { public final IntValue blazePowderWorth; public final IntValue blazeAbsorbWorth; - PyromancerStaffSettings(ForgeConfigSpec.Builder builder) { + PyromancerStaffSettings(ModConfigSpec.Builder builder) { builder.comment("Pyromancer Staff settings").push("pyromancerStaff"); fireChargeLimit = builder @@ -1018,7 +1025,7 @@ public static class RendingGaleSettings { public final ConfigValue> pushableEntitiesBlacklist; public final ConfigValue> pushableProjectilesBlacklist; - RendingGaleSettings(ForgeConfigSpec.Builder builder) { + RendingGaleSettings(ModConfigSpec.Builder builder) { builder.comment("Rending Gale settings").push("rendingGale"); chargeLimit = builder @@ -1055,7 +1062,7 @@ public static class RendingGaleSettings { pedestalCostPerSecond = builder .comment("Cost per second of buffing players with flight") - .defineInRange("pedestalCostPerSecond", 5, 1, 20); + .defineInRange("pedestalCostPerSecond", 3, 1, 20); pushableEntitiesBlacklist = builder .comment("List of entities that are banned from being pushed by the Rending Gale") @@ -1080,12 +1087,13 @@ public static class RodOfLyssaSettings { public final BooleanValue angerOnStealFailure; public final BooleanValue stealFromPlayers; private static final String ENTITY_NAME_MATCHER = "[a-z1-9_.-]+:[a-z1-9_/.-]+"; - @SuppressWarnings("java:S4968") // ? extends String is the type parameter returned from defineList so it can't be just String here - public final ForgeConfigSpec.ConfigValue> entityBlockList; + @SuppressWarnings("java:S4968") + // ? extends String is the type parameter returned from defineList so it can't be just String here + public final ModConfigSpec.ConfigValue> entityBlockList; @Nullable private Set> blockedEntities = null; - RodOfLyssaSettings(ForgeConfigSpec.Builder builder) { + RodOfLyssaSettings(ModConfigSpec.Builder builder) { builder.comment("Rod of Lyssa settings").push("rodOfLyssa"); useLeveledFailureRate = builder @@ -1122,7 +1130,7 @@ public static class RodOfLyssaSettings { } public boolean canStealFromEntity(Entity entity) { - if(blockedEntities == null) { + if (blockedEntities == null) { initBlockedEntityTypes(); } return !blockedEntities.contains(entity.getType()); @@ -1131,10 +1139,8 @@ public boolean canStealFromEntity(Entity entity) { private void initBlockedEntityTypes() { blockedEntities = new HashSet<>(); for (var entityName : entityBlockList.get()) { - EntityType entityType = ForgeRegistries.ENTITY_TYPES.getValue(new ResourceLocation(entityName)); - if (entityType != null) { - blockedEntities.add(entityType); - } + BuiltInRegistries.ENTITY_TYPE.getOptional(new ResourceLocation(entityName)) + .ifPresent(entityType -> blockedEntities.add(entityType)); } } } @@ -1144,7 +1150,7 @@ private void initBlockedEntityTypes() { public static class SeekerShotSettings { public final ConfigValue> huntableEntitiesBlacklist; - SeekerShotSettings(ForgeConfigSpec.Builder builder) { + SeekerShotSettings(ModConfigSpec.Builder builder) { builder.comment("Seeker Shot settings").push("seekerShot"); huntableEntitiesBlacklist = builder @@ -1163,7 +1169,7 @@ public static class SojournerStaffSettings { public final IntValue maxRange; public final IntValue tilePerCostMultiplier; - SojournerStaffSettings(ForgeConfigSpec.Builder builder) { + SojournerStaffSettings(ModConfigSpec.Builder builder) { builder.comment("Sojourner Staff settings").push("sojournerStaff"); torches = builder @@ -1206,7 +1212,7 @@ private ArrayList getDefaultTorches() { public static class TwilightCloakSettings { public final IntValue maxLightLevel; - TwilightCloakSettings(ForgeConfigSpec.Builder builder) { + TwilightCloakSettings(ModConfigSpec.Builder builder) { builder.comment("Twilight Cloak settings").push("twilightCloak"); maxLightLevel = builder @@ -1223,7 +1229,7 @@ public static class VoidTearSettings { public final IntValue itemLimit; public final BooleanValue absorbWhenCreated; - VoidTearSettings(ForgeConfigSpec.Builder builder) { + VoidTearSettings(ModConfigSpec.Builder builder) { builder.comment("Void Tear settings").push("voidTear"); itemLimit = builder @@ -1240,7 +1246,7 @@ public static class VoidTearSettings { } public static class BlockSettings { - BlockSettings(ForgeConfigSpec.Builder builder) { + BlockSettings(ModConfigSpec.Builder builder) { builder.push("blocks"); altar = new AltarSettings(builder); apothecaryCauldron = new ApothecaryCauldronSettings(builder); @@ -1258,7 +1264,7 @@ public static class AltarSettings { public final IntValue maximumTimeVarianceInMinutes; public final IntValue outputLightLevelWhileActive; - AltarSettings(ForgeConfigSpec.Builder builder) { + AltarSettings(ModConfigSpec.Builder builder) { builder.comment("Altar of Light settings").push("altar"); redstoneCost = builder @@ -1289,7 +1295,7 @@ public static class ApothecaryCauldronSettings { public final ConfigValue> heatSources; public final IntValue glowstoneLimit; - ApothecaryCauldronSettings(ForgeConfigSpec.Builder builder) { + ApothecaryCauldronSettings(ModConfigSpec.Builder builder) { builder.comment("Apothecary Cauldron settings").push("apothecaryCauldron"); redstoneLimit = builder @@ -1319,7 +1325,7 @@ public static class FertileLilypadSettings { public final IntValue tileRange; public final IntValue fullPotencyRange; - FertileLilypadSettings(ForgeConfigSpec.Builder builder) { + FertileLilypadSettings(ModConfigSpec.Builder builder) { builder.comment("Lilypad of Fertility settings").push("fertileLilypad"); secondsBetweenGrowthTicks = builder @@ -1346,7 +1352,7 @@ public static class InterdictionTorchSettings { public final ConfigValue> pushableEntitiesBlacklist; public final ConfigValue> pushableProjectilesBlacklist; - InterdictionTorchSettings(ForgeConfigSpec.Builder builder) { + InterdictionTorchSettings(ModConfigSpec.Builder builder) { builder.comment("Interdiction Torch settings").push("interdictionTorch"); pushRadius = builder @@ -1382,7 +1388,7 @@ public static class PedestalSettings { public final IntValue fishingWrapperSuccessRate; public final IntValue fishingWrapperRetractDelay; - PedestalSettings(ForgeConfigSpec.Builder builder) { + PedestalSettings(ModConfigSpec.Builder builder) { builder.comment("Pedestal related settings").push("pedestal"); meleeWrapperRange = builder @@ -1428,10 +1434,10 @@ public static class PedestalSettings { } public static final Common COMMON; - public static final ForgeConfigSpec COMMON_SPEC; + public static final ModConfigSpec COMMON_SPEC; static { - final Pair specPair = new ForgeConfigSpec.Builder().configure(Common::new); + final Pair specPair = new ModConfigSpec.Builder().configure(Common::new); COMMON_SPEC = specPair.getRight(); COMMON = specPair.getLeft(); } diff --git a/src/main/java/reliquary/reference/Reference.java b/src/main/java/reliquary/reference/Reference.java index b5f7cdcd..3e387089 100644 --- a/src/main/java/reliquary/reference/Reference.java +++ b/src/main/java/reliquary/reference/Reference.java @@ -37,4 +37,5 @@ public class Reference { //reliquary potion names public static final String CURE = MOD_ID + ":cure"; + public static final String FLIGHT = MOD_ID + ":flight"; } diff --git a/src/main/java/reliquary/util/CombinedItemHandler.java b/src/main/java/reliquary/util/CombinedItemHandler.java index 18154deb..c00503eb 100644 --- a/src/main/java/reliquary/util/CombinedItemHandler.java +++ b/src/main/java/reliquary/util/CombinedItemHandler.java @@ -1,8 +1,8 @@ package reliquary.util; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.items.IItemHandler; -import net.minecraftforge.items.wrapper.EmptyHandler; +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.items.wrapper.EmptyHandler; import org.jetbrains.annotations.NotNull; // combines multiple IItemHandler into one interface diff --git a/src/main/java/reliquary/util/InventoryHelper.java b/src/main/java/reliquary/util/InventoryHelper.java index ad7abf39..0dd72b5b 100644 --- a/src/main/java/reliquary/util/InventoryHelper.java +++ b/src/main/java/reliquary/util/InventoryHelper.java @@ -11,28 +11,24 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.items.IItemHandler; -import net.minecraftforge.items.ItemHandlerHelper; +import net.minecraft.world.level.block.state.BlockState; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.items.ItemHandlerHelper; +import net.neoforged.neoforge.items.wrapper.PlayerMainInvWrapper; import reliquary.items.ToggleableItem; import reliquary.items.util.ICuriosItem; import javax.annotation.Nullable; -import java.util.AbstractMap; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; +import java.util.*; import java.util.function.BiFunction; import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Predicate; public class InventoryHelper { - private InventoryHelper() {} + private InventoryHelper() { + } private static final Set> baublesItemHandlerFactories = new HashSet<>(); @@ -80,9 +76,7 @@ public static int getItemQuantity(ItemStack stack, IItemHandler inventory) { } public static ItemStack consumeItemStack(Predicate itemMatches, Player player, int count) { - return player.getCapability(ForgeCapabilities.ITEM_HANDLER, Direction.UP) - .map(inventory -> extractFromInventory(itemMatches, count, inventory, false)) - .orElse(ItemStack.EMPTY); + return extractFromInventory(itemMatches, count, getItemHandlerFrom(player), false); } public static ItemStack extractFromInventory(Predicate itemMatches, int count, IItemHandler inventory, boolean simulate) { @@ -186,34 +180,63 @@ public static int tryToRemoveFromInventory(ItemStack contents, IItemHandler inve return maxToRemove - remaining; } - public static LazyOptional getInventoryAtPos(Level world, BlockPos pos) { - return getInventoryAtPos(world, pos, null); + public static void runOnInventoryAt(Level world, BlockPos pos, Consumer run) { + IItemHandler itemHandler = getInventoryAtPos(world, pos, null); + if (itemHandler == null) { + return; + } + run.accept(itemHandler); } - public static LazyOptional getInventoryAtPos(Level world, BlockPos pos, @Nullable Direction side) { - return WorldHelper.getBlockEntity(world, pos).map(te -> InventoryHelper.getItemHandlerFrom(te, side)).orElse(LazyOptional.empty()); + @Nullable + public static IItemHandler getInventoryAtPos(Level level, BlockPos pos, @Nullable Direction side) { + return level.getCapability(Capabilities.ItemHandler.BLOCK, pos, side); } - public static LazyOptional getItemHandlerFrom(Player player, @Nullable Direction side) { - return player.getCapability(ForgeCapabilities.ITEM_HANDLER, side); + @Nullable + public static IItemHandler getItemHandlerFrom(Player player, @Nullable Direction side) { + return player.getCapability(Capabilities.ItemHandler.ENTITY); } - public static LazyOptional getItemHandlerFrom(Player player) { - return getItemHandlerFrom(player, Direction.UP); + public static IItemHandler getItemHandlerFrom(Player player) { + return new PlayerMainInvWrapper(player.getInventory()); } - public static LazyOptional getItemHandlerFrom(BlockEntity te) { - return getItemHandlerFrom(te, null); + public static void executeOnItemHandlerAt(Level level, BlockPos pos, BlockState state, BlockEntity blockEntity, Consumer run) { + executeOnItemHandlerAt(level, pos, state, blockEntity, handler -> { + run.accept(handler); + return null; + }, null); } - private static LazyOptional getItemHandlerFrom(BlockEntity te, @Nullable Direction side) { - return te.getCapability(ForgeCapabilities.ITEM_HANDLER, side); + public static T executeOnItemHandlerAt(Level level, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity, Function run, @Nullable T defaultReturnValue) { + return executeOnItemHandlerAt(level, pos, state, blockEntity, null, run, defaultReturnValue); + } + + private static T executeOnItemHandlerAt(Level level, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity, @Nullable Direction side, Function run, @Nullable T defaultReturnValue) { + IItemHandler itemHandler = level.getCapability(Capabilities.ItemHandler.BLOCK, pos, state, blockEntity, side); + + if (itemHandler != null) { + return run.apply(itemHandler); + } + + //noinspection DataFlowIssue - sometimes null may be produced based on default value being null, ignoring here not to have to deal with nullability check everywhere this is used + return defaultReturnValue; } public static int insertIntoInventory(ItemStack contents, IItemHandler inventory) { return tryToAddToInventory(contents, inventory, contents.getCount()); } + public static int tryToAddToInventoryAtPos(ItemStack contents, Level level, BlockPos pos, Direction side, int maxToAdd) { + IItemHandler inventory = getInventoryAtPos(level, pos, side); + if (inventory == null) { + return 0; + } + + return tryToAddToInventory(contents, inventory, maxToAdd); + } + public static int tryToAddToInventory(ItemStack contents, IItemHandler inventory, int maxToAdd) { int inventorySize = inventory.getSlots(); @@ -356,22 +379,26 @@ private static void dropInventoryItems(Level world, double x, double y, double z } public static boolean hasItemHandler(Level world, BlockPos pos) { - return WorldHelper.getBlockEntity(world, pos).map(InventoryHelper::hasItemHandler).orElse(false); - } - - private static boolean hasItemHandler(BlockEntity te) { - return te.getCapability(ForgeCapabilities.ITEM_HANDLER, null).isPresent(); + return executeOnItemHandlerAt(world, pos, world.getBlockState(pos), null, handler -> true, false); } public static void runOnItemHandler(ItemStack stack, Consumer run, Class itemHandlerClass) { - getItemHandler(stack, itemHandlerClass).ifPresent(run); + T itemHandler = getItemHandler(stack, itemHandlerClass); + if (itemHandler != null) { + run.accept(itemHandler); + } } - private static Optional getItemHandler(ItemStack stack, Class itemHandlerClass) { - return stack.getCapability(ForgeCapabilities.ITEM_HANDLER, null).filter(itemHandlerClass::isInstance).map(itemHandlerClass::cast); + @Nullable + private static T getItemHandler(ItemStack stack, Class itemHandlerClass) { + return itemHandlerClass.cast(stack.getCapability(Capabilities.ItemHandler.ITEM)); } public static Optional getFromHandler(ItemStack stack, Function get, Class itemHandlerClass) { - return getItemHandler(stack, itemHandlerClass).map(get); + T itemHandler = getItemHandler(stack, itemHandlerClass); + if (itemHandler != null) { + return Optional.of(get.apply(itemHandler)); + } + return Optional.empty(); } } diff --git a/src/main/java/reliquary/util/RegistryHelper.java b/src/main/java/reliquary/util/RegistryHelper.java index c5dbe5eb..638a6b45 100644 --- a/src/main/java/reliquary/util/RegistryHelper.java +++ b/src/main/java/reliquary/util/RegistryHelper.java @@ -1,30 +1,25 @@ package reliquary.util; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.effect.MobEffect; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; -import net.minecraftforge.registries.ForgeRegistries; import java.util.Objects; public class RegistryHelper { - private RegistryHelper() {} + private RegistryHelper() { + } public static String getItemRegistryName(Item item) { - ResourceLocation rl = ForgeRegistries.ITEMS.getKey(item); - //null check because some mods don't properly register items they use in recipes - if (rl != null) { - return rl.toString(); - } - - return ""; + return BuiltInRegistries.ITEM.getKey(item).toString(); } public static ResourceLocation getRegistryName(Item item) { - return Objects.requireNonNull(ForgeRegistries.ITEMS.getKey(item)); + return BuiltInRegistries.ITEM.getKey(item); } public static ResourceLocation getRegistryName(Entity entity) { @@ -32,11 +27,11 @@ public static ResourceLocation getRegistryName(Entity entity) { } public static ResourceLocation getRegistryName(Block block) { - return Objects.requireNonNull(ForgeRegistries.BLOCKS.getKey(block)); + return BuiltInRegistries.BLOCK.getKey(block); } public static ResourceLocation getRegistryName(EntityType entityType) { - return Objects.requireNonNull(ForgeRegistries.ENTITY_TYPES.getKey(entityType)); + return BuiltInRegistries.ENTITY_TYPE.getKey(entityType); } public static boolean registryNamesEqual(Item itemA, Item itemB) { @@ -44,6 +39,6 @@ public static boolean registryNamesEqual(Item itemA, Item itemB) { } public static ResourceLocation getRegistryName(MobEffect effect) { - return Objects.requireNonNull(ForgeRegistries.MOB_EFFECTS.getKey(effect)); + return Objects.requireNonNull(BuiltInRegistries.MOB_EFFECT.getKey(effect)); } } diff --git a/src/main/java/reliquary/util/StackHelper.java b/src/main/java/reliquary/util/StackHelper.java deleted file mode 100644 index 7e8a4c78..00000000 --- a/src/main/java/reliquary/util/StackHelper.java +++ /dev/null @@ -1,20 +0,0 @@ -package reliquary.util; - -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraftforge.registries.ForgeRegistries; - -import java.util.Optional; - -public class StackHelper { - private StackHelper() {} - - public static Optional getItemStackFromName(String name) { - Item item = ForgeRegistries.ITEMS.getValue(new ResourceLocation(name)); - if (item == null) { - return Optional.empty(); - } - return Optional.of(new ItemStack(item)); - } -} diff --git a/src/main/java/reliquary/util/TooltipBuilder.java b/src/main/java/reliquary/util/TooltipBuilder.java index 008acc00..c27fb455 100644 --- a/src/main/java/reliquary/util/TooltipBuilder.java +++ b/src/main/java/reliquary/util/TooltipBuilder.java @@ -1,26 +1,19 @@ package reliquary.util; -import com.google.common.collect.Lists; import net.minecraft.ChatFormatting; import net.minecraft.client.gui.screens.Screen; -import net.minecraft.client.resources.language.I18n; import net.minecraft.locale.Language; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; -import net.minecraft.util.Tuple; -import net.minecraft.world.effect.MobEffect; import net.minecraft.world.effect.MobEffectInstance; -import net.minecraft.world.effect.MobEffectUtil; -import net.minecraft.world.entity.ai.attributes.Attribute; -import net.minecraft.world.entity.ai.attributes.AttributeModifier; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.alchemy.PotionUtils; import reliquary.items.EnderStaffItem; import reliquary.reference.Reference; import reliquary.util.potions.XRPotionHelper; import java.util.List; -import java.util.Map; import java.util.function.UnaryOperator; public class TooltipBuilder { @@ -35,64 +28,7 @@ private TooltipBuilder(List tooltip) { } public void potionEffects(List effects) { - if (!effects.isEmpty()) { - List> attributeModifiers = Lists.newArrayList(); - for (MobEffectInstance potioneffect : effects) { - String s1 = I18n.get(potioneffect.getDescriptionId()).trim(); - MobEffect potion = potioneffect.getEffect(); - Map map = potion.getAttributeModifiers(); - - if (!map.isEmpty()) { - for (Map.Entry entry : map.entrySet()) { - AttributeModifier attributemodifier = entry.getValue(); - AttributeModifier attributemodifier1 = new AttributeModifier(attributemodifier.getName(), potion.getAttributeModifierValue(potioneffect.getAmplifier(), attributemodifier), attributemodifier.getOperation()); - attributeModifiers.add(new Tuple<>(entry.getKey().getDescriptionId(), attributemodifier1)); - } - } - - if (potioneffect.getAmplifier() > 0) { - s1 = s1 + " " + I18n.get("potion.potency." + potioneffect.getAmplifier()).trim(); - } - - if (potioneffect.getDuration() > 20) { - s1 = s1 + " (" + MobEffectUtil.formatDuration(potioneffect, 1.0F).getString() + ")"; - } - - if (potion.isBeneficial()) { - tooltip.add(Component.literal(ChatFormatting.BLUE + s1)); - } else { - tooltip.add(Component.literal(ChatFormatting.RED + s1)); - } - } - - addAttributeModifierTooltip(tooltip, attributeModifiers); - } - } - - private static void addAttributeModifierTooltip(List list, List> list1) { - if (!list1.isEmpty()) { - list.add(Component.literal("")); - list.add(Component.literal(ChatFormatting.DARK_PURPLE + I18n.get("potion.whenDrank"))); - - for (Tuple tuple : list1) { - AttributeModifier attributemodifier2 = tuple.getB(); - double d0 = attributemodifier2.getAmount(); - double d1; - - if (attributemodifier2.getOperation() != AttributeModifier.Operation.MULTIPLY_BASE && attributemodifier2.getOperation() != AttributeModifier.Operation.MULTIPLY_TOTAL) { - d1 = attributemodifier2.getAmount(); - } else { - d1 = attributemodifier2.getAmount() * 100.0D; - } - - if (d0 > 0.0D) { - list.add((Component.translatable("attribute.modifier.plus." + attributemodifier2.getOperation().toValue(), ItemStack.ATTRIBUTE_MODIFIER_FORMAT.format(d1), Component.translatable(tuple.getA()))).withStyle(ChatFormatting.BLUE)); - } else if (d0 < 0.0D) { - d1 = d1 * -1.0D; - list.add((Component.translatable("attribute.modifier.take." + attributemodifier2.getOperation().toValue(), ItemStack.ATTRIBUTE_MODIFIER_FORMAT.format(d1), Component.translatable(tuple.getA()))).withStyle(ChatFormatting.RED)); - } - } - } + PotionUtils.addPotionTooltip(effects, tooltip, 1, 20); } public void potionEffects(ItemStack stack) { diff --git a/src/main/java/reliquary/util/potions/PotionIngredient.java b/src/main/java/reliquary/util/potions/PotionIngredient.java index 9399f97b..13923f82 100644 --- a/src/main/java/reliquary/util/potions/PotionIngredient.java +++ b/src/main/java/reliquary/util/potions/PotionIngredient.java @@ -1,10 +1,10 @@ package reliquary.util.potions; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.effect.MobEffect; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.registries.ForgeRegistries; import reliquary.util.LogHelper; import java.util.ArrayList; @@ -24,7 +24,7 @@ public PotionIngredient(ItemStack item, List effects) { } void addEffect(String potionName, int durationWeight, int ampWeight) { - MobEffect mobEffect = ForgeRegistries.MOB_EFFECTS.getValue(new ResourceLocation(potionName)); + MobEffect mobEffect = BuiltInRegistries.MOB_EFFECT.get(new ResourceLocation(potionName)); if (mobEffect == null) { LogHelper.error("Potion name " + potionName + " is not registered. Please fix the name or remove it from potion map."); diff --git a/src/main/java/reliquary/util/potions/PotionMap.java b/src/main/java/reliquary/util/potions/PotionMap.java index fd81856a..3025029d 100644 --- a/src/main/java/reliquary/util/potions/PotionMap.java +++ b/src/main/java/reliquary/util/potions/PotionMap.java @@ -1,19 +1,18 @@ package reliquary.util.potions; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.resources.ResourceLocation; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import reliquary.init.ModItems; +import reliquary.reference.Config; import reliquary.reference.Reference; -import reliquary.reference.Settings; import reliquary.util.LogHelper; import reliquary.util.RegistryHelper; -import reliquary.util.StackHelper; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.StringJoiner; +import java.util.*; import java.util.regex.Pattern; public class PotionMap { @@ -34,8 +33,8 @@ public static void initPotionMap() { } private static void setDefaultInConfigIfEmpty() { - if (Settings.COMMON.potions.potionMap.get().isEmpty()) { - Settings.COMMON.potions.potionMap.set(getDefaultConfigPotionMap()); + if (Config.COMMON.potions.potionMap.get().isEmpty()) { + Config.COMMON.potions.potionMap.set(getDefaultConfigPotionMap()); } } @@ -64,7 +63,7 @@ private static void loadUniquePotions() { private static void addUniquePotions(PotionEssence essence) { uniquePotions.add(essence); - if (Boolean.TRUE.equals(Settings.COMMON.potions.redstoneAndGlowstone.get())) { + if (Boolean.TRUE.equals(Config.COMMON.potions.redstoneAndGlowstone.get())) { PotionEssence redstone = essence.copy(); redstone.setEffects(XRPotionHelper.augmentPotionEffects(redstone.getEffects(), 1, 0)); redstone.setRedstoneCount(1); @@ -92,10 +91,10 @@ private static void loadPotionCombinations() { for (PotionIngredient ingredient2 : ingredients) { if (ingredient1.getItem().getItem() != ingredient2.getItem().getItem()) { PotionEssence twoEssence = new PotionEssence.Builder().setIngredients(ingredient1, ingredient2).setEffects(XRPotionHelper.combineIngredients(ingredient1, ingredient2)).build(); - if (!twoEssence.getEffects().isEmpty() && twoEssence.getEffects().size() <= Settings.COMMON.potions.maxEffectCount.get()) { + if (!twoEssence.getEffects().isEmpty() && twoEssence.getEffects().size() <= Config.COMMON.potions.maxEffectCount.get()) { addPotionCombination(twoEssence); - if (Boolean.TRUE.equals(Settings.COMMON.potions.threeIngredients.get())) { + if (Boolean.TRUE.equals(Config.COMMON.potions.threeIngredients.get())) { for (PotionIngredient ingredient3 : ingredients) { if ((ingredient3.getItem().getItem() != ingredient1.getItem().getItem()) && ingredient3.getItem().getItem() != ingredient2.getItem().getItem()) { PotionEssence threeEssence = new PotionEssence.Builder().setIngredients(ingredient1, ingredient2, ingredient3).setEffects(XRPotionHelper.combineIngredients(ingredient1, ingredient2, ingredient3)).build(); @@ -119,7 +118,7 @@ private static void addPotionCombination(PotionEssence newEssence) { return; } //the same effect potion id with different duration is turned on by config option - if (effectsEqual(essence.getEffects(), newEssence.getEffects(), Settings.COMMON.potions.differentDurations.get()) && !effectsEqual(essence.getEffects(), newEssence.getEffects())) { + if (effectsEqual(essence.getEffects(), newEssence.getEffects(), Config.COMMON.potions.differentDurations.get()) && !effectsEqual(essence.getEffects(), newEssence.getEffects())) { return; } } @@ -175,7 +174,7 @@ private static void loadPotionMapFromSettings() { ingredients.clear(); Pattern validEntry = Pattern.compile("[a-z_:0-9]+=[a-z_0-9:.|;]+"); - for (String entry : Settings.COMMON.potions.potionMap.get()) { + for (String entry : Config.COMMON.potions.potionMap.get()) { if (validEntry.matcher(entry).matches()) { String[] entryParts = entry.split("="); @@ -193,7 +192,7 @@ private static void loadPotionMapFromSettings() { } private static void addItemEffectsToPotionMap(String name, String[] effects) { - StackHelper.getItemStackFromName(name).ifPresent(stack -> { + getItemStackFromName(name).ifPresent(stack -> { PotionIngredient ingredient = new PotionIngredient(stack); for (String effect : effects) { String[] effectValues = effect.split("\\|"); @@ -217,7 +216,7 @@ public static List getDefaultConfigPotionMap() { addPotionIngredient(potionMap, Items.SUGAR, speed(3, 0), haste(3, 0)); addPotionIngredient(potionMap, Items.APPLE, heal(0), hboost(3, 0), cure(0)); addPotionIngredient(potionMap, Items.COAL, blind(1), absorb(3, 0), invis(1), wither(0, 0)); - addPotionIngredient(potionMap, Items.FEATHER, jump(3, 0), weak(1, 0)); + addPotionIngredient(potionMap, Items.FEATHER, jump(3, 0), weak(1, 0), flight(1)); addPotionIngredient(potionMap, Items.WHEAT_SEEDS, harm(0), hboost(3, 0)); addPotionIngredient(potionMap, Items.WHEAT, heal(0), hboost(3, 0)); addPotionIngredient(potionMap, Items.FLINT, harm(0), dboost(3, 0)); @@ -240,7 +239,7 @@ public static List getDefaultConfigPotionMap() { //TIER TWO INGREDIENTS, one of the effects of each will always be a one, slightly increased duration vs. TIER ONE addPotionIngredient(potionMap, Items.SPIDER_EYE, vision(4), poison(2)); - addPotionIngredient(potionMap, Items.BLAZE_POWDER, dboost(4, 0), harm(0)); + addPotionIngredient(potionMap, Items.BLAZE_POWDER, dboost(4, 0), harm(0), flight(1)); addPotionIngredient(potionMap, Items.IRON_INGOT, resist(4, 0), slow(2, 0)); addPotionIngredient(potionMap, Items.STRING, slow(2, 0), fatigue(2, 0)); addPotionIngredient(potionMap, Items.BREAD, hboost(4, 0), satur(5)); @@ -264,7 +263,7 @@ public static List getDefaultConfigPotionMap() { addPotionIngredient(potionMap, Items.PUMPKIN_PIE, invis(1), fireres(1), speed(3, 0), haste(3, 0), absorb(3, 0), regen(0, 0)); //combination of ingredients, strong. addPotionIngredient(potionMap, Items.MAGMA_CREAM, dboost(4, 0), harm(0), resist(4, 0), fireres(2)); //also a combo, strong. addPotionIngredient(potionMap, Items.GLISTERING_MELON_SLICE, dboost(3, 0), haste(3, 0), heal(0), speed(4, 0)); //combo - addPotionIngredient(potionMap, Items.GHAST_TEAR, regen(3, 0), absorb(5, 0)); + addPotionIngredient(potionMap, Items.GHAST_TEAR, regen(3, 0), absorb(5, 0), flight(2)); addPotionIngredient(potionMap, Items.FERMENTED_SPIDER_EYE, vision(4), poison(2), speed(3, 0), haste(3, 0)); //combo addPotionIngredient(potionMap, Items.GOLDEN_CARROT, dboost(3, 0), haste(3, 0), hboost(3, 0), vision(3)); //combo addPotionIngredient(potionMap, Items.GOLD_INGOT, dboost(4, 0), haste(4, 0), cure(0)); //combo @@ -276,12 +275,12 @@ public static List getDefaultConfigPotionMap() { addPotionIngredient(potionMap, ModItems.CHELICERAE.get(), poison(3), weak(3, 0)); addPotionIngredient(potionMap, ModItems.SLIME_PEARL.get(), resist(5, 0), absorb(5, 0)); addPotionIngredient(potionMap, ModItems.KRAKEN_SHELL_FRAGMENT.get(), absorb(5, 0), breath(5)); - addPotionIngredient(potionMap, ModItems.BAT_WING.get(), jump(5, 0), weak(3, 0)); + addPotionIngredient(potionMap, ModItems.BAT_WING.get(), jump(5, 0), weak(3, 0), flight(2)); addPotionIngredient(potionMap, Items.GOLDEN_APPLE, cure(1)); addPotionIngredient(potionMap, Items.GOLDEN_APPLE, cure(2)); //TIER FOUR INGREDIENTS, these carry multiple one-potency effects and have the most duration for any given effect. - addPotionIngredient(potionMap, Items.DIAMOND, resist(6, 1), absorb(6, 1), fireres(6), cure(0)); + addPotionIngredient(potionMap, Items.DIAMOND, resist(6, 1), absorb(6, 1), fireres(6), cure(0), flight(1)); addPotionIngredient(potionMap, ModItems.WITHERED_RIB.get(), wither(2, 1), weak(3, 1), slow(3, 1), fatigue(3, 1), cure(0)); addPotionIngredient(potionMap, Items.ENDER_EYE, dboost(6, 1), invis(6), speed(6, 1), harm(1)); addPotionIngredient(potionMap, Items.EMERALD, haste(6, 1), speed(6, 1), hboost(6, 1), cure(1)); @@ -364,6 +363,10 @@ private static String jump(int duration, int potency) { return effectString(Reference.JUMP, Integer.toString(duration), Integer.toString(potency)); } + private static String flight(int duration) { + return effectString(Reference.FLIGHT, Integer.toString(duration), Integer.toString(0)); + } + private static String nausea(int duration) { return effectString(Reference.NAUSEA, Integer.toString(duration), Integer.toString(0)); } @@ -406,4 +409,8 @@ private static void addPotionIngredient(List potionMap, String itemRegis potionMap.add(String.format("%s=%s", itemRegistryName, effectsString)); } + + public static Optional getItemStackFromName(String name) { + return BuiltInRegistries.ITEM.getOptional(new ResourceLocation(name)).map(ItemStack::new); + } } diff --git a/src/main/java/reliquary/util/potions/XRPotionHelper.java b/src/main/java/reliquary/util/potions/XRPotionHelper.java index adf5ceed..557752f5 100644 --- a/src/main/java/reliquary/util/potions/XRPotionHelper.java +++ b/src/main/java/reliquary/util/potions/XRPotionHelper.java @@ -2,6 +2,7 @@ import com.google.common.base.MoreObjects; import com.google.common.collect.Lists; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.ListTag; import net.minecraft.nbt.Tag; @@ -12,19 +13,11 @@ import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.registries.ForgeRegistries; import reliquary.items.PotionEssenceItem; import reliquary.util.RegistryHelper; import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; +import java.util.*; public class XRPotionHelper { @@ -221,7 +214,7 @@ public static List combineIngredients(Collection getPotionEffectsFromCompoundTag(CompoundTa int duration = effect.getInt("duration"); int potency = effect.getInt("potency"); //noinspection ConstantConditions - ret.add(new MobEffectInstance(ForgeRegistries.MOB_EFFECTS.getValue(new ResourceLocation(registryName)), duration, potency)); + ret.add(new MobEffectInstance(BuiltInRegistries.MOB_EFFECT.get(new ResourceLocation(registryName)), duration, potency)); } return ret; diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg index 70a36268..698c3d4e 100644 --- a/src/main/resources/META-INF/accesstransformer.cfg +++ b/src/main/resources/META-INF/accesstransformer.cfg @@ -1,10 +1,17 @@ -public net.minecraft.world.entity.projectile.Projectile (Lnet/minecraft/entity/EntityType;Lnet/minecraft/world/World;)V -protected net.minecraft.world.entity.Entity f_19825_ #positionVec -protected net.minecraft.world.entity.Entity f_19826_ #position -public net.minecraft.world.entity.projectile.FishingHook$FishHookState +protected net.minecraft.world.entity.Entity position +protected net.minecraft.world.entity.Entity blockPosition +public net.minecraft.world.entity.LivingEntity fallFlyTicks +public net.minecraft.world.entity.Mob handDropChances +public net.minecraft.world.entity.Mob armorDropChances +public net.minecraft.world.entity.projectile.FishingHook currentState +public net.minecraft.world.entity.projectile.FishingHook nibble +public net.minecraft.world.entity.monster.ZombieVillager startConverting(Ljava/util/UUID;I)V +public net.minecraft.world.item.crafting.ShapelessRecipe result +public net.minecraft.world.item.crafting.ShapedRecipe result +public net.minecraft.world.item.crafting.ShapedRecipe pattern protected net.minecraft.world.entity.projectile.FishingHook (Lnet/minecraft/world/entity/EntityType;Lnet/minecraft/world/level/Level;II)V -protected net.minecraft.world.entity.projectile.FishingHook m_37136_(Lnet/minecraft/world/entity/player/Player;)Z #shouldStopFishing -public net.minecraft.world.item.context.UseOnContext m_43718_()Lnet/minecraft/world/phys/BlockHitResult; # getHitResult -public net.minecraft.world.item.crafting.ShapelessRecipe f_44243_ # result -public net.minecraft.world.item.crafting.ShapedRecipe f_44149_ # result -public net.minecraft.world.damagesource.DamageSources m_268998_(Lnet/minecraft/resources/ResourceKey;Lnet/minecraft/world/entity/Entity;Lnet/minecraft/world/entity/Entity;)Lnet/minecraft/world/damagesource/DamageSource; # source \ No newline at end of file +protected net.minecraft.world.entity.projectile.FishingHook shouldStopFishing(Lnet/minecraft/world/entity/player/Player;)Z +public net.minecraft.world.item.context.UseOnContext getHitResult()Lnet/minecraft/world/phys/BlockHitResult; +public net.minecraft.world.entity.projectile.FishingHook$FishHookState +public-f net.minecraft.world.inventory.Slot x +public-f net.minecraft.world.inventory.Slot y \ No newline at end of file diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 2e7786ca..5b36c88c 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -1,58 +1,32 @@ -# There are several mandatory fields (#mandatory), and many more that are optional (#optional). -# The overall format is standard TOML format, v0.5.0. -# Note that there are a couple of TOML lists in this file. -# Find more information on toml format here: https://github.com/toml-lang/toml - -# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml modLoader="javafml" #mandatory - -# A version range to match for said mod loader - for regular FML @Mod it will be the minecraft version (without the 1.) -loaderVersion="[14,)" #mandatory - -# A URL to query for updates for this mod. See the JSON update specification -#updateJSONURL="" #optional - -# A URL to refer people to when problems occur with this mod -issueTrackerURL="https://github.com/p3pp3rF1y/reliquary/issues" #optional - -# A URL for the "homepage" for this mod, displayed in the mod UI -displayURL="https://www.curseforge.com/minecraft/mc-mods/reliquary-v1-3" #optional - -# License -license="GNU General Public License v3.0" - -# A file name (in the root of the mod JAR) containing a logo for display -logoFile="xrlogo.png" #optional - -# A text field displayed in the mod UI -credits="Originally made by x3n0ph0b3 and TheMike, now maintained by P3pp3rF1y." #optional - -# A text field displayed in the mod UI -authors="x3n0ph0b3, TheMike, P3pp3rF1y" #optional - -# A list of mods - how many allowed here is determined by the individual mod loader -[[mods]] #mandatory - -# The modid of the mod -modId="reliquary" #mandatory - -# The version number of the mod -version="project_version" #mandatory - -# A display name for the mod -displayName="Reliquary" #mandatory - -# The description text for the mod (multi line!) (#mandatory) -description=''' -Two words: magical swag. Oh, and a gun. -''' - -# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional. -[[dependencies.reliquary]] - modId="forge" #mandatory - mandatory=true #mandatory - versionRange="[36.1.3,)" #mandatory - # An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory - ordering="NONE" - # Side this dependency is applied on - BOTH, CLIENT or SERVER - side="BOTH" \ No newline at end of file +loaderVersion="${loader_version_range}" #mandatory + +license="${mod_license}" +issueTrackerURL="${mod_issue_tracker_url}" + +[[mods]] +modId="${mod_id}" +version="${mod_version}" +displayName="${mod_name}" +displayURL="${mod_display_url}" +logoFile="${mod_logo_file}" +credits="${mod_credits}" +authors="${mod_authors}" +description='''${mod_description}''' + +[[accessTransformers]] +file="META-INF/accesstransformer.cfg" + +[[dependencies.${mod_id}]] #optional +modId="neoforge" #mandatory +type="required" #mandatory +versionRange="${neo_version_range}" #mandatory +ordering="NONE" +side="BOTH" + +[[dependencies.${mod_id}]] +modId="minecraft" +type="required" +versionRange="${minecraft_version_range}" +ordering="NONE" +side="BOTH" \ No newline at end of file diff --git a/src/main/resources/assets/reliquary/lang/en_us.json b/src/main/resources/assets/reliquary/lang/en_us.json index 86f36447..0f7ccfa1 100644 --- a/src/main/resources/assets/reliquary/lang/en_us.json +++ b/src/main/resources/assets/reliquary/lang/en_us.json @@ -92,7 +92,7 @@ "item.reliquary.ender_staff.tooltip": "Uses ender pearls to let player teleport around", "item.reliquary.ender_staff.tooltip2": "Shift + Scroll to cycle modes:\n[Cast, Long Cast, Node Warp or Bind]", "item.reliquary.ender_staff.tooltip.charge": "Ender Pearls: %s", - "item.reliquary.ender_staff.tooltip.position": "Currently bound to X:%s Y:%s Z:%s", + "item.reliquary.ender_staff.tooltip.position": "Currently bound to %s, %s, %s in %s", "item.reliquary.ender_staff.tooltip.position.nowhere": "Currently bound to nowhere.", "item.reliquary.ender_staff.tooltip.position.out_of_range": "Out of range!", "item.reliquary.fertile_potion": "Fertile Potion", diff --git a/src/main/resources/data/reliquary/curios/entities/entities.json b/src/main/resources/data/reliquary/curios/entities/entities.json new file mode 100644 index 00000000..6c8fcd7e --- /dev/null +++ b/src/main/resources/data/reliquary/curios/entities/entities.json @@ -0,0 +1,10 @@ +{ + "entities": [ + "minecraft:player" + ], + "slots": [ + "body", + "belt", + "necklace" + ] +} \ No newline at end of file diff --git a/src/test/java/reliquary/items/util/FilteredItemStackHandlerTest.java b/src/test/java/reliquary/items/util/FilteredItemStackHandlerTest.java index fec253af..013f0f23 100644 --- a/src/test/java/reliquary/items/util/FilteredItemStackHandlerTest.java +++ b/src/test/java/reliquary/items/util/FilteredItemStackHandlerTest.java @@ -10,7 +10,7 @@ import net.minecraft.nbt.NBTTagInt; import net.minecraft.nbt.NBTTagList; import net.minecraft.util.NonNullList; -import net.minecraftforge.items.ItemHandlerHelper; +import net.neoforged.neoforge.items.ItemHandlerHelper; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.invocation.InvocationOnMock;