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-02-26 17:54:48 +00:00
|
|
|
index 1b8e5671c9dc8c15ce33d351c1bb20f28919b9a2..c52dc0346f93527965ef29a0ccdc4bf3debe302e 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-02-26 17:54:48 +00:00
|
|
|
@@ -242,4 +243,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
|
|
|
+ }
|
|
|
|
}
|
2021-03-16 07:19:45 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/players/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/players/NameReferencingFileConverter.java
|
|
|
|
index 8a343a857dc4661ba256e39cf391dd2c7a1cc970..8c1f328ca1ba12ed63ec7bd7efad54ff633ba802 100644
|
|
|
|
--- a/src/main/java/net/minecraft/server/players/NameReferencingFileConverter.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/players/NameReferencingFileConverter.java
|
|
|
|
@@ -66,7 +66,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;
|
2021-05-05 02:54:42 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/players/UserCache.java b/src/main/java/net/minecraft/server/players/UserCache.java
|
|
|
|
index 4ad084e7cea3b341ca0dbaa6e853cfc685a555ff..b9f94f957dd5372c8b02d785204690e4ade36a98 100644
|
|
|
|
--- a/src/main/java/net/minecraft/server/players/UserCache.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/players/UserCache.java
|
|
|
|
@@ -89,6 +89,7 @@ public class UserCache {
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
+ if (com.destroystokyo.paper.PaperConfig.isProxyOnlineMode()) // Paper - only run in online mode - 100 COL
|
|
|
|
gameprofilerepository.findProfilesByNames(new String[]{s}, Agent.MINECRAFT, profilelookupcallback);
|
|
|
|
GameProfile gameprofile = (GameProfile) atomicreference.get();
|
|
|
|
|
|
|
|
@@ -106,7 +107,7 @@ public class UserCache {
|
|
|
|
}
|
|
|
|
|
|
|
|
private static boolean c() {
|
|
|
|
- return UserCache.b;
|
|
|
|
+ return com.destroystokyo.paper.PaperConfig.isProxyOnlineMode(); // Paper
|
|
|
|
}
|
|
|
|
|
|
|
|
public synchronized void a(GameProfile gameprofile) { // Paper - synchronize
|
2016-08-12 23:08:53 +00:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
2021-05-12 08:07:08 +00:00
|
|
|
index a084beced6647d6815e9bd728b2107c03998777c..f6d4e8d008b85bcf52cfeceb6b40fe9d1a2b557b 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-05-12 08:07:08 +00:00
|
|
|
@@ -1515,7 +1515,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 );
|
|
|
|
}
|