diff --git a/.editorconfig b/.editorconfig
index a18e8d5829..0614989b23 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -25,5 +25,5 @@ ij_java_blank_lines_before_method_body = 0
ij_java_else_on_new_line = false
ij_java_class_count_to_use_import_on_demand = 999
ij_java_names_count_to_use_import_on_demand = 999
-ij_java_imports_layout = $*,|,java.**,|,javax.**,|,org.**,|,com.**,|,*,|,net.minecraftforge.**
+ij_java_imports_layout = $*,|,java.**,|,javax.**,|,org.**,|,com.**,|,*,|,net.neoforged.**
ij_java_insert_inner_class_imports = true
\ No newline at end of file
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000000..12c7b0873b
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,31 @@
+name: Build
+
+on: [ workflow_dispatch, push, pull_request ]
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Repository
+ uses: actions/checkout@v4
+
+ - name: Setup Java
+ run: echo "JAVA_HOME=$JAVA_HOME_17_X64" >> "$GITHUB_ENV"
+
+ - name: NeoGradle Cache
+ uses: actions/cache@v4
+ with:
+ path: "**/.gradle/repositories/"
+ key: "${{ runner.os }}-gradle-${{ hashFiles('**/libs.versions.*', '**/*.gradle*', '**/gradle-wrapper.properties') }}"
+ restore-keys: "${{ runner.os }}-gradle-"
+
+ - name: Setup Gradle
+ uses: gradle/actions/setup-gradle@v4
+ with:
+ gradle-home-cache-cleanup: true
+
+ - name: Validate Gradle Wrapper Integrity
+ uses: gradle/wrapper-validation-action@v2
+
+ - name: Build
+ run: ./gradlew build
diff --git a/.github/workflows/gametest.yml b/.github/workflows/gametest.yml
index 23bb055a98..4d65d58b00 100644
--- a/.github/workflows/gametest.yml
+++ b/.github/workflows/gametest.yml
@@ -1,23 +1,33 @@
-name: gametest
+name: GameTests
+
on: [ workflow_dispatch ]
jobs:
- build:
- runs-on: ubuntu-latest
- steps:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Repository
+ uses: actions/checkout@v4
- - name: checkout repository
- uses: actions/checkout@v3
+ - name: Setup Java
+ run: echo "JAVA_HOME=$JAVA_HOME_17_X64" >> "$GITHUB_ENV"
- - name: setup Java
- uses: actions/setup-java@v3
- with:
- distribution: temurin
- java-version: 17
- cache: gradle
+ - name: NeoGradle Cache
+ uses: actions/cache@v4
+ if: ${{ !endsWith(github.ref, '/dev') }}
+ with:
+ path: "**/.gradle/repositories/"
+ key: "${{ runner.os }}-gradle-${{ hashFiles('**/libs.versions.*', '**/*.gradle*', '**/gradle-wrapper.properties') }}"
+ restore-keys: "${{ runner.os }}-gradle-"
- - name: make gradle wrapper executable
- run: chmod +x ./gradlew
+ - name: Setup Gradle
+ uses: gradle/actions/setup-gradle@v3
+ with:
+ gradle-home-cache-cleanup: true
+ cache-read-only: ${{ !endsWith(github.ref, '/dev') }}
- - name: run gametests
- run: ./gradlew prepareRunGameTestServer runGameTestServer --no-daemon
+ - name: Validate Gradle Wrapper Integrity
+ uses: gradle/wrapper-validation-action@v2
+
+ - name: Run GameTest Server
+ run: ./gradlew runGameTestServer
diff --git a/.github/workflows/label-actions.yml b/.github/workflows/label-actions.yml
index 1b59fae39c..76a959ab24 100644
--- a/.github/workflows/label-actions.yml
+++ b/.github/workflows/label-actions.yml
@@ -1,21 +1,21 @@
name: "Label Actions"
on:
- issues:
- types: [labeled, unlabeled]
- pull_request_target:
- types: [labeled, unlabeled]
+ issues:
+ types: [ labeled, unlabeled ]
+ pull_request_target:
+ types: [ labeled, unlabeled ]
permissions:
- contents: read
- issues: write
- pull-requests: write
- discussions: write
+ contents: read
+ issues: write
+ pull-requests: write
+ discussions: write
jobs:
- action:
- runs-on: ubuntu-latest
- steps:
- - uses: dessant/label-actions@102faf474a544be75fbaf4df54e73d3c515a0e65 # Depend on an exact commit
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- config-path: '.github/config/label-actions.yml'
+ action:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: dessant/label-actions@102faf474a544be75fbaf4df54e73d3c515a0e65 # Depend on an exact commit
+ with:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ config-path: '.github/config/label-actions.yml'
diff --git a/.github/workflows/localization.yml b/.github/workflows/localization.yml
index 01bed80205..b3605fd8a8 100644
--- a/.github/workflows/localization.yml
+++ b/.github/workflows/localization.yml
@@ -5,44 +5,44 @@ name: Crowdin Action
# Controls when the action will run.
on: workflow_dispatch
- # Only run when started manually
+ # Only run when started manually
- #:
- # inputs:
- # uploadTranslations:
- # description: "Set to true to upload (changed) translations to Crowdin"
- # type: boolean
- # required: true
- # default: false
+ #:
+ # inputs:
+ # uploadTranslations:
+ # description: "Set to true to upload (changed) translations to Crowdin"
+ # type: boolean
+ # required: true
+ # default: false
- #schedule:
- #- cron: '0 */6 * * *' # Every 6 hours - https://crontab.guru/#0_*/6_*_*_*
+#schedule:
+#- cron: '0 */6 * * *' # Every 6 hours - https://crontab.guru/#0_*/6_*_*_*
jobs:
- synchronize-with-crowdin:
- runs-on: ubuntu-latest
+ synchronize-with-crowdin:
+ runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v2
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
- - name: crowdin action
- uses: crowdin/github-action@1.4.9
- with:
- # Upload sources to Crowdin
- upload_sources: true
- # Upload translations to Crowdin, only use true at initial run
- upload_translations: false
- # Make pull request of Crowdin translations
- download_translations: true
- # To download translations to the specified version branch
- localization_branch_name: l10n_crowdin_translations
- # Create pull request after pushing to branch
- create_pull_request: true
- pull_request_title: 'New Crowdin translations'
- pull_request_body: 'New Crowdin pull request with translations'
- pull_request_base_branch_name: 'mc1.20.1/dev'
- env:
- GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
- CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
+ - name: crowdin action
+ uses: crowdin/github-action@1.4.9
+ with:
+ # Upload sources to Crowdin
+ upload_sources: true
+ # Upload translations to Crowdin, only use true at initial run
+ upload_translations: false
+ # Make pull request of Crowdin translations
+ download_translations: true
+ # To download translations to the specified version branch
+ localization_branch_name: l10n_crowdin_translations
+ # Create pull request after pushing to branch
+ create_pull_request: true
+ pull_request_title: 'New Crowdin translations'
+ pull_request_body: 'New Crowdin pull request with translations'
+ pull_request_base_branch_name: 'mc1.20.1/dev'
+ env:
+ GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
+ CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
+ CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
diff --git a/build.gradle b/build.gradle
index 89d9b78bb1..73f6a5d780 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,459 +1,230 @@
plugins {
- id 'idea'
+ id 'java-library'
id 'eclipse'
+ id 'idea'
id 'maven-publish'
-
- id 'net.minecraftforge.gradle' version "${forgegradle_version}"
- id 'org.spongepowered.mixin' version "${mixingradle_version}"
- id 'org.parchmentmc.librarian.forgegradle' version "${librarian_version}"
-
- id 'com.matthewprenger.cursegradle' version "${cursegradle_version}"
+ id 'net.neoforged.moddev' version '2.0.9-beta'
}
-apply from: './gradle/java.gradle'
+boolean dev = System.getenv('RELEASE') == null || System.getenv('RELEASE').equals('false');
+String buildNumber = System.getenv('BUILD_NUMBER')
-jarJar.enable()
+version = project.mod_version + (dev && buildNumber != null ? "-${buildNumber}" : '')
+group = project.maven_group
-boolean dev = System.getenv('RELEASE') == null || System.getenv('RELEASE').equals('false')
-ext.buildNumber = System.getenv('BUILD_NUMBER')
+repositories {
+ mavenLocal()
+}
base {
- archivesName = "create-${artifact_minecraft_version}"
- group = 'com.simibubi.create'
- version = mod_version + (dev && buildNumber != null ? "-${buildNumber}" : '')
+ archivesName = "$mod_id-$minecraft_version"
}
-boolean inMultiModWorkspace = rootProject.hasProperty('multiModWorkspace.enabled')
-boolean catnipInWorkspace = rootProject.hasProperty('multiModWorkspace.catnip')
-boolean ponderInWorkspace = rootProject.hasProperty('multiModWorkspace.ponder')
+java.toolchain.languageVersion = JavaLanguageVersion.of(21)
-if (catnipInWorkspace) {
- evaluationDependsOn(":catnip:Forge")
-}
+neoForge {
+ version = project.neo_version
-if (ponderInWorkspace) {
- evaluationDependsOn(":ponder:Forge")
-}
-
-project.logger.lifecycle("MultiModWorkspace ${inMultiModWorkspace ? 'enabled' : 'disabled'} for project ${project.name}.")
-project.logger.lifecycle("Dependencies included in Workspace: [Catnip: ${catnipInWorkspace}], [Ponder: ${ponderInWorkspace}]")
-
-mixin {
- add sourceSets.main, 'create.refmap.json'
-
- config 'create.mixins.json'
-}
-
-println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
-
-mixin {
- add sourceSets.main, 'create.refmap.json'
-
- debug.verbose = true
- debug.export = true
-}
-
-idea {
- module {
- downloadJavadoc = true
- downloadSources = true
- }
-}
-
-minecraft {
-
- if (Boolean.parseBoolean(use_parchment)) {
- mappings channel: 'parchment', version: "${parchment_version}-${minecraft_version}"
- } else {
- mappings channel: 'official', version: "${minecraft_version}"
+ parchment {
+ minecraftVersion = project.parchment_minecraft_version
+ mappingsVersion = project.parchment_version
}
- // This property allows configuring Gradle's ProcessResources task(s) to run on IDE output locations before launching the game.
- copyIdeResources = true
-
- if (file('src/main/resources/META-INF/accesstransformer.cfg').exists()) {
- accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
- }
+ accessTransformers = project.files('src/main/resources/META-INF/accesstransformer.cfg')
runs {
- // applies to all the run configs below
- configureEach {
- if (inMultiModWorkspace)
- ideaModule "createmod.Create.main"
- else
- ideaModule "Create.main"
-
- property 'forge.logging.markers', ''
- property 'forge.logging.console.level', 'info'
- jvmArgs '-XX:+IgnoreUnrecognizedVMOptions', '-XX:+AllowEnhancedClassRedefinition'
- //jvmArgs("-XX:-OmitStackTraceInFastThrow") // uncomment when you get exceptions with null messages etc
- //jvmArgs '-XX:+UnlockCommercialFeatures' // uncomment for profiling
-
- property 'mixin.debug.export', 'true'
- property 'mixin.env.remapRefMap', 'true'
- property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
-
- arg '-mixin.config=create.mixins.json'
- arg '-mixin.config=catnip.mixins.json'
-
- mods {
- create {
- source sourceSets.main
- }
-
- if (catnipInWorkspace) {
- catnip {
- source project(":catnip:Common").sourceSets.main
- source project(":catnip:Forge").sourceSets.main
- }
- }
-
- if (ponderInWorkspace) {
- ponder {
- source project(":ponder:Common").sourceSets.main
- source project(":ponder:Forge").sourceSets.main
- }
- }
- }
- }
-
client {
- workingDirectory project.file('run')
+ client()
+
+ // Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
+ systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
}
server {
- workingDirectory project.file('run/server')
+ server()
+
+ gameDirectory = project.file('run/server')
+
+ programArgument '--nogui'
+ systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
+ }
+
+ // This run config launches GameTestServer and runs all registered gametests, then exits.
+ // By default, the server will crash when no gametests are provided.
+ // The gametest system is also enabled by default for other run configs under the /test command.
+ gameTestServer {
+ type = "gameTestServer"
+ systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
}
data {
- workingDirectory project.file('run')
- property 'forge.logging.markers', 'REGISTRIES,REGISTRYDUMP'
- property 'forge.logging.console.level', 'debug'
- args '--mod', 'create', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources')
+ data()
+
+ // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
+ programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}
- gameTestServer {
- workingDirectory project.file('run/gametest')
- // setForceExit false <- FIXME 1.20
+ configureEach {
+ systemProperty 'forge.logging.markers', 'REGISTRIES'
+
+ systemProperty 'mixin.debug.verbose', 'true'
+ systemProperty 'mixin.debug.export', 'true'
+
+ // IThundxr ~ I use JBR for enhanced hotswap, this adds the required arg while not affecting other people
+ jvmArguments = ["-XX:+AllowEnhancedClassRedefinition", "-XX:+IgnoreUnrecognizedVMOptions"]
+
+ logLevel = org.slf4j.event.Level.DEBUG
+ }
+ }
+
+ mods {
+ "${mod_id}" {
+ sourceSet(sourceSets.main)
}
}
}
+configurations {
+ runtimeClasspath.extendsFrom localRuntime
+}
+
repositories {
- maven {
- // location of the maven for Registrate and Flywheel
- name = 'tterrag maven'
- url = 'https://maven.tterrag.com'
- }
- maven {
- // location of the maven that hosts JEI files since January 2023
- // location of the maven for Vazkii's mods
- name = "Jared's maven"
- url = "https://maven.blamejared.com/"
- }
- /*maven {
- // location of a maven mirror for JEI files, as a fallback
- name = "ModMaven"
- url = "https://modmaven.dev"
- }*/
- maven {
- // location of the maven for Dynamic Trees
- url = 'https://harleyoconnor.com/maven'
- }
- maven {
- // location of the maven for Curios API
- url = "https://maven.theillusivec4.top/"
- }
- maven {
- // location of maven for CC: Tweaked
- name = "squiddev"
- url = "https://squiddev.cc/maven/"
- }
- maven {
- name = "ftb"
- url = "https://maven.saps.dev/releases"
- }
- maven {
- name = "architectury"
- url = "https://maven.architectury.dev/"
- }
- maven {
- url = "https://jm.gserv.me/repository/maven-public/"
+ maven { url = "https://maven.createmod.net" } // Ponder, Catnip
+ maven { url = "https://maven.tterrag.com" } // Flywheel
+ maven { url = "https://maven.ithundxr.dev/snapshots" } // Registrate
+ maven { url = "https://maven.blamejared.com" } // JEI, Vazkii's Mods
+ maven { url = "https://harleyoconnor.com/maven" } // Dynamic Trees
+ maven { url = "https://maven.theillusivec4.top/" } // Curios API
+ maven { url = "https://maven.squiddev.cc/" } // CC: Tweaked
+ maven { url = "https://www.cursemaven.com" }
+ maven { url = "https://api.modrinth.com/maven" }
+ maven { url = "https://maven.saps.dev/releases" } // FTB Mods
+ maven { url = "https://maven.architectury.dev/" } // Arch API
+ maven { url = "https://jm.gserv.me/repository/maven-public/" // JourneyMap
content {
includeGroup "info.journeymap"
includeGroup "mysticdrew"
}
}
-
- maven {
- url = 'https://www.cursemaven.com'
- content {
- includeGroup "curse.maven"
- }
- }
- maven {
- // Location of the maven for Ponder, Catnip
- name = 'createmod maven'
- url 'https://maven.createmod.net'
- }
- maven {
- name = "Modrinth"
- url = "https://api.modrinth.com/maven"
- content {
- includeGroup "maven.modrinth"
- }
- }
- maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" }
-
// Mirror of maven.createmod.net
if (System.getProperty("os.name").contains("Mac") && System.getenv("USER") == "ithundxr") {
maven { url = "https://maven.ithundxr.dev/mirror" }
}
- mavenCentral()
- mavenLocal()
+ // todo - temp
+ maven { url = "https://maven.ithundxr.dev/hidden" } // Flywheel 1.21 PR
flatDir {
- dirs 'libs'
+ dirs "libs"
+ }
+}
+
+dependencies {
+ jarJar(implementation("com.tterrag.registrate:Registrate:${registrate_version}"))
+
+ compileOnly("dev.engine_room.flywheel:flywheel-neoforge-api-${flywheel_minecraft_version}:${flywheel_version}")
+ jarJar(runtimeOnly("dev.engine_room.flywheel:flywheel-neoforge-${flywheel_minecraft_version}:${flywheel_version}"))
+
+ jarJar(implementation("net.createmod.catnip:Catnip-NeoForge-${catnip_and_ponder_mc_ver}:${catnip_version}"))
+ jarJar(implementation("net.createmod.ponder:Ponder-NeoForge-${catnip_and_ponder_mc_ver}:${ponder_version}"))
+
+ //compileOnly("mezz.jei:jei-${jei_minecraft_version}-common-api:${jei_version}")
+ //compileOnly("mezz.jei:jei-${jei_minecraft_version}-neoforge-api:${jei_version}")
+ implementation("mezz.jei:jei-${jei_minecraft_version}-neoforge:${jei_version}")
+
+ compileOnly("top.theillusivec4.curios:curios-neoforge:${curios_version}+${curios_minecraft_version}:api")
+ // FIXME: Look into what to replace this with
+ //runtimeOnly("top.theillusivec4.curios:curios-neoforge:${curios_version}+${curios_minecraft_version}")
+
+ if (cc_tweaked_enable.toBoolean()) {
+ compileOnly("cc.tweaked:cc-tweaked-${cc_tweaked_minecraft_version}-core-api:${cc_tweaked_version}")
+ compileOnly("cc.tweaked:cc-tweaked-${cc_tweaked_minecraft_version}-forge-api:${cc_tweaked_version}")
+ if (!cc_tweaked_disable_runtime.toBoolean())
+ runtimeOnly("cc.tweaked:cc-tweaked-${cc_tweaked_minecraft_version}-forge:${cc_tweaked_version}")
+ }
+
+ implementation("dev.architectury:architectury-neoforge:13.0.8")
+ implementation("dev.ftb.mods:ftb-chunks-neoforge:2101.1.1")
+ implementation("dev.ftb.mods:ftb-teams-neoforge:2101.1.0")
+ implementation("dev.ftb.mods:ftb-library-neoforge:2101.1.3")
+
+ implementation("maven.modrinth:journeymap:1.21.1-6.0.0-beta.32+neoforge")
+ implementation("info.journeymap:journeymap-api-neoforge:2.0.0-1.21.1-SNAPSHOT")
+
+ // implementation("curse.maven:druidcraft-340991:3101903")
+ // implementation("com.ferreusveritas.dynamictrees:DynamicTrees-1.16.5:0.10.0-Beta25")
+ // runtimeOnly("vazkii.arl:AutoRegLib:1.4-35.69")
+ // runtimeOnly("vazkii.quark:Quark:r2.0-212.984")
+ // runtimeOnly("slimeknights.mantle:Mantle:1.16.5-1.6.115")
+ // runtimeOnly("slimeknights.tconstruct:TConstruct:1.16.5-3.1.1.252")
+ // runtimeOnly("maven.modrinth:rubidium:0.5.3")
+ // implementation("com.railwayteam.railways:railways-1.18.2-1.1.1:all" { transitive = false })
+ // runtimeOnly("maven.modrinth:aether:1.19.2-1.0.0-beta.1.1-forge")
+ // runtimeOnly("maven.modrinth:spark:1.10.38-forge")
+ // runtimeOnly("curse.maven:xycraft-653786:4788862")
+ // runtimeOnly("curse.maven:xycraft-world-653789:4788863")
+}
+
+sourceSets.main.java {
+ if (!cc_tweaked_enable.toBoolean()) {
+ exclude "com/simibubi/create/compat/computercraft/implementation/**"
}
}
sourceSets.main.resources {
- srcDir 'src/generated/resources'
- exclude '.cache/'
+ srcDir "src/generated/resources"
+ exclude ".cache/"
}
-dependencies {
- minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
-
- jarJar("com.tterrag.registrate:Registrate:${registrate_version}") {
- jarJar.ranged(it, '[MC1.19.3-1.1.10,)')
- }
- jarJar("dev.engine_room.flywheel:flywheel-forge-${flywheel_minecraft_version}:${flywheel_version}") {
- jarJar.ranged(it, '[1.0,2.0)')
- }
-
- jarJar("net.createmod.catnip:Catnip-Forge-${minecraft_version}:${catnip_version}") {
- jarJar.ranged(it, '[0.7.5,)')
- }
- jarJar("net.createmod.ponder:Ponder-Forge-${minecraft_version}:${ponder_version}") {
- jarJar.ranged(it, '[0.7.5,)')
- }
-
- implementation(jarJar("io.github.llamalad7:mixinextras-forge:${mixin_extras_version}")) {
- jarJar.ranged(it, "[${mixin_extras_version},)")
- }
-
- implementation fg.deobf("com.tterrag.registrate:Registrate:${registrate_version}")
-
- compileOnly fg.deobf("dev.engine_room.flywheel:flywheel-forge-api-${flywheel_minecraft_version}:${flywheel_version}")
- runtimeOnly fg.deobf("dev.engine_room.flywheel:flywheel-forge-${flywheel_minecraft_version}:${flywheel_version}")
-
- if (catnipInWorkspace) {
- implementation project(":catnip:Common")
- implementation project(":catnip:Forge")
- } else {
- implementation fg.deobf("net.createmod.catnip:Catnip-Forge-${minecraft_version}:${catnip_version}")
- }
-
- if (ponderInWorkspace) {
- implementation project(":ponder:Common")
- implementation project(":ponder:Forge")
- } else {
- implementation fg.deobf("net.createmod.ponder:Ponder-Forge-${minecraft_version}:${ponder_version}")
- }
-
- compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:${mixin_extras_version}"))
-
- // compileOnly fg.deobf("mezz.jei:jei-${jei_minecraft_version}-common-api:${jei_version}")
- // compileOnly fg.deobf("mezz.jei:jei-${jei_minecraft_version}-forge-api:${jei_version}")
- implementation fg.deobf("mezz.jei:jei-${jei_minecraft_version}-forge:${jei_version}")
-
- compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}+${curios_minecraft_version}:api")
- runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}+${curios_minecraft_version}")
-
- if (cc_tweaked_enable.toBoolean()) {
- compileOnly("cc.tweaked:cc-tweaked-${cc_tweaked_minecraft_version}-core-api:${cc_tweaked_version}")
- compileOnly fg.deobf("cc.tweaked:cc-tweaked-${cc_tweaked_minecraft_version}-forge-api:${cc_tweaked_version}")
- runtimeOnly fg.deobf("cc.tweaked:cc-tweaked-${cc_tweaked_minecraft_version}-forge:${cc_tweaked_version}")
- }
-
- if (dynamic_trees_enable.toBoolean()) {
- compileOnly fg.deobf("com.ferreusveritas.dynamictrees:DynamicTrees-${dynamic_trees_minecraft_version}:${dynamic_trees_version}")
- }
-
- // implementation fg.deobf("curse.maven:ic2-classic-242942:5555152")
- // implementation fg.deobf("curse.maven:druidcraft-340991:3101903")
- // implementation fg.deobf("com.railwayteam.railways:railways-1.19.2-1.6.4:all") { transitive = false }
-
- implementation fg.deobf("dev.architectury:architectury-forge:9.1.12")
- implementation fg.deobf("dev.ftb.mods:ftb-chunks-forge:2001.3.1")
- implementation fg.deobf("dev.ftb.mods:ftb-teams-forge:2001.3.0")
- implementation fg.deobf("dev.ftb.mods:ftb-library-forge:2001.2.4")
-
- implementation fg.deobf("curse.maven:journeymap-32274:5457831")
- // implementation fg.deobf("ignored:journeymap-1.20.1-5.10.1-forge")
-
- // runtimeOnly fg.deobf("curse.maven:framedblocks-441647:5399211")
- // runtimeOnly fg.deobf("curse.maven:galosphere-631098:4574834")
- // runtimeOnly fg.deobf("curse.maven:elementary-ores-332609:4514276") 1.19.4 only
- // runtimeOnly fg.deobf("curse.maven:flib-661261:4479544")
- // runtimeOnly fg.deobf("curse.maven:infernal-expansion-395078:4002091")
- // runtimeOnly fg.deobf("vazkii.autoreglib:AutoRegLib:1.8.2-58.126")
- // runtimeOnly fg.deobf("curse.maven:quark-243121:4812006")
- // runtimeOnly fg.deobf("curse.maven:mantle-74924:5339977")
- // runtimeOnly fg.deobf("curse.maven:tinkers-construct-74072:5358052")
- // runtimeOnly fg.deobf("maven.modrinth:rubidium:0.6.2c")
- // runtimeOnly fg.deobf("maven.modrinth:aether:1.19.2-1.4.2-forge")
- // runtimeOnly fg.deobf("maven.modrinth:spark:1.10.38-forge")
- // runtimeOnly fg.deobf("curse.maven:forbidden-arcanus-309858:4852521")
- // runtimeOnly fg.deobf("curse.maven:valhelsia-core-416935:4181245")
- // runtimeOnly fg.deobf("curse.maven:modern-ui-352491:5229370")
- // runtimeOnly fg.deobf("curse.maven:sophisticated-storage-619320:5194750")
- // runtimeOnly fg.deobf("curse.maven:sophisticated-core-618298:5296313")
- // runtimeOnly fg.deobf("curse.maven:functional-storage-556861:5499169")
- // runtimeOnly fg.deobf("curse.maven:titanium-287342:5356458")
- // runtimeOnly fg.deobf("curse.maven:storage-drawers-223852:3884263")
- // runtimeOnly fg.deobf("curse.maven:ftb-chunks-forge-314906:5417874")
- // runtimeOnly fg.deobf("curse.maven:architectury-api-419699:5137942")
- // runtimeOnly fg.deobf("curse.maven:ftb-library-forge-404465:4661834")
- // runtimeOnly fg.deobf("curse.maven:ftb-teams-forge-404468:4611938")
- // runtimeOnly fg.deobf("curse.maven:citadel-331936:4556677")
- // runtimeOnly fg.deobf("curse.maven:ice-and-fire-dragons-264231:5037952")
- // runtimeOnly fg.deobf("curse.maven:exnihilosequentia-400012:4993344")
- // runtimeOnly fg.deobf("curse.maven:upgrade-aquatic-326895:4777515")
- // runtimeOnly fg.deobf("curse.maven:blueprint-382216:4749000")
- // runtimeOnly fg.deobf("curse.maven:windsweptmod-636321:4817132")
- // runtimeOnly fg.deobf("curse.maven:good-ending-690161:4363719")
-
- // https://discord.com/channels/313125603924639766/725850371834118214/910619168821354497
- // Prevent Mixin annotation processor from getting into IntelliJ's annotation processor settings
- // This allows 'Settings > Build, Execution, and Deployment > Build Tools > Gradle > Build and run using' set to IntelliJ to work correctly
- if (!Boolean.getBoolean('idea.sync.active')) {
- annotationProcessor "org.spongepowered:mixin:${mixin_version}:processor"
- }
-}
-
-sourceSets.main.java {
- if (!cc_tweaked_enable.toBoolean()) {
- exclude 'com/simibubi/create/compat/computercraft/implementation/**'
- }
-}
-
-// Workaround for SpongePowered/MixinGradle#38
-afterEvaluate {
- tasks.configureReobfTaskForReobfJar.mustRunAfter(tasks.compileJava)
- tasks.configureReobfTaskForReobfJarJar.mustRunAfter(tasks.compileJava)
-}
-
-processResources {
- def buildProps = project.properties.clone()
-
- // Replaces FML's magic file.jarVersion string with the correct version at build time.
- buildProps.put('file', [jarVersion: project.version])
-
- filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) {
- expand buildProps
- }
-}
-
-compileJava {
- options.compilerArgs = ['-Xdiags:verbose']
-}
-
-void addLicense(jarTask) {
- jarTask.from('LICENSE') {
+jar {
+ from('LICENSE') {
rename { "${it}_${project.archivesBaseName}" }
}
}
-tasks.jar {
- archiveClassifier = 'slim'
- finalizedBy('reobfJar')
- addLicense it
-}
+tasks.withType(ProcessResources).configureEach {
+ var replaceProperties = [
+ mod_version : mod_version,
+ mod_id : mod_id,
+ mod_name : mod_name,
+ mod_author : mod_author,
+ mod_description : mod_description,
+ mod_license : mod_license,
+ minecraft_version_range: minecraft_version_range,
+ neo_version_range : neo_version_range,
+ flywheel_version_range : flywheel_version_range,
+ ]
+ inputs.properties replaceProperties
-tasks.jarJar {
- finalizedBy('reobfJarJar')
- addLicense it
-}
-
-task jarJarRelease {
- group = 'jarjar'
- doLast {
- tasks.jarJar {
- archiveClassifier = ''
- }
+ filesMatching(['META-INF/neoforge.mods.toml']) {
+ expand replaceProperties
}
- finalizedBy tasks.jarJar
}
-project.publishing {
+java {
+ withSourcesJar()
+}
+
+publishing {
publications {
- mavenJava(MavenPublication) {
- artifactId base.archivesName.get()
+ register('mavenJava', MavenPublication) {
from components.java
- fg.component(it)
- jarJar.component(it)
}
}
-
repositories {
if (project.hasProperty('mavendir')) {
- maven { url mavendir }
+ maven { url = mavendir }
}
}
}
-String getChangelogText() {
- def changelogFile = file('changelog.txt')
- String str = ''
- int lineCount = 0
- boolean done = false
- changelogFile.eachLine {
- if (done || it == null) {
- return
- }
- if (it.size() > 1) {
- def temp = it
- if (lineCount == 0) {
- temp = "Create ${version}"
- temp = "Create v${mod_version} for Minecraft ${minecraft_version}
"
- } else if (it.startsWith('-')) {
- temp = " $temp
"
- temp = temp.replaceAll("(\\S+\\/\\S+)#([0-9]+)\\b", "\$0");
- temp = temp.replaceAll("#([0-9]+)\\b(?!<\\/a>)", "\$0");
- } else {
- temp = "
$temp
"
- }
- str += temp
- lineCount++
- } else {
- str += "Please submit any Issues you come across on the Issue Tracker.
"
- done = true
- }
- }
- return str
+tasks.withType(JavaCompile).configureEach {
+ options.encoding = 'UTF-8'
}
-// changelog debugging
-// new File("changelog.html").write getChangelogText()
-// tasks.curseforge.enabled = !dev && project.hasProperty('simi_curseforge_key')
-// curseforge {
-// if (project.hasProperty('simi_curseforge_key')) {
-// apiKey = project.simi_curseforge_key
-// }
-//
-// project {
-// id = project.projectId
-// changelog = System.getenv('CHANGELOG') == null || System.getenv('CHANGELOG').equals('none') ? getChangelogText() : System.getenv('CHANGELOG')
-// changelogType = 'html'
-// releaseType = project.curse_type
-// mainArtifact(shadowJar) {
-// displayName = "Create - ${version}"
-// }
-// relations {
-// optionalDependency 'jei'
-// }
-// }
-// }
+idea {
+ module {
+ downloadSources = true
+ downloadJavadoc = true
+ }
+}
diff --git a/gradle.properties b/gradle.properties
index 90f3b5e55e..19ccf99a1d 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,55 +1,45 @@
-# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
-# This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs = -Xmx3G
org.gradle.daemon = false
+org.gradle.caching = true
-# mod version info
+# Mod Info
mod_version = 0.5.2
-artifact_minecraft_version = 1.20.1
+maven_group = com.simibubi.create
-minecraft_version = 1.20.1
-forge_version = 47.2.6
-
-# build dependency versions
-forgegradle_version = [6.0.16,6.2)
-mixingradle_version = 0.7.+
-mixin_version = 0.8.5
-librarian_version = 1.+
-cursegradle_version = 1.4.0
-parchment_version = 2023.09.03
-
-use_parchment = true
-
-# dependency versions
-registrate_version = MC1.20-1.3.3
-flywheel_minecraft_version = 1.20.1
-flywheel_version = 1.0.0-beta-177
-jei_minecraft_version = 1.20.1
-jei_version = 15.10.0.39
-curios_minecraft_version = 1.20.1
-curios_version = 5.3.1
-catnip_version = 0.8.42
-ponder_version = 0.8.15
-mixin_extras_version = 0.4.1
-
-cc_tweaked_enable = true
-cc_tweaked_minecraft_version = 1.20.1
-cc_tweaked_version = 1.105.0
-
-dynamic_trees_enable = true
-dynamic_trees_minecraft_version = 1.20.1
-dynamic_trees_version = 1.3.0-BETA13
-
-# mod options
mod_id = create
mod_name = Create
mod_author = simibubi
mod_description = Technology that empowers the player.
mod_license = MIT
-# curseforge information
-projectId = 328085
-curse_type = beta
+# Mod Dependencies
+minecraft_version = 1.21.1
+minecraft_version_range=[1.21.1]
-# github information
-github_project = Creators-of-Create/Create
+neo_version = 21.1.71
+neo_version_range=[21.1.71,)
+
+parchment_minecraft_version = 1.21.1
+parchment_version = 2024.11.17
+
+# From maven.ithundxr.dev/snapshots
+registrate_version = MC1.21-1.3.0+58
+
+# From maven.ithundxr.dev/hidden
+flywheel_minecraft_version = 1.21.1
+flywheel_version = 1.0.0-beta-fork.10
+flywheel_version_range = [1.0.0-alpha,2.0)
+
+# Optional Dependencies
+jei_minecraft_version = 1.21
+jei_version = 19.5.0.33
+curios_minecraft_version = 1.21.1
+curios_version = 9.0.15
+catnip_version = 0.8.43
+ponder_version = 0.8.7
+catnip_and_ponder_mc_ver = 1.21.1
+
+cc_tweaked_enable = true
+cc_tweaked_disable_runtime = true
+cc_tweaked_minecraft_version = 1.21.1
+cc_tweaked_version = 1.114.2
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index c1962a79e2..e6441136f3 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 309b4e18db..a4413138c9 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
+validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
index aeb74cbb43..b740cf1339 100755
--- a/gradlew
+++ b/gradlew
@@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
-# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -83,7 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
-APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
+# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
+APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -130,10 +131,13 @@ location of your Java installation."
fi
else
JAVACMD=java
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+ if ! command -v java >/dev/null 2>&1
+ then
+ die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
+ fi
fi
# Increase the maximum file descriptors if we can.
@@ -141,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
- # shellcheck disable=SC3045
+ # shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
@@ -149,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
- # shellcheck disable=SC3045
+ # shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@@ -198,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
-# Collect all arguments for the java command;
-# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
-# shell script including quotes and variable substitutions, so put them in
-# double quotes to make sure that they get re-expanded; and
-# * put everything else in single quotes, so that it's not re-expanded.
+# Collect all arguments for the java command:
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
+# and any embedded shellness will be escaped.
+# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
+# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
diff --git a/gradlew.bat b/gradlew.bat
index 93e3f59f13..25da30dbde 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
+echo. 1>&2
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
goto fail
@@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
+echo. 1>&2
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
goto fail
diff --git a/settings.gradle b/settings.gradle
index 1a196a6fe8..6f7f994cff 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,16 +1,9 @@
pluginManagement {
repositories {
+ mavenLocal()
gradlePluginPortal()
- mavenCentral()
- jcenter()
- maven { url = 'https://maven.minecraftforge.net/' }
- maven { url = 'https://repo.spongepowered.org/repository/maven-public' }
- maven { url = 'https://maven.parchmentmc.org' }
+ maven { url = 'https://maven.neoforged.net/releases' }
}
}
-plugins {
- id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0'
-}
-
rootProject.name = 'Create'
diff --git a/src/main/java/com/simibubi/create/AllAttachmentTypes.java b/src/main/java/com/simibubi/create/AllAttachmentTypes.java
new file mode 100644
index 0000000000..6c358adc4b
--- /dev/null
+++ b/src/main/java/com/simibubi/create/AllAttachmentTypes.java
@@ -0,0 +1,22 @@
+package com.simibubi.create;
+
+import java.util.function.Supplier;
+
+import com.simibubi.create.content.contraptions.minecart.capability.MinecartController;
+
+import net.neoforged.bus.api.IEventBus;
+import net.neoforged.neoforge.attachment.AttachmentType;
+import net.neoforged.neoforge.registries.DeferredRegister;
+import net.neoforged.neoforge.registries.NeoForgeRegistries;
+
+public class AllAttachmentTypes {
+ private static final DeferredRegister> ATTACHMENT_TYPES = DeferredRegister.create(NeoForgeRegistries.ATTACHMENT_TYPES, Create.ID);
+
+ public static final Supplier> MINECART_CONTROLLER = ATTACHMENT_TYPES.register(
+ "minecart_controller", () -> AttachmentType.builder(MinecartController::empty).serialize(MinecartController.SERIALIZER).build()
+ );
+
+ public static void register(IEventBus modEventBus) {
+ ATTACHMENT_TYPES.register(modEventBus);
+ }
+}
diff --git a/src/main/java/com/simibubi/create/AllBlockEntityTypes.java b/src/main/java/com/simibubi/create/AllBlockEntityTypes.java
index 2bbcc0c19e..dab50e6d20 100644
--- a/src/main/java/com/simibubi/create/AllBlockEntityTypes.java
+++ b/src/main/java/com/simibubi/create/AllBlockEntityTypes.java
@@ -346,7 +346,7 @@ public class AllBlockEntityTypes {
.validBlocks(AllBlocks.HAND_CRANK)
.renderer(() -> HandCrankRenderer::new)
.register();
-
+
public static final BlockEntityEntry VALVE_HANDLE = REGISTRATE
.blockEntity("valve_handle", ValveHandleBlockEntity::new)
.visual(() -> HandCrankVisual::new)
@@ -795,7 +795,7 @@ public class AllBlockEntityTypes {
.validBlocks(AllBlocks.ANALOG_LEVER)
.renderer(() -> AnalogLeverRenderer::new)
.register();
-
+
public static final BlockEntityEntry PLACARD = REGISTRATE
.blockEntity("placard", PlacardBlockEntity::new)
.validBlocks(AllBlocks.PLACARD)
@@ -941,7 +941,7 @@ public class AllBlockEntityTypes {
.validBlocksDeferred(TrackMaterial::allBlocks)
.renderer(() -> TrackRenderer::new)
.register();
-
+
public static final BlockEntityEntry FAKE_TRACK = REGISTRATE
.blockEntity("fake_track", FakeTrackBlockEntity::new)
.validBlocks(AllBlocks.FAKE_TRACK)
@@ -990,7 +990,7 @@ public class AllBlockEntityTypes {
.renderer(() -> TrackObserverRenderer::new)
.validBlocks(AllBlocks.TRACK_OBSERVER)
.register();
-
+
public static final BlockEntityEntry CLIPBOARD = REGISTRATE
.blockEntity("clipboard", ClipboardBlockEntity::new)
.validBlocks(AllBlocks.CLIPBOARD)
diff --git a/src/main/java/com/simibubi/create/AllBlocks.java b/src/main/java/com/simibubi/create/AllBlocks.java
index a528a6c3c2..f81bd15f31 100644
--- a/src/main/java/com/simibubi/create/AllBlocks.java
+++ b/src/main/java/com/simibubi/create/AllBlocks.java
@@ -282,10 +282,10 @@ import com.simibubi.create.foundation.data.ModelGen;
import com.simibubi.create.foundation.data.SharedProperties;
import com.simibubi.create.foundation.item.ItemDescription;
import com.simibubi.create.foundation.item.UncontainableBlockItem;
+import com.simibubi.create.foundation.mixin.accessor.BlockLootSubProviderAccessor;
import com.simibubi.create.foundation.utility.ColorHandlers;
import com.simibubi.create.foundation.utility.DyeHelper;
import com.tterrag.registrate.providers.RegistrateRecipeProvider;
-import com.tterrag.registrate.providers.loot.RegistrateBlockLootTables;
import com.tterrag.registrate.util.DataIngredient;
import com.tterrag.registrate.util.entry.BlockEntry;
@@ -293,6 +293,7 @@ import net.createmod.catnip.utility.Couple;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.core.Direction.Axis;
import net.minecraft.core.Direction.AxisDirection;
+import net.minecraft.core.HolderLookup;
import net.minecraft.core.registries.Registries;
import net.minecraft.data.loot.BlockLootSubProvider;
import net.minecraft.data.recipes.RecipeCategory;
@@ -305,6 +306,7 @@ import net.minecraft.tags.ItemTags;
import net.minecraft.world.item.DyeColor;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.Rarity;
+import net.minecraft.world.item.enchantment.Enchantment;
import net.minecraft.world.item.enchantment.Enchantments;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
@@ -321,17 +323,17 @@ import net.minecraft.world.level.storage.loot.LootTable;
import net.minecraft.world.level.storage.loot.LootTable.Builder;
import net.minecraft.world.level.storage.loot.entries.LootItem;
import net.minecraft.world.level.storage.loot.functions.ApplyBonusCount;
+import net.minecraft.world.level.storage.loot.functions.CopyComponentsFunction;
import net.minecraft.world.level.storage.loot.functions.CopyNameFunction;
-import net.minecraft.world.level.storage.loot.functions.CopyNbtFunction;
import net.minecraft.world.level.storage.loot.predicates.ExplosionCondition;
import net.minecraft.world.level.storage.loot.predicates.LootItemCondition;
-import net.minecraft.world.level.storage.loot.providers.nbt.ContextNbtProvider;
import net.minecraft.world.level.storage.loot.providers.number.ConstantValue;
-import net.minecraftforge.client.model.generators.ConfiguredModel;
-import net.minecraftforge.client.model.generators.ModelFile;
-import net.minecraftforge.common.Tags;
-import net.minecraftforge.common.util.ForgeSoundType;
+import net.neoforged.neoforge.client.model.generators.ConfiguredModel;
+import net.neoforged.neoforge.client.model.generators.ModelFile;
+import net.neoforged.neoforge.common.Tags;
+import net.neoforged.neoforge.common.util.DeferredSoundType;
+@SuppressWarnings("removal")
public class AllBlocks {
static {
@@ -354,8 +356,9 @@ public class AllBlocks {
.setRolls(ConstantValue.exactly(1))
.add(LootItem.lootTableItem(AllBlocks.SCHEMATICANNON.get()
.asItem())
- .apply(CopyNbtFunction.copyData(ContextNbtProvider.BLOCK_ENTITY)
- .copy("Options", "BlockEntityTag.Options")))));
+ // TODO 1.21: Make sure this works
+ .apply(CopyComponentsFunction.copyComponents(CopyComponentsFunction.Source.BLOCK_ENTITY)
+ .include(AllDataComponents.SCHEMATICANNON_OPTIONS.value())))));
})
.item()
.transform(customItemModel())
@@ -1768,7 +1771,7 @@ public class AllBlocks {
public static final BlockEntry ANDESITE_TUNNEL =
REGISTRATE.block("andesite_tunnel", BeltTunnelBlock::new)
.properties(p -> p.mapColor(MapColor.STONE))
- .transform(BuilderTransformers.beltTunnel("andesite", new ResourceLocation("block/polished_andesite")))
+ .transform(BuilderTransformers.beltTunnel("andesite", ResourceLocation.withDefaultNamespace("block/polished_andesite")))
.onRegister(assignDataBehaviour(new AccumulatedItemCountDisplaySource(), "accumulate_items"))
.onRegister(assignDataBehaviour(new ItemThroughputDisplaySource(), "item_throughput"))
.register();
@@ -1996,7 +1999,7 @@ public class AllBlocks {
.transform(BuilderTransformers.tableCloth("brass", SharedProperties::softMetal, false))
.properties(p -> p.mapColor(MapColor.TERRACOTTA_YELLOW)
.requiresCorrectToolForDrops())
- .recipe((c, p) -> p.stonecutting(DataIngredient.tag(AllTags.forgeItemTag("ingots/brass")),
+ .recipe((c, p) -> p.stonecutting(DataIngredient.tag(AllTags.commonItemTag("ingots/brass")),
RecipeCategory.DECORATIONS, c::get, 2))
.transform(pickaxeOnly())
.register();
@@ -2005,7 +2008,7 @@ public class AllBlocks {
REGISTRATE.block("copper_table_cloth", p -> new TableClothBlock(p, "copper"))
.transform(BuilderTransformers.tableCloth("copper", SharedProperties::copperMetal, false))
.properties(p -> p.requiresCorrectToolForDrops())
- .recipe((c, p) -> p.stonecutting(DataIngredient.tag(AllTags.forgeItemTag("ingots/copper")),
+ .recipe((c, p) -> p.stonecutting(DataIngredient.tag(Tags.Items.INGOTS_COPPER),
RecipeCategory.DECORATIONS, c::get, 2))
.transform(pickaxeOnly())
.register();
@@ -2216,17 +2219,17 @@ public class AllBlocks {
.forceSolidOn())
.addLayer(() -> RenderType::cutoutMipped)
.loot((lt, block) -> {
- Builder builder = LootTable.lootTable();
- LootItemCondition.Builder survivesExplosion = ExplosionCondition.survivesExplosion();
- lt.add(block, builder.withPool(LootPool.lootPool()
- .when(survivesExplosion)
- .setRolls(ConstantValue.exactly(1))
- .add(LootItem.lootTableItem(block)
- .apply(CopyNameFunction.copyName(CopyNameFunction.NameSource.BLOCK_ENTITY))
- .apply(CopyNbtFunction.copyData(ContextNbtProvider.BLOCK_ENTITY)
- .copy("UniqueId", "UniqueId"))
- .apply(CopyNbtFunction.copyData(ContextNbtProvider.BLOCK_ENTITY)
- .copy("Inventory", "Inventory")))));
+ lt.add(block, LootTable.lootTable().withPool(LootPool.lootPool()
+ .when(ExplosionCondition.survivesExplosion())
+ .setRolls(ConstantValue.exactly(1))
+ .add(LootItem.lootTableItem(block)
+ .apply(CopyNameFunction.copyName(CopyNameFunction.NameSource.BLOCK_ENTITY))
+ .apply(CopyComponentsFunction.copyComponents(CopyComponentsFunction.Source.BLOCK_ENTITY)
+ .include(AllDataComponents.TOOLBOX_UUID.value())
+ .include(AllDataComponents.TOOLBOX_INVENTORY.value())
+ )
+ )
+ ));
})
.blockstate((c, p) -> {
p.horizontalBlock(c.get(), p.models()
@@ -2272,21 +2275,21 @@ public class AllBlocks {
public static final BlockEntry BRASS_LADDER =
REGISTRATE.block("brass_ladder", MetalLadderBlock::new)
.transform(BuilderTransformers.ladder("brass",
- () -> DataIngredient.tag(AllTags.forgeItemTag("ingots/brass")), MapColor.TERRACOTTA_YELLOW))
+ () -> DataIngredient.tag(AllTags.commonItemTag("ingots/brass")), MapColor.TERRACOTTA_YELLOW))
.register();
public static final BlockEntry COPPER_LADDER =
REGISTRATE.block("copper_ladder", MetalLadderBlock::new)
.transform(BuilderTransformers.ladder("copper",
- () -> DataIngredient.tag(AllTags.forgeItemTag("ingots/copper")), MapColor.COLOR_ORANGE))
+ () -> DataIngredient.tag(Tags.Items.INGOTS_COPPER), MapColor.COLOR_ORANGE))
.register();
public static final BlockEntry ANDESITE_BARS = MetalBarsGen.createBars("andesite", true,
() -> DataIngredient.items(AllItems.ANDESITE_ALLOY.get()), MapColor.STONE);
public static final BlockEntry BRASS_BARS = MetalBarsGen.createBars("brass", true,
- () -> DataIngredient.tag(AllTags.forgeItemTag("ingots/brass")), MapColor.TERRACOTTA_YELLOW);
+ () -> DataIngredient.tag(AllTags.commonItemTag("ingots/brass")), MapColor.TERRACOTTA_YELLOW);
public static final BlockEntry COPPER_BARS = MetalBarsGen.createBars("copper", true,
- () -> DataIngredient.tag(AllTags.forgeItemTag("ingots/copper")), MapColor.COLOR_ORANGE);
+ () -> DataIngredient.tag(Tags.Items.INGOTS_COPPER), MapColor.COLOR_ORANGE);
public static final BlockEntry ANDESITE_SCAFFOLD = REGISTRATE
.block("andesite_scaffolding", MetalScaffoldingBlock::new)
@@ -2298,14 +2301,14 @@ public class AllBlocks {
public static final BlockEntry BRASS_SCAFFOLD =
REGISTRATE.block("brass_scaffolding", MetalScaffoldingBlock::new)
.transform(BuilderTransformers.scaffold("brass",
- () -> DataIngredient.tag(AllTags.forgeItemTag("ingots/brass")), MapColor.TERRACOTTA_YELLOW,
+ () -> DataIngredient.tag(AllTags.commonItemTag("ingots/brass")), MapColor.TERRACOTTA_YELLOW,
AllSpriteShifts.BRASS_SCAFFOLD, AllSpriteShifts.BRASS_SCAFFOLD_INSIDE, AllSpriteShifts.BRASS_CASING))
.register();
public static final BlockEntry COPPER_SCAFFOLD =
REGISTRATE.block("copper_scaffolding", MetalScaffoldingBlock::new)
.transform(BuilderTransformers.scaffold("copper",
- () -> DataIngredient.tag(AllTags.forgeItemTag("ingots/copper")), MapColor.COLOR_ORANGE,
+ () -> DataIngredient.tag(Tags.Items.INGOTS_COPPER), MapColor.COLOR_ORANGE,
AllSpriteShifts.COPPER_SCAFFOLD, AllSpriteShifts.COPPER_SCAFFOLD_INSIDE, AllSpriteShifts.COPPER_CASING))
.register();
@@ -2349,7 +2352,7 @@ public class AllBlocks {
.transform(BuilderTransformers.copycat())
.onRegister(CreateRegistrate.blockModel(() -> CopycatStepModel::new))
.item()
- .recipe((c, p) -> p.stonecutting(DataIngredient.tag(AllTags.forgeItemTag("ingots/zinc")),
+ .recipe((c, p) -> p.stonecutting(DataIngredient.tag(AllTags.commonItemTag("ingots/zinc")),
RecipeCategory.BUILDING_BLOCKS, c::get, 4))
.transform(customItemModel("copycat_base", "step"))
.register();
@@ -2359,7 +2362,7 @@ public class AllBlocks {
.transform(BuilderTransformers.copycat())
.onRegister(CreateRegistrate.blockModel(() -> CopycatPanelModel::new))
.item()
- .recipe((c, p) -> p.stonecutting(DataIngredient.tag(AllTags.forgeItemTag("ingots/zinc")),
+ .recipe((c, p) -> p.stonecutting(DataIngredient.tag(AllTags.commonItemTag("ingots/zinc")),
RecipeCategory.BUILDING_BLOCKS, c::get, 4))
.transform(customItemModel("copycat_base", "panel"))
.register();
@@ -2472,10 +2475,14 @@ public class AllBlocks {
.requiresCorrectToolForDrops()
.sound(SoundType.STONE))
.transform(pickaxeOnly())
- .loot((lt, b) -> lt.add(b,
- RegistrateBlockLootTables.createSilkTouchDispatchTable(b,
+ .loot((lt, b) -> {
+ HolderLookup.RegistryLookup enchantmentRegistryLookup = ((BlockLootSubProviderAccessor) lt).create$getRegistries().lookupOrThrow(Registries.ENCHANTMENT);
+
+ lt.add(b,
+ lt.createSilkTouchDispatchTable(b,
lt.applyExplosionDecay(b, LootItem.lootTableItem(AllItems.RAW_ZINC.get())
- .apply(ApplyBonusCount.addOreBonusCount(Enchantments.BLOCK_FORTUNE))))))
+ .apply(ApplyBonusCount.addOreBonusCount(enchantmentRegistryLookup.getOrThrow(Enchantments.FORTUNE))))));
+ })
.tag(BlockTags.NEEDS_IRON_TOOL)
.tag(Tags.Blocks.ORES)
.transform(tagBlockAndItem("ores/zinc", "ores_in_ground/stone"))
@@ -2489,10 +2496,15 @@ public class AllBlocks {
.requiresCorrectToolForDrops()
.sound(SoundType.DEEPSLATE))
.transform(pickaxeOnly())
- .loot((lt, b) -> lt.add(b,
- RegistrateBlockLootTables.createSilkTouchDispatchTable(b,
- lt.applyExplosionDecay(b, LootItem.lootTableItem(AllItems.RAW_ZINC.get())
- .apply(ApplyBonusCount.addOreBonusCount(Enchantments.BLOCK_FORTUNE))))))
+ .loot((lt, b) -> {
+ HolderLookup.RegistryLookup enchantmentRegistryLookup = ((BlockLootSubProviderAccessor) lt).create$getRegistries().lookupOrThrow(Registries.ENCHANTMENT);
+
+
+ lt.add(b,
+ lt.createSilkTouchDispatchTable(b,
+ lt.applyExplosionDecay(b, LootItem.lootTableItem(AllItems.RAW_ZINC.get())
+ .apply(ApplyBonusCount.addOreBonusCount(enchantmentRegistryLookup.getOrThrow(Enchantments.FORTUNE))))));
+ })
.tag(BlockTags.NEEDS_IRON_TOOL)
.tag(Tags.Blocks.ORES)
.transform(tagBlockAndItem("ores/zinc", "ores_in_ground/deepslate"))
@@ -2544,7 +2556,7 @@ public class AllBlocks {
.transform(BuilderTransformers.palettesIronBlock())
.lang("Block of Industrial Iron")
.register();
-
+
public static final BlockEntry WEATHERED_IRON_BLOCK = REGISTRATE.block("weathered_iron_block", Block::new)
.transform(BuilderTransformers.palettesIronBlock())
.lang("Block of Weathered Iron")
@@ -2574,9 +2586,9 @@ public class AllBlocks {
.transform(axeOnly())
.blockstate(BlockStateGen.horizontalAxisBlockProvider(false))
.tag(Tags.Blocks.STORAGE_BLOCKS)
- .tag(AllTags.forgeBlockTag("storage_blocks/cardboard"))
+ .tag(AllTags.commonBlockTag("storage_blocks/cardboard"))
.item(CardboardBlockItem::new)
- .tag(AllTags.forgeItemTag("storage_blocks/cardboard"))
+ .tag(AllTags.commonItemTag("storage_blocks/cardboard"))
.tag(Tags.Items.STORAGE_BLOCKS)
.build()
.lang("Block of Cardboard")
@@ -2606,7 +2618,7 @@ public class AllBlocks {
REGISTRATE.block("experience_block", ExperienceBlock::new)
.initialProperties(SharedProperties::softMetal)
.properties(p -> p.mapColor(MapColor.PLANT)
- .sound(new ForgeSoundType(1, .5f, () -> SoundEvents.AMETHYST_BLOCK_BREAK,
+ .sound(new DeferredSoundType(1, .5f, () -> SoundEvents.AMETHYST_BLOCK_BREAK,
() -> SoundEvents.AMETHYST_BLOCK_STEP, () -> SoundEvents.AMETHYST_BLOCK_PLACE,
() -> SoundEvents.AMETHYST_BLOCK_HIT, () -> SoundEvents.AMETHYST_BLOCK_FALL))
.requiresCorrectToolForDrops()
@@ -2662,14 +2674,14 @@ public class AllBlocks {
public static final CopperBlockSet COPPER_SHINGLES = new CopperBlockSet(REGISTRATE, "copper_shingles",
"copper_roof_top", CopperBlockSet.DEFAULT_VARIANTS, (c, p) -> {
- p.stonecutting(DataIngredient.tag(AllTags.forgeItemTag("ingots/copper")), RecipeCategory.BUILDING_BLOCKS,
+ p.stonecutting(DataIngredient.tag(Tags.Items.INGOTS_COPPER), RecipeCategory.BUILDING_BLOCKS,
c::get, 2);
}, (ws, block) -> connectedTextures(() -> new RoofBlockCTBehaviour(AllSpriteShifts.COPPER_SHINGLES.get(ws)))
.accept(block));
public static final CopperBlockSet COPPER_TILES =
new CopperBlockSet(REGISTRATE, "copper_tiles", "copper_roof_top", CopperBlockSet.DEFAULT_VARIANTS, (c, p) -> {
- p.stonecutting(DataIngredient.tag(AllTags.forgeItemTag("ingots/copper")), RecipeCategory.BUILDING_BLOCKS,
+ p.stonecutting(DataIngredient.tag(Tags.Items.INGOTS_COPPER), RecipeCategory.BUILDING_BLOCKS,
c::get, 2);
}, (ws, block) -> connectedTextures(() -> new RoofBlockCTBehaviour(AllSpriteShifts.COPPER_TILES.get(ws)))
.accept(block));
diff --git a/src/main/java/com/simibubi/create/AllCreativeModeTabs.java b/src/main/java/com/simibubi/create/AllCreativeModeTabs.java
index aee0f12cdf..a1c50a90d5 100644
--- a/src/main/java/com/simibubi/create/AllCreativeModeTabs.java
+++ b/src/main/java/com/simibubi/create/AllCreativeModeTabs.java
@@ -29,6 +29,7 @@ import it.unimi.dsi.fastutil.objects.Reference2ReferenceOpenHashMap;
import it.unimi.dsi.fastutil.objects.ReferenceArrayList;
import it.unimi.dsi.fastutil.objects.ReferenceLinkedOpenHashSet;
import it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet;
+import net.createmod.catnip.platform.CatnipServices;
import net.createmod.catnip.utility.lang.Components;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.entity.ItemRenderer;
@@ -46,21 +47,17 @@ import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.block.Block;
-import net.minecraftforge.api.distmarker.Dist;
-import net.minecraftforge.api.distmarker.OnlyIn;
-import net.minecraftforge.eventbus.api.IEventBus;
-import net.minecraftforge.fml.DistExecutor;
-import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
-import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;
-import net.minecraftforge.registries.DeferredRegister;
-import net.minecraftforge.registries.RegistryObject;
+import net.neoforged.api.distmarker.Dist;
+import net.neoforged.api.distmarker.OnlyIn;
+import net.neoforged.bus.api.IEventBus;
+import net.neoforged.neoforge.registries.DeferredHolder;
+import net.neoforged.neoforge.registries.DeferredRegister;
-@EventBusSubscriber(bus = Bus.MOD)
public class AllCreativeModeTabs {
private static final DeferredRegister REGISTER =
DeferredRegister.create(Registries.CREATIVE_MODE_TAB, Create.ID);
- public static final RegistryObject BASE_CREATIVE_TAB = REGISTER.register("base",
+ public static final DeferredHolder BASE_CREATIVE_TAB = REGISTER.register("base",
() -> CreativeModeTab.builder()
.title(Components.translatable("itemGroup.create.base"))
.withTabsBefore(CreativeModeTabs.SPAWN_EGGS)
@@ -68,7 +65,7 @@ public class AllCreativeModeTabs {
.displayItems(new RegistrateDisplayItemsGenerator(true, AllCreativeModeTabs.BASE_CREATIVE_TAB))
.build());
- public static final RegistryObject PALETTES_CREATIVE_TAB = REGISTER.register("palettes",
+ public static final DeferredHolder PALETTES_CREATIVE_TAB = REGISTER.register("palettes",
() -> CreativeModeTab.builder()
.title(Components.translatable("itemGroup.create.palettes"))
.withTabsBefore(BASE_CREATIVE_TAB.getKey())
@@ -85,14 +82,8 @@ public class AllCreativeModeTabs {
static {
MutableObject> isItem3d = new MutableObject<>(item -> false);
- DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> {
- isItem3d.setValue(item -> {
- ItemRenderer itemRenderer = Minecraft.getInstance()
- .getItemRenderer();
- BakedModel model = itemRenderer.getModel(new ItemStack(item), null, null, 0);
- return model.isGui3d();
- });
- });
+ if (CatnipServices.PLATFORM.getEnv().isClient())
+ isItem3d.setValue(makeClient3dItemPredicate());
IS_ITEM_3D_PREDICATE = isItem3d.getValue();
}
@@ -107,9 +98,9 @@ public class AllCreativeModeTabs {
}
private final boolean addItems;
- private final RegistryObject tabFilter;
+ private final DeferredHolder tabFilter;
- public RegistrateDisplayItemsGenerator(boolean addItems, RegistryObject tabFilter) {
+ public RegistrateDisplayItemsGenerator(boolean addItems, DeferredHolder tabFilter) {
this.addItems = addItems;
this.tabFilter = tabFilter;
}
@@ -117,7 +108,7 @@ public class AllCreativeModeTabs {
private static Predicate- makeExclusionPredicate() {
Set
- exclusions = new ReferenceOpenHashSet<>();
- List> simpleExclusions = List.of(
+ List> simpleExclusions = List.of(
AllItems.INCOMPLETE_PRECISION_MECHANISM,
AllItems.INCOMPLETE_REINFORCED_SHEET,
AllItems.INCOMPLETE_TRACK,
@@ -154,10 +145,10 @@ public class AllCreativeModeTabs {
AllItems.CRUSHED_URANIUM,
AllItems.CRUSHED_NICKEL
);
-
+
exclusions.addAll(PackageStyles.RARE_BOXES);
- for (ItemProviderEntry> entry : simpleExclusions) {
+ for (ItemProviderEntry, ?> entry : simpleExclusions) {
exclusions.add(entry.asItem());
}
@@ -174,12 +165,12 @@ public class AllCreativeModeTabs {
private static List makeOrderings() {
List orderings = new ReferenceArrayList<>();
- Map, ItemProviderEntry>> simpleBeforeOrderings = Map.of(
+ Map, ItemProviderEntry, ?>> simpleBeforeOrderings = Map.of(
AllItems.EMPTY_BLAZE_BURNER, AllBlocks.BLAZE_BURNER,
AllItems.SCHEDULE, AllBlocks.TRACK_STATION
);
- Map, ItemProviderEntry>> simpleAfterOrderings = Map.of(
+ Map, ItemProviderEntry, ?>> simpleAfterOrderings = Map.of(
AllItems.VERTICAL_GEARBOX, AllBlocks.GEARBOX
);
@@ -190,7 +181,7 @@ public class AllCreativeModeTabs {
simpleAfterOrderings.forEach((entry, otherEntry) -> {
orderings.add(ItemOrdering.after(entry.asItem(), otherEntry.asItem()));
});
-
+
PackageStyles.STANDARD_BOXES.forEach(item -> {
orderings.add(ItemOrdering.after(item, AllBlocks.PACKAGER.asItem()));
});
@@ -201,15 +192,15 @@ public class AllCreativeModeTabs {
private static Function
- makeStackFunc() {
Map
- > factories = new Reference2ReferenceOpenHashMap<>();
- Map, Function
- > simpleFactories = Map.of(
+ Map, Function
- > simpleFactories = Map.of(
AllItems.COPPER_BACKTANK, item -> {
ItemStack stack = new ItemStack(item);
- stack.getOrCreateTag().putInt("Air", BacktankUtil.maxAirWithoutEnchants());
+ stack.set(AllDataComponents.BACKTANK_AIR, BacktankUtil.maxAirWithoutEnchants());
return stack;
},
AllItems.NETHERITE_BACKTANK, item -> {
ItemStack stack = new ItemStack(item);
- stack.getOrCreateTag().putInt("Air", BacktankUtil.maxAirWithoutEnchants());
+ stack.set(AllDataComponents.BACKTANK_AIR, BacktankUtil.maxAirWithoutEnchants());
return stack;
}
);
@@ -230,7 +221,7 @@ public class AllCreativeModeTabs {
private static Function
- makeVisibilityFunc() {
Map
- visibilities = new Reference2ObjectOpenHashMap<>();
- Map, TabVisibility> simpleVisibilities = Map.of(
+ Map, TabVisibility> simpleVisibilities = Map.of(
AllItems.BLAZE_CAKE_BASE, TabVisibility.SEARCH_TAB_ONLY
);
@@ -248,14 +239,14 @@ public class AllCreativeModeTabs {
visibilities.put(entry.asItem(), TabVisibility.SEARCH_TAB_ONLY);
}
}
-
+
for (BlockEntry entry : AllBlocks.TABLE_CLOTHS) {
TableClothBlock block = entry.get();
if (block.getColor() != DyeColor.RED) {
visibilities.put(entry.asItem(), TabVisibility.SEARCH_TAB_ONLY);
}
}
-
+
for (BlockEntry entry : AllBlocks.PACKAGE_POSTBOXES) {
PostboxBlock block = entry.get();
if (block.getColor() != DyeColor.WHITE) {
@@ -301,7 +292,7 @@ public class AllCreativeModeTabs {
private List
- collectBlocks(Predicate
- exclusionPredicate) {
List
- items = new ReferenceArrayList<>();
- for (RegistryEntry entry : Create.REGISTRATE.getAll(Registries.BLOCK)) {
+ for (RegistryEntry entry : Create.REGISTRATE.getAll(Registries.BLOCK)) {
if (!CreateRegistrate.isInCreativeTab(entry, tabFilter))
continue;
Item item = entry.get()
@@ -317,7 +308,7 @@ public class AllCreativeModeTabs {
private List
- collectItems(Predicate
- exclusionPredicate) {
List
- items = new ReferenceArrayList<>();
- for (RegistryEntry
- entry : Create.REGISTRATE.getAll(Registries.ITEM)) {
+ for (RegistryEntry
- entry : Create.REGISTRATE.getAll(Registries.ITEM)) {
if (!CreateRegistrate.isInCreativeTab(entry, tabFilter))
continue;
Item item = entry.get();
diff --git a/src/main/java/com/simibubi/create/AllDamageTypes.java b/src/main/java/com/simibubi/create/AllDamageTypes.java
index eef7b55bc4..9700800b39 100644
--- a/src/main/java/com/simibubi/create/AllDamageTypes.java
+++ b/src/main/java/com/simibubi/create/AllDamageTypes.java
@@ -3,7 +3,7 @@ package com.simibubi.create;
import com.simibubi.create.foundation.damageTypes.DamageTypeBuilder;
import net.minecraft.core.registries.Registries;
-import net.minecraft.data.worldgen.BootstapContext;
+import net.minecraft.data.worldgen.BootstrapContext;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.damagesource.DamageEffects;
import net.minecraft.world.damagesource.DamageScaling;
@@ -25,7 +25,7 @@ public class AllDamageTypes {
return ResourceKey.create(Registries.DAMAGE_TYPE, Create.asResource(name));
}
- public static void bootstrap(BootstapContext ctx) {
+ public static void bootstrap(BootstrapContext ctx) {
new DamageTypeBuilder(CRUSH).scaling(DamageScaling.ALWAYS).register(ctx);
new DamageTypeBuilder(CUCKOO_SURPRISE).scaling(DamageScaling.ALWAYS).exhaustion(0.1f).register(ctx);
new DamageTypeBuilder(FAN_FIRE).effects(DamageEffects.BURNING).register(ctx);
diff --git a/src/main/java/com/simibubi/create/AllDataComponents.java b/src/main/java/com/simibubi/create/AllDataComponents.java
new file mode 100644
index 0000000000..7da60ddd37
--- /dev/null
+++ b/src/main/java/com/simibubi/create/AllDataComponents.java
@@ -0,0 +1,342 @@
+package com.simibubi.create;
+
+import java.util.List;
+import java.util.UUID;
+
+import com.mojang.serialization.Codec;
+import com.simibubi.create.content.equipment.clipboard.ClipboardEntry;
+import com.simibubi.create.content.equipment.clipboard.ClipboardOverrides.ClipboardType;
+import com.simibubi.create.content.equipment.symmetryWand.mirror.SymmetryMirror;
+import com.simibubi.create.content.equipment.zapper.PlacementPatterns;
+import com.simibubi.create.content.equipment.zapper.terrainzapper.PlacementOptions;
+import com.simibubi.create.content.equipment.zapper.terrainzapper.TerrainBrushes;
+import com.simibubi.create.content.equipment.zapper.terrainzapper.TerrainTools;
+import com.simibubi.create.content.fluids.potion.PotionFluid.BottleType;
+import com.simibubi.create.content.logistics.box.PackageItem.PackageOrderData;
+import com.simibubi.create.content.logistics.filter.AttributeFilterWhitelistMode;
+import com.simibubi.create.content.logistics.item.filter.attribute.ItemAttribute.ItemAttributeEntry;
+import com.simibubi.create.content.logistics.redstoneRequester.AutoRequestData;
+import com.simibubi.create.content.logistics.stockTicker.PackageOrder;
+import com.simibubi.create.content.logistics.tableCloth.ShoppingListItem.ShoppingList;
+import com.simibubi.create.content.processing.sequenced.SequencedAssemblyRecipe.SequencedAssembly;
+import com.simibubi.create.content.redstone.displayLink.ClickToLinkBlockItem.ClickToLinkData;
+import com.simibubi.create.content.schematics.cannon.SchematicannonBlockEntity.SchematicannonOptions;
+import com.simibubi.create.content.trains.track.BezierTrackPointLocation;
+import com.simibubi.create.content.trains.track.TrackPlacement.ConnectingFrom;
+
+import net.createmod.catnip.codecs.stream.CatnipStreamCodecs;
+import net.minecraft.core.BlockPos;
+import net.minecraft.core.UUIDUtil;
+import net.minecraft.core.Vec3i;
+import net.minecraft.core.component.DataComponentType;
+import net.minecraft.core.registries.Registries;
+import net.minecraft.nbt.CompoundTag;
+import net.minecraft.network.codec.ByteBufCodecs;
+import net.minecraft.network.codec.StreamCodec;
+import net.minecraft.util.ExtraCodecs;
+import net.minecraft.util.Unit;
+import net.minecraft.world.item.ItemStack;
+import net.minecraft.world.item.component.ItemContainerContents;
+import net.minecraft.world.level.block.Block;
+import net.minecraft.world.level.block.Mirror;
+import net.minecraft.world.level.block.Rotation;
+import net.minecraft.world.level.block.state.BlockState;
+import net.neoforged.bus.api.IEventBus;
+import net.neoforged.neoforge.registries.DeferredHolder;
+import net.neoforged.neoforge.registries.DeferredRegister;
+
+public class AllDataComponents {
+ private static final DeferredRegister.DataComponents DATA_COMPONENTS = DeferredRegister.createDataComponents(Registries.DATA_COMPONENT_TYPE, Create.ID);
+
+ public static final DeferredHolder, DataComponentType> BACKTANK_AIR = DATA_COMPONENTS.registerComponentType(
+ "banktank_air",
+ builder -> builder.persistent(ExtraCodecs.NON_NEGATIVE_INT).networkSynchronized(ByteBufCodecs.VAR_INT)
+ );
+
+ public static final DeferredHolder, DataComponentType> BELT_FIRST_SHAFT = DATA_COMPONENTS.registerComponentType(
+ "belt_first_shaft",
+ builder -> builder.persistent(BlockPos.CODEC).networkSynchronized(BlockPos.STREAM_CODEC)
+ );
+
+ public static final DeferredHolder, DataComponentType> INFERRED_FROM_RECIPE = DATA_COMPONENTS.registerComponentType(
+ "inferred_from_recipe",
+ builder -> builder.persistent(Codec.BOOL).networkSynchronized(ByteBufCodecs.BOOL)
+ );
+
+ public static final DeferredHolder, DataComponentType> PLACEMENT_PATTERN = DATA_COMPONENTS.registerComponentType(
+ "placement_pattern",
+ builder -> builder.persistent(PlacementPatterns.CODEC).networkSynchronized(PlacementPatterns.STREAM_CODEC)
+ );
+
+ public static final DeferredHolder, DataComponentType> SHAPER_BRUSH = DATA_COMPONENTS.registerComponentType(
+ "shaper_brush",
+ builder -> builder.persistent(TerrainBrushes.CODEC).networkSynchronized(TerrainBrushes.STREAM_CODEC)
+ );
+
+ public static final DeferredHolder, DataComponentType> SHAPER_BRUSH_PARAMS = DATA_COMPONENTS.registerComponentType(
+ "shaper_brush_params",
+ builder -> builder.persistent(BlockPos.CODEC).networkSynchronized(BlockPos.STREAM_CODEC)
+ );
+
+ public static final DeferredHolder, DataComponentType> SHAPER_PLACEMENT_OPTIONS = DATA_COMPONENTS.registerComponentType(
+ "shaper_placement_options",
+ builder -> builder.persistent(PlacementOptions.CODEC).networkSynchronized(PlacementOptions.STREAM_CODEC)
+ );
+
+ public static final DeferredHolder, DataComponentType> SHAPER_TOOL = DATA_COMPONENTS.registerComponentType(
+ "shaper_tool",
+ builder -> builder.persistent(TerrainTools.CODEC).networkSynchronized(TerrainTools.STREAM_CODEC)
+ );
+
+ public static final DeferredHolder, DataComponentType> SHAPER_BLOCK_USED = DATA_COMPONENTS.registerComponentType(
+ "shaper_block_used",
+ builder -> builder.persistent(BlockState.CODEC).networkSynchronized(ByteBufCodecs.idMapper(Block.BLOCK_STATE_REGISTRY))
+ );
+
+ public static final DeferredHolder, DataComponentType> SHAPER_SWAP = DATA_COMPONENTS.registerComponentType(
+ "shaper_swap",
+ builder -> builder.persistent(Codec.BOOL).networkSynchronized(ByteBufCodecs.BOOL)
+ );
+
+ public static final DeferredHolder, DataComponentType> SHAPER_BLOCK_DATA = DATA_COMPONENTS.registerComponentType(
+ "shaper_block_data",
+ builder -> builder.persistent(CompoundTag.CODEC).networkSynchronized(ByteBufCodecs.COMPOUND_TAG)
+ );
+
+ public static final DeferredHolder, DataComponentType> FILTER_ITEMS = DATA_COMPONENTS.registerComponentType(
+ "filter_items",
+ builder -> builder.persistent(ItemContainerContents.CODEC).networkSynchronized(ItemContainerContents.STREAM_CODEC)
+ );
+
+ // These 2 are placed on items inside filters and not the filter itself
+ public static final DeferredHolder, DataComponentType> FILTER_ITEMS_RESPECT_NBT = DATA_COMPONENTS.registerComponentType(
+ "filter_items_respect_nbt",
+ builder -> builder.persistent(Codec.BOOL).networkSynchronized(ByteBufCodecs.BOOL)
+ );
+
+ public static final DeferredHolder, DataComponentType> FILTER_ITEMS_BLACKLIST = DATA_COMPONENTS.registerComponentType(
+ "filter_items_blacklist",
+ builder -> builder.persistent(Codec.BOOL).networkSynchronized(ByteBufCodecs.BOOL)
+ );
+
+ public static final DeferredHolder, DataComponentType> ATTRIBUTE_FILTER_WHITELIST_MODE = DATA_COMPONENTS.registerComponentType(
+ "attribute_filter_whitelist_mode",
+ builder -> builder.persistent(AttributeFilterWhitelistMode.CODEC).networkSynchronized(AttributeFilterWhitelistMode.STREAM_CODEC)
+ );
+
+ // TODO - Make a stream codec for this
+ public static final DeferredHolder, DataComponentType
>> ATTRIBUTE_FILTER_MATCHED_ATTRIBUTES = DATA_COMPONENTS.registerComponentType(
+ "attribute_filter_matched_attributes",
+ builder -> builder.persistent(ItemAttributeEntry.CODEC.listOf())
+ );
+
+ public static final DeferredHolder, DataComponentType> CLIPBOARD_TYPE = DATA_COMPONENTS.registerComponentType(
+ "clipboard_type",
+ builder -> builder.persistent(ClipboardType.CODEC).networkSynchronized(ClipboardType.STREAM_CODEC)
+ );
+
+ public static final DeferredHolder, DataComponentType>>> CLIPBOARD_PAGES = DATA_COMPONENTS.registerComponentType(
+ "clipboard_pages",
+ builder -> builder.persistent(ClipboardEntry.CODEC.listOf().listOf()).networkSynchronized(ClipboardEntry.STREAM_CODEC.apply(ByteBufCodecs.list()).apply(ByteBufCodecs.list()))
+ );
+
+ public static final DeferredHolder, DataComponentType> CLIPBOARD_READ_ONLY = DATA_COMPONENTS.registerComponentType(
+ "clipboard_read_only",
+ builder -> builder.persistent(Unit.CODEC).networkSynchronized(StreamCodec.unit(Unit.INSTANCE))
+ );
+
+ public static final DeferredHolder, DataComponentType> CLIPBOARD_COPIED_VALUES = DATA_COMPONENTS.registerComponentType(
+ "clipboard_copied_values",
+ builder -> builder.persistent(CompoundTag.CODEC).networkSynchronized(ByteBufCodecs.COMPOUND_TAG)
+ );
+
+ public static final DeferredHolder, DataComponentType> CLIPBOARD_PREVIOUSLY_OPENED_PAGE = DATA_COMPONENTS.registerComponentType(
+ "clipboard_previously_opened_page",
+ builder -> builder.persistent(Codec.INT).networkSynchronized(ByteBufCodecs.INT)
+ );
+
+ public static final DeferredHolder, DataComponentType> TRACK_CONNECTING_FROM = DATA_COMPONENTS.registerComponentType(
+ "track_connecting_from",
+ builder -> builder.persistent(ConnectingFrom.CODEC).networkSynchronized(ConnectingFrom.STREAM_CODEC)
+ );
+
+ public static final DeferredHolder, DataComponentType> TRACK_EXTENDED_CURVE = DATA_COMPONENTS.registerComponentType(
+ "track_extend_curve",
+ builder -> builder.persistent(Codec.BOOL).networkSynchronized(ByteBufCodecs.BOOL)
+ );
+
+ public static final DeferredHolder, DataComponentType> TRACK_TARGETING_ITEM_SELECTED_POS = DATA_COMPONENTS.registerComponentType(
+ "track_targeting_item_selected_pos",
+ builder -> builder.persistent(BlockPos.CODEC).networkSynchronized(BlockPos.STREAM_CODEC)
+ );
+
+ public static final DeferredHolder, DataComponentType> TRACK_TARGETING_ITEM_SELECTED_DIRECTION = DATA_COMPONENTS.registerComponentType(
+ "track_targeting_item_selected_direction",
+ builder -> builder.persistent(Codec.BOOL).networkSynchronized(ByteBufCodecs.BOOL)
+ );
+
+ public static final DeferredHolder, DataComponentType> TRACK_TARGETING_ITEM_BEZIER = DATA_COMPONENTS.registerComponentType(
+ "track_targeting_item_bezier",
+ builder -> builder.persistent(BezierTrackPointLocation.CODEC).networkSynchronized(BezierTrackPointLocation.STREAM_CODEC)
+ );
+
+ public static final DeferredHolder, DataComponentType> SCHEMATIC_DEPLOYED = DATA_COMPONENTS.registerComponentType(
+ "schematic_deployed",
+ builder -> builder.persistent(Codec.BOOL).networkSynchronized(ByteBufCodecs.BOOL)
+ );
+
+ public static final DeferredHolder, DataComponentType> SCHEMATIC_OWNER = DATA_COMPONENTS.registerComponentType(
+ "schematic_owner",
+ builder -> builder.persistent(Codec.STRING).networkSynchronized(ByteBufCodecs.STRING_UTF8)
+ );
+
+ public static final DeferredHolder, DataComponentType> SCHEMATIC_FILE = DATA_COMPONENTS.registerComponentType(
+ "schematic_file",
+ builder -> builder.persistent(Codec.STRING).networkSynchronized(ByteBufCodecs.STRING_UTF8)
+ );
+
+ public static final DeferredHolder, DataComponentType> SCHEMATIC_ANCHOR = DATA_COMPONENTS.registerComponentType(
+ "schematic_anchor",
+ builder -> builder.persistent(BlockPos.CODEC).networkSynchronized(BlockPos.STREAM_CODEC)
+ );
+
+ public static final DeferredHolder, DataComponentType> SCHEMATIC_ROTATION = DATA_COMPONENTS.registerComponentType(
+ "schematic_rotation",
+ builder -> builder.persistent(Rotation.CODEC).networkSynchronized(CatnipStreamCodecs.ROTATION)
+ );
+
+ public static final DeferredHolder, DataComponentType> SCHEMATIC_MIRROR = DATA_COMPONENTS.registerComponentType(
+ "schematic_mirror",
+ builder -> builder.persistent(Mirror.CODEC).networkSynchronized(CatnipStreamCodecs.MIRROR)
+ );
+
+ public static final DeferredHolder, DataComponentType> SCHEMATIC_BOUNDS = DATA_COMPONENTS.registerComponentType(
+ "schematic_bounds",
+ builder -> builder.persistent(Vec3i.CODEC).networkSynchronized(CatnipStreamCodecs.VEC3I)
+ );
+
+ public static final DeferredHolder, DataComponentType> SCHEMATIC_HASH = DATA_COMPONENTS.registerComponentType(
+ "schematic_hash",
+ builder -> builder.persistent(Codec.INT).networkSynchronized(ByteBufCodecs.INT)
+ );
+
+ public static final DeferredHolder, DataComponentType> CHROMATIC_COMPOUND_COLLECTING_LIGHT = DATA_COMPONENTS.registerComponentType(
+ "chromatic_compound_collecting_light",
+ builder -> builder.persistent(Codec.INT).networkSynchronized(ByteBufCodecs.INT)
+ );
+
+ public static final DeferredHolder, DataComponentType> SAND_PAPER_POLISHING = DATA_COMPONENTS.registerComponentType(
+ "sand_paper_polishing",
+ builder -> builder.persistent(ItemStack.CODEC).networkSynchronized(ItemStack.STREAM_CODEC)
+ );
+
+ public static final DeferredHolder, DataComponentType> SAND_PAPER_JEI = DATA_COMPONENTS.registerComponentType(
+ "sand_paper_jei",
+ builder -> builder.persistent(Unit.CODEC).networkSynchronized(StreamCodec.unit(Unit.INSTANCE))
+ );
+
+ // Holds contraption data when a minecraft contraption is picked up
+ public static final DeferredHolder, DataComponentType> MINECRAFT_CONTRAPTION_DATA = DATA_COMPONENTS.registerComponentType(
+ "minecart_contraption_data",
+ builder -> builder.persistent(CompoundTag.CODEC).networkSynchronized(ByteBufCodecs.COMPOUND_TAG)
+ );
+
+ public static final DeferredHolder, DataComponentType> LINKED_CONTROLLER_ITEMS = DATA_COMPONENTS.registerComponentType(
+ "linked_controller_items",
+ builder -> builder.persistent(ItemContainerContents.CODEC).networkSynchronized(ItemContainerContents.STREAM_CODEC)
+ );
+
+ public static final DeferredHolder, DataComponentType> TOOLBOX_INVENTORY = DATA_COMPONENTS.registerComponentType(
+ "toolbox_inventory",
+ builder -> builder.persistent(ItemContainerContents.CODEC).networkSynchronized(ItemContainerContents.STREAM_CODEC)
+ );
+
+ public static final DeferredHolder, DataComponentType> TOOLBOX_UUID = DATA_COMPONENTS.registerComponentType(
+ "toolbox_uuid",
+ builder -> builder.persistent(UUIDUtil.CODEC).networkSynchronized(UUIDUtil.STREAM_CODEC)
+ );
+
+ public static final DeferredHolder, DataComponentType> SEQUENCED_ASSEMBLY = DATA_COMPONENTS.registerComponentType(
+ "sequenced_assembly",
+ builder -> builder.persistent(SequencedAssembly.CODEC).networkSynchronized(SequencedAssembly.STREAM_CODEC)
+ );
+
+ public static final DeferredHolder, DataComponentType> TRAIN_SCHEDULE = DATA_COMPONENTS.registerComponentType(
+ "train_schedule",
+ builder -> builder.persistent(CompoundTag.CODEC).networkSynchronized(ByteBufCodecs.COMPOUND_TAG)
+ );
+
+ public static final DeferredHolder, DataComponentType> SYMMETRY_WAND = DATA_COMPONENTS.registerComponentType(
+ "symmetry_wand",
+ builder -> builder.persistent(SymmetryMirror.CODEC).networkSynchronized(SymmetryMirror.STREAM_CODEC)
+ );
+
+ public static final DeferredHolder, DataComponentType> SYMMETRY_WAND_ENABLE = DATA_COMPONENTS.registerComponentType(
+ "symmetry_wand_enable",
+ builder -> builder.persistent(Codec.BOOL).networkSynchronized(ByteBufCodecs.BOOL)
+ );
+
+ public static final DeferredHolder, DataComponentType> SYMMETRY_WAND_SIMULATE = DATA_COMPONENTS.registerComponentType(
+ "symmetry_wand_simulate",
+ builder -> builder.persistent(Codec.BOOL).networkSynchronized(ByteBufCodecs.BOOL)
+ );
+
+ public static final DeferredHolder, DataComponentType> DISPLAY_LINK_SELECTED_POS = DATA_COMPONENTS.registerComponentType(
+ "display_link_selected_pos",
+ builder -> builder.persistent(BlockPos.CODEC).networkSynchronized(BlockPos.STREAM_CODEC)
+ );
+
+ public static final DeferredHolder, DataComponentType> POTION_FLUID_BOTTLE_TYPE = DATA_COMPONENTS.registerComponentType(
+ "potion_fluid_bottle_type",
+ builder -> builder.persistent(BottleType.CODEC).networkSynchronized(BottleType.STREAM_CODEC)
+ );
+
+ public static final DeferredHolder, DataComponentType> SCHEMATICANNON_OPTIONS = DATA_COMPONENTS.registerComponentType(
+ "schematicannon_options",
+ builder -> builder.persistent(SchematicannonOptions.CODEC).networkSynchronized(SchematicannonOptions.STREAM_CODEC)
+ );
+
+ public static final DeferredHolder, DataComponentType> AUTO_REQUEST_DATA = DATA_COMPONENTS.registerComponentType(
+ "auto_request_data",
+ builder -> builder.persistent(AutoRequestData.CODEC).networkSynchronized(AutoRequestData.STREAM_CODEC)
+ );
+
+ public static final DeferredHolder, DataComponentType> SHOPPING_LIST = DATA_COMPONENTS.registerComponentType(
+ "shopping_list",
+ builder -> builder.persistent(ShoppingList.CODEC).networkSynchronized(ShoppingList.STREAM_CODEC)
+ );
+
+ public static final DeferredHolder, DataComponentType> SHOPPING_LIST_ADDRESS = DATA_COMPONENTS.registerComponentType(
+ "shopping_list_address",
+ builder -> builder.persistent(Codec.STRING).networkSynchronized(ByteBufCodecs.STRING_UTF8)
+ );
+
+ public static final DeferredHolder, DataComponentType> PACKAGE_ADDRESS = DATA_COMPONENTS.registerComponentType(
+ "package_address",
+ builder -> builder.persistent(Codec.STRING).networkSynchronized(ByteBufCodecs.STRING_UTF8)
+ );
+
+ public static final DeferredHolder, DataComponentType> PACKAGE_CONTENTS = DATA_COMPONENTS.registerComponentType(
+ "package_contents",
+ builder -> builder.persistent(ItemContainerContents.CODEC).networkSynchronized(ItemContainerContents.STREAM_CODEC)
+ );
+
+ public static final DeferredHolder, DataComponentType> PACKAGE_ORDER_DATA = DATA_COMPONENTS.registerComponentType(
+ "package_order_data",
+ builder -> builder.persistent(PackageOrderData.CODEC).networkSynchronized(PackageOrderData.STREAM_CODEC)
+ );
+
+ public static final DeferredHolder, DataComponentType> PACKAGE_ORDER_CONTEXT = DATA_COMPONENTS.registerComponentType(
+ "package_order_context",
+ builder -> builder.persistent(PackageOrder.CODEC).networkSynchronized(PackageOrder.STREAM_CODEC)
+ );
+
+ public static final DeferredHolder, DataComponentType> CLICK_TO_LINK_DATA = DATA_COMPONENTS.registerComponentType(
+ "click_to_link_data",
+ builder -> builder.persistent(ClickToLinkData.CODEC).networkSynchronized(ClickToLinkData.STREAM_CODEC)
+ );
+
+ public static void register(IEventBus modEventBus) {
+ DATA_COMPONENTS.register(modEventBus);
+ }
+}
diff --git a/src/main/java/com/simibubi/create/AllEnchantments.java b/src/main/java/com/simibubi/create/AllEnchantments.java
index 3f0a3f8636..8186244c3c 100644
--- a/src/main/java/com/simibubi/create/AllEnchantments.java
+++ b/src/main/java/com/simibubi/create/AllEnchantments.java
@@ -1,31 +1,76 @@
package com.simibubi.create;
-import static com.simibubi.create.Create.REGISTRATE;
+import com.simibubi.create.content.equipment.potatoCannon.PotatoProjectileTypeManager;
-import com.simibubi.create.content.equipment.armor.CapacityEnchantment;
-import com.simibubi.create.content.equipment.potatoCannon.PotatoRecoveryEnchantment;
-import com.tterrag.registrate.util.entry.RegistryEntry;
-
-import net.minecraft.world.entity.EquipmentSlot;
-import net.minecraft.world.item.enchantment.Enchantment.Rarity;
-import net.minecraft.world.item.enchantment.EnchantmentCategory;
+import net.minecraft.advancements.critereon.ItemPredicate;
+import net.minecraft.core.HolderGetter;
+import net.minecraft.core.HolderSet;
+import net.minecraft.core.registries.Registries;
+import net.minecraft.data.worldgen.BootstrapContext;
+import net.minecraft.resources.ResourceKey;
+import net.minecraft.world.entity.EquipmentSlotGroup;
+import net.minecraft.world.item.Item;
+import net.minecraft.world.item.enchantment.Enchantment;
+import net.minecraft.world.item.enchantment.EnchantmentEffectComponents;
+import net.minecraft.world.item.enchantment.LevelBasedValue;
+import net.minecraft.world.item.enchantment.effects.SetValue;
+import net.minecraft.world.level.storage.loot.predicates.MatchTool;
public class AllEnchantments {
+ public static final ResourceKey
+ POTATO_RECOVERY = key("potato_recovery"),
+ CAPACITY = key("capacity");
- public static final RegistryEntry POTATO_RECOVERY = REGISTRATE.object("potato_recovery")
- .enchantment(EnchantmentCategory.BOW, PotatoRecoveryEnchantment::new)
- .addSlots(EquipmentSlot.MAINHAND, EquipmentSlot.OFFHAND)
- .lang("Potato Recovery")
- .rarity(Rarity.UNCOMMON)
- .register();
-
- public static final RegistryEntry CAPACITY = REGISTRATE.object("capacity")
- .enchantment(EnchantmentCategory.ARMOR_CHEST, CapacityEnchantment::new)
- .addSlots(EquipmentSlot.CHEST)
- .lang("Capacity")
- .rarity(Rarity.COMMON)
- .register();
+ private static ResourceKey key(String name) {
+ return ResourceKey.create(Registries.ENCHANTMENT, Create.asResource(name));
+ }
- public static void register() {}
+ public static void bootstrap(BootstrapContext context) {
+ HolderGetter- itemHolderGetter = context.lookup(Registries.ITEM);
+
+ register(
+ context,
+ POTATO_RECOVERY,
+ Enchantment.enchantment(
+ Enchantment.definition(
+ HolderSet.direct(AllItems.POTATO_CANNON),
+ 10,
+ 3,
+ Enchantment.dynamicCost(15, 15),
+ Enchantment.dynamicCost(45, 15),
+ 1,
+ EquipmentSlotGroup.MAINHAND
+ )
+ ).withEffect(
+ EnchantmentEffectComponents.AMMO_USE,
+ new SetValue(LevelBasedValue.perLevel(0.0F, 33.3333333333F)),
+ MatchTool.toolMatches(
+ ItemPredicate.Builder.item().of(
+ PotatoProjectileTypeManager.getItems().toArray(Item[]::new)
+ )
+ )
+ )
+ );
+
+ register(
+ context,
+ CAPACITY,
+ Enchantment.enchantment(
+ Enchantment.definition(
+ itemHolderGetter.getOrThrow(AllTags.AllItemTags.PRESSURIZED_AIR_SOURCES.tag),
+ 10,
+ 3,
+ Enchantment.dynamicCost(15, 15),
+ Enchantment.dynamicCost(45, 15),
+ 1,
+ EquipmentSlotGroup.MAINHAND
+ )
+ )
+ );
+ }
+
+ private static void register(BootstrapContext context, ResourceKey key, Enchantment.Builder builder) {
+ context.register(key, builder.build(key.location()));
+ }
}
diff --git a/src/main/java/com/simibubi/create/AllEntityDataSerializers.java b/src/main/java/com/simibubi/create/AllEntityDataSerializers.java
index ad3932e907..f5864fc08d 100644
--- a/src/main/java/com/simibubi/create/AllEntityDataSerializers.java
+++ b/src/main/java/com/simibubi/create/AllEntityDataSerializers.java
@@ -3,18 +3,17 @@ package com.simibubi.create;
import com.simibubi.create.content.trains.entity.CarriageSyncDataSerializer;
import net.minecraft.network.syncher.EntityDataSerializer;
-import net.minecraftforge.eventbus.api.IEventBus;
-import net.minecraftforge.registries.DeferredRegister;
-import net.minecraftforge.registries.ForgeRegistries;
-import net.minecraftforge.registries.RegistryObject;
-
+import net.neoforged.bus.api.IEventBus;
+import net.neoforged.neoforge.registries.DeferredHolder;
+import net.neoforged.neoforge.registries.DeferredRegister;
+import net.neoforged.neoforge.registries.NeoForgeRegistries;
public class AllEntityDataSerializers {
- private static final DeferredRegister> REGISTER = DeferredRegister.create(ForgeRegistries.Keys.ENTITY_DATA_SERIALIZERS, Create.ID);
+ private static final DeferredRegister> REGISTER = DeferredRegister.create(NeoForgeRegistries.Keys.ENTITY_DATA_SERIALIZERS, Create.ID);
public static final CarriageSyncDataSerializer CARRIAGE_DATA = new CarriageSyncDataSerializer();
- public static final RegistryObject CARRIAGE_DATA_ENTRY = REGISTER.register("carriage_data", () -> CARRIAGE_DATA);
+ public static final DeferredHolder, CarriageSyncDataSerializer> CARRIAGE_DATA_ENTRY = REGISTER.register("carriage_data", () -> CARRIAGE_DATA);
public static void register(IEventBus modEventBus) {
REGISTER.register(modEventBus);
diff --git a/src/main/java/com/simibubi/create/AllEntityTypes.java b/src/main/java/com/simibubi/create/AllEntityTypes.java
index 30984943e8..c0ed5edef1 100644
--- a/src/main/java/com/simibubi/create/AllEntityTypes.java
+++ b/src/main/java/com/simibubi/create/AllEntityTypes.java
@@ -32,7 +32,7 @@ import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.EntityType.EntityFactory;
import net.minecraft.world.entity.MobCategory;
-import net.minecraftforge.event.entity.EntityAttributeCreationEvent;
+import net.neoforged.neoforge.event.entity.EntityAttributeCreationEvent;
public class AllEntityTypes {
@@ -69,7 +69,7 @@ public class AllEntityTypes {
public static final EntityEntry SEAT = register("seat", SeatEntity::new, () -> SeatEntity.Render::new,
MobCategory.MISC, 5, Integer.MAX_VALUE, false, true, SeatEntity::build).register();
-
+
public static final EntityEntry PACKAGE = register("package", PackageEntity::new, () -> PackageRenderer::new,
MobCategory.MISC, 10, 3, true, false, PackageEntity::build).register();
@@ -99,7 +99,7 @@ public class AllEntityTypes {
})
.renderer(renderer);
}
-
+
public static void registerEntityAttributes(EntityAttributeCreationEvent event) {
event.put(PACKAGE.get(), PackageEntity.createPackageAttributes()
.build());
diff --git a/src/main/java/com/simibubi/create/AllFluids.java b/src/main/java/com/simibubi/create/AllFluids.java
index eea55ba3da..45c9c0571e 100644
--- a/src/main/java/com/simibubi/create/AllFluids.java
+++ b/src/main/java/com/simibubi/create/AllFluids.java
@@ -12,7 +12,6 @@ import org.joml.Vector3f;
import com.mojang.blaze3d.shaders.FogShape;
import com.mojang.blaze3d.systems.RenderSystem;
-import com.simibubi.create.AllTags.AllFluidTags;
import com.simibubi.create.content.decoration.palettes.AllPaletteStoneTypes;
import com.simibubi.create.content.fluids.VirtualFluid;
import com.simibubi.create.content.fluids.potion.PotionFluid;
@@ -32,13 +31,14 @@ import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Fluid;
import net.minecraft.world.level.material.FluidState;
-import net.minecraftforge.client.extensions.common.IClientFluidTypeExtensions;
-import net.minecraftforge.common.ForgeMod;
-import net.minecraftforge.fluids.FluidInteractionRegistry;
-import net.minecraftforge.fluids.FluidInteractionRegistry.InteractionInformation;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.FluidType;
-import net.minecraftforge.fluids.ForgeFlowingFluid;
+import net.neoforged.neoforge.client.extensions.common.IClientFluidTypeExtensions;
+import net.neoforged.neoforge.common.NeoForgeMod;
+import net.neoforged.neoforge.common.Tags;
+import net.neoforged.neoforge.fluids.BaseFlowingFluid;
+import net.neoforged.neoforge.fluids.FluidInteractionRegistry;
+import net.neoforged.neoforge.fluids.FluidInteractionRegistry.InteractionInformation;
+import net.neoforged.neoforge.fluids.FluidStack;
+import net.neoforged.neoforge.fluids.FluidType;
public class AllFluids {
static {
@@ -52,10 +52,10 @@ public class AllFluids {
public static final FluidEntry TEA = REGISTRATE.virtualFluid("tea")
.lang("Builder's Tea")
- .tag(AllTags.forgeFluidTag("tea"))
+ .tag(AllTags.commonFluidTag("teas"))
.register();
- public static final FluidEntry HONEY =
+ public static final FluidEntry HONEY =
REGISTRATE.standardFluid("honey",
SolidRenderedPlaceableFluidType.create(0xEAAE2F,
() -> 1f / 8f * AllConfigs.client().honeyTransparencyMultiplier.getF()))
@@ -66,19 +66,19 @@ public class AllFluids {
.tickRate(25)
.slopeFindDistance(3)
.explosionResistance(100f))
- .tag(AllFluidTags.HONEY.tag)
- .source(ForgeFlowingFluid.Source::new) // TODO: remove when Registrate fixes FluidBuilder
+ .tag(Tags.Fluids.HONEY)
+ .source(BaseFlowingFluid.Source::new) // TODO: remove when Registrate fixes FluidBuilder
.bucket()
- .tag(AllTags.forgeItemTag("buckets/honey"))
+ .tag(AllTags.commonItemTag("buckets/honey"))
.build()
.register();
- public static final FluidEntry CHOCOLATE =
+ public static final FluidEntry CHOCOLATE =
REGISTRATE.standardFluid("chocolate",
SolidRenderedPlaceableFluidType.create(0x622020,
() -> 1f / 32f * AllConfigs.client().chocolateTransparencyMultiplier.getF()))
.lang("Chocolate")
- .tag(AllTags.forgeFluidTag("chocolate"))
+ .tag(AllTags.commonFluidTag("chocolates"))
.properties(b -> b.viscosity(1500)
.density(1400))
.fluidProperties(p -> p.levelDecreasePerBlock(2)
@@ -92,7 +92,7 @@ public class AllFluids {
public static void register() {}
public static void registerFluidInteractions() {
- FluidInteractionRegistry.addInteraction(ForgeMod.LAVA_TYPE.get(), new InteractionInformation(
+ FluidInteractionRegistry.addInteraction(NeoForgeMod.LAVA_TYPE.value(), new InteractionInformation(
HONEY.get().getFluidType(),
fluidState -> {
if (fluidState.isSource()) {
@@ -105,7 +105,7 @@ public class AllFluids {
}
));
- FluidInteractionRegistry.addInteraction(ForgeMod.LAVA_TYPE.get(), new InteractionInformation(
+ FluidInteractionRegistry.addInteraction(NeoForgeMod.LAVA_TYPE.value(), new InteractionInformation(
CHOCOLATE.get().getFluidType(),
fluidState -> {
if (fluidState.isSource()) {
diff --git a/src/main/java/com/simibubi/create/AllInteractionBehaviours.java b/src/main/java/com/simibubi/create/AllInteractionBehaviours.java
index 85eefbb530..e9012835dd 100644
--- a/src/main/java/com/simibubi/create/AllInteractionBehaviours.java
+++ b/src/main/java/com/simibubi/create/AllInteractionBehaviours.java
@@ -13,15 +13,15 @@ import com.simibubi.create.content.contraptions.behaviour.TrapdoorMovingInteract
import com.simibubi.create.foundation.utility.AttachedRegistry;
import com.tterrag.registrate.util.nullness.NonNullConsumer;
+import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.BlockTags;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;
-import net.minecraftforge.registries.ForgeRegistries;
public class AllInteractionBehaviours {
- private static final AttachedRegistry BLOCK_BEHAVIOURS = new AttachedRegistry<>(ForgeRegistries.BLOCKS);
+ private static final AttachedRegistry BLOCK_BEHAVIOURS = new AttachedRegistry<>(BuiltInRegistries.BLOCK);
private static final List GLOBAL_BEHAVIOURS = new ArrayList<>();
public static void registerBehaviour(ResourceLocation block, MovingInteractionBehaviour provider) {
diff --git a/src/main/java/com/simibubi/create/AllItems.java b/src/main/java/com/simibubi/create/AllItems.java
index 79cb68596e..4bc9a4e422 100644
--- a/src/main/java/com/simibubi/create/AllItems.java
+++ b/src/main/java/com/simibubi/create/AllItems.java
@@ -1,9 +1,9 @@
package com.simibubi.create;
-import static com.simibubi.create.AllTags.forgeItemTag;
import static com.simibubi.create.AllTags.AllItemTags.CREATE_INGOTS;
import static com.simibubi.create.AllTags.AllItemTags.CRUSHED_RAW_MATERIALS;
import static com.simibubi.create.AllTags.AllItemTags.PLATES;
+import static com.simibubi.create.AllTags.commonItemTag;
import static com.simibubi.create.Create.REGISTRATE;
import static com.simibubi.create.foundation.data.recipe.CompatMetals.ALUMINUM;
import static com.simibubi.create.foundation.data.recipe.CompatMetals.LEAD;
@@ -26,7 +26,7 @@ import com.simibubi.create.content.equipment.armor.BacktankItem;
import com.simibubi.create.content.equipment.armor.BacktankItem.BacktankBlockItem;
import com.simibubi.create.content.equipment.armor.BaseArmorItem;
import com.simibubi.create.content.equipment.armor.CardboardArmorItem;
-import com.simibubi.create.content.equipment.armor.CardboardHelmetItem;
+import com.simibubi.create.content.equipment.armor.CardboardArmorStealthOverlay;
import com.simibubi.create.content.equipment.armor.DivingBootsItem;
import com.simibubi.create.content.equipment.armor.DivingHelmetItem;
import com.simibubi.create.content.equipment.armor.TrimmableArmorModelGenerator;
@@ -37,6 +37,7 @@ import com.simibubi.create.content.equipment.goggles.GogglesModel;
import com.simibubi.create.content.equipment.potatoCannon.PotatoCannonItem;
import com.simibubi.create.content.equipment.sandPaper.SandPaperItem;
import com.simibubi.create.content.equipment.symmetryWand.SymmetryWandItem;
+import com.simibubi.create.content.equipment.tool.AllToolMaterials;
import com.simibubi.create.content.equipment.tool.CardboardSwordItem;
import com.simibubi.create.content.equipment.wrench.WrenchItem;
import com.simibubi.create.content.equipment.zapper.terrainzapper.WorldshaperItem;
@@ -78,7 +79,8 @@ import net.minecraft.world.item.ArmorItem;
import net.minecraft.world.item.ArmorMaterials;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.Rarity;
-import net.minecraftforge.common.Tags;
+import net.minecraft.world.item.SwordItem;
+import net.neoforged.neoforge.common.Tags;
public class AllItems {
@@ -86,18 +88,18 @@ public class AllItems {
REGISTRATE.setCreativeTab(AllCreativeModeTabs.BASE_CREATIVE_TAB);
}
- public static final ItemEntry
- WHEAT_FLOUR =
- taggedIngredient("wheat_flour", forgeItemTag("flour/wheat"), forgeItemTag("flour")),
- DOUGH = taggedIngredient("dough", forgeItemTag("dough"), forgeItemTag("dough/wheat")),
+ public static final ItemEntry
-
+ WHEAT_FLOUR = taggedIngredient("wheat_flour", commonItemTag("flours/wheat"), commonItemTag("flours")),
+ DOUGH = taggedIngredient("dough", commonItemTag("doughs"), commonItemTag("doughs/wheat")),
CINDER_FLOUR = ingredient("cinder_flour"), ROSE_QUARTZ = ingredient("rose_quartz"),
POLISHED_ROSE_QUARTZ = ingredient("polished_rose_quartz"), POWDERED_OBSIDIAN = ingredient("powdered_obsidian"),
- STURDY_SHEET = taggedIngredient("sturdy_sheet", forgeItemTag("plates/obsidian"), PLATES.tag),
+ STURDY_SHEET = taggedIngredient("sturdy_sheet", commonItemTag("plates/obsidian"), PLATES.tag),
PROPELLER = ingredient("propeller"), WHISK = ingredient("whisk"), BRASS_HAND = ingredient("brass_hand"),
CRAFTER_SLOT_COVER = ingredient("crafter_slot_cover"), ELECTRON_TUBE = ingredient("electron_tube"),
TRANSMITTER = ingredient("transmitter"), PULP = ingredient("pulp");
public static final ItemEntry CARDBOARD = REGISTRATE.item("cardboard", CombustibleItem::new)
- .tag(forgeItemTag("plates/cardboard"))
+ .tag(commonItemTag("plates/cardboard"))
.onRegister(i -> i.setBurnTime(1000))
.register();
@@ -127,26 +129,26 @@ public class AllItems {
public static final ItemEntry
- BAR_OF_CHOCOLATE = REGISTRATE.item("bar_of_chocolate", Item::new)
.properties(p -> p.food(new FoodProperties.Builder().nutrition(6)
- .saturationMod(0.3F)
+ .saturationModifier(0.3F)
.build()))
.lang("Bar of Chocolate")
.register();
public static final ItemEntry
- SWEET_ROLL = REGISTRATE.item("sweet_roll", Item::new)
.properties(p -> p.food(new FoodProperties.Builder().nutrition(6)
- .saturationMod(0.8F)
+ .saturationModifier(0.8F)
.build()))
.register();
public static final ItemEntry
- CHOCOLATE_BERRIES = REGISTRATE.item("chocolate_glazed_berries", Item::new)
.properties(p -> p.food(new FoodProperties.Builder().nutrition(7)
- .saturationMod(0.8F)
+ .saturationModifier(0.8F)
.build()))
.register();
public static final ItemEntry
- HONEYED_APPLE = REGISTRATE.item("honeyed_apple", Item::new)
.properties(p -> p.food(new FoodProperties.Builder().nutrition(8)
- .saturationMod(0.8F)
+ .saturationModifier(0.8F)
.build()))
.register();
@@ -159,15 +161,16 @@ public class AllItems {
public static final ItemEntry CARDBOARD_SWORD =
REGISTRATE.item("cardboard_sword", CardboardSwordItem::new)
.properties(p -> p.stacksTo(1))
+ .properties(p -> p.attributes(SwordItem.createAttributes(AllToolMaterials.CARDBOARD, 3, 1)))
.model(AssetLookup.itemModelWithPartials())
.register();
public static final ItemEntry
- RAW_ZINC =
- taggedIngredient("raw_zinc", forgeItemTag("raw_materials/zinc"), forgeItemTag("raw_materials"));
+ taggedIngredient("raw_zinc", commonItemTag("raw_materials/zinc"), commonItemTag("raw_materials"));
public static final ItemEntry
- ANDESITE_ALLOY = taggedIngredient("andesite_alloy", CREATE_INGOTS.tag),
- ZINC_INGOT = taggedIngredient("zinc_ingot", forgeItemTag("ingots/zinc"), CREATE_INGOTS.tag),
- BRASS_INGOT = taggedIngredient("brass_ingot", forgeItemTag("ingots/brass"), CREATE_INGOTS.tag);
+ ZINC_INGOT = taggedIngredient("zinc_ingot", commonItemTag("ingots/zinc"), CREATE_INGOTS.tag),
+ BRASS_INGOT = taggedIngredient("brass_ingot", commonItemTag("ingots/brass"), CREATE_INGOTS.tag);
public static final ItemEntry CHROMATIC_COMPOUND =
REGISTRATE.item("chromatic_compound", ChromaticCompoundItem::new)
@@ -185,10 +188,10 @@ public class AllItems {
.properties(p -> p.rarity(Rarity.UNCOMMON))
.register();
- public static final ItemEntry
- COPPER_NUGGET =
- taggedIngredient("copper_nugget", forgeItemTag("nuggets/copper"), Tags.Items.NUGGETS),
- ZINC_NUGGET = taggedIngredient("zinc_nugget", forgeItemTag("nuggets/zinc"), Tags.Items.NUGGETS),
- BRASS_NUGGET = taggedIngredient("brass_nugget", forgeItemTag("nuggets/brass"), Tags.Items.NUGGETS);
+ public static final ItemEntry
-
+ COPPER_NUGGET = taggedIngredient("copper_nugget", commonItemTag("nuggets/copper"), Tags.Items.NUGGETS),
+ ZINC_NUGGET = taggedIngredient("zinc_nugget", commonItemTag("nuggets/zinc"), Tags.Items.NUGGETS),
+ BRASS_NUGGET = taggedIngredient("brass_nugget", commonItemTag("nuggets/brass"), Tags.Items.NUGGETS);
public static final ItemEntry EXP_NUGGET =
REGISTRATE.item("experience_nugget", ExperienceNuggetItem::new)
@@ -197,11 +200,11 @@ public class AllItems {
.lang("Nugget of Experience")
.register();
- public static final ItemEntry
- COPPER_SHEET =
- taggedIngredient("copper_sheet", forgeItemTag("plates/copper"), PLATES.tag),
- BRASS_SHEET = taggedIngredient("brass_sheet", forgeItemTag("plates/brass"), PLATES.tag),
- IRON_SHEET = taggedIngredient("iron_sheet", forgeItemTag("plates/iron"), PLATES.tag),
- GOLDEN_SHEET = taggedIngredient("golden_sheet", forgeItemTag("plates/gold"), PLATES.tag, ItemTags.PIGLIN_LOVED),
+ public static final ItemEntry
-
+ COPPER_SHEET = taggedIngredient("copper_sheet", commonItemTag("plates/copper"), PLATES.tag),
+ BRASS_SHEET = taggedIngredient("brass_sheet", commonItemTag("plates/brass"), PLATES.tag),
+ IRON_SHEET = taggedIngredient("iron_sheet", commonItemTag("plates/iron"), PLATES.tag),
+ GOLDEN_SHEET = taggedIngredient("golden_sheet", commonItemTag("plates/gold"), PLATES.tag, ItemTags.PIGLIN_LOVED),
CRUSHED_IRON = taggedIngredient("crushed_raw_iron", CRUSHED_RAW_MATERIALS.tag),
CRUSHED_GOLD = taggedIngredient("crushed_raw_gold", CRUSHED_RAW_MATERIALS.tag, ItemTags.PIGLIN_LOVED),
@@ -275,7 +278,7 @@ public class AllItems {
COPPER_BACKTANK_PLACEABLE))
.model(AssetLookup.customGenericItemModel("_", "item"))
.tag(AllItemTags.PRESSURIZED_AIR_SOURCES.tag)
- .tag(forgeItemTag("armors/chestplates"))
+ .tag(ItemTags.CHEST_ARMOR)
.register(),
NETHERITE_BACKTANK = REGISTRATE
@@ -285,7 +288,7 @@ public class AllItems {
.model(AssetLookup.customGenericItemModel("_", "item"))
.properties(p -> p.fireResistant())
.tag(AllItemTags.PRESSURIZED_AIR_SOURCES.tag)
- .tag(forgeItemTag("armors/chestplates"))
+ .tag(ItemTags.CHEST_ARMOR)
.register();
public static final ItemEntry extends DivingHelmetItem>
@@ -294,14 +297,14 @@ public class AllItems {
REGISTRATE
.item("copper_diving_helmet",
p -> new DivingHelmetItem(AllArmorMaterials.COPPER, p, Create.asResource("copper_diving")))
- .tag(forgeItemTag("armors/helmets"))
+ .tag(ItemTags.HEAD_ARMOR)
.register(),
NETHERITE_DIVING_HELMET = REGISTRATE
.item("netherite_diving_helmet",
p -> new DivingHelmetItem(ArmorMaterials.NETHERITE, p, Create.asResource("netherite_diving")))
.properties(p -> p.fireResistant())
- .tag(forgeItemTag("armors/helmets"))
+ .tag(ItemTags.HEAD_ARMOR)
.register();
public static final ItemEntry extends DivingBootsItem>
@@ -310,40 +313,41 @@ public class AllItems {
REGISTRATE
.item("copper_diving_boots",
p -> new DivingBootsItem(AllArmorMaterials.COPPER, p, Create.asResource("copper_diving")))
- .tag(forgeItemTag("armors/boots"))
+ .tag(ItemTags.FOOT_ARMOR)
.register(),
NETHERITE_DIVING_BOOTS = REGISTRATE
.item("netherite_diving_boots",
p -> new DivingBootsItem(ArmorMaterials.NETHERITE, p, Create.asResource("netherite_diving")))
.properties(p -> p.fireResistant())
- .tag(forgeItemTag("armors/boots"))
+ .tag(ItemTags.FOOT_ARMOR)
.register();
public static final ItemEntry extends BaseArmorItem>
- CARDBOARD_HELMET = REGISTRATE.item("cardboard_helmet", p -> new CardboardHelmetItem(ArmorItem.Type.HELMET, p))
- .tag(forgeItemTag("armors/helmet"), ItemTags.TRIMMABLE_ARMOR)
+ CARDBOARD_HELMET = REGISTRATE.item("cardboard_helmet", p -> new CardboardArmorItem(ArmorItem.Type.HELMET, p))
+ .tag(ItemTags.HEAD_ARMOR, ItemTags.TRIMMABLE_ARMOR)
.onRegisterAfter(Registries.ITEM, v -> ItemDescription.useKey(v, "item.create.cardboard_armor"))
.model(TrimmableArmorModelGenerator::generate)
+ .clientExtension(() -> () -> new CardboardArmorStealthOverlay())
.register(),
CARDBOARD_CHESTPLATE =
REGISTRATE.item("cardboard_chestplate", p -> new CardboardArmorItem(ArmorItem.Type.CHESTPLATE, p))
- .tag(forgeItemTag("armors/chestplate"), ItemTags.TRIMMABLE_ARMOR)
+ .tag(ItemTags.CHEST_ARMOR, ItemTags.TRIMMABLE_ARMOR)
.onRegisterAfter(Registries.ITEM, v -> ItemDescription.useKey(v, "item.create.cardboard_armor"))
.model(TrimmableArmorModelGenerator::generate)
.register(),
CARDBOARD_LEGGINGS =
REGISTRATE.item("cardboard_leggings", p -> new CardboardArmorItem(ArmorItem.Type.LEGGINGS, p))
- .tag(forgeItemTag("armors/leggings"), ItemTags.TRIMMABLE_ARMOR)
+ .tag(ItemTags.LEG_ARMOR, ItemTags.TRIMMABLE_ARMOR)
.onRegisterAfter(Registries.ITEM, v -> ItemDescription.useKey(v, "item.create.cardboard_armor"))
.model(TrimmableArmorModelGenerator::generate)
.register(),
CARDBOARD_BOOTS = REGISTRATE.item("cardboard_boots", p -> new CardboardArmorItem(ArmorItem.Type.BOOTS, p))
- .tag(forgeItemTag("armors/boots"), ItemTags.TRIMMABLE_ARMOR)
+ .tag(ItemTags.FOOT_ARMOR, ItemTags.TRIMMABLE_ARMOR)
.onRegisterAfter(Registries.ITEM, v -> ItemDescription.useKey(v, "item.create.cardboard_armor"))
.model(TrimmableArmorModelGenerator::generate)
.register();
@@ -386,6 +390,7 @@ public class AllItems {
public static final ItemEntry POTATO_CANNON =
REGISTRATE.item("potato_cannon", PotatoCannonItem::new)
.model(AssetLookup.itemModelWithPartials())
+ .tag(Tags.Items.ENCHANTABLES)
.register();
public static final ItemEntry EXTENDO_GRIP = REGISTRATE.item("extendo_grip", ExtendoGripItem::new)
@@ -490,7 +495,7 @@ public class AllItems {
String metalName = metal.getName();
return REGISTRATE
.item("crushed_raw_" + metalName,
- props -> new TagDependentIngredientItem(props, AllTags.forgeItemTag("ores/" + metalName)))
+ props -> new TagDependentIngredientItem(props, AllTags.commonItemTag("ores/" + metalName)))
.tag(CRUSHED_RAW_MATERIALS.tag)
.register();
}
diff --git a/src/main/java/com/simibubi/create/AllKeys.java b/src/main/java/com/simibubi/create/AllKeys.java
index 0b1f1338be..afb3a083ba 100644
--- a/src/main/java/com/simibubi/create/AllKeys.java
+++ b/src/main/java/com/simibubi/create/AllKeys.java
@@ -1,5 +1,7 @@
package com.simibubi.create;
+import net.neoforged.fml.common.EventBusSubscriber;
+
import org.lwjgl.glfw.GLFW;
import com.mojang.blaze3d.platform.InputConstants;
@@ -7,10 +9,9 @@ import com.mojang.blaze3d.platform.InputConstants;
import net.minecraft.client.KeyMapping;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.Screen;
-import net.minecraftforge.api.distmarker.Dist;
-import net.minecraftforge.client.event.RegisterKeyMappingsEvent;
-import net.minecraftforge.eventbus.api.SubscribeEvent;
-import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
+import net.neoforged.api.distmarker.Dist;
+import net.neoforged.bus.api.SubscribeEvent;
+import net.neoforged.neoforge.client.event.RegisterKeyMappingsEvent;
@EventBusSubscriber(value = Dist.CLIENT, bus = EventBusSubscriber.Bus.MOD)
public enum AllKeys {
diff --git a/src/main/java/com/simibubi/create/AllMapDecorationTypes.java b/src/main/java/com/simibubi/create/AllMapDecorationTypes.java
new file mode 100644
index 0000000000..24a934d774
--- /dev/null
+++ b/src/main/java/com/simibubi/create/AllMapDecorationTypes.java
@@ -0,0 +1,17 @@
+package com.simibubi.create;
+
+import net.minecraft.core.Holder;
+import net.minecraft.core.registries.Registries;
+import net.minecraft.world.level.saveddata.maps.MapDecorationType;
+import net.neoforged.bus.api.IEventBus;
+import net.neoforged.neoforge.registries.DeferredRegister;
+
+public class AllMapDecorationTypes {
+ private static final DeferredRegister DECORATION_TYPES = DeferredRegister.create(Registries.MAP_DECORATION_TYPE, Create.ID);
+
+ public static final Holder STATION_MAP_DECORATION = DECORATION_TYPES.register("station", () -> new MapDecorationType(Create.asResource("station"), true, -1, false, true));
+
+ public static void register(IEventBus modEventBus) {
+ DECORATION_TYPES.register(modEventBus);
+ }
+}
diff --git a/src/main/java/com/simibubi/create/AllMovementBehaviours.java b/src/main/java/com/simibubi/create/AllMovementBehaviours.java
index 6dde486402..737fb2d91a 100644
--- a/src/main/java/com/simibubi/create/AllMovementBehaviours.java
+++ b/src/main/java/com/simibubi/create/AllMovementBehaviours.java
@@ -13,14 +13,15 @@ import com.simibubi.create.content.contraptions.behaviour.dispenser.DropperMovem
import com.simibubi.create.foundation.utility.AttachedRegistry;
import com.tterrag.registrate.util.nullness.NonNullConsumer;
+import net.minecraft.core.registries.BuiltInRegistries;
+import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;
-import net.minecraftforge.registries.ForgeRegistries;
public class AllMovementBehaviours {
- private static final AttachedRegistry BLOCK_BEHAVIOURS = new AttachedRegistry<>(ForgeRegistries.BLOCKS);
+ private static final AttachedRegistry BLOCK_BEHAVIOURS = new AttachedRegistry<>(BuiltInRegistries.BLOCK);
private static final List GLOBAL_BEHAVIOURS = new ArrayList<>();
public static void registerBehaviour(ResourceLocation block, MovementBehaviour behaviour) {
diff --git a/src/main/java/com/simibubi/create/AllPackets.java b/src/main/java/com/simibubi/create/AllPackets.java
index bf7ea041b5..9d98724fec 100644
--- a/src/main/java/com/simibubi/create/AllPackets.java
+++ b/src/main/java/com/simibubi/create/AllPackets.java
@@ -1,11 +1,6 @@
package com.simibubi.create;
-import static net.minecraftforge.network.NetworkDirection.PLAY_TO_CLIENT;
-import static net.minecraftforge.network.NetworkDirection.PLAY_TO_SERVER;
-
-import java.util.function.BiConsumer;
-import java.util.function.Function;
-import java.util.function.Supplier;
+import java.util.Locale;
import com.simibubi.create.compat.computercraft.AttachedComputerPacket;
import com.simibubi.create.compat.trainmap.TrainMapSyncPacket;
@@ -91,7 +86,8 @@ import com.simibubi.create.content.schematics.packet.SchematicSyncPacket;
import com.simibubi.create.content.schematics.packet.SchematicUploadPacket;
import com.simibubi.create.content.trains.HonkPacket;
import com.simibubi.create.content.trains.TrainHUDUpdatePacket;
-import com.simibubi.create.content.trains.entity.TrainPacket;
+import com.simibubi.create.content.trains.entity.AddTrainPacket;
+import com.simibubi.create.content.trains.entity.RemoveTrainPacket;
import com.simibubi.create.content.trains.entity.TrainPromptPacket;
import com.simibubi.create.content.trains.entity.TrainRelocationPacket;
import com.simibubi.create.content.trains.graph.TrackGraphRequestPacket;
@@ -111,153 +107,137 @@ import com.simibubi.create.foundation.gui.menu.ClearMenuPacket;
import com.simibubi.create.foundation.gui.menu.GhostItemSubmitPacket;
import com.simibubi.create.foundation.networking.ISyncPersistentData;
import com.simibubi.create.foundation.networking.LeftClickPacket;
-import com.simibubi.create.foundation.networking.SimplePacketBase;
import com.simibubi.create.foundation.utility.ServerSpeedProvider;
import com.simibubi.create.infrastructure.command.HighlightPacket;
import com.simibubi.create.infrastructure.command.SimpleCreateActions;
import com.simibubi.create.infrastructure.debugInfo.ServerDebugInfoPacket;
-import net.createmod.catnip.net.ClientboundSimpleActionPacket;
-import net.minecraft.core.BlockPos;
-import net.minecraft.network.FriendlyByteBuf;
-import net.minecraft.resources.ResourceLocation;
-import net.minecraft.world.level.Level;
-import net.minecraftforge.network.NetworkDirection;
-import net.minecraftforge.network.NetworkEvent.Context;
-import net.minecraftforge.network.NetworkRegistry;
-import net.minecraftforge.network.PacketDistributor;
-import net.minecraftforge.network.PacketDistributor.TargetPoint;
-import net.minecraftforge.network.simple.SimpleChannel;
-
-public enum AllPackets {
+import net.createmod.catnip.net.base.BasePacketPayload;
+import net.createmod.catnip.net.base.CatnipPacketRegistry;
+import net.createmod.catnip.net.packets.ClientboundSimpleActionPacket;
+import net.minecraft.network.RegistryFriendlyByteBuf;
+import net.minecraft.network.codec.StreamCodec;
+import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
+public enum AllPackets implements BasePacketPayload.PacketTypeProvider {
// Client to Server
- CONFIGURE_SCHEMATICANNON(ConfigureSchematicannonPacket.class, ConfigureSchematicannonPacket::new, PLAY_TO_SERVER),
- CONFIGURE_STOCKSWITCH(ConfigureThresholdSwitchPacket.class, ConfigureThresholdSwitchPacket::new, PLAY_TO_SERVER),
- CONFIGURE_SEQUENCER(ConfigureSequencedGearshiftPacket.class, ConfigureSequencedGearshiftPacket::new,
- PLAY_TO_SERVER),
- PLACE_SCHEMATIC(SchematicPlacePacket.class, SchematicPlacePacket::new, PLAY_TO_SERVER),
- UPLOAD_SCHEMATIC(SchematicUploadPacket.class, SchematicUploadPacket::new, PLAY_TO_SERVER),
- CLEAR_CONTAINER(ClearMenuPacket.class, ClearMenuPacket::new, PLAY_TO_SERVER),
- CONFIGURE_FILTER(FilterScreenPacket.class, FilterScreenPacket::new, PLAY_TO_SERVER),
- EXTENDO_INTERACT(ExtendoGripInteractionPacket.class, ExtendoGripInteractionPacket::new, PLAY_TO_SERVER),
- CONTRAPTION_INTERACT(ContraptionInteractionPacket.class, ContraptionInteractionPacket::new, PLAY_TO_SERVER),
- CLIENT_MOTION(ClientMotionPacket.class, ClientMotionPacket::new, PLAY_TO_SERVER),
- PLACE_ARM(ArmPlacementPacket.class, ArmPlacementPacket::new, PLAY_TO_SERVER),
- PLACE_PACKAGE_PORT(PackagePortPlacementPacket.class, PackagePortPlacementPacket::new, PLAY_TO_SERVER),
- MINECART_COUPLING_CREATION(CouplingCreationPacket.class, CouplingCreationPacket::new, PLAY_TO_SERVER),
- INSTANT_SCHEMATIC(InstantSchematicPacket.class, InstantSchematicPacket::new, PLAY_TO_SERVER),
- SYNC_SCHEMATIC(SchematicSyncPacket.class, SchematicSyncPacket::new, PLAY_TO_SERVER),
- LEFT_CLICK(LeftClickPacket.class, LeftClickPacket::new, PLAY_TO_SERVER),
- PLACE_EJECTOR(EjectorPlacementPacket.class, EjectorPlacementPacket::new, PLAY_TO_SERVER),
- TRIGGER_EJECTOR(EjectorTriggerPacket.class, EjectorTriggerPacket::new, PLAY_TO_SERVER),
- EJECTOR_ELYTRA(EjectorElytraPacket.class, EjectorElytraPacket::new, PLAY_TO_SERVER),
- LINKED_CONTROLLER_INPUT(LinkedControllerInputPacket.class, LinkedControllerInputPacket::new, PLAY_TO_SERVER),
- LINKED_CONTROLLER_BIND(LinkedControllerBindPacket.class, LinkedControllerBindPacket::new, PLAY_TO_SERVER),
- LINKED_CONTROLLER_USE_LECTERN(LinkedControllerStopLecternPacket.class, LinkedControllerStopLecternPacket::new,
- PLAY_TO_SERVER),
- SUBMIT_GHOST_ITEM(GhostItemSubmitPacket.class, GhostItemSubmitPacket::new, PLAY_TO_SERVER),
- BLUEPRINT_COMPLETE_RECIPE(BlueprintAssignCompleteRecipePacket.class, BlueprintAssignCompleteRecipePacket::new,
- PLAY_TO_SERVER),
- CONFIGURE_SYMMETRY_WAND(ConfigureSymmetryWandPacket.class, ConfigureSymmetryWandPacket::new, PLAY_TO_SERVER),
- CONFIGURE_WORLDSHAPER(ConfigureWorldshaperPacket.class, ConfigureWorldshaperPacket::new, PLAY_TO_SERVER),
- TOOLBOX_EQUIP(ToolboxEquipPacket.class, ToolboxEquipPacket::new, PLAY_TO_SERVER),
- TOOLBOX_DISPOSE_ALL(ToolboxDisposeAllPacket.class, ToolboxDisposeAllPacket::new, PLAY_TO_SERVER),
- CONFIGURE_SCHEDULE(ScheduleEditPacket.class, ScheduleEditPacket::new, PLAY_TO_SERVER),
- CONFIGURE_STATION(StationEditPacket.class, StationEditPacket::new, PLAY_TO_SERVER),
- C_CONFIGURE_TRAIN(TrainEditPacket.class, TrainEditPacket::new, PLAY_TO_SERVER),
- RELOCATE_TRAIN(TrainRelocationPacket.class, TrainRelocationPacket::new, PLAY_TO_SERVER),
- CONTROLS_INPUT(ControlsInputPacket.class, ControlsInputPacket::new, PLAY_TO_SERVER),
- CONFIGURE_DATA_GATHERER(DisplayLinkConfigurationPacket.class, DisplayLinkConfigurationPacket::new, PLAY_TO_SERVER),
- DESTROY_CURVED_TRACK(CurvedTrackDestroyPacket.class, CurvedTrackDestroyPacket::new, PLAY_TO_SERVER),
- SELECT_CURVED_TRACK(CurvedTrackSelectionPacket.class, CurvedTrackSelectionPacket::new, PLAY_TO_SERVER),
- PLACE_CURVED_TRACK(PlaceExtendedCurvePacket.class, PlaceExtendedCurvePacket::new, PLAY_TO_SERVER),
- GLUE_IN_AREA(SuperGlueSelectionPacket.class, SuperGlueSelectionPacket::new, PLAY_TO_SERVER),
- GLUE_REMOVED(SuperGlueRemovalPacket.class, SuperGlueRemovalPacket::new, PLAY_TO_SERVER),
- TRAIN_COLLISION(TrainCollisionPacket.class, TrainCollisionPacket::new, PLAY_TO_SERVER),
- C_TRAIN_HUD(TrainHUDUpdatePacket.Serverbound.class, TrainHUDUpdatePacket.Serverbound::new, PLAY_TO_SERVER),
- C_TRAIN_HONK(HonkPacket.Serverbound.class, HonkPacket.Serverbound::new, PLAY_TO_SERVER),
- OBSERVER_STRESSOMETER(GaugeObservedPacket.class, GaugeObservedPacket::new, PLAY_TO_SERVER),
- EJECTOR_AWARD(EjectorAwardPacket.class, EjectorAwardPacket::new, PLAY_TO_SERVER),
- TRACK_GRAPH_REQUEST(TrackGraphRequestPacket.class, TrackGraphRequestPacket::new, PLAY_TO_SERVER),
- CONFIGURE_ELEVATOR_CONTACT(ElevatorContactEditPacket.class, ElevatorContactEditPacket::new, PLAY_TO_SERVER),
- REQUEST_FLOOR_LIST(ElevatorFloorListPacket.RequestFloorList.class, ElevatorFloorListPacket.RequestFloorList::new,
- PLAY_TO_SERVER),
- ELEVATOR_SET_FLOOR(ElevatorTargetFloorPacket.class, ElevatorTargetFloorPacket::new, PLAY_TO_SERVER),
- VALUE_SETTINGS(ValueSettingsPacket.class, ValueSettingsPacket::new, PLAY_TO_SERVER),
- CLIPBOARD_EDIT(ClipboardEditPacket.class, ClipboardEditPacket::new, PLAY_TO_SERVER),
- CONTRAPTION_COLLIDER_LOCK_REQUEST(ContraptionColliderLockPacketRequest.class,
- ContraptionColliderLockPacketRequest::new, PLAY_TO_SERVER),
- RADIAL_WRENCH_MENU_SUBMIT(RadialWrenchMenuSubmitPacket.class, RadialWrenchMenuSubmitPacket::new,
- PLAY_TO_SERVER),
- LOGISTICS_STOCK_REQUEST(LogisticalStockRequestPacket.class, LogisticalStockRequestPacket::new, PLAY_TO_SERVER),
- LOGISTICS_PACKAGE_REQUEST(PackageOrderRequestPacket.class, PackageOrderRequestPacket::new, PLAY_TO_SERVER),
- CHAIN_CONVEYOR_CONNECT(ChainConveyorConnectionPacket.class, ChainConveyorConnectionPacket::new, PLAY_TO_SERVER),
- CHAIN_CONVEYOR_RIDING(ServerboundChainConveyorRidingPacket.class, ServerboundChainConveyorRidingPacket::new, PLAY_TO_SERVER),
- CHAIN_PACKAGE_INTERACTION(ChainPackageInteractionPacket.class, ChainPackageInteractionPacket::new, PLAY_TO_SERVER),
- PACKAGE_PORT_CONFIGURATION(PackagePortConfigurationPacket.class, PackagePortConfigurationPacket::new, PLAY_TO_SERVER),
- TRAIN_MAP_REQUEST(TrainMapSyncRequestPacket.class, TrainMapSyncRequestPacket::new, PLAY_TO_SERVER),
- CONNECT_FACTORY_PANEL(FactoryPanelConnectionPacket.class, FactoryPanelConnectionPacket::new, PLAY_TO_SERVER),
- CONFIGURE_FACTORY_PANEL(FactoryPanelConfigurationPacket.class, FactoryPanelConfigurationPacket::new, PLAY_TO_SERVER),
- CONFIGURE_REDSTONE_REQUESTER(RedstoneRequesterConfigurationPacket.class, RedstoneRequesterConfigurationPacket::new, PLAY_TO_SERVER),
- CONFIGURE_STOCK_KEEPER_CATEGORIES(StockKeeperCategoryEditPacket.class, StockKeeperCategoryEditPacket::new, PLAY_TO_SERVER),
- REFUND_STOCK_KEEPER_CATEGORY(StockKeeperCategoryRefundPacket.class, StockKeeperCategoryRefundPacket::new, PLAY_TO_SERVER),
- LOCK_STOCK_KEEPER(StockKeeperLockPacket.class, StockKeeperLockPacket::new, PLAY_TO_SERVER),
- STOCK_KEEPER_HIDE_CATEGORY(StockKeeperCategoryHidingPacket.class, StockKeeperCategoryHidingPacket::new, PLAY_TO_SERVER),
+ CONFIGURE_SCHEMATICANNON(ConfigureSchematicannonPacket.class, ConfigureSchematicannonPacket.STREAM_CODEC),
+ CONFIGURE_STOCKSWITCH(ConfigureThresholdSwitchPacket.class, ConfigureThresholdSwitchPacket.STREAM_CODEC),
+ CONFIGURE_SEQUENCER(ConfigureSequencedGearshiftPacket.class, ConfigureSequencedGearshiftPacket.STREAM_CODEC),
+ PLACE_SCHEMATIC(SchematicPlacePacket.class, SchematicPlacePacket.STREAM_CODEC),
+ UPLOAD_SCHEMATIC(SchematicUploadPacket.class, SchematicUploadPacket.STREAM_CODEC),
+ CLEAR_CONTAINER(ClearMenuPacket.class, ClearMenuPacket.STREAM_CODEC),
+ CONFIGURE_FILTER(FilterScreenPacket.class, FilterScreenPacket.STREAM_CODEC),
+ EXTENDO_INTERACT(ExtendoGripInteractionPacket.class, ExtendoGripInteractionPacket.STREAM_CODEC),
+ CONTRAPTION_INTERACT(ContraptionInteractionPacket.class, ContraptionInteractionPacket.STREAM_CODEC),
+ CLIENT_MOTION(ClientMotionPacket.class, ClientMotionPacket.STREAM_CODEC),
+ PLACE_ARM(ArmPlacementPacket.class, ArmPlacementPacket.STREAM_CODEC),
+ PLACE_PACKAGE_PORT(PackagePortPlacementPacket.class, PackagePortPlacementPacket.STREAM_CODEC),
+ MINECART_COUPLING_CREATION(CouplingCreationPacket.class, CouplingCreationPacket.STREAM_CODEC),
+ INSTANT_SCHEMATIC(InstantSchematicPacket.class, InstantSchematicPacket.STREAM_CODEC),
+ SYNC_SCHEMATIC(SchematicSyncPacket.class, SchematicSyncPacket.STREAM_CODEC),
+ LEFT_CLICK(LeftClickPacket.class, LeftClickPacket.STREAM_CODEC),
+ PLACE_EJECTOR(EjectorPlacementPacket.class, EjectorPlacementPacket.STREAM_CODEC),
+ TRIGGER_EJECTOR(EjectorTriggerPacket.class, EjectorTriggerPacket.STREAM_CODEC),
+ EJECTOR_ELYTRA(EjectorElytraPacket.class, EjectorElytraPacket.STREAM_CODEC),
+ LINKED_CONTROLLER_INPUT(LinkedControllerInputPacket.class, LinkedControllerInputPacket.STREAM_CODEC),
+ LINKED_CONTROLLER_BIND(LinkedControllerBindPacket.class, LinkedControllerBindPacket.STREAM_CODEC),
+ LINKED_CONTROLLER_USE_LECTERN(LinkedControllerStopLecternPacket.class, LinkedControllerStopLecternPacket.STREAM_CODEC),
+ SUBMIT_GHOST_ITEM(GhostItemSubmitPacket.class, GhostItemSubmitPacket.STREAM_CODEC),
+ BLUEPRINT_COMPLETE_RECIPE(BlueprintAssignCompleteRecipePacket.class, BlueprintAssignCompleteRecipePacket.STREAM_CODEC),
+ CONFIGURE_SYMMETRY_WAND(ConfigureSymmetryWandPacket.class, ConfigureSymmetryWandPacket.STREAM_CODEC),
+ CONFIGURE_WORLDSHAPER(ConfigureWorldshaperPacket.class, ConfigureWorldshaperPacket.STREAM_CODEC),
+ TOOLBOX_EQUIP(ToolboxEquipPacket.class, ToolboxEquipPacket.STREAM_CODEC),
+ TOOLBOX_DISPOSE_ALL(ToolboxDisposeAllPacket.class, ToolboxDisposeAllPacket.STREAM_CODEC),
+ CONFIGURE_SCHEDULE(ScheduleEditPacket.class, ScheduleEditPacket.STREAM_CODEC),
+ CONFIGURE_STATION(StationEditPacket.class, StationEditPacket.STREAM_CODEC),
+ C_CONFIGURE_TRAIN(TrainEditPacket.Serverbound.class, TrainEditPacket.Serverbound.STREAM_CODEC),
+ RELOCATE_TRAIN(TrainRelocationPacket.class, TrainRelocationPacket.STREAM_CODEC),
+ CONTROLS_INPUT(ControlsInputPacket.class, ControlsInputPacket.STREAM_CODEC),
+ CONFIGURE_DATA_GATHERER(DisplayLinkConfigurationPacket.class, DisplayLinkConfigurationPacket.STREAM_CODEC),
+ DESTROY_CURVED_TRACK(CurvedTrackDestroyPacket.class, CurvedTrackDestroyPacket.STREAM_CODEC),
+ SELECT_CURVED_TRACK(CurvedTrackSelectionPacket.class, CurvedTrackSelectionPacket.STREAM_CODEC),
+ PLACE_CURVED_TRACK(PlaceExtendedCurvePacket.class, PlaceExtendedCurvePacket.STREAM_CODEC),
+ GLUE_IN_AREA(SuperGlueSelectionPacket.class, SuperGlueSelectionPacket.STREAM_CODEC),
+ GLUE_REMOVED(SuperGlueRemovalPacket.class, SuperGlueRemovalPacket.STREAM_CODEC),
+ TRAIN_COLLISION(TrainCollisionPacket.class, TrainCollisionPacket.STREAM_CODEC),
+ C_TRAIN_HUD(TrainHUDUpdatePacket.Serverbound.class, TrainHUDUpdatePacket.Serverbound.STREAM_CODEC),
+ C_TRAIN_HONK(HonkPacket.Serverbound.class, HonkPacket.Serverbound.STREAM_CODEC),
+ OBSERVER_STRESSOMETER(GaugeObservedPacket.class, GaugeObservedPacket.STREAM_CODEC),
+ EJECTOR_AWARD(EjectorAwardPacket.class, EjectorAwardPacket.STREAM_CODEC),
+ TRACK_GRAPH_REQUEST(TrackGraphRequestPacket.class, TrackGraphRequestPacket.STREAM_CODEC),
+ CONFIGURE_ELEVATOR_CONTACT(ElevatorContactEditPacket.class, ElevatorContactEditPacket.STREAM_CODEC),
+ REQUEST_FLOOR_LIST(ElevatorFloorListPacket.RequestFloorList.class, ElevatorFloorListPacket.RequestFloorList.STREAM_CODEC),
+ ELEVATOR_SET_FLOOR(ElevatorTargetFloorPacket.class, ElevatorTargetFloorPacket.STREAM_CODEC),
+ VALUE_SETTINGS(ValueSettingsPacket.class, ValueSettingsPacket.STREAM_CODEC),
+ CLIPBOARD_EDIT(ClipboardEditPacket.class, ClipboardEditPacket.STREAM_CODEC),
+ CONTRAPTION_COLLIDER_LOCK_REQUEST(ContraptionColliderLockPacketRequest.class, ContraptionColliderLockPacketRequest.STREAM_CODEC),
+ RADIAL_WRENCH_MENU_SUBMIT(RadialWrenchMenuSubmitPacket.class, RadialWrenchMenuSubmitPacket.STREAM_CODEC),
+ LOGISTICS_STOCK_REQUEST(LogisticalStockRequestPacket.class, LogisticalStockRequestPacket.STREAM_CODEC),
+ LOGISTICS_PACKAGE_REQUEST(PackageOrderRequestPacket.class, PackageOrderRequestPacket.STREAM_CODEC),
+ CHAIN_CONVEYOR_CONNECT(ChainConveyorConnectionPacket.class, ChainConveyorConnectionPacket.STREAM_CODEC),
+ CHAIN_CONVEYOR_RIDING(ServerboundChainConveyorRidingPacket.class, ServerboundChainConveyorRidingPacket.STREAM_CODEC),
+ CHAIN_PACKAGE_INTERACTION(ChainPackageInteractionPacket.class, ChainPackageInteractionPacket.STREAM_CODEC),
+ PACKAGE_PORT_CONFIGURATION(PackagePortConfigurationPacket.class, PackagePortConfigurationPacket.STREAM_CODEC),
+ TRAIN_MAP_REQUEST(TrainMapSyncRequestPacket.class, TrainMapSyncRequestPacket.STREAM_CODEC),
+ CONNECT_FACTORY_PANEL(FactoryPanelConnectionPacket.class, FactoryPanelConnectionPacket.STREAM_CODEC),
+ CONFIGURE_FACTORY_PANEL(FactoryPanelConfigurationPacket.class, FactoryPanelConfigurationPacket.STREAM_CODEC),
+ CONFIGURE_REDSTONE_REQUESTER(RedstoneRequesterConfigurationPacket.class, RedstoneRequesterConfigurationPacket.STREAM_CODEC),
+ CONFIGURE_STOCK_KEEPER_CATEGORIES(StockKeeperCategoryEditPacket.class, StockKeeperCategoryEditPacket.STREAM_CODEC),
+ REFUND_STOCK_KEEPER_CATEGORY(StockKeeperCategoryRefundPacket.class, StockKeeperCategoryRefundPacket.STREAM_CODEC),
+ LOCK_STOCK_KEEPER(StockKeeperLockPacket.class, StockKeeperLockPacket.STREAM_CODEC),
+ STOCK_KEEPER_HIDE_CATEGORY(StockKeeperCategoryHidingPacket.class, StockKeeperCategoryHidingPacket.STREAM_CODEC),
// Server to Client
- SYMMETRY_EFFECT(SymmetryEffectPacket.class, SymmetryEffectPacket::new, PLAY_TO_CLIENT),
- SERVER_SPEED(ServerSpeedProvider.Packet.class, ServerSpeedProvider.Packet::new, PLAY_TO_CLIENT),
- BEAM_EFFECT(ZapperBeamPacket.class, ZapperBeamPacket::new, PLAY_TO_CLIENT),
- CONTRAPTION_STALL(ContraptionStallPacket.class, ContraptionStallPacket::new, PLAY_TO_CLIENT),
- CONTRAPTION_DISASSEMBLE(ContraptionDisassemblyPacket.class, ContraptionDisassemblyPacket::new, PLAY_TO_CLIENT),
- CONTRAPTION_BLOCK_CHANGED(ContraptionBlockChangedPacket.class, ContraptionBlockChangedPacket::new, PLAY_TO_CLIENT),
- GLUE_EFFECT(GlueEffectPacket.class, GlueEffectPacket::new, PLAY_TO_CLIENT),
- CONTRAPTION_SEAT_MAPPING(ContraptionSeatMappingPacket.class, ContraptionSeatMappingPacket::new, PLAY_TO_CLIENT),
- LIMBSWING_UPDATE(LimbSwingUpdatePacket.class, LimbSwingUpdatePacket::new, PLAY_TO_CLIENT),
- MINECART_CONTROLLER(MinecartControllerUpdatePacket.class, MinecartControllerUpdatePacket::new, PLAY_TO_CLIENT),
- FLUID_SPLASH(FluidSplashPacket.class, FluidSplashPacket::new, PLAY_TO_CLIENT),
- CONTRAPTION_FLUID(ContraptionFluidPacket.class, ContraptionFluidPacket::new, PLAY_TO_CLIENT),
- GANTRY_UPDATE(GantryContraptionUpdatePacket.class, GantryContraptionUpdatePacket::new, PLAY_TO_CLIENT),
- BLOCK_HIGHLIGHT(HighlightPacket.class, HighlightPacket::new, PLAY_TO_CLIENT),
- TUNNEL_FLAP(TunnelFlapPacket.class, TunnelFlapPacket::new, PLAY_TO_CLIENT),
- FUNNEL_FLAP(FunnelFlapPacket.class, FunnelFlapPacket::new, PLAY_TO_CLIENT),
- POTATO_CANNON(PotatoCannonPacket.class, PotatoCannonPacket::new, PLAY_TO_CLIENT),
- SOUL_PULSE(SoulPulseEffectPacket.class, SoulPulseEffectPacket::new, PLAY_TO_CLIENT),
- PERSISTENT_DATA(ISyncPersistentData.PersistentDataPacket.class, ISyncPersistentData.PersistentDataPacket::new,
- PLAY_TO_CLIENT),
- SYNC_POTATO_PROJECTILE_TYPES(PotatoProjectileTypeManager.SyncPacket.class,
- PotatoProjectileTypeManager.SyncPacket::new, PLAY_TO_CLIENT),
- SYNC_RAIL_GRAPH(TrackGraphSyncPacket.class, TrackGraphSyncPacket::new, PLAY_TO_CLIENT),
- SYNC_EDGE_GROUP(SignalEdgeGroupPacket.class, SignalEdgeGroupPacket::new, PLAY_TO_CLIENT),
- SYNC_TRAIN(TrainPacket.class, TrainPacket::new, PLAY_TO_CLIENT),
- REMOVE_TE(RemoveBlockEntityPacket.class, RemoveBlockEntityPacket::new, PLAY_TO_CLIENT),
- S_CONFIGURE_TRAIN(TrainEditReturnPacket.class, TrainEditReturnPacket::new, PLAY_TO_CLIENT),
- CONTROLS_ABORT(ControlsStopControllingPacket.class, ControlsStopControllingPacket::new, PLAY_TO_CLIENT),
- S_TRAIN_HUD(TrainHUDUpdatePacket.class, TrainHUDUpdatePacket::new, PLAY_TO_CLIENT),
- S_TRAIN_HONK(HonkPacket.class, HonkPacket::new, PLAY_TO_CLIENT),
- S_TRAIN_PROMPT(TrainPromptPacket.class, TrainPromptPacket::new, PLAY_TO_CLIENT),
- CONTRAPTION_RELOCATION(ContraptionRelocationPacket.class, ContraptionRelocationPacket::new, PLAY_TO_CLIENT),
- TRACK_GRAPH_ROLL_CALL(TrackGraphRollCallPacket.class, TrackGraphRollCallPacket::new, PLAY_TO_CLIENT),
- S_PLACE_EJECTOR(ArmPlacementPacket.ClientBoundRequest.class, ArmPlacementPacket.ClientBoundRequest::new,
- PLAY_TO_CLIENT),
- S_PLACE_ARM(EjectorPlacementPacket.ClientBoundRequest.class, EjectorPlacementPacket.ClientBoundRequest::new,
- PLAY_TO_CLIENT),
- S_PLACE_PACKAGE_PORT(PackagePortPlacementPacket.ClientBoundRequest.class, PackagePortPlacementPacket.ClientBoundRequest::new,
- PLAY_TO_CLIENT),
- UPDATE_ELEVATOR_FLOORS(ElevatorFloorListPacket.class, ElevatorFloorListPacket::new, PLAY_TO_CLIENT),
- CONTRAPTION_ACTOR_TOGGLE(ContraptionDisableActorPacket.class, ContraptionDisableActorPacket::new, PLAY_TO_CLIENT),
- CONTRAPTION_COLLIDER_LOCK(ContraptionColliderLockPacket.class, ContraptionColliderLockPacket::new, PLAY_TO_CLIENT),
- ATTACHED_COMPUTER(AttachedComputerPacket.class, AttachedComputerPacket::new, PLAY_TO_CLIENT),
- SERVER_DEBUG_INFO(ServerDebugInfoPacket.class, ServerDebugInfoPacket::new, PLAY_TO_CLIENT),
- PACKAGE_DESTROYED(PackageDestroyPacket.class, PackageDestroyPacket::new, PLAY_TO_CLIENT),
- LOGISTICS_STOCK_RESPONSE(LogisticalStockResponsePacket.class, LogisticalStockResponsePacket::new, PLAY_TO_CLIENT),
- FACTORY_PANEL_EFFECT(FactoryPanelEffectPacket.class, FactoryPanelEffectPacket::new, PLAY_TO_CLIENT),
- PACKAGER_LINK_EFFECT(PackagerLinkEffectPacket.class, PackagerLinkEffectPacket::new, PLAY_TO_CLIENT),
- REDSTONE_REQUESTER_EFFECT(RedstoneRequesterEffectPacket.class, RedstoneRequesterEffectPacket::new, PLAY_TO_CLIENT),
- KNOCKBACK(KnockbackPacket.class, KnockbackPacket::new, PLAY_TO_CLIENT),
- TRAIN_MAP_SYNC(TrainMapSyncPacket.class, TrainMapSyncPacket::new, PLAY_TO_CLIENT),
- CLIENTBOUND_CHAIN_CONVEYOR(ClientboundChainConveyorRidingPacket.class, ClientboundChainConveyorRidingPacket::new, PLAY_TO_CLIENT);
+ SYMMETRY_EFFECT(SymmetryEffectPacket.class, SymmetryEffectPacket.STREAM_CODEC),
+ SERVER_SPEED(ServerSpeedProvider.Packet.class, ServerSpeedProvider.Packet.STREAM_CODEC),
+ BEAM_EFFECT(ZapperBeamPacket.class, ZapperBeamPacket.STREAM_CODEC),
+ CONTRAPTION_STALL(ContraptionStallPacket.class, ContraptionStallPacket.STREAM_CODEC),
+ CONTRAPTION_DISASSEMBLE(ContraptionDisassemblyPacket.class, ContraptionDisassemblyPacket.STREAM_CODEC),
+ CONTRAPTION_BLOCK_CHANGED(ContraptionBlockChangedPacket.class, ContraptionBlockChangedPacket.STREAM_CODEC),
+ GLUE_EFFECT(GlueEffectPacket.class, GlueEffectPacket.STREAM_CODEC),
+ CONTRAPTION_SEAT_MAPPING(ContraptionSeatMappingPacket.class, ContraptionSeatMappingPacket.STREAM_CODEC),
+ LIMBSWING_UPDATE(LimbSwingUpdatePacket.class, LimbSwingUpdatePacket.STREAM_CODEC),
+ MINECART_CONTROLLER(MinecartControllerUpdatePacket.class, MinecartControllerUpdatePacket.STREAM_CODEC),
+ FLUID_SPLASH(FluidSplashPacket.class, FluidSplashPacket.STREAM_CODEC),
+ CONTRAPTION_FLUID(ContraptionFluidPacket.class, ContraptionFluidPacket.STREAM_CODEC),
+ GANTRY_UPDATE(GantryContraptionUpdatePacket.class, GantryContraptionUpdatePacket.STREAM_CODEC),
+ BLOCK_HIGHLIGHT(HighlightPacket.class, HighlightPacket.STREAM_CODEC),
+ TUNNEL_FLAP(TunnelFlapPacket.class, TunnelFlapPacket.STREAM_CODEC),
+ FUNNEL_FLAP(FunnelFlapPacket.class, FunnelFlapPacket.STREAM_CODEC),
+ POTATO_CANNON(PotatoCannonPacket.class, PotatoCannonPacket.STREAM_CODEC),
+ SOUL_PULSE(SoulPulseEffectPacket.class, SoulPulseEffectPacket.STREAM_CODEC),
+ PERSISTENT_DATA(ISyncPersistentData.PersistentDataPacket.class, ISyncPersistentData.PersistentDataPacket.STREAM_CODEC),
+ SYNC_POTATO_PROJECTILE_TYPES(PotatoProjectileTypeManager.SyncPacket.class, PotatoProjectileTypeManager.SyncPacket.STREAM_CODEC),
+ SYNC_RAIL_GRAPH(TrackGraphSyncPacket.class, TrackGraphSyncPacket.STREAM_CODEC),
+ SYNC_EDGE_GROUP(SignalEdgeGroupPacket.class, SignalEdgeGroupPacket.STREAM_CODEC),
+ ADD_TRAIN(AddTrainPacket.class, AddTrainPacket.STREAM_CODEC),
+ REMOVE_TRAIN(RemoveTrainPacket.class, RemoveTrainPacket.STREAM_CODEC),
+ REMOVE_TE(RemoveBlockEntityPacket.class, RemoveBlockEntityPacket.STREAM_CODEC),
+ S_CONFIGURE_TRAIN(TrainEditReturnPacket.class, TrainEditReturnPacket.STREAM_CODEC),
+ CONTROLS_ABORT(ControlsStopControllingPacket.class, ControlsStopControllingPacket.STREAM_CODEC),
+ S_TRAIN_HUD(TrainHUDUpdatePacket.Clientbound.class, TrainHUDUpdatePacket.Clientbound.STREAM_CODEC),
+ S_TRAIN_HONK(HonkPacket.Clientbound.class, HonkPacket.Clientbound.STREAM_CODEC),
+ S_TRAIN_PROMPT(TrainPromptPacket.class, TrainPromptPacket.STREAM_CODEC),
+ CONTRAPTION_RELOCATION(ContraptionRelocationPacket.class, ContraptionRelocationPacket.STREAM_CODEC),
+ TRACK_GRAPH_ROLL_CALL(TrackGraphRollCallPacket.class, TrackGraphRollCallPacket.STREAM_CODEC),
+ S_PLACE_ARM(ArmPlacementPacket.ClientBoundRequest.class, ArmPlacementPacket.ClientBoundRequest.STREAM_CODEC),
+ S_PLACE_EJECTOR(EjectorPlacementPacket.ClientBoundRequest.class, EjectorPlacementPacket.ClientBoundRequest.STREAM_CODEC),
+ S_PLACE_PACKAGE_PORT(PackagePortPlacementPacket.ClientBoundRequest.class, PackagePortPlacementPacket.ClientBoundRequest.STREAM_CODEC),
+ UPDATE_ELEVATOR_FLOORS(ElevatorFloorListPacket.class, ElevatorFloorListPacket.STREAM_CODEC),
+ CONTRAPTION_ACTOR_TOGGLE(ContraptionDisableActorPacket.class, ContraptionDisableActorPacket.STREAM_CODEC),
+ CONTRAPTION_COLLIDER_LOCK(ContraptionColliderLockPacket.class, ContraptionColliderLockPacket.STREAM_CODEC),
+ ATTACHED_COMPUTER(AttachedComputerPacket.class, AttachedComputerPacket.STREAM_CODEC),
+ SERVER_DEBUG_INFO(ServerDebugInfoPacket.class, ServerDebugInfoPacket.STREAM_CODEC),
+ PACKAGE_DESTROYED(PackageDestroyPacket.class, PackageDestroyPacket.STREAM_CODEC),
+ LOGISTICS_STOCK_RESPONSE(LogisticalStockResponsePacket.class, LogisticalStockResponsePacket.STREAM_CODEC),
+ FACTORY_PANEL_EFFECT(FactoryPanelEffectPacket.class, FactoryPanelEffectPacket.STREAM_CODEC),
+ PACKAGER_LINK_EFFECT(PackagerLinkEffectPacket.class, PackagerLinkEffectPacket.STREAM_CODEC),
+ REDSTONE_REQUESTER_EFFECT(RedstoneRequesterEffectPacket.class, RedstoneRequesterEffectPacket.STREAM_CODEC),
+ KNOCKBACK(KnockbackPacket.class, KnockbackPacket.STREAM_CODEC),
+ TRAIN_MAP_SYNC(TrainMapSyncPacket.class, TrainMapSyncPacket.STREAM_CODEC),
+ CLIENTBOUND_CHAIN_CONVEYOR(ClientboundChainConveyorRidingPacket.class, ClientboundChainConveyorRidingPacket.STREAM_CODEC)
+ ;
static {
ClientboundSimpleActionPacket.addAction("rainbowDebug", () -> SimpleCreateActions::rainbowDebug);
@@ -271,68 +251,27 @@ public enum AllPackets {
ClientboundSimpleActionPacket.addAction("camAngleFunction", () -> SimpleCreateActions::camAngleFunction);
}
- public static final ResourceLocation CHANNEL_NAME = Create.asResource("main");
- public static final int NETWORK_VERSION = 3;
- public static final String NETWORK_VERSION_STR = String.valueOf(NETWORK_VERSION);
- private static SimpleChannel channel;
+ private final CatnipPacketRegistry.PacketType> type;
- private PacketType> packetType;
-
- AllPackets(Class type, Function factory,
- NetworkDirection direction) {
- packetType = new PacketType<>(type, factory, direction);
+ AllPackets(Class clazz, StreamCodec super RegistryFriendlyByteBuf, T> codec) {
+ String name = this.name().toLowerCase(Locale.ROOT);
+ this.type = new CatnipPacketRegistry.PacketType<>(
+ new CustomPacketPayload.Type<>(Create.asResource(name)),
+ clazz, codec
+ );
}
- public static void registerPackets() {
- channel = NetworkRegistry.ChannelBuilder.named(CHANNEL_NAME)
- .serverAcceptedVersions(NETWORK_VERSION_STR::equals)
- .clientAcceptedVersions(NETWORK_VERSION_STR::equals)
- .networkProtocolVersion(() -> NETWORK_VERSION_STR)
- .simpleChannel();
-
- for (AllPackets packet : values())
- packet.packetType.register();
+ @Override
+ @SuppressWarnings("unchecked")
+ public CustomPacketPayload.Type getType() {
+ return (CustomPacketPayload.Type) this.type.type();
}
- public static SimpleChannel getChannel() {
- return channel;
- }
-
- public static void sendToNear(Level world, BlockPos pos, int range, Object message) {
- getChannel().send(
- PacketDistributor.NEAR.with(TargetPoint.p(pos.getX(), pos.getY(), pos.getZ(), range, world.dimension())),
- message);
- }
-
- private static class PacketType {
- private static int index = 0;
-
- private BiConsumer encoder;
- private Function decoder;
- private BiConsumer> handler;
- private Class type;
- private NetworkDirection direction;
-
- private PacketType(Class type, Function factory, NetworkDirection direction) {
- encoder = T::write;
- decoder = factory;
- handler = (packet, contextSupplier) -> {
- Context context = contextSupplier.get();
- if (packet.handle(context)) {
- context.setPacketHandled(true);
- }
- };
- this.type = type;
- this.direction = direction;
- }
-
- private void register() {
- getChannel().messageBuilder(type, index++, direction)
- .encoder(encoder)
- .decoder(decoder)
- .consumerNetworkThread(handler)
- .add();
+ public static void register() {
+ CatnipPacketRegistry packetRegistry = new CatnipPacketRegistry(Create.ID, 1);
+ for (AllPackets packet : AllPackets.values()) {
+ packetRegistry.registerPacket(packet.type);
}
+ packetRegistry.registerAllPackets();
}
-
}
diff --git a/src/main/java/com/simibubi/create/AllParticleTypes.java b/src/main/java/com/simibubi/create/AllParticleTypes.java
index 7cb2b0a653..0b90cfb1a0 100644
--- a/src/main/java/com/simibubi/create/AllParticleTypes.java
+++ b/src/main/java/com/simibubi/create/AllParticleTypes.java
@@ -15,16 +15,15 @@ import com.simibubi.create.foundation.particle.ICustomParticleData;
import net.createmod.catnip.utility.lang.Lang;
import net.minecraft.core.particles.ParticleOptions;
import net.minecraft.core.particles.ParticleType;
-import net.minecraftforge.api.distmarker.Dist;
-import net.minecraftforge.api.distmarker.OnlyIn;
-import net.minecraftforge.client.event.RegisterParticleProvidersEvent;
-import net.minecraftforge.eventbus.api.IEventBus;
-import net.minecraftforge.registries.DeferredRegister;
-import net.minecraftforge.registries.ForgeRegistries;
-import net.minecraftforge.registries.RegistryObject;
+import net.minecraft.core.registries.Registries;
+import net.neoforged.api.distmarker.Dist;
+import net.neoforged.api.distmarker.OnlyIn;
+import net.neoforged.bus.api.IEventBus;
+import net.neoforged.neoforge.client.event.RegisterParticleProvidersEvent;
+import net.neoforged.neoforge.registries.DeferredHolder;
+import net.neoforged.neoforge.registries.DeferredRegister;
public enum AllParticleTypes {
-
ROTATION_INDICATOR(RotationIndicatorParticleData::new),
AIR_FLOW(AirFlowParticleData::new),
AIR(AirParticleData::new),
@@ -64,11 +63,11 @@ public enum AllParticleTypes {
}
private static class ParticleEntry {
- private static final DeferredRegister> REGISTER = DeferredRegister.create(ForgeRegistries.PARTICLE_TYPES, Create.ID);
+ private static final DeferredRegister> REGISTER = DeferredRegister.create(Registries.PARTICLE_TYPE, Create.ID);
private final String name;
private final Supplier extends ICustomParticleData> typeFactory;
- private final RegistryObject> object;
+ private final DeferredHolder, ParticleType> object;
public ParticleEntry(String name, Supplier extends ICustomParticleData> typeFactory) {
this.name = name;
@@ -84,5 +83,4 @@ public enum AllParticleTypes {
}
}
-
}
diff --git a/src/main/java/com/simibubi/create/AllRecipeTypes.java b/src/main/java/com/simibubi/create/AllRecipeTypes.java
index 058cd6c84f..c77e57aa92 100644
--- a/src/main/java/com/simibubi/create/AllRecipeTypes.java
+++ b/src/main/java/com/simibubi/create/AllRecipeTypes.java
@@ -4,8 +4,11 @@ import java.util.Optional;
import java.util.function.Predicate;
import java.util.function.Supplier;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import com.mojang.serialization.Codec;
+import com.mojang.serialization.MapCodec;
import com.simibubi.create.compat.jei.ConversionRecipe;
import com.simibubi.create.content.equipment.sandPaper.SandPaperPolishingRecipe;
import com.simibubi.create.content.equipment.toolbox.ToolboxDyeingRecipe;
@@ -14,6 +17,7 @@ import com.simibubi.create.content.fluids.transfer.FillingRecipe;
import com.simibubi.create.content.kinetics.crafter.MechanicalCraftingRecipe;
import com.simibubi.create.content.kinetics.crusher.CrushingRecipe;
import com.simibubi.create.content.kinetics.deployer.DeployerApplicationRecipe;
+import com.simibubi.create.content.kinetics.deployer.ItemApplicationRecipe;
import com.simibubi.create.content.kinetics.deployer.ManualApplicationRecipe;
import com.simibubi.create.content.kinetics.fan.processing.HauntingRecipe;
import com.simibubi.create.content.kinetics.fan.processing.SplashingRecipe;
@@ -23,27 +27,30 @@ import com.simibubi.create.content.kinetics.mixer.MixingRecipe;
import com.simibubi.create.content.kinetics.press.PressingRecipe;
import com.simibubi.create.content.kinetics.saw.CuttingRecipe;
import com.simibubi.create.content.processing.basin.BasinRecipe;
+import com.simibubi.create.content.processing.recipe.ProcessingRecipe;
import com.simibubi.create.content.processing.recipe.ProcessingRecipeBuilder.ProcessingRecipeFactory;
import com.simibubi.create.content.processing.recipe.ProcessingRecipeSerializer;
import com.simibubi.create.content.processing.sequenced.SequencedAssemblyRecipeSerializer;
import com.simibubi.create.foundation.recipe.IRecipeTypeInfo;
import net.createmod.catnip.utility.lang.Lang;
+import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceLocation;
-import net.minecraft.world.Container;
+import net.minecraft.util.StringRepresentable;
import net.minecraft.world.item.crafting.Recipe;
+import net.minecraft.world.item.crafting.RecipeHolder;
+import net.minecraft.world.item.crafting.RecipeInput;
import net.minecraft.world.item.crafting.RecipeSerializer;
import net.minecraft.world.item.crafting.RecipeType;
-import net.minecraft.world.item.crafting.ShapedRecipe;
+import net.minecraft.world.item.crafting.ShapedRecipePattern;
import net.minecraft.world.item.crafting.SimpleCraftingRecipeSerializer;
import net.minecraft.world.level.Level;
-import net.minecraftforge.eventbus.api.IEventBus;
-import net.minecraftforge.registries.DeferredRegister;
-import net.minecraftforge.registries.ForgeRegistries;
-import net.minecraftforge.registries.RegistryObject;
+import net.neoforged.bus.api.IEventBus;
+import net.neoforged.neoforge.registries.DeferredHolder;
+import net.neoforged.neoforge.registries.DeferredRegister;
-public enum AllRecipeTypes implements IRecipeTypeInfo {
+public enum AllRecipeTypes implements IRecipeTypeInfo, StringRepresentable {
CONVERSION(ConversionRecipe::new),
CRUSHING(CrushingRecipe::new),
@@ -66,19 +73,25 @@ public enum AllRecipeTypes implements IRecipeTypeInfo {
TOOLBOX_DYEING(() -> new SimpleCraftingRecipeSerializer<>(ToolboxDyeingRecipe::new), () -> RecipeType.CRAFTING, false);
- public static final Predicate super Recipe>> CAN_BE_AUTOMATED = r -> !r.getId()
- .getPath()
- .endsWith("_manual_only");
+ public static final Predicate> CAN_BE_AUTOMATED = r -> !r.id()
+ .getPath()
+ .endsWith("_manual_only");
- private final ResourceLocation id;
- private final RegistryObject> serializerObject;
+ public final ResourceLocation id;
+ public final Supplier> serializerSupplier;
+ private final DeferredHolder, RecipeSerializer>> serializerObject;
@Nullable
- private final RegistryObject> typeObject;
+ private final DeferredHolder, RecipeType>> typeObject;
private final Supplier> type;
+ private boolean isProcessingRecipe;
+
+ public static final Codec CODEC = StringRepresentable.fromEnum(AllRecipeTypes::values);
+
AllRecipeTypes(Supplier> serializerSupplier, Supplier