2020-05-06 09:48:49 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2016-08-12 23:08:53 +00:00
|
|
|
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
|
2021-01-02 04:59:30 +00:00
|
|
|
index d614d6771aa97a544d0397234aa922d1e4c535f4..91f8d4e2f747f980a597bca533af631bbff6d6bd 100644
|
2016-08-12 23:08:53 +00:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
2020-06-26 06:29:44 +00:00
|
|
|
@@ -23,6 +23,7 @@ import org.bukkit.configuration.InvalidConfigurationException;
|
2018-10-19 00:44:59 +00:00
|
|
|
import org.bukkit.configuration.file.YamlConfiguration;
|
|
|
|
import co.aikar.timings.Timings;
|
|
|
|
import co.aikar.timings.TimingsManager;
|
|
|
|
+import org.spigotmc.SpigotConfig;
|
|
|
|
|
|
|
|
public class PaperConfig {
|
|
|
|
|
2021-01-02 04:59:30 +00:00
|
|
|
@@ -237,4 +238,13 @@ public class PaperConfig {
|
2016-08-12 23:08:53 +00:00
|
|
|
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);
|
2018-10-19 00:44:59 +00:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static boolean isProxyOnlineMode() {
|
|
|
|
+ return Bukkit.getOnlineMode() || (SpigotConfig.bungee && bungeeOnlineMode);
|
2016-08-12 23:08:53 +00:00
|
|
|
+ }
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
|
2020-06-25 11:00:35 +00:00
|
|
|
index 060887d765604e4be82913607bb6266a278f5db6..c5957c2d6c54b076ebe7f9a432e30551d2b6febc 100644
|
2016-08-12 23:08:53 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
|
2020-06-25 11:00:35 +00:00
|
|
|
@@ -56,7 +56,8 @@ public class NameReferencingFileConverter {
|
2018-07-16 20:08:09 +00:00
|
|
|
return new String[i];
|
|
|
|
});
|
2016-08-12 23:08:53 +00:00
|
|
|
|
|
|
|
- if (minecraftserver.getOnlineMode() || org.spigotmc.SpigotConfig.bungee) { // Spigot: bungee = online mode, for now.
|
|
|
|
+ if (minecraftserver.getOnlineMode()
|
2018-10-19 00:44:59 +00:00
|
|
|
+ || (com.destroystokyo.paper.PaperConfig.isProxyOnlineMode())) { // Spigot: bungee = online mode, for now. // Paper - Handle via setting
|
2016-08-12 23:08:53 +00:00
|
|
|
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
|
2021-02-21 20:55:01 +00:00
|
|
|
index 83ab502d80bbb97204a6f0e4474d1a3b96218448..7a1a24c71999462aa4f8aebd78914d9bf243f5c9 100644
|
2016-08-12 23:08:53 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
2021-02-21 20:55:01 +00:00
|
|
|
@@ -1507,7 +1507,8 @@ public final class CraftServer implements Server {
|
2016-08-12 23:08:53 +00:00
|
|
|
// Spigot Start
|
|
|
|
GameProfile profile = null;
|
|
|
|
// Only fetch an online UUID in online mode
|
2019-04-27 06:26:04 +00:00
|
|
|
- if ( getOnlineMode() || org.spigotmc.SpigotConfig.bungee )
|
|
|
|
+ if ( getOnlineMode()
|
|
|
|
+ || com.destroystokyo.paper.PaperConfig.isProxyOnlineMode() ) // Paper - Handle via setting
|
2016-08-12 23:08:53 +00:00
|
|
|
{
|
|
|
|
profile = console.getUserCache().getProfile( name );
|
|
|
|
}
|