diff --git a/.env.template b/.env.template new file mode 100644 index 00000000..78313993 --- /dev/null +++ b/.env.template @@ -0,0 +1,2 @@ +MODRINTH_API_KEY= +CURSEFORGE_API_KEY= \ No newline at end of file diff --git a/.gitignore b/.gitignore index 31d25505..1a841a52 100644 --- a/.gitignore +++ b/.gitignore @@ -1,26 +1,50 @@ -# eclipse -bin -*.launch -.settings -.metadata -.classpath -.project +.env +.gradle +.kotlin +.cache/ +build/ +!gradle/wrapper/gradle-wrapper.jar +!**/src/main/**/build/ +!**/src/test/**/build/ -# idea -out -*.ipr +run/ + +### IntelliJ IDEA ### +.idea/modules.xml +.idea/jarRepositories.xml +.idea/compiler.xml +.idea/libraries/ *.iws *.iml -.idea +*.ipr +out/ +!**/src/main/**/out/ +!**/src/test/**/out/ -# gradle -build -.gradle +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache +bin/ +!**/src/main/**/bin/ +!**/src/test/**/bin/ + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ + +### VS Code ### +.vscode/ -# other -eclipse -run -runs -run-data +### Mac OS ### +.DS_Store -repo \ No newline at end of file +### Jetbrains ### +.idea/ \ No newline at end of file diff --git a/build.fabric.gradle.kts b/build.fabric.gradle.kts new file mode 100644 index 00000000..ca3e4b89 --- /dev/null +++ b/build.fabric.gradle.kts @@ -0,0 +1,143 @@ +@file:Suppress("UnstableApiUsage") + +plugins { + id("net.fabricmc.fabric-loom") + id("dev.kikugie.postprocess.jsonlang") + id("me.modmuss50.mod-publish-plugin") +} + +tasks.named("processResources") { + fun prop(name: String) = project.property(name) as String + + val props = HashMap().apply { + this["mod_version"] = prop("mod.version") + this["minecraft"] = prop("deps.minecraft") + this["mod_id"] = prop("mod.id") + this["mod_name"] = prop("mod.name") + this["mod_description"] = prop("mod.description") + this["mod_authors"] = prop("mod.authors") + this["mod_license"] = prop("mod.license") + this["minecraft_version_range"] = prop("deps.minecraft_version_range") + } + + filesMatching(listOf("fabric.mod.json", "META-INF/neoforge.mods.toml", "META-INF/mods.toml")) { + expand(props) + } +} + +version = "${property("mod.version")}+${property("deps.minecraft")}-fabric" +base.archivesName = property("mod.id") as String + +loom { + accessWidenerPath = rootProject.file("src/main/resources/${property("mod.id")}.accesswidener") +} + +sourceSets { + main { + resources { + srcDir("src/generated/resources") + } + } +} + +jsonlang { + languageDirectories = listOf("assets/${property("mod.id")}/lang") + prettyPrint = true +} + +repositories { + mavenLocal() + exclusiveContent { + forRepository { + maven { + name = "Fuzs Mod Resources" + url = uri("https://raw.githubusercontent.com/Fuzss/modresources/main/maven/") + } + } + filter { + includeGroupAndSubgroups("fuzs") + } + } + maven { + // location of the maven that hosts JEI files since January 2023 + name = "Jared's maven" + url = uri("https://maven.blamejared.com/") + content { + includeGroupAndSubgroups("mezz.jei") + } + } + maven { + name = "Terraformers (Mod Menu)" + url = uri("https://maven.terraformersmc.com/releases/") + content { + includeGroupAndSubgroups("com.terraformersmc") + } + } +} + +dependencies { + minecraft("com.mojang:minecraft:${property("deps.minecraft")}") + implementation("net.fabricmc:fabric-loader:${property("deps.fabric-loader")}") + implementation("net.fabricmc.fabric-api:fabric-api:${property("deps.fabric-api")}") + implementation("fuzs.forgeconfigapiport:forgeconfigapiport-fabric:${property("deps.forge_config_api_port")}") + compileOnly("mezz.jei:jei-${property("deps.minecraft")}-common-api:${property("deps.jei")}") + compileOnly("mezz.jei:jei-${property("deps.minecraft")}-fabric-api:${property("deps.jei")}") + // We add the full version to localRuntime, not runtimeOnly, so that we do not publish a dependency on it + localRuntime("mezz.jei:jei-${property("deps.minecraft")}-fabric:${property("deps.jei")}") + compileOnly("com.terraformersmc:modmenu:${property("deps.modmenu")}") + runtimeOnly("com.terraformersmc:modmenu:${property("deps.modmenu")}") +} + +tasks { + processResources { + exclude("**/neoforge.mods.toml", "**/mods.toml") + } + + register("buildAndCollect") { + group = "build" + from(jar.map { it.archiveFile }) + into(rootProject.layout.buildDirectory.file("libs/${project.property("mod.version")}")) + dependsOn("build") + } +} + +java { + withSourcesJar() + val javaCompat = JavaVersion.VERSION_25 + sourceCompatibility = javaCompat + targetCompatibility = javaCompat +} + +val additionalVersionsStr = findProperty("publish.additionalVersions") as String? +val additionalVersions: List = additionalVersionsStr + ?.split(",") + ?.map { it.trim() } + ?.filter { it.isNotEmpty() } + ?: emptyList() + +publishMods { + file = tasks.jar.map { it.archiveFile.get() } + additionalFiles.from(tasks.named("sourcesJar").map { it.archiveFile.get() }) + + type = BETA + displayName = "${property("mod.name")} ${property("mod.version")} for ${stonecutter.current.version} Fabric" + version = "${property("mod.version")}+${property("deps.minecraft")}-fabric" + changelog = provider { rootProject.file("changelog.md").readText() } + modLoaders.add("fabric") + + modrinth { + projectId = property("publish.modrinth") as String + accessToken = env.MODRINTH_API_KEY.orNull() + minecraftVersions.add(stonecutter.current.version) + minecraftVersions.addAll(additionalVersions) + requires("fabric-api") + } + + curseforge { + projectId = property("publish.curseforge") as String + accessToken = env.CURSEFORGE_API_KEY.orNull() + minecraftVersions.add(stonecutter.current.version) + minecraftVersions.addAll(additionalVersions) + requires("fabric-api") + } +} diff --git a/build.gradle b/build.gradle deleted file mode 100644 index f91ab364..00000000 --- a/build.gradle +++ /dev/null @@ -1,194 +0,0 @@ -plugins { - id 'java-library' - id 'maven-publish' - id 'net.neoforged.moddev' version '2.0.141' - id 'idea' -} - -tasks.named('wrapper', Wrapper).configure { - // Define wrapper values here so as to not have to always do so when updating gradlew.properties. - // Switching this to Wrapper.DistributionType.ALL will download the full gradle sources that comes with - // documentation attached on cursor hover of gradle classes and methods. However, this comes with increased - // file size for Gradle. If you do switch this to ALL, run the Gradle wrapper task twice afterwards. - // (Verify by checking gradle/wrapper/gradle-wrapper.properties to see if distributionUrl now points to `-all`) - distributionType = Wrapper.DistributionType.BIN -} - -version = mod_version -group = mod_group_id - -repositories { - mavenLocal() - maven { - // location of the maven that hosts JEI files since January 2023 - 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" - } -} - -base { - archivesName = "BlockBox-${minecraft_version}" -} - -// Mojang ships Java 25 to end users starting in 26.1, so mods should target Java 25. -java.toolchain.languageVersion = JavaLanguageVersion.of(25) - -neoForge { - // Specify the version of NeoForge to use. - version = project.neo_version - - // This line is optional. Access Transformers are automatically detected - accessTransformers = project.files('src/main/templates/META-INF/accesstransformer.cfg') - - // Default run configurations. - // These can be tweaked, removed, or duplicated as needed. - runs { - client { - client() - - // Comma-separated list of namespaces to load gametests from. Empty = all namespaces. - systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id - } - - server { - 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 { - clientData() - - // example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it - // gameDirectory = project.file('run-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() - } - - // applies to all the run configs above - configureEach { - // Recommended logging data for a userdev environment - // The markers can be added/remove as needed separated by commas. - // "SCAN": For mods scan. - // "REGISTRIES": For firing of registry events. - // "REGISTRYDUMP": For getting the contents of all registries. - systemProperty 'forge.logging.markers', 'REGISTRIES' - - // Recommended logging level for the console - // You can set various levels here. - // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels - logLevel = org.slf4j.event.Level.DEBUG - } - } - - mods { - // define mod <-> source bindings - // these are used to tell the game which sources are for which mod - // multi mod projects should define one per mod - "${mod_id}" { - sourceSet(sourceSets.main) - } - } -} - -// Include resources generated by data generators. -sourceSets.main.resources { srcDir 'src/generated/resources' } - -// Sets up a dependency configuration called 'localRuntime'. -// This configuration should be used instead of 'runtimeOnly' to declare -// a dependency that will be present for runtime testing but that is -// "optional", meaning it will not be pulled by dependents of this mod. -configurations { - runtimeClasspath.extendsFrom localRuntime -} - -dependencies { - // Example optional mod dependency with JEI - // The JEI API is declared for compile time use, while the full JEI artifact is used at runtime - compileOnly "mezz.jei:jei-${jei_minecraft_version}-common-api:${jei_version}" - compileOnly "mezz.jei:jei-${jei_minecraft_version}-neoforge-api:${jei_version}" - // We add the full version to localRuntime, not runtimeOnly, so that we do not publish a dependency on it - localRuntime "mezz.jei:jei-${jei_minecraft_version}-neoforge:${jei_version}" - - // Example mod dependency using a mod jar from ./libs with a flat dir repository - // This maps to ./libs/coolmod-${mc_version}-${coolmod_version}.jar - // The group id is ignored when searching -- in this case, it is "blank" - // implementation "blank:coolmod-${mc_version}:${coolmod_version}" - - // Example mod dependency using a file as dependency - // implementation files("libs/coolmod-${mc_version}-${coolmod_version}.jar") - - // Example project dependency using a sister or child project: - // implementation project(":myproject") - - // For more info: - // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html - // http://www.gradle.org/docs/current/userguide/dependency_management.html -} - -// This block of code expands all declared replace properties in the specified resource targets. -// A missing property will result in an error. Properties are expanded using ${} Groovy notation. -var generateModMetadata = tasks.register("generateModMetadata", ProcessResources) { - var replaceProperties = [ - minecraft_version : minecraft_version, - minecraft_version_range: minecraft_version_range, - neo_version : neo_version, - neo_version_range : neo_version_range, - loader_version_range : loader_version_range, - mod_id : mod_id, - mod_name : mod_name, - mod_license : mod_license, - mod_version : mod_version, - mod_authors : mod_authors, - mod_description : mod_description - ] - inputs.properties replaceProperties - expand replaceProperties - from "src/main/templates" - into "build/generated/sources/modMetadata" -} -// Include the output of "generateModMetadata" as an input directory for the build -// this works with both building through Gradle and the IDE. -sourceSets.main.resources.srcDir generateModMetadata -// To avoid having to run "generateModMetadata" manually, make it run on every project reload -neoForge.ideSyncTask generateModMetadata - -// Example configuration to allow publishing using the maven-publish plugin -publishing { - publications { - register('mavenJava', MavenPublication) { - from components.java - } - } - repositories { - maven { - url "file://${project.projectDir}/repo" - } - } -} - -tasks.withType(JavaCompile).configureEach { - options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation -} - -// IDEA no longer automatically downloads sources/javadoc jars for dependencies, so we need to explicitly enable the behavior. -idea { - module { - downloadSources = true - downloadJavadoc = true - } -} diff --git a/build.neoforge.gradle.kts b/build.neoforge.gradle.kts new file mode 100644 index 00000000..e342b209 --- /dev/null +++ b/build.neoforge.gradle.kts @@ -0,0 +1,154 @@ +plugins { + id("net.neoforged.moddev") + id ("dev.kikugie.postprocess.jsonlang") + id("me.modmuss50.mod-publish-plugin") +} + +tasks.named("processResources") { + fun prop(name: String) = project.property(name) as String + + val props = HashMap().apply { + this["mod_version"] = prop("mod.version") + this["minecraft"] = prop("deps.minecraft") + this["mod_id"] = prop("mod.id") + this["mod_name"] = prop("mod.name") + this["mod_description"] = prop("mod.description") + this["mod_authors"] = prop("mod.authors") + this["mod_license"] = prop("mod.license") + this["loader_version_range"] = "[1,)" + this["neo_version_range"] = "[26.1,26.2)" + this["minecraft_version_range"] = prop("deps.minecraft_version_range") + } + + filesMatching(listOf("fabric.mod.json", "META-INF/neoforge.mods.toml", "META-INF/mods.toml")) { + expand(props) + } +} + +version = "${property("mod.version")}+${property("deps.minecraft")}-neoforge" +base.archivesName = property("mod.id") as String + +jsonlang { + languageDirectories = listOf("assets/${property("mod.id")}/lang") + prettyPrint = true +} + +repositories { + maven("https://maven.parchmentmc.org") { name = "ParchmentMC" } +} + +neoForge { + version = property("deps.neoforge") as String + validateAccessTransformers = true + + if (hasProperty("deps.parchment")) parchment { + val (mc, ver) = (property("deps.parchment") as String).split(':') + mappingsVersion = ver + minecraftVersion = mc + } + + runs { + register("client") { + gameDirectory = file("run/") + client() + } + register("server") { + gameDirectory = file("run/") + server() + } + register("clientData") { + clientData() +// gameDirectory = file("run/") + programArguments.addAll("--mod", property("mod.id").toString(), + "--all", "--output", file("$rootDir/src/generated/resources").getAbsolutePath(), "--existing", file("$rootDir/src/generated/resources").getAbsolutePath()) + } + } + + mods { + register(property("mod.id") as String) { + sourceSet(sourceSets["main"]) + } + } + sourceSets["main"].resources.srcDir("src/generated") +} +sourceSets { + main { + resources { + srcDir("src/generated/resources") + } + } +} + +repositories { + maven { + // location of the maven that hosts JEI files since January 2023 + name = "Jared's maven" + url = uri("https://maven.blamejared.com/") + content { + includeGroupAndSubgroups("mezz.jei") + } + } +} + +dependencies { + compileOnly("mezz.jei:jei-${property("deps.minecraft")}-common-api:${property("deps.jei")}") + compileOnly("mezz.jei:jei-${property("deps.minecraft")}-neoforge-api:${property("deps.jei")}") + // We add the full version to localRuntime, not runtimeOnly, so that we do not publish a dependency on it + runtimeOnly("mezz.jei:jei-${property("deps.minecraft")}-neoforge:${property("deps.jei")}") +} + +tasks { + processResources { + exclude("**/fabric.mod.json", "**/*.accesswidener", "**/mods.toml") + } + + named("createMinecraftArtifacts") { + dependsOn("stonecutterGenerate") + } + + register("buildAndCollect") { + group = "build" + from(jar.map { it.archiveFile }) + into(rootProject.layout.buildDirectory.file("libs/${project.property("mod.version")}")) + dependsOn("build") + } +} + +java { + withSourcesJar() + val javaCompat = JavaVersion.VERSION_25 + sourceCompatibility = javaCompat + targetCompatibility = javaCompat +} + +val additionalVersionsStr = findProperty("publish.additionalVersions") as String? +val additionalVersions: List = additionalVersionsStr + ?.split(",") + ?.map { it.trim() } + ?.filter { it.isNotEmpty() } + ?: emptyList() + +publishMods { + file = tasks.jar.map { it.archiveFile.get() } + additionalFiles.from(tasks.named("sourcesJar").map { it.archiveFile.get() }) + + type = BETA + displayName = "${property("mod.name")} ${property("mod.version")} for ${stonecutter.current.version} Neoforge" + version = "${property("mod.version")}+${property("deps.minecraft")}-neoforge" + changelog = provider { rootProject.file("changelog.md").readText() } + modLoaders.add("neoforge") + + modrinth { + projectId = property("publish.modrinth") as String + accessToken = env.MODRINTH_API_KEY.orNull() + minecraftVersions.add(stonecutter.current.version) + minecraftVersions.addAll(additionalVersions) + } + + curseforge { + projectId = property("publish.curseforge") as String + accessToken = env.CURSEFORGE_API_KEY.orNull() + minecraftVersions.add(stonecutter.current.version) + minecraftVersions.addAll(additionalVersions) + } +} diff --git a/gradle.properties b/gradle.properties index 04bee837..6624522f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,28 +1,26 @@ -# Sets default memory used for gradle commands. Can be overridden by user or command line properties. -org.gradle.jvmargs=-Xmx1G -org.gradle.daemon=true +org.gradle.jvmargs=-Xmx2G org.gradle.parallel=true -org.gradle.caching=true org.gradle.configuration-cache=true # Environment Properties # You can find the latest versions here: https://projects.neoforged.net/neoforged/neoforge # The Minecraft version must agree with the Neo version to get a valid artifact -minecraft_version=26.1.2 -minecraft_version_range=[26.1.2,26.2) -neo_version=26.1.2.12-beta -neo_version_range=[26.1.2.12-beta,) -loader_version_range=[1,) +deps.minecraft=[VERSIONED] +deps.neoforge=[VERSIONED] +deps.fabric-loader=0.19.2 +deps.fabric-api=[VERSIONED] # Dependency Properties -jei_version=29.5.0.26 -jei_minecraft_version=26.1.2 +deps.jei=29.5.0.26 ## Mod Properties -mod_id=blockbox -mod_name=The Block Box -mod_license=https://github.com/vectorwing/BlockBox/blob/26.1/LICENSE -mod_version=0.1.2 -mod_group_id=vectorwing.blockbox -mod_authors=vectorwing -mod_description=A collection of building blocks, furniture and decorations! +mod.id=blockbox +mod.name=The Block Box +mod.license=https://github.com/vectorwing/BlockBox/blob/26.1/LICENSE +mod.version=0.1.2 +mod.group_id=vectorwing.blockbox +mod.authors=vectorwing +mod.description=A collection of building blocks, furniture and decorations! +publish.modrinth=UmGvBQOb +publish.curseforge= +#publish.additionalVersions= \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index d997cfc6..9bbc975c 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradlew b/gradlew index 739907df..faf93008 100644 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015 the original authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -57,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/2d6327017519d23b96af35865dc997fcb544fb40/platforms/jvm/plugins-application/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/. @@ -114,6 +114,7 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. @@ -171,6 +172,7 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) JAVACMD=$( cygpath --unix "$JAVACMD" ) @@ -210,7 +212,8 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ "$@" # Stop when "xargs" is not available. diff --git a/gradlew.bat b/gradlew.bat index c4bdd3ab..9d21a218 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -70,10 +70,11 @@ goto fail :execute @rem Setup the command line +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index bf5d5276..00000000 --- a/settings.gradle +++ /dev/null @@ -1,11 +0,0 @@ -pluginManagement { - repositories { - mavenLocal() - gradlePluginPortal() - maven { url = 'https://maven.neoforged.net/releases' } - } -} - -plugins { - id 'org.gradle.toolchains.foojay-resolver-convention' version '1.0.0' -} diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 00000000..db44ff07 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,27 @@ +pluginManagement { + repositories { + mavenLocal() + mavenCentral() + gradlePluginPortal() + maven("https://maven.fabricmc.net/") { name = "Fabric" } + maven("https://maven.neoforged.net/releases/") { name = "NeoForged" } + maven("https://maven.kikugie.dev/snapshots") { name = "KikuGie" } + maven("https://maven.kikugie.dev/releases") { name = "KikuGie Releases" } + } +} + +plugins { + id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0" + id("dev.kikugie.stonecutter") version "0.7.11" +} + +stonecutter { + create(rootProject) { + fun match(version: String, vararg loaders: String) = loaders + .forEach { vers("$version-$it", version).buildscript = "build.$it.gradle.kts" } + + match("26.1", "fabric", "neoforge") + + vcsVersion = "26.1-neoforge" + } +} \ No newline at end of file diff --git a/src/generated/resources/.cache/28b4b53cd706bc6b6e3f6a8fda45d834ad59c7ec b/src/generated/resources/.cache/28b4b53cd706bc6b6e3f6a8fda45d834ad59c7ec index 97027b27..28efe132 100644 --- a/src/generated/resources/.cache/28b4b53cd706bc6b6e3f6a8fda45d834ad59c7ec +++ b/src/generated/resources/.cache/28b4b53cd706bc6b6e3f6a8fda45d834ad59c7ec @@ -1,4 +1,4 @@ -// 26.1.2 2026-04-15T21:45:31.1350127 Tags for minecraft:item mod id blockbox +// 26.1.2 2026-04-25T17:30:33.08367154 Tags for minecraft:item mod id blockbox ac505c538459acba3d5cbbc8d6cef561ae253f92 data/blockbox/tags/item/golden_blocks.json 809acd4690b1fa37484b9b1dce4556313f9a4fd4 data/blockbox/tags/item/palisades.json 888158b7f20bfc6d8b528f2d3cada3de04678dd0 data/blockbox/tags/item/sky_lanterns.json diff --git a/src/main/java/vectorwing/blockbox/BlockBox.java b/src/main/java/vectorwing/blockbox/BlockBox.java index f3ae38f1..1b2b3154 100644 --- a/src/main/java/vectorwing/blockbox/BlockBox.java +++ b/src/main/java/vectorwing/blockbox/BlockBox.java @@ -1,30 +1,10 @@ package vectorwing.blockbox; import com.mojang.logging.LogUtils; -import net.minecraft.resources.Identifier; -import net.neoforged.bus.api.IEventBus; -import net.neoforged.fml.ModContainer; -import net.neoforged.fml.common.Mod; -import net.neoforged.fml.config.ModConfig; import org.slf4j.Logger; -import vectorwing.blockbox.common.registry.*; -@Mod(BlockBox.MODID) public class BlockBox { public static final String MODID = "blockbox"; public static final Logger LOGGER = LogUtils.getLogger(); - - public BlockBox(IEventBus modEventBus, ModContainer modContainer) { - modContainer.registerConfig(ModConfig.Type.COMMON, Config.SPEC); - - ModBlocks.BLOCKS.register(modEventBus); - ModItems.ITEMS.register(modEventBus); - ModEntityTypes.ENTITY_TYPES.register(modEventBus); - ModSounds.SOUNDS.register(modEventBus); - ModParticleTypes.PARTICLE_TYPES.register(modEventBus); - ModCreativeTabs.CREATIVE_MODE_TABS.register(modEventBus); - - RegistryAliases.addRegistryAliases(); - } } diff --git a/src/main/java/vectorwing/blockbox/Config.java b/src/main/java/vectorwing/blockbox/Config.java index 55ed4e6c..52814e85 100644 --- a/src/main/java/vectorwing/blockbox/Config.java +++ b/src/main/java/vectorwing/blockbox/Config.java @@ -12,5 +12,5 @@ public class Config .comment("Should the items from this mod be organized within vanilla tabs? They will be placed together with similar block sets.") .define("addItemsToVanillaTabs", true); - static final ModConfigSpec SPEC = BUILDER.build(); + public static final ModConfigSpec SPEC = BUILDER.build(); } diff --git a/src/main/java/vectorwing/blockbox/client/event/ClientSetupEvents.java b/src/main/java/vectorwing/blockbox/client/event/ClientSetupEvents.java index 40a986ff..40ef3a7a 100644 --- a/src/main/java/vectorwing/blockbox/client/event/ClientSetupEvents.java +++ b/src/main/java/vectorwing/blockbox/client/event/ClientSetupEvents.java @@ -1,12 +1,17 @@ package vectorwing.blockbox.client.event; import net.minecraft.client.Minecraft; +//? neoforge { import net.neoforged.api.distmarker.Dist; import net.neoforged.bus.api.EventPriority; import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.common.EventBusSubscriber; import net.neoforged.neoforge.client.event.EntityRenderersEvent; import net.neoforged.neoforge.client.event.RegisterParticleProvidersEvent; +//?} else { +/*import vectorwing.blockbox.fabric.event.client.EntityRenderersEvent; +import vectorwing.blockbox.fabric.event.client.RegisterParticleProvidersEvent; +*///?} import vectorwing.blockbox.BlockBox; import vectorwing.blockbox.client.particle.SparkleParticle; import vectorwing.blockbox.common.entity.SeatEntity; @@ -14,15 +19,21 @@ import vectorwing.blockbox.client.particle.StrikeParticle; import vectorwing.blockbox.common.registry.ModParticleTypes; +//? neoforge { @EventBusSubscriber(modid = BlockBox.MODID, value = Dist.CLIENT) +//?} public class ClientSetupEvents { + //? neoforge { @SubscribeEvent(priority = EventPriority.LOWEST) + //?} public static void registerParticles(RegisterParticleProvidersEvent event) { event.registerSpriteSet(ModParticleTypes.SPARKLE.get(), SparkleParticle.Provider::new); } + //? neoforge { @SubscribeEvent + //?} public static void onRegisterRenderers(EntityRenderersEvent.RegisterRenderers event) { event.registerEntityRenderer(ModEntityTypes.SEAT.get(), SeatEntity.Renderer::new); } diff --git a/src/main/java/vectorwing/blockbox/common/block/BrazierBlock.java b/src/main/java/vectorwing/blockbox/common/block/BrazierBlock.java index 07e7d591..50c1ec3c 100644 --- a/src/main/java/vectorwing/blockbox/common/block/BrazierBlock.java +++ b/src/main/java/vectorwing/blockbox/common/block/BrazierBlock.java @@ -1,6 +1,5 @@ package vectorwing.blockbox.common.block; -import com.mojang.logging.annotations.MethodsReturnNonnullByDefault; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.particles.ParticleTypes; @@ -16,8 +15,6 @@ import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.SimpleWaterloggedBlock; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.CampfireBlockEntity; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.properties.BlockStateProperties; @@ -30,16 +27,19 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; +//? neoforge { import net.neoforged.neoforge.common.ItemAbilities; import net.neoforged.neoforge.common.ItemAbility; -import vectorwing.blockbox.common.tag.ModTags; +//?} else { -import javax.annotation.Nullable; -import javax.annotation.ParametersAreNonnullByDefault; +/*import vectorwing.blockbox.fabric.porting.ItemAbilities; +import vectorwing.blockbox.fabric.porting.ItemAbility; +*///?} +import vectorwing.blockbox.fabric.porting.BlockWithItemAbility; +import org.jspecify.annotations.Nullable; +import vectorwing.blockbox.common.tag.ModTags; -@ParametersAreNonnullByDefault -@MethodsReturnNonnullByDefault -public class BrazierBlock extends Block implements SimpleWaterloggedBlock +public class BrazierBlock extends Block implements SimpleWaterloggedBlock, BlockWithItemAbility { public static final BooleanProperty HANGING = BlockStateProperties.HANGING; public static final BooleanProperty LIT = BlockStateProperties.LIT; @@ -64,7 +64,6 @@ public BrazierBlock(int fireDamage, Properties properties) { this.registerDefaultState(this.stateDefinition.any().setValue(HANGING, false).setValue(LIT, true).setValue(WATERLOGGED, false)); } - @Override public BlockState getToolModifiedState(BlockState state, UseOnContext context, ItemAbility itemAbility, boolean simulate) { if (itemAbility == ItemAbilities.FIRESTARTER_LIGHT && canLight(state)) { return state.setValue(BlockStateProperties.LIT, true); diff --git a/src/main/java/vectorwing/blockbox/common/block/PackedSnowBlock.java b/src/main/java/vectorwing/blockbox/common/block/PackedSnowBlock.java index 948ac600..dc52daba 100644 --- a/src/main/java/vectorwing/blockbox/common/block/PackedSnowBlock.java +++ b/src/main/java/vectorwing/blockbox/common/block/PackedSnowBlock.java @@ -14,13 +14,9 @@ import net.minecraft.world.level.block.CarvedPumpkinBlock; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.BlockHitResult; -import net.neoforged.neoforge.common.Tags; import vectorwing.blockbox.common.registry.ModBlocks; +import vectorwing.blockbox.common.tag.CommonTags; -import javax.annotation.ParametersAreNonnullByDefault; - -@MethodsReturnNonnullByDefault -@ParametersAreNonnullByDefault public class PackedSnowBlock extends Block { public PackedSnowBlock(Properties properties) { @@ -29,7 +25,7 @@ public PackedSnowBlock(Properties properties) { @Override protected InteractionResult useItemOn(ItemStack stack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult) { - if (stack.is(Tags.Items.RODS_WOODEN)) { + if (stack.is(CommonTags.Items.RODS_WOODEN)) { Direction hitDirection = hitResult.getDirection(); Direction facingDirection = hitDirection.getAxis() == Direction.Axis.Y ? player.getDirection().getOpposite() : hitDirection; level.playSound(null, pos, SoundEvents.SNOW_BREAK, SoundSource.BLOCKS, 1.0F, 1.0F); diff --git a/src/main/java/vectorwing/blockbox/common/block/PalisadeBlock.java b/src/main/java/vectorwing/blockbox/common/block/PalisadeBlock.java index 6acda413..2103a731 100644 --- a/src/main/java/vectorwing/blockbox/common/block/PalisadeBlock.java +++ b/src/main/java/vectorwing/blockbox/common/block/PalisadeBlock.java @@ -2,10 +2,11 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; -import com.mojang.logging.annotations.MethodsReturnNonnullByDefault; import com.mojang.serialization.MapCodec; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.resources.Identifier; import net.minecraft.sounds.SoundSource; import net.minecraft.tags.BlockTags; import net.minecraft.tags.ItemTags; @@ -26,32 +27,34 @@ import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; +//? neoforge { import net.neoforged.neoforge.common.ItemAbilities; import net.neoforged.neoforge.common.ItemAbility; -import org.jetbrains.annotations.NotNull; +//?} else { + +/*import vectorwing.blockbox.fabric.porting.ItemAbilities; +import vectorwing.blockbox.fabric.porting.ItemAbility; +*///?} +import vectorwing.blockbox.fabric.porting.BlockWithItemAbility; +import org.jspecify.annotations.Nullable; import vectorwing.blockbox.common.block.state.PalisadeConnection; import vectorwing.blockbox.common.registry.ModSounds; import vectorwing.blockbox.common.tag.ModTags; -import javax.annotation.Nullable; -import javax.annotation.ParametersAreNonnullByDefault; import java.util.Map; import java.util.function.Function; import java.util.function.Supplier; -@ParametersAreNonnullByDefault -@MethodsReturnNonnullByDefault -public class PalisadeBlock extends CrossCollisionBlock implements SimpleWaterloggedBlock +public class PalisadeBlock extends CrossCollisionBlock implements SimpleWaterloggedBlock, BlockWithItemAbility { - public static final MapCodec CODEC = simpleCodec(PalisadeBlock::new); public static final EnumProperty TYPE_NORTH = EnumProperty.create("north", PalisadeConnection.class); public static final EnumProperty TYPE_EAST = EnumProperty.create("east", PalisadeConnection.class); public static final EnumProperty TYPE_SOUTH = EnumProperty.create("south", PalisadeConnection.class); public static final EnumProperty TYPE_WEST = EnumProperty.create("west", PalisadeConnection.class); - public final Supplier strippedForm; - public final Supplier spikedForm; + public @Nullable Supplier strippedForm; + public @Nullable Supplier spikedForm; public static final Map> PROPERTY_BY_DIRECTION = ImmutableMap.copyOf(Maps.newEnumMap(Map.of( Direction.NORTH, TYPE_NORTH, @@ -60,22 +63,12 @@ public class PalisadeBlock extends CrossCollisionBlock implements SimpleWaterlog Direction.WEST, TYPE_WEST ))); - public PalisadeBlock(Properties properties) { - this(null, null, 8.0F, 16.0F, 8.0F, 16.0F, 16.0F, properties); - } - - public PalisadeBlock(@Nullable Supplier spikedForm, Properties properties) { - this(spikedForm, null, 8.0F, 16.0F, 8.0F, 16.0F, 16.0F, properties); - } - public PalisadeBlock(@Nullable Supplier spikedForm, @Nullable Supplier strippedForm, Properties properties) { this(spikedForm, strippedForm, 8.0F, 16.0F, 8.0F, 16.0F, 16.0F, properties); } public PalisadeBlock(@Nullable Supplier spikedForm, @Nullable Supplier strippedForm, float postWidth, float postHeight, float wallWidth, float wallHeight, float collisionHeight, Properties properties) { super(postWidth, postHeight, wallWidth, wallHeight, collisionHeight, properties); - this.spikedForm = spikedForm; - this.strippedForm = strippedForm; this.registerDefaultState(this.stateDefinition.any() .setValue(TYPE_NORTH, PalisadeConnection.NONE) .setValue(TYPE_EAST, PalisadeConnection.NONE) @@ -104,9 +97,19 @@ protected Function makeShapes(float postWidth, float pos @Override protected InteractionResult useItemOn(ItemStack stack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult) { if (spikedForm == null) { - return InteractionResult.PASS; + spikedForm = ()-> { + Identifier id = BuiltInRegistries.BLOCK.getKey(this); + Identifier spiked; + if (id.getPath().contains("stripped")) { + spiked = id.withPath(path -> path.replace("stripped", "stripped_spiked")); + } else { + spiked = id.withPrefix("spiked_"); + } + return BuiltInRegistries.BLOCK.getValue(spiked); + + }; } - if (stack.is(ItemTags.SWORDS) && level.getBlockState(pos.above()).isAir()) { + if (stack.is(ItemTags.SWORDS) && !spikedForm.get().equals(Blocks.AIR) && level.getBlockState(pos.above()).isAir()) { level.playSound(null, pos, ModSounds.ITEM_SWORD_CARVE.get(), SoundSource.BLOCKS, 1.0F, 0.9F); level.addDestroyBlockEffect(pos, state); stack.hurtAndBreak(2, player, hand.asEquipmentSlot()); @@ -124,10 +127,13 @@ protected InteractionResult useItemOn(ItemStack stack, BlockState state, Level l @Override public BlockState getToolModifiedState(BlockState state, UseOnContext context, ItemAbility itemAbility, boolean simulate) { if (strippedForm == null) { - return null; + strippedForm = ()-> { + Identifier stripped = BuiltInRegistries.BLOCK.getKey(this).withPrefix("stripped_"); + return BuiltInRegistries.BLOCK.getValue(stripped); + }; } - if (itemAbility == ItemAbilities.AXE_STRIP) { + if (itemAbility == ItemAbilities.AXE_STRIP && !strippedForm.get().equals(Blocks.AIR)) { return strippedForm.get().defaultBlockState() .setValue(TYPE_NORTH, state.getValue(TYPE_NORTH)) .setValue(TYPE_EAST, state.getValue(TYPE_EAST)) @@ -183,8 +189,8 @@ public PalisadeConnection getConnectionType(BlockState state, boolean isSideSoli } @Override - protected @NotNull MapCodec codec() { - return CODEC; + protected MapCodec codec() { + return null; } @Override diff --git a/src/main/java/vectorwing/blockbox/common/block/PortalFrameBlock.java b/src/main/java/vectorwing/blockbox/common/block/PortalFrameBlock.java index b1baa2bd..07fe77c1 100644 --- a/src/main/java/vectorwing/blockbox/common/block/PortalFrameBlock.java +++ b/src/main/java/vectorwing/blockbox/common/block/PortalFrameBlock.java @@ -5,17 +5,16 @@ import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; -import javax.annotation.ParametersAreNonnullByDefault; - -@ParametersAreNonnullByDefault public class PortalFrameBlock extends Block { public PortalFrameBlock(Properties properties) { super(properties); } + //? neoforge { @Override public boolean isPortalFrame(BlockState state, BlockGetter level, BlockPos pos) { return true; } + //?} } diff --git a/src/main/java/vectorwing/blockbox/common/block/SeatBlock.java b/src/main/java/vectorwing/blockbox/common/block/SeatBlock.java index d340b587..19108dbd 100644 --- a/src/main/java/vectorwing/blockbox/common/block/SeatBlock.java +++ b/src/main/java/vectorwing/blockbox/common/block/SeatBlock.java @@ -1,6 +1,5 @@ package vectorwing.blockbox.common.block; -import com.mojang.logging.annotations.MethodsReturnNonnullByDefault; import com.mojang.serialization.MapCodec; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -19,13 +18,8 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -import org.jetbrains.annotations.NotNull; import vectorwing.blockbox.common.entity.SeatEntity; -import javax.annotation.ParametersAreNonnullByDefault; - -@ParametersAreNonnullByDefault -@MethodsReturnNonnullByDefault public class SeatBlock extends HorizontalDirectionalBlock { public static final MapCodec CODEC = simpleCodec(SeatBlock::new); @@ -80,7 +74,7 @@ protected void createBlockStateDefinition(StateDefinition.Builder codec() { + protected MapCodec codec() { return CODEC; } } diff --git a/src/main/java/vectorwing/blockbox/common/block/SpikedPalisadeBlock.java b/src/main/java/vectorwing/blockbox/common/block/SpikedPalisadeBlock.java index 765c833c..5a0b794a 100644 --- a/src/main/java/vectorwing/blockbox/common/block/SpikedPalisadeBlock.java +++ b/src/main/java/vectorwing/blockbox/common/block/SpikedPalisadeBlock.java @@ -1,9 +1,10 @@ package vectorwing.blockbox.common.block; -import com.mojang.logging.annotations.MethodsReturnNonnullByDefault; import com.mojang.serialization.MapCodec; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.resources.Identifier; import net.minecraft.tags.BlockTags; import net.minecraft.util.RandomSource; import net.minecraft.world.entity.Entity; @@ -11,10 +12,7 @@ import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.item.context.UseOnContext; import net.minecraft.world.level.*; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.CrossCollisionBlock; -import net.minecraft.world.level.block.IronBarsBlock; -import net.minecraft.world.level.block.SimpleWaterloggedBlock; +import net.minecraft.world.level.block.*; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.material.FluidState; @@ -23,24 +21,27 @@ import net.minecraft.world.phys.shapes.BooleanOp; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; +//? neoforge { import net.neoforged.neoforge.common.ItemAbilities; import net.neoforged.neoforge.common.ItemAbility; +//?} else { +/*import vectorwing.blockbox.fabric.porting.ItemAbilities; +import vectorwing.blockbox.fabric.porting.ItemAbility; +*///?} +import vectorwing.blockbox.fabric.porting.BlockWithItemAbility; +import org.jspecify.annotations.Nullable; import vectorwing.blockbox.common.registry.ModDamageTypes; import vectorwing.blockbox.common.tag.ModTags; -import javax.annotation.Nullable; -import javax.annotation.ParametersAreNonnullByDefault; import java.util.function.Supplier; -@ParametersAreNonnullByDefault -@MethodsReturnNonnullByDefault -public class SpikedPalisadeBlock extends CrossCollisionBlock implements SimpleWaterloggedBlock +public class SpikedPalisadeBlock extends CrossCollisionBlock implements SimpleWaterloggedBlock, BlockWithItemAbility { public static final MapCodec CODEC = simpleCodec(SpikedPalisadeBlock::new); protected static final VoxelShape SPIKE_SHAPE = Block.box(4.0D, 8.0D, 4.0D, 12.0D, 16.0D, 12.0D); - public final Supplier strippedForm; + public Supplier strippedForm; public SpikedPalisadeBlock(Properties properties) { this(null, properties); @@ -60,9 +61,12 @@ public SpikedPalisadeBlock(@Nullable Supplier strippedForm, Properties pr @Override public BlockState getToolModifiedState(BlockState state, UseOnContext context, ItemAbility itemAbility, boolean simulate) { if (strippedForm == null) { - return null; + strippedForm = ()-> { + Identifier stripped = BuiltInRegistries.BLOCK.getKey(this).withPrefix("stripped_"); + return BuiltInRegistries.BLOCK.getValue(stripped); + }; } - if (itemAbility == ItemAbilities.AXE_STRIP) { + if (itemAbility == ItemAbilities.AXE_STRIP && !strippedForm.get().equals(Blocks.AIR)) { return strippedForm.get().defaultBlockState() .setValue(NORTH, state.getValue(NORTH)) .setValue(EAST, state.getValue(EAST)) diff --git a/src/main/java/vectorwing/blockbox/common/block/WeatheringCopperPillarBlock.java b/src/main/java/vectorwing/blockbox/common/block/WeatheringCopperPillarBlock.java index 132663ec..753a97e9 100644 --- a/src/main/java/vectorwing/blockbox/common/block/WeatheringCopperPillarBlock.java +++ b/src/main/java/vectorwing/blockbox/common/block/WeatheringCopperPillarBlock.java @@ -1,6 +1,5 @@ package vectorwing.blockbox.common.block; -import com.mojang.logging.annotations.MethodsReturnNonnullByDefault; import com.mojang.serialization.MapCodec; import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.core.BlockPos; @@ -11,10 +10,6 @@ import net.minecraft.world.level.block.WeatheringCopper; import net.minecraft.world.level.block.state.BlockState; -import javax.annotation.ParametersAreNonnullByDefault; - -@MethodsReturnNonnullByDefault -@ParametersAreNonnullByDefault public class WeatheringCopperPillarBlock extends RotatedPillarBlock implements WeatheringCopper { public static final MapCodec CODEC = RecordCodecBuilder.mapCodec( diff --git a/src/main/java/vectorwing/blockbox/common/block/package-info.java b/src/main/java/vectorwing/blockbox/common/block/package-info.java new file mode 100644 index 00000000..4fd6cc41 --- /dev/null +++ b/src/main/java/vectorwing/blockbox/common/block/package-info.java @@ -0,0 +1,4 @@ +@NullMarked +package vectorwing.blockbox.common.block; + +import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/src/main/java/vectorwing/blockbox/common/entity/SeatEntity.java b/src/main/java/vectorwing/blockbox/common/entity/SeatEntity.java index 2f5e75ea..fe392111 100644 --- a/src/main/java/vectorwing/blockbox/common/entity/SeatEntity.java +++ b/src/main/java/vectorwing/blockbox/common/entity/SeatEntity.java @@ -1,6 +1,8 @@ package vectorwing.blockbox.common.entity; -import com.mojang.logging.annotations.MethodsReturnNonnullByDefault; +//? fabric { +/*import net.fabricmc.fabric.api.entity.FakePlayer; +*///?} import net.minecraft.client.renderer.culling.Frustum; import net.minecraft.client.renderer.entity.EntityRenderer; import net.minecraft.client.renderer.entity.EntityRendererProvider; @@ -17,14 +19,14 @@ import net.minecraft.world.level.storage.ValueInput; import net.minecraft.world.level.storage.ValueOutput; import net.minecraft.world.phys.Vec3; +//? neoforge { import net.neoforged.neoforge.common.util.FakePlayer; +//?} +import org.jspecify.annotations.NullMarked; import vectorwing.blockbox.common.block.SeatBlock; import vectorwing.blockbox.common.registry.ModEntityTypes; -import javax.annotation.ParametersAreNonnullByDefault; - -@ParametersAreNonnullByDefault -@MethodsReturnNonnullByDefault +@NullMarked public class SeatEntity extends Entity { public SeatEntity(EntityType entityType, Level level) { diff --git a/src/main/java/vectorwing/blockbox/common/event/CommonEvents.java b/src/main/java/vectorwing/blockbox/common/event/CommonEvents.java index ff0cca78..24cc598e 100644 --- a/src/main/java/vectorwing/blockbox/common/event/CommonEvents.java +++ b/src/main/java/vectorwing/blockbox/common/event/CommonEvents.java @@ -5,15 +5,20 @@ import net.minecraft.world.item.CreativeModeTabs; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; +//? neoforge { import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.common.EventBusSubscriber; import net.neoforged.neoforge.event.BuildCreativeModeTabContentsEvent; import net.neoforged.neoforge.registries.RegisterEvent; +//?} else { +/*import vectorwing.blockbox.fabric.event.BuildCreativeModeTabContentsEvent; +*///?} import vectorwing.blockbox.BlockBox; import vectorwing.blockbox.Config; -import vectorwing.blockbox.common.registry.ModBlocks; import vectorwing.blockbox.common.registry.ModItems; + +//? neoforge @EventBusSubscriber(modid = BlockBox.MODID) @SuppressWarnings("unused") public class CommonEvents @@ -22,8 +27,10 @@ public class CommonEvents // clay_tiles -> tiles // jagged_clay_tiles -> broken_tile_mosaic + //? neoforge @SubscribeEvent - public static void addItemsToVanillaCreativeTabs(BuildCreativeModeTabContentsEvent event) { + public static void addItemsToVanillaCreativeTabs(BuildCreativeModeTabContentsEvent event + ) { if (!Config.ADD_ITEMS_TO_VANILLA_TABS.get()) { return; } diff --git a/src/main/java/vectorwing/blockbox/common/registry/ModBlocks.java b/src/main/java/vectorwing/blockbox/common/registry/ModBlocks.java index 479ffb9e..02ad2ee9 100644 --- a/src/main/java/vectorwing/blockbox/common/registry/ModBlocks.java +++ b/src/main/java/vectorwing/blockbox/common/registry/ModBlocks.java @@ -1,22 +1,28 @@ package vectorwing.blockbox.common.registry; +import net.minecraft.core.Registry; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.core.registries.Registries; +import net.minecraft.resources.Identifier; +import net.minecraft.resources.ResourceKey; +import net.minecraft.world.item.BlockItem; +import net.minecraft.world.item.Item; import net.minecraft.world.level.block.*; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.NoteBlockInstrument; import net.minecraft.world.level.material.MapColor; -import net.neoforged.neoforge.registries.DeferredRegister; +import org.jspecify.annotations.Nullable; import vectorwing.blockbox.BlockBox; import vectorwing.blockbox.common.block.*; -import javax.annotation.Nullable; +import java.util.function.Function; import java.util.function.Supplier; import java.util.function.ToIntFunction; public class ModBlocks { - public static final DeferredRegister.Blocks BLOCKS = DeferredRegister.createBlocks(BlockBox.MODID); public static final BlockBehaviour.Properties PROPERTIES_PACKED_SNOW = BlockBehaviour.Properties.of().mapColor(MapColor.SNOW).strength(0.6F).sound(SoundType.SNOW); public static final BlockBehaviour.Properties PROPERTIES_PACKED_ICE = BlockBehaviour.Properties.ofFullCopy(Blocks.PACKED_ICE).strength(0.4F).requiresCorrectToolForDrops(); @@ -24,186 +30,196 @@ public class ModBlocks public static final BlockBehaviour.Properties PROPERTIES_PALISADE = BlockBehaviour.Properties.of().strength(2.0F).instrument(NoteBlockInstrument.BASS).sound(SoundType.WOOD).ignitedByLava(); public static final BlockBehaviour.Properties PROPERTIES_SKY_LANTERN = BlockBehaviour.Properties.of().instrument(NoteBlockInstrument.GUITAR).noOcclusion().lightLevel((state) -> 15).ignitedByLava().sound(SoundType.WOOL); - public static final Supplier GRANITE_BRICKS = BLOCKS.registerSimpleBlock("granite_bricks", () -> BlockBehaviour.Properties.ofFullCopy(Blocks.GRANITE)); - public static final Supplier GRANITE_BRICK_STAIRS = BLOCKS.registerBlock("granite_brick_stairs", props -> stair(ModBlocks.GRANITE_BRICKS.get(), props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.GRANITE)); - public static final Supplier GRANITE_BRICK_SLAB = BLOCKS.registerBlock("granite_brick_slab", SlabBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.GRANITE)); - public static final Supplier GRANITE_BRICK_WALL = BLOCKS.registerBlock("granite_brick_wall", WallBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.GRANITE).forceSolidOn()); - public static final Supplier DIORITE_BRICKS = BLOCKS.registerSimpleBlock("diorite_bricks", () -> BlockBehaviour.Properties.ofFullCopy(Blocks.DIORITE)); - public static final Supplier DIORITE_BRICK_STAIRS = BLOCKS.registerBlock("diorite_brick_stairs", props -> stair(ModBlocks.DIORITE_BRICKS.get(), props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.DIORITE)); - public static final Supplier DIORITE_BRICK_SLAB = BLOCKS.registerBlock("diorite_brick_slab", SlabBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.DIORITE)); - public static final Supplier DIORITE_BRICK_WALL = BLOCKS.registerBlock("diorite_brick_wall", WallBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.DIORITE).forceSolidOn()); - public static final Supplier ANDESITE_BRICKS = BLOCKS.registerSimpleBlock("andesite_bricks", () -> BlockBehaviour.Properties.ofFullCopy(Blocks.ANDESITE)); - public static final Supplier ANDESITE_BRICK_STAIRS = BLOCKS.registerBlock("andesite_brick_stairs", props -> stair(ModBlocks.ANDESITE_BRICKS.get(), props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.ANDESITE)); - public static final Supplier ANDESITE_BRICK_SLAB = BLOCKS.registerBlock("andesite_brick_slab", SlabBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.ANDESITE)); - public static final Supplier ANDESITE_BRICK_WALL = BLOCKS.registerBlock("andesite_brick_wall", WallBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.ANDESITE).forceSolidOn()); - - public static final Supplier SANDSTONE_BRICKS = BLOCKS.registerSimpleBlock("sandstone_bricks", () -> BlockBehaviour.Properties.ofFullCopy(Blocks.SANDSTONE)); - public static final Supplier SANDSTONE_BRICK_STAIRS = BLOCKS.registerBlock("sandstone_brick_stairs", props -> stair(ModBlocks.SANDSTONE_BRICKS.get(), props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.SANDSTONE)); - public static final Supplier SANDSTONE_BRICK_SLAB = BLOCKS.registerBlock("sandstone_brick_slab", SlabBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(ModBlocks.SANDSTONE_BRICKS.get())); - public static final Supplier RED_SANDSTONE_BRICKS = BLOCKS.registerSimpleBlock("red_sandstone_bricks", () -> BlockBehaviour.Properties.ofFullCopy(Blocks.RED_SANDSTONE)); - public static final Supplier RED_SANDSTONE_BRICK_STAIRS = BLOCKS.registerBlock("red_sandstone_brick_stairs", props -> stair(ModBlocks.RED_SANDSTONE_BRICKS.get(), props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.RED_SANDSTONE)); - public static final Supplier RED_SANDSTONE_BRICK_SLAB = BLOCKS.registerBlock("red_sandstone_brick_slab", SlabBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(ModBlocks.RED_SANDSTONE_BRICKS.get())); - - public static final Supplier TILES = BLOCKS.registerSimpleBlock("tiles", () -> BlockBehaviour.Properties.ofFullCopy(Blocks.BRICKS)); - public static final Supplier TILE_STAIRS = BLOCKS.registerBlock("tile_stairs", props -> stair(ModBlocks.TILES.get(), props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.BRICKS)); - public static final Supplier TILE_SLAB = BLOCKS.registerBlock("tile_slab", SlabBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.BRICKS)); - public static final Supplier BROKEN_TILE_MOSAIC = BLOCKS.registerSimpleBlock("broken_tile_mosaic", () -> BlockBehaviour.Properties.ofFullCopy(Blocks.BRICKS)); - - public static final Supplier PACKED_SNOW = BLOCKS.registerBlock("packed_snow", PackedSnowBlock::new, () -> PROPERTIES_PACKED_SNOW); - public static final Supplier CARVED_SNOW = BLOCKS.registerBlock("carved_snow", CarvedSnowBlock::new, () -> PROPERTIES_PACKED_SNOW); - public static final Supplier SNOW_BRICKS = BLOCKS.registerSimpleBlock("snow_bricks", () -> PROPERTIES_PACKED_SNOW); - public static final Supplier SNOW_BRICK_STAIRS = BLOCKS.registerBlock("snow_brick_stairs", props -> stair(ModBlocks.SNOW_BRICKS.get(), props), () -> PROPERTIES_PACKED_SNOW); - public static final Supplier SNOW_BRICK_SLAB = BLOCKS.registerBlock("snow_brick_slab", SlabBlock::new, () -> PROPERTIES_PACKED_SNOW); - public static final Supplier SNOW_BRICK_WALL = BLOCKS.registerBlock("snow_brick_wall", WallBlock::new, () -> PROPERTIES_PACKED_SNOW.forceSolidOn()); - public static final Supplier POLISHED_PACKED_ICE = BLOCKS.registerSimpleBlock("polished_packed_ice", () -> PROPERTIES_PACKED_ICE); - public static final Supplier PACKED_ICE_BRICKS = BLOCKS.registerSimpleBlock("packed_ice_bricks", () -> PROPERTIES_PACKED_ICE); - public static final Supplier PACKED_ICE_BRICK_STAIRS = BLOCKS.registerBlock("packed_ice_brick_stairs", props -> stair(ModBlocks.PACKED_ICE_BRICKS.get(), props), () -> PROPERTIES_PACKED_ICE); - public static final Supplier PACKED_ICE_BRICK_SLAB = BLOCKS.registerBlock("packed_ice_brick_slab", SlabBlock::new, () -> PROPERTIES_PACKED_ICE); - public static final Supplier PACKED_ICE_BRICK_WALL = BLOCKS.registerBlock("packed_ice_brick_wall", WallBlock::new, () -> PROPERTIES_PACKED_ICE.forceSolidOn()); - - public static final Supplier POLISHED_OBSIDIAN = BLOCKS.registerBlock("polished_obsidian", PortalFrameBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.OBSIDIAN)); - - public static final Supplier ROUGH_GLASS = BLOCKS.registerBlock("rough_glass", TransparentBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.GLASS)); - public static final Supplier ROUGH_GLASS_PANE = BLOCKS.registerBlock("rough_glass_pane", IronBarsBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.GLASS_PANE)); - - public static final Supplier COPPER_CHAIN_LINKS = BLOCKS.registerBlock("copper_chain_links", props -> new WeatheringCopperBarsBlock(WeatheringCopper.WeatherState.UNAFFECTED, props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.COPPER_BARS.unaffected())); - public static final Supplier EXPOSED_COPPER_CHAIN_LINKS = BLOCKS.registerBlock("exposed_copper_chain_links", props -> new WeatheringCopperBarsBlock(WeatheringCopper.WeatherState.EXPOSED, props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.COPPER_BARS.exposed())); - public static final Supplier WEATHERED_COPPER_CHAIN_LINKS = BLOCKS.registerBlock("weathered_copper_chain_links", props -> new WeatheringCopperBarsBlock(WeatheringCopper.WeatherState.WEATHERED, props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.COPPER_BARS.weathered())); - public static final Supplier OXIDIZED_COPPER_CHAIN_LINKS = BLOCKS.registerBlock("oxidized_copper_chain_links", props -> new WeatheringCopperBarsBlock(WeatheringCopper.WeatherState.OXIDIZED, props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.COPPER_BARS.oxidized())); - public static final Supplier WAXED_COPPER_CHAIN_LINKS = BLOCKS.registerBlock("waxed_copper_chain_links", IronBarsBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.COPPER_BARS.waxed())); - public static final Supplier WAXED_EXPOSED_COPPER_CHAIN_LINKS = BLOCKS.registerBlock("waxed_exposed_copper_chain_links", IronBarsBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.COPPER_BARS.waxedExposed())); - public static final Supplier WAXED_WEATHERED_COPPER_CHAIN_LINKS = BLOCKS.registerBlock("waxed_weathered_copper_chain_links", IronBarsBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.COPPER_BARS.waxedWeathered())); - public static final Supplier WAXED_OXIDIZED_COPPER_CHAIN_LINKS = BLOCKS.registerBlock("waxed_oxidized_copper_chain_links", IronBarsBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.COPPER_BARS.waxedOxidized())); - - public static final Supplier COPPER_PILLAR = BLOCKS.registerBlock("copper_pillar", props -> new WeatheringCopperPillarBlock(WeatheringCopper.WeatherState.UNAFFECTED, props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.COPPER_BLOCK)); - public static final Supplier EXPOSED_COPPER_PILLAR = BLOCKS.registerBlock("exposed_copper_pillar", props -> new WeatheringCopperPillarBlock(WeatheringCopper.WeatherState.EXPOSED, props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.EXPOSED_COPPER)); - public static final Supplier WEATHERED_COPPER_PILLAR = BLOCKS.registerBlock("weathered_copper_pillar", props -> new WeatheringCopperPillarBlock(WeatheringCopper.WeatherState.WEATHERED, props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.WEATHERED_COPPER)); - public static final Supplier OXIDIZED_COPPER_PILLAR = BLOCKS.registerBlock("oxidized_copper_pillar", props -> new WeatheringCopperPillarBlock(WeatheringCopper.WeatherState.OXIDIZED, props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.OXIDIZED_COPPER)); - public static final Supplier WAXED_COPPER_PILLAR = BLOCKS.registerBlock("waxed_copper_pillar", RotatedPillarBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.COPPER_BLOCK)); - public static final Supplier WAXED_EXPOSED_COPPER_PILLAR = BLOCKS.registerBlock("waxed_exposed_copper_pillar", RotatedPillarBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.EXPOSED_COPPER)); - public static final Supplier WAXED_WEATHERED_COPPER_PILLAR = BLOCKS.registerBlock("waxed_weathered_copper_pillar", RotatedPillarBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.WEATHERED_COPPER)); - public static final Supplier WAXED_OXIDIZED_COPPER_PILLAR = BLOCKS.registerBlock("waxed_oxidized_copper_pillar", RotatedPillarBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.OXIDIZED_COPPER)); - - public static final Supplier IRON_PLATE = BLOCKS.registerSimpleBlock("iron_plate", () -> PROPERTIES_IRON_PLATE); - public static final Supplier IRON_TREAD_PLATE = BLOCKS.registerSimpleBlock("iron_tread_plate", () -> PROPERTIES_IRON_PLATE); - public static final Supplier IRON_TREAD_PLATE_STAIRS = BLOCKS.registerBlock("iron_tread_plate_stairs", props -> stair(ModBlocks.IRON_TREAD_PLATE.get(), props), () -> PROPERTIES_IRON_PLATE); - public static final Supplier IRON_TREAD_PLATE_SLAB = BLOCKS.registerBlock("iron_tread_plate_slab", SlabBlock::new, () -> PROPERTIES_IRON_PLATE); - public static final Supplier CORRUGATED_IRON_PLATE = BLOCKS.registerSimpleBlock("corrugated_iron_plate", () -> PROPERTIES_IRON_PLATE); - public static final Supplier CORRUGATED_IRON_PLATE_STAIRS = BLOCKS.registerBlock("corrugated_iron_plate_stairs", props -> stair(ModBlocks.CORRUGATED_IRON_PLATE.get(), props), () -> PROPERTIES_IRON_PLATE); - public static final Supplier CORRUGATED_IRON_PLATE_SLAB = BLOCKS.registerBlock("corrugated_iron_plate_slab", SlabBlock::new, () -> PROPERTIES_IRON_PLATE); - public static final Supplier IRON_PLATE_PILLAR = BLOCKS.registerBlock("iron_plate_pillar", RotatedPillarBlock::new, () -> PROPERTIES_IRON_PLATE); - public static final Supplier IRON_PLATE_DOOR = BLOCKS.registerBlock("iron_plate_door", + public static final Supplier GRANITE_BRICKS = registerSimpleBlock("granite_bricks", () -> BlockBehaviour.Properties.ofFullCopy(Blocks.GRANITE)); + public static final Supplier GRANITE_BRICK_STAIRS = registerBlock("granite_brick_stairs", props -> stair(ModBlocks.GRANITE_BRICKS.get(), props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.GRANITE)); + public static final Supplier GRANITE_BRICK_SLAB = registerBlock("granite_brick_slab", SlabBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.GRANITE)); + public static final Supplier GRANITE_BRICK_WALL = registerBlock("granite_brick_wall", WallBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.GRANITE).forceSolidOn()); + public static final Supplier DIORITE_BRICKS = registerSimpleBlock("diorite_bricks", () -> BlockBehaviour.Properties.ofFullCopy(Blocks.DIORITE)); + public static final Supplier DIORITE_BRICK_STAIRS = registerBlock("diorite_brick_stairs", props -> stair(ModBlocks.DIORITE_BRICKS.get(), props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.DIORITE)); + public static final Supplier DIORITE_BRICK_SLAB = registerBlock("diorite_brick_slab", SlabBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.DIORITE)); + public static final Supplier DIORITE_BRICK_WALL = registerBlock("diorite_brick_wall", WallBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.DIORITE).forceSolidOn()); + public static final Supplier ANDESITE_BRICKS = registerSimpleBlock("andesite_bricks", () -> BlockBehaviour.Properties.ofFullCopy(Blocks.ANDESITE)); + public static final Supplier ANDESITE_BRICK_STAIRS = registerBlock("andesite_brick_stairs", props -> stair(ModBlocks.ANDESITE_BRICKS.get(), props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.ANDESITE)); + public static final Supplier ANDESITE_BRICK_SLAB = registerBlock("andesite_brick_slab", SlabBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.ANDESITE)); + public static final Supplier ANDESITE_BRICK_WALL = registerBlock("andesite_brick_wall", WallBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.ANDESITE).forceSolidOn()); + + public static final Supplier SANDSTONE_BRICKS = registerSimpleBlock("sandstone_bricks", () -> BlockBehaviour.Properties.ofFullCopy(Blocks.SANDSTONE)); + public static final Supplier SANDSTONE_BRICK_STAIRS = registerBlock("sandstone_brick_stairs", props -> stair(ModBlocks.SANDSTONE_BRICKS.get(), props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.SANDSTONE)); + public static final Supplier SANDSTONE_BRICK_SLAB = registerBlock("sandstone_brick_slab", SlabBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(ModBlocks.SANDSTONE_BRICKS.get())); + public static final Supplier RED_SANDSTONE_BRICKS = registerSimpleBlock("red_sandstone_bricks", () -> BlockBehaviour.Properties.ofFullCopy(Blocks.RED_SANDSTONE)); + public static final Supplier RED_SANDSTONE_BRICK_STAIRS = registerBlock("red_sandstone_brick_stairs", props -> stair(ModBlocks.RED_SANDSTONE_BRICKS.get(), props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.RED_SANDSTONE)); + public static final Supplier RED_SANDSTONE_BRICK_SLAB = registerBlock("red_sandstone_brick_slab", SlabBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(ModBlocks.RED_SANDSTONE_BRICKS.get())); + + public static final Supplier TILES = registerSimpleBlock("tiles", () -> BlockBehaviour.Properties.ofFullCopy(Blocks.BRICKS)); + public static final Supplier TILE_STAIRS = registerBlock("tile_stairs", props -> stair(ModBlocks.TILES.get(), props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.BRICKS)); + public static final Supplier TILE_SLAB = registerBlock("tile_slab", SlabBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.BRICKS)); + public static final Supplier BROKEN_TILE_MOSAIC = registerSimpleBlock("broken_tile_mosaic", () -> BlockBehaviour.Properties.ofFullCopy(Blocks.BRICKS)); + + public static final Supplier PACKED_SNOW = registerBlock("packed_snow", PackedSnowBlock::new, () -> PROPERTIES_PACKED_SNOW); + public static final Supplier CARVED_SNOW = registerBlock("carved_snow", CarvedSnowBlock::new, () -> PROPERTIES_PACKED_SNOW); + public static final Supplier SNOW_BRICKS = registerSimpleBlock("snow_bricks", () -> PROPERTIES_PACKED_SNOW); + public static final Supplier SNOW_BRICK_STAIRS = registerBlock("snow_brick_stairs", props -> stair(ModBlocks.SNOW_BRICKS.get(), props), () -> PROPERTIES_PACKED_SNOW); + public static final Supplier SNOW_BRICK_SLAB = registerBlock("snow_brick_slab", SlabBlock::new, () -> PROPERTIES_PACKED_SNOW); + public static final Supplier SNOW_BRICK_WALL = registerBlock("snow_brick_wall", WallBlock::new, () -> PROPERTIES_PACKED_SNOW.forceSolidOn()); + public static final Supplier POLISHED_PACKED_ICE = registerSimpleBlock("polished_packed_ice", () -> PROPERTIES_PACKED_ICE); + public static final Supplier PACKED_ICE_BRICKS = registerSimpleBlock("packed_ice_bricks", () -> PROPERTIES_PACKED_ICE); + public static final Supplier PACKED_ICE_BRICK_STAIRS = registerBlock("packed_ice_brick_stairs", props -> stair(ModBlocks.PACKED_ICE_BRICKS.get(), props), () -> PROPERTIES_PACKED_ICE); + public static final Supplier PACKED_ICE_BRICK_SLAB = registerBlock("packed_ice_brick_slab", SlabBlock::new, () -> PROPERTIES_PACKED_ICE); + public static final Supplier PACKED_ICE_BRICK_WALL = registerBlock("packed_ice_brick_wall", WallBlock::new, () -> PROPERTIES_PACKED_ICE.forceSolidOn()); + + public static final Supplier POLISHED_OBSIDIAN = registerBlock("polished_obsidian", PortalFrameBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.OBSIDIAN)); + + public static final Supplier ROUGH_GLASS = registerBlock("rough_glass", TransparentBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.GLASS)); + public static final Supplier ROUGH_GLASS_PANE = registerBlock("rough_glass_pane", IronBarsBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.GLASS_PANE)); + + public static final Supplier COPPER_CHAIN_LINKS = registerBlock("copper_chain_links", props -> new WeatheringCopperBarsBlock(WeatheringCopper.WeatherState.UNAFFECTED, props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.COPPER_BARS.unaffected())); + public static final Supplier EXPOSED_COPPER_CHAIN_LINKS = registerBlock("exposed_copper_chain_links", props -> new WeatheringCopperBarsBlock(WeatheringCopper.WeatherState.EXPOSED, props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.COPPER_BARS.exposed())); + public static final Supplier WEATHERED_COPPER_CHAIN_LINKS = registerBlock("weathered_copper_chain_links", props -> new WeatheringCopperBarsBlock(WeatheringCopper.WeatherState.WEATHERED, props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.COPPER_BARS.weathered())); + public static final Supplier OXIDIZED_COPPER_CHAIN_LINKS = registerBlock("oxidized_copper_chain_links", props -> new WeatheringCopperBarsBlock(WeatheringCopper.WeatherState.OXIDIZED, props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.COPPER_BARS.oxidized())); + public static final Supplier WAXED_COPPER_CHAIN_LINKS = registerBlock("waxed_copper_chain_links", IronBarsBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.COPPER_BARS.waxed())); + public static final Supplier WAXED_EXPOSED_COPPER_CHAIN_LINKS = registerBlock("waxed_exposed_copper_chain_links", IronBarsBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.COPPER_BARS.waxedExposed())); + public static final Supplier WAXED_WEATHERED_COPPER_CHAIN_LINKS = registerBlock("waxed_weathered_copper_chain_links", IronBarsBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.COPPER_BARS.waxedWeathered())); + public static final Supplier WAXED_OXIDIZED_COPPER_CHAIN_LINKS = registerBlock("waxed_oxidized_copper_chain_links", IronBarsBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.COPPER_BARS.waxedOxidized())); + + public static final Supplier COPPER_PILLAR = registerBlock("copper_pillar", props -> new WeatheringCopperPillarBlock(WeatheringCopper.WeatherState.UNAFFECTED, props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.COPPER_BLOCK)); + public static final Supplier EXPOSED_COPPER_PILLAR = registerBlock("exposed_copper_pillar", props -> new WeatheringCopperPillarBlock(WeatheringCopper.WeatherState.EXPOSED, props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.EXPOSED_COPPER)); + public static final Supplier WEATHERED_COPPER_PILLAR = registerBlock("weathered_copper_pillar", props -> new WeatheringCopperPillarBlock(WeatheringCopper.WeatherState.WEATHERED, props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.WEATHERED_COPPER)); + public static final Supplier OXIDIZED_COPPER_PILLAR = registerBlock("oxidized_copper_pillar", props -> new WeatheringCopperPillarBlock(WeatheringCopper.WeatherState.OXIDIZED, props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.OXIDIZED_COPPER)); + public static final Supplier WAXED_COPPER_PILLAR = registerBlock("waxed_copper_pillar", RotatedPillarBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.COPPER_BLOCK)); + public static final Supplier WAXED_EXPOSED_COPPER_PILLAR = registerBlock("waxed_exposed_copper_pillar", RotatedPillarBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.EXPOSED_COPPER)); + public static final Supplier WAXED_WEATHERED_COPPER_PILLAR = registerBlock("waxed_weathered_copper_pillar", RotatedPillarBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.WEATHERED_COPPER)); + public static final Supplier WAXED_OXIDIZED_COPPER_PILLAR = registerBlock("waxed_oxidized_copper_pillar", RotatedPillarBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.OXIDIZED_COPPER)); + + public static final Supplier IRON_PLATE = registerSimpleBlock("iron_plate", () -> PROPERTIES_IRON_PLATE); + public static final Supplier IRON_TREAD_PLATE = registerSimpleBlock("iron_tread_plate", () -> PROPERTIES_IRON_PLATE); + public static final Supplier IRON_TREAD_PLATE_STAIRS = registerBlock("iron_tread_plate_stairs", props -> stair(ModBlocks.IRON_TREAD_PLATE.get(), props), () -> PROPERTIES_IRON_PLATE); + public static final Supplier IRON_TREAD_PLATE_SLAB = registerBlock("iron_tread_plate_slab", SlabBlock::new, () -> PROPERTIES_IRON_PLATE); + public static final Supplier CORRUGATED_IRON_PLATE = registerSimpleBlock("corrugated_iron_plate", () -> PROPERTIES_IRON_PLATE); + public static final Supplier CORRUGATED_IRON_PLATE_STAIRS = registerBlock("corrugated_iron_plate_stairs", props -> stair(ModBlocks.CORRUGATED_IRON_PLATE.get(), props), () -> PROPERTIES_IRON_PLATE); + public static final Supplier CORRUGATED_IRON_PLATE_SLAB = registerBlock("corrugated_iron_plate_slab", SlabBlock::new, () -> PROPERTIES_IRON_PLATE); + public static final Supplier IRON_PLATE_PILLAR = registerBlock("iron_plate_pillar", RotatedPillarBlock::new, () -> PROPERTIES_IRON_PLATE); + public static final Supplier IRON_PLATE_DOOR = registerBlock("iron_plate_door", props -> new DoorBlock(ModBlockSets.IRON_PLATE.get(), props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.IRON_DOOR)); - public static final Supplier IRON_PLATE_TRAPDOOR = BLOCKS.registerBlock("iron_plate_trapdoor", + public static final Supplier IRON_PLATE_TRAPDOOR = registerBlock("iron_plate_trapdoor", props -> new TrapDoorBlock(ModBlockSets.IRON_PLATE.get(), props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.IRON_TRAPDOOR)); - public static final Supplier CHISELED_GOLD = BLOCKS.registerSimpleBlock("chiseled_gold", () -> BlockBehaviour.Properties.ofFullCopy(Blocks.GOLD_BLOCK)); - public static final Supplier GOLDEN_TILES = BLOCKS.registerSimpleBlock("golden_tiles", () -> BlockBehaviour.Properties.ofFullCopy(Blocks.GOLD_BLOCK)); - public static final Supplier GOLDEN_BRICKS = BLOCKS.registerSimpleBlock("golden_bricks", () -> BlockBehaviour.Properties.ofFullCopy(Blocks.GOLD_BLOCK)); - public static final Supplier GOLDEN_BRICK_STAIRS = BLOCKS.registerBlock("golden_brick_stairs", props -> stair(ModBlocks.GOLDEN_BRICKS.get(), props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.GOLD_BLOCK)); - public static final Supplier GOLDEN_BRICK_SLAB = BLOCKS.registerBlock("golden_brick_slab", SlabBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.GOLD_BLOCK)); - public static final Supplier GOLDEN_PILLAR = BLOCKS.registerBlock("golden_pillar", + public static final Supplier CHISELED_GOLD = registerSimpleBlock("chiseled_gold", () -> BlockBehaviour.Properties.ofFullCopy(Blocks.GOLD_BLOCK)); + public static final Supplier GOLDEN_TILES = registerSimpleBlock("golden_tiles", () -> BlockBehaviour.Properties.ofFullCopy(Blocks.GOLD_BLOCK)); + public static final Supplier GOLDEN_BRICKS = registerSimpleBlock("golden_bricks", () -> BlockBehaviour.Properties.ofFullCopy(Blocks.GOLD_BLOCK)); + public static final Supplier GOLDEN_BRICK_STAIRS = registerBlock("golden_brick_stairs", props -> stair(ModBlocks.GOLDEN_BRICKS.get(), props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.GOLD_BLOCK)); + public static final Supplier GOLDEN_BRICK_SLAB = registerBlock("golden_brick_slab", SlabBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.GOLD_BLOCK)); + public static final Supplier GOLDEN_PILLAR = registerBlock("golden_pillar", RotatedPillarBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.GOLD_BLOCK)); - public static final Supplier GOLDEN_DOOR = BLOCKS.registerBlock("golden_door", + public static final Supplier GOLDEN_DOOR = registerBlock("golden_door", props -> new DoorBlock(ModBlockSets.GOLD.get(), props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.IRON_DOOR)); - public static final Supplier GOLDEN_TRAPDOOR = BLOCKS.registerBlock("golden_trapdoor", + public static final Supplier GOLDEN_TRAPDOOR = registerBlock("golden_trapdoor", props -> new TrapDoorBlock(ModBlockSets.GOLD.get(), props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.IRON_TRAPDOOR)); - public static final Supplier GOLDEN_BARS = BLOCKS.registerBlock("golden_bars", + public static final Supplier GOLDEN_BARS = registerBlock("golden_bars", IronBarsBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.GOLD_BLOCK)); - public static final Supplier POLISHED_AMETHYST = BLOCKS.registerSimpleBlock("polished_amethyst", () -> BlockBehaviour.Properties.ofFullCopy(Blocks.AMETHYST_BLOCK)); - public static final Supplier CUT_AMETHYST = BLOCKS.registerSimpleBlock("cut_amethyst", () -> BlockBehaviour.Properties.ofFullCopy(Blocks.AMETHYST_BLOCK)); - public static final Supplier CUT_AMETHYST_STAIRS = BLOCKS.registerBlock("cut_amethyst_stairs", props -> stair(ModBlocks.CUT_AMETHYST.get(), props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.AMETHYST_BLOCK)); - public static final Supplier CUT_AMETHYST_SLAB = BLOCKS.registerBlock("cut_amethyst_slab", SlabBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.AMETHYST_BLOCK)); - public static final Supplier AMETHYST_MOSAIC = BLOCKS.registerSimpleBlock("amethyst_mosaic", () -> BlockBehaviour.Properties.ofFullCopy(Blocks.AMETHYST_BLOCK)); - public static final Supplier AMETHYST_MOSAIC_STAIRS = BLOCKS.registerBlock("amethyst_mosaic_stairs", props -> stair(ModBlocks.AMETHYST_MOSAIC.get(), props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.AMETHYST_BLOCK)); - public static final Supplier AMETHYST_MOSAIC_SLAB = BLOCKS.registerBlock("amethyst_mosaic_slab", SlabBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.AMETHYST_BLOCK)); - - public static final Supplier LAPIS_LAZULI_BRICKS = BLOCKS.registerSimpleBlock("lapis_lazuli_bricks", () -> BlockBehaviour.Properties.ofFullCopy(Blocks.LAPIS_BLOCK)); - public static final Supplier LAPIS_LAZULI_BRICK_STAIRS = BLOCKS.registerBlock("lapis_lazuli_brick_stairs", props -> stair(ModBlocks.LAPIS_LAZULI_BRICKS.get(), props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.LAPIS_BLOCK)); - public static final Supplier LAPIS_LAZULI_BRICK_SLAB = BLOCKS.registerBlock("lapis_lazuli_brick_slab", SlabBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.LAPIS_BLOCK)); - public static final Supplier LAPIS_LAZULI_MOSAIC = BLOCKS.registerSimpleBlock("lapis_lazuli_mosaic", () -> BlockBehaviour.Properties.ofFullCopy(Blocks.LAPIS_BLOCK)); - public static final Supplier LAPIS_LAZULI_MOSAIC_STAIRS = BLOCKS.registerBlock("lapis_lazuli_mosaic_stairs", props -> stair(ModBlocks.LAPIS_LAZULI_MOSAIC.get(), props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.LAPIS_BLOCK)); - public static final Supplier LAPIS_LAZULI_MOSAIC_SLAB = BLOCKS.registerBlock("lapis_lazuli_mosaic_slab", SlabBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.LAPIS_BLOCK)); - - public static final Supplier OAK_SEAT = BLOCKS.registerBlock("oak_seat", SeatBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.OAK_PLANKS)); - public static final Supplier SPRUCE_SEAT = BLOCKS.registerBlock("spruce_seat", SeatBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.SPRUCE_PLANKS)); - public static final Supplier BIRCH_SEAT = BLOCKS.registerBlock("birch_seat", SeatBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.BIRCH_PLANKS)); - public static final Supplier JUNGLE_SEAT = BLOCKS.registerBlock("jungle_seat", SeatBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.JUNGLE_PLANKS)); - public static final Supplier ACACIA_SEAT = BLOCKS.registerBlock("acacia_seat", SeatBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.ACACIA_PLANKS)); - public static final Supplier DARK_OAK_SEAT = BLOCKS.registerBlock("dark_oak_seat", SeatBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.DARK_OAK_PLANKS)); - public static final Supplier MANGROVE_SEAT = BLOCKS.registerBlock("mangrove_seat", SeatBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.MANGROVE_PLANKS)); - public static final Supplier CHERRY_SEAT = BLOCKS.registerBlock("cherry_seat", SeatBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.CHERRY_PLANKS)); - public static final Supplier BAMBOO_SEAT = BLOCKS.registerBlock("bamboo_seat", SeatBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.BAMBOO_PLANKS)); - public static final Supplier CRIMSON_SEAT = BLOCKS.registerBlock("crimson_seat", SeatBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.CRIMSON_PLANKS)); - public static final Supplier WARPED_SEAT = BLOCKS.registerBlock("warped_seat", SeatBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.WARPED_PLANKS)); - - public static final Supplier OAK_PALISADE = BLOCKS.registerBlock("oak_palisade", props -> palisade(ModBlocks.SPIKED_OAK_PALISADE, ModBlocks.STRIPPED_OAK_PALISADE, MapColor.WOOD, props), () -> PROPERTIES_PALISADE); - public static final Supplier SPIKED_OAK_PALISADE = BLOCKS.registerBlock("spiked_oak_palisade", props -> spikedPalisade(ModBlocks.STRIPPED_SPIKED_OAK_PALISADE, MapColor.WOOD, props), () -> PROPERTIES_PALISADE); - public static final Supplier SPRUCE_PALISADE = BLOCKS.registerBlock("spruce_palisade", props -> palisade(ModBlocks.SPIKED_SPRUCE_PALISADE, ModBlocks.STRIPPED_SPRUCE_PALISADE, MapColor.PODZOL, props), () -> PROPERTIES_PALISADE); - public static final Supplier SPIKED_SPRUCE_PALISADE = BLOCKS.registerBlock("spiked_spruce_palisade", props -> spikedPalisade(ModBlocks.STRIPPED_SPIKED_SPRUCE_PALISADE, MapColor.PODZOL, props), () -> PROPERTIES_PALISADE); - public static final Supplier BIRCH_PALISADE = BLOCKS.registerBlock("birch_palisade", props -> palisade(ModBlocks.SPIKED_BIRCH_PALISADE, ModBlocks.STRIPPED_BIRCH_PALISADE, MapColor.SAND, props), () -> PROPERTIES_PALISADE); - public static final Supplier SPIKED_BIRCH_PALISADE = BLOCKS.registerBlock("spiked_birch_palisade", props -> spikedPalisade(ModBlocks.STRIPPED_SPIKED_BIRCH_PALISADE, MapColor.SAND, props), () -> PROPERTIES_PALISADE); - public static final Supplier JUNGLE_PALISADE = BLOCKS.registerBlock("jungle_palisade", props -> palisade(ModBlocks.SPIKED_JUNGLE_PALISADE, ModBlocks.STRIPPED_JUNGLE_PALISADE, MapColor.DIRT, props), () -> PROPERTIES_PALISADE); - public static final Supplier SPIKED_JUNGLE_PALISADE = BLOCKS.registerBlock("spiked_jungle_palisade", props -> spikedPalisade(ModBlocks.STRIPPED_SPIKED_JUNGLE_PALISADE, MapColor.DIRT, props), () -> PROPERTIES_PALISADE); - public static final Supplier ACACIA_PALISADE = BLOCKS.registerBlock("acacia_palisade", props -> palisade(ModBlocks.SPIKED_ACACIA_PALISADE, ModBlocks.STRIPPED_ACACIA_PALISADE, MapColor.COLOR_ORANGE, props), () -> PROPERTIES_PALISADE); - public static final Supplier SPIKED_ACACIA_PALISADE = BLOCKS.registerBlock("spiked_acacia_palisade", props -> spikedPalisade(ModBlocks.STRIPPED_SPIKED_ACACIA_PALISADE, MapColor.COLOR_ORANGE, props), () -> PROPERTIES_PALISADE); - public static final Supplier DARK_OAK_PALISADE = BLOCKS.registerBlock("dark_oak_palisade", props -> palisade(ModBlocks.SPIKED_DARK_OAK_PALISADE, ModBlocks.STRIPPED_DARK_OAK_PALISADE, MapColor.COLOR_BROWN, props), () -> PROPERTIES_PALISADE); - public static final Supplier SPIKED_DARK_OAK_PALISADE = BLOCKS.registerBlock("spiked_dark_oak_palisade", props -> spikedPalisade(ModBlocks.STRIPPED_SPIKED_DARK_OAK_PALISADE, MapColor.COLOR_BROWN, props), () -> PROPERTIES_PALISADE); - public static final Supplier MANGROVE_PALISADE = BLOCKS.registerBlock("mangrove_palisade", props -> palisade(ModBlocks.SPIKED_MANGROVE_PALISADE, ModBlocks.STRIPPED_MANGROVE_PALISADE, MapColor.COLOR_RED, props), () -> PROPERTIES_PALISADE); - public static final Supplier SPIKED_MANGROVE_PALISADE = BLOCKS.registerBlock("spiked_mangrove_palisade", props -> spikedPalisade(ModBlocks.STRIPPED_SPIKED_MANGROVE_PALISADE, MapColor.COLOR_RED, props), () -> PROPERTIES_PALISADE); - public static final Supplier CHERRY_PALISADE = BLOCKS.registerBlock("cherry_palisade", props -> palisade(ModBlocks.SPIKED_CHERRY_PALISADE, ModBlocks.STRIPPED_CHERRY_PALISADE, MapColor.TERRACOTTA_WHITE, SoundType.CHERRY_WOOD, props), () -> PROPERTIES_PALISADE); - public static final Supplier SPIKED_CHERRY_PALISADE = BLOCKS.registerBlock("spiked_cherry_palisade", props -> spikedPalisade(ModBlocks.STRIPPED_SPIKED_CHERRY_PALISADE, MapColor.TERRACOTTA_WHITE, SoundType.CHERRY_WOOD, props), () -> PROPERTIES_PALISADE); - public static final Supplier CRIMSON_PALISADE = BLOCKS.registerBlock("crimson_palisade", props -> netherPalisade(ModBlocks.SPIKED_CRIMSON_PALISADE, ModBlocks.STRIPPED_CRIMSON_PALISADE, MapColor.CRIMSON_STEM, props), () -> PROPERTIES_PALISADE); - public static final Supplier SPIKED_CRIMSON_PALISADE = BLOCKS.registerBlock("spiked_crimson_palisade", props -> netherSpikedPalisade(ModBlocks.STRIPPED_SPIKED_CRIMSON_PALISADE, MapColor.CRIMSON_STEM, props), () -> PROPERTIES_PALISADE); - public static final Supplier WARPED_PALISADE = BLOCKS.registerBlock("warped_palisade", props -> netherPalisade(ModBlocks.SPIKED_WARPED_PALISADE, ModBlocks.STRIPPED_WARPED_PALISADE, MapColor.WARPED_STEM, props), () -> PROPERTIES_PALISADE); - public static final Supplier SPIKED_WARPED_PALISADE = BLOCKS.registerBlock("spiked_warped_palisade", props -> netherSpikedPalisade(ModBlocks.STRIPPED_SPIKED_WARPED_PALISADE, MapColor.WARPED_STEM, props), () -> PROPERTIES_PALISADE); - - public static final Supplier STRIPPED_OAK_PALISADE = BLOCKS.registerBlock("stripped_oak_palisade", props -> palisade(ModBlocks.STRIPPED_SPIKED_OAK_PALISADE, null, MapColor.WOOD, props), () -> PROPERTIES_PALISADE); - public static final Supplier STRIPPED_SPIKED_OAK_PALISADE = BLOCKS.registerBlock("stripped_spiked_oak_palisade", props -> spikedPalisade(null, MapColor.WOOD, props), () -> PROPERTIES_PALISADE); - public static final Supplier STRIPPED_SPRUCE_PALISADE = BLOCKS.registerBlock("stripped_spruce_palisade", props -> palisade(ModBlocks.STRIPPED_SPIKED_SPRUCE_PALISADE, null, MapColor.PODZOL, props), () -> PROPERTIES_PALISADE); - public static final Supplier STRIPPED_SPIKED_SPRUCE_PALISADE = BLOCKS.registerBlock("stripped_spiked_spruce_palisade", props -> spikedPalisade(null, MapColor.PODZOL, props), () -> PROPERTIES_PALISADE); - public static final Supplier STRIPPED_BIRCH_PALISADE = BLOCKS.registerBlock("stripped_birch_palisade", props -> palisade(ModBlocks.STRIPPED_SPIKED_BIRCH_PALISADE, null, MapColor.SAND, props), () -> PROPERTIES_PALISADE); - public static final Supplier STRIPPED_SPIKED_BIRCH_PALISADE = BLOCKS.registerBlock("stripped_spiked_birch_palisade", props -> spikedPalisade(null, MapColor.SAND, props), () -> PROPERTIES_PALISADE); - public static final Supplier STRIPPED_JUNGLE_PALISADE = BLOCKS.registerBlock("stripped_jungle_palisade", props -> palisade(ModBlocks.STRIPPED_SPIKED_JUNGLE_PALISADE, null, MapColor.DIRT, props), () -> PROPERTIES_PALISADE); - public static final Supplier STRIPPED_SPIKED_JUNGLE_PALISADE = BLOCKS.registerBlock("stripped_spiked_jungle_palisade", props -> spikedPalisade(null, MapColor.DIRT, props), () -> PROPERTIES_PALISADE); - public static final Supplier STRIPPED_ACACIA_PALISADE = BLOCKS.registerBlock("stripped_acacia_palisade", props -> palisade(ModBlocks.STRIPPED_SPIKED_ACACIA_PALISADE, null, MapColor.COLOR_ORANGE, props), () -> PROPERTIES_PALISADE); - public static final Supplier STRIPPED_SPIKED_ACACIA_PALISADE = BLOCKS.registerBlock("stripped_spiked_acacia_palisade", props -> spikedPalisade(null, MapColor.COLOR_ORANGE, props), () -> PROPERTIES_PALISADE); - public static final Supplier STRIPPED_DARK_OAK_PALISADE = BLOCKS.registerBlock("stripped_dark_oak_palisade", props -> palisade(ModBlocks.STRIPPED_SPIKED_DARK_OAK_PALISADE, null, MapColor.COLOR_BROWN, props), () -> PROPERTIES_PALISADE); - public static final Supplier STRIPPED_SPIKED_DARK_OAK_PALISADE = BLOCKS.registerBlock("stripped_spiked_dark_oak_palisade", props -> spikedPalisade(null, MapColor.COLOR_BROWN, props), () -> PROPERTIES_PALISADE); - public static final Supplier STRIPPED_MANGROVE_PALISADE = BLOCKS.registerBlock("stripped_mangrove_palisade", props -> palisade(ModBlocks.STRIPPED_SPIKED_MANGROVE_PALISADE, null, MapColor.COLOR_RED, props), () -> PROPERTIES_PALISADE); - public static final Supplier STRIPPED_SPIKED_MANGROVE_PALISADE = BLOCKS.registerBlock("stripped_spiked_mangrove_palisade", props -> spikedPalisade(null, MapColor.COLOR_RED, props), () -> PROPERTIES_PALISADE); - public static final Supplier STRIPPED_CHERRY_PALISADE = BLOCKS.registerBlock("stripped_cherry_palisade", props -> palisade(ModBlocks.STRIPPED_SPIKED_CHERRY_PALISADE, null, MapColor.TERRACOTTA_WHITE, SoundType.CHERRY_WOOD, props), () -> PROPERTIES_PALISADE); - public static final Supplier STRIPPED_SPIKED_CHERRY_PALISADE = BLOCKS.registerBlock("stripped_spiked_cherry_palisade", props -> spikedPalisade(null, MapColor.TERRACOTTA_WHITE, SoundType.CHERRY_WOOD, props), () -> PROPERTIES_PALISADE); - public static final Supplier STRIPPED_CRIMSON_PALISADE = BLOCKS.registerBlock("stripped_crimson_palisade", props -> netherPalisade(ModBlocks.STRIPPED_SPIKED_CRIMSON_PALISADE, null, MapColor.CRIMSON_STEM, props), () -> PROPERTIES_PALISADE); - public static final Supplier STRIPPED_SPIKED_CRIMSON_PALISADE = BLOCKS.registerBlock("stripped_spiked_crimson_palisade", props -> netherSpikedPalisade(null, MapColor.CRIMSON_STEM, props), () -> PROPERTIES_PALISADE); - public static final Supplier STRIPPED_WARPED_PALISADE = BLOCKS.registerBlock("stripped_warped_palisade", props -> netherPalisade(ModBlocks.STRIPPED_SPIKED_WARPED_PALISADE, null, MapColor.WARPED_STEM, props), () -> PROPERTIES_PALISADE); - public static final Supplier STRIPPED_SPIKED_WARPED_PALISADE = BLOCKS.registerBlock("stripped_spiked_warped_palisade", props -> netherSpikedPalisade(null, MapColor.WARPED_STEM, props), () -> PROPERTIES_PALISADE); - - - public static final Supplier BRAZIER = BLOCKS.registerBlock("brazier", props -> new BrazierBlock(1, props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.LANTERN) + public static final Supplier POLISHED_AMETHYST = registerSimpleBlock("polished_amethyst", () -> BlockBehaviour.Properties.ofFullCopy(Blocks.AMETHYST_BLOCK)); + public static final Supplier CUT_AMETHYST = registerSimpleBlock("cut_amethyst", () -> BlockBehaviour.Properties.ofFullCopy(Blocks.AMETHYST_BLOCK)); + public static final Supplier CUT_AMETHYST_STAIRS = registerBlock("cut_amethyst_stairs", props -> stair(ModBlocks.CUT_AMETHYST.get(), props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.AMETHYST_BLOCK)); + public static final Supplier CUT_AMETHYST_SLAB = registerBlock("cut_amethyst_slab", SlabBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.AMETHYST_BLOCK)); + public static final Supplier AMETHYST_MOSAIC = registerSimpleBlock("amethyst_mosaic", () -> BlockBehaviour.Properties.ofFullCopy(Blocks.AMETHYST_BLOCK)); + public static final Supplier AMETHYST_MOSAIC_STAIRS = registerBlock("amethyst_mosaic_stairs", props -> stair(ModBlocks.AMETHYST_MOSAIC.get(), props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.AMETHYST_BLOCK)); + public static final Supplier AMETHYST_MOSAIC_SLAB = registerBlock("amethyst_mosaic_slab", SlabBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.AMETHYST_BLOCK)); + + public static final Supplier LAPIS_LAZULI_BRICKS = registerSimpleBlock("lapis_lazuli_bricks", () -> BlockBehaviour.Properties.ofFullCopy(Blocks.LAPIS_BLOCK)); + public static final Supplier LAPIS_LAZULI_BRICK_STAIRS = registerBlock("lapis_lazuli_brick_stairs", props -> stair(ModBlocks.LAPIS_LAZULI_BRICKS.get(), props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.LAPIS_BLOCK)); + public static final Supplier LAPIS_LAZULI_BRICK_SLAB = registerBlock("lapis_lazuli_brick_slab", SlabBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.LAPIS_BLOCK)); + public static final Supplier LAPIS_LAZULI_MOSAIC = registerSimpleBlock("lapis_lazuli_mosaic", () -> BlockBehaviour.Properties.ofFullCopy(Blocks.LAPIS_BLOCK)); + public static final Supplier LAPIS_LAZULI_MOSAIC_STAIRS = registerBlock("lapis_lazuli_mosaic_stairs", props -> stair(ModBlocks.LAPIS_LAZULI_MOSAIC.get(), props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.LAPIS_BLOCK)); + public static final Supplier LAPIS_LAZULI_MOSAIC_SLAB = registerBlock("lapis_lazuli_mosaic_slab", SlabBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.LAPIS_BLOCK)); + + public static final Supplier OAK_SEAT = registerBlock("oak_seat", SeatBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.OAK_PLANKS)); + public static final Supplier SPRUCE_SEAT = registerBlock("spruce_seat", SeatBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.SPRUCE_PLANKS)); + public static final Supplier BIRCH_SEAT = registerBlock("birch_seat", SeatBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.BIRCH_PLANKS)); + public static final Supplier JUNGLE_SEAT = registerBlock("jungle_seat", SeatBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.JUNGLE_PLANKS)); + public static final Supplier ACACIA_SEAT = registerBlock("acacia_seat", SeatBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.ACACIA_PLANKS)); + public static final Supplier DARK_OAK_SEAT = registerBlock("dark_oak_seat", SeatBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.DARK_OAK_PLANKS)); + public static final Supplier MANGROVE_SEAT = registerBlock("mangrove_seat", SeatBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.MANGROVE_PLANKS)); + public static final Supplier CHERRY_SEAT = registerBlock("cherry_seat", SeatBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.CHERRY_PLANKS)); + public static final Supplier BAMBOO_SEAT = registerBlock("bamboo_seat", SeatBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.BAMBOO_PLANKS)); + public static final Supplier CRIMSON_SEAT = registerBlock("crimson_seat", SeatBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.CRIMSON_PLANKS)); + public static final Supplier WARPED_SEAT = registerBlock("warped_seat", SeatBlock::new, () -> BlockBehaviour.Properties.ofFullCopy(Blocks.WARPED_PLANKS)); + public static final Supplier OAK_PALISADE = registerBlock("oak_palisade", props -> palisade(ModBlocks.SPIKED_OAK_PALISADE, ModBlocks.STRIPPED_OAK_PALISADE, MapColor.WOOD, props), () -> PROPERTIES_PALISADE); + public static final Supplier SPIKED_OAK_PALISADE = registerBlock("spiked_oak_palisade", props -> spikedPalisade(ModBlocks.STRIPPED_SPIKED_OAK_PALISADE, MapColor.WOOD, props), () -> PROPERTIES_PALISADE); + public static final Supplier SPRUCE_PALISADE = registerBlock("spruce_palisade", props -> palisade(ModBlocks.SPIKED_SPRUCE_PALISADE, ModBlocks.STRIPPED_SPRUCE_PALISADE, MapColor.PODZOL, props), () -> PROPERTIES_PALISADE); + public static final Supplier SPIKED_SPRUCE_PALISADE = registerBlock("spiked_spruce_palisade", props -> spikedPalisade(ModBlocks.STRIPPED_SPIKED_SPRUCE_PALISADE, MapColor.PODZOL, props), () -> PROPERTIES_PALISADE); + public static final Supplier BIRCH_PALISADE = registerBlock("birch_palisade", props -> palisade(ModBlocks.SPIKED_BIRCH_PALISADE, ModBlocks.STRIPPED_BIRCH_PALISADE, MapColor.SAND, props), () -> PROPERTIES_PALISADE); + public static final Supplier SPIKED_BIRCH_PALISADE = registerBlock("spiked_birch_palisade", props -> spikedPalisade(ModBlocks.STRIPPED_SPIKED_BIRCH_PALISADE, MapColor.SAND, props), () -> PROPERTIES_PALISADE); + public static final Supplier JUNGLE_PALISADE = registerBlock("jungle_palisade", props -> palisade(ModBlocks.SPIKED_JUNGLE_PALISADE, ModBlocks.STRIPPED_JUNGLE_PALISADE, MapColor.DIRT, props), () -> PROPERTIES_PALISADE); + public static final Supplier SPIKED_JUNGLE_PALISADE = registerBlock("spiked_jungle_palisade", props -> spikedPalisade(ModBlocks.STRIPPED_SPIKED_JUNGLE_PALISADE, MapColor.DIRT, props), () -> PROPERTIES_PALISADE); + public static final Supplier ACACIA_PALISADE = registerBlock("acacia_palisade", props -> palisade(ModBlocks.SPIKED_ACACIA_PALISADE, ModBlocks.STRIPPED_ACACIA_PALISADE, MapColor.COLOR_ORANGE, props), () -> PROPERTIES_PALISADE); + public static final Supplier SPIKED_ACACIA_PALISADE = registerBlock("spiked_acacia_palisade", props -> spikedPalisade(ModBlocks.STRIPPED_SPIKED_ACACIA_PALISADE, MapColor.COLOR_ORANGE, props), () -> PROPERTIES_PALISADE); + public static final Supplier DARK_OAK_PALISADE = registerBlock("dark_oak_palisade", props -> palisade(ModBlocks.SPIKED_DARK_OAK_PALISADE, ModBlocks.STRIPPED_DARK_OAK_PALISADE, MapColor.COLOR_BROWN, props), () -> PROPERTIES_PALISADE); + public static final Supplier SPIKED_DARK_OAK_PALISADE = registerBlock("spiked_dark_oak_palisade", props -> spikedPalisade(ModBlocks.STRIPPED_SPIKED_DARK_OAK_PALISADE, MapColor.COLOR_BROWN, props), () -> PROPERTIES_PALISADE); + public static final Supplier MANGROVE_PALISADE = registerBlock("mangrove_palisade", props -> palisade(ModBlocks.SPIKED_MANGROVE_PALISADE, ModBlocks.STRIPPED_MANGROVE_PALISADE, MapColor.COLOR_RED, props), () -> PROPERTIES_PALISADE); + public static final Supplier SPIKED_MANGROVE_PALISADE = registerBlock("spiked_mangrove_palisade", props -> spikedPalisade(ModBlocks.STRIPPED_SPIKED_MANGROVE_PALISADE, MapColor.COLOR_RED, props), () -> PROPERTIES_PALISADE); + public static final Supplier CHERRY_PALISADE = registerBlock("cherry_palisade", props -> palisade(ModBlocks.SPIKED_CHERRY_PALISADE, ModBlocks.STRIPPED_CHERRY_PALISADE, MapColor.TERRACOTTA_WHITE, SoundType.CHERRY_WOOD, props), () -> PROPERTIES_PALISADE); + public static final Supplier SPIKED_CHERRY_PALISADE = registerBlock("spiked_cherry_palisade", props -> spikedPalisade(ModBlocks.STRIPPED_SPIKED_CHERRY_PALISADE, MapColor.TERRACOTTA_WHITE, SoundType.CHERRY_WOOD, props), () -> PROPERTIES_PALISADE); + public static final Supplier CRIMSON_PALISADE = registerBlock("crimson_palisade", props -> netherPalisade(ModBlocks.SPIKED_CRIMSON_PALISADE, ModBlocks.STRIPPED_CRIMSON_PALISADE, MapColor.CRIMSON_STEM, props), () -> PROPERTIES_PALISADE); + public static final Supplier SPIKED_CRIMSON_PALISADE = registerBlock("spiked_crimson_palisade", props -> netherSpikedPalisade(ModBlocks.STRIPPED_SPIKED_CRIMSON_PALISADE, MapColor.CRIMSON_STEM, props), () -> PROPERTIES_PALISADE); + public static final Supplier WARPED_PALISADE = registerBlock("warped_palisade", props -> netherPalisade(ModBlocks.SPIKED_WARPED_PALISADE, ModBlocks.STRIPPED_WARPED_PALISADE, MapColor.WARPED_STEM, props), () -> PROPERTIES_PALISADE); + public static final Supplier SPIKED_WARPED_PALISADE = registerBlock("spiked_warped_palisade", props -> netherSpikedPalisade(ModBlocks.STRIPPED_SPIKED_WARPED_PALISADE, MapColor.WARPED_STEM, props), () -> PROPERTIES_PALISADE); + + public static final Supplier STRIPPED_OAK_PALISADE = registerBlock("stripped_oak_palisade", props -> palisade(ModBlocks.STRIPPED_SPIKED_OAK_PALISADE, null, MapColor.WOOD, props), () -> PROPERTIES_PALISADE); + public static final Supplier STRIPPED_SPIKED_OAK_PALISADE = registerBlock("stripped_spiked_oak_palisade", props -> spikedPalisade(null, MapColor.WOOD, props), () -> PROPERTIES_PALISADE); + public static final Supplier STRIPPED_SPRUCE_PALISADE = registerBlock("stripped_spruce_palisade", props -> palisade(ModBlocks.STRIPPED_SPIKED_SPRUCE_PALISADE, null, MapColor.PODZOL, props), () -> PROPERTIES_PALISADE); + public static final Supplier STRIPPED_SPIKED_SPRUCE_PALISADE = registerBlock("stripped_spiked_spruce_palisade", props -> spikedPalisade(null, MapColor.PODZOL, props), () -> PROPERTIES_PALISADE); + public static final Supplier STRIPPED_BIRCH_PALISADE = registerBlock("stripped_birch_palisade", props -> palisade(ModBlocks.STRIPPED_SPIKED_BIRCH_PALISADE, null, MapColor.SAND, props), () -> PROPERTIES_PALISADE); + public static final Supplier STRIPPED_SPIKED_BIRCH_PALISADE = registerBlock("stripped_spiked_birch_palisade", props -> spikedPalisade(null, MapColor.SAND, props), () -> PROPERTIES_PALISADE); + public static final Supplier STRIPPED_JUNGLE_PALISADE = registerBlock("stripped_jungle_palisade", props -> palisade(ModBlocks.STRIPPED_SPIKED_JUNGLE_PALISADE, null, MapColor.DIRT, props), () -> PROPERTIES_PALISADE); + public static final Supplier STRIPPED_SPIKED_JUNGLE_PALISADE = registerBlock("stripped_spiked_jungle_palisade", props -> spikedPalisade(null, MapColor.DIRT, props), () -> PROPERTIES_PALISADE); + public static final Supplier STRIPPED_ACACIA_PALISADE = registerBlock("stripped_acacia_palisade", props -> palisade(ModBlocks.STRIPPED_SPIKED_ACACIA_PALISADE, null, MapColor.COLOR_ORANGE, props), () -> PROPERTIES_PALISADE); + public static final Supplier STRIPPED_SPIKED_ACACIA_PALISADE = registerBlock("stripped_spiked_acacia_palisade", props -> spikedPalisade(null, MapColor.COLOR_ORANGE, props), () -> PROPERTIES_PALISADE); + public static final Supplier STRIPPED_DARK_OAK_PALISADE = registerBlock("stripped_dark_oak_palisade", props -> palisade(ModBlocks.STRIPPED_SPIKED_DARK_OAK_PALISADE, null, MapColor.COLOR_BROWN, props), () -> PROPERTIES_PALISADE); + public static final Supplier STRIPPED_SPIKED_DARK_OAK_PALISADE = registerBlock("stripped_spiked_dark_oak_palisade", props -> spikedPalisade(null, MapColor.COLOR_BROWN, props), () -> PROPERTIES_PALISADE); + public static final Supplier STRIPPED_MANGROVE_PALISADE = registerBlock("stripped_mangrove_palisade", props -> palisade(ModBlocks.STRIPPED_SPIKED_MANGROVE_PALISADE, null, MapColor.COLOR_RED, props), () -> PROPERTIES_PALISADE); + public static final Supplier STRIPPED_SPIKED_MANGROVE_PALISADE = registerBlock("stripped_spiked_mangrove_palisade", props -> spikedPalisade(null, MapColor.COLOR_RED, props), () -> PROPERTIES_PALISADE); + public static final Supplier STRIPPED_CHERRY_PALISADE = registerBlock("stripped_cherry_palisade", props -> palisade(ModBlocks.STRIPPED_SPIKED_CHERRY_PALISADE, null, MapColor.TERRACOTTA_WHITE, SoundType.CHERRY_WOOD, props), () -> PROPERTIES_PALISADE); + public static final Supplier STRIPPED_SPIKED_CHERRY_PALISADE = registerBlock("stripped_spiked_cherry_palisade", props -> spikedPalisade(null, MapColor.TERRACOTTA_WHITE, SoundType.CHERRY_WOOD, props), () -> PROPERTIES_PALISADE); + public static final Supplier STRIPPED_CRIMSON_PALISADE = registerBlock("stripped_crimson_palisade", props -> netherPalisade(ModBlocks.STRIPPED_SPIKED_CRIMSON_PALISADE, null, MapColor.CRIMSON_STEM, props), () -> PROPERTIES_PALISADE); + public static final Supplier STRIPPED_SPIKED_CRIMSON_PALISADE = registerBlock("stripped_spiked_crimson_palisade", props -> netherSpikedPalisade(null, MapColor.CRIMSON_STEM, props), () -> PROPERTIES_PALISADE); + public static final Supplier STRIPPED_WARPED_PALISADE = registerBlock("stripped_warped_palisade", props -> netherPalisade(ModBlocks.STRIPPED_SPIKED_WARPED_PALISADE, null, MapColor.WARPED_STEM, props), () -> PROPERTIES_PALISADE); + public static final Supplier STRIPPED_SPIKED_WARPED_PALISADE = registerBlock("stripped_spiked_warped_palisade", props -> netherSpikedPalisade(null, MapColor.WARPED_STEM, props), () -> PROPERTIES_PALISADE); + + + public static final Supplier BRAZIER = registerBlock("brazier", props -> new BrazierBlock(1, props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.LANTERN) .lightLevel(litBlockEmission(15)) ); - public static final Supplier SOUL_BRAZIER = BLOCKS.registerBlock("soul_brazier", props -> new BrazierBlock(2, props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.SOUL_LANTERN) + public static final Supplier SOUL_BRAZIER = registerBlock("soul_brazier", props -> new BrazierBlock(2, props), () -> BlockBehaviour.Properties.ofFullCopy(Blocks.SOUL_LANTERN) .lightLevel(litBlockEmission(10)) ); - public static final Supplier WHITE_SKY_LANTERN = BLOCKS.registerBlock("white_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.SNOW)); - public static final Supplier LIGHT_GRAY_SKY_LANTERN = BLOCKS.registerBlock("light_gray_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.COLOR_LIGHT_GRAY)); - public static final Supplier GRAY_SKY_LANTERN = BLOCKS.registerBlock("gray_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.COLOR_GRAY)); - public static final Supplier BLACK_SKY_LANTERN = BLOCKS.registerBlock("black_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.COLOR_BLACK)); - public static final Supplier BROWN_SKY_LANTERN = BLOCKS.registerBlock("brown_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.COLOR_BROWN)); - public static final Supplier RED_SKY_LANTERN = BLOCKS.registerBlock("red_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.COLOR_RED)); - public static final Supplier ORANGE_SKY_LANTERN = BLOCKS.registerBlock("orange_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.COLOR_ORANGE)); - public static final Supplier YELLOW_SKY_LANTERN = BLOCKS.registerBlock("yellow_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.COLOR_YELLOW)); - public static final Supplier LIME_SKY_LANTERN = BLOCKS.registerBlock("lime_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.COLOR_LIGHT_GREEN)); - public static final Supplier GREEN_SKY_LANTERN = BLOCKS.registerBlock("green_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.COLOR_GREEN)); - public static final Supplier CYAN_SKY_LANTERN = BLOCKS.registerBlock("cyan_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.COLOR_CYAN)); - public static final Supplier LIGHT_BLUE_SKY_LANTERN = BLOCKS.registerBlock("light_blue_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.COLOR_LIGHT_BLUE)); - public static final Supplier BLUE_SKY_LANTERN = BLOCKS.registerBlock("blue_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.COLOR_BLUE)); - public static final Supplier PURPLE_SKY_LANTERN = BLOCKS.registerBlock("purple_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.COLOR_PURPLE)); - public static final Supplier MAGENTA_SKY_LANTERN = BLOCKS.registerBlock("magenta_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.COLOR_MAGENTA)); - public static final Supplier PINK_SKY_LANTERN = BLOCKS.registerBlock("pink_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.COLOR_PINK)); + public static final Supplier WHITE_SKY_LANTERN = registerBlock("white_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.SNOW)); + public static final Supplier LIGHT_GRAY_SKY_LANTERN = registerBlock("light_gray_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.COLOR_LIGHT_GRAY)); + public static final Supplier GRAY_SKY_LANTERN = registerBlock("gray_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.COLOR_GRAY)); + public static final Supplier BLACK_SKY_LANTERN = registerBlock("black_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.COLOR_BLACK)); + public static final Supplier BROWN_SKY_LANTERN = registerBlock("brown_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.COLOR_BROWN)); + public static final Supplier RED_SKY_LANTERN = registerBlock("red_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.COLOR_RED)); + public static final Supplier ORANGE_SKY_LANTERN = registerBlock("orange_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.COLOR_ORANGE)); + public static final Supplier YELLOW_SKY_LANTERN = registerBlock("yellow_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.COLOR_YELLOW)); + public static final Supplier LIME_SKY_LANTERN = registerBlock("lime_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.COLOR_LIGHT_GREEN)); + public static final Supplier GREEN_SKY_LANTERN = registerBlock("green_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.COLOR_GREEN)); + public static final Supplier CYAN_SKY_LANTERN = registerBlock("cyan_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.COLOR_CYAN)); + public static final Supplier LIGHT_BLUE_SKY_LANTERN = registerBlock("light_blue_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.COLOR_LIGHT_BLUE)); + public static final Supplier BLUE_SKY_LANTERN = registerBlock("blue_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.COLOR_BLUE)); + public static final Supplier PURPLE_SKY_LANTERN = registerBlock("purple_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.COLOR_PURPLE)); + public static final Supplier MAGENTA_SKY_LANTERN = registerBlock("magenta_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.COLOR_MAGENTA)); + public static final Supplier PINK_SKY_LANTERN = registerBlock("pink_sky_lantern", SkyLanternBlock::new, () -> PROPERTIES_SKY_LANTERN.mapColor(MapColor.COLOR_PINK)); + + + private static Supplier registerBlock(String name, Function blockFactory, Supplier settings) { + ResourceKey blockKey = ResourceKey.create(Registries.BLOCK, Identifier.fromNamespaceAndPath(BlockBox.MODID, name)); + Block block = Registry.register(BuiltInRegistries.BLOCK, blockKey, blockFactory.apply(settings.get().setId(blockKey))); + return ()->block; + } + + private static Supplier registerSimpleBlock(String name, Supplier propertiesSupplier) { + return registerBlock(name, Block::new, propertiesSupplier); + } private static ToIntFunction litBlockEmission(int lightValue) { return state -> state.getValue(BlockStateProperties.LIT) ? lightValue : 0; @@ -236,4 +252,8 @@ private static Block spikedPalisade(@Nullable Supplier strippedForm, MapC private static Block netherSpikedPalisade(@Nullable Supplier strippedForm, MapColor mapColor, BlockBehaviour.Properties properties) { return new SpikedPalisadeBlock(strippedForm, properties.mapColor(mapColor).sound(SoundType.STEM)); } + + public static void register() { + + } } diff --git a/src/main/java/vectorwing/blockbox/common/registry/ModCreativeTabs.java b/src/main/java/vectorwing/blockbox/common/registry/ModCreativeTabs.java index 4c7f1512..88b163f5 100644 --- a/src/main/java/vectorwing/blockbox/common/registry/ModCreativeTabs.java +++ b/src/main/java/vectorwing/blockbox/common/registry/ModCreativeTabs.java @@ -1,19 +1,38 @@ package vectorwing.blockbox.common.registry; +//? fabric +/*import net.fabricmc.fabric.api.creativetab.v1.FabricCreativeModeTab;*/ +import net.minecraft.core.Registry; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.Registries; import net.minecraft.network.chat.Component; +import net.minecraft.resources.Identifier; import net.minecraft.world.item.CreativeModeTab; -import net.neoforged.neoforge.registries.DeferredHolder; -import net.neoforged.neoforge.registries.DeferredRegister; import vectorwing.blockbox.BlockBox; +import java.util.function.Supplier; + public class ModCreativeTabs { - public static final DeferredRegister CREATIVE_MODE_TABS = DeferredRegister.create(Registries.CREATIVE_MODE_TAB, BlockBox.MODID); - public static final DeferredHolder TAB_BLOCK_BOX = CREATIVE_MODE_TABS.register("example_tab", () -> CreativeModeTab.builder() + public static final Supplier TAB_BLOCK_BOX = register("example_tab", () -> + //? fabric + /*FabricCreativeModeTab.builder()*/ + //? neoforge + CreativeModeTab.builder() .title(Component.translatable("itemGroup." + BlockBox.MODID)) .icon(() -> ModItems.CHISELED_GOLD.get().getDefaultInstance()) - .displayItems((parameters, output) -> ModItems.CREATIVE_TAB_ITEMS.forEach((item) -> output.accept(item.get()))) + .displayItems((parameters, output) -> ModItems.CREATIVE_TAB_ITEMS.forEach((item) -> { + output.accept(item.get()); + })) .build()); + + private static Supplier register(String name, Supplier tabSupplier) { + CreativeModeTab tab = Registry.register(BuiltInRegistries.CREATIVE_MODE_TAB, Identifier.fromNamespaceAndPath(BlockBox.MODID, name), tabSupplier.get()); + return ()->tab; + } + + public static void register() { + + } } diff --git a/src/main/java/vectorwing/blockbox/common/registry/ModEntityTypes.java b/src/main/java/vectorwing/blockbox/common/registry/ModEntityTypes.java index 9d9ac072..c49803cf 100644 --- a/src/main/java/vectorwing/blockbox/common/registry/ModEntityTypes.java +++ b/src/main/java/vectorwing/blockbox/common/registry/ModEntityTypes.java @@ -1,20 +1,39 @@ package vectorwing.blockbox.common.registry; +import net.minecraft.core.Registry; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.core.registries.Registries; +import net.minecraft.resources.Identifier; +import net.minecraft.resources.ResourceKey; +import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.MobCategory; -import net.neoforged.neoforge.registries.DeferredRegister; import vectorwing.blockbox.BlockBox; import vectorwing.blockbox.common.entity.SeatEntity; +import java.util.function.Function; import java.util.function.Supplier; +import java.util.function.UnaryOperator; public class ModEntityTypes { - public static final DeferredRegister.Entities ENTITY_TYPES = DeferredRegister.createEntities(BlockBox.MODID); - public static final Supplier> SEAT = ENTITY_TYPES.registerEntityType("seat", + public static final Supplier> SEAT = registerEntityType("seat", SeatEntity::new, MobCategory.MISC, builder -> builder .sized(0.25f, 0.35f) .clientTrackingRange(3) .updateInterval(Integer.MAX_VALUE)); + + public static Supplier> registerEntityType(String name, EntityType.EntityFactory factory, MobCategory category, UnaryOperator> builder) { + return register(name, key -> builder.apply(EntityType.Builder.of(factory, category)).build(ResourceKey.create(Registries.ENTITY_TYPE, key))); + } + + public static > Supplier register(final String name, final Function func) { + ResourceKey> key = ResourceKey.create(Registries.ENTITY_TYPE, Identifier.fromNamespaceAndPath(BlockBox.MODID, name)); + T apply = Registry.register(BuiltInRegistries.ENTITY_TYPE, key, func.apply(key.identifier())); + return ()-> apply; + } + + public static void register() { + } } diff --git a/src/main/java/vectorwing/blockbox/common/registry/ModItems.java b/src/main/java/vectorwing/blockbox/common/registry/ModItems.java index 17498e83..3ba297b3 100644 --- a/src/main/java/vectorwing/blockbox/common/registry/ModItems.java +++ b/src/main/java/vectorwing/blockbox/common/registry/ModItems.java @@ -1,12 +1,16 @@ package vectorwing.blockbox.common.registry; import com.google.common.collect.Sets; +import net.minecraft.core.Registry; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.core.registries.Registries; +import net.minecraft.resources.Identifier; +import net.minecraft.resources.ResourceKey; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.Item; import net.minecraft.world.item.Items; import net.minecraft.world.level.ItemLike; import net.minecraft.world.level.block.Block; -import net.neoforged.neoforge.registries.DeferredRegister; import vectorwing.blockbox.BlockBox; import vectorwing.blockbox.common.event.VanillaTabOrdering; import vectorwing.blockbox.common.item.SkyLanternItem; @@ -21,13 +25,13 @@ @SuppressWarnings("unused") public class ModItems { - public static final DeferredRegister.Items ITEMS = DeferredRegister.createItems(BlockBox.MODID); public static LinkedHashSet> CREATIVE_TAB_ITEMS = Sets.newLinkedHashSet(); - public static Supplier registerItem(final String name, final Function function) { - Supplier block = ITEMS.registerItem(name, function); - CREATIVE_TAB_ITEMS.add(block); - return block; + public static Supplier registerItem(final String name, final Function function) { + Identifier id = Identifier.fromNamespaceAndPath(BlockBox.MODID, name); + T block = Registry.register(BuiltInRegistries.ITEM, id, function.apply(new Item.Properties().setId(ResourceKey.create(Registries.ITEM, id)))); + CREATIVE_TAB_ITEMS.add(()->block); + return ()-> block; } public static Supplier registerItem(final String name, final Function function, final Item vanillaTabNeighbor, LinkedHashMap, ItemLike> vanillaTab) { @@ -37,9 +41,7 @@ public static Supplier registerItem(final String name, final Function registerSimpleBlockItem(final String name, final Supplier supplier) { - Supplier block = ITEMS.registerSimpleBlockItem(name, supplier); - CREATIVE_TAB_ITEMS.add(block); - return block; + return registerItem(name, properties -> new BlockItem(supplier.get(), properties.useBlockDescriptionPrefix())); } public static Supplier registerSimpleBlockItem(final String name, final Supplier supplier, final Item vanillaTabNeighbor) { @@ -222,4 +224,8 @@ public static Supplier registerSimpleBlockItem(final String name, fin private static Function skyLantern(Supplier block) { return properties -> new SkyLanternItem(block.get(), properties.useBlockDescriptionPrefix()); } + + public static void register() { + + } } diff --git a/src/main/java/vectorwing/blockbox/common/registry/ModParticleTypes.java b/src/main/java/vectorwing/blockbox/common/registry/ModParticleTypes.java index d5b87cc5..2b52703d 100644 --- a/src/main/java/vectorwing/blockbox/common/registry/ModParticleTypes.java +++ b/src/main/java/vectorwing/blockbox/common/registry/ModParticleTypes.java @@ -1,17 +1,25 @@ package vectorwing.blockbox.common.registry; -import net.minecraft.core.particles.ParticleType; +import net.minecraft.core.Registry; import net.minecraft.core.particles.SimpleParticleType; -import net.minecraft.core.registries.Registries; -import net.neoforged.neoforge.registries.DeferredRegister; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.resources.Identifier; import vectorwing.blockbox.BlockBox; import java.util.function.Supplier; public class ModParticleTypes { - public static final DeferredRegister> PARTICLE_TYPES = DeferredRegister.create(Registries.PARTICLE_TYPE, BlockBox.MODID); - public static final Supplier SPARKLE = PARTICLE_TYPES.register("sparkle", + public static final Supplier SPARKLE = register("sparkle", () -> new SimpleParticleType(true)); + + private static Supplier register(String name, Supplier tabSupplier) { + SimpleParticleType tab = Registry.register(BuiltInRegistries.PARTICLE_TYPE, Identifier.fromNamespaceAndPath(BlockBox.MODID, name), tabSupplier.get()); + return ()->tab; + } + + public static void register() { + + } } diff --git a/src/main/java/vectorwing/blockbox/common/registry/ModSounds.java b/src/main/java/vectorwing/blockbox/common/registry/ModSounds.java index ad97857f..07a1e9b3 100644 --- a/src/main/java/vectorwing/blockbox/common/registry/ModSounds.java +++ b/src/main/java/vectorwing/blockbox/common/registry/ModSounds.java @@ -1,18 +1,27 @@ package vectorwing.blockbox.common.registry; +import net.minecraft.core.Registry; +import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.Registries; import net.minecraft.resources.Identifier; import net.minecraft.sounds.SoundEvent; -import net.neoforged.neoforge.registries.DeferredRegister; import vectorwing.blockbox.BlockBox; import java.util.function.Supplier; public class ModSounds { - public static final DeferredRegister SOUNDS = DeferredRegister.create(Registries.SOUND_EVENT, BlockBox.MODID); // Stove - public static final Supplier ITEM_SWORD_CARVE = SOUNDS.register("item.sword.carve", + public static final Supplier ITEM_SWORD_CARVE = register("item.sword.carve", () -> SoundEvent.createVariableRangeEvent(Identifier.fromNamespaceAndPath(BlockBox.MODID, "item.sword.carve"))); + + private static Supplier register(String name, Supplier supplier) { + SoundEvent register = Registry.register(BuiltInRegistries.SOUND_EVENT, Identifier.fromNamespaceAndPath(BlockBox.MODID, name), supplier.get()); + return ()->register; + } + + public static void register() { + + } } diff --git a/src/main/java/vectorwing/blockbox/common/registry/RegistryAliases.java b/src/main/java/vectorwing/blockbox/common/registry/RegistryAliases.java index 885937aa..9be3c4db 100644 --- a/src/main/java/vectorwing/blockbox/common/registry/RegistryAliases.java +++ b/src/main/java/vectorwing/blockbox/common/registry/RegistryAliases.java @@ -1,5 +1,6 @@ package vectorwing.blockbox.common.registry; +import net.minecraft.core.registries.BuiltInRegistries; import vectorwing.blockbox.common.helper.RecipeHelper; public class RegistryAliases @@ -25,10 +26,10 @@ public static void addRegistryAliases() { } public static void addBlockAlias(String oldName, String newName) { - ModBlocks.BLOCKS.addAlias(RecipeHelper.modIdentifier(oldName), RecipeHelper.modIdentifier(newName)); + BuiltInRegistries.BLOCK.addAlias(RecipeHelper.modIdentifier(oldName), RecipeHelper.modIdentifier(newName)); } public static void addItemAlias(String oldName, String newName) { - ModItems.ITEMS.addAlias(RecipeHelper.modIdentifier(oldName), RecipeHelper.modIdentifier(newName)); + BuiltInRegistries.ITEM.addAlias(RecipeHelper.modIdentifier(oldName), RecipeHelper.modIdentifier(newName)); } } diff --git a/src/main/java/vectorwing/blockbox/common/tag/CommonTags.java b/src/main/java/vectorwing/blockbox/common/tag/CommonTags.java new file mode 100644 index 00000000..766d6fe3 --- /dev/null +++ b/src/main/java/vectorwing/blockbox/common/tag/CommonTags.java @@ -0,0 +1,18 @@ +package vectorwing.blockbox.common.tag; + +import net.minecraft.core.registries.Registries; +import net.minecraft.resources.Identifier; +import net.minecraft.tags.TagKey; +import net.minecraft.world.item.Item; + +public class CommonTags { + public static class Items { + + public static final TagKey RODS_WOODEN = commonItemTag("rods/wooden"); + public static final TagKey IGNITERS = commonItemTag("tools/igniter"); + } + + private static TagKey commonItemTag(String path) { + return TagKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath("c", path)); + } +} diff --git a/src/main/java/vectorwing/blockbox/common/tag/CompatibilityTags.java b/src/main/java/vectorwing/blockbox/common/tag/CompatibilityTags.java index dd36b06e..f947cbb5 100644 --- a/src/main/java/vectorwing/blockbox/common/tag/CompatibilityTags.java +++ b/src/main/java/vectorwing/blockbox/common/tag/CompatibilityTags.java @@ -1,5 +1,6 @@ package vectorwing.blockbox.common.tag; +import net.minecraft.core.registries.Registries; import net.minecraft.resources.Identifier; import net.minecraft.tags.BlockTags; import net.minecraft.tags.ItemTags; @@ -14,10 +15,10 @@ public class CompatibilityTags public static final TagKey FARMERS_DELIGHT_TRAY_HEAT_SOURCES = externalBlockTag(FARMERS_DELIGHT, "tray_heat_sources"); private static TagKey externalBlockTag(String modId, String path) { - return BlockTags.create(Identifier.fromNamespaceAndPath(modId, path)); + return TagKey.create(Registries.BLOCK, Identifier.fromNamespaceAndPath(modId, path)); } private static TagKey externalItemTag(String modId, String path) { - return ItemTags.create(Identifier.fromNamespaceAndPath(modId, path)); + return TagKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(modId, path)); } } diff --git a/src/main/java/vectorwing/blockbox/common/tag/ModTags.java b/src/main/java/vectorwing/blockbox/common/tag/ModTags.java index 962fc309..fe7669ac 100644 --- a/src/main/java/vectorwing/blockbox/common/tag/ModTags.java +++ b/src/main/java/vectorwing/blockbox/common/tag/ModTags.java @@ -1,5 +1,6 @@ package vectorwing.blockbox.common.tag; +import net.minecraft.core.registries.Registries; import net.minecraft.resources.Identifier; import net.minecraft.tags.BlockTags; import net.minecraft.tags.ItemTags; @@ -47,10 +48,10 @@ public class ModTags public static final TagKey SKY_LANTERNS = modItemTag("sky_lanterns"); private static TagKey modBlockTag(String path) { - return BlockTags.create(Identifier.fromNamespaceAndPath(BlockBox.MODID, path)); + return TagKey.create(Registries.BLOCK, Identifier.fromNamespaceAndPath(BlockBox.MODID, path)); } private static TagKey modItemTag(String path) { - return ItemTags.create(Identifier.fromNamespaceAndPath(BlockBox.MODID, path)); + return TagKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(BlockBox.MODID, path)); } } diff --git a/src/main/java/vectorwing/blockbox/data/DataGenerators.java b/src/main/java/vectorwing/blockbox/data/DataGenerators.java index ef42579b..f544df57 100644 --- a/src/main/java/vectorwing/blockbox/data/DataGenerators.java +++ b/src/main/java/vectorwing/blockbox/data/DataGenerators.java @@ -1,3 +1,4 @@ +//? neoforge { package vectorwing.blockbox.data; import net.neoforged.bus.api.SubscribeEvent; @@ -30,3 +31,4 @@ public static void gatherData(GatherDataEvent.Client event) { event.createProvider(ParticleTypes::new); } } +//?} \ No newline at end of file diff --git a/src/main/java/vectorwing/blockbox/data/generator/ModBlockModelGenerators.java b/src/main/java/vectorwing/blockbox/data/generator/ModBlockModelGenerators.java index 50916a09..65dd64b1 100644 --- a/src/main/java/vectorwing/blockbox/data/generator/ModBlockModelGenerators.java +++ b/src/main/java/vectorwing/blockbox/data/generator/ModBlockModelGenerators.java @@ -1,3 +1,4 @@ +//? neoforge { package vectorwing.blockbox.data.generator; import net.minecraft.client.data.models.BlockModelGenerators; @@ -333,3 +334,4 @@ public static MultiVariantGenerator createBrazier(Block block, MultiVariant stan .select(true, true, hangingLit)); } } +//?} \ No newline at end of file diff --git a/src/main/java/vectorwing/blockbox/data/model/ModModelTemplates.java b/src/main/java/vectorwing/blockbox/data/model/ModModelTemplates.java index 0d3e228a..9985a247 100644 --- a/src/main/java/vectorwing/blockbox/data/model/ModModelTemplates.java +++ b/src/main/java/vectorwing/blockbox/data/model/ModModelTemplates.java @@ -1,3 +1,4 @@ +//? neoforge { package vectorwing.blockbox.data.model; import net.minecraft.client.data.models.model.ModelTemplate; @@ -37,3 +38,4 @@ public static ModelTemplate create(String id, String suffix, TextureSlot... slot return ModelTemplates.create(Identifier.fromNamespaceAndPath(BlockBox.MODID, id).toString(), suffix, slots); } } +//?} \ No newline at end of file diff --git a/src/main/java/vectorwing/blockbox/data/provider/BlockItemModels.java b/src/main/java/vectorwing/blockbox/data/provider/BlockItemModels.java index 45f077a7..0376b281 100644 --- a/src/main/java/vectorwing/blockbox/data/provider/BlockItemModels.java +++ b/src/main/java/vectorwing/blockbox/data/provider/BlockItemModels.java @@ -1,3 +1,4 @@ +//? neoforge { package vectorwing.blockbox.data.provider; import net.minecraft.client.data.models.BlockModelGenerators; @@ -18,3 +19,4 @@ protected void registerModels(BlockModelGenerators blockModels, ItemModelGenerat new ModBlockModelGenerators(blockModels).run(); } } +//?} \ No newline at end of file diff --git a/src/main/java/vectorwing/blockbox/data/provider/BlockLootTables.java b/src/main/java/vectorwing/blockbox/data/provider/BlockLootTables.java index 65152e91..f7a9b24b 100644 --- a/src/main/java/vectorwing/blockbox/data/provider/BlockLootTables.java +++ b/src/main/java/vectorwing/blockbox/data/provider/BlockLootTables.java @@ -1,3 +1,4 @@ +//? neoforge { package vectorwing.blockbox.data.provider; import net.minecraft.core.HolderLookup; @@ -182,3 +183,4 @@ protected Iterable getKnownBlocks() { return generatedLootTables; } } +//?} \ No newline at end of file diff --git a/src/main/java/vectorwing/blockbox/data/provider/DataMaps.java b/src/main/java/vectorwing/blockbox/data/provider/DataMaps.java index de69b822..f5b7abed 100644 --- a/src/main/java/vectorwing/blockbox/data/provider/DataMaps.java +++ b/src/main/java/vectorwing/blockbox/data/provider/DataMaps.java @@ -1,3 +1,4 @@ +//? neoforge { package vectorwing.blockbox.data.provider; import net.minecraft.core.HolderLookup; @@ -46,3 +47,4 @@ protected void gather(HolderLookup.Provider provider) { .add(ModTags.WOODEN_SEAT_ITEMS, new FurnaceFuel(200), false); } } +//?} \ No newline at end of file diff --git a/src/main/java/vectorwing/blockbox/data/provider/LootTables.java b/src/main/java/vectorwing/blockbox/data/provider/LootTables.java index 313809d7..9363cc84 100644 --- a/src/main/java/vectorwing/blockbox/data/provider/LootTables.java +++ b/src/main/java/vectorwing/blockbox/data/provider/LootTables.java @@ -1,3 +1,4 @@ +//? neoforge { package vectorwing.blockbox.data.provider; import net.minecraft.core.HolderLookup; @@ -17,3 +18,4 @@ public LootTables(PackOutput output, CompletableFuture re ), registries); } } +//?} \ No newline at end of file diff --git a/src/main/java/vectorwing/blockbox/data/provider/ParticleTypes.java b/src/main/java/vectorwing/blockbox/data/provider/ParticleTypes.java index 1a900828..3e12cd74 100644 --- a/src/main/java/vectorwing/blockbox/data/provider/ParticleTypes.java +++ b/src/main/java/vectorwing/blockbox/data/provider/ParticleTypes.java @@ -1,3 +1,4 @@ +//? neoforge { package vectorwing.blockbox.data.provider; import net.minecraft.data.PackOutput; @@ -21,3 +22,4 @@ protected void addDescriptions() { ); } } +//?} \ No newline at end of file diff --git a/src/main/java/vectorwing/blockbox/data/provider/Recipes.java b/src/main/java/vectorwing/blockbox/data/provider/Recipes.java index 7401ca83..0fcd6d08 100644 --- a/src/main/java/vectorwing/blockbox/data/provider/Recipes.java +++ b/src/main/java/vectorwing/blockbox/data/provider/Recipes.java @@ -1,6 +1,6 @@ +//? neoforge { package vectorwing.blockbox.data.provider; -import com.mojang.logging.annotations.MethodsReturnNonnullByDefault; import net.minecraft.core.HolderLookup; import net.minecraft.data.PackOutput; import net.minecraft.data.recipes.RecipeOutput; @@ -9,11 +9,8 @@ import vectorwing.blockbox.data.recipe.SmeltingRecipes; import vectorwing.blockbox.data.recipe.StonecuttingRecipes; -import javax.annotation.ParametersAreNonnullByDefault; import java.util.concurrent.CompletableFuture; -@ParametersAreNonnullByDefault -@MethodsReturnNonnullByDefault public class Recipes extends RecipeProvider { public Recipes(HolderLookup.Provider registries, RecipeOutput output) { @@ -44,3 +41,4 @@ public String getName() { } } } +//?} \ No newline at end of file diff --git a/src/main/java/vectorwing/blockbox/data/provider/package-info.java b/src/main/java/vectorwing/blockbox/data/provider/package-info.java new file mode 100644 index 00000000..00d96cdd --- /dev/null +++ b/src/main/java/vectorwing/blockbox/data/provider/package-info.java @@ -0,0 +1,4 @@ +@NullMarked +package vectorwing.blockbox.data.provider; + +import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/src/main/java/vectorwing/blockbox/data/recipe/CraftingRecipes.java b/src/main/java/vectorwing/blockbox/data/recipe/CraftingRecipes.java index 2d249f2e..315d76a6 100644 --- a/src/main/java/vectorwing/blockbox/data/recipe/CraftingRecipes.java +++ b/src/main/java/vectorwing/blockbox/data/recipe/CraftingRecipes.java @@ -1,3 +1,4 @@ +//? neoforge { package vectorwing.blockbox.data.recipe; import net.minecraft.advancements.criterion.InventoryChangeTrigger; @@ -501,3 +502,4 @@ private static ResourceKey> nameWithSuffix(String name, String suffix) return ResourceKey.create(Registries.RECIPE, Identifier.fromNamespaceAndPath(BlockBox.MODID, name + "_" + suffix)); } } +//?} \ No newline at end of file diff --git a/src/main/java/vectorwing/blockbox/data/tag/BlockTags.java b/src/main/java/vectorwing/blockbox/data/tag/BlockTags.java index 11d76371..c0dc7666 100644 --- a/src/main/java/vectorwing/blockbox/data/tag/BlockTags.java +++ b/src/main/java/vectorwing/blockbox/data/tag/BlockTags.java @@ -1,3 +1,4 @@ +//? neoforge { package vectorwing.blockbox.data.tag; import net.minecraft.core.HolderLookup; @@ -341,3 +342,4 @@ private void registerBlockMineables() { tag(net.minecraft.tags.BlockTags.NEEDS_DIAMOND_TOOL).add(ModBlocks.POLISHED_OBSIDIAN.get()); } } +//?} diff --git a/src/main/java/vectorwing/blockbox/data/tag/DamageTypeTags.java b/src/main/java/vectorwing/blockbox/data/tag/DamageTypeTags.java index 78493523..104516eb 100644 --- a/src/main/java/vectorwing/blockbox/data/tag/DamageTypeTags.java +++ b/src/main/java/vectorwing/blockbox/data/tag/DamageTypeTags.java @@ -1,3 +1,4 @@ +//? neoforge { package vectorwing.blockbox.data.tag; import net.minecraft.core.HolderLookup; @@ -22,3 +23,4 @@ protected void addTags(HolderLookup.Provider provider) { tag(net.minecraft.tags.DamageTypeTags.PANIC_ENVIRONMENTAL_CAUSES).add(ModDamageTypes.PALISADE); } } +//?} \ No newline at end of file diff --git a/src/main/java/vectorwing/blockbox/data/tag/ItemTags.java b/src/main/java/vectorwing/blockbox/data/tag/ItemTags.java index 836e0ad1..b15d88e1 100644 --- a/src/main/java/vectorwing/blockbox/data/tag/ItemTags.java +++ b/src/main/java/vectorwing/blockbox/data/tag/ItemTags.java @@ -1,14 +1,17 @@ +//? neoforge { package vectorwing.blockbox.data.tag; import net.minecraft.core.HolderLookup; import net.minecraft.data.PackOutput; import net.minecraft.data.tags.TagsProvider; +import net.minecraft.world.item.Items; import net.minecraft.world.level.block.Block; import net.neoforged.neoforge.common.data.ItemTagsProvider; import org.jetbrains.annotations.NotNull; import vectorwing.blockbox.BlockBox; import vectorwing.blockbox.common.registry.ModBlocks; import vectorwing.blockbox.common.registry.ModItems; +import vectorwing.blockbox.common.tag.CommonTags; import vectorwing.blockbox.common.tag.ModTags; import java.util.concurrent.CompletableFuture; @@ -167,3 +170,4 @@ private void registerMinecraftTags() { tag(net.minecraft.tags.ItemTags.PIGLIN_LOVED).addTag(ModTags.GOLDEN_BLOCK_ITEMS); } } +//?} \ No newline at end of file diff --git a/src/main/java/vectorwing/blockbox/fabric/BlockBoxFabric.java b/src/main/java/vectorwing/blockbox/fabric/BlockBoxFabric.java new file mode 100644 index 00000000..9da52f55 --- /dev/null +++ b/src/main/java/vectorwing/blockbox/fabric/BlockBoxFabric.java @@ -0,0 +1,62 @@ +package vectorwing.blockbox.fabric; + +//? fabric { +/*import fuzs.forgeconfigapiport.fabric.api.v5.ConfigRegistry; +import net.fabricmc.api.ModInitializer; +import net.fabricmc.fabric.api.creativetab.v1.CreativeModeTabEvents; +import net.fabricmc.fabric.api.event.player.ItemEvents; +import net.minecraft.core.BlockPos; +import net.minecraft.world.InteractionResult; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.BlockState; +import net.neoforged.fml.config.ModConfig; +import vectorwing.blockbox.Config; +import vectorwing.blockbox.fabric.event.BuildCreativeModeTabContentsEvent; +import vectorwing.blockbox.common.event.CommonEvents; +import vectorwing.blockbox.common.registry.*; +import vectorwing.blockbox.fabric.porting.BlockWithItemAbility; +import vectorwing.blockbox.fabric.porting.DataMaps; +import vectorwing.blockbox.fabric.porting.ItemAbilities; +import vectorwing.blockbox.fabric.porting.ItemAbility; + +import static vectorwing.blockbox.BlockBox.MODID; + +public class BlockBoxFabric implements ModInitializer { + + @Override + public void onInitialize() { + ConfigRegistry.INSTANCE.register(MODID, ModConfig.Type.COMMON, Config.SPEC); + + ModBlocks.register(); + ModItems.register(); + ModEntityTypes.register(); + ModSounds.register(); + ModParticleTypes.register(); + ModCreativeTabs.register(); + + RegistryAliases.addRegistryAliases(); + CreativeModeTabEvents.MODIFY_OUTPUT_ALL.register((tab, output)-> CommonEvents.addItemsToVanillaCreativeTabs(new BuildCreativeModeTabContentsEvent(tab, output))); + + ItemEvents.USE_ON.register(useOnContext -> { + BlockPos pos = useOnContext.getClickedPos(); + Level level = useOnContext.getLevel(); + BlockState state = level.getBlockState(pos); + Block block = state.getBlock(); + if (block instanceof BlockWithItemAbility blockWithItemAbility) { + ItemAbility itemAbility = ItemAbilities.get(useOnContext.getItemInHand()); + if (itemAbility != null) { + BlockState toolModifiedState = blockWithItemAbility.getToolModifiedState(state, useOnContext, itemAbility, false); + if (toolModifiedState != null) { + level.setBlockAndUpdate(pos, toolModifiedState); + return InteractionResult.SUCCESS; + } + } + } + return null; + }); + DataMaps.register(); + } + +} +*///?} diff --git a/src/main/java/vectorwing/blockbox/fabric/BlockBoxFabricClient.java b/src/main/java/vectorwing/blockbox/fabric/BlockBoxFabricClient.java new file mode 100644 index 00000000..ea8e1f1f --- /dev/null +++ b/src/main/java/vectorwing/blockbox/fabric/BlockBoxFabricClient.java @@ -0,0 +1,20 @@ +package vectorwing.blockbox.fabric; + +//? fabric { +/*import net.fabricmc.api.ClientModInitializer; +import vectorwing.blockbox.BlockBox; +import vectorwing.blockbox.client.event.ClientSetupEvents; +import vectorwing.blockbox.fabric.event.client.EntityRenderersEvent; +import vectorwing.blockbox.fabric.event.client.RegisterParticleProvidersEvent; + +public class BlockBoxFabricClient implements ClientModInitializer { + + @Override + public void onInitializeClient() { + BlockBox.LOGGER.info("Initializing {} Client", BlockBox.MODID); + ClientSetupEvents.onRegisterRenderers(new EntityRenderersEvent.RegisterRenderers()); + ClientSetupEvents.registerParticles(new RegisterParticleProvidersEvent()); + } + +} +*///?} \ No newline at end of file diff --git a/src/main/java/vectorwing/blockbox/fabric/event/BuildCreativeModeTabContentsEvent.java b/src/main/java/vectorwing/blockbox/fabric/event/BuildCreativeModeTabContentsEvent.java new file mode 100644 index 00000000..82d363a6 --- /dev/null +++ b/src/main/java/vectorwing/blockbox/fabric/event/BuildCreativeModeTabContentsEvent.java @@ -0,0 +1,29 @@ +//? fabric { +/*package vectorwing.blockbox.fabric.event; + +import net.fabricmc.fabric.api.creativetab.v1.FabricCreativeModeTabOutput; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.resources.ResourceKey; +import net.minecraft.world.item.CreativeModeTab; +import net.minecraft.world.item.ItemStack; + +import java.util.Collections; + +public class BuildCreativeModeTabContentsEvent { + private final ResourceKey tabKey; + private final FabricCreativeModeTabOutput output; + + public BuildCreativeModeTabContentsEvent(CreativeModeTab tab, FabricCreativeModeTabOutput output) { + this.tabKey = BuiltInRegistries.CREATIVE_MODE_TAB.getResourceKey(tab).orElse(null); + this.output = output; + } + + public ResourceKey getTabKey() { + return tabKey; + } + + public void insertAfter(ItemStack anchor, ItemStack newStack, CreativeModeTab.TabVisibility tabVisibility) { + output.insertAfter(anchor, Collections.singleton(newStack), tabVisibility); + } +} +*///?} \ No newline at end of file diff --git a/src/main/java/vectorwing/blockbox/fabric/event/client/EntityRenderersEvent.java b/src/main/java/vectorwing/blockbox/fabric/event/client/EntityRenderersEvent.java new file mode 100644 index 00000000..f691d3d4 --- /dev/null +++ b/src/main/java/vectorwing/blockbox/fabric/event/client/EntityRenderersEvent.java @@ -0,0 +1,19 @@ +//? fabric { +/*package vectorwing.blockbox.fabric.event.client; + +import net.minecraft.client.renderer.entity.EntityRendererProvider; +import net.minecraft.client.renderer.entity.EntityRenderers; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EntityType; +import vectorwing.blockbox.common.entity.SeatEntity; + +import java.util.function.Supplier; + +public class EntityRenderersEvent { + public static class RegisterRenderers { + public void registerEntityRenderer(EntityType entityType, EntityRendererProvider provider) { + EntityRenderers.register(entityType, provider); + } + } +} +*///?} \ No newline at end of file diff --git a/src/main/java/vectorwing/blockbox/fabric/event/client/RegisterParticleProvidersEvent.java b/src/main/java/vectorwing/blockbox/fabric/event/client/RegisterParticleProvidersEvent.java new file mode 100644 index 00000000..5638c8fa --- /dev/null +++ b/src/main/java/vectorwing/blockbox/fabric/event/client/RegisterParticleProvidersEvent.java @@ -0,0 +1,13 @@ +//? fabric { +/*package vectorwing.blockbox.fabric.event.client; + +import net.fabricmc.fabric.api.client.particle.v1.ParticleProviderRegistry; +import net.minecraft.core.particles.ParticleOptions; +import net.minecraft.core.particles.ParticleType; + +public class RegisterParticleProvidersEvent { + public void registerSpriteSet(ParticleType simpleParticleType, ParticleProviderRegistry.PendingParticleProvider provider) { + ParticleProviderRegistry.getInstance().register(simpleParticleType, provider); + } +} +*///?} \ No newline at end of file diff --git a/src/main/java/vectorwing/blockbox/fabric/mixin/PortalShapeMixin.java b/src/main/java/vectorwing/blockbox/fabric/mixin/PortalShapeMixin.java new file mode 100644 index 00000000..54f614f6 --- /dev/null +++ b/src/main/java/vectorwing/blockbox/fabric/mixin/PortalShapeMixin.java @@ -0,0 +1,24 @@ +//? fabric { +/*package vectorwing.blockbox.fabric.mixin; + +import com.llamalad7.mixinextras.injector.wrapoperation.Operation; +import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.portal.PortalShape; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import vectorwing.blockbox.common.block.PortalFrameBlock; +import vectorwing.blockbox.common.registry.ModBlocks; + +@Mixin(PortalShape.class) +public class PortalShapeMixin { + @WrapOperation( + method = "lambda$static$0", + at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/state/BlockState;is(Ljava/lang/Object;)Z") + ) + private static boolean addToFrame(BlockState instance, Object block, Operation original) { + return original.call(instance, block) || instance.getBlock() instanceof PortalFrameBlock; + } +} +*///?} \ No newline at end of file diff --git a/src/main/java/vectorwing/blockbox/fabric/porting/BlockWithItemAbility.java b/src/main/java/vectorwing/blockbox/fabric/porting/BlockWithItemAbility.java new file mode 100644 index 00000000..21ce4f73 --- /dev/null +++ b/src/main/java/vectorwing/blockbox/fabric/porting/BlockWithItemAbility.java @@ -0,0 +1,10 @@ +package vectorwing.blockbox.fabric.porting; + +import net.minecraft.world.item.context.UseOnContext; +import net.minecraft.world.level.block.state.BlockState; + +public interface BlockWithItemAbility { + //? fabric + /*BlockState getToolModifiedState(BlockState state, UseOnContext context, ItemAbility itemAbility, boolean simulate);*/ + +} diff --git a/src/main/java/vectorwing/blockbox/fabric/porting/DataMaps.java b/src/main/java/vectorwing/blockbox/fabric/porting/DataMaps.java new file mode 100644 index 00000000..6b012429 --- /dev/null +++ b/src/main/java/vectorwing/blockbox/fabric/porting/DataMaps.java @@ -0,0 +1,49 @@ +//? fabric { +/*package vectorwing.blockbox.fabric.porting; + +import net.fabricmc.fabric.api.registry.FuelValueEvents; +import net.fabricmc.fabric.api.registry.OxidizableBlocksRegistry; +import net.minecraft.world.level.block.Block; +import vectorwing.blockbox.common.registry.ModBlocks; +import vectorwing.blockbox.common.tag.ModTags; + +import java.util.function.Supplier; + +public class DataMaps { + + // Fabric replacements for NeoForge data maps. + public static void register() { + FuelValueEvents.BUILD.register((builder, context) -> { + builder.add(ModTags.PALISADE_ITEMS, 150); + builder.add(ModTags.SPIKED_PALISADE_ITEMS, 150); + builder.add(ModTags.WOODEN_SEAT_ITEMS, 200); + }); + + oxidize(ModBlocks.COPPER_CHAIN_LINKS, ModBlocks.EXPOSED_COPPER_CHAIN_LINKS); + oxidize(ModBlocks.EXPOSED_COPPER_CHAIN_LINKS, ModBlocks.WEATHERED_COPPER_CHAIN_LINKS); + oxidize(ModBlocks.WEATHERED_COPPER_CHAIN_LINKS, ModBlocks.OXIDIZED_COPPER_CHAIN_LINKS); + + oxidize(ModBlocks.COPPER_PILLAR, ModBlocks.EXPOSED_COPPER_PILLAR); + oxidize(ModBlocks.EXPOSED_COPPER_PILLAR, ModBlocks.WEATHERED_COPPER_PILLAR); + oxidize(ModBlocks.WEATHERED_COPPER_PILLAR, ModBlocks.OXIDIZED_COPPER_PILLAR); + + wax(ModBlocks.COPPER_CHAIN_LINKS, ModBlocks.WAXED_COPPER_CHAIN_LINKS); + wax(ModBlocks.EXPOSED_COPPER_CHAIN_LINKS, ModBlocks.WAXED_EXPOSED_COPPER_CHAIN_LINKS); + wax(ModBlocks.WEATHERED_COPPER_CHAIN_LINKS, ModBlocks.WAXED_WEATHERED_COPPER_CHAIN_LINKS); + wax(ModBlocks.OXIDIZED_COPPER_CHAIN_LINKS, ModBlocks.WAXED_OXIDIZED_COPPER_CHAIN_LINKS); + + wax(ModBlocks.COPPER_PILLAR, ModBlocks.WAXED_COPPER_PILLAR); + wax(ModBlocks.EXPOSED_COPPER_PILLAR, ModBlocks.WAXED_EXPOSED_COPPER_PILLAR); + wax(ModBlocks.WEATHERED_COPPER_PILLAR, ModBlocks.WAXED_WEATHERED_COPPER_PILLAR); + wax(ModBlocks.OXIDIZED_COPPER_PILLAR, ModBlocks.WAXED_OXIDIZED_COPPER_PILLAR); + } + + private static void oxidize(Supplier less, Supplier more) { + OxidizableBlocksRegistry.registerNextStage(less.get(), more.get()); + } + + private static void wax(Supplier unwaxed, Supplier waxed) { + OxidizableBlocksRegistry.registerWaxable(unwaxed.get(), waxed.get()); + } +} +*///?} \ No newline at end of file diff --git a/src/main/java/vectorwing/blockbox/fabric/porting/ItemAbilities.java b/src/main/java/vectorwing/blockbox/fabric/porting/ItemAbilities.java new file mode 100644 index 00000000..a2814aa4 --- /dev/null +++ b/src/main/java/vectorwing/blockbox/fabric/porting/ItemAbilities.java @@ -0,0 +1,27 @@ +//? fabric { +/*package vectorwing.blockbox.fabric.porting; + +import net.minecraft.tags.ItemTags; +import net.minecraft.world.item.ItemStack; +import org.jspecify.annotations.Nullable; +import vectorwing.blockbox.common.tag.CommonTags; + +public class ItemAbilities { + public static final ItemAbility AXE_STRIP = new ItemAbility(ItemTags.AXES); + public static final ItemAbility FIRESTARTER_LIGHT = new ItemAbility(CommonTags.Items.IGNITERS); + public static final ItemAbility SHOVEL_DOUSE = new ItemAbility(ItemTags.SHOVELS); + + public static @Nullable ItemAbility get(ItemStack itemInHand) { + if (itemInHand.is(AXE_STRIP.tagKey())) { + return AXE_STRIP; + } + else if (itemInHand.is(FIRESTARTER_LIGHT.tagKey())) { + return FIRESTARTER_LIGHT; + } + else if (itemInHand.is(SHOVEL_DOUSE.tagKey())) { + return SHOVEL_DOUSE; + } + return null; + } +} +*///?} \ No newline at end of file diff --git a/src/main/java/vectorwing/blockbox/fabric/porting/ItemAbility.java b/src/main/java/vectorwing/blockbox/fabric/porting/ItemAbility.java new file mode 100644 index 00000000..d700f6f9 --- /dev/null +++ b/src/main/java/vectorwing/blockbox/fabric/porting/ItemAbility.java @@ -0,0 +1,10 @@ +//? fabric { +/*package vectorwing.blockbox.fabric.porting; + +import net.minecraft.tags.TagKey; +import net.minecraft.world.item.Item; + +public record ItemAbility(TagKey tagKey) { + +} +*///?} \ No newline at end of file diff --git a/src/main/java/vectorwing/blockbox/neoforge/BlockBoxNeoForge.java b/src/main/java/vectorwing/blockbox/neoforge/BlockBoxNeoForge.java new file mode 100644 index 00000000..e67a4dd9 --- /dev/null +++ b/src/main/java/vectorwing/blockbox/neoforge/BlockBoxNeoForge.java @@ -0,0 +1,45 @@ +package vectorwing.blockbox.neoforge; + +//? neoforge { +import net.minecraft.core.registries.Registries; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.fml.ModContainer; +import net.neoforged.fml.config.ModConfig; +import net.neoforged.neoforge.registries.RegisterEvent; +import vectorwing.blockbox.BlockBox; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.EventBusSubscriber; +import net.neoforged.fml.common.Mod; +import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; +import vectorwing.blockbox.Config; +import vectorwing.blockbox.common.registry.*; + +@Mod(BlockBox.MODID) +@EventBusSubscriber(modid = BlockBox.MODID) +public class BlockBoxNeoForge { + + public BlockBoxNeoForge(IEventBus eventBus, ModContainer container) { + container.registerConfig(ModConfig.Type.COMMON, Config.SPEC); + RegistryAliases.addRegistryAliases(); + } + + @SubscribeEvent + public static void register(RegisterEvent event) { + if (event.getRegistryKey().equals(Registries.BLOCK)) { + ModBlocks.register(); + } else if (event.getRegistryKey().equals(Registries.ITEM)) { + ModItems.register(); + } else if (event.getRegistryKey().equals(Registries.ENTITY_TYPE)) { + ModEntityTypes.register(); + } else if (event.getRegistryKey().equals(Registries.SOUND_EVENT)) { + ModSounds.register(); + } else if (event.getRegistryKey().equals(Registries.CREATIVE_MODE_TAB)) { + ModCreativeTabs.register(); + } else if (event.getRegistryKey().equals(Registries.PARTICLE_TYPE)) { + ModParticleTypes.register(); + } + } + +} +//?} diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/src/main/resources/META-INF/accesstransformer.cfg @@ -0,0 +1 @@ + diff --git a/src/main/templates/META-INF/neoforge.mods.toml b/src/main/resources/META-INF/neoforge.mods.toml similarity index 100% rename from src/main/templates/META-INF/neoforge.mods.toml rename to src/main/resources/META-INF/neoforge.mods.toml diff --git a/src/main/resources/blockbox.accesswidener b/src/main/resources/blockbox.accesswidener new file mode 100644 index 00000000..ec0920a0 --- /dev/null +++ b/src/main/resources/blockbox.accesswidener @@ -0,0 +1,6 @@ +accessWidener v2 official + +accessible method net/minecraft/world/level/block/state/properties/BlockSetType register (Lnet/minecraft/world/level/block/state/properties/BlockSetType;)Lnet/minecraft/world/level/block/state/properties/BlockSetType; +accessible method net/minecraft/core/particles/SimpleParticleType (Z)V + + diff --git a/src/main/resources/blockbox.fabric.mixins.json b/src/main/resources/blockbox.fabric.mixins.json new file mode 100644 index 00000000..532f6fb7 --- /dev/null +++ b/src/main/resources/blockbox.fabric.mixins.json @@ -0,0 +1,13 @@ +{ + "package": "vectorwing.blockbox.fabric.mixin", + "required": true, + "minVersion": "0.8", + "compatibilityLevel": "JAVA_21", + "injectors": { + "defaultRequire": 1 + }, + "mixins": [ + "PortalShapeMixin" + ], + "client": [] +} diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json new file mode 100644 index 00000000..64ba8496 --- /dev/null +++ b/src/main/resources/fabric.mod.json @@ -0,0 +1,31 @@ +{ + "schemaVersion": 1, + "id": "${mod_id}", + "name": "${mod_name}", + "version": "${mod_version}", + "authors": ["vectorwing"], + "contact": { + "sources": "https://github.com/vectorwing/BlockBox", + "issues": "https://github.com/vectorwing/BlockBox/issues" + }, + "description": "A collection of building blocks, furniture and decorations!", + "icon": "icon.png", + "license": "MIT", + "environment": "*", + "accessWidener": "blockbox.accesswidener", + "entrypoints": { + "main": [ + "vectorwing.blockbox.fabric.BlockBoxFabric" + ], + "client": [ + "vectorwing.blockbox.fabric.BlockBoxFabricClient" + ] + }, + "mixins": [ + "blockbox.fabric.mixins.json" + ], + "depends": { + "fabric-api": "*", + "forgeconfigapiport": "*" + } +} \ No newline at end of file diff --git a/src/main/resources/icon.png b/src/main/resources/icon.png new file mode 100644 index 00000000..3e06f9cf Binary files /dev/null and b/src/main/resources/icon.png differ diff --git a/src/main/templates/META-INF/accesstransformer.cfg b/src/main/templates/META-INF/accesstransformer.cfg deleted file mode 100644 index bbae4092..00000000 --- a/src/main/templates/META-INF/accesstransformer.cfg +++ /dev/null @@ -1 +0,0 @@ -protected-f net.minecraft.world.level.block.CrossCollisionBlock stateToIndex \ No newline at end of file diff --git a/stonecutter.gradle.kts b/stonecutter.gradle.kts new file mode 100644 index 00000000..fc285543 --- /dev/null +++ b/stonecutter.gradle.kts @@ -0,0 +1,25 @@ +plugins { + id("dev.kikugie.stonecutter") + id("co.uzzu.dotenv.gradle") version "4.0.0" + id("net.fabricmc.fabric-loom") version "1.15-SNAPSHOT" apply false + id("net.neoforged.moddev") version "2.0.140" apply false + id ("dev.kikugie.postprocess.jsonlang") version "2.1-beta.4" apply false + id("me.modmuss50.mod-publish-plugin") version "0.8.+" apply false +} + +stonecutter active "26.1-neoforge" + +stonecutter parameters { + constants.match(node.metadata.project.substringAfterLast('-'), "fabric", "neoforge") + filters.include("**/*.fsh", "**/*.vsh") +} + +stonecutter tasks { + order("publishModrinth") + order("publishCurseforge") +} + +for (version in stonecutter.versions.map { it.version }.distinct()) tasks.register("publish$version") { + group = "publishing" + dependsOn(stonecutter.tasks.named("publishMods") { metadata.version == version }) +} diff --git a/versions/26.1-fabric/gradle.properties b/versions/26.1-fabric/gradle.properties new file mode 100644 index 00000000..2c47af90 --- /dev/null +++ b/versions/26.1-fabric/gradle.properties @@ -0,0 +1,7 @@ +deps.minecraft=26.1.2 +deps.fabric-api=0.146.1+26.1.2 + +publish.additionalVersions=26.1, 26.1.1 +deps.minecraft_version_range=~26.1 +deps.forge_config_api_port=26.1.3 +deps.modmenu=18.0.0-alpha.8 \ No newline at end of file diff --git a/versions/26.1-neoforge/gradle.properties b/versions/26.1-neoforge/gradle.properties new file mode 100644 index 00000000..dd576ab4 --- /dev/null +++ b/versions/26.1-neoforge/gradle.properties @@ -0,0 +1,4 @@ +deps.minecraft=26.1.2 +deps.neoforge=26.1.2.22-beta +deps.minecraft_version_range=[26.1.2,26.2) +publish.additionalVersions=26.1, 26.1.1 \ No newline at end of file