mirror of
https://github.com/chylex/Minecraft-Window-Title.git
synced 2025-09-15 17:32:14 +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 {
|
plugins {
|
||||||
idea
|
idea
|
||||||
id("fabric-loom") version "0.10-SNAPSHOT"
|
id("fabric-loom")
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
@@ -11,7 +11,7 @@ public class CustomWindowTitle implements ClientModInitializer {
|
|||||||
private final TitleConfig config;
|
private final TitleConfig config;
|
||||||
|
|
||||||
public CustomWindowTitle() {
|
public CustomWindowTitle() {
|
||||||
config = TitleConfig.read(FabricLoader.getInstance().getConfigDirectory().getAbsolutePath());
|
config = TitleConfig.read(FabricLoader.getInstance().getConfigDir().toAbsolutePath().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"schemaVersion": 1,
|
"schemaVersion": 1,
|
||||||
"id": "customwindowtitle",
|
"id": "${id}",
|
||||||
"name": "${name}",
|
"name": "${name}",
|
||||||
"description": "${description}",
|
"description": "${description}",
|
||||||
"version": "${version}",
|
"version": "${version}",
|
||||||
@@ -22,12 +22,13 @@
|
|||||||
"chylex.customwindowtitle.fabric.CustomWindowTitle"
|
"chylex.customwindowtitle.fabric.CustomWindowTitle"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"mixins": [
|
|
||||||
"customwindowtitle.mixins.json"
|
"mixins": [{
|
||||||
],
|
"config": "${id}.mixins.json"
|
||||||
|
}],
|
||||||
|
|
||||||
"depends": {
|
"depends": {
|
||||||
"fabricloader": ">=0.7.2",
|
"fabricloader": ">=${minimumFabricVersion}",
|
||||||
"minecraft": ">=1.17"
|
"minecraft": ">=${minimumMinecraftVersion}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -11,7 +11,6 @@ import net.minecraftforge.fml.common.Mod;
|
|||||||
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
|
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
|
||||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||||
import net.minecraftforge.fml.loading.FMLPaths;
|
import net.minecraftforge.fml.loading.FMLPaths;
|
||||||
import net.minecraftforge.fmllegacy.network.FMLNetworkConstants;
|
|
||||||
|
|
||||||
@Mod("customwindowtitle")
|
@Mod("customwindowtitle")
|
||||||
public class CustomWindowTitle {
|
public class CustomWindowTitle {
|
||||||
@@ -19,7 +18,7 @@ public class CustomWindowTitle {
|
|||||||
|
|
||||||
public CustomWindowTitle() {
|
public CustomWindowTitle() {
|
||||||
config = TitleConfig.read(FMLPaths.CONFIGDIR.get().toString());
|
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);
|
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::onClientSetup);
|
||||||
CommonTokenData.register(new TokenProvider());
|
CommonTokenData.register(new TokenProvider());
|
||||||
}
|
}
|
||||||
|
@@ -1,27 +1,27 @@
|
|||||||
modLoader = "javafml"
|
modLoader = "javafml"
|
||||||
loaderVersion = "[31,)"
|
loaderVersion = "[0,)"
|
||||||
|
|
||||||
authors = "${author}"
|
authors = "${author}"
|
||||||
license = "${license}"
|
license = "${license}"
|
||||||
issueTrackerURL = "${issuesURL}"
|
issueTrackerURL = "${issuesURL}"
|
||||||
|
|
||||||
[[mods]]
|
[[mods]]
|
||||||
modId = "customwindowtitle"
|
modId = "${id}"
|
||||||
version = "${version}"
|
version = "${version}"
|
||||||
displayName = "${name}"
|
displayName = "${name}"
|
||||||
description = "${description}"
|
description = "${description}"
|
||||||
displayURL = "${sourcesURL}"
|
displayURL = "${sourcesURL}"
|
||||||
|
|
||||||
[[dependencies.customwindowtitle]]
|
[[dependencies.${id}]]
|
||||||
modId = "minecraft"
|
modId = "minecraft"
|
||||||
mandatory = true
|
mandatory = true
|
||||||
versionRange = "[1.17,)"
|
versionRange = "[${minimumMinecraftVersion},)"
|
||||||
ordering = "NONE"
|
ordering = "NONE"
|
||||||
side = "CLIENT"
|
side = "CLIENT"
|
||||||
|
|
||||||
[[dependencies.customwindowtitle]]
|
[[dependencies.${id}]]
|
||||||
modId = "forge"
|
modId = "forge"
|
||||||
mandatory = true
|
mandatory = true
|
||||||
versionRange = "[31.2.45,)"
|
versionRange = "[${minimumForgeVersion},)"
|
||||||
ordering = "NONE"
|
ordering = "NONE"
|
||||||
side = "CLIENT"
|
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 minecraftVersion: String by project
|
||||||
val mixinVersion: 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 modNameStripped = modName.replace(" ", "")
|
||||||
val jarVersion = "$minecraftVersion+v$modVersion"
|
val jarVersion = "$minecraftVersion+v$modVersion"
|
||||||
|
|
||||||
@@ -74,12 +78,12 @@ allprojects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extensions.getByType<JavaPluginExtension>().apply {
|
extensions.getByType<JavaPluginExtension>().apply {
|
||||||
toolchain.languageVersion.set(JavaLanguageVersion.of(16))
|
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType<JavaCompile> {
|
tasks.withType<JavaCompile> {
|
||||||
options.encoding = "UTF-8"
|
options.encoding = "UTF-8"
|
||||||
options.release.set(16)
|
options.release.set(17)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,8 +105,7 @@ subprojects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tasks.processResources {
|
tasks.processResources {
|
||||||
from(rootProject.sourceSets.main.get().resources)
|
inputs.property("id", modId)
|
||||||
|
|
||||||
inputs.property("name", modName)
|
inputs.property("name", modName)
|
||||||
inputs.property("description", modDescription)
|
inputs.property("description", modDescription)
|
||||||
inputs.property("version", modVersion)
|
inputs.property("version", modVersion)
|
||||||
@@ -110,6 +113,13 @@ subprojects {
|
|||||||
inputs.property("license", modLicense)
|
inputs.property("license", modLicense)
|
||||||
inputs.property("sourcesURL", modSourcesURL)
|
inputs.property("sourcesURL", modSourcesURL)
|
||||||
inputs.property("issuesURL", modIssuesURL)
|
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 {
|
tasks.jar {
|
||||||
@@ -130,6 +140,10 @@ subprojects {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.test {
|
||||||
|
onlyIf { false }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register("setupIdea") {
|
tasks.register("setupIdea") {
|
||||||
|
@@ -3,16 +3,22 @@ modId=customwindowtitle
|
|||||||
modName=Custom Window Title
|
modName=Custom Window Title
|
||||||
modDescription=Customize window title and icon.
|
modDescription=Customize window title and icon.
|
||||||
modAuthor=chylex
|
modAuthor=chylex
|
||||||
modVersion=1.1.1
|
modVersion=1.1.2
|
||||||
modLicense=Unlicense
|
modLicense=Unlicense
|
||||||
modSourcesURL=https://github.com/chylex/Minecraft-Window-Title
|
modSourcesURL=https://github.com/chylex/Minecraft-Window-Title
|
||||||
modIssuesURL=https://github.com/chylex/Minecraft-Window-Title/issues
|
modIssuesURL=https://github.com/chylex/Minecraft-Window-Title/issues
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
minecraftVersion=1.17.1
|
minecraftVersion=1.19.3
|
||||||
forgeVersion=37.0.75
|
forgeVersion=44.1.0
|
||||||
fabricVersion=0.11.7
|
fabricVersion=0.14.12
|
||||||
mixinVersion=0.8.4
|
loomVersion=0.12
|
||||||
|
mixinVersion=0.8.5
|
||||||
|
|
||||||
|
# Constraints
|
||||||
|
minimumMinecraftVersion=1.19.3
|
||||||
|
minimumForgeVersion=44.0.0
|
||||||
|
minimumFabricVersion=0.12.3
|
||||||
|
|
||||||
# Gradle
|
# Gradle
|
||||||
org.gradle.jvmargs=-Xmx3G
|
org.gradle.jvmargs=-Xmx3G
|
||||||
|
@@ -6,6 +6,12 @@ pluginManagement {
|
|||||||
maven(url = "https://maven.fabricmc.net/") { name = "Fabric" }
|
maven(url = "https://maven.fabricmc.net/") { name = "Fabric" }
|
||||||
maven(url = "https://repo.spongepowered.org/repository/maven-public/") { name = "Sponge Snapshots" }
|
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")) {
|
if (settings.extra.has("forgeVersion")) {
|
||||||
|
@@ -1,11 +1,11 @@
|
|||||||
package chylex.customwindowtitle;
|
package chylex.customwindowtitle;
|
||||||
|
import net.minecraft.server.packs.resources.IoSupplier;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.nio.file.StandardOpenOption;
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -113,19 +113,11 @@ public final class TitleConfig {
|
|||||||
return icon16 != null && icon32 != null;
|
return icon16 != null && icon32 != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public InputStream readIcon16() {
|
public IoSupplier<InputStream> readIcon16() {
|
||||||
try {
|
return IoSupplier.create(icon16);
|
||||||
return Files.newInputStream(icon16, StandardOpenOption.READ);
|
|
||||||
} catch (final IOException e) {
|
|
||||||
throw new RuntimeException("CustomWindowTitle could not open the specified 16x16 icon: " + icon16, e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public InputStream readIcon32() {
|
public IoSupplier<InputStream> readIcon32() {
|
||||||
try {
|
return IoSupplier.create(icon32);
|
||||||
return Files.newInputStream(icon32, StandardOpenOption.READ);
|
|
||||||
} catch (final IOException e) {
|
|
||||||
throw new RuntimeException("CustomWindowTitle could not open the specified 32x32 icon: " + icon16, e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
"minVersion": "0.8",
|
"minVersion": "0.8",
|
||||||
"package": "chylex.customwindowtitle.mixin",
|
"package": "chylex.customwindowtitle.mixin",
|
||||||
"refmap": "customwindowtitle.refmap.json",
|
"refmap": "customwindowtitle.refmap.json",
|
||||||
"compatibilityLevel": "JAVA_16",
|
"compatibilityLevel": "JAVA_17",
|
||||||
"client": [
|
"client": [
|
||||||
"DisableVanillaTitle"
|
"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