diff options
author | Zach Brown <[email protected]> | 2017-04-29 05:27:31 -0500 |
---|---|---|
committer | Zach Brown <[email protected]> | 2017-04-29 05:27:31 -0500 |
commit | 974b0afca91844fed61c5fda9293bbcd88752c2f (patch) | |
tree | d3a7b65e14f34b7cc8928efaf6403f67eaaaf708 /Spigot-Server-Patches/0082-Support-offline-mode-in-whitelist-command-as-well.patch | |
parent | 8b2122a291e3ea68f0e1516209914ef43a2d55e9 (diff) | |
download | Paper-974b0afca91844fed61c5fda9293bbcd88752c2f.tar.gz Paper-974b0afca91844fed61c5fda9293bbcd88752c2f.zip |
Remove last bit of chunk exists region file fix
CraftBukkit removed their implementation that caused this issue,
switching to Mojang's implementation which doesn't appear to share it. I
already removed the important bit in the last upstream merge, this is
just unused and unnecessary now. So we remove it.
Diffstat (limited to 'Spigot-Server-Patches/0082-Support-offline-mode-in-whitelist-command-as-well.patch')
-rw-r--r-- | Spigot-Server-Patches/0082-Support-offline-mode-in-whitelist-command-as-well.patch | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/Spigot-Server-Patches/0082-Support-offline-mode-in-whitelist-command-as-well.patch b/Spigot-Server-Patches/0082-Support-offline-mode-in-whitelist-command-as-well.patch new file mode 100644 index 0000000000..4db1720329 --- /dev/null +++ b/Spigot-Server-Patches/0082-Support-offline-mode-in-whitelist-command-as-well.patch @@ -0,0 +1,93 @@ +From 08efbaa590f1d22457b23dac04cc88535f84da74 Mon Sep 17 00:00:00 2001 +From: Zach Brown <[email protected]> +Date: Mon, 21 Mar 2016 00:19:18 -0500 +Subject: [PATCH] Support offline mode in whitelist command as well + + +diff --git a/src/main/java/net/minecraft/server/CommandWhitelist.java b/src/main/java/net/minecraft/server/CommandWhitelist.java +index c74d1d2be..0f4237db1 100644 +--- a/src/main/java/net/minecraft/server/CommandWhitelist.java ++++ b/src/main/java/net/minecraft/server/CommandWhitelist.java +@@ -44,24 +44,35 @@ public class CommandWhitelist extends CommandAbstract { + throw new ExceptionUsage("commands.whitelist.add.usage", new Object[0]); + } + ++ // Paper start - Handle offline mode as well ++ /* + gameprofile = minecraftserver.getUserCache().getProfile(astring[1]); + if (gameprofile == null) { + throw new CommandException("commands.whitelist.add.failed", new Object[] { astring[1]}); + } + + minecraftserver.getPlayerList().addWhitelist(gameprofile); ++ */ ++ this.whitelist(minecraftserver, astring[1], true); ++ // Paper end + a(icommandlistener, (ICommand) this, "commands.whitelist.add.success", new Object[] { astring[1]}); + } else if ("remove".equals(astring[0])) { + if (astring.length < 2) { + throw new ExceptionUsage("commands.whitelist.remove.usage", new Object[0]); + } + ++ // Paper start - Handle offline mode as well ++ /* + gameprofile = minecraftserver.getPlayerList().getWhitelist().a(astring[1]); + if (gameprofile == null) { + throw new CommandException("commands.whitelist.remove.failed", new Object[] { astring[1]}); + } + + minecraftserver.getPlayerList().removeWhitelist(gameprofile); ++ ++ */ ++ this.whitelist(minecraftserver, astring[1], false); ++ // Paper end + a(icommandlistener, (ICommand) this, "commands.whitelist.remove.success", new Object[] { astring[1]}); + } else if ("reload".equals(astring[0])) { + minecraftserver.getPlayerList().reloadWhitelist(); +@@ -89,4 +100,43 @@ public class CommandWhitelist extends CommandAbstract { + return Collections.emptyList(); + } + } ++ ++ // Paper start ++ /** ++ * Adds or removes a player from the game whitelist ++ * ++ * @param mcserver running instance of MinecraftServer ++ * @param playerName the player we're going to be whitelisting ++ * @param add whether we're adding or removing from the whitelist ++ */ ++ private void whitelist(MinecraftServer mcserver, String playerName, boolean add) throws CommandException { ++ if (mcserver.getOnlineMode()) { ++ // The reason we essentially copy/pasta NMS code here is because the NMS online-only version ++ // is capable of providing feedback to the person running the command based on whether or ++ // not the player is a real online-mode account ++ GameProfile gameprofile = mcserver.getUserCache().getProfile(playerName); ++ if (gameprofile == null) { ++ if (add) { ++ throw new CommandException("commands.whitelist.add.failed", new Object[] { playerName}); ++ } else { ++ throw new CommandException("commands.whitelist.remove.failed", new Object[] { playerName}); ++ } ++ } ++ ++ if (add) { ++ mcserver.getPlayerList().addWhitelist(gameprofile); ++ } else { ++ mcserver.getPlayerList().removeWhitelist(gameprofile); ++ } ++ } else { ++ // versus our offline version, which will always report success all of the time ++ org.bukkit.OfflinePlayer offlinePlayer = org.bukkit.Bukkit.getOfflinePlayer(playerName); ++ if (add) { ++ offlinePlayer.setWhitelisted(true); ++ } else { ++ offlinePlayer.setWhitelisted(false); ++ } ++ } ++ } ++ // Paper end + } +-- +2.12.2.windows.2 + |