Updated gradle and metadata.

This commit is contained in:
2026-01-08 22:17:34 +01:00
parent f79326266a
commit 407e26a179
6 changed files with 140 additions and 125 deletions

View File

@ -1,112 +1,134 @@
buildscript { buildscript {
repositories { repositories {
// These repositories are only for Gradle plugins, put any other repositories in the repository block further below // These repositories are only for Gradle plugins, put any other repositories in the repository block further below
maven { url = 'https://maven.minecraftforge.net' } maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT'
} }
} }
apply plugin: 'net.minecraftforge.gradle' plugins {
id 'eclipse'
id 'idea'
id 'net.minecraftforge.gradle' version '[6.0.16,6.2)'
id 'org.parchmentmc.librarian.forgegradle' version '1.+'
}
def archiveVersion = "${project.mcVersion}-${project.buildVersion}" as Object apply plugin: 'org.spongepowered.mixin'
java.toolchain.languageVersion = JavaLanguageVersion.of(17) group = mod_group_id
version = mod_version
base {
archivesName = "${mod_id}-${minecraft_version}"
}
java {
toolchain.languageVersion = JavaLanguageVersion.of(17)
}
minecraft { minecraft {
mappings channel: 'official', version: mcVersion mappings channel: mapping_channel, version: "$mapping_version-$minecraft_version"
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') copyIdeResources = true
// generateRunFolders = true
// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // https://docs.minecraftforge.net/en/latest/advanced/accesstransformers/
runs { runs {
client { // applies to all the run configs below
configureEach {
workingDirectory project.file('run') workingDirectory project.file('run')
property 'forge.logging.markers', 'REGISTRIES' property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug' property 'forge.logging.console.level', 'debug'
mods { mods {
totemofreviving { "${mod_id}" {
source sourceSets.main source sourceSets.main
} }
} }
} }
client {
property 'forge.enabledGameTestNamespaces', mod_id
}
server { server {
workingDirectory project.file('run') property 'forge.enabledGameTestNamespaces', mod_id
args '--nogui'
}
property 'forge.logging.markers', 'REGISTRIES' gameTestServer {
property 'forge.logging.console.level', 'debug' property 'forge.enabledGameTestNamespaces', mod_id
mods {
totemofreviving {
source sourceSets.main
}
}
} }
data { data {
workingDirectory project.file('run') workingDirectory project.file('run-data')
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
args '--mod', 'totemofreviving', '--all',
'--existing', file('src/main/resources').toString(),
'--existing', file('src/generated/resources').toString(),
'--output', file('src/generated/resources/')
mods {
totemofreviving {
source sourceSets.main
}
}
} }
} }
} }
//mixin {
// add sourceSets.main, "${mod_id}.refmap.json"
//
// config "${mod_id}.mixins.json"
//}
sourceSets.main.resources { sourceSets.main.resources {
srcDir 'src/generated/resources' srcDir 'src/generated/resources'
} }
repositories { repositories {
maven { exclusiveContent {
name = "Progwml6 maven" forRepository {
url = "https://dvs1.progwml6.com/files/maven/" maven {
} name = "Modrinth"
maven { url = "https://api.modrinth.com/maven"
name = "ModMaven" }
url = "https://modmaven.dev" }
forRepositories(fg.repository) // Only add this if you're using ForgeGradle, otherwise remove this line
filter {
includeGroup "maven.modrinth"
}
} }
} }
dependencies { dependencies {
minecraft "net.minecraftforge:forge:${project.mcVersion}-${project.forgeVersion}" minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
}
// JEI tasks.named('processResources', ProcessResources).configure {
if (project.hasProperty('jeiVersion')) { var replaceProperties = [minecraft_version : minecraft_version, minecraft_version_range: minecraft_version_range,
// compile against JEI API but do not include it at runtime forge_version : forge_version, forge_version_range: forge_version_range,
compileOnly fg.deobf("mezz.jei:jei-${project.mcVersion}-forge-api:${project.jeiVersion}") loader_version_range: loader_version_range,
// at runtime, use full JEI jar mod_id : mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version,
runtimeOnly fg.deobf("mezz.jei:jei-${project.mcVersion}-forge:${project.jeiVersion}") mod_authors : mod_authors, mod_description: mod_description]
inputs.properties replaceProperties
filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) {
expand replaceProperties + [project: project]
} }
} }
jar { tasks.named('jar', Jar).configure {
archiveFileName = "${project.archivesBaseName}-${archiveVersion}.jar"
manifest { manifest {
attributes([ attributes(["Specification-Title" : mod_id,
"Specification-Title" : project.name, "Specification-Vendor" : mod_authors,
"Specification-Vendor" : project.author, "Specification-Version" : "1",
"Specification-Version" : "1", "Implementation-Title" : project.name,
"Implementation-Title" : project.name, "Implementation-Version" : project.jar.archiveVersion,
"Implementation-Vendor" : project.author, "Implementation-Vendor" : mod_authors,
"Implementation-Version" : archiveVersion, "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")])
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
} }
finalizedBy 'reobfJar'
} }
jar.finalizedBy('reobfJar') tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}

View File

@ -1,14 +1,20 @@
org.gradle.jvmargs=-Xmx3G org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false org.gradle.daemon=false
group = dev.micle mod_id=totem_of_reviving
archivesBaseName = micles-totem-of-reviving-forge mod_name=Micle's Totem of Reviving
modID = totemofreviving mod_license=All Rights Reserved
name = Micle's Totem of Reviving mod_version=2.0.0
author = Micle mod_group_id=dev.micle
mod_authors=Micle
mod_description=Totems to revive your friends in hardcore.
buildVersion = 2.0.0 minecraft_version=1.20.1
mcVersion = 1.20.1 minecraft_version_range=[1.20.1,1.21)
forgeVersion = 47.2.20
#jeiVersion = 11.+ forge_version=47.2.20
forge_version_range=[47,)
loader_version_range=[47,)
mapping_channel=parchment
mapping_version=2023.09.03

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

@ -1 +1,16 @@
rootProject.name = 'TotemOfReviving-1.20' pluginManagement {
repositories {
gradlePluginPortal()
maven {
name = 'MinecraftForge'
url = 'https://maven.minecraftforge.net/'
}
maven { url = 'https://maven.parchmentmc.org' }
}
}
plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0'
}
rootProject.name = "${mod_id}-${minecraft_version}"

View File

@ -12,7 +12,7 @@ import java.util.Optional;
@Mod(TotemOfReviving.MOD_ID) @Mod(TotemOfReviving.MOD_ID)
public final class TotemOfReviving { public final class TotemOfReviving {
public static final String MOD_ID = "totemofreviving"; public static final String MOD_ID = "totem_of_reviving";
private static IProxy proxy; private static IProxy proxy;

View File

@ -1,58 +1,30 @@
# This is an example mods.toml file. It contains the data relating to the loading mods. modLoader = "javafml"
# There are several mandatory fields (#mandatory), and many more that are optional (#optional). loaderVersion = "${loader_version_range}"
# The overall format is standard TOML format, v0.5.0. license = "${mod_license}"
# Note that there are a couple of TOML lists in this file. issueTrackerURL="https://gitea.micle.dev/minecraft-mods/totem_of_reviving/issues"
# Find more information on toml format here: https://github.com/toml-lang/toml
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml [[mods]]
modLoader = "javafml" #mandatory modId = "${mod_id}"
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version version = "${mod_version}"
loaderVersion = "[47,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions. displayName = "${mod_name}"
# The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties. #updateJSONURL="http://myurl.me/"
# Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here. #displayURL="http://example.com/"
license = "All Rights Reserved" logoFile="logo.jpg"
# A URL to refer people to when problems occur with this mod #credits=""
#issueTrackerURL="http://my.issue.tracker/" #optional authors="${mod_authors}"
# A list of mods - how many allowed here is determined by the individual mod loader displayTest="MATCH_VERSION" # MATCH_VERSION, IGNORE_SERVER_VERSION (server only), IGNORE_ALL_VERSION (client only), NONE (IExtensionPoint.DisplayTest)
[[mods]] #mandatory description = '''${mod_description}'''
# The modid of the mod
modId = "totemofreviving" #mandatory [[dependencies."${mod_id}"]]
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it modId = "forge"
# ${file.jarVersion} will substitute the value of the Implementation-Version as read from the mod's JAR file metadata mandatory = true
# see the associated build.gradle script for how to populate this completely automatically during a build versionRange = "${forge_version_range}"
version = "${file.jarVersion}" #mandatory ordering = "NONE" # BEFORE, AFTER, NONE
# A display name for the mod side = "BOTH" # BOTH, CLIENT, SERVER
displayName = "Micle's Totem of Reviving" #mandatory
# A URL to query for updates for this mod. See the JSON update specification <here> [[dependencies."${mod_id}"]]
#updateJSONURL="http://myurl.me/" #optional
# A URL for the "homepage" for this mod, displayed in the mod UI
#displayURL="http://example.com/" #optional
# A file name (in the root of the mod JAR) containing a logo for display
logoFile="logo.jpg" #optional
# A text field displayed in the mod UI
#credits="Thanks for this example mod goes to Java" #optional
# A text field displayed in the mod UI
authors="Micle" #optional
# The description text for the mod (multi line!) (#mandatory)
description = '''
Mod for reviving players in a hardcore world.
'''
# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional.
[[dependencies.totemofreviving]] #optional
# the modid of the dependency
modId = "forge" #mandatory
# Does this dependency have to exist - if not, ordering below must be specified
mandatory = true #mandatory
# The version range of the dependency
versionRange = "[47,)" #mandatory
# An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory
ordering = "NONE"
# Side this dependency is applied on - BOTH, CLIENT or SERVER
side = "BOTH"
# Here's another dependency
[[dependencies.totemofreviving]]
modId = "minecraft" modId = "minecraft"
mandatory = true mandatory = true
# This version range declares a minimum of the current minecraft version up to but not including the next major version versionRange = "${minecraft_version_range}"
versionRange = "[1.20.1,1.20.2)"
ordering = "NONE" ordering = "NONE"
side = "BOTH" side = "BOTH"