1.21.11 first part

This commit is contained in:
2026-01-05 17:24:05 -06:00
parent 9beb9ef1e5
commit 11f3d68031
43 changed files with 1023 additions and 1174 deletions

View File

@@ -1,22 +0,0 @@
# Changelog
## 1.1.1
## 1.10
- added tools, and sword
- datagen for no more json files*
- new textures for the tools
- adds horse armor, and player armor
* kinda
## 1.02
adds ores both deepslate and regular and it drops you can smelt the raw nugget it drops into nuggets and makes it so you can create raw nugget blocks and nugget block
## 1.01
add two new blocks
- raw nugget block
- nugget block
## 1.00
version 1 adds the nugget item

View File

@@ -2,7 +2,7 @@ plugins {
id 'eclipse' id 'eclipse'
id 'idea' id 'idea'
id 'maven-publish' id 'maven-publish'
id 'net.minecraftforge.gradle' version '[6.0.24,6.2)' id 'net.minecraftforge.gradle' version '[6.0.46,6.2)'
id 'org.parchmentmc.librarian.forgegradle' version '1.+' id 'org.parchmentmc.librarian.forgegradle' version '1.+'
} }
@@ -23,17 +23,13 @@ minecraft {
// official MCVersion Official field/method names from Mojang mapping files // official MCVersion Official field/method names from Mojang mapping files
// parchment YYYY.MM.DD-MCVersion Open community-sourced parameter names and javadocs layered on top of official // parchment YYYY.MM.DD-MCVersion Open community-sourced parameter names and javadocs layered on top of official
// //
// You must be aware of the Mojang license when using the 'official' or 'parchment' mappings.
// See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
//
// Parchment is an unofficial project maintained by ParchmentMC, separate from MinecraftForge // Parchment is an unofficial project maintained by ParchmentMC, separate from MinecraftForge
// Additional setup is needed to use their mappings: https://parchmentmc.org/docs/getting-started // Additional setup is needed to use their mappings: https://parchmentmc.org/docs/getting-started
// //
// Use non-default mappings at your own risk. They may not always work.
// Simply re-run your setup task after changing the mappings to update your workspace. // Simply re-run your setup task after changing the mappings to update your workspace.
mappings channel: mapping_channel, version: mapping_version mappings channel: mapping_channel, version: mapping_version
// Tell FG to not automtically create the reobf tasks, as we now use Official mappings at runtime, If you don't use them at dev time then you'll have to fix your reobf yourself. // Forge 1.20.6 and newer use official mappings at runtime, so we shouldn't reobf from official to SRG
reobf = false reobf = false
// When true, this property will have all Eclipse/IntelliJ IDEA run configurations run the "prepareX" task for the given run configuration before launching the game. // When true, this property will have all Eclipse/IntelliJ IDEA run configurations run the "prepareX" task for the given run configuration before launching the game.
@@ -51,8 +47,7 @@ minecraft {
// By default, the folder name of a run configuration is the name of the Gradle project containing it. // By default, the folder name of a run configuration is the name of the Gradle project containing it.
// generateRunFolders = true // generateRunFolders = true
// This property enables access transformers for use in development. // This property enables access transformers for use in development, applied to the Minecraft artifact.
// They will be applied to the Minecraft artifact.
// The access transformer file can be anywhere in the project. // The access transformer file can be anywhere in the project.
// However, it must be at "META-INF/accesstransformer.cfg" in the final mod jar to be loaded by Forge. // However, it must be at "META-INF/accesstransformer.cfg" in the final mod jar to be loaded by Forge.
// This default location is a best practice to automatically put the file in the right place in the final jar. // This default location is a best practice to automatically put the file in the right place in the final jar.
@@ -66,17 +61,18 @@ minecraft {
configureEach { configureEach {
workingDirectory project.file('run') workingDirectory project.file('run')
// Recommended logging data for a userdev environment // Optional additional logging. The markers can be added/remove as needed, separated by commas.
// The markers can be added/remove as needed separated by commas.
// "SCAN": For mods scan. // "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events. // "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries. // "REGISTRYDUMP": For getting the contents of all registries.
property 'forge.logging.markers', 'REGISTRIES' // property '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
property 'forge.logging.console.level', 'debug' property 'forge.logging.console.level', 'debug'
// Recommended for development - enables more descriptive errors at the cost of slower startup and registration.
property 'eventbus.api.strictRuntimeChecks', 'true'
// arg "-mixin.config=${mod_id}.mixins.json"
} }
client { client {
@@ -111,7 +107,26 @@ sourceSets.main.resources { srcDir 'src/generated/resources' }
repositories { repositories {
// Put repositories for dependencies here // Put repositories for dependencies here
// ForgeGradle automatically adds the Forge maven and Maven Central for you mavenCentral()
maven {
name = 'Forge'
url = 'https://maven.minecraftforge.net'
}
maven {
name = 'Minecraft libraries'
url = 'https://libraries.minecraft.net'
}
exclusiveContent {
forRepository {
maven {
name = 'Sponge'
url = 'https://repo.spongepowered.org/repository/maven-public'
}
}
filter {
includeGroupAndSubgroups('org.spongepowered')
}
}
// If you have mod jar dependencies in ./libs, you can declare them as a repository like so. // If you have mod jar dependencies in ./libs, you can declare them as a repository like so.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html#sub:flat_dir_resolver // See https://docs.gradle.org/current/userguide/declaring_repositories.html#sub:flat_dir_resolver
@@ -128,6 +143,11 @@ dependencies {
// then special handling is done to allow a setup of a vanilla dependency without the use of an external repository. // then special handling is done to allow a setup of a vanilla dependency without the use of an external repository.
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
// Forge 1.21.6+ uses EventBus 7, which shifts most of its runtime validation to compile-time via an annotation processor
// to improve performance in production environments. This line is required to enable said compile-time validation
// in your development environment, helping you catch issues early.
annotationProcessor 'net.minecraftforge:eventbus-validator:7.0-beta.12'
// Example mod dependency with JEI // Example mod dependency with JEI
// The JEI API is declared for compile time use, while the full JEI artifact is used at runtime // The JEI API is declared for compile time use, while the full JEI artifact is used at runtime
// compileOnly "mezz.jei:jei-${mc_version}-common-api:${jei_version}" // compileOnly "mezz.jei:jei-${mc_version}-common-api:${jei_version}"
@@ -142,16 +162,13 @@ dependencies {
// For more info: // For more info:
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html // http://www.gradle.org/docs/current/userguide/dependency_management.html
// Hack fix for now, force jopt-simple to be exactly 5.0.4 because Mojang ships that version, but some transitive dependencies request 6.0+
implementation('net.sf.jopt-simple:jopt-simple:5.0.4') { version { strictly '5.0.4' } }
} }
// This block of code expands all declared replace properties in the specified resource targets. // 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. // A missing property will result in an error. Properties are expanded using ${} Groovy notation.
// When "copyIdeResources" is enabled, this will also run before the game launches in IDE environments. // When "copyIdeResources" is enabled, this will also run before the game launches in IDE environments.
// See https://docs.gradle.org/current/dsl/org.gradle.language.jvm.tasks.ProcessResources.html // See https://docs.gradle.org/current/dsl/org.gradle.language.jvm.tasks.ProcessResources.html
tasks.named('processResources', ProcessResources).configure { tasks.named('processResources', ProcessResources) {
var replaceProperties = [ var replaceProperties = [
minecraft_version: minecraft_version, minecraft_version_range: minecraft_version_range, minecraft_version: minecraft_version, minecraft_version_range: minecraft_version_range,
forge_version: forge_version, forge_version_range: forge_version_range, forge_version: forge_version, forge_version_range: forge_version_range,
@@ -167,7 +184,7 @@ tasks.named('processResources', ProcessResources).configure {
} }
// Example for how to get properties into the manifest for reading at runtime. // Example for how to get properties into the manifest for reading at runtime.
tasks.named('jar', Jar).configure { tasks.named('jar', Jar) {
manifest { manifest {
attributes([ attributes([
'Specification-Title' : mod_id, 'Specification-Title' : mod_id,
@@ -177,10 +194,8 @@ tasks.named('jar', Jar).configure {
'Implementation-Version' : project.jar.archiveVersion, 'Implementation-Version' : project.jar.archiveVersion,
'Implementation-Vendor' : mod_authors 'Implementation-Vendor' : mod_authors
]) ])
// attributes['MixinConfigs'] = "${mod_id}.mixins.json"
} }
archiveBaseName.set(mod_id) // Base name: mod ID
archiveVersion.set("${mod_version}-${minecraft_version}") // Version and Minecraft version
archiveClassifier.set('') // No additional classifier
} }
// Example configuration to allow publishing using the maven-publish plugin // Example configuration to allow publishing using the maven-publish plugin
@@ -201,6 +216,9 @@ tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
} }
// IntelliJ no longer downloads javadocs and sources by default, this tells Gradle to force IntelliJ to do it.
idea.module { downloadJavadoc = downloadSources = true }
eclipse { eclipse {
// Run everytime eclipse builds the code // Run everytime eclipse builds the code
//autoBuildTasks genEclipseRuns //autoBuildTasks genEclipseRuns
@@ -208,8 +226,7 @@ eclipse {
synchronizationTasks 'genEclipseRuns' synchronizationTasks 'genEclipseRuns'
} }
// Merge the resources and classes into the same directory. // Merge the resources and classes into the same directory, because Java expects modules to be in a single directory.
// This is done because java expects modules to be in a single directory.
// And if we have it in multiple we have to do performance intensive hacks like having the UnionFileSystem // And if we have it in multiple we have to do performance intensive hacks like having the UnionFileSystem
// This will eventually be migrated to ForgeGradle so modders don't need to manually do it. But that is later. // This will eventually be migrated to ForgeGradle so modders don't need to manually do it. But that is later.
sourceSets.each { sourceSets.each {

View File

@@ -1,23 +1,30 @@
# Sets default memory used for gradle commands. Can be overridden by user or command line properties. # Sets default memory used for Gradle commands. Can be overridden by user or command line properties.
# This is required to provide enough memory for the Minecraft decompilation process. # This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs=-Xmx3G org.gradle.jvmargs=-Xmx5G
org.gradle.daemon=false org.gradle.daemon=false
# In the case that Gradle needs to fork to recompile, this will set the memory for that process.
systemProp.net.minecraftforge.gradle.repo.recompile.fork=true
systemProp.net.minecraftforge.gradle.repo.recompile.fork.args=-Xmx5G
# Opts-out of ForgeGradle automatically adding mavenCentral(), Forge's maven and MC libs maven to the repositories block
systemProp.net.minecraftforge.gradle.repo.attach=false
## Environment Properties ## Environment Properties
# The Minecraft version must agree with the Forge version to get a valid artifact # The Minecraft version must agree with the Forge version to get a valid artifact
minecraft_version=1.21.3 minecraft_version=1.21.11
# The Minecraft version range can use any release version of Minecraft as bounds. # The Minecraft version range can use any release version of Minecraft as bounds.
# Snapshots, pre-releases, and release candidates are not guaranteed to sort properly # Snapshots, pre-releases, and release candidates are not guaranteed to sort properly
# as they do not follow standard versioning conventions. # as they do not follow standard versioning conventions.
minecraft_version_range=[1.21,1.22) minecraft_version_range=[1.21.11,1.22)
# The Forge version must agree with the Minecraft version to get a valid artifact # The Forge version must agree with the Minecraft version to get a valid artifact
forge_version=53.0.25 forge_version=61.0.3
# The Forge version range can use any version of Forge as bounds or match the loader version range # The Forge version range can use any version of Forge as bounds or match the loader version range
forge_version_range=[0,) forge_version_range=[61,)
# The loader version range can only use the major version of Forge/FML as bounds # The loader version range can only use the major version of Forge/FML as bounds
loader_version_range=[0,) loader_version_range=[61,)
# The mapping channel to use for mappings. # The mapping channel to use for mappings.
# The default set of supported mapping channels are ["official", "snapshot", "snapshot_nodoc", "stable", "stable_nodoc"]. # The default set of supported mapping channels are ["official", "snapshot", "snapshot_nodoc", "stable", "stable_nodoc"].
# Additional mapping channels can be registered through the "channelProviders" extension in a Gradle plugin. # Additional mapping channels can be registered through the "channelProviders" extension in a Gradle plugin.
@@ -35,7 +42,7 @@ loader_version_range=[0,)
mapping_channel=parchment mapping_channel=parchment
# The mapping version to query from the mapping channel. # The mapping version to query from the mapping channel.
# This must match the format required by the mapping channel. # This must match the format required by the mapping channel.
mapping_version=1.21-2024.11.10-1.21.3 mapping_version=2025.12.20-1.21.11
## Mod Properties ## Mod Properties
@@ -52,7 +59,7 @@ mod_version=1.2.2
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources. # This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html # See https://maven.apache.org/guides/mini/guide-naming-conventions.html
mod_group_id=xyz.sillyangel.nugget mod_group_id=dev.sillyangel.nugget
# The authors of the mod. This is a simple text string that is used for display purposes in the mod list. # The authors of the mod. This is a simple text string that is used for display purposes in the mod list.
mod_authors=sillyangel mod_authors=sillyangel
# The description of the mod. This is a simple multiline text string that is used for display purposes in the mod list. # The description of the mod. This is a simple multiline text string that is used for display purposes in the mod list.

View File

@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

22
gradlew vendored
View File

@@ -83,7 +83,8 @@ done
# This is normally unused # This is normally unused
# shellcheck disable=SC2034 # shellcheck disable=SC2034
APP_BASE_NAME=${0##*/} APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum MAX_FD=maximum
@@ -130,10 +131,13 @@ location of your Java installation."
fi fi
else else
JAVACMD=java JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the Please set the JAVA_HOME variable in your environment to match the
location of your Java installation." location of your Java installation."
fi
fi fi
# Increase the maximum file descriptors if we can. # Increase the maximum file descriptors if we can.
@@ -141,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #( case $MAX_FD in #(
max*) max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045 # shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) || MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit" warn "Could not query maximum file descriptor limit"
esac esac
@@ -149,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
'' | soft) :;; #( '' | soft) :;; #(
*) *)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045 # shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" || ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD" warn "Could not set maximum file descriptor limit to $MAX_FD"
esac esac
@@ -198,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command; # Collect all arguments for the java command:
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# shell script including quotes and variable substitutions, so put them in # and any embedded shellness will be escaped.
# double quotes to make sure that they get re-expanded; and # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# * put everything else in single quotes, so that it's not re-expanded. # treated as '${Hostname}' itself on the command line.
set -- \ set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \ "-Dorg.gradle.appname=$APP_BASE_NAME" \

20
gradlew.bat vendored
View File

@@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1 %JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute if %ERRORLEVEL% equ 0 goto execute
echo. echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. echo location of your Java installation. 1>&2
goto fail goto fail
@@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute if exist "%JAVA_EXE%" goto execute
echo. echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. echo location of your Java installation. 1>&2
goto fail goto fail

View File

@@ -307,8 +307,8 @@
[05Jan2025 22:08:43.805] [main/DEBUG] [net.minecraftforge.fml.javafmlmod.FMLModContainer/LOADING]: Creating FMLModContainer instance for net.minecraftforge.common.ForgeMod [05Jan2025 22:08:43.805] [main/DEBUG] [net.minecraftforge.fml.javafmlmod.FMLModContainer/LOADING]: Creating FMLModContainer instance for net.minecraftforge.common.ForgeMod
[05Jan2025 22:08:43.805] [main/DEBUG] [net.minecraftforge.fml.javafmlmod.FMLModContainer/LOADING]: Loaded modclass net.minecraftforge.forge/net.minecraftforge.common.ForgeMod with TransformingClassLoader[TRANSFORMER]@155829656 [05Jan2025 22:08:43.805] [main/DEBUG] [net.minecraftforge.fml.javafmlmod.FMLModContainer/LOADING]: Loaded modclass net.minecraftforge.forge/net.minecraftforge.common.ForgeMod with TransformingClassLoader[TRANSFORMER]@155829656
[05Jan2025 22:08:43.805] [main/DEBUG] [net.minecraftforge.fml.javafmlmod.FMLJavaModLanguageProvider/LOADING]: Loading FMLModContainer from classloader TransformingClassLoader[TRANSFORMER]@155829656 - got SecureModuleClassLoader[LAYER PLUGIN]@92941132 [05Jan2025 22:08:43.805] [main/DEBUG] [net.minecraftforge.fml.javafmlmod.FMLJavaModLanguageProvider/LOADING]: Loading FMLModContainer from classloader TransformingClassLoader[TRANSFORMER]@155829656 - got SecureModuleClassLoader[LAYER PLUGIN]@92941132
[05Jan2025 22:08:43.805] [main/DEBUG] [net.minecraftforge.fml.javafmlmod.FMLModContainer/LOADING]: Creating FMLModContainer instance for xyz.sillyangel.nugget.NuggetMod [05Jan2025 22:08:43.805] [main/DEBUG] [net.minecraftforge.fml.javafmlmod.FMLModContainer/LOADING]: Creating FMLModContainer instance for dev.sillyangel.nugget.NuggetMod
[05Jan2025 22:08:43.805] [main/DEBUG] [net.minecraftforge.fml.javafmlmod.FMLModContainer/LOADING]: Loaded modclass nuggetmod/xyz.sillyangel.nugget.NuggetMod with TransformingClassLoader[TRANSFORMER]@155829656 [05Jan2025 22:08:43.805] [main/DEBUG] [net.minecraftforge.fml.javafmlmod.FMLModContainer/LOADING]: Loaded modclass nuggetmod/dev.sillyangel.nugget.NuggetMod with TransformingClassLoader[TRANSFORMER]@155829656
[05Jan2025 22:08:43.886] [modloading-worker-0/DEBUG] [net.minecraftforge.versions.forge.ForgeVersion/CORE]: Forge Version package package net.minecraftforge.versions.forge, Forge, version 0.0 from TransformingClassLoader[TRANSFORMER]@155829656 [05Jan2025 22:08:43.886] [modloading-worker-0/DEBUG] [net.minecraftforge.versions.forge.ForgeVersion/CORE]: Forge Version package package net.minecraftforge.versions.forge, Forge, version 0.0 from TransformingClassLoader[TRANSFORMER]@155829656
[05Jan2025 22:08:43.886] [modloading-worker-0/DEBUG] [net.minecraftforge.versions.forge.ForgeVersion/CORE]: Found Forge version 53.0.25 [05Jan2025 22:08:43.886] [modloading-worker-0/DEBUG] [net.minecraftforge.versions.forge.ForgeVersion/CORE]: Found Forge version 53.0.25
[05Jan2025 22:08:43.886] [modloading-worker-0/DEBUG] [net.minecraftforge.versions.forge.ForgeVersion/CORE]: Found Forge spec 0.0 [05Jan2025 22:08:43.886] [modloading-worker-0/DEBUG] [net.minecraftforge.versions.forge.ForgeVersion/CORE]: Found Forge spec 0.0
@@ -320,10 +320,10 @@
[05Jan2025 22:08:43.886] [modloading-worker-0/INFO] [net.minecraftforge.common.MinecraftForge/FORGE]: MinecraftForge v53.0.25 Initialized [05Jan2025 22:08:43.886] [modloading-worker-0/INFO] [net.minecraftforge.common.MinecraftForge/FORGE]: MinecraftForge v53.0.25 Initialized
[05Jan2025 22:08:43.965] [modloading-worker-0/DEBUG] [net.minecraftforge.fml.config.ConfigTracker/CONFIG]: Config file nuggetmod-common.toml for nuggetmod tracking [05Jan2025 22:08:43.965] [modloading-worker-0/DEBUG] [net.minecraftforge.fml.config.ConfigTracker/CONFIG]: Config file nuggetmod-common.toml for nuggetmod tracking
[05Jan2025 22:08:43.998] [modloading-worker-0/DEBUG] [net.minecraftforge.fml.javafmlmod.AutomaticEventSubscriber/LOADING]: Attempting to inject @EventBusSubscriber classes into the eventbus for nuggetmod [05Jan2025 22:08:43.998] [modloading-worker-0/DEBUG] [net.minecraftforge.fml.javafmlmod.AutomaticEventSubscriber/LOADING]: Attempting to inject @EventBusSubscriber classes into the eventbus for nuggetmod
[05Jan2025 22:08:43.998] [modloading-worker-0/DEBUG] [net.minecraftforge.fml.javafmlmod.AutomaticEventSubscriber/LOADING]: Auto-subscribing xyz.sillyangel.nugget.Config to MOD [05Jan2025 22:08:43.998] [modloading-worker-0/DEBUG] [net.minecraftforge.fml.javafmlmod.AutomaticEventSubscriber/LOADING]: Auto-subscribing dev.sillyangel.nugget.Config to MOD
[05Jan2025 22:08:44.013] [modloading-worker-0/INFO] [net.minecraftforge.common.ForgeMod/FORGEMOD]: Opening jdk.naming.dns/com.sun.jndi.dns to java.naming [05Jan2025 22:08:44.013] [modloading-worker-0/INFO] [net.minecraftforge.common.ForgeMod/FORGEMOD]: Opening jdk.naming.dns/com.sun.jndi.dns to java.naming
[05Jan2025 22:08:44.029] [modloading-worker-0/DEBUG] [net.minecraftforge.fml.javafmlmod.AutomaticEventSubscriber/LOADING]: Auto-subscribing xyz.sillyangel.nugget.datagen.DataGenerators to MOD [05Jan2025 22:08:44.029] [modloading-worker-0/DEBUG] [net.minecraftforge.fml.javafmlmod.AutomaticEventSubscriber/LOADING]: Auto-subscribing datagen.dev.sillyangel.nugget.DataGenerators to MOD
[05Jan2025 22:08:44.029] [modloading-worker-0/DEBUG] [net.minecraftforge.fml.javafmlmod.AutomaticEventSubscriber/LOADING]: Auto-subscribing xyz.sillyangel.nugget.NuggetMod$ClientModEvents to MOD [05Jan2025 22:08:44.029] [modloading-worker-0/DEBUG] [net.minecraftforge.fml.javafmlmod.AutomaticEventSubscriber/LOADING]: Auto-subscribing dev.sillyangel.nugget.NuggetMod$ClientModEvents to MOD
[05Jan2025 22:08:44.061] [modloading-worker-0/DEBUG] [io.netty.util.internal.PlatformDependent0/]: -Dio.netty.noUnsafe: false [05Jan2025 22:08:44.061] [modloading-worker-0/DEBUG] [io.netty.util.internal.PlatformDependent0/]: -Dio.netty.noUnsafe: false
[05Jan2025 22:08:44.061] [modloading-worker-0/DEBUG] [io.netty.util.internal.PlatformDependent0/]: Java version: 21 [05Jan2025 22:08:44.061] [modloading-worker-0/DEBUG] [io.netty.util.internal.PlatformDependent0/]: Java version: 21
[05Jan2025 22:08:44.061] [modloading-worker-0/DEBUG] [io.netty.util.internal.PlatformDependent0/]: sun.misc.Unsafe.theUnsafe: available [05Jan2025 22:08:44.061] [modloading-worker-0/DEBUG] [io.netty.util.internal.PlatformDependent0/]: sun.misc.Unsafe.theUnsafe: available

View File

@@ -5,10 +5,13 @@ pluginManagement {
name = 'MinecraftForge' name = 'MinecraftForge'
url = 'https://maven.minecraftforge.net/' url = 'https://maven.minecraftforge.net/'
} }
maven { url = 'https://maven.parchmentmc.org' } maven {
name = 'ParchmentMC'
url = 'https://maven.parchmentmc.org'
}
} }
} }
plugins { plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0' id 'org.gradle.toolchains.foojay-resolver-convention' version '0.10.0'
} }

View File

@@ -1,6 +0,0 @@
// 1.21.3 2025-01-05T20:56:27.110625 Tags for minecraft:item mod id nuggetmod
4dd3e16112d5950861571bb8b5212983e5192dfc data/minecraft/tags/item/trimmable_armor.json
bb7be5aa0b582860d2d8dd7a0f2115ac4dc842a9 data/minecraft/tags/item/trim_materials.json
ab6bd31a8063a99913c4a6fc41bde37ff0564389 data/minecraft/tags/item/trim_templates.json
bb7be5aa0b582860d2d8dd7a0f2115ac4dc842a9 data/nuggetmod/tags/item/nugget_repairs.json
562be55fb606ffa455100bd2a6942846dcd124cb data/nuggetmod/tags/item/transformable_items.json

View File

@@ -1,6 +0,0 @@
// 1.21.3 2025-01-05T20:56:27.1418921 Registries
53aea7bfe12c9e17903617fdc8946ce53057c9da data/nuggetmod/forge/biome_modifier/add_nugget_ore.json
12edbe7dddaf2b8379bdf3bc1f3552c83a86e3b2 data/nuggetmod/trim_material/nugget.json
c26c02f523d403aa4352b30b1a97a95a69a4d97c data/nuggetmod/trim_pattern/nugget.json
8b0873c1ad86c61c7c0dfd0749909cc9982639de data/nuggetmod/worldgen/configured_feature/nugget_ore.json
c86e299467433ed0c44ce94a9a75e4352f8ce6ca data/nuggetmod/worldgen/placed_feature/nugget_ore_placed.json

View File

@@ -1,5 +0,0 @@
// 1.21.3 2025-01-05T20:56:27.127889 Tags for minecraft:block mod id nuggetmod
265fffb09f55ddbd810e4aca08e95427b6f8abb8 data/minecraft/tags/block/mineable/pickaxe.json
d3afbade112106a4f7dba97fc08964398669700a data/minecraft/tags/block/needs_stone_tool.json
768d28c36c35fda7aa9d014ae9d9ce7ba23fdfb8 data/nuggetmod/tags/block/incorrect_for_nugget_tool.json
9c48de48f12ecaae54ddd4a48ea1ac229e0bcaa4 data/nuggetmod/tags/block/needs_nugget_tool.json

View File

@@ -1,5 +0,0 @@
// 1.21.3 2025-01-05T20:56:27.127889 Loot Tables
74a43d938ccd280fff25bd66ec0f55a3e2c30ad0 data/nuggetmod/loot_table/blocks/nugget_block.json
206de236ad19cf2d06cf21b0f282e5b64bd5918d data/nuggetmod/loot_table/blocks/nugget_deepslate_ore.json
d65584c1286a06f15f88db5682372d78e8e0ebf7 data/nuggetmod/loot_table/blocks/nugget_ore.json
2b4a937626ec0aa515a8a78663ce0f6142b843a6 data/nuggetmod/loot_table/blocks/raw_nugget_block.json

View File

@@ -1,55 +0,0 @@
// 1.21.3 2025-01-05T20:56:27.110625 Item Models: nuggetmod
90b22d61432e35fb68e2232a3eb76e15d2a77d89 assets/nuggetmod/models/item/nugget.json
b8f9c1135f1af8d77201d51866966ba73f3dbbfc assets/nuggetmod/models/item/nugget_armor_trim_smithing_template.json
cac221f8a7659366628c3b429c22ebd27f5adadd assets/nuggetmod/models/item/nugget_axe.json
dbadf09a9e221788b2cef71600701e4400e7a5ac assets/nuggetmod/models/item/nugget_boots.json
7dca863c633a328b682607342061c24fa359317c assets/nuggetmod/models/item/nugget_boots_amethyst_trim.json
1dacd5f685c47004a55cbae6d955b2e710b3f07d assets/nuggetmod/models/item/nugget_boots_copper_trim.json
d1de5dad49d95556fa2fab70a7890d878200beea assets/nuggetmod/models/item/nugget_boots_diamond_trim.json
ae67748e68ad7bbcec748b6ee7f1f4791660ce8e assets/nuggetmod/models/item/nugget_boots_emerald_trim.json
a52575c6328635ee70967a31244336ae5a5aa669 assets/nuggetmod/models/item/nugget_boots_gold_trim.json
dcb69986d03a024a176d38dfcb495362ffeac193 assets/nuggetmod/models/item/nugget_boots_iron_trim.json
0ff4a87f97bbaaa1c4124fc43df140d29082a383 assets/nuggetmod/models/item/nugget_boots_lapis_trim.json
cba310d5939725d84f409fb6ea91432495da218b assets/nuggetmod/models/item/nugget_boots_netherite_trim.json
6b56d9ec6ca6d379030db32774c9a725e76c7005 assets/nuggetmod/models/item/nugget_boots_quartz_trim.json
af0f965c4b451cecbbc056ba5019bcc44ab9ec6f assets/nuggetmod/models/item/nugget_boots_redstone_trim.json
277e491adbc77bbf30fb263b1c6b14951f6cd84a assets/nuggetmod/models/item/nugget_chestplate.json
afa48d58bfe8a41e52947389eadacf1d54aa201e assets/nuggetmod/models/item/nugget_chestplate_amethyst_trim.json
34db4371091135f3d8ea5f9bf60472ac120614d2 assets/nuggetmod/models/item/nugget_chestplate_copper_trim.json
e0a4e96ecac9b8664d7b28332ad40b3a976d80d5 assets/nuggetmod/models/item/nugget_chestplate_diamond_trim.json
99b4bbeb361c600e1d3136857084094a17e83f89 assets/nuggetmod/models/item/nugget_chestplate_emerald_trim.json
1cd1064b3355e6da5b83cb569202962534cea5f1 assets/nuggetmod/models/item/nugget_chestplate_gold_trim.json
01f17a408f386d0a9658d5efd184e187616dd40e assets/nuggetmod/models/item/nugget_chestplate_iron_trim.json
01ee5bbd07e896aca474564bb64720a97a5f1146 assets/nuggetmod/models/item/nugget_chestplate_lapis_trim.json
9fdc651171a846a9c2815002709a33f0919821b2 assets/nuggetmod/models/item/nugget_chestplate_netherite_trim.json
2ab1f9773c249568d33a78622d39b9baf7eb193b assets/nuggetmod/models/item/nugget_chestplate_quartz_trim.json
15620acb506fa42a1d914768a2d4fca28a1ad4c7 assets/nuggetmod/models/item/nugget_chestplate_redstone_trim.json
55eac09e1c7132d02b0aac04c3a8ed8b1777833a assets/nuggetmod/models/item/nugget_helmet.json
15d62a07a0a79876c483ed4e9c60f3e474cc8ad0 assets/nuggetmod/models/item/nugget_helmet_amethyst_trim.json
000fb83913689a98c5973f78e51219cd9b646ceb assets/nuggetmod/models/item/nugget_helmet_copper_trim.json
0d5e6916288fb5a4bca41d87e1f6f02c99300032 assets/nuggetmod/models/item/nugget_helmet_diamond_trim.json
ee78e385f9e4ab937298a5e2ad81ebe75a81cb45 assets/nuggetmod/models/item/nugget_helmet_emerald_trim.json
1283c96f9f373f7657a8188b69107430d658c51b assets/nuggetmod/models/item/nugget_helmet_gold_trim.json
f9e9efc27bcaad6628e0f2bd73bfdb41ed8490d3 assets/nuggetmod/models/item/nugget_helmet_iron_trim.json
7e6b4feb55d2e5ddf35ac9a47b2ad2dadba8a0aa assets/nuggetmod/models/item/nugget_helmet_lapis_trim.json
032d8a3a745bf6b2931609f60073b527a9e304c7 assets/nuggetmod/models/item/nugget_helmet_netherite_trim.json
82fc614cc45ec6d645b943a390d630102f332a59 assets/nuggetmod/models/item/nugget_helmet_quartz_trim.json
62a7de8cca1d782c0f8071f66fe9adc90d637228 assets/nuggetmod/models/item/nugget_helmet_redstone_trim.json
cc6e0d754901f7397916b947124acf6ba8467153 assets/nuggetmod/models/item/nugget_hoe.json
585ab18ac9b18eff5dd487a2c30c3448915dd5cb assets/nuggetmod/models/item/nugget_horse_armor.json
33af7bddeab67677dc62cd5e92d5b8973b24106b assets/nuggetmod/models/item/nugget_leggings.json
3e5b37dd9163b929d93012d11d2ef7ec968606da assets/nuggetmod/models/item/nugget_leggings_amethyst_trim.json
3a0993a40e57bfed0b2bd9818ea191b8a779b30b assets/nuggetmod/models/item/nugget_leggings_copper_trim.json
3917c35fd1454de92ae457b1362f98f07a8b8721 assets/nuggetmod/models/item/nugget_leggings_diamond_trim.json
93da5f00ac4604464454ca88d23634974f2a904a assets/nuggetmod/models/item/nugget_leggings_emerald_trim.json
f2b8f7782a1248c2e8de7eeb981a0e7abcf5cc23 assets/nuggetmod/models/item/nugget_leggings_gold_trim.json
c52faa339653807513edd9c61b99e9311df33e30 assets/nuggetmod/models/item/nugget_leggings_iron_trim.json
6fe0d511015bb76193f85d598a2db9a73f15c5a6 assets/nuggetmod/models/item/nugget_leggings_lapis_trim.json
597e2fb3857aeb6c2a7b4c464c0e2d91b13581a0 assets/nuggetmod/models/item/nugget_leggings_netherite_trim.json
d3c9108105a1732366550c88e524fd2ae4a15c7a assets/nuggetmod/models/item/nugget_leggings_quartz_trim.json
d5eb4a552e79ff6bfe770e092abfb48e88e58f06 assets/nuggetmod/models/item/nugget_leggings_redstone_trim.json
ee757b7f51aa5703ac735ac748f433503c4f2596 assets/nuggetmod/models/item/nugget_music_disc.json
1453d89f622ad5616505f248996b1715b196af76 assets/nuggetmod/models/item/nugget_pickaxe.json
f67a964a8a74c61df4d090dc5b250ad03bb16d8f assets/nuggetmod/models/item/nugget_shovel.json
dcc1dd8bb95c5c088212a9584d952a11ac2a840d assets/nuggetmod/models/item/nugget_sword.json
762606d79e485c8a5e4447e8a1236bee89185245 assets/nuggetmod/models/item/raw_nugget.json

View File

@@ -1,13 +0,0 @@
// 1.21.3 2025-01-05T20:56:27.127889 Block States: nuggetmod
e458b67af79198beb28149bb003b81fd70269977 assets/nuggetmod/blockstates/nugget_block.json
878193901a69171263432147c8d69dc3ad6a3329 assets/nuggetmod/blockstates/nugget_deepslate_ore.json
97b7f829a5952c457a7bd71a23fd2e40c9e41afd assets/nuggetmod/blockstates/nugget_ore.json
fc3b3199be08abb9ba378b6500ae96db0336a2ac assets/nuggetmod/blockstates/raw_nugget_block.json
5cd8b360f3c316bc790a0a08cca2902f5494ecb1 assets/nuggetmod/models/block/nugget_block.json
04a6c3905fc9bebb1701de7bf870efea11648a0e assets/nuggetmod/models/block/nugget_deepslate_ore.json
d8685b96ce2399042e685f5a0d52cc6f93aa2f7c assets/nuggetmod/models/block/nugget_ore.json
22ddcb7a66f04ae207af491a5e9264556726fec1 assets/nuggetmod/models/block/raw_nugget_block.json
87d953ce0211f8d1ae9e2f0411c38e6a937db408 assets/nuggetmod/models/item/nugget_block.json
1cbd017c90351ede4f571a9e6efd9b78640fed67 assets/nuggetmod/models/item/nugget_deepslate_ore.json
e8d9aff343954c5f248feb0b5fda5d9719aff29e assets/nuggetmod/models/item/nugget_ore.json
54f4c1e65c7687038adaf302a6471a1591ec2c2e assets/nuggetmod/models/item/raw_nugget_block.json

View File

@@ -1,41 +0,0 @@
// 1.21.3 2025-01-05T20:56:27.127889 Recipes
0fd5b77716dc45e332dc36b7f60aed900e725668 data/minecraft/advancement/recipes/misc/nugget_armor_trim_smithing_template_smithing_trim.json
eee047ea671dd65353f1d8da201bc2436d4df8ce data/minecraft/recipe/nugget_armor_trim_smithing_template_smithing_trim.json
1c4efbad060c0d91ce6e6c1cb6d1d1669bbcc6b4 data/nuggetmod/advancement/recipes/combat/nugget_boots.json
588a665982f97f016a8945b507f6a03d310f4090 data/nuggetmod/advancement/recipes/combat/nugget_chestplate.json
63d4a98bae280da5308f5011f4dce19970e727f9 data/nuggetmod/advancement/recipes/combat/nugget_helmet.json
5fd0412d9575823d882ec6e844021f2bdf83dc7c data/nuggetmod/advancement/recipes/combat/nugget_leggings.json
587bf7befb4b1be77e7002038b9faf0eb5bb4ce5 data/nuggetmod/advancement/recipes/combat/nugget_sword.json
39a320d3e238f524a92dae1eaa1c60d0e45ba296 data/nuggetmod/advancement/recipes/misc/nugget.json
8160ae7d8117c0cc293fcd40e22d1072c16ca478 data/nuggetmod/advancement/recipes/misc/nugget_block.json
ebf761f6dad07dac9f3ac9f8732d291cf7930611 data/nuggetmod/advancement/recipes/misc/nugget_from_blasting_nugget_deepslate_ore.json
e10188670de3a7a815f73a66fc5f4e92a648b51e data/nuggetmod/advancement/recipes/misc/nugget_from_blasting_nugget_ore.json
6138abcf020eb5235f574a65048b88a03b8dc057 data/nuggetmod/advancement/recipes/misc/nugget_from_blasting_raw_nugget.json
16fc56222bdb61afa3618038ee189f405fd20922 data/nuggetmod/advancement/recipes/misc/nugget_from_smelting_nugget_deepslate_ore.json
7b9dcb92c1af9c1982292c1efd6b4fb27513b3f5 data/nuggetmod/advancement/recipes/misc/nugget_from_smelting_nugget_ore.json
762af010e4f2c6dbf4b54f5f7c4575f28b47c524 data/nuggetmod/advancement/recipes/misc/nugget_from_smelting_raw_nugget.json
59e41b4b30c51f225ccb673f401839ec7e77fe20 data/nuggetmod/advancement/recipes/misc/raw_nugget.json
0eac4876a225ba434ebefcecb2d9a3d5b1af5cc3 data/nuggetmod/advancement/recipes/misc/raw_nugget_block.json
a159ddd57f6c263d4862f5ee479f3df3595379d9 data/nuggetmod/advancement/recipes/tools/nugget_axe.json
1889633531251f9d32df839f13041a7839569079 data/nuggetmod/advancement/recipes/tools/nugget_hoe.json
e6dbb4576802c7009518fe2bc4dbe541f16b6687 data/nuggetmod/advancement/recipes/tools/nugget_pickaxe.json
f63988753316f6848707a1bebb9004bff2f6d5e4 data/nuggetmod/advancement/recipes/tools/nugget_shovel.json
f18984bdec26f4f333b5ec20dcd09fe9dac918d5 data/nuggetmod/recipe/nugget.json
c7c3acba2cdae39001c97944e1a1eae52005bd21 data/nuggetmod/recipe/nugget_axe.json
aa4ff76dcf9a17b5d90446ef62241e4c7361e4a9 data/nuggetmod/recipe/nugget_block.json
4b405f3dad7ae6b25cf1d2eddfc27ddbe1ce19f6 data/nuggetmod/recipe/nugget_boots.json
b3ce51675061ff49c9b94b9f8d15dc87dcf9d089 data/nuggetmod/recipe/nugget_chestplate.json
be70886b617dbe8cdcb814a4d2f754fe3abbc659 data/nuggetmod/recipe/nugget_from_blasting_nugget_deepslate_ore.json
45cac40fe007c51d5b6e1d197c395975d2655def data/nuggetmod/recipe/nugget_from_blasting_nugget_ore.json
5c3110d1dd220a719fc151cc9067a4a53ee690c5 data/nuggetmod/recipe/nugget_from_blasting_raw_nugget.json
c21c2f595a958d26505b7615307edc354d890505 data/nuggetmod/recipe/nugget_from_smelting_nugget_deepslate_ore.json
33c1f170f1bb2e409858a4953b957abf9c3de9a1 data/nuggetmod/recipe/nugget_from_smelting_nugget_ore.json
731c7b164832de8e43bf6e9f900026a43ce5ee1a data/nuggetmod/recipe/nugget_from_smelting_raw_nugget.json
421bd212f8c4995d52f9818aa393a18003442ffc data/nuggetmod/recipe/nugget_helmet.json
c833522c310026665d6aa35a7d356f977e08b500 data/nuggetmod/recipe/nugget_hoe.json
10dbf3cb9b95e5bf98b10b7f2c68c24fb6fe0404 data/nuggetmod/recipe/nugget_leggings.json
dc1605410ae247b2a5ee0f94c3914b3c8a6f01a2 data/nuggetmod/recipe/nugget_pickaxe.json
9ef92db13ca907ab529a954bf53fe21e2fdd65c3 data/nuggetmod/recipe/nugget_shovel.json
9a9aa6724cc4ccc22c3cf0f7fb52b59e91e47215 data/nuggetmod/recipe/nugget_sword.json
4788404672bb103c1ac8572be4e1d17db06c31c1 data/nuggetmod/recipe/raw_nugget.json
73fcf373c40d2d9c3e8e5d6ccacbac0f4a2efa55 data/nuggetmod/recipe/raw_nugget_block.json

View File

@@ -0,0 +1,37 @@
package dev.sillyangel.nugget;
import net.minecraft.resources.Identifier;
import net.minecraft.world.item.Item;
import net.minecraftforge.common.ForgeConfigSpec;
import net.minecraftforge.eventbus.api.listener.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.config.ModConfigEvent;
import net.minecraftforge.registries.ForgeRegistries;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
// An example config class. This is not required, but it's a good idea to have one to keep your config organized.
// Demonstrates how to use Forge's config APIs
@Mod.EventBusSubscriber(modid = NuggetMod.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
public class Config
{
private static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder();
static final ForgeConfigSpec SPEC = BUILDER.build();
public static boolean logDirtBlock;
public static Set<Item> items;
private static boolean validateItemName(final Object obj)
{
return obj instanceof final String itemName && ForgeRegistries.ITEMS.containsKey(Identifier.tryParse(itemName));
}
@SubscribeEvent
static void onLoad(final ModConfigEvent event)
{
}
}

View File

@@ -1,23 +1,19 @@
package xyz.sillyangel.nugget; package dev.sillyangel.nugget;
import com.mojang.logging.LogUtils; import com.mojang.logging.LogUtils;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.eventbus.api.listener.SubscribeEvent;
import net.minecraftforge.event.BuildCreativeModeTabContentsEvent; import net.minecraftforge.event.BuildCreativeModeTabContentsEvent;
import net.minecraftforge.event.server.ServerStartingEvent;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.config.ModConfig; import net.minecraftforge.fml.config.ModConfig;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import org.slf4j.Logger; import org.slf4j.Logger;
import xyz.sillyangel.nugget.item.ModCreativeModeTabs; import dev.sillyangel.nugget.item.ModCreativeModeTabs;
import xyz.sillyangel.nugget.item.ModItems; import dev.sillyangel.nugget.item.ModItems;
import xyz.sillyangel.nugget.block.ModBlocks; import dev.sillyangel.nugget.block.ModBlocks;
import xyz.sillyangel.nugget.sound.ModSounds; import dev.sillyangel.nugget.sound.ModSounds;
// Very important Comment // Very important Comment
// The value here should match an entry in the META-INF/mods.toml file // The value here should match an entry in the META-INF/mods.toml file
@@ -28,23 +24,26 @@ public class NuggetMod {
// Directly reference a slf4j logger // Directly reference a slf4j logger
public static final Logger LOGGER = LogUtils.getLogger(); public static final Logger LOGGER = LogUtils.getLogger();
public NuggetMod() { public NuggetMod(FMLJavaModLoadingContext context) {
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); var modBusGroup = context.getModBusGroup();
modEventBus.addListener(this::commonSetup);
// Register ourselves for server and other game events we are interested in
MinecraftForge.EVENT_BUS.register(this);
ModCreativeModeTabs.register(modEventBus); // Register the commonSetup method for modloading
FMLCommonSetupEvent.getBus(modBusGroup).addListener(this::commonSetup);
ModItems.register(modEventBus); // Register the Deferred Register to the mod event bus so blocks get registered
ModBlocks.register(modEventBus); ModBlocks.register(modBusGroup);
// Register the Deferred Register to the mod event bus so items get registered
ModSounds.register(modEventBus); ModItems.register(modBusGroup);
// Register the Deferred Register to the mod event bus so tabs get registered
ModCreativeModeTabs.register(modBusGroup);
// Register the Deferred Register to the mod event bus so sounds get registered
ModSounds.register(modBusGroup);
// Register the item to a creative tab // Register the item to a creative tab
modEventBus.addListener(this::addCreative); BuildCreativeModeTabContentsEvent.BUS.addListener(this::addCreative);
// Register our mod's ForgeConfigSpec so that Forge can create and load the config file for us // Register our mod's ForgeConfigSpec so that Forge can create and load the config file for us
ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, Config.SPEC); context.registerConfig(ModConfig.Type.COMMON, Config.SPEC);
} }
private void commonSetup(final FMLCommonSetupEvent event) { private void commonSetup(final FMLCommonSetupEvent event) {
@@ -56,14 +55,8 @@ public class NuggetMod {
} }
// You can use SubscribeEvent and let the Event Bus discover methods to call
@SubscribeEvent
public void onServerStarting(ServerStartingEvent event) {
}
// You can use EventBusSubscriber to automatically register all static methods in the class annotated with @SubscribeEvent // You can use EventBusSubscriber to automatically register all static methods in the class annotated with @SubscribeEvent
@Mod.EventBusSubscriber(modid = MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT) @Mod.EventBusSubscriber(modid = MOD_ID, value = Dist.CLIENT)
public static class ClientModEvents { public static class ClientModEvents {
@SubscribeEvent @SubscribeEvent
public static void onClientSetup(FMLClientSetupEvent event) { public static void onClientSetup(FMLClientSetupEvent event) {

View File

@@ -1,10 +1,10 @@
package xyz.sillyangel.nugget.block; package dev.sillyangel.nugget.block;
import net.minecraft.core.registries.Registries; import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.Identifier;
import xyz.sillyangel.nugget.NuggetMod; import dev.sillyangel.nugget.NuggetMod;
import xyz.sillyangel.nugget.item.ModItems; import dev.sillyangel.nugget.item.ModItems;
import net.minecraft.util.valueproviders.UniformInt; import net.minecraft.util.valueproviders.UniformInt;
import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
@@ -12,7 +12,7 @@ import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.DropExperienceBlock; import net.minecraft.world.level.block.DropExperienceBlock;
import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.eventbus.api.bus.BusGroup;
import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject; import net.minecraftforge.registries.RegistryObject;
@@ -25,22 +25,22 @@ public class ModBlocks {
public static final RegistryObject<Block> NUGGET_BLOCK = registerBlock("nugget_block", public static final RegistryObject<Block> NUGGET_BLOCK = registerBlock("nugget_block",
() -> new Block(BlockBehaviour.Properties.of() () -> new Block(BlockBehaviour.Properties.of()
.setId(ResourceKey.create(Registries.BLOCK, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_block"))) .setId(ResourceKey.create(Registries.BLOCK, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_block")))
.strength(4f).requiresCorrectToolForDrops().sound(SoundType.AMETHYST))); .strength(4f).requiresCorrectToolForDrops().sound(SoundType.AMETHYST)));
public static final RegistryObject<Block> RAW_NUGGET_BLOCK = registerBlock("raw_nugget_block", public static final RegistryObject<Block> RAW_NUGGET_BLOCK = registerBlock("raw_nugget_block",
() -> new Block(BlockBehaviour.Properties.of() () -> new Block(BlockBehaviour.Properties.of()
.setId(ResourceKey.create(Registries.BLOCK, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "raw_nugget_block"))) .setId(ResourceKey.create(Registries.BLOCK, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "raw_nugget_block")))
.strength(3f).requiresCorrectToolForDrops())); .strength(3f).requiresCorrectToolForDrops()));
// ores // ores
public static final RegistryObject<Block> NUGGET_ORE = registerBlock("nugget_ore", public static final RegistryObject<Block> NUGGET_ORE = registerBlock("nugget_ore",
() -> new DropExperienceBlock(UniformInt.of(2, 4), BlockBehaviour.Properties.of() () -> new DropExperienceBlock(UniformInt.of(2, 4), BlockBehaviour.Properties.of()
.setId(ResourceKey.create(Registries.BLOCK, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_ore"))) .setId(ResourceKey.create(Registries.BLOCK, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_ore")))
.strength(4f).requiresCorrectToolForDrops())); .strength(4f).requiresCorrectToolForDrops()));
public static final RegistryObject<Block> NUGGET_DEEPSLATE_ORE = registerBlock("nugget_deepslate_ore", public static final RegistryObject<Block> NUGGET_DEEPSLATE_ORE = registerBlock("nugget_deepslate_ore",
() -> new DropExperienceBlock(UniformInt.of(2, 4), BlockBehaviour.Properties.of() () -> new DropExperienceBlock(UniformInt.of(2, 4), BlockBehaviour.Properties.of()
.setId(ResourceKey.create(Registries.BLOCK, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_deepslate_ore"))) .setId(ResourceKey.create(Registries.BLOCK, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_deepslate_ore")))
.strength(5f).requiresCorrectToolForDrops().sound(SoundType.DEEPSLATE))); .strength(5f).requiresCorrectToolForDrops().sound(SoundType.DEEPSLATE)));
private static <T extends Block> RegistryObject<T> registerBlock(String name, Supplier<T> block) { private static <T extends Block> RegistryObject<T> registerBlock(String name, Supplier<T> block) {
@@ -51,10 +51,10 @@ public class ModBlocks {
private static <T extends Block> void registerBlockItem(String name, RegistryObject<T> block) { private static <T extends Block> void registerBlockItem(String name, RegistryObject<T> block) {
ModItems.ITEMS.register(name, () -> new BlockItem(block.get(), new Item.Properties() ModItems.ITEMS.register(name, () -> new BlockItem(block.get(), new Item.Properties()
.setId(ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, name))))); .setId(ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, name)))));
} }
public static void register(IEventBus eventBus) { public static void register(BusGroup busGroup) {
BLOCKS.register(eventBus); BLOCKS.register(busGroup);
} }
} }

View File

@@ -1,6 +1,6 @@
package xyz.sillyangel.nugget.datagen; package dev.sillyangel.nugget.datagen;
import xyz.sillyangel.nugget.NuggetMod; import dev.sillyangel.nugget.NuggetMod;
import net.minecraft.core.HolderLookup; import net.minecraft.core.HolderLookup;
import net.minecraft.data.DataGenerator; import net.minecraft.data.DataGenerator;
import net.minecraft.data.PackOutput; import net.minecraft.data.PackOutput;
@@ -9,7 +9,7 @@ import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets;
import net.minecraftforge.common.data.BlockTagsProvider; import net.minecraftforge.common.data.BlockTagsProvider;
import net.minecraftforge.common.data.ExistingFileHelper; import net.minecraftforge.common.data.ExistingFileHelper;
import net.minecraftforge.data.event.GatherDataEvent; import net.minecraftforge.data.event.GatherDataEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.eventbus.api.listener.SubscribeEvent;
import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod;
import java.util.Collections; import java.util.Collections;

View File

@@ -1,19 +1,17 @@
package xyz.sillyangel.nugget.datagen; package dev.sillyangel.nugget.datagen;
import xyz.sillyangel.nugget.block.ModBlocks; import dev.sillyangel.nugget.block.ModBlocks;
import xyz.sillyangel.nugget.item.ModItems; import dev.sillyangel.nugget.item.ModItems;
import net.minecraft.core.HolderLookup; import net.minecraft.core.HolderLookup;
import net.minecraft.core.registries.Registries; import net.minecraft.core.registries.Registries;
import net.minecraft.data.loot.BlockLootSubProvider; import net.minecraft.data.loot.BlockLootSubProvider;
import net.minecraft.world.flag.FeatureFlags; import net.minecraft.world.flag.FeatureFlags;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.enchantment.Enchantment; import net.minecraft.world.item.enchantment.Enchantment;
import net.minecraft.world.item.enchantment.Enchantments; import net.minecraft.world.item.enchantment.Enchantments;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.storage.loot.LootTable; import net.minecraft.world.level.storage.loot.LootTable;
import net.minecraft.world.level.storage.loot.entries.LootItem; import net.minecraft.world.level.storage.loot.entries.LootItem;
import net.minecraft.world.level.storage.loot.entries.LootPoolEntryContainer;
import net.minecraft.world.level.storage.loot.functions.ApplyBonusCount; import net.minecraft.world.level.storage.loot.functions.ApplyBonusCount;
import net.minecraft.world.level.storage.loot.functions.SetItemCountFunction; import net.minecraft.world.level.storage.loot.functions.SetItemCountFunction;
import net.minecraft.world.level.storage.loot.providers.number.UniformGenerator; import net.minecraft.world.level.storage.loot.providers.number.UniformGenerator;

View File

@@ -1,7 +1,7 @@
package xyz.sillyangel.nugget.datagen; package dev.sillyangel.nugget.datagen;
import xyz.sillyangel.nugget.NuggetMod; import dev.sillyangel.nugget.NuggetMod;
import xyz.sillyangel.nugget.block.ModBlocks; import dev.sillyangel.nugget.block.ModBlocks;
import net.minecraft.data.PackOutput; import net.minecraft.data.PackOutput;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraftforge.client.model.generators.BlockStateProvider; import net.minecraftforge.client.model.generators.BlockStateProvider;

View File

@@ -1,15 +1,14 @@
package xyz.sillyangel.nugget.datagen; package dev.sillyangel.nugget.datagen;
import xyz.sillyangel.nugget.NuggetMod; import dev.sillyangel.nugget.NuggetMod;
import xyz.sillyangel.nugget.block.ModBlocks; import dev.sillyangel.nugget.block.ModBlocks;
import net.minecraft.core.HolderLookup; import net.minecraft.core.HolderLookup;
import net.minecraft.data.PackOutput; import net.minecraft.data.PackOutput;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.tags.BlockTags; import net.minecraft.tags.BlockTags;
import net.minecraftforge.common.data.BlockTagsProvider; import net.minecraftforge.common.data.BlockTagsProvider;
import net.minecraftforge.common.data.ExistingFileHelper; import net.minecraftforge.common.data.ExistingFileHelper;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import xyz.sillyangel.nugget.util.ModTags; import dev.sillyangel.nugget.util.ModTags;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;

View File

@@ -1,11 +1,11 @@
package xyz.sillyangel.nugget.datagen; package dev.sillyangel.nugget.datagen;
import xyz.sillyangel.nugget.NuggetMod; import dev.sillyangel.nugget.NuggetMod;
import xyz.sillyangel.nugget.trim.ModTrimMaterials; import dev.sillyangel.nugget.trim.ModTrimMaterials;
import xyz.sillyangel.nugget.trim.ModTrimPatterns; import dev.sillyangel.nugget.trim.ModTrimPatterns;
import xyz.sillyangel.nugget.worldgen.ModBiomeModifiers; import dev.sillyangel.nugget.worldgen.ModBiomeModifiers;
import xyz.sillyangel.nugget.worldgen.ModConfiguredFeatures; import dev.sillyangel.nugget.worldgen.ModConfiguredFeatures;
import xyz.sillyangel.nugget.worldgen.ModPlacedFeatures; import dev.sillyangel.nugget.worldgen.ModPlacedFeatures;
import net.minecraft.core.HolderLookup; import net.minecraft.core.HolderLookup;
import net.minecraft.core.RegistrySetBuilder; import net.minecraft.core.RegistrySetBuilder;
import net.minecraft.core.registries.Registries; import net.minecraft.core.registries.Registries;

View File

@@ -1,22 +1,22 @@
package xyz.sillyangel.nugget.datagen; package dev.sillyangel.nugget.datagen;
import dev.sillyangel.nugget.NuggetMod;
import dev.sillyangel.nugget.item.ModItems;
import net.minecraft.data.PackOutput;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.Identifier;
import net.minecraft.server.packs.PackType;
import net.minecraft.world.item.ArmorItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.equipment.trim.TrimMaterial; import net.minecraft.world.item.equipment.trim.TrimMaterial;
import net.minecraft.world.item.equipment.trim.TrimMaterials; import net.minecraft.world.item.equipment.trim.TrimMaterials;
import xyz.sillyangel.nugget.NuggetMod;
import xyz.sillyangel.nugget.item.ModItems;
import net.minecraft.data.PackOutput;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraftforge.client.model.generators.ItemModelBuilder; import net.minecraftforge.client.model.generators.ItemModelBuilder;
import net.minecraftforge.client.model.generators.ItemModelProvider; import net.minecraftforge.client.model.generators.ItemModelProvider;
import net.minecraftforge.client.model.generators.ModelFile;
import net.minecraftforge.common.data.ExistingFileHelper; import net.minecraftforge.common.data.ExistingFileHelper;
import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject; import net.minecraftforge.registries.RegistryObject;
import net.minecraft.resources.ResourceKey;
import net.minecraft.server.packs.PackType;
import net.minecraft.world.item.ArmorItem;
import net.minecraftforge.client.model.generators.ModelFile;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
@@ -79,9 +79,9 @@ public class ModItemModelProvider extends ItemModelProvider {
String armorItemPath = armorItem.toString(); String armorItemPath = armorItem.toString();
String trimPath = "trims/items/" + armorType + "_trim_" + trimMaterial.location().getPath(); String trimPath = "trims/items/" + armorType + "_trim_" + trimMaterial.location().getPath();
String currentTrimName = armorItemPath + "_" + trimMaterial.location().getPath() + "_trim"; String currentTrimName = armorItemPath + "_" + trimMaterial.location().getPath() + "_trim";
ResourceLocation armorItemResLoc = ResourceLocation.parse(armorItemPath); Identifier armorItemResLoc = Identifier.parse(armorItemPath);
ResourceLocation trimResLoc = ResourceLocation.parse(trimPath); // minecraft namespace Identifier trimResLoc = Identifier.parse(trimPath); // minecraft namespace
ResourceLocation trimNameResLoc = ResourceLocation.parse(currentTrimName); Identifier trimNameResLoc = Identifier.parse(currentTrimName);
// This is used for making the ExistingFileHelper acknowledge that this texture exist, so this will // This is used for making the ExistingFileHelper acknowledge that this texture exist, so this will
// avoid an IllegalArgumentException // avoid an IllegalArgumentException
existingFileHelper.trackGenerated(trimResLoc, PackType.CLIENT_RESOURCES, ".png", "textures"); existingFileHelper.trackGenerated(trimResLoc, PackType.CLIENT_RESOURCES, ".png", "textures");
@@ -97,38 +97,38 @@ public class ModItemModelProvider extends ItemModelProvider {
.model(new ModelFile.UncheckedModelFile(trimNameResLoc.getNamespace() + ":item/" + trimNameResLoc.getPath())) .model(new ModelFile.UncheckedModelFile(trimNameResLoc.getNamespace() + ":item/" + trimNameResLoc.getPath()))
.predicate(mcLoc("trim_type"), trimValue).end() .predicate(mcLoc("trim_type"), trimValue).end()
.texture("layer0", .texture("layer0",
ResourceLocation.fromNamespaceAndPath(MOD_ID, Identifier.fromNamespaceAndPath(MOD_ID,
"item/" + itemRegistryObject.getId().getPath())); "item/" + itemRegistryObject.getId().getPath()));
}); });
} }
} }
private ItemModelBuilder handheldItem(RegistryObject<Item> item) { private ItemModelBuilder handheldItem(RegistryObject<Item> item) {
return withExistingParent(item.getId().getPath(), return withExistingParent(item.getId().getPath(),
ResourceLocation.parse("item/handheld")).texture("layer0", Identifier.parse("item/handheld")).texture("layer0",
ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID,"item/" + item.getId().getPath())); Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID,"item/" + item.getId().getPath()));
} }
public void buttonItem(RegistryObject<? extends Block> block, RegistryObject<Block> baseBlock) { public void buttonItem(RegistryObject<? extends Block> block, RegistryObject<Block> baseBlock) {
this.withExistingParent(ForgeRegistries.BLOCKS.getKey(block.get()).getPath(), mcLoc("block/button_inventory")) this.withExistingParent(ForgeRegistries.BLOCKS.getKey(block.get()).getPath(), mcLoc("block/button_inventory"))
.texture("texture", ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, .texture("texture", Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID,
"block/" + ForgeRegistries.BLOCKS.getKey(baseBlock.get()).getPath())); "block/" + ForgeRegistries.BLOCKS.getKey(baseBlock.get()).getPath()));
} }
public void fenceItem(RegistryObject<? extends Block> block, RegistryObject<Block> baseBlock) { public void fenceItem(RegistryObject<? extends Block> block, RegistryObject<Block> baseBlock) {
this.withExistingParent(ForgeRegistries.BLOCKS.getKey(block.get()).getPath(), mcLoc("block/fence_inventory")) this.withExistingParent(ForgeRegistries.BLOCKS.getKey(block.get()).getPath(), mcLoc("block/fence_inventory"))
.texture("texture", ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, .texture("texture", Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID,
"block/" + ForgeRegistries.BLOCKS.getKey(baseBlock.get()).getPath())); "block/" + ForgeRegistries.BLOCKS.getKey(baseBlock.get()).getPath()));
} }
public void wallItem(RegistryObject<? extends Block> block, RegistryObject<Block> baseBlock) { public void wallItem(RegistryObject<? extends Block> block, RegistryObject<Block> baseBlock) {
this.withExistingParent(ForgeRegistries.BLOCKS.getKey(block.get()).getPath(), mcLoc("block/wall_inventory")) this.withExistingParent(ForgeRegistries.BLOCKS.getKey(block.get()).getPath(), mcLoc("block/wall_inventory"))
.texture("wall", ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, .texture("wall", Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID,
"block/" + ForgeRegistries.BLOCKS.getKey(baseBlock.get()).getPath())); "block/" + ForgeRegistries.BLOCKS.getKey(baseBlock.get()).getPath()));
} }
private ItemModelBuilder simpleBlockItem(RegistryObject<? extends Block> item) { private ItemModelBuilder simpleBlockItem(RegistryObject<? extends Block> item) {
return withExistingParent(item.getId().getPath(), return withExistingParent(item.getId().getPath(),
ResourceLocation.parse("item/generated")).texture("layer0", Identifier.parse("item/generated")).texture("layer0",
ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID,"item/" + item.getId().getPath())); Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID,"item/" + item.getId().getPath()));
} }
} }

View File

@@ -1,12 +1,12 @@
package xyz.sillyangel.nugget.datagen; package dev.sillyangel.nugget.datagen;
import xyz.sillyangel.nugget.NuggetMod; import dev.sillyangel.nugget.NuggetMod;
import xyz.sillyangel.nugget.item.ModItems; import dev.sillyangel.nugget.item.ModItems;
import xyz.sillyangel.nugget.util.ModTags; import dev.sillyangel.nugget.util.ModTags;
import net.minecraft.core.HolderLookup; import net.minecraft.core.HolderLookup;
import net.minecraft.tags.ItemTags; import net.minecraft.tags.ItemTags;
import net.minecraft.data.PackOutput; import net.minecraft.data.PackOutput;
import net.minecraft.data.tags.ItemTagsProvider; import net.minecraft.data.tags.ItemTagProvider;
import net.minecraft.world.item.Items; import net.minecraft.world.item.Items;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraftforge.common.data.ExistingFileHelper; import net.minecraftforge.common.data.ExistingFileHelper;
@@ -15,9 +15,8 @@ import org.jetbrains.annotations.Nullable;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
public class ModItemTagProvider extends ItemTagsProvider { public class ModItemTagProvider extends ItemTagsProvider {
public ModItemTagProvider(PackOutput packOutput, CompletableFuture<HolderLookup.Provider> completableFuture, public ModItemTagProvider(PackOutput pOutput, CompletableFuture<HolderLookup.Provider> pLookupProvider, CompletableFuture<TagLookup<Block>> pBlockTags, @Nullable ExistingFileHelper existingFileHelper) {
CompletableFuture<TagLookup<Block>> lookupCompletableFuture, @Nullable ExistingFileHelper existingFileHelper) { super(pOutput, pLookupProvider, pBlockTags, NuggetMod.MOD_ID, existingFileHelper);
super(packOutput, completableFuture, lookupCompletableFuture, NuggetMod.MOD_ID, existingFileHelper);
} }
@Override @Override
@@ -36,8 +35,8 @@ public class ModItemTagProvider extends ItemTagsProvider {
.add(ModItems.NUGGET_BOOTS.get()); .add(ModItems.NUGGET_BOOTS.get());
tag(ItemTags.TRIM_MATERIALS) tag(ItemTags.TRIM_MATERIALS)
.add(ModItems.NUGGET.get()); .add(ModItems.NUGGET.get());
tag(ItemTags.TRIM_TEMPLATES) // tag(ItemTags.TRIM_TEMPLATES)
.add(ModItems.NUGGET_SMITHING_TEMPLATE.get()); // .add(ModItems.NUGGET_SMITHING_TEMPLATE.get());
tag(ModTags.Items.NUGGET_REPAIRS) tag(ModTags.Items.NUGGET_REPAIRS)
.add(ModItems.NUGGET.get()); .add(ModItems.NUGGET.get());
} }

View File

@@ -1,15 +1,15 @@
package xyz.sillyangel.nugget.datagen; package dev.sillyangel.nugget.datagen;
import net.minecraft.core.registries.Registries; import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceKey;
import net.minecraft.world.item.Items; import net.minecraft.world.item.Items;
import xyz.sillyangel.nugget.NuggetMod; import dev.sillyangel.nugget.NuggetMod;
import xyz.sillyangel.nugget.block.ModBlocks; import dev.sillyangel.nugget.block.ModBlocks;
import xyz.sillyangel.nugget.item.ModItems; import dev.sillyangel.nugget.item.ModItems;
import net.minecraft.core.HolderLookup; import net.minecraft.core.HolderLookup;
import net.minecraft.data.PackOutput; import net.minecraft.data.PackOutput;
import net.minecraft.data.recipes.*; import net.minecraft.data.recipes.*;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.Identifier;
import net.minecraft.world.item.crafting.*; import net.minecraft.world.item.crafting.*;
import net.minecraft.world.level.ItemLike; import net.minecraft.world.level.ItemLike;
import net.minecraftforge.common.crafting.conditions.IConditionBuilder; import net.minecraftforge.common.crafting.conditions.IConditionBuilder;
@@ -143,7 +143,7 @@ public class ModRecipeProvider extends RecipeProvider implements IConditionBuild
.unlockedBy(getHasName(ModItems.NUGGET.get()), has(ModItems.NUGGET.get())).save(this.output); .unlockedBy(getHasName(ModItems.NUGGET.get()), has(ModItems.NUGGET.get())).save(this.output);
trimSmithing(ModItems.NUGGET_SMITHING_TEMPLATE.get(), ResourceKey.create(Registries.RECIPE, trimSmithing(ModItems.NUGGET_SMITHING_TEMPLATE.get(), ResourceKey.create(Registries.RECIPE,
ResourceLocation.parse(getItemName(ModItems.NUGGET_SMITHING_TEMPLATE.get()) + "_smithing_trim"))); Identifier.parse(getItemName(ModItems.NUGGET_SMITHING_TEMPLATE.get()) + "_smithing_trim")));
oreSmelting(this.output, NUGGET_SMELTABLES, RecipeCategory.MISC, ModItems.NUGGET.get(), 0.25f, 200, "nugget"); oreSmelting(this.output, NUGGET_SMELTABLES, RecipeCategory.MISC, ModItems.NUGGET.get(), 0.25f, 200, "nugget");
oreBlasting(this.output, NUGGET_SMELTABLES, RecipeCategory.MISC, ModItems.NUGGET.get(), 0.25f, 100, "nugget"); oreBlasting(this.output, NUGGET_SMELTABLES, RecipeCategory.MISC, ModItems.NUGGET.get(), 0.25f, 100, "nugget");

View File

@@ -1,15 +1,22 @@
package xyz.sillyangel.nugget.item; package dev.sillyangel.nugget.item;
import xyz.sillyangel.nugget.NuggetMod; import dev.sillyangel.nugget.NuggetMod;
import xyz.sillyangel.nugget.util.ModTags; import dev.sillyangel.nugget.util.ModTags;
import net.minecraft.Util; import net.minecraft.util.Util;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.Identifier;
import net.minecraft.resources.ResourceKey;
import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundEvents;
import net.minecraft.world.item.equipment.ArmorMaterial; import net.minecraft.world.item.equipment.ArmorMaterial;
import net.minecraft.world.item.equipment.ArmorType; import net.minecraft.world.item.equipment.ArmorType;
import net.minecraft.world.item.equipment.EquipmentAsset;
import java.util.EnumMap; import java.util.EnumMap;
public class ModArmorMaterials { public class ModArmorMaterials {
public static final ResourceKey<EquipmentAsset> NUGGET_EQUIPMENT_ASSET =
ResourceKey.create(ResourceKey.createRegistryKey(Identifier.withDefaultNamespace("equipment_asset")),
Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget"));
public static final ArmorMaterial NUGGET_ARMOR_MATERIAL = new ArmorMaterial(1200, Util.make(new EnumMap<>(ArmorType.class), public static final ArmorMaterial NUGGET_ARMOR_MATERIAL = new ArmorMaterial(1200, Util.make(new EnumMap<>(ArmorType.class),
attribute -> { attribute -> {
attribute.put(ArmorType.BOOTS, 5); attribute.put(ArmorType.BOOTS, 5);
@@ -18,5 +25,6 @@ public class ModArmorMaterials {
attribute.put(ArmorType.HELMET, 5); attribute.put(ArmorType.HELMET, 5);
attribute.put(ArmorType.BODY, 11); attribute.put(ArmorType.BODY, 11);
}), 20, SoundEvents.ARMOR_EQUIP_NETHERITE, }), 20, SoundEvents.ARMOR_EQUIP_NETHERITE,
4f, 0.1f, ModTags.Items.NUGGET_REPAIRS, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget")); 4f, 0.1f, ModTags.Items.NUGGET_REPAIRS, NUGGET_EQUIPMENT_ASSET);
} }

View File

@@ -1,14 +1,14 @@
package xyz.sillyangel.nugget.item; package dev.sillyangel.nugget.item;
import net.minecraft.core.registries.Registries; import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Component;
import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.eventbus.api.bus.BusGroup;
import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.RegistryObject; import net.minecraftforge.registries.RegistryObject;
import xyz.sillyangel.nugget.NuggetMod; import dev.sillyangel.nugget.NuggetMod;
import xyz.sillyangel.nugget.block.ModBlocks; import dev.sillyangel.nugget.block.ModBlocks;
public class ModCreativeModeTabs { public class ModCreativeModeTabs {
public static final DeferredRegister<CreativeModeTab> CREATIVE_MODE_TABS = public static final DeferredRegister<CreativeModeTab> CREATIVE_MODE_TABS =
@@ -53,7 +53,7 @@ public class ModCreativeModeTabs {
public static void register(IEventBus eventBus) { public static void register(BusGroup busGroup) {
CREATIVE_MODE_TABS.register(eventBus); CREATIVE_MODE_TABS.register(busGroup);
} }
} }

View File

@@ -1,4 +1,4 @@
package xyz.sillyangel.nugget.item; package dev.sillyangel.nugget.item;
import net.minecraft.world.food.FoodProperties; import net.minecraft.world.food.FoodProperties;

View File

@@ -0,0 +1,96 @@
package dev.sillyangel.nugget.item;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.item.equipment.ArmorType;
import dev.sillyangel.nugget.NuggetMod;
import net.minecraftforge.eventbus.api.bus.BusGroup;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraft.resources.Identifier;
import net.minecraftforge.registries.RegistryObject;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ShovelItem;
import net.minecraft.world.item.AxeItem;
import net.minecraft.world.item.HoeItem;
import net.minecraft.world.item.SmithingTemplateItem;
import dev.sillyangel.nugget.sound.ModSounds;
public class ModItems {
public static final DeferredRegister<Item> ITEMS =
DeferredRegister.create(ForgeRegistries.ITEMS, NuggetMod.MOD_ID);
public static final RegistryObject<Item> NUGGET = ITEMS.register("nugget",
() -> new Item(new Item.Properties().setId(ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget")))
.food(ModFoodProperties.Nugget)));
public static final RegistryObject<Item> RAW_NUGGET = ITEMS.register("raw_nugget",
() -> new Item(new Item.Properties().setId(ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "raw_nugget")))));
public static final RegistryObject<Item> NUGGET_SWORD = ITEMS.register("nugget_sword",
() -> new Item(new Item.Properties()
.setId(ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_sword")))
.sword(ModToolTiers.NUGGET, 3.0F, -2.4F)));
public static final RegistryObject<Item> NUGGET_PICKAXE = ITEMS.register("nugget_pickaxe",
() -> new Item(new Item.Properties()
.setId(ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_pickaxe")))
.pickaxe(ModToolTiers.NUGGET, 1.0F, -2.8F)));
public static final RegistryObject<Item> NUGGET_SHOVEL = ITEMS.register("nugget_shovel",
() -> new ShovelItem(ModToolTiers.NUGGET, 1.5f, -3.0f, new Item.Properties()
.setId(ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_shovel")))));
public static final RegistryObject<Item> NUGGET_AXE = ITEMS.register("nugget_axe",
() -> new AxeItem(ModToolTiers.NUGGET, 6, -3.2f, new Item.Properties()
.setId(ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_axe")))));
public static final RegistryObject<Item> NUGGET_HOE = ITEMS.register("nugget_hoe",
() -> new HoeItem(ModToolTiers.NUGGET, 0, -3.0f, new Item.Properties()
.setId(ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_hoe")))));
// armor things
public static final RegistryObject<Item> NUGGET_HELMET = ITEMS.register("nugget_helmet",
() -> new Item(new Item.Properties()
.setId(ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_helmet")))
.humanoidArmor(ModArmorMaterials.NUGGET_ARMOR_MATERIAL, ArmorType.HELMET)));
public static final RegistryObject<Item> NUGGET_CHESTPLATE = ITEMS.register("nugget_chestplate",
() -> new Item(new Item.Properties()
.setId(ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_chestplate")))
.humanoidArmor(ModArmorMaterials.NUGGET_ARMOR_MATERIAL, ArmorType.CHESTPLATE)));
public static final RegistryObject<Item> NUGGET_LEGGINGS = ITEMS.register("nugget_leggings",
() -> new Item(new Item.Properties()
.setId(ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_leggings")))
.humanoidArmor(ModArmorMaterials.NUGGET_ARMOR_MATERIAL, ArmorType.LEGGINGS)));
public static final RegistryObject<Item> NUGGET_BOOTS = ITEMS.register("nugget_boots",
() -> new Item(new Item.Properties()
.setId(ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_boots")))
.humanoidArmor(ModArmorMaterials.NUGGET_ARMOR_MATERIAL, ArmorType.BOOTS)));
// horse armor
public static final RegistryObject<Item> NUGGET_HORSE_ARMOR = ITEMS.register("nugget_horse_armor",
() -> new Item(new Item.Properties()
.setId(ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_horse_armor")))
.horseArmor(ModArmorMaterials.NUGGET_ARMOR_MATERIAL)
.stacksTo(1)));
// smithing temp
public static final RegistryObject<Item> NUGGET_SMITHING_TEMPLATE = ITEMS.register("nugget_armor_trim_smithing_template",
() -> SmithingTemplateItem.createArmorTrimTemplate(new Item.Properties()
.setId(ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_armor_trim_smithing_template")))));
public static final RegistryObject<Item> NUGGET_MUSIC_DISC = ITEMS.register("nugget_music_disc",
() -> new Item(new Item.Properties()
.setId(ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_music_disc")))
.jukeboxPlayable(ModSounds.NUGGET_THEME_KEY).stacksTo(1)));
public static void register(BusGroup busGroup) {
ITEMS.register(busGroup);
}
}

View File

@@ -1,7 +1,7 @@
package xyz.sillyangel.nugget.item; package dev.sillyangel.nugget.item;
import net.minecraft.world.item.ToolMaterial; import net.minecraft.world.item.ToolMaterial;
import xyz.sillyangel.nugget.util.ModTags; import dev.sillyangel.nugget.util.ModTags;
public class ModToolTiers { public class ModToolTiers {
public static final ToolMaterial NUGGET = new ToolMaterial(ModTags.Blocks.INCORRECT_FOR_NUGGET_TOOL, public static final ToolMaterial NUGGET = new ToolMaterial(ModTags.Blocks.INCORRECT_FOR_NUGGET_TOOL,

View File

@@ -1,12 +1,12 @@
package xyz.sillyangel.nugget.sound; package dev.sillyangel.nugget.sound;
import net.minecraft.core.registries.Registries; import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceKey;
import net.minecraft.world.item.JukeboxSong; import net.minecraft.world.item.JukeboxSong;
import xyz.sillyangel.nugget.NuggetMod; import dev.sillyangel.nugget.NuggetMod;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.Identifier;
import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvent;
import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.eventbus.api.bus.BusGroup;
import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject; import net.minecraftforge.registries.RegistryObject;
@@ -18,14 +18,14 @@ public class ModSounds {
public static final RegistryObject<SoundEvent> NUGGET_THEME = registerSoundEvent("nugget_theme"); public static final RegistryObject<SoundEvent> NUGGET_THEME = registerSoundEvent("nugget_theme");
public static final ResourceKey<JukeboxSong> NUGGET_THEME_KEY = ResourceKey.create(Registries.JUKEBOX_SONG, public static final ResourceKey<JukeboxSong> NUGGET_THEME_KEY = ResourceKey.create(Registries.JUKEBOX_SONG,
ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_theme")); Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_theme"));
private static RegistryObject<SoundEvent> registerSoundEvent(String name) { private static RegistryObject<SoundEvent> registerSoundEvent(String name) {
return SOUND_EVENT.register(name, () -> SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, name))); return SOUND_EVENT.register(name, () -> SoundEvent.createVariableRangeEvent(Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, name)));
} }
public static void register(IEventBus eventBus) { public static void register(BusGroup busGroup) {
SOUND_EVENT.register(eventBus); SOUND_EVENT.register(busGroup);
} }
} }

View File

@@ -1,15 +1,15 @@
package xyz.sillyangel.nugget.trim; package dev.sillyangel.nugget.trim;
import xyz.sillyangel.nugget.NuggetMod; import dev.sillyangel.nugget.NuggetMod;
import xyz.sillyangel.nugget.item.ModItems; import dev.sillyangel.nugget.item.ModItems;
import net.minecraft.Util; import net.minecraft.util.Util;
import net.minecraft.core.registries.Registries; import net.minecraft.core.registries.Registries;
import net.minecraft.data.worldgen.BootstrapContext; import net.minecraft.data.worldgen.BootstrapContext;
import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.Style; import net.minecraft.network.chat.Style;
import net.minecraft.network.chat.TextColor; import net.minecraft.network.chat.TextColor;
import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.Identifier;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
import net.minecraft.world.item.equipment.trim.TrimMaterial; import net.minecraft.world.item.equipment.trim.TrimMaterial;
@@ -17,7 +17,7 @@ import java.util.Map;
public class ModTrimMaterials { public class ModTrimMaterials {
public static final ResourceKey<TrimMaterial> NUGGET = public static final ResourceKey<TrimMaterial> NUGGET =
ResourceKey.create(Registries.TRIM_MATERIAL, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget")); ResourceKey.create(Registries.TRIM_MATERIAL, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget"));
public static void bootstrap(BootstrapContext<TrimMaterial> context) { public static void bootstrap(BootstrapContext<TrimMaterial> context) {
register(context, NUGGET, ModItems.NUGGET.get(), Style.EMPTY.withColor(TextColor.parseColor("#f9b042").getOrThrow()), 0.1F); register(context, NUGGET, ModItems.NUGGET.get(), Style.EMPTY.withColor(TextColor.parseColor("#f9b042").getOrThrow()), 0.1F);

View File

@@ -1,20 +1,20 @@
package xyz.sillyangel.nugget.trim; package dev.sillyangel.nugget.trim;
import net.minecraft.world.item.equipment.trim.TrimPattern; import net.minecraft.world.item.equipment.trim.TrimPattern;
import xyz.sillyangel.nugget.NuggetMod; import dev.sillyangel.nugget.NuggetMod;
import xyz.sillyangel.nugget.item.ModItems; import dev.sillyangel.nugget.item.ModItems;
import net.minecraft.Util; import net.minecraft.util.Util;
import net.minecraft.core.registries.Registries; import net.minecraft.core.registries.Registries;
import net.minecraft.data.worldgen.BootstrapContext; import net.minecraft.data.worldgen.BootstrapContext;
import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.Identifier;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.ForgeRegistries;
public class ModTrimPatterns { public class ModTrimPatterns {
public static final ResourceKey<TrimPattern> NUGGET = ResourceKey.create(Registries.TRIM_PATTERN, public static final ResourceKey<TrimPattern> NUGGET = ResourceKey.create(Registries.TRIM_PATTERN,
ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget")); Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget"));
public static void bootstrap(BootstrapContext<TrimPattern> context) { public static void bootstrap(BootstrapContext<TrimPattern> context) {
register(context, ModItems.NUGGET_SMITHING_TEMPLATE.get(), NUGGET); register(context, ModItems.NUGGET_SMITHING_TEMPLATE.get(), NUGGET);

View File

@@ -1,4 +1,4 @@
package xyz.sillyangel.nugget.util; package dev.sillyangel.nugget.util;
public class ModItemProperites { public class ModItemProperites {
// i dont know what to put here?! // i dont know what to put here?!

View File

@@ -1,7 +1,7 @@
package xyz.sillyangel.nugget.util; package dev.sillyangel.nugget.util;
import xyz.sillyangel.nugget.NuggetMod; import dev.sillyangel.nugget.NuggetMod;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.Identifier;
import net.minecraft.tags.BlockTags; import net.minecraft.tags.BlockTags;
import net.minecraft.tags.ItemTags; import net.minecraft.tags.ItemTags;
import net.minecraft.tags.TagKey; import net.minecraft.tags.TagKey;
@@ -14,7 +14,7 @@ public class ModTags {
public static final TagKey<Block> INCORRECT_FOR_NUGGET_TOOL = createTag("incorrect_for_nugget_tool"); public static final TagKey<Block> INCORRECT_FOR_NUGGET_TOOL = createTag("incorrect_for_nugget_tool");
private static TagKey<Block> createTag(String name) { private static TagKey<Block> createTag(String name) {
return BlockTags.create(ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, name)); return BlockTags.create(Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, name));
} }
} }
@@ -23,7 +23,7 @@ public class ModTags {
public static final TagKey<Item> NUGGET_REPAIRS = createTag("nugget_repairs"); public static final TagKey<Item> NUGGET_REPAIRS = createTag("nugget_repairs");
private static TagKey<Item> createTag(String name) { private static TagKey<Item> createTag(String name) {
return ItemTags.create(ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, name)); return ItemTags.create(Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, name));
} }
} }
} }

View File

@@ -1,14 +1,14 @@
package xyz.sillyangel.nugget.worldgen; package dev.sillyangel.nugget.worldgen;
import net.minecraft.core.HolderSet; import net.minecraft.core.HolderSet;
import net.minecraft.tags.BiomeTags; import net.minecraft.tags.BiomeTags;
import net.minecraft.world.level.levelgen.GenerationStep; import net.minecraft.world.level.levelgen.GenerationStep;
import net.minecraftforge.common.world.ForgeBiomeModifiers; import net.minecraftforge.common.world.ForgeBiomeModifiers;
import xyz.sillyangel.nugget.NuggetMod; import dev.sillyangel.nugget.NuggetMod;
import net.minecraft.core.registries.Registries; import net.minecraft.core.registries.Registries;
import net.minecraft.data.worldgen.BootstrapContext; import net.minecraft.data.worldgen.BootstrapContext;
import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.Identifier;
import net.minecraftforge.common.world.BiomeModifier; import net.minecraftforge.common.world.BiomeModifier;
import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.ForgeRegistries;
@@ -29,6 +29,6 @@ public class ModBiomeModifiers {
} }
private static ResourceKey<BiomeModifier> registerKey(String name) { private static ResourceKey<BiomeModifier> registerKey(String name) {
return ResourceKey.create(ForgeRegistries.Keys.BIOME_MODIFIERS, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, name)); return ResourceKey.create(ForgeRegistries.Keys.BIOME_MODIFIERS, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, name));
} }
} }

View File

@@ -1,18 +1,18 @@
package xyz.sillyangel.nugget.worldgen; package dev.sillyangel.nugget.worldgen;
import net.minecraft.tags.BlockTags; import net.minecraft.tags.BlockTags;
import net.minecraft.world.level.levelgen.feature.configurations.OreConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.OreConfiguration;
import net.minecraft.world.level.levelgen.structure.templatesystem.RuleTest; import net.minecraft.world.level.levelgen.structure.templatesystem.RuleTest;
import net.minecraft.world.level.levelgen.structure.templatesystem.TagMatchTest; import net.minecraft.world.level.levelgen.structure.templatesystem.TagMatchTest;
import xyz.sillyangel.nugget.NuggetMod; import dev.sillyangel.nugget.NuggetMod;
import net.minecraft.core.registries.Registries; import net.minecraft.core.registries.Registries;
import net.minecraft.data.worldgen.BootstrapContext; import net.minecraft.data.worldgen.BootstrapContext;
import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.Identifier;
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature; import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
import net.minecraft.world.level.levelgen.feature.Feature; import net.minecraft.world.level.levelgen.feature.Feature;
import net.minecraft.world.level.levelgen.feature.configurations.FeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.FeatureConfiguration;
import xyz.sillyangel.nugget.block.ModBlocks; import dev.sillyangel.nugget.block.ModBlocks;
import java.util.List; import java.util.List;
@@ -34,7 +34,7 @@ public class ModConfiguredFeatures {
} }
public static ResourceKey<ConfiguredFeature<?, ?>> registerKey(String name) { public static ResourceKey<ConfiguredFeature<?, ?>> registerKey(String name) {
return ResourceKey.create(Registries.CONFIGURED_FEATURE, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, name)); return ResourceKey.create(Registries.CONFIGURED_FEATURE, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, name));
} }
private static <FC extends FeatureConfiguration, F extends Feature<FC>> void register(BootstrapContext<ConfiguredFeature<?, ?>> context, private static <FC extends FeatureConfiguration, F extends Feature<FC>> void register(BootstrapContext<ConfiguredFeature<?, ?>> context,

View File

@@ -1,4 +1,4 @@
package xyz.sillyangel.nugget.worldgen; package dev.sillyangel.nugget.worldgen;
import net.minecraft.world.level.levelgen.placement.*; import net.minecraft.world.level.levelgen.placement.*;

View File

@@ -1,13 +1,13 @@
package xyz.sillyangel.nugget.worldgen; package dev.sillyangel.nugget.worldgen;
import net.minecraft.world.level.levelgen.VerticalAnchor; import net.minecraft.world.level.levelgen.VerticalAnchor;
import net.minecraft.world.level.levelgen.placement.HeightRangePlacement; import net.minecraft.world.level.levelgen.placement.HeightRangePlacement;
import xyz.sillyangel.nugget.NuggetMod; import dev.sillyangel.nugget.NuggetMod;
import net.minecraft.core.Holder; import net.minecraft.core.Holder;
import net.minecraft.core.registries.Registries; import net.minecraft.core.registries.Registries;
import net.minecraft.data.worldgen.BootstrapContext; import net.minecraft.data.worldgen.BootstrapContext;
import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.Identifier;
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature; import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
import net.minecraft.world.level.levelgen.placement.PlacedFeature; import net.minecraft.world.level.levelgen.placement.PlacedFeature;
import net.minecraft.world.level.levelgen.placement.PlacementModifier; import net.minecraft.world.level.levelgen.placement.PlacementModifier;
@@ -28,7 +28,7 @@ public class ModPlacedFeatures {
} }
private static ResourceKey<PlacedFeature> registerKey(String name) { private static ResourceKey<PlacedFeature> registerKey(String name) {
return ResourceKey.create(Registries.PLACED_FEATURE, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, name)); return ResourceKey.create(Registries.PLACED_FEATURE, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, name));
} }
private static void register(BootstrapContext<PlacedFeature> context, ResourceKey<PlacedFeature> key, Holder<ConfiguredFeature<?, ?>> configuration, private static void register(BootstrapContext<PlacedFeature> context, ResourceKey<PlacedFeature> key, Holder<ConfiguredFeature<?, ?>> configuration,

View File

@@ -1,63 +0,0 @@
package xyz.sillyangel.nugget;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Item;
import net.minecraftforge.common.ForgeConfigSpec;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.config.ModConfigEvent;
import net.minecraftforge.registries.ForgeRegistries;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
// An example config class. This is not required, but it's a good idea to have one to keep your config organized.
// Demonstrates how to use Forge's config APIs
@Mod.EventBusSubscriber(modid = NuggetMod.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
public class Config
{
private static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder();
private static final ForgeConfigSpec.BooleanValue LOG_DIRT_BLOCK = BUILDER
.comment("Whether to log the dirt block on common setup")
.define("logDirtBlock", true);
private static final ForgeConfigSpec.IntValue MAGIC_NUMBER = BUILDER
.comment("A magic number")
.defineInRange("magicNumber", 42, 0, Integer.MAX_VALUE);
public static final ForgeConfigSpec.ConfigValue<String> MAGIC_NUMBER_INTRODUCTION = BUILDER
.comment("What you want the introduction message to be for the magic number")
.define("magicNumberIntroduction", "The magic number is... ");
// a list of strings that are treated as resource locations for items
private static final ForgeConfigSpec.ConfigValue<List<? extends String>> ITEM_STRINGS = BUILDER
.comment("A list of items to log on common setup.")
.defineListAllowEmpty("items", List.of("minecraft:iron_ingot"), Config::validateItemName);
static final ForgeConfigSpec SPEC = BUILDER.build();
public static boolean logDirtBlock;
public static int magicNumber;
public static String magicNumberIntroduction;
public static Set<Item> items;
private static boolean validateItemName(final Object obj)
{
return obj instanceof final String itemName && ForgeRegistries.ITEMS.containsKey(ResourceLocation.tryParse(itemName));
}
@SubscribeEvent
static void onLoad(final ModConfigEvent event)
{
logDirtBlock = LOG_DIRT_BLOCK.get();
magicNumber = MAGIC_NUMBER.get();
magicNumberIntroduction = MAGIC_NUMBER_INTRODUCTION.get();
// convert the list of strings into a set of items
items = ITEM_STRINGS.get().stream()
.map(itemName -> ForgeRegistries.ITEMS.getValue(ResourceLocation.tryParse(itemName)))
.collect(Collectors.toSet());
}
}

View File

@@ -1,97 +0,0 @@
package xyz.sillyangel.nugget.item;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.item.equipment.ArmorType;
import xyz.sillyangel.nugget.NuggetMod;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.registries.RegistryObject;
import net.minecraft.world.item.*;
import xyz.sillyangel.nugget.sound.ModSounds;
import java.util.List;
public class ModItems {
public static final DeferredRegister<Item> ITEMS =
DeferredRegister.create(ForgeRegistries.ITEMS, NuggetMod.MOD_ID);
public static final RegistryObject<Item> NUGGET = ITEMS.register("nugget",
() -> new Item(new Item.Properties().setId(ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget")))
.food(ModFoodProperties.Nugget)) {
@Override
public void appendHoverText(ItemStack pStack, TooltipContext pContext, List<Component> pTooltipComponent, TooltipFlag pTooltipFlag) {
pTooltipComponent.add(Component.translatable("item.nuggetmod.nugget.tooltip"));
super.appendHoverText(pStack, pContext, pTooltipComponent, pTooltipFlag);
}
});
public static final RegistryObject<Item> RAW_NUGGET = ITEMS.register("raw_nugget",
() -> new Item(new Item.Properties().setId(ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "raw_nugget")))));
public static final RegistryObject<Item> NUGGET_SWORD = ITEMS.register("nugget_sword",
() -> new SwordItem(ModToolTiers.NUGGET, 3, -2.4f, new Item.Properties()
.setId(ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_sword")))));
public static final RegistryObject<Item> NUGGET_PICKAXE = ITEMS.register("nugget_pickaxe",
() -> new PickaxeItem(ModToolTiers.NUGGET, 1, -2.8f, new Item.Properties()
.setId(ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_pickaxe")))));
public static final RegistryObject<Item> NUGGET_SHOVEL = ITEMS.register("nugget_shovel",
() -> new ShovelItem(ModToolTiers.NUGGET, 1.5f, -3.0f, new Item.Properties()
.setId(ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_shovel")))));
public static final RegistryObject<Item> NUGGET_AXE = ITEMS.register("nugget_axe",
() -> new AxeItem(ModToolTiers.NUGGET, 6, -3.2f, new Item.Properties()
.setId(ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_axe")))));
public static final RegistryObject<Item> NUGGET_HOE = ITEMS.register("nugget_hoe",
() -> new HoeItem(ModToolTiers.NUGGET, 0, -3.0f, new Item.Properties()
.setId(ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_hoe")))));
// armor things
public static final RegistryObject<Item> NUGGET_HELMET = ITEMS.register("nugget_helmet",
() -> new ArmorItem(ModArmorMaterials.NUGGET_ARMOR_MATERIAL, ArmorType.HELMET,
new Item.Properties()
.setId(ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_helmet")))));
public static final RegistryObject<Item> NUGGET_CHESTPLATE = ITEMS.register("nugget_chestplate",
() -> new ArmorItem(ModArmorMaterials.NUGGET_ARMOR_MATERIAL, ArmorType.CHESTPLATE,
new Item.Properties()
.setId(ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_chestplate")))));
public static final RegistryObject<Item> NUGGET_LEGGINGS = ITEMS.register("nugget_leggings",
() -> new ArmorItem(ModArmorMaterials.NUGGET_ARMOR_MATERIAL, ArmorType.LEGGINGS,
new Item.Properties()
.setId(ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_leggings")))));
public static final RegistryObject<Item> NUGGET_BOOTS = ITEMS.register("nugget_boots",
() -> new ArmorItem(ModArmorMaterials.NUGGET_ARMOR_MATERIAL, ArmorType.BOOTS,
new Item.Properties()
.setId(ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_boots")))));
// horse armor
public static final RegistryObject<Item> NUGGET_HORSE_ARMOR = ITEMS.register("nugget_horse_armor",
() -> new AnimalArmorItem(ModArmorMaterials.NUGGET_ARMOR_MATERIAL, AnimalArmorItem.BodyType.EQUESTRIAN, new Item.Properties()
.setId(ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_horse_armor")))
.stacksTo(1)));
// smithing temp
public static final RegistryObject<Item> NUGGET_SMITHING_TEMPLATE = ITEMS.register("nugget_armor_trim_smithing_template",
() -> SmithingTemplateItem.createArmorTrimTemplate(new Item.Properties()
.setId(ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_armor_trim_smithing_template")))));
public static final RegistryObject<Item> NUGGET_MUSIC_DISC = ITEMS.register("nugget_music_disc",
() -> new Item(new Item.Properties()
.setId(ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_music_disc")))
.jukeboxPlayable(ModSounds.NUGGET_THEME_KEY).stacksTo(1)));
public static void register(IEventBus eventBus) {
ITEMS.register(eventBus);
}
}

View File

@@ -11,7 +11,7 @@ loaderVersion="${loader_version_range}" #mandatory This is typically bumped ever
# Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here. # Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here.
license="${mod_license}" license="${mod_license}"
# A URL to refer people to when problems occur with this mod # A URL to refer people to when problems occur with this mod
#issueTrackerURL="https://change.me.to.your.issue.tracker.example.invalid/" #optional issueTrackerURL="https://github.com/sillyangel/nugget" #optional
# If your mod is purely client-side and has no multiplayer functionality (be it dedicated servers or Open to LAN), # If your mod is purely client-side and has no multiplayer functionality (be it dedicated servers or Open to LAN),
# set this to true, and Forge will set the correct displayTest for you and skip loading your mod on dedicated servers. # set this to true, and Forge will set the correct displayTest for you and skip loading your mod on dedicated servers.
#clientSideOnly=true #optional - defaults to false if absent #clientSideOnly=true #optional - defaults to false if absent
@@ -26,9 +26,9 @@ displayName="${mod_name}" #mandatory
# A URL to query for updates for this mod. See the JSON update specification https://docs.minecraftforge.net/en/latest/misc/updatechecker/ # A URL to query for updates for this mod. See the JSON update specification https://docs.minecraftforge.net/en/latest/misc/updatechecker/
#updateJSONURL="https://change.me.example.invalid/updates.json" #optional #updateJSONURL="https://change.me.example.invalid/updates.json" #optional
# A URL for the "homepage" for this mod, displayed in the mod UI # A URL for the "homepage" for this mod, displayed in the mod UI
#displayURL="https://change.me.to.your.mods.homepage.example.invalid/" #optional displayURL="https://sillyangel.dev/" #optional
# A file name (in the root of the mod JAR) containing a logo for display # A file name (in the root of the mod JAR) containing a logo for display
#logoFile="examplemod.png" #optional logoFile="splash.png" #optional
# A text field displayed in the mod UI # A text field displayed in the mod UI
#credits="" #optional #credits="" #optional
# A text field displayed in the mod UI # A text field displayed in the mod UI