2020-05-06 11:48:49 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2016-08-13 01:08:53 +02: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
|
2020-05-06 11:48:49 +02:00
|
|
|
index 67f35fe66b33a4b461a310b6ce4fdedb5eaf1ac4..53f96a1576582fce83999a1f7e9a2624506ed51f 100644
|
2016-08-13 01:08:53 +02:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
2018-10-19 02:44:59 +02:00
|
|
|
@@ -22,6 +22,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 {
|
|
|
|
|
2019-05-06 09:20:16 +02:00
|
|
|
@@ -233,4 +234,13 @@ public class PaperConfig {
|
2016-08-13 01:08:53 +02: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 02:44:59 +02:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static boolean isProxyOnlineMode() {
|
|
|
|
+ return Bukkit.getOnlineMode() || (SpigotConfig.bungee && bungeeOnlineMode);
|
2016-08-13 01:08:53 +02:00
|
|
|
+ }
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
|
2020-05-06 11:48:49 +02:00
|
|
|
index 1422503e11ac632c7b94640d59d9aaa0c5cb2f8f..d3c2e1bedfde39c19fe293941036641ea72c1bcd 100644
|
2016-08-13 01:08:53 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
|
2019-01-01 04:15:55 +01:00
|
|
|
@@ -58,7 +58,8 @@ public class NameReferencingFileConverter {
|
2018-07-16 22:08:09 +02:00
|
|
|
return new String[i];
|
|
|
|
});
|
2016-08-13 01:08:53 +02:00
|
|
|
|
|
|
|
- if (minecraftserver.getOnlineMode() || org.spigotmc.SpigotConfig.bungee) { // Spigot: bungee = online mode, for now.
|
|
|
|
+ if (minecraftserver.getOnlineMode()
|
2018-10-19 02:44:59 +02:00
|
|
|
+ || (com.destroystokyo.paper.PaperConfig.isProxyOnlineMode())) { // Spigot: bungee = online mode, for now. // Paper - Handle via setting
|
2016-08-13 01:08:53 +02: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
|
2020-05-06 11:48:49 +02:00
|
|
|
index ddb16ca8b69adc6d7e7efda7a7fb906234c19cb4..a27783dcf3f7575b8527aefc60a15621520cbf19 100644
|
2016-08-13 01:08:53 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
2020-03-10 12:01:15 +01:00
|
|
|
@@ -1399,7 +1399,8 @@ public final class CraftServer implements Server {
|
2016-08-13 01:08:53 +02:00
|
|
|
// Spigot Start
|
|
|
|
GameProfile profile = null;
|
|
|
|
// Only fetch an online UUID in online mode
|
2019-04-27 08:26:04 +02:00
|
|
|
- if ( getOnlineMode() || org.spigotmc.SpigotConfig.bungee )
|
|
|
|
+ if ( getOnlineMode()
|
|
|
|
+ || com.destroystokyo.paper.PaperConfig.isProxyOnlineMode() ) // Paper - Handle via setting
|
2016-08-13 01:08:53 +02:00
|
|
|
{
|
|
|
|
profile = console.getUserCache().getProfile( name );
|
|
|
|
}
|