summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin
diff options
context:
space:
mode:
authorKeuin <[email protected]>2020-12-24 21:59:23 +0800
committerKeuin <[email protected]>2020-12-25 15:18:50 +0800
commit01445b4c92eef7bd2c32f65189eed2f00d4b4767 (patch)
tree50eb03801e854c400f96d6c57b86def9889016f7 /src/main/java/com/keuin
parentf11cb5937d6c6adb8ad4079592d26a718716b646 (diff)
keep up with main stream (1.1.3-beta)
Diffstat (limited to 'src/main/java/com/keuin')
-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
3 files changed, 13 insertions, 12 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 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
);
}
}