兼容1.19.4

This commit is contained in:
Xujiayao 2023-03-15 23:42:55 +08:00
parent 69ae693046
commit e10561d43d
7 changed files with 33 additions and 8 deletions

View file

@ -11,6 +11,7 @@ preprocess {
def mc1182 = createNode("1.18.2", 1_18_02, "yarn")
def mc1192 = createNode("1.19.2", 1_19_02, "yarn")
def mc1193 = createNode("1.19.3", 1_19_03, "yarn")
def mc1194 = createNode("1.19.4", 1_19_04, "yarn")
mc1144.link(mc1152, null)
mc1152.link(mc1165, null)
@ -18,4 +19,5 @@ preprocess {
mc1171.link(mc1182, null)
mc1182.link(mc1192, null)
mc1192.link(mc1193, null)
mc1193.link(mc1194, null)
}

View file

@ -8,7 +8,7 @@ archives_base_name=MCDiscordChat
# Wrapper Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.19.3
yarn_mappings=1.19.3+build.5
minecraft_version=1.19.4
yarn_mappings=1.19.4+build.1
loader_version=0.14.17
fabric_version=0.75.1+1.19.3
fabric_version=0.75.3+1.19.4

View file

@ -24,7 +24,8 @@ def versions = Arrays.asList(
"1.17.1",
"1.18.2",
"1.19.2",
"1.19.3"
"1.19.3",
"1.19.4"
)
for (String version : versions) {
include(":$version")

View file

@ -12,7 +12,6 @@ import net.dv8tion.jda.api.interactions.commands.OptionType;
import net.dv8tion.jda.api.interactions.commands.build.Commands;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.util.math.MathHelper;
import okhttp3.CacheControl;
import okhttp3.Request;
import okhttp3.Response;
@ -224,7 +223,7 @@ public class Utils {
}
// Server TPS
double serverTickTime = MathHelper.average(SERVER.lastTickLengths) * 1.0E-6D;
double serverTickTime = average(SERVER.lastTickLengths) * 1.0E-6D;
message.append(Translations.translate("utils.utils.gicMessage.serverTps", String.format("%.2f", Math.min(1000.0 / serverTickTime, 20))));
// Server MSPT
@ -324,7 +323,7 @@ public class Utils {
MSPT_MONITOR_TIMER.schedule(new TimerTask() {
@Override
public void run() {
double mspt = MathHelper.average(SERVER.lastTickLengths) * 1.0E-6D;
double mspt = average(SERVER.lastTickLengths) * 1.0E-6D;
if (mspt > CONFIG.generic.msptLimit) {
CHANNEL.sendMessage(Translations.translateMessage("message.highMspt")
@ -380,4 +379,13 @@ public class Utils {
}
}, 3600000, 21600000);
}
public static double average(long[] array) {
long sum = 0L;
for (final long i : array) {
sum += i;
}
return sum / (double) array.length;
}
}

View file

@ -0,0 +1,11 @@
# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.19.4
yarn_mappings=1.19.4+build.1
loader_version=0.14.17
# Fabric Mod Metadata
minecraft_dependency=1.19.4
# Dependencies
fabric_version=0.75.3+1.19.4

View file

@ -1 +1 @@
1.19.3
1.19.4

View file

@ -36,6 +36,9 @@
},
{
"file": "META-INF/jars/MCDiscordChat-1.19.3-${version}.jar"
},
{
"file": "META-INF/jars/MCDiscordChat-1.19.4-${version}.jar"
}
]
}