mirror of
https://github.com/chylex/Minecraft-Window-Title.git
synced 2025-09-15 08:32:12 +02:00
Compare commits
4 Commits
1.17
...
02d6f2a63d
Author | SHA1 | Date | |
---|---|---|---|
02d6f2a63d
|
|||
30a12716b6
|
|||
5325cdf282
|
|||
6c4892dcd0
|
@@ -4,7 +4,7 @@ val fabricVersion: String by project
|
||||
|
||||
plugins {
|
||||
idea
|
||||
id("fabric-loom") version "0.10-SNAPSHOT"
|
||||
id("fabric-loom")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@@ -11,7 +11,7 @@ public class CustomWindowTitle implements ClientModInitializer {
|
||||
private final TitleConfig config;
|
||||
|
||||
public CustomWindowTitle() {
|
||||
config = TitleConfig.read(FabricLoader.getInstance().getConfigDirectory().getAbsolutePath());
|
||||
config = TitleConfig.read(FabricLoader.getInstance().getConfigDir().toAbsolutePath().toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -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}"
|
||||
}
|
||||
}
|
||||
|
@@ -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());
|
||||
}
|
||||
|
@@ -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"
|
||||
|
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"pack": {
|
||||
"description": "Custom Window Title",
|
||||
"pack_format": 5,
|
||||
"_comment": ""
|
||||
}
|
||||
}
|
@@ -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") {
|
||||
|
@@ -3,16 +3,22 @@ modId=customwindowtitle
|
||||
modName=Custom Window Title
|
||||
modDescription=Customize window title and icon.
|
||||
modAuthor=chylex
|
||||
modVersion=1.1.1
|
||||
modVersion=1.1.2
|
||||
modLicense=Unlicense
|
||||
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.3
|
||||
forgeVersion=44.1.0
|
||||
fabricVersion=0.14.12
|
||||
loomVersion=0.12
|
||||
mixinVersion=0.8.5
|
||||
|
||||
# Constraints
|
||||
minimumMinecraftVersion=1.19.3
|
||||
minimumForgeVersion=44.0.0
|
||||
minimumFabricVersion=0.12.3
|
||||
|
||||
# Gradle
|
||||
org.gradle.jvmargs=-Xmx3G
|
||||
|
@@ -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")) {
|
||||
|
@@ -1,11 +1,11 @@
|
||||
package chylex.customwindowtitle;
|
||||
import net.minecraft.server.packs.resources.IoSupplier;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.StandardOpenOption;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
@@ -113,19 +113,11 @@ public final class TitleConfig {
|
||||
return icon16 != null && icon32 != null;
|
||||
}
|
||||
|
||||
public InputStream readIcon16() {
|
||||
try {
|
||||
return Files.newInputStream(icon16, StandardOpenOption.READ);
|
||||
} catch (final IOException e) {
|
||||
throw new RuntimeException("CustomWindowTitle could not open the specified 16x16 icon: " + icon16, e);
|
||||
}
|
||||
public IoSupplier<InputStream> readIcon16() {
|
||||
return IoSupplier.create(icon16);
|
||||
}
|
||||
|
||||
public InputStream readIcon32() {
|
||||
try {
|
||||
return Files.newInputStream(icon32, StandardOpenOption.READ);
|
||||
} catch (final IOException e) {
|
||||
throw new RuntimeException("CustomWindowTitle could not open the specified 32x32 icon: " + icon16, e);
|
||||
}
|
||||
public IoSupplier<InputStream> readIcon32() {
|
||||
return IoSupplier.create(icon32);
|
||||
}
|
||||
}
|
||||
|
@@ -3,7 +3,7 @@
|
||||
"minVersion": "0.8",
|
||||
"package": "chylex.customwindowtitle.mixin",
|
||||
"refmap": "customwindowtitle.refmap.json",
|
||||
"compatibilityLevel": "JAVA_16",
|
||||
"compatibilityLevel": "JAVA_17",
|
||||
"client": [
|
||||
"DisableVanillaTitle"
|
||||
],
|
||||
|
7
src/main/resources/pack.mcmeta
Normal file
7
src/main/resources/pack.mcmeta
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"pack": {
|
||||
"description": "${name}",
|
||||
"pack_format": 7,
|
||||
"_comment": ""
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user