summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorKeuin <[email protected]>2020-12-24 21:59:23 +0800
committerKeuin <[email protected]>2020-12-26 12:48:34 +0800
commitdc4ab73f6f4925ca15a69c698aada740841457be (patch)
treecadc430b90b681388e9b3474a82af6f657440253 /src/main
parent55715b8b3fc8705e6eecbf835c8d441d3503fa7d (diff)
keep up with main stream (1.1.3-beta)
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/keuin/blame/data/entry/LogEntry.java2
-rw-r--r--src/main/java/com/keuin/blame/util/MinecraftUtil.java5
-rw-r--r--src/main/java/com/keuin/blame/util/PrintUtil.java18
-rw-r--r--src/main/resources/fabric.mod.json2
4 files changed, 14 insertions, 13 deletions
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 0ffaf94..04f52ca 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": "*"