update once more

This commit is contained in:
sillyangel
2024-12-30 18:57:02 -06:00
parent 3f3a1e69d4
commit 0480586663
71 changed files with 2122 additions and 1721 deletions

View File

@@ -1,35 +1,35 @@
name: Build and Upload JAR name: Build and Upload JAR
on: on:
push: push:
branches: branches:
- main - main
pull_request: pull_request:
branches: branches:
- main - main
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Set up JDK 21 - name: Set up JDK 21
uses: actions/setup-java@v3 uses: actions/setup-java@v3
with: with:
distribution: 'temurin' distribution: 'temurin'
java-version: '21' java-version: '21'
- name: Grant execute permission for gradlew - name: Grant execute permission for gradlew
run: chmod +x gradlew run: chmod +x gradlew
- name: Build with Gradle - name: Build with Gradle
run: ./gradlew build run: ./gradlew build
- name: Upload build artifacts - name: Upload build artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: build-artifact name: build-artifact
path: build/libs/*.jar path: build/libs/*.jar

View File

@@ -1,4 +1,4 @@
{ {
"java.compile.nullAnalysis.mode": "automatic", "java.compile.nullAnalysis.mode": "automatic",
"java.configuration.updateBuildConfiguration": "automatic" "java.configuration.updateBuildConfiguration": "automatic"
} }

View File

@@ -1,216 +1,216 @@
plugins { 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.24,6.2)'
id 'org.parchmentmc.librarian.forgegradle' version '1.+' id 'org.parchmentmc.librarian.forgegradle' version '1.+'
} }
version = mod_version version = mod_version
group = mod_group_id group = mod_group_id
base { base {
archivesName = mod_id archivesName = mod_id
} }
// Mojang ships Java 21 to end users in 1.20.5+, so your mod should target Java 21. // Mojang ships Java 21 to end users in 1.20.5+, so your mod should target Java 21.
java.toolchain.languageVersion = JavaLanguageVersion.of(21) java.toolchain.languageVersion = JavaLanguageVersion.of(21)
println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}" println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
minecraft { minecraft {
// The mappings can be changed at any time and must be in the following format. // The mappings can be changed at any time and must be in the following format.
// Channel: Version: // Channel: Version:
// 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. // 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 // 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. // 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. // 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.
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.
// In most cases, it is not necessary to enable. // In most cases, it is not necessary to enable.
// enableEclipsePrepareRuns = true // enableEclipsePrepareRuns = true
// enableIdeaPrepareRuns = true // enableIdeaPrepareRuns = true
// This property allows configuring Gradle's ProcessResources task(s) to run on IDE output locations before launching the game. // This property allows configuring Gradle's ProcessResources task(s) to run on IDE output locations before launching the game.
// It is REQUIRED to be set to true for this template to function. // It is REQUIRED to be set to true for this template to function.
// 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
copyIdeResources = true copyIdeResources = true
// When true, this property will add the folder name of all declared run configurations to generated IDE run configurations. // When true, this property will add the folder name of all declared run configurations to generated IDE run configurations.
// The folder name can be set on a run configuration using the "folderName" property. // The folder name can be set on a run configuration using the "folderName" property.
// 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.
// They will be 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.
// See https://docs.minecraftforge.net/en/latest/advanced/accesstransformers/ for more information. // See https://docs.minecraftforge.net/en/latest/advanced/accesstransformers/ for more information.
// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
// Default run configurations. // Default run configurations.
// These can be tweaked, removed, or duplicated as needed. // These can be tweaked, removed, or duplicated as needed.
runs { runs {
// applies to all the run configs below // applies to all the run configs below
configureEach { configureEach {
workingDirectory project.file('run') workingDirectory project.file('run')
// Recommended logging data for a userdev environment // Recommended logging data for a userdev environment
// 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 // Recommended logging level for the console
// You can set various levels here. // You can set various levels here.
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels // 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'
} }
client { client {
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces. // Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
property 'forge.enabledGameTestNamespaces', mod_id property 'forge.enabledGameTestNamespaces', mod_id
} }
server { server {
property 'forge.enabledGameTestNamespaces', mod_id property 'forge.enabledGameTestNamespaces', mod_id
args '--nogui' args '--nogui'
} }
// This run config launches GameTestServer and runs all registered gametests, then exits. // This run config launches GameTestServer and runs all registered gametests, then exits.
// By default, the server will crash when no gametests are provided. // By default, the server will crash when no gametests are provided.
// The gametest system is also enabled by default for other run configs under the /test command. // The gametest system is also enabled by default for other run configs under the /test command.
gameTestServer { gameTestServer {
property 'forge.enabledGameTestNamespaces', mod_id property 'forge.enabledGameTestNamespaces', mod_id
} }
data { data {
// example of overriding the workingDirectory set in configureEach above // example of overriding the workingDirectory set in configureEach above
workingDirectory project.file('run-data') workingDirectory project.file('run-data')
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources. // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
} }
} }
} }
// Include resources generated by data generators. // Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' } 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 // ForgeGradle automatically adds the Forge maven and Maven Central for you
// 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
// flatDir { // flatDir {
// dir 'libs' // dir 'libs'
// } // }
} }
dependencies { dependencies {
// Specify the version of Minecraft to use. // Specify the version of Minecraft to use.
// Any artifact can be supplied so long as it has a "userdev" classifier artifact and is a compatible patcher artifact. // Any artifact can be supplied so long as it has a "userdev" classifier artifact and is a compatible patcher artifact.
// The "userdev" classifier will be requested and setup by ForgeGradle. // The "userdev" classifier will be requested and setup by ForgeGradle.
// If the group id is "net.minecraft" and the artifact id is one of ["client", "server", "joined"], // If the group id is "net.minecraft" and the artifact id is one of ["client", "server", "joined"],
// 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}"
// 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}"
// compileOnly "mezz.jei:jei-${mc_version}-forge-api:${jei_version}" // compileOnly "mezz.jei:jei-${mc_version}-forge-api:${jei_version}"
// runtimeOnly "mezz.jei:jei-${mc_version}-forge:${jei_version}" // runtimeOnly "mezz.jei:jei-${mc_version}-forge:${jei_version}"
// Example mod dependency using a mod jar from ./libs with a flat dir repository // Example mod dependency using a mod jar from ./libs with a flat dir repository
// This maps to ./libs/coolmod-${mc_version}-${coolmod_version}.jar // This maps to ./libs/coolmod-${mc_version}-${coolmod_version}.jar
// The group id is ignored when searching -- in this case, it is "blank" // The group id is ignored when searching -- in this case, it is "blank"
// implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}") // implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}")
// 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+ // 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' } } 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).configure {
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,
loader_version_range: loader_version_range, loader_version_range: loader_version_range,
mod_id: mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version, mod_id: mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version,
mod_authors: mod_authors, mod_description: mod_description, mod_authors: mod_authors, mod_description: mod_description,
] ]
inputs.properties replaceProperties inputs.properties replaceProperties
filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) { filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) {
expand replaceProperties + [project: project] expand replaceProperties + [project: project]
} }
} }
// 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).configure {
manifest { manifest {
attributes([ attributes([
'Specification-Title' : mod_id, 'Specification-Title' : mod_id,
'Specification-Vendor' : mod_authors, 'Specification-Vendor' : mod_authors,
'Specification-Version' : '1', // We are version 1 of ourselves 'Specification-Version' : '1', // We are version 1 of ourselves
'Implementation-Title' : project.name, 'Implementation-Title' : project.name,
'Implementation-Version' : project.jar.archiveVersion, 'Implementation-Version' : project.jar.archiveVersion,
'Implementation-Vendor' : mod_authors 'Implementation-Vendor' : mod_authors
]) ])
} }
} }
// Example configuration to allow publishing using the maven-publish plugin // Example configuration to allow publishing using the maven-publish plugin
publishing { publishing {
publications { publications {
register('mavenJava', MavenPublication) { register('mavenJava', MavenPublication) {
artifact jar artifact jar
} }
} }
repositories { repositories {
maven { maven {
url "file://${project.projectDir}/mcmodsrepo" url "file://${project.projectDir}/mcmodsrepo"
} }
} }
} }
tasks.withType(JavaCompile).configureEach { 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
} }
eclipse { eclipse {
// Run everytime eclipse builds the code // Run everytime eclipse builds the code
//autoBuildTasks genEclipseRuns //autoBuildTasks genEclipseRuns
// Run when importing the project // Run when importing the project
synchronizationTasks 'genEclipseRuns' synchronizationTasks 'genEclipseRuns'
} }
// Merge the resources and classes into the same directory. // Merge the resources and classes into the same directory.
// This is done 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 {
def dir = layout.buildDirectory.dir("sourcesSets/$it.name") def dir = layout.buildDirectory.dir("sourcesSets/$it.name")
it.output.resourcesDir = dir it.output.resourcesDir = dir
it.java.destinationDirectory = dir it.java.destinationDirectory = dir
} }

View File

@@ -69,8 +69,8 @@
- 50.0.22 Add GatherComponentsEvent (#9944) - 50.0.22 Add GatherComponentsEvent (#9944)
- 50.0.21 Fix powered rails not propogating correctly. - 50.0.21 Fix powered rails not propogating correctly.
- 50.0.20 Remove ICustomPacket and add PayloadChannel. (#9972) - 50.0.20 Remove ICustomPacket and add PayloadChannel. (#9972)
New PayloadChannel that uses the vanilla payload Type for packet distinction New PayloadChannel that uses the vanilla payload Type for packet distinction
Implement the minecraft:register/unregister channels using the new PayloadChannel Implement the minecraft:register/unregister channels using the new PayloadChannel
New generic channel builder function allowing people to implement channels however they want. New generic channel builder function allowing people to implement channels however they want.
- 50.0.19 Implement entity aware armor model and texture hooks. Closes #9960 - 50.0.19 Implement entity aware armor model and texture hooks. Closes #9960
- 50.0.18 Fix finalizeSpawn's return value not being used correctly. Closes #9964 - 50.0.18 Fix finalizeSpawn's return value not being used correctly. Closes #9964
@@ -83,11 +83,11 @@
- 50.0.11 Some patch cleanup (#9951) - 50.0.11 Some patch cleanup (#9951)
- 50.0.10 Filter paths discovered by ServiceProvider in ClasspathLocator. Closes #9899 - 50.0.10 Filter paths discovered by ServiceProvider in ClasspathLocator. Closes #9899
- 50.0.9 Update SimpleChannel to make StreamCodecs easier (#9959) - 50.0.9 Update SimpleChannel to make StreamCodecs easier (#9959)
Rework networking so that RegistryFriendlyByteBuf is useable for modders Rework networking so that RegistryFriendlyByteBuf is useable for modders
Simple support for StreamCodec in SimpleChannel Simple support for StreamCodec in SimpleChannel
Codecify all Forge packets Codecify all Forge packets
Make simpler builder pattern for SimpleChannel. Will eventually deprecate the old MessageBuilder as it's verbose and poorly written. Make simpler builder pattern for SimpleChannel. Will eventually deprecate the old MessageBuilder as it's verbose and poorly written.
Co-authored-by: MrCrayfish <4958241+MrCrayfish@users.noreply.github.com> Co-authored-by: MrCrayfish <4958241+MrCrayfish@users.noreply.github.com>
Co-authored-by: Paint_Ninja <PaintNinja@users.noreply.github.com> Co-authored-by: Paint_Ninja <PaintNinja@users.noreply.github.com>
- 50.0.8 Fix shields not working correctly. Fixes #9966 - 50.0.8 Fix shields not working correctly. Fixes #9966
- 50.0.7 Fix RenderTarget stencil patch location. Fixes #9965 - 50.0.7 Fix RenderTarget stencil patch location. Fixes #9965

View File

@@ -1,59 +1,59 @@
# 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=-Xmx3G
org.gradle.daemon=false org.gradle.daemon=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 minecraft_version=1.21
# 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,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=51.0.33 forge_version=51.0.33
# 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=[0,)
# 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=[0,)
# 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.
# #
# | Channel | Version | | # | Channel | Version | |
# |-----------|----------------------|--------------------------------------------------------------------------------| # |-----------|----------------------|--------------------------------------------------------------------------------|
# | 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. # 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 # See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
# #
# Parchment is an unofficial project maintained by ParchmentMC, separate from Minecraft Forge. # Parchment is an unofficial project maintained by ParchmentMC, separate from Minecraft Forge.
# Additional setup is needed to use their mappings, see https://parchmentmc.org/docs/getting-started # Additional setup is needed to use their mappings, see https://parchmentmc.org/docs/getting-started
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=2024.07.28-1.21 mapping_version=2024.07.28-1.21
## Mod Properties ## Mod Properties
# The unique mod identifier for the mod. Must be lowercase in English locale. Must fit the regex [a-z][a-z0-9_]{1,63} # The unique mod identifier for the mod. Must be lowercase in English locale. Must fit the regex [a-z][a-z0-9_]{1,63}
# Must match the String constant located in the main mod class annotated with @Mod. # Must match the String constant located in the main mod class annotated with @Mod.
mod_id=nuggetmod mod_id=nuggetmod
# The human-readable display name for the mod. # The human-readable display name for the mod.
mod_name=Nugget Mod mod_name=Nugget Mod
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=MIT mod_license=MIT
# The mod version. See https://semver.org/ # The mod version. See https://semver.org/
mod_version=1.0.2 mod_version=1.0.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=xyz.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.
mod_description=gedagedigedagedago mod_description=gedagedigedagedago

184
gradlew.bat vendored
View File

@@ -1,92 +1,92 @@
@rem @rem
@rem Copyright 2015 the original author or authors. @rem Copyright 2015 the original author or authors.
@rem @rem
@rem Licensed under the Apache License, Version 2.0 (the "License"); @rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License. @rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at @rem You may obtain a copy of the License at
@rem @rem
@rem https://www.apache.org/licenses/LICENSE-2.0 @rem https://www.apache.org/licenses/LICENSE-2.0
@rem @rem
@rem Unless required by applicable law or agreed to in writing, software @rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS, @rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and @rem See the License for the specific language governing permissions and
@rem limitations under the License. @rem limitations under the License.
@rem @rem
@if "%DEBUG%"=="" @echo off @if "%DEBUG%"=="" @echo off
@rem ########################################################################## @rem ##########################################################################
@rem @rem
@rem Gradle startup script for Windows @rem Gradle startup script for Windows
@rem @rem
@rem ########################################################################## @rem ##########################################################################
@rem Set local scope for the variables with windows NT shell @rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0 set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=. if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused @rem This is normally unused
set APP_BASE_NAME=%~n0 set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME% set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter. @rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe @rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe 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.
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.
echo. echo.
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
echo location of your Java installation. echo location of your Java installation.
goto fail goto fail
:findJavaFromJavaHome :findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=% set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute if exist "%JAVA_EXE%" goto execute
echo. echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo. echo.
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
echo location of your Java installation. echo location of your Java installation.
goto fail goto fail
:execute :execute
@rem Setup the command line @rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle @rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end :end
@rem End local scope for the variables with windows NT shell @rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd if %ERRORLEVEL% equ 0 goto mainEnd
:fail :fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code! rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL% set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1 if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE% exit /b %EXIT_CODE%
:mainEnd :mainEnd
if "%OS%"=="Windows_NT" endlocal if "%OS%"=="Windows_NT" endlocal
:omega :omega

View File

@@ -1,28 +1,28 @@
#Early window height #Early window height
earlyWindowHeight = 480 earlyWindowHeight = 480
#Enable forge global version checking #Enable forge global version checking
versionCheck = true versionCheck = true
#Should we control the window. Disabling this disables new GL features and can be bad for mods that rely on them. #Should we control the window. Disabling this disables new GL features and can be bad for mods that rely on them.
earlyWindowControl = true earlyWindowControl = true
#Early window framebuffer scale #Early window framebuffer scale
earlyWindowFBScale = 1 earlyWindowFBScale = 1
#Early window provider #Early window provider
earlyWindowProvider = "fmlearlywindow" earlyWindowProvider = "fmlearlywindow"
#Early window width #Early window width
earlyWindowWidth = 854 earlyWindowWidth = 854
#Early window starts maximized #Early window starts maximized
earlyWindowMaximized = false earlyWindowMaximized = false
#Default config path for servers #Default config path for servers
defaultConfigPath = "defaultconfigs" defaultConfigPath = "defaultconfigs"
#Disables Optimized DFU client-side - already disabled on servers #Disables Optimized DFU client-side - already disabled on servers
disableOptimizedDFU = true disableOptimizedDFU = true
#Skip specific GL versions, may help with buggy graphics card drivers #Skip specific GL versions, may help with buggy graphics card drivers
earlyWindowSkipGLVersions = [] earlyWindowSkipGLVersions = []
#Whether to log a help message on first attempt, to aid troubleshooting. This setting should automatically disable itself after a successful launch #Whether to log a help message on first attempt, to aid troubleshooting. This setting should automatically disable itself after a successful launch
earlyWindowLogHelpMessage = true earlyWindowLogHelpMessage = true
#Max threads for early initialization parallelism, -1 is based on processor count #Max threads for early initialization parallelism, -1 is based on processor count
maxThreads = -1 maxThreads = -1
#Squir? #Squir?
earlyWindowSquir = false earlyWindowSquir = false
#Whether to show CPU usage stats in early window #Whether to show CPU usage stats in early window
earlyWindowShowCPU = false earlyWindowShowCPU = false

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -1,27 +1,27 @@
[30Dec2024 15:04:53.923] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--launchTarget, forge_userdev_data, --assetIndex, 17, --assetsDir, D:\.gradle\caches\forge_gradle\assets, --gameDir, ., --mod, nuggetmod, --all, --output, D:\Coding Projects\Java\forge-1.21-mod\src\generated\resources, --existing, D:\Coding Projects\Java\forge-1.21-mod\src\main\resources] [30Dec2024 18:26:11.395] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--launchTarget, forge_userdev_data, --assetIndex, 17, --assetsDir, C:\Users\diann\.gradle\caches\forge_gradle\assets, --gameDir, ., --mod, nuggetmod, --all, --output, D:\Coding Projects\Java\nuggetmod_code\src\generated\resources, --existing, D:\Coding Projects\Java\nuggetmod_code\src\main\resources]
[30Dec2024 15:04:53.927] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: JVM identified as Eclipse Adoptium OpenJDK 64-Bit Server VM 21.0.5+11-LTS [30Dec2024 18:26:11.399] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: JVM identified as Eclipse Adoptium OpenJDK 64-Bit Server VM 21.0.5+11-LTS
[30Dec2024 15:04:53.929] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 10.2.1 starting: java version 21.0.5 by Eclipse Adoptium; OS Windows 11 arch amd64 version 10.0 [30Dec2024 18:26:11.401] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 10.2.1 starting: java version 21.0.5 by Eclipse Adoptium; OS Windows 11 arch amd64 version 10.0
[30Dec2024 15:04:54.060] [main/INFO] [net.minecraftforge.fml.loading.ImmediateWindowHandler/]: ImmediateWindowProvider not loading because launch target is forge_userdev_data [30Dec2024 18:26:11.522] [main/INFO] [net.minecraftforge.fml.loading.ImmediateWindowHandler/]: ImmediateWindowProvider not loading because launch target is forge_userdev_data
[30Dec2024 15:04:54.235] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.7 Source=jar:file:///D:/.gradle/caches/modules-2/files-2.1/org.spongepowered/mixin/0.8.7/8ab114ac385e6dbdad5efafe28aba4df8120915f/mixin-0.8.7.jar!/ Service=ModLauncher Env=UNKNOWN [30Dec2024 18:26:11.777] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.7 Source=jar:file:///C:/Users/diann/.gradle/caches/modules-2/files-2.1/org.spongepowered/mixin/0.8.7/8ab114ac385e6dbdad5efafe28aba4df8120915f/mixin-0.8.7.jar!/ Service=ModLauncher Env=UNKNOWN
[30Dec2024 15:04:55.680] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.JarInJarDependencyLocator/]: No dependencies to load found. Skipping! [30Dec2024 18:26:13.326] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.JarInJarDependencyLocator/]: No dependencies to load found. Skipping!
[30Dec2024 15:04:57.181] [main/INFO] [cpw.mods.modlauncher.LaunchServiceHandler/MODLAUNCHER]: Launching target 'forge_userdev_data' with arguments [--gameDir, ., --assetsDir, D:\.gradle\caches\forge_gradle\assets, --assetIndex, 17, --mod, nuggetmod, --all, --output, D:\Coding Projects\Java\forge-1.21-mod\src\generated\resources, --existing, D:\Coding Projects\Java\forge-1.21-mod\src\main\resources] [30Dec2024 18:26:14.598] [main/INFO] [cpw.mods.modlauncher.LaunchServiceHandler/MODLAUNCHER]: Launching target 'forge_userdev_data' with arguments [--gameDir, ., --assetsDir, C:\Users\diann\.gradle\caches\forge_gradle\assets, --assetIndex, 17, --mod, nuggetmod, --all, --output, D:\Coding Projects\Java\nuggetmod_code\src\generated\resources, --existing, D:\Coding Projects\Java\nuggetmod_code\src\main\resources]
[30Dec2024 15:05:06.046] [modloading-worker-0/INFO] [net.minecraftforge.common.ForgeMod/FORGEMOD]: Forge mod loading, version 51.0.33, for MC 1.21 with MCP 20240613.102039 [30Dec2024 18:26:23.146] [modloading-worker-0/INFO] [net.minecraftforge.common.ForgeMod/FORGEMOD]: Forge mod loading, version 51.0.33, for MC 1.21 with MCP 20240613.102039
[30Dec2024 15:05:06.046] [modloading-worker-0/INFO] [net.minecraftforge.common.MinecraftForge/FORGE]: MinecraftForge v51.0.33 Initialized [30Dec2024 18:26:23.147] [modloading-worker-0/INFO] [net.minecraftforge.common.MinecraftForge/FORGE]: MinecraftForge v51.0.33 Initialized
[30Dec2024 15:05:06.090] [modloading-worker-0/INFO] [net.minecraftforge.common.ForgeMod/FORGEMOD]: Opening jdk.naming.dns/com.sun.jndi.dns to java.naming [30Dec2024 18:26:23.193] [modloading-worker-0/INFO] [net.minecraftforge.common.ForgeMod/FORGEMOD]: Opening jdk.naming.dns/com.sun.jndi.dns to java.naming
[30Dec2024 15:05:07.454] [main/INFO] [net.minecraftforge.data.loading.DatagenModLoader/]: Initializing Data Gatherer for mods [nuggetmod] [30Dec2024 18:26:24.052] [main/INFO] [net.minecraftforge.data.loading.DatagenModLoader/]: Initializing Data Gatherer for mods [nuggetmod]
[30Dec2024 15:05:07.550] [main/WARN] [net.minecraft.server.packs.VanillaPackResourcesBuilder/]: Assets URL 'union:/D:/.gradle/caches/forge_gradle/minecraft_user_repo/net/minecraftforge/forge/1.21-51.0.33_mapped_parchment_2024.07.28-1.21/forge-1.21-51.0.33_mapped_parchment_2024.07.28-1.21-recomp.jar%230!/assets/.mcassetsroot' uses unexpected schema [30Dec2024 18:26:24.314] [main/WARN] [net.minecraft.server.packs.VanillaPackResourcesBuilder/]: Assets URL 'union:/C:/Users/diann/.gradle/caches/forge_gradle/minecraft_user_repo/net/minecraftforge/forge/1.21-51.0.33_mapped_parchment_2024.07.28-1.21/forge-1.21-51.0.33_mapped_parchment_2024.07.28-1.21.jar%230!/assets/.mcassetsroot' uses unexpected schema
[30Dec2024 15:05:07.550] [main/WARN] [net.minecraft.server.packs.VanillaPackResourcesBuilder/]: Assets URL 'union:/D:/.gradle/caches/forge_gradle/minecraft_user_repo/net/minecraftforge/forge/1.21-51.0.33_mapped_parchment_2024.07.28-1.21/forge-1.21-51.0.33_mapped_parchment_2024.07.28-1.21-recomp.jar%230!/data/.mcassetsroot' uses unexpected schema [30Dec2024 18:26:24.342] [main/WARN] [net.minecraft.server.packs.VanillaPackResourcesBuilder/]: Assets URL 'union:/C:/Users/diann/.gradle/caches/forge_gradle/minecraft_user_repo/net/minecraftforge/forge/1.21-51.0.33_mapped_parchment_2024.07.28-1.21/forge-1.21-51.0.33_mapped_parchment_2024.07.28-1.21.jar%230!/data/.mcassetsroot' uses unexpected schema
[30Dec2024 15:05:07.733] [main/INFO] [net.minecraft.data.DataGenerator/]: Starting provider: Loot Tables [30Dec2024 18:26:24.633] [main/INFO] [net.minecraft.data.DataGenerator/]: Starting provider: Loot Tables
[30Dec2024 15:05:08.022] [main/INFO] [net.minecraft.data.DataGenerator/]: Loot Tables finished after 275 ms [30Dec2024 18:26:25.219] [main/INFO] [net.minecraft.data.DataGenerator/]: Loot Tables finished after 585 ms
[30Dec2024 15:05:08.022] [main/INFO] [net.minecraft.data.DataGenerator/]: Starting provider: Recipes [30Dec2024 18:26:25.219] [main/INFO] [net.minecraft.data.DataGenerator/]: Starting provider: Recipes
[30Dec2024 15:05:08.062] [main/INFO] [net.minecraft.data.DataGenerator/]: Recipes finished after 43 ms [30Dec2024 18:26:25.274] [main/INFO] [net.minecraft.data.DataGenerator/]: Recipes finished after 53 ms
[30Dec2024 15:05:08.062] [main/INFO] [net.minecraft.data.DataGenerator/]: Starting provider: Tags for minecraft:block mod id nuggetmod [30Dec2024 18:26:25.274] [main/INFO] [net.minecraft.data.DataGenerator/]: Starting provider: Tags for minecraft:block mod id nuggetmod
[30Dec2024 15:05:08.078] [main/INFO] [net.minecraft.data.DataGenerator/]: Tags for minecraft:block mod id nuggetmod finished after 7 ms [30Dec2024 18:26:25.288] [main/INFO] [net.minecraft.data.DataGenerator/]: Tags for minecraft:block mod id nuggetmod finished after 13 ms
[30Dec2024 15:05:08.078] [main/INFO] [net.minecraft.data.DataGenerator/]: Starting provider: Tags for minecraft:item mod id nuggetmod [30Dec2024 18:26:25.288] [main/INFO] [net.minecraft.data.DataGenerator/]: Starting provider: Tags for minecraft:item mod id nuggetmod
[30Dec2024 15:05:08.078] [main/INFO] [net.minecraft.data.DataGenerator/]: Tags for minecraft:item mod id nuggetmod finished after 2 ms [30Dec2024 18:26:25.292] [main/INFO] [net.minecraft.data.DataGenerator/]: Tags for minecraft:item mod id nuggetmod finished after 3 ms
[30Dec2024 15:05:08.078] [main/INFO] [net.minecraft.data.DataGenerator/]: Starting provider: Item Models: nuggetmod [30Dec2024 18:26:25.292] [main/INFO] [net.minecraft.data.DataGenerator/]: Starting provider: Item Models: nuggetmod
[30Dec2024 15:05:08.078] [main/INFO] [net.minecraft.data.DataGenerator/]: Item Models: nuggetmod finished after 4 ms [30Dec2024 18:26:25.301] [main/INFO] [net.minecraft.data.DataGenerator/]: Item Models: nuggetmod finished after 8 ms
[30Dec2024 15:05:08.078] [main/INFO] [net.minecraft.data.DataGenerator/]: Starting provider: Block States: nuggetmod [30Dec2024 18:26:25.302] [main/INFO] [net.minecraft.data.DataGenerator/]: Starting provider: Block States: nuggetmod
[30Dec2024 15:05:08.206] [main/INFO] [net.minecraft.data.DataGenerator/]: Block States: nuggetmod finished after 121 ms [30Dec2024 18:26:25.478] [main/INFO] [net.minecraft.data.DataGenerator/]: Block States: nuggetmod finished after 176 ms
[30Dec2024 15:05:08.206] [main/INFO] [net.minecraft.data.DataGenerator/]: All providers took: 467 ms [30Dec2024 18:26:25.479] [main/INFO] [net.minecraft.data.DataGenerator/]: All providers took: 846 ms
[30Dec2024 15:05:08.227] [main/INFO] [net.minecraft.data.HashCache/]: Caching: total files: 42, old count: 38, new count: 43, removed stale: 0, written: 4 [30Dec2024 18:26:25.489] [main/INFO] [net.minecraft.data.HashCache/]: Caching: total files: 58, old count: 58, new count: 59, removed stale: 0, written: 0

View File

@@ -1,14 +1,14 @@
pluginManagement { pluginManagement {
repositories { repositories {
gradlePluginPortal() gradlePluginPortal()
maven { maven {
name = 'MinecraftForge' name = 'MinecraftForge'
url = 'https://maven.minecraftforge.net/' url = 'https://maven.minecraftforge.net/'
} }
maven { url = 'https://maven.parchmentmc.org' } maven { 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.7.0'
} }

View File

@@ -1,2 +1,2 @@
// 1.21 2024-12-30T14:50:30.7413735 Tags for minecraft:item mod id nuggetmod // 1.21 2024-12-30T14:50:30.7413735 Tags for minecraft:item mod id nuggetmod
562be55fb606ffa455100bd2a6942846dcd124cb data/nuggetmod/tags/item/transformable_items.json 562be55fb606ffa455100bd2a6942846dcd124cb data/nuggetmod/tags/item/transformable_items.json

View File

@@ -1,4 +1,5 @@
// 1.21 2024-12-30T14:50:30.7520688 Tags for minecraft:block mod id nuggetmod // 1.21 2024-12-30T18:01:57.8471253 Tags for minecraft:block mod id nuggetmod
265fffb09f55ddbd810e4aca08e95427b6f8abb8 data/minecraft/tags/block/mineable/pickaxe.json 265fffb09f55ddbd810e4aca08e95427b6f8abb8 data/minecraft/tags/block/mineable/pickaxe.json
6b9f8ad5cb4e30e1a1e5fed561cbcdf19794cfba data/minecraft/tags/block/needs_diamond_tool.json d3afbade112106a4f7dba97fc08964398669700a data/minecraft/tags/block/needs_stone_tool.json
532756f975f04ecee6d351a7d1086a9c9921d694 data/minecraft/tags/block/needs_iron_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 +1,5 @@
// 1.21 2024-12-30T14:50:30.7468819 Loot Tables // 1.21 2024-12-30T14:50:30.7468819 Loot Tables
74a43d938ccd280fff25bd66ec0f55a3e2c30ad0 data/nuggetmod/loot_table/blocks/nugget_block.json 74a43d938ccd280fff25bd66ec0f55a3e2c30ad0 data/nuggetmod/loot_table/blocks/nugget_block.json
206de236ad19cf2d06cf21b0f282e5b64bd5918d data/nuggetmod/loot_table/blocks/nugget_deepslate_ore.json 206de236ad19cf2d06cf21b0f282e5b64bd5918d data/nuggetmod/loot_table/blocks/nugget_deepslate_ore.json
d65584c1286a06f15f88db5682372d78e8e0ebf7 data/nuggetmod/loot_table/blocks/nugget_ore.json d65584c1286a06f15f88db5682372d78e8e0ebf7 data/nuggetmod/loot_table/blocks/nugget_ore.json
2b4a937626ec0aa515a8a78663ce0f6142b843a6 data/nuggetmod/loot_table/blocks/raw_nugget_block.json 2b4a937626ec0aa515a8a78663ce0f6142b843a6 data/nuggetmod/loot_table/blocks/raw_nugget_block.json

View File

@@ -1,3 +1,8 @@
// 1.21 2024-12-30T14:50:30.7393544 Item Models: nuggetmod // 1.21 2024-12-30T18:01:57.8351251 Item Models: nuggetmod
90b22d61432e35fb68e2232a3eb76e15d2a77d89 assets/nuggetmod/models/item/nugget.json 90b22d61432e35fb68e2232a3eb76e15d2a77d89 assets/nuggetmod/models/item/nugget.json
762606d79e485c8a5e4447e8a1236bee89185245 assets/nuggetmod/models/item/raw_nugget.json cac221f8a7659366628c3b429c22ebd27f5adadd assets/nuggetmod/models/item/nugget_axe.json
cc6e0d754901f7397916b947124acf6ba8467153 assets/nuggetmod/models/item/nugget_hoe.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 +1,13 @@
// 1.21 2024-12-30T14:50:30.7438816 Block States: nuggetmod // 1.21 2024-12-30T14:50:30.7438816 Block States: nuggetmod
e458b67af79198beb28149bb003b81fd70269977 assets/nuggetmod/blockstates/nugget_block.json e458b67af79198beb28149bb003b81fd70269977 assets/nuggetmod/blockstates/nugget_block.json
878193901a69171263432147c8d69dc3ad6a3329 assets/nuggetmod/blockstates/nugget_deepslate_ore.json 878193901a69171263432147c8d69dc3ad6a3329 assets/nuggetmod/blockstates/nugget_deepslate_ore.json
97b7f829a5952c457a7bd71a23fd2e40c9e41afd assets/nuggetmod/blockstates/nugget_ore.json 97b7f829a5952c457a7bd71a23fd2e40c9e41afd assets/nuggetmod/blockstates/nugget_ore.json
fc3b3199be08abb9ba378b6500ae96db0336a2ac assets/nuggetmod/blockstates/raw_nugget_block.json fc3b3199be08abb9ba378b6500ae96db0336a2ac assets/nuggetmod/blockstates/raw_nugget_block.json
5cd8b360f3c316bc790a0a08cca2902f5494ecb1 assets/nuggetmod/models/block/nugget_block.json 5cd8b360f3c316bc790a0a08cca2902f5494ecb1 assets/nuggetmod/models/block/nugget_block.json
04a6c3905fc9bebb1701de7bf870efea11648a0e assets/nuggetmod/models/block/nugget_deepslate_ore.json 04a6c3905fc9bebb1701de7bf870efea11648a0e assets/nuggetmod/models/block/nugget_deepslate_ore.json
d8685b96ce2399042e685f5a0d52cc6f93aa2f7c assets/nuggetmod/models/block/nugget_ore.json d8685b96ce2399042e685f5a0d52cc6f93aa2f7c assets/nuggetmod/models/block/nugget_ore.json
22ddcb7a66f04ae207af491a5e9264556726fec1 assets/nuggetmod/models/block/raw_nugget_block.json 22ddcb7a66f04ae207af491a5e9264556726fec1 assets/nuggetmod/models/block/raw_nugget_block.json
87d953ce0211f8d1ae9e2f0411c38e6a937db408 assets/nuggetmod/models/item/nugget_block.json 87d953ce0211f8d1ae9e2f0411c38e6a937db408 assets/nuggetmod/models/item/nugget_block.json
1cbd017c90351ede4f571a9e6efd9b78640fed67 assets/nuggetmod/models/item/nugget_deepslate_ore.json 1cbd017c90351ede4f571a9e6efd9b78640fed67 assets/nuggetmod/models/item/nugget_deepslate_ore.json
e8d9aff343954c5f248feb0b5fda5d9719aff29e assets/nuggetmod/models/item/nugget_ore.json e8d9aff343954c5f248feb0b5fda5d9719aff29e assets/nuggetmod/models/item/nugget_ore.json
54f4c1e65c7687038adaf302a6471a1591ec2c2e assets/nuggetmod/models/item/raw_nugget_block.json 54f4c1e65c7687038adaf302a6471a1591ec2c2e assets/nuggetmod/models/item/raw_nugget_block.json

View File

@@ -1,21 +1,31 @@
// 1.21 2024-12-30T15:05:08.206774 Recipes // 1.21 2024-12-30T18:01:57.8391248 Recipes
39a320d3e238f524a92dae1eaa1c60d0e45ba296 data/nuggetmod/advancement/recipes/misc/nugget.json 587bf7befb4b1be77e7002038b9faf0eb5bb4ce5 data/nuggetmod/advancement/recipes/combat/nugget_sword.json
8160ae7d8117c0cc293fcd40e22d1072c16ca478 data/nuggetmod/advancement/recipes/misc/nugget_block.json 39a320d3e238f524a92dae1eaa1c60d0e45ba296 data/nuggetmod/advancement/recipes/misc/nugget.json
ebf761f6dad07dac9f3ac9f8732d291cf7930611 data/nuggetmod/advancement/recipes/misc/nugget_from_blasting_nugget_deepslate_ore.json 8160ae7d8117c0cc293fcd40e22d1072c16ca478 data/nuggetmod/advancement/recipes/misc/nugget_block.json
e10188670de3a7a815f73a66fc5f4e92a648b51e data/nuggetmod/advancement/recipes/misc/nugget_from_blasting_nugget_ore.json ebf761f6dad07dac9f3ac9f8732d291cf7930611 data/nuggetmod/advancement/recipes/misc/nugget_from_blasting_nugget_deepslate_ore.json
6138abcf020eb5235f574a65048b88a03b8dc057 data/nuggetmod/advancement/recipes/misc/nugget_from_blasting_raw_nugget.json e10188670de3a7a815f73a66fc5f4e92a648b51e data/nuggetmod/advancement/recipes/misc/nugget_from_blasting_nugget_ore.json
16fc56222bdb61afa3618038ee189f405fd20922 data/nuggetmod/advancement/recipes/misc/nugget_from_smelting_nugget_deepslate_ore.json 6138abcf020eb5235f574a65048b88a03b8dc057 data/nuggetmod/advancement/recipes/misc/nugget_from_blasting_raw_nugget.json
7b9dcb92c1af9c1982292c1efd6b4fb27513b3f5 data/nuggetmod/advancement/recipes/misc/nugget_from_smelting_nugget_ore.json 16fc56222bdb61afa3618038ee189f405fd20922 data/nuggetmod/advancement/recipes/misc/nugget_from_smelting_nugget_deepslate_ore.json
762af010e4f2c6dbf4b54f5f7c4575f28b47c524 data/nuggetmod/advancement/recipes/misc/nugget_from_smelting_raw_nugget.json 7b9dcb92c1af9c1982292c1efd6b4fb27513b3f5 data/nuggetmod/advancement/recipes/misc/nugget_from_smelting_nugget_ore.json
59e41b4b30c51f225ccb673f401839ec7e77fe20 data/nuggetmod/advancement/recipes/misc/raw_nugget.json 762af010e4f2c6dbf4b54f5f7c4575f28b47c524 data/nuggetmod/advancement/recipes/misc/nugget_from_smelting_raw_nugget.json
0eac4876a225ba434ebefcecb2d9a3d5b1af5cc3 data/nuggetmod/advancement/recipes/misc/raw_nugget_block.json 59e41b4b30c51f225ccb673f401839ec7e77fe20 data/nuggetmod/advancement/recipes/misc/raw_nugget.json
46cf496588958f9727af31d89b8adfa56f319b32 data/nuggetmod/recipe/nugget.json 0eac4876a225ba434ebefcecb2d9a3d5b1af5cc3 data/nuggetmod/advancement/recipes/misc/raw_nugget_block.json
a616003c555df86443a939fff05be631f005b5e7 data/nuggetmod/recipe/nugget_block.json a159ddd57f6c263d4862f5ee479f3df3595379d9 data/nuggetmod/advancement/recipes/tools/nugget_axe.json
7cb0715c46c01f7dd8802b3cd8302c20ccb281cf data/nuggetmod/recipe/nugget_from_blasting_nugget_deepslate_ore.json 1889633531251f9d32df839f13041a7839569079 data/nuggetmod/advancement/recipes/tools/nugget_hoe.json
662c0a68d691fcb004fdfa4b18af745502eb51c4 data/nuggetmod/recipe/nugget_from_blasting_nugget_ore.json e6dbb4576802c7009518fe2bc4dbe541f16b6687 data/nuggetmod/advancement/recipes/tools/nugget_pickaxe.json
67a9834245f8ecd74cf7b72ebeddee9e9d2296a5 data/nuggetmod/recipe/nugget_from_blasting_raw_nugget.json f63988753316f6848707a1bebb9004bff2f6d5e4 data/nuggetmod/advancement/recipes/tools/nugget_shovel.json
61bc79a197aa3f00ccdbc3a573c1dc90bbb380e1 data/nuggetmod/recipe/nugget_from_smelting_nugget_deepslate_ore.json 46cf496588958f9727af31d89b8adfa56f319b32 data/nuggetmod/recipe/nugget.json
da4d3a890cd2a10ef6502861f80d89da01c38533 data/nuggetmod/recipe/nugget_from_smelting_nugget_ore.json 7a93996e567af4358d0add13412438c89efff405 data/nuggetmod/recipe/nugget_axe.json
b7053163e6e237928a9de0b5dfe921883a6e6b5c data/nuggetmod/recipe/nugget_from_smelting_raw_nugget.json a616003c555df86443a939fff05be631f005b5e7 data/nuggetmod/recipe/nugget_block.json
c30c2ad83bc1c296f619a1d111eb11aff1155f0b data/nuggetmod/recipe/raw_nugget.json 7cb0715c46c01f7dd8802b3cd8302c20ccb281cf data/nuggetmod/recipe/nugget_from_blasting_nugget_deepslate_ore.json
0a4297bae4d63ee5ba5092d4000e888112186293 data/nuggetmod/recipe/raw_nugget_block.json 662c0a68d691fcb004fdfa4b18af745502eb51c4 data/nuggetmod/recipe/nugget_from_blasting_nugget_ore.json
67a9834245f8ecd74cf7b72ebeddee9e9d2296a5 data/nuggetmod/recipe/nugget_from_blasting_raw_nugget.json
61bc79a197aa3f00ccdbc3a573c1dc90bbb380e1 data/nuggetmod/recipe/nugget_from_smelting_nugget_deepslate_ore.json
da4d3a890cd2a10ef6502861f80d89da01c38533 data/nuggetmod/recipe/nugget_from_smelting_nugget_ore.json
b7053163e6e237928a9de0b5dfe921883a6e6b5c data/nuggetmod/recipe/nugget_from_smelting_raw_nugget.json
5502215f2426567d06785639a9011f601e9593a4 data/nuggetmod/recipe/nugget_hoe.json
b983b6efee4952a3a2dee230c8f13b363894d29e data/nuggetmod/recipe/nugget_pickaxe.json
2c25036d787f791caa37836de3c04b31ab9e9551 data/nuggetmod/recipe/nugget_shovel.json
af124114b7882426d847851db6f2f1c8bba4e6eb data/nuggetmod/recipe/nugget_sword.json
c30c2ad83bc1c296f619a1d111eb11aff1155f0b data/nuggetmod/recipe/raw_nugget.json
0a4297bae4d63ee5ba5092d4000e888112186293 data/nuggetmod/recipe/raw_nugget_block.json

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/handheld",
"textures": {
"layer0": "nuggetmod:item/nugget_axe"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/handheld",
"textures": {
"layer0": "nuggetmod:item/nugget_hoe"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/handheld",
"textures": {
"layer0": "nuggetmod:item/nugget_pickaxe"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/handheld",
"textures": {
"layer0": "nuggetmod:item/nugget_shovel"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/handheld",
"textures": {
"layer0": "nuggetmod:item/nugget_sword"
}
}

View File

@@ -1,5 +0,0 @@
{
"values": [
"nuggetmod:nugget_deepslate_ore"
]
}

View File

@@ -1,5 +1,6 @@
{ {
"values": [ "values": [
"nuggetmod:nugget_deepslate_ore",
"nuggetmod:raw_nugget_block" "nuggetmod:raw_nugget_block"
] ]
} }

View File

@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_nugget": {
"conditions": {
"items": [
{
"items": "nuggetmod:nugget"
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "nuggetmod:nugget_sword"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_the_recipe",
"has_nugget"
]
],
"rewards": {
"recipes": [
"nuggetmod:nugget_sword"
]
}
}

View File

@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_nugget": {
"conditions": {
"items": [
{
"items": "nuggetmod:nugget"
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "nuggetmod:nugget_axe"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_the_recipe",
"has_nugget"
]
],
"rewards": {
"recipes": [
"nuggetmod:nugget_axe"
]
}
}

View File

@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_nugget": {
"conditions": {
"items": [
{
"items": "nuggetmod:nugget"
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "nuggetmod:nugget_hoe"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_the_recipe",
"has_nugget"
]
],
"rewards": {
"recipes": [
"nuggetmod:nugget_hoe"
]
}
}

View File

@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_nugget": {
"conditions": {
"items": [
{
"items": "nuggetmod:nugget"
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "nuggetmod:nugget_pickaxe"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_the_recipe",
"has_nugget"
]
],
"rewards": {
"recipes": [
"nuggetmod:nugget_pickaxe"
]
}
}

View File

@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_nugget": {
"conditions": {
"items": [
{
"items": "nuggetmod:nugget"
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "nuggetmod:nugget_shovel"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_the_recipe",
"has_nugget"
]
],
"rewards": {
"recipes": [
"nuggetmod:nugget_shovel"
]
}
}

View File

@@ -0,0 +1,21 @@
{
"type": "minecraft:crafting_shaped",
"category": "equipment",
"key": {
"A": {
"item": "nuggetmod:nugget"
},
"B": {
"item": "minecraft:stick"
}
},
"pattern": [
" AA",
" BA",
" B "
],
"result": {
"count": 1,
"id": "nuggetmod:nugget_axe"
}
}

View File

@@ -0,0 +1,21 @@
{
"type": "minecraft:crafting_shaped",
"category": "equipment",
"key": {
"A": {
"item": "nuggetmod:nugget"
},
"B": {
"item": "minecraft:stick"
}
},
"pattern": [
" AA",
" B ",
" B "
],
"result": {
"count": 1,
"id": "nuggetmod:nugget_hoe"
}
}

View File

@@ -0,0 +1,21 @@
{
"type": "minecraft:crafting_shaped",
"category": "equipment",
"key": {
"A": {
"item": "nuggetmod:nugget"
},
"B": {
"item": "minecraft:stick"
}
},
"pattern": [
"AAA",
" B ",
" B "
],
"result": {
"count": 1,
"id": "nuggetmod:nugget_pickaxe"
}
}

View File

@@ -0,0 +1,21 @@
{
"type": "minecraft:crafting_shaped",
"category": "equipment",
"key": {
"A": {
"item": "nuggetmod:nugget"
},
"B": {
"item": "minecraft:stick"
}
},
"pattern": [
" A ",
" B ",
" B "
],
"result": {
"count": 1,
"id": "nuggetmod:nugget_shovel"
}
}

View File

@@ -0,0 +1,21 @@
{
"type": "minecraft:crafting_shaped",
"category": "equipment",
"key": {
"A": {
"item": "nuggetmod:nugget"
},
"B": {
"item": "minecraft:stick"
}
},
"pattern": [
" A ",
" A ",
" B "
],
"result": {
"count": 1,
"id": "nuggetmod:nugget_sword"
}
}

View File

@@ -0,0 +1,8 @@
{
"remove": [
"#nuggetmod:needs_nugget_tool"
],
"values": [
"#minecraft:incorrect_for_diamond_tool"
]
}

View File

@@ -0,0 +1,6 @@
{
"values": [
"nuggetmod:raw_nugget_block",
"#minecraft:needs_diamond_tool"
]
}

View File

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

View File

@@ -1,70 +1,70 @@
package xyz.sillyangel.nugget; package xyz.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.common.MinecraftForge;
import net.minecraftforge.event.BuildCreativeModeTabContentsEvent; import net.minecraftforge.event.BuildCreativeModeTabContentsEvent;
import net.minecraftforge.event.server.ServerStartingEvent; import net.minecraftforge.event.server.ServerStartingEvent;
import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.ModLoadingContext; 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 xyz.sillyangel.nugget.item.ModCreativeModeTabs;
import xyz.sillyangel.nugget.item.ModItems; import xyz.sillyangel.nugget.item.ModItems;
import xyz.sillyangel.nugget.block.ModBlocks; import xyz.sillyangel.nugget.block.ModBlocks;
// 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
@Mod(NuggetMod.MOD_ID) @Mod(NuggetMod.MOD_ID)
public class NuggetMod { public class NuggetMod {
// Define mod id in a common place for everything to reference // Define mod id in a common place for everything to reference
public static final String MOD_ID = "nuggetmod"; public static final String MOD_ID = "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() {
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
modEventBus.addListener(this::commonSetup); modEventBus.addListener(this::commonSetup);
// Register ourselves for server and other game events we are interested in // Register ourselves for server and other game events we are interested in
MinecraftForge.EVENT_BUS.register(this); MinecraftForge.EVENT_BUS.register(this);
ModCreativeModeTabs.register(modEventBus); ModCreativeModeTabs.register(modEventBus);
ModItems.register(modEventBus); ModItems.register(modEventBus);
ModBlocks.register(modEventBus); ModBlocks.register(modEventBus);
// Register the item to a creative tab // Register the item to a creative tab
modEventBus.addListener(this::addCreative); modEventBus.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); ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, Config.SPEC);
} }
private void commonSetup(final FMLCommonSetupEvent event) { private void commonSetup(final FMLCommonSetupEvent event) {
} }
// Add the example block item to the building blocks tab // Add the example block item to the building blocks tab
private void addCreative(BuildCreativeModeTabContentsEvent event) { private void addCreative(BuildCreativeModeTabContentsEvent event) {
} }
// You can use SubscribeEvent and let the Event Bus discover methods to call // You can use SubscribeEvent and let the Event Bus discover methods to call
@SubscribeEvent @SubscribeEvent
public void onServerStarting(ServerStartingEvent event) { 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, bus = Mod.EventBusSubscriber.Bus.MOD, 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,52 +1,52 @@
package xyz.sillyangel.nugget.block; package xyz.sillyangel.nugget.block;
import xyz.sillyangel.nugget.NuggetMod; import xyz.sillyangel.nugget.NuggetMod;
import xyz.sillyangel.nugget.item.ModItems; import xyz.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;
import net.minecraft.world.level.block.Block; 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.IEventBus;
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;
import java.util.function.Supplier; import java.util.function.Supplier;
public class ModBlocks { public class ModBlocks {
public static final DeferredRegister<Block> BLOCKS = public static final DeferredRegister<Block> BLOCKS =
DeferredRegister.create(ForgeRegistries.BLOCKS, NuggetMod.MOD_ID); DeferredRegister.create(ForgeRegistries.BLOCKS, NuggetMod.MOD_ID);
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()
.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()
.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()
.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()
.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) {
RegistryObject<T> toReturn = BLOCKS.register(name, block); RegistryObject<T> toReturn = BLOCKS.register(name, block);
registerBlockItem(name, toReturn); registerBlockItem(name, toReturn);
return toReturn; return toReturn;
} }
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()));
} }
public static void register(IEventBus eventBus) { public static void register(IEventBus eventBus) {
BLOCKS.register(eventBus); BLOCKS.register(eventBus);
} }
} }

View File

@@ -1,39 +1,39 @@
package xyz.sillyangel.nugget.datagen; package xyz.sillyangel.nugget.datagen;
import xyz.sillyangel.nugget.NuggetMod; import xyz.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;
import net.minecraft.data.loot.LootTableProvider; import net.minecraft.data.loot.LootTableProvider;
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets; 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.SubscribeEvent;
import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
@Mod.EventBusSubscriber(modid = NuggetMod.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) @Mod.EventBusSubscriber(modid = NuggetMod.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
public class DataGenerators { public class DataGenerators {
@SubscribeEvent @SubscribeEvent
public static void gatherData(GatherDataEvent event) { public static void gatherData(GatherDataEvent event) {
DataGenerator generator = event.getGenerator(); DataGenerator generator = event.getGenerator();
PackOutput packOutput = generator.getPackOutput(); PackOutput packOutput = generator.getPackOutput();
ExistingFileHelper existingFileHelper = event.getExistingFileHelper(); ExistingFileHelper existingFileHelper = event.getExistingFileHelper();
CompletableFuture<HolderLookup.Provider> lookupProvider = event.getLookupProvider(); CompletableFuture<HolderLookup.Provider> lookupProvider = event.getLookupProvider();
generator.addProvider(event.includeServer(), new LootTableProvider(packOutput, Collections.emptySet(), generator.addProvider(event.includeServer(), new LootTableProvider(packOutput, Collections.emptySet(),
List.of(new LootTableProvider.SubProviderEntry(ModBlockLootTableProvider::new, LootContextParamSets.BLOCK)), lookupProvider)); List.of(new LootTableProvider.SubProviderEntry(ModBlockLootTableProvider::new, LootContextParamSets.BLOCK)), lookupProvider));
generator.addProvider(event.includeServer(), new ModRecipeProvider(packOutput, lookupProvider)); generator.addProvider(event.includeServer(), new ModRecipeProvider(packOutput, lookupProvider));
BlockTagsProvider blockTagsProvider = new ModBlockTagProvider(packOutput, lookupProvider, existingFileHelper); BlockTagsProvider blockTagsProvider = new ModBlockTagProvider(packOutput, lookupProvider, existingFileHelper);
generator.addProvider(event.includeServer(), blockTagsProvider); generator.addProvider(event.includeServer(), blockTagsProvider);
generator.addProvider(event.includeServer(), new ModItemTagProvider(packOutput, lookupProvider, blockTagsProvider.contentsGetter(), existingFileHelper)); generator.addProvider(event.includeServer(), new ModItemTagProvider(packOutput, lookupProvider, blockTagsProvider.contentsGetter(), existingFileHelper));
generator.addProvider(event.includeClient(), new ModItemModelProvider(packOutput, existingFileHelper)); generator.addProvider(event.includeClient(), new ModItemModelProvider(packOutput, existingFileHelper));
generator.addProvider(event.includeClient(), new ModBlockStateProvider(packOutput, existingFileHelper)); generator.addProvider(event.includeClient(), new ModBlockStateProvider(packOutput, existingFileHelper));
} }
} }

View File

@@ -1,55 +1,55 @@
package xyz.sillyangel.nugget.datagen; package xyz.sillyangel.nugget.datagen;
import xyz.sillyangel.nugget.block.ModBlocks; import xyz.sillyangel.nugget.block.ModBlocks;
import xyz.sillyangel.nugget.item.ModItems; import xyz.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.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.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;
import net.minecraftforge.registries.RegistryObject; import net.minecraftforge.registries.RegistryObject;
import java.util.Set; import java.util.Set;
public class ModBlockLootTableProvider extends BlockLootSubProvider { public class ModBlockLootTableProvider extends BlockLootSubProvider {
protected ModBlockLootTableProvider(HolderLookup.Provider pRegistries) { protected ModBlockLootTableProvider(HolderLookup.Provider pRegistries) {
super(Set.of(), FeatureFlags.REGISTRY.allFlags(), pRegistries); super(Set.of(), FeatureFlags.REGISTRY.allFlags(), pRegistries);
} }
@Override @Override
protected void generate() { protected void generate() {
dropSelf(ModBlocks.NUGGET_BLOCK.get()); dropSelf(ModBlocks.NUGGET_BLOCK.get());
dropSelf(ModBlocks.RAW_NUGGET_BLOCK.get()); dropSelf(ModBlocks.RAW_NUGGET_BLOCK.get());
this.add(ModBlocks.NUGGET_ORE.get(), this.add(ModBlocks.NUGGET_ORE.get(),
block -> createOreDrop(ModBlocks.NUGGET_ORE.get(), ModItems.RAW_NUGGET.get())); block -> createOreDrop(ModBlocks.NUGGET_ORE.get(), ModItems.RAW_NUGGET.get()));
this.add(ModBlocks.NUGGET_DEEPSLATE_ORE.get(), this.add(ModBlocks.NUGGET_DEEPSLATE_ORE.get(),
block -> createMultipleOreDrops(ModBlocks.NUGGET_DEEPSLATE_ORE.get(), ModItems.RAW_NUGGET.get(), 2, 6)); block -> createMultipleOreDrops(ModBlocks.NUGGET_DEEPSLATE_ORE.get(), ModItems.RAW_NUGGET.get(), 2, 6));
} }
protected LootTable.Builder createMultipleOreDrops(Block pBlock, Item item, float minDrops, float maxDrops) { protected LootTable.Builder createMultipleOreDrops(Block pBlock, Item item, float minDrops, float maxDrops) {
HolderLookup.RegistryLookup<Enchantment> registrylookup = this.registries.lookupOrThrow(Registries.ENCHANTMENT); HolderLookup.RegistryLookup<Enchantment> registrylookup = this.registries.lookupOrThrow(Registries.ENCHANTMENT);
return this.createSilkTouchDispatchTable( return this.createSilkTouchDispatchTable(
pBlock, this.applyExplosionDecay( pBlock, this.applyExplosionDecay(
pBlock, LootItem.lootTableItem(item) pBlock, LootItem.lootTableItem(item)
.apply(SetItemCountFunction.setCount(UniformGenerator.between(minDrops, maxDrops))) .apply(SetItemCountFunction.setCount(UniformGenerator.between(minDrops, maxDrops)))
.apply(ApplyBonusCount.addOreBonusCount(registrylookup.getOrThrow(Enchantments.FORTUNE))) .apply(ApplyBonusCount.addOreBonusCount(registrylookup.getOrThrow(Enchantments.FORTUNE)))
) )
); );
} }
@Override @Override
protected Iterable<Block> getKnownBlocks() { protected Iterable<Block> getKnownBlocks() {
return ModBlocks.BLOCKS.getEntries().stream().map(RegistryObject::get)::iterator; return ModBlocks.BLOCKS.getEntries().stream().map(RegistryObject::get)::iterator;
} }
} }

View File

@@ -1,29 +1,29 @@
package xyz.sillyangel.nugget.datagen; package xyz.sillyangel.nugget.datagen;
import xyz.sillyangel.nugget.NuggetMod; import xyz.sillyangel.nugget.NuggetMod;
import xyz.sillyangel.nugget.block.ModBlocks; import xyz.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;
import net.minecraftforge.common.data.ExistingFileHelper; import net.minecraftforge.common.data.ExistingFileHelper;
import net.minecraftforge.registries.RegistryObject; import net.minecraftforge.registries.RegistryObject;
public class ModBlockStateProvider extends BlockStateProvider { public class ModBlockStateProvider extends BlockStateProvider {
public ModBlockStateProvider(PackOutput output, ExistingFileHelper exFileHelper) { public ModBlockStateProvider(PackOutput output, ExistingFileHelper exFileHelper) {
super(output, NuggetMod.MOD_ID, exFileHelper); super(output, NuggetMod.MOD_ID, exFileHelper);
} }
@Override @Override
protected void registerStatesAndModels() { protected void registerStatesAndModels() {
blockWithItem(ModBlocks.NUGGET_BLOCK); blockWithItem(ModBlocks.NUGGET_BLOCK);
blockWithItem(ModBlocks.RAW_NUGGET_BLOCK); blockWithItem(ModBlocks.RAW_NUGGET_BLOCK);
blockWithItem(ModBlocks.NUGGET_ORE); blockWithItem(ModBlocks.NUGGET_ORE);
blockWithItem(ModBlocks.NUGGET_DEEPSLATE_ORE); blockWithItem(ModBlocks.NUGGET_DEEPSLATE_ORE);
} }
private void blockWithItem(RegistryObject<Block> blockRegistryObject) { private void blockWithItem(RegistryObject<Block> blockRegistryObject) {
simpleBlockWithItem(blockRegistryObject.get(), cubeAll(blockRegistryObject.get())); simpleBlockWithItem(blockRegistryObject.get(), cubeAll(blockRegistryObject.get()));
} }
} }

View File

@@ -1,42 +1,42 @@
package xyz.sillyangel.nugget.datagen; package xyz.sillyangel.nugget.datagen;
import xyz.sillyangel.nugget.NuggetMod; import xyz.sillyangel.nugget.NuggetMod;
import xyz.sillyangel.nugget.block.ModBlocks; import xyz.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.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 xyz.sillyangel.nugget.util.ModTags;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
public class ModBlockTagProvider extends BlockTagsProvider { public class ModBlockTagProvider extends BlockTagsProvider {
public ModBlockTagProvider(PackOutput output, CompletableFuture<HolderLookup.Provider> lookupProvider, @Nullable ExistingFileHelper existingFileHelper) { public ModBlockTagProvider(PackOutput output, CompletableFuture<HolderLookup.Provider> lookupProvider, @Nullable ExistingFileHelper existingFileHelper) {
super(output, lookupProvider, NuggetMod.MOD_ID, existingFileHelper); super(output, lookupProvider, NuggetMod.MOD_ID, existingFileHelper);
} }
@Override @Override
protected void addTags(HolderLookup.Provider pProvider) { protected void addTags(HolderLookup.Provider pProvider) {
tag(BlockTags.MINEABLE_WITH_PICKAXE) tag(BlockTags.MINEABLE_WITH_PICKAXE)
.add(ModBlocks.NUGGET_BLOCK.get()) .add(ModBlocks.NUGGET_BLOCK.get())
.add(ModBlocks.RAW_NUGGET_BLOCK.get()) .add(ModBlocks.RAW_NUGGET_BLOCK.get())
.add(ModBlocks.NUGGET_ORE.get()) .add(ModBlocks.NUGGET_ORE.get())
.add(ModBlocks.NUGGET_DEEPSLATE_ORE.get()); .add(ModBlocks.NUGGET_DEEPSLATE_ORE.get());
tag(BlockTags.NEEDS_STONE_TOOL) tag(BlockTags.NEEDS_STONE_TOOL)
.add(ModBlocks.NUGGET_DEEPSLATE_ORE.get()) .add(ModBlocks.NUGGET_DEEPSLATE_ORE.get())
.add(ModBlocks.RAW_NUGGET_BLOCK.get()); .add(ModBlocks.RAW_NUGGET_BLOCK.get());
// tag(BlockTags.NEEDS_STONE_TOOL) // tag(BlockTags.NEEDS_STONE_TOOL)
tag(ModTags.Blocks.NEEDS_NUGGET_TOOL) tag(ModTags.Blocks.NEEDS_NUGGET_TOOL)
.add(ModBlocks.RAW_NUGGET_BLOCK.get()) .add(ModBlocks.RAW_NUGGET_BLOCK.get())
.addTag(BlockTags.NEEDS_DIAMOND_TOOL); .addTag(BlockTags.NEEDS_DIAMOND_TOOL);
tag(ModTags.Blocks.INCORRECT_FOR_NUGGET_TOOL) tag(ModTags.Blocks.INCORRECT_FOR_NUGGET_TOOL)
.addTag(BlockTags.INCORRECT_FOR_DIAMOND_TOOL) .addTag(BlockTags.INCORRECT_FOR_DIAMOND_TOOL)
.remove(ModTags.Blocks.NEEDS_NUGGET_TOOL); .remove(ModTags.Blocks.NEEDS_NUGGET_TOOL);
} }
} }

View File

@@ -1,61 +1,61 @@
package xyz.sillyangel.nugget.datagen; package xyz.sillyangel.nugget.datagen;
import xyz.sillyangel.nugget.NuggetMod; import xyz.sillyangel.nugget.NuggetMod;
import xyz.sillyangel.nugget.item.ModItems; import xyz.sillyangel.nugget.item.ModItems;
import net.minecraft.data.PackOutput; import net.minecraft.data.PackOutput;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Item; 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.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;
public class ModItemModelProvider extends ItemModelProvider { public class ModItemModelProvider extends ItemModelProvider {
public ModItemModelProvider(PackOutput output, ExistingFileHelper existingFileHelper) { public ModItemModelProvider(PackOutput output, ExistingFileHelper existingFileHelper) {
super(output, NuggetMod.MOD_ID, existingFileHelper); super(output, NuggetMod.MOD_ID, existingFileHelper);
} }
@Override @Override
protected void registerModels() { protected void registerModels() {
basicItem(ModItems.NUGGET.get()); basicItem(ModItems.NUGGET.get());
basicItem(ModItems.RAW_NUGGET.get()); basicItem(ModItems.RAW_NUGGET.get());
handheldItem(ModItems.NUGGET_SWORD); handheldItem(ModItems.NUGGET_SWORD);
handheldItem(ModItems.NUGGET_PICKAXE); handheldItem(ModItems.NUGGET_PICKAXE);
handheldItem(ModItems.NUGGET_SHOVEL); handheldItem(ModItems.NUGGET_SHOVEL);
handheldItem(ModItems.NUGGET_AXE); handheldItem(ModItems.NUGGET_AXE);
handheldItem(ModItems.NUGGET_HOE); handheldItem(ModItems.NUGGET_HOE);
} }
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", ResourceLocation.parse("item/handheld")).texture("layer0",
ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID,"item/" + item.getId().getPath())); ResourceLocation.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", ResourceLocation.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", ResourceLocation.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", ResourceLocation.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", ResourceLocation.parse("item/generated")).texture("layer0",
ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID,"item/" + item.getId().getPath())); ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID,"item/" + item.getId().getPath()));
} }
} }

View File

@@ -1,31 +1,31 @@
package xyz.sillyangel.nugget.datagen; package xyz.sillyangel.nugget.datagen;
import xyz.sillyangel.nugget.NuggetMod; import xyz.sillyangel.nugget.NuggetMod;
import xyz.sillyangel.nugget.item.ModItems; import xyz.sillyangel.nugget.item.ModItems;
import xyz.sillyangel.nugget.util.ModTags; import xyz.sillyangel.nugget.util.ModTags;
import net.minecraft.core.HolderLookup; import net.minecraft.core.HolderLookup;
import net.minecraft.data.PackOutput; import net.minecraft.data.PackOutput;
import net.minecraft.data.tags.ItemTagsProvider; import net.minecraft.data.tags.ItemTagsProvider;
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;
import org.jetbrains.annotations.Nullable; 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 packOutput, CompletableFuture<HolderLookup.Provider> completableFuture,
CompletableFuture<TagLookup<Block>> lookupCompletableFuture, @Nullable ExistingFileHelper existingFileHelper) { CompletableFuture<TagLookup<Block>> lookupCompletableFuture, @Nullable ExistingFileHelper existingFileHelper) {
super(packOutput, completableFuture, lookupCompletableFuture, NuggetMod.MOD_ID, existingFileHelper); super(packOutput, completableFuture, lookupCompletableFuture, NuggetMod.MOD_ID, existingFileHelper);
} }
@Override @Override
protected void addTags(HolderLookup.Provider pProvider) { protected void addTags(HolderLookup.Provider pProvider) {
tag(ModTags.Items.TRANSFORMABLE_ITEMS) tag(ModTags.Items.TRANSFORMABLE_ITEMS)
.add(ModItems.NUGGET.get()) .add(ModItems.NUGGET.get())
.add(ModItems.RAW_NUGGET.get()) .add(ModItems.RAW_NUGGET.get())
.add(Items.COAL) .add(Items.COAL)
.add(Items.STICK) .add(Items.STICK)
.add(Items.COMPASS); .add(Items.COMPASS);
} }
} }

View File

@@ -1,76 +1,120 @@
package xyz.sillyangel.nugget.datagen; package xyz.sillyangel.nugget.datagen;
import xyz.sillyangel.nugget.NuggetMod; import net.minecraft.world.item.Items;
import xyz.sillyangel.nugget.block.ModBlocks; import xyz.sillyangel.nugget.NuggetMod;
import xyz.sillyangel.nugget.item.ModItems; import xyz.sillyangel.nugget.block.ModBlocks;
import net.minecraft.core.HolderLookup; import xyz.sillyangel.nugget.item.ModItems;
import net.minecraft.data.PackOutput; import net.minecraft.core.HolderLookup;
import net.minecraft.data.recipes.*; import net.minecraft.data.PackOutput;
import net.minecraft.world.item.crafting.*; import net.minecraft.data.recipes.*;
import net.minecraft.world.level.ItemLike; import net.minecraft.world.item.crafting.*;
import net.minecraftforge.common.crafting.conditions.IConditionBuilder; import net.minecraft.world.level.ItemLike;
import net.minecraftforge.common.crafting.conditions.IConditionBuilder;
import java.util.List;
import java.util.concurrent.CompletableFuture; import java.util.List;
import java.util.concurrent.CompletableFuture;
public class ModRecipeProvider extends RecipeProvider implements IConditionBuilder {
public ModRecipeProvider(PackOutput pOutput, CompletableFuture<HolderLookup.Provider> pRegistries) { public class ModRecipeProvider extends RecipeProvider implements IConditionBuilder {
super(pOutput, pRegistries); public ModRecipeProvider(PackOutput pOutput, CompletableFuture<HolderLookup.Provider> pRegistries) {
} super(pOutput, pRegistries);
}
@Override
protected void buildRecipes(RecipeOutput pRecipeOutput) { @Override
List<ItemLike> NUGGET_SMELTABLES = List.of(ModItems.RAW_NUGGET.get(), protected void buildRecipes(RecipeOutput pRecipeOutput) {
ModBlocks.NUGGET_ORE.get(), ModBlocks.NUGGET_DEEPSLATE_ORE.get()); List<ItemLike> NUGGET_SMELTABLES = List.of(ModItems.RAW_NUGGET.get(),
ModBlocks.NUGGET_ORE.get(), ModBlocks.NUGGET_DEEPSLATE_ORE.get());
ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModBlocks.NUGGET_BLOCK.get())
.pattern("AAA") ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModBlocks.NUGGET_BLOCK.get())
.pattern("AAA") .pattern("AAA")
.pattern("AAA") .pattern("AAA")
.define('A', ModItems.NUGGET.get()) .pattern("AAA")
.unlockedBy(getHasName(ModItems.NUGGET.get()), has(ModItems.NUGGET.get())).save(pRecipeOutput); .define('A', ModItems.NUGGET.get())
.unlockedBy(getHasName(ModItems.NUGGET.get()), has(ModItems.NUGGET.get())).save(pRecipeOutput);
ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.NUGGET.get(), 9)
.requires(ModBlocks.NUGGET_BLOCK.get()) ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.NUGGET.get(), 9)
.unlockedBy(getHasName(ModBlocks.NUGGET_BLOCK.get()), has(ModBlocks.NUGGET_BLOCK.get())).save(pRecipeOutput); .requires(ModBlocks.NUGGET_BLOCK.get())
.unlockedBy(getHasName(ModBlocks.NUGGET_BLOCK.get()), has(ModBlocks.NUGGET_BLOCK.get())).save(pRecipeOutput);
// RAW NUGGET
// RAW NUGGET
ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModBlocks.RAW_NUGGET_BLOCK.get())
.pattern("AAA") ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModBlocks.RAW_NUGGET_BLOCK.get())
.pattern("AAA") .pattern("AAA")
.pattern("AAA") .pattern("AAA")
.define('A', ModItems.RAW_NUGGET.get()) .pattern("AAA")
.unlockedBy(getHasName(ModItems.RAW_NUGGET.get()), has(ModItems.RAW_NUGGET.get())).save(pRecipeOutput); .define('A', ModItems.RAW_NUGGET.get())
.unlockedBy(getHasName(ModItems.RAW_NUGGET.get()), has(ModItems.RAW_NUGGET.get())).save(pRecipeOutput);
ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.RAW_NUGGET.get(), 9)
.requires(ModBlocks.RAW_NUGGET_BLOCK.get()) ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.RAW_NUGGET.get(), 9)
.unlockedBy(getHasName(ModBlocks.RAW_NUGGET_BLOCK.get()), has(ModBlocks.RAW_NUGGET_BLOCK.get())).save(pRecipeOutput); .requires(ModBlocks.RAW_NUGGET_BLOCK.get())
.unlockedBy(getHasName(ModBlocks.RAW_NUGGET_BLOCK.get()), has(ModBlocks.RAW_NUGGET_BLOCK.get())).save(pRecipeOutput);
// TOOLS
oreSmelting(pRecipeOutput, NUGGET_SMELTABLES, RecipeCategory.MISC, ModItems.NUGGET.get(), 0.25f, 200, "nugget");
oreBlasting(pRecipeOutput, NUGGET_SMELTABLES, RecipeCategory.MISC, ModItems.NUGGET.get(), 0.25f, 100, "nugget"); //SWORD
ShapedRecipeBuilder.shaped(RecipeCategory.COMBAT, ModItems.NUGGET_SWORD.get())
.pattern(" A ")
} .pattern(" A ")
.pattern(" B ")
protected static void oreSmelting(RecipeOutput recipeOutput, List<ItemLike> pIngredients, RecipeCategory pCategory, ItemLike pResult, .define('A', ModItems.NUGGET.get())
float pExperience, int pCookingTIme, String pGroup) { .define('B', Items.STICK)
oreCooking(recipeOutput, RecipeSerializer.SMELTING_RECIPE, SmeltingRecipe::new, pIngredients, pCategory, pResult, .unlockedBy(getHasName(ModItems.NUGGET.get()), has(ModItems.NUGGET.get())).save(pRecipeOutput);
pExperience, pCookingTIme, pGroup, "_from_smelting"); //PICAXE
} ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.NUGGET_PICKAXE.get())
.pattern("AAA")
protected static void oreBlasting(RecipeOutput recipeOutput, List<ItemLike> pIngredients, RecipeCategory pCategory, ItemLike pResult, .pattern(" B ")
float pExperience, int pCookingTime, String pGroup) { .pattern(" B ")
oreCooking(recipeOutput, RecipeSerializer.BLASTING_RECIPE, BlastingRecipe::new, pIngredients, pCategory, pResult, .define('A', ModItems.NUGGET.get())
pExperience, pCookingTime, pGroup, "_from_blasting"); .define('B', Items.STICK)
} .unlockedBy(getHasName(ModItems.NUGGET.get()), has(ModItems.NUGGET.get())).save(pRecipeOutput);
//AXE
protected static <T extends AbstractCookingRecipe> void oreCooking(RecipeOutput recipeOutput, RecipeSerializer<T> pCookingSerializer, AbstractCookingRecipe.Factory<T> factory, ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.NUGGET_AXE.get())
List<ItemLike> pIngredients, RecipeCategory pCategory, ItemLike pResult, float pExperience, int pCookingTime, String pGroup, String pRecipeName) { .pattern(" AA")
for(ItemLike itemlike : pIngredients) { .pattern(" BA")
SimpleCookingRecipeBuilder.generic(Ingredient.of(itemlike), pCategory, pResult, pExperience, pCookingTime, pCookingSerializer, factory).group(pGroup).unlockedBy(getHasName(itemlike), has(itemlike)) .pattern(" B ")
.save(recipeOutput, NuggetMod.MOD_ID + ":" + getItemName(pResult) + pRecipeName + "_" + getItemName(itemlike)); .define('A', ModItems.NUGGET.get())
} .define('B', Items.STICK)
} .unlockedBy(getHasName(ModItems.NUGGET.get()), has(ModItems.NUGGET.get())).save(pRecipeOutput);
//SHOVEL
ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.NUGGET_SHOVEL.get())
.pattern(" A ")
.pattern(" B ")
.pattern(" B ")
.define('A', ModItems.NUGGET.get())
.define('B', Items.STICK)
.unlockedBy(getHasName(ModItems.NUGGET.get()), has(ModItems.NUGGET.get())).save(pRecipeOutput);
//HOE
ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ModItems.NUGGET_HOE.get())
.pattern(" AA")
.pattern(" B ")
.pattern(" B ")
.define('A', ModItems.NUGGET.get())
.define('B', Items.STICK)
.unlockedBy(getHasName(ModItems.NUGGET.get()), has(ModItems.NUGGET.get())).save(pRecipeOutput);
// END OF TOOLS
oreSmelting(pRecipeOutput, NUGGET_SMELTABLES, RecipeCategory.MISC, ModItems.NUGGET.get(), 0.25f, 200, "nugget");
oreBlasting(pRecipeOutput, NUGGET_SMELTABLES, RecipeCategory.MISC, ModItems.NUGGET.get(), 0.25f, 100, "nugget");
}
protected static void oreSmelting(RecipeOutput recipeOutput, List<ItemLike> pIngredients, RecipeCategory pCategory, ItemLike pResult,
float pExperience, int pCookingTIme, String pGroup) {
oreCooking(recipeOutput, RecipeSerializer.SMELTING_RECIPE, SmeltingRecipe::new, pIngredients, pCategory, pResult,
pExperience, pCookingTIme, pGroup, "_from_smelting");
}
protected static void oreBlasting(RecipeOutput recipeOutput, List<ItemLike> pIngredients, RecipeCategory pCategory, ItemLike pResult,
float pExperience, int pCookingTime, String pGroup) {
oreCooking(recipeOutput, RecipeSerializer.BLASTING_RECIPE, BlastingRecipe::new, pIngredients, pCategory, pResult,
pExperience, pCookingTime, pGroup, "_from_blasting");
}
protected static <T extends AbstractCookingRecipe> void oreCooking(RecipeOutput recipeOutput, RecipeSerializer<T> pCookingSerializer, AbstractCookingRecipe.Factory<T> factory,
List<ItemLike> pIngredients, RecipeCategory pCategory, ItemLike pResult, float pExperience, int pCookingTime, String pGroup, String pRecipeName) {
for(ItemLike itemlike : pIngredients) {
SimpleCookingRecipeBuilder.generic(Ingredient.of(itemlike), pCategory, pResult, pExperience, pCookingTime, pCookingSerializer, factory).group(pGroup).unlockedBy(getHasName(itemlike), has(itemlike))
.save(recipeOutput, NuggetMod.MOD_ID + ":" + getItemName(pResult) + pRecipeName + "_" + getItemName(itemlike));
}
}
} }

View File

@@ -1,49 +1,49 @@
package xyz.sillyangel.nugget.item; package xyz.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.IEventBus;
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 xyz.sillyangel.nugget.NuggetMod;
import xyz.sillyangel.nugget.block.ModBlocks; import xyz.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 =
DeferredRegister.create(Registries.CREATIVE_MODE_TAB, NuggetMod.MOD_ID); DeferredRegister.create(Registries.CREATIVE_MODE_TAB, NuggetMod.MOD_ID);
public static final RegistryObject<CreativeModeTab> NUGGET_ITEMS_TAB = CREATIVE_MODE_TABS.register("nuggetmod_items_tab", public static final RegistryObject<CreativeModeTab> NUGGET_ITEMS_TAB = CREATIVE_MODE_TABS.register("nuggetmod_items_tab",
() -> CreativeModeTab.builder().icon(() -> new ItemStack(ModItems.NUGGET.get())) () -> CreativeModeTab.builder().icon(() -> new ItemStack(ModItems.NUGGET.get()))
.title(Component.translatable("creativetab.nuggetmod.nugget_items")) .title(Component.translatable("creativetab.nuggetmod.nugget_items"))
.displayItems((itemDisplayParameters, output) -> { .displayItems((itemDisplayParameters, output) -> {
output.accept(ModItems.NUGGET.get()); output.accept(ModItems.NUGGET.get());
output.accept(ModItems.RAW_NUGGET.get()); output.accept(ModItems.RAW_NUGGET.get());
output.accept(ModItems.NUGGET_SWORD.get()); output.accept(ModItems.NUGGET_SWORD.get());
output.accept(ModItems.NUGGET_PICKAXE.get()); output.accept(ModItems.NUGGET_PICKAXE.get());
output.accept(ModItems.NUGGET_SHOVEL.get()); output.accept(ModItems.NUGGET_SHOVEL.get());
output.accept(ModItems.NUGGET_AXE.get()); output.accept(ModItems.NUGGET_AXE.get());
output.accept(ModItems.NUGGET_HOE.get()); output.accept(ModItems.NUGGET_HOE.get());
}).build()); }).build());
public static final RegistryObject<CreativeModeTab> NUGGET_BLOCKS_TAB = CREATIVE_MODE_TABS.register("nuggetmod_blocks_tab", public static final RegistryObject<CreativeModeTab> NUGGET_BLOCKS_TAB = CREATIVE_MODE_TABS.register("nuggetmod_blocks_tab",
() -> CreativeModeTab.builder().icon(() -> new ItemStack(ModBlocks.NUGGET_BLOCK.get())) () -> CreativeModeTab.builder().icon(() -> new ItemStack(ModBlocks.NUGGET_BLOCK.get()))
.withTabsBefore(NUGGET_ITEMS_TAB.getId()) .withTabsBefore(NUGGET_ITEMS_TAB.getId())
.title(Component.translatable("creativetab.nuggetmod.nugget_blocks")) .title(Component.translatable("creativetab.nuggetmod.nugget_blocks"))
.displayItems((itemDisplayParameters, output) -> { .displayItems((itemDisplayParameters, output) -> {
output.accept(ModBlocks.NUGGET_BLOCK.get()); output.accept(ModBlocks.NUGGET_BLOCK.get());
output.accept(ModBlocks.RAW_NUGGET_BLOCK.get()); output.accept(ModBlocks.RAW_NUGGET_BLOCK.get());
output.accept(ModBlocks.NUGGET_ORE.get()); output.accept(ModBlocks.NUGGET_ORE.get());
output.accept(ModBlocks.NUGGET_DEEPSLATE_ORE.get()); output.accept(ModBlocks.NUGGET_DEEPSLATE_ORE.get());
}).build()); }).build());
public static void register(IEventBus eventBus) { public static void register(IEventBus eventBus) {
CREATIVE_MODE_TABS.register(eventBus); CREATIVE_MODE_TABS.register(eventBus);
} }
} }

View File

@@ -1,8 +1,8 @@
package xyz.sillyangel.nugget.item; package xyz.sillyangel.nugget.item;
import net.minecraft.world.food.FoodProperties; import net.minecraft.world.food.FoodProperties;
public class ModFoodProperties { public class ModFoodProperties {
public static final FoodProperties Nugget = new FoodProperties.Builder().nutrition(5).saturationModifier(0.5f) public static final FoodProperties Nugget = new FoodProperties.Builder().nutrition(5).saturationModifier(0.5f)
.build(); .build();
} }

View File

@@ -1,48 +1,48 @@
package xyz.sillyangel.nugget.item; package xyz.sillyangel.nugget.item;
import xyz.sillyangel.nugget.NuggetMod; import xyz.sillyangel.nugget.NuggetMod;
import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.ForgeRegistries;
import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Component;
import net.minecraftforge.registries.RegistryObject; import net.minecraftforge.registries.RegistryObject;
import net.minecraft.world.item.*; import net.minecraft.world.item.*;
import java.util.List; import java.util.List;
public class ModItems { public class ModItems {
public static final DeferredRegister<Item> ITEMS = public static final DeferredRegister<Item> ITEMS =
DeferredRegister.create(ForgeRegistries.ITEMS, NuggetMod.MOD_ID); DeferredRegister.create(ForgeRegistries.ITEMS, NuggetMod.MOD_ID);
public static final RegistryObject<Item> NUGGET = ITEMS.register("nugget", public static final RegistryObject<Item> NUGGET = ITEMS.register("nugget",
() -> new Item(new Item.Properties().food(ModFoodProperties.Nugget)) { () -> new Item(new Item.Properties().food(ModFoodProperties.Nugget)) {
@Override @Override
public void appendHoverText(ItemStack pStack, TooltipContext pContext, List<Component> pTooltipComponent, TooltipFlag pTooltipFlag) { public void appendHoverText(ItemStack pStack, TooltipContext pContext, List<Component> pTooltipComponent, TooltipFlag pTooltipFlag) {
pTooltipComponent.add(Component.translatable("item.nuggetmod.nugget.tooltip")); pTooltipComponent.add(Component.translatable("item.nuggetmod.nugget.tooltip"));
super.appendHoverText(pStack, pContext, pTooltipComponent, pTooltipFlag); super.appendHoverText(pStack, pContext, pTooltipComponent, pTooltipFlag);
} }
}); });
public static final RegistryObject<Item> RAW_NUGGET = ITEMS.register("raw_nugget", public static final RegistryObject<Item> RAW_NUGGET = ITEMS.register("raw_nugget",
() -> new Item(new Item.Properties())); () -> new Item(new Item.Properties()));
public static final RegistryObject<Item> NUGGET_SWORD = ITEMS.register("nugget_sword", public static final RegistryObject<Item> NUGGET_SWORD = ITEMS.register("nugget_sword",
() -> new SwordItem(ModToolTiers.NUGGET, new Item.Properties() () -> new SwordItem(ModToolTiers.NUGGET, new Item.Properties()
.attributes(SwordItem.createAttributes(ModToolTiers.NUGGET, 3, -2.4f)))); .attributes(SwordItem.createAttributes(ModToolTiers.NUGGET, 3, -2.4f))));
public static final RegistryObject<Item> NUGGET_PICKAXE = ITEMS.register("nugget_pickaxe", public static final RegistryObject<Item> NUGGET_PICKAXE = ITEMS.register("nugget_pickaxe",
() -> new PickaxeItem(ModToolTiers.NUGGET, new Item.Properties() () -> new PickaxeItem(ModToolTiers.NUGGET, new Item.Properties()
.attributes(PickaxeItem.createAttributes(ModToolTiers.NUGGET, 1, -2.8f)))); .attributes(PickaxeItem.createAttributes(ModToolTiers.NUGGET, 1, -2.8f))));
public static final RegistryObject<Item> NUGGET_SHOVEL = ITEMS.register("nugget_shovel", public static final RegistryObject<Item> NUGGET_SHOVEL = ITEMS.register("nugget_shovel",
() -> new ShovelItem(ModToolTiers.NUGGET, new Item.Properties() () -> new ShovelItem(ModToolTiers.NUGGET, new Item.Properties()
.attributes(ShovelItem.createAttributes(ModToolTiers.NUGGET, 1.5f, -3.0f)))); .attributes(ShovelItem.createAttributes(ModToolTiers.NUGGET, 1.5f, -3.0f))));
public static final RegistryObject<Item> NUGGET_AXE = ITEMS.register("nugget_axe", public static final RegistryObject<Item> NUGGET_AXE = ITEMS.register("nugget_axe",
() -> new AxeItem(ModToolTiers.NUGGET, new Item.Properties() () -> new AxeItem(ModToolTiers.NUGGET, new Item.Properties()
.attributes(AxeItem.createAttributes(ModToolTiers.NUGGET, 6, -3.2f)))); .attributes(AxeItem.createAttributes(ModToolTiers.NUGGET, 6, -3.2f))));
public static final RegistryObject<Item> NUGGET_HOE = ITEMS.register("nugget_hoe", public static final RegistryObject<Item> NUGGET_HOE = ITEMS.register("nugget_hoe",
() -> new HoeItem(ModToolTiers.NUGGET, new Item.Properties() () -> new HoeItem(ModToolTiers.NUGGET, new Item.Properties()
.attributes(HoeItem.createAttributes(ModToolTiers.NUGGET, 0, -3.0f)))); .attributes(HoeItem.createAttributes(ModToolTiers.NUGGET, 0, -3.0f))));
public static void register(IEventBus eventBus) { public static void register(IEventBus eventBus) {
ITEMS.register(eventBus); ITEMS.register(eventBus);
} }
} }

View File

@@ -1,12 +1,12 @@
package xyz.sillyangel.nugget.item; package xyz.sillyangel.nugget.item;
import net.minecraft.world.item.Tier; import net.minecraft.world.item.Tier;
import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.Ingredient;
import net.minecraftforge.common.ForgeTier; import net.minecraftforge.common.ForgeTier;
import xyz.sillyangel.nugget.util.ModTags; import xyz.sillyangel.nugget.util.ModTags;
public class ModToolTiers { public class ModToolTiers {
public static final Tier NUGGET = new ForgeTier(1500, 4.5f, 3.5f, 25, public static final Tier NUGGET = new ForgeTier(1500, 4.5f, 3.5f, 22,
ModTags.Blocks.NEEDS_NUGGET_TOOL, () -> Ingredient.of(ModItems.NUGGET.get()), ModTags.Blocks.NEEDS_NUGGET_TOOL, () -> Ingredient.of(ModItems.NUGGET.get()),
ModTags.Blocks.INCORRECT_FOR_NUGGET_TOOL); ModTags.Blocks.INCORRECT_FOR_NUGGET_TOOL);
} }

View File

@@ -1,28 +1,28 @@
package xyz.sillyangel.nugget.util; package xyz.sillyangel.nugget.util;
import xyz.sillyangel.nugget.NuggetMod; import xyz.sillyangel.nugget.NuggetMod;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
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;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
public class ModTags { public class ModTags {
public static class Blocks { public static class Blocks {
public static final TagKey<Block> NEEDS_NUGGET_TOOL = createTag("needs_nugget_tool"); public static final TagKey<Block> NEEDS_NUGGET_TOOL = createTag("needs_nugget_tool");
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(ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, name));
} }
} }
public static class Items { public static class Items {
public static final TagKey<Item> TRANSFORMABLE_ITEMS = createTag("transformable_items"); public static final TagKey<Item> TRANSFORMABLE_ITEMS = createTag("transformable_items");
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(ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, name));
} }
} }
} }

View File

@@ -1,14 +1,20 @@
{ {
"item.nuggetmod.raw_nugget": "Raw Nugget", "item.nuggetmod.raw_nugget": "Raw Nugget",
"item.nuggetmod.nugget": "nugget", "item.nuggetmod.nugget": "nugget",
"block.nuggetmod.nugget_block": "Nugget Block", "block.nuggetmod.nugget_block": "Nugget Block",
"block.nuggetmod.raw_nugget_block": "Raw Nugget Block", "block.nuggetmod.raw_nugget_block": "Raw Nugget Block",
"block.nuggetmod.nugget_ore": "Nugget Ore", "block.nuggetmod.nugget_ore": "Nugget Ore",
"block.nuggetmod.nugget_deepslate_ore": "Nugget Deepslate Ore", "block.nuggetmod.nugget_deepslate_ore": "Nugget Deepslate Ore",
"creativetab.nuggetmod.nugget_items": "Nugget Mod Items", "item.nuggetmod.nugget_sword": "Nugget Sword",
"creativetab.nuggetmod.nugget_blocks": "Nugget Mod Blocks", "item.nuggetmod.nugget_pickaxe": "Nugget Pickaxe",
"item.nuggetmod.nugget_shovel": "Nugget Shovel",
"item.nuggetmod.nugget.tooltip": "THE NUGGET" "item.nuggetmod.nugget_axe": "Nugget Axe",
"item.nuggetmod.nugget_hoe": "Nugget Hoe",
"creativetab.nuggetmod.nugget_items": "Nugget Mod Items",
"creativetab.nuggetmod.nugget_blocks": "Nugget Mod Blocks",
"item.nuggetmod.nugget.tooltip": "THE NUGGET"
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"nuggetmod:nugget_axe"
]
}

View File

@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"nuggetmod:nugget_hoe"
]
}

View File

@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"nuggetmod:nugget_pickaxe"
]
}

View File

@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"nuggetmod:nugget_shovel"
]
}

View File

@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"nuggetmod:nugget_sword"
]
}