Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
PercyDan54 committed Sep 4, 2021
1 parent 613e1e8 commit d3296b9
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 31 deletions.
14 changes: 3 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '0.7-SNAPSHOT'
id 'fabric-loom' version '0.9-SNAPSHOT'
id 'maven-publish'
//id 'maven'
id 'idea'
Expand All @@ -23,11 +23,9 @@ dependencies {
// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
// You may need to force-disable transitiveness on them.

implementation group: 'org.yaml', name: 'snakeyaml', version: '1.28'
implementation group: 'org.yaml', name: 'snakeyaml', version: '1.29'
}
repositories {
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
Expand All @@ -37,15 +35,9 @@ repositories {
processResources {
inputs.property "version", project.version

from(sourceSets.main.resources.srcDirs) {
include "fabric.mod.json"
include "title.yml"
filesMatching("fabric.mod.json") {
expand "version": project.version
}

from(sourceSets.main.resources.srcDirs) {
exclude "fabric.mod.json"
}
}

// ensure that the encoding is set to UTF-8, no matter what the system default is
Expand Down
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx2G
org.gradle.daemon=false

# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.16.5
yarn_mappings=1.16.5+build.9
loader_version=0.11.3
minecraft_version=1.17.1
yarn_mappings=1.17.1+build.46
loader_version=0.11.6

# Mod Properties
mod_version = 1.8
maven_group = net.fabricmc
mod_version = 1.0.7
maven_group = me.percydan
archives_base_name = RandomTitle-Fabric

# Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_version=0.34.2+1.16
fabric_version=0.39.2+1.17
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://lss233.littleservice.cn/repositories/gradle-dist/gradle-6.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion src/main/java/me/PercyDan/RandomTitle/ConfigManager.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.percydan.randomtitle;
package me.percydan.RandomTitle;

import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package me.percydan.randomtitle.Mixins;
package me.percydan.RandomTitle.mixins;

import me.percydan.randomtitle.ConfigManager;
import me.percydan.RandomTitle.ConfigManager;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.SharedConstants;
import net.minecraft.client.MinecraftClient;
Expand All @@ -20,7 +20,8 @@
@Mixin(MinecraftClient.class)
public abstract class MixinMinecraft {
ConfigManager config = new ConfigManager();
public String RandTitle = config.getTitle();
private final String randomTitle = config.getTitle();

@Shadow
private IntegratedServer server;
@Shadow
Expand Down Expand Up @@ -57,7 +58,7 @@ private void getWindowTitle(CallbackInfoReturnable<String> ci) {
}
String date = new SimpleDateFormat(config.Get("dateformat")).format((System.currentTimeMillis()));
title = title.replace("%date%", date);
title = title.replace("%title%", RandTitle);
title = title.replace("%title%", randomTitle);
title = title.replace("%version%", stringBuilder.toString());
title = title.replace("%mod%", String.valueOf(FabricLoader.getInstance().getAllMods().size()));
ci.setReturnValue(title);
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"schemaVersion": 1,
"id": "randomtitle",
"version": "1.8",
"version": "1.0.7",

"name": "RandomTitle",
"name": "Random Title",
"description": "Pick random sentences as window title",
"authors": [
"PercyDan"
Expand Down
3 changes: 1 addition & 2 deletions src/main/resources/mixins.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"required": true,
"minVersion": "0.8",
"package": "me.percydan.randomtitle.Mixins",
"package": "me.percydan.RandomTitle.mixins",
"compatibilityLevel": "JAVA_8",
"mixins": [],
"client": ["MixinMinecraft"],
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ title:
- "如果温柔是罪,那就只能用拳头来洗清我们犯下的罪孽 ——《镇魂街》"

#Variables:
#%prefix% as defined above
#%title% - random title
#%title% - Random title
#%date% - Date formatted as dateformat below
#%mod% - loaded mod count
#%mod% - Loaded mod count
#%version% - Minecraft version
format: "Minecraft %version% | %title%"

dateformat: "yyyy-MM-dd HH:mm:ss"

0 comments on commit d3296b9

Please sign in to comment.