1
0
mirror of https://github.com/chylex/Minecraft-Window-Title.git synced 2025-09-15 08:32:12 +02:00

2 Commits

Author SHA1 Message Date
5325cdf282 Release v1.1.1 for Minecraft 1.19 or newer 2023-01-06 16:17:35 +01:00
6c4892dcd0 Update build scripts 2023-01-04 06:53:55 +01:00
10 changed files with 57 additions and 31 deletions

View File

@@ -4,7 +4,7 @@ val fabricVersion: String by project
plugins {
idea
id("fabric-loom") version "0.10-SNAPSHOT"
id("fabric-loom")
}
dependencies {

View File

@@ -1,6 +1,6 @@
{
"schemaVersion": 1,
"id": "customwindowtitle",
"id": "${id}",
"name": "${name}",
"description": "${description}",
"version": "${version}",
@@ -22,12 +22,13 @@
"chylex.customwindowtitle.fabric.CustomWindowTitle"
]
},
"mixins": [
"customwindowtitle.mixins.json"
],
"mixins": [{
"config": "${id}.mixins.json"
}],
"depends": {
"fabricloader": ">=0.7.2",
"minecraft": ">=1.17"
"fabricloader": ">=${minimumFabricVersion}",
"minecraft": ">=${minimumMinecraftVersion}"
}
}

View File

@@ -11,7 +11,6 @@ import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.fml.loading.FMLPaths;
import net.minecraftforge.fmllegacy.network.FMLNetworkConstants;
@Mod("customwindowtitle")
public class CustomWindowTitle {
@@ -19,7 +18,7 @@ public class CustomWindowTitle {
public CustomWindowTitle() {
config = TitleConfig.read(FMLPaths.CONFIGDIR.get().toString());
ModLoadingContext.get().registerExtensionPoint(DisplayTest.class, () -> new DisplayTest(() -> FMLNetworkConstants.IGNORESERVERONLY, (a, b) -> true));
ModLoadingContext.get().registerExtensionPoint(DisplayTest.class, () -> new DisplayTest(() -> DisplayTest.IGNORESERVERONLY, (a, b) -> true));
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::onClientSetup);
CommonTokenData.register(new TokenProvider());
}

View File

@@ -1,27 +1,27 @@
modLoader = "javafml"
loaderVersion = "[31,)"
loaderVersion = "[0,)"
authors = "${author}"
license = "${license}"
issueTrackerURL = "${issuesURL}"
[[mods]]
modId = "customwindowtitle"
modId = "${id}"
version = "${version}"
displayName = "${name}"
description = "${description}"
displayURL = "${sourcesURL}"
[[dependencies.customwindowtitle]]
[[dependencies.${id}]]
modId = "minecraft"
mandatory = true
versionRange = "[1.17,)"
versionRange = "[${minimumMinecraftVersion},)"
ordering = "NONE"
side = "CLIENT"
[[dependencies.customwindowtitle]]
[[dependencies.${id}]]
modId = "forge"
mandatory = true
versionRange = "[31.2.45,)"
versionRange = "[${minimumForgeVersion},)"
ordering = "NONE"
side = "CLIENT"

View File

@@ -1,7 +0,0 @@
{
"pack": {
"description": "Custom Window Title",
"pack_format": 5,
"_comment": ""
}
}

View File

@@ -14,6 +14,10 @@ val modIssuesURL: String by project
val minecraftVersion: String by project
val mixinVersion: String by project
val minimumMinecraftVersion: String by project
val minimumForgeVersion: String by project
val minimumFabricVersion: String by project
val modNameStripped = modName.replace(" ", "")
val jarVersion = "$minecraftVersion+v$modVersion"
@@ -74,12 +78,12 @@ allprojects {
}
extensions.getByType<JavaPluginExtension>().apply {
toolchain.languageVersion.set(JavaLanguageVersion.of(16))
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
options.release.set(16)
options.release.set(17)
}
}
@@ -101,8 +105,7 @@ subprojects {
}
tasks.processResources {
from(rootProject.sourceSets.main.get().resources)
inputs.property("id", modId)
inputs.property("name", modName)
inputs.property("description", modDescription)
inputs.property("version", modVersion)
@@ -110,6 +113,13 @@ subprojects {
inputs.property("license", modLicense)
inputs.property("sourcesURL", modSourcesURL)
inputs.property("issuesURL", modIssuesURL)
inputs.property("minimumMinecraftVersion", minimumMinecraftVersion)
inputs.property("minimumForgeVersion", minimumForgeVersion)
inputs.property("minimumFabricVersion", minimumFabricVersion)
from(rootProject.sourceSets.main.get().resources) {
expand(inputs.properties)
}
}
tasks.jar {
@@ -130,6 +140,10 @@ subprojects {
)
}
}
tasks.test {
onlyIf { false }
}
}
tasks.register("setupIdea") {

View File

@@ -9,10 +9,16 @@ modSourcesURL=https://github.com/chylex/Minecraft-Window-Title
modIssuesURL=https://github.com/chylex/Minecraft-Window-Title/issues
# Dependencies
minecraftVersion=1.17.1
forgeVersion=37.0.75
fabricVersion=0.11.7
mixinVersion=0.8.4
minecraftVersion=1.19
forgeVersion=41.1.0
fabricVersion=0.14.12
loomVersion=0.12
mixinVersion=0.8.5
# Constraints
minimumMinecraftVersion=1.19
minimumForgeVersion=41.0.1
minimumFabricVersion=0.12.0
# Gradle
org.gradle.jvmargs=-Xmx3G

View File

@@ -6,6 +6,12 @@ pluginManagement {
maven(url = "https://maven.fabricmc.net/") { name = "Fabric" }
maven(url = "https://repo.spongepowered.org/repository/maven-public/") { name = "Sponge Snapshots" }
}
plugins {
if (settings.extra.has("loomVersion")) {
id("fabric-loom") version "${settings.extra["loomVersion"]}-SNAPSHOT"
}
}
}
if (settings.extra.has("forgeVersion")) {

View File

@@ -3,7 +3,7 @@
"minVersion": "0.8",
"package": "chylex.customwindowtitle.mixin",
"refmap": "customwindowtitle.refmap.json",
"compatibilityLevel": "JAVA_16",
"compatibilityLevel": "JAVA_17",
"client": [
"DisableVanillaTitle"
],

View File

@@ -0,0 +1,7 @@
{
"pack": {
"description": "${name}",
"pack_format": 7,
"_comment": ""
}
}