From 01445b4c92eef7bd2c32f65189eed2f00d4b4767 Mon Sep 17 00:00:00 2001 From: Keuin Date: Thu, 24 Dec 2020 21:59:23 +0800 Subject: keep up with main stream (1.1.3-beta) --- .gitignore | 2 +- gradle.properties | 8 ++++---- src/main/java/com/keuin/blame/data/entry/LogEntry.java | 2 +- src/main/java/com/keuin/blame/util/MinecraftUtil.java | 5 ++++- src/main/java/com/keuin/blame/util/PrintUtil.java | 18 ++++++++---------- src/main/resources/fabric.mod.json | 2 +- 6 files changed, 19 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index 5faee2e..f1b1c57 100644 --- a/.gitignore +++ b/.gitignore @@ -31,5 +31,5 @@ bin/ # fabric run/ -run.1152 +run.1152/ logs/ \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index dd908cf..0c58fb8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,13 +2,13 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/use -minecraft_version=1.16.4 -yarn_mappings=1.16.4+build.6 -loader_version=0.10.6+build.214 +minecraft_version=1.15.2 +yarn_mappings=1.15.2+build.17 +loader_version=0.10.8 # Mod Properties mod_version=1.1.3-beta maven_group=com.keuin.blame archives_base_name=blame-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.25.1+build.416-1.16 +fabric_version=0.28.4+1.15 diff --git a/src/main/java/com/keuin/blame/data/entry/LogEntry.java b/src/main/java/com/keuin/blame/data/entry/LogEntry.java index 090d77c..e47cc92 100644 --- a/src/main/java/com/keuin/blame/data/entry/LogEntry.java +++ b/src/main/java/com/keuin/blame/data/entry/LogEntry.java @@ -44,7 +44,7 @@ public class LogEntry { public int version = 1; @BsonProperty(GAME_VERSION) - public String gameVersion = MinecraftVersion.field_25319.getName(); + public String gameVersion = (new MinecraftVersion()).getName(); @BsonProperty(TIMESTAMP_MILLIS) public long timeMillis = 0; diff --git a/src/main/java/com/keuin/blame/util/MinecraftUtil.java b/src/main/java/com/keuin/blame/util/MinecraftUtil.java index ce8707e..4cb7e2b 100644 --- a/src/main/java/com/keuin/blame/util/MinecraftUtil.java +++ b/src/main/java/com/keuin/blame/util/MinecraftUtil.java @@ -1,11 +1,14 @@ package com.keuin.blame.util; import net.minecraft.world.World; +import net.minecraft.world.dimension.DimensionType; + +import java.util.Objects; public class MinecraftUtil { public static String worldToString(World world) { - return world.getRegistryKey().getValue().toString(); + return Objects.requireNonNull(DimensionType.getId(world.dimension.getType())).toString(); } } diff --git a/src/main/java/com/keuin/blame/util/PrintUtil.java b/src/main/java/com/keuin/blame/util/PrintUtil.java index 75b73d4..07985f9 100644 --- a/src/main/java/com/keuin/blame/util/PrintUtil.java +++ b/src/main/java/com/keuin/blame/util/PrintUtil.java @@ -2,7 +2,6 @@ package com.keuin.blame.util; import com.mojang.brigadier.context.CommandContext; import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; -import net.minecraft.network.MessageType; import net.minecraft.server.MinecraftServer; import net.minecraft.server.PlayerManager; import net.minecraft.server.command.ServerCommandSource; @@ -12,19 +11,19 @@ import net.minecraft.util.Formatting; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import static com.keuin.blame.util.UuidUtils.UUID_NULL; - public final class PrintUtil implements ServerLifecycleEvents.ServerStarted { + // version: 1.2 (for 1.15.2) + private static final Object syncMessage = new Object(); private static final Object syncBroadcast = new Object(); - private static final Style broadcastStyle = Style.EMPTY.withColor(Formatting.AQUA); - private static final Style infoStyle = Style.EMPTY.withColor(Formatting.WHITE); - private static final Style stressStyle = Style.EMPTY.withColor(Formatting.AQUA); - private static final Style warnStyle = Style.EMPTY.withColor(Formatting.YELLOW); - private static final Style errorStyle = Style.EMPTY.withColor(Formatting.DARK_RED); + private static final Style broadcastStyle = new Style().setColor(Formatting.AQUA); + private static final Style infoStyle = new Style().setColor(Formatting.WHITE); + private static final Style stressStyle = new Style().setColor(Formatting.AQUA); + private static final Style warnStyle = new Style().setColor(Formatting.YELLOW); + private static final Style errorStyle = new Style().setColor(Formatting.DARK_RED); private static final Logger LOGGER = LogManager.getLogger(); private static final String LOG_HEADING = "[Blame]"; @@ -52,8 +51,7 @@ public final class PrintUtil implements ServerLifecycleEvents.ServerStarted { if (playerManager != null) playerManager.broadcastChatMessage( new LiteralText(message).setStyle(broadcastStyle), - MessageType.SYSTEM, - UUID_NULL + false ); } } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index f4d8e92..aa17a7b 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -25,7 +25,7 @@ "depends": { "fabricloader": ">=0.7.4", "fabric": "*", - "minecraft": "1.16.x" + "minecraft": "1.15.x" }, "suggests": { "another-mod": "*" -- cgit v1.2.3