diff --git a/.github/workflows/build_and_publish.yaml b/.github/workflows/build_and_publish.yaml index 120fb7680..fbea7e8d6 100644 --- a/.github/workflows/build_and_publish.yaml +++ b/.github/workflows/build_and_publish.yaml @@ -63,17 +63,17 @@ jobs: with: allowUpdates: true draft: false - name: occultism-${{ steps.get_mc_version.outputs.result }}-${{ steps.get_version.outputs.result }}-${{ steps.get_release_type.outputs.result }} + name: occultism-${{ steps.get_mc_version.outputs.result }}-neoforge-${{ steps.get_version.outputs.result }}-${{ steps.get_release_type.outputs.result }} body: ${{ steps.changelog.outputs.changes }} token: ${{ github.token }} tag: ${{ github.ref }} - artifacts: ./build/libs/occultism-${{ steps.get_mc_version.outputs.result }}-${{ steps.get_version.outputs.result }}.jar + artifacts: ./build/libs/occultism-${{ steps.get_mc_version.outputs.result }}-neoforge-${{ steps.get_version.outputs.result }}.jar artifactContentType: application/java-archive - name: Commit CHANGELOG.md uses: stefanzweifel/git-auto-commit-action@v4 if: ${{ steps.get_release_type.outputs.result != 'test' }} with: - branch: version/1.20.1 + branch: version/1.20.4 commit_message: 'docs: update CHANGELOG.md for ${{ github.ref_name }} [skip ci]' file_pattern: CHANGELOG.md - name: Upload to Mod Platforms @@ -86,14 +86,13 @@ jobs: curseforge-token: ${{ secrets.CURSEFORGE_API_KEY }} files: | - build/libs/occultism-${{ steps.get_mc_version.outputs.result }}-${{ steps.get_version.outputs.result }}.jar - build/libs/occultism-${{ steps.get_mc_version.outputs.result }}-${{ steps.get_version.outputs.result }}-sources.jar + build/libs/occultism-${{ steps.get_mc_version.outputs.result }}-neoforge-${{ steps.get_version.outputs.result }}.jar + build/libs/occultism-${{ steps.get_mc_version.outputs.result }}-neoforge-${{ steps.get_version.outputs.result }}-sources.jar - name: occultism-${{ steps.get_mc_version.outputs.result }}-${{ steps.get_version.outputs.result }}.jar - version: ${{ steps.get_mc_version.outputs.result }}-${{ steps.get_version.outputs.result }} + name: occultism-${{ steps.get_mc_version.outputs.result }}-neoforge-${{ steps.get_version.outputs.result }}.jar + version: ${{ steps.get_mc_version.outputs.result }}-neoforge-${{ steps.get_version.outputs.result }} version-type: ${{ steps.get_release_type.outputs.result }} loaders: | - forge neoforge game-versions: | ${{ steps.get_mc_version.outputs.result }} diff --git a/.gitignore b/.gitignore index 938cc1c1f..d4dafbc8c 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ build # other eclipse run +runs # Files from Forge MDK forge*changelog.txt diff --git a/build.gradle b/build.gradle index 131dd638b..347a40ba9 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,7 @@ plugins { id 'idea' id 'maven-publish' - id 'net.minecraftforge.gradle' version '[6.0,6.2)' - id 'org.parchmentmc.librarian.forgegradle' version '1.+' + id 'net.neoforged.gradle.userdev' version "${neogradle_version}" } if (System.getenv('MOD_VERSION') != null) { @@ -11,96 +10,45 @@ if (System.getenv('MOD_VERSION') != null) { version = mod_version base { - archivesName = mod_id + "-" + minecraft_version + archivesName = "${mod_id}-${minecraft_version}-neoforge" } -java.toolchain.languageVersion = JavaLanguageVersion.of(17) -java.withSourcesJar() - -println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch')) -minecraft { - - mappings channel: mapping_channel, version: mapping_version - - accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') - - // Default run configurations. - // These can be tweaked, removed, or duplicated as needed. - runs { - client { - workingDirectory project.file('run') - args '--username', 'Occultism' - // Recommended logging data for a userdev environment - property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' - - // Recommended logging level for the console - property 'forge.logging.console.level', 'debug' - - //Fix for patchouli mixin crash - property 'mixin.env.remapRefMap', 'true' - property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg" - - // enable using JBR to hotswap MOAR - // also ignore the option if someone isnt using JBR - jvmArgs '-XX:+AllowEnhancedClassRedefinition', '-XX:+IgnoreUnrecognizedVMOptions' - - mods { - "${mod_id}" { - source sourceSets.main - } - } - } - - clientalt { - parent runs.client - //somehow doesnt replace the name but adds a new one, so we manually need remove - args '--username', 'Occultism2' //#s get replaced with random numbers when starting - } - - server { - workingDirectory project.file('run') - - // Recommended logging data for a userdev environment - property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' - - // Recommended logging level for the console - property 'forge.logging.console.level', 'debug' - - //Workaround for patchouli mixin crash - property 'mixin.env.disableRefMap', 'true' - - // enable using JBR to hotswap MOAR - // also ignore the option if someone isnt using JBR - jvmArgs '-XX:+AllowEnhancedClassRedefinition', '-XX:+IgnoreUnrecognizedVMOptions' - - mods { - "${mod_id}" { - source sourceSets.main - } - } +//TODO: re enable source sets once mods are updated +sourceSets { + main { + java { + exclude '**/AlmostUnifiedIntegrationImpl.java' } + } +} - data { - workingDirectory project.file('run') +java.toolchain.languageVersion = JavaLanguageVersion.of(17) +java.withSourcesJar() - // Recommended logging data for a userdev environment - property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' +if (file('src/main/resources/META-INF/accesstransformer.cfg').exists()) { + minecraft.accessTransformers.file file('src/main/resources/META-INF/accesstransformer.cfg') +} - // Recommended logging level for the console - property 'forge.logging.console.level', 'debug' +runs { + configureEach { + systemProperty 'forge.logging.markers', 'REGISTRIES' + systemProperty 'forge.logging.console.level', 'debug' + jvmArguments.addAll('-XX:+AllowEnhancedClassRedefinition', '-XX:+IgnoreUnrecognizedVMOptions') + modSource project.sourceSets.main + } - //Workaround for patchouli mixin crash - property 'mixin.env.disableRefMap', 'true' + client { + systemProperty 'forge.enabledGameTestNamespaces', project.mod_id + programArgument "--username=Occultism" + } - // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources. - args '--mod', 'occultism', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') + server { + systemProperty 'forge.enabledGameTestNamespaces', project.mod_id +// programArgument '--nogui' + } - mods { - "${mod_id}" { - source sourceSets.main - } - } - } + data { + programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath() } } @@ -162,51 +110,46 @@ repositories { } dependencies { - // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed - // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied. - // The userdev artifact is a special name and will get all sorts of transformations applied to it. - minecraft "net.minecraftforge:forge:${forge_version}" + implementation "net.neoforged:neoforge:${neo_version}" //Jei - compileOnly fg.deobf("mezz.jei:jei-${minecraft_version}-common-api:${jei_version}") - compileOnly fg.deobf("mezz.jei:jei-${minecraft_version}-forge-api:${jei_version}") - runtimeOnly fg.deobf("mezz.jei:jei-${minecraft_version}-forge:${jei_version}") + compileOnly "mezz.jei:jei-${minecraft_version}-common-api:${jei_version}" + compileOnly "mezz.jei:jei-${minecraft_version}-neoforge-api:${jei_version}" + runtimeOnly "mezz.jei:jei-${minecraft_version}-neoforge:${jei_version}" + //TODO: enable once available //curios - compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}+${minecraft_version}:api") - runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}+${minecraft_version}") +// compileOnly "top.theillusivec4.curios:curios-neoforge:${curios_version}+${minecraft_version}:api" +// runtimeOnly "top.theillusivec4.curios:curios-neoforge:${curios_version}+${minecraft_version}" //geckolib - implementation fg.deobf("software.bernie.geckolib:geckolib-forge-${geckolib_minecraft_version}:${geckolib_version}") + implementation "software.bernie.geckolib:geckolib-neoforge-${geckolib_minecraft_version}:${geckolib_version}" //smartbrainlib - implementation fg.deobf("net.tslat.smartbrainlib:SmartBrainLib-forge-${smartbrainlib_minecraft_version}:${smartbrainlib_version}") + implementation "net.tslat.smartbrainlib:SmartBrainLib-neoforge-${smartbrainlib_minecraft_version}:${smartbrainlib_version}" + //TODO: enable once available //almostunified - implementation fg.deobf("com.almostreliable.mods:almostunified-forge:${minecraft_version}-${almost_unified_version}") +// implementation "com.almostreliable.mods:almostunified-forge:${minecraft_version}-${almost_unified_version}" //modonomicon - implementation fg.deobf("com.klikli_dev:modonomicon-${minecraft_version}-forge:${modonomicon_version}") + implementation "com.klikli_dev:modonomicon-${minecraft_version}-neoforge:${modonomicon_version}" //theurgy - compileOnly fg.deobf("com.klikli_dev:theurgy-${minecraft_version}:${theurgy_version}"){transitive=false} - runtimeOnly fg.deobf("com.klikli_dev:theurgy-${minecraft_version}:${theurgy_version}"){transitive=false} + compileOnly "com.klikli_dev:theurgy-${minecraft_version}-neoforge:${theurgy_version}" + runtimeOnly "com.klikli_dev:theurgy-${minecraft_version}-neoforge:${theurgy_version}" //runtime only helper mods for dev env, placed in ./runtime-mods, example: Hwyla-forge-1.10.11-B78_1.16.2.jar - //runtimeOnly fg.deobf("ignoredvalue:Hwyla:forge-1.10.11-B78_1.16.2") + //runtimeOnly "ignoredvalue:Hwyla:forge-1.10.11-B78_1.16.2" //alltheores - for recipe testing //enable once available for 1.20 - //runtimeOnly fg.deobf("curse.maven:alltheores-405593:xyz") // - - //Ma for crafting issue testing -// runtimeOnly fg.deobf("curse.maven:mysticalagriculture-246640:4399151") //MysticalAgriculture-1.19.3-6.1.4.jar -// runtimeOnly fg.deobf("curse.maven:cucumber-272335:4395466") //Cucumber-1.19.3-6.1.2.jar + //runtimeOnly "curse.maven:alltheores-405593:xyz" // //PerViamInvenire - for AI integration testing - //runtimeOnly fg.deobf("curse.maven:perviaminvenire-449945:xyz") // + //runtimeOnly "curse.maven:perviaminvenire-449945:xyz" // //enable once available for 1.20 - //runtimeOnly fg.deobf("com.ldtteam:per_viam_invenire:1.19.3-XYZ-RELEASE:universal") + //runtimeOnly "com.ldtteam:per_viam_invenire:1.19.3-XYZ-RELEASE:universal" } processResources { @@ -230,8 +173,6 @@ jar { } } -jar.finalizedBy('reobfJar') - publishing { publications { mavenJava(MavenPublication) { diff --git a/gradle.properties b/gradle.properties index f27973f9b..d75b9b404 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,21 +6,25 @@ org.gradle.daemon=false ## Environment Properties # The Minecraft version must agree with the Forge version to get a valid artifact -minecraft_version=1.20.1 +minecraft_version=1.20.4 # The Minecraft version range can use any release version of Minecraft as bounds. # Snapshots, pre-releases, and release candidates are not guaranteed to sort properly # as they do not follow standard versioning conventions. -minecraft_version_range=[1.20,1.21) -# The Forge version must agree with the Minecraft version to get a valid artifact -forge_version=1.20.1-47.1.3 -# The Forge version range can use any version of Forge as bounds or match the loader version range -forge_version_range=[47,) -# The loader version range can only use the major version of Forge/FML as bounds -loader_version_range=[47,) -mapping_channel=parchment -#postfix is target mc version, optional prefix is source parchment mc version -mapping_version=2023.06.26-1.20.1 +## Neo +# The neo version must agree with the Minecraft version to get a valid artifact +neo_version=20.4.117-beta +# The neo version range can use any version of neo as bounds or match the loader version range +neo_version_range=[20.4.80-beta,) +# The loader version range can only use the major version of Neo/FML as bounds +neo_loader_version_range=[2,) +neogradle_version=7.0.80 + +# neo directly reads these properties +# the version the mappings were created for, does not need to match the current mc version +neogradle.subsystems.parchment.minecraftVersion=1.20.3 +# the mapping version +neogradle.subsystems.parchment.mappingsVersion=2023.12.31 ## Mod Properties group=com.klikli_dev @@ -32,22 +36,20 @@ mod_authors=Kli Kli mod_description=A magic mod inspired by the world of Jonathan Stroud's Bartimaeus. With the help of occult rituals players can summon entities from the "Other Side" to perform magic. ## Dependency Properties -jei_version=15.2.0.23 -jei_version_range=[15.2.0.0,) -curios_version=5.2.0-beta.3 -curios_version_range=[5.2.0-beta.1,) -# geckolib currently names their files after 1.20 -geckolib_minecraft_version=1.20.1 -geckolib_version=4.4 -geckolib_version_range=[4.4,) -# smartbrainlib currently names their files after 1.20 -smartbrainlib_minecraft_version=1.20 -smartbrainlib_version=1.11 -smartbrainlib_version_range=[1.11,) +jei_version=17.0.0.30 +jei_version_range=[17.0.0.30,) +curios_version=7.0.0-beta.3 +curios_version_range=[7.0.0-beta.3,) +geckolib_minecraft_version=1.20.4 +geckolib_version=4.4.1 +geckolib_version_range=[4.4.1,) +smartbrainlib_minecraft_version=1.20.4 +smartbrainlib_version=1.13 +smartbrainlib_version_range=[1.13,) almost_unified_version=0.5.0 almost_unified_version_range=[0.5.0,) -modonomicon_version=1.51.0 -modonomicon_version_range=[1.38.1,) -theurgy_version=1.8.0 -theurgy_version_range=[1.6.3,) +modonomicon_version=1.54.4 +modonomicon_version_range=[1.52.0,) +theurgy_version=1.13.0 +theurgy_version_range=[1.11.0,) per_viam_invenire_version_range=[0.1.57,) \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index ad9053e30..6fc1fb386 100644 --- a/settings.gradle +++ b/settings.gradle @@ -2,18 +2,13 @@ pluginManagement { repositories { gradlePluginPortal() maven { - url = 'https://maven.minecraftforge.net/' - content { - includeGroup "net.minecraftforge.gradle" - includeGroup "net.minecraftforge" - } - } - maven { - url = 'https://maven.parchmentmc.org' + url = 'https://maven.neoforged.net/releases/' } } } plugins { id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0' -} \ No newline at end of file +} + +rootProject.name = 'Occultism ' + minecraft_version \ No newline at end of file diff --git a/src/generated/resources/data/occultism/advancements/occultism/craft_dimensional_matrix.json b/src/generated/resources/data/occultism/advancements/occultism/craft_dimensional_matrix.json index 9ab56c538..9d2f6c9dd 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/craft_dimensional_matrix.json +++ b/src/generated/resources/data/occultism/advancements/occultism/craft_dimensional_matrix.json @@ -3,9 +3,7 @@ "criteria": { "craft_dimensional_matrix": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/craft_dimensional_matrix" - } + "ritual_id": "occultism:ritual/craft_dimensional_matrix" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.craft_dimensional_matrix.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/craft_dimensional_mineshaft.json b/src/generated/resources/data/occultism/advancements/occultism/craft_dimensional_mineshaft.json index f4cfa4750..76b4685bd 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/craft_dimensional_mineshaft.json +++ b/src/generated/resources/data/occultism/advancements/occultism/craft_dimensional_mineshaft.json @@ -3,9 +3,7 @@ "criteria": { "craft_dimensional_mineshaft": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/craft_dimensional_mineshaft" - } + "ritual_id": "occultism:ritual/craft_dimensional_mineshaft" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.craft_dimensional_mineshaft.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/craft_familiar_ring.json b/src/generated/resources/data/occultism/advancements/occultism/craft_familiar_ring.json index b60050ded..ea9cd3916 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/craft_familiar_ring.json +++ b/src/generated/resources/data/occultism/advancements/occultism/craft_familiar_ring.json @@ -3,9 +3,7 @@ "criteria": { "craft_familiar_ring": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/craft_familiar_ring" - } + "ritual_id": "occultism:ritual/craft_familiar_ring" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.craft_familiar_ring.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/craft_infused_lenses.json b/src/generated/resources/data/occultism/advancements/occultism/craft_infused_lenses.json index 0201d6626..ad3606475 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/craft_infused_lenses.json +++ b/src/generated/resources/data/occultism/advancements/occultism/craft_infused_lenses.json @@ -3,9 +3,7 @@ "criteria": { "craft_infused_lenses": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/craft_infused_lenses" - } + "ritual_id": "occultism:ritual/craft_infused_lenses" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.craft_infused_lenses.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/craft_infused_pickaxe.json b/src/generated/resources/data/occultism/advancements/occultism/craft_infused_pickaxe.json index 9f723b1d6..e52aa58e6 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/craft_infused_pickaxe.json +++ b/src/generated/resources/data/occultism/advancements/occultism/craft_infused_pickaxe.json @@ -3,9 +3,7 @@ "criteria": { "craft_infused_pickaxe": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/craft_infused_pickaxe" - } + "ritual_id": "occultism:ritual/craft_infused_pickaxe" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.craft_infused_pickaxe.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/craft_miner_afrit_deeps.json b/src/generated/resources/data/occultism/advancements/occultism/craft_miner_afrit_deeps.json index afe4c5142..74a24bafc 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/craft_miner_afrit_deeps.json +++ b/src/generated/resources/data/occultism/advancements/occultism/craft_miner_afrit_deeps.json @@ -3,9 +3,7 @@ "criteria": { "craft_miner_afrit_deeps": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/craft_miner_afrit_deeps" - } + "ritual_id": "occultism:ritual/craft_miner_afrit_deeps" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.craft_miner_afrit_deeps.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/craft_miner_djinni_ores.json b/src/generated/resources/data/occultism/advancements/occultism/craft_miner_djinni_ores.json index a3d0b39a9..196f71cb2 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/craft_miner_djinni_ores.json +++ b/src/generated/resources/data/occultism/advancements/occultism/craft_miner_djinni_ores.json @@ -3,9 +3,7 @@ "criteria": { "craft_miner_djinni_ores": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/craft_miner_djinni_ores" - } + "ritual_id": "occultism:ritual/craft_miner_djinni_ores" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.craft_miner_djinni_ores.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/craft_miner_foliot_unspecialized.json b/src/generated/resources/data/occultism/advancements/occultism/craft_miner_foliot_unspecialized.json index 2337946a4..b4f0a1519 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/craft_miner_foliot_unspecialized.json +++ b/src/generated/resources/data/occultism/advancements/occultism/craft_miner_foliot_unspecialized.json @@ -3,9 +3,7 @@ "criteria": { "craft_miner_foliot_unspecialized": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/craft_miner_foliot_unspecialized" - } + "ritual_id": "occultism:ritual/craft_miner_foliot_unspecialized" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.craft_miner_foliot_unspecialized.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/craft_miner_marid_master.json b/src/generated/resources/data/occultism/advancements/occultism/craft_miner_marid_master.json index fbaee0adf..648ebf50b 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/craft_miner_marid_master.json +++ b/src/generated/resources/data/occultism/advancements/occultism/craft_miner_marid_master.json @@ -3,9 +3,7 @@ "criteria": { "craft_miner_marid_master": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/craft_miner_marid_master" - } + "ritual_id": "occultism:ritual/craft_miner_marid_master" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.craft_miner_marid_master.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/craft_satchel.json b/src/generated/resources/data/occultism/advancements/occultism/craft_satchel.json index 1f2715a22..5d9581803 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/craft_satchel.json +++ b/src/generated/resources/data/occultism/advancements/occultism/craft_satchel.json @@ -3,9 +3,7 @@ "criteria": { "craft_satchel": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/craft_satchel" - } + "ritual_id": "occultism:ritual/craft_satchel" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.craft_satchel.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/craft_soul_gem.json b/src/generated/resources/data/occultism/advancements/occultism/craft_soul_gem.json index 80876a9e8..4a2704c8e 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/craft_soul_gem.json +++ b/src/generated/resources/data/occultism/advancements/occultism/craft_soul_gem.json @@ -3,9 +3,7 @@ "criteria": { "craft_soul_gem": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/craft_soul_gem" - } + "ritual_id": "occultism:ritual/craft_soul_gem" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.craft_soul_gem.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/craft_stabilizer_tier1.json b/src/generated/resources/data/occultism/advancements/occultism/craft_stabilizer_tier1.json index a89de6c2c..68fb25735 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/craft_stabilizer_tier1.json +++ b/src/generated/resources/data/occultism/advancements/occultism/craft_stabilizer_tier1.json @@ -3,9 +3,7 @@ "criteria": { "craft_stabilizer_tier1": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/craft_stabilizer_tier1" - } + "ritual_id": "occultism:ritual/craft_stabilizer_tier1" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.craft_stabilizer_tier1.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/craft_stabilizer_tier2.json b/src/generated/resources/data/occultism/advancements/occultism/craft_stabilizer_tier2.json index 593a2a996..e7699b93f 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/craft_stabilizer_tier2.json +++ b/src/generated/resources/data/occultism/advancements/occultism/craft_stabilizer_tier2.json @@ -3,9 +3,7 @@ "criteria": { "craft_stabilizer_tier2": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/craft_stabilizer_tier2" - } + "ritual_id": "occultism:ritual/craft_stabilizer_tier2" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.craft_stabilizer_tier2.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/craft_stabilizer_tier3.json b/src/generated/resources/data/occultism/advancements/occultism/craft_stabilizer_tier3.json index 62a781e00..e4056c4fc 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/craft_stabilizer_tier3.json +++ b/src/generated/resources/data/occultism/advancements/occultism/craft_stabilizer_tier3.json @@ -3,9 +3,7 @@ "criteria": { "craft_stabilizer_tier3": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/craft_stabilizer_tier3" - } + "ritual_id": "occultism:ritual/craft_stabilizer_tier3" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.craft_stabilizer_tier3.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/craft_stabilizer_tier4.json b/src/generated/resources/data/occultism/advancements/occultism/craft_stabilizer_tier4.json index d4622b1cf..3dc63c5bf 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/craft_stabilizer_tier4.json +++ b/src/generated/resources/data/occultism/advancements/occultism/craft_stabilizer_tier4.json @@ -3,9 +3,7 @@ "criteria": { "craft_stabilizer_tier4": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/craft_stabilizer_tier4" - } + "ritual_id": "occultism:ritual/craft_stabilizer_tier4" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.craft_stabilizer_tier4.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/craft_stable_wormhole.json b/src/generated/resources/data/occultism/advancements/occultism/craft_stable_wormhole.json index e7b17a255..2534f5ac9 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/craft_stable_wormhole.json +++ b/src/generated/resources/data/occultism/advancements/occultism/craft_stable_wormhole.json @@ -3,9 +3,7 @@ "criteria": { "craft_stable_wormhole": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/craft_stable_wormhole" - } + "ritual_id": "occultism:ritual/craft_stable_wormhole" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.craft_stable_wormhole.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/craft_storage_controller_base.json b/src/generated/resources/data/occultism/advancements/occultism/craft_storage_controller_base.json index 3ed4ff75d..50a04d42c 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/craft_storage_controller_base.json +++ b/src/generated/resources/data/occultism/advancements/occultism/craft_storage_controller_base.json @@ -3,9 +3,7 @@ "criteria": { "craft_storage_controller_base": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/craft_storage_controller_base" - } + "ritual_id": "occultism:ritual/craft_storage_controller_base" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.craft_storage_controller_base.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/craft_storage_remote.json b/src/generated/resources/data/occultism/advancements/occultism/craft_storage_remote.json index 1cfeccfb1..fecdbc1c5 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/craft_storage_remote.json +++ b/src/generated/resources/data/occultism/advancements/occultism/craft_storage_remote.json @@ -3,9 +3,7 @@ "criteria": { "craft_storage_remote": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/craft_storage_remote" - } + "ritual_id": "occultism:ritual/craft_storage_remote" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.craft_storage_remote.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar/bat.json b/src/generated/resources/data/occultism/advancements/occultism/familiar/bat.json index 06d462ee9..1f8da246d 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar/bat.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar/bat.json @@ -3,23 +3,19 @@ "criteria": { "bat_eat": { "conditions": { - "type": "BAT_EAT" + "type": "bat_eat" }, "trigger": "occultism:familiar" } }, "display": { - "announce_to_chat": true, "description": { "translate": "advancements.occultism.familiar.bat.description" }, - "frame": "task", - "hidden": false, "icon": { "item": "occultism:advancement_icon", "nbt": "{CustomModelData:1}" }, - "show_toast": true, "title": { "translate": "advancements.occultism.familiar.bat.title" } diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar/beaver_woodchop.json b/src/generated/resources/data/occultism/advancements/occultism/familiar/beaver_woodchop.json index a387f2af7..4ef4ae6f0 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar/beaver_woodchop.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar/beaver_woodchop.json @@ -3,23 +3,19 @@ "criteria": { "beaver_woodchop": { "conditions": { - "type": "BEAVER_WOODCHOP" + "type": "beaver_woodchop" }, "trigger": "occultism:familiar" } }, "display": { - "announce_to_chat": true, "description": { "translate": "advancements.occultism.familiar.beaver_woodchop.description" }, - "frame": "task", - "hidden": false, "icon": { "item": "occultism:advancement_icon", "nbt": "{CustomModelData:16}" }, - "show_toast": true, "title": { "translate": "advancements.occultism.familiar.beaver_woodchop.title" } diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar/beholder_eat.json b/src/generated/resources/data/occultism/advancements/occultism/familiar/beholder_eat.json index 74f3762ae..051f0fbdc 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar/beholder_eat.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar/beholder_eat.json @@ -3,22 +3,18 @@ "criteria": { "beholder_eat": { "conditions": { - "type": "BEHOLDER_EAT" + "type": "beholder_eat" }, "trigger": "occultism:familiar" } }, "display": { - "announce_to_chat": true, "description": { "translate": "advancements.occultism.familiar.beholder_eat.description" }, - "frame": "task", - "hidden": false, "icon": { "item": "minecraft:pumpkin_pie" }, - "show_toast": true, "title": { "translate": "advancements.occultism.familiar.beholder_eat.title" } diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar/beholder_ray.json b/src/generated/resources/data/occultism/advancements/occultism/familiar/beholder_ray.json index d1084133d..fe00579e1 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar/beholder_ray.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar/beholder_ray.json @@ -3,23 +3,19 @@ "criteria": { "beholder_ray": { "conditions": { - "type": "BEHOLDER_RAY" + "type": "beholder_ray" }, "trigger": "occultism:familiar" } }, "display": { - "announce_to_chat": true, "description": { "translate": "advancements.occultism.familiar.beholder_ray.description" }, - "frame": "task", - "hidden": false, "icon": { "item": "occultism:advancement_icon", "nbt": "{CustomModelData:13}" }, - "show_toast": true, "title": { "translate": "advancements.occultism.familiar.beholder_ray.title" } diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar/blacksmith_upgrade.json b/src/generated/resources/data/occultism/advancements/occultism/familiar/blacksmith_upgrade.json index e5695edfb..61e90c9b4 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar/blacksmith_upgrade.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar/blacksmith_upgrade.json @@ -3,23 +3,19 @@ "criteria": { "blacksmith_upgrade": { "conditions": { - "type": "BLACKSMITH_UPGRADE" + "type": "blacksmith_upgrade" }, "trigger": "occultism:familiar" } }, "display": { - "announce_to_chat": true, "description": { "translate": "advancements.occultism.familiar.blacksmith_upgrade.description" }, - "frame": "task", - "hidden": false, "icon": { "item": "occultism:advancement_icon", "nbt": "{CustomModelData:7}" }, - "show_toast": true, "title": { "translate": "advancements.occultism.familiar.blacksmith_upgrade.title" } diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar/capture.json b/src/generated/resources/data/occultism/advancements/occultism/familiar/capture.json index 06203ff44..033df6194 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar/capture.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar/capture.json @@ -3,22 +3,18 @@ "criteria": { "capture": { "conditions": { - "type": "CAPTURE" + "type": "capture" }, "trigger": "occultism:familiar" } }, "display": { - "announce_to_chat": true, "description": { "translate": "advancements.occultism.familiar.capture.description" }, - "frame": "task", - "hidden": false, "icon": { "item": "occultism:familiar_ring" }, - "show_toast": true, "title": { "translate": "advancements.occultism.familiar.capture.title" } diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar/chimera_ride.json b/src/generated/resources/data/occultism/advancements/occultism/familiar/chimera_ride.json index f06c4940c..2f772a011 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar/chimera_ride.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar/chimera_ride.json @@ -3,23 +3,19 @@ "criteria": { "chimera_ride": { "conditions": { - "type": "CHIMERA_RIDE" + "type": "chimera_ride" }, "trigger": "occultism:familiar" } }, "display": { - "announce_to_chat": true, "description": { "translate": "advancements.occultism.familiar.chimera_ride.description" }, - "frame": "task", - "hidden": false, "icon": { "item": "occultism:advancement_icon", "nbt": "{CustomModelData:10}" }, - "show_toast": true, "title": { "translate": "advancements.occultism.familiar.chimera_ride.title" } diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar/cthulhu.json b/src/generated/resources/data/occultism/advancements/occultism/familiar/cthulhu.json index fc0c05a7d..98679cc9f 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar/cthulhu.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar/cthulhu.json @@ -3,23 +3,19 @@ "criteria": { "cthulhu_sad": { "conditions": { - "type": "CTHULHU_SAD" + "type": "cthulhu_sad" }, "trigger": "occultism:familiar" } }, "display": { - "announce_to_chat": true, "description": { "translate": "advancements.occultism.familiar.cthulhu.description" }, - "frame": "task", - "hidden": false, "icon": { "item": "occultism:advancement_icon", "nbt": "{CustomModelData:0}" }, - "show_toast": true, "title": { "translate": "advancements.occultism.familiar.cthulhu.title" } diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar/deer.json b/src/generated/resources/data/occultism/advancements/occultism/familiar/deer.json index bc8424689..c23e7ed16 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar/deer.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar/deer.json @@ -3,23 +3,19 @@ "criteria": { "deer_poop": { "conditions": { - "type": "DEER_POOP" + "type": "deer_poop" }, "trigger": "occultism:familiar" } }, "display": { - "announce_to_chat": true, "description": { "translate": "advancements.occultism.familiar.deer.description" }, - "frame": "task", - "hidden": false, "icon": { "item": "occultism:advancement_icon", "nbt": "{CustomModelData:2}" }, - "show_toast": true, "title": { "translate": "advancements.occultism.familiar.deer.title" } diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar/devil.json b/src/generated/resources/data/occultism/advancements/occultism/familiar/devil.json index d234b0f1b..25eb8c1ed 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar/devil.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar/devil.json @@ -3,23 +3,19 @@ "criteria": { "devil_fire": { "conditions": { - "type": "DEVIL_FIRE" + "type": "devil_fire" }, "trigger": "occultism:familiar" } }, "display": { - "announce_to_chat": true, "description": { "translate": "advancements.occultism.familiar.devil.description" }, - "frame": "task", - "hidden": false, "icon": { "item": "occultism:advancement_icon", "nbt": "{CustomModelData:3}" }, - "show_toast": true, "title": { "translate": "advancements.occultism.familiar.devil.title" } diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar/dragon_nugget.json b/src/generated/resources/data/occultism/advancements/occultism/familiar/dragon_nugget.json index 124f157e8..d82aa8654 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar/dragon_nugget.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar/dragon_nugget.json @@ -3,22 +3,18 @@ "criteria": { "dragon_nugget": { "conditions": { - "type": "DRAGON_NUGGET" + "type": "dragon_nugget" }, "trigger": "occultism:familiar" } }, "display": { - "announce_to_chat": true, "description": { "translate": "advancements.occultism.familiar.dragon_nugget.description" }, - "frame": "task", - "hidden": false, "icon": { "item": "minecraft:gold_nugget" }, - "show_toast": true, "title": { "translate": "advancements.occultism.familiar.dragon_nugget.title" } diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar/dragon_ride.json b/src/generated/resources/data/occultism/advancements/occultism/familiar/dragon_ride.json index 2265413f1..158064d73 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar/dragon_ride.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar/dragon_ride.json @@ -3,23 +3,19 @@ "criteria": { "dragon_ride": { "conditions": { - "type": "DRAGON_RIDE" + "type": "dragon_ride" }, "trigger": "occultism:familiar" } }, "display": { - "announce_to_chat": true, "description": { "translate": "advancements.occultism.familiar.dragon_ride.description" }, - "frame": "task", - "hidden": false, "icon": { "item": "occultism:advancement_icon", "nbt": "{CustomModelData:6}" }, - "show_toast": true, "title": { "translate": "advancements.occultism.familiar.dragon_ride.title" } diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar/fairy_save.json b/src/generated/resources/data/occultism/advancements/occultism/familiar/fairy_save.json index 44b747ded..d02ae4d28 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar/fairy_save.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar/fairy_save.json @@ -3,23 +3,19 @@ "criteria": { "fairy_save": { "conditions": { - "type": "FAIRY_SAVE" + "type": "fairy_save" }, "trigger": "occultism:familiar" } }, "display": { - "announce_to_chat": true, "description": { "translate": "advancements.occultism.familiar.fairy_save.description" }, - "frame": "task", - "hidden": false, "icon": { "item": "occultism:advancement_icon", "nbt": "{CustomModelData:14}" }, - "show_toast": true, "title": { "translate": "advancements.occultism.familiar.fairy_save.title" } diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar/goat_detach.json b/src/generated/resources/data/occultism/advancements/occultism/familiar/goat_detach.json index b4a01130e..639f21feb 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar/goat_detach.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar/goat_detach.json @@ -3,22 +3,18 @@ "criteria": { "goat_detach": { "conditions": { - "type": "GOAT_DETACH" + "type": "goat_detach" }, "trigger": "occultism:familiar" } }, "display": { - "announce_to_chat": true, "description": { "translate": "advancements.occultism.familiar.goat_detach.description" }, - "frame": "task", - "hidden": false, "icon": { "item": "minecraft:golden_apple" }, - "show_toast": true, "title": { "translate": "advancements.occultism.familiar.goat_detach.title" } diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar/greedy.json b/src/generated/resources/data/occultism/advancements/occultism/familiar/greedy.json index 0b3d7208a..2554dadef 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar/greedy.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar/greedy.json @@ -3,23 +3,19 @@ "criteria": { "greedy_item": { "conditions": { - "type": "GREEDY_ITEM" + "type": "greedy_item" }, "trigger": "occultism:familiar" } }, "display": { - "announce_to_chat": true, "description": { "translate": "advancements.occultism.familiar.greedy.description" }, - "frame": "task", - "hidden": false, "icon": { "item": "occultism:advancement_icon", "nbt": "{CustomModelData:4}" }, - "show_toast": true, "title": { "translate": "advancements.occultism.familiar.greedy.title" } diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar/guardian_ultimate_sacrifice.json b/src/generated/resources/data/occultism/advancements/occultism/familiar/guardian_ultimate_sacrifice.json index aca33092e..1940274d5 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar/guardian_ultimate_sacrifice.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar/guardian_ultimate_sacrifice.json @@ -3,23 +3,19 @@ "criteria": { "guardian_ultimate_sacrifice": { "conditions": { - "type": "GUARDIAN_ULTIMATE_SACRIFICE" + "type": "guardian_ultimate_sacrifice" }, "trigger": "occultism:familiar" } }, "display": { - "announce_to_chat": true, "description": { "translate": "advancements.occultism.familiar.guardian_ultimate_sacrifice.description" }, - "frame": "task", - "hidden": false, "icon": { "item": "occultism:advancement_icon", "nbt": "{CustomModelData:8}" }, - "show_toast": true, "title": { "translate": "advancements.occultism.familiar.guardian_ultimate_sacrifice.title" } diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar/headless_cthulhu_head.json b/src/generated/resources/data/occultism/advancements/occultism/familiar/headless_cthulhu_head.json index e3be4edc2..5e63aabcf 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar/headless_cthulhu_head.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar/headless_cthulhu_head.json @@ -3,23 +3,19 @@ "criteria": { "headless_cthulhu_head": { "conditions": { - "type": "HEADLESS_CTHULHU_HEAD" + "type": "headless_cthulhu_head" }, "trigger": "occultism:familiar" } }, "display": { - "announce_to_chat": true, "description": { "translate": "advancements.occultism.familiar.headless_cthulhu_head.description" }, - "frame": "task", - "hidden": false, "icon": { "item": "occultism:advancement_icon", "nbt": "{CustomModelData:9}" }, - "show_toast": true, "title": { "translate": "advancements.occultism.familiar.headless_cthulhu_head.title" } diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar/headless_rebuilt.json b/src/generated/resources/data/occultism/advancements/occultism/familiar/headless_rebuilt.json index beefea2b5..3b7dfd618 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar/headless_rebuilt.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar/headless_rebuilt.json @@ -3,22 +3,18 @@ "criteria": { "headless_rebuilt": { "conditions": { - "type": "HEADLESS_REBUILT" + "type": "headless_rebuilt" }, "trigger": "occultism:familiar" } }, "display": { - "announce_to_chat": true, "description": { "translate": "advancements.occultism.familiar.headless_rebuilt.description" }, - "frame": "task", - "hidden": false, "icon": { "item": "minecraft:hay_block" }, - "show_toast": true, "title": { "translate": "advancements.occultism.familiar.headless_rebuilt.title" } diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar/mans_best_friend.json b/src/generated/resources/data/occultism/advancements/occultism/familiar/mans_best_friend.json index 5b0f1523b..9d2a1193a 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar/mans_best_friend.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar/mans_best_friend.json @@ -3,28 +3,24 @@ "criteria": { "dragon_fetch": { "conditions": { - "type": "DRAGON_FETCH" + "type": "dragon_fetch" }, "trigger": "occultism:familiar" }, "dragon_pet": { "conditions": { - "type": "DRAGON_PET" + "type": "dragon_pet" }, "trigger": "occultism:familiar" } }, "display": { - "announce_to_chat": true, "description": { "translate": "advancements.occultism.familiar.mans_best_friend.description" }, - "frame": "task", - "hidden": false, "icon": { "item": "minecraft:stick" }, - "show_toast": true, "title": { "translate": "advancements.occultism.familiar.mans_best_friend.title" } diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar/mummy_dodge.json b/src/generated/resources/data/occultism/advancements/occultism/familiar/mummy_dodge.json index 1c7fed933..02f60392d 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar/mummy_dodge.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar/mummy_dodge.json @@ -3,23 +3,19 @@ "criteria": { "mummy_dodge": { "conditions": { - "type": "MUMMY_DODGE" + "type": "mummy_dodge" }, "trigger": "occultism:familiar" } }, "display": { - "announce_to_chat": true, "description": { "translate": "advancements.occultism.familiar.mummy_dodge.description" }, - "frame": "task", - "hidden": false, "icon": { "item": "occultism:advancement_icon", "nbt": "{CustomModelData:15}" }, - "show_toast": true, "title": { "translate": "advancements.occultism.familiar.mummy_dodge.title" } diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar/party.json b/src/generated/resources/data/occultism/advancements/occultism/familiar/party.json index aed39dce0..2b268d0bd 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar/party.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar/party.json @@ -3,22 +3,18 @@ "criteria": { "party": { "conditions": { - "type": "PARTY" + "type": "party" }, "trigger": "occultism:familiar" } }, "display": { - "announce_to_chat": true, "description": { "translate": "advancements.occultism.familiar.party.description" }, - "frame": "task", - "hidden": false, "icon": { "item": "minecraft:jukebox" }, - "show_toast": true, "title": { "translate": "advancements.occultism.familiar.party.title" } diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar/rare.json b/src/generated/resources/data/occultism/advancements/occultism/familiar/rare.json index 597804b9a..b88640d0d 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar/rare.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar/rare.json @@ -3,23 +3,19 @@ "criteria": { "rare_variant": { "conditions": { - "type": "RARE_VARIANT" + "type": "rare_variant" }, "trigger": "occultism:familiar" } }, "display": { - "announce_to_chat": true, "description": { "translate": "advancements.occultism.familiar.rare.description" }, - "frame": "task", - "hidden": false, "icon": { "item": "occultism:advancement_icon", "nbt": "{CustomModelData:5}" }, - "show_toast": true, "title": { "translate": "advancements.occultism.familiar.rare.title" } diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar/root.json b/src/generated/resources/data/occultism/advancements/occultism/familiar/root.json index a67a0648f..e243ac7e2 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar/root.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar/root.json @@ -2,25 +2,19 @@ "criteria": { "summon_familiar": { "conditions": { - "ritual_predicate": { - "ritual_factory_id": "occultism:familiar" - } + "ritual_factory_id": "occultism:familiar" }, "trigger": "occultism:ritual" } }, "display": { - "announce_to_chat": true, "background": "minecraft:textures/gui/advancements/backgrounds/stone.png", "description": { "translate": "advancements.occultism.familiars.description" }, - "frame": "task", - "hidden": false, "icon": { "item": "occultism:jei_dummy/none" }, - "show_toast": true, "title": { "translate": "advancements.occultism.familiars.title" } diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar/shub_cthulhu_friends.json b/src/generated/resources/data/occultism/advancements/occultism/familiar/shub_cthulhu_friends.json index c988768d4..d87457819 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar/shub_cthulhu_friends.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar/shub_cthulhu_friends.json @@ -3,22 +3,18 @@ "criteria": { "shub_cthulhu_friends": { "conditions": { - "type": "SHUB_CTHULHU_FRIENDS" + "type": "shub_cthulhu_friends" }, "trigger": "occultism:familiar" } }, "display": { - "announce_to_chat": true, "description": { "translate": "advancements.occultism.familiar.shub_cthulhu_friends.description" }, - "frame": "task", - "hidden": false, "icon": { "item": "minecraft:poppy" }, - "show_toast": true, "title": { "translate": "advancements.occultism.familiar.shub_cthulhu_friends.title" } diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar/shub_niggurath_spawn.json b/src/generated/resources/data/occultism/advancements/occultism/familiar/shub_niggurath_spawn.json index 8df23eaeb..622728ced 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar/shub_niggurath_spawn.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar/shub_niggurath_spawn.json @@ -3,23 +3,19 @@ "criteria": { "shub_niggurath_spawn": { "conditions": { - "type": "SHUB_NIGGURATH_SPAWN" + "type": "shub_niggurath_spawn" }, "trigger": "occultism:familiar" } }, "display": { - "announce_to_chat": true, "description": { "translate": "advancements.occultism.familiar.shub_niggurath_spawn.description" }, - "frame": "task", - "hidden": false, "icon": { "item": "occultism:advancement_icon", "nbt": "{CustomModelData:12}" }, - "show_toast": true, "title": { "translate": "advancements.occultism.familiar.shub_niggurath_spawn.title" } diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar/shub_niggurath_summon.json b/src/generated/resources/data/occultism/advancements/occultism/familiar/shub_niggurath_summon.json index 8c80d33f2..6238189c3 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar/shub_niggurath_summon.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar/shub_niggurath_summon.json @@ -3,23 +3,19 @@ "criteria": { "shub_niggurath_summon": { "conditions": { - "type": "SHUB_NIGGURATH_SUMMON" + "type": "shub_niggurath_summon" }, "trigger": "occultism:familiar" } }, "display": { - "announce_to_chat": true, "description": { "translate": "advancements.occultism.familiar.shub_niggurath_summon.description" }, - "frame": "task", - "hidden": false, "icon": { "item": "occultism:advancement_icon", "nbt": "{CustomModelData:11}" }, - "show_toast": true, "title": { "translate": "advancements.occultism.familiar.shub_niggurath_summon.title" } diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar_bat.json b/src/generated/resources/data/occultism/advancements/occultism/familiar_bat.json index 8ea888697..e67dfbd89 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar_bat.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar_bat.json @@ -3,9 +3,7 @@ "criteria": { "familiar_bat": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/familiar_bat" - } + "ritual_id": "occultism:ritual/familiar_bat" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.familiar_bat.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar_beaver.json b/src/generated/resources/data/occultism/advancements/occultism/familiar_beaver.json index e182aa198..c11add4ca 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar_beaver.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar_beaver.json @@ -3,9 +3,7 @@ "criteria": { "familiar_beaver": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/familiar_beaver" - } + "ritual_id": "occultism:ritual/familiar_beaver" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.familiar_beaver.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar_beholder.json b/src/generated/resources/data/occultism/advancements/occultism/familiar_beholder.json index 7f8ee6876..6aeb20db4 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar_beholder.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar_beholder.json @@ -3,9 +3,7 @@ "criteria": { "familiar_beholder": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/familiar_beholder" - } + "ritual_id": "occultism:ritual/familiar_beholder" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.familiar_beholder.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar_blacksmith.json b/src/generated/resources/data/occultism/advancements/occultism/familiar_blacksmith.json index 357e9858a..1f10b4f78 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar_blacksmith.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar_blacksmith.json @@ -3,9 +3,7 @@ "criteria": { "familiar_blacksmith": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/familiar_blacksmith" - } + "ritual_id": "occultism:ritual/familiar_blacksmith" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.familiar_blacksmith.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar_chimera.json b/src/generated/resources/data/occultism/advancements/occultism/familiar_chimera.json index 1237708ed..e7e53b1ed 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar_chimera.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar_chimera.json @@ -3,9 +3,7 @@ "criteria": { "familiar_chimera": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/familiar_chimera" - } + "ritual_id": "occultism:ritual/familiar_chimera" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.familiar_chimera.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar_cthulhu.json b/src/generated/resources/data/occultism/advancements/occultism/familiar_cthulhu.json index 482d42922..236b83f18 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar_cthulhu.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar_cthulhu.json @@ -3,9 +3,7 @@ "criteria": { "familiar_cthulhu": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/familiar_cthulhu" - } + "ritual_id": "occultism:ritual/familiar_cthulhu" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.familiar_cthulhu.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar_deer.json b/src/generated/resources/data/occultism/advancements/occultism/familiar_deer.json index c7cf6cb01..2150f171a 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar_deer.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar_deer.json @@ -3,9 +3,7 @@ "criteria": { "familiar_deer": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/familiar_deer" - } + "ritual_id": "occultism:ritual/familiar_deer" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.familiar_deer.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar_devil.json b/src/generated/resources/data/occultism/advancements/occultism/familiar_devil.json index a5fda6a2b..ee42a4803 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar_devil.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar_devil.json @@ -3,9 +3,7 @@ "criteria": { "familiar_devil": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/familiar_devil" - } + "ritual_id": "occultism:ritual/familiar_devil" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.familiar_devil.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar_dragon.json b/src/generated/resources/data/occultism/advancements/occultism/familiar_dragon.json index 97c271af1..7a5a1ed6d 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar_dragon.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar_dragon.json @@ -3,9 +3,7 @@ "criteria": { "familiar_dragon": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/familiar_dragon" - } + "ritual_id": "occultism:ritual/familiar_dragon" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.familiar_dragon.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar_fairy.json b/src/generated/resources/data/occultism/advancements/occultism/familiar_fairy.json index e6ed0bb01..0dda4cef6 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar_fairy.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar_fairy.json @@ -3,9 +3,7 @@ "criteria": { "familiar_fairy": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/familiar_fairy" - } + "ritual_id": "occultism:ritual/familiar_fairy" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.familiar_fairy.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar_greedy.json b/src/generated/resources/data/occultism/advancements/occultism/familiar_greedy.json index 89058b98a..8ec1bee21 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar_greedy.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar_greedy.json @@ -3,9 +3,7 @@ "criteria": { "familiar_greedy": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/familiar_greedy" - } + "ritual_id": "occultism:ritual/familiar_greedy" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.familiar_greedy.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar_guardian.json b/src/generated/resources/data/occultism/advancements/occultism/familiar_guardian.json index 37403bae3..43373d576 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar_guardian.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar_guardian.json @@ -3,9 +3,7 @@ "criteria": { "familiar_guardian": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/familiar_guardian" - } + "ritual_id": "occultism:ritual/familiar_guardian" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.familiar_guardian.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar_headless.json b/src/generated/resources/data/occultism/advancements/occultism/familiar_headless.json index 308212a3b..eb4d979df 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar_headless.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar_headless.json @@ -3,9 +3,7 @@ "criteria": { "familiar_headless": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/familiar_headless" - } + "ritual_id": "occultism:ritual/familiar_headless" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.familiar_headless.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar_mummy.json b/src/generated/resources/data/occultism/advancements/occultism/familiar_mummy.json index 7f838d21a..6dfe632b2 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar_mummy.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar_mummy.json @@ -3,9 +3,7 @@ "criteria": { "familiar_mummy": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/familiar_mummy" - } + "ritual_id": "occultism:ritual/familiar_mummy" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.familiar_mummy.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar_otherworld_bird.json b/src/generated/resources/data/occultism/advancements/occultism/familiar_otherworld_bird.json index 1e4253753..4dc40ac56 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar_otherworld_bird.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar_otherworld_bird.json @@ -3,9 +3,7 @@ "criteria": { "familiar_otherworld_bird": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/familiar_otherworld_bird" - } + "ritual_id": "occultism:ritual/familiar_otherworld_bird" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.familiar_otherworld_bird.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/familiar_parrot.json b/src/generated/resources/data/occultism/advancements/occultism/familiar_parrot.json index 82161157d..afe19184e 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/familiar_parrot.json +++ b/src/generated/resources/data/occultism/advancements/occultism/familiar_parrot.json @@ -3,9 +3,7 @@ "criteria": { "familiar_parrot": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/familiar_parrot" - } + "ritual_id": "occultism:ritual/familiar_parrot" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.familiar_parrot.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/possess_enderman.json b/src/generated/resources/data/occultism/advancements/occultism/possess_enderman.json index f8952bb1f..188eb6ca5 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/possess_enderman.json +++ b/src/generated/resources/data/occultism/advancements/occultism/possess_enderman.json @@ -3,9 +3,7 @@ "criteria": { "possess_enderman": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/possess_enderman" - } + "ritual_id": "occultism:ritual/possess_enderman" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.possess_enderman.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/possess_endermite.json b/src/generated/resources/data/occultism/advancements/occultism/possess_endermite.json index 720c437b8..f095d0ca2 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/possess_endermite.json +++ b/src/generated/resources/data/occultism/advancements/occultism/possess_endermite.json @@ -3,9 +3,7 @@ "criteria": { "possess_endermite": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/possess_endermite" - } + "ritual_id": "occultism:ritual/possess_endermite" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.possess_endermite.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/possess_ghast.json b/src/generated/resources/data/occultism/advancements/occultism/possess_ghast.json index 7309b91f9..be3310fd4 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/possess_ghast.json +++ b/src/generated/resources/data/occultism/advancements/occultism/possess_ghast.json @@ -3,9 +3,7 @@ "criteria": { "possess_ghast": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/possess_ghast" - } + "ritual_id": "occultism:ritual/possess_ghast" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.possess_ghast.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/possess_skeleton.json b/src/generated/resources/data/occultism/advancements/occultism/possess_skeleton.json index da6c1eade..082e49546 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/possess_skeleton.json +++ b/src/generated/resources/data/occultism/advancements/occultism/possess_skeleton.json @@ -3,9 +3,7 @@ "criteria": { "possess_skeleton": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/possess_skeleton" - } + "ritual_id": "occultism:ritual/possess_skeleton" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.possess_skeleton.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/root.json b/src/generated/resources/data/occultism/advancements/occultism/root.json index 81741bffc..75526db45 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/root.json +++ b/src/generated/resources/data/occultism/advancements/occultism/root.json @@ -1,7 +1,6 @@ { "criteria": { "occultism_present": { - "conditions": {}, "trigger": "minecraft:tick" } }, diff --git a/src/generated/resources/data/occultism/advancements/occultism/summon_afrit_crusher.json b/src/generated/resources/data/occultism/advancements/occultism/summon_afrit_crusher.json index cd28c16b0..a250db5c5 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/summon_afrit_crusher.json +++ b/src/generated/resources/data/occultism/advancements/occultism/summon_afrit_crusher.json @@ -3,9 +3,7 @@ "criteria": { "summon_afrit_crusher": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/summon_afrit_crusher" - } + "ritual_id": "occultism:ritual/summon_afrit_crusher" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.summon_afrit_crusher.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/summon_afrit_rain_weather.json b/src/generated/resources/data/occultism/advancements/occultism/summon_afrit_rain_weather.json index 4bed2f92a..e5f48ba98 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/summon_afrit_rain_weather.json +++ b/src/generated/resources/data/occultism/advancements/occultism/summon_afrit_rain_weather.json @@ -3,9 +3,7 @@ "criteria": { "summon_afrit_rain_weather": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/summon_afrit_rain_weather" - } + "ritual_id": "occultism:ritual/summon_afrit_rain_weather" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.summon_afrit_rain_weather.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/summon_afrit_thunder_weather.json b/src/generated/resources/data/occultism/advancements/occultism/summon_afrit_thunder_weather.json index 964d02d86..8bfab0972 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/summon_afrit_thunder_weather.json +++ b/src/generated/resources/data/occultism/advancements/occultism/summon_afrit_thunder_weather.json @@ -3,9 +3,7 @@ "criteria": { "summon_afrit_thunder_weather": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/summon_afrit_thunder_weather" - } + "ritual_id": "occultism:ritual/summon_afrit_thunder_weather" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.summon_afrit_thunder_weather.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/summon_djinni_clear_weather.json b/src/generated/resources/data/occultism/advancements/occultism/summon_djinni_clear_weather.json index 349e30210..47e8a374f 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/summon_djinni_clear_weather.json +++ b/src/generated/resources/data/occultism/advancements/occultism/summon_djinni_clear_weather.json @@ -3,9 +3,7 @@ "criteria": { "summon_djinni_clear_weather": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/summon_djinni_clear_weather" - } + "ritual_id": "occultism:ritual/summon_djinni_clear_weather" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.summon_djinni_clear_weather.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/summon_djinni_crusher.json b/src/generated/resources/data/occultism/advancements/occultism/summon_djinni_crusher.json index 145107266..c8e507239 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/summon_djinni_crusher.json +++ b/src/generated/resources/data/occultism/advancements/occultism/summon_djinni_crusher.json @@ -3,9 +3,7 @@ "criteria": { "summon_djinni_crusher": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/summon_djinni_crusher" - } + "ritual_id": "occultism:ritual/summon_djinni_crusher" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.summon_djinni_crusher.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/summon_djinni_day_time.json b/src/generated/resources/data/occultism/advancements/occultism/summon_djinni_day_time.json index 77430be62..34f1f4ab3 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/summon_djinni_day_time.json +++ b/src/generated/resources/data/occultism/advancements/occultism/summon_djinni_day_time.json @@ -3,9 +3,7 @@ "criteria": { "summon_djinni_day_time": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/summon_djinni_day_time" - } + "ritual_id": "occultism:ritual/summon_djinni_day_time" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.summon_djinni_day_time.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/summon_djinni_manage_machine.json b/src/generated/resources/data/occultism/advancements/occultism/summon_djinni_manage_machine.json index ecebbb14a..317af65ec 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/summon_djinni_manage_machine.json +++ b/src/generated/resources/data/occultism/advancements/occultism/summon_djinni_manage_machine.json @@ -3,9 +3,7 @@ "criteria": { "summon_djinni_manage_machine": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/summon_djinni_manage_machine" - } + "ritual_id": "occultism:ritual/summon_djinni_manage_machine" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.summon_djinni_manage_machine.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/summon_djinni_night_time.json b/src/generated/resources/data/occultism/advancements/occultism/summon_djinni_night_time.json index eec69c0e5..13955ed7d 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/summon_djinni_night_time.json +++ b/src/generated/resources/data/occultism/advancements/occultism/summon_djinni_night_time.json @@ -3,9 +3,7 @@ "criteria": { "summon_djinni_night_time": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/summon_djinni_night_time" - } + "ritual_id": "occultism:ritual/summon_djinni_night_time" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.summon_djinni_night_time.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/summon_foliot_cleaner.json b/src/generated/resources/data/occultism/advancements/occultism/summon_foliot_cleaner.json index fece21c39..e16fdfc8c 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/summon_foliot_cleaner.json +++ b/src/generated/resources/data/occultism/advancements/occultism/summon_foliot_cleaner.json @@ -3,9 +3,7 @@ "criteria": { "summon_foliot_cleaner": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/summon_foliot_cleaner" - } + "ritual_id": "occultism:ritual/summon_foliot_cleaner" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.summon_foliot_cleaner.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/summon_foliot_crusher.json b/src/generated/resources/data/occultism/advancements/occultism/summon_foliot_crusher.json index 59e5f9744..0b8546f60 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/summon_foliot_crusher.json +++ b/src/generated/resources/data/occultism/advancements/occultism/summon_foliot_crusher.json @@ -3,9 +3,7 @@ "criteria": { "summon_foliot_crusher": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/summon_foliot_crusher" - } + "ritual_id": "occultism:ritual/summon_foliot_crusher" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.summon_foliot_crusher.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/summon_foliot_lumberjack.json b/src/generated/resources/data/occultism/advancements/occultism/summon_foliot_lumberjack.json index ef71d54b7..9bc34abcf 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/summon_foliot_lumberjack.json +++ b/src/generated/resources/data/occultism/advancements/occultism/summon_foliot_lumberjack.json @@ -3,9 +3,7 @@ "criteria": { "summon_foliot_lumberjack": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/summon_foliot_lumberjack" - } + "ritual_id": "occultism:ritual/summon_foliot_lumberjack" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.summon_foliot_lumberjack.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/summon_foliot_otherstone_trader.json b/src/generated/resources/data/occultism/advancements/occultism/summon_foliot_otherstone_trader.json index 493b210b6..781a13cd0 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/summon_foliot_otherstone_trader.json +++ b/src/generated/resources/data/occultism/advancements/occultism/summon_foliot_otherstone_trader.json @@ -3,9 +3,7 @@ "criteria": { "summon_foliot_otherstone_trader": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/summon_foliot_otherstone_trader" - } + "ritual_id": "occultism:ritual/summon_foliot_otherstone_trader" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.summon_foliot_otherstone_trader.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/summon_foliot_sapling_trader.json b/src/generated/resources/data/occultism/advancements/occultism/summon_foliot_sapling_trader.json index d86bc6889..63bcd1ef5 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/summon_foliot_sapling_trader.json +++ b/src/generated/resources/data/occultism/advancements/occultism/summon_foliot_sapling_trader.json @@ -3,9 +3,7 @@ "criteria": { "summon_foliot_sapling_trader": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/summon_foliot_sapling_trader" - } + "ritual_id": "occultism:ritual/summon_foliot_sapling_trader" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.summon_foliot_sapling_trader.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/summon_foliot_transport_items.json b/src/generated/resources/data/occultism/advancements/occultism/summon_foliot_transport_items.json index ca87a02c3..8d3b3b911 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/summon_foliot_transport_items.json +++ b/src/generated/resources/data/occultism/advancements/occultism/summon_foliot_transport_items.json @@ -3,9 +3,7 @@ "criteria": { "summon_foliot_transport_items": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/summon_foliot_transport_items" - } + "ritual_id": "occultism:ritual/summon_foliot_transport_items" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.summon_foliot_transport_items.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/summon_marid_crusher.json b/src/generated/resources/data/occultism/advancements/occultism/summon_marid_crusher.json index 33d2f9eef..5e71f44f9 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/summon_marid_crusher.json +++ b/src/generated/resources/data/occultism/advancements/occultism/summon_marid_crusher.json @@ -3,9 +3,7 @@ "criteria": { "summon_marid_crusher": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/summon_marid_crusher" - } + "ritual_id": "occultism:ritual/summon_marid_crusher" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.summon_marid_crusher.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/summon_wild_afrit.json b/src/generated/resources/data/occultism/advancements/occultism/summon_wild_afrit.json index 2b673b7d9..235909f82 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/summon_wild_afrit.json +++ b/src/generated/resources/data/occultism/advancements/occultism/summon_wild_afrit.json @@ -3,9 +3,7 @@ "criteria": { "summon_wild_afrit": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/summon_wild_afrit" - } + "ritual_id": "occultism:ritual/summon_wild_afrit" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.summon_wild_afrit.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/advancements/occultism/summon_wild_hunt.json b/src/generated/resources/data/occultism/advancements/occultism/summon_wild_hunt.json index fa05d49d9..87ea19c0a 100644 --- a/src/generated/resources/data/occultism/advancements/occultism/summon_wild_hunt.json +++ b/src/generated/resources/data/occultism/advancements/occultism/summon_wild_hunt.json @@ -3,9 +3,7 @@ "criteria": { "summon_wild_hunt": { "conditions": { - "ritual_predicate": { - "ritual_id": "occultism:ritual/summon_wild_hunt" - } + "ritual_id": "occultism:ritual/summon_wild_hunt" }, "trigger": "occultism:ritual" } @@ -15,7 +13,6 @@ "description": { "translate": "advancements.occultism.summon_wild_hunt.description" }, - "frame": "task", "hidden": true, "icon": { "item": "occultism:jei_dummy/none" diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/book.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/book.json index 06a4ac61d..b4733bc58 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/book.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/book.json @@ -21,6 +21,7 @@ "creative_tab": "modonomicon:modonomicon", "custom_book_item": "occultism:dictionary_of_spirits", "default_title_color": 0, + "font": "modonomicon:default", "frame_texture": "modonomicon:textures/gui/book_frame.png", "generate_book_item": false, "left_frame_overlay": { diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_afrit_miner.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_afrit_miner.json index 86ae4b44d..77a9e840d 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_afrit_miner.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_afrit_miner.json @@ -38,6 +38,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 0, "y": -5 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_dimensional_matrix.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_dimensional_matrix.json index 63edb0931..a9a0cf753 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_dimensional_matrix.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_dimensional_matrix.json @@ -38,6 +38,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -2, "y": 1 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_dimensional_mineshaft.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_dimensional_mineshaft.json index a4365d89d..78c093d58 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_dimensional_mineshaft.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_dimensional_mineshaft.json @@ -46,6 +46,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -6, "y": -5 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_djinni_miner.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_djinni_miner.json index bb4c6e781..c7ab847c5 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_djinni_miner.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_djinni_miner.json @@ -38,6 +38,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -2, "y": -5 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_familiar_ring.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_familiar_ring.json index 8f1d97133..b090cea22 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_familiar_ring.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_familiar_ring.json @@ -46,6 +46,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -2, "y": -3 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_foliot_miner.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_foliot_miner.json index 97d3a91e3..210fa646d 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_foliot_miner.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_foliot_miner.json @@ -62,6 +62,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -4, "y": -5 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_infused_pickaxe.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_infused_pickaxe.json index 668b145b2..e94030c59 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_infused_pickaxe.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_infused_pickaxe.json @@ -38,6 +38,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -6, "y": -3 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_marid_miner.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_marid_miner.json index 0c7cac19e..b10bb8a9b 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_marid_miner.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_marid_miner.json @@ -38,6 +38,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 2, "y": -5 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_otherworld_goggles.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_otherworld_goggles.json index 011045cfd..23f4d800e 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_otherworld_goggles.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_otherworld_goggles.json @@ -79,6 +79,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -6, "y": 1 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_satchel.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_satchel.json index 245409592..a06b73981 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_satchel.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_satchel.json @@ -38,6 +38,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 1, "y": 1 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_soul_gem.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_soul_gem.json index 945b4fa4e..52ed0bb1d 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_soul_gem.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_soul_gem.json @@ -46,6 +46,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -4, "y": -3 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_stabilizer_tier1.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_stabilizer_tier1.json index 7f8e93220..d69da6c13 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_stabilizer_tier1.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_stabilizer_tier1.json @@ -38,6 +38,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -2, "y": 5 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_stabilizer_tier2.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_stabilizer_tier2.json index 5571c87ce..7d029b559 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_stabilizer_tier2.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_stabilizer_tier2.json @@ -38,6 +38,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 0, "y": 5 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_stabilizer_tier3.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_stabilizer_tier3.json index 730c1a115..81314ba69 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_stabilizer_tier3.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_stabilizer_tier3.json @@ -38,6 +38,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 2, "y": 5 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_stabilizer_tier4.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_stabilizer_tier4.json index a0733faef..4a4c1edb5 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_stabilizer_tier4.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_stabilizer_tier4.json @@ -38,6 +38,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 4, "y": 5 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_stable_wormhole.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_stable_wormhole.json index 8c7fda01f..9666660b7 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_stable_wormhole.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_stable_wormhole.json @@ -38,6 +38,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 0, "y": 3 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_storage_controller_base.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_storage_controller_base.json index ce936866a..d0596969b 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_storage_controller_base.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_storage_controller_base.json @@ -38,6 +38,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -2, "y": 3 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_storage_remote.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_storage_remote.json index c7d3980b5..4c4593889 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_storage_remote.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_storage_remote.json @@ -38,6 +38,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 2, "y": 3 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_storage_system.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_storage_system.json index d9ff4e4e9..8db778ec0 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_storage_system.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/craft_storage_system.json @@ -30,6 +30,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -4, "y": 1 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/overview.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/overview.json index 31c56a2b1..5ae47aab6 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/overview.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/overview.json @@ -23,6 +23,7 @@ "use_markdown_in_title": false } ], + "show_when_any_parent_unlocked": false, "x": -8, "y": -1 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/return_to_rituals.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/return_to_rituals.json index d2a0438f8..eb46d5c14 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/return_to_rituals.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/crafting_rituals/return_to_rituals.json @@ -22,6 +22,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -10, "y": -1 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_bat.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_bat.json index 15022f471..c98995ebe 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_bat.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_bat.json @@ -50,6 +50,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -6, "y": 2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_beaver.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_beaver.json index 9a9de7f6d..f62e69a9c 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_beaver.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_beaver.json @@ -50,6 +50,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -5, "y": 4 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_beholder.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_beholder.json index 5f083a042..e3b304afa 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_beholder.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_beholder.json @@ -50,6 +50,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -4, "y": 2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_blacksmith.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_blacksmith.json index 440d456a6..98fb77ec2 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_blacksmith.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_blacksmith.json @@ -58,6 +58,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -3, "y": 4 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_chimera.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_chimera.json index 28f9c026e..a93e57591 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_chimera.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_chimera.json @@ -58,6 +58,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -2, "y": 2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_cthulhu.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_cthulhu.json index b49f29920..db180ded5 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_cthulhu.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_cthulhu.json @@ -50,6 +50,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -1, "y": 4 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_deer.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_deer.json index fe87954ba..26482c6d7 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_deer.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_deer.json @@ -50,6 +50,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 0, "y": 2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_devil.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_devil.json index 5581cf295..34d4e4376 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_devil.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_devil.json @@ -50,6 +50,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 1, "y": 4 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_dragon.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_dragon.json index c63aa3193..dfece0ea9 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_dragon.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_dragon.json @@ -50,6 +50,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -6, "y": -2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_fairy.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_fairy.json index 87d4b4124..0984530e5 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_fairy.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_fairy.json @@ -50,6 +50,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -5, "y": -4 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_greedy.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_greedy.json index a477ea56f..d6175604a 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_greedy.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_greedy.json @@ -50,6 +50,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -4, "y": -2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_guardian.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_guardian.json index 698153fe3..f2e6d1cc8 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_guardian.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_guardian.json @@ -58,6 +58,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -3, "y": -4 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_headless.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_headless.json index 0ee7cec4d..05a8adff5 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_headless.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_headless.json @@ -50,6 +50,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -2, "y": -2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_mummy.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_mummy.json index 57aa6192d..e9a356d45 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_mummy.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_mummy.json @@ -50,6 +50,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -1, "y": -4 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_otherworld_bird.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_otherworld_bird.json index c4c343cf2..63fe73a02 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_otherworld_bird.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_otherworld_bird.json @@ -58,6 +58,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 0, "y": -2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_parrot.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_parrot.json index 60fded86a..a85587328 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_parrot.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_parrot.json @@ -58,6 +58,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 1, "y": -4 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_shub_niggurath.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_shub_niggurath.json index 8537d1fb6..d65704ab4 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_shub_niggurath.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/familiar_shub_niggurath.json @@ -50,6 +50,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 2, "y": 0 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/overview.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/overview.json index ca64b3613..d145c8bd5 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/overview.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/overview.json @@ -39,6 +39,7 @@ "use_markdown_in_title": false } ], + "show_when_any_parent_unlocked": false, "x": -8, "y": 0 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/return_to_rituals.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/return_to_rituals.json index d2d6e1141..bc2ed0b16 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/return_to_rituals.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/familiar_rituals/return_to_rituals.json @@ -22,6 +22,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -10, "y": 0 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/books_of_binding.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/books_of_binding.json index dd0e693f6..a80b68822 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/books_of_binding.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/books_of_binding.json @@ -117,6 +117,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -3, "y": 2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/books_of_calling.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/books_of_calling.json index e220806d2..ef715bbcf 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/books_of_calling.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/books_of_calling.json @@ -58,6 +58,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -1, "y": 4 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/brush.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/brush.json index 8fb490549..1bc0b8826 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/brush.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/brush.json @@ -34,6 +34,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -3, "y": -4 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/candle.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/candle.json index 7a3930140..ef9f2ed08 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/candle.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/candle.json @@ -52,6 +52,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -5, "y": 0 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/chalks.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/chalks.json index 4da2e5304..954811d76 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/chalks.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/chalks.json @@ -83,6 +83,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 5, "y": 0 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/crafting_rituals.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/crafting_rituals.json index 6283b7076..b7b269835 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/crafting_rituals.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/crafting_rituals.json @@ -36,6 +36,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 15, "y": 4 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/demons_dream.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/demons_dream.json index f71ef2fdb..bae55dbaa 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/demons_dream.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/demons_dream.json @@ -69,6 +69,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -11, "y": 0 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/divination_rod.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/divination_rod.json index a857b05ce..31dc4405d 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/divination_rod.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/divination_rod.json @@ -151,6 +151,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -7, "y": -2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/familiar_rituals.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/familiar_rituals.json index 46611462d..df1783426 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/familiar_rituals.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/familiar_rituals.json @@ -36,6 +36,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 11, "y": 4 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/first_ritual.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/first_ritual.json index f66df1238..a9b18cafa 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/first_ritual.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/first_ritual.json @@ -90,6 +90,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 1, "y": 0 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/grey_particles.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/grey_particles.json index 521a2abbf..fc1388b9f 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/grey_particles.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/grey_particles.json @@ -26,6 +26,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 3, "y": 4 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/healing_spirits.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/healing_spirits.json index 3a631d69c..a8b0b24bc 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/healing_spirits.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/healing_spirits.json @@ -27,6 +27,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -9, "y": 2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/iesnium.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/iesnium.json index 47a74e206..64994850d 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/iesnium.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/iesnium.json @@ -59,6 +59,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 9, "y": -2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/iesnium_pickaxe.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/iesnium_pickaxe.json index c1b3177dc..4b7c44ea0 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/iesnium_pickaxe.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/iesnium_pickaxe.json @@ -35,6 +35,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 9, "y": -4 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/infused_pickaxe.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/infused_pickaxe.json index bab6137de..5c8e15afd 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/infused_pickaxe.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/infused_pickaxe.json @@ -51,6 +51,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 7, "y": -2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/intro.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/intro.json index e0f64b501..5233be7d0 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/intro.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/intro.json @@ -26,6 +26,7 @@ "use_markdown_in_title": false } ], + "show_when_any_parent_unlocked": false, "x": -11, "y": -2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/magic_lamps.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/magic_lamps.json index 6d738d886..b400c04f6 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/magic_lamps.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/magic_lamps.json @@ -35,6 +35,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 11, "y": -2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/mineshaft.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/mineshaft.json index 6e730d0d2..10f9906c8 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/mineshaft.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/mineshaft.json @@ -35,6 +35,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 13, "y": -4 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/more_rituals.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/more_rituals.json index 13d24d64a..7b47f937f 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/more_rituals.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/more_rituals.json @@ -19,6 +19,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 5, "y": 2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/otherworld_goggles.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/otherworld_goggles.json index 93c7a9369..180056f78 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/otherworld_goggles.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/otherworld_goggles.json @@ -35,6 +35,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 5, "y": -2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/possession_rituals.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/possession_rituals.json index d994b2a29..094936034 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/possession_rituals.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/possession_rituals.json @@ -36,6 +36,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 9, "y": 4 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/ritual_prep_bowl.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/ritual_prep_bowl.json index bef6fb990..483bb9c8a 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/ritual_prep_bowl.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/ritual_prep_bowl.json @@ -52,6 +52,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -1, "y": -2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/ritual_prep_chalk.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/ritual_prep_chalk.json index 0585d24a3..88c42b90b 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/ritual_prep_chalk.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/ritual_prep_chalk.json @@ -75,6 +75,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -3, "y": -2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/spirit_fire.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/spirit_fire.json index 6e54bd981..99c5c4ad8 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/spirit_fire.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/spirit_fire.json @@ -77,6 +77,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -7, "y": 0 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/spirit_miners.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/spirit_miners.json index 3b4c41a8b..9f3eedaa4 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/spirit_miners.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/spirit_miners.json @@ -35,6 +35,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 13, "y": -2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/spirits.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/spirits.json index 1c64909fb..c28788283 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/spirits.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/spirits.json @@ -19,6 +19,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 5, "y": 4 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/storage.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/storage.json index f4de4e3b8..3e26ed8a5 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/storage.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/storage.json @@ -17,6 +17,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 7, "y": 0 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/summoning_rituals.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/summoning_rituals.json index 04d96b059..4dd9b4c52 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/summoning_rituals.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/summoning_rituals.json @@ -36,6 +36,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 13, "y": 4 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/theurgy_divination_rod.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/theurgy_divination_rod.json index 682efadcc..5e71537e9 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/theurgy_divination_rod.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/theurgy_divination_rod.json @@ -64,6 +64,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -7, "y": -4 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/third_eye.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/third_eye.json index aed034d29..5aa0d5c1e 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/third_eye.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/getting_started/third_eye.json @@ -45,6 +45,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -11, "y": 2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/chalk_uses.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/chalk_uses.json index 2564ec5a0..639ad05c1 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/chalk_uses.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/chalk_uses.json @@ -113,6 +113,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -8, "y": 2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/craft_afrit.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/craft_afrit.json index 78fcd860f..0d248a92d 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/craft_afrit.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/craft_afrit.json @@ -45,6 +45,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -2, "y": 2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/craft_djinni.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/craft_djinni.json index 96deed086..f5a12cfc3 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/craft_djinni.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/craft_djinni.json @@ -45,6 +45,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -4, "y": 2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/craft_foliot.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/craft_foliot.json index 5252bc76b..14ae4ac99 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/craft_foliot.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/craft_foliot.json @@ -45,6 +45,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -6, "y": 2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/craft_marid.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/craft_marid.json index 1f4ebb2bd..3fc2c8a51 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/craft_marid.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/craft_marid.json @@ -45,6 +45,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 0, "y": 2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/paraphernalia.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/paraphernalia.json index 9933e0daf..3330b1f8e 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/paraphernalia.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/paraphernalia.json @@ -72,6 +72,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -8, "y": -2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/pentacles_overview.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/pentacles_overview.json index 52ab9c0d7..355df4001 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/pentacles_overview.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/pentacles_overview.json @@ -87,6 +87,7 @@ "use_markdown_in_title": false } ], + "show_when_any_parent_unlocked": false, "x": -8, "y": 0 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/possess_afrit.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/possess_afrit.json index e340fcdb0..7399fa603 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/possess_afrit.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/possess_afrit.json @@ -45,6 +45,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 0, "y": 0 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/possess_djinni.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/possess_djinni.json index 548a1133b..878807166 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/possess_djinni.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/possess_djinni.json @@ -53,6 +53,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -2, "y": 0 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/possess_foliot.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/possess_foliot.json index 78a9a5e13..4b66852f0 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/possess_foliot.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/possess_foliot.json @@ -45,6 +45,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -4, "y": 0 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/summon_afrit.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/summon_afrit.json index 9bd258775..54122049c 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/summon_afrit.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/summon_afrit.json @@ -45,6 +45,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 0, "y": -2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/summon_djinni.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/summon_djinni.json index d811c3bd3..fd98bd304 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/summon_djinni.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/summon_djinni.json @@ -45,6 +45,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -4, "y": -2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/summon_foliot.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/summon_foliot.json index be7a41719..d32816720 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/summon_foliot.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/summon_foliot.json @@ -45,6 +45,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -6, "y": -2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/summon_marid.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/summon_marid.json index 2f52a66d4..95710e085 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/summon_marid.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/summon_marid.json @@ -45,6 +45,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 2, "y": -2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/summon_wild_afrit.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/summon_wild_afrit.json index f9cdafec6..0cef921e4 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/summon_wild_afrit.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/summon_wild_afrit.json @@ -45,6 +45,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -2, "y": -2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/summon_wild_greater_spirit.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/summon_wild_greater_spirit.json index a0b967ebd..2806d38a2 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/summon_wild_greater_spirit.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/pentacles/summon_wild_greater_spirit.json @@ -45,6 +45,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 4, "y": -2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/overview.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/overview.json index 4652b9ccd..ed07bb4e0 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/overview.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/overview.json @@ -23,6 +23,7 @@ "use_markdown_in_title": false } ], + "show_when_any_parent_unlocked": false, "x": -8, "y": 0 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_elder_guardian.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_elder_guardian.json index 1c75ad09e..0ee50bd7c 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_elder_guardian.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_elder_guardian.json @@ -48,6 +48,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 2, "y": -1 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_enderman.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_enderman.json index 7d2f36739..2c496d4ad 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_enderman.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_enderman.json @@ -48,6 +48,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -4, "y": -1 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_endermite.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_endermite.json index f7e966855..006379470 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_endermite.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_endermite.json @@ -48,6 +48,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -6, "y": -1 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_ghast.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_ghast.json index bead7da92..09a6cce53 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_ghast.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_ghast.json @@ -48,6 +48,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -6, "y": 1 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_phantom.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_phantom.json index 49c2aea57..f34766336 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_phantom.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_phantom.json @@ -48,6 +48,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 0, "y": -1 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_shulker.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_shulker.json index 3075897fe..55fe47c96 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_shulker.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_shulker.json @@ -48,6 +48,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 2, "y": 1 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_skeleton.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_skeleton.json index 34c07f3bc..784057d1b 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_skeleton.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_skeleton.json @@ -48,6 +48,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -4, "y": 1 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_weak_shulker.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_weak_shulker.json index b07ca5b76..c5881da45 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_weak_shulker.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/possess_weak_shulker.json @@ -48,6 +48,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 0, "y": 1 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/return_to_rituals.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/return_to_rituals.json index 0b5a555b1..17832525f 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/return_to_rituals.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/return_to_rituals.json @@ -22,6 +22,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -10, "y": 0 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/summoning_rituals/afrit_essence.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/summoning_rituals/afrit_essence.json index 43032ee18..f4a921140 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/summoning_rituals/afrit_essence.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/summoning_rituals/afrit_essence.json @@ -37,6 +37,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -2, "y": -1 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/summoning_rituals/wither_skull.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/summoning_rituals/wither_skull.json index b0ef88546..e2ac5e189 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/summoning_rituals/wither_skull.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/possession_rituals/summoning_rituals/wither_skull.json @@ -37,6 +37,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -2, "y": 1 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/rituals/crafting_rituals.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/rituals/crafting_rituals.json index dcc0d12be..e883d2b8e 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/rituals/crafting_rituals.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/rituals/crafting_rituals.json @@ -22,6 +22,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 5, "y": 2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/rituals/familiar_rituals.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/rituals/familiar_rituals.json index 2f4d388da..72ac2f187 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/rituals/familiar_rituals.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/rituals/familiar_rituals.json @@ -22,6 +22,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 7, "y": 2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/rituals/item_use.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/rituals/item_use.json index 9e08765f4..988af1ee4 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/rituals/item_use.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/rituals/item_use.json @@ -29,6 +29,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 1, "y": 0 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/rituals/overview.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/rituals/overview.json index 63cb37520..782148845 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/rituals/overview.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/rituals/overview.json @@ -36,6 +36,7 @@ "use_markdown_in_title": false } ], + "show_when_any_parent_unlocked": false, "x": -1, "y": 0 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/rituals/possession_rituals.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/rituals/possession_rituals.json index f0545beba..5dabe271d 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/rituals/possession_rituals.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/rituals/possession_rituals.json @@ -22,6 +22,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 5, "y": -2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/rituals/sacrifice.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/rituals/sacrifice.json index a883eef92..4b7b00d0b 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/rituals/sacrifice.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/rituals/sacrifice.json @@ -29,6 +29,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 3, "y": 0 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/rituals/summoning_rituals.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/rituals/summoning_rituals.json index c0bc6f093..0b9e9e3bc 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/rituals/summoning_rituals.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/rituals/summoning_rituals.json @@ -22,6 +22,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 7, "y": -2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/spirits/essence_decay.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/spirits/essence_decay.json index 4fcc6b90d..019f3b88e 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/spirits/essence_decay.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/spirits/essence_decay.json @@ -42,6 +42,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -8, "y": 1 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/spirits/overview.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/spirits/overview.json index 7a9a9a087..c68a2b39a 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/spirits/overview.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/spirits/overview.json @@ -76,6 +76,7 @@ "use_markdown_in_title": false } ], + "show_when_any_parent_unlocked": false, "x": -8, "y": -1 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/spirits/return_to_getting_started.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/spirits/return_to_getting_started.json index 9e7555c54..cfd9cfd04 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/spirits/return_to_getting_started.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/spirits/return_to_getting_started.json @@ -20,6 +20,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -10, "y": -1 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/spirits/true_names.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/spirits/true_names.json index 61180083d..1cba5e91f 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/spirits/true_names.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/spirits/true_names.json @@ -42,6 +42,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -6, "y": -1 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/spirits/unbound_spirits.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/spirits/unbound_spirits.json index 2b1d61076..e6a22b8b4 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/spirits/unbound_spirits.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/spirits/unbound_spirits.json @@ -52,6 +52,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -4, "y": -1 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/spirits/wild_hunt.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/spirits/wild_hunt.json index 3ba187715..06fcaecfb 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/spirits/wild_hunt.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/spirits/wild_hunt.json @@ -36,6 +36,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -2, "y": -1 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/crafting_rituals/craft_stabilizer_tier1.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/crafting_rituals/craft_stabilizer_tier1.json index 446268652..9bfcf0e1c 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/crafting_rituals/craft_stabilizer_tier1.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/crafting_rituals/craft_stabilizer_tier1.json @@ -35,6 +35,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 0, "y": 0 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/crafting_rituals/craft_stabilizer_tier2.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/crafting_rituals/craft_stabilizer_tier2.json index e0aa287a8..04f757f7d 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/crafting_rituals/craft_stabilizer_tier2.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/crafting_rituals/craft_stabilizer_tier2.json @@ -35,6 +35,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 2, "y": 0 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/crafting_rituals/craft_stabilizer_tier3.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/crafting_rituals/craft_stabilizer_tier3.json index e0933f21d..1a11dac30 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/crafting_rituals/craft_stabilizer_tier3.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/crafting_rituals/craft_stabilizer_tier3.json @@ -35,6 +35,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 4, "y": 0 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/crafting_rituals/craft_stabilizer_tier4.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/crafting_rituals/craft_stabilizer_tier4.json index 80bdf6e71..f95b50198 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/crafting_rituals/craft_stabilizer_tier4.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/crafting_rituals/craft_stabilizer_tier4.json @@ -35,6 +35,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 6, "y": 0 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/crafting_rituals/craft_stable_wormhole.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/crafting_rituals/craft_stable_wormhole.json index 543a015d3..4bb366059 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/crafting_rituals/craft_stable_wormhole.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/crafting_rituals/craft_stable_wormhole.json @@ -35,6 +35,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -4, "y": -2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/crafting_rituals/craft_storage_remote.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/crafting_rituals/craft_storage_remote.json index bc56f54c4..e2c1ce15b 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/crafting_rituals/craft_storage_remote.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/crafting_rituals/craft_storage_remote.json @@ -35,6 +35,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -2, "y": -2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/overview.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/overview.json index 69ff152f7..961f1e90e 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/overview.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/overview.json @@ -26,6 +26,7 @@ "use_markdown_in_title": false } ], + "show_when_any_parent_unlocked": false, "x": -8, "y": 0 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/storage_controller.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/storage_controller.json index 20c15dc9c..ae5c65a70 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/storage_controller.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/storage_controller.json @@ -99,6 +99,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -6, "y": 0 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/storage_stabilizer.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/storage_stabilizer.json index 285592226..60d077a3d 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/storage_stabilizer.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/storage_stabilizer.json @@ -51,6 +51,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -2, "y": 0 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/summoning_rituals/summon_manage_machine.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/summoning_rituals/summon_manage_machine.json index f0a9cd878..b60e5877e 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/summoning_rituals/summon_manage_machine.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/storage/summoning_rituals/summon_manage_machine.json @@ -58,6 +58,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -4, "y": 2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/afrit_essence.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/afrit_essence.json index de5d31674..f0d45e1f0 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/afrit_essence.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/afrit_essence.json @@ -37,6 +37,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 4, "y": 0 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/overview.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/overview.json index d510dabbb..02006e053 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/overview.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/overview.json @@ -23,6 +23,7 @@ "use_markdown_in_title": false } ], + "show_when_any_parent_unlocked": false, "x": -6, "y": -2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/return_to_rituals.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/return_to_rituals.json index b5d9891ff..3f3701b0e 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/return_to_rituals.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/return_to_rituals.json @@ -22,6 +22,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -8, "y": -2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_cleaner.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_cleaner.json index 987a2fce2..971999278 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_cleaner.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_cleaner.json @@ -61,6 +61,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 0, "y": -6 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_crusher_t1.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_crusher_t1.json index ebdc2db0a..17ff5a39a 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_crusher_t1.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_crusher_t1.json @@ -53,6 +53,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -2, "y": 0 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_crusher_t2.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_crusher_t2.json index 1c0142780..d9bf916fe 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_crusher_t2.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_crusher_t2.json @@ -37,6 +37,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -2, "y": 2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_crusher_t3.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_crusher_t3.json index 397d661de..2c9c7e6b5 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_crusher_t3.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_crusher_t3.json @@ -37,6 +37,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -2, "y": 4 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_crusher_t4.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_crusher_t4.json index 7963af217..75f9d1ce4 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_crusher_t4.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_crusher_t4.json @@ -37,6 +37,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -2, "y": 6 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_lumberjack.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_lumberjack.json index 448ef97e4..0db26c43d 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_lumberjack.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_lumberjack.json @@ -69,6 +69,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": -2, "y": -4 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_manage_machine.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_manage_machine.json index ac040ab21..7fc3f585e 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_manage_machine.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_manage_machine.json @@ -61,6 +61,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 2, "y": -4 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_otherstone_trader.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_otherstone_trader.json index ad45421af..d7ee3f587 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_otherstone_trader.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_otherstone_trader.json @@ -45,6 +45,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 0, "y": 4 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_otherworld_sapling_trader.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_otherworld_sapling_trader.json index 08fa6408f..41424fbd3 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_otherworld_sapling_trader.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_otherworld_sapling_trader.json @@ -45,6 +45,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 0, "y": 2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_transport_items.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_transport_items.json index 47372ec02..b6ff71b8a 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_transport_items.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_transport_items.json @@ -69,6 +69,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 0, "y": -4 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_wild_otherworld_bird.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_wild_otherworld_bird.json index 7c4af8a94..29c5457ff 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_wild_otherworld_bird.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_wild_otherworld_bird.json @@ -50,6 +50,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 2, "y": 2 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_wild_parrot.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_wild_parrot.json index 9cefc546a..8538a9884 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_wild_parrot.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_wild_parrot.json @@ -58,6 +58,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 2, "y": 0 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/time_magic.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/time_magic.json index 927b071c0..08bcb0062 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/time_magic.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/time_magic.json @@ -45,6 +45,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 4, "y": -6 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/trade_spirits.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/trade_spirits.json index 1f1f7f07a..47cd433a6 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/trade_spirits.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/trade_spirits.json @@ -39,6 +39,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 0, "y": 0 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/weather_magic.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/weather_magic.json index 299c7e38d..17236aac4 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/weather_magic.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/weather_magic.json @@ -53,6 +53,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 4, "y": -4 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/wither_skull.json b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/wither_skull.json index e97177d41..0fa4d2295 100644 --- a/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/wither_skull.json +++ b/src/generated/resources/data/occultism/modonomicon/books/dictionary_of_spirits/entries/summoning_rituals/wither_skull.json @@ -37,6 +37,7 @@ "line_reversed": false } ], + "show_when_any_parent_unlocked": false, "x": 6, "y": 0 } \ No newline at end of file diff --git a/src/generated/resources/data/occultism/forge/biome_modifier/add_grove_underground.json b/src/generated/resources/data/occultism/neoforge/biome_modifier/add_grove_underground.json similarity index 78% rename from src/generated/resources/data/occultism/forge/biome_modifier/add_grove_underground.json rename to src/generated/resources/data/occultism/neoforge/biome_modifier/add_grove_underground.json index 24e95dca6..498c3e27f 100644 --- a/src/generated/resources/data/occultism/forge/biome_modifier/add_grove_underground.json +++ b/src/generated/resources/data/occultism/neoforge/biome_modifier/add_grove_underground.json @@ -1,5 +1,5 @@ { - "type": "forge:add_features", + "type": "neoforge:add_features", "biomes": "#minecraft:stronghold_biased_to", "features": "occultism:grove_underground", "step": "underground_structures" diff --git a/src/generated/resources/data/occultism/forge/biome_modifier/add_ore_iesnium.json b/src/generated/resources/data/occultism/neoforge/biome_modifier/add_ore_iesnium.json similarity index 75% rename from src/generated/resources/data/occultism/forge/biome_modifier/add_ore_iesnium.json rename to src/generated/resources/data/occultism/neoforge/biome_modifier/add_ore_iesnium.json index 76fa2d5cd..81e29d4b7 100644 --- a/src/generated/resources/data/occultism/forge/biome_modifier/add_ore_iesnium.json +++ b/src/generated/resources/data/occultism/neoforge/biome_modifier/add_ore_iesnium.json @@ -1,5 +1,5 @@ { - "type": "forge:add_features", + "type": "neoforge:add_features", "biomes": "#minecraft:is_nether", "features": "occultism:ore_iesnium", "step": "underground_ores" diff --git a/src/generated/resources/data/occultism/forge/biome_modifier/add_ore_silver.json b/src/generated/resources/data/occultism/neoforge/biome_modifier/add_ore_silver.json similarity index 75% rename from src/generated/resources/data/occultism/forge/biome_modifier/add_ore_silver.json rename to src/generated/resources/data/occultism/neoforge/biome_modifier/add_ore_silver.json index 3d9012ae8..0988dc4aa 100644 --- a/src/generated/resources/data/occultism/forge/biome_modifier/add_ore_silver.json +++ b/src/generated/resources/data/occultism/neoforge/biome_modifier/add_ore_silver.json @@ -1,5 +1,5 @@ { - "type": "forge:add_features", + "type": "neoforge:add_features", "biomes": "#minecraft:is_overworld", "features": "occultism:ore_silver", "step": "underground_ores" diff --git a/src/generated/resources/data/occultism/forge/biome_modifier/add_ore_silver_deepslate.json b/src/generated/resources/data/occultism/neoforge/biome_modifier/add_ore_silver_deepslate.json similarity index 77% rename from src/generated/resources/data/occultism/forge/biome_modifier/add_ore_silver_deepslate.json rename to src/generated/resources/data/occultism/neoforge/biome_modifier/add_ore_silver_deepslate.json index dda4f9b39..586977f31 100644 --- a/src/generated/resources/data/occultism/forge/biome_modifier/add_ore_silver_deepslate.json +++ b/src/generated/resources/data/occultism/neoforge/biome_modifier/add_ore_silver_deepslate.json @@ -1,5 +1,5 @@ { - "type": "forge:add_features", + "type": "neoforge:add_features", "biomes": "#minecraft:is_overworld", "features": "occultism:ore_silver_deepslate", "step": "underground_ores" diff --git a/src/generated/resources/data/occultism/forge/biome_modifier/add_tree_otherworld.json b/src/generated/resources/data/occultism/neoforge/biome_modifier/add_tree_otherworld.json similarity index 77% rename from src/generated/resources/data/occultism/forge/biome_modifier/add_tree_otherworld.json rename to src/generated/resources/data/occultism/neoforge/biome_modifier/add_tree_otherworld.json index 5fdc1d66a..1e5e18707 100644 --- a/src/generated/resources/data/occultism/forge/biome_modifier/add_tree_otherworld.json +++ b/src/generated/resources/data/occultism/neoforge/biome_modifier/add_tree_otherworld.json @@ -1,5 +1,5 @@ { - "type": "forge:add_features", + "type": "neoforge:add_features", "biomes": "#minecraft:stronghold_biased_to", "features": "occultism:tree_otherworld", "step": "vegetal_decoration" diff --git a/src/generated/resources/data/occultism/forge/biome_modifier/add_tree_otherworld_natural.json b/src/generated/resources/data/occultism/neoforge/biome_modifier/add_tree_otherworld_natural.json similarity index 79% rename from src/generated/resources/data/occultism/forge/biome_modifier/add_tree_otherworld_natural.json rename to src/generated/resources/data/occultism/neoforge/biome_modifier/add_tree_otherworld_natural.json index 3257e8aa2..3c30d03bf 100644 --- a/src/generated/resources/data/occultism/forge/biome_modifier/add_tree_otherworld_natural.json +++ b/src/generated/resources/data/occultism/neoforge/biome_modifier/add_tree_otherworld_natural.json @@ -1,5 +1,5 @@ { - "type": "forge:add_features", + "type": "neoforge:add_features", "biomes": "#minecraft:stronghold_biased_to", "features": "occultism:tree_otherworld_natural", "step": "vegetal_decoration" diff --git a/src/generated/resources/data/occultism/recipes/crushing/allthemodium_dust.json b/src/generated/resources/data/occultism/recipes/crushing/allthemodium_dust.json index 8087ce446..e6abac156 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/allthemodium_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/allthemodium_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/allthemodium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/allthemodium" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/allthemodium_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/allthemodium_dust_from_ingot.json index 8ad849099..718cd909f 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/allthemodium_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/allthemodium_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/allthemodium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/allthemodium" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/allthemodium_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/allthemodium_dust_from_raw.json index 491b1bd8b..ba1f9c466 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/allthemodium_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/allthemodium_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/allthemodium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/allthemodium" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/allthemodium_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/allthemodium_dust_from_raw_block.json index a3e53dc84..d81a92f7b 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/allthemodium_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/allthemodium_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_allthemodium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/allthemodium" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/aluminum_dust.json b/src/generated/resources/data/occultism/recipes/crushing/aluminum_dust.json index 9de009ce6..a92544f77 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/aluminum_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/aluminum_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/aluminum" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/aluminum" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/aluminum_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/aluminum_dust_from_ingot.json index 61d19764b..5584e28bf 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/aluminum_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/aluminum_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/aluminum" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/aluminum" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/aluminum_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/aluminum_dust_from_raw.json index 3c25fecca..b27f7c92b 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/aluminum_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/aluminum_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/aluminum" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/aluminum" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/aluminum_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/aluminum_dust_from_raw_block.json index d06460e91..8180da92c 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/aluminum_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/aluminum_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_aluminum" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/aluminum" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/amber_dust.json b/src/generated/resources/data/occultism/recipes/crushing/amber_dust.json index e920f1610..48108735c 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/amber_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/amber_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/amber" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/amber" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/amber_dust_from_gem.json b/src/generated/resources/data/occultism/recipes/crushing/amber_dust_from_gem.json index dd9637a81..5bca37789 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/amber_dust_from_gem.json +++ b/src/generated/resources/data/occultism/recipes/crushing/amber_dust_from_gem.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:gems/amber" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/amber" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/apatite_dust.json b/src/generated/resources/data/occultism/recipes/crushing/apatite_dust.json index 4d062fee6..88ac13cb2 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/apatite_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/apatite_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/apatite" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/apatite" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/apatite_dust_from_gem.json b/src/generated/resources/data/occultism/recipes/crushing/apatite_dust_from_gem.json index 1c6308e86..704cd95a3 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/apatite_dust_from_gem.json +++ b/src/generated/resources/data/occultism/recipes/crushing/apatite_dust_from_gem.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:gems/apatite" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/apatite" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/arcane_crystal_dust.json b/src/generated/resources/data/occultism/recipes/crushing/arcane_crystal_dust.json index ca9a48b7e..6cf4796fb 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/arcane_crystal_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/arcane_crystal_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/arcane_crystal" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/arcane_crystal" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/arcane_crystal_dust_from_gem.json b/src/generated/resources/data/occultism/recipes/crushing/arcane_crystal_dust_from_gem.json index 88d35816d..baad1997c 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/arcane_crystal_dust_from_gem.json +++ b/src/generated/resources/data/occultism/recipes/crushing/arcane_crystal_dust_from_gem.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:gems/arcane_crystal" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/arcane_crystal" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/azure_silver_dust.json b/src/generated/resources/data/occultism/recipes/crushing/azure_silver_dust.json index 6e5749cea..37f8e066e 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/azure_silver_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/azure_silver_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/azure_silver" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/azure_silver" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/azure_silver_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/azure_silver_dust_from_ingot.json index 4379ba903..83210e428 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/azure_silver_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/azure_silver_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/azure_silver" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/azure_silver" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/azure_silver_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/azure_silver_dust_from_raw.json index b9e244ea5..827d26ea7 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/azure_silver_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/azure_silver_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/azure_silver" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/azure_silver" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/azure_silver_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/azure_silver_dust_from_raw_block.json index b27c95a25..b3a14af46 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/azure_silver_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/azure_silver_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_azure_silver" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/azure_silver" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/brass_dust.json b/src/generated/resources/data/occultism/recipes/crushing/brass_dust.json index b9c5299f7..15b1982ef 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/brass_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/brass_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/brass" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/brass" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/brass_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/brass_dust_from_ingot.json index b8d84b621..ceb65dfb6 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/brass_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/brass_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/brass" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/brass" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/brass_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/brass_dust_from_raw.json index 51b001b39..118554ab6 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/brass_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/brass_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/brass" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/brass" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/brass_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/brass_dust_from_raw_block.json index 6617fef0a..9e9ff688d 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/brass_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/brass_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_brass" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/brass" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/bronze_dust.json b/src/generated/resources/data/occultism/recipes/crushing/bronze_dust.json index 8430fbb6a..72c1e35cf 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/bronze_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/bronze_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/bronze" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/bronze" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/bronze_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/bronze_dust_from_ingot.json index 3b7d3a471..b445a5983 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/bronze_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/bronze_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/bronze" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/bronze" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/bronze_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/bronze_dust_from_raw.json index 69941a01c..04f6abe2c 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/bronze_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/bronze_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/bronze" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/bronze" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/bronze_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/bronze_dust_from_raw_block.json index 4088a13fb..f132c9c5e 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/bronze_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/bronze_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_bronze" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/bronze" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/certus_quartz_dust.json b/src/generated/resources/data/occultism/recipes/crushing/certus_quartz_dust.json index 7b281dd3b..3bc91a492 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/certus_quartz_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/certus_quartz_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/certus_quartz" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/certus_quartz" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/certus_quartz_dust_from_gem.json b/src/generated/resources/data/occultism/recipes/crushing/certus_quartz_dust_from_gem.json index 23c7dab96..9c4785066 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/certus_quartz_dust_from_gem.json +++ b/src/generated/resources/data/occultism/recipes/crushing/certus_quartz_dust_from_gem.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:gems/certus_quartz" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/certus_quartz" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/charged_certus_quartz_dust.json b/src/generated/resources/data/occultism/recipes/crushing/charged_certus_quartz_dust.json index 60862b427..4d749f4e7 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/charged_certus_quartz_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/charged_certus_quartz_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/charged_certus_quartz" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/charged_certus_quartz" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/charged_certus_quartz_dust_from_gem.json b/src/generated/resources/data/occultism/recipes/crushing/charged_certus_quartz_dust_from_gem.json index 724df8d47..ace748ea6 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/charged_certus_quartz_dust_from_gem.json +++ b/src/generated/resources/data/occultism/recipes/crushing/charged_certus_quartz_dust_from_gem.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:gems/charged_certus_quartz" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/charged_certus_quartz" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/cinnabar_dust.json b/src/generated/resources/data/occultism/recipes/crushing/cinnabar_dust.json index 2d0271f72..08934a98c 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/cinnabar_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/cinnabar_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/cinnabar" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/cinnabar" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/cinnabar_dust_from_gem.json b/src/generated/resources/data/occultism/recipes/crushing/cinnabar_dust_from_gem.json index 5f1dd253b..8809d8683 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/cinnabar_dust_from_gem.json +++ b/src/generated/resources/data/occultism/recipes/crushing/cinnabar_dust_from_gem.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:gems/cinnabar" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/cinnabar" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/coal_dust.json b/src/generated/resources/data/occultism/recipes/crushing/coal_dust.json index 2879d9f8a..312154b55 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/coal_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/coal_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/coal" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/coal" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/coal_dust_from_gem.json b/src/generated/resources/data/occultism/recipes/crushing/coal_dust_from_gem.json index 752c86579..f2a61acd4 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/coal_dust_from_gem.json +++ b/src/generated/resources/data/occultism/recipes/crushing/coal_dust_from_gem.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:gems/coal" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/coal" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/cobalt_dust.json b/src/generated/resources/data/occultism/recipes/crushing/cobalt_dust.json index 98c08ca4c..c53fcde52 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/cobalt_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/cobalt_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/cobalt" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/cobalt" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/cobalt_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/cobalt_dust_from_ingot.json index 2a16ec534..447df65d7 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/cobalt_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/cobalt_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/cobalt" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/cobalt" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/cobalt_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/cobalt_dust_from_raw.json index 545ab5b6e..34ff95e7c 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/cobalt_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/cobalt_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/cobalt" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/cobalt" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/cobalt_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/cobalt_dust_from_raw_block.json index 88f788d63..093deb38c 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/cobalt_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/cobalt_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_cobalt" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/cobalt" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/constantan_dust.json b/src/generated/resources/data/occultism/recipes/crushing/constantan_dust.json index 4e9ed168d..952ba671d 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/constantan_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/constantan_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/constantan" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/constantan" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/constantan_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/constantan_dust_from_ingot.json index 24a6f1c99..2c6569818 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/constantan_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/constantan_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/constantan" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/constantan" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/constantan_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/constantan_dust_from_raw.json index f24d6d559..62b720aeb 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/constantan_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/constantan_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/constantan" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/constantan" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/constantan_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/constantan_dust_from_raw_block.json index 77103ed48..98a6d11f5 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/constantan_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/constantan_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_constantan" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/constantan" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/copper_dust.json b/src/generated/resources/data/occultism/recipes/crushing/copper_dust.json index b5d595980..f27e51580 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/copper_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/copper_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/copper" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/copper" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/copper_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/copper_dust_from_ingot.json index ab4a1fecf..88da8cad5 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/copper_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/copper_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/copper" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/copper" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/copper_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/copper_dust_from_raw.json index f5da2d29e..49df78394 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/copper_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/copper_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/copper" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/copper" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/copper_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/copper_dust_from_raw_block.json index cbbc04d61..c9dfa76f3 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/copper_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/copper_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_copper" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/copper" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/crimson_iron_dust.json b/src/generated/resources/data/occultism/recipes/crushing/crimson_iron_dust.json index f574c1d46..d276ff969 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/crimson_iron_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/crimson_iron_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/crimson_iron" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/crimson_iron" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/crimson_iron_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/crimson_iron_dust_from_ingot.json index 5b2045b6d..e0473fa60 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/crimson_iron_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/crimson_iron_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/crimson_iron" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/crimson_iron" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/crimson_iron_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/crimson_iron_dust_from_raw.json index 77d7bf8e8..2977a53dd 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/crimson_iron_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/crimson_iron_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/crimson_iron" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/crimson_iron" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/crimson_iron_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/crimson_iron_dust_from_raw_block.json index b72fdee6e..1d28602a6 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/crimson_iron_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/crimson_iron_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_crimson_iron" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/crimson_iron" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/diamond_dust.json b/src/generated/resources/data/occultism/recipes/crushing/diamond_dust.json index 1051b8186..fd9c6228c 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/diamond_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/diamond_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/diamond" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/diamond" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/diamond_dust_from_gem.json b/src/generated/resources/data/occultism/recipes/crushing/diamond_dust_from_gem.json index b4fff20c4..920f1efb6 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/diamond_dust_from_gem.json +++ b/src/generated/resources/data/occultism/recipes/crushing/diamond_dust_from_gem.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:gems/diamond" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/diamond" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/electrum_dust.json b/src/generated/resources/data/occultism/recipes/crushing/electrum_dust.json index cf71a5f19..ad27a4923 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/electrum_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/electrum_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/electrum" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/electrum" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/electrum_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/electrum_dust_from_ingot.json index 68ef9b228..96ba72f6a 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/electrum_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/electrum_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/electrum" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/electrum" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/electrum_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/electrum_dust_from_raw.json index 2d3603305..9fe789213 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/electrum_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/electrum_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/electrum" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/electrum" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/electrum_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/electrum_dust_from_raw_block.json index 7883ad4da..dbfd9109e 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/electrum_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/electrum_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_electrum" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/electrum" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/emerald_dust.json b/src/generated/resources/data/occultism/recipes/crushing/emerald_dust.json index 90bed830a..18f438ecf 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/emerald_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/emerald_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/emerald" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/emerald" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/emerald_dust_from_gem.json b/src/generated/resources/data/occultism/recipes/crushing/emerald_dust_from_gem.json index 694e823e4..ebd36f7e3 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/emerald_dust_from_gem.json +++ b/src/generated/resources/data/occultism/recipes/crushing/emerald_dust_from_gem.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:gems/emerald" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/emerald" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/enderium_dust.json b/src/generated/resources/data/occultism/recipes/crushing/enderium_dust.json index 552150afa..bb0e117ab 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/enderium_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/enderium_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/enderium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/enderium" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/enderium_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/enderium_dust_from_ingot.json index a67be277d..fa60e1de4 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/enderium_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/enderium_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/enderium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/enderium" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/enderium_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/enderium_dust_from_raw.json index 04e10444c..830ca9a6e 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/enderium_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/enderium_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/enderium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/enderium" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/enderium_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/enderium_dust_from_raw_block.json index 02e02772f..9022eb4c7 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/enderium_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/enderium_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_enderium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/enderium" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/fluorite_dust.json b/src/generated/resources/data/occultism/recipes/crushing/fluorite_dust.json index 5ae105c03..9bd0a81cd 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/fluorite_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/fluorite_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/fluorite" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/fluorite" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/fluorite_dust_from_gem.json b/src/generated/resources/data/occultism/recipes/crushing/fluorite_dust_from_gem.json index 0430a53b5..09cc63efb 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/fluorite_dust_from_gem.json +++ b/src/generated/resources/data/occultism/recipes/crushing/fluorite_dust_from_gem.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:gems/fluorite" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/fluorite" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/gold_dust.json b/src/generated/resources/data/occultism/recipes/crushing/gold_dust.json index b57cd3d5b..2b483fa69 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/gold_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/gold_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/gold" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/gold" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/gold_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/gold_dust_from_ingot.json index fbe24e240..c7e90ae2d 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/gold_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/gold_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/gold" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/gold" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/gold_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/gold_dust_from_raw.json index 330f4f3b8..2e93aa283 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/gold_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/gold_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/gold" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/gold" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/gold_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/gold_dust_from_raw_block.json index 905e3ddac..fc079349e 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/gold_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/gold_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_gold" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/gold" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/graphite_dust.json b/src/generated/resources/data/occultism/recipes/crushing/graphite_dust.json index fd4a7031b..f57cde8f8 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/graphite_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/graphite_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/graphite" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/graphite" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/graphite_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/graphite_dust_from_ingot.json index bd8b1580a..7cd224b8e 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/graphite_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/graphite_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/graphite" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/graphite" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/graphite_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/graphite_dust_from_raw.json index 7367fa2bd..0c54cdcac 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/graphite_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/graphite_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/graphite" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/graphite" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/graphite_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/graphite_dust_from_raw_block.json index 3a8f5e8db..2db91e636 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/graphite_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/graphite_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_graphite" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/graphite" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/iesnium_dust.json b/src/generated/resources/data/occultism/recipes/crushing/iesnium_dust.json index f2803123e..652d9eed0 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/iesnium_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/iesnium_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/iesnium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/iesnium" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/iesnium_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/iesnium_dust_from_ingot.json index 86da90fc3..9a3eb6bec 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/iesnium_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/iesnium_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/iesnium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/iesnium" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/iesnium_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/iesnium_dust_from_raw.json index c8f3928df..5c64dc500 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/iesnium_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/iesnium_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/iesnium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/iesnium" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/iesnium_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/iesnium_dust_from_raw_block.json index 47c4243e5..fe9eea7e6 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/iesnium_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/iesnium_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_iesnium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/iesnium" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/invar_dust.json b/src/generated/resources/data/occultism/recipes/crushing/invar_dust.json index 33e2dba0a..58fd53458 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/invar_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/invar_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/invar" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/invar" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/invar_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/invar_dust_from_ingot.json index 4c6056963..7ab183aad 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/invar_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/invar_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/invar" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/invar" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/invar_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/invar_dust_from_raw.json index b46e39996..7f81bd666 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/invar_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/invar_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/invar" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/invar" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/invar_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/invar_dust_from_raw_block.json index c97e906e2..0d86d232e 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/invar_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/invar_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_invar" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/invar" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/iridium_dust.json b/src/generated/resources/data/occultism/recipes/crushing/iridium_dust.json index b3858b9da..c6c5b36ef 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/iridium_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/iridium_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/iridium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/iridium" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/iridium_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/iridium_dust_from_ingot.json index c27aeff97..a5e78d4da 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/iridium_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/iridium_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/iridium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/iridium" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/iridium_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/iridium_dust_from_raw.json index 31f69acac..90dfa7f04 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/iridium_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/iridium_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/iridium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/iridium" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/iridium_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/iridium_dust_from_raw_block.json index d8f1213cc..a14ba0b82 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/iridium_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/iridium_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_iridium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/iridium" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/iron_dust.json b/src/generated/resources/data/occultism/recipes/crushing/iron_dust.json index 64ce05590..462389b35 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/iron_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/iron_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/iron" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/iron" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/iron_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/iron_dust_from_ingot.json index 2f789669f..50b5a17cf 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/iron_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/iron_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/iron" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/iron" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/iron_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/iron_dust_from_raw.json index b7e82443c..5a3a03ad6 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/iron_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/iron_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/iron" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/iron" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/iron_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/iron_dust_from_raw_block.json index 610c5be18..d8d3e8509 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/iron_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/iron_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_iron" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/iron" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/lapis_dust.json b/src/generated/resources/data/occultism/recipes/crushing/lapis_dust.json index b709d1178..1c94d7ff1 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/lapis_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/lapis_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/lapis" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/lapis" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/lapis_dust_from_gem.json b/src/generated/resources/data/occultism/recipes/crushing/lapis_dust_from_gem.json index c068dba85..e3b29948d 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/lapis_dust_from_gem.json +++ b/src/generated/resources/data/occultism/recipes/crushing/lapis_dust_from_gem.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:gems/lapis" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/lapis" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/lead_dust.json b/src/generated/resources/data/occultism/recipes/crushing/lead_dust.json index bbd9d4072..0dbe4e336 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/lead_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/lead_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/lead" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/lead" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/lead_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/lead_dust_from_ingot.json index d54ed331b..0a179150c 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/lead_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/lead_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/lead" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/lead" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/lead_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/lead_dust_from_raw.json index 01b53a889..b4853061e 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/lead_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/lead_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/lead" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/lead" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/lead_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/lead_dust_from_raw_block.json index f22f2ca63..d9ae370ad 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/lead_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/lead_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_lead" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/lead" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/lumium_dust.json b/src/generated/resources/data/occultism/recipes/crushing/lumium_dust.json index 4f74ea2c6..e1e339f2a 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/lumium_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/lumium_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/lumium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/lumium" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/lumium_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/lumium_dust_from_ingot.json index a385de512..ea3ecdd33 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/lumium_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/lumium_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/lumium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/lumium" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/lumium_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/lumium_dust_from_raw.json index aad73a574..58f0cffa0 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/lumium_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/lumium_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/lumium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/lumium" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/lumium_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/lumium_dust_from_raw_block.json index 00e5ffb29..1b6454bde 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/lumium_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/lumium_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_lumium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/lumium" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/mithril_dust.json b/src/generated/resources/data/occultism/recipes/crushing/mithril_dust.json index e3df6f864..5bd17b13a 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/mithril_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/mithril_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/mithril" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/mithril" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/mithril_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/mithril_dust_from_ingot.json index d3f393286..4a3ddad37 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/mithril_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/mithril_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/mithril" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/mithril" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/mithril_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/mithril_dust_from_raw.json index f34a16b28..9475f9edd 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/mithril_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/mithril_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/mithril" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/mithril" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/mithril_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/mithril_dust_from_raw_block.json index b68542af9..5e42b7fe0 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/mithril_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/mithril_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_mithril" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/mithril" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/netherite_dust.json b/src/generated/resources/data/occultism/recipes/crushing/netherite_dust.json index ea48bf3e6..efebbefe3 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/netherite_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/netherite_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/netherite" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/netherite" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/netherite_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/netherite_dust_from_ingot.json index bef20269a..97d324271 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/netherite_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/netherite_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/netherite" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/netherite" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/netherite_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/netherite_dust_from_raw.json index c2f2a5e88..8fc32fb57 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/netherite_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/netherite_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/netherite" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/netherite" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/netherite_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/netherite_dust_from_raw_block.json index 401e23b26..6f85fb20a 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/netherite_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/netherite_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_netherite" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/netherite" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/nickel_dust.json b/src/generated/resources/data/occultism/recipes/crushing/nickel_dust.json index 115cfd0ba..e1132c9aa 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/nickel_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/nickel_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/nickel" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/nickel" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/nickel_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/nickel_dust_from_ingot.json index 2f835f80e..3426ad27d 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/nickel_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/nickel_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/nickel" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/nickel" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/nickel_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/nickel_dust_from_raw.json index 3090784ea..8b2c68475 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/nickel_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/nickel_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/nickel" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/nickel" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/nickel_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/nickel_dust_from_raw_block.json index d84c2dadd..2fd9af9e3 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/nickel_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/nickel_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_nickel" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/nickel" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/osmium_dust.json b/src/generated/resources/data/occultism/recipes/crushing/osmium_dust.json index 9a052b0f9..3b938c83a 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/osmium_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/osmium_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/osmium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/osmium" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/osmium_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/osmium_dust_from_ingot.json index 4ae96e1f9..17f9195b3 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/osmium_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/osmium_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/osmium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/osmium" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/osmium_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/osmium_dust_from_raw.json index a4c263344..bc338dc6f 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/osmium_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/osmium_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/osmium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/osmium" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/osmium_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/osmium_dust_from_raw_block.json index 1d436cdf2..80bc3a8aa 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/osmium_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/osmium_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_osmium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/osmium" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/peridot_dust.json b/src/generated/resources/data/occultism/recipes/crushing/peridot_dust.json index 1cbb89256..5e088aa21 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/peridot_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/peridot_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/peridot" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/peridot" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/peridot_dust_from_gem.json b/src/generated/resources/data/occultism/recipes/crushing/peridot_dust_from_gem.json index a985eb76a..d6fd1f514 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/peridot_dust_from_gem.json +++ b/src/generated/resources/data/occultism/recipes/crushing/peridot_dust_from_gem.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:gems/peridot" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/peridot" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/pewter_dust.json b/src/generated/resources/data/occultism/recipes/crushing/pewter_dust.json index da3b901a8..95198daff 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/pewter_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/pewter_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/pewter" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/pewter" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/pewter_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/pewter_dust_from_ingot.json index 60cc545a9..8c73dc24c 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/pewter_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/pewter_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/pewter" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/pewter" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/pewter_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/pewter_dust_from_raw.json index 619b90d27..bfd70c946 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/pewter_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/pewter_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/pewter" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/pewter" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/pewter_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/pewter_dust_from_raw_block.json index 1290aa828..328f0afcb 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/pewter_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/pewter_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_pewter" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/pewter" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/platinum_dust.json b/src/generated/resources/data/occultism/recipes/crushing/platinum_dust.json index ca8958fbc..63b5ddd9c 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/platinum_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/platinum_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/platinum" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/platinum" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/platinum_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/platinum_dust_from_ingot.json index 8defaee7e..8b2aa73e1 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/platinum_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/platinum_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/platinum" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/platinum" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/platinum_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/platinum_dust_from_raw.json index 755738ae2..a7004855f 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/platinum_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/platinum_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/platinum" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/platinum" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/platinum_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/platinum_dust_from_raw_block.json index 08226114c..612cd1053 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/platinum_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/platinum_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_platinum" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/platinum" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/quartz_dust.json b/src/generated/resources/data/occultism/recipes/crushing/quartz_dust.json index a8342273d..894aa8094 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/quartz_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/quartz_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/quartz" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/quartz" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/quartz_dust_from_gem.json b/src/generated/resources/data/occultism/recipes/crushing/quartz_dust_from_gem.json index 3509d1793..4bc431362 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/quartz_dust_from_gem.json +++ b/src/generated/resources/data/occultism/recipes/crushing/quartz_dust_from_gem.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:gems/quartz" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/quartz" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/quicksilver_dust.json b/src/generated/resources/data/occultism/recipes/crushing/quicksilver_dust.json index de901f0d3..60d85ebe0 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/quicksilver_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/quicksilver_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/quicksilver" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/quicksilver" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/quicksilver_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/quicksilver_dust_from_ingot.json index 416dce0c4..f8ac72be2 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/quicksilver_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/quicksilver_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/quicksilver" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/quicksilver" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/quicksilver_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/quicksilver_dust_from_raw.json index d72ea1099..024f5ca61 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/quicksilver_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/quicksilver_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/quicksilver" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/quicksilver" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/quicksilver_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/quicksilver_dust_from_raw_block.json index 722558ea2..e23a9e0e8 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/quicksilver_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/quicksilver_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_quicksilver" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/quicksilver" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/redstone_dust.json b/src/generated/resources/data/occultism/recipes/crushing/redstone_dust.json index 99555fe16..d2a6684f9 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/redstone_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/redstone_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/redstone" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/redstone" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/redstone_dust_from_gem.json b/src/generated/resources/data/occultism/recipes/crushing/redstone_dust_from_gem.json index b01635624..9aabca0ec 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/redstone_dust_from_gem.json +++ b/src/generated/resources/data/occultism/recipes/crushing/redstone_dust_from_gem.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:gems/redstone" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/redstone" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/ruby_dust.json b/src/generated/resources/data/occultism/recipes/crushing/ruby_dust.json index ed74fa4a7..334b8a78e 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/ruby_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/ruby_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/ruby" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/ruby" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/ruby_dust_from_gem.json b/src/generated/resources/data/occultism/recipes/crushing/ruby_dust_from_gem.json index 2bc197a43..b88d39335 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/ruby_dust_from_gem.json +++ b/src/generated/resources/data/occultism/recipes/crushing/ruby_dust_from_gem.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:gems/ruby" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/ruby" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/sapphire_dust.json b/src/generated/resources/data/occultism/recipes/crushing/sapphire_dust.json index c9f4c7964..07b3b2c4d 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/sapphire_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/sapphire_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/sapphire" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/sapphire" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/sapphire_dust_from_gem.json b/src/generated/resources/data/occultism/recipes/crushing/sapphire_dust_from_gem.json index 5039cfd03..7cbd324b6 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/sapphire_dust_from_gem.json +++ b/src/generated/resources/data/occultism/recipes/crushing/sapphire_dust_from_gem.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:gems/sapphire" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/sapphire" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/signalum_dust.json b/src/generated/resources/data/occultism/recipes/crushing/signalum_dust.json index 27b63239b..3534066ee 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/signalum_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/signalum_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/signalum" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/signalum" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/signalum_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/signalum_dust_from_ingot.json index fbbc31a3f..36e113073 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/signalum_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/signalum_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/signalum" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/signalum" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/signalum_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/signalum_dust_from_raw.json index 1df24cd5b..1fd32b995 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/signalum_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/signalum_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/signalum" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/signalum" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/signalum_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/signalum_dust_from_raw_block.json index 21468625a..4fb1f0461 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/signalum_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/signalum_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_signalum" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/signalum" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/silver_dust.json b/src/generated/resources/data/occultism/recipes/crushing/silver_dust.json index 08fda2331..584523aa7 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/silver_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/silver_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/silver" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/silver" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/silver_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/silver_dust_from_ingot.json index 801475a3e..045d7ff83 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/silver_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/silver_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/silver" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/silver" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/silver_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/silver_dust_from_raw.json index 94ae37c42..5c61cda92 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/silver_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/silver_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/silver" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/silver" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/silver_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/silver_dust_from_raw_block.json index 2cb130a84..025658562 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/silver_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/silver_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_silver" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/silver" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/steel_dust.json b/src/generated/resources/data/occultism/recipes/crushing/steel_dust.json index a1838d129..66409dcbf 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/steel_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/steel_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/steel" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/steel" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/steel_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/steel_dust_from_ingot.json index 02879802b..19c636dfc 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/steel_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/steel_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/steel" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/steel" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/steel_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/steel_dust_from_raw.json index 4d4cd8789..756420448 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/steel_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/steel_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/steel" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/steel" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/steel_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/steel_dust_from_raw_block.json index 8f00171cc..074cd44b7 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/steel_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/steel_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_steel" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/steel" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/sulfur_dust.json b/src/generated/resources/data/occultism/recipes/crushing/sulfur_dust.json index fd9775b84..0b9ffa3d8 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/sulfur_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/sulfur_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/sulfur" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/sulfur" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/sulfur_dust_from_gem.json b/src/generated/resources/data/occultism/recipes/crushing/sulfur_dust_from_gem.json index 5e3f93a8e..28502b398 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/sulfur_dust_from_gem.json +++ b/src/generated/resources/data/occultism/recipes/crushing/sulfur_dust_from_gem.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:gems/sulfur" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/sulfur" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/tin_dust.json b/src/generated/resources/data/occultism/recipes/crushing/tin_dust.json index 8efcc3b61..d6e4543c9 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/tin_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/tin_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/tin" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/tin" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/tin_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/tin_dust_from_ingot.json index 00546f7cd..3cc127c8f 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/tin_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/tin_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/tin" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/tin" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/tin_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/tin_dust_from_raw.json index 5f534471c..41a1323ec 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/tin_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/tin_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/tin" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/tin" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/tin_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/tin_dust_from_raw_block.json index 97d0ba78f..865412bc3 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/tin_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/tin_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_tin" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/tin" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/topaz_dust.json b/src/generated/resources/data/occultism/recipes/crushing/topaz_dust.json index 83cd4fdbd..bd438c486 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/topaz_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/topaz_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/topaz" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/topaz" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/topaz_dust_from_gem.json b/src/generated/resources/data/occultism/recipes/crushing/topaz_dust_from_gem.json index 20aa0a18b..bd253abe6 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/topaz_dust_from_gem.json +++ b/src/generated/resources/data/occultism/recipes/crushing/topaz_dust_from_gem.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:gems/topaz" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/topaz" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/tungsten_dust.json b/src/generated/resources/data/occultism/recipes/crushing/tungsten_dust.json index 369acca5a..9cf7b9fd0 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/tungsten_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/tungsten_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/tungsten" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/tungsten" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/tungsten_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/tungsten_dust_from_ingot.json index 7c894b4a8..abbdaaddf 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/tungsten_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/tungsten_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/tungsten" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/tungsten" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/tungsten_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/tungsten_dust_from_raw.json index 0709c07d0..a79227e0c 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/tungsten_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/tungsten_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/tungsten" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/tungsten" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/tungsten_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/tungsten_dust_from_raw_block.json index 5b365dd0e..b1bf980bd 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/tungsten_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/tungsten_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_tungsten" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/tungsten" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/unobtainium_dust.json b/src/generated/resources/data/occultism/recipes/crushing/unobtainium_dust.json index b3227d882..dd47d0fbf 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/unobtainium_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/unobtainium_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/unobtainium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/unobtainium" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/unobtainium_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/unobtainium_dust_from_ingot.json index c985f1de3..47d9bea71 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/unobtainium_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/unobtainium_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/unobtainium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/unobtainium" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/unobtainium_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/unobtainium_dust_from_raw.json index 3790a3182..32f36e442 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/unobtainium_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/unobtainium_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/unobtainium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/unobtainium" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/unobtainium_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/unobtainium_dust_from_raw_block.json index 2621e9552..fd57f4d5b 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/unobtainium_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/unobtainium_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_unobtainium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/unobtainium" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/uranium_dust.json b/src/generated/resources/data/occultism/recipes/crushing/uranium_dust.json index 5ce63c567..006a6acc3 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/uranium_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/uranium_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/uranium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/uranium" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/uranium_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/uranium_dust_from_ingot.json index 923e01121..012eee96c 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/uranium_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/uranium_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/uranium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/uranium" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/uranium_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/uranium_dust_from_raw.json index acdd2ce5a..d6486d4d1 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/uranium_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/uranium_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/uranium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/uranium" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/uranium_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/uranium_dust_from_raw_block.json index 20f65ca3f..ec6e71a75 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/uranium_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/uranium_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_uranium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/uranium" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/vibranium_dust.json b/src/generated/resources/data/occultism/recipes/crushing/vibranium_dust.json index fd0b191d3..3c9e0dd3a 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/vibranium_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/vibranium_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/vibranium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/vibranium" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/vibranium_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/vibranium_dust_from_ingot.json index 67fff88bf..3591efeac 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/vibranium_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/vibranium_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/vibranium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/vibranium" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/vibranium_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/vibranium_dust_from_raw.json index 82f2c4bd9..1054e15b2 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/vibranium_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/vibranium_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/vibranium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/vibranium" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/vibranium_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/vibranium_dust_from_raw_block.json index 5ffa59f54..9479a905a 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/vibranium_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/vibranium_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_vibranium" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/vibranium" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/zinc_dust.json b/src/generated/resources/data/occultism/recipes/crushing/zinc_dust.json index 2ae665474..5cd342c1a 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/zinc_dust.json +++ b/src/generated/resources/data/occultism/recipes/crushing/zinc_dust.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/zinc" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/zinc" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/zinc_dust_from_ingot.json b/src/generated/resources/data/occultism/recipes/crushing/zinc_dust_from_ingot.json index 0943f3f21..ef837fa36 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/zinc_dust_from_ingot.json +++ b/src/generated/resources/data/occultism/recipes/crushing/zinc_dust_from_ingot.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ingots/zinc" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/zinc" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": true, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/zinc_dust_from_raw.json b/src/generated/resources/data/occultism/recipes/crushing/zinc_dust_from_raw.json index 5c08204f5..ec349db24 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/zinc_dust_from_raw.json +++ b/src/generated/resources/data/occultism/recipes/crushing/zinc_dust_from_raw.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:raw_materials/zinc" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/zinc" } } ], + "type": "occultism:crushing", "crushing_time": 200, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/generated/resources/data/occultism/recipes/crushing/zinc_dust_from_raw_block.json b/src/generated/resources/data/occultism/recipes/crushing/zinc_dust_from_raw_block.json index b521f12d6..86248fe88 100644 --- a/src/generated/resources/data/occultism/recipes/crushing/zinc_dust_from_raw_block.json +++ b/src/generated/resources/data/occultism/recipes/crushing/zinc_dust_from_raw_block.json @@ -1,21 +1,21 @@ { - "type": "occultism:crushing", - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:storage_blocks/raw_zinc" } }, { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:dusts/zinc" } } ], + "type": "occultism:crushing", "crushing_time": 1600, "ignore_crushing_multiplier": false, "ingredient": { diff --git a/src/main/java/com/klikli_dev/occultism/Occultism.java b/src/main/java/com/klikli_dev/occultism/Occultism.java index d9b0b10ae..9bcdf90f2 100644 --- a/src/main/java/com/klikli_dev/occultism/Occultism.java +++ b/src/main/java/com/klikli_dev/occultism/Occultism.java @@ -31,26 +31,25 @@ import com.klikli_dev.occultism.config.OccultismClientConfig; import com.klikli_dev.occultism.config.OccultismCommonConfig; import com.klikli_dev.occultism.config.OccultismServerConfig; +import com.klikli_dev.occultism.handlers.ClientSetupEventHandler; import com.klikli_dev.occultism.integration.modonomicon.PageLoaders; -import com.klikli_dev.occultism.network.OccultismPackets; +import com.klikli_dev.occultism.network.Networking; import com.klikli_dev.occultism.registry.*; +import com.klikli_dev.theurgy.Theurgy; +import com.klikli_dev.theurgy.registry.ParticleRegistry; import com.mojang.logging.LogUtils; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.EntityAttributeCreationEvent; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.fml.InterModComms; -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.FMLDedicatedServerSetupEvent; -import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent; -import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +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.FMLDedicatedServerSetupEvent; +import net.neoforged.fml.loading.FMLEnvironment; +import net.neoforged.neoforge.common.NeoForge; +import net.neoforged.neoforge.event.entity.EntityAttributeCreationEvent; import org.slf4j.Logger; import software.bernie.geckolib.GeckoLib; -import top.theillusivec4.curios.api.CuriosApi; -import top.theillusivec4.curios.api.SlotTypeMessage; -import top.theillusivec4.curios.api.SlotTypePreset; @Mod(Occultism.MODID) public class Occultism { @@ -65,12 +64,11 @@ public class Occultism { public static final DebugHelper DEBUG = new DebugHelper(); public static Occultism INSTANCE; - public Occultism() { + public Occultism(IEventBus modEventBus) { INSTANCE = this; ModLoadingContext.get().registerConfig(ModConfig.Type.SERVER, SERVER_CONFIG.spec); ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, COMMON_CONFIG.spec); ModLoadingContext.get().registerConfig(ModConfig.Type.CLIENT, CLIENT_CONFIG.spec); - IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); OccultismEffects.EFFECTS.register(modEventBus); OccultismRecipes.RECIPE_TYPES.register(modEventBus); @@ -78,7 +76,7 @@ public Occultism() { OccultismBlocks.BLOCKS.register(modEventBus); OccultismItems.ITEMS.register(modEventBus); OccultismCreativeModeTabs.CREATIVE_MODE_TABS.register(modEventBus); - OccultismTiles.TILES.register(modEventBus); + OccultismBlockEntities.BLOCK_ENTITIES.register(modEventBus); OccultismContainers.CONTAINERS.register(modEventBus); OccultismEntities.ENTITIES.register(modEventBus); OccultismSounds.SOUNDS.register(modEventBus); @@ -87,31 +85,32 @@ public Occultism() { OccultismLootModifiers.LOOT_MODIFIERS.register(modEventBus); OccultismSensors.SENSORS.register(modEventBus); OccultismMemoryTypes.MEMORY_MODULE_TYPES.register(modEventBus); + OccultismDataStorage.ATTACHMENT_TYPES.register(modEventBus); + OccultismAdvancements.TRIGGER_TYPES.register(modEventBus); //now register the custom registries OccultismSpiritJobs.JOBS.register(modEventBus); OccultismRituals.RITUAL_FACTORIES.register(modEventBus); - OccultismAdvancements.register(); - //register event buses modEventBus.addListener(OccultismCapabilities::onRegisterCapabilities); modEventBus.addListener(this::commonSetup); modEventBus.addListener(this::onEntityAttributeCreation); modEventBus.addListener(this::serverSetup); - modEventBus.addListener(this::enqueueIMC); + modEventBus.addListener(Networking::register); + + NeoForge.EVENT_BUS.addListener(OccultismDataStorage::onPlayerClone); + NeoForge.EVENT_BUS.addListener(OccultismDataStorage::onJoinWorld); - MinecraftForge.EVENT_BUS.register(this); - MinecraftForge.EVENT_BUS.addListener(OccultismCapabilities::onPlayerClone); - MinecraftForge.EVENT_BUS.addListener(OccultismCapabilities::onJoinWorld); + if (FMLEnvironment.dist == Dist.CLIENT) { + modEventBus.addListener(ClientSetupEventHandler::onRegisterMenuScreens); + } - GeckoLib.initialize(); + GeckoLib.initialize(modEventBus); } private void commonSetup(final FMLCommonSetupEvent event) { - OccultismPackets.registerMessages(); - OccultismItems.registerCompostables(); PageLoaders.onCommonSetup(event); @@ -160,11 +159,4 @@ private void onEntityAttributeCreation(final EntityAttributeCreationEvent event) private void serverSetup(final FMLDedicatedServerSetupEvent event) { LOGGER.info("Dedicated server setup complete."); } - - private void enqueueIMC(final InterModEnqueueEvent event) { - InterModComms.sendTo(CuriosApi.MODID, SlotTypeMessage.REGISTER_TYPE, () -> SlotTypePreset.BELT.getMessageBuilder().build()); - InterModComms.sendTo(CuriosApi.MODID, SlotTypeMessage.REGISTER_TYPE, () -> SlotTypePreset.HEAD.getMessageBuilder().build()); - InterModComms.sendTo(CuriosApi.MODID, SlotTypeMessage.REGISTER_TYPE, () -> SlotTypePreset.RING.getMessageBuilder().build()); - InterModComms.sendTo(CuriosApi.MODID, SlotTypeMessage.REGISTER_TYPE, () -> SlotTypePreset.HANDS.getMessageBuilder().build()); - } } diff --git a/src/main/java/com/klikli_dev/occultism/api/common/blockentity/IStorageController.java b/src/main/java/com/klikli_dev/occultism/api/common/blockentity/IStorageController.java index a92412c01..77613d588 100644 --- a/src/main/java/com/klikli_dev/occultism/api/common/blockentity/IStorageController.java +++ b/src/main/java/com/klikli_dev/occultism/api/common/blockentity/IStorageController.java @@ -25,7 +25,7 @@ import com.klikli_dev.occultism.api.common.container.IItemStackComparator; import com.klikli_dev.occultism.api.common.data.GlobalBlockPos; import com.klikli_dev.occultism.api.common.data.MachineReference; -import com.klikli_dev.occultism.network.MessageUpdateStacks; +import com.klikli_dev.occultism.network.messages.MessageUpdateStacks; import net.minecraft.world.item.ItemStack; import java.util.List; diff --git a/src/main/java/com/klikli_dev/occultism/api/common/blockentity/IStorageControllerProxy.java b/src/main/java/com/klikli_dev/occultism/api/common/blockentity/IStorageControllerProxy.java index 1793a4061..3288a9edd 100644 --- a/src/main/java/com/klikli_dev/occultism/api/common/blockentity/IStorageControllerProxy.java +++ b/src/main/java/com/klikli_dev/occultism/api/common/blockentity/IStorageControllerProxy.java @@ -23,12 +23,11 @@ package com.klikli_dev.occultism.api.common.blockentity; import com.klikli_dev.occultism.api.common.data.GlobalBlockPos; -import net.minecraftforge.common.capabilities.ICapabilityProvider; /** * Interface for storage */ -public interface IStorageControllerProxy extends ICapabilityProvider { +public interface IStorageControllerProxy { //region Getter / Setter IStorageController getLinkedStorageController(); diff --git a/src/main/java/com/klikli_dev/occultism/api/common/container/IItemStackComparator.java b/src/main/java/com/klikli_dev/occultism/api/common/container/IItemStackComparator.java index 728c47ca8..a90c8bc1e 100644 --- a/src/main/java/com/klikli_dev/occultism/api/common/container/IItemStackComparator.java +++ b/src/main/java/com/klikli_dev/occultism/api/common/container/IItemStackComparator.java @@ -24,8 +24,7 @@ import net.minecraft.nbt.CompoundTag; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.common.util.INBTSerializable; - +import net.neoforged.neoforge.common.util.INBTSerializable; import javax.annotation.Nonnull; import java.util.function.Predicate; diff --git a/src/main/java/com/klikli_dev/occultism/api/common/data/GlobalBlockPos.java b/src/main/java/com/klikli_dev/occultism/api/common/data/GlobalBlockPos.java index c63c233b0..8f3389767 100644 --- a/src/main/java/com/klikli_dev/occultism/api/common/data/GlobalBlockPos.java +++ b/src/main/java/com/klikli_dev/occultism/api/common/data/GlobalBlockPos.java @@ -30,8 +30,7 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraftforge.common.util.INBTSerializable; - +import net.neoforged.neoforge.common.util.INBTSerializable; import java.util.Objects; import java.util.StringJoiner; diff --git a/src/main/java/com/klikli_dev/occultism/api/common/data/MachineReference.java b/src/main/java/com/klikli_dev/occultism/api/common/data/MachineReference.java index 0a506e483..d0667b4fc 100644 --- a/src/main/java/com/klikli_dev/occultism/api/common/data/MachineReference.java +++ b/src/main/java/com/klikli_dev/occultism/api/common/data/MachineReference.java @@ -24,6 +24,7 @@ import com.klikli_dev.occultism.util.BlockEntityUtil; import net.minecraft.core.Direction; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.resources.ResourceLocation; @@ -32,8 +33,7 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.util.INBTSerializable; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.neoforge.common.util.INBTSerializable; import org.apache.commons.lang3.StringUtils; public class MachineReference implements INBTSerializable { @@ -85,8 +85,8 @@ public static MachineReference from(BlockEntity extractBlockEntity, BlockEntity boolean insertIsLoaded = insertBlockEntity.getLevel().isLoaded(insertPos.getPos()); return new MachineReference(extractPos, - ForgeRegistries.ITEMS.getKey(extractItem.getItem()), extractIsLoaded, insertPos, - ForgeRegistries.ITEMS.getKey(insertItem.getItem()), insertIsLoaded); + BuiltInRegistries.ITEM.getKey(extractItem.getItem()), extractIsLoaded, insertPos, + BuiltInRegistries.ITEM.getKey(insertItem.getItem()), insertIsLoaded); } public static MachineReference from(CompoundTag compound) { @@ -103,7 +103,7 @@ public static MachineReference from(FriendlyByteBuf buf) { public Item getExtractItem() { if (this.cachedExtractItem == null) - this.cachedExtractItem = ForgeRegistries.ITEMS.getValue(this.extractRegistryName); + this.cachedExtractItem = BuiltInRegistries.ITEM.get(this.extractRegistryName); return this.cachedExtractItem; } @@ -115,7 +115,7 @@ public ItemStack getExtractItemStack() { public Item getInsertItem() { if (this.cachedInsertItem == null) - this.cachedInsertItem = ForgeRegistries.ITEMS.getValue(this.insertRegistryName); + this.cachedInsertItem = BuiltInRegistries.ITEM.get(this.insertRegistryName); return this.cachedInsertItem; } diff --git a/src/main/java/com/klikli_dev/occultism/api/common/misc/OccultismItemTier.java b/src/main/java/com/klikli_dev/occultism/api/common/misc/OccultismItemTier.java index 1a670e836..2dd535a39 100644 --- a/src/main/java/com/klikli_dev/occultism/api/common/misc/OccultismItemTier.java +++ b/src/main/java/com/klikli_dev/occultism/api/common/misc/OccultismItemTier.java @@ -26,8 +26,7 @@ import net.minecraft.world.item.Items; import net.minecraft.world.item.Tier; import net.minecraft.world.item.crafting.Ingredient; -import net.minecraftforge.common.util.Lazy; - +import net.neoforged.neoforge.common.util.Lazy; import java.util.function.Supplier; public enum OccultismItemTier implements Tier { diff --git a/src/main/java/com/klikli_dev/occultism/client/gui/DimensionalMineshaftScreen.java b/src/main/java/com/klikli_dev/occultism/client/gui/DimensionalMineshaftScreen.java index 2e2fb52dd..367b05da1 100644 --- a/src/main/java/com/klikli_dev/occultism/client/gui/DimensionalMineshaftScreen.java +++ b/src/main/java/com/klikli_dev/occultism/client/gui/DimensionalMineshaftScreen.java @@ -48,7 +48,7 @@ public DimensionalMineshaftScreen(DimensionalMineshaftContainer screenContainer, } public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) { - this.renderBackground(guiGraphics); + //this.renderBackground(guiGraphics); //called by super super.render(guiGraphics, mouseX, mouseY, partialTicks); this.renderTooltip(guiGraphics, mouseX, mouseY); } diff --git a/src/main/java/com/klikli_dev/occultism/client/gui/GuiHelper.java b/src/main/java/com/klikli_dev/occultism/client/gui/GuiHelper.java index 7e65e9dca..691f3dd41 100644 --- a/src/main/java/com/klikli_dev/occultism/client/gui/GuiHelper.java +++ b/src/main/java/com/klikli_dev/occultism/client/gui/GuiHelper.java @@ -28,8 +28,8 @@ import com.klikli_dev.occultism.common.item.spirit.BookOfCallingItem; import net.minecraft.client.Minecraft; import net.minecraft.core.Direction; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; public class GuiHelper { diff --git a/src/main/java/com/klikli_dev/occultism/client/gui/controls/MachineSlotWidget.java b/src/main/java/com/klikli_dev/occultism/client/gui/controls/MachineSlotWidget.java index 3dcc27c19..be31efb2a 100644 --- a/src/main/java/com/klikli_dev/occultism/client/gui/controls/MachineSlotWidget.java +++ b/src/main/java/com/klikli_dev/occultism/client/gui/controls/MachineSlotWidget.java @@ -29,7 +29,6 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Font; import net.minecraft.client.gui.GuiGraphics; - import javax.annotation.Nonnull; import java.awt.*; diff --git a/src/main/java/com/klikli_dev/occultism/client/gui/controls/SizedImageButton.java b/src/main/java/com/klikli_dev/occultism/client/gui/controls/SizedImageButton.java index 183bb2ecb..d7bc2ee40 100644 --- a/src/main/java/com/klikli_dev/occultism/client/gui/controls/SizedImageButton.java +++ b/src/main/java/com/klikli_dev/occultism/client/gui/controls/SizedImageButton.java @@ -28,10 +28,11 @@ import net.minecraft.client.gui.components.Button; import net.minecraft.client.gui.components.ImageButton; import net.minecraft.client.renderer.GameRenderer; +import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; -public class SizedImageButton extends ImageButton { +public class SizedImageButton extends Button { public final ResourceLocation resourceLocation; public final int xTexStart; public final int yTexStart; @@ -61,7 +62,7 @@ public SizedImageButton(int xIn, int yIn, int widthIn, int heightIn, int texture int textureOffsetY, int hoverOffsetX, int textureWidth, int textureHeight, int textureMapWidth, int textureMapHeight, ResourceLocation resourceLocation, Button.OnPress handler) { - super(xIn, yIn, widthIn, heightIn, textureOffsetX, textureOffsetY, 0, resourceLocation, handler); + super(xIn, yIn, widthIn, heightIn, Component.empty(), handler, DEFAULT_NARRATION); this.xTexStart = textureOffsetX; this.yTexStart = textureOffsetY; this.xDiffOffset = hoverOffsetX; diff --git a/src/main/java/com/klikli_dev/occultism/client/gui/spirit/BookOfCallingGui.java b/src/main/java/com/klikli_dev/occultism/client/gui/spirit/BookOfCallingGui.java index 6bcaf6f99..a74aa1ac0 100644 --- a/src/main/java/com/klikli_dev/occultism/client/gui/spirit/BookOfCallingGui.java +++ b/src/main/java/com/klikli_dev/occultism/client/gui/spirit/BookOfCallingGui.java @@ -27,14 +27,13 @@ import com.klikli_dev.occultism.api.common.data.WorkAreaSize; import com.klikli_dev.occultism.client.gui.controls.LabelWidget; import com.klikli_dev.occultism.common.item.spirit.BookOfCallingItem; -import com.klikli_dev.occultism.network.MessageSetItemMode; -import com.klikli_dev.occultism.network.MessageSetWorkAreaSize; -import com.klikli_dev.occultism.network.OccultismPackets; -import com.mojang.blaze3d.vertex.PoseStack; +import com.klikli_dev.occultism.network.messages.MessageSetItemMode; +import com.klikli_dev.occultism.network.messages.MessageSetWorkAreaSize; +import com.klikli_dev.occultism.network.Networking; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.screens.Screen; import net.minecraft.network.chat.Component; -import net.minecraftforge.client.gui.widget.ExtendedButton; +import net.neoforged.neoforge.client.gui.widget.ExtendedButton; public class BookOfCallingGui extends Screen { @@ -51,7 +50,7 @@ public BookOfCallingGui(BookOfCallingItem.IItemModeSubset mode, WorkAreaSize @Override public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) { - this.renderBackground(guiGraphics); +// this.renderBackground(guiGraphics); //called by super super.render(guiGraphics, mouseX, mouseY, partialTicks); } @@ -78,7 +77,7 @@ protected void init() { this.addRenderableWidget((new ExtendedButton(guiLeft - buttonWidth / 2, guiTop + 60, buttonWidth, 20, Component.translatable(this.mode.getItemMode().getDescriptionId()), (b) -> { this.mode = this.mode.next(); - OccultismPackets.sendToServer(new MessageSetItemMode(this.mode.getItemMode().getValue())); + Networking.sendToServer(new MessageSetItemMode(this.mode.getItemMode().getValue())); this.init(); }))); @@ -93,7 +92,7 @@ protected void init() { this.addRenderableWidget(new ExtendedButton(guiLeft - buttonWidth / 2, guiTop + 85, buttonWidth, 20, Component.translatable(this.workAreaSize.getDescriptionId()), (b) -> { this.workAreaSize = this.workAreaSize.next(); - OccultismPackets.sendToServer(new MessageSetWorkAreaSize(this.workAreaSize.getValue())); + Networking.sendToServer(new MessageSetWorkAreaSize(this.workAreaSize.getValue())); this.init(); })); diff --git a/src/main/java/com/klikli_dev/occultism/client/gui/spirit/BookOfCallingManagedMachineGui.java b/src/main/java/com/klikli_dev/occultism/client/gui/spirit/BookOfCallingManagedMachineGui.java index 3e6d49969..bcd521542 100644 --- a/src/main/java/com/klikli_dev/occultism/client/gui/spirit/BookOfCallingManagedMachineGui.java +++ b/src/main/java/com/klikli_dev/occultism/client/gui/spirit/BookOfCallingManagedMachineGui.java @@ -26,16 +26,15 @@ import com.klikli_dev.occultism.OccultismConstants; import com.klikli_dev.occultism.api.common.data.MachineReference; import com.klikli_dev.occultism.client.gui.controls.LabelWidget; -import com.klikli_dev.occultism.network.MessageSetManagedMachine; -import com.klikli_dev.occultism.network.OccultismPackets; +import com.klikli_dev.occultism.network.messages.MessageSetManagedMachine; +import com.klikli_dev.occultism.network.Networking; import com.klikli_dev.occultism.util.EnumUtil; -import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.EditBox; import net.minecraft.client.gui.screens.Screen; import net.minecraft.core.Direction; import net.minecraft.network.chat.Component; -import net.minecraftforge.client.gui.widget.ExtendedButton; +import net.neoforged.neoforge.client.gui.widget.ExtendedButton; import org.apache.commons.lang3.StringUtils; public class BookOfCallingManagedMachineGui extends Screen { @@ -59,9 +58,9 @@ public BookOfCallingManagedMachineGui(Direction insertFacing, Direction extractF @Override public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) { - this.renderBackground(guiGraphics); - this.text.render(guiGraphics, mouseX, mouseY, partialTicks); +// this.renderBackground(guiGraphics); called by super super.render(guiGraphics, mouseX, mouseY, partialTicks); + this.text.render(guiGraphics, mouseX, mouseY, partialTicks); } @Override @@ -74,7 +73,7 @@ public void onClose() { super.onClose(); this.text.setFocused(false); if (!StringUtils.isBlank(this.customName) && !this.customName.equals(this.originalCustomName)) { - OccultismPackets.sendToServer(new MessageSetManagedMachine(this.makeMachineReference())); + Networking.sendToServer(new MessageSetManagedMachine(this.makeMachineReference())); } } @@ -95,7 +94,7 @@ public void init() { (b) -> { MachineReference reference = this.makeMachineReference(); this.insertFacing = reference.insertFacing = EnumUtil.nextFacing(this.insertFacing); - OccultismPackets.sendToServer(new MessageSetManagedMachine(reference)); + Networking.sendToServer(new MessageSetManagedMachine(reference)); this.init(); })); @@ -105,7 +104,7 @@ public void init() { Component.translatable("enum." + Occultism.MODID + ".facing." + this.extractFacing.getSerializedName()), (b) -> { MachineReference reference = this.makeMachineReference(); this.extractFacing = reference.extractFacing = EnumUtil.nextFacing(this.extractFacing); - OccultismPackets.sendToServer(new MessageSetManagedMachine(reference)); + Networking.sendToServer(new MessageSetManagedMachine(reference)); this.init(); })); @@ -143,12 +142,6 @@ public void init() { this.addRenderableWidget(customNameLabel); } - @Override - public void tick() { - this.text.tick(); - super.tick(); - } - @Override public boolean isPauseScreen() { return false; diff --git a/src/main/java/com/klikli_dev/occultism/client/gui/spirit/SpiritGui.java b/src/main/java/com/klikli_dev/occultism/client/gui/spirit/SpiritGui.java index a8667c615..a6344977e 100644 --- a/src/main/java/com/klikli_dev/occultism/client/gui/spirit/SpiritGui.java +++ b/src/main/java/com/klikli_dev/occultism/client/gui/spirit/SpiritGui.java @@ -141,7 +141,7 @@ protected void renderLabels(GuiGraphics guiGraphics, int pMouseX, int pMouseY) { @Override protected void renderBg(GuiGraphics guiGraphics, float partialTicks, int x, int y) { - this.renderBackground(guiGraphics); +// this.renderBackground(guiGraphics); //called by super RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); guiGraphics.blit(TEXTURE, this.leftPos, this.topPos, 0, 0, this.imageWidth, this.imageHeight); diff --git a/src/main/java/com/klikli_dev/occultism/client/gui/spirit/SpiritTransporterGui.java b/src/main/java/com/klikli_dev/occultism/client/gui/spirit/SpiritTransporterGui.java index 22b46ad8b..b0957d5e5 100644 --- a/src/main/java/com/klikli_dev/occultism/client/gui/spirit/SpiritTransporterGui.java +++ b/src/main/java/com/klikli_dev/occultism/client/gui/spirit/SpiritTransporterGui.java @@ -26,17 +26,15 @@ import com.klikli_dev.occultism.OccultismConstants; import com.klikli_dev.occultism.client.gui.controls.SizedImageButton; import com.klikli_dev.occultism.common.container.spirit.SpiritTransporterContainer; -import com.klikli_dev.occultism.network.MessageSetFilterMode; -import com.klikli_dev.occultism.network.MessageSetTagFilterText; -import com.klikli_dev.occultism.network.OccultismPackets; +import com.klikli_dev.occultism.network.messages.MessageSetFilterMode; +import com.klikli_dev.occultism.network.messages.MessageSetTagFilterText; +import com.klikli_dev.occultism.network.Networking; import com.klikli_dev.occultism.util.InputUtil; import com.mojang.blaze3d.platform.InputConstants; import com.mojang.blaze3d.systems.RenderSystem; -import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.ChatFormatting; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.EditBox; -import net.minecraft.client.renderer.GameRenderer; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; @@ -85,7 +83,7 @@ public void setTagFilterText(String tagFilterText) { public void setIsBlacklist(boolean isBlacklist) { this.spirit.setFilterBlacklist(isBlacklist); - OccultismPackets.sendToServer(new MessageSetFilterMode(isBlacklist, this.spirit.getId())); + Networking.sendToServer(new MessageSetFilterMode(isBlacklist, this.spirit.getId())); } //endregion Getter / Setter @@ -213,16 +211,7 @@ public void onClose() { //we used to check for blank tag filter here, but that prevents emptying the filter this.spirit.setTagFilter(this.tagFilter); - OccultismPackets.sendToServer(new MessageSetTagFilterText(this.tagFilter, this.spirit.getId())); - } - - /** - * Tick is final in abstract container, but calls this method - */ - @Override - public void containerTick() { - this.tagFilterTextField.tick(); - super.containerTick(); + Networking.sendToServer(new MessageSetTagFilterText(this.tagFilter, this.spirit.getId())); } @Override diff --git a/src/main/java/com/klikli_dev/occultism/client/gui/storage/SatchelScreen.java b/src/main/java/com/klikli_dev/occultism/client/gui/storage/SatchelScreen.java index 0a5cb24a1..1e5360350 100644 --- a/src/main/java/com/klikli_dev/occultism/client/gui/storage/SatchelScreen.java +++ b/src/main/java/com/klikli_dev/occultism/client/gui/storage/SatchelScreen.java @@ -52,7 +52,7 @@ protected void init() { @Override public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) { - this.renderBackground(guiGraphics); +// this.renderBackground(guiGraphics); called in super super.render(guiGraphics, mouseX, mouseY, partialTicks); this.renderTooltip(guiGraphics, mouseX, mouseY); } diff --git a/src/main/java/com/klikli_dev/occultism/client/gui/storage/StableWormholeGui.java b/src/main/java/com/klikli_dev/occultism/client/gui/storage/StableWormholeGui.java index b4eb7fc28..8c70e7d08 100644 --- a/src/main/java/com/klikli_dev/occultism/client/gui/storage/StableWormholeGui.java +++ b/src/main/java/com/klikli_dev/occultism/client/gui/storage/StableWormholeGui.java @@ -26,8 +26,8 @@ import com.klikli_dev.occultism.api.common.data.SortType; import com.klikli_dev.occultism.common.blockentity.StorageControllerBlockEntity; import com.klikli_dev.occultism.common.container.storage.StableWormholeContainer; -import com.klikli_dev.occultism.network.MessageUpdateStorageSettings; -import com.klikli_dev.occultism.network.OccultismPackets; +import com.klikli_dev.occultism.network.messages.MessageUpdateStorageSettings; +import com.klikli_dev.occultism.network.Networking; import net.minecraft.core.BlockPos; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; @@ -62,7 +62,7 @@ public SortDirection getSortDirection() { @Override public void setSortDirection(SortDirection sortDirection) { this.container.getStableWormhole().setSortDirection(sortDirection); - OccultismPackets.sendToServer(new MessageUpdateStorageSettings(sortDirection, this.getSortType())); + Networking.sendToServer(new MessageUpdateStorageSettings(sortDirection, this.getSortType())); } @Override @@ -73,7 +73,7 @@ public SortType getSortType() { @Override public void setSortType(SortType sortType) { this.container.getStableWormhole().setSortType(sortType); - OccultismPackets.sendToServer(new MessageUpdateStorageSettings(this.getSortDirection(), sortType)); + Networking.sendToServer(new MessageUpdateStorageSettings(this.getSortDirection(), sortType)); } } diff --git a/src/main/java/com/klikli_dev/occultism/client/gui/storage/StorageControllerGui.java b/src/main/java/com/klikli_dev/occultism/client/gui/storage/StorageControllerGui.java index 06fb58c64..46755e44a 100644 --- a/src/main/java/com/klikli_dev/occultism/client/gui/storage/StorageControllerGui.java +++ b/src/main/java/com/klikli_dev/occultism/client/gui/storage/StorageControllerGui.java @@ -26,8 +26,8 @@ import com.klikli_dev.occultism.api.common.data.SortType; import com.klikli_dev.occultism.common.blockentity.StorageControllerBlockEntity; import com.klikli_dev.occultism.common.container.storage.StorageControllerContainer; -import com.klikli_dev.occultism.network.MessageUpdateStorageSettings; -import com.klikli_dev.occultism.network.OccultismPackets; +import com.klikli_dev.occultism.network.messages.MessageUpdateStorageSettings; +import com.klikli_dev.occultism.network.Networking; import net.minecraft.core.BlockPos; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; @@ -60,7 +60,7 @@ public SortDirection getSortDirection() { @Override public void setSortDirection(SortDirection sortDirection) { this.storageController.setSortDirection(sortDirection); - OccultismPackets.sendToServer(new MessageUpdateStorageSettings(sortDirection, this.getSortType())); + Networking.sendToServer(new MessageUpdateStorageSettings(sortDirection, this.getSortType())); } @Override @@ -71,7 +71,7 @@ public SortType getSortType() { @Override public void setSortType(SortType sortType) { this.storageController.setSortType(sortType); - OccultismPackets.sendToServer(new MessageUpdateStorageSettings(this.getSortDirection(), sortType)); + Networking.sendToServer(new MessageUpdateStorageSettings(this.getSortDirection(), sortType)); } } diff --git a/src/main/java/com/klikli_dev/occultism/client/gui/storage/StorageControllerGuiBase.java b/src/main/java/com/klikli_dev/occultism/client/gui/storage/StorageControllerGuiBase.java index 750984075..29d6e6e99 100644 --- a/src/main/java/com/klikli_dev/occultism/client/gui/storage/StorageControllerGuiBase.java +++ b/src/main/java/com/klikli_dev/occultism/client/gui/storage/StorageControllerGuiBase.java @@ -35,9 +35,10 @@ import com.klikli_dev.occultism.client.gui.controls.MachineSlotWidget; import com.klikli_dev.occultism.client.gui.controls.SizedImageButton; import com.klikli_dev.occultism.common.container.storage.StorageControllerContainerBase; -import com.klikli_dev.occultism.integration.jei.JeiAccess; import com.klikli_dev.occultism.integration.jei.JeiSettings; +import com.klikli_dev.occultism.integration.jei.OccultismJeiIntegration; import com.klikli_dev.occultism.network.*; +import com.klikli_dev.occultism.network.messages.*; import com.klikli_dev.occultism.util.InputUtil; import com.klikli_dev.occultism.util.TextUtil; import com.mojang.blaze3d.platform.InputConstants; @@ -125,7 +126,7 @@ public StorageControllerGuiBase(T container, Inventory playerInventory, Componen this.lastClick = System.currentTimeMillis(); - OccultismPackets.sendToServer(new MessageRequestStacks()); + Networking.sendToServer(new MessageRequestStacks()); } //region Getter / Setter @@ -240,7 +241,7 @@ public void init() { this.searchBar.setValue(searchBarText); if (JeiSettings.isJeiLoaded() && JeiSettings.isJeiSearchSynced()) { - this.searchBar.setValue(JeiAccess.getFilterText()); + this.searchBar.setValue(OccultismJeiIntegration.get().getFilterText()); } int storageSpaceInfoLabelLeft = 186; @@ -256,7 +257,7 @@ public void init() { @Override public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) { - this.renderBackground(guiGraphics); +// this.renderBackground(guiGraphics, mouseX, mouseY, partialTicks); //called by super super.render(guiGraphics, mouseX, mouseY, partialTicks); this.renderTooltip(guiGraphics, mouseX, mouseY); @@ -325,13 +326,13 @@ public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) { (mouseButton == InputUtil.MOUSE_BUTTON_LEFT || mouseButton == InputUtil.MOUSE_BUTTON_RIGHT) && stackCarriedByMouse.isEmpty() && this.canClick()) { //take item out of storage - OccultismPackets.sendToServer( + Networking.sendToServer( new MessageTakeItem(this.stackUnderMouse, mouseButton, Screen.hasShiftDown(), Screen.hasControlDown())); this.lastClick = System.currentTimeMillis(); } else if (!stackCarriedByMouse.isEmpty() && this.isPointInItemArea(mouseX, mouseY) && this.canClick()) { //put item into storage - OccultismPackets.sendToServer(new MessageInsertMouseHeldItem(mouseButton)); + Networking.sendToServer(new MessageInsertMouseHeldItem(mouseButton)); this.lastClick = System.currentTimeMillis(); } } else if (this.guiMode == StorageControllerGuiMode.AUTOCRAFTING) { @@ -347,7 +348,7 @@ public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) { //this message both clears the order slot and creates the order GlobalBlockPos storageControllerPos = this.storageControllerContainer.getStorageControllerGlobalBlockPos(); if (storageControllerPos != null) { - OccultismPackets.sendToServer(new MessageRequestOrder( + Networking.sendToServer(new MessageRequestOrder( storageControllerPos, slot.getMachine().insertGlobalPos, orderStack)); } else { @@ -369,7 +370,7 @@ public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) { public boolean keyPressed(int keyCode, int scanCode, int p_keyPressed_3_) { if (this.searchBar.isFocused() && this.searchBar.keyPressed(keyCode, scanCode, p_keyPressed_3_)) { if (JeiSettings.isJeiLoaded() && JeiSettings.isJeiSearchSynced()) { - JeiAccess.setFilterText(this.searchBar.getValue()); + OccultismJeiIntegration.get().setFilterText(this.searchBar.getValue()); } return true; } @@ -399,15 +400,15 @@ public void containerChanged(Container inventory) { } @Override - public boolean mouseScrolled(double x, double y, double mouseButton) { - super.mouseScrolled(x, y, mouseButton); + public boolean mouseScrolled(double pMouseX, double pMouseY, double pScrollX, double pScrollY) { + super.mouseScrolled(pMouseX, pMouseY, pScrollX, pScrollY); //check if mouse is over item area, then handle scrolling - if (this.isPointInItemArea(x, y)) { - if (mouseButton > 0 && this.currentPage > 1) { + if (this.isPointInItemArea(pMouseX, pMouseY)) { + if (pScrollX > 0 && this.currentPage > 1) { this.currentPage--; } - if (mouseButton < 0 && this.currentPage < this.totalPages) { + if (pScrollX < 0 && this.currentPage < this.totalPages) { this.currentPage++; } } @@ -417,9 +418,9 @@ public boolean mouseScrolled(double x, double y, double mouseButton) { @Override public boolean charTyped(char typedChar, int keyCode) { if (this.searchBar.isFocused() && this.searchBar.charTyped(typedChar, keyCode)) { - OccultismPackets.sendToServer(new MessageRequestStacks()); + Networking.sendToServer(new MessageRequestStacks()); if (JeiSettings.isJeiLoaded() && JeiSettings.isJeiSearchSynced()) { - JeiAccess.setFilterText(this.searchBar.getValue()); + OccultismJeiIntegration.get().setFilterText(this.searchBar.getValue()); } } @@ -434,8 +435,8 @@ public void initButtons() { this.clearRecipeButton = new SizedImageButton(this.leftPos + clearRecipeButtonLeft, this.topPos + clearRecipeButtonTop, controlButtonSize, controlButtonSize, 0, 196, 28, 28, 28, 256, 256, BUTTONS, (button) -> { - OccultismPackets.sendToServer(new MessageClearCraftingMatrix()); - OccultismPackets.sendToServer(new MessageRequestStacks()); + Networking.sendToServer(new MessageClearCraftingMatrix()); + Networking.sendToServer(new MessageRequestStacks()); this.init(); }); this.addRenderableWidget(this.clearRecipeButton); @@ -458,7 +459,7 @@ public void initButtons() { this.topPos + controlButtonTop, controlButtonSize, controlButtonSize, 0, sortTypeOffset, 28, 28, 28, 256, 256, BUTTONS, (button) -> { this.setSortType(this.getSortType().next()); - OccultismPackets.sendToServer( + Networking.sendToServer( new MessageSortItems(this.getEntityPosition(), this.getSortDirection(), this.getSortType())); this.init(); }); @@ -470,7 +471,7 @@ public void initButtons() { this.topPos + controlButtonTop, controlButtonSize, controlButtonSize, 0, sortDirectionOffset, 28, 28, 28, 256, 256, BUTTONS, (button) -> { this.setSortDirection(this.getSortDirection().next()); - OccultismPackets.sendToServer( + Networking.sendToServer( new MessageSortItems(this.getEntityPosition(), this.getSortDirection(), this.getSortType())); this.init(); }); @@ -860,7 +861,7 @@ protected void drawMachineSlots(GuiGraphics guiGraphics, int mouseX, int mouseY) protected void clearSearch() { this.searchBar.setValue(""); if (JeiSettings.isJeiLoaded() && JeiSettings.isJeiSearchSynced()) { - JeiAccess.setFilterText(""); + OccultismJeiIntegration.get().setFilterText(""); } } diff --git a/src/main/java/com/klikli_dev/occultism/client/gui/storage/StorageRemoteGui.java b/src/main/java/com/klikli_dev/occultism/client/gui/storage/StorageRemoteGui.java index 345be0619..9f9998665 100644 --- a/src/main/java/com/klikli_dev/occultism/client/gui/storage/StorageRemoteGui.java +++ b/src/main/java/com/klikli_dev/occultism/client/gui/storage/StorageRemoteGui.java @@ -25,8 +25,8 @@ import com.klikli_dev.occultism.api.common.data.SortDirection; import com.klikli_dev.occultism.api.common.data.SortType; import com.klikli_dev.occultism.common.container.storage.StorageRemoteContainer; -import com.klikli_dev.occultism.network.MessageUpdateStorageSettings; -import com.klikli_dev.occultism.network.OccultismPackets; +import com.klikli_dev.occultism.network.messages.MessageUpdateStorageSettings; +import com.klikli_dev.occultism.network.Networking; import net.minecraft.core.BlockPos; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; @@ -59,7 +59,7 @@ public SortDirection getSortDirection() { @Override public void setSortDirection(SortDirection sortDirection) { this.container.getStorageRemote().getOrCreateTag().putInt("sortDirection", sortDirection.getValue()); - OccultismPackets.sendToServer(new MessageUpdateStorageSettings(sortDirection, this.getSortType())); + Networking.sendToServer(new MessageUpdateStorageSettings(sortDirection, this.getSortType())); } @Override @@ -70,7 +70,7 @@ public SortType getSortType() { @Override public void setSortType(SortType sortType) { this.container.getStorageRemote().getOrCreateTag().putInt("sortType", sortType.getValue()); - OccultismPackets.sendToServer(new MessageUpdateStorageSettings(this.getSortDirection(), sortType)); + Networking.sendToServer(new MessageUpdateStorageSettings(this.getSortDirection(), sortType)); } } diff --git a/src/main/java/com/klikli_dev/occultism/client/itemproperties/DivinationRodItemPropertyGetter.java b/src/main/java/com/klikli_dev/occultism/client/itemproperties/DivinationRodItemPropertyGetter.java index f1ebae18f..1de562fd1 100644 --- a/src/main/java/com/klikli_dev/occultism/client/itemproperties/DivinationRodItemPropertyGetter.java +++ b/src/main/java/com/klikli_dev/occultism/client/itemproperties/DivinationRodItemPropertyGetter.java @@ -28,9 +28,8 @@ import net.minecraft.client.renderer.item.ItemPropertyFunction; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; - +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; import javax.annotation.Nullable; @OnlyIn(Dist.CLIENT) diff --git a/src/main/java/com/klikli_dev/occultism/client/itemproperties/OtherworldBlockItemPropertyGetter.java b/src/main/java/com/klikli_dev/occultism/client/itemproperties/OtherworldBlockItemPropertyGetter.java index 79920f73a..c7d611083 100644 --- a/src/main/java/com/klikli_dev/occultism/client/itemproperties/OtherworldBlockItemPropertyGetter.java +++ b/src/main/java/com/klikli_dev/occultism/client/itemproperties/OtherworldBlockItemPropertyGetter.java @@ -28,9 +28,8 @@ import net.minecraft.client.renderer.item.ItemPropertyFunction; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; - +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; import javax.annotation.Nullable; @OnlyIn(Dist.CLIENT) diff --git a/src/main/java/com/klikli_dev/occultism/client/itemproperties/SoulGemItemPropertyGetter.java b/src/main/java/com/klikli_dev/occultism/client/itemproperties/SoulGemItemPropertyGetter.java index c2fccbb04..b875b6ae6 100644 --- a/src/main/java/com/klikli_dev/occultism/client/itemproperties/SoulGemItemPropertyGetter.java +++ b/src/main/java/com/klikli_dev/occultism/client/itemproperties/SoulGemItemPropertyGetter.java @@ -26,9 +26,8 @@ import net.minecraft.client.renderer.item.ItemPropertyFunction; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; - +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; import javax.annotation.Nullable; @OnlyIn(Dist.CLIENT) diff --git a/src/main/java/com/klikli_dev/occultism/client/itemproperties/StableWormholeBlockItemPropertyGetter.java b/src/main/java/com/klikli_dev/occultism/client/itemproperties/StableWormholeBlockItemPropertyGetter.java index 9e370a3c0..b49a09d78 100644 --- a/src/main/java/com/klikli_dev/occultism/client/itemproperties/StableWormholeBlockItemPropertyGetter.java +++ b/src/main/java/com/klikli_dev/occultism/client/itemproperties/StableWormholeBlockItemPropertyGetter.java @@ -26,9 +26,8 @@ import net.minecraft.client.renderer.item.ItemPropertyFunction; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; - +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; import javax.annotation.Nullable; @OnlyIn(Dist.CLIENT) diff --git a/src/main/java/com/klikli_dev/occultism/client/itemproperties/StorageRemoteItemPropertyGetter.java b/src/main/java/com/klikli_dev/occultism/client/itemproperties/StorageRemoteItemPropertyGetter.java index 1baaae95c..b50034ee5 100644 --- a/src/main/java/com/klikli_dev/occultism/client/itemproperties/StorageRemoteItemPropertyGetter.java +++ b/src/main/java/com/klikli_dev/occultism/client/itemproperties/StorageRemoteItemPropertyGetter.java @@ -26,9 +26,8 @@ import net.minecraft.client.renderer.item.ItemPropertyFunction; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; - +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; import javax.annotation.Nullable; @OnlyIn(Dist.CLIENT) diff --git a/src/main/java/com/klikli_dev/occultism/client/keybindings/BackpackKeyConflictContext.java b/src/main/java/com/klikli_dev/occultism/client/keybindings/BackpackKeyConflictContext.java index 707d14584..6f9521cee 100644 --- a/src/main/java/com/klikli_dev/occultism/client/keybindings/BackpackKeyConflictContext.java +++ b/src/main/java/com/klikli_dev/occultism/client/keybindings/BackpackKeyConflictContext.java @@ -2,8 +2,8 @@ import com.klikli_dev.occultism.client.gui.storage.SatchelScreen; import net.minecraft.client.Minecraft; -import net.minecraftforge.client.settings.IKeyConflictContext; -import net.minecraftforge.client.settings.KeyConflictContext; +import net.neoforged.neoforge.client.settings.IKeyConflictContext; +import net.neoforged.neoforge.client.settings.KeyConflictContext; public class BackpackKeyConflictContext implements IKeyConflictContext { diff --git a/src/main/java/com/klikli_dev/occultism/client/keybindings/StorageRemoteKeyConflictContext.java b/src/main/java/com/klikli_dev/occultism/client/keybindings/StorageRemoteKeyConflictContext.java index a5421461c..14723b51f 100644 --- a/src/main/java/com/klikli_dev/occultism/client/keybindings/StorageRemoteKeyConflictContext.java +++ b/src/main/java/com/klikli_dev/occultism/client/keybindings/StorageRemoteKeyConflictContext.java @@ -2,8 +2,8 @@ import com.klikli_dev.occultism.client.gui.storage.StorageControllerGuiBase; import net.minecraft.client.Minecraft; -import net.minecraftforge.client.settings.IKeyConflictContext; -import net.minecraftforge.client.settings.KeyConflictContext; +import net.neoforged.neoforge.client.settings.IKeyConflictContext; +import net.neoforged.neoforge.client.settings.KeyConflictContext; public class StorageRemoteKeyConflictContext implements IKeyConflictContext { diff --git a/src/main/java/com/klikli_dev/occultism/client/render/SelectedBlockRenderer.java b/src/main/java/com/klikli_dev/occultism/client/render/SelectedBlockRenderer.java index 88f37879b..91bca9bfd 100644 --- a/src/main/java/com/klikli_dev/occultism/client/render/SelectedBlockRenderer.java +++ b/src/main/java/com/klikli_dev/occultism/client/render/SelectedBlockRenderer.java @@ -31,10 +31,9 @@ import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.core.BlockPos; import net.minecraft.world.phys.Vec3; -import net.minecraftforge.client.event.RenderLevelStageEvent; -import net.minecraftforge.client.event.RenderLevelStageEvent.Stage; -import net.minecraftforge.eventbus.api.SubscribeEvent; - +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.neoforge.client.event.RenderLevelStageEvent; +import net.neoforged.neoforge.client.event.RenderLevelStageEvent.Stage; import java.awt.*; import java.util.HashSet; import java.util.Iterator; diff --git a/src/main/java/com/klikli_dev/occultism/client/render/ThirdEyeEffectRenderer.java b/src/main/java/com/klikli_dev/occultism/client/render/ThirdEyeEffectRenderer.java index d78bc96e6..1c20adb36 100644 --- a/src/main/java/com/klikli_dev/occultism/client/render/ThirdEyeEffectRenderer.java +++ b/src/main/java/com/klikli_dev/occultism/client/render/ThirdEyeEffectRenderer.java @@ -37,11 +37,10 @@ import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.client.event.ScreenEvent; -import net.minecraftforge.event.TickEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; - +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.neoforge.event.TickEvent; import java.util.HashSet; import java.util.Set; @@ -133,7 +132,7 @@ public void uncoverBlocks(Player player, Level level, OtherworldBlockTier tier) if (state.getBlock() instanceof IOtherworldBlock block) { if (block.getTier().getLevel() <= tier.getLevel()) { if (!state.getValue(IOtherworldBlock.UNCOVERED)) { - level.setBlock(pos, state.setValue(IOtherworldBlock.UNCOVERED, true), 1); + level.setBlock(pos, state.setValue(IOtherworldBlock.UNCOVERED, true), Block.UPDATE_IMMEDIATE); } this.uncoveredBlocks.add(pos.immutable()); } diff --git a/src/main/java/com/klikli_dev/occultism/client/render/blockentity/SacrificialBowlRenderer.java b/src/main/java/com/klikli_dev/occultism/client/render/blockentity/SacrificialBowlRenderer.java index 77b140053..c013fe6e6 100644 --- a/src/main/java/com/klikli_dev/occultism/client/render/blockentity/SacrificialBowlRenderer.java +++ b/src/main/java/com/klikli_dev/occultism/client/render/blockentity/SacrificialBowlRenderer.java @@ -42,7 +42,6 @@ public SacrificialBowlRenderer(BlockEntityRendererProvider.Context context) { } - //region Static Methods public static float getScale(ItemStack stack) { if (stack.getItem() instanceof BlockItem itemBlock) { if (itemBlock.getBlock() instanceof SpiritAttunedCrystalBlock) @@ -54,33 +53,32 @@ public static float getScale(ItemStack stack) { @Override public void render(SacrificialBowlBlockEntity blockEntity, float partialTicks, PoseStack poseStack, MultiBufferSource buffer, int combinedLight, int combinedOverlay) { - blockEntity.itemStackHandler.ifPresent(handler -> { - ItemStack stack = handler.getStackInSlot(0); - long time = blockEntity.getLevel().getGameTime(); - poseStack.pushPose(); + var handler = blockEntity.itemStackHandler; - //slowly bob up and down following a sine - double offset = Math.sin((time - blockEntity.lastChangeTime + partialTicks) / 16) * 0.5f + 0.5f; // * 0.5f + 0.5f; move sine between 0.0-1.0 - offset = offset / 4.0f; //reduce amplitude - poseStack.translate(0.5, 0.6 + offset, 0.5); + ItemStack stack = handler.getStackInSlot(0); + long time = blockEntity.getLevel().getGameTime(); + poseStack.pushPose(); - //use system time to become independent of game time - long systemTime = System.currentTimeMillis(); - //rotate item slowly around y axis - float angle = (systemTime / 16) % 360; - poseStack.mulPose(Axis.YP.rotationDegrees(angle)); + //slowly bob up and down following a sine + double offset = Math.sin((time - blockEntity.lastChangeTime + partialTicks) / 16) * 0.5f + 0.5f; // * 0.5f + 0.5f; move sine between 0.0-1.0 + offset = offset / 4.0f; //reduce amplitude + poseStack.translate(0.5, 0.6 + offset, 0.5); - //Fixed scale - float scale = getScale(stack) * 0.5f; - poseStack.scale(scale, scale, scale); + //use system time to become independent of game time + long systemTime = System.currentTimeMillis(); + //rotate item slowly around y axis + float angle = (systemTime / 16) % 360; + poseStack.mulPose(Axis.YP.rotationDegrees(angle)); - ItemRenderer itemRenderer = Minecraft.getInstance().getItemRenderer(); - BakedModel model = itemRenderer.getModel(stack, blockEntity.getLevel(), null, 0); - itemRenderer.render(stack, ItemDisplayContext.FIXED, true, poseStack, buffer, - combinedLight, combinedOverlay, model); + //Fixed scale + float scale = getScale(stack) * 0.5f; + poseStack.scale(scale, scale, scale); - poseStack.popPose(); - }); + ItemRenderer itemRenderer = Minecraft.getInstance().getItemRenderer(); + BakedModel model = itemRenderer.getModel(stack, blockEntity.getLevel(), null, 0); + itemRenderer.render(stack, ItemDisplayContext.FIXED, true, poseStack, buffer, + combinedLight, combinedOverlay, model); + + poseStack.popPose(); } - //endregion Static Methods } diff --git a/src/main/java/com/klikli_dev/occultism/client/render/blockentity/StorageControllerRenderer.java b/src/main/java/com/klikli_dev/occultism/client/render/blockentity/StorageControllerRenderer.java index deee72be5..bd0031658 100644 --- a/src/main/java/com/klikli_dev/occultism/client/render/blockentity/StorageControllerRenderer.java +++ b/src/main/java/com/klikli_dev/occultism/client/render/blockentity/StorageControllerRenderer.java @@ -39,7 +39,6 @@ import net.minecraft.core.Direction; import net.minecraft.util.RandomSource; import net.minecraft.world.item.ItemStack; - import java.awt.*; import java.util.List; diff --git a/src/main/java/com/klikli_dev/occultism/client/render/entity/DragonFamiliarRenderer.java b/src/main/java/com/klikli_dev/occultism/client/render/entity/DragonFamiliarRenderer.java index 25e07d4e3..d7f484e72 100644 --- a/src/main/java/com/klikli_dev/occultism/client/render/entity/DragonFamiliarRenderer.java +++ b/src/main/java/com/klikli_dev/occultism/client/render/entity/DragonFamiliarRenderer.java @@ -34,11 +34,11 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.util.Mth; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.client.event.RenderLivingEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.common.Mod.EventBusSubscriber; -import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.Mod.EventBusSubscriber; +import net.neoforged.fml.common.Mod.EventBusSubscriber.Bus; +import net.neoforged.neoforge.client.event.RenderLivingEvent; public class DragonFamiliarRenderer extends MobRenderer { @@ -61,7 +61,7 @@ public ResourceLocation getTextureLocation(DragonFamiliarEntity entity) { private static class RenderText { @SubscribeEvent - public static void renderText(RenderLivingEvent event) { + public static void renderText(RenderLivingEvent.Post event) { if (!(event.getEntity() instanceof DragonFamiliarEntity dragon)) return; diff --git a/src/main/java/com/klikli_dev/occultism/client/render/entity/HeadlessFamiliarRenderer.java b/src/main/java/com/klikli_dev/occultism/client/render/entity/HeadlessFamiliarRenderer.java index 71580baa0..d2f601365 100644 --- a/src/main/java/com/klikli_dev/occultism/client/render/entity/HeadlessFamiliarRenderer.java +++ b/src/main/java/com/klikli_dev/occultism/client/render/entity/HeadlessFamiliarRenderer.java @@ -244,7 +244,7 @@ public HeadLayer(RenderLayerParent type) { if (textures == null) { ImmutableMap.Builder, ResourceLocation> builder = new ImmutableMap.Builder<>(); - builder.put(EntityType.PLAYER, DefaultPlayerSkin.getDefaultSkin()); + builder.put(EntityType.PLAYER, DefaultPlayerSkin.getDefaultTexture()); builder.put(EntityType.SKELETON, new ResourceLocation("textures/entity/skeleton/skeleton.png")); builder.put(EntityType.WITHER_SKELETON, new ResourceLocation("textures/entity/skeleton/wither_skeleton.png")); builder.put(EntityType.ZOMBIE, new ResourceLocation("textures/entity/zombie/zombie.png")); diff --git a/src/main/java/com/klikli_dev/occultism/client/render/entity/OtherworldBirdRenderer.java b/src/main/java/com/klikli_dev/occultism/client/render/entity/OtherworldBirdRenderer.java index 5c4b2922d..7b43c0a9d 100644 --- a/src/main/java/com/klikli_dev/occultism/client/render/entity/OtherworldBirdRenderer.java +++ b/src/main/java/com/klikli_dev/occultism/client/render/entity/OtherworldBirdRenderer.java @@ -22,6 +22,7 @@ package com.klikli_dev.occultism.client.render.entity; +import com.klikli_dev.occultism.Occultism; import net.minecraft.client.model.ParrotModel; import net.minecraft.client.model.geom.ModelLayers; import net.minecraft.client.renderer.entity.EntityRendererProvider; @@ -30,10 +31,8 @@ import net.minecraft.util.Mth; import net.minecraft.world.entity.animal.Parrot; -import static com.klikli_dev.occultism.util.StaticUtil.modLoc; - public class OtherworldBirdRenderer extends MobRenderer { - public static final ResourceLocation TEXTURE = modLoc("textures/entity/otherworld_bird.png"); + public static final ResourceLocation TEXTURE = new ResourceLocation(Occultism.MODID, "textures/entity/otherworld_bird.png"); public OtherworldBirdRenderer(EntityRendererProvider.Context context) { super(context, new ParrotModel(context.bakeLayer(ModelLayers.PARROT)), 0.3F); diff --git a/src/main/java/com/klikli_dev/occultism/common/advancement/FamiliarTrigger.java b/src/main/java/com/klikli_dev/occultism/common/advancement/FamiliarTrigger.java index 7397a58a2..683194629 100644 --- a/src/main/java/com/klikli_dev/occultism/common/advancement/FamiliarTrigger.java +++ b/src/main/java/com/klikli_dev/occultism/common/advancement/FamiliarTrigger.java @@ -1,33 +1,32 @@ package com.klikli_dev.occultism.common.advancement; -import com.google.gson.JsonObject; -import com.klikli_dev.occultism.Occultism; +import com.klikli_dev.occultism.registry.OccultismAdvancements; +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; +import net.minecraft.advancements.CriteriaTriggers; +import net.minecraft.advancements.Criterion; import net.minecraft.advancements.critereon.*; -import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerPlayer; -import net.minecraft.util.GsonHelper; +import net.minecraft.util.ExtraCodecs; +import net.minecraft.util.StringRepresentable; import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.level.block.Block; -public class FamiliarTrigger extends SimpleCriterionTrigger { +import java.util.Optional; - private static final ResourceLocation ID = new ResourceLocation(Occultism.MODID, "familiar"); +public class FamiliarTrigger extends SimpleCriterionTrigger { - public static Instance of(Type type) { - return new Instance(ContextAwarePredicate.ANY, type); + public static Criterion of(Type type) { + return OccultismAdvancements.FAMILIAR.get().createCriterion(new TriggerInstance(Optional.empty(), Optional.of(type))); } @Override - public ResourceLocation getId() { - return ID; - } - - @Override - protected Instance createInstance(JsonObject pJson, ContextAwarePredicate predicate, DeserializationContext pContext) { - return new Instance(predicate, Type.valueOf(GsonHelper.getAsString(pJson, "type"))); + public Codec codec() { + return TriggerInstance.CODEC; } public void trigger(ServerPlayer player, Type type) { - this.trigger(player, instance -> instance.test(type)); + this.trigger(player, instance -> instance.matches(type)); } public void trigger(LivingEntity entity, Type type) { @@ -35,32 +34,48 @@ public void trigger(LivingEntity entity, Type type) { this.trigger((ServerPlayer) entity, type); } - public enum Type { + public enum Type implements StringRepresentable { DEER_POOP, CTHULHU_SAD, BAT_EAT, DEVIL_FIRE, GREEDY_ITEM, RARE_VARIANT, PARTY, CAPTURE, DRAGON_NUGGET, DRAGON_RIDE, DRAGON_PET, DRAGON_FETCH, BLACKSMITH_UPGRADE, GUARDIAN_ULTIMATE_SACRIFICE, HEADLESS_CTHULHU_HEAD, HEADLESS_REBUILT, CHIMERA_RIDE, GOAT_DETACH, SHUB_NIGGURATH_SUMMON, SHUB_CTHULHU_FRIENDS, SHUB_NIGGURATH_SPAWN, - BEHOLDER_RAY, BEHOLDER_EAT, FAIRY_SAVE, MUMMY_DODGE, BEAVER_WOODCHOP - } - - public static class Instance extends AbstractCriterionTriggerInstance { + BEHOLDER_RAY, BEHOLDER_EAT, FAIRY_SAVE, MUMMY_DODGE, BEAVER_WOODCHOP; - private final Type type; + private final String name; - public Instance(ContextAwarePredicate predicate, Type type) { - super(FamiliarTrigger.ID, predicate); - this.type = type; + Type() { + this.name = this.name().toLowerCase(); } - public boolean test(Type type) { - return this.type == type; + @Override + public String getSerializedName() { + return name; } + } - @Override - public JsonObject serializeToJson(SerializationContext serializationContext) { - JsonObject json = super.serializeToJson(serializationContext); - json.addProperty("type", this.type.name()); - return json; + public record TriggerInstance(Optional player, + Optional type) implements SimpleCriterionTrigger.SimpleInstance { + public static final Codec CODEC = RecordCodecBuilder.create( + instance -> instance.group( + ExtraCodecs.strictOptionalField(EntityPredicate.ADVANCEMENT_CODEC, "player").forGetter(TriggerInstance::player), + ExtraCodecs.strictOptionalField(StringRepresentable.fromEnum(Type::values), "type") + .forGetter(TriggerInstance::type) + ) + .apply(instance, TriggerInstance::new) + ); + + public static Criterion destroyedBeeNest( + Block pBlock, ItemPredicate.Builder pItem, MinMaxBounds.Ints pNumBees + ) { + return CriteriaTriggers.BEE_NEST_DESTROYED + .createCriterion( + new BeeNestDestroyedTrigger.TriggerInstance( + Optional.empty(), Optional.of(pBlock.builtInRegistryHolder()), Optional.of(pItem.build()), pNumBees + ) + ); } + public boolean matches(Type type) { + return this.type.isPresent() && this.type.get() == type; + } } } diff --git a/src/main/java/com/klikli_dev/occultism/common/advancement/RitualTrigger.java b/src/main/java/com/klikli_dev/occultism/common/advancement/RitualTrigger.java index 4202415b8..dc6ee5ace 100644 --- a/src/main/java/com/klikli_dev/occultism/common/advancement/RitualTrigger.java +++ b/src/main/java/com/klikli_dev/occultism/common/advancement/RitualTrigger.java @@ -22,108 +22,57 @@ package com.klikli_dev.occultism.common.advancement; -import com.google.gson.JsonElement; -import com.google.gson.JsonNull; -import com.google.gson.JsonObject; -import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.common.ritual.Ritual; -import net.minecraft.advancements.critereon.*; +import com.klikli_dev.occultism.registry.OccultismAdvancements; +import com.klikli_dev.occultism.registry.OccultismRecipes; +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; +import net.minecraft.advancements.CriteriaTriggers; +import net.minecraft.advancements.Criterion; +import net.minecraft.advancements.critereon.ContextAwarePredicate; +import net.minecraft.advancements.critereon.EntityPredicate; +import net.minecraft.advancements.critereon.PlayerTrigger; +import net.minecraft.advancements.critereon.SimpleCriterionTrigger; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerPlayer; -import net.minecraft.util.GsonHelper; +import net.minecraft.util.ExtraCodecs; -public class RitualTrigger extends SimpleCriterionTrigger { +import java.util.Optional; - private static final ResourceLocation ID = new ResourceLocation(Occultism.MODID, "ritual"); +public class RitualTrigger extends SimpleCriterionTrigger { - public RitualTrigger() { - } - - public ResourceLocation getId() { - return ID; - } - - @Override - protected Instance createInstance(JsonObject json, ContextAwarePredicate predicate, DeserializationContext deserializationContext) { - return new RitualTrigger.Instance(this.deserializeRitualPredicate(json)); - } - - private RitualPredicate deserializeRitualPredicate(JsonObject json) { - if (json.has("ritual_id")) - return new RitualPredicate(new ResourceLocation(GsonHelper.getAsString(json, "ritual_id")), null); - return RitualPredicate.deserialize(json.get("ritual_predicate")); - } public void trigger(ServerPlayer player, Ritual ritual) { - this.trigger(player, (instance) -> instance.test(player, ritual)); + this.trigger(player, (instance) -> instance.matches(player, ritual)); } - - public static class Instance extends AbstractCriterionTriggerInstance { - - RitualPredicate ritualPredicate; - - public Instance(RitualPredicate ritualPredicate) { - super(RitualTrigger.ID, ContextAwarePredicate.ANY); - this.ritualPredicate = ritualPredicate; - } - - public boolean test(ServerPlayer player, Ritual ritual) { - return this.ritualPredicate.test(ritual); - } - - public JsonObject serializeToJson(SerializationContext pConditions) { - JsonObject jsonobject = super.serializeToJson(pConditions); - jsonobject.add("ritual_predicate", this.ritualPredicate.serialize()); - return jsonobject; - } - + @Override + public Codec codec() { + return TriggerInstance.CODEC; } - public static class RitualPredicate { - - public static final RitualPredicate ANY = new RitualPredicate(null, null); + public record TriggerInstance(Optional player, + Optional ritualId, + Optional ritualFactoryId) implements SimpleCriterionTrigger.SimpleInstance { - private final ResourceLocation ritualId; - private final ResourceLocation ritualFactoryId; - - public RitualPredicate(ResourceLocation ritualId, ResourceLocation ritualFactoryId) { - this.ritualId = ritualId; - this.ritualFactoryId = ritualFactoryId; - } - - public static RitualPredicate deserialize(JsonElement element) { - if (element == null || element.isJsonNull()) - return ANY; - - ResourceLocation ritualId = null; - ResourceLocation ritualFactoryId = null; - JsonObject json = GsonHelper.convertToJsonObject(element, "ritual_predicate"); - if (json.has("ritual_id")) - ritualId = new ResourceLocation(GsonHelper.getAsString(json, "ritual_id")); - if (json.has("ritual_factory_id")) - ritualFactoryId = new ResourceLocation(GsonHelper.getAsString(json, "ritual_factory_id")); - return new RitualPredicate(ritualId, ritualFactoryId); + public static Criterion ritualFactory(ResourceLocation ritualFactoryId) { + return OccultismAdvancements.RITUAL.get().createCriterion(new TriggerInstance(Optional.empty(), Optional.empty(), Optional.of(ritualFactoryId))); } - public boolean test(Ritual ritual) { - if (this == ANY) - return true; - else if (this.ritualId != null && !this.ritualId.equals(ritual.getRecipe().getId())) + public static final Codec CODEC = RecordCodecBuilder.create( + instance -> instance.group( + ExtraCodecs.strictOptionalField(EntityPredicate.ADVANCEMENT_CODEC, "player").forGetter(TriggerInstance::player), + ExtraCodecs.strictOptionalField(ResourceLocation.CODEC, "ritual_id").forGetter(TriggerInstance::ritualId), + ExtraCodecs.strictOptionalField(ResourceLocation.CODEC, "ritual_factory_id").forGetter(TriggerInstance::ritualFactoryId) + ) + .apply(instance, TriggerInstance::new) + ); + + public boolean matches(ServerPlayer player, Ritual ritual) { + if (this.ritualId.isPresent() && !this.ritualId.get().equals(ritual.getRecipeHolder(player).id())) return false; - else return this.ritualFactoryId == null || this.ritualFactoryId.equals(ritual.getFactoryID()); + else return this.ritualFactoryId.isEmpty() || this.ritualFactoryId.get().equals(ritual.getFactoryID()); } - public JsonElement serialize() { - if (this == ANY) - return JsonNull.INSTANCE; - JsonObject json = new JsonObject(); - if (this.ritualId != null) - json.addProperty("ritual_id", this.ritualId.toString()); - if (this.ritualFactoryId != null) - json.addProperty("ritual_factory_id", this.ritualFactoryId.toString()); - return json; - } } - } diff --git a/src/main/java/com/klikli_dev/occultism/common/block/CandleBlock.java b/src/main/java/com/klikli_dev/occultism/common/block/CandleBlock.java index 1ff22d09f..e35314235 100644 --- a/src/main/java/com/klikli_dev/occultism/common/block/CandleBlock.java +++ b/src/main/java/com/klikli_dev/occultism/common/block/CandleBlock.java @@ -34,9 +34,8 @@ 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 net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; import java.util.Random; import java.util.stream.Stream; diff --git a/src/main/java/com/klikli_dev/occultism/common/block/ChalkGlyphBlock.java b/src/main/java/com/klikli_dev/occultism/common/block/ChalkGlyphBlock.java index 199c1391e..856ebd31e 100644 --- a/src/main/java/com/klikli_dev/occultism/common/block/ChalkGlyphBlock.java +++ b/src/main/java/com/klikli_dev/occultism/common/block/ChalkGlyphBlock.java @@ -24,8 +24,8 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.world.entity.Mob; -import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.context.BlockPlaceContext; @@ -39,11 +39,9 @@ import net.minecraft.world.level.block.state.properties.IntegerProperty; import net.minecraft.world.level.material.Fluid; import net.minecraft.world.level.pathfinder.BlockPathTypes; -import net.minecraft.world.phys.HitResult; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -import net.minecraftforge.registries.ForgeRegistries; import org.jetbrains.annotations.Nullable; import java.util.function.Supplier; @@ -136,14 +134,14 @@ protected void createBlockStateDefinition(StateDefinition.Builder { - if (!player.isShiftKeyDown()) { - ItemStack itemStack = handler.getStackInSlot(0); - if (itemStack.isEmpty()) { - //if there is nothing in the bowl, put the hand held item in - player.setItemInHand(hand, handler.insertItem(0, heldItem, false)); - level.playSound(null, pos, SoundEvents.ITEM_FRAME_ADD_ITEM, SoundSource.BLOCKS, 1, 1); + var handler = bowl.itemStackHandler; + if (!player.isShiftKeyDown()) { + ItemStack itemStack = handler.getStackInSlot(0); + if (itemStack.isEmpty()) { + //if there is nothing in the bowl, put the hand held item in + player.setItemInHand(hand, handler.insertItem(0, heldItem, false)); + level.playSound(null, pos, SoundEvents.ITEM_FRAME_ADD_ITEM, SoundSource.BLOCKS, 1, 1); + } else { + //otherwise take out the item. + if (heldItem.isEmpty()) { + //place it in the hand if possible + player.setItemInHand(hand, handler.extractItem(0, 64, false)); } else { - //otherwise take out the item. - if (heldItem.isEmpty()) { - //place it in the hand if possible - player.setItemInHand(hand, handler.extractItem(0, 64, false)); - } else { - //and if not, just put it in the inventory - ItemHandlerHelper.giveItemToPlayer(player, handler.extractItem(0, 64, false)); - } - level.playSound(null, pos, SoundEvents.ITEM_FRAME_REMOVE_ITEM, SoundSource.BLOCKS, 1, 1); + //and if not, just put it in the inventory + ItemHandlerHelper.giveItemToPlayer(player, handler.extractItem(0, 64, false)); } - bowl.setChanged(); + level.playSound(null, pos, SoundEvents.ITEM_FRAME_REMOVE_ITEM, SoundSource.BLOCKS, 1, 1); } - }); + bowl.setChanged(); + } } return InteractionResult.SUCCESS; } @@ -114,6 +112,6 @@ public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, @Nullable @Override public BlockEntity newBlockEntity(BlockPos blockPos, BlockState blockState) { - return OccultismTiles.SACRIFICIAL_BOWL.get().create(blockPos, blockState); + return OccultismBlockEntities.SACRIFICIAL_BOWL.get().create(blockPos, blockState); } } diff --git a/src/main/java/com/klikli_dev/occultism/common/block/SpiritFireBlock.java b/src/main/java/com/klikli_dev/occultism/common/block/SpiritFireBlock.java index c071f7fdf..79eba7177 100644 --- a/src/main/java/com/klikli_dev/occultism/common/block/SpiritFireBlock.java +++ b/src/main/java/com/klikli_dev/occultism/common/block/SpiritFireBlock.java @@ -27,6 +27,7 @@ import com.klikli_dev.occultism.registry.OccultismRecipes; import com.klikli_dev.occultism.registry.OccultismSounds; import com.klikli_dev.occultism.util.Math3DUtil; +import com.mojang.serialization.MapCodec; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.sounds.SoundSource; @@ -41,16 +42,24 @@ import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.BaseFireBlock; import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.FireBlock; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.Vec3; import java.util.Optional; public class SpiritFireBlock extends BaseFireBlock { + + public static final MapCodec CODEC = simpleCodec(SpiritFireBlock::new); public SpiritFireBlock(Properties properties) { super(properties, 0); } + @Override + protected MapCodec codec() { + return CODEC; + } + public BlockState getStateForPlacement(BlockPlaceContext pContext) { return this.defaultBlockState(); } @@ -66,13 +75,13 @@ public void entityInside(BlockState pState, Level pLevel, BlockPos pPos, Entity ItemStackFakeInventory fakeInventory = new ItemStackFakeInventory(ItemStack.EMPTY); fakeInventory.setItem(0, item.getItem()); - Optional recipe = + var recipe = pLevel.getRecipeManager().getRecipeFor(OccultismRecipes.SPIRIT_FIRE_TYPE.get(), fakeInventory, pLevel); if (recipe.isPresent()) { item.remove(RemovalReason.DISCARDED); - ItemStack result = recipe.get().assemble(fakeInventory, pLevel.registryAccess()); + ItemStack result = recipe.get().value().assemble(fakeInventory, pLevel.registryAccess()); Vec3 center = Math3DUtil.center(pPos); Containers.dropItemStack(pLevel, center.x, center.y + 0.5, center.z, result); diff --git a/src/main/java/com/klikli_dev/occultism/common/block/SpiritTorchBlock.java b/src/main/java/com/klikli_dev/occultism/common/block/SpiritTorchBlock.java index 9e780d0ab..6ceaf2f6f 100644 --- a/src/main/java/com/klikli_dev/occultism/common/block/SpiritTorchBlock.java +++ b/src/main/java/com/klikli_dev/occultism/common/block/SpiritTorchBlock.java @@ -22,25 +22,28 @@ package com.klikli_dev.occultism.common.block; -import com.klikli_dev.occultism.registry.OccultismParticles; import net.minecraft.core.BlockPos; -import net.minecraft.core.particles.ParticleTypes; +import net.minecraft.core.particles.SimpleParticleType; import net.minecraft.util.RandomSource; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.TorchBlock; import net.minecraft.world.level.block.state.BlockState; +import java.util.function.Supplier; + public class SpiritTorchBlock extends TorchBlock { - public SpiritTorchBlock(Properties pProperties) { - super(pProperties, null); + + Supplier particleType; + public SpiritTorchBlock(Supplier particleType, Properties pProperties) { + super(null, pProperties); + this.particleType = particleType; } @Override - public void animateTick(BlockState pState, Level pLevel, BlockPos pPos, RandomSource pRand) { - double d0 = (double) pPos.getX() + 0.5D; - double d1 = (double) pPos.getY() + 0.7D; - double d2 = (double) pPos.getZ() + 0.5D; - pLevel.addParticle(ParticleTypes.SMOKE, d0, d1, d2, 0.0D, 0.0D, 0.0D); - pLevel.addParticle(OccultismParticles.SPIRIT_FIRE_FLAME.get(), d0, d1, d2, 0.0D, 0.0D, 0.0D); + public void animateTick(BlockState pState, Level pLevel, BlockPos pPos, RandomSource pRandom) { + if(this.flameParticle == null){ + this.flameParticle = this.particleType.get(); + } + super.animateTick(pState, pLevel, pPos, pRandom); } } diff --git a/src/main/java/com/klikli_dev/occultism/common/block/SpiritWallTorchBlock.java b/src/main/java/com/klikli_dev/occultism/common/block/SpiritWallTorchBlock.java index dced51460..2c51391d0 100644 --- a/src/main/java/com/klikli_dev/occultism/common/block/SpiritWallTorchBlock.java +++ b/src/main/java/com/klikli_dev/occultism/common/block/SpiritWallTorchBlock.java @@ -22,30 +22,28 @@ package com.klikli_dev.occultism.common.block; -import com.klikli_dev.occultism.registry.OccultismParticles; import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.core.particles.ParticleTypes; +import net.minecraft.core.particles.SimpleParticleType; import net.minecraft.util.RandomSource; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.WallTorchBlock; import net.minecraft.world.level.block.state.BlockState; +import java.util.function.Supplier; + public class SpiritWallTorchBlock extends WallTorchBlock { - public SpiritWallTorchBlock(Properties pProperties) { - super(pProperties, null); + + Supplier particleType; + public SpiritWallTorchBlock(Supplier particleType, Properties pProperties) { + super(null, pProperties); + this.particleType = particleType; } @Override - public void animateTick(BlockState pState, Level pLevel, BlockPos pPos, RandomSource pRand) { - Direction direction = pState.getValue(FACING); - double d0 = (double) pPos.getX() + 0.5D; - double d1 = (double) pPos.getY() + 0.7D; - double d2 = (double) pPos.getZ() + 0.5D; - double d3 = 0.22D; - double d4 = 0.27D; - Direction direction1 = direction.getOpposite(); - pLevel.addParticle(ParticleTypes.SMOKE, d0 + 0.27D * (double) direction1.getStepX(), d1 + 0.22D, d2 + 0.27D * (double) direction1.getStepZ(), 0.0D, 0.0D, 0.0D); - pLevel.addParticle(OccultismParticles.SPIRIT_FIRE_FLAME.get(), d0 + 0.27D * (double) direction1.getStepX(), d1 + 0.22D, d2 + 0.27D * (double) direction1.getStepZ(), 0.0D, 0.0D, 0.0D); + public void animateTick(BlockState pState, Level pLevel, BlockPos pPos, RandomSource pRandom) { + if(this.flameParticle == null){ + this.flameParticle = this.particleType.get(); + } + super.animateTick(pState, pLevel, pPos, pRandom); } } diff --git a/src/main/java/com/klikli_dev/occultism/common/block/otherworld/IesniumOreNaturalBlock.java b/src/main/java/com/klikli_dev/occultism/common/block/otherworld/IesniumOreNaturalBlock.java index 2feb30a9e..ae1d9c4bb 100644 --- a/src/main/java/com/klikli_dev/occultism/common/block/otherworld/IesniumOreNaturalBlock.java +++ b/src/main/java/com/klikli_dev/occultism/common/block/otherworld/IesniumOreNaturalBlock.java @@ -30,6 +30,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.entity.BlockEntity; @@ -74,7 +75,7 @@ public String getDescriptionId() { @Override @SuppressWarnings("deprecation") - public ItemStack getCloneItemStack(BlockGetter worldIn, BlockPos pos, BlockState state) { + public ItemStack getCloneItemStack(LevelReader worldIn, BlockPos pos, BlockState state) { return IOtherworldBlock.super.getItem(worldIn, pos, state); } diff --git a/src/main/java/com/klikli_dev/occultism/common/block/otherworld/OtherstoneNaturalBlock.java b/src/main/java/com/klikli_dev/occultism/common/block/otherworld/OtherstoneNaturalBlock.java index 09ead388f..ec56b8535 100644 --- a/src/main/java/com/klikli_dev/occultism/common/block/otherworld/OtherstoneNaturalBlock.java +++ b/src/main/java/com/klikli_dev/occultism/common/block/otherworld/OtherstoneNaturalBlock.java @@ -30,6 +30,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.entity.BlockEntity; @@ -72,9 +73,11 @@ public String getDescriptionId() { return "block.minecraft.andesite"; } + + @Override @SuppressWarnings("deprecation") - public ItemStack getCloneItemStack(BlockGetter worldIn, BlockPos pos, BlockState state) { + public ItemStack getCloneItemStack(LevelReader worldIn, BlockPos pos, BlockState state) { return IOtherworldBlock.super.getItem(worldIn, pos, state); } diff --git a/src/main/java/com/klikli_dev/occultism/common/block/otherworld/OtherworldLeavesNaturalBlock.java b/src/main/java/com/klikli_dev/occultism/common/block/otherworld/OtherworldLeavesNaturalBlock.java index bde886e89..0eaeacf4d 100644 --- a/src/main/java/com/klikli_dev/occultism/common/block/otherworld/OtherworldLeavesNaturalBlock.java +++ b/src/main/java/com/klikli_dev/occultism/common/block/otherworld/OtherworldLeavesNaturalBlock.java @@ -29,6 +29,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.LeavesBlock; @@ -76,7 +77,7 @@ public String getDescriptionId() { @Override @SuppressWarnings("deprecation") - public ItemStack getCloneItemStack(BlockGetter worldIn, BlockPos pos, BlockState state) { + public ItemStack getCloneItemStack(LevelReader worldIn, BlockPos pos, BlockState state) { return IOtherworldBlock.super.getItem(worldIn, pos, state); } diff --git a/src/main/java/com/klikli_dev/occultism/common/block/otherworld/OtherworldLogNaturalBlock.java b/src/main/java/com/klikli_dev/occultism/common/block/otherworld/OtherworldLogNaturalBlock.java index 7d605ca17..95f1a9e46 100644 --- a/src/main/java/com/klikli_dev/occultism/common/block/otherworld/OtherworldLogNaturalBlock.java +++ b/src/main/java/com/klikli_dev/occultism/common/block/otherworld/OtherworldLogNaturalBlock.java @@ -29,6 +29,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.RotatedPillarBlock; @@ -75,7 +76,7 @@ public String getDescriptionId() { @Override @SuppressWarnings("deprecation") - public ItemStack getCloneItemStack(BlockGetter worldIn, BlockPos pos, BlockState state) { + public ItemStack getCloneItemStack(LevelReader worldIn, BlockPos pos, BlockState state) { return IOtherworldBlock.super.getItem(worldIn, pos, state); } diff --git a/src/main/java/com/klikli_dev/occultism/common/block/otherworld/OtherworldSaplingBlock.java b/src/main/java/com/klikli_dev/occultism/common/block/otherworld/OtherworldSaplingBlock.java index cccd9f58e..b71b4378f 100644 --- a/src/main/java/com/klikli_dev/occultism/common/block/otherworld/OtherworldSaplingBlock.java +++ b/src/main/java/com/klikli_dev/occultism/common/block/otherworld/OtherworldSaplingBlock.java @@ -22,11 +22,17 @@ package com.klikli_dev.occultism.common.block.otherworld; +import com.klikli_dev.occultism.datagen.worldgen.ConfiguredFeatures; import net.minecraft.world.level.block.SaplingBlock; -import net.minecraft.world.level.block.grower.AbstractTreeGrower; +import net.minecraft.world.level.block.grower.TreeGrower; + +import java.util.Optional; public class OtherworldSaplingBlock extends SaplingBlock { - public OtherworldSaplingBlock(AbstractTreeGrower tree, Properties properties) { - super(tree, properties); + + public static final TreeGrower TREE_GROWER = new TreeGrower("otherworld", Optional.empty(), Optional.of(ConfiguredFeatures.TREE_OTHERWORLD), Optional.empty()); + + public OtherworldSaplingBlock(Properties properties) { + super(TREE_GROWER, properties); } } diff --git a/src/main/java/com/klikli_dev/occultism/common/block/otherworld/OtherworldSaplingNaturalBlock.java b/src/main/java/com/klikli_dev/occultism/common/block/otherworld/OtherworldSaplingNaturalBlock.java index 39bbf34c3..de86759a1 100644 --- a/src/main/java/com/klikli_dev/occultism/common/block/otherworld/OtherworldSaplingNaturalBlock.java +++ b/src/main/java/com/klikli_dev/occultism/common/block/otherworld/OtherworldSaplingNaturalBlock.java @@ -23,25 +23,31 @@ package com.klikli_dev.occultism.common.block.otherworld; import com.klikli_dev.occultism.api.common.data.OtherworldBlockTier; +import com.klikli_dev.occultism.datagen.worldgen.ConfiguredFeatures; import net.minecraft.core.BlockPos; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.SaplingBlock; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.grower.AbstractTreeGrower; +import net.minecraft.world.level.block.grower.TreeGrower; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; import javax.annotation.Nullable; +import java.util.Optional; public class OtherworldSaplingNaturalBlock extends SaplingBlock implements IOtherworldBlock { - public OtherworldSaplingNaturalBlock(AbstractTreeGrower tree, Properties properties) { - super(tree, properties); + public static final TreeGrower TREE_GROWER = new TreeGrower("otherworld_natural", Optional.empty(), Optional.of(ConfiguredFeatures.TREE_OTHERWORLD_NATURAL), Optional.empty()); + + + public OtherworldSaplingNaturalBlock(Properties properties) { + super(TREE_GROWER, properties); this.registerDefaultState(this.defaultBlockState().setValue(UNCOVERED, false)); } @@ -74,8 +80,8 @@ public String getDescriptionId() { @Override @SuppressWarnings("deprecation") - public ItemStack getCloneItemStack(BlockGetter worldIn, BlockPos pos, BlockState state) { - return IOtherworldBlock.super.getItem(worldIn, pos, state); + public ItemStack getCloneItemStack(LevelReader pLevel, BlockPos pPos, BlockState pState) { + return IOtherworldBlock.super.getItem(pLevel, pPos, pState); } @Override diff --git a/src/main/java/com/klikli_dev/occultism/common/block/storage/StableWormholeBlock.java b/src/main/java/com/klikli_dev/occultism/common/block/storage/StableWormholeBlock.java index f9a6fbb08..08362b02c 100644 --- a/src/main/java/com/klikli_dev/occultism/common/block/storage/StableWormholeBlock.java +++ b/src/main/java/com/klikli_dev/occultism/common/block/storage/StableWormholeBlock.java @@ -27,7 +27,7 @@ import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.common.blockentity.StableWormholeBlockEntity; import com.klikli_dev.occultism.common.container.storage.StorageControllerContainerBase; -import com.klikli_dev.occultism.registry.OccultismTiles; +import com.klikli_dev.occultism.registry.OccultismBlockEntities; import com.klikli_dev.occultism.util.BlockEntityUtil; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -39,6 +39,7 @@ import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.EntityBlock; import net.minecraft.world.level.block.entity.BlockEntity; @@ -52,8 +53,6 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -import net.minecraftforge.network.NetworkHooks; - import javax.annotation.Nullable; import java.util.Map; import java.util.stream.Stream; @@ -230,8 +229,8 @@ public InteractionResult use(BlockState state, Level level, BlockPos pos, Player if (!level.isClientSide) { BlockEntity blockEntity = level.getBlockEntity(pos); if (blockEntity instanceof StableWormholeBlockEntity wormhole && StorageControllerContainerBase.canOpen(player, pos)) { - if (wormhole.getLinkedStorageController() != null) { - NetworkHooks.openScreen((ServerPlayer) player, wormhole, pos); + if (wormhole.getLinkedStorageController() != null && player instanceof ServerPlayer serverPlayer) { + serverPlayer.openMenu(wormhole, pos); StorageControllerContainerBase.reserve(player, pos); } else { level.setBlock(pos, state.setValue(LINKED, false), 2); @@ -254,7 +253,7 @@ public BlockState getStateForPlacement(BlockPlaceContext context) { @Override @SuppressWarnings("deprecation") - public ItemStack getCloneItemStack(BlockGetter worldIn, BlockPos pos, BlockState state) { + public ItemStack getCloneItemStack(LevelReader worldIn, BlockPos pos, BlockState state) { return BlockEntityUtil.getItemWithNbt(this, worldIn, pos); } @@ -267,7 +266,7 @@ protected void createBlockStateDefinition(StateDefinition.Builder inputHandler = LazyOptional.of(() -> new ItemStackHandler(1) { + public ItemStackHandler inputHandler =new ItemStackHandler(1) { @Override protected void onContentsChanged(int slot) { DimensionalMineshaftBlockEntity.this.setChanged(); } - }); - public LazyOptional outputHandler = LazyOptional.of(() -> new ItemStackHandler(9) { + }; + + public ItemStackHandler outputHandler = new ItemStackHandler(9) { @Override protected void onContentsChanged(int slot) { DimensionalMineshaftBlockEntity.this.setChanged(); } - }); - public LazyOptional combinedHandler = - LazyOptional - .of(() -> new CombinedInvWrapper(this.inputHandler.orElseThrow(ItemHandlerMissingException::new), - this.outputHandler.orElseThrow(ItemHandlerMissingException::new))); + }; + + public CombinedInvWrapper combinedHandler = new CombinedInvWrapper(this.inputHandler, this.outputHandler); public int miningTime; public int maxMiningTime = 0; public int rollsPerOperation = 0; @@ -95,7 +91,7 @@ protected void onContentsChanged(int slot) { protected List possibleResults; public DimensionalMineshaftBlockEntity(BlockPos worldPos, BlockState state) { - super(OccultismTiles.DIMENSIONAL_MINESHAFT.get(), worldPos, state); + super(OccultismBlockEntities.DIMENSIONAL_MINESHAFT.get(), worldPos, state); } //region Static Methods @@ -121,36 +117,21 @@ public static int getRollsPerOperation(ItemStack stack) { @Override public Component getDisplayName() { - return Component.literal(ForgeRegistries.BLOCK_ENTITY_TYPES.getKey(this.getType()).getPath()); + return Component.literal(BuiltInRegistries.BLOCK_ENTITY_TYPE.getKey(this.getType()).getPath()); } - @Nonnull - @Override - public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction direction) { - if (cap == ForgeCapabilities.ITEM_HANDLER) { - if (direction == null) { - //null is full access for machines or similar. - return this.combinedHandler.cast(); - } else if (direction == Direction.UP) { - return this.inputHandler.cast(); - } else { - return this.outputHandler.cast(); - } - } - return super.getCapability(cap, direction); - } @Override public void load(CompoundTag compound) { super.load(compound); - this.inputHandler.ifPresent((handler) -> handler.deserializeNBT(compound.getCompound("inputHandler"))); - this.outputHandler.ifPresent((handler) -> handler.deserializeNBT(compound.getCompound("outputHandler"))); + inputHandler.deserializeNBT(compound.getCompound("inputHandler")); + outputHandler.deserializeNBT(compound.getCompound("outputHandler")); } @Override protected void saveAdditional(CompoundTag compound) { - this.inputHandler.ifPresent(handler -> compound.put("inputHandler", handler.serializeNBT())); - this.outputHandler.ifPresent(handler -> compound.put("outputHandler", handler.serializeNBT())); + compound.put("inputHandler", inputHandler.serializeNBT()); + compound.put("outputHandler", outputHandler.serializeNBT()); super.saveAdditional(compound); } @@ -168,23 +149,16 @@ public CompoundTag saveNetwork(CompoundTag compound) { return super.saveNetwork(compound); } - @Override - public void setRemoved() { - this.inputHandler.invalidate(); - this.outputHandler.invalidate(); - super.setRemoved(); - } public void tick() { if (!this.level.isClientSide) { - IItemHandler inputHandler = this.inputHandler.orElseThrow(ItemHandlerMissingException::new); ItemStack input = inputHandler.getStackInSlot(0); //handle unusing enchantment from evilcraft, see https://github.com/klikli-dev/occultism/issues/909 if (input.getMaxDamage() - input.getDamageValue() < 6 && input.isEnchanted() && - ForgeRegistries.ENCHANTMENTS.containsKey(EVILCRAFT_UNUSING_ENCHANTEMENT) && - input.getEnchantmentLevel(ForgeRegistries.ENCHANTMENTS.getValue(EVILCRAFT_UNUSING_ENCHANTEMENT)) > 0) { + BuiltInRegistries.ENCHANTMENT.containsKey(EVILCRAFT_UNUSING_ENCHANTEMENT) && + input.getEnchantmentLevel(BuiltInRegistries.ENCHANTMENT.get(EVILCRAFT_UNUSING_ENCHANTEMENT)) > 0) { this.miningTime = 0; return; } @@ -237,17 +211,15 @@ public AbstractContainerMenu createMenu(int id, Inventory playerInventory, Playe //endregion Static Methods public void mine() { - ItemStackHandler inputHandler = this.inputHandler.orElseThrow(ItemHandlerMissingException::new); - ItemStackHandler outputHandler = this.outputHandler.orElseThrow(ItemHandlerMissingException::new); if (this.possibleResults == null) { - List recipes = this.level.getRecipeManager() + List> recipes = this.level.getRecipeManager() .getRecipesFor(OccultismRecipes.MINER_TYPE.get(), new RecipeWrapper(inputHandler), this.level); if (recipes == null || recipes.size() == 0) { this.possibleResults = new ArrayList<>(); } else { - this.possibleResults = recipes.stream().map(r -> r.getWeightedOutput()).collect(Collectors.toList()); + this.possibleResults = recipes.stream().map(r -> r.value().getWeightedOutput()).collect(Collectors.toList()); } } @@ -271,13 +243,4 @@ public void mine() { input.setDamageValue(0); } } - - @Override - public void invalidateCaps() { - super.invalidateCaps(); - this.inputHandler.invalidate(); - this.outputHandler.invalidate(); - this.combinedHandler.invalidate(); - } - } diff --git a/src/main/java/com/klikli_dev/occultism/common/blockentity/GoldenSacrificialBowlBlockEntity.java b/src/main/java/com/klikli_dev/occultism/common/blockentity/GoldenSacrificialBowlBlockEntity.java index b6b25ffd2..905c85c5e 100644 --- a/src/main/java/com/klikli_dev/occultism/common/blockentity/GoldenSacrificialBowlBlockEntity.java +++ b/src/main/java/com/klikli_dev/occultism/common/blockentity/GoldenSacrificialBowlBlockEntity.java @@ -30,10 +30,9 @@ import com.klikli_dev.occultism.common.item.spirit.BookOfBindingItem; import com.klikli_dev.occultism.common.ritual.Ritual; import com.klikli_dev.occultism.crafting.recipe.RitualRecipe; -import com.klikli_dev.occultism.exceptions.ItemHandlerMissingException; +import com.klikli_dev.occultism.registry.OccultismBlockEntities; import com.klikli_dev.occultism.registry.OccultismParticles; import com.klikli_dev.occultism.registry.OccultismRecipes; -import com.klikli_dev.occultism.registry.OccultismTiles; import com.klikli_dev.occultism.util.EntityUtil; import com.mojang.datafixers.util.Pair; import net.minecraft.Util; @@ -47,38 +46,34 @@ import net.minecraft.network.chat.MutableComponent; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerLevel; +import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.Containers; import net.minecraft.world.InteractionHand; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; -import net.minecraft.world.item.crafting.Recipe; +import net.minecraft.world.item.crafting.RecipeHolder; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Rotation; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; -import net.minecraftforge.event.entity.player.PlayerInteractEvent.RightClickItem; -import net.minecraftforge.items.IItemHandler; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import net.neoforged.neoforge.common.NeoForge; +import net.neoforged.neoforge.event.entity.living.LivingDeathEvent; +import net.neoforged.neoforge.event.entity.player.PlayerInteractEvent; +import net.neoforged.neoforge.event.entity.player.PlayerInteractEvent.RightClickItem; +import net.neoforged.neoforge.items.IItemHandler; + import java.util.*; import java.util.Map.Entry; import java.util.function.Consumer; public class GoldenSacrificialBowlBlockEntity extends SacrificialBowlBlockEntity { - public RitualRecipe currentRitualRecipe; + public RecipeHolder currentRitualRecipe; public ResourceLocation currentRitualRecipeId; public UUID castingPlayerId; - public Player castingPlayer; + public ServerPlayer castingPlayer; public List remainingAdditionalIngredients = new ArrayList<>(); public List consumedIngredients = new ArrayList<>(); public boolean sacrificeProvided; @@ -90,7 +85,7 @@ public class GoldenSacrificialBowlBlockEntity extends SacrificialBowlBlockEntity public GoldenSacrificialBowlBlockEntity(BlockPos worldPos, BlockState state) { - super(OccultismTiles.GOLDEN_SACRIFICIAL_BOWL.get(), worldPos, state); + super(OccultismBlockEntities.GOLDEN_SACRIFICIAL_BOWL.get(), worldPos, state); this.rightClickItemListener = this::onPlayerRightClickItem; this.livingDeathEventListener = this::onLivingDeath; @@ -102,7 +97,7 @@ private static boolean helpWithPentacle(Level level, BlockPos pos, Player player Map bestPentacleDiff = null; var pentacleMultiblocks = level.getRecipeManager().getAllRecipesFor(OccultismRecipes.RITUAL_TYPE.get()) - .stream().map(RitualRecipe::getPentacleId).distinct().map(ModonomiconAPI.get()::getMultiblock).toList(); + .stream().map(r -> r.value().getPentacleId()).distinct().map(ModonomiconAPI.get()::getMultiblock).toList(); Multiblock bestMatch = null; for (var pentacle : pentacleMultiblocks) { @@ -143,13 +138,13 @@ private static MutableComponent pentacleDiffToComponent(Map bes } // If we find ritual with ingredients that almost matches bowls, then print help - private static boolean helpWithRitual(Level level, BlockPos pos, Player player, ItemStack activationItem) { + private static boolean helpWithRitual(Level level, BlockPos pos, ServerPlayer player, ItemStack activationItem) { List ritualDiff = null; List bestRitualDiff = null; RitualRecipe bestRitual = null; var pentacleMultiblocks = level.getRecipeManager().getAllRecipesFor(OccultismRecipes.RITUAL_TYPE.get()) - .stream().map(RitualRecipe::getPentacleId).distinct().map(ModonomiconAPI.get()::getMultiblock); + .stream().map(r -> r.value().getPentacleId()).distinct().map(ModonomiconAPI.get()::getMultiblock); var pentacle = pentacleMultiblocks.filter(p -> p.validate(level, pos) != null).findFirst(); @@ -157,12 +152,12 @@ private static boolean helpWithRitual(Level level, BlockPos pos, Player player, return false; - for (RitualRecipe recipe : level.getRecipeManager().getAllRecipesFor(OccultismRecipes.RITUAL_TYPE.get())) { - if (recipe.getPentacle() != pentacle.orElseThrow()) + for (var recipe : level.getRecipeManager().getAllRecipesFor(OccultismRecipes.RITUAL_TYPE.get())) { + if (recipe.value().getPentacle() != pentacle.orElseThrow()) continue; - ritualDiff = new ArrayList<>(recipe.getIngredients()); - List items = recipe.getRitual().getItemsOnSacrificialBowls(level, pos); + ritualDiff = new ArrayList<>(recipe.value().getIngredients()); + List items = recipe.value().getRitual().getItemsOnSacrificialBowls(level, pos); boolean found = false; for (int i = ritualDiff.size() - 1; i >= 0; i--) { @@ -180,13 +175,13 @@ private static boolean helpWithRitual(Level level, BlockPos pos, Player player, if (bestRitualDiff == null || bestRitualDiff.size() > ritualDiff.size()) { bestRitualDiff = ritualDiff; - bestRitual = recipe; + bestRitual = recipe.value(); } } if (bestRitualDiff != null && !bestRitualDiff.isEmpty() && bestRitualDiff.size() < 4) { player.displayClientMessage( - Component.translatable("ritual." + Occultism.MODID + ".ritual_help", Component.translatable(bestRitual.getRitual().getStartedMessage()), ritualDiffToComponent(bestRitualDiff)), + Component.translatable("ritual." + Occultism.MODID + ".ritual_help", Component.translatable(bestRitual.getRitual().getStartedMessage(player)), ritualDiffToComponent(bestRitualDiff)), false); return true; @@ -234,14 +229,14 @@ public static Map getDifference(Multiblock multiblock, Level le return minDifference; } - public RitualRecipe getCurrentRitualRecipe() { + public RecipeHolder getCurrentRitualRecipe() { if (this.currentRitualRecipeId != null) { if (this.level != null) { - Optional> recipe = this.level.getRecipeManager().byKey(this.currentRitualRecipeId); - recipe.map(r -> (RitualRecipe) r).ifPresent(r -> this.currentRitualRecipe = r); + var recipe = this.level.getRecipeManager().byKey(this.currentRitualRecipeId); + recipe.map(r -> (RecipeHolder) r).ifPresent(r -> this.currentRitualRecipe = r); - MinecraftForge.EVENT_BUS.addListener(this.rightClickItemListener); - MinecraftForge.EVENT_BUS.addListener(this.livingDeathEventListener); + NeoForge.EVENT_BUS.addListener(this.rightClickItemListener); + NeoForge.EVENT_BUS.addListener(this.livingDeathEventListener); this.currentRitualRecipeId = null; } @@ -250,7 +245,7 @@ public RitualRecipe getCurrentRitualRecipe() { } public void tick() { - RitualRecipe recipe = this.getCurrentRitualRecipe(); + RecipeHolder recipe = this.getCurrentRitualRecipe(); if (!this.level.isClientSide && recipe != null) { this.restoreCastingPlayer(); @@ -264,8 +259,8 @@ public void tick() { } //if we ever have a ritual that depends on casting player for validity, we need to rework this //to involve casting player id with some good pre-check - IItemHandler handler = this.itemStackHandler.orElseThrow(ItemHandlerMissingException::new); - if (!recipe.getRitual().isValid(this.level, this.getBlockPos(), this, this.castingPlayer, + IItemHandler handler = this.itemStackHandler; + if (!recipe.value().getRitual().isValid(this.level, this.getBlockPos(), this, this.castingPlayer, handler.getStackInSlot(0), this.remainingAdditionalIngredients)) { //ritual is no longer valid, so interrupt this.stopRitual(false); @@ -307,12 +302,12 @@ public void tick() { this.currentTime++; recipe - .getRitual() + .value().getRitual() .update(this.level, this.getBlockPos(), this, this.castingPlayer, handler.getStackInSlot(0), this.currentTime); if (!recipe - .getRitual() + .value().getRitual() .consumeAdditionalIngredients(this.level, this.getBlockPos(), this.remainingAdditionalIngredients, this.currentTime, this.consumedIngredients)) { //if ingredients cannot be found, interrupt @@ -320,7 +315,7 @@ public void tick() { return; } - if (recipe.getDuration() >= 0 && this.currentTime >= recipe.getDuration()) + if (recipe.value().getDuration() >= 0 && this.currentTime >= recipe.value().getDuration()) this.stopRitual(true); } } @@ -336,7 +331,7 @@ public void restoreCastingPlayer() { } public boolean activate(Level level, BlockPos pos, Player player, InteractionHand hand, Direction face) { - if (!level.isClientSide) { + if (!level.isClientSide && player instanceof ServerPlayer serverPlayer) { ItemStack activationItem = player.getItemInHand(hand); if (activationItem == ItemStack.EMPTY) return false; @@ -350,17 +345,17 @@ public boolean activate(Level level, BlockPos pos, Player player, InteractionHan if (this.getCurrentRitualRecipe() == null) { //Identify the ritual in the ritual registry. - RitualRecipe ritualRecipe = this.level.getRecipeManager().getAllRecipesFor(OccultismRecipes.RITUAL_TYPE.get()).stream().filter( - r -> r.matches(level, pos, activationItem) + var ritualRecipe = this.level.getRecipeManager().getAllRecipesFor(OccultismRecipes.RITUAL_TYPE.get()).stream().filter( + r -> r.value().matches(level, pos, activationItem) ).findFirst().orElse(null); if (ritualRecipe != null) { - if (ritualRecipe.getRitual().isValid(level, pos, this, player, activationItem, - ritualRecipe.getIngredients())) { - this.startRitual(player, activationItem, ritualRecipe); + if (ritualRecipe.value().getRitual().isValid(level, pos, this, player, activationItem, + ritualRecipe.value().getIngredients())) { + this.startRitual(serverPlayer, activationItem, ritualRecipe); } else { //if ritual is not valid, inform player. - player.displayClientMessage(Component.translatable(ritualRecipe.getRitual().getConditionsMessage()), true); + player.displayClientMessage(Component.translatable(ritualRecipe.value().getRitual().getConditionsMessage(serverPlayer)), true); return false; } } else { @@ -371,7 +366,7 @@ public boolean activate(Level level, BlockPos pos, Player player, InteractionHan false); } else { if (!helpWithPentacle(level, pos, player)) { - if (!helpWithRitual(level, pos, player, activationItem)) { + if (!helpWithRitual(level, pos, serverPlayer, activationItem)) { player.displayClientMessage( Component.translatable(String.format("ritual.%s.does_not_exist", Occultism.MODID)), false); @@ -387,7 +382,7 @@ public boolean activate(Level level, BlockPos pos, Player player, InteractionHan return true; } - public void startRitual(Player player, ItemStack activationItem, RitualRecipe ritualRecipe) { + public void startRitual(ServerPlayer player, ItemStack activationItem, RecipeHolder ritualRecipe) { if (!this.level.isClientSide) { this.currentRitualRecipe = ritualRecipe; this.castingPlayerId = player.getUUID(); @@ -396,15 +391,15 @@ public void startRitual(Player player, ItemStack activationItem, RitualRecipe ri this.sacrificeProvided = false; this.itemUseProvided = false; this.consumedIngredients.clear(); - this.remainingAdditionalIngredients = new ArrayList<>(this.currentRitualRecipe.getIngredients()); + this.remainingAdditionalIngredients = new ArrayList<>(this.currentRitualRecipe.value().getIngredients()); //place activation item in handler - IItemHandler handler = this.itemStackHandler.orElseThrow(ItemHandlerMissingException::new); + IItemHandler handler = this.itemStackHandler; handler.insertItem(0, activationItem.split(1), false); - this.currentRitualRecipe.getRitual().start(this.level, this.getBlockPos(), this, player, handler.getStackInSlot(0)); + this.currentRitualRecipe.value().getRitual().start(this.level, this.getBlockPos(), this, player, handler.getStackInSlot(0)); - MinecraftForge.EVENT_BUS.addListener(this.rightClickItemListener); - MinecraftForge.EVENT_BUS.addListener(this.livingDeathEventListener); + NeoForge.EVENT_BUS.addListener(this.rightClickItemListener); + NeoForge.EVENT_BUS.addListener(this.livingDeathEventListener); this.setChanged(); this.markNetworkDirty(); @@ -415,14 +410,14 @@ public void startRitual(Player player, ItemStack activationItem, RitualRecipe ri public void stopRitual(boolean finished) { if (!this.level.isClientSide) { - RitualRecipe recipe = this.getCurrentRitualRecipe(); + var recipe = this.getCurrentRitualRecipe(); if (recipe != null && this.castingPlayer != null) { - IItemHandler handler = this.itemStackHandler.orElseThrow(ItemHandlerMissingException::new); + IItemHandler handler = this.itemStackHandler; if (finished) { ItemStack activationItem = handler.getStackInSlot(0); - recipe.getRitual().finish(this.level, this.getBlockPos(), this, this.castingPlayer, activationItem); + recipe.value().getRitual().finish(this.level, this.getBlockPos(), this, this.castingPlayer, activationItem); } else { - recipe.getRitual().interrupt(this.level, this.getBlockPos(), this, this.castingPlayer, + recipe.value().getRitual().interrupt(this.level, this.getBlockPos(), this, this.castingPlayer, handler.getStackInSlot(0)); //Pop activation item back into level Containers.dropItemStack(this.level, this.getBlockPos().getX(), this.getBlockPos().getY(), this.getBlockPos().getZ(), @@ -439,8 +434,8 @@ public void stopRitual(boolean finished) { this.remainingAdditionalIngredients.clear(); this.consumedIngredients.clear(); - MinecraftForge.EVENT_BUS.unregister(this.rightClickItemListener); - MinecraftForge.EVENT_BUS.unregister(this.livingDeathEventListener); + NeoForge.EVENT_BUS.unregister(this.rightClickItemListener); + NeoForge.EVENT_BUS.unregister(this.livingDeathEventListener); this.setChanged(); this.markNetworkDirty(); @@ -448,11 +443,11 @@ public void stopRitual(boolean finished) { } public boolean sacrificeFulfilled() { - return !this.getCurrentRitualRecipe().requiresSacrifice() || this.sacrificeProvided; + return !this.getCurrentRitualRecipe().value().requiresSacrifice() || this.sacrificeProvided; } public boolean itemUseFulfilled() { - return !this.getCurrentRitualRecipe().requiresItemUse() || this.itemUseProvided; + return !this.getCurrentRitualRecipe().value().requiresItemUse() || this.itemUseProvided; } public void notifySacrifice(LivingEntity entityLivingBase) { @@ -468,29 +463,20 @@ public void onPlayerRightClickItem(PlayerInteractEvent.RightClickItem event) { if (!player.level().isClientSide && this.getCurrentRitualRecipe() != null) { if (this.getBlockPos().distSqr(event.getPos()) <= Ritual.ITEM_USE_DETECTION_RANGE_SQUARE) { - if (this.getCurrentRitualRecipe().getRitual().isValidItemUse(event)) { + if (this.getCurrentRitualRecipe().value().getRitual().isValidItemUse(event)) { this.notifyItemUse(event); } } } } - @Nonnull - @Override - public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction direction) { - if (cap == ForgeCapabilities.ITEM_HANDLER) { - return LazyOptional.empty(); - } - return super.getCapability(cap, direction); - } - public void onLivingDeath(LivingDeathEvent event) { LivingEntity entityLivingBase = event.getEntity(); if (!entityLivingBase.level().isClientSide && this.getCurrentRitualRecipe() != null) { //Limit to player kills if (event.getSource().getEntity() instanceof Player) { if (this.getBlockPos().distSqr(entityLivingBase.blockPosition()) <= Ritual.SACRIFICE_DETECTION_RANGE_SQUARE) { - if (this.getCurrentRitualRecipe().getRitual().isValidSacrifice(entityLivingBase)) { + if (this.getCurrentRitualRecipe().value().getRitual().isValidSacrifice(entityLivingBase)) { this.notifySacrifice(entityLivingBase); } } @@ -505,9 +491,9 @@ protected void restoreRemainingAdditionalIngredients() { } else { if (this.consumedIngredients.size() > 0) { this.remainingAdditionalIngredients = Ritual.getRemainingAdditionalIngredients( - this.getCurrentRitualRecipe().getIngredients(), this.consumedIngredients); + this.getCurrentRitualRecipe().value().getIngredients(), this.consumedIngredients); } else { - this.remainingAdditionalIngredients = new ArrayList<>(this.getCurrentRitualRecipe().getIngredients()); + this.remainingAdditionalIngredients = new ArrayList<>(this.getCurrentRitualRecipe().value().getIngredients()); } } @@ -539,10 +525,10 @@ public void load(CompoundTag compound) { @Override protected void saveAdditional(CompoundTag compound) { if (this.getCurrentRitualRecipe() != null) { - if (this.consumedIngredients.size() > 0) { + if (!this.consumedIngredients.isEmpty()) { ListTag list = new ListTag(); for (ItemStack stack : this.consumedIngredients) { - list.add(stack.serializeNBT()); + list.add(stack.save(new CompoundTag())); } compound.put("consumedIngredients", list); } @@ -568,9 +554,9 @@ public void loadNetwork(CompoundTag compound) { @Override public CompoundTag saveNetwork(CompoundTag compound) { - RitualRecipe recipe = this.getCurrentRitualRecipe(); + var recipe = this.getCurrentRitualRecipe(); if (recipe != null) { - compound.putString("currentRitual", recipe.getId().toString()); + compound.putString("currentRitual", recipe.id().toString()); } if (this.castingPlayerId != null) { compound.putUUID("castingPlayerId", this.castingPlayerId); diff --git a/src/main/java/com/klikli_dev/occultism/common/blockentity/SacrificialBowlBlockEntity.java b/src/main/java/com/klikli_dev/occultism/common/blockentity/SacrificialBowlBlockEntity.java index 5e2e13c78..13c1d1e40 100644 --- a/src/main/java/com/klikli_dev/occultism/common/blockentity/SacrificialBowlBlockEntity.java +++ b/src/main/java/com/klikli_dev/occultism/common/blockentity/SacrificialBowlBlockEntity.java @@ -22,78 +22,55 @@ package com.klikli_dev.occultism.common.blockentity; -import com.klikli_dev.occultism.registry.OccultismTiles; +import com.klikli_dev.occultism.registry.OccultismBlockEntities; import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; 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.ItemStackHandler; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import net.neoforged.neoforge.items.ItemStackHandler; public class SacrificialBowlBlockEntity extends NetworkedBlockEntity { public long lastChangeTime; - public LazyOptional itemStackHandler = LazyOptional.of( - () -> new ItemStackHandler(1) { + public ItemStackHandler itemStackHandler = new ItemStackHandler(1) { - @Override - public int getSlotLimit(int slot) { - return 1; - } + @Override + public int getSlotLimit(int slot) { + return 1; + } - @Override - protected void onContentsChanged( - int slot) { - if (!SacrificialBowlBlockEntity.this.level.isClientSide) { - SacrificialBowlBlockEntity.this.lastChangeTime = SacrificialBowlBlockEntity.this.level - .getGameTime(); - SacrificialBowlBlockEntity.this.markNetworkDirty(); - } - } + @Override + protected void onContentsChanged( + int slot) { + if (!SacrificialBowlBlockEntity.this.level.isClientSide) { + SacrificialBowlBlockEntity.this.lastChangeTime = SacrificialBowlBlockEntity.this.level + .getGameTime(); + SacrificialBowlBlockEntity.this.markNetworkDirty(); + } + } - }); + }; protected boolean initialized = false; public SacrificialBowlBlockEntity(BlockPos worldPos, BlockState state) { - super(OccultismTiles.SACRIFICIAL_BOWL.get(), worldPos, state); + super(OccultismBlockEntities.SACRIFICIAL_BOWL.get(), worldPos, state); } public SacrificialBowlBlockEntity(BlockEntityType BlockEntityTypeIn, BlockPos worldPos, BlockState state) { super(BlockEntityTypeIn, worldPos, state); } - @Nonnull - @Override - public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction direction) { - if (cap == ForgeCapabilities.ITEM_HANDLER) { - return this.itemStackHandler.cast(); - } - return super.getCapability(cap, direction); - } @Override public void loadNetwork(CompoundTag compound) { - this.itemStackHandler.ifPresent((handler) -> handler.deserializeNBT(compound.getCompound("inventory"))); + this.itemStackHandler.deserializeNBT(compound.getCompound("inventory")); this.lastChangeTime = compound.getLong("lastChangeTime"); } @Override public CompoundTag saveNetwork(CompoundTag compound) { - this.itemStackHandler.ifPresent(handler -> compound.put("inventory", handler.serializeNBT())); + compound.put("inventory", this.itemStackHandler.serializeNBT()); compound.putLong("lastChangeTime", this.lastChangeTime); return compound; } - - @Override - public void invalidateCaps() { - super.invalidateCaps(); - this.itemStackHandler.invalidate(); - } - } diff --git a/src/main/java/com/klikli_dev/occultism/common/blockentity/StableWormholeBlockEntity.java b/src/main/java/com/klikli_dev/occultism/common/blockentity/StableWormholeBlockEntity.java index cdf99d4a5..3e57a6950 100644 --- a/src/main/java/com/klikli_dev/occultism/common/blockentity/StableWormholeBlockEntity.java +++ b/src/main/java/com/klikli_dev/occultism/common/blockentity/StableWormholeBlockEntity.java @@ -30,10 +30,10 @@ import com.klikli_dev.occultism.api.common.data.SortType; import com.klikli_dev.occultism.common.block.storage.StableWormholeBlock; import com.klikli_dev.occultism.common.container.storage.StableWormholeContainer; -import com.klikli_dev.occultism.registry.OccultismTiles; +import com.klikli_dev.occultism.registry.OccultismBlockEntities; import com.klikli_dev.occultism.util.BlockEntityUtil; import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.ListTag; import net.minecraft.nbt.Tag; @@ -45,10 +45,6 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.entity.BlockEntity; 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.registries.ForgeRegistries; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -64,7 +60,7 @@ public class StableWormholeBlockEntity extends NetworkedBlockEntity implements I protected SortType sortType = SortType.AMOUNT; public StableWormholeBlockEntity(BlockPos worldPos, BlockState state) { - super(OccultismTiles.STABLE_WORMHOLE.get(), worldPos, state); + super(OccultismBlockEntities.STABLE_WORMHOLE.get(), worldPos, state); } //region Getter / Setter @@ -106,7 +102,7 @@ public void setOrderStack(@Nonnull ItemStack orderStack) { @Override public Component getDisplayName() { - return Component.literal(ForgeRegistries.BLOCK_ENTITY_TYPES.getKey(this.getType()).getPath()); + return Component.literal(BuiltInRegistries.BLOCK_ENTITY_TYPE.getKey(this.getType()).getPath()); } @Override @@ -143,18 +139,6 @@ public void setLinkedStorageControllerPosition(GlobalBlockPos blockPos) { this.linkedStorageControllerPosition = blockPos; } - @Nonnull - @Override - public LazyOptional getCapability(@Nonnull Capability cap, Direction side) { - if (cap == ForgeCapabilities.ITEM_HANDLER) { - if (this.getLinkedStorageController() != null) { - return ((BlockEntity) this.getLinkedStorageController()).getCapability(cap, side); - } - } - return super.getCapability(cap, side); - } - - @Override public void loadNetwork(CompoundTag compound) { if (compound.contains("linkedStorageControllerPosition")) diff --git a/src/main/java/com/klikli_dev/occultism/common/blockentity/StorageControllerBlockEntity.java b/src/main/java/com/klikli_dev/occultism/common/blockentity/StorageControllerBlockEntity.java index cb45dd8e2..6471fa3a5 100644 --- a/src/main/java/com/klikli_dev/occultism/common/blockentity/StorageControllerBlockEntity.java +++ b/src/main/java/com/klikli_dev/occultism/common/blockentity/StorageControllerBlockEntity.java @@ -39,14 +39,15 @@ import com.klikli_dev.occultism.common.misc.DepositOrder; import com.klikli_dev.occultism.common.misc.ItemStackComparator; import com.klikli_dev.occultism.common.misc.StorageControllerItemStackHandler; -import com.klikli_dev.occultism.network.MessageUpdateStacks; +import com.klikli_dev.occultism.network.messages.MessageUpdateStacks; +import com.klikli_dev.occultism.registry.OccultismBlockEntities; import com.klikli_dev.occultism.registry.OccultismBlocks; import com.klikli_dev.occultism.registry.OccultismItems; -import com.klikli_dev.occultism.registry.OccultismTiles; import com.klikli_dev.occultism.util.EntityUtil; import com.klikli_dev.occultism.util.Math3DUtil; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.ListTag; import net.minecraft.nbt.Tag; @@ -61,13 +62,9 @@ import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.DirectionalBlock; 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.ItemHandlerHelper; -import net.minecraftforge.items.ItemStackHandler; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.neoforge.items.ItemHandlerHelper; +import net.neoforged.neoforge.items.ItemStackHandler; +import net.neoforged.neoforge.registries.DeferredBlock; import software.bernie.geckolib.animatable.GeoBlockEntity; import software.bernie.geckolib.core.animatable.instance.AnimatableInstanceCache; import software.bernie.geckolib.core.animation.AnimatableManager; @@ -88,21 +85,20 @@ public class StorageControllerBlockEntity extends NetworkedBlockEntity implement public static final int MAX_STABILIZER_DISTANCE = 5; - protected static final List> BLOCK_BLACKLIST = Stream.of( + protected static final List> BLOCK_BLACKLIST = Stream.of( OccultismBlocks.STORAGE_CONTROLLER).collect(Collectors.toList()); private final AnimatableInstanceCache animatableInstanceCache = GeckoLibUtil.createInstanceCache(this); public Map matrix = new HashMap<>(); public ItemStack orderStack = ItemStack.EMPTY; public Map linkedMachines = new HashMap<>(); public Map depositOrderSpirits = new HashMap<>(); - protected SortDirection sortDirection = SortDirection.DOWN; - protected SortType sortType = SortType.AMOUNT; - protected ItemStackHandler itemStackHandlerInternal = new StorageControllerItemStackHandler(this, + public ItemStackHandler itemStackHandler = new StorageControllerItemStackHandler(this, Occultism.SERVER_CONFIG.storage.controllerBaseSlots.get(), Occultism.SERVER_CONFIG.storage.controllerStackSize.get(), Occultism.SERVER_CONFIG.storage.overrideItemStackSizes.get() ); - protected LazyOptional itemStackHandler = LazyOptional.of(() -> this.itemStackHandlerInternal); + protected SortDirection sortDirection = SortDirection.DOWN; + protected SortType sortType = SortType.AMOUNT; protected int maxSlots = Occultism.SERVER_CONFIG.storage.controllerBaseSlots.get(); protected int usedSlots = 0; protected boolean stabilizersInitialized = false; @@ -110,7 +106,7 @@ public class StorageControllerBlockEntity extends NetworkedBlockEntity implement protected MessageUpdateStacks cachedMessageUpdateStacks; public StorageControllerBlockEntity(BlockPos worldPos, BlockState state) { - super(OccultismTiles.STORAGE_CONTROLLER.get(), worldPos, state); + super(OccultismBlockEntities.STORAGE_CONTROLLER.get(), worldPos, state); } public void tick() { @@ -185,7 +181,7 @@ protected void validateLinkedMachines() { } private List> getComparatorsSortedByAmount(Predicate comparator) { - var handler = this.itemStackHandlerInternal; + var handler = this.itemStackHandler; var map = new HashMap(); for (int i = 0; i < handler.getSlots(); i++) { var getStackInSlot = handler.getStackInSlot(i); @@ -206,7 +202,7 @@ private PlayState predicate(AnimationState event) @Override public Component getDisplayName() { - return Component.literal(ForgeRegistries.BLOCK_ENTITY_TYPES.getKey(this.getType()).getPath()); + return Component.literal(BuiltInRegistries.BLOCK_ENTITY_TYPE.getKey(this.getType()).getPath()); } @Override @@ -263,7 +259,7 @@ public void setSortType(SortType sortType) { @Override public List getStacks() { - ItemStackHandler handler = this.itemStackHandlerInternal; + ItemStackHandler handler = this.itemStackHandler; int size = handler.getSlots(); int usedSlots = 0; List result = new ArrayList<>(size); @@ -295,7 +291,7 @@ public int getMaxSlots() { @Override public void setMaxSlots(int slots) { this.maxSlots = slots; - this.itemStackHandlerInternal.setSize(this.maxSlots); + this.itemStackHandler.setSize(this.maxSlots); //force resync this.cachedMessageUpdateStacks = null; this.markNetworkDirty(); @@ -360,7 +356,7 @@ public void removeDepositOrderSpirit(GlobalBlockPos linkedMachinePosition) { @Override public boolean isBlacklisted(ItemStack stack) { if (stack.getItem() instanceof BlockItem itemBlock) { - return BLOCK_BLACKLIST.stream().map(RegistryObject::get).anyMatch(block -> itemBlock.getBlock() == block); + return BLOCK_BLACKLIST.stream().map(DeferredBlock::get).anyMatch(block -> itemBlock.getBlock() == block); } return stack.getItem() == OccultismItems.STORAGE_REMOTE.get(); @@ -371,7 +367,7 @@ public int insertStack(ItemStack stack, boolean simulate) { if (this.isBlacklisted(stack)) return stack.getCount(); - ItemStackHandler handler = this.itemStackHandlerInternal; + ItemStackHandler handler = this.itemStackHandler; if (ItemHandlerHelper.insertItem(handler, stack, true).getCount() < stack.getCount()) { stack = ItemHandlerHelper.insertItem(handler, stack, simulate); } @@ -387,7 +383,7 @@ public ItemStack getOneOfMostCommonItem(Predicate comparator, boolean var comparators = this.getComparatorsSortedByAmount(comparator); - ItemStackHandler handler = this.itemStackHandlerInternal; + ItemStackHandler handler = this.itemStackHandler; //we start with the comparator representing the most common item, and if we don't find anything we move on. //Note: unless something weird happens we should always find something. @@ -418,7 +414,7 @@ public ItemStack getItemStack(Predicate comparator, int requestedSize if (requestedSize <= 0 || comparator == null) { return ItemStack.EMPTY; } - ItemStackHandler handler = this.itemStackHandlerInternal; + ItemStackHandler handler = this.itemStackHandler; ItemStack firstMatchedStack = ItemStack.EMPTY; int remaining = requestedSize; for (int slot = 0; slot < handler.getSlots(); slot++) { @@ -472,7 +468,7 @@ public int getAvailableAmount(IItemStackComparator comparator) { return 0; } int totalCount = 0; - ItemStackHandler handler = this.itemStackHandlerInternal; + ItemStackHandler handler = this.itemStackHandler; int size = handler.getSlots(); for (int slot = 0; slot < size; slot++) { ItemStack stack = handler.getStackInSlot(slot); @@ -488,27 +484,6 @@ public void onContentsChanged() { this.setChanged(); } - @Override - public void invalidateCaps() { - super.invalidateCaps(); - this.itemStackHandler.invalidate(); - } - - @Override - public void reviveCaps() { - super.reviveCaps(); - this.itemStackHandler = LazyOptional.of(() -> this.itemStackHandlerInternal); - } - - @Nonnull - @Override - public LazyOptional getCapability(@Nonnull Capability cap, Direction direction) { - if (cap == ForgeCapabilities.ITEM_HANDLER) { - return this.itemStackHandler.cast(); - } - return super.getCapability(cap, direction); - } - @Override public void load(CompoundTag compound) { compound.remove("linkedMachines"); //linked machines are not saved, they self-register. @@ -516,7 +491,7 @@ public void load(CompoundTag compound) { //read stored items if (compound.contains("items")) { - this.itemStackHandlerInternal.deserializeNBT(compound.getCompound("items")); + this.itemStackHandler.deserializeNBT(compound.getCompound("items")); this.cachedMessageUpdateStacks = null; } } @@ -525,7 +500,7 @@ public void load(CompoundTag compound) { protected void saveAdditional(CompoundTag compound) { super.saveAdditional(compound); compound.remove("linkedMachines"); //linked machines are not saved, they self-register. - compound.put("items", this.itemStackHandlerInternal.serializeNBT()); + compound.put("items", this.itemStackHandler.serializeNBT()); } @Override diff --git a/src/main/java/com/klikli_dev/occultism/common/capability/DoubleJumpCapability.java b/src/main/java/com/klikli_dev/occultism/common/capability/DoubleJumpCapability.java deleted file mode 100644 index 7f64c2996..000000000 --- a/src/main/java/com/klikli_dev/occultism/common/capability/DoubleJumpCapability.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * MIT License - * - * Copyright 2020 klikli-dev - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and - * associated documentation files (the "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT - * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.klikli_dev.occultism.common.capability; - -import com.klikli_dev.occultism.registry.OccultismCapabilities; -import net.minecraft.core.Direction; -import net.minecraft.nbt.CompoundTag; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.ICapabilitySerializable; -import net.minecraftforge.common.util.INBTSerializable; -import net.minecraftforge.common.util.LazyOptional; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -public class DoubleJumpCapability implements INBTSerializable { - - private int jumps = 0; - - public DoubleJumpCapability() { - } - - //region Getter / Setter - public int getJumps() { - return this.jumps; - } - - public void setJumps(int i) { - this.jumps = i; - } - //endregion Getter / Setter - - public void addJump() { - this.jumps++; - } - - @Override - public CompoundTag serializeNBT() { - CompoundTag compound = new CompoundTag(); - compound.putInt("jumps", this.jumps); - return compound; - } - - @Override - public void deserializeNBT(CompoundTag nbt) { - this.jumps = nbt.getInt("jumps"); - } - - public static class Dispatcher implements ICapabilitySerializable { - - private final LazyOptional doubleJumpCapability = LazyOptional.of( - DoubleJumpCapability::new); - - @Nonnull - @Override - public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { - if (cap == OccultismCapabilities.DOUBLE_JUMP) { - return this.doubleJumpCapability.cast(); - } - return LazyOptional.empty(); - } - - @Override - public CompoundTag serializeNBT() { - return this.doubleJumpCapability.map(DoubleJumpCapability::serializeNBT).orElse(new CompoundTag()); - } - - @Override - public void deserializeNBT(CompoundTag nbt) { - this.doubleJumpCapability.ifPresent(capability -> capability.deserializeNBT(nbt)); - } - - } -} diff --git a/src/main/java/com/klikli_dev/occultism/common/capability/FamiliarSettingsCapability.java b/src/main/java/com/klikli_dev/occultism/common/capability/FamiliarSettingsData.java similarity index 65% rename from src/main/java/com/klikli_dev/occultism/common/capability/FamiliarSettingsCapability.java rename to src/main/java/com/klikli_dev/occultism/common/capability/FamiliarSettingsData.java index f25a18644..029b80f8f 100644 --- a/src/main/java/com/klikli_dev/occultism/common/capability/FamiliarSettingsCapability.java +++ b/src/main/java/com/klikli_dev/occultism/common/capability/FamiliarSettingsData.java @@ -24,34 +24,28 @@ import com.google.common.collect.ImmutableList; import com.klikli_dev.occultism.common.entity.familiar.IFamiliar; -import com.klikli_dev.occultism.network.MessageSyncFamiliarSettings; -import com.klikli_dev.occultism.network.OccultismPackets; -import com.klikli_dev.occultism.registry.OccultismCapabilities; +import com.klikli_dev.occultism.network.Networking; +import com.klikli_dev.occultism.network.messages.MessageSyncFamiliarSettings; +import com.klikli_dev.occultism.registry.OccultismDataStorage; import com.klikli_dev.occultism.registry.OccultismEntities; -import net.minecraft.core.Direction; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.nbt.CompoundTag; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.EntityType; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.ICapabilitySerializable; -import net.minecraftforge.common.util.INBTSerializable; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.neoforge.common.util.INBTSerializable; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; -public class FamiliarSettingsCapability implements INBTSerializable { +public class FamiliarSettingsData implements INBTSerializable { private static ImmutableList> familiars = null; private final Map, Boolean> familiarEnabled; - public FamiliarSettingsCapability() { + public FamiliarSettingsData() { this.familiarEnabled = new HashMap<>(); for (EntityType familiar : getFamiliars()) this.familiarEnabled.put(familiar, true); @@ -82,9 +76,7 @@ public static List> getFamiliars() { } public static void syncFor(ServerPlayer player) { - player.getCapability(OccultismCapabilities.FAMILIAR_SETTINGS).ifPresent(capability -> { - capability.sync(player); - }); + player.getData(OccultismDataStorage.FAMILIAR_SETTINGS).sync(player); } /** @@ -92,7 +84,7 @@ public static void syncFor(ServerPlayer player) { * * @param settings the existing settings instance. */ - public void clone(FamiliarSettingsCapability settings) { + public void clone(FamiliarSettingsData settings) { for (Entry, Boolean> entry : settings.familiarEnabled.entrySet()) this.familiarEnabled.put(entry.getKey(), entry.getValue()); } @@ -106,46 +98,21 @@ public boolean isFamiliarEnabled(EntityType familiar) { } public void sync(ServerPlayer player) { - OccultismPackets.sendTo(player, new MessageSyncFamiliarSettings(this)); + Networking.sendTo(player, new MessageSyncFamiliarSettings(this)); } @Override public CompoundTag serializeNBT() { CompoundTag compound = new CompoundTag(); for (Entry, Boolean> entry : this.familiarEnabled.entrySet()) - compound.putBoolean(ForgeRegistries.ENTITY_TYPES.getKey(entry.getKey()).getPath(), entry.getValue()); + compound.putBoolean(BuiltInRegistries.ENTITY_TYPE.getKey(entry.getKey()).getPath(), entry.getValue()); return compound; } @Override public void deserializeNBT(CompoundTag nbt) { for (EntityType familiar : getFamiliars()) - if (nbt.contains(ForgeRegistries.ENTITY_TYPES.getKey(familiar).getPath())) - this.familiarEnabled.put(familiar, nbt.getBoolean(ForgeRegistries.ENTITY_TYPES.getKey(familiar).getPath())); - } - - public static class Dispatcher implements ICapabilitySerializable { - - private final LazyOptional familiarSettingsCapability = LazyOptional.of( - FamiliarSettingsCapability::new); - - @Nonnull - @Override - public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { - if (cap == OccultismCapabilities.FAMILIAR_SETTINGS) { - return this.familiarSettingsCapability.cast(); - } - return LazyOptional.empty(); - } - - @Override - public CompoundTag serializeNBT() { - return this.familiarSettingsCapability.map(FamiliarSettingsCapability::serializeNBT).orElse(new CompoundTag()); - } - - @Override - public void deserializeNBT(CompoundTag nbt) { - this.familiarSettingsCapability.ifPresent(capability -> capability.deserializeNBT(nbt)); - } + if (nbt.contains(BuiltInRegistries.ENTITY_TYPE.getKey(familiar).getPath())) + this.familiarEnabled.put(familiar, nbt.getBoolean(BuiltInRegistries.ENTITY_TYPE.getKey(familiar).getPath())); } } diff --git a/src/main/java/com/klikli_dev/occultism/common/command/ShareNbtCommand.java b/src/main/java/com/klikli_dev/occultism/common/command/ShareNbtCommand.java deleted file mode 100644 index e6e1cca6e..000000000 --- a/src/main/java/com/klikli_dev/occultism/common/command/ShareNbtCommand.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * MIT License - * - * Copyright 2020 klikli-dev - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and - * associated documentation files (the "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT - * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.klikli_dev.occultism.common.command; - -import com.mojang.brigadier.Command; -import com.mojang.brigadier.CommandDispatcher; -import com.mojang.brigadier.builder.ArgumentBuilder; -import com.mojang.brigadier.context.CommandContext; -import com.mojang.brigadier.exceptions.CommandSyntaxException; -import net.minecraft.commands.CommandSourceStack; -import net.minecraft.commands.Commands; -import net.minecraft.nbt.NbtUtils; -import net.minecraft.network.chat.Component; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.InteractionHand; -import net.minecraft.world.item.ItemStack; - -public class ShareNbtCommand implements Command { - - private static final ShareNbtCommand CMD = new ShareNbtCommand(); - - public static ArgumentBuilder register(CommandDispatcher dispatcher) { - return Commands.literal("sharenbt") - .requires(cs -> cs.hasPermission(0)) - .executes(CMD); - } - - @Override - public int run(CommandContext context) throws CommandSyntaxException { - ServerPlayer player = context.getSource().getPlayerOrException(); - ItemStack heldItem = player.getItemInHand(InteractionHand.MAIN_HAND); - - Component nbtText = heldItem.isEmpty() || !heldItem.hasTag() ? Component.literal("{}") : NbtUtils.toPrettyComponent(heldItem.getShareTag()); - context.getSource().sendSuccess(() -> nbtText, false); - return 0; - } -} \ No newline at end of file diff --git a/src/main/java/com/klikli_dev/occultism/common/container/DimensionalMineshaftContainer.java b/src/main/java/com/klikli_dev/occultism/common/container/DimensionalMineshaftContainer.java index 4b6d90d6e..14efb4389 100644 --- a/src/main/java/com/klikli_dev/occultism/common/container/DimensionalMineshaftContainer.java +++ b/src/main/java/com/klikli_dev/occultism/common/container/DimensionalMineshaftContainer.java @@ -23,7 +23,7 @@ package com.klikli_dev.occultism.common.container; import com.klikli_dev.occultism.common.blockentity.DimensionalMineshaftBlockEntity; -import com.klikli_dev.occultism.exceptions.ItemHandlerMissingException; + import com.klikli_dev.occultism.registry.OccultismContainers; import com.klikli_dev.occultism.registry.OccultismRecipes; import com.klikli_dev.occultism.util.RecipeUtil; @@ -33,9 +33,9 @@ import net.minecraft.world.inventory.Slot; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.RecipeManager; -import net.minecraftforge.items.IItemHandler; -import net.minecraftforge.items.ItemStackHandler; -import net.minecraftforge.items.SlotItemHandler; +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.items.ItemStackHandler; +import net.neoforged.neoforge.items.SlotItemHandler; public class DimensionalMineshaftContainer extends AbstractContainerMenu { @@ -49,8 +49,8 @@ public DimensionalMineshaftContainer(int id, Inventory playerInventory, super(OccultismContainers.OTHERWORLD_MINER.get(), id); this.playerInventory = playerInventory; this.otherworldMiner = otherworldMiner; - this.inputHandler = otherworldMiner.inputHandler.orElseThrow(ItemHandlerMissingException::new); - this.outputHandler = otherworldMiner.outputHandler.orElseThrow(ItemHandlerMissingException::new); + this.inputHandler = otherworldMiner.inputHandler; + this.outputHandler = otherworldMiner.outputHandler; this.setupMinerInventory(); this.setupPlayerInventorySlots(playerInventory.player); @@ -120,8 +120,8 @@ protected void setupMinerInventory() { int outputGridLeft = 98; int index = 0; - IItemHandler outputHandler = this.otherworldMiner.outputHandler.orElseThrow(ItemHandlerMissingException::new); - IItemHandler inputHandler = this.otherworldMiner.inputHandler.orElseThrow(ItemHandlerMissingException::new); + IItemHandler outputHandler = this.otherworldMiner.outputHandler; + IItemHandler inputHandler = this.otherworldMiner.inputHandler; for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) { diff --git a/src/main/java/com/klikli_dev/occultism/common/container/spirit/SpiritContainer.java b/src/main/java/com/klikli_dev/occultism/common/container/spirit/SpiritContainer.java index 1e6956fbd..aeb7cab2b 100644 --- a/src/main/java/com/klikli_dev/occultism/common/container/spirit/SpiritContainer.java +++ b/src/main/java/com/klikli_dev/occultism/common/container/spirit/SpiritContainer.java @@ -23,7 +23,7 @@ package com.klikli_dev.occultism.common.container.spirit; import com.klikli_dev.occultism.common.entity.spirit.SpiritEntity; -import com.klikli_dev.occultism.exceptions.ItemHandlerMissingException; + import com.klikli_dev.occultism.registry.OccultismContainers; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Player; @@ -31,9 +31,8 @@ import net.minecraft.world.inventory.MenuType; import net.minecraft.world.inventory.Slot; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.items.ItemStackHandler; -import net.minecraftforge.items.SlotItemHandler; - +import net.neoforged.neoforge.items.ItemStackHandler; +import net.neoforged.neoforge.items.SlotItemHandler; import javax.annotation.Nullable; public class SpiritContainer extends AbstractContainerMenu { @@ -47,7 +46,7 @@ public SpiritContainer(int id, Inventory playerInventory, SpiritEntity spirit) { public SpiritContainer(@Nullable MenuType type, int id, Inventory playerInventory, SpiritEntity spirit) { super(type, id); - this.inventory = spirit.itemStackHandler.orElseThrow(ItemHandlerMissingException::new); + this.inventory = spirit.inventory; this.spirit = spirit; this.setupSlots(playerInventory); diff --git a/src/main/java/com/klikli_dev/occultism/common/container/spirit/SpiritTransporterContainer.java b/src/main/java/com/klikli_dev/occultism/common/container/spirit/SpiritTransporterContainer.java index 529e8123b..dc684c40f 100644 --- a/src/main/java/com/klikli_dev/occultism/common/container/spirit/SpiritTransporterContainer.java +++ b/src/main/java/com/klikli_dev/occultism/common/container/spirit/SpiritTransporterContainer.java @@ -23,17 +23,16 @@ package com.klikli_dev.occultism.common.container.spirit; import com.klikli_dev.occultism.common.entity.spirit.SpiritEntity; -import com.klikli_dev.occultism.exceptions.ItemHandlerMissingException; + import com.klikli_dev.occultism.registry.OccultismContainers; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.ClickType; import net.minecraft.world.inventory.Slot; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.items.IItemHandler; -import net.minecraftforge.items.ItemStackHandler; -import net.minecraftforge.items.SlotItemHandler; - +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.items.ItemStackHandler; +import net.neoforged.neoforge.items.SlotItemHandler; import javax.annotation.Nonnull; public class SpiritTransporterContainer extends SpiritContainer { @@ -101,7 +100,7 @@ public boolean canTakeItemForPickAll(ItemStack stack, Slot slot) { protected void setupFilterSlots() { int x = 8; int y = 84; - ItemStackHandler filterItems = this.spirit.filterItemStackHandler.orElseThrow(ItemHandlerMissingException::new); + ItemStackHandler filterItems = this.spirit.filterItemStackHandler; for (int i = 0; i < 2; i++) { for (int j = 0; j < filterItems.getSlots() / 2; j++) { diff --git a/src/main/java/com/klikli_dev/occultism/common/container/storage/StableWormholeContainer.java b/src/main/java/com/klikli_dev/occultism/common/container/storage/StableWormholeContainer.java index 76f998e82..449f0f0e1 100644 --- a/src/main/java/com/klikli_dev/occultism/common/container/storage/StableWormholeContainer.java +++ b/src/main/java/com/klikli_dev/occultism/common/container/storage/StableWormholeContainer.java @@ -27,8 +27,8 @@ import com.klikli_dev.occultism.common.blockentity.StableWormholeBlockEntity; import com.klikli_dev.occultism.common.blockentity.StorageControllerBlockEntity; import com.klikli_dev.occultism.common.misc.StorageControllerCraftingInventory; -import com.klikli_dev.occultism.network.MessageUpdateLinkedMachines; -import com.klikli_dev.occultism.network.OccultismPackets; +import com.klikli_dev.occultism.network.messages.MessageUpdateLinkedMachines; +import com.klikli_dev.occultism.network.Networking; import com.klikli_dev.occultism.registry.OccultismContainers; import com.klikli_dev.occultism.util.BlockEntityUtil; import net.minecraft.core.BlockPos; @@ -132,8 +132,8 @@ public boolean stillValid(Player player) { //send stack updates on a slow tick while interacting if (!level.isClientSide && level.getGameTime() % 40 == 0) { - OccultismPackets.sendTo((ServerPlayer) player, this.storageController.getMessageUpdateStacks()); - OccultismPackets.sendTo((ServerPlayer) player, + Networking.sendTo((ServerPlayer) player, this.storageController.getMessageUpdateStacks()); + Networking.sendTo((ServerPlayer) player, new MessageUpdateLinkedMachines(this.storageController.getLinkedMachines())); } diff --git a/src/main/java/com/klikli_dev/occultism/common/container/storage/StorageControllerContainer.java b/src/main/java/com/klikli_dev/occultism/common/container/storage/StorageControllerContainer.java index 628a09ee8..52095d579 100644 --- a/src/main/java/com/klikli_dev/occultism/common/container/storage/StorageControllerContainer.java +++ b/src/main/java/com/klikli_dev/occultism/common/container/storage/StorageControllerContainer.java @@ -25,8 +25,8 @@ import com.klikli_dev.occultism.client.gui.storage.StorageControllerGuiBase; import com.klikli_dev.occultism.common.blockentity.StorageControllerBlockEntity; import com.klikli_dev.occultism.common.misc.StorageControllerCraftingInventory; -import com.klikli_dev.occultism.network.MessageUpdateLinkedMachines; -import com.klikli_dev.occultism.network.OccultismPackets; +import com.klikli_dev.occultism.network.messages.MessageUpdateLinkedMachines; +import com.klikli_dev.occultism.network.Networking; import com.klikli_dev.occultism.registry.OccultismContainers; import net.minecraft.core.BlockPos; import net.minecraft.server.level.ServerPlayer; @@ -112,8 +112,8 @@ public boolean stillValid(Player player) { //send stack updates on a slow tick while interacting if (!level.isClientSide && level.getGameTime() % 40 == 0) { - OccultismPackets.sendTo((ServerPlayer) player, this.storageController.getMessageUpdateStacks()); - OccultismPackets.sendTo((ServerPlayer) player, + Networking.sendTo((ServerPlayer) player, this.storageController.getMessageUpdateStacks()); + Networking.sendTo((ServerPlayer) player, new MessageUpdateLinkedMachines(this.storageController.getLinkedMachines())); } diff --git a/src/main/java/com/klikli_dev/occultism/common/container/storage/StorageControllerContainerBase.java b/src/main/java/com/klikli_dev/occultism/common/container/storage/StorageControllerContainerBase.java index 2440e0679..390286aee 100644 --- a/src/main/java/com/klikli_dev/occultism/common/container/storage/StorageControllerContainerBase.java +++ b/src/main/java/com/klikli_dev/occultism/common/container/storage/StorageControllerContainerBase.java @@ -30,7 +30,7 @@ import com.klikli_dev.occultism.common.misc.ItemStackComparator; import com.klikli_dev.occultism.common.misc.StorageControllerCraftingInventory; import com.klikli_dev.occultism.common.misc.StorageControllerSlot; -import com.klikli_dev.occultism.network.OccultismPackets; +import com.klikli_dev.occultism.network.Networking; import net.minecraft.ChatFormatting; import net.minecraft.core.BlockPos; import net.minecraft.core.NonNullList; @@ -44,11 +44,11 @@ import net.minecraft.world.inventory.*; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.CraftingRecipe; +import net.minecraft.world.item.crafting.RecipeHolder; import net.minecraft.world.item.crafting.RecipeType; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraftforge.items.ItemHandlerHelper; -import net.minecraftforge.items.wrapper.PlayerMainInvWrapper; - +import net.neoforged.neoforge.items.ItemHandlerHelper; +import net.neoforged.neoforge.items.wrapper.PlayerMainInvWrapper; import javax.annotation.Nullable; import java.util.*; import java.util.concurrent.ConcurrentHashMap; @@ -65,7 +65,7 @@ public abstract class StorageControllerContainerBase extends AbstractContainerMe protected ResultContainer result; protected StorageControllerCraftingInventory matrix; protected SimpleContainer orderInventory; - protected CraftingRecipe currentRecipe; + protected RecipeHolder currentRecipe; /** * used to lock recipe while crafting */ @@ -152,7 +152,7 @@ public ItemStack quickMoveStack(Player player, int index) { this.broadcastChanges(); //get updated stacks from storage controller and send to client - OccultismPackets.sendTo((ServerPlayer) player, storageController.getMessageUpdateStacks()); + Networking.sendTo((ServerPlayer) player, storageController.getMessageUpdateStacks()); if (!remainingItemStack.isEmpty()) { slot.onTake(player, slotStack); @@ -212,7 +212,7 @@ protected void setupOrderInventorySlot() { protected abstract void setupPlayerHotbar(); protected void findRecipeForMatrixClient() { - Optional optional = + var optional = this.player.level().getRecipeManager().getRecipeFor(RecipeType.CRAFTING, this.matrix, this.player.level()); optional.ifPresentOrElse(iCraftingRecipe -> this.currentRecipe = iCraftingRecipe, () -> this.currentRecipe = null); } @@ -224,13 +224,13 @@ protected void findRecipeForMatrix() { this.currentRecipe = null; ServerPlayer serverplayerentity = (ServerPlayer) this.player; ItemStack itemstack = ItemStack.EMPTY; - Optional optional = this.player.level().getServer().getRecipeManager() + var optional = this.player.level().getServer().getRecipeManager() .getRecipeFor(RecipeType.CRAFTING, this.matrix, this.player.level()); if (optional.isPresent()) { - CraftingRecipe icraftingrecipe = optional.get(); + var icraftingrecipe = optional.get(); if (this.result.setRecipeUsed(this.player.level(), serverplayerentity, icraftingrecipe)) { - itemstack = icraftingrecipe.assemble(this.matrix, serverplayerentity.level().registryAccess()); + itemstack = icraftingrecipe.value().assemble(this.matrix, serverplayerentity.level().registryAccess()); this.currentRecipe = icraftingrecipe; } } @@ -260,7 +260,7 @@ protected void craftShift(Player player, IStorageController storageController) { } //Get the crafting result and abort if none - ItemStack result = this.currentRecipe.assemble(this.matrix, player.level().registryAccess()); + ItemStack result = this.currentRecipe.value().assemble(this.matrix, player.level().registryAccess()); if (result.isEmpty()) { return; } @@ -276,7 +276,7 @@ protected void craftShift(Player player, IStorageController storageController) { if (this.currentRecipe == null) break; - ItemStack newResult = this.currentRecipe.assemble(this.matrix, player.level().registryAccess()).copy(); + ItemStack newResult = this.currentRecipe.value().assemble(this.matrix, player.level().registryAccess()).copy(); if (newResult.getItem() != result.getItem()) break; @@ -288,7 +288,7 @@ protected void craftShift(Player player, IStorageController storageController) { } //if recipe is no longer fulfilled, stop - if (!this.currentRecipe.matches(this.matrix, player.level())) { + if (!this.currentRecipe.value().matches(this.matrix, player.level())) { break; } @@ -300,7 +300,7 @@ protected void craftShift(Player player, IStorageController storageController) { resultList.add(newResult); //get remaining items in the crafting matrix - NonNullList remainingCraftingItems = this.currentRecipe.getRemainingItems(this.matrix); + NonNullList remainingCraftingItems = this.currentRecipe.value().getRemainingItems(this.matrix); for (int i = 0; i < remainingCraftingItems.size(); ++i) { ItemStack currentCraftingItem = remainingCraftingItems.get(i); @@ -384,7 +384,7 @@ else if (ItemStack.isSameItem(stackInSlot, currentCraftingItem)) { //update crafting matrix to handle container items / items that survive crafting this.slotsChanged(this.matrix); - OccultismPackets.sendTo((ServerPlayer) player, this.getStorageController().getMessageUpdateStacks()); + Networking.sendTo((ServerPlayer) player, this.getStorageController().getMessageUpdateStacks()); } diff --git a/src/main/java/com/klikli_dev/occultism/common/container/storage/StorageRemoteContainer.java b/src/main/java/com/klikli_dev/occultism/common/container/storage/StorageRemoteContainer.java index 2014e90b3..c9a08c7a3 100644 --- a/src/main/java/com/klikli_dev/occultism/common/container/storage/StorageRemoteContainer.java +++ b/src/main/java/com/klikli_dev/occultism/common/container/storage/StorageRemoteContainer.java @@ -27,10 +27,11 @@ import com.klikli_dev.occultism.client.gui.storage.StorageControllerGuiBase; import com.klikli_dev.occultism.common.item.storage.StorageRemoteItem; import com.klikli_dev.occultism.common.misc.StorageControllerCraftingInventory; -import com.klikli_dev.occultism.network.MessageUpdateLinkedMachines; -import com.klikli_dev.occultism.network.OccultismPackets; +import com.klikli_dev.occultism.network.messages.MessageUpdateLinkedMachines; +import com.klikli_dev.occultism.network.Networking; import com.klikli_dev.occultism.registry.OccultismContainers; import com.klikli_dev.occultism.util.CuriosUtil; +import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.ListTag; import net.minecraft.nbt.Tag; import net.minecraft.server.level.ServerPlayer; @@ -159,8 +160,8 @@ public boolean stillValid(Player entityPlayer) { //stack updates every 40 ticks. if (storageController != null && !entityPlayer.level().isClientSide && entityPlayer.level().getGameTime() % 40 == 0) { - OccultismPackets.sendTo((ServerPlayer) this.player, this.getStorageController().getMessageUpdateStacks()); - OccultismPackets.sendTo((ServerPlayer) this.player, + Networking.sendTo((ServerPlayer) this.player, this.getStorageController().getMessageUpdateStacks()); + Networking.sendTo((ServerPlayer) this.player, new MessageUpdateLinkedMachines(this.getStorageController().getLinkedMachines())); } @@ -182,7 +183,7 @@ public boolean isContainerItem() { public void updateCraftingSlots(boolean force) { ListTag nbtTagList = new ListTag(); for (int i = 0; i < this.matrix.getContainerSize(); i++) { - nbtTagList.add(this.matrix.getItem(i).serializeNBT()); + nbtTagList.add(this.matrix.getItem(i).save(new CompoundTag())); } ItemStack storageRemote = this.getStorageRemote(); if (storageRemote != ItemStack.EMPTY) @@ -193,7 +194,7 @@ public void updateCraftingSlots(boolean force) { public void updateOrderSlot(boolean force) { ItemStack storageRemote = this.getStorageRemote(); if (storageRemote != ItemStack.EMPTY) - storageRemote.getOrCreateTag().put("orderStack", this.orderInventory.getItem(0).serializeNBT()); + storageRemote.getOrCreateTag().put("orderStack", this.orderInventory.getItem(0).save(new CompoundTag())); } protected List getCraftingMatrixFromItemStack(ItemStack stack) { diff --git a/src/main/java/com/klikli_dev/occultism/common/effect/DoubleJumpEffect.java b/src/main/java/com/klikli_dev/occultism/common/effect/DoubleJumpEffect.java index 8c6c80359..c7e1de295 100644 --- a/src/main/java/com/klikli_dev/occultism/common/effect/DoubleJumpEffect.java +++ b/src/main/java/com/klikli_dev/occultism/common/effect/DoubleJumpEffect.java @@ -33,8 +33,7 @@ import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; -import net.minecraftforge.client.extensions.common.IClientMobEffectExtensions; - +import net.neoforged.neoforge.client.extensions.common.IClientMobEffectExtensions; import java.util.function.Consumer; public class DoubleJumpEffect extends MobEffect { @@ -81,8 +80,9 @@ public static int getMaxJumps(Player player) { public void applyEffectTick(LivingEntity entityLivingBaseIn, int amplifier) { } + @Override - public boolean isDurationEffectTick(int duration, int amplifier) { + public boolean shouldApplyEffectTickThisTick(int duration, int amplifier) { return true; } diff --git a/src/main/java/com/klikli_dev/occultism/common/effect/ThirdEyeEffect.java b/src/main/java/com/klikli_dev/occultism/common/effect/ThirdEyeEffect.java index 983b52e59..09add62f6 100644 --- a/src/main/java/com/klikli_dev/occultism/common/effect/ThirdEyeEffect.java +++ b/src/main/java/com/klikli_dev/occultism/common/effect/ThirdEyeEffect.java @@ -30,8 +30,7 @@ import net.minecraft.world.effect.MobEffectCategory; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.entity.LivingEntity; -import net.minecraftforge.client.extensions.common.IClientMobEffectExtensions; - +import net.neoforged.neoforge.client.extensions.common.IClientMobEffectExtensions; import java.util.function.Consumer; public class ThirdEyeEffect extends MobEffect { @@ -58,7 +57,7 @@ public void applyEffectTick(LivingEntity entityLivingBaseIn, int amplifier) { } @Override - public boolean isDurationEffectTick(int duration, int amplifier) { + public boolean shouldApplyEffectTickThisTick(int duration, int amplifier) { return true; } diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/DepositItemsBehaviour.java b/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/DepositItemsBehaviour.java index ec3589167..aae11c47f 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/DepositItemsBehaviour.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/DepositItemsBehaviour.java @@ -1,7 +1,6 @@ package com.klikli_dev.occultism.common.entity.ai.behaviour; import com.klikli_dev.occultism.common.entity.spirit.SpiritEntity; -import com.klikli_dev.occultism.exceptions.ItemHandlerMissingException; import com.klikli_dev.occultism.registry.OccultismMemoryTypes; import com.klikli_dev.occultism.util.StorageUtil; import com.mojang.datafixers.util.Pair; @@ -13,8 +12,8 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.phys.Vec3; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.items.ItemHandlerHelper; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.items.ItemHandlerHelper; import net.tslat.smartbrainlib.api.core.behaviour.ExtendedBehaviour; import net.tslat.smartbrainlib.util.BrainUtils; @@ -44,7 +43,7 @@ protected boolean shouldKeepRunning(E entity) { protected boolean checkExtraStartConditions(ServerLevel level, E entity) { var depositPos = BrainUtils.getMemory(entity, OccultismMemoryTypes.DEPOSIT_POSITION.get()); var dist = entity.distanceToSqr(Vec3.atCenterOf(depositPos)); - return StorageUtil.getFirstFilledSlot(entity.itemStackHandler.orElseThrow(ItemHandlerMissingException::new)) != -1 + return StorageUtil.getFirstFilledSlot(entity.inventory) != -1 && dist <= DepositItemsBehaviour.DEPOSIT_ITEM_RANGE_SQUARE; } @@ -56,13 +55,12 @@ protected void start(E entity) { if (blockEntity != null) { BrainUtils.setMemory(entity, MemoryModuleType.LOOK_TARGET, new BlockPosTracker(depositPos)); - var depositItemHandlerCap = blockEntity.getCapability(ForgeCapabilities.ITEM_HANDLER, depositFacing); + var depositItemHandler = entity.level().getCapability(Capabilities.ItemHandler.BLOCK, depositPos, blockEntity.getBlockState(), blockEntity, depositFacing); this.toggleContainer(blockEntity, true); - if (depositItemHandlerCap.isPresent()) { - var depositItemHandler = depositItemHandlerCap.orElseThrow(ItemHandlerMissingException::new); - var entityItemHandler = entity.itemStackHandler.orElseThrow(ItemHandlerMissingException::new); + if (depositItemHandler != null) { + var entityItemHandler = entity.inventory; var firstFilledSlot = StorageUtil.getFirstFilledSlot(entityItemHandler); ItemStack duplicate = entityItemHandler.getStackInSlot(firstFilledSlot).copy(); diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/FellTreeBehaviour.java b/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/FellTreeBehaviour.java index e005541f8..824b410c8 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/FellTreeBehaviour.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/FellTreeBehaviour.java @@ -17,7 +17,6 @@ import net.minecraft.world.phys.Vec3; import net.tslat.smartbrainlib.api.core.behaviour.ExtendedBehaviour; import net.tslat.smartbrainlib.util.BrainUtils; - import java.util.*; public class FellTreeBehaviour extends ExtendedBehaviour { diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/HandleUnreachableTreeBehaviour.java b/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/HandleUnreachableTreeBehaviour.java index c7fee9433..d6f82b10c 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/HandleUnreachableTreeBehaviour.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/HandleUnreachableTreeBehaviour.java @@ -3,8 +3,8 @@ import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.OccultismConstants; import com.klikli_dev.occultism.common.entity.spirit.SpiritEntity; -import com.klikli_dev.occultism.network.MessageSelectBlock; -import com.klikli_dev.occultism.network.OccultismPackets; +import com.klikli_dev.occultism.network.messages.MessageSelectBlock; +import com.klikli_dev.occultism.network.Networking; import com.klikli_dev.occultism.registry.OccultismMemoryTypes; import com.mojang.datafixers.util.Pair; import it.unimi.dsi.fastutil.objects.ObjectArrayList; @@ -13,7 +13,6 @@ import net.minecraft.world.entity.ai.memory.MemoryStatus; import net.tslat.smartbrainlib.api.core.behaviour.ExtendedBehaviour; import net.tslat.smartbrainlib.util.BrainUtils; - import java.util.HashSet; import java.util.List; @@ -41,7 +40,7 @@ protected void start(E entity) { BrainUtils.clearMemory(entity, OccultismMemoryTypes.WALK_TARGET_UNREACHABLE.get()); if (Occultism.DEBUG.debugAI) { - OccultismPackets.sendToTracking(entity, new MessageSelectBlock(walkTarget.getTarget().currentBlockPosition(), 50000, OccultismConstants.Color.RED)); + Networking.sendToTracking(entity, new MessageSelectBlock(walkTarget.getTarget().currentBlockPosition(), 50000, OccultismConstants.Color.RED)); } } } diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/PickupItemBehaviour.java b/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/PickupItemBehaviour.java index 3d5482f74..c99eedf1f 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/PickupItemBehaviour.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/PickupItemBehaviour.java @@ -1,7 +1,7 @@ package com.klikli_dev.occultism.common.entity.ai.behaviour; import com.klikli_dev.occultism.common.entity.spirit.SpiritEntity; -import com.klikli_dev.occultism.exceptions.ItemHandlerMissingException; + import com.klikli_dev.occultism.registry.OccultismMemoryTypes; import com.klikli_dev.occultism.util.Math3DUtil; import com.mojang.datafixers.util.Pair; @@ -11,11 +11,10 @@ import net.minecraft.world.entity.ai.memory.MemoryModuleType; import net.minecraft.world.entity.ai.memory.MemoryStatus; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.items.ItemHandlerHelper; -import net.minecraftforge.items.ItemStackHandler; +import net.neoforged.neoforge.items.ItemHandlerHelper; +import net.neoforged.neoforge.items.ItemStackHandler; import net.tslat.smartbrainlib.api.core.behaviour.ExtendedBehaviour; import net.tslat.smartbrainlib.util.BrainUtils; - import java.util.List; public class PickupItemBehaviour extends ExtendedBehaviour { @@ -37,7 +36,7 @@ protected boolean checkExtraStartConditions(ServerLevel level, E entity) { PickupItemBehaviour.PICKUP_XZ_RANGE_SQUARE) //also check if inserting would take anything from the entity stack -> means we have free slots && ItemHandlerHelper.insertItemStacked( - entity.itemStackHandler.orElseThrow(ItemHandlerMissingException::new), jobItem.getItem(), true).getCount() < + entity.inventory, jobItem.getItem(), true).getCount() < jobItem.getItem().getCount(); } @@ -46,7 +45,7 @@ protected void start(E entity) { BrainUtils.setMemory(entity, MemoryModuleType.LOOK_TARGET, new EntityTracker(jobItem, false)); ItemStack duplicate = jobItem.getItem().copy(); - ItemStackHandler handler = entity.itemStackHandler.orElseThrow(ItemHandlerMissingException::new); + ItemStackHandler handler = entity.inventory; if (ItemHandlerHelper.insertItemStacked(handler, duplicate, true).getCount() < duplicate.getCount()) { ItemStack remaining = ItemHandlerHelper.insertItemStacked(handler, duplicate, false); jobItem.getItem().setCount(remaining.getCount()); diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/ReplantSaplingBehaviour.java b/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/ReplantSaplingBehaviour.java index 4acc6ec77..0df8b1705 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/ReplantSaplingBehaviour.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/ReplantSaplingBehaviour.java @@ -1,7 +1,6 @@ package com.klikli_dev.occultism.common.entity.ai.behaviour; import com.klikli_dev.occultism.common.entity.spirit.SpiritEntity; -import com.klikli_dev.occultism.exceptions.ItemHandlerMissingException; import com.klikli_dev.occultism.registry.OccultismMemoryTypes; import com.klikli_dev.occultism.util.StorageUtil; import com.mojang.datafixers.util.Pair; @@ -30,7 +29,7 @@ public class ReplantSaplingBehaviour extends ExtendedBeh protected boolean checkExtraStartConditions(ServerLevel level, E entity) { var treePos = BrainUtils.getMemory(entity, OccultismMemoryTypes.LAST_FELLED_TREE.get()); var dist = entity.distanceToSqr(Vec3.atCenterOf(treePos)); - return StorageUtil.getFirstMatchingSlot(entity.itemStackHandler.orElseThrow(ItemHandlerMissingException::new), ItemTags.SAPLINGS) != -1 + return StorageUtil.getFirstMatchingSlot(entity.inventory, ItemTags.SAPLINGS) != -1 && dist <= ReplantSaplingBehaviour.REPLANT_RANGE_SQUARE; } @@ -40,7 +39,7 @@ protected void start(E entity) { if (entity.level().isEmptyBlock(lastFelledTree)) { BrainUtils.setMemory(entity, MemoryModuleType.LOOK_TARGET, new BlockPosTracker(lastFelledTree)); - var handler = entity.itemStackHandler.orElseThrow(ItemHandlerMissingException::new); + var handler = entity.inventory; ItemStack sapling = handler.getStackInSlot(StorageUtil.getFirstMatchingSlot(handler, ItemTags.SAPLINGS)); if (sapling.getItem() instanceof BlockItem saplingBlockItem) { entity.level().setBlockAndUpdate(lastFelledTree, saplingBlockItem.getBlock().defaultBlockState()); diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/SetWalkTargetToDepositBehaviour.java b/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/SetWalkTargetToDepositBehaviour.java index 0379e82cc..1ba1d9c16 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/SetWalkTargetToDepositBehaviour.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/SetWalkTargetToDepositBehaviour.java @@ -3,9 +3,9 @@ import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.OccultismConstants; import com.klikli_dev.occultism.common.entity.spirit.SpiritEntity; -import com.klikli_dev.occultism.exceptions.ItemHandlerMissingException; -import com.klikli_dev.occultism.network.MessageSelectBlock; -import com.klikli_dev.occultism.network.OccultismPackets; + +import com.klikli_dev.occultism.network.messages.MessageSelectBlock; +import com.klikli_dev.occultism.network.Networking; import com.klikli_dev.occultism.registry.OccultismMemoryTypes; import com.klikli_dev.occultism.util.StorageUtil; import com.mojang.datafixers.util.Pair; @@ -20,7 +20,6 @@ import net.minecraft.world.phys.Vec3; import net.tslat.smartbrainlib.api.core.behaviour.ExtendedBehaviour; import net.tslat.smartbrainlib.util.BrainUtils; - import java.util.HashSet; import java.util.List; @@ -38,7 +37,7 @@ public class SetWalkTargetToDepositBehaviour extends Ext @Override protected boolean checkExtraStartConditions(ServerLevel level, E entity) { - return StorageUtil.getFirstFilledSlot(entity.itemStackHandler.orElseThrow(ItemHandlerMissingException::new)) != -1; + return StorageUtil.getFirstFilledSlot(entity.inventory) != -1; } @Override @@ -66,8 +65,8 @@ protected void start(E entity) { if (Occultism.DEBUG.debugAI) { - OccultismPackets.sendToTracking(entity, new MessageSelectBlock(depositPos, 5000, OccultismConstants.Color.MAGENTA)); - OccultismPackets.sendToTracking(entity, new MessageSelectBlock(walkPos, 5000, OccultismConstants.Color.GREEN)); + Networking.sendToTracking(entity, new MessageSelectBlock(depositPos, 5000, OccultismConstants.Color.MAGENTA)); + Networking.sendToTracking(entity, new MessageSelectBlock(walkPos, 5000, OccultismConstants.Color.GREEN)); } } else { @@ -76,7 +75,7 @@ protected void start(E entity) { BrainUtils.clearMemory(entity, MemoryModuleType.WALK_TARGET); if (Occultism.DEBUG.debugAI) { - OccultismPackets.sendToTracking(entity, new MessageSelectBlock(depositPos, 50000, OccultismConstants.Color.RED)); + Networking.sendToTracking(entity, new MessageSelectBlock(depositPos, 50000, OccultismConstants.Color.RED)); } } } diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/SetWalkTargetToItemBehaviour.java b/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/SetWalkTargetToItemBehaviour.java index bf2b88f77..9fcbedbc4 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/SetWalkTargetToItemBehaviour.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/SetWalkTargetToItemBehaviour.java @@ -3,8 +3,8 @@ import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.OccultismConstants; import com.klikli_dev.occultism.common.entity.spirit.SpiritEntity; -import com.klikli_dev.occultism.network.MessageSelectBlock; -import com.klikli_dev.occultism.network.OccultismPackets; +import com.klikli_dev.occultism.network.messages.MessageSelectBlock; +import com.klikli_dev.occultism.network.Networking; import com.klikli_dev.occultism.registry.OccultismMemoryTypes; import com.klikli_dev.occultism.util.Math3DUtil; import com.mojang.datafixers.util.Pair; @@ -15,7 +15,6 @@ import net.minecraft.world.entity.ai.memory.WalkTarget; import net.tslat.smartbrainlib.api.core.behaviour.ExtendedBehaviour; import net.tslat.smartbrainlib.util.BrainUtils; - import java.util.List; /** @@ -45,7 +44,7 @@ protected void start(E entity) { BrainUtils.setMemory(entity, MemoryModuleType.WALK_TARGET, new WalkTarget(jobItem, 1.0f, 0)); if (Occultism.DEBUG.debugAI) { - OccultismPackets.sendToTracking(entity, new MessageSelectBlock(jobItem.blockPosition(), 5000, OccultismConstants.Color.GREEN)); + Networking.sendToTracking(entity, new MessageSelectBlock(jobItem.blockPosition(), 5000, OccultismConstants.Color.GREEN)); } } } else { diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/SetWalkTargetToReplantSaplingBehaviour.java b/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/SetWalkTargetToReplantSaplingBehaviour.java index 63ef835a3..a78495634 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/SetWalkTargetToReplantSaplingBehaviour.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/SetWalkTargetToReplantSaplingBehaviour.java @@ -3,9 +3,9 @@ import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.OccultismConstants; import com.klikli_dev.occultism.common.entity.spirit.SpiritEntity; -import com.klikli_dev.occultism.exceptions.ItemHandlerMissingException; -import com.klikli_dev.occultism.network.MessageSelectBlock; -import com.klikli_dev.occultism.network.OccultismPackets; + +import com.klikli_dev.occultism.network.messages.MessageSelectBlock; +import com.klikli_dev.occultism.network.Networking; import com.klikli_dev.occultism.registry.OccultismMemoryTypes; import com.klikli_dev.occultism.util.StorageUtil; import com.mojang.datafixers.util.Pair; @@ -19,7 +19,6 @@ import net.minecraft.world.phys.Vec3; import net.tslat.smartbrainlib.api.core.behaviour.ExtendedBehaviour; import net.tslat.smartbrainlib.util.BrainUtils; - import java.util.List; /** @@ -35,7 +34,7 @@ public class SetWalkTargetToReplantSaplingBehaviour exte @Override protected boolean checkExtraStartConditions(ServerLevel level, E entity) { - return StorageUtil.getFirstMatchingSlot(entity.itemStackHandler.orElseThrow(ItemHandlerMissingException::new), ItemTags.SAPLINGS) != -1; + return StorageUtil.getFirstMatchingSlot(entity.inventory, ItemTags.SAPLINGS) != -1; } @Override @@ -48,7 +47,7 @@ protected void start(E entity) { BrainUtils.setMemory(entity, MemoryModuleType.WALK_TARGET, new WalkTarget(treePos, 1.0f, 0)); if (Occultism.DEBUG.debugAI) { - OccultismPackets.sendToTracking(entity, new MessageSelectBlock(treePos, 5000, OccultismConstants.Color.GREEN)); + Networking.sendToTracking(entity, new MessageSelectBlock(treePos, 5000, OccultismConstants.Color.GREEN)); } } } diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/SetWalkTargetToTreeBehaviour.java b/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/SetWalkTargetToTreeBehaviour.java index b0ff03348..c766796f4 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/SetWalkTargetToTreeBehaviour.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/ai/behaviour/SetWalkTargetToTreeBehaviour.java @@ -3,8 +3,8 @@ import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.OccultismConstants; import com.klikli_dev.occultism.common.entity.spirit.SpiritEntity; -import com.klikli_dev.occultism.network.MessageSelectBlock; -import com.klikli_dev.occultism.network.OccultismPackets; +import com.klikli_dev.occultism.network.messages.MessageSelectBlock; +import com.klikli_dev.occultism.network.Networking; import com.klikli_dev.occultism.registry.OccultismMemoryTypes; import com.mojang.datafixers.util.Pair; import it.unimi.dsi.fastutil.objects.ObjectArrayList; @@ -17,7 +17,6 @@ import net.minecraft.world.phys.Vec3; import net.tslat.smartbrainlib.api.core.behaviour.ExtendedBehaviour; import net.tslat.smartbrainlib.util.BrainUtils; - import java.util.HashSet; import java.util.List; @@ -62,8 +61,8 @@ protected void start(E entity) { BrainUtils.setMemory(entity, OccultismMemoryTypes.LAST_TREE_WALK_TARGET.get(), new WalkTarget(walkPos, 1.0f, 1)); if (Occultism.DEBUG.debugAI) { - OccultismPackets.sendToTracking(entity, new MessageSelectBlock(treePos, 5000, OccultismConstants.Color.MAGENTA)); - OccultismPackets.sendToTracking(entity, new MessageSelectBlock(walkPos, 5000, OccultismConstants.Color.GREEN)); + Networking.sendToTracking(entity, new MessageSelectBlock(treePos, 5000, OccultismConstants.Color.MAGENTA)); + Networking.sendToTracking(entity, new MessageSelectBlock(walkPos, 5000, OccultismConstants.Color.GREEN)); } } else { @@ -76,7 +75,7 @@ protected void start(E entity) { BrainUtils.clearMemory(entity, OccultismMemoryTypes.NEAREST_TREE.get()); if (Occultism.DEBUG.debugAI) { - OccultismPackets.sendToTracking(entity, new MessageSelectBlock(treePos, 50000, OccultismConstants.Color.RED)); + Networking.sendToTracking(entity, new MessageSelectBlock(treePos, 50000, OccultismConstants.Color.RED)); } } } diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/ai/goal/DepositItemsGoal.java b/src/main/java/com/klikli_dev/occultism/common/entity/ai/goal/DepositItemsGoal.java index 93bec3245..06e8a8202 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/ai/goal/DepositItemsGoal.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/ai/goal/DepositItemsGoal.java @@ -27,7 +27,7 @@ import com.klikli_dev.occultism.common.entity.ai.target.EntityMoveTarget; import com.klikli_dev.occultism.common.entity.ai.target.IMoveTarget; import com.klikli_dev.occultism.common.entity.spirit.SpiritEntity; -import com.klikli_dev.occultism.exceptions.ItemHandlerMissingException; + import com.klikli_dev.occultism.util.Math3DUtil; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -37,11 +37,9 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.ChestBlockEntity; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.items.IItemHandler; -import net.minecraftforge.items.ItemHandlerHelper; - +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.items.ItemHandlerHelper; import java.util.EnumSet; import java.util.Optional; import java.util.UUID; @@ -120,14 +118,11 @@ public void tick() { //when close enough insert item if (distance < accessDistance && this.canSeeTarget()) { - LazyOptional handlerCapability = this.moveTarget.getCapability( - ForgeCapabilities.ITEM_HANDLER, this.entity.getDepositFacing()); - if (!handlerCapability - .isPresent()) { //worst case scenario if block entity or entity changes since last target reset. + var handler = this.entity.level().getCapability(Capabilities.ItemHandler.BLOCK, this.moveTarget.getBlockPos(), this.entity.getDepositFacing()); + if (handler == null) { //worst case scenario if block entity or entity changes since last target reset. this.resetTarget(); return; } - IItemHandler handler = handlerCapability.orElseThrow(ItemHandlerMissingException::new); ItemStack duplicate = this.entity.getItemInHand(InteractionHand.MAIN_HAND).copy(); //simulate insertion @@ -198,8 +193,8 @@ private void resetTarget() { Optional targetPos = this.entity.getDepositPosition(); targetPos.ifPresent((pos) -> { this.moveTarget = new BlockPosMoveTarget(this.entity.level(), pos); - if (!this.moveTarget.getCapability(ForgeCapabilities.ITEM_HANDLER, this.entity.getDepositFacing()) - .isPresent()) { + var handler = this.entity.level().getCapability(Capabilities.ItemHandler.BLOCK, this.moveTarget.getBlockPos(), this.entity.getDepositFacing()); + if (handler == null) { //the deposit block is not valid for depositing, so we disable this to allow exiting this task. this.entity.setDepositPosition(null); } diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/ai/goal/ExtractItemsGoal.java b/src/main/java/com/klikli_dev/occultism/common/entity/ai/goal/ExtractItemsGoal.java index a14d5ec01..1249f6bc4 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/ai/goal/ExtractItemsGoal.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/ai/goal/ExtractItemsGoal.java @@ -24,7 +24,7 @@ import com.klikli_dev.occultism.common.entity.ai.BlockSorter; import com.klikli_dev.occultism.common.entity.spirit.SpiritEntity; -import com.klikli_dev.occultism.exceptions.ItemHandlerMissingException; + import com.klikli_dev.occultism.util.Math3DUtil; import com.klikli_dev.occultism.util.StorageUtil; import net.minecraft.core.BlockPos; @@ -36,11 +36,9 @@ import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.ChestBlockEntity; import net.minecraft.world.phys.BlockHitResult; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.items.IItemHandler; -import net.minecraftforge.items.ItemHandlerHelper; - +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.items.ItemHandlerHelper; import java.util.EnumSet; import java.util.Optional; @@ -121,20 +119,17 @@ public void tick() { //when close enough extract item if (distance < accessDistance && this.canSeeTarget()) { - LazyOptional handlerCapability = blockEntity.getCapability( - ForgeCapabilities.ITEM_HANDLER, this.entity.getExtractFacing()); - if (!handlerCapability - .isPresent()) { //worst case scenario if block entity changes since last target reset. + var blockEntityHandler = this.entity.level().getCapability(Capabilities.ItemHandler.BLOCK, blockEntity.getBlockPos(),blockEntity.getBlockState(), blockEntity, this.entity.getDepositFacing()); + if (blockEntityHandler == null) { //worst case scenario if block entity or entity changes since last target reset. this.resetTarget(); return; } - IItemHandler blockEntityHandler = handlerCapability.orElseThrow(ItemHandlerMissingException::new); + IItemHandler entityHandler = - this.entity.getCapability(ForgeCapabilities.ITEM_HANDLER, Direction.DOWN) - .orElseThrow(ItemHandlerMissingException::new); + this.entity.getCapability(Capabilities.ItemHandler.ENTITY); int slot = StorageUtil.getFirstMatchingSlot(blockEntityHandler, - this.entity.getFilterItems().orElseThrow(ItemHandlerMissingException::new), this.entity.getTagFilter(), this.entity.isFilterBlacklist()); + this.entity.getFilterItems(), this.entity.getTagFilter(), this.entity.isFilterBlacklist()); if (slot >= 0) { //simulate extraction ItemStack toExtract = blockEntityHandler.extractItem(slot, Integer.MAX_VALUE, true).copy(); @@ -179,7 +174,7 @@ public boolean canSeeTarget() { /** * Opens or closes a chest * - * @param BlockEntity the chest block entity + * @param blockEntity the chest block entity * @param open true to open the chest, false to close it. */ public void toggleChest(Container blockEntity, boolean open) { @@ -196,10 +191,9 @@ private void resetTarget() { Optional targetPos = this.entity.getExtractPosition(); targetPos.ifPresent((pos) -> { this.targetBlock = pos; - BlockEntity blockEntity = this.entity.level().getBlockEntity(this.targetBlock); - if (blockEntity == null || - !blockEntity.getCapability(ForgeCapabilities.ITEM_HANDLER, this.entity.getExtractFacing()) - .isPresent()) { + + var handler = this.entity.level().getCapability(Capabilities.ItemHandler.BLOCK, this.targetBlock, this.entity.getExtractFacing()); + if (handler == null) { //the extract block is not valid for extracting, so we disable this to allow exiting this task. this.entity.setExtractPosition(null); } diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/ai/goal/ManageMachineGoal.java b/src/main/java/com/klikli_dev/occultism/common/entity/ai/goal/ManageMachineGoal.java index 3c0ae711e..0efad9679 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/ai/goal/ManageMachineGoal.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/ai/goal/ManageMachineGoal.java @@ -29,7 +29,6 @@ import com.klikli_dev.occultism.common.entity.job.ManageMachineJob; import com.klikli_dev.occultism.common.entity.spirit.SpiritEntity; import com.klikli_dev.occultism.common.misc.DepositOrder; -import com.klikli_dev.occultism.exceptions.ItemHandlerMissingException; import com.klikli_dev.occultism.util.Math3DUtil; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -41,9 +40,9 @@ import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.BlockHitResult; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.items.IItemHandler; -import net.minecraftforge.items.ItemHandlerHelper; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.items.ItemHandlerHelper; import java.util.ArrayList; import java.util.EnumSet; @@ -131,8 +130,7 @@ public void tick() { ItemStack itemToExtract = this.job.getStorageController() .getItemStack(currentOrder.comparator, currentOrder.amount, true); - IItemHandler handler = this.entity.getCapability(ForgeCapabilities.ITEM_HANDLER, - Direction.UP).orElseThrow(ItemHandlerMissingException::new); + IItemHandler handler = this.entity.getCapability(Capabilities.ItemHandler.ENTITY); if (!itemToExtract.isEmpty() && ItemHandlerHelper.insertItem(handler, itemToExtract, true).isEmpty()) { //we can insert all, so we can perform for real now @@ -150,13 +148,13 @@ public void tick() { } else if (this.targetBlock.equals(machineReference.extractGlobalPos.getPos())) { //if we reached the machine (=extract block entity), we take out the result + var machineHandler = blockEntity.getLevel().getCapability(Capabilities.ItemHandler.BLOCK, + blockEntity.getBlockPos(), blockEntity.getBlockState(), blockEntity, + machineReference.extractFacing); - blockEntity.getCapability(ForgeCapabilities.ITEM_HANDLER, - machineReference.extractFacing).ifPresent(machineHandler -> { + if (machineHandler != null) { - IItemHandler entityHandler = this.entity.getCapability( - ForgeCapabilities.ITEM_HANDLER, Direction.UP) - .orElseThrow(ItemHandlerMissingException::new); + IItemHandler entityHandler = this.entity.getCapability(Capabilities.ItemHandler.ENTITY); boolean movedAnyItems = false; for (int i = 0; i < machineHandler.getSlots(); i++) { @@ -188,7 +186,7 @@ public void tick() { this.targetBlock = null; } - }); + } } this.stop(); } @@ -250,44 +248,49 @@ protected BlockEntity findClosestStorageProxy() { private boolean startTargetingStorageController(DepositOrder depositOrder, MachineReference machineReference, BlockEntity machine, IStorageController storageController) { - return machine.getCapability(ForgeCapabilities.ITEM_HANDLER, machineReference.insertFacing) - .map(machineItemHandler -> { - //simulate taking and inserting items to ensure we have space - ItemStack orderStack = storageController - .getItemStack(depositOrder.comparator, depositOrder.amount, - true); - if (!orderStack.isEmpty() && - ItemHandlerHelper.insertItem(machineItemHandler, orderStack, true).isEmpty()) { - //if we can insert everything we can get for this order, perform it. - BlockEntity storageControllerProxy = this.findClosestStorageProxy(); - if (storageControllerProxy != null) { - this.targetBlock = storageControllerProxy.getBlockPos(); - return true; - } - //no proxy in range, so we just skip this task which will lead to idle. - this.targetBlock = null; - return true; - } else if (!orderStack.isEmpty()) { - //returning false leads to a call to startTargetingMachine - return false; - } - return false; - }).orElse(false); + + var machineItemHandler = machine.getLevel().getCapability(Capabilities.ItemHandler.BLOCK, + machine.getBlockPos(), machine.getBlockState(), machine, machineReference.insertFacing); + if (machineItemHandler == null) + return false; + + //simulate taking and inserting items to ensure we have space + ItemStack orderStack = storageController + .getItemStack(depositOrder.comparator, depositOrder.amount, + true); + if (!orderStack.isEmpty() && + ItemHandlerHelper.insertItem(machineItemHandler, orderStack, true).isEmpty()) { + //if we can insert everything we can get for this order, perform it. + BlockEntity storageControllerProxy = this.findClosestStorageProxy(); + if (storageControllerProxy != null) { + this.targetBlock = storageControllerProxy.getBlockPos(); + return true; + } + //no proxy in range, so we just skip this task which will lead to idle. + this.targetBlock = null; + return true; + } else if (!orderStack.isEmpty()) { + //returning false leads to a call to startTargetingMachine + return false; + } + return false; } private boolean startTargetingExtractBlockEntity(DepositOrder depositOrder, MachineReference machineReference, BlockEntity extractBlockEntity, IStorageController storageController) { - return extractBlockEntity.getCapability(ForgeCapabilities.ITEM_HANDLER, machineReference.extractFacing) - .map(machineItemHandler -> { - for (int i = 0; i < machineItemHandler.getSlots(); i++) { - if (!machineItemHandler.getStackInSlot(i).isEmpty()) { - this.targetBlock = extractBlockEntity.getBlockPos(); - return true; - } - } - this.targetBlock = null; - return false; - }).orElse(false); + var machineItemHandler = extractBlockEntity.getLevel().getCapability(Capabilities.ItemHandler.BLOCK, + extractBlockEntity.getBlockPos(), extractBlockEntity.getBlockState(), extractBlockEntity, machineReference.extractFacing); + if (machineItemHandler == null) + return false; + + for (int i = 0; i < machineItemHandler.getSlots(); i++) { + if (!machineItemHandler.getStackInSlot(i).isEmpty()) { + this.targetBlock = extractBlockEntity.getBlockPos(); + return true; + } + } + this.targetBlock = null; + return false; } private void resetTarget() { @@ -300,8 +303,9 @@ private void resetTarget() { if (machine != null && extractBlockEntity != null && storageController != null) { //machine was replaced or no longer supports inventories, so we unlink it and abort - if (!machine.getCapability(ForgeCapabilities.ITEM_HANDLER, machineReference.insertFacing).isPresent() || - !extractBlockEntity.getCapability(ForgeCapabilities.ITEM_HANDLER, machineReference.extractFacing).isPresent()) { + if (machine.getLevel().getCapability(Capabilities.ItemHandler.BLOCK, + machine.getBlockPos(), machine.getBlockState(), machine, machineReference.insertFacing) == null || + extractBlockEntity.getLevel().getCapability(Capabilities.ItemHandler.BLOCK, extractBlockEntity.getBlockPos(), extractBlockEntity.getBlockState(), extractBlockEntity, machineReference.extractFacing) == null) { this.job.setManagedMachine(null); this.targetBlock = null; return; diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/ai/goal/PickupItemsGoal.java b/src/main/java/com/klikli_dev/occultism/common/entity/ai/goal/PickupItemsGoal.java index 4777201b3..8437ca166 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/ai/goal/PickupItemsGoal.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/ai/goal/PickupItemsGoal.java @@ -25,14 +25,13 @@ import com.google.common.base.Predicate; import com.klikli_dev.occultism.common.entity.ai.EntitySorter; import com.klikli_dev.occultism.common.entity.spirit.SpiritEntity; -import com.klikli_dev.occultism.exceptions.ItemHandlerMissingException; + import net.minecraft.world.entity.ai.goal.target.TargetGoal; import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.item.ItemStack; import net.minecraft.world.phys.AABB; -import net.minecraftforge.items.ItemHandlerHelper; -import net.minecraftforge.items.ItemStackHandler; - +import net.neoforged.neoforge.items.ItemHandlerHelper; +import net.neoforged.neoforge.items.ItemStackHandler; import javax.annotation.Nullable; import java.util.EnumSet; import java.util.List; @@ -62,7 +61,7 @@ public PickupItemsGoal(SpiritEntity entity, float pickupRange, int executionChan public boolean apply(@Nullable ItemEntity item) { ItemStack stack = item.getItem(); return !stack.isEmpty() && entity.canPickupItem(item) && ItemHandlerHelper.insertItemStacked( - entity.itemStackHandler.orElseThrow(ItemHandlerMissingException::new), stack, true).getCount() < + entity.inventory, stack, true).getCount() < stack.getCount(); } @@ -112,7 +111,7 @@ public void tick() { this.entity.getNavigation().stop(); ItemStack duplicate = this.targetItem.getItem().copy(); - ItemStackHandler handler = this.entity.itemStackHandler.orElseThrow(ItemHandlerMissingException::new); + ItemStackHandler handler = this.entity.inventory; if (ItemHandlerHelper.insertItemStacked(handler, duplicate, true).getCount() < duplicate.getCount()) { ItemStack remaining = ItemHandlerHelper.insertItemStacked(handler, duplicate, false); this.targetItem.getItem().setCount(remaining.getCount()); diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/ai/sensor/NearestJobItemSensor.java b/src/main/java/com/klikli_dev/occultism/common/entity/ai/sensor/NearestJobItemSensor.java index 9a0e91b4b..333ae6e2c 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/ai/sensor/NearestJobItemSensor.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/ai/sensor/NearestJobItemSensor.java @@ -3,8 +3,8 @@ import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.OccultismConstants; import com.klikli_dev.occultism.common.entity.spirit.SpiritEntity; -import com.klikli_dev.occultism.network.MessageSelectBlock; -import com.klikli_dev.occultism.network.OccultismPackets; +import com.klikli_dev.occultism.network.messages.MessageSelectBlock; +import com.klikli_dev.occultism.network.Networking; import com.klikli_dev.occultism.registry.OccultismMemoryTypes; import com.klikli_dev.occultism.registry.OccultismSensors; import it.unimi.dsi.fastutil.objects.ObjectArrayList; @@ -17,7 +17,6 @@ import net.tslat.smartbrainlib.api.core.sensor.PredicateSensor; import net.tslat.smartbrainlib.util.BrainUtils; import net.tslat.smartbrainlib.util.EntityRetrievalUtil; - import java.util.List; public class NearestJobItemSensor extends PredicateSensor { @@ -46,7 +45,7 @@ protected void doTick(ServerLevel level, E entity) { if (BrainUtils.hasMemory(entity, MemoryModuleType.NEAREST_VISIBLE_WANTED_ITEM)) { var nearestEntity = BrainUtils.getMemory(entity, MemoryModuleType.NEAREST_VISIBLE_WANTED_ITEM); if (Occultism.DEBUG.debugAI) { - OccultismPackets.sendToTracking(entity, new MessageSelectBlock(nearestEntity.blockPosition(), 5000, OccultismConstants.Color.GREEN)); + Networking.sendToTracking(entity, new MessageSelectBlock(nearestEntity.blockPosition(), 5000, OccultismConstants.Color.GREEN)); } return; } @@ -55,19 +54,19 @@ protected void doTick(ServerLevel level, E entity) { var workAreaSize = BrainUtils.getMemory(entity, OccultismMemoryTypes.WORK_AREA_SIZE.get()); if (Occultism.DEBUG.debugAI) { - OccultismPackets.sendToTracking(entity, new MessageSelectBlock(workAreaCenter, 5000, OccultismConstants.Color.BLUE)); - OccultismPackets.sendToTracking(entity, new MessageSelectBlock(workAreaCenter.offset(workAreaSize / 2, workAreaSize / 2, workAreaSize / 2), 5000, OccultismConstants.Color.CYAN)); - OccultismPackets.sendToTracking(entity, new MessageSelectBlock(workAreaCenter.offset(-workAreaSize / 2, -workAreaSize / 2, -workAreaSize / 2), 5000, OccultismConstants.Color.CYAN)); - OccultismPackets.sendToTracking(entity, new MessageSelectBlock(workAreaCenter.offset(workAreaSize / 2, workAreaSize / 2, -workAreaSize / 2), 5000, OccultismConstants.Color.CYAN)); - OccultismPackets.sendToTracking(entity, new MessageSelectBlock(workAreaCenter.offset(-workAreaSize / 2, -workAreaSize / 2, workAreaSize / 2), 5000, OccultismConstants.Color.CYAN)); - OccultismPackets.sendToTracking(entity, new MessageSelectBlock(workAreaCenter.offset(workAreaSize / 2, -workAreaSize / 2, workAreaSize / 2), 5000, OccultismConstants.Color.CYAN)); - OccultismPackets.sendToTracking(entity, new MessageSelectBlock(workAreaCenter.offset(-workAreaSize / 2, workAreaSize / 2, -workAreaSize / 2), 5000, OccultismConstants.Color.CYAN)); - OccultismPackets.sendToTracking(entity, new MessageSelectBlock(workAreaCenter.offset(-workAreaSize / 2, workAreaSize / 2, workAreaSize / 2), 5000, OccultismConstants.Color.CYAN)); - OccultismPackets.sendToTracking(entity, new MessageSelectBlock(workAreaCenter.offset(workAreaSize / 2, -workAreaSize / 2, -workAreaSize / 2), 5000, OccultismConstants.Color.CYAN)); + Networking.sendToTracking(entity, new MessageSelectBlock(workAreaCenter, 5000, OccultismConstants.Color.BLUE)); + Networking.sendToTracking(entity, new MessageSelectBlock(workAreaCenter.offset(workAreaSize / 2, workAreaSize / 2, workAreaSize / 2), 5000, OccultismConstants.Color.CYAN)); + Networking.sendToTracking(entity, new MessageSelectBlock(workAreaCenter.offset(-workAreaSize / 2, -workAreaSize / 2, -workAreaSize / 2), 5000, OccultismConstants.Color.CYAN)); + Networking.sendToTracking(entity, new MessageSelectBlock(workAreaCenter.offset(workAreaSize / 2, workAreaSize / 2, -workAreaSize / 2), 5000, OccultismConstants.Color.CYAN)); + Networking.sendToTracking(entity, new MessageSelectBlock(workAreaCenter.offset(-workAreaSize / 2, -workAreaSize / 2, workAreaSize / 2), 5000, OccultismConstants.Color.CYAN)); + Networking.sendToTracking(entity, new MessageSelectBlock(workAreaCenter.offset(workAreaSize / 2, -workAreaSize / 2, workAreaSize / 2), 5000, OccultismConstants.Color.CYAN)); + Networking.sendToTracking(entity, new MessageSelectBlock(workAreaCenter.offset(-workAreaSize / 2, workAreaSize / 2, -workAreaSize / 2), 5000, OccultismConstants.Color.CYAN)); + Networking.sendToTracking(entity, new MessageSelectBlock(workAreaCenter.offset(-workAreaSize / 2, workAreaSize / 2, workAreaSize / 2), 5000, OccultismConstants.Color.CYAN)); + Networking.sendToTracking(entity, new MessageSelectBlock(workAreaCenter.offset(workAreaSize / 2, -workAreaSize / 2, -workAreaSize / 2), 5000, OccultismConstants.Color.CYAN)); } - var aabb = new AABB(workAreaCenter.offset(-workAreaSize / 2, -workAreaSize / 2, -workAreaSize / 2), - workAreaCenter.offset(workAreaSize / 2, workAreaSize / 2, workAreaSize / 2)); + var aabb = new AABB(workAreaCenter.getCenter().add(-workAreaSize / 2f, -workAreaSize / 2f, -workAreaSize / 2f), + workAreaCenter.getCenter().add(workAreaSize / 2f, workAreaSize / 2f, workAreaSize / 2f)); ItemEntity nearestEntity = EntityRetrievalUtil.getNearestEntity(level, aabb, entity.position(), (obj) -> { @@ -80,7 +79,7 @@ protected void doTick(ServerLevel level, E entity) { BrainUtils.setMemory(entity, MemoryModuleType.NEAREST_VISIBLE_WANTED_ITEM, nearestEntity); if (Occultism.DEBUG.debugAI && nearestEntity != null) { - OccultismPackets.sendToTracking(entity, new MessageSelectBlock(nearestEntity.blockPosition(), 5000, OccultismConstants.Color.GREEN)); + Networking.sendToTracking(entity, new MessageSelectBlock(nearestEntity.blockPosition(), 5000, OccultismConstants.Color.GREEN)); } } diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/ai/sensor/NearestTreeSensor.java b/src/main/java/com/klikli_dev/occultism/common/entity/ai/sensor/NearestTreeSensor.java index 55f3adf73..74bcdee21 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/ai/sensor/NearestTreeSensor.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/ai/sensor/NearestTreeSensor.java @@ -4,8 +4,8 @@ import com.klikli_dev.occultism.OccultismConstants; import com.klikli_dev.occultism.common.entity.ai.BlockSorter; import com.klikli_dev.occultism.common.entity.spirit.SpiritEntity; -import com.klikli_dev.occultism.network.MessageSelectBlock; -import com.klikli_dev.occultism.network.OccultismPackets; +import com.klikli_dev.occultism.network.messages.MessageSelectBlock; +import com.klikli_dev.occultism.network.Networking; import com.klikli_dev.occultism.registry.OccultismMemoryTypes; import com.klikli_dev.occultism.registry.OccultismSensors; import com.klikli_dev.occultism.registry.OccultismTags; @@ -21,7 +21,6 @@ import net.tslat.smartbrainlib.api.core.sensor.ExtendedSensor; import net.tslat.smartbrainlib.util.BrainUtils; import org.jetbrains.annotations.NotNull; - import java.util.HashSet; import java.util.List; import java.util.stream.Collectors; @@ -84,10 +83,10 @@ protected void doTick(@NotNull ServerLevel level, @NotNull E entity) { if (Occultism.DEBUG.debugAI) { for (var tree : unreachableTrees) { - OccultismPackets.sendToTracking(entity, new MessageSelectBlock(tree, 10000, OccultismConstants.Color.ORANGE)); + Networking.sendToTracking(entity, new MessageSelectBlock(tree, 10000, OccultismConstants.Color.ORANGE)); } for (var tree : nonTreeLogs) { - OccultismPackets.sendToTracking(entity, new MessageSelectBlock(tree, 10000, OccultismConstants.Color.ORANGE)); + Networking.sendToTracking(entity, new MessageSelectBlock(tree, 10000, OccultismConstants.Color.ORANGE)); } } @@ -115,7 +114,7 @@ && isTreeSoil(level, pos.below()) for (var potentialStump : potentialStumps) { if (Occultism.DEBUG.debugAI) { - OccultismPackets.sendToTracking(entity, new MessageSelectBlock(potentialStump, 5000, OccultismConstants.Color.WHITE)); + Networking.sendToTracking(entity, new MessageSelectBlock(potentialStump, 5000, OccultismConstants.Color.WHITE)); } //we only check if the stump is actually a tree one by one from closest to furthest to save perf. @@ -132,7 +131,7 @@ && isTreeSoil(level, pos.below()) if (isReachable) { if (Occultism.DEBUG.debugAI) { - OccultismPackets.sendToTracking(entity, new MessageSelectBlock(potentialStump, 50000, 0x800080)); + Networking.sendToTracking(entity, new MessageSelectBlock(potentialStump, 50000, 0x800080)); } BrainUtils.setMemory(entity, OccultismMemoryTypes.NEAREST_TREE.get(), potentialStump); @@ -145,7 +144,7 @@ && isTreeSoil(level, pos.below()) BrainUtils.setMemory(entity, OccultismMemoryTypes.NON_TREE_LOGS.get(), nonTreeLogs); if (Occultism.DEBUG.debugAI) { - OccultismPackets.sendToTracking(entity, new MessageSelectBlock(potentialStump, 50000, 0xffff00)); + Networking.sendToTracking(entity, new MessageSelectBlock(potentialStump, 50000, 0xffff00)); } } } diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/ai/sensor/UnreachableTreeWalkTargetSensor.java b/src/main/java/com/klikli_dev/occultism/common/entity/ai/sensor/UnreachableTreeWalkTargetSensor.java index 21d6ecdf9..b287a65af 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/ai/sensor/UnreachableTreeWalkTargetSensor.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/ai/sensor/UnreachableTreeWalkTargetSensor.java @@ -2,8 +2,8 @@ import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.OccultismConstants; -import com.klikli_dev.occultism.network.MessageSelectBlock; -import com.klikli_dev.occultism.network.OccultismPackets; +import com.klikli_dev.occultism.network.messages.MessageSelectBlock; +import com.klikli_dev.occultism.network.Networking; import com.klikli_dev.occultism.registry.OccultismMemoryTypes; import com.klikli_dev.occultism.registry.OccultismSensors; import it.unimi.dsi.fastutil.objects.ObjectArrayList; @@ -14,7 +14,6 @@ import net.minecraft.world.entity.ai.sensing.SensorType; import net.tslat.smartbrainlib.api.core.sensor.ExtendedSensor; import net.tslat.smartbrainlib.util.BrainUtils; - import java.util.List; public class UnreachableTreeWalkTargetSensor extends ExtendedSensor { @@ -56,7 +55,7 @@ protected void doTick(ServerLevel level, E entity) { BrainUtils.setMemory(brain, OccultismMemoryTypes.WALK_TARGET_UNREACHABLE.get(), walkTarget.getTarget().currentBlockPosition().getY() > entity.getEyeY()); BrainUtils.clearMemory(brain, OccultismMemoryTypes.LAST_TREE_WALK_TARGET.get()); if (Occultism.DEBUG.debugAI) { - OccultismPackets.sendToTracking(entity, new MessageSelectBlock(walkTarget.getTarget().currentBlockPosition(), 50000, OccultismConstants.Color.RED)); + Networking.sendToTracking(entity, new MessageSelectBlock(walkTarget.getTarget().currentBlockPosition(), 50000, OccultismConstants.Color.RED)); } } diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/ai/target/BlockPosMoveTarget.java b/src/main/java/com/klikli_dev/occultism/common/entity/ai/target/BlockPosMoveTarget.java index 57a7444ca..4b5585126 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/ai/target/BlockPosMoveTarget.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/ai/target/BlockPosMoveTarget.java @@ -27,9 +27,6 @@ import net.minecraft.world.Container; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.util.LazyOptional; - import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -57,14 +54,4 @@ public boolean isValid() { public boolean isChest() { return this.level.getBlockEntity(this.target) instanceof Container; } - - @Nonnull - @Override - public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { - BlockEntity blockEntity = this.level.getBlockEntity(this.target); - if (blockEntity != null) { - return blockEntity.getCapability(cap, side); - } - return LazyOptional.empty(); - } } diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/ai/target/EntityMoveTarget.java b/src/main/java/com/klikli_dev/occultism/common/entity/ai/target/EntityMoveTarget.java index 059bbe9b6..8ebef06d2 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/ai/target/EntityMoveTarget.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/ai/target/EntityMoveTarget.java @@ -23,13 +23,7 @@ package com.klikli_dev.occultism.common.entity.ai.target; import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; import net.minecraft.world.entity.Entity; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.util.LazyOptional; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; public class EntityMoveTarget implements IMoveTarget { @@ -53,10 +47,4 @@ public boolean isValid() { public boolean isChest() { return false; } - - @Nonnull - @Override - public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { - return this.target.getCapability(cap, side); - } } diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/ai/target/IMoveTarget.java b/src/main/java/com/klikli_dev/occultism/common/entity/ai/target/IMoveTarget.java index 4948dd2ed..2cdb2d44b 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/ai/target/IMoveTarget.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/ai/target/IMoveTarget.java @@ -23,9 +23,8 @@ package com.klikli_dev.occultism.common.entity.ai.target; import net.minecraft.core.BlockPos; -import net.minecraftforge.common.capabilities.ICapabilityProvider; -public interface IMoveTarget extends ICapabilityProvider { +public interface IMoveTarget { BlockPos getBlockPos(); boolean isValid(); diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/BatFamiliarEntity.java b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/BatFamiliarEntity.java index 1b86368fd..e533a5140 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/BatFamiliarEntity.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/BatFamiliarEntity.java @@ -69,7 +69,7 @@ public static AttributeSupplier.Builder createAttributes() { @Override public void setFamiliarOwner(LivingEntity owner) { if (this.hasRibbon()) - OccultismAdvancements.FAMILIAR.trigger(owner, FamiliarTrigger.Type.RARE_VARIANT); + OccultismAdvancements.FAMILIAR.get().trigger(owner, FamiliarTrigger.Type.RARE_VARIANT); super.setFamiliarOwner(owner); } @@ -193,7 +193,7 @@ public boolean canUse() { public void start() { if (this.nearby != null) { this.nearby.hurt(this.bat.damageSources().mobAttack(this.bat), 10); - OccultismAdvancements.FAMILIAR.trigger(this.bat.getFamiliarOwner(), FamiliarTrigger.Type.BAT_EAT); + OccultismAdvancements.FAMILIAR.get().trigger(this.bat.getFamiliarOwner(), FamiliarTrigger.Type.BAT_EAT); } } diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/BeaverFamiliarEntity.java b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/BeaverFamiliarEntity.java index 783c94c3e..d14013e19 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/BeaverFamiliarEntity.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/BeaverFamiliarEntity.java @@ -43,7 +43,8 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.ServerLevelAccessor; import net.minecraft.world.level.pathfinder.BlockPathTypes; -import net.minecraftforge.common.ForgeMod; +import net.neoforged.neoforge.common.NeoForgeMod; +import net.neoforged.neoforge.fluids.FluidType; import javax.annotation.Nullable; import java.util.EnumSet; @@ -66,7 +67,7 @@ public BeaverFamiliarEntity(EntityType type, Lev } public static AttributeSupplier.Builder createAttributes() { - return FamiliarEntity.createMobAttributes().add(ForgeMod.SWIM_SPEED.get(), 1f); + return FamiliarEntity.createMobAttributes().add(NeoForgeMod.SWIM_SPEED.value(), 1f); } @Override @@ -85,7 +86,7 @@ public void updateSwimming() { @Override public void setFamiliarOwner(LivingEntity owner) { if (this.hasBigTail()) - OccultismAdvancements.FAMILIAR.trigger(owner, FamiliarTrigger.Type.RARE_VARIANT); + OccultismAdvancements.FAMILIAR.get().trigger(owner, FamiliarTrigger.Type.RARE_VARIANT); super.setFamiliarOwner(owner); } @@ -110,8 +111,8 @@ public SpawnGroupData finalizeSpawn(ServerLevelAccessor pLevel, DifficultyInstan } @Override - public boolean canBreatheUnderwater() { - return true; + public boolean canDrownInFluidType(FluidType type) { + return false; } public boolean hasWhiskers() { @@ -206,7 +207,7 @@ public void tick() { for (BlockPos p : harvesting) this.beaver.level().destroyBlock(p, true); this.beaver.treeTarget = null; - OccultismAdvancements.FAMILIAR.trigger(this.beaver.getFamiliarOwner(), FamiliarTrigger.Type.BEAVER_WOODCHOP); + OccultismAdvancements.FAMILIAR.get().trigger(this.beaver.getFamiliarOwner(), FamiliarTrigger.Type.BEAVER_WOODCHOP); } } } diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/BeholderFamiliarEntity.java b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/BeholderFamiliarEntity.java index 8b30e358f..71b62a984 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/BeholderFamiliarEntity.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/BeholderFamiliarEntity.java @@ -24,8 +24,8 @@ import com.google.common.collect.ImmutableList; import com.klikli_dev.occultism.common.advancement.FamiliarTrigger; -import com.klikli_dev.occultism.network.MessageBeholderAttack; -import com.klikli_dev.occultism.network.OccultismPackets; +import com.klikli_dev.occultism.network.Networking; +import com.klikli_dev.occultism.network.messages.MessageBeholderAttack; import com.klikli_dev.occultism.registry.OccultismAdvancements; import com.klikli_dev.occultism.util.FamiliarUtil; import net.minecraft.core.BlockPos; @@ -165,13 +165,13 @@ public float getAnimationHeight(float partialTicks) { if (this.isSitting()) return -0.44f; - return 1 + Mth.cos((this.tickCount + this.heightOffset + partialTicks) / 5f) * 0.1f; + return 1 + Mth.cos((this.tickCount + this.heightOffset + partialTicks) / 5f) * 0.1f; } @Override public void setFamiliarOwner(LivingEntity owner) { if (this.hasTongue()) - OccultismAdvancements.FAMILIAR.trigger(owner, FamiliarTrigger.Type.RARE_VARIANT); + OccultismAdvancements.FAMILIAR.get().trigger(owner, FamiliarTrigger.Type.RARE_VARIANT); super.setFamiliarOwner(owner); } @@ -295,7 +295,7 @@ public void tick() { this.targetIds = enemies; this.cooldown = MAX_COOLDOWN; this.attackTimer = 23; - OccultismPackets.sendToTracking(this.entity, + Networking.sendToTracking(this.entity, new MessageBeholderAttack(this.entity.getId(), this.targetIds)); } @@ -315,7 +315,7 @@ private List getNearbyEnemies() { protected void attack() { LivingEntity owner = this.entity.getFamiliarOwner(); - OccultismAdvancements.FAMILIAR.trigger(owner, FamiliarTrigger.Type.BEHOLDER_RAY); + OccultismAdvancements.FAMILIAR.get().trigger(owner, FamiliarTrigger.Type.BEHOLDER_RAY); for (int id : this.targetIds) { Entity e = this.entity.level().getEntity(id); @@ -361,7 +361,7 @@ public void start() { this.entity.addEffect(new MobEffectInstance(MobEffects.DAMAGE_BOOST, EAT_EFFECT_DURATION, 0, false, false)); this.entity.addEffect(new MobEffectInstance(MobEffects.MOVEMENT_SPEED, EAT_EFFECT_DURATION, 0, false, false)); - OccultismAdvancements.FAMILIAR.trigger(owner, FamiliarTrigger.Type.BEHOLDER_EAT); + OccultismAdvancements.FAMILIAR.get().trigger(owner, FamiliarTrigger.Type.BEHOLDER_EAT); } } diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/BlacksmithFamiliarEntity.java b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/BlacksmithFamiliarEntity.java index 94f669a97..5f21ac85d 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/BlacksmithFamiliarEntity.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/BlacksmithFamiliarEntity.java @@ -42,9 +42,8 @@ import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; import net.minecraft.world.level.ServerLevelAccessor; -import net.minecraftforge.common.ForgeConfigSpec.ConfigValue; -import net.minecraftforge.common.Tags; - +import net.neoforged.neoforge.common.ModConfigSpec.ConfigValue; +import net.neoforged.neoforge.common.Tags; import javax.annotation.Nullable; import java.util.EnumSet; @@ -101,7 +100,7 @@ protected InteractionResult mobInteract(Player playerIn, InteractionHand hand) { @Override public void setFamiliarOwner(LivingEntity owner) { if (this.hasEarring()) - OccultismAdvancements.FAMILIAR.trigger(owner, FamiliarTrigger.Type.RARE_VARIANT); + OccultismAdvancements.FAMILIAR.get().trigger(owner, FamiliarTrigger.Type.RARE_VARIANT); super.setFamiliarOwner(owner); } @@ -224,7 +223,7 @@ public void tick() { if (this.target.canBlacksmithUpgrade()) { this.target.blacksmithUpgrade(); this.blacksmith.changeIronCount(-UPGRADE_COST.get()); - OccultismAdvancements.FAMILIAR.trigger(this.blacksmith.getFamiliarOwner(), + OccultismAdvancements.FAMILIAR.get().trigger(this.blacksmith.getFamiliarOwner(), FamiliarTrigger.Type.BLACKSMITH_UPGRADE); } this.target = null; diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/ChimeraFamiliarEntity.java b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/ChimeraFamiliarEntity.java index 5351a98ce..504d76706 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/ChimeraFamiliarEntity.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/ChimeraFamiliarEntity.java @@ -35,6 +35,7 @@ import net.minecraft.world.DifficultyInstance; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; +import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.effect.MobEffects; import net.minecraft.world.entity.*; @@ -52,13 +53,14 @@ import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; import net.minecraft.world.level.ServerLevelAccessor; +import net.minecraft.world.phys.Vec2; import net.minecraft.world.phys.Vec3; import javax.annotation.Nullable; import java.util.List; import java.util.UUID; -public class ChimeraFamiliarEntity extends ResizableFamiliarEntity implements ItemSteerable { +public class ChimeraFamiliarEntity extends ResizableFamiliarEntity implements ItemSteerable, PlayerRideableJumping { public static final byte NO_ATTACKER = 0; public static final byte LION_ATTACKER = 1; @@ -68,16 +70,16 @@ public class ChimeraFamiliarEntity extends ResizableFamiliarEntity implements It private static final UUID DAMAGE_BONUS = UUID.fromString("fdaa6165-abdf-4b85-aed6-199086f6a5ee"); private static final byte RIDING_SIZE = 80; private static final double SHRINK_CHANCE = 0.005; - private static final int JUMP_COOLDOWN = 20 * 2; private static final int ATTACK_TIME = 10; private static final EntityDataAccessor ATTACKER = SynchedEntityData.defineId(ChimeraFamiliarEntity.class, EntityDataSerializers.BYTE); private final ItemBasedSteering boost = new DummyBoostHelper(); - private int jumpTimer; private int goatNoseTimer; private int attackTimer; + private float playerJumpPendingScale; + private boolean isJumping; public ChimeraFamiliarEntity(EntityType type, Level level) { super(type, level); @@ -85,7 +87,12 @@ public ChimeraFamiliarEntity(EntityType type, L } public static AttributeSupplier.Builder createAttributes() { - return createMobAttributes().add(Attributes.ATTACK_DAMAGE, 4).add(Attributes.MOVEMENT_SPEED, 0.25).add(Attributes.MAX_HEALTH, 20); + return createMobAttributes() + .add(Attributes.ATTACK_DAMAGE, 4) + .add(Attributes.MOVEMENT_SPEED, 0.25) + .add(Attributes.MAX_HEALTH, 20) + .add(Attributes.JUMP_STRENGTH, 0.7) + ; } private boolean isRiderJumping(Player rider) { @@ -109,9 +116,6 @@ public void tick() { if (!this.level().isClientSide && this.getRandom().nextDouble() < SHRINK_CHANCE) this.setSize((byte) (this.getSize() - 1)); - if (this.jumpTimer > 0) - this.jumpTimer--; - this.attackTimer--; if (this.attackTimer == 0) this.setAttacker(NO_ATTACKER); @@ -278,6 +282,11 @@ public float getAttackProgress(float partialTicks) { return (ATTACK_TIME - this.attackTimer + partialTicks) / (float) ATTACK_TIME; } + @Override + public Vec3 getPassengerRidingPosition(Entity pEntity) { + return super.getPassengerRidingPosition(pEntity).subtract(0, 0.6, 0); + } + @Override protected InteractionResult mobInteract(Player playerIn, InteractionHand hand) { ItemStack stack = playerIn.getItemInHand(hand); @@ -290,7 +299,7 @@ protected InteractionResult mobInteract(Player playerIn, InteractionHand hand) { this.getSize(), this.getFamiliarOwner()); goat.setPos(this.getX(), this.getY(), this.getZ()); this.level().addFreshEntity(goat); - OccultismAdvancements.FAMILIAR.trigger(playerIn, FamiliarTrigger.Type.GOAT_DETACH); + OccultismAdvancements.FAMILIAR.get().trigger(playerIn, FamiliarTrigger.Type.GOAT_DETACH); } return InteractionResult.sidedSuccess(this.level().isClientSide); } @@ -303,7 +312,7 @@ protected InteractionResult mobInteract(Player playerIn, InteractionHand hand) { && this.getFamiliarOwner() == playerIn && this.getSize() > RIDING_SIZE) { if (!this.level().isClientSide) { playerIn.startRiding(this); - OccultismAdvancements.FAMILIAR.trigger(playerIn, FamiliarTrigger.Type.CHIMERA_RIDE); + OccultismAdvancements.FAMILIAR.get().trigger(playerIn, FamiliarTrigger.Type.CHIMERA_RIDE); } return InteractionResult.sidedSuccess(this.level().isClientSide); } @@ -314,7 +323,7 @@ protected InteractionResult mobInteract(Player playerIn, InteractionHand hand) { @Override public void setFamiliarOwner(LivingEntity owner) { if (this.hasHat()) - OccultismAdvancements.FAMILIAR.trigger(owner, FamiliarTrigger.Type.RARE_VARIANT); + OccultismAdvancements.FAMILIAR.get().trigger(owner, FamiliarTrigger.Type.RARE_VARIANT); super.setFamiliarOwner(owner); } @@ -329,21 +338,70 @@ protected void tickRidden(Player rider, Vec3 travelVec) { this.setRot(rider.getYRot(), rider.getXRot() * 0.5F); this.yRotO = this.yBodyRot = this.yHeadRot = this.getYRot(); this.boost.tickBoost(); + + if (this.isControlledByLocalInstance()) { +// if (travelVec.z <= 0.0) { +// this.gallopSoundCounter = 0; +// } + + if (this.onGround()) { + this.setIsJumping(false); + if (this.playerJumpPendingScale > 0.0F && !this.isJumping()) { + this.executeRidersJump(this.playerJumpPendingScale, travelVec); + } + + this.playerJumpPendingScale = 0.0F; + } + } + } + + public double getCustomJump() { + return this.getAttributeValue(Attributes.JUMP_STRENGTH) * 2; } + + protected void executeRidersJump(float pPlayerJumpPendingScale, Vec3 pTravelVector) { + double d0 = this.getCustomJump() * (double)pPlayerJumpPendingScale * (double)this.getBlockJumpFactor(); + double d1 = d0 + (double)this.getJumpBoostPower(); + Vec3 vec3 = this.getDeltaMovement(); + this.setDeltaMovement(vec3.x, d1, vec3.z); + this.setIsJumping(true); + this.hasImpulse = true; + net.neoforged.neoforge.common.CommonHooks.onLivingJump(this); + if (pTravelVector.z > 0.0) { + float f = Mth.sin(this.getYRot() * (float) (Math.PI / 180.0)); + float f1 = Mth.cos(this.getYRot() * (float) (Math.PI / 180.0)); + this.setDeltaMovement(this.getDeltaMovement().add((double)(-0.4F * f * pPlayerJumpPendingScale), 0.0, (double)(0.4F * f1 * pPlayerJumpPendingScale))); + } + } + + public boolean isJumping() { + return this.isJumping; + } + + public void setIsJumping(boolean pJumping) { + this.isJumping = pJumping; + } + + @Override protected Vec3 getRiddenInput(Player rider, Vec3 travelVec) { +// if (this.onGround() && this.playerJumpPendingScale == 0.0F) {// && this.isStanding() && !this.allowStandSliding) { +// return Vec3.ZERO; +// } else { +// float forward = rider.zza; +// float strafe = rider.xxa * 0.5f; +// +// if (forward < 0) +// forward *= 0.25f; +// +// return new Vec3(strafe, 0, forward); +// } + if (this.isVehicle()) { float forward = rider.zza; float strafe = rider.xxa * 0.5f; - if (this.isRiderJumping(rider) && this.onGround() && this.jumpTimer <= 0) { - this.jumpTimer = JUMP_COOLDOWN; - Vec3 forwardDirection = Vec3.directionFromRotation(0, this.yRotO).scale(0.7); - this.setDeltaMovement(this.getDeltaMovement().add(forwardDirection.x, 0, forwardDirection.z)); - this.jumpFromGround(); - } - if (forward < 0) forward *= 0.25f; @@ -379,10 +437,6 @@ protected float nextStep() { return this.moveDist + 1.6f; } - @Override - public double getPassengersRidingOffset() { - return super.getPassengersRidingOffset() * 0.6; - } @Nullable public LivingEntity getControllingPassenger() { @@ -391,6 +445,43 @@ public LivingEntity getControllingPassenger() { return null; } + @Override + public void onPlayerJump(int pJumpPower) { + if (pJumpPower < 0) { + pJumpPower = 0; + } else { +// this.allowStandSliding = true; +// this.standIfPossible(); + } + + if (pJumpPower >= 90) { + this.playerJumpPendingScale = 1.0F; + } else { + this.playerJumpPendingScale = 0.6F + 0.4F * (float)pJumpPower / 90.0F; + } + } + + @Override + public boolean canJump() { + return true; + } + + @Override + public boolean causeFallDamage(float pFallDistance, float pMultiplier, DamageSource pSource) { + return false; + } + + @Override + public void handleStartJump(int pJumpPower) { +// this.allowStandSliding = true; +// this.standIfPossible(); +// this.playJumpSound(); + } + + @Override + public void handleStopJump() { + } + private static class DummyBoostHelper extends ItemBasedSteering { public DummyBoostHelper() { diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/CthulhuFamiliarEntity.java b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/CthulhuFamiliarEntity.java index 05141a382..5fc2a7b81 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/CthulhuFamiliarEntity.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/CthulhuFamiliarEntity.java @@ -53,7 +53,8 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.pathfinder.BlockPathTypes; import net.minecraft.world.phys.Vec3; -import net.minecraftforge.common.ForgeMod; +import net.neoforged.neoforge.common.NeoForgeMod; +import net.neoforged.neoforge.fluids.FluidType; import javax.annotation.Nullable; import java.util.EnumSet; @@ -76,7 +77,7 @@ public CthulhuFamiliarEntity(EntityType type, L } public static AttributeSupplier.Builder createAttributes() { - return createMobAttributes().add(ForgeMod.SWIM_SPEED.get(), 1f); + return createMobAttributes().add(NeoForgeMod.SWIM_SPEED.value(), 1f); } @Override @@ -91,7 +92,7 @@ protected void registerGoals() { @Override public void setFamiliarOwner(LivingEntity owner) { if (this.hasHat()) - OccultismAdvancements.FAMILIAR.trigger(owner, FamiliarTrigger.Type.RARE_VARIANT); + OccultismAdvancements.FAMILIAR.get().trigger(owner, FamiliarTrigger.Type.RARE_VARIANT); super.setFamiliarOwner(owner); } @@ -212,8 +213,8 @@ public Vec3 getDismountLocationForPassenger(LivingEntity pLivingEntity) { } @Override - public boolean canBreatheUnderwater() { - return true; + public boolean canDrownInFluidType(FluidType type) { + return false; } @Override @@ -222,7 +223,7 @@ public boolean hurt(DamageSource source, float amount) { if (source.getEntity() == this.getFamiliarOwner()) { this.setAngry(true); this.setSitting(true); - OccultismAdvancements.FAMILIAR.trigger(this.getFamiliarOwner(), FamiliarTrigger.Type.CTHULHU_SAD); + OccultismAdvancements.FAMILIAR.get().trigger(this.getFamiliarOwner(), FamiliarTrigger.Type.CTHULHU_SAD); } else if (source.getEntity() != null) { Vec3 tp = DefaultRandomPos.getPos(this, 8, 4); if (tp != null) { diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/DeerFamiliarEntity.java b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/DeerFamiliarEntity.java index 19511277e..4e9146b6d 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/DeerFamiliarEntity.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/DeerFamiliarEntity.java @@ -77,7 +77,7 @@ public boolean canUse() { @Override public void setFamiliarOwner(LivingEntity owner) { if (this.hasRedNose()) - OccultismAdvancements.FAMILIAR.trigger(owner, FamiliarTrigger.Type.RARE_VARIANT); + OccultismAdvancements.FAMILIAR.get().trigger(owner, FamiliarTrigger.Type.RARE_VARIANT); super.setFamiliarOwner(owner); } @@ -119,7 +119,7 @@ public void ate() { this.spawnAtLocation(OccultismItems.DATURA_SEEDS.get(), 0); LivingEntity owner = this.getOwner(); if (owner instanceof ServerPlayer serverPlayer) - OccultismAdvancements.FAMILIAR.trigger(serverPlayer, FamiliarTrigger.Type.DEER_POOP); + OccultismAdvancements.FAMILIAR.get().trigger(serverPlayer, FamiliarTrigger.Type.DEER_POOP); } } diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/DevilFamiliarEntity.java b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/DevilFamiliarEntity.java index 3294f2eb9..13d5630fd 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/DevilFamiliarEntity.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/DevilFamiliarEntity.java @@ -54,7 +54,6 @@ import software.bernie.geckolib.core.animation.RawAnimation; import software.bernie.geckolib.core.object.PlayState; import software.bernie.geckolib.util.GeckoLibUtil; - import java.util.List; public class DevilFamiliarEntity extends FamiliarEntity implements GeoEntity { @@ -165,7 +164,7 @@ private List getNearbyEnemies() { public void start() { List enemies = this.getNearbyEnemies(); if (!enemies.isEmpty() && this.entity instanceof DevilFamiliarEntity) - OccultismAdvancements.FAMILIAR.trigger(this.entity.getFamiliarOwner(), FamiliarTrigger.Type.DEVIL_FIRE); + OccultismAdvancements.FAMILIAR.get().trigger(this.entity.getFamiliarOwner(), FamiliarTrigger.Type.DEVIL_FIRE); this.attack(enemies); this.entity.swing(InteractionHand.MAIN_HAND); diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/DragonFamiliarEntity.java b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/DragonFamiliarEntity.java index 5a02fcf77..c974586e1 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/DragonFamiliarEntity.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/DragonFamiliarEntity.java @@ -46,9 +46,8 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.ServerLevelAccessor; import net.minecraft.world.phys.Vec3; -import net.minecraftforge.common.Tags; -import net.minecraftforge.items.ItemHandlerHelper; - +import net.neoforged.neoforge.common.Tags; +import net.neoforged.neoforge.items.ItemHandlerHelper; import javax.annotation.Nullable; import java.util.EnumSet; import java.util.List; @@ -73,10 +72,15 @@ public static AttributeSupplier.Builder createAttributes() { return FamiliarEntity.createMobAttributes().add(Attributes.ATTACK_DAMAGE, 4); } + @Override + public Vec3 getPassengerRidingPosition(Entity pEntity) { + return super.getPassengerRidingPosition(pEntity).subtract(0, 0.4, 0); + } + @Override public void setFamiliarOwner(LivingEntity owner) { if (this.hasFez()) - OccultismAdvancements.FAMILIAR.trigger(owner, FamiliarTrigger.Type.RARE_VARIANT); + OccultismAdvancements.FAMILIAR.get().trigger(owner, FamiliarTrigger.Type.RARE_VARIANT); super.setFamiliarOwner(owner); } @@ -192,7 +196,7 @@ protected InteractionResult mobInteract(Player playerIn, InteractionHand hand) { this.setStick(false); return InteractionResult.sidedSuccess(!this.isEffectiveAi()); } else if (stack.is(Tags.Items.NUGGETS_GOLD)) { - OccultismAdvancements.FAMILIAR.trigger(this.getFamiliarOwner(), FamiliarTrigger.Type.DRAGON_NUGGET); + OccultismAdvancements.FAMILIAR.get().trigger(this.getFamiliarOwner(), FamiliarTrigger.Type.DRAGON_NUGGET); this.greedyTimer += GREEDY_INCREMENT; if (this.isEffectiveAi()) stack.shrink(1); @@ -202,7 +206,7 @@ protected InteractionResult mobInteract(Player playerIn, InteractionHand hand) { return InteractionResult.sidedSuccess(!this.isEffectiveAi()); } else if (stack.isEmpty() && playerIn.isShiftKeyDown()) { this.petTimer = 0; - OccultismAdvancements.FAMILIAR.trigger(playerIn, FamiliarTrigger.Type.DRAGON_PET); + OccultismAdvancements.FAMILIAR.get().trigger(playerIn, FamiliarTrigger.Type.DRAGON_PET); return InteractionResult.sidedSuccess(!this.isEffectiveAi()); } return super.mobInteract(playerIn, hand); @@ -240,11 +244,6 @@ private void setStick(boolean b) { this.setVariant(3, b); } - @Override - public double getPassengersRidingOffset() { - return super.getPassengersRidingOffset() * 0.4f; - } - @Override public void addAdditionalSaveData(CompoundTag compound) { super.addAdditionalSaveData(compound); @@ -355,7 +354,7 @@ public void tick() { if (this.stick.distanceToSqr(this.dragon) < 3) { this.dragon.setStick(true); - OccultismAdvancements.FAMILIAR.trigger(this.dragon.getFamiliarOwner(), + OccultismAdvancements.FAMILIAR.get().trigger(this.dragon.getFamiliarOwner(), FamiliarTrigger.Type.DRAGON_FETCH); this.stick.getItem().shrink(1); this.stick = null; diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/FairyFamiliarEntity.java b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/FairyFamiliarEntity.java index ed2004f25..872534ccc 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/FairyFamiliarEntity.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/FairyFamiliarEntity.java @@ -23,8 +23,8 @@ package com.klikli_dev.occultism.common.entity.familiar; import com.klikli_dev.occultism.common.advancement.FamiliarTrigger; -import com.klikli_dev.occultism.network.MessageFairySupport; -import com.klikli_dev.occultism.network.OccultismPackets; +import com.klikli_dev.occultism.network.messages.MessageFairySupport; +import com.klikli_dev.occultism.network.Networking; import com.klikli_dev.occultism.registry.OccultismAdvancements; import com.klikli_dev.occultism.registry.OccultismParticles; import com.klikli_dev.occultism.util.FamiliarUtil; @@ -57,10 +57,10 @@ import net.minecraft.world.level.ServerLevelAccessor; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.pathfinder.BlockPathTypes; +import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.Vec2; import net.minecraft.world.phys.Vec3; import org.joml.Vector3f; - import javax.annotation.Nullable; import java.util.*; import java.util.Map.Entry; @@ -95,7 +95,7 @@ protected void defineSynchedData() { @Override public void setFamiliarOwner(LivingEntity owner) { if (this.hasFlower()) - OccultismAdvancements.FAMILIAR.trigger(owner, FamiliarTrigger.Type.RARE_VARIANT); + OccultismAdvancements.FAMILIAR.get().trigger(owner, FamiliarTrigger.Type.RARE_VARIANT); super.setFamiliarOwner(owner); } @@ -303,7 +303,7 @@ public boolean saveFamiliar(IFamiliar familiar) { this.saveCooldown = 20 * 20; if (!familiar.getFamiliarEntity().level().isClientSide) - OccultismPackets.sendToTracking(this, + Networking.sendToTracking(this, new MessageFairySupport(this.getId(), familiar.getFamiliarEntity().getId())); return true; } @@ -319,6 +319,29 @@ public boolean hurt(DamageSource pSource, float pAmount) { return super.hurt(pSource, pAmount); } + private static final double DEFAULT_ATTACK_REACH = Math.sqrt(2.04F) - 0.6F; + @Override + protected AABB getAttackBoundingBox() { + //copied from parent and set reach * 3 + Entity entity = this.getVehicle(); + AABB aabb; + if (entity != null) { + AABB aabb1 = entity.getBoundingBox(); + AABB aabb2 = this.getBoundingBox(); + aabb = new AABB( + Math.min(aabb2.minX, aabb1.minX), + aabb2.minY, + Math.min(aabb2.minZ, aabb1.minZ), + Math.max(aabb2.maxX, aabb1.maxX), + aabb2.maxY, + Math.max(aabb2.maxZ, aabb1.maxZ) + ); + } else { + aabb = this.getBoundingBox(); + } + + return aabb.inflate(DEFAULT_ATTACK_REACH * 3, 0.0, DEFAULT_ATTACK_REACH * 3); + } @Override public boolean causeFallDamage(float fallDistance, float damageMultiplier, DamageSource p_147189_) { @@ -410,7 +433,7 @@ public void tick() { && familiar.addEffect(new MobEffectInstance(MobEffects.DAMAGE_RESISTANCE, DURATION))) gaveSupport = true; if (gaveSupport) { - OccultismPackets.sendToTracking(this.fairy, + Networking.sendToTracking(this.fairy, new MessageFairySupport(this.fairy.getId(), familiar.getId())); this.cooldowns.put(id, DURATION); } @@ -443,10 +466,15 @@ public void stop() { } @Override - protected void checkAndPerformAttack(LivingEntity pEnemy, double pDistToEnemySqr) { + protected boolean canPerformAttack(LivingEntity pEntity) { + return this.mob.isWithinMeleeAttackRange(pEntity); + } + + @Override + protected void checkAndPerformAttack(LivingEntity pEnemy) { this.attackTimer--; - double reach = this.getAttackReachSqr(pEnemy); - if (pDistToEnemySqr <= reach) { + + if(this.canPerformAttack(pEnemy)) { this.fairy.setMagicTarget(pEnemy); if (this.attackTimer <= 0) { this.attackTimer = 20; @@ -465,16 +493,11 @@ protected void checkAndPerformAttack(LivingEntity pEnemy, double pDistToEnemySqr } } } - } else if (pDistToEnemySqr > reach * 3) { + } else { this.fairy.setMagicTarget(null); } } - @Override - protected double getAttackReachSqr(LivingEntity pAttackTarget) { - return super.getAttackReachSqr(pAttackTarget) * 3; - } - } public static class SetAttackTargetGoal extends TargetGoal { diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/FamiliarEntity.java b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/FamiliarEntity.java index 428c04e3c..0a2940c73 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/FamiliarEntity.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/FamiliarEntity.java @@ -42,7 +42,6 @@ import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.pathfinder.BlockPathTypes; import net.minecraft.world.level.pathfinder.WalkNodeEvaluator; - import java.util.EnumSet; import java.util.Optional; import java.util.UUID; diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/GoatFamiliarEntity.java b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/GoatFamiliarEntity.java index a5fca1051..57d119ae0 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/GoatFamiliarEntity.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/GoatFamiliarEntity.java @@ -41,7 +41,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; -import net.minecraftforge.common.Tags; +import net.neoforged.neoforge.common.Tags; public class GoatFamiliarEntity extends ResizableFamiliarEntity { @@ -171,7 +171,7 @@ else if (stack.getItem() == Items.ENDER_EYE) else if (stack.getItem() == Items.FLINT) this.setEvilHorns(true); if (this.shouldTransform()) { - OccultismAdvancements.FAMILIAR.trigger(playerIn, FamiliarTrigger.Type.SHUB_NIGGURATH_SUMMON); + OccultismAdvancements.FAMILIAR.get().trigger(playerIn, FamiliarTrigger.Type.SHUB_NIGGURATH_SUMMON); this.transform(); } diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/GreedyFamiliarEntity.java b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/GreedyFamiliarEntity.java index 9b1ce7178..15ad5358b 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/GreedyFamiliarEntity.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/GreedyFamiliarEntity.java @@ -46,10 +46,9 @@ import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.Block; import net.minecraft.world.phys.Vec3; -import net.minecraftforge.items.IItemHandler; -import net.minecraftforge.items.ItemHandlerHelper; -import net.minecraftforge.items.wrapper.PlayerMainInvWrapper; - +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.items.ItemHandlerHelper; +import net.neoforged.neoforge.items.wrapper.PlayerMainInvWrapper; import java.util.EnumSet; import java.util.List; import java.util.Optional; @@ -241,7 +240,7 @@ public void tick() { LivingEntity owner = this.entity.getFamiliarOwner(); if (item.distanceToSqr(this.entity) < 4 && owner instanceof Player player) { item.playerTouch(player); - OccultismAdvancements.FAMILIAR.trigger(owner, FamiliarTrigger.Type.GREEDY_ITEM); + OccultismAdvancements.FAMILIAR.get().trigger(owner, FamiliarTrigger.Type.GREEDY_ITEM); } } } @@ -314,7 +313,7 @@ public void tick() { this.mount.getNavigation().stop(); if (this.rider.getType() == OccultismEntities.SHUB_NIGGURATH_FAMILIAR.get() && this.type == OccultismEntities.CTHULHU_FAMILIAR.get()) - OccultismAdvancements.FAMILIAR.trigger(this.rider.getFamiliarOwner(), FamiliarTrigger.Type.SHUB_CTHULHU_FRIENDS); + OccultismAdvancements.FAMILIAR.get().trigger(this.rider.getFamiliarOwner(), FamiliarTrigger.Type.SHUB_CTHULHU_FRIENDS); } } diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/GuardianFamiliarEntity.java b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/GuardianFamiliarEntity.java index 744d13f24..9e1041ce9 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/GuardianFamiliarEntity.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/GuardianFamiliarEntity.java @@ -119,7 +119,7 @@ protected void registerGoals() { @Override public void setFamiliarOwner(LivingEntity owner) { if (this.hasTree()) - OccultismAdvancements.FAMILIAR.trigger(owner, FamiliarTrigger.Type.RARE_VARIANT); + OccultismAdvancements.FAMILIAR.get().trigger(owner, FamiliarTrigger.Type.RARE_VARIANT); super.setFamiliarOwner(owner); } @@ -133,7 +133,7 @@ public boolean sacrifice() { byte lives = this.getLives(); boolean success = lives > 0; if (lives == DEATHS_DOOR) - OccultismAdvancements.FAMILIAR.trigger(this.getFamiliarOwner(), FamiliarTrigger.Type.GUARDIAN_ULTIMATE_SACRIFICE); + OccultismAdvancements.FAMILIAR.get().trigger(this.getFamiliarOwner(), FamiliarTrigger.Type.GUARDIAN_ULTIMATE_SACRIFICE); this.setLives((byte) (lives - 1)); return success; } diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/HeadlessFamiliarEntity.java b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/HeadlessFamiliarEntity.java index b3c34ffdc..29dfa52a5 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/HeadlessFamiliarEntity.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/HeadlessFamiliarEntity.java @@ -25,8 +25,8 @@ import com.google.common.collect.ImmutableBiMap; import com.google.common.collect.ImmutableList; import com.klikli_dev.occultism.common.advancement.FamiliarTrigger; -import com.klikli_dev.occultism.network.MessageHeadlessDie; -import com.klikli_dev.occultism.network.OccultismPackets; +import com.klikli_dev.occultism.network.messages.MessageHeadlessDie; +import com.klikli_dev.occultism.network.Networking; import com.klikli_dev.occultism.registry.OccultismAdvancements; import com.klikli_dev.occultism.registry.OccultismEntities; import net.minecraft.core.particles.DustParticleOptions; @@ -55,7 +55,7 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.ServerLevelAccessor; import net.minecraft.world.phys.Vec3; -import net.minecraftforge.common.Tags; +import net.neoforged.neoforge.common.Tags; import org.joml.Vector3f; import javax.annotation.Nullable; @@ -203,7 +203,7 @@ protected InteractionResult mobInteract(Player playerIn, InteractionHand hand) { if (success) { stack.shrink(1); if (this.isFullyRebuilt()) - OccultismAdvancements.FAMILIAR.trigger(playerIn, FamiliarTrigger.Type.HEADLESS_REBUILT); + OccultismAdvancements.FAMILIAR.get().trigger(playerIn, FamiliarTrigger.Type.HEADLESS_REBUILT); return InteractionResult.sidedSuccess(!this.level().isClientSide); } @@ -215,7 +215,7 @@ protected InteractionResult mobInteract(Player playerIn, InteractionHand hand) { @Override public void setFamiliarOwner(LivingEntity owner) { if (this.hasGlasses()) - OccultismAdvancements.FAMILIAR.trigger(owner, FamiliarTrigger.Type.RARE_VARIANT); + OccultismAdvancements.FAMILIAR.get().trigger(owner, FamiliarTrigger.Type.RARE_VARIANT); super.setFamiliarOwner(owner); } @@ -247,7 +247,7 @@ protected void actuallyHurt(DamageSource pDamageSrc, float pDamageAmount) { super.actuallyHurt(pDamageSrc, pDamageAmount); if (this.getHealth() / this.getMaxHealth() < 0.5 && !this.isHeadlessDead()) { this.setHeadlessDead(true); - OccultismPackets.sendToTracking(this, new MessageHeadlessDie(this.getId())); + Networking.sendToTracking(this, new MessageHeadlessDie(this.getId())); } } diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/IFamiliar.java b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/IFamiliar.java index dde9c3494..3fa746252 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/IFamiliar.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/IFamiliar.java @@ -24,6 +24,7 @@ import com.klikli_dev.occultism.common.item.tool.FamiliarRingItem; import com.klikli_dev.occultism.registry.OccultismCapabilities; +import com.klikli_dev.occultism.registry.OccultismDataStorage; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.LivingEntity; @@ -97,8 +98,7 @@ default void curioTick(LivingEntity wearer) { default boolean isEffectEnabled(LivingEntity owner) { if (owner == null) return false; - return owner.getCapability(OccultismCapabilities.FAMILIAR_SETTINGS) - .map(cap -> cap.isFamiliarEnabled(this.getFamiliarEntity().getType())).orElse(false); + return owner.getData(OccultismDataStorage.FAMILIAR_SETTINGS.get()).isFamiliarEnabled(this.getFamiliarEntity().getType()); } /*** diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/MummyFamiliarEntity.java b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/MummyFamiliarEntity.java index ea6705915..4690e1929 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/MummyFamiliarEntity.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/MummyFamiliarEntity.java @@ -154,7 +154,7 @@ public void blacksmithUpgrade() { @Override public void setFamiliarOwner(LivingEntity owner) { if (this.hasCrown()) - OccultismAdvancements.FAMILIAR.trigger(owner, FamiliarTrigger.Type.RARE_VARIANT); + OccultismAdvancements.FAMILIAR.get().trigger(owner, FamiliarTrigger.Type.RARE_VARIANT); super.setFamiliarOwner(owner); } diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/ShubNiggurathSpawnEntity.java b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/ShubNiggurathSpawnEntity.java index 5938f53d2..8f6a50419 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/ShubNiggurathSpawnEntity.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/ShubNiggurathSpawnEntity.java @@ -124,7 +124,7 @@ private void explode() { e.hurt(owner == null ? this.damageSources().generic() : this.damageSources().mobAttack(owner), damage); if (!enemies.isEmpty()) - OccultismAdvancements.FAMILIAR.trigger(this.getCreatorOwner(), FamiliarTrigger.Type.SHUB_NIGGURATH_SPAWN); + OccultismAdvancements.FAMILIAR.get().trigger(this.getCreatorOwner(), FamiliarTrigger.Type.SHUB_NIGGURATH_SPAWN); this.kill(); } diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/ThrownSwordEntity.java b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/ThrownSwordEntity.java index bbb1dc624..11e0b8c43 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/familiar/ThrownSwordEntity.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/familiar/ThrownSwordEntity.java @@ -33,8 +33,6 @@ import net.minecraft.world.level.Level; import net.minecraft.world.phys.EntityHitResult; import net.minecraft.world.phys.HitResult; -import net.minecraftforge.network.NetworkHooks; - public class ThrownSwordEntity extends ThrowableItemProjectile { private static final int MAX_DURATION = 20 * 5; @@ -93,12 +91,6 @@ protected void onHitEntity(EntityHitResult pResult) { } } - @Override - @SuppressWarnings("unchecked") - public Packet getAddEntityPacket() { - return NetworkHooks.getEntitySpawningPacket(this); - } - private boolean friendlyFire(Entity target) { Entity owner = this.getOwner(); if (owner == null) diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/job/CleanerJob.java b/src/main/java/com/klikli_dev/occultism/common/entity/job/CleanerJob.java index 759f2a74e..66637ec71 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/job/CleanerJob.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/job/CleanerJob.java @@ -27,7 +27,7 @@ import com.klikli_dev.occultism.common.entity.ai.goal.PickupItemsGoal; import com.klikli_dev.occultism.common.entity.ai.goal.ReturnToWorkAreaGoal; import com.klikli_dev.occultism.common.entity.spirit.SpiritEntity; -import com.klikli_dev.occultism.exceptions.ItemHandlerMissingException; + import com.klikli_dev.occultism.util.StorageUtil; import net.minecraft.network.chat.Component; import net.minecraft.world.MenuProvider; @@ -72,7 +72,7 @@ public void cleanup() { public boolean canPickupItem(ItemEntity entity) { ItemStack stack = entity.getItem(); boolean matches = StorageUtil.matchesFilter(stack, - this.entity.getFilterItems().orElseThrow(ItemHandlerMissingException::new)) || + this.entity.getFilterItems()) || StorageUtil.matchesFilter(stack, this.entity.getTagFilter()); boolean isBlacklist = this.entity.isFilterBlacklist(); diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/job/CrusherJob.java b/src/main/java/com/klikli_dev/occultism/common/entity/job/CrusherJob.java index afea44df5..da7aaa01a 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/job/CrusherJob.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/job/CrusherJob.java @@ -37,8 +37,8 @@ import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; +import net.minecraft.world.item.crafting.RecipeHolder; import net.minecraft.world.phys.Vec3; - import java.util.ArrayList; import java.util.List; import java.util.Optional; @@ -57,7 +57,7 @@ public class CrusherJob extends SpiritJob { protected Supplier outputMultiplier; protected Supplier tier; - protected Optional currentRecipe = Optional.empty(); + protected Optional> currentRecipe = Optional.empty(); protected PickupItemsGoal pickupItemsGoal; protected List itemsToPickUp = new ArrayList<>(); @@ -73,12 +73,11 @@ public CrusherJob(SpiritEntity entity, Supplier crushingTimeMultiplier, S @Override public void onInit() { this.entity.targetSelector.addGoal(1, this.pickupItemsGoal = new PickupItemsGoal(this.entity)); - this.itemsToPickUp = this.entity.level().getRecipeManager().getRecipes().stream() + this.itemsToPickUp = this.entity.level().getRecipeManager().getAllRecipesFor(OccultismRecipes.CRUSHING_TYPE.get()).stream() .filter( - recipe -> recipe.getType() == OccultismRecipes.CRUSHING_TYPE.get() - && ((CrushingRecipe) recipe).getMinTier() <= this.tier.get() + recipe -> recipe.value().getMinTier() <= this.tier.get() ) - .flatMap(recipe -> recipe.getIngredients().stream()).collect(Collectors.toList()); + .flatMap(recipe -> recipe.value().getIngredients().stream()).collect(Collectors.toList()); } @Override @@ -111,7 +110,7 @@ public void update() { } } if (this.currentRecipe.isPresent()) { - if (handHeld.isEmpty() || !this.currentRecipe.get().matches(fakeInventory, this.entity.level())) { + if (handHeld.isEmpty() || !this.currentRecipe.get().value().matches(fakeInventory, this.entity.level())) { //Reset cached recipe if it no longer matches this.currentRecipe = Optional.empty(); } else { @@ -134,14 +133,14 @@ public void update() { 1 + 0.5f * this.entity.getRandom().nextFloat()); } - if (this.crushingTimer >= this.currentRecipe.get().getCrushingTime() * this.crushingTimeMultiplier.get()) { + if (this.crushingTimer >= this.currentRecipe.get().value().getCrushingTime() * this.crushingTimeMultiplier.get()) { this.crushingTimer = 0; - ItemStack result = this.currentRecipe.get().assemble(fakeInventory, this.entity.level().registryAccess()); + ItemStack result = this.currentRecipe.get().value().assemble(fakeInventory, this.entity.level().registryAccess()); //make sure to ignore output multiplier on recipes that set that flag. //prevents e.g. 1x ingot -> 3x dust -> 3x ingot -> 9x dust ... float outputMultiplier = this.outputMultiplier.get(); - if (this.currentRecipe.get().getIgnoreCrushingMultiplier()) + if (this.currentRecipe.get().value().getIgnoreCrushingMultiplier()) outputMultiplier = 1; result.setCount((int) (result.getCount() * outputMultiplier)); ItemStack inputCopy = handHeld.copy(); diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/job/SpiritJob.java b/src/main/java/com/klikli_dev/occultism/common/entity/job/SpiritJob.java index 3a80cf1c4..7456515c6 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/job/SpiritJob.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/job/SpiritJob.java @@ -33,7 +33,7 @@ import net.minecraft.world.entity.ai.Brain; import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.item.crafting.Ingredient; -import net.minecraftforge.common.util.INBTSerializable; +import net.neoforged.neoforge.common.util.INBTSerializable; import net.tslat.smartbrainlib.api.core.BrainActivityGroup; import net.tslat.smartbrainlib.api.core.sensor.ExtendedSensor; import net.tslat.smartbrainlib.util.BrainUtils; @@ -50,7 +50,7 @@ public SpiritJob(SpiritEntity entity) { public static SpiritJob from(SpiritEntity entity, CompoundTag nbt) { SpiritJobFactory factory = OccultismSpiritJobs.REGISTRY - .get().getValue(new ResourceLocation(nbt.getString("factoryId"))); + .get(new ResourceLocation(nbt.getString("factoryId"))); SpiritJob job = factory.create(entity); job.deserializeNBT(nbt); return job; diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/job/SpiritJobFactory.java b/src/main/java/com/klikli_dev/occultism/common/entity/job/SpiritJobFactory.java index 3ccedfbdc..8c4fcaa33 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/job/SpiritJobFactory.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/job/SpiritJobFactory.java @@ -37,7 +37,7 @@ public SpiritJobFactory(Function constructor) public SpiritJob create(SpiritEntity entity) { SpiritJob job = this.constructor.apply(entity); - job.setFactoryId(OccultismSpiritJobs.REGISTRY.get().getKey(this)); + job.setFactoryId(OccultismSpiritJobs.REGISTRY.getKey(this)); return job; } diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/job/TraderJob.java b/src/main/java/com/klikli_dev/occultism/common/entity/job/TraderJob.java index 004511ecd..360e52490 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/job/TraderJob.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/job/TraderJob.java @@ -33,6 +33,7 @@ import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Recipe; +import net.minecraft.world.item.crafting.RecipeHolder; import net.minecraft.world.phys.Vec3; import java.util.Collections; @@ -49,7 +50,7 @@ public class TraderJob extends SpiritJob { protected PickupItemsGoal pickupItemsGoal; - protected SpiritTradeRecipe trade; + protected RecipeHolder trade; protected int maxTradesPerRound = 4; public TraderJob(SpiritEntity entity, ResourceLocation recipeId) { @@ -76,12 +77,10 @@ public void setTimeToConvert(int timeToConvert) { * @param recipeId the resource location for the recipe. */ public void setTradeRecipeId(ResourceLocation recipeId) { - this.trade = null; - Optional> recipe = this.entity.level().getRecipeManager().byKey(recipeId); - recipe.ifPresent(r -> { - if (r instanceof SpiritTradeRecipe) - this.trade = (SpiritTradeRecipe) r; - }); + var recipe = this.entity.level().getRecipeManager().byKey(recipeId); + //noinspection unchecked + this.trade = (RecipeHolder) recipe + .filter(r -> r.value() instanceof SpiritTradeRecipe).orElse(null); } /** @@ -107,7 +106,7 @@ public void cleanup() { @Override public void update() { ItemStack handHeld = this.entity.getItemInHand(InteractionHand.MAIN_HAND); - if (this.trade != null && this.trade.isValid(handHeld)) { + if (this.trade != null && this.trade.value().isValid(handHeld)) { if (this.entity.level().getGameTime() % 10 == 0) { //show particle effect while converting Vec3 pos = this.entity.position(); @@ -124,8 +123,8 @@ public void update() { List input = Collections.singletonList(handHeld); int resultCount = 0; - while (this.trade.isValid(input) && resultCount < this.maxTradesPerRound) { - input = this.trade.consume(input); + while (this.trade.value().isValid(input) && resultCount < this.maxTradesPerRound) { + input = this.trade.value().consume(input); resultCount++; } @@ -135,7 +134,7 @@ public void update() { this.entity.setItemInHand(InteractionHand.MAIN_HAND, input.get(0)); } - ItemStack converted = this.trade.getResultItem(this.entity.level().registryAccess()).copy(); + ItemStack converted = this.trade.value().getResultItem(this.entity.level().registryAccess()).copy(); converted.setCount(converted.getCount() * resultCount); if (resultCount > 0) { @@ -155,7 +154,7 @@ public CompoundTag writeJobToNBT(CompoundTag compound) { compound.putInt("conversionTimer", this.conversionTimer); compound.putInt("maxTradesPerRound", this.maxTradesPerRound); if (this.trade != null) - compound.putString("spiritTradeId", this.trade.getId().toString()); + compound.putString("spiritTradeId", this.trade.id().toString()); return super.writeJobToNBT(compound); } @@ -173,7 +172,7 @@ public void readJobFromNBT(CompoundTag compound) { @Override public boolean canPickupItem(ItemEntity entity) { ItemStack stack = entity.getItem(); - return !stack.isEmpty() && this.trade.isValid(stack); + return !stack.isEmpty() && this.trade.value().isValid(stack); } /** diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/spirit/AfritEntity.java b/src/main/java/com/klikli_dev/occultism/common/entity/spirit/AfritEntity.java index c3cffdf5e..74752dfbf 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/spirit/AfritEntity.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/spirit/AfritEntity.java @@ -28,7 +28,7 @@ import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.items.ItemStackHandler; +import net.neoforged.neoforge.items.ItemStackHandler; import software.bernie.geckolib.animatable.GeoEntity; import software.bernie.geckolib.core.animatable.GeoAnimatable; import software.bernie.geckolib.core.animatable.instance.AnimatableInstanceCache; diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/spirit/AfritWildEntity.java b/src/main/java/com/klikli_dev/occultism/common/entity/spirit/AfritWildEntity.java index 78f08f5ea..6247b319a 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/spirit/AfritWildEntity.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/spirit/AfritWildEntity.java @@ -44,7 +44,7 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.ServerLevelAccessor; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.event.ForgeEventFactory; +import net.neoforged.neoforge.event.EventHooks; import software.bernie.geckolib.animatable.GeoEntity; import software.bernie.geckolib.core.animatable.GeoAnimatable; import software.bernie.geckolib.core.animatable.instance.AnimatableInstanceCache; @@ -54,7 +54,6 @@ import software.bernie.geckolib.core.animation.RawAnimation; import software.bernie.geckolib.core.object.PlayState; import software.bernie.geckolib.util.GeckoLibUtil; - import javax.annotation.Nullable; public class AfritWildEntity extends Monster implements GeoEntity { @@ -84,7 +83,7 @@ public SpawnGroupData finalizeSpawn(ServerLevelAccessor level, DifficultyInstanc for (int i = 0; i < maxBlazes; i++) { Blaze entity = EntityType.BLAZE.create(level.getLevel()); - ForgeEventFactory.onFinalizeSpawn(entity, level, difficultyIn, reason, spawnDataIn, dataTag); + EventHooks.onFinalizeSpawn(entity, level, difficultyIn, reason, spawnDataIn, dataTag); double offsetX = level.getRandom().nextGaussian() * (1 + level.getRandom().nextInt(4)); double offsetZ = level.getRandom().nextGaussian() * (1 + level.getRandom().nextInt(4)); diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/spirit/SpiritEntity.java b/src/main/java/com/klikli_dev/occultism/common/entity/spirit/SpiritEntity.java index f2e9139d1..54d76ce4f 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/spirit/SpiritEntity.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/spirit/SpiritEntity.java @@ -28,7 +28,6 @@ import com.klikli_dev.occultism.common.container.spirit.SpiritContainer; import com.klikli_dev.occultism.common.entity.job.SpiritJob; import com.klikli_dev.occultism.common.item.spirit.BookOfCallingItem; -import com.klikli_dev.occultism.exceptions.ItemHandlerMissingException; import com.klikli_dev.occultism.registry.OccultismMemoryTypes; import com.klikli_dev.occultism.registry.OccultismSounds; import com.mojang.serialization.Dynamic; @@ -62,11 +61,7 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.ServerLevelAccessor; import net.minecraft.world.phys.Vec3; -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.minecraftforge.network.NetworkHooks; +import net.neoforged.neoforge.items.ItemStackHandler; import net.tslat.smartbrainlib.api.SmartBrainOwner; import net.tslat.smartbrainlib.api.core.BrainActivityGroup; import net.tslat.smartbrainlib.api.core.SmartBrain; @@ -136,14 +131,13 @@ public abstract class SpiritEntity extends TamableAnimal implements ISkinnedCrea .defineId(SpiritEntity.class, EntityDataSerializers.STRING); public ItemStackHandler inventory; - public LazyOptional itemStackHandler = LazyOptional.of(() -> this.inventory); - public LazyOptional filterItemStackHandler = LazyOptional.of(() -> new ItemStackHandler(MAX_FILTER_SLOTS) { + public ItemStackHandler filterItemStackHandler = new ItemStackHandler(MAX_FILTER_SLOTS) { @Override protected void onContentsChanged(int slot) { super.onContentsChanged(slot); SpiritEntity.this.entityData.set(FILTER_ITEMS, this.serializeNBT()); } - }); + }; //initialized in getter, because super constructor already accesses it protected Optional job; @@ -210,22 +204,13 @@ public void onSyncedDataUpdated(EntityDataAccessor key) { if (key == FILTER_ITEMS) { //restore filter item handler from data param on client if (this.level().isClientSide) { - this.filterItemStackHandler.ifPresent((handler) -> { - CompoundTag compound = this.entityData.get(FILTER_ITEMS); - if (!compound.isEmpty()) - handler.deserializeNBT(compound); - }); + CompoundTag compound = this.entityData.get(FILTER_ITEMS); + if (!compound.isEmpty()) + this.filterItemStackHandler.deserializeNBT(compound); } } } - public LazyOptional getCapability(Capability capability, @Nullable Direction facing) { - if (this.isAlive() && capability == ForgeCapabilities.ITEM_HANDLER) { - return this.itemStackHandler.cast(); - } - return super.getCapability(capability, facing); - } - public Optional getDepositPosition() { return this.entityData.get(DEPOSIT_POSITION); } @@ -380,7 +365,7 @@ public void setTagFilter(String tagFilter) { /** * @return the filter mode */ - public LazyOptional getFilterItems() { + public ItemStackHandler getFilterItems() { return this.filterItemStackHandler; } @@ -500,7 +485,7 @@ protected void registerGoals() { @Override public ItemStack getItemBySlot(EquipmentSlot slotIn) { if (slotIn == EquipmentSlot.MAINHAND) { - return this.itemStackHandler.orElseThrow(ItemHandlerMissingException::new).getStackInSlot(0); + return this.inventory.getStackInSlot(0); } return ItemStack.EMPTY; } @@ -508,7 +493,7 @@ public ItemStack getItemBySlot(EquipmentSlot slotIn) { @Override public void setItemSlot(EquipmentSlot slotIn, ItemStack stack) { if (slotIn == EquipmentSlot.MAINHAND) { - this.itemStackHandler.orElseThrow(ItemHandlerMissingException::new).setStackInSlot(0, stack); + this.inventory.setStackInSlot(0, stack); } } @@ -565,13 +550,13 @@ public void addAdditionalSaveData(CompoundTag compound) { compound.putInt("extractFacing", this.getExtractFacing().ordinal()); //store current inventory - this.itemStackHandler.ifPresent(handler -> compound.put("inventory", handler.serializeNBT())); + compound.put("inventory", this.inventory.serializeNBT()); //store job this.getJob().ifPresent(job -> compound.put("spiritJob", job.serializeNBT())); compound.putBoolean("isFilterBlacklist", this.isFilterBlacklist()); - this.filterItemStackHandler.ifPresent(handler -> compound.put("filterItems", handler.serializeNBT())); + compound.put("filterItems", this.filterItemStackHandler.serializeNBT()); compound.putString("tagFilter", this.getTagFilter()); } @@ -618,7 +603,7 @@ public void readAdditionalSaveData(CompoundTag compound) { //set up inventory and read items if (compound.contains("inventory")) { - this.itemStackHandler.ifPresent(handler -> handler.deserializeNBT(compound.getCompound("inventory"))); + this.inventory.deserializeNBT(compound.getCompound("inventory")); } //read job @@ -637,7 +622,7 @@ public void readAdditionalSaveData(CompoundTag compound) { if (compound.contains("filterItems")) { compound.getCompound("filterItems").putInt("Size", MAX_FILTER_SLOTS); //override legacy filter size - this.filterItemStackHandler.ifPresent(handler -> handler.deserializeNBT(compound.getCompound("filterItems"))); + this.filterItemStackHandler.deserializeNBT(compound.getCompound("filterItems")); } if (compound.contains("tagFilter")) { @@ -655,15 +640,12 @@ public void setTame(boolean tamed) { @Override protected void dropEquipment() { super.dropEquipment(); - this.itemStackHandler.ifPresent((handle) -> { - for (int i = 0; i < handle.getSlots(); ++i) { - ItemStack itemstack = handle.getStackInSlot(i); - if (!itemstack.isEmpty()) { - this.spawnAtLocation(itemstack, 0.0F); - } + for (int i = 0; i < this.inventory.getSlots(); ++i) { + ItemStack itemstack = this.inventory.getStackInSlot(i); + if (!itemstack.isEmpty()) { + this.spawnAtLocation(itemstack, 0.0F); } - }); - + } } @Override @@ -740,7 +722,9 @@ public void openScreen(Player playerEntity) { if (currentJob instanceof MenuProvider) menuProvider = (MenuProvider) currentJob; - NetworkHooks.openScreen((ServerPlayer) playerEntity, menuProvider, (buf) -> buf.writeInt(this.getId())); + if (playerEntity instanceof ServerPlayer serverPlayer) { + serverPlayer.openMenu(menuProvider, (buf) -> buf.writeInt(this.getId())); + } } } } diff --git a/src/main/java/com/klikli_dev/occultism/common/entity/spirit/WildHuntWitherSkeletonEntity.java b/src/main/java/com/klikli_dev/occultism/common/entity/spirit/WildHuntWitherSkeletonEntity.java index 56fa84d48..2758b3f1e 100644 --- a/src/main/java/com/klikli_dev/occultism/common/entity/spirit/WildHuntWitherSkeletonEntity.java +++ b/src/main/java/com/klikli_dev/occultism/common/entity/spirit/WildHuntWitherSkeletonEntity.java @@ -39,8 +39,7 @@ import net.minecraft.world.entity.monster.WitherSkeleton; import net.minecraft.world.level.Level; import net.minecraft.world.level.ServerLevelAccessor; -import net.minecraftforge.event.ForgeEventFactory; - +import net.neoforged.neoforge.event.EventHooks; import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; @@ -69,7 +68,7 @@ public SpawnGroupData finalizeSpawn(ServerLevelAccessor level, DifficultyInstanc for (int i = 0; i < maxSkeletons; i++) { WildHuntSkeletonEntity entity = OccultismEntities.WILD_HUNT_SKELETON.get().create(this.level()); - ForgeEventFactory.onFinalizeSpawn(entity, level, difficultyIn, reason, spawnDataIn, dataTag); + EventHooks.onFinalizeSpawn(entity, level, difficultyIn, reason, spawnDataIn, dataTag); double offsetX = level.getRandom().nextGaussian() * (1 + level.getRandom().nextInt(4)); double offsetZ = level.getRandom().nextGaussian() * (1 + level.getRandom().nextInt(4)); diff --git a/src/main/java/com/klikli_dev/occultism/common/item/DummyTooltipItem.java b/src/main/java/com/klikli_dev/occultism/common/item/DummyTooltipItem.java index 4a7882d6f..6b9414c76 100644 --- a/src/main/java/com/klikli_dev/occultism/common/item/DummyTooltipItem.java +++ b/src/main/java/com/klikli_dev/occultism/common/item/DummyTooltipItem.java @@ -27,6 +27,7 @@ import com.klikli_dev.occultism.registry.OccultismRecipes; import net.minecraft.core.BlockPos; import net.minecraft.network.chat.Component; +import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; @@ -47,10 +48,12 @@ public DummyTooltipItem(Properties properties) { public void performRitual(Level level, BlockPos pos, GoldenSacrificialBowlBlockEntity blockEntity, Player player, ItemStack activationItem) { - Optional ritualRecipe = level.getRecipeManager().getAllRecipesFor(OccultismRecipes.RITUAL_TYPE.get()) - .stream().filter(r -> r.getRitualDummy().getItem() == this).findFirst(); + if(player instanceof ServerPlayer serverPlayer){ + var ritualRecipe = level.getRecipeManager().getAllRecipesFor(OccultismRecipes.RITUAL_TYPE.get()) + .stream().filter(r -> r.value().getRitualDummy().getItem() == this).findFirst(); - ritualRecipe.ifPresent(r -> r.getRitual().finish(level, pos, blockEntity, player, activationItem)); + ritualRecipe.ifPresent(r -> r.value().getRitual().finish(level, pos, blockEntity, serverPlayer, activationItem)); + } } @Override diff --git a/src/main/java/com/klikli_dev/occultism/common/item/debug/SummonDjinniManageMachineItem.java b/src/main/java/com/klikli_dev/occultism/common/item/debug/SummonDjinniManageMachineItem.java index 45938e210..33edf3dbc 100644 --- a/src/main/java/com/klikli_dev/occultism/common/item/debug/SummonDjinniManageMachineItem.java +++ b/src/main/java/com/klikli_dev/occultism/common/item/debug/SummonDjinniManageMachineItem.java @@ -34,7 +34,7 @@ import net.minecraft.world.entity.MobSpawnType; import net.minecraft.world.item.Item; import net.minecraft.world.item.context.UseOnContext; -import net.minecraftforge.event.ForgeEventFactory; +import net.neoforged.neoforge.event.EventHooks; public class SummonDjinniManageMachineItem extends Item { @@ -48,7 +48,7 @@ public InteractionResult useOn(UseOnContext context) { DjinniEntity spirit = OccultismEntities.DJINNI.get().create(context.getLevel()); - ForgeEventFactory.onFinalizeSpawn(spirit, (ServerLevel) context.getLevel(), context.getLevel().getCurrentDifficultyAt(context.getClickedPos()), MobSpawnType.SPAWN_EGG, null, null); + EventHooks.onFinalizeSpawn(spirit, (ServerLevel) context.getLevel(), context.getLevel().getCurrentDifficultyAt(context.getClickedPos()), MobSpawnType.SPAWN_EGG, null, null); spirit.tame(context.getPlayer()); spirit.setPos(context.getClickedPos().getX(), context.getClickedPos().getY() + 1.0f, context.getClickedPos().getZ()); diff --git a/src/main/java/com/klikli_dev/occultism/common/item/debug/SummonDjinniTest.java b/src/main/java/com/klikli_dev/occultism/common/item/debug/SummonDjinniTest.java index 9b7d73b54..917307d93 100644 --- a/src/main/java/com/klikli_dev/occultism/common/item/debug/SummonDjinniTest.java +++ b/src/main/java/com/klikli_dev/occultism/common/item/debug/SummonDjinniTest.java @@ -34,7 +34,7 @@ import net.minecraft.world.entity.MobSpawnType; import net.minecraft.world.item.Item; import net.minecraft.world.item.context.UseOnContext; -import net.minecraftforge.event.ForgeEventFactory; +import net.neoforged.neoforge.event.EventHooks; public class SummonDjinniTest extends Item { @@ -48,7 +48,7 @@ public InteractionResult useOn(UseOnContext context) { DjinniEntity spirit = OccultismEntities.DJINNI.get().create(context.getLevel()); - ForgeEventFactory.onFinalizeSpawn(spirit, (ServerLevel) context.getLevel(), context.getLevel().getCurrentDifficultyAt(context.getClickedPos()), MobSpawnType.SPAWN_EGG, null, null); + EventHooks.onFinalizeSpawn(spirit, (ServerLevel) context.getLevel(), context.getLevel().getCurrentDifficultyAt(context.getClickedPos()), MobSpawnType.SPAWN_EGG, null, null); spirit.tame(context.getPlayer()); spirit.setPos(context.getClickedPos().getX(), context.getClickedPos().getY() + 1.0f, context.getClickedPos().getZ()); diff --git a/src/main/java/com/klikli_dev/occultism/common/item/debug/SummonFoliotCleanerItem.java b/src/main/java/com/klikli_dev/occultism/common/item/debug/SummonFoliotCleanerItem.java index b1511327c..bbf3440f9 100644 --- a/src/main/java/com/klikli_dev/occultism/common/item/debug/SummonFoliotCleanerItem.java +++ b/src/main/java/com/klikli_dev/occultism/common/item/debug/SummonFoliotCleanerItem.java @@ -34,7 +34,7 @@ import net.minecraft.world.entity.MobSpawnType; import net.minecraft.world.item.Item; import net.minecraft.world.item.context.UseOnContext; -import net.minecraftforge.event.ForgeEventFactory; +import net.neoforged.neoforge.event.EventHooks; public class SummonFoliotCleanerItem extends Item { @@ -47,7 +47,7 @@ public InteractionResult useOn(UseOnContext context) { if (!context.getLevel().isClientSide) { FoliotEntity spirit = OccultismEntities.FOLIOT.get().create(context.getLevel()); - ForgeEventFactory.onFinalizeSpawn(spirit, (ServerLevel) context.getLevel(), context.getLevel().getCurrentDifficultyAt(context.getClickedPos()), MobSpawnType.SPAWN_EGG, null, null); + EventHooks.onFinalizeSpawn(spirit, (ServerLevel) context.getLevel(), context.getLevel().getCurrentDifficultyAt(context.getClickedPos()), MobSpawnType.SPAWN_EGG, null, null); spirit.tame(context.getPlayer()); spirit.setPos(context.getClickedPos().getX(), context.getClickedPos().getY() + 1.0f, context.getClickedPos().getZ()); diff --git a/src/main/java/com/klikli_dev/occultism/common/item/debug/SummonFoliotLumberjackItem.java b/src/main/java/com/klikli_dev/occultism/common/item/debug/SummonFoliotLumberjackItem.java index d0f7c5016..962cadfd3 100644 --- a/src/main/java/com/klikli_dev/occultism/common/item/debug/SummonFoliotLumberjackItem.java +++ b/src/main/java/com/klikli_dev/occultism/common/item/debug/SummonFoliotLumberjackItem.java @@ -34,7 +34,7 @@ import net.minecraft.world.entity.MobSpawnType; import net.minecraft.world.item.Item; import net.minecraft.world.item.context.UseOnContext; -import net.minecraftforge.event.ForgeEventFactory; +import net.neoforged.neoforge.event.EventHooks; public class SummonFoliotLumberjackItem extends Item { @@ -47,7 +47,7 @@ public InteractionResult useOn(UseOnContext context) { if (!context.getLevel().isClientSide) { FoliotEntity spirit = OccultismEntities.FOLIOT.get().create(context.getLevel()); - ForgeEventFactory.onFinalizeSpawn(spirit, (ServerLevel) context.getLevel(), context.getLevel().getCurrentDifficultyAt(context.getClickedPos()), MobSpawnType.SPAWN_EGG, null, null); + EventHooks.onFinalizeSpawn(spirit, (ServerLevel) context.getLevel(), context.getLevel().getCurrentDifficultyAt(context.getClickedPos()), MobSpawnType.SPAWN_EGG, null, null); spirit.tame(context.getPlayer()); spirit.setPos(context.getClickedPos().getX(), context.getClickedPos().getY() + 1.0f, context.getClickedPos().getZ()); diff --git a/src/main/java/com/klikli_dev/occultism/common/item/debug/SummonFoliotTraderItem.java b/src/main/java/com/klikli_dev/occultism/common/item/debug/SummonFoliotTraderItem.java index 9b52db062..46c6a22e9 100644 --- a/src/main/java/com/klikli_dev/occultism/common/item/debug/SummonFoliotTraderItem.java +++ b/src/main/java/com/klikli_dev/occultism/common/item/debug/SummonFoliotTraderItem.java @@ -22,20 +22,21 @@ package com.klikli_dev.occultism.common.item.debug; +import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.common.entity.job.TraderJob; import com.klikli_dev.occultism.common.entity.spirit.FoliotEntity; import com.klikli_dev.occultism.registry.OccultismEntities; import com.klikli_dev.occultism.registry.OccultismSpiritJobs; -import com.klikli_dev.occultism.util.StaticUtil; import net.minecraft.advancements.CriteriaTriggers; import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.MobSpawnType; import net.minecraft.world.item.Item; import net.minecraft.world.item.context.UseOnContext; -import net.minecraftforge.event.ForgeEventFactory; +import net.neoforged.neoforge.event.EventHooks; public class SummonFoliotTraderItem extends Item { @@ -48,7 +49,7 @@ public InteractionResult useOn(UseOnContext context) { if (!context.getLevel().isClientSide) { FoliotEntity spirit = OccultismEntities.FOLIOT.get().create(context.getLevel()); - ForgeEventFactory.onFinalizeSpawn(spirit, (ServerLevel) context.getLevel(), context.getLevel().getCurrentDifficultyAt(context.getClickedPos()), MobSpawnType.SPAWN_EGG, null, null); + EventHooks.onFinalizeSpawn(spirit, (ServerLevel) context.getLevel(), context.getLevel().getCurrentDifficultyAt(context.getClickedPos()), MobSpawnType.SPAWN_EGG, null, null); spirit.tame(context.getPlayer()); spirit.setPos(context.getClickedPos().getX(), context.getClickedPos().getY() + 1.0f, context.getClickedPos().getZ()); @@ -57,7 +58,7 @@ public InteractionResult useOn(UseOnContext context) { //set up the job TraderJob trader = (TraderJob) OccultismSpiritJobs.TRADE_OTHERSTONE_T1.get().create(spirit); trader.init(); - trader.setTradeRecipeId(StaticUtil.modLoc("spirit_trade/test")); + trader.setTradeRecipeId(new ResourceLocation(Occultism.MODID, "spirit_trade/test")); spirit.setJob(trader); //notify players nearby and spawn diff --git a/src/main/java/com/klikli_dev/occultism/common/item/debug/SummonFoliotTransportItemsItem.java b/src/main/java/com/klikli_dev/occultism/common/item/debug/SummonFoliotTransportItemsItem.java index d972d803d..db7b1c252 100644 --- a/src/main/java/com/klikli_dev/occultism/common/item/debug/SummonFoliotTransportItemsItem.java +++ b/src/main/java/com/klikli_dev/occultism/common/item/debug/SummonFoliotTransportItemsItem.java @@ -34,7 +34,7 @@ import net.minecraft.world.entity.MobSpawnType; import net.minecraft.world.item.Item; import net.minecraft.world.item.context.UseOnContext; -import net.minecraftforge.event.ForgeEventFactory; +import net.neoforged.neoforge.event.EventHooks; public class SummonFoliotTransportItemsItem extends Item { @@ -47,7 +47,7 @@ public InteractionResult useOn(UseOnContext context) { if (!context.getLevel().isClientSide) { FoliotEntity spirit = OccultismEntities.FOLIOT.get().create(context.getLevel()); - ForgeEventFactory.onFinalizeSpawn(spirit, (ServerLevel) context.getLevel(), context.getLevel().getCurrentDifficultyAt(context.getClickedPos()), MobSpawnType.SPAWN_EGG, null, null); + EventHooks.onFinalizeSpawn(spirit, (ServerLevel) context.getLevel(), context.getLevel().getCurrentDifficultyAt(context.getClickedPos()), MobSpawnType.SPAWN_EGG, null, null); spirit.tame(context.getPlayer()); spirit.setPos(context.getClickedPos().getX(), context.getClickedPos().getY() + 1.0f, context.getClickedPos().getZ()); diff --git a/src/main/java/com/klikli_dev/occultism/common/item/spirit/BookOfCallingItem.java b/src/main/java/com/klikli_dev/occultism/common/item/spirit/BookOfCallingItem.java index 5bf28f02a..202a2af97 100644 --- a/src/main/java/com/klikli_dev/occultism/common/item/spirit/BookOfCallingItem.java +++ b/src/main/java/com/klikli_dev/occultism/common/item/spirit/BookOfCallingItem.java @@ -53,7 +53,7 @@ import net.minecraft.world.item.context.UseOnContext; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraftforge.common.capabilities.ForgeCapabilities; +import net.neoforged.neoforge.capabilities.Capabilities; import javax.annotation.Nullable; import java.util.*; @@ -189,7 +189,7 @@ public InteractionResult interactLivingEntity(ItemStack stack, Player player, Li //if our mode is "set deposit" then we check if the target is appropriate for depositing //Note: we filter above for spirits -> so for now only spirits are an appropriate target if (ItemMode.get(this.getItemMode(stack)) == ItemMode.SET_DEPOSIT) { - if (targetSpirit.getCapability(ForgeCapabilities.ITEM_HANDLER).isPresent()) { + if (targetSpirit.getCapability(Capabilities.ItemHandler.ENTITY) != null) { UUID boundSpiritId = ItemNBTUtil.getSpiritEntityUUID(stack); if (boundSpiritId != null) { Optional boundSpirit = EntityUtil.getEntityByUuiDGlobal(target.level().getServer(), boundSpiritId) @@ -531,25 +531,23 @@ public InteractionResult handleItemMode(Player player, Level world, BlockPos pos ItemMode itemMode = ItemMode.get(this.getItemMode(stack)); BlockEntity blockEntity = world.getBlockEntity(pos); + var blockEntityHasItemHandlerAtFacing = world.getCapability(Capabilities.ItemHandler.BLOCK, pos, blockEntity != null ? blockEntity.getBlockState() : null, blockEntity, facing) != null; //handle the serverside item modes if (!world.isClientSide) { switch (itemMode) { case SET_DEPOSIT: - if (blockEntity != null && - blockEntity.getCapability(ForgeCapabilities.ITEM_HANDLER, facing).isPresent()) { + if (blockEntity != null && blockEntityHasItemHandlerAtFacing) { return this.setSpiritDepositLocation(player, world, pos, stack, facing) ? InteractionResult.SUCCESS : InteractionResult.PASS; } break; case SET_EXTRACT: if (this instanceof BookOfCallingManageMachineItem) { - if (blockEntity != null && - blockEntity.getCapability(ForgeCapabilities.ITEM_HANDLER, facing).isPresent()) { + if (blockEntity != null && blockEntityHasItemHandlerAtFacing) { return this.setSpiritManagedMachineExtractLocation(player, world, pos, stack, facing) ? InteractionResult.SUCCESS : InteractionResult.PASS; } - } else if (blockEntity != null && - blockEntity.getCapability(ForgeCapabilities.ITEM_HANDLER, facing).isPresent()) { + } else if (blockEntity != null && blockEntityHasItemHandlerAtFacing) { return this.setSpiritExtractLocation(player, world, pos, stack, facing) ? InteractionResult.SUCCESS : InteractionResult.PASS; } @@ -565,7 +563,7 @@ public InteractionResult handleItemMode(Player player, Level world, BlockPos pos break; case SET_MANAGED_MACHINE: if (blockEntity != null && BlockEntityUtil.hasCapabilityOnAnySide(blockEntity, - ForgeCapabilities.ITEM_HANDLER)) { + Capabilities.ItemHandler.BLOCK)) { this.setSpiritManagedMachine(player, world, pos, stack, facing); return InteractionResult.SUCCESS; } @@ -574,7 +572,7 @@ public InteractionResult handleItemMode(Player player, Level world, BlockPos pos } else { if (Objects.requireNonNull(itemMode) == ItemMode.SET_MANAGED_MACHINE) { if (blockEntity != null && BlockEntityUtil.hasCapabilityOnAnySide(blockEntity, - ForgeCapabilities.ITEM_HANDLER)) { + Capabilities.ItemHandler.BLOCK)) { MachineReference machine = ItemNBTUtil.getManagedMachine(stack); if (machine != null) { GuiHelper.openBookOfCallingManagedMachineGui(machine.insertFacing, machine.extractFacing, diff --git a/src/main/java/com/klikli_dev/occultism/common/item/spirit/MinerSpiritItem.java b/src/main/java/com/klikli_dev/occultism/common/item/spirit/MinerSpiritItem.java index 343fb923c..b0cbfddbb 100644 --- a/src/main/java/com/klikli_dev/occultism/common/item/spirit/MinerSpiritItem.java +++ b/src/main/java/com/klikli_dev/occultism/common/item/spirit/MinerSpiritItem.java @@ -32,7 +32,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.Level; -import net.minecraftforge.common.capabilities.ICapabilityProvider; +import net.neoforged.neoforge.capabilities.ICapabilityProvider; import org.jetbrains.annotations.Nullable; import java.util.List; @@ -72,9 +72,14 @@ public int getMaxDamage(ItemStack stack) { } @Override - public @Nullable ICapabilityProvider initCapabilities(ItemStack stack, @Nullable CompoundTag nbt) { - stack.getOrCreateTag().putInt(DimensionalMineshaftBlockEntity.MAX_MINING_TIME_TAG, this.maxMiningTime.get()); - stack.getOrCreateTag().putInt(DimensionalMineshaftBlockEntity.ROLLS_PER_OPERATION_TAG, this.rollsPerOperation.get()); - return super.initCapabilities(stack, nbt); + public int getMaxStackSize(ItemStack stack) { + //cannot use verifyTagAfterLoad as config is not available at that time + var pTag = stack.getOrCreateTag(); + if(!pTag.contains(DimensionalMineshaftBlockEntity.MAX_MINING_TIME_TAG)) + pTag.putInt(DimensionalMineshaftBlockEntity.MAX_MINING_TIME_TAG, this.maxMiningTime.get()); + + if(!pTag.contains(DimensionalMineshaftBlockEntity.ROLLS_PER_OPERATION_TAG)) + pTag.putInt(DimensionalMineshaftBlockEntity.ROLLS_PER_OPERATION_TAG, this.rollsPerOperation.get()); + return super.getMaxStackSize(stack); } } diff --git a/src/main/java/com/klikli_dev/occultism/common/item/storage/SatchelItem.java b/src/main/java/com/klikli_dev/occultism/common/item/storage/SatchelItem.java index 4a63f2605..8ce006fc7 100644 --- a/src/main/java/com/klikli_dev/occultism/common/item/storage/SatchelItem.java +++ b/src/main/java/com/klikli_dev/occultism/common/item/storage/SatchelItem.java @@ -35,9 +35,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.Level; -import net.minecraftforge.network.NetworkHooks; import org.jetbrains.annotations.Nullable; - import java.util.List; public class SatchelItem extends Item { @@ -50,11 +48,11 @@ public SatchelItem(Properties properties) { public InteractionResultHolder use(Level level, Player player, InteractionHand hand) { final ItemStack stack = player.getItemInHand(hand); - if (!level.isClientSide && player instanceof ServerPlayer) { + if (!level.isClientSide && player instanceof ServerPlayer serverPlayer) { //here we use main hand item as selected slot int selectedSlot = hand == InteractionHand.MAIN_HAND ? player.getInventory().selected : -1; - NetworkHooks.openScreen((ServerPlayer) player, + serverPlayer.openMenu( new SimpleMenuProvider((id, playerInventory, unused) -> { return new SatchelContainer(id, playerInventory, this.getInventory((ServerPlayer) player, stack), selectedSlot); @@ -75,16 +73,10 @@ public void appendHoverText(ItemStack stack, @Nullable Level worldIn, List use(Level level, Player player, Intera } //then access it and if it fits, open UI - if (storageControllerWorld.getBlockEntity(storageControllerPos.getPos()) instanceof IStorageController) { - NetworkHooks.openScreen((ServerPlayer) player, this, buffer -> buffer.writeVarInt(player.getInventory().selected)); + if (storageControllerWorld.getBlockEntity(storageControllerPos.getPos()) instanceof IStorageController && player instanceof ServerPlayer serverPlayer) { + serverPlayer.openMenu(this, buffer -> buffer.writeVarInt(player.getInventory().selected)); return new InteractionResultHolder<>(InteractionResult.SUCCESS, stack); } return super.use(level, player, hand); diff --git a/src/main/java/com/klikli_dev/occultism/common/item/tool/DivinationRodItem.java b/src/main/java/com/klikli_dev/occultism/common/item/tool/DivinationRodItem.java index 23e05f7f7..8cf175bbf 100644 --- a/src/main/java/com/klikli_dev/occultism/common/item/tool/DivinationRodItem.java +++ b/src/main/java/com/klikli_dev/occultism/common/item/tool/DivinationRodItem.java @@ -27,13 +27,14 @@ import com.klikli_dev.occultism.client.divination.ScanManager; import com.klikli_dev.occultism.common.block.otherworld.IOtherworldBlock; import com.klikli_dev.occultism.integration.theurgy.TheurgyIntegration; -import com.klikli_dev.occultism.network.MessageSetDivinationResult; -import com.klikli_dev.occultism.network.OccultismPackets; +import com.klikli_dev.occultism.network.Networking; +import com.klikli_dev.occultism.network.messages.MessageSetDivinationResult; import com.klikli_dev.occultism.registry.OccultismBlocks; import com.klikli_dev.occultism.registry.OccultismSounds; import com.klikli_dev.occultism.util.Math3DUtil; import net.minecraft.ChatFormatting; import net.minecraft.core.BlockPos; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.sounds.SoundSource; @@ -51,7 +52,6 @@ import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.Vec3; -import net.minecraftforge.registries.ForgeRegistries; import javax.annotation.Nullable; import java.util.List; @@ -89,7 +89,7 @@ public InteractionResult useOn(UseOnContext context) { String translationKey = block instanceof IOtherworldBlock ? ((IOtherworldBlock) block).getUncoveredBlock() .getDescriptionId() : block.getDescriptionId(); - stack.getOrCreateTag().putString(OccultismConstants.Nbt.Divination.LINKED_BLOCK_ID, ForgeRegistries.BLOCKS.getKey(block).toString()); + stack.getOrCreateTag().putString(OccultismConstants.Nbt.Divination.LINKED_BLOCK_ID, BuiltInRegistries.BLOCK.getKey(block).toString()); player.sendSystemMessage( Component.translatable(this.getDescriptionId() + ".message.linked_block", Component.translatable(translationKey))); @@ -123,7 +123,7 @@ public InteractionResultHolder use(Level level, Player player, Intera if (level.isClientSide) { ResourceLocation id = new ResourceLocation(stack.getTag().getString(OccultismConstants.Nbt.Divination.LINKED_BLOCK_ID)); - ScanManager.instance.beginScan(player, ForgeRegistries.BLOCKS.getValue(id)); + ScanManager.instance.beginScan(player, BuiltInRegistries.BLOCK.get(id)); } } else if (!level.isClientSide) { player.sendSystemMessage(Component.translatable(this.getDescriptionId() + ".message.no_linked_block")); @@ -145,7 +145,7 @@ public ItemStack finishUsingItem(ItemStack stack, Level level, LivingEntity enti float distance = this.getDistance(player.position(), result); stack.getTag().putFloat(OccultismConstants.Nbt.Divination.DISTANCE, distance); - OccultismPackets.sendToServer(new MessageSetDivinationResult(result, distance)); + Networking.sendToServer(new MessageSetDivinationResult(result, distance)); if (result != null) { stack.getTag().putLong(OccultismConstants.Nbt.Divination.POS, result.asLong()); @@ -207,7 +207,7 @@ public void appendHoverText(ItemStack stack, @Nullable Level worldIn, List tooltip, - TooltipFlag flagIn) { - super.appendHoverText(stack, worldIn, tooltip, flagIn); - if (stack.getOrCreateTag().getBoolean("occupied")) { - DistHelper.appendHoverText(stack, worldIn, tooltip, flagIn); - } else { - tooltip.add(Component.translatable( - stack.getDescriptionId() + ".tooltip.empty")); - } - } - - @Override - public InteractionResult interactLivingEntity(ItemStack stack, Player playerIn, LivingEntity target, - InteractionHand hand) { - if (!playerIn.level().isClientSide && target instanceof IFamiliar familiar) { - if ((familiar.getFamiliarOwner() == playerIn || familiar.getFamiliarOwner() == null) && getCurio(stack).captureFamiliar(playerIn.level(), familiar)) { - OccultismAdvancements.FAMILIAR.trigger(playerIn, FamiliarTrigger.Type.CAPTURE); - CompoundTag tag = stack.getOrCreateTag(); - tag.putBoolean("occupied", true); - ItemNBTUtil.setBoundSpiritName(stack, familiar.getFamiliarEntity().getDisplayName().getString()); - return InteractionResult.SUCCESS; - } - } - - return super.interactLivingEntity(stack, playerIn, target, hand); - } - - @Override - public InteractionResult useOn(UseOnContext pContext) { - - ItemStack stack = pContext.getPlayer().getItemInHand(pContext.getHand()); - if (!pContext.getPlayer().level().isClientSide && getCurio(stack).releaseFamiliar(pContext.getPlayer(), pContext.getLevel())) { - CompoundTag tag = stack.getOrCreateTag(); - tag.putBoolean("occupied", false); - return InteractionResult.sidedSuccess(pContext.getPlayer().level().isClientSide); - } - - return InteractionResult.CONSUME; - } - - @Override - public void verifyTagAfterLoad(CompoundTag pCompoundTag) { - super.verifyTagAfterLoad(pCompoundTag); - - if (pCompoundTag.contains("forHandleFamiliarTypeTag")) { - return; //avoid recursion via handleFamiliarTypeTag - } - - this.handleFamiliarTypeTag(pCompoundTag); - } - - public void handleFamiliarTypeTag(CompoundTag tag) { - //we create an item stack to be able to modify the tag & access the capabilities. - //that stack will not be put anywhere - var stack = new ItemStack(this); - tag.putBoolean("forHandleFamiliarTypeTag", true); - stack.setTag(tag); //avoid recursion via verifyTagAfterLoad. - tag.remove("forHandleFamiliarTypeTag"); - - var server = ServerLifecycleHooks.getCurrentServer(); - var icurio = stack.getCapability(CuriosCapability.ITEM).orElse(null); - - //if we have a familiar type, that means we got a ring from e.g. a loot table. - // it has no actual familiar nbt data, just the type to spawn, so we need to create a new familiar. - // Test with: /give @p occultism:familiar_ring{familiarType:"occultism:greedy_familiar"} - if (stack.hasTag() && stack.getTag().contains("familiarType") && icurio instanceof Curio curio && server != null) { - try { - EntityType type = EntityType.byString(stack.getTag().getString("familiarType")).orElse(null); - if (type != null) { - var level = ServerLifecycleHooks.getCurrentServer().getLevel(Level.OVERWORLD); - var entity = type.create(level); - var familiar = (IFamiliar) entity; - if (familiar != null) { - curio.setFamiliar(familiar); - - stack.getTag().putBoolean("occupied", true); - //now we also need to create the "familiar" nbt tag - stack.getTag().put("familiar", curio.serializeNBT()); - } - } - - stack.getTag().remove("familiarType"); - } catch (Exception e) { - //we're brutally ignoring it. if it fails, it fails. - //this is just in case we do not have a server/level. - } - } - } - - @Override - public ICapabilityProvider initCapabilities(ItemStack stack, CompoundTag nbt) { - return new Provider(stack); - } - - private static class Curio implements ICurio, INBTSerializable { - private final ItemStack stack; - private IFamiliar familiar; - private CompoundTag nbt; - - private Curio(ItemStack stack) { - this.stack = stack; - } - - private boolean captureFamiliar(Level level, IFamiliar familiar) { - if (this.getFamiliar(level) != null) - return false; - - //otherwise is added to world is serialized - familiar.getFamiliarEntity().onRemovedFromWorld(); - this.setFamiliar(familiar); - this.getFamiliar(level).getFamiliarEntity().stopRiding(); - this.getFamiliar(level).getFamiliarEntity().ejectPassengers(); - this.getFamiliar(level).getFamiliarEntity().remove(Entity.RemovalReason.DISCARDED); - return true; - } - - private boolean releaseFamiliar(Player player, Level level) { - if (this.getFamiliar(level) != null - && !this.getFamiliar(level).getFamiliarEntity().isAddedToWorld()) { - EntityType.loadEntityRecursive(this.getFamiliar(level).getFamiliarEntity().serializeNBT(), level, e -> { - e.setPos(player.getX(), player.getY(), player.getZ()); - //on release overwrite owner -> familiar rings can be used to trade familiars. - ((IFamiliar) e).setFamiliarOwner(player); - - var name = ItemNBTUtil.getBoundSpiritName(this.stack); - e.setCustomName(Component.literal(name)); //set the name from the ring. the reverse happens when ring is used on entity. - - level.addFreshEntity(e); - return e; - }); - this.setFamiliar(null); - return true; - } - return false; - } - - @Override - public ItemStack getStack() { - return this.stack; - } - - @Override - public void curioTick(SlotContext slotContext) { - Level level = slotContext.entity().level(); - IFamiliar familiar = this.getFamiliar(level); - - if (familiar != null) { - // after portal use the level is still the pre-teleport level, the familiar owner is not found on the next check - // hence, we update the level, if the familiar is in a ring - if (!familiar.getFamiliarEntity().isAddedToWorld()) - familiar.getFamiliarEntity().setLevel(level); - - if (familiar.getFamiliarOwner() != slotContext.entity()) - return; - // Apply effects - if (!level.isClientSide && slotContext.entity().tickCount % 20 == 0 && familiar.isEffectEnabled(slotContext.entity())) - for (MobEffectInstance effect : familiar.getFamiliarEffects()) - familiar.getFamiliarOwner().addEffect(effect); - - // Tick - familiar.curioTick(slotContext.entity()); - } - } - - @Override - public CompoundTag serializeNBT() { - CompoundTag compound = new CompoundTag(); - compound.putBoolean("hasFamiliar", this.familiar != null || this.nbt != null); - if (this.familiar != null) - compound.put("familiar", this.familiar.getFamiliarEntity().serializeNBT()); - else if (this.nbt != null) - compound.put("familiar", this.nbt); - - return compound; - } - - @Override - public void deserializeNBT(CompoundTag compound) { - if (compound.getBoolean("hasFamiliar")) - this.nbt = compound.getCompound("familiar"); - } - - // Need this because we cannot deserialize the familiar in deserializeNBT() - // because we have no level at that point - private IFamiliar getFamiliar(Level level) { - if (this.familiar != null) - return this.familiar; - if (this.nbt != null) { - this.familiar = (IFamiliar) EntityType.loadEntityRecursive(this.nbt, level, Function.identity()); - this.nbt = null; - } - - return this.familiar; - } - - private void setFamiliar(IFamiliar familiar) { - this.familiar = familiar; - this.nbt = null; - } - - } - - private static class Provider implements ICapabilitySerializable { - - private final ItemStack stack; - private Curio curio; - private final LazyOptional instance = LazyOptional.of(this::get); - - public Provider(ItemStack stack) { - this.stack = stack; - } - - @Override - public LazyOptional getCapability(Capability cap, Direction side) { - return CuriosCapability.ITEM.orEmpty(cap, this.instance); - } - - @Override - public CompoundTag serializeNBT() { - return this.get().serializeNBT(); - } - - @Override - public void deserializeNBT(CompoundTag nbt) { - this.get().deserializeNBT(nbt); - } - - private Curio get() { - if (this.curio == null) - this.curio = new Curio(this.stack); - return this.curio; - } - - } - - public static class DistHelper { - - public static void appendHoverText(ItemStack stack, @Nullable Level worldIn, List tooltip, - TooltipFlag flagIn) { - if (worldIn != null) { - var familiar = getFamiliar(stack, worldIn); - if (familiar != null) { - var type = familiar.getFamiliarEntity().getType(); - tooltip.add(Component.translatable( - stack.getDescriptionId() + ".tooltip", - TextUtil.formatDemonName(ItemNBTUtil.getBoundSpiritName(stack)), - Component.translatable( - stack.getDescriptionId() + ".tooltip.familiar_type", - TextUtil.formatDemonType(type.getDescription(), type) - ).withStyle(ChatFormatting.ITALIC) - )); - } - } - } - - public static boolean isFoil(ItemStack pStack) { - var level = Minecraft.getInstance().level; - if (level == null) - return false; - - var familiar = getFamiliar(pStack, level); - if (familiar != null) { - return familiar.isEffectEnabled(Minecraft.getInstance().player); - } - return false; - } - - } + //TODO: enable once curios is available +// private static Curio getCurio(ItemStack stack) { +// ICurio icurio = stack.getCapability(CuriosCapability.ITEM); +// if (icurio != null && icurio instanceof Curio curio) { +// if (stack.getTag() != null && stack.getTag().contains("familiar")) { +// curio.deserializeNBT(stack.getTag().getCompound("familiar")); +// stack.getTag().remove("familiar"); +// } +// return curio; +// } +// return null; +// } +// +// public static IFamiliar getFamiliar(ItemStack stack, Level level) { +// Curio curio = getCurio(stack); +// return curio == null ? null : curio.getFamiliar(level); +// } +// +// @Override +// public int getMaxStackSize(ItemStack stack) { +// //force generation of a name if it does not exist yet. +// //this might get around loot tables caching the stack +// ItemNBTUtil.getBoundSpiritName(stack); +// return super.getMaxStackSize(stack); +// } +// +// @Override +// public boolean isFoil(ItemStack pStack) { +// if (FMLLoader.getDist() == Dist.CLIENT) +// return DistHelper.isFoil(pStack); +// return false; +// } +// +// @Override +// public void appendHoverText(ItemStack stack, @Nullable Level worldIn, List tooltip, +// TooltipFlag flagIn) { +// super.appendHoverText(stack, worldIn, tooltip, flagIn); +// if (stack.getOrCreateTag().getBoolean("occupied")) { +// DistHelper.appendHoverText(stack, worldIn, tooltip, flagIn); +// } else { +// tooltip.add(Component.translatable( +// stack.getDescriptionId() + ".tooltip.empty")); +// } +// } +// +// @Override +// public InteractionResult interactLivingEntity(ItemStack stack, Player playerIn, LivingEntity target, +// InteractionHand hand) { +// if (!playerIn.level().isClientSide && target instanceof IFamiliar familiar) { +// if ((familiar.getFamiliarOwner() == playerIn || familiar.getFamiliarOwner() == null) && getCurio(stack).captureFamiliar(playerIn.level(), familiar)) { +// OccultismAdvancements.FAMILIAR.get().trigger(playerIn, FamiliarTrigger.Type.CAPTURE); +// CompoundTag tag = stack.getOrCreateTag(); +// tag.putBoolean("occupied", true); +// ItemNBTUtil.setBoundSpiritName(stack, familiar.getFamiliarEntity().getDisplayName().getString()); +// return InteractionResult.SUCCESS; +// } +// } +// +// return super.interactLivingEntity(stack, playerIn, target, hand); +// } +// +// @Override +// public InteractionResult useOn(UseOnContext pContext) { +// +// ItemStack stack = pContext.getPlayer().getItemInHand(pContext.getHand()); +// if (!pContext.getPlayer().level().isClientSide && getCurio(stack).releaseFamiliar(pContext.getPlayer(), pContext.getLevel())) { +// CompoundTag tag = stack.getOrCreateTag(); +// tag.putBoolean("occupied", false); +// return InteractionResult.sidedSuccess(pContext.getPlayer().level().isClientSide); +// } +// +// return InteractionResult.CONSUME; +// } +// +// @Override +// public void verifyTagAfterLoad(CompoundTag pCompoundTag) { +// super.verifyTagAfterLoad(pCompoundTag); +// +// if (pCompoundTag.contains("forHandleFamiliarTypeTag")) { +// return; //avoid recursion via handleFamiliarTypeTag +// } +// +// this.handleFamiliarTypeTag(pCompoundTag); +// } +// +// public void handleFamiliarTypeTag(CompoundTag tag) { +// //we create an item stack to be able to modify the tag & access the capabilities. +// //that stack will not be put anywhere +// var stack = new ItemStack(this); +// tag.putBoolean("forHandleFamiliarTypeTag", true); +// stack.setTag(tag); //avoid recursion via verifyTagAfterLoad. +// tag.remove("forHandleFamiliarTypeTag"); +// +// var server = ServerLifecycleHooks.getCurrentServer(); +// var icurio = stack.getCapability(CuriosCapability.ITEM); +// +// //if we have a familiar type, that means we got a ring from e.g. a loot table. +// // it has no actual familiar nbt data, just the type to spawn, so we need to create a new familiar. +// // Test with: /give @p occultism:familiar_ring{familiarType:"occultism:greedy_familiar"} +// if (stack.hasTag() && stack.getTag().contains("familiarType") && icurio instanceof Curio curio && server != null) { +// try { +// EntityType type = EntityType.byString(stack.getTag().getString("familiarType")).orElse(null); +// if (type != null) { +// var level = ServerLifecycleHooks.getCurrentServer().getLevel(Level.OVERWORLD); +// var entity = type.create(level); +// var familiar = (IFamiliar) entity; +// if (familiar != null) { +// curio.setFamiliar(familiar); +// +// stack.getTag().putBoolean("occupied", true); +// //now we also need to create the "familiar" nbt tag +// stack.getTag().put("familiar", curio.serializeNBT()); +// } +// } +// +// stack.getTag().remove("familiarType"); +// } catch (Exception e) { +// //we're brutally ignoring it. if it fails, it fails. +// //this is just in case we do not have a server/level. +// } +// } +// } +// +// public static class Curio implements ICurio, INBTSerializable { +// private final ItemStack stack; +// private IFamiliar familiar; +// private CompoundTag nbt; +// +// public Curio(ItemStack stack) { +// this.stack = stack; +// } +// +// private boolean captureFamiliar(Level level, IFamiliar familiar) { +// if (this.getFamiliar(level) != null) +// return false; +// +// //otherwise is added to world is serialized +// familiar.getFamiliarEntity().onRemovedFromWorld(); +// this.setFamiliar(familiar); +// this.getFamiliar(level).getFamiliarEntity().stopRiding(); +// this.getFamiliar(level).getFamiliarEntity().ejectPassengers(); +// this.getFamiliar(level).getFamiliarEntity().remove(Entity.RemovalReason.DISCARDED); +// return true; +// } +// +// private boolean releaseFamiliar(Player player, Level level) { +// if (this.getFamiliar(level) != null +// && !this.getFamiliar(level).getFamiliarEntity().isAddedToWorld()) { +// EntityType.loadEntityRecursive(this.getFamiliar(level).getFamiliarEntity().serializeNBT(), level, e -> { +// e.setPos(player.getX(), player.getY(), player.getZ()); +// //on release overwrite owner -> familiar rings can be used to trade familiars. +// ((IFamiliar) e).setFamiliarOwner(player); +// +// var name = ItemNBTUtil.getBoundSpiritName(this.stack); +// e.setCustomName(Component.literal(name)); //set the name from the ring. the reverse happens when ring is used on entity. +// +// level.addFreshEntity(e); +// return e; +// }); +// this.setFamiliar(null); +// return true; +// } +// return false; +// } +// +// @Override +// public ItemStack getStack() { +// return this.stack; +// } +// +// @Override +// public void curioTick(SlotContext slotContext) { +// Level level = slotContext.entity().level(); +// IFamiliar familiar = this.getFamiliar(level); +// +// if (familiar != null) { +// // after portal use the level is still the pre-teleport level, the familiar owner is not found on the next check +// // hence, we update the level, if the familiar is in a ring +// if (!familiar.getFamiliarEntity().isAddedToWorld()) +// familiar.getFamiliarEntity().setLevel(level); +// +// if (familiar.getFamiliarOwner() != slotContext.entity()) +// return; +// // Apply effects +// if (!level.isClientSide && slotContext.entity().tickCount % 20 == 0 && familiar.isEffectEnabled(slotContext.entity())) +// for (MobEffectInstance effect : familiar.getFamiliarEffects()) +// familiar.getFamiliarOwner().addEffect(effect); +// +// // Tick +// familiar.curioTick(slotContext.entity()); +// } +// } +// +// @Override +// public CompoundTag serializeNBT() { +// CompoundTag compound = new CompoundTag(); +// compound.putBoolean("hasFamiliar", this.familiar != null || this.nbt != null); +// if (this.familiar != null) +// compound.put("familiar", this.familiar.getFamiliarEntity().serializeNBT()); +// else if (this.nbt != null) +// compound.put("familiar", this.nbt); +// +// return compound; +// } +// +// @Override +// public void deserializeNBT(CompoundTag compound) { +// if (compound.getBoolean("hasFamiliar")) +// this.nbt = compound.getCompound("familiar"); +// } +// +// // Need this because we cannot deserialize the familiar in deserializeNBT() +// // because we have no level at that point +// private IFamiliar getFamiliar(Level level) { +// if (this.familiar != null) +// return this.familiar; +// if (this.nbt != null) { +// this.familiar = (IFamiliar) EntityType.loadEntityRecursive(this.nbt, level, Function.identity()); +// this.nbt = null; +// } +// +// return this.familiar; +// } +// +// private void setFamiliar(IFamiliar familiar) { +// this.familiar = familiar; +// this.nbt = null; +// } +// +// } +// +// public static class DistHelper { +// +// public static void appendHoverText(ItemStack stack, @Nullable Level worldIn, List tooltip, +// TooltipFlag flagIn) { +// if (worldIn != null) { +// var familiar = getFamiliar(stack, worldIn); +// if (familiar != null) { +// var type = familiar.getFamiliarEntity().getType(); +// tooltip.add(Component.translatable( +// stack.getDescriptionId() + ".tooltip", +// TextUtil.formatDemonName(ItemNBTUtil.getBoundSpiritName(stack)), +// Component.translatable( +// stack.getDescriptionId() + ".tooltip.familiar_type", +// TextUtil.formatDemonType(type.getDescription(), type) +// ).withStyle(ChatFormatting.ITALIC) +// )); +// } +// } +// } +// +// public static boolean isFoil(ItemStack pStack) { +// var level = Minecraft.getInstance().level; +// if (level == null) +// return false; +// +// var familiar = getFamiliar(pStack, level); +// if (familiar != null) { +// return familiar.isEffectEnabled(Minecraft.getInstance().player); +// } +// return false; +// } +// +// } } diff --git a/src/main/java/com/klikli_dev/occultism/common/item/tool/GuideBookItem.java b/src/main/java/com/klikli_dev/occultism/common/item/tool/GuideBookItem.java index c51ec2946..00748c41f 100644 --- a/src/main/java/com/klikli_dev/occultism/common/item/tool/GuideBookItem.java +++ b/src/main/java/com/klikli_dev/occultism/common/item/tool/GuideBookItem.java @@ -40,8 +40,6 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.Level; -import net.minecraftforge.common.capabilities.ICapabilityProvider; -import org.jetbrains.annotations.Nullable; import java.util.List; @@ -121,8 +119,9 @@ public ItemStack getCreativeModeTabDisplayStack() { } @Override - public @Nullable ICapabilityProvider initCapabilities(ItemStack stack, @Nullable CompoundTag nbt) { - stack.getOrCreateTag().putString(ModonomiconConstants.Nbt.ITEM_BOOK_ID_TAG, DICTIONARY_OF_SPIRITS.toString()); - return super.initCapabilities(stack, nbt); + public void verifyTagAfterLoad(CompoundTag pTag) { + //here this is ok to use as we do not access the (at that time not yet loaded) config + if (!pTag.contains(ModonomiconConstants.Nbt.ITEM_BOOK_ID_TAG)) + pTag.putString(ModonomiconConstants.Nbt.ITEM_BOOK_ID_TAG, DICTIONARY_OF_SPIRITS.toString()); } } diff --git a/src/main/java/com/klikli_dev/occultism/common/item/tool/SoulGemItem.java b/src/main/java/com/klikli_dev/occultism/common/item/tool/SoulGemItem.java index 24a74c79a..5d2981610 100644 --- a/src/main/java/com/klikli_dev/occultism/common/item/tool/SoulGemItem.java +++ b/src/main/java/com/klikli_dev/occultism/common/item/tool/SoulGemItem.java @@ -40,7 +40,6 @@ import net.minecraft.world.item.context.UseOnContext; import net.minecraft.world.level.Level; import org.jetbrains.annotations.Nullable; - import java.util.Arrays; import java.util.List; @@ -173,19 +172,4 @@ public void appendHoverText(ItemStack stack, @Nullable Level worldIn, List !key.equals("id")).toArray(String[]::new); - Arrays.stream(toRemove).forEach(entityData::remove); - } - } - return tag; - } } diff --git a/src/main/java/com/klikli_dev/occultism/common/level/cave/SphericalCaveSubFeature.java b/src/main/java/com/klikli_dev/occultism/common/level/cave/SphericalCaveSubFeature.java index dca085673..6c9421fc5 100644 --- a/src/main/java/com/klikli_dev/occultism/common/level/cave/SphericalCaveSubFeature.java +++ b/src/main/java/com/klikli_dev/occultism/common/level/cave/SphericalCaveSubFeature.java @@ -37,7 +37,6 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.chunk.ChunkGenerator; import net.minecraft.world.phys.AABB; - import java.util.ArrayList; import java.util.HashSet; import java.util.List; diff --git a/src/main/java/com/klikli_dev/occultism/common/level/cave/UndergroundGroveDecorator.java b/src/main/java/com/klikli_dev/occultism/common/level/cave/UndergroundGroveDecorator.java index 7f9819161..fd5f03d0c 100644 --- a/src/main/java/com/klikli_dev/occultism/common/level/cave/UndergroundGroveDecorator.java +++ b/src/main/java/com/klikli_dev/occultism/common/level/cave/UndergroundGroveDecorator.java @@ -49,10 +49,10 @@ public void finalFloorPass(WorldGenLevel seedReader, ChunkGenerator generator, R BlockPos pos, MultiChunkFeatureConfig config) { if (seedReader.getBlockState(pos).getBlock() == Blocks.GRASS_BLOCK && rand.nextFloat() < config.grassChance) - seedReader.setBlock(pos.above(), Blocks.GRASS.defaultBlockState(), 2); + seedReader.setBlock(pos.above(), Blocks.SHORT_GRASS.defaultBlockState(), 2); if (rand.nextFloat() < config.treeChance) { - config.otherworldTreeFeature.get().place(seedReader, generator, rand, pos.above()); + config.otherworldTreeFeature.value().place(seedReader, generator, rand, pos.above()); } } diff --git a/src/main/java/com/klikli_dev/occultism/common/level/multichunk/MultiChunkFeature.java b/src/main/java/com/klikli_dev/occultism/common/level/multichunk/MultiChunkFeature.java index 62f1f6d25..9080c7a9c 100644 --- a/src/main/java/com/klikli_dev/occultism/common/level/multichunk/MultiChunkFeature.java +++ b/src/main/java/com/klikli_dev/occultism/common/level/multichunk/MultiChunkFeature.java @@ -33,7 +33,6 @@ import net.minecraft.world.level.levelgen.XoroshiroRandomSource; import net.minecraft.world.level.levelgen.feature.Feature; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; - import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/com/klikli_dev/occultism/common/level/tree/OtherworldNaturalTreeGrower.java b/src/main/java/com/klikli_dev/occultism/common/level/tree/OtherworldNaturalTreeGrower.java deleted file mode 100644 index ce424ce9b..000000000 --- a/src/main/java/com/klikli_dev/occultism/common/level/tree/OtherworldNaturalTreeGrower.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * MIT License - * - * Copyright 2020 klikli-dev - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and - * associated documentation files (the "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT - * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.klikli_dev.occultism.common.level.tree; - -import com.klikli_dev.occultism.datagen.worldgen.ConfiguredFeatures; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Holder; -import net.minecraft.core.registries.Registries; -import net.minecraft.resources.ResourceKey; -import net.minecraft.server.level.ServerLevel; -import net.minecraft.util.RandomSource; -import net.minecraft.world.level.block.grower.AbstractTreeGrower; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.chunk.ChunkGenerator; -import net.minecraft.world.level.levelgen.feature.ConfiguredFeature; -import org.jetbrains.annotations.Nullable; - -public class OtherworldNaturalTreeGrower extends AbstractTreeGrower { - - public OtherworldNaturalTreeGrower() { - } - - @Nullable - @Override - protected ResourceKey> getConfiguredFeature(RandomSource p_222910_, boolean p_222911_) { - return ConfiguredFeatures.TREE_OTHERWORLD_NATURAL; - } - - @Override - public boolean growTree(ServerLevel level, ChunkGenerator p_222906_, BlockPos p_222907_, BlockState p_222908_, RandomSource p_222909_) { - Holder> holder = level.registryAccess().registryOrThrow(Registries.CONFIGURED_FEATURE).getHolderOrThrow(ConfiguredFeatures.TREE_OTHERWORLD_NATURAL); - - if (holder == null) { - return false; - } else { - ConfiguredFeature configuredfeature = holder.value(); - BlockState blockstate = level.getFluidState(p_222907_).createLegacyBlock(); - level.setBlock(p_222907_, blockstate, 4); - if (configuredfeature.place(level, p_222906_, p_222909_, p_222907_)) { - if (level.getBlockState(p_222907_) == blockstate) { - level.sendBlockUpdated(p_222907_, p_222908_, blockstate, 2); - } - - return true; - } else { - level.setBlock(p_222907_, p_222908_, 4); - return false; - } - } - } - -} diff --git a/src/main/java/com/klikli_dev/occultism/common/level/tree/OtherworldTreeGrower.java b/src/main/java/com/klikli_dev/occultism/common/level/tree/OtherworldTreeGrower.java deleted file mode 100644 index f1f3942a8..000000000 --- a/src/main/java/com/klikli_dev/occultism/common/level/tree/OtherworldTreeGrower.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * MIT License - * - * Copyright 2020 klikli-dev - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and - * associated documentation files (the "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT - * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.klikli_dev.occultism.common.level.tree; - -import com.klikli_dev.occultism.datagen.worldgen.ConfiguredFeatures; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Holder; -import net.minecraft.core.registries.Registries; -import net.minecraft.resources.ResourceKey; -import net.minecraft.server.level.ServerLevel; -import net.minecraft.util.RandomSource; -import net.minecraft.world.level.block.grower.AbstractTreeGrower; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.chunk.ChunkGenerator; -import net.minecraft.world.level.levelgen.feature.ConfiguredFeature; -import org.jetbrains.annotations.Nullable; - -public class OtherworldTreeGrower extends AbstractTreeGrower { - - public OtherworldTreeGrower() { - } - - @Nullable - @Override - protected ResourceKey> getConfiguredFeature(RandomSource p_222910_, boolean p_222911_) { - return ConfiguredFeatures.TREE_OTHERWORLD; - } - - @Override - public boolean growTree(ServerLevel level, ChunkGenerator p_222906_, BlockPos p_222907_, BlockState p_222908_, RandomSource p_222909_) { - Holder> holder = level.registryAccess().registryOrThrow(Registries.CONFIGURED_FEATURE).getHolderOrThrow(ConfiguredFeatures.TREE_OTHERWORLD); - - if (holder == null) { - return false; - } else { - ConfiguredFeature configuredfeature = holder.value(); - BlockState blockstate = level.getFluidState(p_222907_).createLegacyBlock(); - level.setBlock(p_222907_, blockstate, 4); - if (configuredfeature.place(level, p_222906_, p_222909_, p_222907_)) { - if (level.getBlockState(p_222907_) == blockstate) { - level.sendBlockUpdated(p_222907_, p_222908_, blockstate, 2); - } - - return true; - } else { - level.setBlock(p_222907_, p_222908_, 4); - return false; - } - } - } -} diff --git a/src/main/java/com/klikli_dev/occultism/common/misc/DepositOrder.java b/src/main/java/com/klikli_dev/occultism/common/misc/DepositOrder.java index 6217f83bb..0e1700859 100644 --- a/src/main/java/com/klikli_dev/occultism/common/misc/DepositOrder.java +++ b/src/main/java/com/klikli_dev/occultism/common/misc/DepositOrder.java @@ -23,7 +23,7 @@ package com.klikli_dev.occultism.common.misc; import net.minecraft.nbt.CompoundTag; -import net.minecraftforge.common.util.INBTSerializable; +import net.neoforged.neoforge.common.util.INBTSerializable; public class DepositOrder implements INBTSerializable { diff --git a/src/main/java/com/klikli_dev/occultism/common/misc/OutputIngredient.java b/src/main/java/com/klikli_dev/occultism/common/misc/OutputIngredient.java index fca3be6dc..bb8d13de4 100644 --- a/src/main/java/com/klikli_dev/occultism/common/misc/OutputIngredient.java +++ b/src/main/java/com/klikli_dev/occultism/common/misc/OutputIngredient.java @@ -1,16 +1,20 @@ package com.klikli_dev.occultism.common.misc; import com.klikli_dev.occultism.integration.almostunified.AlmostUnifiedIntegration; +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.core.Holder; import net.minecraft.core.HolderSet; import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; +import net.minecraft.util.ExtraCodecs; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.level.block.Blocks; import java.util.Arrays; +import java.util.Optional; import java.util.stream.Stream; /** @@ -19,24 +23,22 @@ public class OutputIngredient { protected Ingredient ingredient; - //While we take the item from the ingredient, we take the count and nbt form this - protected ItemStack outputStackInfo; + protected OutputStackInfo outputStackInfo; protected ItemStack cachedOutputStack; - - public OutputIngredient(Ingredient ingredient) { - this(ingredient, new ItemStack(Items.DIRT, 1)); + this(ingredient, new OutputStackInfo(1, null)); //have to use dirt, because EMPTY/AIR will cause output count to be 0 } + /** * Creates a new OutputIngredient * * @param ingredient the ingredient to source the output item from * @param outputStackInfo the additional required stack info (count, nbt) will be read from this */ - public OutputIngredient(Ingredient ingredient, ItemStack outputStackInfo) { + public OutputIngredient(Ingredient ingredient, OutputStackInfo outputStackInfo) { this.ingredient = ingredient; this.outputStackInfo = outputStackInfo; } @@ -47,10 +49,10 @@ public ItemStack getStack() { var itemStacks = Arrays.stream(this.ingredient.values).flatMap((value) -> { if (value instanceof Ingredient.TagValue tagValue) { - var item = AlmostUnifiedIntegration.getPreferredItemForTag(tagValue.tag); + var item = AlmostUnifiedIntegration.get().getPreferredItemForTag(tagValue.tag()); if (item == null) - item = BuiltInRegistries.ITEM.getTag(tagValue.tag) + item = BuiltInRegistries.ITEM.getTag(tagValue.tag()) .map(HolderSet.ListBacked::stream) .flatMap(Stream::findFirst) .map(Holder::value) @@ -61,14 +63,14 @@ public ItemStack getStack() { } //copied from Ingredient.TagValue.getItems to handle empty tags - return Stream.of(new ItemStack(Blocks.BARRIER).setHoverName(Component.literal("Empty Tag: " + tagValue.tag.location()))); + return Stream.of(new ItemStack(Blocks.BARRIER).setHoverName(Component.literal("Empty Tag: " + tagValue.tag().location()))); } return value.getItems().stream(); }).distinct().toArray(ItemStack[]::new); var outputStack = itemStacks[0].copy(); - outputStack.setCount(this.outputStackInfo.getCount()); - outputStack.setTag(this.outputStackInfo.getTag()); + outputStack.setCount(this.outputStackInfo.count()); + outputStack.setTag(this.outputStackInfo.nbt()); this.cachedOutputStack = outputStack; } return this.cachedOutputStack; @@ -78,7 +80,14 @@ public Ingredient getIngredient() { return this.ingredient; } - public ItemStack getOutputStackInfo() { + public OutputStackInfo getOutputStackInfo() { return this.outputStackInfo; } + + public record OutputStackInfo(int count, CompoundTag nbt) { + public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( + ExtraCodecs.strictOptionalField(ExtraCodecs.POSITIVE_INT, "count", 1).forGetter(OutputStackInfo::count), + ExtraCodecs.strictOptionalField(net.neoforged.neoforge.common.crafting.CraftingHelper.TAG_CODEC, "nbt").forGetter(stack -> Optional.ofNullable(stack.nbt)) + ).apply(instance, (count, nbt) -> new OutputStackInfo(count, nbt.orElse(null)))); + } } diff --git a/src/main/java/com/klikli_dev/occultism/common/misc/StorageControllerItemStackHandler.java b/src/main/java/com/klikli_dev/occultism/common/misc/StorageControllerItemStackHandler.java index 4ed83948a..84ee69660 100644 --- a/src/main/java/com/klikli_dev/occultism/common/misc/StorageControllerItemStackHandler.java +++ b/src/main/java/com/klikli_dev/occultism/common/misc/StorageControllerItemStackHandler.java @@ -28,9 +28,8 @@ import net.minecraft.nbt.ListTag; import net.minecraft.nbt.Tag; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.items.ItemHandlerHelper; -import net.minecraftforge.items.ItemStackHandler; - +import net.neoforged.neoforge.items.ItemHandlerHelper; +import net.neoforged.neoforge.items.ItemStackHandler; import javax.annotation.Nonnull; import java.util.Collections; diff --git a/src/main/java/com/klikli_dev/occultism/common/misc/WeightedOutputIngredient.java b/src/main/java/com/klikli_dev/occultism/common/misc/WeightedOutputIngredient.java index c16b96e9e..def88b9e5 100644 --- a/src/main/java/com/klikli_dev/occultism/common/misc/WeightedOutputIngredient.java +++ b/src/main/java/com/klikli_dev/occultism/common/misc/WeightedOutputIngredient.java @@ -28,10 +28,16 @@ public class WeightedOutputIngredient extends WeightedEntry.IntrusiveBase { protected OutputIngredient ingredient; + protected int weight; public WeightedOutputIngredient(Ingredient ingredient, int itemWeightIn) { super(itemWeightIn); this.ingredient = new OutputIngredient(ingredient); + this.weight = itemWeightIn; + } + + public int weight() { + return this.weight; } public ItemStack getStack() { @@ -41,4 +47,8 @@ public ItemStack getStack() { public Ingredient getIngredient() { return this.ingredient.getIngredient(); } + + public OutputIngredient.OutputStackInfo getOutputStackInfo() { + return this.ingredient.getOutputStackInfo(); + } } diff --git a/src/main/java/com/klikli_dev/occultism/common/ritual/CommandRitual.java b/src/main/java/com/klikli_dev/occultism/common/ritual/CommandRitual.java index 84d3895e1..054cecf74 100644 --- a/src/main/java/com/klikli_dev/occultism/common/ritual/CommandRitual.java +++ b/src/main/java/com/klikli_dev/occultism/common/ritual/CommandRitual.java @@ -34,6 +34,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerLevel; +import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; @@ -47,7 +48,7 @@ public CommandRitual(RitualRecipe recipe) { } @Override - public void finish(Level level, BlockPos goldenBowlPosition, GoldenSacrificialBowlBlockEntity blockEntity, Player castingPlayer, ItemStack activationItem) { + public void finish(Level level, BlockPos goldenBowlPosition, GoldenSacrificialBowlBlockEntity blockEntity, ServerPlayer castingPlayer, ItemStack activationItem) { super.finish(level, goldenBowlPosition, blockEntity, castingPlayer, activationItem); diff --git a/src/main/java/com/klikli_dev/occultism/common/ritual/CraftMinerSpiritRitual.java b/src/main/java/com/klikli_dev/occultism/common/ritual/CraftMinerSpiritRitual.java index 923d28e3c..51c1d48de 100644 --- a/src/main/java/com/klikli_dev/occultism/common/ritual/CraftMinerSpiritRitual.java +++ b/src/main/java/com/klikli_dev/occultism/common/ritual/CraftMinerSpiritRitual.java @@ -28,7 +28,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.server.level.ServerLevel; -import net.minecraft.world.entity.player.Player; +import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; @@ -40,7 +40,7 @@ public CraftMinerSpiritRitual(RitualRecipe recipe) { @Override public void finish(Level level, BlockPos goldenBowlPosition, GoldenSacrificialBowlBlockEntity BlockEntity, - Player castingPlayer, ItemStack activationItem) { + ServerPlayer castingPlayer, ItemStack activationItem) { super.finish(level, goldenBowlPosition, BlockEntity, castingPlayer, activationItem); ItemStack copy = activationItem.copy(); activationItem.shrink(1); //remove activation item. diff --git a/src/main/java/com/klikli_dev/occultism/common/ritual/CraftRitual.java b/src/main/java/com/klikli_dev/occultism/common/ritual/CraftRitual.java index 9aab6cbda..6122bf9bb 100644 --- a/src/main/java/com/klikli_dev/occultism/common/ritual/CraftRitual.java +++ b/src/main/java/com/klikli_dev/occultism/common/ritual/CraftRitual.java @@ -27,7 +27,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.server.level.ServerLevel; -import net.minecraft.world.entity.player.Player; +import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; @@ -38,7 +38,7 @@ public CraftRitual(RitualRecipe recipe) { } @Override - public void finish(Level level, BlockPos goldenBowlPosition, GoldenSacrificialBowlBlockEntity blockEntity, Player castingPlayer, ItemStack activationItem) { + public void finish(Level level, BlockPos goldenBowlPosition, GoldenSacrificialBowlBlockEntity blockEntity, ServerPlayer castingPlayer, ItemStack activationItem) { super.finish(level, goldenBowlPosition, blockEntity, castingPlayer, activationItem); diff --git a/src/main/java/com/klikli_dev/occultism/common/ritual/CraftWithSpiritNameRitual.java b/src/main/java/com/klikli_dev/occultism/common/ritual/CraftWithSpiritNameRitual.java index a804134c1..240a2ef6f 100644 --- a/src/main/java/com/klikli_dev/occultism/common/ritual/CraftWithSpiritNameRitual.java +++ b/src/main/java/com/klikli_dev/occultism/common/ritual/CraftWithSpiritNameRitual.java @@ -28,7 +28,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.server.level.ServerLevel; -import net.minecraft.world.entity.player.Player; +import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; @@ -39,7 +39,7 @@ public CraftWithSpiritNameRitual(RitualRecipe recipe) { } @Override - public void finish(Level level, BlockPos goldenBowlPosition, GoldenSacrificialBowlBlockEntity blockEntity, Player castingPlayer, ItemStack activationItem) { + public void finish(Level level, BlockPos goldenBowlPosition, GoldenSacrificialBowlBlockEntity blockEntity, ServerPlayer castingPlayer, ItemStack activationItem) { super.finish(level, goldenBowlPosition, blockEntity, castingPlayer, activationItem); ItemStack copy = activationItem.copy(); diff --git a/src/main/java/com/klikli_dev/occultism/common/ritual/FamiliarRitual.java b/src/main/java/com/klikli_dev/occultism/common/ritual/FamiliarRitual.java index 99a11a178..c04aafcd1 100644 --- a/src/main/java/com/klikli_dev/occultism/common/ritual/FamiliarRitual.java +++ b/src/main/java/com/klikli_dev/occultism/common/ritual/FamiliarRitual.java @@ -37,11 +37,10 @@ import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.MobSpawnType; -import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.level.ServerLevelAccessor; -import net.minecraftforge.event.ForgeEventFactory; +import net.neoforged.neoforge.event.EventHooks; public class FamiliarRitual extends SummonRitual { @@ -51,12 +50,12 @@ public FamiliarRitual(RitualRecipe recipe) { @Override public void finish(Level level, BlockPos goldenBowlPosition, GoldenSacrificialBowlBlockEntity blockEntity, - Player castingPlayer, ItemStack activationItem) { + ServerPlayer castingPlayer, ItemStack activationItem) { //manually call content of Ritual.finish(), because we cannot access it via super level.playSound(null, goldenBowlPosition, OccultismSounds.POOF.get(), SoundSource.BLOCKS, 0.7f, 0.7f); - castingPlayer.displayClientMessage(Component.translatable(this.getFinishedMessage()), true); - OccultismAdvancements.RITUAL.trigger((ServerPlayer) castingPlayer, this); + castingPlayer.displayClientMessage(Component.translatable(this.getFinishedMessage(castingPlayer)), true); + OccultismAdvancements.RITUAL.get().trigger(castingPlayer, this); String entityName = ItemNBTUtil.getBoundSpiritName(activationItem); activationItem.shrink(1); //remove original activation item. @@ -68,7 +67,7 @@ public void finish(Level level, BlockPos goldenBowlPosition, GoldenSacrificialBo if (entityType != null) { Entity entity = this.createSummonedEntity(entityType, level, goldenBowlPosition, blockEntity, castingPlayer); if (entity instanceof FamiliarEntity familiar) { - ForgeEventFactory.onFinalizeSpawn(familiar, (ServerLevelAccessor) level, level.getCurrentDifficultyAt(goldenBowlPosition), MobSpawnType.MOB_SUMMONED, null, null); + EventHooks.onFinalizeSpawn(familiar, (ServerLevelAccessor) level, level.getCurrentDifficultyAt(goldenBowlPosition), MobSpawnType.MOB_SUMMONED, null, null); this.applyEntityNbt(familiar); diff --git a/src/main/java/com/klikli_dev/occultism/common/ritual/Ritual.java b/src/main/java/com/klikli_dev/occultism/common/ritual/Ritual.java index f23d0773d..43dbe14e0 100644 --- a/src/main/java/com/klikli_dev/occultism/common/ritual/Ritual.java +++ b/src/main/java/com/klikli_dev/occultism/common/ritual/Ritual.java @@ -22,11 +22,13 @@ package com.klikli_dev.occultism.common.ritual; +import com.google.common.base.Suppliers; import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.common.blockentity.GoldenSacrificialBowlBlockEntity; import com.klikli_dev.occultism.common.blockentity.SacrificialBowlBlockEntity; import com.klikli_dev.occultism.crafting.recipe.RitualRecipe; import com.klikli_dev.occultism.registry.OccultismAdvancements; +import com.klikli_dev.occultism.registry.OccultismRecipes; import com.klikli_dev.occultism.registry.OccultismSounds; import net.minecraft.core.BlockPos; import net.minecraft.core.particles.ParticleTypes; @@ -41,14 +43,16 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; +import net.minecraft.world.item.crafting.RecipeHolder; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; +import net.neoforged.neoforge.event.entity.player.PlayerInteractEvent; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Optional; +import java.util.function.Supplier; public abstract class Ritual { @@ -72,6 +76,9 @@ public abstract class Ritual { public RitualRecipe recipe; public ResourceLocation factoryId; + Supplier> recipeHolderSupplier; + + //region Getter / Setter /** * Constructs a ritual. @@ -80,8 +87,6 @@ public Ritual(RitualRecipe recipe) { this.recipe = recipe; } - //region Getter / Setter - /** * Removes all matching consumed already consumed ingredients from the remaining additional ingredients. * @@ -119,8 +124,17 @@ public RitualRecipe getRecipe() { return this.recipe; } - public String getRitualID() { - ResourceLocation recipeId = this.getRecipe().getId(); + public RecipeHolder getRecipeHolder(ServerPlayer player) { + if (this.recipeHolderSupplier == null) { + this.recipeHolderSupplier = Suppliers.memoize(() -> player.getServer().getRecipeManager().getAllRecipesFor(OccultismRecipes.RITUAL_TYPE.get()).stream().filter( + r -> r.value() == this.getRecipe() + ).findFirst().orElse(null)); + } + return this.recipeHolderSupplier.get(); + } + + public String getRitualID(ServerPlayer player) { + ResourceLocation recipeId = this.getRecipeHolder(player).id(); String path = recipeId.getPath(); if (path.contains("/")) path = path.substring(path.indexOf("/") + 1); @@ -131,30 +145,30 @@ public String getRitualID() { /** * @return the conditions message translation key for this ritual. */ - public String getConditionsMessage() { - return String.format("ritual.%s.conditions", this.getRitualID()); + public String getConditionsMessage(ServerPlayer player) { + return String.format("ritual.%s.conditions", this.getRitualID(player)); } /** * @return the started message translation key for this ritual. */ - public String getStartedMessage() { - return String.format("ritual.%s.started", this.getRitualID()); + public String getStartedMessage(ServerPlayer player) { + return String.format("ritual.%s.started", this.getRitualID(player)); } /** * @return the interrupted message translation key for this ritual. */ - public String getInterruptedMessage() { - return String.format("ritual.%s.interrupted", this.getRitualID()); + public String getInterruptedMessage(ServerPlayer player) { + return String.format("ritual.%s.interrupted", this.getRitualID(player)); } //endregion Getter / Setter /** * @return the finished message translation key for this ritual. */ - public String getFinishedMessage() { - return String.format("ritual.%s.finished", this.getRitualID()); + public String getFinishedMessage(ServerPlayer player) { + return String.format("ritual.%s.finished", this.getRitualID(player)); } /** @@ -185,9 +199,9 @@ public boolean isValid(Level level, BlockPos goldenBowlPosition, GoldenSacrifici * @param activationItem the item used to start the ritual. */ public void start(Level level, BlockPos goldenBowlPosition, GoldenSacrificialBowlBlockEntity blockEntity, - Player castingPlayer, ItemStack activationItem) { + ServerPlayer castingPlayer, ItemStack activationItem) { level.playSound(null, goldenBowlPosition, OccultismSounds.START_RITUAL.get(), SoundSource.BLOCKS, 1, 1); - castingPlayer.displayClientMessage(Component.translatable(this.getStartedMessage()), true); + castingPlayer.displayClientMessage(Component.translatable(this.getStartedMessage(castingPlayer)), true); } /** @@ -200,11 +214,11 @@ public void start(Level level, BlockPos goldenBowlPosition, GoldenSacrificialBow * @param activationItem the item used to start the ritual. */ public void finish(Level level, BlockPos goldenBowlPosition, GoldenSacrificialBowlBlockEntity blockEntity, - Player castingPlayer, ItemStack activationItem) { + ServerPlayer castingPlayer, ItemStack activationItem) { level.playSound(null, goldenBowlPosition, OccultismSounds.POOF.get(), SoundSource.BLOCKS, 0.7f, 0.7f); - castingPlayer.displayClientMessage(Component.translatable(this.getFinishedMessage()), true); - OccultismAdvancements.RITUAL.trigger((ServerPlayer) castingPlayer, this); + castingPlayer.displayClientMessage(Component.translatable(this.getFinishedMessage(castingPlayer)), true); + OccultismAdvancements.RITUAL.get().trigger(castingPlayer, this); } /** @@ -217,9 +231,9 @@ public void finish(Level level, BlockPos goldenBowlPosition, GoldenSacrificialBo * @param activationItem the item used to start the ritual. */ public void interrupt(Level level, BlockPos goldenBowlPosition, GoldenSacrificialBowlBlockEntity blockEntity, - Player castingPlayer, ItemStack activationItem) { + ServerPlayer castingPlayer, ItemStack activationItem) { level.playSound(null, goldenBowlPosition, SoundEvents.CHICKEN_EGG, SoundSource.BLOCKS, 0.7f, 0.7f); - castingPlayer.displayClientMessage(Component.translatable(this.getInterruptedMessage()), true); + castingPlayer.displayClientMessage(Component.translatable(this.getInterruptedMessage(castingPlayer)), true); } /** @@ -325,27 +339,22 @@ public boolean consumeAdditionalIngredient(Level level, BlockPos goldenBowlPosit Ingredient ingredient, List consumedIngredients) { for (SacrificialBowlBlockEntity sacrificialBowl : sacrificialBowls) { //first simulate removal to check the ingredient - if (sacrificialBowl.itemStackHandler.map(handler -> { - ItemStack stack = handler.extractItem(0, 1, true); - if (ingredient.test(stack)) { - //now take for real - ItemStack extracted = handler.extractItem(0, 1, false); - consumedIngredients.add(extracted); - //Show effect in level - ((ServerLevel) level) - .sendParticles(ParticleTypes.LARGE_SMOKE, sacrificialBowl.getBlockPos().getX() + 0.5, - sacrificialBowl.getBlockPos().getY() + 1.5, sacrificialBowl.getBlockPos().getZ() + 0.5, 1, - 0.0, 0.0, 0.0, - 0.0); - - level.playSound(null, sacrificialBowl.getBlockPos(), OccultismSounds.POOF.get(), SoundSource.BLOCKS, - 0.7f, 0.7f); - return true; - } - return false; - }).orElse(false)) + ItemStack stack = sacrificialBowl.itemStackHandler.extractItem(0, 1, true); + if (ingredient.test(stack)) { + //now take for real + ItemStack extracted = sacrificialBowl.itemStackHandler.extractItem(0, 1, false); + consumedIngredients.add(extracted); + //Show effect in level + ((ServerLevel) level) + .sendParticles(ParticleTypes.LARGE_SMOKE, sacrificialBowl.getBlockPos().getX() + 0.5, + sacrificialBowl.getBlockPos().getY() + 1.5, sacrificialBowl.getBlockPos().getZ() + 0.5, 1, + 0.0, 0.0, 0.0, + 0.0); + + level.playSound(null, sacrificialBowl.getBlockPos(), OccultismSounds.POOF.get(), SoundSource.BLOCKS, + 0.7f, 0.7f); return true; - + } } return false; } @@ -415,12 +424,10 @@ public List getItemsOnSacrificialBowls(Level level, BlockPos goldenBo List sacrificialBowls = this.getSacrificialBowls(level, goldenBowlPosition); for (SacrificialBowlBlockEntity sacrificialBowl : sacrificialBowls) { - sacrificialBowl.itemStackHandler.ifPresent(handler -> { - ItemStack stack = handler.getStackInSlot(0); - if (!stack.isEmpty()) { - result.add(stack); - } - }); + ItemStack stack = sacrificialBowl.itemStackHandler.getStackInSlot(0); + if (!stack.isEmpty()) { + result.add(stack); + } } return result; diff --git a/src/main/java/com/klikli_dev/occultism/common/ritual/RitualFactory.java b/src/main/java/com/klikli_dev/occultism/common/ritual/RitualFactory.java index 3793b247a..90180b7f7 100644 --- a/src/main/java/com/klikli_dev/occultism/common/ritual/RitualFactory.java +++ b/src/main/java/com/klikli_dev/occultism/common/ritual/RitualFactory.java @@ -37,7 +37,7 @@ public RitualFactory(Function constructor) { public Ritual create(RitualRecipe recipe) { Ritual ritual = this.constructor.apply(recipe); - ritual.setFactoryId(OccultismRituals.REGISTRY.get().getKey(this)); + ritual.setFactoryId(OccultismRituals.REGISTRY.getKey(this)); return ritual; } } \ No newline at end of file diff --git a/src/main/java/com/klikli_dev/occultism/common/ritual/SummonRitual.java b/src/main/java/com/klikli_dev/occultism/common/ritual/SummonRitual.java index 8915bc127..7869605dd 100644 --- a/src/main/java/com/klikli_dev/occultism/common/ritual/SummonRitual.java +++ b/src/main/java/com/klikli_dev/occultism/common/ritual/SummonRitual.java @@ -40,8 +40,8 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.level.ServerLevelAccessor; -import net.minecraftforge.event.ForgeEventFactory; -import net.minecraftforge.items.ItemHandlerHelper; +import net.neoforged.neoforge.event.EventHooks; +import net.neoforged.neoforge.items.ItemHandlerHelper; public class SummonRitual extends Ritual { @@ -108,7 +108,7 @@ public void applyEntityNbt(Entity entity) { @Override public void finish(Level level, BlockPos goldenBowlPosition, GoldenSacrificialBowlBlockEntity blockEntity, - Player castingPlayer, ItemStack activationItem) { + ServerPlayer castingPlayer, ItemStack activationItem) { super.finish(level, goldenBowlPosition, blockEntity, castingPlayer, activationItem); ItemStack copy = activationItem.copy(); @@ -173,7 +173,7 @@ public void prepareLivingEntityForSpawn(LivingEntity livingEntity, Level level, if (spiritName.length() > 0) livingEntity.setCustomName(Component.literal(spiritName)); if (livingEntity instanceof Mob mob) { - ForgeEventFactory.onFinalizeSpawn(mob, (ServerLevelAccessor) level, level.getCurrentDifficultyAt(goldenBowlPosition), MobSpawnType.MOB_SUMMONED, null, null); + EventHooks.onFinalizeSpawn(mob, (ServerLevelAccessor) level, level.getCurrentDifficultyAt(goldenBowlPosition), MobSpawnType.MOB_SUMMONED, null, null); } } } diff --git a/src/main/java/com/klikli_dev/occultism/common/ritual/SummonSpiritWithJobRitual.java b/src/main/java/com/klikli_dev/occultism/common/ritual/SummonSpiritWithJobRitual.java index 1e4eb0a9b..e1c6404a8 100644 --- a/src/main/java/com/klikli_dev/occultism/common/ritual/SummonSpiritWithJobRitual.java +++ b/src/main/java/com/klikli_dev/occultism/common/ritual/SummonSpiritWithJobRitual.java @@ -44,7 +44,7 @@ public void initSummoned(LivingEntity living, Level level, BlockPos goldenBowlPo super.initSummoned(living, level, goldenBowlPosition, blockEntity, castingPlayer); if (living instanceof SpiritEntity spirit) { - SpiritJob job = OccultismSpiritJobs.REGISTRY.get().getValue(this.recipe.getSpiritJobType()).create(spirit); + SpiritJob job = OccultismSpiritJobs.REGISTRY.get(this.recipe.getSpiritJobType()).create(spirit); job.init(); spirit.setJob(job); } diff --git a/src/main/java/com/klikli_dev/occultism/common/ritual/SummonWildHuntRitual.java b/src/main/java/com/klikli_dev/occultism/common/ritual/SummonWildHuntRitual.java index 09c94b783..a521da7ff 100644 --- a/src/main/java/com/klikli_dev/occultism/common/ritual/SummonWildHuntRitual.java +++ b/src/main/java/com/klikli_dev/occultism/common/ritual/SummonWildHuntRitual.java @@ -34,11 +34,10 @@ import net.minecraft.server.level.ServerPlayer; import net.minecraft.sounds.SoundSource; import net.minecraft.world.entity.*; -import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.level.ServerLevelAccessor; -import net.minecraftforge.event.ForgeEventFactory; +import net.neoforged.neoforge.event.EventHooks; public class SummonWildHuntRitual extends SummonRitual { @@ -48,12 +47,12 @@ public SummonWildHuntRitual(RitualRecipe recipe) { @Override public void finish(Level level, BlockPos goldenBowlPosition, GoldenSacrificialBowlBlockEntity blockEntity, - Player castingPlayer, ItemStack activationItem) { + ServerPlayer castingPlayer, ItemStack activationItem) { //manually call content of Ritual.finish(), because we cannot access it via super level.playSound(null, goldenBowlPosition, OccultismSounds.POOF.get(), SoundSource.BLOCKS, 0.7f, 0.7f); - castingPlayer.displayClientMessage(Component.translatable(this.getFinishedMessage()), true); - OccultismAdvancements.RITUAL.trigger((ServerPlayer) castingPlayer, this); + castingPlayer.displayClientMessage(Component.translatable(this.getFinishedMessage(castingPlayer)), true); + OccultismAdvancements.RITUAL.get().trigger(castingPlayer, this); activationItem.shrink(1); //remove original activation item. @@ -77,7 +76,7 @@ public void finish(Level level, BlockPos goldenBowlPosition, GoldenSacrificialBo living.setCustomName(Component.literal(TextUtil.generateName())); if (living instanceof Mob mob) { - ForgeEventFactory.onFinalizeSpawn(mob, (ServerLevelAccessor) level, level.getCurrentDifficultyAt(goldenBowlPosition), MobSpawnType.MOB_SUMMONED, null, null); + EventHooks.onFinalizeSpawn(mob, (ServerLevelAccessor) level, level.getCurrentDifficultyAt(goldenBowlPosition), MobSpawnType.MOB_SUMMONED, null, null); } this.applyEntityNbt(living); diff --git a/src/main/java/com/klikli_dev/occultism/config/OccultismClientConfig.java b/src/main/java/com/klikli_dev/occultism/config/OccultismClientConfig.java index daae39ba9..f58e0ac2c 100644 --- a/src/main/java/com/klikli_dev/occultism/config/OccultismClientConfig.java +++ b/src/main/java/com/klikli_dev/occultism/config/OccultismClientConfig.java @@ -22,18 +22,18 @@ package com.klikli_dev.occultism.config; -import net.minecraftforge.common.ForgeConfigSpec; -import net.minecraftforge.common.ForgeConfigSpec.BooleanValue; -import net.minecraftforge.common.ForgeConfigSpec.IntValue; +import net.neoforged.neoforge.common.ModConfigSpec; +import net.neoforged.neoforge.common.ModConfigSpec.BooleanValue; +import net.neoforged.neoforge.common.ModConfigSpec.IntValue; public class OccultismClientConfig { public final VisualSettings visuals; public final MiscSettings misc; - public final ForgeConfigSpec spec; + public final ModConfigSpec spec; public OccultismClientConfig() { - ForgeConfigSpec.Builder builder = new ForgeConfigSpec.Builder(); + ModConfigSpec.Builder builder = new ModConfigSpec.Builder(); this.visuals = new VisualSettings(builder); this.misc = new MiscSettings(builder); this.spec = builder.build(); @@ -45,13 +45,13 @@ public static class VisualSettings { public final BooleanValue disableHolidayTheming; public final BooleanValue useAlternativeDivinationRodRenderer; - public final ForgeConfigSpec.ConfigValue whiteChalkGlyphColor; - public final ForgeConfigSpec.ConfigValue goldenChalkGlyphColor; - public final ForgeConfigSpec.ConfigValue purpleChalkGlyphColor; - public final ForgeConfigSpec.ConfigValue redChalkGlyphColor; + public final ModConfigSpec.ConfigValue whiteChalkGlyphColor; + public final ModConfigSpec.ConfigValue goldenChalkGlyphColor; + public final ModConfigSpec.ConfigValue purpleChalkGlyphColor; + public final ModConfigSpec.ConfigValue redChalkGlyphColor; - public VisualSettings(ForgeConfigSpec.Builder builder) { + public VisualSettings(ModConfigSpec.Builder builder) { builder.comment("Visual Settings").push("visual"); this.showItemTagsInTooltip = builder.comment("Shows all tags an item has in the tooltip on hover if advanced tooltips (F3+H) are enabled.") .define("showItemTagsInTooltip", false); @@ -98,7 +98,7 @@ public static class MiscSettings { public final BooleanValue divinationRodHighlightAllResults; public final IntValue divinationRodScanRange; - public MiscSettings(ForgeConfigSpec.Builder builder) { + public MiscSettings(ModConfigSpec.Builder builder) { builder.comment("Misc Settings").push("misc"); this.syncJeiSearch = builder.comment("Sync JEI search in storage actuator.") diff --git a/src/main/java/com/klikli_dev/occultism/config/OccultismCommonConfig.java b/src/main/java/com/klikli_dev/occultism/config/OccultismCommonConfig.java index 3e24f4ec7..93ba0afc2 100644 --- a/src/main/java/com/klikli_dev/occultism/config/OccultismCommonConfig.java +++ b/src/main/java/com/klikli_dev/occultism/config/OccultismCommonConfig.java @@ -22,13 +22,13 @@ package com.klikli_dev.occultism.config; -import net.minecraftforge.common.ForgeConfigSpec; +import net.neoforged.neoforge.common.ModConfigSpec; public class OccultismCommonConfig { - public final ForgeConfigSpec spec; + public final ModConfigSpec spec; public OccultismCommonConfig() { - ForgeConfigSpec.Builder builder = new ForgeConfigSpec.Builder(); + ModConfigSpec.Builder builder = new ModConfigSpec.Builder(); this.spec = builder.build(); } } diff --git a/src/main/java/com/klikli_dev/occultism/config/OccultismServerConfig.java b/src/main/java/com/klikli_dev/occultism/config/OccultismServerConfig.java index abd98d537..fd5690068 100644 --- a/src/main/java/com/klikli_dev/occultism/config/OccultismServerConfig.java +++ b/src/main/java/com/klikli_dev/occultism/config/OccultismServerConfig.java @@ -22,15 +22,14 @@ package com.klikli_dev.occultism.config; -import net.minecraftforge.common.ForgeConfigSpec; -import net.minecraftforge.common.ForgeConfigSpec.BooleanValue; -import net.minecraftforge.common.ForgeConfigSpec.ConfigValue; -import net.minecraftforge.common.ForgeConfigSpec.DoubleValue; - import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; +import net.neoforged.neoforge.common.ModConfigSpec; +import net.neoforged.neoforge.common.ModConfigSpec.BooleanValue; +import net.neoforged.neoforge.common.ModConfigSpec.ConfigValue; +import net.neoforged.neoforge.common.ModConfigSpec.DoubleValue; public class OccultismServerConfig { @@ -40,10 +39,10 @@ public class OccultismServerConfig { public final RitualSettings rituals; public final DimensionalMineshaftSettings dimensionalMineshaft; public final ItemSettings itemSettings; - public final ForgeConfigSpec spec; + public final ModConfigSpec spec; public OccultismServerConfig() { - ForgeConfigSpec.Builder builder = new ForgeConfigSpec.Builder(); + ModConfigSpec.Builder builder = new ModConfigSpec.Builder(); this.storage = new StorageSettings(builder); this.spiritJobs = new SpiritJobSettings(builder); this.rituals = new RitualSettings(builder); @@ -54,7 +53,7 @@ public OccultismServerConfig() { public static class ItemSettings { - public ItemSettings(ForgeConfigSpec.Builder builder) { + public ItemSettings(ModConfigSpec.Builder builder) { builder.comment("Item Settings").push("items"); builder.pop(); @@ -76,7 +75,7 @@ public static class SpiritJobSettings { public final ConfigValue blacksmithFamiliarUpgradeCooldown; public final ConfigValue blacksmithFamiliarRepairChance; - public SpiritJobSettings(ForgeConfigSpec.Builder builder) { + public SpiritJobSettings(ModConfigSpec.Builder builder) { builder.comment("Spirit Job Settings").push("spirit_job"); this.drikwingFamiliarSlowFallingSeconds = builder.comment( @@ -146,7 +145,7 @@ public static class DimensionalMineshaftSettings { public final MinerSpiritSettings minerAfritDeeps; public final MinerSpiritSettings minerMaridMaster; - public DimensionalMineshaftSettings(ForgeConfigSpec.Builder builder) { + public DimensionalMineshaftSettings(ModConfigSpec.Builder builder) { builder.comment("Dimensional Mineshaft Settings").push("dimensional_mineshaft"); this.minerFoliotUnspecialized = @@ -169,7 +168,7 @@ public static class MinerSpiritSettings { public final ConfigValue rollsPerOperation; public final ConfigValue durability; - public MinerSpiritSettings(String oreName, ForgeConfigSpec.Builder builder, + public MinerSpiritSettings(String oreName, ModConfigSpec.Builder builder, int maxMiningTime, int rollsPerOperation, int durability) { builder.comment("Miner Spirit Settings").push(oreName); @@ -202,7 +201,7 @@ public static class RitualSettings { public final DoubleValue usePossibleSpiritNamesChance; - public RitualSettings(ForgeConfigSpec.Builder builder) { + public RitualSettings(ModConfigSpec.Builder builder) { builder.comment("Ritual Settings").push("rituals"); this.enableClearWeatherRitual = @@ -257,7 +256,7 @@ public static class StorageSettings { public final BooleanValue overrideItemStackSizes; public final BooleanValue unlinkWormholeOnBreak; - public StorageSettings(ForgeConfigSpec.Builder builder) { + public StorageSettings(ModConfigSpec.Builder builder) { builder.comment("Storage Settings").push("storage"); this.stabilizerTier1Slots = builder.comment("The amount of slots the storage stabilizer tier 1 provides.") diff --git a/src/main/java/com/klikli_dev/occultism/crafting/recipe/CrushingRecipe.java b/src/main/java/com/klikli_dev/occultism/crafting/recipe/CrushingRecipe.java index c83892398..b4e16a53b 100644 --- a/src/main/java/com/klikli_dev/occultism/crafting/recipe/CrushingRecipe.java +++ b/src/main/java/com/klikli_dev/occultism/crafting/recipe/CrushingRecipe.java @@ -26,29 +26,63 @@ import com.google.gson.JsonObject; import com.klikli_dev.occultism.common.misc.OutputIngredient; import com.klikli_dev.occultism.registry.OccultismRecipes; +import com.klikli_dev.theurgy.content.recipe.DistillationRecipe; +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.core.RegistryAccess; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.NbtOps; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.resources.ResourceLocation; +import net.minecraft.util.ExtraCodecs; import net.minecraft.util.GsonHelper; 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.RecipeType; import net.minecraft.world.level.Level; -import net.minecraftforge.common.crafting.CraftingHelper; +import net.neoforged.neoforge.common.crafting.CraftingHelper; + +import java.util.Optional; public class CrushingRecipe extends ItemStackFakeInventoryRecipe { - public static Serializer SERIALIZER = new Serializer(); + public static int DEFAULT_CRUSHING_TIME = 200; + public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( + Ingredient.CODEC + .fieldOf("ingredient").forGetter((r) -> r.input), + Ingredient.CODEC.fieldOf("result").forGetter(r -> r.output.getIngredient()), + OutputIngredient.OutputStackInfo.CODEC.fieldOf("result").forGetter(r -> r.output.getOutputStackInfo()), + Codec.INT.optionalFieldOf("min_tier", -1).forGetter(r -> r.minTier), + Codec.INT.optionalFieldOf("crushing_time", DEFAULT_CRUSHING_TIME).forGetter(r -> r.crushingTime), + Codec.BOOL.optionalFieldOf("ignore_crushing_multiplier", false).forGetter(r -> r.ignoreCrushingMultiplier) + ).apply(instance, (input, output, outputStackInfo, minTier, crushingTime, ignoreCrushingMultiplier) -> { + return new CrushingRecipe(input, new OutputIngredient(output, outputStackInfo), minTier, crushingTime, ignoreCrushingMultiplier); + })); + + public static final Codec NETWORK_CODEC = RecordCodecBuilder.create(instance -> instance.group( + Ingredient.CODEC + .fieldOf("ingredient").forGetter((r) -> r.input), + Ingredient.CODEC.fieldOf("result").forGetter(r -> r.output.getIngredient()), + OutputIngredient.OutputStackInfo.CODEC.fieldOf("result_stack_info").forGetter(r -> r.output.getOutputStackInfo()), + Codec.INT.optionalFieldOf("min_tier", -1).forGetter(r -> r.minTier), + Codec.INT.optionalFieldOf("crushing_time", DEFAULT_CRUSHING_TIME).forGetter(r -> r.crushingTime), + Codec.BOOL.optionalFieldOf("ignore_crushing_multiplier", false).forGetter(r -> r.ignoreCrushingMultiplier) + ).apply(instance, (input, output, outputStackInfo, minTier, crushingTime, ignoreCrushingMultiplier) -> { + return new CrushingRecipe(input, new OutputIngredient(output, outputStackInfo), minTier, crushingTime, ignoreCrushingMultiplier); + })); + + public static Serializer SERIALIZER = new Serializer(); + protected final int crushingTime; protected final int minTier; protected final boolean ignoreCrushingMultiplier; protected OutputIngredient output; - public CrushingRecipe(ResourceLocation id, Ingredient input, OutputIngredient output, int minTier, int crushingTime, boolean ignoreCrushingMultiplier) { - super(id, input, ItemStack.EMPTY); //hand over empty item stack, because we cannot resolve output.getStack() yet as tags are not resolved yet. + public CrushingRecipe(Ingredient input, OutputIngredient output, int minTier, int crushingTime, boolean ignoreCrushingMultiplier) { + super(input, ItemStack.EMPTY); //hand over empty item stack, because we cannot resolve output.getStack() yet as tags are not resolved yet. this.output = output; this.crushingTime = crushingTime; this.minTier = minTier; @@ -100,54 +134,20 @@ public RecipeType getType() { public static class Serializer implements RecipeSerializer { @Override - public CrushingRecipe fromJson(ResourceLocation recipeId, JsonObject originalJson) { - var json = originalJson.deepCopy(); //we are modifying the json, so we need a copy to avoid side effects to e.g. KubeJS - - int crushingTime = GsonHelper.getAsInt(json, "crushing_time", DEFAULT_CRUSHING_TIME); - boolean ignoreCrushingMultiplier = GsonHelper.getAsBoolean(json, "ignore_crushing_multiplier", false); - int minTier = GsonHelper.getAsInt(json, "min_tier", -1); - - var resultElement = GsonHelper.getAsJsonObject(json, "result"); - - //our recipe supports tags and items as output, so we use the ingredient loader which handles both - var outputIngredient = Ingredient.fromJson(resultElement); - - //the ingredient loader does not handle count and nbt, so we use the item loader - //The item loader requires and "item" field, so we add it if it is missing - if(!resultElement.has("item")) - //just a dummy, OutputIngredient will not use the item type. - //however, cannot be air as that will make ItemStack report as empty - resultElement.addProperty("item", "minecraft:dirt"); - - //helper to get count and nbt for our output ingredient - ItemStack outputStackInfo = CraftingHelper.getItemStack(GsonHelper.getAsJsonObject(json, "result"), true); - - JsonElement ingredientElement = GsonHelper.isArrayNode(json, "ingredient") ? GsonHelper.getAsJsonArray(json, - "ingredient") : GsonHelper.getAsJsonObject(json, "ingredient"); - Ingredient ingredient = Ingredient.fromJson(ingredientElement); - - return new CrushingRecipe(recipeId, ingredient, new OutputIngredient(outputIngredient, outputStackInfo), minTier, crushingTime, ignoreCrushingMultiplier); + public Codec codec() { + return CODEC; } @Override - public CrushingRecipe fromNetwork(ResourceLocation recipeId, FriendlyByteBuf buffer) { - int crushingTime = buffer.readInt(); - boolean ignoreCrushingMultiplier = buffer.readBoolean(); - int minTier = buffer.readInt(); - Ingredient ingredient = Ingredient.fromNetwork(buffer); - Ingredient outputIngredient = Ingredient.fromNetwork(buffer); - ItemStack outputStackInfo = buffer.readItem(); - return new CrushingRecipe(recipeId, ingredient, new OutputIngredient(outputIngredient, outputStackInfo), minTier, crushingTime, ignoreCrushingMultiplier); + public CrushingRecipe fromNetwork(FriendlyByteBuf pBuffer) { + //noinspection deprecation + return pBuffer.readWithCodecTrusted(NbtOps.INSTANCE, NETWORK_CODEC); } @Override - public void toNetwork(FriendlyByteBuf buffer, CrushingRecipe recipe) { - buffer.writeInt(recipe.crushingTime); - buffer.writeBoolean(recipe.ignoreCrushingMultiplier); - buffer.writeInt(recipe.minTier); - recipe.input.toNetwork(buffer); - recipe.output.getIngredient().toNetwork(buffer); - buffer.writeItem(recipe.output.getOutputStackInfo()); + public void toNetwork(FriendlyByteBuf pBuffer, CrushingRecipe pRecipe) { + //noinspection deprecation + pBuffer.writeWithCodec(NbtOps.INSTANCE, NETWORK_CODEC, pRecipe); } } } \ No newline at end of file diff --git a/src/main/java/com/klikli_dev/occultism/crafting/recipe/ItemStackFakeInventoryRecipe.java b/src/main/java/com/klikli_dev/occultism/crafting/recipe/ItemStackFakeInventoryRecipe.java index 7630f435a..57530df1a 100644 --- a/src/main/java/com/klikli_dev/occultism/crafting/recipe/ItemStackFakeInventoryRecipe.java +++ b/src/main/java/com/klikli_dev/occultism/crafting/recipe/ItemStackFakeInventoryRecipe.java @@ -22,30 +22,21 @@ package com.klikli_dev.occultism.crafting.recipe; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; 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.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.level.Level; -import net.minecraftforge.common.crafting.CraftingHelper; public abstract class ItemStackFakeInventoryRecipe implements Recipe { - public static Serializer SERIALIZER = new Serializer(); - protected final ResourceLocation id; protected final Ingredient input; protected final ItemStack output; - public ItemStackFakeInventoryRecipe(ResourceLocation id, Ingredient input, ItemStack output) { + public ItemStackFakeInventoryRecipe(Ingredient input, ItemStack output) { this.input = input; this.output = output; - this.id = id; } @Override @@ -74,41 +65,4 @@ public NonNullList getIngredients() { return NonNullList.of(Ingredient.EMPTY, this.input); } - @Override - public ResourceLocation getId() { - return this.id; - } - - public interface IItemStackFakeInventoryRecipeFactory { - - T create(ResourceLocation id, Ingredient input, ItemStack output); - - } - - public static class Serializer { - - public T read(IItemStackFakeInventoryRecipeFactory factory, - ResourceLocation recipeId, JsonObject json) { - //we also allow arrays, but only one ingredient will be used. - JsonElement ingredientElement = GsonHelper.isArrayNode(json, "ingredient") ? GsonHelper.getAsJsonArray(json, - "ingredient") : GsonHelper.getAsJsonObject(json, "ingredient"); - Ingredient ingredient = Ingredient.fromJson(ingredientElement); - ItemStack result = CraftingHelper.getItemStack(GsonHelper.getAsJsonObject(json, "result"), true); - - return factory.create(recipeId, ingredient, result); - } - - public T read(IItemStackFakeInventoryRecipeFactory factory, - ResourceLocation recipeId, FriendlyByteBuf buffer) { - Ingredient ingredient = Ingredient.fromNetwork(buffer); - ItemStack result = buffer.readItem(); - return factory.create(recipeId, ingredient, result); - } - - public void write(FriendlyByteBuf buffer, T recipe) { - recipe.input.toNetwork(buffer); - buffer.writeItem(recipe.output); - } - - } } \ No newline at end of file diff --git a/src/main/java/com/klikli_dev/occultism/crafting/recipe/MinerRecipe.java b/src/main/java/com/klikli_dev/occultism/crafting/recipe/MinerRecipe.java index b39586496..57bb8b8c4 100644 --- a/src/main/java/com/klikli_dev/occultism/crafting/recipe/MinerRecipe.java +++ b/src/main/java/com/klikli_dev/occultism/crafting/recipe/MinerRecipe.java @@ -22,33 +22,40 @@ package com.klikli_dev.occultism.crafting.recipe; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; import com.klikli_dev.occultism.common.misc.WeightedOutputIngredient; import com.klikli_dev.occultism.registry.OccultismRecipes; +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.core.NonNullList; import net.minecraft.core.RegistryAccess; +import net.minecraft.nbt.NbtOps; import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.util.GsonHelper; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.item.crafting.RecipeType; import net.minecraft.world.level.Level; -import net.minecraftforge.items.wrapper.RecipeWrapper; +import net.neoforged.neoforge.items.wrapper.RecipeWrapper; public class MinerRecipe implements Recipe { + + public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( + Ingredient.CODEC + .fieldOf("ingredient").forGetter((r) -> r.input), + Ingredient.CODEC.fieldOf("result").forGetter(r -> r.output.getIngredient()), + Codec.INT.fieldOf("weight").forGetter(r -> r.output.weight()) + ).apply(instance, (input, output, weight) -> { + return new MinerRecipe(input, new WeightedOutputIngredient(output, weight)); + })); + public static Serializer SERIALIZER = new Serializer(); - protected final ResourceLocation id; protected final Ingredient input; protected final WeightedOutputIngredient output; - public MinerRecipe(ResourceLocation id, Ingredient input, WeightedOutputIngredient output) { + public MinerRecipe(Ingredient input, WeightedOutputIngredient output) { this.input = input; this.output = output; - this.id = id; } @Override @@ -86,11 +93,6 @@ public NonNullList getIngredients() { return NonNullList.of(Ingredient.EMPTY, this.input); } - @Override - public ResourceLocation getId() { - return this.id; - } - @Override public RecipeSerializer getSerializer() { return SERIALIZER; @@ -105,31 +107,20 @@ public RecipeType getType() { public static class Serializer implements RecipeSerializer { @Override - public MinerRecipe fromJson(ResourceLocation recipeId, JsonObject json) { - JsonElement ingredientElement = GsonHelper.isArrayNode(json, "ingredient") ? GsonHelper.getAsJsonArray(json, - "ingredient") : GsonHelper.getAsJsonObject(json, "ingredient"); - Ingredient ingredient = Ingredient.fromJson(ingredientElement); - JsonElement resultElement = GsonHelper.getAsJsonObject(json, "result"); - Ingredient result = Ingredient.fromJson(resultElement); - int weight = GsonHelper.getAsInt(json, "weight"); - - return new MinerRecipe(recipeId, ingredient, new WeightedOutputIngredient(result, weight)); + public Codec codec() { + return CODEC; } @Override - public MinerRecipe fromNetwork(ResourceLocation recipeId, FriendlyByteBuf buffer) { - Ingredient ingredient = Ingredient.fromNetwork(buffer); - Ingredient result = Ingredient.fromNetwork(buffer); - int weight = buffer.readInt(); - - return new MinerRecipe(recipeId, ingredient, new WeightedOutputIngredient(result, weight)); + public MinerRecipe fromNetwork(FriendlyByteBuf pBuffer) { + //noinspection deprecation + return pBuffer.readWithCodecTrusted(NbtOps.INSTANCE, CODEC); } @Override - public void toNetwork(FriendlyByteBuf buffer, MinerRecipe recipe) { - recipe.input.toNetwork(buffer); - recipe.output.getIngredient().toNetwork(buffer); - buffer.writeInt(recipe.output.getWeight().asInt()); + public void toNetwork(FriendlyByteBuf pBuffer, MinerRecipe pRecipe) { + //noinspection deprecation + pBuffer.writeWithCodec(NbtOps.INSTANCE, CODEC, pRecipe); } } } \ No newline at end of file diff --git a/src/main/java/com/klikli_dev/occultism/crafting/recipe/RitualRecipe.java b/src/main/java/com/klikli_dev/occultism/crafting/recipe/RitualRecipe.java index 37041b27b..13d4755d2 100644 --- a/src/main/java/com/klikli_dev/occultism/crafting/recipe/RitualRecipe.java +++ b/src/main/java/com/klikli_dev/occultism/crafting/recipe/RitualRecipe.java @@ -22,71 +22,83 @@ package com.klikli_dev.occultism.crafting.recipe; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; +import com.google.common.base.Suppliers; import com.klikli_dev.modonomicon.api.ModonomiconAPI; import com.klikli_dev.modonomicon.api.multiblock.Multiblock; import com.klikli_dev.occultism.common.ritual.Ritual; import com.klikli_dev.occultism.registry.OccultismRecipes; import com.klikli_dev.occultism.registry.OccultismRituals; +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; +import net.minecraft.client.Minecraft; import net.minecraft.core.BlockPos; import net.minecraft.core.NonNullList; import net.minecraft.core.RegistryAccess; -import net.minecraft.core.registries.Registries; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.NbtOps; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.resources.ResourceLocation; +import net.minecraft.server.MinecraftServer; import net.minecraft.tags.TagKey; -import net.minecraft.util.GsonHelper; import net.minecraft.world.Container; import net.minecraft.world.entity.EntityType; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.crafting.*; +import net.minecraft.world.item.crafting.Ingredient; +import net.minecraft.world.item.crafting.Recipe; +import net.minecraft.world.item.crafting.RecipeSerializer; +import net.minecraft.world.item.crafting.RecipeType; import net.minecraft.world.level.Level; -import net.minecraftforge.common.crafting.CraftingHelper; -import net.minecraftforge.registries.ForgeRegistries; -import java.util.Iterator; +import java.util.Optional; import java.util.function.Supplier; public class RitualRecipe implements Recipe { - public static Serializer SERIALIZER = new Serializer(); + public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( + ResourceLocation.CODEC.fieldOf("pentacle_id").forGetter((r) -> r.pentacleId), + ResourceLocation.CODEC.fieldOf("ritual_type").forGetter((r) -> r.ritualType), + ItemStack.ITEM_WITH_COUNT_CODEC.fieldOf("ritual_dummy").forGetter((r) -> r.ritualDummy), + ItemStack.ITEM_WITH_COUNT_CODEC.fieldOf("result").forGetter((r) -> r.result), + BuiltInRegistries.ENTITY_TYPE.byNameCodec().optionalFieldOf("entity_to_summon").forGetter(r -> Optional.ofNullable(r.entityToSummon)), + CompoundTag.CODEC.optionalFieldOf("entity_nbt").forGetter(r -> Optional.ofNullable(r.entityNbt)), + Ingredient.CODEC.fieldOf("activation_item").forGetter((r) -> r.activationItem), + Ingredient.LIST_CODEC.fieldOf("ingredients").forGetter((r) -> r.ingredients), + Codec.INT.optionalFieldOf("duration", 30).forGetter((r) -> r.duration), + Codec.INT.optionalFieldOf("spirit_max_age", -1).forGetter((r) -> r.spiritMaxAge), + ResourceLocation.CODEC.optionalFieldOf("spirit_job_type").forGetter(r -> Optional.ofNullable(r.spiritJobType)), + EntityToSacrifice.CODEC.optionalFieldOf("entity_to_sacrifice").forGetter(r -> Optional.ofNullable(r.entityToSacrifice)), + Ingredient.CODEC.optionalFieldOf("item_to_use").forGetter(r -> Optional.ofNullable(r.itemToUse)), + Codec.STRING.optionalFieldOf("command").forGetter(r -> Optional.ofNullable(r.command)) + ).apply(instance, (pentacleId, ritualType, ritualDummy, result, entityToSummon, entityNbt, activationItem, ingredients, duration, spiritMaxAge, spiritJobType, entityToSacrifice, itemToUse, command) -> new RitualRecipe(pentacleId, ritualType, ritualDummy, result, entityToSummon.orElse(null), entityNbt.orElse(null), activationItem, + NonNullList.copyOf(ingredients), duration, spiritMaxAge, spiritJobType.orElse(null), entityToSacrifice.orElse(null), itemToUse.orElse(null), command.orElse(null))) + ); + public static Serializer SERIALIZER = new Serializer(); + final ItemStack result; + final NonNullList ingredients; private final ResourceLocation pentacleId; private final ResourceLocation ritualType; private final ResourceLocation spiritJobType; private final Supplier ritual; private final ItemStack ritualDummy; private final Ingredient activationItem; - private final TagKey> entityToSacrifice; + private final EntityToSacrifice entityToSacrifice; private final EntityType entityToSummon; - private final CompoundTag entityNbt; private final Ingredient itemToUse; private final int duration; private final int spiritMaxAge; private final float durationPerIngredient; - private final String entityToSacrificeDisplayName; private final String command; - - private final ResourceLocation id; - - final ItemStack result; - final NonNullList ingredients; - - public RitualRecipe(ResourceLocation id, ResourceLocation pentacleId, ResourceLocation ritualType, ItemStack ritualDummy, - ItemStack result, EntityType entityToSummon, CompoundTag entityNbt, Ingredient activationItem, NonNullList ingredients, int duration, int spiritMaxAge, ResourceLocation spiritJobType, - TagKey> entityToSacrifice, String entityToSacrificeDisplayName, Ingredient itemToUse, String command) { - this.id = id; + public RitualRecipe(ResourceLocation pentacleId, ResourceLocation ritualType, ItemStack ritualDummy, + ItemStack result, EntityType entityToSummon, CompoundTag entityNbt, Ingredient activationItem, NonNullList ingredients, int duration, int spiritMaxAge, ResourceLocation spiritJobType, EntityToSacrifice entityToSacrifice, Ingredient itemToUse, String command) { this.result = result; this.ingredients = ingredients; this.entityToSummon = entityToSummon; this.entityNbt = entityNbt; this.pentacleId = pentacleId; this.ritualType = ritualType; - this.ritual = () -> OccultismRituals.REGISTRY.get().getValue(this.ritualType).create(this); + this.ritual = () -> OccultismRituals.REGISTRY.get(this.ritualType).create(this); this.ritualDummy = ritualDummy; this.activationItem = activationItem; this.duration = duration; @@ -94,7 +106,6 @@ public RitualRecipe(ResourceLocation id, ResourceLocation pentacleId, ResourceLo this.spiritJobType = spiritJobType; this.durationPerIngredient = this.duration / (float) (this.getIngredients().size() + 1); this.entityToSacrifice = entityToSacrifice; - this.entityToSacrificeDisplayName = entityToSacrificeDisplayName; this.itemToUse = itemToUse; this.command = command; } @@ -152,11 +163,6 @@ public ItemStack assemble(Container pInv, RegistryAccess access) { return null; } - @Override - public ResourceLocation getId() { - return this.id; - } - @Override public boolean canCraftInDimensions(int i, int i1) { return true; @@ -190,7 +196,7 @@ public RecipeType getType() { } public TagKey> getEntityToSacrifice() { - return this.entityToSacrifice; + return this.entityToSacrifice.tag(); } public boolean requiresSacrifice() { @@ -218,7 +224,7 @@ public Ritual getRitual() { } public String getEntityToSacrificeDisplayName() { - return this.entityToSacrificeDisplayName; + return this.entityToSacrifice.displayName(); } public ResourceLocation getSpiritJobType() { @@ -229,180 +235,30 @@ public int getSpiritMaxAge() { return this.spiritMaxAge; } - public static class Serializer implements RecipeSerializer { - private static final ShapelessRecipe.Serializer serializer = new ShapelessRecipe.Serializer(); - - private static NonNullList itemsFromJson(JsonArray pIngredientArray) { - NonNullList nonnulllist = NonNullList.create(); - - for (int i = 0; i < pIngredientArray.size(); ++i) { - Ingredient ingredient = Ingredient.fromJson(pIngredientArray.get(i)); - if (!ingredient.isEmpty()) { - nonnulllist.add(ingredient); - } - } + public record EntityToSacrifice(TagKey> tag, String displayName) { + public static Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( + TagKey.codec(BuiltInRegistries.ENTITY_TYPE.key()).fieldOf("tag").forGetter(EntityToSacrifice::tag), + Codec.STRING.fieldOf("display_name").forGetter(EntityToSacrifice::displayName) + ).apply(instance, EntityToSacrifice::new)); + } - return nonnulllist; - } + public static class Serializer implements RecipeSerializer { @Override - public RitualRecipe fromJson(ResourceLocation recipeId, JsonObject json) { - NonNullList ingredients = itemsFromJson(GsonHelper.getAsJsonArray(json, "ingredients")); - if (ingredients.isEmpty()) { - throw new JsonParseException("No ingredients for shapeless recipe"); - } - ItemStack result = ShapedRecipe.itemStackFromJson(GsonHelper.getAsJsonObject(json, "result")); - - ResourceLocation ritualType = new ResourceLocation(json.get("ritual_type").getAsString()); - - EntityType entityToSummon = null; - if (json.has("entity_to_summon")) { - entityToSummon = ForgeRegistries.ENTITY_TYPES.getValue(new ResourceLocation(GsonHelper.getAsString(json, "entity_to_summon"))); - } - - CompoundTag entityNbt = null; - if (json.has("entity_nbt")) { - entityNbt = CraftingHelper.getNBT(json.get("entity_nbt")); - } - - JsonElement activationItemElement = - GsonHelper.isArrayNode(json, "activation_item") ? GsonHelper.getAsJsonArray(json, - "activation_item") : GsonHelper.getAsJsonObject(json, "activation_item"); - Ingredient activationItem = Ingredient.fromJson(activationItemElement); - - ResourceLocation pentacleId = new ResourceLocation(json.get("pentacle_id").getAsString()); - - int duration = GsonHelper.getAsInt(json, "duration", 30); - int spiritMaxAge = GsonHelper.getAsInt(json, "spirit_max_age", -1); - - ResourceLocation spiritJobType = null; - if (json.has("spirit_job_type")) { - spiritJobType = new ResourceLocation(json.get("spirit_job_type").getAsString()); - } - - ItemStack ritualDummy = CraftingHelper.getItemStack(GsonHelper.getAsJsonObject(json, "ritual_dummy"), true); - - TagKey> entityToSacrifice = null; - String entityToSacrificeDisplayName = ""; - if (json.has("entity_to_sacrifice")) { - var tagRL = new ResourceLocation(GsonHelper.getAsString(json.getAsJsonObject("entity_to_sacrifice"), "tag")); - entityToSacrifice = TagKey.create(Registries.ENTITY_TYPE, tagRL); - - entityToSacrificeDisplayName = json.getAsJsonObject("entity_to_sacrifice").get("display_name").getAsString(); - } - - Ingredient itemToUse = Ingredient.EMPTY; - if (json.has("item_to_use")) { - JsonElement itemToUseElement = - GsonHelper.isArrayNode(json, "item_to_use") ? GsonHelper.getAsJsonArray(json, - "item_to_use") : GsonHelper.getAsJsonObject(json, "item_to_use"); - itemToUse = Ingredient.fromJson(itemToUseElement); - - } - - var command = GsonHelper.getAsString(json, "command", null); - - return new RitualRecipe(recipeId, pentacleId, ritualType, ritualDummy, - result, entityToSummon, entityNbt, activationItem, ingredients, duration, - spiritMaxAge, spiritJobType, entityToSacrifice, entityToSacrificeDisplayName, itemToUse, command); + public Codec codec() { + return CODEC; } @Override - public RitualRecipe fromNetwork(ResourceLocation recipeId, FriendlyByteBuf buffer) { - int ingredientCount = buffer.readVarInt(); - NonNullList ingredients = NonNullList.withSize(ingredientCount, Ingredient.EMPTY); - - for(int j = 0; j < ingredients.size(); ++j) { - ingredients.set(j, Ingredient.fromNetwork(buffer)); - } - - ItemStack result = buffer.readItem(); - - ResourceLocation ritualType = buffer.readResourceLocation(); - - EntityType entityToSummon = null; - if (buffer.readBoolean()) { - entityToSummon = buffer.readRegistryId(); - } - - CompoundTag entityNbt = null; - if (buffer.readBoolean()) { - entityNbt = buffer.readNbt(); - } - - ResourceLocation pentacleId = buffer.readResourceLocation(); - int duration = buffer.readVarInt(); - int spiritMaxAge = buffer.readVarInt(); - - ResourceLocation spiritJobType = null; - if (buffer.readBoolean()) { - spiritJobType = buffer.readResourceLocation(); - } - - ItemStack ritualDummy = buffer.readItem(); - Ingredient activationItem = Ingredient.fromNetwork(buffer); - - TagKey> entityToSacrifice = null; - String entityToSacrificeDisplayName = ""; - if (buffer.readBoolean()) { - var tagRL = buffer.readResourceLocation(); - entityToSacrifice = TagKey.create(Registries.ENTITY_TYPE, tagRL); - entityToSacrificeDisplayName = buffer.readUtf(); - } - - Ingredient itemToUse = Ingredient.EMPTY; - if (buffer.readBoolean()) { - itemToUse = Ingredient.fromNetwork(buffer); - } - - String command = buffer.readBoolean() ? buffer.readUtf() : null; - - return new RitualRecipe(recipeId, pentacleId, ritualType, ritualDummy, result, entityToSummon, entityNbt, - activationItem, ingredients, duration, spiritMaxAge, spiritJobType, entityToSacrifice, entityToSacrificeDisplayName, itemToUse, command); + public RitualRecipe fromNetwork(FriendlyByteBuf pBuffer) { + //noinspection deprecation + return pBuffer.readWithCodecTrusted(NbtOps.INSTANCE, CODEC); } @Override - public void toNetwork(FriendlyByteBuf buffer, RitualRecipe recipe) { - buffer.writeVarInt(recipe.ingredients.size()); - - for(var ingredient : recipe.ingredients) { - ingredient.toNetwork(buffer); - } - - buffer.writeItem(recipe.result); - - buffer.writeResourceLocation(recipe.ritualType); - - buffer.writeBoolean(recipe.entityToSummon != null); - if (recipe.entityToSummon != null) - buffer.writeRegistryId(ForgeRegistries.ENTITY_TYPES, recipe.entityToSummon); - - buffer.writeBoolean(recipe.entityNbt != null); - if (recipe.entityNbt != null) - buffer.writeNbt(recipe.entityNbt); - - buffer.writeResourceLocation(recipe.pentacleId); - buffer.writeVarInt(recipe.duration); - buffer.writeVarInt(recipe.spiritMaxAge); - buffer.writeBoolean(recipe.spiritJobType != null); - if (recipe.spiritJobType != null) { - buffer.writeResourceLocation(recipe.spiritJobType); - } - buffer.writeItem(recipe.ritualDummy); - recipe.activationItem.toNetwork(buffer); - buffer.writeBoolean(recipe.entityToSacrifice != null); - if (recipe.entityToSacrifice != null) { - - buffer.writeResourceLocation(recipe.entityToSacrifice.location()); - buffer.writeUtf(recipe.entityToSacrificeDisplayName); - } - buffer.writeBoolean(recipe.itemToUse != Ingredient.EMPTY); - if (recipe.itemToUse != Ingredient.EMPTY) - recipe.itemToUse.toNetwork(buffer); - - buffer.writeBoolean(recipe.command != null); - if (recipe.command != null) - buffer.writeUtf(recipe.command); + public void toNetwork(FriendlyByteBuf pBuffer, RitualRecipe pRecipe) { + //noinspection deprecation + pBuffer.writeWithCodec(NbtOps.INSTANCE, CODEC, pRecipe); } } } diff --git a/src/main/java/com/klikli_dev/occultism/crafting/recipe/SpiritFireRecipe.java b/src/main/java/com/klikli_dev/occultism/crafting/recipe/SpiritFireRecipe.java index f326a14b0..7c698da0a 100644 --- a/src/main/java/com/klikli_dev/occultism/crafting/recipe/SpiritFireRecipe.java +++ b/src/main/java/com/klikli_dev/occultism/crafting/recipe/SpiritFireRecipe.java @@ -25,22 +25,30 @@ import com.google.gson.JsonObject; import com.klikli_dev.occultism.registry.OccultismBlocks; import com.klikli_dev.occultism.registry.OccultismRecipes; +import com.mojang.serialization.Codec; +import com.mojang.serialization.DataResult; +import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.core.NonNullList; import net.minecraft.core.RegistryAccess; +import net.minecraft.nbt.NbtOps; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.resources.ResourceLocation; 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.RecipeType; +import net.minecraft.world.item.crafting.*; import net.minecraft.world.level.Level; public class SpiritFireRecipe extends ItemStackFakeInventoryRecipe { public static Serializer SERIALIZER = new Serializer(); - public SpiritFireRecipe(ResourceLocation id, Ingredient input, ItemStack output) { - super(id, input, output); + public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( + Ingredient.CODEC + .fieldOf("ingredient").forGetter((r) -> r.input), + ItemStack.ITEM_WITH_COUNT_CODEC.fieldOf("result").forGetter(r -> r.output) + ).apply(instance, SpiritFireRecipe::new)); + + public SpiritFireRecipe(Ingredient input, ItemStack output) { + super(input, output); } @Override @@ -76,11 +84,6 @@ public NonNullList getIngredients() { return NonNullList.of(Ingredient.EMPTY, this.input); } - @Override - public ResourceLocation getId() { - return this.id; - } - @Override public RecipeSerializer getSerializer() { return SERIALIZER; @@ -99,19 +102,20 @@ public RecipeType getType() { public static class Serializer implements RecipeSerializer { @Override - public SpiritFireRecipe fromJson(ResourceLocation recipeId, JsonObject json) { - return ItemStackFakeInventoryRecipe.SERIALIZER.read(SpiritFireRecipe::new, recipeId, json); + public Codec codec() { + return CODEC; } @Override - public SpiritFireRecipe fromNetwork(ResourceLocation recipeId, FriendlyByteBuf buffer) { - return ItemStackFakeInventoryRecipe.SERIALIZER.read(SpiritFireRecipe::new, recipeId, buffer); + public SpiritFireRecipe fromNetwork(FriendlyByteBuf pBuffer) { + //noinspection deprecation + return pBuffer.readWithCodecTrusted(NbtOps.INSTANCE, CODEC); } @Override - public void toNetwork(FriendlyByteBuf buffer, SpiritFireRecipe recipe) { - ItemStackFakeInventoryRecipe.SERIALIZER.write(buffer, recipe); + public void toNetwork(FriendlyByteBuf pBuffer, SpiritFireRecipe pRecipe) { + //noinspection deprecation + pBuffer.writeWithCodec(NbtOps.INSTANCE, CODEC, pRecipe); } - } } \ No newline at end of file diff --git a/src/main/java/com/klikli_dev/occultism/crafting/recipe/SpiritTradeRecipe.java b/src/main/java/com/klikli_dev/occultism/crafting/recipe/SpiritTradeRecipe.java index f213945a8..784bcb14c 100644 --- a/src/main/java/com/klikli_dev/occultism/crafting/recipe/SpiritTradeRecipe.java +++ b/src/main/java/com/klikli_dev/occultism/crafting/recipe/SpiritTradeRecipe.java @@ -22,12 +22,15 @@ package com.klikli_dev.occultism.crafting.recipe; -import com.google.gson.JsonObject; import com.klikli_dev.occultism.registry.OccultismRecipes; +import com.mojang.serialization.Codec; +import com.mojang.serialization.DataResult; +import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.core.NonNullList; import net.minecraft.core.RegistryAccess; +import net.minecraft.nbt.NbtOps; import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.resources.ResourceLocation; +import net.minecraft.util.ExtraCodecs; import net.minecraft.world.inventory.CraftingContainer; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.*; @@ -42,8 +45,8 @@ public class SpiritTradeRecipe extends ShapelessRecipe { public static Serializer SERIALIZER = new Serializer(); - public SpiritTradeRecipe(ResourceLocation id, String group, ItemStack result, NonNullList input) { - super(id, group, CraftingBookCategory.MISC, result, input); + public SpiritTradeRecipe(String group, ItemStack result, NonNullList input) { + super(group, CraftingBookCategory.MISC, result, input); } @Override @@ -120,25 +123,50 @@ public boolean isValid(List input) { public static class Serializer implements RecipeSerializer { - private static final ShapelessRecipe.Serializer serializer = new ShapelessRecipe.Serializer(); + //Codec copied from ShaplessRecipe, because xmap throws errors + private static final Codec CODEC = RecordCodecBuilder.create( + p_311734_ -> p_311734_.group( + ExtraCodecs.strictOptionalField(Codec.STRING, "group", "").forGetter(p_301127_ -> p_301127_.getGroup()), + CraftingBookCategory.CODEC.fieldOf("category").orElse(CraftingBookCategory.MISC).forGetter(p_301133_ -> p_301133_.category()), + ItemStack.ITEM_WITH_COUNT_CODEC.fieldOf("result").forGetter(p_301142_ -> p_301142_.getResultItem(RegistryAccess.EMPTY)), + Ingredient.CODEC_NONEMPTY + .listOf() + .fieldOf("ingredients") + .flatXmap( + p_301021_ -> { + Ingredient[] aingredient = p_301021_ + .toArray(Ingredient[]::new); //Forge skip the empty check and immediatly create the array. + if (aingredient.length == 0) { + return DataResult.error(() -> "No ingredients for shapeless recipe"); + } else { + return aingredient.length > ShapedRecipePattern.getMaxHeight() * ShapedRecipePattern.getMaxWidth() + ? DataResult.error(() -> "Too many ingredients for shapeless recipe. The maximum is: %s".formatted(ShapedRecipePattern.getMaxHeight() * ShapedRecipePattern.getMaxWidth())) + : DataResult.success(NonNullList.of(Ingredient.EMPTY, aingredient)); + } + }, + DataResult::success + ) + .forGetter(p_300975_ -> p_300975_.getIngredients()) + ) + .apply(p_311734_, (group, category, result, ingredients) -> new SpiritTradeRecipe(group, result, ingredients)) + ); + @Override - public SpiritTradeRecipe fromJson(ResourceLocation recipeId, JsonObject json) { - ShapelessRecipe recipe = serializer.fromJson(recipeId, json); - //we can pass null because shapeless recipe doesn't use the registryaccess. - return new SpiritTradeRecipe(recipe.getId(), recipe.getGroup(), recipe.getResultItem(RegistryAccess.EMPTY), recipe.getIngredients()); + public Codec codec() { + return CODEC; } @Override - public SpiritTradeRecipe fromNetwork(ResourceLocation recipeId, FriendlyByteBuf buffer) { - ShapelessRecipe recipe = serializer.fromNetwork(recipeId, buffer); - //we can pass null because shapeless recipe doesn't use the registryaccess. - return new SpiritTradeRecipe(recipe.getId(), recipe.getGroup(), recipe.getResultItem(RegistryAccess.EMPTY), recipe.getIngredients()); + public SpiritTradeRecipe fromNetwork(FriendlyByteBuf pBuffer) { + //noinspection deprecation + return pBuffer.readWithCodecTrusted(NbtOps.INSTANCE, CODEC); } @Override - public void toNetwork(FriendlyByteBuf buffer, SpiritTradeRecipe recipe) { - serializer.toNetwork(buffer, recipe); + public void toNetwork(FriendlyByteBuf pBuffer, SpiritTradeRecipe pRecipe) { + //noinspection deprecation + pBuffer.writeWithCodec(NbtOps.INSTANCE, CODEC, pRecipe); } } diff --git a/src/main/java/com/klikli_dev/occultism/datagen/CrushingRecipeProvider.java b/src/main/java/com/klikli_dev/occultism/datagen/CrushingRecipeProvider.java index 65dc2eb9b..c7173eae3 100644 --- a/src/main/java/com/klikli_dev/occultism/datagen/CrushingRecipeProvider.java +++ b/src/main/java/com/klikli_dev/occultism/datagen/CrushingRecipeProvider.java @@ -31,7 +31,6 @@ import net.minecraft.data.DataProvider; import net.minecraft.data.PackOutput; import net.minecraft.resources.ResourceLocation; - import java.util.ArrayList; import java.util.List; import java.util.Set; @@ -149,7 +148,7 @@ public JsonObject buildCrushingRecipe(String inputTag, String outputTag, int cou var recipe = new JsonObject(); recipe.addProperty("type", "occultism:crushing"); var conditions = this.buildCrushingCondition(inputTag, outputTag); - recipe.add("conditions", conditions); + recipe.add("neoforge:conditions", conditions); var ingredient = new JsonObject(); ingredient.addProperty("tag", inputTag); recipe.add("ingredient", ingredient); @@ -166,16 +165,16 @@ public JsonArray buildCrushingCondition(String inputTag, String outputTag) { var conditions = new JsonArray(); //multiple conditions on the root level array are treated as AND by forge var condition = new JsonObject(); - condition.addProperty("type", "forge:not"); + condition.addProperty("type", "neoforge:not"); var value = new JsonObject(); - value.addProperty("type", "forge:tag_empty"); + value.addProperty("type", "neoforge:tag_empty"); value.addProperty("tag", inputTag); condition.add("value", value); conditions.add(condition); condition = new JsonObject(); - condition.addProperty("type", "forge:not"); + condition.addProperty("type", "neoforge:not"); value = new JsonObject(); - value.addProperty("type", "forge:tag_empty"); + value.addProperty("type", "neoforge:tag_empty"); value.addProperty("tag", outputTag); condition.add("value", value); conditions.add(condition); diff --git a/src/main/java/com/klikli_dev/occultism/datagen/DataGenerators.java b/src/main/java/com/klikli_dev/occultism/datagen/DataGenerators.java index 7e4c417da..c9a055265 100644 --- a/src/main/java/com/klikli_dev/occultism/datagen/DataGenerators.java +++ b/src/main/java/com/klikli_dev/occultism/datagen/DataGenerators.java @@ -27,15 +27,16 @@ import com.klikli_dev.occultism.datagen.loot.OccultismBlockLoot; import com.klikli_dev.occultism.datagen.loot.OccultismEntityLoot; import com.klikli_dev.occultism.datagen.worldgen.OccultismRegistries; +import com.klikli_dev.theurgy.datagen.advancement.TheurgyAdvancementSubProvider; import net.minecraft.data.DataGenerator; import net.minecraft.data.DataProvider; import net.minecraft.data.loot.LootTableProvider; import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets; -import net.minecraftforge.common.data.DatapackBuiltinEntriesProvider; -import net.minecraftforge.data.event.GatherDataEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.common.Mod; - +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.Mod; +import net.neoforged.neoforge.common.data.AdvancementProvider; +import net.neoforged.neoforge.common.data.DatapackBuiltinEntriesProvider; +import net.neoforged.neoforge.data.event.GatherDataEvent; import java.util.List; import java.util.Set; @@ -51,7 +52,12 @@ public static void gatherData(GatherDataEvent event) { new LootTableProvider.SubProviderEntry(OccultismEntityLoot::new, LootContextParamSets.ENTITY) ))); generator.addProvider(event.includeServer(), new PentacleProvider(generator)); - generator.addProvider(event.includeServer(), new OccultismAdvancementProvider(generator)); + generator.addProvider(event.includeServer(), + new AdvancementProvider(generator.getPackOutput(), event.getLookupProvider(), event.getExistingFileHelper(), List.of( + new OccultismAdvancementSubProvider() + ))); + + generator.addProvider(event.includeServer(), new CrushingRecipeProvider(generator.getPackOutput())); generator.addProvider(event.includeServer(), new MinerRecipeProvider(generator.getPackOutput())); generator.addProvider(event.includeClient(), new ItemModelsGenerator(generator.getPackOutput(), event.getExistingFileHelper())); diff --git a/src/main/java/com/klikli_dev/occultism/datagen/ItemModelsGenerator.java b/src/main/java/com/klikli_dev/occultism/datagen/ItemModelsGenerator.java index b599a0c5b..170684806 100644 --- a/src/main/java/com/klikli_dev/occultism/datagen/ItemModelsGenerator.java +++ b/src/main/java/com/klikli_dev/occultism/datagen/ItemModelsGenerator.java @@ -23,12 +23,12 @@ package com.klikli_dev.occultism.datagen; import com.klikli_dev.occultism.Occultism; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.data.PackOutput; -import net.minecraftforge.client.model.generators.ItemModelBuilder; -import net.minecraftforge.client.model.generators.ItemModelProvider; -import net.minecraftforge.client.model.generators.ModelFile; -import net.minecraftforge.common.data.ExistingFileHelper; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.neoforge.client.model.generators.ItemModelBuilder; +import net.neoforged.neoforge.client.model.generators.ItemModelProvider; +import net.neoforged.neoforge.client.model.generators.ModelFile; +import net.neoforged.neoforge.common.data.ExistingFileHelper; import java.util.ArrayList; import java.util.List; @@ -40,8 +40,8 @@ public ItemModelsGenerator(PackOutput packOutput, ExistingFileHelper existingFil @Override protected void registerModels() { - ForgeRegistries.ITEMS.forEach(item -> { - var key = ForgeRegistries.ITEMS.getKey(item); + BuiltInRegistries.ITEM.forEach(item -> { + var key = BuiltInRegistries.ITEM.getKey(item); if (key.getPath().startsWith("ritual_dummy/")) { this.registerRitualDummy("item/" + key.getPath()); } diff --git a/src/main/java/com/klikli_dev/occultism/datagen/MinerRecipeProvider.java b/src/main/java/com/klikli_dev/occultism/datagen/MinerRecipeProvider.java index 9294347f0..164c112ec 100644 --- a/src/main/java/com/klikli_dev/occultism/datagen/MinerRecipeProvider.java +++ b/src/main/java/com/klikli_dev/occultism/datagen/MinerRecipeProvider.java @@ -31,7 +31,6 @@ import net.minecraft.data.DataProvider; import net.minecraft.data.PackOutput; import net.minecraft.resources.ResourceLocation; - import java.util.ArrayList; import java.util.List; import java.util.Set; diff --git a/src/main/java/com/klikli_dev/occultism/datagen/OccultismAdvancementProvider.java b/src/main/java/com/klikli_dev/occultism/datagen/OccultismAdvancementSubProvider.java similarity index 78% rename from src/main/java/com/klikli_dev/occultism/datagen/OccultismAdvancementProvider.java rename to src/main/java/com/klikli_dev/occultism/datagen/OccultismAdvancementSubProvider.java index 9b3522f8d..f9a39249b 100644 --- a/src/main/java/com/klikli_dev/occultism/datagen/OccultismAdvancementProvider.java +++ b/src/main/java/com/klikli_dev/occultism/datagen/OccultismAdvancementSubProvider.java @@ -25,43 +25,31 @@ import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.common.advancement.FamiliarTrigger; import com.klikli_dev.occultism.common.advancement.RitualTrigger; +import com.klikli_dev.occultism.registry.OccultismAdvancements; import com.klikli_dev.occultism.registry.OccultismItems; import com.klikli_dev.occultism.registry.OccultismRituals; import net.minecraft.advancements.Advancement; -import net.minecraft.advancements.CriteriaTriggers; -import net.minecraft.advancements.FrameType; -import net.minecraft.advancements.critereon.ContextAwarePredicate; -import net.minecraft.advancements.critereon.EntityPredicate; +import net.minecraft.advancements.AdvancementHolder; +import net.minecraft.advancements.AdvancementType; import net.minecraft.advancements.critereon.PlayerTrigger; -import net.minecraft.data.CachedOutput; -import net.minecraft.data.DataGenerator; -import net.minecraft.data.DataProvider; +import net.minecraft.core.HolderLookup; import net.minecraft.nbt.IntTag; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; +import net.neoforged.neoforge.common.data.AdvancementProvider; +import net.neoforged.neoforge.common.data.ExistingFileHelper; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; +import java.util.Optional; +import java.util.function.Consumer; -public class OccultismAdvancementProvider implements DataProvider { - private static final Logger LOGGER = LogManager.getLogger(); +public class OccultismAdvancementSubProvider implements AdvancementProvider.AdvancementGenerator { - private final DataGenerator generator; - private final Map advancements; - - public OccultismAdvancementProvider(DataGenerator generator) { - this.generator = generator; - this.advancements = new HashMap<>(); - } + protected Consumer saver; + protected HolderLookup.Provider registries; + protected ExistingFileHelper existingFileHelper; private static MutableComponent text(String name, String type) { return Component.translatable("advancements." + Occultism.MODID + "." + name + "." + type); @@ -87,167 +75,152 @@ public static MutableComponent familiarDescr(String name) { return familiarText(name, "description"); } - private static Path getPath(Path path, Advancement advancement) { - ResourceLocation id = advancement.getId(); - return path.resolve("data/" + id.getNamespace() + "/advancements/" + id.getPath() + ".json"); - } - @Override - public CompletableFuture run(CachedOutput pCache) { - - List> futures = new ArrayList<>(); - - Path folder = this.generator.getPackOutput().getOutputFolder(); - + public void generate(HolderLookup.Provider registries, Consumer saver, ExistingFileHelper existingFileHelper) { + this.registries = registries; + this.saver = saver; + this.existingFileHelper = existingFileHelper; this.start(); - - for (Advancement advancement : this.advancements.values()) { - Path path = getPath(folder, advancement); - futures.add(DataProvider.saveStable(pCache, advancement.deconstruct().serializeToJson(), path)); - } - - return CompletableFuture.allOf(futures.toArray(CompletableFuture[]::new)); } private void start() { - Advancement root = this.add(Advancement.Builder.advancement() + var root = this.add(Advancement.Builder.advancement() // .display(OccultismItems.JEI_DUMMY_NONE.get(), // title("root"), // descr("root"), -// new ResourceLocation("textures/gui/advancements/backgrounds/stone.png"), FrameType.TASK, true, +// new ResourceLocation("textures/gui/advancements/backgrounds/stone.png"), AdvancementType.TASK, true, // true, true) - .addCriterion("occultism_present", - new PlayerTrigger.TriggerInstance(CriteriaTriggers.TICK.getId(), ContextAwarePredicate.ANY)) + .addCriterion("occultism_present", PlayerTrigger.TriggerInstance.tick()) .build(new ResourceLocation(Occultism.MODID, "occultism/root"))); - Advancement familiarsRoot = this.add(Advancement.Builder.advancement() + var familiarsRoot = this.add(Advancement.Builder.advancement() .display(OccultismItems.JEI_DUMMY_NONE.get(), title("familiars"), descr("familiars"), - new ResourceLocation("textures/gui/advancements/backgrounds/stone.png"), FrameType.TASK, true, + new ResourceLocation("textures/gui/advancements/backgrounds/stone.png"), AdvancementType.TASK, true, true, false) .addCriterion("summon_familiar", - new RitualTrigger.Instance(new RitualTrigger.RitualPredicate(null, OccultismRituals.FAMILIAR_RITUAL.getId()))) + RitualTrigger.TriggerInstance.ritualFactory(OccultismRituals.FAMILIAR_RITUAL.getId())) .build(new ResourceLocation(Occultism.MODID, "occultism/familiar/root"))); //Familiar advancements this.add(Advancement.Builder.advancement().parent(familiarsRoot) - .display(this.icon(2), familiarTitle("deer"), familiarDescr("deer"), null, FrameType.TASK, true, true, false) + .display(this.icon(2), familiarTitle("deer"), familiarDescr("deer"), null, AdvancementType.TASK, true, true, false) .addCriterion("deer_poop", FamiliarTrigger.of(FamiliarTrigger.Type.DEER_POOP)) .build(new ResourceLocation(Occultism.MODID, "occultism/familiar/deer"))); this.add(Advancement.Builder.advancement().parent(familiarsRoot) - .display(this.icon(0), familiarTitle("cthulhu"), familiarDescr("cthulhu"), null, FrameType.TASK, true, true, false) + .display(this.icon(0), familiarTitle("cthulhu"), familiarDescr("cthulhu"), null, AdvancementType.TASK, true, true, false) .addCriterion("cthulhu_sad", FamiliarTrigger.of(FamiliarTrigger.Type.CTHULHU_SAD)) .build(new ResourceLocation(Occultism.MODID, "occultism/familiar/cthulhu"))); this.add(Advancement.Builder.advancement().parent(familiarsRoot) - .display(this.icon(1), familiarTitle("bat"), familiarDescr("bat"), null, FrameType.TASK, true, true, false) + .display(this.icon(1), familiarTitle("bat"), familiarDescr("bat"), null, AdvancementType.TASK, true, true, false) .addCriterion("bat_eat", FamiliarTrigger.of(FamiliarTrigger.Type.BAT_EAT)) .build(new ResourceLocation(Occultism.MODID, "occultism/familiar/bat"))); this.add(Advancement.Builder.advancement().parent(familiarsRoot) - .display(this.icon(3), familiarTitle("devil"), familiarDescr("devil"), null, FrameType.TASK, true, true, false) + .display(this.icon(3), familiarTitle("devil"), familiarDescr("devil"), null, AdvancementType.TASK, true, true, false) .addCriterion("devil_fire", FamiliarTrigger.of(FamiliarTrigger.Type.DEVIL_FIRE)) .build(new ResourceLocation(Occultism.MODID, "occultism/familiar/devil"))); this.add(Advancement.Builder.advancement().parent(familiarsRoot) - .display(this.icon(4), familiarTitle("greedy"), familiarDescr("greedy"), null, FrameType.TASK, true, true, false) + .display(this.icon(4), familiarTitle("greedy"), familiarDescr("greedy"), null, AdvancementType.TASK, true, true, false) .addCriterion("greedy_item", FamiliarTrigger.of(FamiliarTrigger.Type.GREEDY_ITEM)) .build(new ResourceLocation(Occultism.MODID, "occultism/familiar/greedy"))); this.add(Advancement.Builder.advancement().parent(familiarsRoot) - .display(this.icon(5), familiarTitle("rare"), familiarDescr("rare"), null, FrameType.TASK, true, true, false) + .display(this.icon(5), familiarTitle("rare"), familiarDescr("rare"), null, AdvancementType.TASK, true, true, false) .addCriterion("rare_variant", FamiliarTrigger.of(FamiliarTrigger.Type.RARE_VARIANT)) .build(new ResourceLocation(Occultism.MODID, "occultism/familiar/rare"))); this.add(Advancement.Builder.advancement().parent(familiarsRoot) - .display(Items.JUKEBOX, familiarTitle("party"), familiarDescr("party"), null, FrameType.TASK, true, true, false) + .display(Items.JUKEBOX, familiarTitle("party"), familiarDescr("party"), null, AdvancementType.TASK, true, true, false) .addCriterion("party", FamiliarTrigger.of(FamiliarTrigger.Type.PARTY)) .build(new ResourceLocation(Occultism.MODID, "occultism/familiar/party"))); this.add(Advancement.Builder.advancement().parent(familiarsRoot) .display(OccultismItems.FAMILIAR_RING.get(), familiarTitle("capture"), familiarDescr("capture"), null, - FrameType.TASK, true, true, false) + AdvancementType.TASK, true, true, false) .addCriterion("capture", FamiliarTrigger.of(FamiliarTrigger.Type.CAPTURE)) .build(new ResourceLocation(Occultism.MODID, "occultism/familiar/capture"))); this.add(Advancement.Builder.advancement().parent(familiarsRoot) - .display(Items.GOLD_NUGGET, familiarTitle("dragon_nugget"), familiarDescr("dragon_nugget"), null, FrameType.TASK, + .display(Items.GOLD_NUGGET, familiarTitle("dragon_nugget"), familiarDescr("dragon_nugget"), null, AdvancementType.TASK, true, true, false) .addCriterion("dragon_nugget", FamiliarTrigger.of(FamiliarTrigger.Type.DRAGON_NUGGET)) .build(new ResourceLocation(Occultism.MODID, "occultism/familiar/dragon_nugget"))); this.add(Advancement.Builder.advancement().parent(familiarsRoot) - .display(this.icon(6), familiarTitle("dragon_ride"), familiarDescr("dragon_ride"), null, FrameType.TASK, true, true, + .display(this.icon(6), familiarTitle("dragon_ride"), familiarDescr("dragon_ride"), null, AdvancementType.TASK, true, true, false) .addCriterion("dragon_ride", FamiliarTrigger.of(FamiliarTrigger.Type.DRAGON_RIDE)) .build(new ResourceLocation(Occultism.MODID, "occultism/familiar/dragon_ride"))); this.add(Advancement.Builder.advancement().parent(familiarsRoot) - .display(Items.STICK, familiarTitle("mans_best_friend"), familiarDescr("mans_best_friend"), null, FrameType.TASK, + .display(Items.STICK, familiarTitle("mans_best_friend"), familiarDescr("mans_best_friend"), null, AdvancementType.TASK, true, true, false) .addCriterion("dragon_pet", FamiliarTrigger.of(FamiliarTrigger.Type.DRAGON_PET)) .addCriterion("dragon_fetch", FamiliarTrigger.of(FamiliarTrigger.Type.DRAGON_FETCH)) .build(new ResourceLocation(Occultism.MODID, "occultism/familiar/mans_best_friend"))); this.add(Advancement.Builder.advancement().parent(root) - .display(this.icon(7), familiarTitle("blacksmith_upgrade"), familiarDescr("blacksmith_upgrade"), null, FrameType.TASK, + .display(this.icon(7), familiarTitle("blacksmith_upgrade"), familiarDescr("blacksmith_upgrade"), null, AdvancementType.TASK, true, true, false) .addCriterion("blacksmith_upgrade", FamiliarTrigger.of(FamiliarTrigger.Type.BLACKSMITH_UPGRADE)) .build(new ResourceLocation(Occultism.MODID, "occultism/familiar/blacksmith_upgrade"))); this.add(Advancement.Builder.advancement().parent(familiarsRoot) - .display(this.icon(8), familiarTitle("guardian_ultimate_sacrifice"), familiarDescr("guardian_ultimate_sacrifice"), null, FrameType.TASK, + .display(this.icon(8), familiarTitle("guardian_ultimate_sacrifice"), familiarDescr("guardian_ultimate_sacrifice"), null, AdvancementType.TASK, true, true, false) .addCriterion("guardian_ultimate_sacrifice", FamiliarTrigger.of(FamiliarTrigger.Type.GUARDIAN_ULTIMATE_SACRIFICE)) .build(new ResourceLocation(Occultism.MODID, "occultism/familiar/guardian_ultimate_sacrifice"))); this.add(Advancement.Builder.advancement().parent(familiarsRoot) - .display(this.icon(9), familiarTitle("headless_cthulhu_head"), familiarDescr("headless_cthulhu_head"), null, FrameType.TASK, + .display(this.icon(9), familiarTitle("headless_cthulhu_head"), familiarDescr("headless_cthulhu_head"), null, AdvancementType.TASK, true, true, false) .addCriterion("headless_cthulhu_head", FamiliarTrigger.of(FamiliarTrigger.Type.HEADLESS_CTHULHU_HEAD)) .build(new ResourceLocation(Occultism.MODID, "occultism/familiar/headless_cthulhu_head"))); this.add(Advancement.Builder.advancement().parent(familiarsRoot) - .display(Items.HAY_BLOCK, familiarTitle("headless_rebuilt"), familiarDescr("headless_rebuilt"), null, FrameType.TASK, + .display(Items.HAY_BLOCK, familiarTitle("headless_rebuilt"), familiarDescr("headless_rebuilt"), null, AdvancementType.TASK, true, true, false) .addCriterion("headless_rebuilt", FamiliarTrigger.of(FamiliarTrigger.Type.HEADLESS_REBUILT)) .build(new ResourceLocation(Occultism.MODID, "occultism/familiar/headless_rebuilt"))); this.add(Advancement.Builder.advancement().parent(familiarsRoot) - .display(this.icon(10), familiarTitle("chimera_ride"), familiarDescr("chimera_ride"), null, FrameType.TASK, + .display(this.icon(10), familiarTitle("chimera_ride"), familiarDescr("chimera_ride"), null, AdvancementType.TASK, true, true, false) .addCriterion("chimera_ride", FamiliarTrigger.of(FamiliarTrigger.Type.CHIMERA_RIDE)) .build(new ResourceLocation(Occultism.MODID, "occultism/familiar/chimera_ride"))); this.add(Advancement.Builder.advancement().parent(familiarsRoot) - .display(Items.GOLDEN_APPLE, familiarTitle("goat_detach"), familiarDescr("goat_detach"), null, FrameType.TASK, + .display(Items.GOLDEN_APPLE, familiarTitle("goat_detach"), familiarDescr("goat_detach"), null, AdvancementType.TASK, true, true, false) .addCriterion("goat_detach", FamiliarTrigger.of(FamiliarTrigger.Type.GOAT_DETACH)) .build(new ResourceLocation(Occultism.MODID, "occultism/familiar/goat_detach"))); - Advancement summonShub = this.add(Advancement.Builder.advancement().parent(familiarsRoot) - .display(this.icon(11), familiarTitle("shub_niggurath_summon"), familiarDescr("shub_niggurath_summon"), null, FrameType.TASK, + var summonShub = this.add(Advancement.Builder.advancement().parent(familiarsRoot) + .display(this.icon(11), familiarTitle("shub_niggurath_summon"), familiarDescr("shub_niggurath_summon"), null, AdvancementType.TASK, true, true, false) .addCriterion("shub_niggurath_summon", FamiliarTrigger.of(FamiliarTrigger.Type.SHUB_NIGGURATH_SUMMON)) .build(new ResourceLocation(Occultism.MODID, "occultism/familiar/shub_niggurath_summon"))); this.add(Advancement.Builder.advancement().parent(summonShub) - .display(Items.POPPY, familiarTitle("shub_cthulhu_friends"), familiarDescr("shub_cthulhu_friends"), null, FrameType.TASK, + .display(Items.POPPY, familiarTitle("shub_cthulhu_friends"), familiarDescr("shub_cthulhu_friends"), null, AdvancementType.TASK, true, true, false) .addCriterion("shub_cthulhu_friends", FamiliarTrigger.of(FamiliarTrigger.Type.SHUB_CTHULHU_FRIENDS)) .build(new ResourceLocation(Occultism.MODID, "occultism/familiar/shub_cthulhu_friends"))); this.add(Advancement.Builder.advancement().parent(summonShub) - .display(this.icon(12), familiarTitle("shub_niggurath_spawn"), familiarDescr("shub_niggurath_spawn"), null, FrameType.TASK, + .display(this.icon(12), familiarTitle("shub_niggurath_spawn"), familiarDescr("shub_niggurath_spawn"), null, AdvancementType.TASK, true, true, false) .addCriterion("shub_niggurath_spawn", FamiliarTrigger.of(FamiliarTrigger.Type.SHUB_NIGGURATH_SPAWN)) .build(new ResourceLocation(Occultism.MODID, "occultism/familiar/shub_niggurath_spawn"))); this.add(Advancement.Builder.advancement().parent(familiarsRoot) - .display(this.icon(13), familiarTitle("beholder_ray"), familiarDescr("beholder_ray"), null, FrameType.TASK, + .display(this.icon(13), familiarTitle("beholder_ray"), familiarDescr("beholder_ray"), null, AdvancementType.TASK, true, true, false) .addCriterion("beholder_ray", FamiliarTrigger.of(FamiliarTrigger.Type.BEHOLDER_RAY)) .build(new ResourceLocation(Occultism.MODID, "occultism/familiar/beholder_ray"))); this.add(Advancement.Builder.advancement().parent(familiarsRoot) - .display(Items.PUMPKIN_PIE, familiarTitle("beholder_eat"), familiarDescr("beholder_eat"), null, FrameType.TASK, + .display(Items.PUMPKIN_PIE, familiarTitle("beholder_eat"), familiarDescr("beholder_eat"), null, AdvancementType.TASK, true, true, false) .addCriterion("beholder_eat", FamiliarTrigger.of(FamiliarTrigger.Type.BEHOLDER_EAT)) .build(new ResourceLocation(Occultism.MODID, "occultism/familiar/beholder_eat"))); this.add(Advancement.Builder.advancement().parent(familiarsRoot) - .display(this.icon(14), familiarTitle("fairy_save"), familiarDescr("fairy_save"), null, FrameType.TASK, + .display(this.icon(14), familiarTitle("fairy_save"), familiarDescr("fairy_save"), null, AdvancementType.TASK, true, true, false) .addCriterion("fairy_save", FamiliarTrigger.of(FamiliarTrigger.Type.FAIRY_SAVE)) .build(new ResourceLocation(Occultism.MODID, "occultism/familiar/fairy_save"))); this.add(Advancement.Builder.advancement().parent(familiarsRoot) - .display(this.icon(15), familiarTitle("mummy_dodge"), familiarDescr("mummy_dodge"), null, FrameType.TASK, + .display(this.icon(15), familiarTitle("mummy_dodge"), familiarDescr("mummy_dodge"), null, AdvancementType.TASK, true, true, false) .addCriterion("mummy_dodge", FamiliarTrigger.of(FamiliarTrigger.Type.MUMMY_DODGE)) .build(new ResourceLocation(Occultism.MODID, "occultism/familiar/mummy_dodge"))); this.add(Advancement.Builder.advancement().parent(familiarsRoot) - .display(this.icon(16), familiarTitle("beaver_woodchop"), familiarDescr("beaver_woodchop"), null, FrameType.TASK, + .display(this.icon(16), familiarTitle("beaver_woodchop"), familiarDescr("beaver_woodchop"), null, AdvancementType.TASK, true, true, false) .addCriterion("beaver_woodchop", FamiliarTrigger.of(FamiliarTrigger.Type.BEAVER_WOODCHOP)) .build(new ResourceLocation(Occultism.MODID, "occultism/familiar/beaver_woodchop"))); @@ -309,31 +282,29 @@ private void start() { this.addRitualHidden(root, "summon_wild_hunt"); } - private Advancement addRitualHidden(Advancement parent, String id) { + private AdvancementHolder addRitualHidden(AdvancementHolder parent, String id) { return this.add(Advancement.Builder.advancement().parent(parent) - .display(OccultismItems.JEI_DUMMY_NONE.get(), title(id), descr(id), null, FrameType.TASK, + .display(OccultismItems.JEI_DUMMY_NONE.get(), title(id), descr(id), null, AdvancementType.TASK, false, false, true) - .addCriterion(id, new RitualTrigger.Instance(new RitualTrigger.RitualPredicate( - new ResourceLocation("occultism", "ritual/" + id), null))) + .addCriterion(id, + OccultismAdvancements.RITUAL.get().createCriterion(new RitualTrigger.TriggerInstance( + Optional.empty(), + Optional.of(new ResourceLocation("occultism", "ritual/" + id)), + Optional.empty() + )) + ) .build(new ResourceLocation(Occultism.MODID, "occultism/" + id))); } + private AdvancementHolder add(AdvancementHolder advancement) { + this.saver.accept(advancement); + return advancement; + } + private ItemStack icon(int data) { ItemStack icon = OccultismItems.ADVANCEMENT_ICON.get().getDefaultInstance(); icon.addTagElement("CustomModelData", IntTag.valueOf(data)); return icon; } - private Advancement add(Advancement advancement) { - if (this.advancements.containsKey(advancement.getId())) - throw new IllegalStateException("Duplicate advancement " + advancement.getId()); - this.advancements.put(advancement.getId(), advancement); - return advancement; - } - - @Override - public String getName() { - return "Advancements: " + Occultism.MODID; - } - } diff --git a/src/main/java/com/klikli_dev/occultism/datagen/OccultismBookProvider.java b/src/main/java/com/klikli_dev/occultism/datagen/OccultismBookProvider.java index 6079521a5..b3e3e953f 100644 --- a/src/main/java/com/klikli_dev/occultism/datagen/OccultismBookProvider.java +++ b/src/main/java/com/klikli_dev/occultism/datagen/OccultismBookProvider.java @@ -25,8 +25,6 @@ import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.level.block.Blocks; -import net.minecraftforge.common.data.LanguageProvider; -import net.minecraftforge.registries.ForgeRegistries; public class OccultismBookProvider extends BookProvider { diff --git a/src/main/java/com/klikli_dev/occultism/datagen/PentacleProvider.java b/src/main/java/com/klikli_dev/occultism/datagen/PentacleProvider.java index 63e98d237..b1ffe4ee1 100644 --- a/src/main/java/com/klikli_dev/occultism/datagen/PentacleProvider.java +++ b/src/main/java/com/klikli_dev/occultism/datagen/PentacleProvider.java @@ -29,6 +29,7 @@ import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.registry.OccultismBlocks; import com.klikli_dev.occultism.registry.OccultismTags; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.data.CachedOutput; import net.minecraft.data.DataGenerator; import net.minecraft.data.DataProvider; @@ -36,10 +37,8 @@ import net.minecraft.tags.TagKey; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; -import net.minecraftforge.registries.ForgeRegistries; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; - import java.nio.file.Path; import java.util.ArrayList; import java.util.HashMap; @@ -337,22 +336,22 @@ private MappingBuilder block(char c, Supplier b) { JsonObject json = new JsonObject(); json.addProperty("type", "modonomicon:block"); - json.addProperty("block", ForgeRegistries.BLOCKS.getKey(b.get()).toString()); + json.addProperty("block", BuiltInRegistries.BLOCK.getKey(b.get()).toString()); return this.element(c, json); } private MappingBuilder blockDisplay(char c, Supplier b, Supplier display) { JsonObject json = new JsonObject(); json.addProperty("type", "modonomicon:block"); - json.addProperty("block", ForgeRegistries.BLOCKS.getKey(b.get()).toString()); - json.addProperty("display", ForgeRegistries.BLOCKS.getKey(display.get()).toString()); + json.addProperty("block", BuiltInRegistries.BLOCK.getKey(b.get()).toString()); + json.addProperty("display", BuiltInRegistries.BLOCK.getKey(display.get()).toString()); return this.element(c, json); } private MappingBuilder display(char c, Supplier display) { JsonObject json = new JsonObject(); json.addProperty("type", "modonomicon:display"); - json.addProperty("display", ForgeRegistries.BLOCKS.getKey(display.get()).toString()); + json.addProperty("display", BuiltInRegistries.BLOCK.getKey(display.get()).toString()); return this.element(c, json); } diff --git a/src/main/java/com/klikli_dev/occultism/datagen/StandardBlockStateProvider.java b/src/main/java/com/klikli_dev/occultism/datagen/StandardBlockStateProvider.java index 25db59a7d..795770285 100644 --- a/src/main/java/com/klikli_dev/occultism/datagen/StandardBlockStateProvider.java +++ b/src/main/java/com/klikli_dev/occultism/datagen/StandardBlockStateProvider.java @@ -30,11 +30,11 @@ import net.minecraft.data.PackOutput; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.properties.BlockStateProperties; -import net.minecraftforge.client.model.generators.BlockStateProvider; -import net.minecraftforge.client.model.generators.ConfiguredModel; -import net.minecraftforge.client.model.generators.ModelFile; -import net.minecraftforge.common.data.ExistingFileHelper; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.neoforge.client.model.generators.BlockStateProvider; +import net.neoforged.neoforge.client.model.generators.ConfiguredModel; +import net.neoforged.neoforge.client.model.generators.ModelFile; +import net.neoforged.neoforge.common.data.ExistingFileHelper; +import net.neoforged.neoforge.registries.DeferredHolder; /** * Based on https://github.com/McJty/YouTubeModding14 @@ -50,7 +50,7 @@ public StandardBlockStateProvider(PackOutput gen, protected void registerStatesAndModels() { //Generate blockstates for the glyphs OccultismBlocks.BLOCKS.getEntries().stream() - .map(RegistryObject::get) + .map(DeferredHolder::get) .filter(block -> block instanceof ChalkGlyphBlock) .forEach(this::generateGlyphBlockState); this.simpleBlock(OccultismBlocks.STORAGE_CONTROLLER.get(), diff --git a/src/main/java/com/klikli_dev/occultism/datagen/lang/ENUSProvider.java b/src/main/java/com/klikli_dev/occultism/datagen/lang/ENUSProvider.java index b146270fd..fa2e5e051 100644 --- a/src/main/java/com/klikli_dev/occultism/datagen/lang/ENUSProvider.java +++ b/src/main/java/com/klikli_dev/occultism/datagen/lang/ENUSProvider.java @@ -25,11 +25,9 @@ import com.klikli_dev.modonomicon.api.ModonomiconAPI; import com.klikli_dev.modonomicon.api.datagen.AbstractModonomiconLanguageProvider; import com.klikli_dev.modonomicon.api.datagen.BookContextHelper; -import com.klikli_dev.modonomicon.api.datagen.ModonomiconLanguageProvider; import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.TranslationKeys; -import com.klikli_dev.occultism.datagen.OccultismAdvancementProvider; -import com.klikli_dev.occultism.integration.modonomicon.OccultismModonomiconConstants; +import com.klikli_dev.occultism.datagen.OccultismAdvancementSubProvider; import com.klikli_dev.occultism.integration.modonomicon.OccultismModonomiconConstants.I18n; import com.klikli_dev.occultism.registry.OccultismBlocks; import com.klikli_dev.occultism.registry.OccultismEntities; @@ -39,7 +37,6 @@ import net.minecraft.data.PackOutput; import net.minecraft.network.chat.contents.TranslatableContents; import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.common.data.LanguageProvider; public class ENUSProvider extends AbstractModonomiconLanguageProvider { @@ -2970,19 +2967,19 @@ private void addDialogs() { } private void addModonomiconIntegration() { - this.add(OccultismModonomiconConstants.I18n.RITUAL_RECIPE_ITEM_USE, "Item to use:"); - this.add(OccultismModonomiconConstants.I18n.RITUAL_RECIPE_SUMMON, "Summon: %s"); - this.add(OccultismModonomiconConstants.I18n.RITUAL_RECIPE_JOB, "Job: %s"); - this.add(OccultismModonomiconConstants.I18n.RITUAL_RECIPE_SACRIFICE, "Sacrifice: %s"); + this.add(I18n.RITUAL_RECIPE_ITEM_USE, "Item to use:"); + this.add(I18n.RITUAL_RECIPE_SUMMON, "Summon: %s"); + this.add(I18n.RITUAL_RECIPE_JOB, "Job: %s"); + this.add(I18n.RITUAL_RECIPE_SACRIFICE, "Sacrifice: %s"); this.add(I18n.RITUAL_RECIPE_GO_TO_PENTACLE, "Open Pentacle Page: %s"); } private void advancementTitle(String name, String s) { - this.add(((TranslatableContents) OccultismAdvancementProvider.title(name).getContents()).getKey(), s); + this.add(((TranslatableContents) OccultismAdvancementSubProvider.title(name).getContents()).getKey(), s); } private void advancementDescr(String name, String s) { - this.add(((TranslatableContents) OccultismAdvancementProvider.descr(name).getContents()).getKey(), s); + this.add(((TranslatableContents) OccultismAdvancementSubProvider.descr(name).getContents()).getKey(), s); } @Override diff --git a/src/main/java/com/klikli_dev/occultism/datagen/loot/OccultismBlockLoot.java b/src/main/java/com/klikli_dev/occultism/datagen/loot/OccultismBlockLoot.java index f127bac94..57db00b09 100644 --- a/src/main/java/com/klikli_dev/occultism/datagen/loot/OccultismBlockLoot.java +++ b/src/main/java/com/klikli_dev/occultism/datagen/loot/OccultismBlockLoot.java @@ -6,6 +6,7 @@ import com.klikli_dev.occultism.registry.OccultismBlocks; import com.klikli_dev.occultism.registry.OccultismItems; import net.minecraft.advancements.critereon.StatePropertiesPredicate; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.data.loot.BlockLootSubProvider; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.flag.FeatureFlags; @@ -24,8 +25,7 @@ import net.minecraft.world.level.storage.loot.predicates.LootItemCondition; import net.minecraft.world.level.storage.loot.providers.number.ConstantValue; import net.minecraft.world.level.storage.loot.providers.number.UniformGenerator; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.neoforge.registries.DeferredHolder; import java.util.Set; import java.util.function.BiConsumer; @@ -49,10 +49,10 @@ public void generate(BiConsumer consumer) { @Override protected void generate() { OccultismBlocks.BLOCKS.getEntries().stream() - .map(RegistryObject::get) + .map(DeferredHolder::get) .forEach(block -> { OccultismBlocks.BlockDataGenSettings settings = OccultismBlocks.BLOCK_DATA_GEN_SETTINGS - .get(ForgeRegistries.BLOCKS.getKey(block)); + .get(BuiltInRegistries.BLOCK.getKey(block)); if (settings.lootTableType == OccultismBlocks.LootTableType.EMPTY) this.registerDropNothingLootTable(block); else if (settings.lootTableType == OccultismBlocks.LootTableType.REPLANTABLE_CROP) { @@ -88,7 +88,7 @@ protected void registerOtherworldBlockTable(Block block) { this.add(block, this.createOtherworldBlockTable(block)); else Occultism.LOGGER.warn("Tried to register otherworld block loot table for non-otherworld block {}", - ForgeRegistries.BLOCKS.getKey(block)); + BuiltInRegistries.BLOCK.getKey(block)); } protected LootTable.Builder createOtherworldBlockTable(Block block) { diff --git a/src/main/java/com/klikli_dev/occultism/datagen/worldgen/BiomeModifiers.java b/src/main/java/com/klikli_dev/occultism/datagen/worldgen/BiomeModifiers.java index c2d35e517..012c390b9 100644 --- a/src/main/java/com/klikli_dev/occultism/datagen/worldgen/BiomeModifiers.java +++ b/src/main/java/com/klikli_dev/occultism/datagen/worldgen/BiomeModifiers.java @@ -8,54 +8,53 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.BiomeTags; import net.minecraft.world.level.levelgen.GenerationStep; -import net.minecraftforge.common.world.BiomeModifier; -import net.minecraftforge.common.world.ForgeBiomeModifiers; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.neoforge.common.world.BiomeModifier; +import net.neoforged.neoforge.registries.NeoForgeRegistries; public class BiomeModifiers { - public static final ResourceKey ADD_ORE_SILVER = ResourceKey.create(ForgeRegistries.Keys.BIOME_MODIFIERS, new ResourceLocation(Occultism.MODID, "add_ore_silver")); + public static final ResourceKey ADD_ORE_SILVER = ResourceKey.create(NeoForgeRegistries.Keys.BIOME_MODIFIERS, new ResourceLocation(Occultism.MODID, "add_ore_silver")); - public static final ResourceKey ADD_ORE_SILVER_DEEPSLATE = ResourceKey.create(ForgeRegistries.Keys.BIOME_MODIFIERS, new ResourceLocation(Occultism.MODID, "add_ore_silver_deepslate")); + public static final ResourceKey ADD_ORE_SILVER_DEEPSLATE = ResourceKey.create(NeoForgeRegistries.Keys.BIOME_MODIFIERS, new ResourceLocation(Occultism.MODID, "add_ore_silver_deepslate")); - public static final ResourceKey ADD_ORE_IESNIUM = ResourceKey.create(ForgeRegistries.Keys.BIOME_MODIFIERS, new ResourceLocation(Occultism.MODID, "add_ore_iesnium")); + public static final ResourceKey ADD_ORE_IESNIUM = ResourceKey.create(NeoForgeRegistries.Keys.BIOME_MODIFIERS, new ResourceLocation(Occultism.MODID, "add_ore_iesnium")); - public static final ResourceKey ADD_TREE_OTHERWORLD = ResourceKey.create(ForgeRegistries.Keys.BIOME_MODIFIERS, new ResourceLocation(Occultism.MODID, "add_tree_otherworld")); + public static final ResourceKey ADD_TREE_OTHERWORLD = ResourceKey.create(NeoForgeRegistries.Keys.BIOME_MODIFIERS, new ResourceLocation(Occultism.MODID, "add_tree_otherworld")); - public static final ResourceKey ADD_TREE_OTHERWORLD_NATURAL = ResourceKey.create(ForgeRegistries.Keys.BIOME_MODIFIERS, new ResourceLocation(Occultism.MODID, "add_tree_otherworld_natural")); + public static final ResourceKey ADD_TREE_OTHERWORLD_NATURAL = ResourceKey.create(NeoForgeRegistries.Keys.BIOME_MODIFIERS, new ResourceLocation(Occultism.MODID, "add_tree_otherworld_natural")); - public static final ResourceKey ADD_GROVE_UNDERGROUND = ResourceKey.create(ForgeRegistries.Keys.BIOME_MODIFIERS, new ResourceLocation(Occultism.MODID, "add_grove_underground")); + public static final ResourceKey ADD_GROVE_UNDERGROUND = ResourceKey.create(NeoForgeRegistries.Keys.BIOME_MODIFIERS, new ResourceLocation(Occultism.MODID, "add_grove_underground")); public static void bootstrap(BootstapContext context) { var placedFeatures = context.lookup(Registries.PLACED_FEATURE); var biomes = context.lookup(Registries.BIOME); - context.register(ADD_ORE_SILVER, new ForgeBiomeModifiers.AddFeaturesBiomeModifier( + context.register(ADD_ORE_SILVER, new net.neoforged.neoforge.common.world.BiomeModifiers.AddFeaturesBiomeModifier( biomes.getOrThrow(BiomeTags.IS_OVERWORLD), HolderSet.direct(placedFeatures.getOrThrow(PlacedFeatures.ORE_SILVER)), GenerationStep.Decoration.UNDERGROUND_ORES)); - context.register(ADD_ORE_SILVER_DEEPSLATE, new ForgeBiomeModifiers.AddFeaturesBiomeModifier( + context.register(ADD_ORE_SILVER_DEEPSLATE, new net.neoforged.neoforge.common.world.BiomeModifiers.AddFeaturesBiomeModifier( biomes.getOrThrow(BiomeTags.IS_OVERWORLD), HolderSet.direct(placedFeatures.getOrThrow(PlacedFeatures.ORE_SILVER_DEEPSLATE)), GenerationStep.Decoration.UNDERGROUND_ORES)); - context.register(ADD_ORE_IESNIUM, new ForgeBiomeModifiers.AddFeaturesBiomeModifier( + context.register(ADD_ORE_IESNIUM, new net.neoforged.neoforge.common.world.BiomeModifiers.AddFeaturesBiomeModifier( biomes.getOrThrow(BiomeTags.IS_NETHER), HolderSet.direct(placedFeatures.getOrThrow(PlacedFeatures.ORE_IESNIUM)), GenerationStep.Decoration.UNDERGROUND_ORES)); - context.register(ADD_TREE_OTHERWORLD_NATURAL, new ForgeBiomeModifiers.AddFeaturesBiomeModifier( + context.register(ADD_TREE_OTHERWORLD_NATURAL, new net.neoforged.neoforge.common.world.BiomeModifiers.AddFeaturesBiomeModifier( biomes.getOrThrow(BiomeTags.STRONGHOLD_BIASED_TO), HolderSet.direct(placedFeatures.getOrThrow(PlacedFeatures.TREE_OTHERWORLD_NATURAL)), GenerationStep.Decoration.VEGETAL_DECORATION)); - context.register(ADD_TREE_OTHERWORLD, new ForgeBiomeModifiers.AddFeaturesBiomeModifier( + context.register(ADD_TREE_OTHERWORLD, new net.neoforged.neoforge.common.world.BiomeModifiers.AddFeaturesBiomeModifier( biomes.getOrThrow(BiomeTags.STRONGHOLD_BIASED_TO), HolderSet.direct(placedFeatures.getOrThrow(PlacedFeatures.TREE_OTHERWORLD)), GenerationStep.Decoration.VEGETAL_DECORATION)); - context.register(ADD_GROVE_UNDERGROUND, new ForgeBiomeModifiers.AddFeaturesBiomeModifier( + context.register(ADD_GROVE_UNDERGROUND, new net.neoforged.neoforge.common.world.BiomeModifiers.AddFeaturesBiomeModifier( biomes.getOrThrow(BiomeTags.STRONGHOLD_BIASED_TO), HolderSet.direct(placedFeatures.getOrThrow(PlacedFeatures.GROVE_UNDERGROUND)), GenerationStep.Decoration.UNDERGROUND_STRUCTURES)); diff --git a/src/main/java/com/klikli_dev/occultism/datagen/worldgen/OccultismRegistries.java b/src/main/java/com/klikli_dev/occultism/datagen/worldgen/OccultismRegistries.java index 78a0bd809..be95aa5f3 100644 --- a/src/main/java/com/klikli_dev/occultism/datagen/worldgen/OccultismRegistries.java +++ b/src/main/java/com/klikli_dev/occultism/datagen/worldgen/OccultismRegistries.java @@ -4,14 +4,14 @@ import net.minecraft.core.registries.Registries; import net.minecraft.data.worldgen.BootstapContext; import net.minecraft.world.level.biome.Biome; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.neoforge.registries.NeoForgeRegistries; public class OccultismRegistries { public static final RegistrySetBuilder BUILDER = (new RegistrySetBuilder()) .add(Registries.CONFIGURED_FEATURE, ConfiguredFeatures::bootstrap) .add(Registries.PLACED_FEATURE, PlacedFeatures::bootstrap) .add(Registries.BIOME, OccultismRegistries::bootstrapBiomes) - .add(ForgeRegistries.Keys.BIOME_MODIFIERS, BiomeModifiers::bootstrap); + .add(NeoForgeRegistries.Keys.BIOME_MODIFIERS, BiomeModifiers::bootstrap); public static void bootstrapBiomes(BootstapContext context) { //doesn't need to do anything, just gives us acccess to a biome registry with empty tag lookup in our other boopstrap contexts diff --git a/src/main/java/com/klikli_dev/occultism/datagen/worldgen/PlacedFeatures.java b/src/main/java/com/klikli_dev/occultism/datagen/worldgen/PlacedFeatures.java index 1da97644c..25bb47759 100644 --- a/src/main/java/com/klikli_dev/occultism/datagen/worldgen/PlacedFeatures.java +++ b/src/main/java/com/klikli_dev/occultism/datagen/worldgen/PlacedFeatures.java @@ -9,7 +9,6 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.levelgen.VerticalAnchor; import net.minecraft.world.level.levelgen.placement.*; - import java.util.List; public class PlacedFeatures { diff --git a/src/main/java/com/klikli_dev/occultism/exceptions/CapabilityMissingException.java b/src/main/java/com/klikli_dev/occultism/exceptions/CapabilityMissingException.java deleted file mode 100644 index ca8605322..000000000 --- a/src/main/java/com/klikli_dev/occultism/exceptions/CapabilityMissingException.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * MIT License - * - * Copyright 2020 klikli-dev - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and - * associated documentation files (the "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT - * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.klikli_dev.occultism.exceptions; - -public class CapabilityMissingException extends RuntimeException { - public CapabilityMissingException(String capability) { - super(capability); - } -} diff --git a/src/main/java/com/klikli_dev/occultism/exceptions/ItemHandlerMissingException.java b/src/main/java/com/klikli_dev/occultism/exceptions/ItemHandlerMissingException.java deleted file mode 100644 index 56521f894..000000000 --- a/src/main/java/com/klikli_dev/occultism/exceptions/ItemHandlerMissingException.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * MIT License - * - * Copyright 2020 klikli-dev - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and - * associated documentation files (the "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT - * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.klikli_dev.occultism.exceptions; - -public class ItemHandlerMissingException extends CapabilityMissingException { - - public ItemHandlerMissingException() { - super("ItemHandler"); - } - -} diff --git a/src/main/java/com/klikli_dev/occultism/handlers/CapabilityEventHandler.java b/src/main/java/com/klikli_dev/occultism/handlers/CapabilityEventHandler.java index 0597fa7e7..e0025c1b2 100644 --- a/src/main/java/com/klikli_dev/occultism/handlers/CapabilityEventHandler.java +++ b/src/main/java/com/klikli_dev/occultism/handlers/CapabilityEventHandler.java @@ -23,29 +23,23 @@ package com.klikli_dev.occultism.handlers; import com.klikli_dev.occultism.Occultism; -import com.klikli_dev.occultism.common.capability.DoubleJumpCapability; -import com.klikli_dev.occultism.common.capability.FamiliarSettingsCapability; -import com.klikli_dev.occultism.network.MessageSetJumps; -import com.klikli_dev.occultism.network.OccultismPackets; -import com.klikli_dev.occultism.registry.OccultismCapabilities; +import com.klikli_dev.occultism.network.Networking; +import com.klikli_dev.occultism.network.messages.MessageSetJumps; +import com.klikli_dev.occultism.registry.OccultismDataStorage; import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.entity.Entity; -import net.minecraft.world.entity.player.Player; -import net.minecraftforge.event.AttachCapabilitiesEvent; -import net.minecraftforge.event.TickEvent; -import net.minecraftforge.event.entity.EntityJoinLevelEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.common.Mod; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.Mod; +import net.neoforged.neoforge.event.TickEvent; +import net.neoforged.neoforge.event.entity.EntityJoinLevelEvent; @Mod.EventBusSubscriber(modid = Occultism.MODID, bus = Mod.EventBusSubscriber.Bus.FORGE) public class CapabilityEventHandler { - //region Static Methods @SubscribeEvent public static void onPlayerTick(final TickEvent.PlayerTickEvent evt) { if (evt.phase == TickEvent.Phase.END) { //Reset the double jump capability if (evt.player.onGround()) { - evt.player.getCapability(OccultismCapabilities.DOUBLE_JUMP).ifPresent(cap -> cap.setJumps(0)); + evt.player.setData(OccultismDataStorage.DOUBLE_JUMP, 0); } } } @@ -53,23 +47,10 @@ public static void onPlayerTick(final TickEvent.PlayerTickEvent evt) { @SubscribeEvent public static void onEntityJoinWorld(final EntityJoinLevelEvent evt) { if (evt.getEntity() instanceof ServerPlayer player) { - int jumps = player.getCapability(OccultismCapabilities.DOUBLE_JUMP).map(DoubleJumpCapability::getJumps).orElse(0); + int jumps = player.getData(OccultismDataStorage.DOUBLE_JUMP); if (jumps > 0) { - OccultismPackets.sendTo(player, new MessageSetJumps(jumps)); + Networking.sendTo(player, new MessageSetJumps(jumps)); } } } - - @SubscribeEvent - public static void onEntityConstructing(final AttachCapabilitiesEvent evt) { - if (evt.getObject() instanceof Player) { - if (!evt.getObject().getCapability(OccultismCapabilities.DOUBLE_JUMP).isPresent()) { - evt.addCapability(OccultismCapabilities.DOUBLE_JUMP_ID, new DoubleJumpCapability.Dispatcher()); - } - if (!evt.getObject().getCapability(OccultismCapabilities.FAMILIAR_SETTINGS).isPresent()) { - evt.addCapability(OccultismCapabilities.FAMILIAR_SETTINGS_ID, new FamiliarSettingsCapability.Dispatcher()); - } - } - } - //endregion Static Methods } diff --git a/src/main/java/com/klikli_dev/occultism/handlers/ClientPlayerEventHandler.java b/src/main/java/com/klikli_dev/occultism/handlers/ClientPlayerEventHandler.java index de8deee34..da15e8ed1 100644 --- a/src/main/java/com/klikli_dev/occultism/handlers/ClientPlayerEventHandler.java +++ b/src/main/java/com/klikli_dev/occultism/handlers/ClientPlayerEventHandler.java @@ -25,7 +25,11 @@ import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.client.gui.storage.SatchelScreen; import com.klikli_dev.occultism.client.gui.storage.StorageRemoteGui; -import com.klikli_dev.occultism.network.*; +import com.klikli_dev.occultism.network.Networking; +import com.klikli_dev.occultism.network.messages.MessageDoubleJump; +import com.klikli_dev.occultism.network.messages.MessageOpenSatchel; +import com.klikli_dev.occultism.network.messages.MessageOpenStorageRemote; +import com.klikli_dev.occultism.network.messages.MessageToggleFamiliarSettings; import com.klikli_dev.occultism.util.CuriosUtil; import com.klikli_dev.occultism.util.MovementUtil; import net.minecraft.client.KeyMapping; @@ -33,10 +37,10 @@ import net.minecraft.client.resources.sounds.SimpleSoundInstance; import net.minecraft.sounds.SoundEvents; import net.minecraft.world.entity.EntityType; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.client.event.InputEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.common.Mod; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.Mod; +import net.neoforged.neoforge.client.event.InputEvent; import java.util.HashMap; import java.util.Map; @@ -56,13 +60,13 @@ public static void onKeyInput(final InputEvent.Key event) { checkFamiliarSettingsKeys(event); if (event.getAction() == GLFW_PRESS && minecraft.options.keyJump.isDown()) { if (minecraft.player != null && MovementUtil.doubleJump(minecraft.player)) { - OccultismPackets.sendToServer(new MessageDoubleJump()); + Networking.sendToServer(new MessageDoubleJump()); } } } @SubscribeEvent - public static void onMouseInput(final InputEvent.MouseButton event) { + public static void onMouseInput(final InputEvent.MouseButton.Key event) { //handle mouse button bindings for storage keys checkBackpackKey(event); checkStorageRemoteKey(event); @@ -80,7 +84,7 @@ else if (minecraft.player != null & minecraft.screen == null && ClientSetupEventHandler.KEY_BACKPACK.consumeClick()) { if (!CuriosUtil.getBackpack(minecraft.player).isEmpty() || CuriosUtil.getFirstBackpackSlot(minecraft.player) > 0) { - OccultismPackets.sendToServer(new MessageOpenSatchel()); + Networking.sendToServer(new MessageOpenSatchel()); minecraft.getSoundManager().play(SimpleSoundInstance.forUI(SoundEvents.ARMOR_EQUIP_LEATHER, 0.75F, 1.0F)); } } @@ -98,7 +102,7 @@ else if (minecraft.player != null & minecraft.screen == null && if (!CuriosUtil.getStorageRemoteCurio(minecraft.player).isEmpty() || CuriosUtil.getFirstStorageRemoteSlot(minecraft.player) > 0) { - OccultismPackets.sendToServer(new MessageOpenStorageRemote()); + Networking.sendToServer(new MessageOpenStorageRemote()); minecraft.getSoundManager().play(SimpleSoundInstance.forUI(SoundEvents.ARMOR_EQUIP_DIAMOND, 0.75F, 1.0F)); } } @@ -117,7 +121,7 @@ public static void checkFamiliarSettingsKeys(InputEvent event) { familiarsPressed.put(entry.getKey(), isPressed); } if (familiarKeyPressed) { - OccultismPackets.sendToServer(new MessageToggleFamiliarSettings(familiarsPressed)); + Networking.sendToServer(new MessageToggleFamiliarSettings(familiarsPressed)); } } } diff --git a/src/main/java/com/klikli_dev/occultism/handlers/ClientRegistryEventHandler.java b/src/main/java/com/klikli_dev/occultism/handlers/ClientRegistryEventHandler.java index c15bb98f6..814015f80 100644 --- a/src/main/java/com/klikli_dev/occultism/handlers/ClientRegistryEventHandler.java +++ b/src/main/java/com/klikli_dev/occultism/handlers/ClientRegistryEventHandler.java @@ -27,10 +27,10 @@ import com.klikli_dev.occultism.client.particle.SnowflakeParticle; import com.klikli_dev.occultism.registry.OccultismParticles; import net.minecraft.client.particle.FlameParticle; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.client.event.RegisterParticleProvidersEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.common.Mod; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.Mod; +import net.neoforged.neoforge.client.event.RegisterParticleProvidersEvent; @Mod.EventBusSubscriber(modid = Occultism.MODID, bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT) public class ClientRegistryEventHandler { diff --git a/src/main/java/com/klikli_dev/occultism/handlers/ClientSetupEventHandler.java b/src/main/java/com/klikli_dev/occultism/handlers/ClientSetupEventHandler.java index 08892e57a..8d36a8b5d 100644 --- a/src/main/java/com/klikli_dev/occultism/handlers/ClientSetupEventHandler.java +++ b/src/main/java/com/klikli_dev/occultism/handlers/ClientSetupEventHandler.java @@ -34,11 +34,10 @@ import com.klikli_dev.occultism.client.keybindings.BackpackKeyConflictContext; import com.klikli_dev.occultism.client.keybindings.StorageRemoteKeyConflictContext; import com.klikli_dev.occultism.client.model.entity.*; -import com.klikli_dev.occultism.client.render.ThirdEyeEffectRenderer; import com.klikli_dev.occultism.client.render.blockentity.SacrificialBowlRenderer; import com.klikli_dev.occultism.client.render.blockentity.StorageControllerGeoRenderer; import com.klikli_dev.occultism.client.render.entity.*; -import com.klikli_dev.occultism.common.capability.FamiliarSettingsCapability; +import com.klikli_dev.occultism.common.capability.FamiliarSettingsData; import com.klikli_dev.occultism.common.container.spirit.SpiritContainer; import com.klikli_dev.occultism.integration.modonomicon.PageRenderers; import com.klikli_dev.occultism.registry.*; @@ -48,18 +47,20 @@ import net.minecraft.client.renderer.blockentity.BlockEntityRenderers; import net.minecraft.client.renderer.entity.*; import net.minecraft.client.renderer.item.ItemProperties; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.EntityType; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.client.event.EntityRenderersEvent; -import net.minecraftforge.client.event.RegisterGuiOverlaysEvent; -import net.minecraftforge.client.event.RegisterKeyMappingsEvent; -import net.minecraftforge.client.settings.KeyConflictContext; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.Mod; +import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; +import net.neoforged.neoforge.client.event.EntityRenderersEvent; +import net.neoforged.neoforge.client.event.RegisterGuiOverlaysEvent; +import net.neoforged.neoforge.client.event.RegisterKeyMappingsEvent; +import net.neoforged.neoforge.client.event.RegisterMenuScreensEvent; +import net.neoforged.neoforge.client.settings.KeyConflictContext; +import net.neoforged.neoforge.common.NeoForge; +import net.neoforged.neoforge.registries.NeoForgeRegistries; import org.lwjgl.glfw.GLFW; import java.util.HashMap; @@ -148,8 +149,8 @@ public static void onRegisterKeyMappings(RegisterKeyMappingsEvent event) { event.register(KEY_STORAGE_REMOTE); keysFamiliars = new HashMap<>(); - for (EntityType familiar : FamiliarSettingsCapability.getFamiliars()) { - KeyMapping kb = new KeyMapping("key.occultism.familiar." + ForgeRegistries.ENTITY_TYPES.getKey(familiar).getPath(), KeyConflictContext.IN_GAME, + for (EntityType familiar : FamiliarSettingsData.getFamiliars()) { + KeyMapping kb = new KeyMapping("key.occultism.familiar." + BuiltInRegistries.ENTITY_TYPE.getKey(familiar).getPath(), KeyConflictContext.IN_GAME, InputConstants.Type.KEYSYM.getOrCreate(-1), "key.occultism.category"); keysFamiliars.put(familiar, kb); event.register(kb); @@ -159,29 +160,16 @@ public static void onRegisterKeyMappings(RegisterKeyMappingsEvent event) { @SubscribeEvent public static void onClientSetup(FMLClientSetupEvent event) { //Register client side event handlers - MinecraftForge.EVENT_BUS.register(Occultism.SELECTED_BLOCK_RENDERER); - MinecraftForge.EVENT_BUS.register(Occultism.THIRD_EYE_EFFECT_RENDERER); + NeoForge.EVENT_BUS.register(Occultism.SELECTED_BLOCK_RENDERER); + NeoForge.EVENT_BUS.register(Occultism.THIRD_EYE_EFFECT_RENDERER); //Register Tile Entity Renderers - BlockEntityRenderers.register(OccultismTiles.STORAGE_CONTROLLER.get(), StorageControllerGeoRenderer::new); - BlockEntityRenderers.register(OccultismTiles.SACRIFICIAL_BOWL.get(), SacrificialBowlRenderer::new); - BlockEntityRenderers.register(OccultismTiles.GOLDEN_SACRIFICIAL_BOWL.get(), SacrificialBowlRenderer::new); + BlockEntityRenderers.register(OccultismBlockEntities.STORAGE_CONTROLLER.get(), StorageControllerGeoRenderer::new); + BlockEntityRenderers.register(OccultismBlockEntities.SACRIFICIAL_BOWL.get(), SacrificialBowlRenderer::new); + BlockEntityRenderers.register(OccultismBlockEntities.GOLDEN_SACRIFICIAL_BOWL.get(), SacrificialBowlRenderer::new); registerItemModelProperties(event); - //Not safe to call during parallel load, so register to run threadsafe. - event.enqueueWork(() -> { - //Register screen factories - MenuScreens.register(OccultismContainers.STORAGE_CONTROLLER.get(), StorageControllerGui::new); - MenuScreens.register(OccultismContainers.STABLE_WORMHOLE.get(), StableWormholeGui::new); - MenuScreens.register(OccultismContainers.STORAGE_REMOTE.get(), StorageRemoteGui::new); - MenuScreens.register(OccultismContainers.SPIRIT.get(), SpiritGui::new); - MenuScreens.register(OccultismContainers.SPIRIT_TRANSPORTER.get(), SpiritTransporterGui::new); - MenuScreens.register(OccultismContainers.OTHERWORLD_MINER.get(), DimensionalMineshaftScreen::new); - MenuScreens.register(OccultismContainers.SATCHEL.get(), SatchelScreen::new); - Occultism.LOGGER.debug("Registered Screen Containers"); - }); - PageRenderers.onClientSetup(event); Occultism.LOGGER.debug("Registered Overlays"); @@ -189,6 +177,16 @@ public static void onClientSetup(FMLClientSetupEvent event) { Occultism.LOGGER.info("Client setup complete."); } + public static void onRegisterMenuScreens(RegisterMenuScreensEvent event){ + event.register(OccultismContainers.STORAGE_CONTROLLER.get(), StorageControllerGui::new); + event.register(OccultismContainers.STABLE_WORMHOLE.get(), StableWormholeGui::new); + event.register(OccultismContainers.STORAGE_REMOTE.get(), StorageRemoteGui::new); + event.register(OccultismContainers.SPIRIT.get(), SpiritGui::new); + event.register(OccultismContainers.SPIRIT_TRANSPORTER.get(), SpiritTransporterGui::new); + event.register(OccultismContainers.OTHERWORLD_MINER.get(), DimensionalMineshaftScreen::new); + event.register(OccultismContainers.SATCHEL.get(), SatchelScreen::new); + } + public static void registerItemModelProperties(FMLClientSetupEvent event) { //Not safe to call during parallel load, so register to run threadsafe @@ -212,7 +210,7 @@ public static void registerItemModelProperties(FMLClientSetupEvent event) { @SubscribeEvent public static void onRegisterGuiOverlays(RegisterGuiOverlaysEvent event) { - event.registerAboveAll("third_eye", (gui, guiGraphics, partialTick, screenWidth, screenHeight) -> { + event.registerAboveAll(new ResourceLocation(Occultism.MODID, "third_eye"), (gui, guiGraphics, partialTick, screenWidth, screenHeight) -> { if (Occultism.THIRD_EYE_EFFECT_RENDERER.gogglesActiveLastTick || Occultism.THIRD_EYE_EFFECT_RENDERER.thirdEyeActiveLastTick) { gui.setupOverlayRenderState(true, false); Occultism.THIRD_EYE_EFFECT_RENDERER.renderOverlay(guiGraphics.pose()); diff --git a/src/main/java/com/klikli_dev/occultism/handlers/ColorEventHandler.java b/src/main/java/com/klikli_dev/occultism/handlers/ColorEventHandler.java index 58ee015a3..473cd5928 100644 --- a/src/main/java/com/klikli_dev/occultism/handlers/ColorEventHandler.java +++ b/src/main/java/com/klikli_dev/occultism/handlers/ColorEventHandler.java @@ -30,10 +30,10 @@ import net.minecraft.world.item.BlockItem; import net.minecraft.world.level.FoliageColor; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.client.event.RegisterColorHandlersEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.common.Mod; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.Mod; +import net.neoforged.neoforge.client.event.RegisterColorHandlersEvent; @Mod.EventBusSubscriber(modid = Occultism.MODID, bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT) public class ColorEventHandler { diff --git a/src/main/java/com/klikli_dev/occultism/handlers/FamiliarEventHandler.java b/src/main/java/com/klikli_dev/occultism/handlers/FamiliarEventHandler.java index 45c524c58..377a0220a 100644 --- a/src/main/java/com/klikli_dev/occultism/handlers/FamiliarEventHandler.java +++ b/src/main/java/com/klikli_dev/occultism/handlers/FamiliarEventHandler.java @@ -40,16 +40,15 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.phys.AABB; -import net.minecraftforge.event.entity.living.LivingDamageEvent; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.living.LivingHurtEvent; -import net.minecraftforge.event.entity.living.MobEffectEvent; -import net.minecraftforge.event.entity.player.PlayerEvent; -import net.minecraftforge.event.level.SaplingGrowTreeEvent; -import net.minecraftforge.eventbus.api.Event.Result; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.common.Mod; - +import net.neoforged.bus.api.Event.Result; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.Mod; +import net.neoforged.neoforge.event.entity.living.LivingDamageEvent; +import net.neoforged.neoforge.event.entity.living.LivingDeathEvent; +import net.neoforged.neoforge.event.entity.living.LivingHurtEvent; +import net.neoforged.neoforge.event.entity.living.MobEffectEvent; +import net.neoforged.neoforge.event.entity.player.PlayerEvent; +import net.neoforged.neoforge.event.level.SaplingGrowTreeEvent; import java.util.List; @Mod.EventBusSubscriber(modid = Occultism.MODID, bus = Mod.EventBusSubscriber.Bus.FORGE) @@ -102,7 +101,7 @@ public static void dodge(LivingHurtEvent event) { event.setCanceled(dodge); if (dodge) - OccultismAdvancements.FAMILIAR.trigger(entity, FamiliarTrigger.Type.MUMMY_DODGE); + OccultismAdvancements.FAMILIAR.get().trigger(entity, FamiliarTrigger.Type.MUMMY_DODGE); } @SubscribeEvent @@ -146,7 +145,7 @@ private static void fairySave(LivingDeathEvent event) { entity.addEffect(new MobEffectInstance(MobEffects.ABSORPTION, 20 * 5, 2)); if (!owner.level().isClientSide) - OccultismAdvancements.FAMILIAR.trigger(owner, FamiliarTrigger.Type.FAIRY_SAVE); + OccultismAdvancements.FAMILIAR.get().trigger(owner, FamiliarTrigger.Type.FAIRY_SAVE); } @SubscribeEvent @@ -177,7 +176,7 @@ private static void headlessStealHead(LivingDeathEvent event) { OccultismEntities.HEADLESS_FAMILIAR.get()); if (!headlesses.isEmpty() && event.getEntity().getType() == OccultismEntities.CTHULHU_FAMILIAR.get()) - OccultismAdvancements.FAMILIAR.trigger(player, FamiliarTrigger.Type.HEADLESS_CTHULHU_HEAD); + OccultismAdvancements.FAMILIAR.get().trigger(player, FamiliarTrigger.Type.HEADLESS_CTHULHU_HEAD); headlesses.forEach(h -> h.setHeadType(event.getEntity().getType())); } diff --git a/src/main/java/com/klikli_dev/occultism/handlers/ForgeEventHandler.java b/src/main/java/com/klikli_dev/occultism/handlers/ForgeEventHandler.java index 16e81280c..e4fa81831 100644 --- a/src/main/java/com/klikli_dev/occultism/handlers/ForgeEventHandler.java +++ b/src/main/java/com/klikli_dev/occultism/handlers/ForgeEventHandler.java @@ -24,9 +24,9 @@ import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.registry.OccultismCommands; -import net.minecraftforge.event.RegisterCommandsEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.common.Mod; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.Mod; +import net.neoforged.neoforge.event.RegisterCommandsEvent; @Mod.EventBusSubscriber(modid = Occultism.MODID, bus = Mod.EventBusSubscriber.Bus.FORGE) public class ForgeEventHandler { diff --git a/src/main/java/com/klikli_dev/occultism/handlers/LootEventHandler.java b/src/main/java/com/klikli_dev/occultism/handlers/LootEventHandler.java index 0ec68846b..95a55cc27 100644 --- a/src/main/java/com/klikli_dev/occultism/handlers/LootEventHandler.java +++ b/src/main/java/com/klikli_dev/occultism/handlers/LootEventHandler.java @@ -31,11 +31,11 @@ import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.common.Tags; -import net.minecraftforge.event.entity.living.LivingExperienceDropEvent; -import net.minecraftforge.event.entity.player.EntityItemPickupEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.common.Mod; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.Mod; +import net.neoforged.neoforge.common.Tags; +import net.neoforged.neoforge.event.entity.living.LivingExperienceDropEvent; +import net.neoforged.neoforge.event.entity.player.EntityItemPickupEvent; @Mod.EventBusSubscriber(modid = Occultism.MODID, bus = Mod.EventBusSubscriber.Bus.FORGE) public class LootEventHandler { diff --git a/src/main/java/com/klikli_dev/occultism/handlers/PlayerEventHandler.java b/src/main/java/com/klikli_dev/occultism/handlers/PlayerEventHandler.java index 2f0ed7bcc..8625e84a4 100644 --- a/src/main/java/com/klikli_dev/occultism/handlers/PlayerEventHandler.java +++ b/src/main/java/com/klikli_dev/occultism/handlers/PlayerEventHandler.java @@ -44,10 +44,9 @@ import net.minecraft.world.level.block.JukeboxBlock; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.AABB; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.common.Mod; - +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.Mod; +import net.neoforged.neoforge.event.entity.player.PlayerInteractEvent; import java.util.List; @Mod.EventBusSubscriber(modid = Occultism.MODID, bus = Mod.EventBusSubscriber.Bus.FORGE) @@ -112,7 +111,7 @@ private static void dancingFamiliars(PlayerInteractEvent.RightClickBlock event) e -> e instanceof IFamiliar && ((IFamiliar) e).getFamiliarOwner() == event.getEntity()) .isEmpty()) return; - OccultismAdvancements.FAMILIAR.trigger(event.getEntity(), FamiliarTrigger.Type.PARTY); + OccultismAdvancements.FAMILIAR.get().trigger(event.getEntity(), FamiliarTrigger.Type.PARTY); } @SubscribeEvent diff --git a/src/main/java/com/klikli_dev/occultism/handlers/TooltipHandler.java b/src/main/java/com/klikli_dev/occultism/handlers/TooltipHandler.java index 70ac4532b..3d479cfee 100644 --- a/src/main/java/com/klikli_dev/occultism/handlers/TooltipHandler.java +++ b/src/main/java/com/klikli_dev/occultism/handlers/TooltipHandler.java @@ -27,13 +27,13 @@ import com.klikli_dev.occultism.util.TextUtil; import net.minecraft.ChatFormatting; import net.minecraft.client.resources.language.I18n; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.network.chat.Component; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.event.entity.player.ItemTooltipEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.Mod; +import net.neoforged.neoforge.event.entity.player.ItemTooltipEvent; @Mod.EventBusSubscriber(modid = Occultism.MODID, bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT) public class TooltipHandler { @@ -51,11 +51,9 @@ public static void onAddInformation(ItemTooltipEvent event) { if (Occultism.CLIENT_CONFIG.visuals.showItemTagsInTooltip.get() && event.getFlags().isAdvanced()) { var tooltips = event.getToolTip(); - var item = event.getItemStack().getItem(); - ForgeRegistries.ITEMS.tags().getReverseTag(item).ifPresent((tag) -> { - tag.getTagKeys().forEach((key) -> { - tooltips.add(Component.literal(key.toString()).withStyle(ChatFormatting.DARK_GRAY)); - }); + var item = event.getItemStack().getItemHolder(); + BuiltInRegistries.ITEM.getTags().filter(p -> p.getSecond().contains(item)).forEach((tag) -> { + tooltips.add(Component.literal(tag.getFirst().toString()).withStyle(ChatFormatting.DARK_GRAY)); }); } } diff --git a/src/main/java/com/klikli_dev/occultism/integration/almostunified/AlmostUnifiedIntegration.java b/src/main/java/com/klikli_dev/occultism/integration/almostunified/AlmostUnifiedIntegration.java index d6d8c85da..c55c99048 100644 --- a/src/main/java/com/klikli_dev/occultism/integration/almostunified/AlmostUnifiedIntegration.java +++ b/src/main/java/com/klikli_dev/occultism/integration/almostunified/AlmostUnifiedIntegration.java @@ -1,26 +1,25 @@ +/* + * SPDX-FileCopyrightText: 2022 klikli-dev + * + * SPDX-License-Identifier: MIT + */ + package com.klikli_dev.occultism.integration.almostunified; -import com.almostreliable.unified.api.AlmostUnifiedLookup; import net.minecraft.tags.TagKey; import net.minecraft.world.item.Item; -import net.minecraftforge.fml.ModList; +import org.jetbrains.annotations.Nullable; -public class AlmostUnifiedIntegration { - public static boolean isLoaded() { - return ModList.get().isLoaded("almostunified"); - } +public interface AlmostUnifiedIntegration { - public static Item getPreferredItemForTag(TagKey tag) { - if (isLoaded()) { - return AlmostUnifiedHelper.getPreferredItemForTag(tag); - } + AlmostUnifiedIntegration instance = new AlmostUnifiedIntegrationDummy(); - return null; + static AlmostUnifiedIntegration get() { + return instance; } - public static class AlmostUnifiedHelper { - public static Item getPreferredItemForTag(TagKey tag) { - return AlmostUnifiedLookup.INSTANCE.getPreferredItemForTag(tag); - } - } + + boolean isLoaded(); + + @Nullable Item getPreferredItemForTag(TagKey tag); } diff --git a/src/main/java/com/klikli_dev/occultism/integration/almostunified/AlmostUnifiedIntegrationDummy.java b/src/main/java/com/klikli_dev/occultism/integration/almostunified/AlmostUnifiedIntegrationDummy.java new file mode 100644 index 000000000..08b141573 --- /dev/null +++ b/src/main/java/com/klikli_dev/occultism/integration/almostunified/AlmostUnifiedIntegrationDummy.java @@ -0,0 +1,21 @@ +// SPDX-FileCopyrightText: 2024 klikli_dev +// +// SPDX-License-Identifier: MIT + +package com.klikli_dev.occultism.integration.almostunified; + +import net.minecraft.tags.TagKey; +import net.minecraft.world.item.Item; +import org.jetbrains.annotations.Nullable; + +public class AlmostUnifiedIntegrationDummy implements AlmostUnifiedIntegration { + @Override + public boolean isLoaded() { + return false; + } + + @Override + public @Nullable Item getPreferredItemForTag(TagKey tag) { + return null; + } +} diff --git a/src/main/java/com/klikli_dev/occultism/integration/almostunified/AlmostUnifiedIntegrationImpl.java b/src/main/java/com/klikli_dev/occultism/integration/almostunified/AlmostUnifiedIntegrationImpl.java new file mode 100644 index 000000000..91f3a0c71 --- /dev/null +++ b/src/main/java/com/klikli_dev/occultism/integration/almostunified/AlmostUnifiedIntegrationImpl.java @@ -0,0 +1,33 @@ +// SPDX-FileCopyrightText: 2023 klikli-dev +// +// SPDX-License-Identifier: MIT + +package com.klikli_dev.occultism.integration.almostunified; + +import com.almostreliable.unified.api.AlmostUnifiedLookup; +import net.minecraft.tags.TagKey; +import net.minecraft.world.item.Item; +import net.neoforged.fml.ModList; +import org.jetbrains.annotations.Nullable; + +public class AlmostUnifiedIntegrationImpl implements AlmostUnifiedIntegration { + public boolean isLoaded() { + return ModList.get().isLoaded("almostunified"); + } + + @Nullable + public Item getPreferredItemForTag(TagKey tag) { + if (this.isLoaded()) { + return AlmostUnifiedHelper.getPreferredItemForTag(tag); + } + + return null; + } + + public static class AlmostUnifiedHelper { + @Nullable + public static Item getPreferredItemForTag(TagKey tag) { + return AlmostUnifiedLookup.INSTANCE.getPreferredItemForTag(tag); + } + } +} diff --git a/src/main/java/com/klikli_dev/occultism/integration/jei/JeiAccess.java b/src/main/java/com/klikli_dev/occultism/integration/jei/JeiAccess.java deleted file mode 100644 index 9d0498cc3..000000000 --- a/src/main/java/com/klikli_dev/occultism/integration/jei/JeiAccess.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * MIT License - * - * Copyright 2020 klikli-dev - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and - * associated documentation files (the "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT - * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.klikli_dev.occultism.integration.jei; - -import com.google.common.base.Strings; -import mezz.jei.api.runtime.IJeiRuntime; - -public class JeiAccess { - public static String getFilterText() { - IJeiRuntime runtime = JeiPlugin.getJeiRuntime(); - if (runtime != null) - return runtime.getIngredientFilter().getFilterText(); - return ""; - } - - public static void setFilterText(String filter) { - IJeiRuntime runtime = JeiPlugin.getJeiRuntime(); - if (runtime != null) - runtime.getIngredientFilter().setFilterText(Strings.nullToEmpty(filter)); - } -} diff --git a/src/main/java/com/klikli_dev/occultism/integration/jei/JeiPlugin.java b/src/main/java/com/klikli_dev/occultism/integration/jei/JeiPlugin.java index d12ae4179..1ffff908f 100644 --- a/src/main/java/com/klikli_dev/occultism/integration/jei/JeiPlugin.java +++ b/src/main/java/com/klikli_dev/occultism/integration/jei/JeiPlugin.java @@ -26,10 +26,6 @@ import com.klikli_dev.occultism.common.container.storage.StableWormholeContainer; import com.klikli_dev.occultism.common.container.storage.StorageControllerContainer; import com.klikli_dev.occultism.common.container.storage.StorageRemoteContainer; -import com.klikli_dev.occultism.crafting.recipe.CrushingRecipe; -import com.klikli_dev.occultism.crafting.recipe.MinerRecipe; -import com.klikli_dev.occultism.crafting.recipe.RitualRecipe; -import com.klikli_dev.occultism.crafting.recipe.SpiritFireRecipe; import com.klikli_dev.occultism.integration.jei.recipes.CrushingRecipeCategory; import com.klikli_dev.occultism.integration.jei.recipes.MinerRecipeCategory; import com.klikli_dev.occultism.integration.jei.recipes.RitualRecipeCategory; @@ -49,14 +45,12 @@ import mezz.jei.api.runtime.IJeiRuntime; import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.RecipeManager; import net.minecraft.world.level.ItemLike; -import net.minecraftforge.registries.ForgeRegistries; - -import java.util.List; @mezz.jei.api.JeiPlugin public class JeiPlugin implements IModPlugin { @@ -85,16 +79,16 @@ public void registerRecipes(IRecipeRegistration registration) { ClientLevel level = Minecraft.getInstance().level; RecipeManager recipeManager = level.getRecipeManager(); - List spiritFireRecipes = recipeManager.getAllRecipesFor(OccultismRecipes.SPIRIT_FIRE_TYPE.get()); + var spiritFireRecipes = recipeManager.getAllRecipesFor(OccultismRecipes.SPIRIT_FIRE_TYPE.get()); registration.addRecipes(JeiRecipeTypes.SPIRIT_FIRE, spiritFireRecipes); - List crushingRecipes = recipeManager.getAllRecipesFor(OccultismRecipes.CRUSHING_TYPE.get()); + var crushingRecipes = recipeManager.getAllRecipesFor(OccultismRecipes.CRUSHING_TYPE.get()); registration.addRecipes(JeiRecipeTypes.CRUSHING, crushingRecipes); - List minerRecipes = recipeManager.getAllRecipesFor(OccultismRecipes.MINER_TYPE.get()); + var minerRecipes = recipeManager.getAllRecipesFor(OccultismRecipes.MINER_TYPE.get()); registration.addRecipes(JeiRecipeTypes.MINER, minerRecipes); - List ritualRecipes = recipeManager.getAllRecipesFor(OccultismRecipes.RITUAL_TYPE.get()); + var ritualRecipes = recipeManager.getAllRecipesFor(OccultismRecipes.RITUAL_TYPE.get()); registration.addRecipes(JeiRecipeTypes.RITUAL, ritualRecipes); this.registerIngredientInfo(registration, OccultismItems.TALLOW.get()); @@ -115,9 +109,9 @@ public void registerRecipeTransferHandlers(IRecipeTransferRegistration registrat IStackHelper stackHelper = registration.getJeiHelpers().getStackHelper(); IRecipeTransferHandlerHelper handlerHelper = registration.getTransferHelper(); - registration.addRecipeTransferHandler(new StorageControllerRecipeTransferHandler<>( StorageControllerContainer.class, handlerHelper), RecipeTypes.CRAFTING); - registration.addRecipeTransferHandler(new StorageControllerRecipeTransferHandler<>( StorageRemoteContainer.class, handlerHelper), RecipeTypes.CRAFTING); - registration.addRecipeTransferHandler(new StorageControllerRecipeTransferHandler<>( StableWormholeContainer.class, handlerHelper), RecipeTypes.CRAFTING); + registration.addRecipeTransferHandler(new StorageControllerRecipeTransferHandler<>(StorageControllerContainer.class, handlerHelper), RecipeTypes.CRAFTING); + registration.addRecipeTransferHandler(new StorageControllerRecipeTransferHandler<>(StorageRemoteContainer.class, handlerHelper), RecipeTypes.CRAFTING); + registration.addRecipeTransferHandler(new StorageControllerRecipeTransferHandler<>(StableWormholeContainer.class, handlerHelper), RecipeTypes.CRAFTING); } @Override @@ -129,13 +123,13 @@ public void registerRecipeCatalysts(IRecipeCatalystRegistration registration) { registration.addRecipeCatalyst(new ItemStack(OccultismBlocks.GOLDEN_SACRIFICIAL_BOWL.get()), JeiRecipeTypes.RITUAL); - registration.addRecipeCatalyst(new ItemStack(ForgeRegistries.ITEMS.getValue(new ResourceLocation(Occultism.MODID, "ritual_dummy/summon_marid_crusher"))), + registration.addRecipeCatalyst(new ItemStack(BuiltInRegistries.ITEM.get(new ResourceLocation(Occultism.MODID, "ritual_dummy/summon_marid_crusher"))), JeiRecipeTypes.CRUSHING); - registration.addRecipeCatalyst(new ItemStack(ForgeRegistries.ITEMS.getValue(new ResourceLocation(Occultism.MODID, "ritual_dummy/summon_afrit_crusher"))), + registration.addRecipeCatalyst(new ItemStack(BuiltInRegistries.ITEM.get(new ResourceLocation(Occultism.MODID, "ritual_dummy/summon_afrit_crusher"))), JeiRecipeTypes.CRUSHING); - registration.addRecipeCatalyst(new ItemStack(ForgeRegistries.ITEMS.getValue(new ResourceLocation(Occultism.MODID, "ritual_dummy/summon_djinni_crusher"))), + registration.addRecipeCatalyst(new ItemStack(BuiltInRegistries.ITEM.get(new ResourceLocation(Occultism.MODID, "ritual_dummy/summon_djinni_crusher"))), JeiRecipeTypes.CRUSHING); - registration.addRecipeCatalyst(new ItemStack(ForgeRegistries.ITEMS.getValue(new ResourceLocation(Occultism.MODID, "ritual_dummy/summon_foliot_crusher"))), + registration.addRecipeCatalyst(new ItemStack(BuiltInRegistries.ITEM.get(new ResourceLocation(Occultism.MODID, "ritual_dummy/summon_foliot_crusher"))), JeiRecipeTypes.CRUSHING); } @@ -147,6 +141,6 @@ public void onRuntimeAvailable(IJeiRuntime jeiRuntime) { public void registerIngredientInfo(IRecipeRegistration registration, ItemLike ingredient) { registration.addIngredientInfo(new ItemStack(ingredient.asItem()), VanillaTypes.ITEM_STACK, - Component.translatable("jei." + Occultism.MODID + ".ingredient." + ForgeRegistries.ITEMS.getKey(ingredient.asItem()).getPath().replace("/", ".") + ".description")); + Component.translatable("jei." + Occultism.MODID + ".ingredient." + BuiltInRegistries.ITEM.getKey(ingredient.asItem()).getPath().replace("/", ".") + ".description")); } } diff --git a/src/main/java/com/klikli_dev/occultism/integration/jei/JeiRecipeTypes.java b/src/main/java/com/klikli_dev/occultism/integration/jei/JeiRecipeTypes.java index 695977516..dd888a83b 100644 --- a/src/main/java/com/klikli_dev/occultism/integration/jei/JeiRecipeTypes.java +++ b/src/main/java/com/klikli_dev/occultism/integration/jei/JeiRecipeTypes.java @@ -25,17 +25,27 @@ import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.crafting.recipe.*; import mezz.jei.api.recipe.RecipeType; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.crafting.Recipe; +import net.minecraft.world.item.crafting.RecipeHolder; public class JeiRecipeTypes { - public static final RecipeType SPIRIT_TRADE = - RecipeType.create(Occultism.MODID, "spirit_trade", SpiritTradeRecipe.class); - public static final RecipeType SPIRIT_FIRE = - RecipeType.create(Occultism.MODID, "spirit_fire", SpiritFireRecipe.class); - public static final RecipeType CRUSHING = - RecipeType.create(Occultism.MODID, "crushing", CrushingRecipe.class); - public static final RecipeType MINER = - RecipeType.create(Occultism.MODID, "miner", MinerRecipe.class); - public static final RecipeType RITUAL = - RecipeType.create(Occultism.MODID, "ritual", RitualRecipe.class); + public static final RecipeType> SPIRIT_TRADE = + create(Occultism.MODID, "spirit_trade", SpiritTradeRecipe.class); + public static final RecipeType> SPIRIT_FIRE = + create(Occultism.MODID, "spirit_fire", SpiritFireRecipe.class); + public static final RecipeType> CRUSHING = + create(Occultism.MODID, "crushing", CrushingRecipe.class); + public static final RecipeType> MINER = + create(Occultism.MODID, "miner", MinerRecipe.class); + public static final RecipeType> RITUAL = + create(Occultism.MODID, "ritual", RitualRecipe.class); + + public static > RecipeType> create(String modid, String name, Class recipeClass) { + ResourceLocation uid = new ResourceLocation(modid, name); + @SuppressWarnings({"unchecked", "RedundantCast"}) + Class> holderClass = (Class>) (Object) RecipeHolder.class; + return new RecipeType<>(uid, holderClass); + } } diff --git a/src/main/java/com/klikli_dev/occultism/integration/jei/OccultismJeiIntegration.java b/src/main/java/com/klikli_dev/occultism/integration/jei/OccultismJeiIntegration.java new file mode 100644 index 000000000..036024d3e --- /dev/null +++ b/src/main/java/com/klikli_dev/occultism/integration/jei/OccultismJeiIntegration.java @@ -0,0 +1,23 @@ +/* + * SPDX-FileCopyrightText: 2022 klikli-dev + * + * SPDX-License-Identifier: MIT + */ + +package com.klikli_dev.occultism.integration.jei; + +public interface OccultismJeiIntegration { + + OccultismJeiIntegration instance = new OccultismJeiIntegrationDummy(); + + static OccultismJeiIntegration get() { + return instance; + } + + boolean isLoaded(); + + + String getFilterText(); + + void setFilterText(String filter); +} diff --git a/src/main/java/com/klikli_dev/occultism/integration/jei/OccultismJeiIntegrationDummy.java b/src/main/java/com/klikli_dev/occultism/integration/jei/OccultismJeiIntegrationDummy.java new file mode 100644 index 000000000..1948f4bf2 --- /dev/null +++ b/src/main/java/com/klikli_dev/occultism/integration/jei/OccultismJeiIntegrationDummy.java @@ -0,0 +1,23 @@ +// SPDX-FileCopyrightText: 2024 klikli-dev +// +// SPDX-License-Identifier: MIT + +package com.klikli_dev.occultism.integration.jei; + +public class OccultismJeiIntegrationDummy implements OccultismJeiIntegration { + + @Override + public boolean isLoaded() { + return false; + } + + @Override + public String getFilterText() { + return ""; + } + + @Override + public void setFilterText(String filter) { + + } +} diff --git a/src/main/java/com/klikli_dev/occultism/integration/jei/OccultismJeiIntegrationImpl.java b/src/main/java/com/klikli_dev/occultism/integration/jei/OccultismJeiIntegrationImpl.java new file mode 100644 index 000000000..47d5b2d7a --- /dev/null +++ b/src/main/java/com/klikli_dev/occultism/integration/jei/OccultismJeiIntegrationImpl.java @@ -0,0 +1,47 @@ +// SPDX-FileCopyrightText: 2024 klikli-dev +// +// SPDX-License-Identifier: MIT + +package com.klikli_dev.occultism.integration.jei; + +import com.google.common.base.Strings; +import com.klikli_dev.modonomicon.platform.Services; +import mezz.jei.api.runtime.IJeiRuntime; + +public class OccultismJeiIntegrationImpl implements OccultismJeiIntegration { + public boolean isLoaded() { + return Services.PLATFORM.isModLoaded("jei"); + } + + @Override + public String getFilterText() { + if (!this.isLoaded()) + return ""; + + return OccultismJeiHelper.getFilterText(); + } + + @Override + public void setFilterText(String filter) { + if (!this.isLoaded()) + return; + + OccultismJeiHelper.setFilterText(filter); + } + + public static class OccultismJeiHelper { + public static String getFilterText() { + IJeiRuntime runtime = JeiPlugin.getJeiRuntime(); + if (runtime != null) + return runtime.getIngredientFilter().getFilterText(); + return ""; + } + + public static void setFilterText(String filter) { + IJeiRuntime runtime = JeiPlugin.getJeiRuntime(); + if (runtime != null) + runtime.getIngredientFilter().setFilterText(Strings.nullToEmpty(filter)); + } + } + +} diff --git a/src/main/java/com/klikli_dev/occultism/integration/jei/StorageControllerRecipeTransferHandler.java b/src/main/java/com/klikli_dev/occultism/integration/jei/StorageControllerRecipeTransferHandler.java index ebf8e09dd..1dffb0f94 100644 --- a/src/main/java/com/klikli_dev/occultism/integration/jei/StorageControllerRecipeTransferHandler.java +++ b/src/main/java/com/klikli_dev/occultism/integration/jei/StorageControllerRecipeTransferHandler.java @@ -24,9 +24,9 @@ import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.api.common.container.IStorageControllerContainer; -import com.klikli_dev.occultism.network.MessageSetRecipe; -import com.klikli_dev.occultism.network.MessageSetRecipeByID; -import com.klikli_dev.occultism.network.OccultismPackets; +import com.klikli_dev.occultism.network.messages.MessageSetRecipe; +import com.klikli_dev.occultism.network.messages.MessageSetRecipeByID; +import com.klikli_dev.occultism.network.Networking; import mezz.jei.api.constants.RecipeTypes; import mezz.jei.api.constants.VanillaTypes; import mezz.jei.api.gui.ingredient.IRecipeSlotsView; @@ -44,8 +44,7 @@ import net.minecraft.world.inventory.Slot; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.CraftingRecipe; -import net.minecraft.world.item.crafting.ShapedRecipe; -import net.minecraft.world.item.crafting.ShapelessRecipe; +import net.minecraft.world.item.crafting.RecipeHolder; import java.util.List; import java.util.Optional; @@ -55,7 +54,7 @@ * Based on https://github.com/Lothrazar/Storage-Network */ -public class StorageControllerRecipeTransferHandler implements IRecipeTransferHandler { +public class StorageControllerRecipeTransferHandler implements IRecipeTransferHandler> { protected final Class containerClass; protected final IRecipeTransferHandlerHelper handlerHelper; @@ -93,7 +92,7 @@ public CompoundTag recipeToNbt(AbstractContainerMenu container, IRecipeSlotsView //if stack is not empty, write to result ItemStack itemStack = possibleItems.get(i); if (!itemStack.isEmpty()) { - invList.add(itemStack.serializeNBT()); + invList.add(itemStack.save(new CompoundTag())); } } nbt.put("s" + (slot.getSlotIndex()), invList); @@ -113,18 +112,18 @@ public Optional> getMenuType() { } @Override - public RecipeType getRecipeType() { + public RecipeType> getRecipeType() { return RecipeTypes.CRAFTING; } - public IRecipeTransferError transferRecipe(T container, CraftingRecipe recipe, IRecipeSlotsView recipeSlots, Player player, boolean maxTransfer, boolean doTransfer) { + public IRecipeTransferError transferRecipe(T container, RecipeHolder recipe, IRecipeSlotsView recipeSlots, Player player, boolean maxTransfer, boolean doTransfer) { - if (recipe.getId() == null) { + if (recipe.id() == null) { return this.handlerHelper.createUserErrorWithTooltip(Component.translatable("jei." + Occultism.MODID + "error.missing_id")); } //sort out any modded recipes that don't fit 3x3 - if (!recipe.canCraftInDimensions(3, 3)) { + if (!recipe.value().canCraftInDimensions(3, 3)) { return this.handlerHelper.createUserErrorWithTooltip(Component.translatable("jei." + Occultism.MODID + "error.recipe_too_large")); } @@ -137,10 +136,10 @@ public IRecipeTransferError transferRecipe(T container, CraftingRecipe recipe, I //if recipe is in recipe manager send by id, otherwise fallback to ingredient list if (doTransfer) { - if (player.getCommandSenderWorld().getRecipeManager().byKey(recipe.getId()).isPresent()) { - OccultismPackets.sendToServer(new MessageSetRecipeByID(recipe.getId())); + if (player.getCommandSenderWorld().getRecipeManager().byKey(recipe.id()).isPresent()) { + Networking.sendToServer(new MessageSetRecipeByID(recipe.id())); } else { - OccultismPackets.sendToServer(new MessageSetRecipe(this.recipeToNbt(container, recipeSlots))); + Networking.sendToServer(new MessageSetRecipe(this.recipeToNbt(container, recipeSlots))); } } return null; diff --git a/src/main/java/com/klikli_dev/occultism/integration/jei/recipes/CrushingRecipeCategory.java b/src/main/java/com/klikli_dev/occultism/integration/jei/recipes/CrushingRecipeCategory.java index c87b4f150..26148702a 100644 --- a/src/main/java/com/klikli_dev/occultism/integration/jei/recipes/CrushingRecipeCategory.java +++ b/src/main/java/com/klikli_dev/occultism/integration/jei/recipes/CrushingRecipeCategory.java @@ -41,8 +41,9 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.crafting.RecipeHolder; -public class CrushingRecipeCategory implements IRecipeCategory { +public class CrushingRecipeCategory implements IRecipeCategory> { private final IDrawable background; private final Component localizedName; @@ -60,7 +61,7 @@ protected void drawStringCentered(GuiGraphics guiGraphics, Font font, Component } @Override - public RecipeType getRecipeType() { + public RecipeType> getRecipeType() { return JeiRecipeTypes.CRUSHING; } @@ -80,21 +81,21 @@ public IDrawable getIcon() { } @Override - public void setRecipe(IRecipeLayoutBuilder builder, CrushingRecipe recipe, IFocusGroup focuses) { + public void setRecipe(IRecipeLayoutBuilder builder, RecipeHolder recipe, IFocusGroup focuses) { builder.addSlot(RecipeIngredientRole.INPUT, 56, 12) - .addIngredients(recipe.getIngredients().get(0)); + .addIngredients(recipe.value().getIngredients().get(0)); builder.addSlot(RecipeIngredientRole.OUTPUT, 94, 12) - .addItemStack(recipe.getResultItem(Minecraft.getInstance().level.registryAccess())); + .addItemStack(recipe.value().getResultItem(Minecraft.getInstance().level.registryAccess())); } @Override - public void draw(CrushingRecipe recipe, IRecipeSlotsView recipeSlotsView, GuiGraphics guiGraphics, double mouseX, double mouseY) { + public void draw(RecipeHolder recipe, IRecipeSlotsView recipeSlotsView, GuiGraphics guiGraphics, double mouseX, double mouseY) { RenderSystem.enableBlend(); this.overlay.draw(guiGraphics, 76, 14); //(center=84) - (width/16=8) = 76 this.drawStringCentered(guiGraphics, Minecraft.getInstance().font, this.getTitle(), 84, 0); - if (recipe.getMinTier() >= 0) { - this.drawStringCentered(guiGraphics, Minecraft.getInstance().font, Component.translatable(TranslationKeys.JEI_CRUSHING_RECIPE_TIER, recipe.getMinTier()), 84, 35); + if (recipe.value().getMinTier() >= 0) { + this.drawStringCentered(guiGraphics, Minecraft.getInstance().font, Component.translatable(TranslationKeys.JEI_CRUSHING_RECIPE_TIER, recipe.value().getMinTier()), 84, 35); } } } diff --git a/src/main/java/com/klikli_dev/occultism/integration/jei/recipes/MinerRecipeCategory.java b/src/main/java/com/klikli_dev/occultism/integration/jei/recipes/MinerRecipeCategory.java index 14b44258d..f97dbcf46 100644 --- a/src/main/java/com/klikli_dev/occultism/integration/jei/recipes/MinerRecipeCategory.java +++ b/src/main/java/com/klikli_dev/occultism/integration/jei/recipes/MinerRecipeCategory.java @@ -44,16 +44,16 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.util.random.WeightedRandom; +import net.minecraft.world.item.crafting.RecipeHolder; import net.minecraft.world.level.Level; -import net.minecraftforge.items.ItemStackHandler; -import net.minecraftforge.items.wrapper.RecipeWrapper; - +import net.neoforged.neoforge.items.ItemStackHandler; +import net.neoforged.neoforge.items.wrapper.RecipeWrapper; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; -public class MinerRecipeCategory implements IRecipeCategory { +public class MinerRecipeCategory implements IRecipeCategory> { private final IDrawable background; private final Component localizedName; @@ -73,7 +73,7 @@ protected void drawStringCentered(GuiGraphics guiGraphics, Font font, Component } @Override - public RecipeType getRecipeType() { + public RecipeType> getRecipeType() { return JeiRecipeTypes.MINER; } @@ -93,28 +93,28 @@ public IDrawable getIcon() { } @Override - public void setRecipe(IRecipeLayoutBuilder builder, MinerRecipe recipe, IFocusGroup focuses) { + public void setRecipe(IRecipeLayoutBuilder builder, RecipeHolder recipe, IFocusGroup focuses) { //set up a simulated handler to get all possible results Level level = Minecraft.getInstance().level; ItemStackHandler simulatedHandler = new ItemStackHandler(1); - simulatedHandler.setStackInSlot(0, recipe.getIngredients().get(0).getItems()[0]); - List recipes = level.getRecipeManager() + simulatedHandler.setStackInSlot(0, recipe.value().getIngredients().get(0).getItems()[0]); + var recipes = level.getRecipeManager() .getRecipesFor(OccultismRecipes.MINER_TYPE.get(), new RecipeWrapper(simulatedHandler), level); - List possibleResults = recipes.stream().map(MinerRecipe::getWeightedOutput).collect(Collectors.toList()); + List possibleResults = recipes.stream().map(RecipeHolder::value).map(MinerRecipe::getWeightedOutput).toList(); - float chance = (float) recipe.getWeightedOutput().getWeight().asInt()/100; - this.chances.put(recipe, chance); + float chance = (float) recipe.value().getWeightedOutput().getWeight().asInt()/100; + this.chances.put(recipe.value(), chance); builder.addSlot(RecipeIngredientRole.INPUT, 56, 12) - .addIngredients(recipe.getIngredients().get(0)); + .addIngredients(recipe.value().getIngredients().get(0)); builder.addSlot(RecipeIngredientRole.OUTPUT, 94, 12) - .addItemStack(recipe.getResultItem(Minecraft.getInstance().level.registryAccess())); + .addItemStack(recipe.value().getResultItem(Minecraft.getInstance().level.registryAccess())); } @Override - public void draw(MinerRecipe recipe, IRecipeSlotsView recipeSlotsView, GuiGraphics guiGraphics, double mouseX, double mouseY) { + public void draw(RecipeHolder recipe, IRecipeSlotsView recipeSlotsView, GuiGraphics guiGraphics, double mouseX, double mouseY) { RenderSystem.enableBlend(); this.overlay.draw(guiGraphics, 76, 14); //(center=84) - (width/16=8) = 76 this.drawStringCentered(guiGraphics, Minecraft.getInstance().font, diff --git a/src/main/java/com/klikli_dev/occultism/integration/jei/recipes/RitualRecipeCategory.java b/src/main/java/com/klikli_dev/occultism/integration/jei/recipes/RitualRecipeCategory.java index 2928c4762..51fe5ae25 100644 --- a/src/main/java/com/klikli_dev/occultism/integration/jei/recipes/RitualRecipeCategory.java +++ b/src/main/java/com/klikli_dev/occultism/integration/jei/recipes/RitualRecipeCategory.java @@ -48,12 +48,13 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.util.FormattedCharSequence; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.RecipeHolder; import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; -public class RitualRecipeCategory implements IRecipeCategory { +public class RitualRecipeCategory implements IRecipeCategory> { private final IDrawable background; private final IDrawable arrow; @@ -93,7 +94,7 @@ protected void drawStringCentered(GuiGraphics guiGraphics, Font font, FormattedC } @Override - public RecipeType getRecipeType() { + public RecipeType> getRecipeType() { return JeiRecipeTypes.RITUAL; } @@ -113,12 +114,12 @@ public IDrawable getIcon() { } @Override - public void setRecipe(IRecipeLayoutBuilder builder, RitualRecipe recipe, IFocusGroup focuses) { + public void setRecipe(IRecipeLayoutBuilder builder, RecipeHolder recipe, IFocusGroup focuses) { this.recipeOutputOffsetX = 75; //draw activation item on top of bowl builder.addSlot(RecipeIngredientRole.INPUT, this.ritualCenterX, this.ritualCenterY - 5) - .addIngredients(recipe.getActivationItem()); + .addIngredients(recipe.value().getActivationItem()); //draw the sacrificial bowl in the center builder.addSlot(RecipeIngredientRole.CATALYST, this.ritualCenterX, this.ritualCenterY) @@ -160,11 +161,11 @@ public void setRecipe(IRecipeLayoutBuilder builder, RitualRecipe recipe, IFocusG ).collect(Collectors.toList()); - for (int i = 0; i < recipe.getIngredients().size(); i++) { + for (int i = 0; i < recipe.value().getIngredients().size(); i++) { Vec3i pos = sacrificialBowlPosition.get(i); builder.addSlot(RecipeIngredientRole.INPUT, pos.getX(), pos.getY() - 5) - .addIngredients(recipe.getIngredients().get(i)); + .addIngredients(recipe.value().getIngredients().get(i)); builder.addSlot(RecipeIngredientRole.RENDER_ONLY, pos.getX(), pos.getY()) .addItemStack(this.sacrificialBowl); @@ -174,14 +175,14 @@ public void setRecipe(IRecipeLayoutBuilder builder, RitualRecipe recipe, IFocusG //draw recipe output on the left var access = Minecraft.getInstance().level.registryAccess(); - if (recipe.getResultItem(access).getItem() != OccultismItems.JEI_DUMMY_NONE.get()) { + if (recipe.value().getResultItem(access).getItem() != OccultismItems.JEI_DUMMY_NONE.get()) { //if we have an item output -> render it builder.addSlot(RecipeIngredientRole.OUTPUT, this.ritualCenterX + this.recipeOutputOffsetX, this.ritualCenterY - 5) - .addItemStack(recipe.getResultItem(access)); + .addItemStack(recipe.value().getResultItem(access)); } else { //if not, we instead render our ritual dummy item, just like in the corner builder.addSlot(RecipeIngredientRole.OUTPUT, this.ritualCenterX + this.recipeOutputOffsetX, this.ritualCenterY - 5) - .addItemStack(recipe.getRitualDummy()); + .addItemStack(recipe.value().getRitualDummy()); } //draw output golden bowl @@ -190,16 +191,16 @@ public void setRecipe(IRecipeLayoutBuilder builder, RitualRecipe recipe, IFocusG //draw ritual dummy item in upper left corner builder.addSlot(RecipeIngredientRole.OUTPUT, 0, 0) - .addItemStack(recipe.getRitualDummy()); + .addItemStack(recipe.value().getRitualDummy()); //draw item to use - if (recipe.requiresItemUse()) { + if (recipe.value().requiresItemUse()) { int infotextY = 0; int lineHeight = Minecraft.getInstance().font.lineHeight; - var pentacle = ModonomiconAPI.get().getMultiblock(recipe.getPentacleId()); + var pentacle = ModonomiconAPI.get().getMultiblock(recipe.value().getPentacleId()); //simulate pentacle id rendering, to get the correct Y level to draw at if (pentacle != null) { @@ -213,7 +214,7 @@ public void setRecipe(IRecipeLayoutBuilder builder, RitualRecipe recipe, IFocusG } //also simulate the info rendered before the item to use for the y level. - if (recipe.requiresSacrifice()) { + if (recipe.value().requiresSacrifice()) { infotextY += lineHeight; } @@ -222,12 +223,12 @@ public void setRecipe(IRecipeLayoutBuilder builder, RitualRecipe recipe, IFocusG int itemToUseX = this.getStringCenteredMaxX(Minecraft.getInstance().font, Component.translatable("jei.occultism.item_to_use"), infoTextX, infotextY); builder.addSlot(RecipeIngredientRole.CATALYST, itemToUseX, itemToUseY) - .addIngredients(recipe.getItemToUse()); + .addIngredients(recipe.value().getItemToUse()); } } @Override - public void draw(RitualRecipe recipe, IRecipeSlotsView recipeSlotsView, GuiGraphics guiGraphics, double mouseX, double mouseY) { + public void draw(RecipeHolder recipe, IRecipeSlotsView recipeSlotsView, GuiGraphics guiGraphics, double mouseX, double mouseY) { RenderSystem.enableBlend(); this.arrow.draw(guiGraphics, this.ritualCenterX + this.recipeOutputOffsetX - 20, this.ritualCenterY); RenderSystem.disableBlend(); @@ -235,7 +236,7 @@ public void draw(RitualRecipe recipe, IRecipeSlotsView recipeSlotsView, GuiGraph int infotextY = 0; int infoTextX = 94; int lineHeight = Minecraft.getInstance().font.lineHeight; - var pentacle = ModonomiconAPI.get().getMultiblock(recipe.getPentacleId()); + var pentacle = ModonomiconAPI.get().getMultiblock(recipe.value().getPentacleId()); if (pentacle != null) { var pentacleName = Minecraft.getInstance().font.split(Component.translatable(Util.makeDescriptionId("multiblock", pentacle.getId())), 150); @@ -249,28 +250,28 @@ public void draw(RitualRecipe recipe, IRecipeSlotsView recipeSlotsView, GuiGraph Component.translatable("jei.occultism.error.pentacle_not_loaded"), infoTextX, 0); } - if (recipe.requiresSacrifice()) { + if (recipe.value().requiresSacrifice()) { this.drawStringCentered(guiGraphics, Minecraft.getInstance().font, - Component.translatable("jei.occultism.sacrifice", Component.translatable(recipe.getEntityToSacrificeDisplayName())), infoTextX, infotextY); + Component.translatable("jei.occultism.sacrifice", Component.translatable(recipe.value().getEntityToSacrificeDisplayName())), infoTextX, infotextY); infotextY += lineHeight; } - if (recipe.requiresItemUse()) { + if (recipe.value().requiresItemUse()) { this.drawStringCentered(guiGraphics, Minecraft.getInstance().font, Component.translatable("jei.occultism.item_to_use"), infoTextX, infotextY); infotextY += lineHeight; } - if (recipe.getEntityToSummon() != null) { + if (recipe.value().getEntityToSummon() != null) { this.drawStringCentered(guiGraphics, Minecraft.getInstance().font, - Component.translatable("jei.occultism.summon", Component.translatable(recipe.getEntityToSummon().getDescriptionId())), + Component.translatable("jei.occultism.summon", Component.translatable(recipe.value().getEntityToSummon().getDescriptionId())), infoTextX, infotextY); infotextY += lineHeight; } - if (recipe.getSpiritJobType() != null) { + if (recipe.value().getSpiritJobType() != null) { this.drawStringCentered(guiGraphics, Minecraft.getInstance().font, Component.translatable("jei.occultism.job", - Component.translatable("job." + recipe.getSpiritJobType().toString().replace(":", "."))), + Component.translatable("job." + recipe.value().getSpiritJobType().toString().replace(":", "."))), infoTextX, infotextY); } } diff --git a/src/main/java/com/klikli_dev/occultism/integration/jei/recipes/SpiritFireRecipeCategory.java b/src/main/java/com/klikli_dev/occultism/integration/jei/recipes/SpiritFireRecipeCategory.java index e424561b8..f7f93f6c9 100644 --- a/src/main/java/com/klikli_dev/occultism/integration/jei/recipes/SpiritFireRecipeCategory.java +++ b/src/main/java/com/klikli_dev/occultism/integration/jei/recipes/SpiritFireRecipeCategory.java @@ -42,8 +42,9 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.RecipeHolder; -public class SpiritFireRecipeCategory implements IRecipeCategory { +public class SpiritFireRecipeCategory implements IRecipeCategory> { private final IDrawable background; private final Component localizedName; @@ -61,7 +62,7 @@ public SpiritFireRecipeCategory(IGuiHelper guiHelper) { } @Override - public RecipeType getRecipeType() { + public RecipeType> getRecipeType() { return JeiRecipeTypes.SPIRIT_FIRE; } @@ -81,19 +82,19 @@ public IDrawable getIcon() { } @Override - public void setRecipe(IRecipeLayoutBuilder builder, SpiritFireRecipe recipe, IFocusGroup focuses) { + public void setRecipe(IRecipeLayoutBuilder builder, RecipeHolder recipe, IFocusGroup focuses) { builder.addSlot(RecipeIngredientRole.INPUT, 40, 12) - .addIngredients(recipe.getIngredients().get(0)); + .addIngredients(recipe.value().getIngredients().get(0)); builder.addSlot(RecipeIngredientRole.CATALYST, 75, 12) .addItemStack(this.renderStack); builder.addSlot(RecipeIngredientRole.OUTPUT, 110, 12) - .addItemStack(recipe.getResultItem(Minecraft.getInstance().level.registryAccess())); + .addItemStack(recipe.value().getResultItem(Minecraft.getInstance().level.registryAccess())); } @Override - public void draw(SpiritFireRecipe recipe, IRecipeSlotsView recipeSlotsView, GuiGraphics guiGraphics, double mouseX, double mouseY) { + public void draw(RecipeHolder recipe, IRecipeSlotsView recipeSlotsView, GuiGraphics guiGraphics, double mouseX, double mouseY) { RenderSystem.enableBlend(); this.overlay.draw(guiGraphics, 48, 0); } diff --git a/src/main/java/com/klikli_dev/occultism/integration/modonomicon/PageLoaders.java b/src/main/java/com/klikli_dev/occultism/integration/modonomicon/PageLoaders.java index 854ffe84f..2978161fb 100644 --- a/src/main/java/com/klikli_dev/occultism/integration/modonomicon/PageLoaders.java +++ b/src/main/java/com/klikli_dev/occultism/integration/modonomicon/PageLoaders.java @@ -4,7 +4,7 @@ import com.klikli_dev.occultism.integration.modonomicon.pages.BookRitualRecipePage; import com.klikli_dev.occultism.integration.modonomicon.pages.BookSpiritFireRecipePage; import com.klikli_dev.occultism.integration.modonomicon.pages.BookSpiritTradeRecipePage; -import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent; public class PageLoaders { diff --git a/src/main/java/com/klikli_dev/occultism/integration/modonomicon/PageRenderers.java b/src/main/java/com/klikli_dev/occultism/integration/modonomicon/PageRenderers.java index c952aa964..7cb8d966f 100644 --- a/src/main/java/com/klikli_dev/occultism/integration/modonomicon/PageRenderers.java +++ b/src/main/java/com/klikli_dev/occultism/integration/modonomicon/PageRenderers.java @@ -2,7 +2,7 @@ import com.klikli_dev.modonomicon.client.render.page.PageRendererRegistry; import com.klikli_dev.occultism.integration.modonomicon.pages.*; -import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; public class PageRenderers { @@ -17,7 +17,7 @@ public static void onClientSetup(FMLClientSetupEvent event) { }); PageRendererRegistry.registerPageRenderer( OccultismModonomiconConstants.Page.RITUAL_RECIPE, - p -> new BookRitualRecipePageRenderer((BookRitualRecipePage) p) { + p -> new BookRitualRecipePageRenderer<>((BookRitualRecipePage) p) { }); } diff --git a/src/main/java/com/klikli_dev/occultism/integration/modonomicon/pages/BookRitualRecipePage.java b/src/main/java/com/klikli_dev/occultism/integration/modonomicon/pages/BookRitualRecipePage.java index 59d956994..e358006fa 100644 --- a/src/main/java/com/klikli_dev/occultism/integration/modonomicon/pages/BookRitualRecipePage.java +++ b/src/main/java/com/klikli_dev/occultism/integration/modonomicon/pages/BookRitualRecipePage.java @@ -16,6 +16,7 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.util.GsonHelper; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.RecipeHolder; import net.minecraft.world.level.Level; public class BookRitualRecipePage extends BookRecipePage { @@ -41,12 +42,12 @@ public ResourceLocation getType() { } @Override - protected ItemStack getRecipeOutput(Level level, RitualRecipe recipe) { + protected ItemStack getRecipeOutput(Level level, RecipeHolder recipe) { if (recipe == null) { return ItemStack.EMPTY; } - return recipe.getRitualDummy(); + return recipe.value().getRitualDummy(); } @Override diff --git a/src/main/java/com/klikli_dev/occultism/integration/modonomicon/pages/BookRitualRecipePageRenderer.java b/src/main/java/com/klikli_dev/occultism/integration/modonomicon/pages/BookRitualRecipePageRenderer.java index 64bf952fe..540422d03 100644 --- a/src/main/java/com/klikli_dev/occultism/integration/modonomicon/pages/BookRitualRecipePageRenderer.java +++ b/src/main/java/com/klikli_dev/occultism/integration/modonomicon/pages/BookRitualRecipePageRenderer.java @@ -23,8 +23,8 @@ import net.minecraft.network.chat.Style; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Recipe; +import net.minecraft.world.item.crafting.RecipeHolder; import org.jetbrains.annotations.Nullable; - import java.util.List; import java.util.stream.Stream; @@ -73,7 +73,7 @@ public Style getClickedComponentStyleAt(double pMouseX, double pMouseY) { //8 is a magic constant, maybe actually because of line height? // IDK why but I put 8 and it works so I won't touch it - var pentacleName = I18n.get(Util.makeDescriptionId("multiblock", this.page.getRecipe1().getPentacleId())); + var pentacleName = I18n.get(Util.makeDescriptionId("multiblock", this.page.getRecipe1().value().getPentacleId())); var nameWidth = this.font.width(pentacleName); int maxWidth = BookContentScreen.MAX_TITLE_WIDTH - RITUAL_DUMMY_OFFSET - 10; //account for the ritual dummy icon, 10 is a magic constant @@ -83,12 +83,12 @@ public Style getClickedComponentStyleAt(double pMouseX, double pMouseY) { } if (pMouseX > pentacleNameX && pMouseX < pentacleNameX + nameWidth && pMouseY > pentacleNameY && pMouseY < pentacleNameY + this.font.lineHeight) { - var goToText = "book.occultism.dictionary_of_spirits.pentacles." + this.page.getRecipe1().getPentacleId().getPath() + ".name"; + var goToText = "book.occultism.dictionary_of_spirits.pentacles." + this.page.getRecipe1().value().getPentacleId().getPath() + ".name"; var hoverComponent = Component.translatable(OccultismModonomiconConstants.I18n.RITUAL_RECIPE_GO_TO_PENTACLE, Component.translatable(goToText)); return Style.EMPTY .withClickEvent(new ClickEvent(Action.CHANGE_PAGE, - "entry://occultism:dictionary_of_spirits/pentacles/" + this.page.getRecipe1().getPentacleId().getPath())) + "entry://occultism:dictionary_of_spirits/pentacles/" + this.page.getRecipe1().value().getPentacleId().getPath())) .withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, hoverComponent)); } } @@ -97,9 +97,10 @@ public Style getClickedComponentStyleAt(double pMouseX, double pMouseY) { @Override - protected void drawRecipe(GuiGraphics guiGraphics, RitualRecipe recipe, int recipeX, int recipeY, int mouseX, int mouseY, boolean second) { + protected void drawRecipe(GuiGraphics guiGraphics, RecipeHolder recipeHolder, int recipeX, int recipeY, int mouseX, int mouseY, boolean second) { recipeY += 10; + var recipe = recipeHolder.value(); if (!second) { //rituals only support one recipe diff --git a/src/main/java/com/klikli_dev/occultism/integration/modonomicon/pages/BookSpiritFireRecipePageRenderer.java b/src/main/java/com/klikli_dev/occultism/integration/modonomicon/pages/BookSpiritFireRecipePageRenderer.java index b15dd88fb..628bc5e2e 100644 --- a/src/main/java/com/klikli_dev/occultism/integration/modonomicon/pages/BookSpiritFireRecipePageRenderer.java +++ b/src/main/java/com/klikli_dev/occultism/integration/modonomicon/pages/BookSpiritFireRecipePageRenderer.java @@ -12,6 +12,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.world.item.crafting.Recipe; +import net.minecraft.world.item.crafting.RecipeHolder; public abstract class BookSpiritFireRecipePageRenderer> extends BookRecipePageRenderer> { public BookSpiritFireRecipePageRenderer(BookProcessingRecipePage page) { @@ -24,9 +25,10 @@ protected int getRecipeHeight() { } @Override - protected void drawRecipe(GuiGraphics guiGraphics, T recipe, int recipeX, int recipeY, int mouseX, int mouseY, boolean second) { + protected void drawRecipe(GuiGraphics guiGraphics, RecipeHolder recipeHolder, int recipeX, int recipeY, int mouseX, int mouseY, boolean second) { recipeY += 10; + var recipe = recipeHolder.value(); if (!second) { diff --git a/src/main/java/com/klikli_dev/occultism/integration/modonomicon/pages/BookSpiritTradeRecipePageRenderer.java b/src/main/java/com/klikli_dev/occultism/integration/modonomicon/pages/BookSpiritTradeRecipePageRenderer.java index af29ae220..bd552775b 100644 --- a/src/main/java/com/klikli_dev/occultism/integration/modonomicon/pages/BookSpiritTradeRecipePageRenderer.java +++ b/src/main/java/com/klikli_dev/occultism/integration/modonomicon/pages/BookSpiritTradeRecipePageRenderer.java @@ -12,6 +12,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.world.item.crafting.Recipe; +import net.minecraft.world.item.crafting.RecipeHolder; public abstract class BookSpiritTradeRecipePageRenderer> extends BookRecipePageRenderer> { public BookSpiritTradeRecipePageRenderer(BookProcessingRecipePage page) { @@ -24,10 +25,10 @@ protected int getRecipeHeight() { } @Override - protected void drawRecipe(GuiGraphics guiGraphics, T recipe, int recipeX, int recipeY, int mouseX, int mouseY, boolean second) { + protected void drawRecipe(GuiGraphics guiGraphics, RecipeHolder recipeHolder, int recipeX, int recipeY, int mouseX, int mouseY, boolean second) { recipeY += 10; - + var recipe = recipeHolder.value(); if (!second) { if (!this.page.getTitle1().isEmpty()) { diff --git a/src/main/java/com/klikli_dev/occultism/integration/theurgy/TheurgyIntegration.java b/src/main/java/com/klikli_dev/occultism/integration/theurgy/TheurgyIntegration.java index f5d340edd..554365773 100644 --- a/src/main/java/com/klikli_dev/occultism/integration/theurgy/TheurgyIntegration.java +++ b/src/main/java/com/klikli_dev/occultism/integration/theurgy/TheurgyIntegration.java @@ -8,7 +8,7 @@ import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.level.Level; import net.minecraft.world.phys.Vec3; -import net.minecraftforge.fml.ModList; +import net.neoforged.fml.ModList; public class TheurgyIntegration { public static boolean isLoaded() { diff --git a/src/main/java/com/klikli_dev/occultism/loot/AddItemModifier.java b/src/main/java/com/klikli_dev/occultism/loot/AddItemModifier.java index 23a08fa0d..dd6279eae 100644 --- a/src/main/java/com/klikli_dev/occultism/loot/AddItemModifier.java +++ b/src/main/java/com/klikli_dev/occultism/loot/AddItemModifier.java @@ -26,13 +26,13 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import it.unimi.dsi.fastutil.objects.ObjectArrayList; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.predicates.LootItemCondition; -import net.minecraftforge.common.loot.IGlobalLootModifier; -import net.minecraftforge.common.loot.LootModifier; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.neoforge.common.loot.IGlobalLootModifier; +import net.neoforged.neoforge.common.loot.LootModifier; import java.util.function.Supplier; @@ -42,7 +42,7 @@ public class AddItemModifier extends LootModifier { RecordCodecBuilder.create(instance -> instance.group( LOOT_CONDITIONS_CODEC.fieldOf("conditions").forGetter(lm -> lm.conditions), - ForgeRegistries.ITEMS.getCodec().fieldOf("item").forGetter(lm -> lm.addedItem), + BuiltInRegistries.ITEM.byNameCodec().fieldOf("item").forGetter(lm -> lm.addedItem), Codec.intRange(0, Integer.MAX_VALUE).fieldOf("count").forGetter((lm) -> lm.count) ) diff --git a/src/main/java/com/klikli_dev/occultism/network/IMessage.java b/src/main/java/com/klikli_dev/occultism/network/IMessage.java index f1be07da3..f47abf3a2 100644 --- a/src/main/java/com/klikli_dev/occultism/network/IMessage.java +++ b/src/main/java/com/klikli_dev/occultism/network/IMessage.java @@ -24,23 +24,28 @@ import net.minecraft.client.Minecraft; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.player.Player; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.network.NetworkEvent; -public interface IMessage { +public interface IMessage extends CustomPacketPayload { void encode(FriendlyByteBuf buf); void decode(FriendlyByteBuf buf); - @OnlyIn(Dist.CLIENT) - void onClientReceived(Minecraft minecraft, Player player, NetworkEvent.Context context); + default void onClientReceived(Minecraft minecraft, Player player) { - void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player, - NetworkEvent.Context context); + } + + default void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player) { + + } + + @Override + default void write(FriendlyByteBuf pBuffer) { + this.encode(pBuffer); + } } diff --git a/src/main/java/com/klikli_dev/occultism/network/MessageBase.java b/src/main/java/com/klikli_dev/occultism/network/MessageBase.java deleted file mode 100644 index f71ec0dc1..000000000 --- a/src/main/java/com/klikli_dev/occultism/network/MessageBase.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * MIT License - * - * Copyright 2020 klikli-dev - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and - * associated documentation files (the "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT - * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.klikli_dev.occultism.network; - -import net.minecraft.client.Minecraft; -import net.minecraft.server.MinecraftServer; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.entity.player.Player; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.network.NetworkEvent; - -public abstract class MessageBase implements IMessage { - - protected MessageBase() { - } - - @OnlyIn(Dist.CLIENT) - public void onClientReceived(Minecraft minecraft, Player player, NetworkEvent.Context context) { - } - - public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player, - NetworkEvent.Context context) { - } - -} diff --git a/src/main/java/com/klikli_dev/occultism/network/MessageHandler.java b/src/main/java/com/klikli_dev/occultism/network/MessageHandler.java new file mode 100644 index 000000000..2a74046f3 --- /dev/null +++ b/src/main/java/com/klikli_dev/occultism/network/MessageHandler.java @@ -0,0 +1,44 @@ +// SPDX-FileCopyrightText: 2023 klikli-dev +// +// SPDX-License-Identifier: MIT + +package com.klikli_dev.occultism.network; + +import com.klikli_dev.theurgy.network.Message; +import net.minecraft.client.Minecraft; +import net.minecraft.network.protocol.common.custom.CustomPacketPayload; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.level.ServerPlayer; +import net.neoforged.fml.LogicalSide; +import net.neoforged.neoforge.network.handling.PlayPayloadContext; + +public class MessageHandler { + + public static void handle(T payload, PlayPayloadContext ctx) { + if (ctx.flow().getReceptionSide() == LogicalSide.SERVER) { + ctx.workHandler().submitAsync(() -> { + handleServer(payload, ctx); + }); + } else { + ctx.workHandler().submitAsync(() -> { + //separate class to avoid loading client code on server. + ClientMessageHandler.handleClient(payload, ctx); + }); + } + } + + public static void handleServer(T payload, PlayPayloadContext ctx) { + MinecraftServer server = ctx.level().get().getServer(); + if (payload instanceof IMessage message) + message.onServerReceived(server, (ServerPlayer) ctx.player().get()); + } + + public static class ClientMessageHandler { + + public static void handleClient(T payload, PlayPayloadContext ctx) { + Minecraft minecraft = Minecraft.getInstance(); + if (payload instanceof IMessage message) + message.onClientReceived(minecraft, minecraft.player); + } + } +} diff --git a/src/main/java/com/klikli_dev/occultism/network/MessageSplitPacket.java b/src/main/java/com/klikli_dev/occultism/network/MessageSplitPacket.java deleted file mode 100644 index 4777b9ae2..000000000 --- a/src/main/java/com/klikli_dev/occultism/network/MessageSplitPacket.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * MIT License - * - * Copyright © 2015 - 2021 Refined Mods - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and - * associated documentation files (the "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT - * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.klikli_dev.occultism.network; - -import net.minecraft.network.FriendlyByteBuf; -import net.minecraftforge.network.NetworkEvent.Context; - -import java.util.function.Supplier; - -public class MessageSplitPacket { - /** - * The payload. - */ - private final byte[] payload; - /** - * Internal communication id. Used to indicate to what wrapped message this belongs to. - */ - private final int communicationId; - /** - * The index of the split message in the wrapped message. - */ - private final int packetIndex; - - public MessageSplitPacket(final int communicationId, final int packetIndex, final byte[] payload) { - this.communicationId = communicationId; - this.packetIndex = packetIndex; - this.payload = payload; - } - - public static void encode(MessageSplitPacket message, FriendlyByteBuf buf) { - buf.writeVarInt(message.communicationId); - buf.writeVarInt(message.packetIndex); - buf.writeByteArray(message.payload); - } - - public static MessageSplitPacket decode(final FriendlyByteBuf buf) { - return new MessageSplitPacket(buf.readVarInt(), buf.readVarInt(), buf.readByteArray()); - } - - public static boolean handle(MessageSplitPacket data, Supplier ctx) { - OccultismPackets.addPackagePart(data.communicationId, data.packetIndex, data.payload); - ctx.get().setPacketHandled(true); - return true; - } -} diff --git a/src/main/java/com/klikli_dev/occultism/network/Networking.java b/src/main/java/com/klikli_dev/occultism/network/Networking.java new file mode 100644 index 000000000..34883ab2d --- /dev/null +++ b/src/main/java/com/klikli_dev/occultism/network/Networking.java @@ -0,0 +1,90 @@ +/* + * MIT License + * + * Copyright 2020 klikli-dev + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and + * associated documentation files (the "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT + * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +package com.klikli_dev.occultism.network; + +import com.klikli_dev.occultism.Occultism; +import com.klikli_dev.occultism.network.messages.*; +import net.minecraft.resources.ResourceKey; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.chunk.LevelChunk; +import net.neoforged.neoforge.network.PacketDistributor; +import net.neoforged.neoforge.network.event.RegisterPayloadHandlerEvent; +import net.neoforged.neoforge.network.registration.IPayloadRegistrar; + +public class Networking { + + public static void register(final RegisterPayloadHandlerEvent event) { + final IPayloadRegistrar registrar = event.registrar(Occultism.MODID); + + registrar.play(MessageBeholderAttack.ID, MessageBeholderAttack::new, MessageHandler::handle); + registrar.play(MessageClearCraftingMatrix.ID, MessageClearCraftingMatrix::new, MessageHandler::handle); + registrar.play(MessageDoubleJump.ID, MessageDoubleJump::new, MessageHandler::handle); + registrar.play(MessageFairySupport.ID, MessageFairySupport::new, MessageHandler::handle); + registrar.play(MessageHeadlessDie.ID, MessageHeadlessDie::new, MessageHandler::handle); + registrar.play(MessageInsertMouseHeldItem.ID, MessageInsertMouseHeldItem::new, MessageHandler::handle); + registrar.play(MessageOpenSatchel.ID, MessageOpenSatchel::new, MessageHandler::handle); + registrar.play(MessageOpenStorageRemote.ID, MessageOpenStorageRemote::new, MessageHandler::handle); + registrar.play(MessageRequestOrder.ID, MessageRequestOrder::new, MessageHandler::handle); + registrar.play(MessageRequestStacks.ID, MessageRequestStacks::new, MessageHandler::handle); + registrar.play(MessageSelectBlock.ID, MessageSelectBlock::new, MessageHandler::handle); + registrar.play(MessageSetDivinationResult.ID, MessageSetDivinationResult::new, MessageHandler::handle); + registrar.play(MessageSetFilterMode.ID, MessageSetFilterMode::new, MessageHandler::handle); + registrar.play(MessageSetItemMode.ID, MessageSetItemMode::new, MessageHandler::handle); + registrar.play(MessageSetJumps.ID, MessageSetJumps::new, MessageHandler::handle); + registrar.play(MessageSetManagedMachine.ID, MessageSetManagedMachine::new, MessageHandler::handle); + registrar.play(MessageSetRecipe.ID, MessageSetRecipe::new, MessageHandler::handle); + registrar.play(MessageSetRecipeByID.ID, MessageSetRecipeByID::new, MessageHandler::handle); + registrar.play(MessageSetTagFilterText.ID, MessageSetTagFilterText::new, MessageHandler::handle); + registrar.play(MessageSetWorkAreaSize.ID, MessageSetWorkAreaSize::new, MessageHandler::handle); + registrar.play(MessageSortItems.ID, MessageSortItems::new, MessageHandler::handle); + registrar.play(MessageSyncFamiliarSettings.ID, MessageSyncFamiliarSettings::new, MessageHandler::handle); + registrar.play(MessageTakeItem.ID, MessageTakeItem::new, MessageHandler::handle); + registrar.play(MessageToggleFamiliarSettings.ID, MessageToggleFamiliarSettings::new, MessageHandler::handle); + registrar.play(MessageUpdateLinkedMachines.ID, MessageUpdateLinkedMachines::new, MessageHandler::handle); + registrar.play(MessageUpdateMouseHeldItem.ID, MessageUpdateMouseHeldItem::new, MessageHandler::handle); + registrar.play(MessageUpdateStacks.ID, MessageUpdateStacks::new, MessageHandler::handle); + registrar.play(MessageUpdateStorageSettings.ID, MessageUpdateStorageSettings::new, MessageHandler::handle); + } + + public static void sendTo(ServerPlayer player, T message) { + PacketDistributor.PLAYER.with(player).send(message); + } + + public static void sendToServer(T message) { + PacketDistributor.SERVER.noArg().send(message); + } + + public static void sendToTracking(Entity entity, T message) { + PacketDistributor.TRACKING_ENTITY.with(entity).send(message); + } + + public static void sendToTracking(LevelChunk chunk, T message) { + PacketDistributor.TRACKING_CHUNK.with(chunk).send(message); + } + + public static void sendToDimension(ResourceKey dimensionKey, T message) { + PacketDistributor.DIMENSION.with(dimensionKey).send(message); + } +} diff --git a/src/main/java/com/klikli_dev/occultism/network/OccultismPacketHandler.java b/src/main/java/com/klikli_dev/occultism/network/OccultismPacketHandler.java deleted file mode 100644 index 018084a75..000000000 --- a/src/main/java/com/klikli_dev/occultism/network/OccultismPacketHandler.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * MIT License - * - * Copyright 2020 klikli-dev - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and - * associated documentation files (the "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT - * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.klikli_dev.occultism.network; - -import net.minecraft.client.Minecraft; -import net.minecraft.server.MinecraftServer; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.fml.LogicalSide; -import net.minecraftforge.network.NetworkEvent; - -import java.util.function.Supplier; - -public class OccultismPacketHandler { - public static void handle(T message, Supplier ctx) { - if (ctx.get().getDirection().getReceptionSide() == LogicalSide.SERVER) { - ctx.get().enqueueWork(() -> { - handleServer(message, ctx); - }); - } else { - ctx.get().enqueueWork(() -> { - handleClient(message, ctx); - }); - } - ctx.get().setPacketHandled(true); - } - - public static void handleServer(T message, Supplier ctx) { - MinecraftServer server = ctx.get().getSender().level().getServer(); - message.onServerReceived(server, ctx.get().getSender(), ctx.get()); - } - - @OnlyIn(Dist.CLIENT) - public static void handleClient(T message, Supplier ctx) { - Minecraft minecraft = Minecraft.getInstance(); - message.onClientReceived(minecraft, minecraft.player, ctx.get()); - } -} diff --git a/src/main/java/com/klikli_dev/occultism/network/OccultismPackets.java b/src/main/java/com/klikli_dev/occultism/network/OccultismPackets.java deleted file mode 100644 index fadfa2f00..000000000 --- a/src/main/java/com/klikli_dev/occultism/network/OccultismPackets.java +++ /dev/null @@ -1,259 +0,0 @@ -/* - * MIT License - * - * Copyright 2020 klikli-dev - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and - * associated documentation files (the "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT - * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.klikli_dev.occultism.network; - -import com.klikli_dev.occultism.Occultism; -import net.minecraft.resources.ResourceKey; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.entity.Entity; -import net.minecraft.world.level.Level; -import net.minecraftforge.common.util.FakePlayer; -import net.minecraftforge.network.NetworkRegistry; -import net.minecraftforge.network.PacketDistributor; -import net.minecraftforge.network.simple.SimpleChannel; - -public class OccultismPackets { - public static final String PROTOCOL_VERSION = "1"; - public static final ResourceLocation CHANNEL = new ResourceLocation(Occultism.MODID, "main"); - public static final SimpleChannel INSTANCE = NetworkRegistry.newSimpleChannel( - CHANNEL, - () -> PROTOCOL_VERSION, - PROTOCOL_VERSION::equals, - PROTOCOL_VERSION::equals - ); - public static final PacketSplitter SPLITTER = new PacketSplitter(10, INSTANCE, CHANNEL); - - private static int ID = 0; - - public static int nextID() { - return ID++; - } - - public static void registerMessages() { - - INSTANCE.registerMessage(nextID(), - MessageSplitPacket.class, - MessageSplitPacket::encode, - MessageSplitPacket::decode, - MessageSplitPacket::handle); - - INSTANCE.registerMessage(nextID(), - MessageRequestStacks.class, - MessageRequestStacks::encode, - MessageRequestStacks::new, - OccultismPacketHandler::handle); - - SPLITTER.registerMessage(nextID(), - MessageUpdateLinkedMachines.class, - MessageUpdateLinkedMachines::encode, - MessageUpdateLinkedMachines::new, - OccultismPacketHandler::handle); - - SPLITTER.registerMessage(nextID(), - MessageUpdateStacks.class, - MessageUpdateStacks::encode, - MessageUpdateStacks::new, - OccultismPacketHandler::handle); - - INSTANCE.registerMessage(nextID(), - MessageSetRecipe.class, - MessageSetRecipe::encode, - MessageSetRecipe::new, - OccultismPacketHandler::handle); - - INSTANCE.registerMessage(nextID(), - MessageClearCraftingMatrix.class, - MessageClearCraftingMatrix::encode, - MessageClearCraftingMatrix::new, - OccultismPacketHandler::handle); - - INSTANCE.registerMessage(nextID(), - MessageTakeItem.class, - MessageTakeItem::encode, - MessageTakeItem::new, - OccultismPacketHandler::handle); - - INSTANCE.registerMessage(nextID(), - MessageUpdateMouseHeldItem.class, - MessageUpdateMouseHeldItem::encode, - MessageUpdateMouseHeldItem::new, - OccultismPacketHandler::handle); - - INSTANCE.registerMessage(nextID(), - MessageInsertMouseHeldItem.class, - MessageInsertMouseHeldItem::encode, - MessageInsertMouseHeldItem::new, - OccultismPacketHandler::handle); - - INSTANCE.registerMessage(nextID(), - MessageRequestOrder.class, - MessageRequestOrder::encode, - MessageRequestOrder::new, - OccultismPacketHandler::handle); - - INSTANCE.registerMessage(nextID(), - MessageSortItems.class, - MessageSortItems::encode, - MessageSortItems::new, - OccultismPacketHandler::handle); - - INSTANCE.registerMessage(nextID(), - MessageSetItemMode.class, - MessageSetItemMode::encode, - MessageSetItemMode::new, - OccultismPacketHandler::handle); - - INSTANCE.registerMessage(nextID(), - MessageSetWorkAreaSize.class, - MessageSetWorkAreaSize::encode, - MessageSetWorkAreaSize::new, - OccultismPacketHandler::handle); - - INSTANCE.registerMessage(nextID(), - MessageSetManagedMachine.class, - MessageSetManagedMachine::encode, - MessageSetManagedMachine::new, - OccultismPacketHandler::handle); - - INSTANCE.registerMessage(nextID(), - MessageSetDivinationResult.class, - MessageSetDivinationResult::encode, - MessageSetDivinationResult::new, - OccultismPacketHandler::handle); - - INSTANCE.registerMessage(nextID(), - MessageSelectBlock.class, - MessageSelectBlock::encode, - MessageSelectBlock::new, - OccultismPacketHandler::handle); - - INSTANCE.registerMessage(nextID(), - MessageSetJumps.class, - MessageSetJumps::encode, - MessageSetJumps::new, - OccultismPacketHandler::handle); - - INSTANCE.registerMessage(nextID(), - MessageDoubleJump.class, - MessageDoubleJump::encode, - MessageDoubleJump::new, - OccultismPacketHandler::handle); - - INSTANCE.registerMessage(nextID(), - MessageSetFilterMode.class, - MessageSetFilterMode::encode, - MessageSetFilterMode::new, - OccultismPacketHandler::handle); - - INSTANCE.registerMessage(nextID(), - MessageSetRecipeByID.class, - MessageSetRecipeByID::encode, - MessageSetRecipeByID::new, - OccultismPacketHandler::handle); - - INSTANCE.registerMessage(nextID(), - MessageOpenSatchel.class, - MessageOpenSatchel::encode, - MessageOpenSatchel::new, - OccultismPacketHandler::handle); - - INSTANCE.registerMessage(nextID(), - MessageSetTagFilterText.class, - MessageSetTagFilterText::encode, - MessageSetTagFilterText::new, - OccultismPacketHandler::handle); - - INSTANCE.registerMessage(nextID(), - MessageToggleFamiliarSettings.class, - MessageToggleFamiliarSettings::encode, - MessageToggleFamiliarSettings::new, - OccultismPacketHandler::handle); - - INSTANCE.registerMessage(nextID(), - MessageOpenStorageRemote.class, - MessageOpenStorageRemote::encode, - MessageOpenStorageRemote::new, - OccultismPacketHandler::handle); - - INSTANCE.registerMessage(nextID(), - MessageHeadlessDie.class, - MessageHeadlessDie::encode, - MessageHeadlessDie::new, - OccultismPacketHandler::handle); - - INSTANCE.registerMessage(nextID(), - MessageBeholderAttack.class, - MessageBeholderAttack::encode, - MessageBeholderAttack::new, - OccultismPacketHandler::handle); - - INSTANCE.registerMessage(nextID(), - MessageFairySupport.class, - MessageFairySupport::encode, - MessageFairySupport::new, - OccultismPacketHandler::handle); - - INSTANCE.registerMessage(nextID(), - MessageUpdateStorageSettings.class, - MessageUpdateStorageSettings::encode, - MessageUpdateStorageSettings::new, - OccultismPacketHandler::handle); - - INSTANCE.registerMessage(nextID(), - MessageSyncFamiliarSettings.class, - MessageSyncFamiliarSettings::encode, - MessageSyncFamiliarSettings::new, - OccultismPacketHandler::handle); - } - - public static void sendToTracking(Entity entity, MSG message) { - INSTANCE.send(PacketDistributor.TRACKING_ENTITY.with(() -> entity), message); - } - - public static void sendToDimension(ResourceKey dimensionKey, MSG message) { - INSTANCE.send(PacketDistributor.DIMENSION.with(() -> dimensionKey), message); - } - - public static void sendToServer(MSG message) { - if (SPLITTER.shouldMessageBeSplit(message.getClass())) { - SPLITTER.sendToServer(message); - } else { - INSTANCE.send(PacketDistributor.SERVER.noArg(), message); - } - } - - public static void sendTo(ServerPlayer player, MSG message) { - if (!(player instanceof FakePlayer)) { - if (SPLITTER.shouldMessageBeSplit(message.getClass())) { - SPLITTER.sendToPlayer(player, message); - } else { - INSTANCE.send(PacketDistributor.PLAYER.with(() -> player), message); - } - } - } - - public static void addPackagePart(int communicationId, int packetIndex, byte[] payload) { - SPLITTER.addPackagePart(communicationId, packetIndex, payload); - } -} diff --git a/src/main/java/com/klikli_dev/occultism/network/PacketSplitter.java b/src/main/java/com/klikli_dev/occultism/network/PacketSplitter.java deleted file mode 100644 index 3fa627842..000000000 --- a/src/main/java/com/klikli_dev/occultism/network/PacketSplitter.java +++ /dev/null @@ -1,250 +0,0 @@ -/* - * MIT License - * - * Copyright © 2015 - 2021 Refined Mods - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and - * associated documentation files (the "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT - * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.klikli_dev.occultism.network; - -import com.google.common.primitives.Bytes; -import io.netty.buffer.Unpooled; -import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.server.level.ServerPlayer; -import net.minecraftforge.network.NetworkEvent; -import net.minecraftforge.network.PacketDistributor; -import net.minecraftforge.network.simple.SimpleChannel; -import org.apache.commons.lang3.tuple.Pair; -import org.apache.logging.log4j.LogManager; - -import java.util.*; -import java.util.concurrent.ConcurrentHashMap; -import java.util.function.BiConsumer; -import java.util.function.Function; -import java.util.function.Supplier; - -public class PacketSplitter { - private final static int MAX_PACKET_SIZE = 943718; - private static final Map> PACKAGE_CACHE = new HashMap<>(); - - private final ResourceLocation channelId; - private final SimpleChannel channel; - private final Map messageTargets = new HashMap<>(); - private final Map packetMaximums = new HashMap<>(); - private final Set> messagesToSplit = new HashSet<>(); - private final int maxNumberOfMessages; - private int comId = 0; - private int id; - - public PacketSplitter(int maxNumberOfMessages, SimpleChannel channel, ResourceLocation CHANNEL_ID) { - this.maxNumberOfMessages = maxNumberOfMessages; - this.channel = channel; - this.channelId = CHANNEL_ID; - } - - public boolean shouldMessageBeSplit(Class clazz) { - return this.messagesToSplit.contains(clazz); - } - - public void sendToPlayer(ServerPlayer player, Object message) { - if (this.id == 0) this.id++; // in case we wrapped around, 0 is reserved for server - int id = this.id++; - this.messageTargets.put(id, player); - this.sendPacket(message, id, PacketDistributor.PLAYER.with(() -> player)); - } - - public void sendToServer(Object message) { - this.messageTargets.put(0, null); - this.sendPacket(message, 0, PacketDistributor.SERVER.noArg()); - } - - //@Volatile mostly copied from SimpleChannel - private void sendPacket(Object Message, int id, PacketDistributor.PacketTarget target) { - final FriendlyByteBuf bufIn = new FriendlyByteBuf(Unpooled.buffer()); - - //write the message id to be able to figure out where the packet is supposed to go in the wrapper - bufIn.writeInt(id); - - int index = this.channel.encodeMessage(Message, bufIn); - target.send(target.getDirection().buildPacket(Pair.of(bufIn, index), this.channelId).getThis()); - } - - public void registerMessage(int index, Class messageType, BiConsumer encoder, Function decoder, BiConsumer> messageConsumer) { - this.registerMessage(index, this.maxNumberOfMessages, messageType, encoder, decoder, messageConsumer); - } - - public void registerMessage(int index, int maxNumberOfMessages, Class messageType, BiConsumer encoder, Function decoder, BiConsumer> messageConsumer) { - this.packetMaximums.put(index, maxNumberOfMessages); - this.messagesToSplit.add(messageType); - - BiConsumer wrappedEncoder = (msg, buffer) -> { - int id = buffer.readInt(); - buffer.discardReadBytes(); - ServerPlayer player = this.messageTargets.get(id); - this.messageTargets.remove(id); - - //write a zero for the number of packets in case the packet does not need to be split - buffer.writeShort(0); - encoder.accept(msg, buffer); - this.createSplittingConsumer(player).accept(msg, buffer); - }; - - this.channel.registerMessage(index, messageType, wrappedEncoder, this.createPacketCombiner().andThen(decoder), messageConsumer); - } - - private BiConsumer createSplittingConsumer(ServerPlayer playerEntity) { - return (MSG, buf) -> { - - if (buf.writerIndex() < MAX_PACKET_SIZE) { - return; - } - - //read packetId for this packet - int packetId = buf.readUnsignedByte(); - - //this short is written here in case we are not splitting, ignore for split packages - buf.readShort(); - - //ignore the above as it is not required for the final packet - int currentIndex = buf.readerIndex(); - int packetIndex = 0; - final int comId = this.comId++; - - //Data for this packet - byte[] packetData = new byte[0]; - - int maximumPackets = this.packetMaximums.get(packetId); - int expectedPackets = buf.writerIndex() / MAX_PACKET_SIZE + 1; - boolean failure = false; - - //Loop while data is available. - while (currentIndex < buf.writerIndex()) { - - int sliceSize = Math.min(MAX_PACKET_SIZE, buf.writerIndex() - currentIndex); - - //Extract the sub data array. - byte[] subPacketData = Arrays.copyOfRange(buf.array(), currentIndex, currentIndex + sliceSize); - - if (packetIndex == 0) { // Assign Data for first Packet to this packet. - packetData = subPacketData; - packetIndex++; - } else { - //Construct the split packet. - var splitPacketMessage = new MessageSplitPacket(comId, packetIndex++, subPacketData); - - if (playerEntity == null) { - this.channel.send(PacketDistributor.SERVER.noArg(), splitPacketMessage); - } else { - this.channel.send(PacketDistributor.PLAYER.with(() -> playerEntity), splitPacketMessage); - } - } - - //Move our working index. - currentIndex += sliceSize; - - if (packetIndex > maximumPackets) { - LogManager.getLogger().error("Failure Splitting Packets on Channel \"" + this.channelId + "\"." + " with " + MSG.getClass() + ". " + - " Number of Packets sent " + (packetIndex - 1) + ", expected number of Packets " + expectedPackets + ", maximum number of packets for a message of this type " + this.packetMaximums.get(packetId)); - failure = true; - break; - } - } - - //start writing at the beginning - buf.setIndex(0, 0); - - //packetId is required for forge to match the packet - buf.writeByte(packetId); - - //number of packets the packet was split into - buf.writeShort(failure ? expectedPackets : packetIndex); - buf.writeInt(comId); - buf.writeByteArray(packetData); - - //copies the written data into a new buffer discarding the old one - buf.capacity(buf.writerIndex()); - }; - } - - private Function createPacketCombiner() { - return (buf) -> { - int size = buf.readShort(); - - //This packet was not split - if (size < 2) return buf; - - int comId = buf.readInt(); - - Map partsMap = PACKAGE_CACHE.get(comId); - if (partsMap == null || partsMap.size() != size - 1) { - int partSize = partsMap == null ? 0 : partsMap.size(); - int id = buf.readUnsignedByte(); - int max = this.packetMaximums.get(id) == null ? 0 : this.packetMaximums.get(id); - throw new PacketSplittingException(this.channelId, partSize, size, max, id); - } - - //Add data that came from this packet - this.addPackagePart(comId, 0, buf.readByteArray()); - - //Combine Cached Data - final byte[] packetData = partsMap.entrySet() - .stream() - .sorted(Map.Entry.comparingByKey()) - .map(Map.Entry::getValue) - .reduce(new byte[0], Bytes::concat); - - FriendlyByteBuf buffer = new FriendlyByteBuf(Unpooled.wrappedBuffer(packetData)); - - //remove data from cache - PACKAGE_CACHE.remove(comId); - return buffer; - }; - } - - public void addPackagePart(int communicationId, int packetIndex, byte[] payload) { - //Sync on the message cache since this is still on the Netty thread. - synchronized (PacketSplitter.PACKAGE_CACHE) { - PacketSplitter.PACKAGE_CACHE.computeIfAbsent(communicationId, (id) -> new ConcurrentHashMap<>()); - PacketSplitter.PACKAGE_CACHE.get(communicationId).put(packetIndex, payload); - } - } -} - -class PacketSplittingException extends RuntimeException { - ResourceLocation channnelId; - int actualSize; - int expectedSize; - int maximumSize; - int packetId; - - public PacketSplittingException(ResourceLocation channnelId, int actualSize, int expectedSize, int maximumSize, int packetId) { - this.channnelId = channnelId; - this.actualSize = actualSize; - this.expectedSize = expectedSize; - this.maximumSize = maximumSize; - this.packetId = packetId; - } - - @Override - public String getMessage() { - return "Failure Splitting Packets on Channel \"" + this.channnelId.toString() + "\"." + - " Number of Packets sent " + this.actualSize + ", Number of Packets expected " + this.expectedSize + ", maximum number of packets for a message of this type " + this.maximumSize; - } - -} \ No newline at end of file diff --git a/src/main/java/com/klikli_dev/occultism/network/MessageBeholderAttack.java b/src/main/java/com/klikli_dev/occultism/network/messages/MessageBeholderAttack.java similarity index 85% rename from src/main/java/com/klikli_dev/occultism/network/MessageBeholderAttack.java rename to src/main/java/com/klikli_dev/occultism/network/messages/MessageBeholderAttack.java index 619ed8dc7..e650676d5 100644 --- a/src/main/java/com/klikli_dev/occultism/network/MessageBeholderAttack.java +++ b/src/main/java/com/klikli_dev/occultism/network/messages/MessageBeholderAttack.java @@ -20,19 +20,23 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package com.klikli_dev.occultism.network; +package com.klikli_dev.occultism.network.messages; +import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.common.entity.familiar.BeholderFamiliarEntity; +import com.klikli_dev.occultism.network.IMessage; import net.minecraft.client.Minecraft; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; -import net.minecraftforge.network.NetworkEvent.Context; import java.util.ArrayList; import java.util.List; -public class MessageBeholderAttack extends MessageBase { +public class MessageBeholderAttack implements IMessage { + + public static final ResourceLocation ID = new ResourceLocation(Occultism.MODID, "beholder_attack"); private int beholderId; private List targetIds; @@ -64,10 +68,14 @@ public void decode(FriendlyByteBuf buf) { } @Override - public void onClientReceived(Minecraft minecraft, Player player, Context context) { + public void onClientReceived(Minecraft minecraft, Player player) { Entity entity = minecraft.level.getEntity(this.beholderId); if (entity instanceof BeholderFamiliarEntity beholder) beholder.shootRay(this.targetIds); } + @Override + public ResourceLocation id() { + return ID; + } } diff --git a/src/main/java/com/klikli_dev/occultism/network/MessageClearCraftingMatrix.java b/src/main/java/com/klikli_dev/occultism/network/messages/MessageClearCraftingMatrix.java similarity index 78% rename from src/main/java/com/klikli_dev/occultism/network/MessageClearCraftingMatrix.java rename to src/main/java/com/klikli_dev/occultism/network/messages/MessageClearCraftingMatrix.java index 85ded6e95..037e1130a 100644 --- a/src/main/java/com/klikli_dev/occultism/network/MessageClearCraftingMatrix.java +++ b/src/main/java/com/klikli_dev/occultism/network/messages/MessageClearCraftingMatrix.java @@ -20,15 +20,19 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package com.klikli_dev.occultism.network; +package com.klikli_dev.occultism.network.messages; +import com.klikli_dev.occultism.Occultism; +import com.klikli_dev.occultism.network.IMessage; import com.klikli_dev.occultism.util.StorageUtil; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.resources.ResourceLocation; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; -import net.minecraftforge.network.NetworkEvent; -public class MessageClearCraftingMatrix extends MessageBase { +public class MessageClearCraftingMatrix implements IMessage { + + public static final ResourceLocation ID = new ResourceLocation(Occultism.MODID, "clear_crafting_matrix"); public MessageClearCraftingMatrix() { @@ -39,8 +43,7 @@ public MessageClearCraftingMatrix(FriendlyByteBuf buf) { } @Override - public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player, - NetworkEvent.Context context) { + public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player) { StorageUtil.clearOpenCraftingMatrix(player, true); } @@ -54,4 +57,8 @@ public void decode(FriendlyByteBuf buf) { } + @Override + public ResourceLocation id() { + return ID; + } } diff --git a/src/main/java/com/klikli_dev/occultism/network/MessageDoubleJump.java b/src/main/java/com/klikli_dev/occultism/network/messages/MessageDoubleJump.java similarity index 81% rename from src/main/java/com/klikli_dev/occultism/network/MessageDoubleJump.java rename to src/main/java/com/klikli_dev/occultism/network/messages/MessageDoubleJump.java index 448530a02..316aa6fea 100644 --- a/src/main/java/com/klikli_dev/occultism/network/MessageDoubleJump.java +++ b/src/main/java/com/klikli_dev/occultism/network/messages/MessageDoubleJump.java @@ -20,16 +20,20 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package com.klikli_dev.occultism.network; +package com.klikli_dev.occultism.network.messages; +import com.klikli_dev.occultism.Occultism; +import com.klikli_dev.occultism.network.IMessage; import com.klikli_dev.occultism.util.MovementUtil; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.resources.ResourceLocation; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; -import net.minecraftforge.network.NetworkEvent; -public class MessageDoubleJump extends MessageBase { +public class MessageDoubleJump implements IMessage { + + public static final ResourceLocation ID = new ResourceLocation(Occultism.MODID, "double_jump"); public MessageDoubleJump() { @@ -40,8 +44,7 @@ public MessageDoubleJump(FriendlyByteBuf buf) { } @Override - public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player, - NetworkEvent.Context context) { + public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player) { if (MovementUtil.doubleJump(player)) { //Show cloud on jump. player.serverLevel() @@ -60,4 +63,8 @@ public void decode(FriendlyByteBuf buf) { } + @Override + public ResourceLocation id() { + return ID; + } } diff --git a/src/main/java/com/klikli_dev/occultism/network/MessageFairySupport.java b/src/main/java/com/klikli_dev/occultism/network/messages/MessageFairySupport.java similarity index 86% rename from src/main/java/com/klikli_dev/occultism/network/MessageFairySupport.java rename to src/main/java/com/klikli_dev/occultism/network/messages/MessageFairySupport.java index e8b174947..4344d9738 100644 --- a/src/main/java/com/klikli_dev/occultism/network/MessageFairySupport.java +++ b/src/main/java/com/klikli_dev/occultism/network/messages/MessageFairySupport.java @@ -20,19 +20,23 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package com.klikli_dev.occultism.network; +package com.klikli_dev.occultism.network.messages; +import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.common.entity.familiar.FairyFamiliarEntity; +import com.klikli_dev.occultism.network.IMessage; import net.minecraft.client.Minecraft; import net.minecraft.core.particles.DustParticleOptions; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.phys.Vec3; -import net.minecraftforge.network.NetworkEvent.Context; import org.joml.Vector3f; -public class MessageFairySupport extends MessageBase { +public class MessageFairySupport implements IMessage { + + public static final ResourceLocation ID = new ResourceLocation(Occultism.MODID, "fairy_support"); private int fairyId; private int targetId; @@ -59,7 +63,7 @@ public void decode(FriendlyByteBuf buf) { } @Override - public void onClientReceived(Minecraft minecraft, Player player, Context context) { + public void onClientReceived(Minecraft minecraft, Player player) { Entity fairy = minecraft.level.getEntity(this.fairyId); if (fairy instanceof FairyFamiliarEntity) ((FairyFamiliarEntity) fairy).startSupportAnimation(); @@ -72,4 +76,9 @@ public void onClientReceived(Minecraft minecraft, Player player, Context context } } } + + @Override + public ResourceLocation id() { + return ID; + } } diff --git a/src/main/java/com/klikli_dev/occultism/network/MessageHeadlessDie.java b/src/main/java/com/klikli_dev/occultism/network/messages/MessageHeadlessDie.java similarity index 82% rename from src/main/java/com/klikli_dev/occultism/network/MessageHeadlessDie.java rename to src/main/java/com/klikli_dev/occultism/network/messages/MessageHeadlessDie.java index 03e308809..12d967a62 100644 --- a/src/main/java/com/klikli_dev/occultism/network/MessageHeadlessDie.java +++ b/src/main/java/com/klikli_dev/occultism/network/messages/MessageHeadlessDie.java @@ -20,16 +20,20 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package com.klikli_dev.occultism.network; +package com.klikli_dev.occultism.network.messages; +import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.common.entity.familiar.HeadlessFamiliarEntity; +import com.klikli_dev.occultism.network.IMessage; import net.minecraft.client.Minecraft; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; -import net.minecraftforge.network.NetworkEvent; -public class MessageHeadlessDie extends MessageBase { +public class MessageHeadlessDie implements IMessage { + + public static final ResourceLocation ID = new ResourceLocation(Occultism.MODID, "headless_die"); private int id; @@ -52,10 +56,14 @@ public void decode(FriendlyByteBuf buf) { } @Override - public void onClientReceived(Minecraft minecraft, Player player, NetworkEvent.Context context) { + public void onClientReceived(Minecraft minecraft, Player player) { Entity headless = minecraft.level.getEntity(this.id); if (headless instanceof HeadlessFamiliarEntity) ((HeadlessFamiliarEntity) headless).killHeadless(); } + @Override + public ResourceLocation id() { + return ID; + } } diff --git a/src/main/java/com/klikli_dev/occultism/network/MessageInsertMouseHeldItem.java b/src/main/java/com/klikli_dev/occultism/network/messages/MessageInsertMouseHeldItem.java similarity index 83% rename from src/main/java/com/klikli_dev/occultism/network/MessageInsertMouseHeldItem.java rename to src/main/java/com/klikli_dev/occultism/network/messages/MessageInsertMouseHeldItem.java index e3a7d908f..24082565d 100644 --- a/src/main/java/com/klikli_dev/occultism/network/MessageInsertMouseHeldItem.java +++ b/src/main/java/com/klikli_dev/occultism/network/messages/MessageInsertMouseHeldItem.java @@ -20,22 +20,27 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package com.klikli_dev.occultism.network; +package com.klikli_dev.occultism.network.messages; +import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.api.common.blockentity.IStorageController; import com.klikli_dev.occultism.api.common.container.IStorageControllerContainer; +import com.klikli_dev.occultism.network.IMessage; +import com.klikli_dev.occultism.network.Networking; import com.klikli_dev.occultism.util.InputUtil; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.resources.ResourceLocation; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.items.ItemHandlerHelper; -import net.minecraftforge.network.NetworkEvent; +import net.neoforged.neoforge.items.ItemHandlerHelper; /** * Inserts the mouse held item into the opened storage controller. */ -public class MessageInsertMouseHeldItem extends MessageBase { +public class MessageInsertMouseHeldItem implements IMessage { + + public static final ResourceLocation ID = new ResourceLocation(Occultism.MODID, "insert_mouse_held_item"); private int mouseButton; @@ -48,8 +53,7 @@ public MessageInsertMouseHeldItem(int mouseButton) { } @Override - public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player, - NetworkEvent.Context context) { + public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player) { if (player.containerMenu instanceof IStorageControllerContainer) { IStorageController storageController = ((IStorageControllerContainer) player.containerMenu) .getStorageController(); @@ -79,10 +83,10 @@ public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer playe //store result mouse held item player.containerMenu.setCarried(result); //send new mouse held item to client - OccultismPackets.sendTo(player, new MessageUpdateMouseHeldItem(result)); + Networking.sendTo(player, new MessageUpdateMouseHeldItem(result)); //update the storage controller - OccultismPackets.sendTo(player, storageController.getMessageUpdateStacks()); + Networking.sendTo(player, storageController.getMessageUpdateStacks()); player.containerMenu.broadcastChanges(); } } @@ -97,4 +101,8 @@ public void decode(FriendlyByteBuf buf) { this.mouseButton = buf.readInt(); } + @Override + public ResourceLocation id() { + return ID; + } } diff --git a/src/main/java/com/klikli_dev/occultism/network/MessageOpenSatchel.java b/src/main/java/com/klikli_dev/occultism/network/messages/MessageOpenSatchel.java similarity index 86% rename from src/main/java/com/klikli_dev/occultism/network/MessageOpenSatchel.java rename to src/main/java/com/klikli_dev/occultism/network/messages/MessageOpenSatchel.java index a45bdf677..cdb4bcc5c 100644 --- a/src/main/java/com/klikli_dev/occultism/network/MessageOpenSatchel.java +++ b/src/main/java/com/klikli_dev/occultism/network/messages/MessageOpenSatchel.java @@ -20,20 +20,23 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package com.klikli_dev.occultism.network; +package com.klikli_dev.occultism.network.messages; +import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.common.container.storage.SatchelContainer; import com.klikli_dev.occultism.common.item.storage.SatchelItem; +import com.klikli_dev.occultism.network.IMessage; import com.klikli_dev.occultism.util.CuriosUtil; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.resources.ResourceLocation; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.SimpleMenuProvider; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.network.NetworkEvent; -import net.minecraftforge.network.NetworkHooks; -public class MessageOpenSatchel extends MessageBase { +public class MessageOpenSatchel implements IMessage { + + public static final ResourceLocation ID = new ResourceLocation(Occultism.MODID, "open_satchel"); public MessageOpenSatchel(FriendlyByteBuf buf) { this.decode(buf); @@ -44,8 +47,7 @@ public MessageOpenSatchel() { } @Override - public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player, - NetworkEvent.Context context) { + public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player) { int selectedSlot = -1; //first attempt to get backpack from curios slot @@ -60,7 +62,7 @@ public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer playe if (backpackStack.getItem() instanceof SatchelItem) { ItemStack finalBackpackStack = backpackStack; int finalSelectedSlot = selectedSlot; - NetworkHooks.openScreen(player, + player.openMenu( new SimpleMenuProvider((id, playerInventory, unused) -> { return new SatchelContainer(id, playerInventory, ((SatchelItem) finalBackpackStack.getItem()).getInventory(player, finalBackpackStack), @@ -81,4 +83,8 @@ public void decode(FriendlyByteBuf buf) { } + @Override + public ResourceLocation id() { + return ID; + } } diff --git a/src/main/java/com/klikli_dev/occultism/network/MessageOpenStorageRemote.java b/src/main/java/com/klikli_dev/occultism/network/messages/MessageOpenStorageRemote.java similarity index 81% rename from src/main/java/com/klikli_dev/occultism/network/MessageOpenStorageRemote.java rename to src/main/java/com/klikli_dev/occultism/network/messages/MessageOpenStorageRemote.java index de9231c2d..36bb509f7 100644 --- a/src/main/java/com/klikli_dev/occultism/network/MessageOpenStorageRemote.java +++ b/src/main/java/com/klikli_dev/occultism/network/messages/MessageOpenStorageRemote.java @@ -20,20 +20,23 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package com.klikli_dev.occultism.network; +package com.klikli_dev.occultism.network.messages; +import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.api.common.blockentity.IStorageController; import com.klikli_dev.occultism.api.common.data.GlobalBlockPos; +import com.klikli_dev.occultism.network.IMessage; import com.klikli_dev.occultism.registry.OccultismItems; import com.klikli_dev.occultism.util.CuriosUtil; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.resources.ResourceLocation; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.level.Level; -import net.minecraftforge.network.NetworkEvent; -import net.minecraftforge.network.NetworkHooks; -public class MessageOpenStorageRemote extends MessageBase { +public class MessageOpenStorageRemote implements IMessage { + + public static final ResourceLocation ID = new ResourceLocation(Occultism.MODID, "open_storage_remote"); public MessageOpenStorageRemote(FriendlyByteBuf buf) { this.decode(buf); @@ -44,8 +47,7 @@ public MessageOpenStorageRemote() { } @Override - public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player, - NetworkEvent.Context context) { + public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player) { CuriosUtil.SelectedCurio selectedCurio = CuriosUtil.getStorageRemote(player); if (selectedCurio != null) { @@ -56,7 +58,7 @@ public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer playe selectedCurio.itemStack.getTag().getCompound("linkedStorageController")); Level storageControllerWorld = minecraftServer.getLevel(storageControllerPos.getDimensionKey()); if (storageControllerWorld.getBlockEntity(storageControllerPos.getPos()) instanceof IStorageController) { - NetworkHooks.openScreen(player, OccultismItems.STORAGE_REMOTE.get(), buffer -> buffer.writeVarInt(selectedCurio.selectedSlot)); + player.openMenu(OccultismItems.STORAGE_REMOTE.get(), buffer -> buffer.writeVarInt(selectedCurio.selectedSlot)); } } } @@ -70,4 +72,9 @@ public void encode(FriendlyByteBuf buf) { public void decode(FriendlyByteBuf buf) { } + + @Override + public ResourceLocation id() { + return ID; + } } diff --git a/src/main/java/com/klikli_dev/occultism/network/MessageRequestOrder.java b/src/main/java/com/klikli_dev/occultism/network/messages/MessageRequestOrder.java similarity index 90% rename from src/main/java/com/klikli_dev/occultism/network/MessageRequestOrder.java rename to src/main/java/com/klikli_dev/occultism/network/messages/MessageRequestOrder.java index 49362cca3..3fae0f1e5 100644 --- a/src/main/java/com/klikli_dev/occultism/network/MessageRequestOrder.java +++ b/src/main/java/com/klikli_dev/occultism/network/messages/MessageRequestOrder.java @@ -20,26 +20,29 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package com.klikli_dev.occultism.network; +package com.klikli_dev.occultism.network.messages; import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.api.common.blockentity.IStorageController; import com.klikli_dev.occultism.api.common.data.GlobalBlockPos; import com.klikli_dev.occultism.common.misc.ItemStackComparator; +import com.klikli_dev.occultism.network.IMessage; import com.klikli_dev.occultism.util.StorageUtil; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraftforge.network.NetworkEvent; /** * This message requests a work order to be executed on a storage controller */ -public class MessageRequestOrder extends MessageBase { +public class MessageRequestOrder implements IMessage { + + public static final ResourceLocation ID = new ResourceLocation(Occultism.MODID, "request_order"); private GlobalBlockPos storageControllerPosition; private GlobalBlockPos targetMachinePosition; @@ -57,8 +60,7 @@ public MessageRequestOrder(GlobalBlockPos storageControllerPosition, GlobalBlock } @Override - public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player, - NetworkEvent.Context context) { + public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player) { Level level = minecraftServer.getLevel(this.storageControllerPosition.getDimensionKey()); //prevent block loading by message @@ -94,4 +96,9 @@ public void decode(FriendlyByteBuf buf) { this.stack = buf.readItem(); } + @Override + public ResourceLocation id() { + return ID; + } + } diff --git a/src/main/java/com/klikli_dev/occultism/network/MessageRequestStacks.java b/src/main/java/com/klikli_dev/occultism/network/messages/MessageRequestStacks.java similarity index 78% rename from src/main/java/com/klikli_dev/occultism/network/MessageRequestStacks.java rename to src/main/java/com/klikli_dev/occultism/network/messages/MessageRequestStacks.java index 6a0172426..5475fcb7e 100644 --- a/src/main/java/com/klikli_dev/occultism/network/MessageRequestStacks.java +++ b/src/main/java/com/klikli_dev/occultism/network/messages/MessageRequestStacks.java @@ -20,17 +20,22 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package com.klikli_dev.occultism.network; +package com.klikli_dev.occultism.network.messages; +import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.api.common.blockentity.IStorageController; import com.klikli_dev.occultism.api.common.container.IStorageControllerContainer; +import com.klikli_dev.occultism.network.IMessage; +import com.klikli_dev.occultism.network.Networking; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.resources.ResourceLocation; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; -import net.minecraftforge.network.NetworkEvent; -public class MessageRequestStacks extends MessageBase { +public class MessageRequestStacks implements IMessage { + + public static final ResourceLocation ID = new ResourceLocation(Occultism.MODID, "request_stacks"); public MessageRequestStacks() { @@ -41,14 +46,13 @@ public MessageRequestStacks(FriendlyByteBuf buf) { } @Override - public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player, - NetworkEvent.Context context) { + public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player) { if (player.containerMenu instanceof IStorageControllerContainer) { IStorageController storageController = ((IStorageControllerContainer) player.containerMenu) .getStorageController(); if (storageController != null) { - OccultismPackets.sendTo(player, storageController.getMessageUpdateStacks()); - OccultismPackets + Networking.sendTo(player, storageController.getMessageUpdateStacks()); + Networking .sendTo(player, new MessageUpdateLinkedMachines(storageController.getLinkedMachines())); player.containerMenu.broadcastChanges(); } @@ -65,4 +69,8 @@ public void decode(FriendlyByteBuf buf) { } + @Override + public ResourceLocation id() { + return ID; + } } diff --git a/src/main/java/com/klikli_dev/occultism/network/MessageSelectBlock.java b/src/main/java/com/klikli_dev/occultism/network/messages/MessageSelectBlock.java similarity index 86% rename from src/main/java/com/klikli_dev/occultism/network/MessageSelectBlock.java rename to src/main/java/com/klikli_dev/occultism/network/messages/MessageSelectBlock.java index 0b2fc9131..d2620af7a 100644 --- a/src/main/java/com/klikli_dev/occultism/network/MessageSelectBlock.java +++ b/src/main/java/com/klikli_dev/occultism/network/messages/MessageSelectBlock.java @@ -20,19 +20,21 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package com.klikli_dev.occultism.network; +package com.klikli_dev.occultism.network.messages; import com.klikli_dev.occultism.Occultism; +import com.klikli_dev.occultism.network.IMessage; import net.minecraft.client.Minecraft; import net.minecraft.core.BlockPos; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Player; -import net.minecraftforge.network.NetworkEvent; import java.awt.*; -public class MessageSelectBlock extends MessageBase { +public class MessageSelectBlock implements IMessage { + public static final ResourceLocation ID = new ResourceLocation(Occultism.MODID, "select_block"); public BlockPos blockPos; public int durationMilliseconds; public int color; @@ -48,7 +50,7 @@ public MessageSelectBlock(BlockPos blockPos, int durationMilliseconds, int color } @Override - public void onClientReceived(Minecraft minecraft, Player player, NetworkEvent.Context context) { + public void onClientReceived(Minecraft minecraft, Player player) { Color color = new Color(this.color); Occultism.SELECTED_BLOCK_RENDERER.selectBlock(this.blockPos, System.currentTimeMillis() + this.durationMilliseconds, color); } @@ -67,4 +69,8 @@ public void decode(FriendlyByteBuf buf) { this.color = buf.readInt(); } + @Override + public ResourceLocation id() { + return ID; + } } diff --git a/src/main/java/com/klikli_dev/occultism/network/MessageSetDivinationResult.java b/src/main/java/com/klikli_dev/occultism/network/messages/MessageSetDivinationResult.java similarity index 85% rename from src/main/java/com/klikli_dev/occultism/network/MessageSetDivinationResult.java rename to src/main/java/com/klikli_dev/occultism/network/messages/MessageSetDivinationResult.java index 80e4f3885..5227cf76b 100644 --- a/src/main/java/com/klikli_dev/occultism/network/MessageSetDivinationResult.java +++ b/src/main/java/com/klikli_dev/occultism/network/messages/MessageSetDivinationResult.java @@ -20,19 +20,23 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package com.klikli_dev.occultism.network; +package com.klikli_dev.occultism.network.messages; +import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.OccultismConstants; import com.klikli_dev.occultism.common.item.tool.DivinationRodItem; +import com.klikli_dev.occultism.network.IMessage; import net.minecraft.core.BlockPos; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.resources.ResourceLocation; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.InteractionHand; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.network.NetworkEvent; -public class MessageSetDivinationResult extends MessageBase { +public class MessageSetDivinationResult implements IMessage { + + public static final ResourceLocation ID = new ResourceLocation(Occultism.MODID, "set_divination_result"); public BlockPos pos; public byte distance; @@ -48,8 +52,7 @@ public MessageSetDivinationResult(BlockPos pos, float distance) { @Override - public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player, - NetworkEvent.Context context) { + public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player) { ItemStack stack = player.getItemInHand(InteractionHand.MAIN_HAND); if (stack.getItem() instanceof DivinationRodItem) { var tag = stack.getOrCreateTag(); @@ -78,4 +81,8 @@ public void decode(FriendlyByteBuf buf) { this.distance = buf.readByte(); } + @Override + public ResourceLocation id() { + return ID; + } } diff --git a/src/main/java/com/klikli_dev/occultism/network/MessageSetFilterMode.java b/src/main/java/com/klikli_dev/occultism/network/messages/MessageSetFilterMode.java similarity index 83% rename from src/main/java/com/klikli_dev/occultism/network/MessageSetFilterMode.java rename to src/main/java/com/klikli_dev/occultism/network/messages/MessageSetFilterMode.java index 271d2b655..0bda57ace 100644 --- a/src/main/java/com/klikli_dev/occultism/network/MessageSetFilterMode.java +++ b/src/main/java/com/klikli_dev/occultism/network/messages/MessageSetFilterMode.java @@ -20,17 +20,20 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package com.klikli_dev.occultism.network; +package com.klikli_dev.occultism.network.messages; +import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.common.entity.spirit.SpiritEntity; +import com.klikli_dev.occultism.network.IMessage; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.resources.ResourceLocation; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.Entity; -import net.minecraftforge.network.NetworkEvent; -public class MessageSetFilterMode extends MessageBase { +public class MessageSetFilterMode implements IMessage { + public static final ResourceLocation ID = new ResourceLocation(Occultism.MODID, "set_filter_mode"); public boolean isBlacklistFilter; public int entityId; @@ -44,8 +47,7 @@ public MessageSetFilterMode(boolean isBlacklistFilter, int entityId) { } @Override - public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player, - NetworkEvent.Context context) { + public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player) { Entity e = player.level().getEntity(this.entityId); if (e instanceof SpiritEntity spirit) { @@ -65,4 +67,8 @@ public void decode(FriendlyByteBuf buf) { this.entityId = buf.readInt(); } + @Override + public ResourceLocation id() { + return ID; + } } diff --git a/src/main/java/com/klikli_dev/occultism/network/MessageSetItemMode.java b/src/main/java/com/klikli_dev/occultism/network/messages/MessageSetItemMode.java similarity index 82% rename from src/main/java/com/klikli_dev/occultism/network/MessageSetItemMode.java rename to src/main/java/com/klikli_dev/occultism/network/messages/MessageSetItemMode.java index 137d55418..d9bf403b5 100644 --- a/src/main/java/com/klikli_dev/occultism/network/MessageSetItemMode.java +++ b/src/main/java/com/klikli_dev/occultism/network/messages/MessageSetItemMode.java @@ -20,18 +20,20 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package com.klikli_dev.occultism.network; +package com.klikli_dev.occultism.network.messages; +import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.api.common.item.IHandleItemMode; +import com.klikli_dev.occultism.network.IMessage; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.resources.ResourceLocation; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.InteractionHand; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.network.NetworkEvent; - -public class MessageSetItemMode extends MessageBase { +public class MessageSetItemMode implements IMessage { + public static final ResourceLocation ID = new ResourceLocation(Occultism.MODID, "set_item_mode"); public int mode; public MessageSetItemMode(FriendlyByteBuf buf) { @@ -43,8 +45,7 @@ public MessageSetItemMode(int mode) { } @Override - public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player, - NetworkEvent.Context context) { + public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player) { ItemStack stack = player.getItemInHand(InteractionHand.MAIN_HAND); if (stack.getItem() instanceof IHandleItemMode itemModeHandler) { itemModeHandler.setItemMode(stack, this.mode); @@ -62,4 +63,8 @@ public void decode(FriendlyByteBuf buf) { this.mode = buf.readInt(); } + @Override + public ResourceLocation id() { + return ID; + } } diff --git a/src/main/java/com/klikli_dev/occultism/network/MessageSetJumps.java b/src/main/java/com/klikli_dev/occultism/network/messages/MessageSetJumps.java similarity index 76% rename from src/main/java/com/klikli_dev/occultism/network/MessageSetJumps.java rename to src/main/java/com/klikli_dev/occultism/network/messages/MessageSetJumps.java index 15a73fe8e..88cddcf3d 100644 --- a/src/main/java/com/klikli_dev/occultism/network/MessageSetJumps.java +++ b/src/main/java/com/klikli_dev/occultism/network/messages/MessageSetJumps.java @@ -20,16 +20,18 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package com.klikli_dev.occultism.network; +package com.klikli_dev.occultism.network.messages; -import com.klikli_dev.occultism.registry.OccultismCapabilities; +import com.klikli_dev.occultism.Occultism; +import com.klikli_dev.occultism.network.IMessage; +import com.klikli_dev.occultism.registry.OccultismDataStorage; import net.minecraft.client.Minecraft; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Player; -import net.minecraftforge.network.NetworkEvent; - -public class MessageSetJumps extends MessageBase { +public class MessageSetJumps implements IMessage { + public static final ResourceLocation ID = new ResourceLocation(Occultism.MODID, "set_jumps"); public int jumps; public MessageSetJumps(FriendlyByteBuf buf) { @@ -41,9 +43,9 @@ public MessageSetJumps(int jumps) { } @Override - public void onClientReceived(Minecraft minecraft, Player player, NetworkEvent.Context context) { + public void onClientReceived(Minecraft minecraft, Player player) { if (!player.onGround()) { - player.getCapability(OccultismCapabilities.DOUBLE_JUMP).ifPresent(cap -> cap.setJumps(this.jumps)); + player.setData(OccultismDataStorage.DOUBLE_JUMP, this.jumps); } } @@ -57,4 +59,8 @@ public void decode(FriendlyByteBuf buf) { this.jumps = buf.readInt(); } + @Override + public ResourceLocation id() { + return ID; + } } diff --git a/src/main/java/com/klikli_dev/occultism/network/MessageSetManagedMachine.java b/src/main/java/com/klikli_dev/occultism/network/messages/MessageSetManagedMachine.java similarity index 87% rename from src/main/java/com/klikli_dev/occultism/network/MessageSetManagedMachine.java rename to src/main/java/com/klikli_dev/occultism/network/messages/MessageSetManagedMachine.java index c5912a987..8218327c9 100644 --- a/src/main/java/com/klikli_dev/occultism/network/MessageSetManagedMachine.java +++ b/src/main/java/com/klikli_dev/occultism/network/messages/MessageSetManagedMachine.java @@ -20,20 +20,23 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package com.klikli_dev.occultism.network; +package com.klikli_dev.occultism.network.messages; +import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.api.common.data.MachineReference; import com.klikli_dev.occultism.common.entity.job.ManageMachineJob; import com.klikli_dev.occultism.common.item.spirit.BookOfCallingItem; +import com.klikli_dev.occultism.network.IMessage; import com.klikli_dev.occultism.util.ItemNBTUtil; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.resources.ResourceLocation; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.InteractionHand; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.network.NetworkEvent; -public class MessageSetManagedMachine extends MessageBase { +public class MessageSetManagedMachine implements IMessage { + public static final ResourceLocation ID = new ResourceLocation(Occultism.MODID, "set_managed_machine"); public MachineReference managedMachine; @@ -46,8 +49,7 @@ public MessageSetManagedMachine(MachineReference managedMachine) { } @Override - public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player, - NetworkEvent.Context context) { + public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player) { ItemStack stack = player.getItemInHand(InteractionHand.MAIN_HAND); if (stack.getItem() instanceof BookOfCallingItem) { ItemNBTUtil.getSpiritEntity(stack).ifPresent(spirit -> { @@ -77,4 +79,8 @@ public void decode(FriendlyByteBuf buf) { this.managedMachine = MachineReference.from(buf); } + @Override + public ResourceLocation id() { + return ID; + } } diff --git a/src/main/java/com/klikli_dev/occultism/network/MessageSetRecipe.java b/src/main/java/com/klikli_dev/occultism/network/messages/MessageSetRecipe.java similarity index 88% rename from src/main/java/com/klikli_dev/occultism/network/MessageSetRecipe.java rename to src/main/java/com/klikli_dev/occultism/network/messages/MessageSetRecipe.java index 3683767c7..be71a8d54 100644 --- a/src/main/java/com/klikli_dev/occultism/network/MessageSetRecipe.java +++ b/src/main/java/com/klikli_dev/occultism/network/messages/MessageSetRecipe.java @@ -19,22 +19,25 @@ * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ -package com.klikli_dev.occultism.network; +package com.klikli_dev.occultism.network.messages; +import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.api.common.blockentity.IStorageController; import com.klikli_dev.occultism.api.common.container.IStorageControllerContainer; import com.klikli_dev.occultism.common.misc.ItemStackComparator; +import com.klikli_dev.occultism.network.IMessage; +import com.klikli_dev.occultism.network.Networking; import com.klikli_dev.occultism.util.StorageUtil; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.ListTag; import net.minecraft.nbt.Tag; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.resources.ResourceLocation; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.inventory.CraftingContainer; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.items.wrapper.PlayerMainInvWrapper; -import net.minecraftforge.network.NetworkEvent; +import net.neoforged.neoforge.items.wrapper.PlayerMainInvWrapper; import java.util.HashMap; import java.util.Map; @@ -42,8 +45,9 @@ /** * Based on https://github.com/Lothrazar/Storage-Network */ -public class MessageSetRecipe extends MessageBase { +public class MessageSetRecipe implements IMessage { + public static final ResourceLocation ID = new ResourceLocation(Occultism.MODID, "set_recipe"); private CompoundTag nbt; private int index = 0; @@ -56,8 +60,7 @@ public MessageSetRecipe(CompoundTag nbt) { } @Override - public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player, - NetworkEvent.Context context) { + public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player) { if (!(player.containerMenu instanceof IStorageControllerContainer container)) { return; } @@ -114,7 +117,7 @@ public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer playe //sync to client container.updateCraftingSlots(true); //finally update controller content for client - OccultismPackets.sendTo(player, storageController.getMessageUpdateStacks()); + Networking.sendTo(player, storageController.getMessageUpdateStacks()); } @Override @@ -129,4 +132,8 @@ public void decode(FriendlyByteBuf buf) { this.index = buf.readInt(); } + @Override + public ResourceLocation id() { + return ID; + } } diff --git a/src/main/java/com/klikli_dev/occultism/network/MessageSetRecipeByID.java b/src/main/java/com/klikli_dev/occultism/network/messages/MessageSetRecipeByID.java similarity index 88% rename from src/main/java/com/klikli_dev/occultism/network/MessageSetRecipeByID.java rename to src/main/java/com/klikli_dev/occultism/network/messages/MessageSetRecipeByID.java index 88170757e..f4f3b8f5d 100644 --- a/src/main/java/com/klikli_dev/occultism/network/MessageSetRecipeByID.java +++ b/src/main/java/com/klikli_dev/occultism/network/messages/MessageSetRecipeByID.java @@ -19,11 +19,13 @@ * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ -package com.klikli_dev.occultism.network; +package com.klikli_dev.occultism.network.messages; import com.google.common.base.Preconditions; import com.klikli_dev.occultism.api.common.blockentity.IStorageController; import com.klikli_dev.occultism.api.common.container.IStorageControllerContainer; +import com.klikli_dev.occultism.network.IMessage; +import com.klikli_dev.occultism.network.Networking; import com.klikli_dev.occultism.util.StorageUtil; import net.minecraft.core.NonNullList; import net.minecraft.network.FriendlyByteBuf; @@ -34,15 +36,15 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.Recipe; -import net.minecraftforge.common.crafting.IShapedRecipe; -import net.minecraftforge.items.wrapper.PlayerMainInvWrapper; -import net.minecraftforge.network.NetworkEvent; +import net.neoforged.neoforge.common.crafting.IShapedRecipe; +import net.neoforged.neoforge.items.wrapper.PlayerMainInvWrapper; /** * Based on https://github.com/Lothrazar/Storage-Network */ -public class MessageSetRecipeByID extends MessageBase { +public class MessageSetRecipeByID implements IMessage { + public static final ResourceLocation ID = new ResourceLocation("occultism", "set_recipe_by_id"); private ResourceLocation id; public MessageSetRecipeByID(FriendlyByteBuf buf) { @@ -54,8 +56,7 @@ public MessageSetRecipeByID(ResourceLocation id) { } @Override - public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player, - NetworkEvent.Context context) { + public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player) { if (!(player.containerMenu instanceof IStorageControllerContainer container)) { return; } @@ -64,12 +65,12 @@ public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer playe return; } - Recipe recipe = player.level().getRecipeManager().byKey(this.id).orElse(null); + var recipe = player.level().getRecipeManager().byKey(this.id).orElse(null); Preconditions.checkArgument(recipe != null); //should not happen StorageUtil.clearOpenCraftingMatrix(player, false); CraftingContainer craftMatrix = container.getCraftMatrix(); - NonNullList ingredients = this.getIngredientsForRecipe(recipe); + NonNullList ingredients = this.getIngredientsForRecipe(recipe.value()); for (int slot = 0; slot < 9; slot++) { Ingredient ingredient = ingredients.get(slot); @@ -95,7 +96,7 @@ public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer playe //sync to client container.updateCraftingSlots(true); //finally update controller content for client - OccultismPackets.sendTo(player, storageController.getMessageUpdateStacks()); + Networking.sendTo(player, storageController.getMessageUpdateStacks()); } @Override @@ -137,4 +138,8 @@ private NonNullList getIngredientsForRecipe(Recipe recipe) { return ingredientsMatrixGrid; } + @Override + public ResourceLocation id() { + return ID; + } } diff --git a/src/main/java/com/klikli_dev/occultism/network/MessageSetTagFilterText.java b/src/main/java/com/klikli_dev/occultism/network/messages/MessageSetTagFilterText.java similarity index 83% rename from src/main/java/com/klikli_dev/occultism/network/MessageSetTagFilterText.java rename to src/main/java/com/klikli_dev/occultism/network/messages/MessageSetTagFilterText.java index b609453da..01f648d3b 100644 --- a/src/main/java/com/klikli_dev/occultism/network/MessageSetTagFilterText.java +++ b/src/main/java/com/klikli_dev/occultism/network/messages/MessageSetTagFilterText.java @@ -20,16 +20,20 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package com.klikli_dev.occultism.network; +package com.klikli_dev.occultism.network.messages; +import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.common.entity.spirit.SpiritEntity; +import com.klikli_dev.occultism.network.IMessage; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.resources.ResourceLocation; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.Entity; -import net.minecraftforge.network.NetworkEvent; -public class MessageSetTagFilterText extends MessageBase { +public class MessageSetTagFilterText implements IMessage { + + public static final ResourceLocation ID = new ResourceLocation(Occultism.MODID, "set_tag_filter_text"); public String tagFilterText; public int entityId; @@ -44,8 +48,7 @@ public MessageSetTagFilterText(String tagFilterText, int entityId) { } @Override - public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player, - NetworkEvent.Context context) { + public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player) { Entity e = player.level().getEntity(this.entityId); if (e instanceof SpiritEntity spirit) { @@ -65,4 +68,8 @@ public void decode(FriendlyByteBuf buf) { this.entityId = buf.readInt(); } + @Override + public ResourceLocation id() { + return ID; + } } diff --git a/src/main/java/com/klikli_dev/occultism/network/MessageSetWorkAreaSize.java b/src/main/java/com/klikli_dev/occultism/network/messages/MessageSetWorkAreaSize.java similarity index 87% rename from src/main/java/com/klikli_dev/occultism/network/MessageSetWorkAreaSize.java rename to src/main/java/com/klikli_dev/occultism/network/messages/MessageSetWorkAreaSize.java index 4e7ccc43d..08aa79217 100644 --- a/src/main/java/com/klikli_dev/occultism/network/MessageSetWorkAreaSize.java +++ b/src/main/java/com/klikli_dev/occultism/network/messages/MessageSetWorkAreaSize.java @@ -20,24 +20,26 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package com.klikli_dev.occultism.network; +package com.klikli_dev.occultism.network.messages; +import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.TranslationKeys; import com.klikli_dev.occultism.api.common.data.WorkAreaSize; import com.klikli_dev.occultism.common.item.spirit.BookOfCallingItem; +import com.klikli_dev.occultism.network.IMessage; import com.klikli_dev.occultism.util.ItemNBTUtil; import com.klikli_dev.occultism.util.TextUtil; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; +import net.minecraft.resources.ResourceLocation; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.InteractionHand; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.network.NetworkEvent; - -public class MessageSetWorkAreaSize extends MessageBase { +public class MessageSetWorkAreaSize implements IMessage { + public static final ResourceLocation ID = new ResourceLocation(Occultism.MODID, "set_work_area_size"); public int workAreaSize; public MessageSetWorkAreaSize(FriendlyByteBuf buf) { @@ -49,8 +51,7 @@ public MessageSetWorkAreaSize(int workAreaSize) { } @Override - public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player, - NetworkEvent.Context context) { + public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player) { ItemStack stack = player.getItemInHand(InteractionHand.MAIN_HAND); if (stack.getItem() instanceof BookOfCallingItem) { ItemNBTUtil.getSpiritEntity(stack).ifPresent(spirit -> { @@ -80,4 +81,8 @@ public void decode(FriendlyByteBuf buf) { this.workAreaSize = buf.readInt(); } + @Override + public ResourceLocation id() { + return ID; + } } diff --git a/src/main/java/com/klikli_dev/occultism/network/MessageSortItems.java b/src/main/java/com/klikli_dev/occultism/network/messages/MessageSortItems.java similarity index 89% rename from src/main/java/com/klikli_dev/occultism/network/MessageSortItems.java rename to src/main/java/com/klikli_dev/occultism/network/messages/MessageSortItems.java index a5c609605..fe94185b5 100644 --- a/src/main/java/com/klikli_dev/occultism/network/MessageSortItems.java +++ b/src/main/java/com/klikli_dev/occultism/network/messages/MessageSortItems.java @@ -20,22 +20,24 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package com.klikli_dev.occultism.network; +package com.klikli_dev.occultism.network.messages; +import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.api.common.blockentity.IStorageAccessor; import com.klikli_dev.occultism.api.common.container.IStorageControllerContainer; import com.klikli_dev.occultism.api.common.data.SortDirection; import com.klikli_dev.occultism.api.common.data.SortType; +import com.klikli_dev.occultism.network.IMessage; import net.minecraft.core.BlockPos; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.resources.ResourceLocation; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraftforge.network.NetworkEvent; - -public class MessageSortItems extends MessageBase { +public class MessageSortItems implements IMessage { + public static final ResourceLocation ID = new ResourceLocation(Occultism.MODID, "sort_items"); private BlockPos entityPosition; private SortDirection sortDirection; private SortType sortType; @@ -51,8 +53,7 @@ public MessageSortItems(BlockPos entityPosition, SortDirection sortDirection, So } @Override - public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player, - NetworkEvent.Context context) { + public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player) { if (player.containerMenu instanceof IStorageControllerContainer) { if (!((IStorageControllerContainer) player.containerMenu).isContainerItem()) { @@ -89,4 +90,8 @@ public void decode(FriendlyByteBuf byteBuf) { this.sortType = SortType.get(byteBuf.readByte()); } + @Override + public ResourceLocation id() { + return ID; + } } diff --git a/src/main/java/com/klikli_dev/occultism/network/MessageSyncFamiliarSettings.java b/src/main/java/com/klikli_dev/occultism/network/messages/MessageSyncFamiliarSettings.java similarity index 73% rename from src/main/java/com/klikli_dev/occultism/network/MessageSyncFamiliarSettings.java rename to src/main/java/com/klikli_dev/occultism/network/messages/MessageSyncFamiliarSettings.java index cd1692fff..5224b85d7 100644 --- a/src/main/java/com/klikli_dev/occultism/network/MessageSyncFamiliarSettings.java +++ b/src/main/java/com/klikli_dev/occultism/network/messages/MessageSyncFamiliarSettings.java @@ -20,17 +20,20 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package com.klikli_dev.occultism.network; +package com.klikli_dev.occultism.network.messages; -import com.klikli_dev.occultism.common.capability.FamiliarSettingsCapability; -import com.klikli_dev.occultism.registry.OccultismCapabilities; +import com.klikli_dev.occultism.Occultism; +import com.klikli_dev.occultism.common.capability.FamiliarSettingsData; +import com.klikli_dev.occultism.network.IMessage; +import com.klikli_dev.occultism.registry.OccultismDataStorage; import net.minecraft.client.Minecraft; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Player; -import net.minecraftforge.network.NetworkEvent; -public class MessageSyncFamiliarSettings extends MessageBase { +public class MessageSyncFamiliarSettings implements IMessage { + public static final ResourceLocation ID = new ResourceLocation(Occultism.MODID, "sync_familiar_settings"); public CompoundTag tag; @@ -38,15 +41,13 @@ public MessageSyncFamiliarSettings(FriendlyByteBuf buf) { this.decode(buf); } - public MessageSyncFamiliarSettings(FamiliarSettingsCapability cap) { + public MessageSyncFamiliarSettings(FamiliarSettingsData cap) { this.tag = cap.serializeNBT(); } @Override - public void onClientReceived(Minecraft minecraft, Player player, NetworkEvent.Context context) { - player.getCapability(OccultismCapabilities.FAMILIAR_SETTINGS).ifPresent(capability -> { - capability.deserializeNBT(this.tag); - }); + public void onClientReceived(Minecraft minecraft, Player player) { + player.getData(OccultismDataStorage.FAMILIAR_SETTINGS).deserializeNBT(this.tag); } @Override @@ -58,4 +59,9 @@ public void encode(FriendlyByteBuf byteBuf) { public void decode(FriendlyByteBuf byteBuf) { this.tag = byteBuf.readNbt(); } + + @Override + public ResourceLocation id() { + return ID; + } } diff --git a/src/main/java/com/klikli_dev/occultism/network/MessageTakeItem.java b/src/main/java/com/klikli_dev/occultism/network/messages/MessageTakeItem.java similarity index 87% rename from src/main/java/com/klikli_dev/occultism/network/MessageTakeItem.java rename to src/main/java/com/klikli_dev/occultism/network/messages/MessageTakeItem.java index cfdff3357..bbeda85a7 100644 --- a/src/main/java/com/klikli_dev/occultism/network/MessageTakeItem.java +++ b/src/main/java/com/klikli_dev/occultism/network/messages/MessageTakeItem.java @@ -20,24 +20,29 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package com.klikli_dev.occultism.network; +package com.klikli_dev.occultism.network.messages; +import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.api.common.blockentity.IStorageController; import com.klikli_dev.occultism.api.common.container.IStorageControllerContainer; import com.klikli_dev.occultism.common.misc.ItemStackComparator; +import com.klikli_dev.occultism.network.IMessage; +import com.klikli_dev.occultism.network.Networking; import com.klikli_dev.occultism.util.InputUtil; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.resources.ResourceLocation; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.items.ItemHandlerHelper; -import net.minecraftforge.network.NetworkEvent; +import net.neoforged.neoforge.items.ItemHandlerHelper; /** * This message requests to take an item from the currently opened storage Based on * https://github.com/Lothrazar/Storage-Network */ -public class MessageTakeItem extends MessageBase { +public class MessageTakeItem implements IMessage { + + public static final ResourceLocation ID = new ResourceLocation(Occultism.MODID, "take_item"); private ItemStack stack = ItemStack.EMPTY; private int mouseButton; @@ -56,8 +61,7 @@ public MessageTakeItem(ItemStack stack, int mouseButton, boolean isShiftDown, bo } @Override - public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player, - NetworkEvent.Context context) { + public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player) { if (player.containerMenu instanceof IStorageControllerContainer) { IStorageController storageController = ((IStorageControllerContainer) player.containerMenu) .getStorageController(); @@ -99,12 +103,12 @@ else if (this.mouseButton == InputUtil.MOUSE_BUTTON_RIGHT) { } else { //otherwise put it on the players mouse player.containerMenu.setCarried(stack); - OccultismPackets.sendTo(player, new MessageUpdateMouseHeldItem(stack)); + Networking.sendTo(player, new MessageUpdateMouseHeldItem(stack)); } } //finally, update the storage controller stacks - OccultismPackets.sendTo(player, storageController.getMessageUpdateStacks()); + Networking.sendTo(player, storageController.getMessageUpdateStacks()); player.containerMenu.broadcastChanges(); } } @@ -130,4 +134,8 @@ public void decode(FriendlyByteBuf buf) { this.isCtrlDown = buf.readBoolean(); } + @Override + public ResourceLocation id() { + return ID; + } } diff --git a/src/main/java/com/klikli_dev/occultism/network/MessageToggleFamiliarSettings.java b/src/main/java/com/klikli_dev/occultism/network/messages/MessageToggleFamiliarSettings.java similarity index 62% rename from src/main/java/com/klikli_dev/occultism/network/MessageToggleFamiliarSettings.java rename to src/main/java/com/klikli_dev/occultism/network/messages/MessageToggleFamiliarSettings.java index f6ccb9935..dd0515f67 100644 --- a/src/main/java/com/klikli_dev/occultism/network/MessageToggleFamiliarSettings.java +++ b/src/main/java/com/klikli_dev/occultism/network/messages/MessageToggleFamiliarSettings.java @@ -20,24 +20,28 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package com.klikli_dev.occultism.network; +package com.klikli_dev.occultism.network.messages; import com.klikli_dev.occultism.Occultism; -import com.klikli_dev.occultism.common.capability.FamiliarSettingsCapability; +import com.klikli_dev.occultism.common.capability.FamiliarSettingsData; +import com.klikli_dev.occultism.network.IMessage; import com.klikli_dev.occultism.registry.OccultismCapabilities; +import com.klikli_dev.occultism.registry.OccultismDataStorage; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.EntityType; -import net.minecraftforge.network.NetworkEvent; -import net.minecraftforge.registries.ForgeRegistries; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; -public class MessageToggleFamiliarSettings extends MessageBase { +public class MessageToggleFamiliarSettings implements IMessage { + + public static final ResourceLocation ID = new ResourceLocation(Occultism.MODID, "toggle_familiar_settings"); public Map, Boolean> familiarsPressed; @@ -50,32 +54,35 @@ public MessageToggleFamiliarSettings(Map, Boolean> familiarsPresse } @Override - public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player, - NetworkEvent.Context context) { - player.getCapability(OccultismCapabilities.FAMILIAR_SETTINGS).ifPresent(cap -> { - for (Entry, Boolean> toggle : this.familiarsPressed.entrySet()) { - if (toggle.getValue()) { - cap.setFamiliarEnabled(toggle.getKey(), !cap.isFamiliarEnabled(toggle.getKey())); - player.displayClientMessage( - Component.translatable( - "message." + Occultism.MODID + ".familiar." + ForgeRegistries.ENTITY_TYPES.getKey(toggle.getKey()).getPath() + - (cap.isFamiliarEnabled(toggle.getKey()) ? ".enabled" : ".disabled")), true); - } + public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player) { + var cap = player.getData(OccultismDataStorage.FAMILIAR_SETTINGS.get()); + for (Entry, Boolean> toggle : this.familiarsPressed.entrySet()) { + if (toggle.getValue()) { + cap.setFamiliarEnabled(toggle.getKey(), !cap.isFamiliarEnabled(toggle.getKey())); + player.displayClientMessage( + Component.translatable( + "message." + Occultism.MODID + ".familiar." + BuiltInRegistries.ENTITY_TYPE.getKey(toggle.getKey()).getPath() + + (cap.isFamiliarEnabled(toggle.getKey()) ? ".enabled" : ".disabled")), true); } - }); - FamiliarSettingsCapability.syncFor(player); + } + FamiliarSettingsData.syncFor(player); } @Override public void encode(FriendlyByteBuf buf) { - for (EntityType familiar : FamiliarSettingsCapability.getFamiliars()) + for (EntityType familiar : FamiliarSettingsData.getFamiliars()) buf.writeBoolean(this.familiarsPressed.get(familiar)); } @Override public void decode(FriendlyByteBuf buf) { this.familiarsPressed = new HashMap<>(); - for (EntityType familiar : FamiliarSettingsCapability.getFamiliars()) + for (EntityType familiar : FamiliarSettingsData.getFamiliars()) this.familiarsPressed.put(familiar, buf.readBoolean()); } + + @Override + public ResourceLocation id() { + return ID; + } } diff --git a/src/main/java/com/klikli_dev/occultism/network/MessageUpdateLinkedMachines.java b/src/main/java/com/klikli_dev/occultism/network/messages/MessageUpdateLinkedMachines.java similarity index 84% rename from src/main/java/com/klikli_dev/occultism/network/MessageUpdateLinkedMachines.java rename to src/main/java/com/klikli_dev/occultism/network/messages/MessageUpdateLinkedMachines.java index 4118f98e9..c7ab346e6 100644 --- a/src/main/java/com/klikli_dev/occultism/network/MessageUpdateLinkedMachines.java +++ b/src/main/java/com/klikli_dev/occultism/network/messages/MessageUpdateLinkedMachines.java @@ -20,17 +20,19 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package com.klikli_dev.occultism.network; +package com.klikli_dev.occultism.network.messages; +import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.api.client.gui.IStorageControllerGui; import com.klikli_dev.occultism.api.common.data.GlobalBlockPos; import com.klikli_dev.occultism.api.common.data.MachineReference; +import com.klikli_dev.occultism.network.IMessage; import net.minecraft.client.Minecraft; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Player; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.network.NetworkEvent; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; import java.util.ArrayList; import java.util.List; @@ -39,7 +41,9 @@ /** * This message sends the stacks in the currently opened storage controller. */ -public class MessageUpdateLinkedMachines extends MessageBase { +public class MessageUpdateLinkedMachines implements IMessage { + + public static final ResourceLocation ID = new ResourceLocation(Occultism.MODID, "update_linked_machines"); private List linkedMachines; @@ -57,7 +61,7 @@ public MessageUpdateLinkedMachines(Map linkedM @Override @OnlyIn(Dist.CLIENT) - public void onClientReceived(Minecraft minecraft, Player player, NetworkEvent.Context context) { + public void onClientReceived(Minecraft minecraft, Player player) { if (minecraft.screen instanceof IStorageControllerGui gui) { if (gui != null) { gui.setLinkedMachines(this.linkedMachines); @@ -84,4 +88,8 @@ public void decode(FriendlyByteBuf buf) { } } + @Override + public ResourceLocation id() { + return ID; + } } diff --git a/src/main/java/com/klikli_dev/occultism/network/MessageUpdateMouseHeldItem.java b/src/main/java/com/klikli_dev/occultism/network/messages/MessageUpdateMouseHeldItem.java similarity index 78% rename from src/main/java/com/klikli_dev/occultism/network/MessageUpdateMouseHeldItem.java rename to src/main/java/com/klikli_dev/occultism/network/messages/MessageUpdateMouseHeldItem.java index da3b126b6..a97306a22 100644 --- a/src/main/java/com/klikli_dev/occultism/network/MessageUpdateMouseHeldItem.java +++ b/src/main/java/com/klikli_dev/occultism/network/messages/MessageUpdateMouseHeldItem.java @@ -20,20 +20,24 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package com.klikli_dev.occultism.network; +package com.klikli_dev.occultism.network.messages; +import com.klikli_dev.occultism.Occultism; +import com.klikli_dev.occultism.network.IMessage; import net.minecraft.client.Minecraft; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.resources.ResourceLocation; 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.network.NetworkEvent; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; /** * Updates the item currently held by the mouse */ -public class MessageUpdateMouseHeldItem extends MessageBase { +public class MessageUpdateMouseHeldItem implements IMessage { + + public static final ResourceLocation ID = new ResourceLocation(Occultism.MODID, "update_mouse_held_item"); private ItemStack stack; @@ -47,7 +51,7 @@ public MessageUpdateMouseHeldItem(ItemStack itemStack) { @Override @OnlyIn(Dist.CLIENT) - public void onClientReceived(Minecraft minecraft, Player player, NetworkEvent.Context context) { + public void onClientReceived(Minecraft minecraft, Player player) { player.containerMenu.setCarried(this.stack); } @@ -61,4 +65,8 @@ public void decode(FriendlyByteBuf buf) { this.stack = buf.readItem(); } + @Override + public ResourceLocation id() { + return ID; + } } diff --git a/src/main/java/com/klikli_dev/occultism/network/MessageUpdateStacks.java b/src/main/java/com/klikli_dev/occultism/network/messages/MessageUpdateStacks.java similarity index 90% rename from src/main/java/com/klikli_dev/occultism/network/MessageUpdateStacks.java rename to src/main/java/com/klikli_dev/occultism/network/messages/MessageUpdateStacks.java index 559a388d3..2b6f2cd39 100644 --- a/src/main/java/com/klikli_dev/occultism/network/MessageUpdateStacks.java +++ b/src/main/java/com/klikli_dev/occultism/network/messages/MessageUpdateStacks.java @@ -20,18 +20,20 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package com.klikli_dev.occultism.network; +package com.klikli_dev.occultism.network.messages; +import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.api.client.gui.IStorageControllerGui; +import com.klikli_dev.occultism.network.IMessage; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import net.minecraft.client.Minecraft; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.resources.ResourceLocation; 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.network.NetworkEvent; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; import java.util.ArrayList; import java.util.List; @@ -41,7 +43,9 @@ /** * This message sends the stacks in the currently opened storage controller. */ -public class MessageUpdateStacks extends MessageBase { +public class MessageUpdateStacks implements IMessage { + + public static final ResourceLocation ID = new ResourceLocation(Occultism.MODID, "update_stacks"); private static final int DEFAULT_BUFFER_SIZE = 2 * 1024; @@ -63,7 +67,7 @@ public MessageUpdateStacks(List stacks, int usedSlots, int maxSlots) @Override @OnlyIn(Dist.CLIENT) - public void onClientReceived(Minecraft minecraft, Player player, NetworkEvent.Context context) { + public void onClientReceived(Minecraft minecraft, Player player) { this.uncompress(); if (minecraft.screen instanceof IStorageControllerGui gui) { if (gui != null) { @@ -148,4 +152,8 @@ public void compress() { } } + @Override + public ResourceLocation id() { + return ID; + } } diff --git a/src/main/java/com/klikli_dev/occultism/network/MessageUpdateStorageSettings.java b/src/main/java/com/klikli_dev/occultism/network/messages/MessageUpdateStorageSettings.java similarity index 90% rename from src/main/java/com/klikli_dev/occultism/network/MessageUpdateStorageSettings.java rename to src/main/java/com/klikli_dev/occultism/network/messages/MessageUpdateStorageSettings.java index 7539bf650..916f8eeee 100644 --- a/src/main/java/com/klikli_dev/occultism/network/MessageUpdateStorageSettings.java +++ b/src/main/java/com/klikli_dev/occultism/network/messages/MessageUpdateStorageSettings.java @@ -20,8 +20,9 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -package com.klikli_dev.occultism.network; +package com.klikli_dev.occultism.network.messages; +import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.api.common.blockentity.IStorageController; import com.klikli_dev.occultism.api.common.container.IStorageControllerContainer; import com.klikli_dev.occultism.api.common.data.SortDirection; @@ -29,16 +30,19 @@ import com.klikli_dev.occultism.common.container.storage.StableWormholeContainer; import com.klikli_dev.occultism.common.container.storage.StorageControllerContainer; import com.klikli_dev.occultism.common.container.storage.StorageRemoteContainer; +import com.klikli_dev.occultism.network.IMessage; import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.resources.ResourceLocation; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.network.NetworkEvent; /** * Inserts the mouse held item into the opened storage controller. */ -public class MessageUpdateStorageSettings extends MessageBase { +public class MessageUpdateStorageSettings implements IMessage { + + public static final ResourceLocation ID = new ResourceLocation(Occultism.MODID, "update_storage_settings"); private SortDirection sortDirection; private SortType sortType; @@ -53,8 +57,7 @@ public MessageUpdateStorageSettings(SortDirection sortDirection, SortType sortTy } @Override - public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player, - NetworkEvent.Context context) { + public void onServerReceived(MinecraftServer minecraftServer, ServerPlayer player) { if (player.containerMenu instanceof IStorageControllerContainer storageContainer) { IStorageController storageController = storageContainer.getStorageController(); @@ -95,4 +98,9 @@ public void decode(FriendlyByteBuf buf) { this.sortDirection = buf.readEnum(SortDirection.class); this.sortType = buf.readEnum(SortType.class); } + + @Override + public ResourceLocation id() { + return ID; + } } diff --git a/src/main/java/com/klikli_dev/occultism/registry/OccultismAdvancements.java b/src/main/java/com/klikli_dev/occultism/registry/OccultismAdvancements.java index 2369b8150..44ce400b7 100644 --- a/src/main/java/com/klikli_dev/occultism/registry/OccultismAdvancements.java +++ b/src/main/java/com/klikli_dev/occultism/registry/OccultismAdvancements.java @@ -22,18 +22,21 @@ package com.klikli_dev.occultism.registry; +import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.common.advancement.FamiliarTrigger; import com.klikli_dev.occultism.common.advancement.RitualTrigger; -import net.minecraft.advancements.CriteriaTriggers; +import net.minecraft.advancements.CriterionTrigger; +import net.minecraft.core.registries.BuiltInRegistries; +import net.neoforged.neoforge.registries.DeferredHolder; +import net.neoforged.neoforge.registries.DeferredRegister; public class OccultismAdvancements { - // region Fields - public static RitualTrigger RITUAL; - public static FamiliarTrigger FAMILIAR; - // endregion Fields - - public static void register() { - RITUAL = CriteriaTriggers.register(new RitualTrigger()); - FAMILIAR = CriteriaTriggers.register(new FamiliarTrigger()); - } + + public static final DeferredRegister> TRIGGER_TYPES = DeferredRegister.create(BuiltInRegistries.TRIGGER_TYPES, Occultism.MODID); + + public static final DeferredHolder, FamiliarTrigger> FAMILIAR = TRIGGER_TYPES.register("familiar", FamiliarTrigger::new); + + public static final DeferredHolder, RitualTrigger> RITUAL = TRIGGER_TYPES.register("ritual", RitualTrigger::new); + + } diff --git a/src/main/java/com/klikli_dev/occultism/registry/OccultismTiles.java b/src/main/java/com/klikli_dev/occultism/registry/OccultismBlockEntities.java similarity index 69% rename from src/main/java/com/klikli_dev/occultism/registry/OccultismTiles.java rename to src/main/java/com/klikli_dev/occultism/registry/OccultismBlockEntities.java index 9cd939cdf..8b6e2faeb 100644 --- a/src/main/java/com/klikli_dev/occultism/registry/OccultismTiles.java +++ b/src/main/java/com/klikli_dev/occultism/registry/OccultismBlockEntities.java @@ -24,35 +24,35 @@ import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.common.blockentity.*; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.neoforge.registries.DeferredRegister; -public class OccultismTiles { +import java.util.function.Supplier; - public static final DeferredRegister> TILES = DeferredRegister.create( - ForgeRegistries.BLOCK_ENTITY_TYPES, Occultism.MODID); +public class OccultismBlockEntities { - public static final RegistryObject> STORAGE_CONTROLLER = TILES.register( + public static final DeferredRegister> BLOCK_ENTITIES = DeferredRegister.create(BuiltInRegistries.BLOCK_ENTITY_TYPE, Occultism.MODID); + + public static final Supplier> STORAGE_CONTROLLER = BLOCK_ENTITIES.register( "storage_controller", () -> BlockEntityType.Builder.of(StorageControllerBlockEntity::new, OccultismBlocks.STORAGE_CONTROLLER.get()).build(null)); - public static final RegistryObject> STABLE_WORMHOLE = TILES.register( + public static final Supplier> STABLE_WORMHOLE = BLOCK_ENTITIES.register( "stable_wormhole", () -> BlockEntityType.Builder.of(StableWormholeBlockEntity::new, OccultismBlocks.STABLE_WORMHOLE.get()).build(null)); - public static final RegistryObject> SACRIFICIAL_BOWL = TILES.register( + public static final Supplier> SACRIFICIAL_BOWL = BLOCK_ENTITIES.register( "sacrificial_bowl", () -> BlockEntityType.Builder.of(SacrificialBowlBlockEntity::new, OccultismBlocks.SACRIFICIAL_BOWL.get()).build(null)); - public static final RegistryObject> GOLDEN_SACRIFICIAL_BOWL = - TILES.register( + public static final Supplier> GOLDEN_SACRIFICIAL_BOWL = + BLOCK_ENTITIES.register( "golden_sacrificial_bowl", () -> BlockEntityType.Builder.of(GoldenSacrificialBowlBlockEntity::new, OccultismBlocks.GOLDEN_SACRIFICIAL_BOWL.get()).build(null)); - public static final RegistryObject> DIMENSIONAL_MINESHAFT = - TILES.register( + public static final Supplier> DIMENSIONAL_MINESHAFT = + BLOCK_ENTITIES.register( "dimensional_mineshaft", () -> BlockEntityType.Builder.of(DimensionalMineshaftBlockEntity::new, OccultismBlocks.DIMENSIONAL_MINESHAFT.get()).build(null)); diff --git a/src/main/java/com/klikli_dev/occultism/registry/OccultismBlocks.java b/src/main/java/com/klikli_dev/occultism/registry/OccultismBlocks.java index d335b1f92..62724e17b 100644 --- a/src/main/java/com/klikli_dev/occultism/registry/OccultismBlocks.java +++ b/src/main/java/com/klikli_dev/occultism/registry/OccultismBlocks.java @@ -32,9 +32,6 @@ import com.klikli_dev.occultism.common.block.storage.StorageStabilizerBlock; import com.klikli_dev.occultism.common.entity.familiar.CthulhuFamiliarEntity; import com.klikli_dev.occultism.common.entity.familiar.FamiliarEntity; -import com.klikli_dev.occultism.common.level.tree.OtherworldNaturalTreeGrower; -import com.klikli_dev.occultism.common.level.tree.OtherworldTreeGrower; -import com.klikli_dev.occultism.config.OccultismClientConfig; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.resources.ResourceLocation; @@ -48,9 +45,8 @@ import net.minecraft.world.level.material.MapColor; import net.minecraft.world.level.material.PushReaction; import net.minecraft.world.phys.AABB; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.neoforge.registries.DeferredBlock; +import net.neoforged.neoforge.registries.DeferredRegister; import java.util.HashMap; import java.util.Map; @@ -58,12 +54,11 @@ public class OccultismBlocks { - public static final DeferredRegister BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, - Occultism.MODID); + public static final DeferredRegister.Blocks BLOCKS = DeferredRegister.createBlocks(Occultism.MODID); public static final Map BLOCK_DATA_GEN_SETTINGS = new HashMap<>(); //Blocks without item - public static final RegistryObject SPIRIT_FIRE = register("spirit_fire", + public static final DeferredBlock SPIRIT_FIRE = register("spirit_fire", () -> new SpiritFireBlock( Block.Properties.of() .mapColor(MapColor.COLOR_PURPLE) @@ -72,7 +67,7 @@ public class OccultismBlocks { .lightLevel((state) -> 12) .sound(SoundType.WOOL)), false, LootTableType.EMPTY); - public static final RegistryObject LIGHTED_AIR = register("lighted_air", () -> new AirBlock( + public static final DeferredBlock LIGHTED_AIR = register("lighted_air", () -> new AirBlock( Block.Properties.of().noCollission().air().noLootTable().lightLevel(s -> 15).randomTicks()) { @Override @SuppressWarnings("deprecation") @@ -89,80 +84,80 @@ public void tick(BlockState pState, ServerLevel pLevel, BlockPos pPos, RandomSou .replaceable() .noCollission() .strength(5f, 30); - public static final RegistryObject CHALK_GLYPH_WHITE = register("chalk_glyph_white", + public static final DeferredBlock CHALK_GLYPH_WHITE = register("chalk_glyph_white", () -> new ChalkGlyphBlock(GLYPH_PROPERTIES, Occultism.CLIENT_CONFIG.visuals.whiteChalkGlyphColor, () -> OccultismItems.CHALK_WHITE.get()), false, LootTableType.EMPTY); - public static final RegistryObject CHALK_GLYPH_GOLD = register("chalk_glyph_gold", + public static final DeferredBlock CHALK_GLYPH_GOLD = register("chalk_glyph_gold", () -> new ChalkGlyphBlock(GLYPH_PROPERTIES, Occultism.CLIENT_CONFIG.visuals.goldenChalkGlyphColor, () -> OccultismItems.CHALK_GOLD.get()), false, LootTableType.EMPTY); - public static final RegistryObject CHALK_GLYPH_PURPLE = register("chalk_glyph_purple", + public static final DeferredBlock CHALK_GLYPH_PURPLE = register("chalk_glyph_purple", () -> new ChalkGlyphBlock(GLYPH_PROPERTIES, Occultism.CLIENT_CONFIG.visuals.purpleChalkGlyphColor, () -> OccultismItems.CHALK_PURPLE.get()), false, LootTableType.EMPTY); - public static final RegistryObject CHALK_GLYPH_RED = register("chalk_glyph_red", + public static final DeferredBlock CHALK_GLYPH_RED = register("chalk_glyph_red", () -> new ChalkGlyphBlock(GLYPH_PROPERTIES, Occultism.CLIENT_CONFIG.visuals.redChalkGlyphColor, () -> OccultismItems.CHALK_RED.get()), false, LootTableType.EMPTY); //Resources - public static final RegistryObject OTHERSTONE = register("otherstone", () -> new Block( + public static final DeferredBlock OTHERSTONE = register("otherstone", () -> new Block( Block.Properties.of().mapColor(MapColor.STONE).sound(SoundType.STONE).strength(1.5f, 30))); //Components - public static final RegistryObject OTHERSTONE_SLAB = register("otherstone_slab", () -> new SlabBlock(Block.Properties.copy(OTHERSTONE.get()))); - public static final RegistryObject OTHERSTONE_PEDESTAL = register("otherstone_pedestal", () -> new Block(Block.Properties.copy(OTHERSTONE.get()))); - public static final RegistryObject STORAGE_CONTROLLER_BASE = register("storage_controller_base", - () -> new NonPathfindableBlock(Block.Properties.copy(OTHERSTONE.get()).noOcclusion())); - public static final RegistryObject OTHERSTONE_NATURAL = + public static final DeferredBlock OTHERSTONE_SLAB = register("otherstone_slab", () -> new SlabBlock(Block.Properties.ofLegacyCopy(OTHERSTONE.get()))); + public static final DeferredBlock OTHERSTONE_PEDESTAL = register("otherstone_pedestal", () -> new Block(Block.Properties.ofLegacyCopy(OTHERSTONE.get()))); + public static final DeferredBlock STORAGE_CONTROLLER_BASE = register("storage_controller_base", + () -> new NonPathfindableBlock(Block.Properties.ofLegacyCopy(OTHERSTONE.get()).noOcclusion())); + public static final DeferredBlock OTHERSTONE_NATURAL = register("otherstone_natural", () -> new OtherstoneNaturalBlock( Block.Properties.of().mapColor(MapColor.STONE).sound(SoundType.STONE).strength(1.5f, 30)), true, LootTableType.OTHERWORLD_BLOCK); - public static final RegistryObject OTHERWORLD_LOG = + public static final DeferredBlock OTHERWORLD_LOG = register("otherworld_log", () -> new RotatedPillarBlock(Block.Properties.of() .mapColor((state) -> state.getValue(RotatedPillarBlock.AXIS) == Direction.Axis.Y ? MapColor.WOOD : MapColor.COLOR_PURPLE) .strength(2.0F).sound(SoundType.WOOD).strength(2.0f))); - public static final RegistryObject OTHERWORLD_LOG_NATURAL = + public static final DeferredBlock OTHERWORLD_LOG_NATURAL = register("otherworld_log_natural", () -> new OtherworldLogNaturalBlock(Block.Properties.of() .mapColor((state) -> state.getValue(RotatedPillarBlock.AXIS) == Direction.Axis.Y ? MapColor.WOOD : MapColor.COLOR_PURPLE).strength(2.0f)), true, LootTableType.OTHERWORLD_BLOCK); - public static final RegistryObject OTHERWORLD_LEAVES = + public static final DeferredBlock OTHERWORLD_LEAVES = register("otherworld_leaves", () -> new LeavesBlock( Block.Properties.of() .mapColor(MapColor.PLANT) .sound(SoundType.GRASS) .strength(0.2f).randomTicks().noOcclusion()), true, LootTableType.CUSTOM); - public static final RegistryObject OTHERWORLD_LEAVES_NATURAL = + public static final DeferredBlock OTHERWORLD_LEAVES_NATURAL = register("otherworld_leaves_natural", () -> new OtherworldLeavesNaturalBlock( Block.Properties.of() .mapColor(MapColor.PLANT).sound(SoundType.GRASS) .strength(0.2f).randomTicks().noOcclusion()), true, LootTableType.CUSTOM); - public static final RegistryObject OTHERWORLD_SAPLING = - register("otherworld_sapling", () -> new OtherworldSaplingBlock(new OtherworldTreeGrower(), + public static final DeferredBlock OTHERWORLD_SAPLING = + register("otherworld_sapling", () -> new OtherworldSaplingBlock( Block.Properties.of() .mapColor(MapColor.PLANT) .sound(SoundType.GRASS) .strength(0.0f).randomTicks().noCollission())); - public static final RegistryObject OTHERWORLD_SAPLING_NATURAL = - register("otherworld_sapling_natural", () -> new OtherworldSaplingNaturalBlock(new OtherworldNaturalTreeGrower(), + public static final DeferredBlock OTHERWORLD_SAPLING_NATURAL = + register("otherworld_sapling_natural", () -> new OtherworldSaplingNaturalBlock( Block.Properties.of() .mapColor(MapColor.PLANT) .sound(SoundType.GRASS) .strength(0.0f).randomTicks().noCollission()), false, LootTableType.OTHERWORLD_BLOCK); - public static final RegistryObject SILVER_ORE = register("silver_ore", () -> new Block(Block.Properties.copy(Blocks.IRON_ORE)), true, LootTableType.CUSTOM); - public static final RegistryObject SILVER_ORE_DEEPSLATE = register("silver_ore_deepslate", () -> new Block(Block.Properties.copy(Blocks.IRON_ORE)), true, LootTableType.CUSTOM); - public static final RegistryObject IESNIUM_ORE = register("iesnium_ore", () -> new Block(Block.Properties.copy(Blocks.IRON_ORE)), true, LootTableType.CUSTOM); - public static final RegistryObject IESNIUM_ORE_NATURAL = - register("iesnium_ore_natural", () -> new IesniumOreNaturalBlock(Block.Properties.copy(Blocks.IRON_ORE)), + public static final DeferredBlock SILVER_ORE = register("silver_ore", () -> new Block(Block.Properties.ofLegacyCopy(Blocks.IRON_ORE)), true, LootTableType.CUSTOM); + public static final DeferredBlock SILVER_ORE_DEEPSLATE = register("silver_ore_deepslate", () -> new Block(Block.Properties.ofLegacyCopy(Blocks.IRON_ORE)), true, LootTableType.CUSTOM); + public static final DeferredBlock IESNIUM_ORE = register("iesnium_ore", () -> new Block(Block.Properties.ofLegacyCopy(Blocks.IRON_ORE)), true, LootTableType.CUSTOM); + public static final DeferredBlock IESNIUM_ORE_NATURAL = + register("iesnium_ore_natural", () -> new IesniumOreNaturalBlock(Block.Properties.ofLegacyCopy(Blocks.IRON_ORE)), true, LootTableType.OTHERWORLD_BLOCK); - public static final RegistryObject SILVER_BLOCK = register("silver_block", () -> new Block(Block.Properties.copy(Blocks.IRON_BLOCK))); - public static final RegistryObject RAW_SILVER_BLOCK = register("raw_silver_block", () -> new Block(Block.Properties.copy(Blocks.RAW_IRON_BLOCK))); - public static final RegistryObject IESNIUM_BLOCK = register("iesnium_block", () -> new Block(Block.Properties.copy(Blocks.IRON_BLOCK))); - public static final RegistryObject RAW_IESNIUM_BLOCK = register("raw_iesnium_block", () -> new Block(Block.Properties.copy(Blocks.RAW_IRON_BLOCK))); + public static final DeferredBlock SILVER_BLOCK = register("silver_block", () -> new Block(Block.Properties.ofLegacyCopy(Blocks.IRON_BLOCK))); + public static final DeferredBlock RAW_SILVER_BLOCK = register("raw_silver_block", () -> new Block(Block.Properties.ofLegacyCopy(Blocks.RAW_IRON_BLOCK))); + public static final DeferredBlock IESNIUM_BLOCK = register("iesnium_block", () -> new Block(Block.Properties.ofLegacyCopy(Blocks.IRON_BLOCK))); + public static final DeferredBlock RAW_IESNIUM_BLOCK = register("raw_iesnium_block", () -> new Block(Block.Properties.ofLegacyCopy(Blocks.RAW_IRON_BLOCK))); //Decorative and Ritual Blocks - public static final RegistryObject CANDLE_WHITE = register("candle_white", () -> new CandleBlock( + public static final DeferredBlock CANDLE_WHITE = register("candle_white", () -> new CandleBlock( Block.Properties.of() .mapColor(MapColor.WOOL) .sound(SoundType.WOOL).noCollission() .strength(0.1f, 0).lightLevel((state) -> 12))); - public static final RegistryObject SPIRIT_ATTUNED_CRYSTAL = + public static final DeferredBlock SPIRIT_ATTUNED_CRYSTAL = register("spirit_attuned_crystal", () -> new SpiritAttunedCrystalBlock( Block.Properties.of() .mapColor(MapColor.STONE) @@ -170,58 +165,58 @@ public void tick(BlockState pState, ServerLevel pLevel, BlockPos pPos, RandomSou .strength(1.5f, 30).lightLevel((state) -> 8))); //Machines - public static final RegistryObject SACRIFICIAL_BOWL = + public static final DeferredBlock SACRIFICIAL_BOWL = register("sacrificial_bowl", () -> new SacrificialBowlBlock( Block.Properties.of() .mapColor(MapColor.STONE) .sound(SoundType.STONE).strength(1.5f, 30) .noOcclusion())); - public static final RegistryObject GOLDEN_SACRIFICIAL_BOWL = + public static final DeferredBlock GOLDEN_SACRIFICIAL_BOWL = register("golden_sacrificial_bowl", () -> new GoldenSacrificialBowlBlock( Block.Properties.of() .mapColor(MapColor.STONE) .sound(SoundType.STONE).strength(1.5f, 30) .noOcclusion())); - public static final RegistryObject STORAGE_CONTROLLER = register("storage_controller", + public static final DeferredBlock STORAGE_CONTROLLER = register("storage_controller", () -> new StorageControllerBlock( Block.Properties.of() .mapColor(MapColor.STONE) .sound(SoundType.STONE) .strength(5f, 100).noOcclusion()), false, LootTableType.EMPTY); - public static final RegistryObject STORAGE_STABILIZER_TIER1 = register( + public static final DeferredBlock STORAGE_STABILIZER_TIER1 = register( "storage_stabilizer_tier1", () -> new StorageStabilizerBlock( Block.Properties.of() .mapColor(MapColor.STONE) .sound(SoundType.STONE).strength(1.5f, 30) .noOcclusion())); - public static final RegistryObject STORAGE_STABILIZER_TIER2 = register( + public static final DeferredBlock STORAGE_STABILIZER_TIER2 = register( "storage_stabilizer_tier2", () -> new StorageStabilizerBlock( Block.Properties.of() .mapColor(MapColor.STONE) .sound(SoundType.STONE).strength(1.5f, 30) .noOcclusion())); - public static final RegistryObject STORAGE_STABILIZER_TIER3 = register( + public static final DeferredBlock STORAGE_STABILIZER_TIER3 = register( "storage_stabilizer_tier3", () -> new StorageStabilizerBlock( Block.Properties.of() .mapColor(MapColor.STONE) .sound(SoundType.STONE).strength(1.5f, 30) .noOcclusion())); - public static final RegistryObject STORAGE_STABILIZER_TIER4 = register( + public static final DeferredBlock STORAGE_STABILIZER_TIER4 = register( "storage_stabilizer_tier4", () -> new StorageStabilizerBlock( Block.Properties.of() .mapColor(MapColor.STONE) .sound(SoundType.STONE).strength(1.5f, 30) .noOcclusion())); - public static final RegistryObject STABLE_WORMHOLE = register("stable_wormhole", + public static final DeferredBlock STABLE_WORMHOLE = register("stable_wormhole", () -> new StableWormholeBlock( Block.Properties.of() .mapColor(MapColor.STONE) .sound(SoundType.STONE).noCollission() .strength(2f, 2).noOcclusion()), false, LootTableType.EMPTY); - public static final RegistryObject DIMENSIONAL_MINESHAFT = + public static final DeferredBlock DIMENSIONAL_MINESHAFT = register("dimensional_mineshaft", () -> new DimensionalMineshaftBlock( Block.Properties.of().sound(SoundType.STONE) .strength(1.5f, 30) @@ -229,7 +224,7 @@ public void tick(BlockState pState, ServerLevel pLevel, BlockPos pPos, RandomSou )); //Crops - public static final RegistryObject DATURA = register("datura", + public static final DeferredBlock DATURA = register("datura", () -> new ReplantableCropsBlock( Block.Properties.of() .mapColor(MapColor.PLANT) @@ -239,44 +234,48 @@ public void tick(BlockState pState, ServerLevel pLevel, BlockPos pPos, RandomSou () -> OccultismItems.DATURA.get()), false, LootTableType.REPLANTABLE_CROP); //Dummy - public static final RegistryObject SKELETON_SKULL_DUMMY = register("skeleton_skull_dummy", () -> new Block( + public static final DeferredBlock SKELETON_SKULL_DUMMY = register("skeleton_skull_dummy", () -> new Block( Block.Properties.of().strength(1.0F)), false); - public static final RegistryObject WITHER_SKELETON_SKULL_DUMMY = register("wither_skeleton_skull_dummy", () -> new Block( + public static final DeferredBlock WITHER_SKELETON_SKULL_DUMMY = register("wither_skeleton_skull_dummy", () -> new Block( Block.Properties.of().strength(1.0F)), false); //Deco - public static final RegistryObject SPIRIT_LANTERN = register("spirit_lantern", + public static final DeferredBlock SPIRIT_LANTERN = register("spirit_lantern", () -> new LanternBlock(BlockBehaviour.Properties.of() .mapColor(MapColor.METAL) .requiresCorrectToolForDrops().strength(3.5F).sound(SoundType.LANTERN) .lightLevel((state) -> 10).noOcclusion())); - public static final RegistryObject SPIRIT_CAMPFIRE = register("spirit_campfire", + public static final DeferredBlock SPIRIT_CAMPFIRE = register("spirit_campfire", () -> new CampfireBlock(false, 2, BlockBehaviour.Properties.of() .mapColor(MapColor.PODZOL) .strength(2.0F).sound(SoundType.WOOD).lightLevel((state) -> 10).noOcclusion())); - public static final RegistryObject SPIRIT_TORCH = register("spirit_torch", - () -> new SpiritTorchBlock(BlockBehaviour.Properties.of() + public static final DeferredBlock SPIRIT_TORCH = register("spirit_torch", + () -> new SpiritTorchBlock( + () -> OccultismParticles.SPIRIT_FIRE_FLAME.get(),//particles are not registered at block construct time, hence the supplier + BlockBehaviour.Properties.of() .noCollission().instabreak().lightLevel((state) -> 10).sound(SoundType.WOOD)), false); - public static final RegistryObject SPIRIT_WALL_TORCH = register("spirit_wall_torch", - () -> new SpiritWallTorchBlock(BlockBehaviour.Properties.of() + public static final DeferredBlock SPIRIT_WALL_TORCH = register("spirit_wall_torch", + () -> new SpiritWallTorchBlock( + () -> OccultismParticles.SPIRIT_FIRE_FLAME.get(), //particles are not registered at block construct time, hence the supplier + BlockBehaviour.Properties.of() .noCollission().instabreak().lightLevel((state) -> 10).sound(SoundType.WOOD).lootFrom(SPIRIT_TORCH)), false); - public static RegistryObject register(final String name, final Supplier sup) { + public static DeferredBlock register(final String name, final Supplier sup) { return register(name, sup, true); } - public static RegistryObject register(final String name, final Supplier sup, - boolean generateDefaultBlockItem) { + public static DeferredBlock register(final String name, final Supplier sup, + boolean generateDefaultBlockItem) { return register(name, sup, generateDefaultBlockItem, LootTableType.DROP_SELF); } - public static RegistryObject register(final String name, final Supplier sup, - boolean generateDefaultBlockItem, - LootTableType lootTableType) { - RegistryObject object = BLOCKS.register(name, sup); + public static DeferredBlock register(final String name, final Supplier sup, + boolean generateDefaultBlockItem, + LootTableType lootTableType) { + DeferredBlock object = BLOCKS.register(name, sup); BLOCK_DATA_GEN_SETTINGS.put(object.getId(), new BlockDataGenSettings(generateDefaultBlockItem, lootTableType)); if (generateDefaultBlockItem) { diff --git a/src/main/java/com/klikli_dev/occultism/registry/OccultismCapabilities.java b/src/main/java/com/klikli_dev/occultism/registry/OccultismCapabilities.java index bc877f715..67c7ae0d5 100644 --- a/src/main/java/com/klikli_dev/occultism/registry/OccultismCapabilities.java +++ b/src/main/java/com/klikli_dev/occultism/registry/OccultismCapabilities.java @@ -22,49 +22,99 @@ package com.klikli_dev.occultism.registry; -import com.klikli_dev.occultism.common.capability.DoubleJumpCapability; -import com.klikli_dev.occultism.common.capability.FamiliarSettingsCapability; -import com.klikli_dev.occultism.util.StaticUtil; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.server.level.ServerPlayer; -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.event.entity.EntityJoinLevelEvent; -import net.minecraftforge.event.entity.player.PlayerEvent; +import com.klikli_dev.occultism.common.blockentity.StorageControllerBlockEntity; +import net.minecraft.core.Direction; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent; public class OccultismCapabilities { - public static final ResourceLocation DOUBLE_JUMP_ID = StaticUtil.modLoc("double_jump"); - public static final ResourceLocation FAMILIAR_SETTINGS_ID = StaticUtil.modLoc("familiar_settings"); + public static void onRegisterCapabilities(RegisterCapabilitiesEvent event) { - public static Capability DOUBLE_JUMP = CapabilityManager.get(new CapabilityToken<>() { - }); - public static Capability FAMILIAR_SETTINGS = CapabilityManager.get(new CapabilityToken<>() { - }); + //TODO: enable once curios is available +// event.registerItem( +// CuriosCapability.ITEM, // capability to register for +// (itemStack, context) -> { +// return new FamiliarRingItem.Curio(itemStack); +// }, +// // items to register for +// OccultismItems.FAMILIAR_RING.get() +// ); + event.registerBlockEntity( + Capabilities.ItemHandler.BLOCK, + OccultismBlockEntities.SACRIFICIAL_BOWL.get(), + (blockEntity, side) -> { + return blockEntity.itemStackHandler; + } + ); + //note the golden sacrificial bowl intentionally does not get a capability! - public static void onRegisterCapabilities(final RegisterCapabilitiesEvent event) { - event.register(DoubleJumpCapability.class); - event.register(FamiliarSettingsCapability.class); - } + event.registerBlockEntity( + Capabilities.ItemHandler.BLOCK, + OccultismBlockEntities.DIMENSIONAL_MINESHAFT.get(), + (blockEntity, side) -> { + if (side == null) + return blockEntity.combinedHandler; + else if (side == Direction.UP) + return blockEntity.inputHandler; + else + return blockEntity.outputHandler; + } + + ); - public static void onPlayerClone(final PlayerEvent.Clone event) { - //only handle respawn after death -> not portal transfers - if (event.isWasDeath()) { - event.getOriginal().reviveCaps(); - //copy capability to new player instance - event.getEntity().getCapability(OccultismCapabilities.FAMILIAR_SETTINGS).ifPresent(newCap -> { - event.getOriginal().getCapability(OccultismCapabilities.FAMILIAR_SETTINGS).ifPresent(newCap::clone); + event.registerBlockEntity( + Capabilities.ItemHandler.BLOCK, + OccultismBlockEntities.STABLE_WORMHOLE.get(), + (blockEntity, side) -> { + if (blockEntity.getLinkedStorageController() instanceof StorageControllerBlockEntity controller) { + return controller.itemStackHandler; } - ); - } - } + return null; + } + ); + + event.registerBlockEntity( + Capabilities.ItemHandler.BLOCK, + OccultismBlockEntities.STORAGE_CONTROLLER.get(), + (blockEntity, side) -> { + return blockEntity.itemStackHandler; + } + ); + + event.registerEntity( + Capabilities.ItemHandler.ENTITY, + OccultismEntities.FOLIOT.get(), + (entity, side) -> { + return entity.inventory; + } + ); + + event.registerEntity( + Capabilities.ItemHandler.ENTITY, + OccultismEntities.DJINNI.get(), + (entity, side) -> { + return entity.inventory; + } + ); + + event.registerEntity( + Capabilities.ItemHandler.ENTITY, + OccultismEntities.AFRIT.get(), + (entity, side) -> { + return entity.inventory; + } + ); + + event.registerEntity( + Capabilities.ItemHandler.ENTITY, + OccultismEntities.MARID.get(), + (entity, side) -> { + return entity.inventory; + } + ); - public static void onJoinWorld(final EntityJoinLevelEvent event) { - if (event.getEntity() instanceof ServerPlayer player) { - FamiliarSettingsCapability.syncFor(player); - } } + } diff --git a/src/main/java/com/klikli_dev/occultism/registry/OccultismCommands.java b/src/main/java/com/klikli_dev/occultism/registry/OccultismCommands.java index adb93b54f..2ec17bf8e 100644 --- a/src/main/java/com/klikli_dev/occultism/registry/OccultismCommands.java +++ b/src/main/java/com/klikli_dev/occultism/registry/OccultismCommands.java @@ -25,7 +25,6 @@ import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.common.command.DebugAICommand; import com.klikli_dev.occultism.common.command.NbtCommand; -import com.klikli_dev.occultism.common.command.ShareNbtCommand; import com.mojang.brigadier.CommandDispatcher; import com.mojang.brigadier.tree.LiteralCommandNode; import net.minecraft.commands.CommandSourceStack; @@ -45,7 +44,6 @@ public static void register(CommandDispatcher dispatcher) { LiteralCommandNode occultismCommand = dispatcher.register( Commands.literal(Occultism.MODID) .then(NbtCommand.register(dispatcher)) - .then(ShareNbtCommand.register(dispatcher)) .then(debugCommand) ); diff --git a/src/main/java/com/klikli_dev/occultism/registry/OccultismContainers.java b/src/main/java/com/klikli_dev/occultism/registry/OccultismContainers.java index 2fb3c80d7..cbec94125 100644 --- a/src/main/java/com/klikli_dev/occultism/registry/OccultismContainers.java +++ b/src/main/java/com/klikli_dev/occultism/registry/OccultismContainers.java @@ -34,60 +34,61 @@ import com.klikli_dev.occultism.common.container.storage.StorageControllerContainer; import com.klikli_dev.occultism.common.container.storage.StorageRemoteContainer; import com.klikli_dev.occultism.common.entity.spirit.SpiritEntity; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.world.inventory.MenuType; -import net.minecraftforge.common.extensions.IForgeMenuType; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.neoforge.common.extensions.IMenuTypeExtension; +import net.neoforged.neoforge.registries.DeferredRegister; + +import java.util.function.Supplier; public class OccultismContainers { public static final DeferredRegister> CONTAINERS = DeferredRegister.create( - ForgeRegistries.MENU_TYPES, Occultism.MODID); + BuiltInRegistries.MENU, Occultism.MODID); - public static final RegistryObject> STORAGE_CONTROLLER = + public static final Supplier> STORAGE_CONTROLLER = CONTAINERS.register("storage_controller", - () -> IForgeMenuType + () -> IMenuTypeExtension .create((windowId, inv, data) -> new StorageControllerContainer(windowId, inv, (StorageControllerBlockEntity) inv.player.level() .getBlockEntity(data.readBlockPos())))); - public static final RegistryObject> STABLE_WORMHOLE = + public static final Supplier> STABLE_WORMHOLE = CONTAINERS.register("stable_wormhole", - () -> IForgeMenuType + () -> IMenuTypeExtension .create((windowId, inv, data) -> new StableWormholeContainer(windowId, inv, (StableWormholeBlockEntity) inv.player.level() .getBlockEntity(data.readBlockPos())))); - public static final RegistryObject> STORAGE_REMOTE = + public static final Supplier> STORAGE_REMOTE = CONTAINERS.register("storage_remote", - () -> IForgeMenuType + () -> IMenuTypeExtension .create((windowId, inv, data) -> new StorageRemoteContainer(windowId, inv, data.readVarInt()))); - public static final RegistryObject> SPIRIT = + public static final Supplier> SPIRIT = CONTAINERS.register("spirit", - () -> IForgeMenuType + () -> IMenuTypeExtension .create((windowId, inv, data) -> { return new SpiritContainer(windowId, inv, (SpiritEntity) inv.player.level().getEntity(data.readInt())); })); - public static final RegistryObject> SPIRIT_TRANSPORTER = + public static final Supplier> SPIRIT_TRANSPORTER = CONTAINERS.register("spirit_transporter", - () -> IForgeMenuType + () -> IMenuTypeExtension .create((windowId, inv, data) -> { return new SpiritTransporterContainer(windowId, inv, (SpiritEntity) inv.player.level().getEntity(data.readInt())); })); - public static final RegistryObject> OTHERWORLD_MINER = + public static final Supplier> OTHERWORLD_MINER = CONTAINERS.register("otherworld_miner", - () -> IForgeMenuType + () -> IMenuTypeExtension .create((windowId, inv, data) -> new DimensionalMineshaftContainer(windowId, inv, (DimensionalMineshaftBlockEntity) inv.player.level().getBlockEntity( data.readBlockPos())))); - public static final RegistryObject> SATCHEL = - CONTAINERS.register("satchel", () -> IForgeMenuType.create(SatchelContainer::createClientContainer)); + public static final Supplier> SATCHEL = + CONTAINERS.register("satchel", () -> IMenuTypeExtension.create(SatchelContainer::createClientContainer)); } diff --git a/src/main/java/com/klikli_dev/occultism/registry/OccultismCreativeModeTabs.java b/src/main/java/com/klikli_dev/occultism/registry/OccultismCreativeModeTabs.java index 632fc46c8..2214cd9f0 100644 --- a/src/main/java/com/klikli_dev/occultism/registry/OccultismCreativeModeTabs.java +++ b/src/main/java/com/klikli_dev/occultism/registry/OccultismCreativeModeTabs.java @@ -5,27 +5,26 @@ import net.minecraft.network.chat.Component; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.CreativeModeTabs; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.neoforge.registries.DeferredHolder; +import net.neoforged.neoforge.registries.DeferredRegister; public class OccultismCreativeModeTabs { - public static final DeferredRegister CREATIVE_MODE_TABS = - DeferredRegister.create(Registries.CREATIVE_MODE_TAB, Occultism.MODID); + public static final DeferredRegister CREATIVE_MODE_TABS = DeferredRegister.create(Registries.CREATIVE_MODE_TAB, Occultism.MODID); - public static final RegistryObject OCCULTISM = CREATIVE_MODE_TABS.register("occultism", + public static final DeferredHolder OCCULTISM = CREATIVE_MODE_TABS.register("occultism", () -> CreativeModeTab.builder() - .title(Component.translatable("itemGroup.occultism")) - .withTabsBefore(CreativeModeTabs.SPAWN_EGGS) - .icon(() -> OccultismItems.PENTACLE.get().getDefaultInstance()) - .displayItems((parameters, output) -> { - OccultismItems.ITEMS.getEntries().forEach(i -> { + .title(Component.translatable("itemGroup.occultism")) + .withTabsBefore(CreativeModeTabs.SPAWN_EGGS) + .icon(() -> OccultismItems.PENTACLE.get().getDefaultInstance()) + .displayItems((parameters, output) -> { + OccultismItems.ITEMS.getEntries().forEach(i -> { - if (!OccultismItems.shouldSkipCreativeModTab(i.get())) { - output.accept(i.get()); - } - }); - output.accept(OccultismItems.DICTIONARY_OF_SPIRITS.get().getCreativeModeTabDisplayStack()); - }).build()); + if (!OccultismItems.shouldSkipCreativeModTab(i.get())) { + output.accept(i.get()); + } + }); + output.accept(OccultismItems.DICTIONARY_OF_SPIRITS.get().getCreativeModeTabDisplayStack()); + }).build()); } \ No newline at end of file diff --git a/src/main/java/com/klikli_dev/occultism/registry/OccultismDataStorage.java b/src/main/java/com/klikli_dev/occultism/registry/OccultismDataStorage.java new file mode 100644 index 000000000..d983e0b6f --- /dev/null +++ b/src/main/java/com/klikli_dev/occultism/registry/OccultismDataStorage.java @@ -0,0 +1,37 @@ +package com.klikli_dev.occultism.registry; + +import com.klikli_dev.occultism.Occultism; +import com.klikli_dev.occultism.common.capability.FamiliarSettingsData; +import com.mojang.serialization.Codec; +import net.minecraft.server.level.ServerPlayer; +import net.neoforged.neoforge.attachment.AttachmentType; +import net.neoforged.neoforge.event.entity.EntityJoinLevelEvent; +import net.neoforged.neoforge.event.entity.player.PlayerEvent; +import net.neoforged.neoforge.registries.DeferredRegister; +import net.neoforged.neoforge.registries.NeoForgeRegistries; + +import java.util.function.Supplier; + +public class OccultismDataStorage { + public static final DeferredRegister> ATTACHMENT_TYPES = DeferredRegister.create(NeoForgeRegistries.ATTACHMENT_TYPES, Occultism.MODID); + + public static final Supplier> DOUBLE_JUMP = ATTACHMENT_TYPES.register( + "double_jump", () -> AttachmentType.builder(() -> 0).serialize(Codec.INT).build()); + + public static final Supplier> FAMILIAR_SETTINGS = ATTACHMENT_TYPES.register( + "familiar_settings", () -> AttachmentType.serializable(FamiliarSettingsData::new).build()); + + public static void onPlayerClone(final PlayerEvent.Clone event) { + //only handle respawn after death -> not portal transfers + if (event.isWasDeath() && event.getOriginal().hasData(FAMILIAR_SETTINGS)) { + event.getEntity().getData(FAMILIAR_SETTINGS).clone(event.getOriginal().getData(FAMILIAR_SETTINGS)); + } + } + + public static void onJoinWorld(final EntityJoinLevelEvent event) { + if (event.getEntity() instanceof ServerPlayer player) { + FamiliarSettingsData.syncFor(player); + } + } + +} diff --git a/src/main/java/com/klikli_dev/occultism/registry/OccultismEffects.java b/src/main/java/com/klikli_dev/occultism/registry/OccultismEffects.java index bbf0c073b..1c031ab73 100644 --- a/src/main/java/com/klikli_dev/occultism/registry/OccultismEffects.java +++ b/src/main/java/com/klikli_dev/occultism/registry/OccultismEffects.java @@ -25,28 +25,28 @@ import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.common.effect.DoubleJumpEffect; import com.klikli_dev.occultism.common.effect.ThirdEyeEffect; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.world.effect.MobEffect; import net.minecraft.world.effect.MobEffectCategory; import net.minecraft.world.entity.ai.attributes.AttributeModifier; -import net.minecraft.world.entity.ai.attributes.Attributes; -import net.minecraftforge.common.ForgeMod; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.neoforge.common.NeoForgeMod; +import net.neoforged.neoforge.registries.DeferredRegister; + +import java.util.function.Supplier; public class OccultismEffects { - public static final DeferredRegister EFFECTS = DeferredRegister.create(ForgeRegistries.MOB_EFFECTS, Occultism.MODID); + public static final DeferredRegister EFFECTS = DeferredRegister.create(BuiltInRegistries.MOB_EFFECT, Occultism.MODID); - public static final RegistryObject THIRD_EYE = EFFECTS.register("third_eye", ThirdEyeEffect::new); - public static final RegistryObject DOUBLE_JUMP = EFFECTS.register("double_jump", DoubleJumpEffect::new); - public static final RegistryObject DRAGON_GREED = EFFECTS.register("dragon_greed", () -> new ModEffect(MobEffectCategory.BENEFICIAL, 0xFFD700)); - public static final RegistryObject MUMMY_DODGE = EFFECTS.register("mummy_dodge", () -> new ModEffect(MobEffectCategory.BENEFICIAL, 0xe4d8a7)); - public static final RegistryObject BAT_LIFESTEAL = EFFECTS.register("bat_lifesteal", () -> new ModEffect(MobEffectCategory.BENEFICIAL, 0x960201)); - public static final RegistryObject BEAVER_HARVEST = EFFECTS.register("beaver_harvest", () -> new ModEffect(MobEffectCategory.BENEFICIAL, 0x603613)); + public static final Supplier THIRD_EYE = EFFECTS.register("third_eye", ThirdEyeEffect::new); + public static final Supplier DOUBLE_JUMP = EFFECTS.register("double_jump", DoubleJumpEffect::new); + public static final Supplier DRAGON_GREED = EFFECTS.register("dragon_greed", () -> new ModEffect(MobEffectCategory.BENEFICIAL, 0xFFD700)); + public static final Supplier MUMMY_DODGE = EFFECTS.register("mummy_dodge", () -> new ModEffect(MobEffectCategory.BENEFICIAL, 0xe4d8a7)); + public static final Supplier BAT_LIFESTEAL = EFFECTS.register("bat_lifesteal", () -> new ModEffect(MobEffectCategory.BENEFICIAL, 0x960201)); + public static final Supplier BEAVER_HARVEST = EFFECTS.register("beaver_harvest", () -> new ModEffect(MobEffectCategory.BENEFICIAL, 0x603613)); - public static final RegistryObject STEP_HEIGHT = EFFECTS.register("step_height", () -> + public static final Supplier STEP_HEIGHT = EFFECTS.register("step_height", () -> new ModEffect(MobEffectCategory.BENEFICIAL, 3402751) - .addAttributeModifier(ForgeMod.STEP_HEIGHT_ADDITION.get(), "748e2cfd-8db4-4b55-ba07-014fdf0f74da", 2, AttributeModifier.Operation.ADDITION)); + .addAttributeModifier(NeoForgeMod.STEP_HEIGHT.value(), "748e2cfd-8db4-4b55-ba07-014fdf0f74da", 2, AttributeModifier.Operation.ADDITION)); public static class ModEffect extends MobEffect { diff --git a/src/main/java/com/klikli_dev/occultism/registry/OccultismEntities.java b/src/main/java/com/klikli_dev/occultism/registry/OccultismEntities.java index ad43a72d9..14d740d73 100644 --- a/src/main/java/com/klikli_dev/occultism/registry/OccultismEntities.java +++ b/src/main/java/com/klikli_dev/occultism/registry/OccultismEntities.java @@ -26,275 +26,276 @@ import com.klikli_dev.occultism.common.entity.familiar.*; import com.klikli_dev.occultism.common.entity.possessed.*; import com.klikli_dev.occultism.common.entity.spirit.*; -import com.klikli_dev.occultism.util.StaticUtil; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.MobCategory; import net.minecraft.world.level.Level; -import net.minecraftforge.common.util.NonNullLazy; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.neoforge.common.util.NonNullLazy; +import net.neoforged.neoforge.registries.DeferredRegister; + +import java.util.function.Supplier; public class OccultismEntities { - public static final DeferredRegister> ENTITIES = DeferredRegister.create(ForgeRegistries.ENTITY_TYPES, + public static final DeferredRegister> ENTITIES = DeferredRegister.create(BuiltInRegistries.ENTITY_TYPE, Occultism.MODID); public static final NonNullLazy> FOLIOT_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(FoliotEntity::new, MobCategory.CREATURE) .sized(0.6f, 1.1f) .clientTrackingRange(8) - .build(StaticUtil.modLoc("foliot").toString())); + .build(new ResourceLocation(Occultism.MODID, "foliot").toString())); public static final NonNullLazy> DJINNI_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(DjinniEntity::new, MobCategory.CREATURE) .sized(0.6f, 1.1f) .clientTrackingRange(8) - .build(StaticUtil.modLoc("djinni").toString())); + .build(new ResourceLocation(Occultism.MODID, "djinni").toString())); public static final NonNullLazy> AFRIT_TYPE = NonNullLazy.of(() -> EntityType.Builder.of((EntityType t, Level l) -> new AfritEntity(t, l), MobCategory.CREATURE) .fireImmune() .sized(1.2f, 2.4f) .clientTrackingRange(8) - .build(StaticUtil.modLoc("afrit").toString())); + .build(new ResourceLocation(Occultism.MODID, "afrit").toString())); public static final NonNullLazy> AFRIT_WILD_TYPE = NonNullLazy.of(() -> EntityType.Builder.of((EntityType t, Level l) -> new AfritWildEntity(t, l), MobCategory.CREATURE) .fireImmune() .sized(1.2f, 2.4f) .clientTrackingRange(8) - .build(StaticUtil.modLoc("afrit_wild").toString())); + .build(new ResourceLocation(Occultism.MODID, "afrit_wild").toString())); public static final NonNullLazy> MARID_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(MaridEntity::new, MobCategory.CREATURE) .sized(1.2f, 2.4f) .clientTrackingRange(8) - .build(StaticUtil.modLoc("marid").toString())); + .build(new ResourceLocation(Occultism.MODID, "marid").toString())); public static final NonNullLazy> POSSESSED_ENDERMITE_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(PossessedEndermiteEntity::new, MobCategory.MONSTER) .sized(0.4F, 0.3F) .clientTrackingRange(8) - .build(StaticUtil.modLoc("possessed_endermite").toString())); + .build(new ResourceLocation(Occultism.MODID, "possessed_endermite").toString())); public static final NonNullLazy> POSSESSED_SKELETON_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(PossessedSkeletonEntity::new, MobCategory.MONSTER) .sized(0.6F, 1.99F) .clientTrackingRange(8) - .build(StaticUtil.modLoc("possessed_skeleton").toString())); + .build(new ResourceLocation(Occultism.MODID, "possessed_skeleton").toString())); public static final NonNullLazy> POSSESSED_ENDERMAN_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(PossessedEndermanEntity::new, MobCategory.MONSTER) .sized(0.6F, 2.9F) .clientTrackingRange(8) - .build(StaticUtil.modLoc("possessed_enderman").toString())); + .build(new ResourceLocation(Occultism.MODID, "possessed_enderman").toString())); public static final NonNullLazy> POSSESSED_GHAST_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(PossessedGhastEntity::new, MobCategory.MONSTER) .fireImmune() .sized(4.0F, 4.0F) .clientTrackingRange(10) - .build(StaticUtil.modLoc("possessed_ghast").toString())); + .build(new ResourceLocation(Occultism.MODID, "possessed_ghast").toString())); public static final NonNullLazy> POSSESSED_PHANTOM_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(PossessedPhantomEntity::new, MobCategory.MONSTER) .fireImmune() .sized(0.9F, 0.5F) .clientTrackingRange(16) - .build(StaticUtil.modLoc("possessed_phantom").toString())); + .build(new ResourceLocation(Occultism.MODID, "possessed_phantom").toString())); public static final NonNullLazy> POSSESSED_WEAK_SHULKER_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(PossessedWeakShulkerEntity::new, MobCategory.MONSTER) .fireImmune() .sized(1F, 1F) .clientTrackingRange(8) - .build(StaticUtil.modLoc("possessed_weak_shulker").toString())); + .build(new ResourceLocation(Occultism.MODID, "possessed_weak_shulker").toString())); public static final NonNullLazy> POSSESSED_SHULKER_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(PossessedShulkerEntity::new, MobCategory.MONSTER) .fireImmune() .sized(1F, 1F) .clientTrackingRange(8) - .build(StaticUtil.modLoc("possessed_shulker").toString())); + .build(new ResourceLocation(Occultism.MODID, "possessed_shulker").toString())); public static final NonNullLazy> POSSESSED_ELDER_GUARDIAN_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(PossessedElderGuardianEntity::new, MobCategory.MONSTER) .fireImmune() .sized(2F, 2F) .clientTrackingRange(24) - .build(StaticUtil.modLoc("possessed_elder_guardian").toString())); + .build(new ResourceLocation(Occultism.MODID, "possessed_elder_guardian").toString())); public static final NonNullLazy> WILD_HUNT_SKELETON_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(WildHuntSkeletonEntity::new, MobCategory.MONSTER) .sized(0.6F, 2.9F) .clientTrackingRange(8) - .build(StaticUtil.modLoc("wild_hunt_skeleton").toString())); + .build(new ResourceLocation(Occultism.MODID, "wild_hunt_skeleton").toString())); public static final NonNullLazy> WILD_HUNT_WITHER_SKELETON_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(WildHuntWitherSkeletonEntity::new, MobCategory.MONSTER) .sized(0.6F, 2.9F) .clientTrackingRange(8) - .build(StaticUtil.modLoc("wild_hunt_wither_skeleton").toString())); + .build(new ResourceLocation(Occultism.MODID, "wild_hunt_wither_skeleton").toString())); public static final NonNullLazy> OTHERWORLD_BIRD_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(OtherworldBirdEntity::new, MobCategory.CREATURE) .sized(0.5F, 0.9F) .clientTrackingRange(8) - .build(StaticUtil.modLoc("otherworld_bird").toString())); + .build(new ResourceLocation(Occultism.MODID, "otherworld_bird").toString())); public static final NonNullLazy> GREEDY_FAMILIAR_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(GreedyFamiliarEntity::new, MobCategory.CREATURE) .sized(0.5F, 0.9F) .clientTrackingRange(8) - .build(StaticUtil.modLoc("greedy_familiar").toString())); + .build(new ResourceLocation(Occultism.MODID, "greedy_familiar").toString())); public static final NonNullLazy> BAT_FAMILIAR_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(BatFamiliarEntity::new, MobCategory.CREATURE) .sized(0.5F, 0.9F) .clientTrackingRange(8) - .build(StaticUtil.modLoc("bat_familiar").toString())); + .build(new ResourceLocation(Occultism.MODID, "bat_familiar").toString())); public static final NonNullLazy> DEER_FAMILIAR_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(DeerFamiliarEntity::new, MobCategory.CREATURE) .sized(0.6F, 1.0F) .clientTrackingRange(8) - .build(StaticUtil.modLoc("deer_familiar").toString())); + .build(new ResourceLocation(Occultism.MODID, "deer_familiar").toString())); public static final NonNullLazy> CTHULHU_FAMILIAR_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(CthulhuFamiliarEntity::new, MobCategory.CREATURE) .sized(0.6F, 1.0F) .clientTrackingRange(8) - .build(StaticUtil.modLoc("cthulhu_familiar").toString())); + .build(new ResourceLocation(Occultism.MODID, "cthulhu_familiar").toString())); public static final NonNullLazy> DEVIL_FAMILIAR_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(DevilFamiliarEntity::new, MobCategory.CREATURE) .sized(0.8F, 1.5F) .fireImmune() .clientTrackingRange(8) - .build(StaticUtil.modLoc("devil_familiar").toString())); + .build(new ResourceLocation(Occultism.MODID, "devil_familiar").toString())); public static final NonNullLazy> DRAGON_FAMILIAR_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(DragonFamiliarEntity::new, MobCategory.CREATURE) .sized(1F, 0.8F) .clientTrackingRange(8) .fireImmune() - .build(StaticUtil.modLoc("dragon_familiar").toString())); + .build(new ResourceLocation(Occultism.MODID, "dragon_familiar").toString())); public static final NonNullLazy> BLACKSMITH_FAMILIAR_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(BlacksmithFamiliarEntity::new, MobCategory.CREATURE) .sized(0.65F, 1F) .clientTrackingRange(8) - .build(StaticUtil.modLoc("blacksmith_familiar").toString())); + .build(new ResourceLocation(Occultism.MODID, "blacksmith_familiar").toString())); public static final NonNullLazy> GUARDIAN_FAMILIAR_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(GuardianFamiliarEntity::new, MobCategory.CREATURE) .sized(0.8F, 1.5F) .clientTrackingRange(8) .fireImmune() - .build(StaticUtil.modLoc("guardian_familiar").toString())); + .build(new ResourceLocation(Occultism.MODID, "guardian_familiar").toString())); public static final NonNullLazy> HEADLESS_FAMILIAR_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(HeadlessFamiliarEntity::new, MobCategory.CREATURE) .sized(0.7F, 1.1F) .clientTrackingRange(8) - .build(StaticUtil.modLoc("headless_familiar").toString())); + .build(new ResourceLocation(Occultism.MODID, "headless_familiar").toString())); public static final NonNullLazy> CHIMERA_FAMILIAR_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(ChimeraFamiliarEntity::new, MobCategory.CREATURE) .sized(0.85F, 1.05F) .clientTrackingRange(8) - .build(StaticUtil.modLoc("chimera_familiar").toString())); + .build(new ResourceLocation(Occultism.MODID, "chimera_familiar").toString())); public static final NonNullLazy> GOAT_FAMILIAR_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(GoatFamiliarEntity::new, MobCategory.CREATURE) .sized(0.7F, 0.8F) .clientTrackingRange(8) - .build(StaticUtil.modLoc("goat_familiar").toString())); + .build(new ResourceLocation(Occultism.MODID, "goat_familiar").toString())); public static final NonNullLazy> SHUB_NIGGURATH_FAMILIAR_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(ShubNiggurathFamiliarEntity::new, MobCategory.CREATURE) .sized(0.7F, 0.8F) .clientTrackingRange(8) - .build(StaticUtil.modLoc("shub_niggurath_familiar").toString())); + .build(new ResourceLocation(Occultism.MODID, "shub_niggurath_familiar").toString())); public static final NonNullLazy> BEHOLDER_FAMILIAR_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(BeholderFamiliarEntity::new, MobCategory.CREATURE) .sized(1.6F, 1F) .clientTrackingRange(8) - .build(StaticUtil.modLoc("beholder_familiar").toString())); + .build(new ResourceLocation(Occultism.MODID, "beholder_familiar").toString())); public static final NonNullLazy> FAIRY_FAMILIAR_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(FairyFamiliarEntity::new, MobCategory.CREATURE) .sized(0.6F, 1F) .clientTrackingRange(8) .fireImmune() - .build(StaticUtil.modLoc("fairy_familiar").toString())); + .build(new ResourceLocation(Occultism.MODID, "fairy_familiar").toString())); public static final NonNullLazy> MUMMY_FAMILIAR_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(MummyFamiliarEntity::new, MobCategory.CREATURE) .sized(0.6F, 1.2F) .clientTrackingRange(8) - .build(StaticUtil.modLoc("mummy_familiar").toString())); + .build(new ResourceLocation(Occultism.MODID, "mummy_familiar").toString())); public static final NonNullLazy> BEAVER_FAMILIAR_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(BeaverFamiliarEntity::new, MobCategory.CREATURE) .sized(0.7F, 0.6F) .clientTrackingRange(8) - .build(StaticUtil.modLoc("beaver_familiar").toString())); + .build(new ResourceLocation(Occultism.MODID, "beaver_familiar").toString())); public static final NonNullLazy> THROWN_SWORD_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(ThrownSwordEntity::new, MobCategory.MISC) .sized(0.5F, 0.5F) .clientTrackingRange(8) - .build(StaticUtil.modLoc("thrown_sword").toString())); + .build(new ResourceLocation(Occultism.MODID, "thrown_sword").toString())); public static final NonNullLazy> SHUB_NIGGURATH_SPAWN_TYPE = NonNullLazy.of(() -> EntityType.Builder.of(ShubNiggurathSpawnEntity::new, MobCategory.CREATURE) .sized(0.6F, 0.6F) .clientTrackingRange(8) - .build(StaticUtil.modLoc("shub_niggurath_spawn").toString())); + .build(new ResourceLocation(Occultism.MODID, "shub_niggurath_spawn").toString())); - public static final RegistryObject> FOLIOT = ENTITIES.register("foliot", FOLIOT_TYPE::get); - public static final RegistryObject> DJINNI = ENTITIES.register("djinni", DJINNI_TYPE::get); - public static final RegistryObject> AFRIT = ENTITIES.register("afrit", AFRIT_TYPE::get); - public static final RegistryObject> AFRIT_WILD = ENTITIES.register("afrit_wild", AFRIT_WILD_TYPE::get); - public static final RegistryObject> MARID = ENTITIES.register("marid", MARID_TYPE::get); + public static final Supplier> FOLIOT = ENTITIES.register("foliot", FOLIOT_TYPE::get); + public static final Supplier> DJINNI = ENTITIES.register("djinni", DJINNI_TYPE::get); + public static final Supplier> AFRIT = ENTITIES.register("afrit", AFRIT_TYPE::get); + public static final Supplier> AFRIT_WILD = ENTITIES.register("afrit_wild", AFRIT_WILD_TYPE::get); + public static final Supplier> MARID = ENTITIES.register("marid", MARID_TYPE::get); - public static final RegistryObject> POSSESSED_ENDERMITE = + public static final Supplier> POSSESSED_ENDERMITE = ENTITIES.register("possessed_endermite", POSSESSED_ENDERMITE_TYPE::get); - public static final RegistryObject> POSSESSED_SKELETON = + public static final Supplier> POSSESSED_SKELETON = ENTITIES.register("possessed_skeleton", POSSESSED_SKELETON_TYPE::get); - public static final RegistryObject> POSSESSED_ENDERMAN = + public static final Supplier> POSSESSED_ENDERMAN = ENTITIES.register("possessed_enderman", POSSESSED_ENDERMAN_TYPE::get); - public static final RegistryObject> POSSESSED_GHAST = + public static final Supplier> POSSESSED_GHAST = ENTITIES.register("possessed_ghast", POSSESSED_GHAST_TYPE::get); - public static final RegistryObject> POSSESSED_PHANTOM = + public static final Supplier> POSSESSED_PHANTOM = ENTITIES.register("possessed_phantom", POSSESSED_PHANTOM_TYPE::get); - public static final RegistryObject> POSSESSED_WEAK_SHULKER = + public static final Supplier> POSSESSED_WEAK_SHULKER = ENTITIES.register("possessed_weak_shulker", POSSESSED_WEAK_SHULKER_TYPE::get); - public static final RegistryObject> POSSESSED_SHULKER = + public static final Supplier> POSSESSED_SHULKER = ENTITIES.register("possessed_shulker", POSSESSED_SHULKER_TYPE::get); - public static final RegistryObject> POSSESSED_ELDER_GUARDIAN = + public static final Supplier> POSSESSED_ELDER_GUARDIAN = ENTITIES.register("possessed_elder_guardian", POSSESSED_ELDER_GUARDIAN_TYPE::get); - public static final RegistryObject> WILD_HUNT_SKELETON = + public static final Supplier> WILD_HUNT_SKELETON = ENTITIES.register("wild_hunt_skeleton", WILD_HUNT_SKELETON_TYPE::get); - public static final RegistryObject> WILD_HUNT_WITHER_SKELETON = + public static final Supplier> WILD_HUNT_WITHER_SKELETON = ENTITIES.register("wild_hunt_wither_skeleton", WILD_HUNT_WITHER_SKELETON_TYPE::get); - public static final RegistryObject> OTHERWORLD_BIRD = + public static final Supplier> OTHERWORLD_BIRD = ENTITIES.register("otherworld_bird", OTHERWORLD_BIRD_TYPE::get); - public static final RegistryObject> GREEDY_FAMILIAR = + public static final Supplier> GREEDY_FAMILIAR = ENTITIES.register("greedy_familiar", GREEDY_FAMILIAR_TYPE::get); - public static final RegistryObject> BAT_FAMILIAR = + public static final Supplier> BAT_FAMILIAR = ENTITIES.register("bat_familiar", BAT_FAMILIAR_TYPE::get); - public static final RegistryObject> DEER_FAMILIAR = + public static final Supplier> DEER_FAMILIAR = ENTITIES.register("deer_familiar", DEER_FAMILIAR_TYPE::get); - public static final RegistryObject> CTHULHU_FAMILIAR = + public static final Supplier> CTHULHU_FAMILIAR = ENTITIES.register("cthulhu_familiar", CTHULHU_FAMILIAR_TYPE::get); - public static final RegistryObject> DEVIL_FAMILIAR = + public static final Supplier> DEVIL_FAMILIAR = ENTITIES.register("devil_familiar", DEVIL_FAMILIAR_TYPE::get); - public static final RegistryObject> DRAGON_FAMILIAR = + public static final Supplier> DRAGON_FAMILIAR = ENTITIES.register("dragon_familiar", DRAGON_FAMILIAR_TYPE::get); - public static final RegistryObject> BLACKSMITH_FAMILIAR = + public static final Supplier> BLACKSMITH_FAMILIAR = ENTITIES.register("blacksmith_familiar", BLACKSMITH_FAMILIAR_TYPE::get); - public static final RegistryObject> GUARDIAN_FAMILIAR = + public static final Supplier> GUARDIAN_FAMILIAR = ENTITIES.register("guardian_familiar", GUARDIAN_FAMILIAR_TYPE::get); - public static final RegistryObject> HEADLESS_FAMILIAR = + public static final Supplier> HEADLESS_FAMILIAR = ENTITIES.register("headless_familiar", HEADLESS_FAMILIAR_TYPE::get); - public static final RegistryObject> CHIMERA_FAMILIAR = + public static final Supplier> CHIMERA_FAMILIAR = ENTITIES.register("chimera_familiar", CHIMERA_FAMILIAR_TYPE::get); - public static final RegistryObject> GOAT_FAMILIAR = + public static final Supplier> GOAT_FAMILIAR = ENTITIES.register("goat_familiar", GOAT_FAMILIAR_TYPE::get); - public static final RegistryObject> SHUB_NIGGURATH_FAMILIAR = + public static final Supplier> SHUB_NIGGURATH_FAMILIAR = ENTITIES.register("shub_niggurath_familiar", SHUB_NIGGURATH_FAMILIAR_TYPE::get); - public static final RegistryObject> BEHOLDER_FAMILIAR = + public static final Supplier> BEHOLDER_FAMILIAR = ENTITIES.register("beholder_familiar", BEHOLDER_FAMILIAR_TYPE::get); - public static final RegistryObject> FAIRY_FAMILIAR = + public static final Supplier> FAIRY_FAMILIAR = ENTITIES.register("fairy_familiar", FAIRY_FAMILIAR_TYPE::get); - public static final RegistryObject> MUMMY_FAMILIAR = + public static final Supplier> MUMMY_FAMILIAR = ENTITIES.register("mummy_familiar", MUMMY_FAMILIAR_TYPE::get); - public static final RegistryObject> BEAVER_FAMILIAR = + public static final Supplier> BEAVER_FAMILIAR = ENTITIES.register("beaver_familiar", BEAVER_FAMILIAR_TYPE::get); - public static final RegistryObject> THROWN_SWORD = + public static final Supplier> THROWN_SWORD = ENTITIES.register("thrown_sword", THROWN_SWORD_TYPE::get); - public static final RegistryObject> SHUB_NIGGURATH_SPAWN = + public static final Supplier> SHUB_NIGGURATH_SPAWN = ENTITIES.register("shub_niggurath_spawn", SHUB_NIGGURATH_SPAWN_TYPE::get); } diff --git a/src/main/java/com/klikli_dev/occultism/registry/OccultismFeatures.java b/src/main/java/com/klikli_dev/occultism/registry/OccultismFeatures.java index fd7c2062f..f33ccbbe8 100644 --- a/src/main/java/com/klikli_dev/occultism/registry/OccultismFeatures.java +++ b/src/main/java/com/klikli_dev/occultism/registry/OccultismFeatures.java @@ -27,20 +27,20 @@ import com.klikli_dev.occultism.common.level.cave.UndergroundGroveDecorator; import com.klikli_dev.occultism.common.level.multichunk.MultiChunkFeature; import com.klikli_dev.occultism.common.level.multichunk.MultiChunkFeatureConfig; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.world.level.levelgen.feature.Feature; import net.minecraft.world.level.levelgen.placement.*; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.neoforge.registries.DeferredRegister; import java.util.List; +import java.util.function.Supplier; public class OccultismFeatures { public static final DeferredRegister> FEATURES = - DeferredRegister.create(ForgeRegistries.FEATURES, Occultism.MODID); + DeferredRegister.create(BuiltInRegistries.FEATURE, Occultism.MODID); - public static final RegistryObject UNDERGROUND_GROVE_FEATURE = + public static final Supplier UNDERGROUND_GROVE_FEATURE = FEATURES.register("underground_grove", () -> new MultiChunkFeature( MultiChunkFeatureConfig.CODEC, diff --git a/src/main/java/com/klikli_dev/occultism/registry/OccultismFoods.java b/src/main/java/com/klikli_dev/occultism/registry/OccultismFoods.java index 0fe67d1f2..b7e4d002b 100644 --- a/src/main/java/com/klikli_dev/occultism/registry/OccultismFoods.java +++ b/src/main/java/com/klikli_dev/occultism/registry/OccultismFoods.java @@ -25,7 +25,7 @@ import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.effect.MobEffects; import net.minecraft.world.food.FoodProperties; -import net.minecraftforge.common.util.NonNullLazy; +import net.neoforged.neoforge.common.util.NonNullLazy; public class OccultismFoods { public static final NonNullLazy DATURA = NonNullLazy.of( diff --git a/src/main/java/com/klikli_dev/occultism/registry/OccultismItems.java b/src/main/java/com/klikli_dev/occultism/registry/OccultismItems.java index a6abc8571..2ec752996 100644 --- a/src/main/java/com/klikli_dev/occultism/registry/OccultismItems.java +++ b/src/main/java/com/klikli_dev/occultism/registry/OccultismItems.java @@ -37,337 +37,336 @@ import net.minecraft.world.entity.EntityType; import net.minecraft.world.item.*; import net.minecraft.world.level.block.ComposterBlock; -import net.minecraftforge.common.ForgeSpawnEggItem; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.neoforge.common.DeferredSpawnEggItem; +import net.neoforged.neoforge.registries.DeferredItem; +import net.neoforged.neoforge.registries.DeferredRegister; public class OccultismItems { - public static final DeferredRegister ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, Occultism.MODID); + public static final DeferredRegister.Items ITEMS = DeferredRegister.createItems(Occultism.MODID); //Debug and placeholder items - public static final RegistryObject DICTIONARY_OF_SPIRITS_ICON = + public static final DeferredItem DICTIONARY_OF_SPIRITS_ICON = ITEMS.register("dictionary_of_spirits_icon", () -> new Item(new Item.Properties())); - public static final RegistryObject DICTIONARY_OF_SPIRITS = ITEMS.register("dictionary_of_spirits", + public static final DeferredItem DICTIONARY_OF_SPIRITS = ITEMS.register("dictionary_of_spirits", () -> new GuideBookItem(defaultProperties().stacksTo(1))); - public static final RegistryObject PENTACLE = ITEMS.register("pentacle", + public static final DeferredItem PENTACLE = ITEMS.register("pentacle", () -> new Item(new Item.Properties())); - public static final RegistryObject DEBUG_WAND = ITEMS.register("debug_wand", + public static final DeferredItem DEBUG_WAND = ITEMS.register("debug_wand", () -> new DebugWandItem(defaultProperties().stacksTo(1))); - public static final RegistryObject DEBUG_FOLIOT_LUMBERJACK = ITEMS.register("debug_foliot_lumberjack", + public static final DeferredItem DEBUG_FOLIOT_LUMBERJACK = ITEMS.register("debug_foliot_lumberjack", () -> new SummonFoliotLumberjackItem(defaultProperties().stacksTo(1))); - public static final RegistryObject DEBUG_FOLIOT_TRANSPORT_ITEMS = + public static final DeferredItem DEBUG_FOLIOT_TRANSPORT_ITEMS = ITEMS.register("debug_foliot_transport_items", () -> new SummonFoliotTransportItemsItem(defaultProperties().stacksTo(1))); - public static final RegistryObject DEBUG_FOLIOT_CLEANER = + public static final DeferredItem DEBUG_FOLIOT_CLEANER = ITEMS.register("debug_foliot_cleaner", () -> new SummonFoliotCleanerItem(defaultProperties().stacksTo(1))); - public static final RegistryObject DEBUG_FOLIOT_TRADER_ITEM = ITEMS.register("debug_foliot_trader", + public static final DeferredItem DEBUG_FOLIOT_TRADER_ITEM = ITEMS.register("debug_foliot_trader", () -> new SummonFoliotTraderItem(defaultProperties().stacksTo(1))); - public static final RegistryObject DEBUG_DJINNI_MANAGE_MACHINE = ITEMS.register("debug_djinni_manage_machine", + public static final DeferredItem DEBUG_DJINNI_MANAGE_MACHINE = ITEMS.register("debug_djinni_manage_machine", () -> new SummonDjinniManageMachineItem(defaultProperties().stacksTo(1))); - public static final RegistryObject DEBUG_DJINNI_TEST = ITEMS.register("debug_djinni_test", + public static final DeferredItem DEBUG_DJINNI_TEST = ITEMS.register("debug_djinni_test", () -> new SummonDjinniTest(defaultProperties().stacksTo(1))); - public static final RegistryObject SPIRIT_FIRE = + public static final DeferredItem SPIRIT_FIRE = ITEMS.register("spirit_fire", () -> new BlockItem(OccultismBlocks.SPIRIT_FIRE.get(), defaultProperties())); - public static final RegistryObject ADVANCEMENT_ICON = + public static final DeferredItem ADVANCEMENT_ICON = ITEMS.register("advancement_icon", () -> new Item(new Item.Properties())); //Resources - public static final RegistryObject OTHERWORLD_SAPLING_NATURAL = + public static final DeferredItem OTHERWORLD_SAPLING_NATURAL = ITEMS.register("otherworld_sapling_natural", () -> new OtherworldBlockItem(OccultismBlocks.OTHERWORLD_SAPLING_NATURAL.get(), defaultProperties())); - public static final RegistryObject TALLOW = ITEMS.register("tallow", + public static final DeferredItem TALLOW = ITEMS.register("tallow", () -> new Item(defaultProperties())); - public static final RegistryObject AFRIT_ESSENCE = ITEMS.register("afrit_essence", + public static final DeferredItem AFRIT_ESSENCE = ITEMS.register("afrit_essence", () -> new Item(defaultProperties())); //Components - public static final RegistryObject DIMENSIONAL_MATRIX = ITEMS.register("dimensional_matrix", + public static final DeferredItem DIMENSIONAL_MATRIX = ITEMS.register("dimensional_matrix", () -> new DimensionalMatrixItem(defaultProperties())); - public static final RegistryObject SPIRIT_ATTUNED_GEM = ITEMS.register("spirit_attuned_gem", + public static final DeferredItem SPIRIT_ATTUNED_GEM = ITEMS.register("spirit_attuned_gem", () -> new Item(defaultProperties())); - public static final RegistryObject OTHERWORLD_ASHES = ITEMS.register("otherworld_ashes", + public static final DeferredItem OTHERWORLD_ASHES = ITEMS.register("otherworld_ashes", () -> new Item(defaultProperties())); - public static final RegistryObject BURNT_OTHERSTONE = ITEMS.register("burnt_otherstone", + public static final DeferredItem BURNT_OTHERSTONE = ITEMS.register("burnt_otherstone", () -> new Item(defaultProperties())); - public static final RegistryObject OTHERSTONE_FRAME = ITEMS.register("otherstone_frame", + public static final DeferredItem OTHERSTONE_FRAME = ITEMS.register("otherstone_frame", () -> new Item(defaultProperties())); - public static final RegistryObject WORMHOLE_FRAME = ITEMS.register("wormhole_frame", + public static final DeferredItem WORMHOLE_FRAME = ITEMS.register("wormhole_frame", () -> new Item(defaultProperties())); - public static final RegistryObject OTHERSTONE_TABLET = ITEMS.register("otherstone_tablet", + public static final DeferredItem OTHERSTONE_TABLET = ITEMS.register("otherstone_tablet", () -> new Item(defaultProperties())); - public static final RegistryObject STORAGE_REMOTE_INERT = ITEMS.register("storage_remote_inert", + public static final DeferredItem STORAGE_REMOTE_INERT = ITEMS.register("storage_remote_inert", () -> new Item(defaultProperties())); - public static final RegistryObject CHALK_WHITE_IMPURE = ITEMS.register("chalk_white_impure", + public static final DeferredItem CHALK_WHITE_IMPURE = ITEMS.register("chalk_white_impure", () -> new Item(defaultProperties())); - public static final RegistryObject CHALK_RED_IMPURE = ITEMS.register("chalk_red_impure", + public static final DeferredItem CHALK_RED_IMPURE = ITEMS.register("chalk_red_impure", () -> new Item(defaultProperties())); - public static final RegistryObject CHALK_GOLD_IMPURE = ITEMS.register("chalk_gold_impure", + public static final DeferredItem CHALK_GOLD_IMPURE = ITEMS.register("chalk_gold_impure", () -> new Item(defaultProperties())); - public static final RegistryObject CHALK_PURPLE_IMPURE = ITEMS.register("chalk_purple_impure", + public static final DeferredItem CHALK_PURPLE_IMPURE = ITEMS.register("chalk_purple_impure", () -> new Item(defaultProperties())); - public static final RegistryObject RAW_SILVER = ITEMS.register("raw_silver", + public static final DeferredItem RAW_SILVER = ITEMS.register("raw_silver", () -> new Item(defaultProperties())); - public static final RegistryObject RAW_IESNIUM = ITEMS.register("raw_iesnium", + public static final DeferredItem RAW_IESNIUM = ITEMS.register("raw_iesnium", () -> new Item(defaultProperties())); - public static final RegistryObject SILVER_INGOT = ITEMS.register("silver_ingot", + public static final DeferredItem SILVER_INGOT = ITEMS.register("silver_ingot", () -> new Item(defaultProperties())); - public static final RegistryObject IESNIUM_INGOT = ITEMS.register("iesnium_ingot", + public static final DeferredItem IESNIUM_INGOT = ITEMS.register("iesnium_ingot", () -> new Item(defaultProperties())); - public static final RegistryObject SILVER_NUGGET = ITEMS.register("silver_nugget", + public static final DeferredItem SILVER_NUGGET = ITEMS.register("silver_nugget", () -> new Item(defaultProperties())); - public static final RegistryObject IESNIUM_NUGGET = ITEMS.register("iesnium_nugget", + public static final DeferredItem IESNIUM_NUGGET = ITEMS.register("iesnium_nugget", () -> new Item(defaultProperties())); - public static final RegistryObject OBSIDIAN_DUST = ITEMS.register("obsidian_dust", + public static final DeferredItem OBSIDIAN_DUST = ITEMS.register("obsidian_dust", () -> new Item(defaultProperties())); - public static final RegistryObject IRON_DUST = ITEMS.register("iron_dust", + public static final DeferredItem IRON_DUST = ITEMS.register("iron_dust", () -> new Item(defaultProperties())); - public static final RegistryObject GOLD_DUST = ITEMS.register("gold_dust", + public static final DeferredItem GOLD_DUST = ITEMS.register("gold_dust", () -> new Item(defaultProperties())); - public static final RegistryObject COPPER_DUST = ITEMS.register("copper_dust", + public static final DeferredItem COPPER_DUST = ITEMS.register("copper_dust", () -> new Item(defaultProperties())); - public static final RegistryObject SILVER_DUST = ITEMS.register("silver_dust", + public static final DeferredItem SILVER_DUST = ITEMS.register("silver_dust", () -> new Item(defaultProperties())); - public static final RegistryObject IESNIUM_DUST = ITEMS.register("iesnium_dust", + public static final DeferredItem IESNIUM_DUST = ITEMS.register("iesnium_dust", () -> new Item(defaultProperties())); - public static final RegistryObject CRUSHED_END_STONE = ITEMS.register("crushed_end_stone", + public static final DeferredItem CRUSHED_END_STONE = ITEMS.register("crushed_end_stone", () -> new Item(defaultProperties())); - public static final RegistryObject LENSES = ITEMS.register("lenses", + public static final DeferredItem LENSES = ITEMS.register("lenses", () -> new Item(defaultProperties())); - public static final RegistryObject INFUSED_LENSES = ITEMS.register("infused_lenses", + public static final DeferredItem INFUSED_LENSES = ITEMS.register("infused_lenses", () -> new Item(defaultProperties())); - public static final RegistryObject LENS_FRAME = ITEMS.register("lens_frame", + public static final DeferredItem LENS_FRAME = ITEMS.register("lens_frame", () -> new Item(defaultProperties())); - public static final RegistryObject STORAGE_REMOTE = ITEMS.register("storage_remote", + public static final DeferredItem STORAGE_REMOTE = ITEMS.register("storage_remote", () -> new StorageRemoteItem(defaultProperties().stacksTo(1))); - public static final RegistryObject CHALK_WHITE = ITEMS.register("chalk_white", + public static final DeferredItem CHALK_WHITE = ITEMS.register("chalk_white", () -> new ChalkItem(defaultProperties().setNoRepair().durability(128), () -> OccultismBlocks.CHALK_GLYPH_WHITE.get())); - public static final RegistryObject CHALK_GOLD = ITEMS.register("chalk_gold", + public static final DeferredItem CHALK_GOLD = ITEMS.register("chalk_gold", () -> new ChalkItem(defaultProperties().setNoRepair().durability(128), () -> OccultismBlocks.CHALK_GLYPH_GOLD.get())); - public static final RegistryObject CHALK_PURPLE = ITEMS.register("chalk_purple", + public static final DeferredItem CHALK_PURPLE = ITEMS.register("chalk_purple", () -> new ChalkItem(defaultProperties().setNoRepair().durability(128), () -> OccultismBlocks.CHALK_GLYPH_PURPLE.get())); - public static final RegistryObject CHALK_RED = ITEMS.register("chalk_red", + public static final DeferredItem CHALK_RED = ITEMS.register("chalk_red", () -> new ChalkItem(defaultProperties().setNoRepair().durability(128), () -> OccultismBlocks.CHALK_GLYPH_RED.get())); - public static final RegistryObject DIVINATION_ROD = ITEMS.register("divination_rod", + public static final DeferredItem DIVINATION_ROD = ITEMS.register("divination_rod", () -> new DivinationRodItem(defaultProperties().stacksTo(1))); - public static final RegistryObject BRUSH = ITEMS.register("brush", + public static final DeferredItem BRUSH = ITEMS.register("brush", () -> new BrushItem(defaultProperties().stacksTo(1))); - public static final RegistryObject BUTCHER_KNIFE = ITEMS.register("butcher_knife", + public static final DeferredItem BUTCHER_KNIFE = ITEMS.register("butcher_knife", () -> new SwordItem(Tiers.IRON, 3, -2.4F, defaultProperties())); - public static final RegistryObject SPIRIT_ATTUNED_PICKAXE_HEAD = ITEMS.register("spirit_attuned_pickaxe_head", + public static final DeferredItem SPIRIT_ATTUNED_PICKAXE_HEAD = ITEMS.register("spirit_attuned_pickaxe_head", () -> new Item(defaultProperties())); - public static final RegistryObject INFUSED_PICKAXE = ITEMS.register("infused_pickaxe", + public static final DeferredItem INFUSED_PICKAXE = ITEMS.register("infused_pickaxe", () -> new InfusedPickaxeItem(OccultismItemTier.SPIRIT_ATTUNED_GEM, 1, -2.8F, defaultProperties())); - public static final RegistryObject IESNIUM_PICKAXE = ITEMS.register("iesnium_pickaxe", + public static final DeferredItem IESNIUM_PICKAXE = ITEMS.register("iesnium_pickaxe", () -> new OtherworldPickaxeItem(Tiers.DIAMOND, 1, -2.8F, defaultProperties())); - public static final RegistryObject SOUL_GEM_ITEM = ITEMS.register("soul_gem", + public static final DeferredItem SOUL_GEM_ITEM = ITEMS.register("soul_gem", () -> new SoulGemItem(defaultProperties().stacksTo(1))); - public static final RegistryObject SATCHEL = ITEMS.register("satchel", + public static final DeferredItem SATCHEL = ITEMS.register("satchel", () -> new SatchelItem(defaultProperties().stacksTo(1).rarity(Rarity.RARE))); - public static final RegistryObject FAMILIAR_RING = ITEMS.register("familiar_ring", + public static final DeferredItem FAMILIAR_RING = ITEMS.register("familiar_ring", () -> new FamiliarRingItem(defaultProperties().stacksTo(1))); - public static final RegistryObject PURIFIED_INK = ITEMS.register("purified_ink", + public static final DeferredItem PURIFIED_INK = ITEMS.register("purified_ink", () -> new Item(defaultProperties())); - public static final RegistryObject AWAKENED_FEATHER = ITEMS.register("awakened_feather", + public static final DeferredItem AWAKENED_FEATHER = ITEMS.register("awakened_feather", () -> new Item(defaultProperties())); - public static final RegistryObject TABOO_BOOK = ITEMS.register("taboo_book", + public static final DeferredItem TABOO_BOOK = ITEMS.register("taboo_book", () -> new Item(defaultProperties())); //Books of Binding - public static final RegistryObject BOOK_OF_BINDING_EMPTY = ITEMS.register( + public static final DeferredItem BOOK_OF_BINDING_EMPTY = ITEMS.register( "book_of_binding_empty", () -> new BookOfBindingItem(defaultProperties().stacksTo(1))); - public static final RegistryObject BOOK_OF_BINDING_FOLIOT = ITEMS.register( + public static final DeferredItem BOOK_OF_BINDING_FOLIOT = ITEMS.register( "book_of_binding_foliot", () -> new BookOfBindingItem(defaultProperties().stacksTo(1))); - public static final RegistryObject BOOK_OF_BINDING_BOUND_FOLIOT = ITEMS.register( + public static final DeferredItem BOOK_OF_BINDING_BOUND_FOLIOT = ITEMS.register( "book_of_binding_bound_foliot", () -> new BookOfBindingBoundItem(defaultProperties().stacksTo(1))); - public static final RegistryObject BOOK_OF_BINDING_DJINNI = ITEMS.register( + public static final DeferredItem BOOK_OF_BINDING_DJINNI = ITEMS.register( "book_of_binding_djinni", () -> new BookOfBindingItem(defaultProperties().stacksTo(1))); - public static final RegistryObject BOOK_OF_BINDING_BOUND_DJINNI = ITEMS.register( + public static final DeferredItem BOOK_OF_BINDING_BOUND_DJINNI = ITEMS.register( "book_of_binding_bound_djinni", () -> new BookOfBindingBoundItem(defaultProperties().stacksTo(1))); - public static final RegistryObject BOOK_OF_BINDING_AFRIT = ITEMS.register( + public static final DeferredItem BOOK_OF_BINDING_AFRIT = ITEMS.register( "book_of_binding_afrit", () -> new BookOfBindingItem(defaultProperties().stacksTo(1))); - public static final RegistryObject BOOK_OF_BINDING_BOUND_AFRIT = ITEMS.register( + public static final DeferredItem BOOK_OF_BINDING_BOUND_AFRIT = ITEMS.register( "book_of_binding_bound_afrit", () -> new BookOfBindingBoundItem(defaultProperties().stacksTo(1))); - public static final RegistryObject BOOK_OF_BINDING_MARID = ITEMS.register( + public static final DeferredItem BOOK_OF_BINDING_MARID = ITEMS.register( "book_of_binding_marid", () -> new BookOfBindingItem(defaultProperties().stacksTo(1))); - public static final RegistryObject BOOK_OF_BINDING_BOUND_MARID = ITEMS.register( + public static final DeferredItem BOOK_OF_BINDING_BOUND_MARID = ITEMS.register( "book_of_binding_bound_marid", () -> new BookOfBindingBoundItem(defaultProperties().stacksTo(1))); //Books of Calling //Foliot - public static final RegistryObject BOOK_OF_CALLING_FOLIOT_LUMBERJACK = + public static final DeferredItem BOOK_OF_CALLING_FOLIOT_LUMBERJACK = ITEMS.register("book_of_calling_foliot_lumberjack", () -> new BookOfCallingLumberjackItem(defaultProperties().stacksTo(1), TranslationKeys.BOOK_OF_CALLING_GENERIC + "_foliot")); - public static final RegistryObject BOOK_OF_CALLING_FOLIOT_TRANSPORT_ITEMS = + public static final DeferredItem BOOK_OF_CALLING_FOLIOT_TRANSPORT_ITEMS = ITEMS.register("book_of_calling_foliot_transport_items", () -> new BookOfCallingTransportItems(defaultProperties().stacksTo(1), TranslationKeys.BOOK_OF_CALLING_GENERIC + "_foliot")); - public static final RegistryObject BOOK_OF_CALLING_FOLIOT_CLEANER = + public static final DeferredItem BOOK_OF_CALLING_FOLIOT_CLEANER = ITEMS.register("book_of_calling_foliot_cleaner", () -> new BookOfCallingCleanerItem(defaultProperties().stacksTo(1), TranslationKeys.BOOK_OF_CALLING_GENERIC + "_foliot")); //Djinn - public static final RegistryObject BOOK_OF_CALLING_DJINNI_MANAGE_MACHINE = + public static final DeferredItem BOOK_OF_CALLING_DJINNI_MANAGE_MACHINE = ITEMS.register("book_of_calling_djinni_manage_machine", () -> new BookOfCallingManageMachineItem(defaultProperties().stacksTo(1), TranslationKeys.BOOK_OF_CALLING_GENERIC + "_djinni")); //Armor - public static final RegistryObject OTHERWORLD_GOGGLES = ITEMS.register("otherworld_goggles", + public static final DeferredItem OTHERWORLD_GOGGLES = ITEMS.register("otherworld_goggles", () -> new OtherworldGogglesItem(ArmorMaterials.IRON, ArmorItem.Type.HELMET, defaultProperties().stacksTo(1))); //Machines - public static final RegistryObject STABLE_WORMHOLE = ITEMS.register("stable_wormhole", + public static final DeferredItem STABLE_WORMHOLE = ITEMS.register("stable_wormhole", () -> new StableWormholeBlockItem(OccultismBlocks.STABLE_WORMHOLE.get(), defaultProperties())); - public static final RegistryObject STORAGE_CONTROLLER = ITEMS.register("storage_controller", + public static final DeferredItem STORAGE_CONTROLLER = ITEMS.register("storage_controller", () -> new StorageControllerBlockItem(OccultismBlocks.STORAGE_CONTROLLER.get(), defaultProperties())); //Crops - public static final RegistryObject DATURA_SEEDS = + public static final DeferredItem DATURA_SEEDS = ITEMS.register("datura_seeds", () -> new ItemNameBlockItem(OccultismBlocks.DATURA.get(), defaultProperties())); //Foods - public static final RegistryObject DATURA = ITEMS.register("datura", + public static final DeferredItem DATURA = ITEMS.register("datura", () -> new SpiritHealingItem(defaultProperties().food(OccultismFoods.DATURA.get()))); //Miner Spirits - public static final RegistryObject MAGIC_LAMP_EMPTY = ITEMS.register("magic_lamp_empty", + public static final DeferredItem MAGIC_LAMP_EMPTY = ITEMS.register("magic_lamp_empty", () -> new Item(defaultProperties())); - public static final RegistryObject MINER_DEBUG_UNSPECIALIZED = + public static final DeferredItem MINER_DEBUG_UNSPECIALIZED = ITEMS.register("miner_debug_unspecialized", () -> new MinerSpiritItem(defaultProperties().durability(10000), () -> 100, () -> 10, () -> 10000)); - public static final RegistryObject MINER_FOLIOT_UNSPECIALIZED = ITEMS.register("miner_foliot_unspecialized", + public static final DeferredItem MINER_FOLIOT_UNSPECIALIZED = ITEMS.register("miner_foliot_unspecialized", () -> new MinerSpiritItem(defaultProperties().durability(1000), Occultism.SERVER_CONFIG.dimensionalMineshaft.minerFoliotUnspecialized.maxMiningTime, Occultism.SERVER_CONFIG.dimensionalMineshaft.minerFoliotUnspecialized.rollsPerOperation, Occultism.SERVER_CONFIG.dimensionalMineshaft.minerFoliotUnspecialized.durability)); - public static final RegistryObject MINER_DJINNI_ORES = ITEMS.register("miner_djinni_ores", + public static final DeferredItem MINER_DJINNI_ORES = ITEMS.register("miner_djinni_ores", () -> new MinerSpiritItem(defaultProperties().durability(400), Occultism.SERVER_CONFIG.dimensionalMineshaft.minerDjinniOres.maxMiningTime, Occultism.SERVER_CONFIG.dimensionalMineshaft.minerDjinniOres.rollsPerOperation, Occultism.SERVER_CONFIG.dimensionalMineshaft.minerDjinniOres.durability)); - public static final RegistryObject MINER_AFRIT_DEEPS = ITEMS.register("miner_afrit_deeps", + public static final DeferredItem MINER_AFRIT_DEEPS = ITEMS.register("miner_afrit_deeps", () -> new MinerSpiritItem(defaultProperties().durability(800), Occultism.SERVER_CONFIG.dimensionalMineshaft.minerAfritDeeps.maxMiningTime, Occultism.SERVER_CONFIG.dimensionalMineshaft.minerAfritDeeps.rollsPerOperation, Occultism.SERVER_CONFIG.dimensionalMineshaft.minerAfritDeeps.durability)); - public static final RegistryObject MINER_MARID_MASTER = ITEMS.register("miner_marid_master", + public static final DeferredItem MINER_MARID_MASTER = ITEMS.register("miner_marid_master", () -> new MinerSpiritItem(defaultProperties().durability(1600), Occultism.SERVER_CONFIG.dimensionalMineshaft.minerMaridMaster.maxMiningTime, Occultism.SERVER_CONFIG.dimensionalMineshaft.minerMaridMaster.rollsPerOperation, Occultism.SERVER_CONFIG.dimensionalMineshaft.minerMaridMaster.durability)); //JEI Dummy Items - public static final RegistryObject JEI_DUMMY_NONE = ITEMS.register( + public static final DeferredItem JEI_DUMMY_NONE = ITEMS.register( "jei_dummy/none", () -> new DummyTooltipItem(new Item.Properties())); - public static final RegistryObject JEI_DUMMY_REQUIRE_SACRIFICE = ITEMS.register( + public static final DeferredItem JEI_DUMMY_REQUIRE_SACRIFICE = ITEMS.register( "jei_dummy/require_sacrifice", () -> new DummyTooltipItem(new Item.Properties())); - public static final RegistryObject JEI_DUMMY_REQUIRE_ITEM_USE = ITEMS.register( + public static final DeferredItem JEI_DUMMY_REQUIRE_ITEM_USE = ITEMS.register( "jei_dummy/require_item_use", () -> new DummyTooltipItem(new Item.Properties())); //Deco Block Items - public static final RegistryObject SPIRIT_TORCH = ITEMS.register("spirit_torch", + public static final DeferredItem SPIRIT_TORCH = ITEMS.register("spirit_torch", () -> new StandingAndWallBlockItem(OccultismBlocks.SPIRIT_TORCH.get(), OccultismBlocks.SPIRIT_WALL_TORCH.get(), defaultProperties(), Direction.DOWN)); - public static final RegistryObject SPAWN_EGG_FOLIOT = ITEMS.register("spawn_egg/foliot", - () -> new ForgeSpawnEggItem(OccultismEntities.FOLIOT_TYPE::get, 0xaa728d, 0x37222c, defaultProperties())); - public static final RegistryObject SPAWN_EGG_DJINNI = ITEMS.register("spawn_egg/djinni", - () -> new ForgeSpawnEggItem(OccultismEntities.DJINNI_TYPE::get, 0xaa728d, 0x37222c, defaultProperties())); - public static final RegistryObject SPAWN_EGG_AFRIT = ITEMS.register("spawn_egg/afrit", - () -> new ForgeSpawnEggItem(OccultismEntities.AFRIT_TYPE::get, 0xaa728d, 0x37222c, defaultProperties())); - public static final RegistryObject SPAWN_EGG_AFRIT_WILD = ITEMS.register("spawn_egg/afrit_wild", - () -> new ForgeSpawnEggItem(OccultismEntities.AFRIT_WILD_TYPE::get, 0xaa728d, 0x37222c, defaultProperties())); - public static final RegistryObject SPAWN_EGG_MARID = ITEMS.register("spawn_egg/marid", - () -> new ForgeSpawnEggItem(OccultismEntities.MARID_TYPE::get, 0xaa728d, 0x37222c, defaultProperties())); - - public static final RegistryObject SPAWN_EGG_POSSESSED_ENDERMITE = ITEMS.register("spawn_egg/possessed_endermite", - () -> new ForgeSpawnEggItem(OccultismEntities.POSSESSED_ENDERMITE_TYPE::get, 0x161616, 0x6E6E6E, defaultProperties())); - public static final RegistryObject SPAWN_EGG_POSSESSED_SKELETON = ITEMS.register("spawn_egg/possessed_skeleton", - () -> new ForgeSpawnEggItem(OccultismEntities.POSSESSED_SKELETON_TYPE::get, 0xC1C1C1, 0x494949, defaultProperties())); - public static final RegistryObject SPAWN_EGG_POSSESSED_ENDERMAN = ITEMS.register("spawn_egg/possessed_enderman", - () -> new ForgeSpawnEggItem(OccultismEntities.POSSESSED_ENDERMAN_TYPE::get, 0x161616, 0x0, defaultProperties())); - public static final RegistryObject SPAWN_EGG_POSSESSED_GHAST = ITEMS.register("spawn_egg/possessed_ghast", - () -> new ForgeSpawnEggItem(OccultismEntities.POSSESSED_GHAST_TYPE::get, 0xe2e2e2, 0xC1C1C1, defaultProperties())); - public static final RegistryObject SPAWN_EGG_POSSESSED_PHANTOM = ITEMS.register("spawn_egg/possessed_phantom", - () -> new ForgeSpawnEggItem(OccultismEntities.POSSESSED_PHANTOM_TYPE::get, 0x3f4c81, 0x6ccc00, defaultProperties())); - public static final RegistryObject SPAWN_EGG_POSSESSED_WEAK_SHULKER = ITEMS.register("spawn_egg/possessed_weak_shulker", - () -> new ForgeSpawnEggItem(OccultismEntities.POSSESSED_WEAK_SHULKER_TYPE::get, 0x8c628c, 0x342638, defaultProperties())); - public static final RegistryObject SPAWN_EGG_POSSESSED_SHULKER = ITEMS.register("spawn_egg/possessed_shulker", - () -> new ForgeSpawnEggItem(OccultismEntities.POSSESSED_SHULKER_TYPE::get, 0x8c628c, 0x342638, defaultProperties())); - public static final RegistryObject SPAWN_EGG_POSSESSED_ELDER_GUARDIAN = ITEMS.register("spawn_egg/possessed_elder_guardian", - () -> new ForgeSpawnEggItem(OccultismEntities.POSSESSED_ELDER_GUARDIAN_TYPE::get, 0xb5b3a3, 0x4b4d60, defaultProperties())); - public static final RegistryObject SPAWN_EGG_WILD_HUNT_SKELETON = ITEMS.register("spawn_egg/wild_hunt_skeleton", - () -> new ForgeSpawnEggItem(OccultismEntities.WILD_HUNT_SKELETON_TYPE::get, 12698049, 4802889, defaultProperties())); - public static final RegistryObject SPAWN_EGG_WILD_HUNT_WITHER_SKELETON = ITEMS.register("spawn_egg/wild_hunt_wither_skeleton", - () -> new ForgeSpawnEggItem(OccultismEntities.WILD_HUNT_WITHER_SKELETON_TYPE::get, 1315860, 4672845, defaultProperties())); - - public static final RegistryObject SPAWN_EGG_OTHERWORLD_BIRD = ITEMS.register("spawn_egg/otherworld_bird", - () -> new ForgeSpawnEggItem(OccultismEntities.OTHERWORLD_BIRD_TYPE::get, 0x221269, 0x6b56c4, defaultProperties())); - - public static final RegistryObject SPAWN_EGG_GREEDY_FAMILIAR = ITEMS.register("spawn_egg/familiar_greedy", - () -> new ForgeSpawnEggItem(OccultismEntities.GREEDY_FAMILIAR_TYPE::get, 0x54990f, 0x725025, defaultProperties())); - public static final RegistryObject SPAWN_EGG_BAT_FAMILIAR = ITEMS.register("spawn_egg/familiar_bat", - () -> new ForgeSpawnEggItem(OccultismEntities.BAT_FAMILIAR_TYPE::get, 0x434343, 0xda95de, defaultProperties())); - - public static final RegistryObject SPAWN_EGG_DEER_FAMILIAR = ITEMS.register("spawn_egg/familiar_deer", - () -> new ForgeSpawnEggItem(OccultismEntities.DEER_FAMILIAR_TYPE::get, 0xc9833e, 0xfffdf2, defaultProperties())); - public static final RegistryObject SPAWN_EGG_CTHULHU_FAMILIAR = ITEMS.register("spawn_egg/familiar_cthulhu", - () -> new ForgeSpawnEggItem(OccultismEntities.CTHULHU_FAMILIAR_TYPE::get, 0x00cdc2, 0x4ae7c0, defaultProperties())); - public static final RegistryObject SPAWN_EGG_DEVIL_FAMILIAR = ITEMS.register("spawn_egg/familiar_devil", - () -> new ForgeSpawnEggItem(OccultismEntities.DEVIL_FAMILIAR_TYPE::get, 0xf2f0d7, 0xa01d1d, defaultProperties())); - public static final RegistryObject SPAWN_EGG_DRAGON_FAMILIAR = ITEMS.register("spawn_egg/familiar_dragon", - () -> new ForgeSpawnEggItem(OccultismEntities.DRAGON_FAMILIAR_TYPE::get, 0x18780f, 0x76c47b, defaultProperties())); - public static final RegistryObject SPAWN_EGG_BLACKSMITH_FAMILIAR = ITEMS.register("spawn_egg/familiar_blacksmith", - () -> new ForgeSpawnEggItem(OccultismEntities.BLACKSMITH_FAMILIAR_TYPE::get, 0x06bc64, 0x2b2b2b, defaultProperties())); - public static final RegistryObject SPAWN_EGG_GUARDIAN_FAMILIAR = ITEMS.register("spawn_egg/familiar_guardian", - () -> new ForgeSpawnEggItem(OccultismEntities.GUARDIAN_FAMILIAR_TYPE::get, 0x787878, 0x515151, defaultProperties())); - public static final RegistryObject SPAWN_EGG_HEADLESS_FAMILIAR = ITEMS.register("spawn_egg/familiar_headless", - () -> new ForgeSpawnEggItem(OccultismEntities.HEADLESS_FAMILIAR_TYPE::get, 0x0c0606, 0xde7900, defaultProperties())); - public static final RegistryObject SPAWN_EGG_CHIMERA_FAMILIAR = ITEMS.register("spawn_egg/familiar_chimera", - () -> new ForgeSpawnEggItem(OccultismEntities.CHIMERA_FAMILIAR_TYPE::get, 0xcf8441, 0x3e7922, defaultProperties())); - public static final RegistryObject SPAWN_EGG_GOAT_FAMILIAR = ITEMS.register("spawn_egg/familiar_goat", - () -> new ForgeSpawnEggItem(OccultismEntities.GOAT_FAMILIAR_TYPE::get, 0xe2e2e2, 0x0f0f0e, defaultProperties())); - public static final RegistryObject SPAWN_EGG_SHUB_NIGGURATH_FAMILIAR = ITEMS.register("spawn_egg/familiar_shub_niggurath", - () -> new ForgeSpawnEggItem(OccultismEntities.SHUB_NIGGURATH_FAMILIAR_TYPE::get, 0x362836, 0x594a3a, defaultProperties())); - public static final RegistryObject SPAWN_EGG_BEHOLDER_FAMILIAR = ITEMS.register("spawn_egg/familiar_beholder", - () -> new ForgeSpawnEggItem(OccultismEntities.BEHOLDER_FAMILIAR_TYPE::get, 0x340a09, 0xfffbff, defaultProperties())); - public static final RegistryObject SPAWN_EGG_FAIRY_FAMILIAR = ITEMS.register("spawn_egg/familiar_fairy", - () -> new ForgeSpawnEggItem(OccultismEntities.FAIRY_FAMILIAR_TYPE::get, 0xbd674c, 0xcca896, defaultProperties())); - public static final RegistryObject SPAWN_EGG_MUMMY_FAMILIAR = ITEMS.register("spawn_egg/familiar_mummy", - () -> new ForgeSpawnEggItem(OccultismEntities.MUMMY_FAMILIAR_TYPE::get, 0xcbb76a, 0xe0d4a3, defaultProperties())); - public static final RegistryObject SPAWN_EGG_BEAVER_FAMILIAR = ITEMS.register("spawn_egg/familiar_beaver", - () -> new ForgeSpawnEggItem(OccultismEntities.BEAVER_FAMILIAR_TYPE::get, 0x824a2b, 0xdd9973, defaultProperties())); - public static final RegistryObject SPAWN_EGG_PARROT_FAMILIAR = ITEMS.register("spawn_egg/familiar_parrot", - () -> new ForgeSpawnEggItem(() -> EntityType.PARROT, 894731, 16711680, defaultProperties())); + public static final DeferredItem SPAWN_EGG_FOLIOT = ITEMS.register("spawn_egg/foliot", + () -> new DeferredSpawnEggItem(OccultismEntities.FOLIOT_TYPE::get, 0xaa728d, 0x37222c, defaultProperties())); + public static final DeferredItem SPAWN_EGG_DJINNI = ITEMS.register("spawn_egg/djinni", + () -> new DeferredSpawnEggItem(OccultismEntities.DJINNI_TYPE::get, 0xaa728d, 0x37222c, defaultProperties())); + public static final DeferredItem SPAWN_EGG_AFRIT = ITEMS.register("spawn_egg/afrit", + () -> new DeferredSpawnEggItem(OccultismEntities.AFRIT_TYPE::get, 0xaa728d, 0x37222c, defaultProperties())); + public static final DeferredItem SPAWN_EGG_AFRIT_WILD = ITEMS.register("spawn_egg/afrit_wild", + () -> new DeferredSpawnEggItem(OccultismEntities.AFRIT_WILD_TYPE::get, 0xaa728d, 0x37222c, defaultProperties())); + public static final DeferredItem SPAWN_EGG_MARID = ITEMS.register("spawn_egg/marid", + () -> new DeferredSpawnEggItem(OccultismEntities.MARID_TYPE::get, 0xaa728d, 0x37222c, defaultProperties())); + + public static final DeferredItem SPAWN_EGG_POSSESSED_ENDERMITE = ITEMS.register("spawn_egg/possessed_endermite", + () -> new DeferredSpawnEggItem(OccultismEntities.POSSESSED_ENDERMITE_TYPE::get, 0x161616, 0x6E6E6E, defaultProperties())); + public static final DeferredItem SPAWN_EGG_POSSESSED_SKELETON = ITEMS.register("spawn_egg/possessed_skeleton", + () -> new DeferredSpawnEggItem(OccultismEntities.POSSESSED_SKELETON_TYPE::get, 0xC1C1C1, 0x494949, defaultProperties())); + public static final DeferredItem SPAWN_EGG_POSSESSED_ENDERMAN = ITEMS.register("spawn_egg/possessed_enderman", + () -> new DeferredSpawnEggItem(OccultismEntities.POSSESSED_ENDERMAN_TYPE::get, 0x161616, 0x0, defaultProperties())); + public static final DeferredItem SPAWN_EGG_POSSESSED_GHAST = ITEMS.register("spawn_egg/possessed_ghast", + () -> new DeferredSpawnEggItem(OccultismEntities.POSSESSED_GHAST_TYPE::get, 0xe2e2e2, 0xC1C1C1, defaultProperties())); + public static final DeferredItem SPAWN_EGG_POSSESSED_PHANTOM = ITEMS.register("spawn_egg/possessed_phantom", + () -> new DeferredSpawnEggItem(OccultismEntities.POSSESSED_PHANTOM_TYPE::get, 0x3f4c81, 0x6ccc00, defaultProperties())); + public static final DeferredItem SPAWN_EGG_POSSESSED_WEAK_SHULKER = ITEMS.register("spawn_egg/possessed_weak_shulker", + () -> new DeferredSpawnEggItem(OccultismEntities.POSSESSED_WEAK_SHULKER_TYPE::get, 0x8c628c, 0x342638, defaultProperties())); + public static final DeferredItem SPAWN_EGG_POSSESSED_SHULKER = ITEMS.register("spawn_egg/possessed_shulker", + () -> new DeferredSpawnEggItem(OccultismEntities.POSSESSED_SHULKER_TYPE::get, 0x8c628c, 0x342638, defaultProperties())); + public static final DeferredItem SPAWN_EGG_POSSESSED_ELDER_GUARDIAN = ITEMS.register("spawn_egg/possessed_elder_guardian", + () -> new DeferredSpawnEggItem(OccultismEntities.POSSESSED_ELDER_GUARDIAN_TYPE::get, 0xb5b3a3, 0x4b4d60, defaultProperties())); + public static final DeferredItem SPAWN_EGG_WILD_HUNT_SKELETON = ITEMS.register("spawn_egg/wild_hunt_skeleton", + () -> new DeferredSpawnEggItem(OccultismEntities.WILD_HUNT_SKELETON_TYPE::get, 12698049, 4802889, defaultProperties())); + public static final DeferredItem SPAWN_EGG_WILD_HUNT_WITHER_SKELETON = ITEMS.register("spawn_egg/wild_hunt_wither_skeleton", + () -> new DeferredSpawnEggItem(OccultismEntities.WILD_HUNT_WITHER_SKELETON_TYPE::get, 1315860, 4672845, defaultProperties())); + + public static final DeferredItem SPAWN_EGG_OTHERWORLD_BIRD = ITEMS.register("spawn_egg/otherworld_bird", + () -> new DeferredSpawnEggItem(OccultismEntities.OTHERWORLD_BIRD_TYPE::get, 0x221269, 0x6b56c4, defaultProperties())); + + public static final DeferredItem SPAWN_EGG_GREEDY_FAMILIAR = ITEMS.register("spawn_egg/familiar_greedy", + () -> new DeferredSpawnEggItem(OccultismEntities.GREEDY_FAMILIAR_TYPE::get, 0x54990f, 0x725025, defaultProperties())); + public static final DeferredItem SPAWN_EGG_BAT_FAMILIAR = ITEMS.register("spawn_egg/familiar_bat", + () -> new DeferredSpawnEggItem(OccultismEntities.BAT_FAMILIAR_TYPE::get, 0x434343, 0xda95de, defaultProperties())); + + public static final DeferredItem SPAWN_EGG_DEER_FAMILIAR = ITEMS.register("spawn_egg/familiar_deer", + () -> new DeferredSpawnEggItem(OccultismEntities.DEER_FAMILIAR_TYPE::get, 0xc9833e, 0xfffdf2, defaultProperties())); + public static final DeferredItem SPAWN_EGG_CTHULHU_FAMILIAR = ITEMS.register("spawn_egg/familiar_cthulhu", + () -> new DeferredSpawnEggItem(OccultismEntities.CTHULHU_FAMILIAR_TYPE::get, 0x00cdc2, 0x4ae7c0, defaultProperties())); + public static final DeferredItem SPAWN_EGG_DEVIL_FAMILIAR = ITEMS.register("spawn_egg/familiar_devil", + () -> new DeferredSpawnEggItem(OccultismEntities.DEVIL_FAMILIAR_TYPE::get, 0xf2f0d7, 0xa01d1d, defaultProperties())); + public static final DeferredItem SPAWN_EGG_DRAGON_FAMILIAR = ITEMS.register("spawn_egg/familiar_dragon", + () -> new DeferredSpawnEggItem(OccultismEntities.DRAGON_FAMILIAR_TYPE::get, 0x18780f, 0x76c47b, defaultProperties())); + public static final DeferredItem SPAWN_EGG_BLACKSMITH_FAMILIAR = ITEMS.register("spawn_egg/familiar_blacksmith", + () -> new DeferredSpawnEggItem(OccultismEntities.BLACKSMITH_FAMILIAR_TYPE::get, 0x06bc64, 0x2b2b2b, defaultProperties())); + public static final DeferredItem SPAWN_EGG_GUARDIAN_FAMILIAR = ITEMS.register("spawn_egg/familiar_guardian", + () -> new DeferredSpawnEggItem(OccultismEntities.GUARDIAN_FAMILIAR_TYPE::get, 0x787878, 0x515151, defaultProperties())); + public static final DeferredItem SPAWN_EGG_HEADLESS_FAMILIAR = ITEMS.register("spawn_egg/familiar_headless", + () -> new DeferredSpawnEggItem(OccultismEntities.HEADLESS_FAMILIAR_TYPE::get, 0x0c0606, 0xde7900, defaultProperties())); + public static final DeferredItem SPAWN_EGG_CHIMERA_FAMILIAR = ITEMS.register("spawn_egg/familiar_chimera", + () -> new DeferredSpawnEggItem(OccultismEntities.CHIMERA_FAMILIAR_TYPE::get, 0xcf8441, 0x3e7922, defaultProperties())); + public static final DeferredItem SPAWN_EGG_GOAT_FAMILIAR = ITEMS.register("spawn_egg/familiar_goat", + () -> new DeferredSpawnEggItem(OccultismEntities.GOAT_FAMILIAR_TYPE::get, 0xe2e2e2, 0x0f0f0e, defaultProperties())); + public static final DeferredItem SPAWN_EGG_SHUB_NIGGURATH_FAMILIAR = ITEMS.register("spawn_egg/familiar_shub_niggurath", + () -> new DeferredSpawnEggItem(OccultismEntities.SHUB_NIGGURATH_FAMILIAR_TYPE::get, 0x362836, 0x594a3a, defaultProperties())); + public static final DeferredItem SPAWN_EGG_BEHOLDER_FAMILIAR = ITEMS.register("spawn_egg/familiar_beholder", + () -> new DeferredSpawnEggItem(OccultismEntities.BEHOLDER_FAMILIAR_TYPE::get, 0x340a09, 0xfffbff, defaultProperties())); + public static final DeferredItem SPAWN_EGG_FAIRY_FAMILIAR = ITEMS.register("spawn_egg/familiar_fairy", + () -> new DeferredSpawnEggItem(OccultismEntities.FAIRY_FAMILIAR_TYPE::get, 0xbd674c, 0xcca896, defaultProperties())); + public static final DeferredItem SPAWN_EGG_MUMMY_FAMILIAR = ITEMS.register("spawn_egg/familiar_mummy", + () -> new DeferredSpawnEggItem(OccultismEntities.MUMMY_FAMILIAR_TYPE::get, 0xcbb76a, 0xe0d4a3, defaultProperties())); + public static final DeferredItem SPAWN_EGG_BEAVER_FAMILIAR = ITEMS.register("spawn_egg/familiar_beaver", + () -> new DeferredSpawnEggItem(OccultismEntities.BEAVER_FAMILIAR_TYPE::get, 0x824a2b, 0xdd9973, defaultProperties())); + public static final DeferredItem SPAWN_EGG_PARROT_FAMILIAR = ITEMS.register("spawn_egg/familiar_parrot", + () -> new DeferredSpawnEggItem(() -> EntityType.PARROT, 894731, 16711680, defaultProperties())); //Ritual Dummy Items static { diff --git a/src/main/java/com/klikli_dev/occultism/registry/OccultismLootModifiers.java b/src/main/java/com/klikli_dev/occultism/registry/OccultismLootModifiers.java index 7a22ae41e..58c5af5b6 100644 --- a/src/main/java/com/klikli_dev/occultism/registry/OccultismLootModifiers.java +++ b/src/main/java/com/klikli_dev/occultism/registry/OccultismLootModifiers.java @@ -3,14 +3,15 @@ import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.loot.AddItemModifier; import com.mojang.serialization.Codec; -import net.minecraftforge.common.loot.IGlobalLootModifier; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries.Keys; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.neoforge.common.loot.IGlobalLootModifier; +import net.neoforged.neoforge.registries.DeferredRegister; +import net.neoforged.neoforge.registries.NeoForgeRegistries; + +import java.util.function.Supplier; public class OccultismLootModifiers { - public static final DeferredRegister> LOOT_MODIFIERS = DeferredRegister.create(Keys.GLOBAL_LOOT_MODIFIER_SERIALIZERS, + public static final DeferredRegister> LOOT_MODIFIERS = DeferredRegister.create(NeoForgeRegistries.GLOBAL_LOOT_MODIFIER_SERIALIZERS, Occultism.MODID); - public static final RegistryObject> ADD_ITEM = LOOT_MODIFIERS.register("add_item", AddItemModifier.CODEC); + public static final Supplier> ADD_ITEM = LOOT_MODIFIERS.register("add_item", AddItemModifier.CODEC); } diff --git a/src/main/java/com/klikli_dev/occultism/registry/OccultismMemoryTypes.java b/src/main/java/com/klikli_dev/occultism/registry/OccultismMemoryTypes.java index 1b7a7bce7..dbe56e807 100644 --- a/src/main/java/com/klikli_dev/occultism/registry/OccultismMemoryTypes.java +++ b/src/main/java/com/klikli_dev/occultism/registry/OccultismMemoryTypes.java @@ -3,10 +3,10 @@ import com.klikli_dev.occultism.Occultism; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.world.entity.ai.memory.MemoryModuleType; import net.minecraft.world.entity.ai.memory.WalkTarget; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.neoforge.registries.DeferredRegister; import java.util.Optional; import java.util.Set; @@ -14,7 +14,7 @@ public class OccultismMemoryTypes { - public static DeferredRegister> MEMORY_MODULE_TYPES = DeferredRegister.create(ForgeRegistries.Keys.MEMORY_MODULE_TYPES, Occultism.MODID); + public static DeferredRegister> MEMORY_MODULE_TYPES = DeferredRegister.create(BuiltInRegistries.MEMORY_MODULE_TYPE, Occultism.MODID); public static final Supplier> NEAREST_TREE = MEMORY_MODULE_TYPES.register("nearest_tree", () -> new MemoryModuleType<>(Optional.empty())); public static final Supplier> LAST_FELLED_TREE = MEMORY_MODULE_TYPES.register("last_felled_tree", () -> new MemoryModuleType<>(Optional.empty())); diff --git a/src/main/java/com/klikli_dev/occultism/registry/OccultismParticles.java b/src/main/java/com/klikli_dev/occultism/registry/OccultismParticles.java index 9db8374dd..821d26fd3 100644 --- a/src/main/java/com/klikli_dev/occultism/registry/OccultismParticles.java +++ b/src/main/java/com/klikli_dev/occultism/registry/OccultismParticles.java @@ -25,19 +25,20 @@ import com.klikli_dev.occultism.Occultism; import net.minecraft.core.particles.ParticleType; import net.minecraft.core.particles.SimpleParticleType; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; +import net.minecraft.core.registries.BuiltInRegistries; +import net.neoforged.neoforge.registries.DeferredRegister; + +import java.util.function.Supplier; public class OccultismParticles { public static final DeferredRegister> PARTICLES = DeferredRegister.create( - ForgeRegistries.PARTICLE_TYPES, Occultism.MODID); + BuiltInRegistries.PARTICLE_TYPE, Occultism.MODID); - public static final RegistryObject RITUAL_WAITING = PARTICLES.register( + public static final Supplier RITUAL_WAITING = PARTICLES.register( "ritual_waiting", () -> new SimpleParticleType(false)); - public static final RegistryObject SNOWFLAKE = PARTICLES.register( + public static final Supplier SNOWFLAKE = PARTICLES.register( "snowflake", () -> new SimpleParticleType(false)); - public static final RegistryObject SPIRIT_FIRE_FLAME = PARTICLES.register( + public static final Supplier SPIRIT_FIRE_FLAME = PARTICLES.register( "spirit_fire_flame", () -> new SimpleParticleType(false)); //NOTE: IF adding new particles, Register in ClientRegistryEventHandler.onRegisterParticleFactories diff --git a/src/main/java/com/klikli_dev/occultism/registry/OccultismRecipes.java b/src/main/java/com/klikli_dev/occultism/registry/OccultismRecipes.java index e2f30d899..7c0941425 100644 --- a/src/main/java/com/klikli_dev/occultism/registry/OccultismRecipes.java +++ b/src/main/java/com/klikli_dev/occultism/registry/OccultismRecipes.java @@ -24,39 +24,39 @@ import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.crafting.recipe.*; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.item.crafting.RecipeType; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.neoforge.registries.DeferredHolder; +import net.neoforged.neoforge.registries.DeferredRegister; public class OccultismRecipes { public static final DeferredRegister> RECIPE_TYPES = DeferredRegister.create( - ForgeRegistries.RECIPE_TYPES, Occultism.MODID); + BuiltInRegistries.RECIPE_TYPE, Occultism.MODID); public static final DeferredRegister> RECIPES = DeferredRegister.create( - ForgeRegistries.RECIPE_SERIALIZERS, Occultism.MODID); + BuiltInRegistries.RECIPE_SERIALIZER, Occultism.MODID); - public static final RegistryObject> SPIRIT_TRADE_TYPE = registerRecipeType("spirit_trade"); - public static final RegistryObject> SPIRIT_FIRE_TYPE = registerRecipeType("spirit_fire"); - public static final RegistryObject> CRUSHING_TYPE = registerRecipeType("crushing"); - public static final RegistryObject> MINER_TYPE = registerRecipeType("miner"); - public static final RegistryObject> RITUAL_TYPE = registerRecipeType("ritual"); + public static final DeferredHolder, RecipeType> SPIRIT_TRADE_TYPE = registerRecipeType("spirit_trade"); + public static final DeferredHolder, RecipeType> SPIRIT_FIRE_TYPE = registerRecipeType("spirit_fire"); + public static final DeferredHolder, RecipeType> CRUSHING_TYPE = registerRecipeType("crushing"); + public static final DeferredHolder, RecipeType> MINER_TYPE = registerRecipeType("miner"); + public static final DeferredHolder, RecipeType> RITUAL_TYPE = registerRecipeType("ritual"); - public static final RegistryObject> SPIRIT_TRADE = RECIPES.register("spirit_trade", + public static final DeferredHolder, RecipeSerializer> SPIRIT_TRADE = RECIPES.register("spirit_trade", () -> SpiritTradeRecipe.SERIALIZER); - public static final RegistryObject> SPIRIT_FIRE = RECIPES.register("spirit_fire", + public static final DeferredHolder, RecipeSerializer> SPIRIT_FIRE = RECIPES.register("spirit_fire", () -> SpiritFireRecipe.SERIALIZER); - public static final RegistryObject> CRUSHING = RECIPES.register("crushing", + public static final DeferredHolder, RecipeSerializer> CRUSHING = RECIPES.register("crushing", () -> CrushingRecipe.SERIALIZER); - public static final RegistryObject> MINER = RECIPES.register("miner", + public static final DeferredHolder, RecipeSerializer> MINER = RECIPES.register("miner", () -> MinerRecipe.SERIALIZER); - public static final RegistryObject> RITUAL = RECIPES.register("ritual", + public static final DeferredHolder, RecipeSerializer> RITUAL = RECIPES.register("ritual", () -> RitualRecipe.SERIALIZER); - static > RegistryObject> registerRecipeType(final String id) { + static > DeferredHolder, RecipeType> registerRecipeType(final String id) { return RECIPE_TYPES.register(id, () -> new RecipeType() { public String toString() { return id; diff --git a/src/main/java/com/klikli_dev/occultism/registry/OccultismRituals.java b/src/main/java/com/klikli_dev/occultism/registry/OccultismRituals.java index f16d4fba5..567a7fddb 100644 --- a/src/main/java/com/klikli_dev/occultism/registry/OccultismRituals.java +++ b/src/main/java/com/klikli_dev/occultism/registry/OccultismRituals.java @@ -24,57 +24,59 @@ import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.common.ritual.*; +import net.minecraft.core.Registry; +import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.IForgeRegistry; -import net.minecraftforge.registries.RegistryBuilder; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.neoforge.registries.DeferredHolder; +import net.neoforged.neoforge.registries.DeferredRegister; import java.util.function.Supplier; public class OccultismRituals { - public static final DeferredRegister RITUAL_FACTORIES = DeferredRegister.create(new ResourceLocation(Occultism.MODID, "ritual_factory"), Occultism.MODID); + public static final ResourceKey> RITUAL_FACTORIES_KEY = ResourceKey.createRegistryKey(new ResourceLocation(Occultism.MODID, "ritual_factories")); - public static final Supplier> REGISTRY = RITUAL_FACTORIES.makeRegistry(() -> - new RegistryBuilder().disableSaving().setMaxID(Integer.MAX_VALUE - 1)); + public static final DeferredRegister RITUAL_FACTORIES = DeferredRegister.create(RITUAL_FACTORIES_KEY, Occultism.MODID); + + public static final Registry REGISTRY = RITUAL_FACTORIES.makeRegistry((builder) -> { + }); //Summoning - public static final RegistryObject SUMMON_RITUAL = + public static final Supplier SUMMON_RITUAL = RITUAL_FACTORIES.register("summon", () -> new RitualFactory((r) -> new SummonRitual(r, false))); - public static final RegistryObject SUMMON_TAMED_RITUAL = + public static final Supplier SUMMON_TAMED_RITUAL = RITUAL_FACTORIES.register("summon_tamed", () -> new RitualFactory((r) -> new SummonRitual(r, true))); - public static final RegistryObject SUMMON_WITH_CHANCE_OF_CHICKEN_RITUAL = + public static final Supplier SUMMON_WITH_CHANCE_OF_CHICKEN_RITUAL = RITUAL_FACTORIES.register("summon_with_chance_of_chicken", () -> new RitualFactory((r) -> new SummonWithChanceOfChickenRitual(r, false))); - public static final RegistryObject SUMMON_WITH_CHANCE_OF_CHICKEN_TAMED_RITUAL = + public static final Supplier SUMMON_WITH_CHANCE_OF_CHICKEN_TAMED_RITUAL = RITUAL_FACTORIES.register("summon_with_chance_of_chicken_tamed", () -> new RitualFactory((r) -> new SummonWithChanceOfChickenRitual(r, false))); - public static final RegistryObject SUMMON_SPIRIT_WITH_JOB_RITUAL = + public static final Supplier SUMMON_SPIRIT_WITH_JOB_RITUAL = RITUAL_FACTORIES.register("summon_spirit_with_job", () -> new RitualFactory(SummonSpiritWithJobRitual::new)); - public static final RegistryObject SUMMON_WILD_HUNT = + public static final Supplier SUMMON_WILD_HUNT = RITUAL_FACTORIES.register("summon_wild_hunt", () -> new RitualFactory(SummonWildHuntRitual::new)); - public static final RegistryObject FAMILIAR_RITUAL = + public static final DeferredHolder< RitualFactory,RitualFactory> FAMILIAR_RITUAL = RITUAL_FACTORIES.register("familiar", () -> new RitualFactory(FamiliarRitual::new)); //Crafting - public static final RegistryObject CRAFT_RITUAL = + public static final Supplier CRAFT_RITUAL = RITUAL_FACTORIES.register("craft", () -> new RitualFactory(CraftRitual::new)); - public static final RegistryObject CRAFT_WITH_SPIRIT_NAME_RITUAL = + public static final Supplier CRAFT_WITH_SPIRIT_NAME_RITUAL = RITUAL_FACTORIES.register("craft_with_spirit_name", () -> new RitualFactory(CraftWithSpiritNameRitual::new)); - public static final RegistryObject CRAFT_MINER_SPIRIT_RITUAL = + public static final Supplier CRAFT_MINER_SPIRIT_RITUAL = RITUAL_FACTORIES.register("craft_miner_spirit", () -> new RitualFactory(CraftMinerSpiritRitual::new)); //Other - public static final RegistryObject COMMAND_RITUAL = + public static final Supplier COMMAND_RITUAL = RITUAL_FACTORIES.register("execute_command", () -> new RitualFactory(CommandRitual::new)); } diff --git a/src/main/java/com/klikli_dev/occultism/registry/OccultismSensors.java b/src/main/java/com/klikli_dev/occultism/registry/OccultismSensors.java index c5e3c1011..abfb5d6cb 100644 --- a/src/main/java/com/klikli_dev/occultism/registry/OccultismSensors.java +++ b/src/main/java/com/klikli_dev/occultism/registry/OccultismSensors.java @@ -26,20 +26,21 @@ import com.klikli_dev.occultism.common.entity.ai.sensor.NearestJobItemSensor; import com.klikli_dev.occultism.common.entity.ai.sensor.NearestTreeSensor; import com.klikli_dev.occultism.common.entity.ai.sensor.UnreachableTreeWalkTargetSensor; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.world.entity.ai.sensing.SensorType; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.neoforge.registries.DeferredRegister; + +import java.util.function.Supplier; public class OccultismSensors { - public static DeferredRegister> SENSORS = DeferredRegister.create(ForgeRegistries.Keys.SENSOR_TYPES, Occultism.MODID); + public static DeferredRegister> SENSORS = DeferredRegister.create(BuiltInRegistries.SENSOR_TYPE, Occultism.MODID); - public static final RegistryObject>> NEAREST_TREE = SENSORS.register("nearest_tree", + public static final Supplier>> NEAREST_TREE = SENSORS.register("nearest_tree", () -> new SensorType<>(NearestTreeSensor::new)); - public static final RegistryObject>> UNREACHABLE_WALK_TARGET = SENSORS.register("unreachable_walk_target", + public static final Supplier>> UNREACHABLE_WALK_TARGET = SENSORS.register("unreachable_walk_target", () -> new SensorType<>(UnreachableTreeWalkTargetSensor::new)); - public static final RegistryObject>> NEAREST_JOB_ITEM = SENSORS.register("nearest_job_item", + public static final Supplier>> NEAREST_JOB_ITEM = SENSORS.register("nearest_job_item", () -> new SensorType<>(NearestJobItemSensor::new)); } diff --git a/src/main/java/com/klikli_dev/occultism/registry/OccultismSounds.java b/src/main/java/com/klikli_dev/occultism/registry/OccultismSounds.java index a89ce1de6..b68311248 100644 --- a/src/main/java/com/klikli_dev/occultism/registry/OccultismSounds.java +++ b/src/main/java/com/klikli_dev/occultism/registry/OccultismSounds.java @@ -23,22 +23,23 @@ package com.klikli_dev.occultism.registry; import com.klikli_dev.occultism.Occultism; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.sounds.SoundEvent; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.neoforge.registries.DeferredRegister; + +import java.util.function.Supplier; public class OccultismSounds { - public static DeferredRegister SOUNDS = DeferredRegister.create(ForgeRegistries.SOUND_EVENTS, Occultism.MODID); + public static DeferredRegister SOUNDS = DeferredRegister.create(BuiltInRegistries.SOUND_EVENT, Occultism.MODID); - public static final RegistryObject CHALK = SOUNDS.register("chalk", () -> loadSoundEvent("chalk")); - public static final RegistryObject BRUSH = SOUNDS.register("brush", () -> loadSoundEvent("brush")); - public static final RegistryObject START_RITUAL = SOUNDS.register("start_ritual", () -> loadSoundEvent("start_ritual")); - public static final RegistryObject TUNING_FORK = SOUNDS.register("tuning_fork", () -> loadSoundEvent("tuning_fork")); - public static final RegistryObject CRUNCHING = SOUNDS.register("crunching", () -> loadSoundEvent("crunching")); - public static final RegistryObject POOF = SOUNDS.register("poof", () -> loadSoundEvent("poof")); + public static final Supplier CHALK = SOUNDS.register("chalk", () -> loadSoundEvent("chalk")); + public static final Supplier BRUSH = SOUNDS.register("brush", () -> loadSoundEvent("brush")); + public static final Supplier START_RITUAL = SOUNDS.register("start_ritual", () -> loadSoundEvent("start_ritual")); + public static final Supplier TUNING_FORK = SOUNDS.register("tuning_fork", () -> loadSoundEvent("tuning_fork")); + public static final Supplier CRUNCHING = SOUNDS.register("crunching", () -> loadSoundEvent("crunching")); + public static final Supplier POOF = SOUNDS.register("poof", () -> loadSoundEvent("poof")); /** * Creates the sound event object for the given sound event name, as specified in sounds.json Automatically appends diff --git a/src/main/java/com/klikli_dev/occultism/registry/OccultismSpiritJobs.java b/src/main/java/com/klikli_dev/occultism/registry/OccultismSpiritJobs.java index 0205c0319..3c55319d6 100644 --- a/src/main/java/com/klikli_dev/occultism/registry/OccultismSpiritJobs.java +++ b/src/main/java/com/klikli_dev/occultism/registry/OccultismSpiritJobs.java @@ -24,67 +24,66 @@ import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.common.entity.job.*; -import com.klikli_dev.occultism.util.StaticUtil; +import net.minecraft.core.Registry; +import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; -import net.minecraftforge.registries.DeferredRegister; -import net.minecraftforge.registries.IForgeRegistry; -import net.minecraftforge.registries.RegistryBuilder; -import net.minecraftforge.registries.RegistryObject; +import net.neoforged.neoforge.registries.DeferredRegister; import java.util.function.Supplier; public class OccultismSpiritJobs { - public static DeferredRegister JOBS = DeferredRegister.create(new ResourceLocation(Occultism.MODID, "spirit_job_factory"), Occultism.MODID); + public static final ResourceKey> JOBS_KEY = ResourceKey.createRegistryKey(new ResourceLocation(Occultism.MODID, "spirit_job_factories")); + public static DeferredRegister JOBS = DeferredRegister.create(JOBS_KEY, Occultism.MODID); - public static final Supplier> REGISTRY = JOBS.makeRegistry(() -> - new RegistryBuilder().disableSaving().setMaxID(Integer.MAX_VALUE - 1)); + public static final Registry REGISTRY = JOBS.makeRegistry((builder) -> { + }); - public static final RegistryObject LUMBERJACK = JOBS.register("lumberjack", + public static final Supplier LUMBERJACK = JOBS.register("lumberjack", () -> new SpiritJobFactory(LumberjackJob::new)); - public static final RegistryObject MANAGE_MACHINE = JOBS.register("manage_machine", + public static final Supplier MANAGE_MACHINE = JOBS.register("manage_machine", () -> new SpiritJobFactory(ManageMachineJob::new)); - public static final RegistryObject TRANSPORT_ITEMS = JOBS.register("transport_items", + public static final Supplier TRANSPORT_ITEMS = JOBS.register("transport_items", () -> new SpiritJobFactory(TransportItemsJob::new)); - public static final RegistryObject CLEANER = JOBS.register("cleaner", + public static final Supplier CLEANER = JOBS.register("cleaner", () -> new SpiritJobFactory(CleanerJob::new)); //Trade jobs - public static final RegistryObject TRADE_OTHERSTONE_T1 = JOBS.register("trade_otherstone_t1", + public static final Supplier TRADE_OTHERSTONE_T1 = JOBS.register("trade_otherstone_t1", () -> new SpiritJobFactory((entity) -> { - TraderJob job = new TraderJob(entity, StaticUtil.modLoc("spirit_trade/stone_to_otherstone")); + TraderJob job = new TraderJob(entity, new ResourceLocation(Occultism.MODID, "spirit_trade/stone_to_otherstone")); job.setTimeToConvert(15); job.setMaxTradesPerRound(4); return job; })); - public static final RegistryObject TRADE_OTHERWORLD_SAPLINGS_T2 = JOBS.register("trade_otherworld_saplings_t1", + public static final Supplier TRADE_OTHERWORLD_SAPLINGS_T2 = JOBS.register("trade_otherworld_saplings_t1", () -> new SpiritJobFactory((entity) -> { - TraderJob job = new TraderJob(entity, StaticUtil.modLoc("spirit_trade/otherworld_sapling")); + TraderJob job = new TraderJob(entity, new ResourceLocation(Occultism.MODID, "spirit_trade/otherworld_sapling")); job.setTimeToConvert(20); job.setMaxTradesPerRound(1); return job; })); //Crushing jobs - public static final RegistryObject CRUSH_TIER1 = JOBS.register("crush_tier1", + public static final Supplier CRUSH_TIER1 = JOBS.register("crush_tier1", () -> new SpiritJobFactory((entity) -> new CrusherJob(entity, () -> Occultism.SERVER_CONFIG.spiritJobs.tier1CrusherTimeMultiplier.get().floatValue(), () -> Occultism.SERVER_CONFIG.spiritJobs.tier1CrusherOutputMultiplier.get().floatValue(), () -> 1 ))); - public static final RegistryObject CRUSH_TIER2 = JOBS.register("crush_tier2", + public static final Supplier CRUSH_TIER2 = JOBS.register("crush_tier2", () -> new SpiritJobFactory((entity) -> new CrusherJob(entity, () -> Occultism.SERVER_CONFIG.spiritJobs.tier2CrusherTimeMultiplier.get().floatValue(), () -> Occultism.SERVER_CONFIG.spiritJobs.tier2CrusherOutputMultiplier.get().floatValue(), () -> 2 ))); - public static final RegistryObject CRUSH_TIER3 = JOBS.register("crush_tier3", + public static final Supplier CRUSH_TIER3 = JOBS.register("crush_tier3", () -> new SpiritJobFactory((entity) -> new CrusherJob(entity, () -> Occultism.SERVER_CONFIG.spiritJobs.tier3CrusherTimeMultiplier.get().floatValue(), () -> Occultism.SERVER_CONFIG.spiritJobs.tier3CrusherOutputMultiplier.get().floatValue(), () -> 3 ))); - public static final RegistryObject CRUSH_TIER4 = JOBS.register("crush_tier4", + public static final Supplier CRUSH_TIER4 = JOBS.register("crush_tier4", () -> new SpiritJobFactory((entity) -> new CrusherJob(entity, () -> Occultism.SERVER_CONFIG.spiritJobs.tier4CrusherTimeMultiplier.get().floatValue(), () -> Occultism.SERVER_CONFIG.spiritJobs.tier4CrusherOutputMultiplier.get().floatValue(), @@ -92,17 +91,17 @@ public class OccultismSpiritJobs { ))); //Weather Jobs - public static final RegistryObject CLEAR_WEATHER = JOBS.register("clear_weather", + public static final Supplier CLEAR_WEATHER = JOBS.register("clear_weather", () -> new SpiritJobFactory((entity) -> new ClearWeatherJob(entity, 20 * 15))); - public static final RegistryObject RAIN_WEATHER = JOBS.register("rain_weather", + public static final Supplier RAIN_WEATHER = JOBS.register("rain_weather", () -> new SpiritJobFactory((entity) -> new RainWeatherJob(entity, 20 * 30))); - public static final RegistryObject THUNDER_WEATHER = JOBS.register("thunder_weather", + public static final Supplier THUNDER_WEATHER = JOBS.register("thunder_weather", () -> new SpiritJobFactory((entity) -> new ThunderWeatherJob(entity, 20 * 60))); //Time Jobs - public static final RegistryObject DAY_TIME = JOBS.register("day_time", + public static final Supplier DAY_TIME = JOBS.register("day_time", () -> new SpiritJobFactory((entity) -> new DayTimeJob(entity, 20 * 5))); - public static final RegistryObject NIGHT_TIME = JOBS.register("night_time", + public static final Supplier NIGHT_TIME = JOBS.register("night_time", () -> new SpiritJobFactory((entity) -> new NightTimeJob(entity, 20 * 5))); } diff --git a/src/main/java/com/klikli_dev/occultism/util/BlockEntityUtil.java b/src/main/java/com/klikli_dev/occultism/util/BlockEntityUtil.java index 7fdcfbc29..d3dd12f66 100644 --- a/src/main/java/com/klikli_dev/occultism/util/BlockEntityUtil.java +++ b/src/main/java/com/klikli_dev/occultism/util/BlockEntityUtil.java @@ -35,8 +35,8 @@ import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.chunk.LevelChunk; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.server.ServerLifecycleHooks; +import net.neoforged.neoforge.capabilities.BlockCapability; +import net.neoforged.neoforge.server.ServerLifecycleHooks; public class BlockEntityUtil { //region Static Methods @@ -114,9 +114,9 @@ public static void updateTile(Level level, BlockPos pos) { * @param capability the capability to check for. * @return true if the capability is found on any face. */ - public static boolean hasCapabilityOnAnySide(BlockEntity blockEntity, Capability capability) { + public static boolean hasCapabilityOnAnySide(BlockEntity blockEntity, BlockCapability capability) { for (Direction face : Direction.values()) { - if (blockEntity.getCapability(capability, face).isPresent()) + if (blockEntity.getLevel().getCapability(capability, blockEntity.getBlockPos(), blockEntity.getBlockState(), blockEntity, face) != null) return true; } return false; @@ -174,7 +174,7 @@ public static ItemStack getItemWithNbt(Block block, BlockGetter level, BlockPos ItemStack itemStack = new ItemStack(block); BlockEntity blockEntity = level.getBlockEntity(pos); - if(blockEntity != null) { + if (blockEntity != null) { CompoundTag CompoundTag = blockEntity.serializeNBT(); if (!CompoundTag.isEmpty()) { itemStack.addTagElement("BlockEntityTag", CompoundTag); diff --git a/src/main/java/com/klikli_dev/occultism/util/CuriosUtil.java b/src/main/java/com/klikli_dev/occultism/util/CuriosUtil.java index 7a7973e4f..7b3a60e1b 100644 --- a/src/main/java/com/klikli_dev/occultism/util/CuriosUtil.java +++ b/src/main/java/com/klikli_dev/occultism/util/CuriosUtil.java @@ -22,57 +22,61 @@ package com.klikli_dev.occultism.util; -import com.klikli_dev.occultism.common.item.armor.OtherworldGogglesItem; import com.klikli_dev.occultism.common.item.storage.SatchelItem; import com.klikli_dev.occultism.common.item.storage.StorageRemoteItem; -import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; -import top.theillusivec4.curios.api.CuriosApi; -import top.theillusivec4.curios.api.SlotTypePreset; -import top.theillusivec4.curios.api.type.inventory.ICurioStacksHandler; -import top.theillusivec4.curios.api.type.inventory.IDynamicStackHandler; - -import java.util.Optional; public class CuriosUtil { public static boolean hasGoggles(Player player) { - ItemStack helmet = player.getItemBySlot(EquipmentSlot.HEAD); - if (OtherworldGogglesItem.isGogglesItem(helmet)) - return true; - - Optional hasGoggles = CuriosApi.getCuriosHelper().getCuriosHandler(player) - .map(curiosHandler -> curiosHandler.getCurios().values()) - .map(slotsHandler -> slotsHandler.stream().map(ICurioStacksHandler::getStacks).map( - stackHandler -> { - for (int i = 0; i < stackHandler.getSlots(); i++) { - ItemStack stack = stackHandler.getStackInSlot(i); - if (OtherworldGogglesItem.isGogglesItem(stack)) { - return true; + return false; - } - } - return false; - } - )).map(results -> results.anyMatch(found -> found)); - return hasGoggles.orElse(false); + //TODO: enable once curios is available +// ItemStack helmet = player.getItemBySlot(EquipmentSlot.HEAD); +// if (OtherworldGogglesItem.isGogglesItem(helmet)) +// return true; +// +// var curiosHandler = player.getCapability(CuriosCapability.INVENTORY); +// if (curiosHandler == null) +// return false; +// +// var slotsHandler = curiosHandler.getCurios().values(); +// return slotsHandler.stream().map(ICurioStacksHandler::getStacks).anyMatch( +// stackHandler -> { +// for (int i = 0; i < stackHandler.getSlots(); i++) { +// ItemStack stack = stackHandler.getStackInSlot(i); +// if (OtherworldGogglesItem.isGogglesItem(stack)) { +// return true; +// +// } +// } +// return false; +// } +// ); } public static ItemStack getBackpack(Player player) { - Optional hasBackpack = CuriosApi.getCuriosHelper().getCuriosHandler(player).map(curiosHandler -> { - Optional hasBackpackStack = curiosHandler.getStacksHandler(SlotTypePreset.BELT.getIdentifier()).map(slotHandler -> { - IDynamicStackHandler stackHandler = slotHandler.getStacks(); - for (int i = 0; i < stackHandler.getSlots(); i++) { - ItemStack stack = stackHandler.getStackInSlot(i); - if (stack.getItem() instanceof SatchelItem) { - return stack; - } - } - return ItemStack.EMPTY; - }); - return hasBackpackStack.orElse(ItemStack.EMPTY); - }); - return hasBackpack.orElse(ItemStack.EMPTY); + return ItemStack.EMPTY; + + //TODO: enable once curios is available +// var curiosHandler = player.getCapability(CuriosCapability.INVENTORY); +// if (curiosHandler == null) +// return ItemStack.EMPTY; +// +// var belt = curiosHandler.getStacksHandler("belt"); +// if (!belt.isPresent()) +// return ItemStack.EMPTY; +// +// IDynamicStackHandler stackHandler = belt.get().getStacks(); +// ItemStack hasBackpack = ItemStack.EMPTY; +// for (int i = 0; i < stackHandler.getSlots(); i++) { +// ItemStack stack = stackHandler.getStackInSlot(i); +// if (stack.getItem() instanceof SatchelItem) { +// hasBackpack = stack; +// break; +// } +// } +// return hasBackpack; } public static SelectedCurio getStorageRemote(Player player) { @@ -99,19 +103,25 @@ public static SelectedCurio getStorageRemote(Player player) { } public static ItemStack getStorageRemoteCurio(Player player) { - Optional hasStorageRemote = CuriosApi.getCuriosHelper().getCuriosHandler(player).map(curiosHandler -> { - for (ICurioStacksHandler curiosStackshandler : curiosHandler.getCurios().values()) { - IDynamicStackHandler stackHandler = curiosStackshandler.getStacks(); - for (int i = 0; i < stackHandler.getSlots(); i++) { - ItemStack stack = stackHandler.getStackInSlot(i); - if (stack.getItem() instanceof StorageRemoteItem) { - return stack; - } - } - } - return ItemStack.EMPTY; - }); - return hasStorageRemote.orElse(ItemStack.EMPTY); + + return ItemStack.EMPTY; + //TODO: enable once curios is available +// ICuriosItemHandler curiosHandler = player.getCapability(CuriosCapability.INVENTORY); +// ItemStack hasStorageRemote = ItemStack.EMPTY; +// for (ICurioStacksHandler curiosStackshandler : curiosHandler.getCurios().values()) { +// IDynamicStackHandler stackHandler = curiosStackshandler.getStacks(); +// for (int i = 0; i < stackHandler.getSlots(); i++) { +// ItemStack stack = stackHandler.getStackInSlot(i); +// if (stack.getItem() instanceof StorageRemoteItem) { +// hasStorageRemote = stack; +// break; +// } +// } +// if (!hasStorageRemote.isEmpty()) { +// break; +// } +// } +// return hasStorageRemote; } public static int getFirstBackpackSlot(Player player) { diff --git a/src/main/java/com/klikli_dev/occultism/util/EntityUtil.java b/src/main/java/com/klikli_dev/occultism/util/EntityUtil.java index de79a2c4a..e67b68a06 100644 --- a/src/main/java/com/klikli_dev/occultism/util/EntityUtil.java +++ b/src/main/java/com/klikli_dev/occultism/util/EntityUtil.java @@ -22,6 +22,7 @@ package com.klikli_dev.occultism.util; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.nbt.CompoundTag; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.MinecraftServer; @@ -30,9 +31,7 @@ import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.level.Level; -import net.minecraftforge.registries.ForgeRegistries; -import net.minecraftforge.server.ServerLifecycleHooks; - +import net.neoforged.neoforge.server.ServerLifecycleHooks; import java.util.Optional; import java.util.UUID; @@ -92,7 +91,7 @@ public static Optional getEntityByUuiDGlobal(MinecraftServer s public static Entity entityFromNBT(Level level, CompoundTag nbtTagCompound) { ResourceLocation typeId = new ResourceLocation(nbtTagCompound.getString("id")); - Entity entity = ForgeRegistries.ENTITY_TYPES.getValue(typeId).create(level); + Entity entity = BuiltInRegistries.ENTITY_TYPE.get(typeId).create(level); entity.deserializeNBT(nbtTagCompound); return entity; } @@ -105,7 +104,7 @@ public static Entity entityFromNBT(Level level, CompoundTag nbtTagCompound) { */ public static EntityType entityTypeFromNbt(CompoundTag nbtTagCompound) { ResourceLocation typeId = new ResourceLocation(nbtTagCompound.getString("id")); - return ForgeRegistries.ENTITY_TYPES.getValue(typeId); + return BuiltInRegistries.ENTITY_TYPE.get(typeId); } //endregion Static Methods diff --git a/src/main/java/com/klikli_dev/occultism/util/FamiliarUtil.java b/src/main/java/com/klikli_dev/occultism/util/FamiliarUtil.java index 82c027e4c..97e62b991 100644 --- a/src/main/java/com/klikli_dev/occultism/util/FamiliarUtil.java +++ b/src/main/java/com/klikli_dev/occultism/util/FamiliarUtil.java @@ -24,12 +24,10 @@ import com.klikli_dev.occultism.Occultism; import com.klikli_dev.occultism.common.entity.familiar.IFamiliar; -import com.klikli_dev.occultism.common.item.tool.FamiliarRingItem; -import com.klikli_dev.occultism.registry.OccultismCapabilities; +import com.klikli_dev.occultism.registry.OccultismDataStorage; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LivingEntity; -import top.theillusivec4.curios.api.CuriosApi; import java.util.ArrayList; import java.util.Calendar; @@ -57,8 +55,7 @@ private static boolean isClose(LivingEntity e, LivingEntity familiar, float rang } public static boolean isFamiliarEnabled(LivingEntity owner, EntityType familiar) { - return owner.getCapability(OccultismCapabilities.FAMILIAR_SETTINGS).lazyMap(c -> c.isFamiliarEnabled(familiar)) - .orElse(false); + return owner.getData(OccultismDataStorage.FAMILIAR_SETTINGS).isFamiliarEnabled(familiar); } public static boolean hasFamiliar(LivingEntity owner, EntityType type) { @@ -110,18 +107,20 @@ public static T getNearbyFamiliar(LivingEntity ow public static List getAllEquippedFamiliars(LivingEntity owner, EntityType type, Predicate pred) { List familiars = new ArrayList<>(); - var curios = CuriosApi.getCuriosHelper().getEquippedCurios(owner).orElse(null); - if (curios == null) - return familiars; - - for (int i = 0; i < curios.getSlots(); i++) { - IFamiliar familiar = FamiliarRingItem.getFamiliar(curios.getStackInSlot(i), owner.level()); - if (familiar != null && familiar.getFamiliarEntity().getType() == type) { - T fam = (T) familiar.getFamiliarEntity(); - if (pred.test(fam)) - familiars.add(fam); - } - } + //TODO: enable once curios is available +// var cap = owner.getCapability(CuriosCapability.INVENTORY); +// if(cap == null) +// return familiars; +// +// var curios = cap.getEquippedCurios(); +// for (int i = 0; i < curios.getSlots(); i++) { +// IFamiliar familiar = FamiliarRingItem.getFamiliar(curios.getStackInSlot(i), owner.level()); +// if (familiar != null && familiar.getFamiliarEntity().getType() == type) { +// T fam = (T) familiar.getFamiliarEntity(); +// if (pred.test(fam)) +// familiars.add(fam); +// } +// } return familiars; } diff --git a/src/main/java/com/klikli_dev/occultism/util/MovementUtil.java b/src/main/java/com/klikli_dev/occultism/util/MovementUtil.java index a6c2e05b5..94c55f59e 100644 --- a/src/main/java/com/klikli_dev/occultism/util/MovementUtil.java +++ b/src/main/java/com/klikli_dev/occultism/util/MovementUtil.java @@ -22,15 +22,13 @@ package com.klikli_dev.occultism.util; -import com.klikli_dev.occultism.common.capability.DoubleJumpCapability; import com.klikli_dev.occultism.common.effect.DoubleJumpEffect; -import com.klikli_dev.occultism.registry.OccultismCapabilities; +import com.klikli_dev.occultism.registry.OccultismDataStorage; import com.klikli_dev.occultism.registry.OccultismTags; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ElytraItem; import net.minecraft.world.item.ItemStack; -import net.minecraftforge.common.util.LazyOptional; public class MovementUtil { public static boolean doubleJump(Player player) { @@ -39,11 +37,10 @@ public static boolean doubleJump(Player player) { return false; } - LazyOptional doubleJumpCapability = player.getCapability(OccultismCapabilities.DOUBLE_JUMP); - int jumps = doubleJumpCapability.map(DoubleJumpCapability::getJumps).orElse(Integer.MAX_VALUE); + int jumps = player.getData(OccultismDataStorage.DOUBLE_JUMP); if (jumps < DoubleJumpEffect.getMaxJumps(player)) { player.jumpFromGround(); - doubleJumpCapability.ifPresent(DoubleJumpCapability::addJump); + player.setData(OccultismDataStorage.DOUBLE_JUMP, jumps + 1); return true; } return false; diff --git a/src/main/java/com/klikli_dev/occultism/util/OtherworldUtil.java b/src/main/java/com/klikli_dev/occultism/util/OtherworldUtil.java index f94c8e8eb..100a308f6 100644 --- a/src/main/java/com/klikli_dev/occultism/util/OtherworldUtil.java +++ b/src/main/java/com/klikli_dev/occultism/util/OtherworldUtil.java @@ -26,10 +26,10 @@ import com.klikli_dev.occultism.registry.OccultismEffects; 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.minecraftforge.fml.loading.FMLEnvironment; -import net.minecraftforge.fml.util.thread.SidedThreadGroups; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.api.distmarker.OnlyIn; +import net.neoforged.fml.loading.FMLEnvironment; +import net.neoforged.fml.util.thread.SidedThreadGroups; public class OtherworldUtil { diff --git a/src/main/java/com/klikli_dev/occultism/util/RecipeUtil.java b/src/main/java/com/klikli_dev/occultism/util/RecipeUtil.java index d7417b4b2..d5ed9d931 100644 --- a/src/main/java/com/klikli_dev/occultism/util/RecipeUtil.java +++ b/src/main/java/com/klikli_dev/occultism/util/RecipeUtil.java @@ -39,9 +39,9 @@ public static > boolean isValidIngredie if (stack.isEmpty()) return false; - List recipes = recipeManager.getAllRecipesFor(recipeType); - for (T recipe : recipes) { - if (recipe.getIngredients().stream().anyMatch(i -> i.test(stack))) { + var recipes = recipeManager.getAllRecipesFor(recipeType); + for (var recipe : recipes) { + if (recipe.value().getIngredients().stream().anyMatch(i -> i.test(stack))) { return true; } } diff --git a/src/main/java/com/klikli_dev/occultism/util/StaticUtil.java b/src/main/java/com/klikli_dev/occultism/util/StaticUtil.java deleted file mode 100644 index fcdde5fd4..000000000 --- a/src/main/java/com/klikli_dev/occultism/util/StaticUtil.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * MIT License - * - * Copyright 2020 klikli-dev - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and - * associated documentation files (the "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT - * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -package com.klikli_dev.occultism.util; - -import com.klikli_dev.occultism.Occultism; -import net.minecraft.resources.ResourceLocation; - -public class StaticUtil { - - public static ResourceLocation modLoc(String path) { - return new ResourceLocation(Occultism.MODID, path); - } -} diff --git a/src/main/java/com/klikli_dev/occultism/util/StorageUtil.java b/src/main/java/com/klikli_dev/occultism/util/StorageUtil.java index a479e68ed..78ae9c022 100644 --- a/src/main/java/com/klikli_dev/occultism/util/StorageUtil.java +++ b/src/main/java/com/klikli_dev/occultism/util/StorageUtil.java @@ -24,8 +24,9 @@ import com.klikli_dev.occultism.api.common.blockentity.IStorageController; import com.klikli_dev.occultism.api.common.container.IStorageControllerContainer; -import com.klikli_dev.occultism.network.OccultismPackets; +import com.klikli_dev.occultism.network.Networking; import net.minecraft.core.BlockPos; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.server.level.ServerPlayer; import net.minecraft.tags.TagKey; import net.minecraft.world.Containers; @@ -36,10 +37,9 @@ 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.items.IItemHandler; -import net.minecraftforge.items.ItemHandlerHelper; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.neoforge.capabilities.Capabilities; +import net.neoforged.neoforge.items.IItemHandler; +import net.neoforged.neoforge.items.ItemHandlerHelper; import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.IOCase; @@ -87,7 +87,7 @@ public static void clearOpenCraftingMatrix(ServerPlayer player, boolean sendStac //finally if requested, send the updated storage controller contents to the player. if (sendStackUpdate) { - OccultismPackets.sendTo(player, storageController.getMessageUpdateStacks()); + Networking.sendTo(player, storageController.getMessageUpdateStacks()); ((AbstractContainerMenu) container).broadcastChanges(); } @@ -127,7 +127,7 @@ public static void clearOpenOrderSlot(ServerPlayer player, boolean sendStackUpda //finally if requested, send the updated storage controller contents to the player. if (sendStackUpdate) { - OccultismPackets.sendTo(player, storageController.getMessageUpdateStacks()); + Networking.sendTo(player, storageController.getMessageUpdateStacks()); ((AbstractContainerMenu) container).broadcastChanges(); } } @@ -237,7 +237,7 @@ public static boolean matchesFilter(ItemStack stack, String tagFilter) { if (filter.startsWith("item:")) { filter = filter.substring(5); - if (FilenameUtils.wildcardMatch(ForgeRegistries.ITEMS.getKey(stack.getItem()).toString(), filter, IOCase.INSENSITIVE)) + if (FilenameUtils.wildcardMatch(BuiltInRegistries.ITEM.getKey(stack.getItem()).toString(), filter, IOCase.INSENSITIVE)) return true; } else { //tags should not be prefixed, but we allow it and handle it @@ -265,9 +265,10 @@ public static boolean matchesFilter(ItemStack stack, String tagFilter) { * @param blockEntity the block entity to drop contents for. */ public static void dropInventoryItems(BlockEntity blockEntity) { - blockEntity.getCapability(ForgeCapabilities.ITEM_HANDLER).ifPresent(handler -> { + var handler = blockEntity.getLevel().getCapability(Capabilities.ItemHandler.BLOCK, blockEntity.getBlockPos(), blockEntity.getBlockState(), blockEntity, null); + if (handler != null) { dropInventoryItems(blockEntity.getLevel(), blockEntity.getBlockPos(), handler); - }); + } } public static void dropInventoryItems(Level worldIn, BlockPos pos, IItemHandler itemHandler) { diff --git a/src/main/java/com/klikli_dev/occultism/util/TextUtil.java b/src/main/java/com/klikli_dev/occultism/util/TextUtil.java index 2deb4b466..85e379eb7 100644 --- a/src/main/java/com/klikli_dev/occultism/util/TextUtil.java +++ b/src/main/java/com/klikli_dev/occultism/util/TextUtil.java @@ -24,18 +24,18 @@ import com.klikli_dev.occultism.Occultism; 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.Item; +import net.minecraft.world.item.SpawnEggItem; import net.minecraft.world.level.block.Block; -import net.minecraftforge.common.ForgeSpawnEggItem; -import net.minecraftforge.fml.ModList; -import net.minecraftforge.forgespi.language.IModInfo; -import net.minecraftforge.registries.ForgeRegistries; +import net.neoforged.fml.ModList; +import net.neoforged.neoforge.common.DeferredSpawnEggItem; +import net.neoforged.neoforgespi.language.IModInfo; import org.apache.commons.lang3.text.WordUtils; - import javax.annotation.Nonnull; import java.util.HashMap; import java.util.Locale; @@ -86,9 +86,9 @@ public static String getModNameForGameObject(@Nonnull Object object) { ResourceLocation key; if (object instanceof Item) { - key = ForgeRegistries.ITEMS.getKey((Item) object); + key = BuiltInRegistries.ITEM.getKey((Item) object); } else if (object instanceof Block) { - key = ForgeRegistries.BLOCKS.getKey((Block) object); + key = BuiltInRegistries.BLOCK.getKey((Block) object); } else { return null; } @@ -126,7 +126,7 @@ public static MutableComponent formatDemonName(MutableComponent name) { * Formats the given spirit type name in a color based on the type. */ public static MutableComponent formatDemonType(Component name, EntityType type) { - var egg = ForgeSpawnEggItem.fromEntityType(type); + var egg = SpawnEggItem.byId(type); var color = egg != null ? egg.getColor(0) : 0xffffff; color = makeColorLighterForDarkMode(color); int finalColor = color; diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg index 9cb8141ca..f6445f50d 100644 --- a/src/main/resources/META-INF/accesstransformer.cfg +++ b/src/main/resources/META-INF/accesstransformer.cfg @@ -1,13 +1,12 @@ -public net.minecraft.entity.item.ItemEntity field_70292_b # age -public net.minecraft.client.renderer.entity.ItemRenderer m_115152_(Lcom/mojang/blaze3d/vertex/BufferBuilder;IIIIIIII)V #fillRect +public net.minecraft.entity.item.ItemEntity age # age +public net.minecraft.client.renderer.entity.ItemRenderer fillRect(Lcom/mojang/blaze3d/vertex/BufferBuilder;IIIIIIII)V #fillRect public-f net.minecraft.client.model.geom.ModelPart # make modelpart non final -public net.minecraft.data.loot.BlockLootSubProvider f_244248_ # HAS_NO_SHEARS_OR_SILK_TOUCH -public net.minecraft.data.loot.BlockLootSubProvider f_244441_ # map -public net.minecraft.data.loot.EntityLootSubProvider f_244213_ # map -public-f net.minecraft.world.item.Item f_41378_ # craftingRemainingItem -public net.minecraft.world.inventory.TransientCraftingContainer f_286951_ # items -public net.minecraft.world.item.crafting.Ingredient f_43902_ # values -public net.minecraft.world.item.crafting.Ingredient$TagValue f_43959_ # tag -public net.minecraft.client.gui.GuiGraphics m_286081_()V # flushIfUnmanaged -public net.minecraft.world.entity.Entity m_284535_(Lnet/minecraft/world/level/Level;)V # setLevel -public net.minecraft.world.entity.LivingEntity m_21304_()I # getCurrentSwingDuration \ No newline at end of file +public net.minecraft.data.loot.BlockLootSubProvider HAS_NO_SHEARS_OR_SILK_TOUCH # HAS_NO_SHEARS_OR_SILK_TOUCH +public net.minecraft.data.loot.BlockLootSubProvider map # map +public net.minecraft.data.loot.EntityLootSubProvider map # map +public-f net.minecraft.world.item.Item craftingRemainingItem # craftingRemainingItem +public net.minecraft.world.inventory.TransientCraftingContainer items # items +public net.minecraft.client.gui.GuiGraphics flushIfUnmanaged()V # flushIfUnmanaged +public net.minecraft.world.entity.Entity setLevel(Lnet/minecraft/world/level/Level;)V # setLevel +public net.minecraft.world.entity.LivingEntity getCurrentSwingDuration()I # getCurrentSwingDuration +public-f net.minecraft.world.level.block.TorchBlock flameParticle \ 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 56c5fe3f7..ed016813e 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -6,7 +6,7 @@ # 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 forge version -loaderVersion = "${loader_version_range}" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions. +loaderVersion = "${neo_loader_version_range}" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions. # The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties. # Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here. license = "${mod_license}" @@ -21,7 +21,7 @@ version="${mod_version}" #mandatory # A display name for the mod displayName="${mod_name}" #mandatory # A URL to query for updates for this mod. See the JSON update specification -updateJSONURL = "https://raw.githubusercontent.com/klikli-dev/occultism/meta/updates.json" #optional +# updateJSONURL = "https://raw.githubusercontent.com/klikli-dev/occultism/meta/updates.json" #optional # A URL for the "homepage" for this mod, displayed in the mod UI displayURL = "https://www.curseforge.com/minecraft/mc-mods/occultism" #optional # A file name (in the root of the mod JAR) containing a logo for display @@ -34,55 +34,56 @@ authors="${mod_authors}" #optional description='''${mod_description}''' [[dependencies.occultism]] -modId = "forge" -mandatory = true -versionRange = "${forge_version_range}" +modId = "neoforge" +type = "required" +versionRange = "${neo_version_range}" side = "BOTH" [[dependencies.occultism]] modId = "modonomicon" -mandatory = true +type = "required" versionRange = "${modonomicon_version_range}" side = "BOTH" [[dependencies.occultism]] modId = "theurgy" -mandatory = false +type = "optional" versionRange = "${theurgy_version_range}" side = "BOTH" -[[dependencies.occultism]] -modId = "curios" -mandatory = true -versionRange = "${curios_version_range}" -side = "BOTH" +#TODO: enable once curios is available +#[[dependencies.occultism]] +#modId = "curios" +#type = "required" +#versionRange = "${curios_version_range}" +#side = "BOTH" [[dependencies.occultism]] modId = "geckolib" -mandatory = true +type = "required" versionRange = "${geckolib_version_range}" side = "BOTH" [[dependencies.occultism]] modId = "smartbrainlib" -mandatory = true +type = "required" versionRange = "${smartbrainlib_version_range}" side = "BOTH" [[dependencies.occultism]] modId = "almostunified" -mandatory = false +type = "optional" versionRange = "${almost_unified_version_range}" side = "BOTH" [[dependencies.occultism]] modId = "per_viam_invenire" -mandatory = false +type = "optional" versionRange = "${per_viam_invenire_version_range}" side = "BOTH" [[dependencies.occultism]] modId = "jei" -mandatory = false +type = "optional" versionRange = "${jei_version_range}" side = "BOTH" diff --git a/src/main/resources/data/curios/slots/belt.json b/src/main/resources/data/curios/slots/belt.json new file mode 100644 index 000000000..258a3b3da --- /dev/null +++ b/src/main/resources/data/curios/slots/belt.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "occultism:satchel" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/curios/slots/hands.json b/src/main/resources/data/curios/slots/hands.json new file mode 100644 index 000000000..460e43b29 --- /dev/null +++ b/src/main/resources/data/curios/slots/hands.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "occultism:storage_remote" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/curios/slots/head.json b/src/main/resources/data/curios/slots/head.json new file mode 100644 index 000000000..29e20e805 --- /dev/null +++ b/src/main/resources/data/curios/slots/head.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "occultism:otherworld_goggles" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/curios/slots/ring.json b/src/main/resources/data/curios/slots/ring.json new file mode 100644 index 000000000..9dc3d3a71 --- /dev/null +++ b/src/main/resources/data/curios/slots/ring.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "occultism:familiar_ring" + ] +} diff --git a/src/main/resources/data/minecraft/tags/entity_types/can_breathe_under_water.json b/src/main/resources/data/minecraft/tags/entity_types/can_breathe_under_water.json new file mode 100644 index 000000000..5f6e2a156 --- /dev/null +++ b/src/main/resources/data/minecraft/tags/entity_types/can_breathe_under_water.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "occultism:beaver_familiar", + "occultism:cthulhu_familiar" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/occultism/loot_modifiers/datura_seed_from_grass.json b/src/main/resources/data/occultism/loot_modifiers/datura_seed_from_grass.json index 28b9d4b28..4f94993d0 100644 --- a/src/main/resources/data/occultism/loot_modifiers/datura_seed_from_grass.json +++ b/src/main/resources/data/occultism/loot_modifiers/datura_seed_from_grass.json @@ -1,6 +1,6 @@ { "type": "occultism:add_item", - "conditions": [ + "neoforge:conditions": [ { "condition": "minecraft:random_chance", "chance": 0.02 diff --git a/src/main/resources/data/occultism/loot_modifiers/datura_seed_from_tall_grass.json b/src/main/resources/data/occultism/loot_modifiers/datura_seed_from_tall_grass.json index 913fec86b..6c19a2bac 100644 --- a/src/main/resources/data/occultism/loot_modifiers/datura_seed_from_tall_grass.json +++ b/src/main/resources/data/occultism/loot_modifiers/datura_seed_from_tall_grass.json @@ -1,6 +1,6 @@ { "type": "occultism:add_item", - "conditions": [ + "neoforge:conditions": [ { "condition": "minecraft:random_chance", "chance": 0.02 diff --git a/src/main/resources/data/occultism/loot_modifiers/tallow_from_cows.json b/src/main/resources/data/occultism/loot_modifiers/tallow_from_cows.json index c7e65c9b7..0c600dd27 100644 --- a/src/main/resources/data/occultism/loot_modifiers/tallow_from_cows.json +++ b/src/main/resources/data/occultism/loot_modifiers/tallow_from_cows.json @@ -1,6 +1,6 @@ { "type": "occultism:add_item", - "conditions": [ + "neoforge:conditions": [ { "condition": "minecraft:entity_properties", "entity": "killer", diff --git a/src/main/resources/data/occultism/loot_modifiers/tallow_from_donkeys.json b/src/main/resources/data/occultism/loot_modifiers/tallow_from_donkeys.json index f982e9c4a..097deaaaf 100644 --- a/src/main/resources/data/occultism/loot_modifiers/tallow_from_donkeys.json +++ b/src/main/resources/data/occultism/loot_modifiers/tallow_from_donkeys.json @@ -1,6 +1,6 @@ { "type": "occultism:add_item", - "conditions": [ + "neoforge:conditions": [ { "condition": "minecraft:entity_properties", "entity": "killer", diff --git a/src/main/resources/data/occultism/loot_modifiers/tallow_from_goats.json b/src/main/resources/data/occultism/loot_modifiers/tallow_from_goats.json index 3e5fc8897..b822d0ed4 100644 --- a/src/main/resources/data/occultism/loot_modifiers/tallow_from_goats.json +++ b/src/main/resources/data/occultism/loot_modifiers/tallow_from_goats.json @@ -1,6 +1,6 @@ { "type": "occultism:add_item", - "conditions": [ + "neoforge:conditions": [ { "condition": "minecraft:entity_properties", "entity": "killer", diff --git a/src/main/resources/data/occultism/loot_modifiers/tallow_from_hoglins.json b/src/main/resources/data/occultism/loot_modifiers/tallow_from_hoglins.json index d971fe63c..6701881ad 100644 --- a/src/main/resources/data/occultism/loot_modifiers/tallow_from_hoglins.json +++ b/src/main/resources/data/occultism/loot_modifiers/tallow_from_hoglins.json @@ -1,6 +1,6 @@ { "type": "occultism:add_item", - "conditions": [ + "neoforge:conditions": [ { "condition": "minecraft:entity_properties", "entity": "killer", diff --git a/src/main/resources/data/occultism/loot_modifiers/tallow_from_horses.json b/src/main/resources/data/occultism/loot_modifiers/tallow_from_horses.json index b7185e628..4c63d93c5 100644 --- a/src/main/resources/data/occultism/loot_modifiers/tallow_from_horses.json +++ b/src/main/resources/data/occultism/loot_modifiers/tallow_from_horses.json @@ -1,6 +1,6 @@ { "type": "occultism:add_item", - "conditions": [ + "neoforge:conditions": [ { "condition": "minecraft:entity_properties", "entity": "killer", diff --git a/src/main/resources/data/occultism/loot_modifiers/tallow_from_llamas.json b/src/main/resources/data/occultism/loot_modifiers/tallow_from_llamas.json index 076cdea56..a393c6225 100644 --- a/src/main/resources/data/occultism/loot_modifiers/tallow_from_llamas.json +++ b/src/main/resources/data/occultism/loot_modifiers/tallow_from_llamas.json @@ -1,6 +1,6 @@ { "type": "occultism:add_item", - "conditions": [ + "neoforge:conditions": [ { "condition": "minecraft:entity_properties", "entity": "killer", diff --git a/src/main/resources/data/occultism/loot_modifiers/tallow_from_mules.json b/src/main/resources/data/occultism/loot_modifiers/tallow_from_mules.json index 013b50c49..d5348fef3 100644 --- a/src/main/resources/data/occultism/loot_modifiers/tallow_from_mules.json +++ b/src/main/resources/data/occultism/loot_modifiers/tallow_from_mules.json @@ -1,6 +1,6 @@ { "type": "occultism:add_item", - "conditions": [ + "neoforge:conditions": [ { "condition": "minecraft:entity_properties", "entity": "killer", diff --git a/src/main/resources/data/occultism/loot_modifiers/tallow_from_pandas.json b/src/main/resources/data/occultism/loot_modifiers/tallow_from_pandas.json index 6e1b427fd..898e48117 100644 --- a/src/main/resources/data/occultism/loot_modifiers/tallow_from_pandas.json +++ b/src/main/resources/data/occultism/loot_modifiers/tallow_from_pandas.json @@ -1,6 +1,6 @@ { "type": "occultism:add_item", - "conditions": [ + "neoforge:conditions": [ { "condition": "minecraft:entity_properties", "entity": "killer", diff --git a/src/main/resources/data/occultism/loot_modifiers/tallow_from_pigs.json b/src/main/resources/data/occultism/loot_modifiers/tallow_from_pigs.json index b923e09d8..05514e230 100644 --- a/src/main/resources/data/occultism/loot_modifiers/tallow_from_pigs.json +++ b/src/main/resources/data/occultism/loot_modifiers/tallow_from_pigs.json @@ -1,6 +1,6 @@ { "type": "occultism:add_item", - "conditions": [ + "neoforge:conditions": [ { "condition": "minecraft:entity_properties", "entity": "killer", diff --git a/src/main/resources/data/occultism/loot_modifiers/tallow_from_sheep.json b/src/main/resources/data/occultism/loot_modifiers/tallow_from_sheep.json index e2d269bb5..6984b664d 100644 --- a/src/main/resources/data/occultism/loot_modifiers/tallow_from_sheep.json +++ b/src/main/resources/data/occultism/loot_modifiers/tallow_from_sheep.json @@ -1,6 +1,6 @@ { "type": "occultism:add_item", - "conditions": [ + "neoforge:conditions": [ { "condition": "minecraft:entity_properties", "entity": "killer", diff --git a/src/main/resources/data/occultism/recipes/miner/ores/agate_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/agate_ore.json index 278c376e2..c36d02f55 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/agate_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/agate_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/agate" }, "weight": 200, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/agate" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/aluminum_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/aluminum_ore.json index 3d6ccfa1a..14a84bf59 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/aluminum_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/aluminum_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/aluminum" }, "weight": 422, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/aluminum" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/amber_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/amber_ore.json index 965b40a95..d17fcf583 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/amber_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/amber_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/amber" }, "weight": 184, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/amber" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/amethyst_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/amethyst_ore.json index f1094985f..e055ef082 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/amethyst_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/amethyst_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/amethyst" }, "weight": 200, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/amethyst" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/aquamarine_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/aquamarine_ore.json index 7a83dce80..34c8a8f25 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/aquamarine_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/aquamarine_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/aquamarine" }, "weight": 200, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/aquamarine" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/ardite_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/ardite_ore.json index bbadfd6d7..4ff27a7f6 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/ardite_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/ardite_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/ardite" }, "weight": 159, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/ardite" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/beryl_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/beryl_ore.json index 0b9e1424f..480074a90 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/beryl_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/beryl_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/beryl" }, "weight": 200, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/beryl" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/boron_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/boron_ore.json index 95caec047..c9310c7cc 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/boron_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/boron_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/boron" }, "weight": 199, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/boron" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/certus_quartz_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/certus_quartz_ore.json index 4acfabc34..469bb6508 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/certus_quartz_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/certus_quartz_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/certus_quartz" }, "weight": 187, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/certus_quartz" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/cinnabar_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/cinnabar_ore.json index 05c2af150..bb7e033b0 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/cinnabar_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/cinnabar_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/cinnabar" }, "weight": 190, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/cinnabar" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/cobalt_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/cobalt_ore.json index cf419ecde..83dd716c8 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/cobalt_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/cobalt_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/cobalt" }, "weight": 163, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/cobalt" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/dimensional_shard_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/dimensional_shard_ore.json index 4918e39c9..508dc117f 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/dimensional_shard_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/dimensional_shard_ore.json @@ -7,9 +7,9 @@ "item": "rftools:dimensional_shard_ore" }, "weight": 127, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:item_exists", + "type": "neoforge:item_exists", "item": "rftools:dimensional_shard_ore" } ] diff --git a/src/main/resources/data/occultism/recipes/miner/ores/draconium_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/draconium_ore.json index d5acaf62f..9279dd0f2 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/draconium_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/draconium_ore.json @@ -7,9 +7,9 @@ "item": "draconicevolution:draconium_ore" }, "weight": 142, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:item_exists", + "type": "neoforge:item_exists", "item": "draconicevolution:draconium_ore" } ] diff --git a/src/main/resources/data/occultism/recipes/miner/ores/electrotine_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/electrotine_ore.json index b8d1c951f..95efab268 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/electrotine_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/electrotine_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/electrotine" }, "weight": 155, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/electrotine" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/garnet_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/garnet_ore.json index 1fd410df2..349560da2 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/garnet_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/garnet_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/garnet" }, "weight": 200, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/garnet" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/heliodor_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/heliodor_ore.json index 041b55e34..087fad5c5 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/heliodor_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/heliodor_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/heliodor" }, "weight": 200, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/heliodor" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/indicolite_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/indicolite_ore.json index ba6e0e469..a73ae2873 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/indicolite_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/indicolite_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/indicolite" }, "weight": 200, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/indicolite" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/inferium_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/inferium_ore.json index 81ebd039a..91e084f7c 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/inferium_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/inferium_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/inferium" }, "weight": 190, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/inferium" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/iolite_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/iolite_ore.json index 671ca0897..d3c69c31e 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/iolite_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/iolite_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/iolite" }, "weight": 200, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/iolite" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/lead_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/lead_ore.json index 1f6aba2e8..093896b8a 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/lead_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/lead_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/lead" }, "weight": 500, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/lead" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/lithium_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/lithium_ore.json index 99d0c0642..79a601580 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/lithium_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/lithium_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/lithium" }, "weight": 201, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/lithium" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/magnesium_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/magnesium_ore.json index 3ec51a9f9..34bc2635e 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/magnesium_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/magnesium_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/magnesium" }, "weight": 233, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/magnesium" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/malachite_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/malachite_ore.json index 0739df737..eb4af16e9 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/malachite_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/malachite_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/malachite" }, "weight": 200, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/malachite" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/mithril_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/mithril_ore.json index 0040bbe87..68ae47741 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/mithril_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/mithril_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/mithril" }, "weight": 169, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/mithril" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/morganite_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/morganite_ore.json index eb0a12d0b..d8edf47a0 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/morganite_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/morganite_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/morganite" }, "weight": 200, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/morganite" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/nickel_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/nickel_ore.json index 324fdd419..bea0839dc 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/nickel_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/nickel_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/nickel" }, "weight": 232, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/nickel" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/niter_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/niter_ore.json index 6d55ee74b..1f6417adf 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/niter_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/niter_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/niter" }, "weight": 244, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/niter" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/onyx_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/onyx_ore.json index 5ff61d98b..79a0c779a 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/onyx_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/onyx_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/onyx" }, "weight": 200, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/onyx" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/opal_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/opal_ore.json index 688829178..074486238 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/opal_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/opal_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/opal" }, "weight": 200, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/opal" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/osmium_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/osmium_ore.json index 063cfeeb7..ed10fc83f 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/osmium_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/osmium_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/osmium" }, "weight": 203, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/osmium" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/peridot_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/peridot_ore.json index 0f699fe86..7d7c8b330 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/peridot_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/peridot_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/peridot" }, "weight": 200, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/peridot" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/platinum_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/platinum_ore.json index 561430a26..c1c020d06 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/platinum_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/platinum_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/platinum" }, "weight": 150, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/platinum" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/prosperity_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/prosperity_ore.json index f20be81df..0aa8093cf 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/prosperity_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/prosperity_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/prosperity" }, "weight": 155, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/prosperity" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/ruby_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/ruby_ore.json index 2c3898c79..16b29e891 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/ruby_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/ruby_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/ruby" }, "weight": 200, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/ruby" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/salt_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/salt_ore.json index 6c4bf8191..b04e4f416 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/salt_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/salt_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/salt" }, "weight": 160, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/salt" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/sapphire_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/sapphire_ore.json index 054fa43ba..564e5893f 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/sapphire_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/sapphire_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/sapphire" }, "weight": 200, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/sapphire" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/silver_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/silver_ore.json index eb967842a..1f2e67232 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/silver_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/silver_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/silver" }, "weight": 381, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/silver" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/skystone.json b/src/main/resources/data/occultism/recipes/miner/ores/skystone.json index 54a81fc73..4b8d17bd4 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/skystone.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/skystone.json @@ -7,11 +7,11 @@ "item": "ae2:sky_stone_block" }, "weight": 50, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/certus_quartz" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/sulfur_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/sulfur_ore.json index 255a22885..5141a54f3 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/sulfur_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/sulfur_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/sulfur" }, "weight": 222, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/sulfur" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/tanzanite_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/tanzanite_ore.json index bc122b19c..e8929b295 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/tanzanite_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/tanzanite_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/tanzanite" }, "weight": 200, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/tanzanite" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/thorium_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/thorium_ore.json index 2956b1632..aebbb7520 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/thorium_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/thorium_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/thorium" }, "weight": 222, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/thorium" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/tin_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/tin_ore.json index 90140e139..f6431dd27 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/tin_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/tin_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/tin" }, "weight": 602, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/tin" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/topaz_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/topaz_ore.json index 478231d43..f1d7486ca 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/topaz_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/topaz_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/topaz" }, "weight": 200, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/topaz" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/tungsten_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/tungsten_ore.json index 51e554455..fbfd036b3 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/tungsten_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/tungsten_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/tungsten" }, "weight": 192, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/tungsten" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/uranium_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/uranium_ore.json index 51fd5d03a..8e15e0d23 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/uranium_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/uranium_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/uranium" }, "weight": 140, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/uranium" } } diff --git a/src/main/resources/data/occultism/recipes/miner/ores/zinc_ore.json b/src/main/resources/data/occultism/recipes/miner/ores/zinc_ore.json index fff035423..27137a6a1 100644 --- a/src/main/resources/data/occultism/recipes/miner/ores/zinc_ore.json +++ b/src/main/resources/data/occultism/recipes/miner/ores/zinc_ore.json @@ -7,11 +7,11 @@ "tag": "forge:ores/zinc" }, "weight": 186, - "conditions": [ + "neoforge:conditions": [ { - "type": "forge:not", + "type": "neoforge:not", "value": { - "type": "forge:tag_empty", + "type": "neoforge:tag_empty", "tag": "forge:ores/zinc" } }