Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
<!--suppress HtmlDeprecatedAttribute -->
<p align="center">
<img alt="fabric-api" height="56" src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/requires/fabric-api_vector.svg">
</p>

Unkindled makes furnaces no longer smelt items automatically.
Instead, players need to use a flint and steel (any tool in `c:tools/igniter`)
or a fire charge to ignite the furnace (while sneaking).
Expand Down
256 changes: 193 additions & 63 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,99 +1,229 @@
plugins {
id 'fabric-loom' version '1.7-SNAPSHOT'
id 'java-library'
id 'maven-publish'
id "com.modrinth.minotaur" version "2.+"
id 'net.neoforged.moddev' version '1.0.20'
id "me.modmuss50.mod-publish-plugin" version "0.7.4"
}

tasks.named('wrapper', Wrapper).configure {
// Define wrapper values here so as to not have to always do so when updating gradlew.properties.
// Switching this to Wrapper.DistributionType.ALL will download the full gradle sources that comes with
// documentation attached on cursor hover of gradle classes and methods. However, this comes with increased
// file size for Gradle. If you do switch this to ALL, run the Gradle wrapper task twice afterwards.
// (Verify by checking gradle/wrapper/gradle-wrapper.properties to see if distributionUrl now points to `-all`)
distributionType = Wrapper.DistributionType.BIN
}

version = "${project.mod_version}+${project.minecraft_version}"
group = project.maven_group
group = mod_group_id

base {
archivesName = project.archives_base_name
repositories {
mavenLocal()
}

repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
base {
archivesName = mod_id
}

dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
// Mojang ships Java 21 to end users starting in 1.20.5, so mods should target Java 21.
java.toolchain.languageVersion = JavaLanguageVersion.of(21)

// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
neoForge {
// Specify the version of NeoForge to use.
version = project.neo_version

}
parchment {
mappingsVersion = project.parchment_mappings_version
minecraftVersion = project.parchment_minecraft_version
}

// This line is optional. Access Transformers are automatically detected
// accessTransformers = project.files('src/main/resources/META-INF/accesstransformer.cfg')

// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
runs {
client {
client()

processResources {
inputs.property "version", project.version
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
}

server {
server()
programArgument '--nogui'
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
}

filesMatching("fabric.mod.json") {
expand "version": project.version
// This run config launches GameTestServer and runs all registered gametests, then exits.
// By default, the server will crash when no gametests are provided.
// The gametest system is also enabled by default for other run configs under the /test command.
gameTestServer {
type = "gameTestServer"
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
}

data {
data()

// example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it
// gameDirectory = project.file('run-data')

// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}

// applies to all the run configs above
configureEach {
// Recommended logging data for a userdev environment
// The markers can be added/remove as needed separated by commas.
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
systemProperty 'forge.logging.markers', 'REGISTRIES'

// Recommended logging level for the console
// You can set various levels here.
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
logLevel = org.slf4j.event.Level.DEBUG
}
}
}

tasks.withType(JavaCompile).configureEach {
it.options.release = 21
mods {
// define mod <-> source bindings
// these are used to tell the game which sources are for which mod
// mostly optional in a single mod project
// but multi mod projects should define one per mod
"${mod_id}" {
sourceSet(sourceSets.main)
}
}
}

java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }

sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
// Sets up a dependency configuration called 'localRuntime'.
// This configuration should be used instead of 'runtimeOnly' to declare
// a dependency that will be present for runtime testing but that is
// "optional", meaning it will not be pulled by dependents of this mod.
configurations {
runtimeClasspath.extendsFrom localRuntime
}

jar {
from("LICENSE") {
rename { "${it}_${project.base.archivesName.get()}"}
}
dependencies {
// Example optional mod dependency with JEI
// The JEI API is declared for compile time use, while the full JEI artifact is used at runtime
// compileOnly "mezz.jei:jei-${mc_version}-common-api:${jei_version}"
// compileOnly "mezz.jei:jei-${mc_version}-neoforge-api:${jei_version}"
// We add the full version to localRuntime, not runtimeOnly, so that we do not publish a dependency on it
// localRuntime "mezz.jei:jei-${mc_version}-neoforge:${jei_version}"

// Example mod dependency using a mod jar from ./libs with a flat dir repository
// This maps to ./libs/coolmod-${mc_version}-${coolmod_version}.jar
// The group id is ignored when searching -- in this case, it is "blank"
// implementation "blank:coolmod-${mc_version}:${coolmod_version}"

// Example mod dependency using a file as dependency
// implementation files("libs/coolmod-${mc_version}-${coolmod_version}.jar")

// Example project dependency using a sister or child project:
// implementation project(":myproject")

// For more info:
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html
}

// configure the maven publication
// This block of code expands all declared replace properties in the specified resource targets.
// A missing property will result in an error. Properties are expanded using ${} Groovy notation.
var generateModMetadata = tasks.register("generateModMetadata", ProcessResources) {
var replaceProperties = [
minecraft_version : minecraft_version,
minecraft_version_range: minecraft_version_range,
neo_version : neo_version,
neo_version_range : neo_version_range,
loader_version_range : loader_version_range,
mod_id : mod_id,
mod_name : mod_name,
mod_license : mod_license,
mod_version : mod_version,
mod_authors : mod_authors,
mod_description : mod_description
]
inputs.properties replaceProperties
expand replaceProperties
from "src/main/templates"
into "build/generated/sources/modMetadata"
}
// Include the output of "generateModMetadata" as an input directory for the build
// this works with both building through Gradle and the IDE.
sourceSets.main.resources.srcDir generateModMetadata
// To avoid having to run "generateModMetadata" manually, make it run on every project reload
neoForge.ideSyncTask generateModMetadata

// Example configuration to allow publishing using the maven-publish plugin
publishing {
publications {
create("mavenJava", MavenPublication) {
artifactId = project.archives_base_name
register('mavenJava', MavenPublication) {
from components.java
}
}

// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
maven {
url "file://${project.projectDir}/repo"
}
}
}

modrinth {
token = System.getenv("MODRINTH_TOKEN")
projectId = project.archives_base_name
versionName = "Unkindled " + project.mod_version
versionNumber = project.version.toString()
versionType = "release"
uploadFile = remapJar
gameVersions = project.version_range.split(",").collect { it.trim() }
loaders = ["fabric"]
dependencies {
required.project "fabric-api"
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}

// IDEA no longer automatically downloads sources/javadoc jars for dependencies, so we need to explicitly enable the behavior.
idea {
module {
downloadSources = true
downloadJavadoc = true
}
syncBodyFrom = rootProject.file("README.md").text
}

java {
withSourcesJar()
}

jar {
from("LICENSE")
}

static def addMinecraftVersions(versionsContainer) {
versionsContainer.add("1.21")
versionsContainer.add("1.21.1")
}

publishMods {
def versionAsNumber = project.mod_version.replaceAll("\\.", "")
changelog = "Check the changelog on [GitHub](https://github.com/Reimaden-Modding/unkindled/blob/HEAD/CHANGELOG.md#" + versionAsNumber + ")"
additionalFiles = [
remapSourcesJar
]
}
type = STABLE
file = jar.archiveFile
modLoaders.add("neoforge")
version = project.version
displayName = "Unkindled " + project.mod_version
additionalFiles.from(sourcesJar.archiveFile)

modrinth {
accessToken = providers.environmentVariable("MODRINTH_TOKEN")
projectId = "ozHCnpcZ"
addMinecraftVersions(minecraftVersions)
projectDescription = providers.fileContents(layout.projectDirectory.file("README.md")).asText
}

tasks.modrinth.dependsOn(tasks.modrinthSyncBody)
curseforge {
accessToken = providers.environmentVariable("CURSEFORGE_TOKEN")
projectId = "1118464"
addMinecraftVersions(minecraftVersions)
clientRequired = false
serverRequired = true
}
}
27 changes: 16 additions & 11 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
# Done to increase the memory available to gradle.
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
org.gradle.jvmargs=-Xmx1G
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.caching=true

# Fabric Properties
# check these on https://fabricmc.net/develop
# Environment Properties
parchment_minecraft_version=1.21
parchment_mappings_version=2024.07.28
minecraft_version=1.21.1
yarn_mappings=1.21.1+build.3
loader_version=0.16.5
minecraft_version_range=[1.21, 1.22)
neo_version=21.1.66
neo_version_range=[21.1.0,)
loader_version_range=[4,)

# Mod Properties
mod_id=unkindled
mod_name=Unkindled
mod_license=MIT
mod_version=1.2.0
maven_group=net.reimaden
archives_base_name=unkindled
version_range=1.21,1.21.1

# Dependencies
fabric_version=0.105.0+1.21.1
mod_group_id=net.reimaden
mod_authors=Maxmani
mod_description=Makes furnaces require manual ignition to work, and campfires are placed unlit.
17 changes: 9 additions & 8 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
pluginManagement {
repositories {
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
mavenCentral()
gradlePluginPortal()
}
repositories {
mavenLocal()
gradlePluginPortal()
maven { url = 'https://maven.neoforged.net/releases' }
}
}

plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
}
Loading