Paper/Spigot-Server-Patches/0115-Add-setting-for-proxy-online-mode-status.patch
Shane Freeder 276afaa2ea
Updated Upstream (Bukkit/CraftBukkit/Spigot)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
c2d72c82 SPIGOT-3102: Add EXPLOSION SpawnReason

CraftBukkit Changes:
fca41573 SPIGOT-5136: EntityPortalEvent getting called on interdimensional entity teleports
604c8bf0 SPIGOT-3102: Add EXPLOSION SpawnReason
375969a6 Re-add chunk GC for plugin chunk loads
58151368 SPIGOT-5123: Snapshot tile entities can end up with a non-null world
491c8482 SPIGOT-5130: PersistentDataContainer not removing values on TileEntities

Spigot Changes:
d05d3c1f Rebuild patches
2019-07-05 03:13:38 +01:00

64 lines
3.0 KiB
Diff

From c837896c267faa0566bbc967676a54323933f5a9 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 cbfe12734d..1daa2e4535 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -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 {
@@ -233,4 +234,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 21a8ed3231..0794aff5b7 100644
--- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
+++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
@@ -58,7 +58,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 5d50baa038..5a77ee9f71 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1357,7 +1357,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 );
}
--
2.22.0