Paper/Spigot-Server-Patches/0107-Add-setting-for-proxy-online-mode-status.patch
2021-01-02 04:59:30 +00:00

61 lines
3.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Gabriele C <sgdc3.mail@gmail.com>
Date: Fri, 5 Aug 2016 01:03:08 +0200
Subject: [PATCH] Add setting for proxy online mode status
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index d614d6771aa97a544d0397234aa922d1e4c535f4..91f8d4e2f747f980a597bca533af631bbff6d6bd 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -23,6 +23,7 @@ import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.YamlConfiguration;
import co.aikar.timings.Timings;
import co.aikar.timings.TimingsManager;
+import org.spigotmc.SpigotConfig;
public class PaperConfig {
@@ -237,4 +238,13 @@ public class PaperConfig {
private static void saveEmptyScoreboardTeams() {
saveEmptyScoreboardTeams = getBoolean("settings.save-empty-scoreboard-teams", false);
}
+
+ public static boolean bungeeOnlineMode = true;
+ private static void bungeeOnlineMode() {
+ bungeeOnlineMode = getBoolean("settings.bungee-online-mode", true);
+ }
+
+ public static boolean isProxyOnlineMode() {
+ return Bukkit.getOnlineMode() || (SpigotConfig.bungee && bungeeOnlineMode);
+ }
}
diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
index 060887d765604e4be82913607bb6266a278f5db6..c5957c2d6c54b076ebe7f9a432e30551d2b6febc 100644
--- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
+++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
@@ -56,7 +56,8 @@ public class NameReferencingFileConverter {
return new String[i];
});
- if (minecraftserver.getOnlineMode() || org.spigotmc.SpigotConfig.bungee) { // Spigot: bungee = online mode, for now.
+ if (minecraftserver.getOnlineMode()
+ || (com.destroystokyo.paper.PaperConfig.isProxyOnlineMode())) { // Spigot: bungee = online mode, for now. // Paper - Handle via setting
minecraftserver.getGameProfileRepository().findProfilesByNames(astring, Agent.MINECRAFT, profilelookupcallback);
} else {
String[] astring1 = astring;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 7779b0784c62cf74ea3ea0865f76ea70ccaf35d8..f2e641c80323b041241956c29590478ff2cf18ef 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1489,7 +1489,8 @@ public final class CraftServer implements Server {
// Spigot Start
GameProfile profile = null;
// Only fetch an online UUID in online mode
- if ( getOnlineMode() || org.spigotmc.SpigotConfig.bungee )
+ if ( getOnlineMode()
+ || com.destroystokyo.paper.PaperConfig.isProxyOnlineMode() ) // Paper - Handle via setting
{
profile = console.getUserCache().getProfile( name );
}