44 lines
2.4 KiB
Diff
44 lines
2.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Simon Gardling <titaniumtown@gmail.com>
|
|
Date: Wed, 20 Jan 2021 16:36:48 -0500
|
|
Subject: [PATCH] Add config for logging login location
|
|
|
|
Original code by YatopiaMC, licensed under MIT
|
|
You can find the original code on https://github.com/YatopiaMC/Yatopia
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
index 0406c3e9a3ca06ba2a8cc47bf9f4b6fa293814d7..b2d98d5d6c5f99eff975a200e78ef6af69ccfe1a 100644
|
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
@@ -500,7 +500,13 @@ public abstract class PlayerList {
|
|
}
|
|
// Paper end
|
|
// CraftBukkit - Moved from above, added world
|
|
- PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", player.getName().getString(), s1, player.getId(), worldserver1.serverLevelData.getLevelName(), player.getX(), player.getY(), player.getZ());
|
|
+ // Yatopia start - configurable logging of player login location
|
|
+ if (wtf.etil.mirai.MiraiConfig.logPlayerLoginLoc) {
|
|
+ PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", player.getName().getString(), s1, player.getId(), worldserver1.serverLevelData.getLevelName(), player.getX(), player.getY(), player.getZ());
|
|
+ } else {
|
|
+ PlayerList.LOGGER.info("{}[{}] logged in with entity id {}", player.getName().getString(), s1, player.getId());
|
|
+ }
|
|
+ // Yatopia end - configurable logging of player login location
|
|
}
|
|
|
|
public void updateEntireScoreboard(ServerScoreboard scoreboard, ServerPlayer player) {
|
|
diff --git a/src/main/java/wtf/etil/mirai/MiraiConfig.java b/src/main/java/wtf/etil/mirai/MiraiConfig.java
|
|
index 860f244e229b18701f4719b5ece7a00f377868a7..c7d4aa9065a49120ed74fab4bddd6f0c08275f21 100644
|
|
--- a/src/main/java/wtf/etil/mirai/MiraiConfig.java
|
|
+++ b/src/main/java/wtf/etil/mirai/MiraiConfig.java
|
|
@@ -131,4 +131,10 @@ public class MiraiConfig {
|
|
return config.getStringList(key);
|
|
}
|
|
|
|
+ public static boolean logPlayerLoginLoc;
|
|
+ private static void logPlayerLoc() {
|
|
+ logPlayerLoginLoc = getBoolean("log-player-login-location", true,
|
|
+ "Whether or not player login location should be written in logs.");
|
|
+ }
|
|
+
|
|
}
|
|
\ No newline at end of file
|