diff --git a/Spigot-API-Patches/Add-getTPS-method.patch b/Spigot-API-Patches/Add-getTPS-method.patch index 0a671eb08c..9907b78caf 100644 --- a/Spigot-API-Patches/Add-getTPS-method.patch +++ b/Spigot-API-Patches/Add-getTPS-method.patch @@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient { - public void broadcast(net.md_5.bungee.api.chat.BaseComponent... components) { + public void restart() { throw new UnsupportedOperationException("Not supported yet."); } + diff --git a/Spigot-API-Patches/Player-affects-spawning-API.patch b/Spigot-API-Patches/Player-affects-spawning-API.patch index a3ff29b63f..964d582611 100644 --- a/Spigot-API-Patches/Player-affects-spawning-API.patch +++ b/Spigot-API-Patches/Player-affects-spawning-API.patch @@ -37,4 +37,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } Spigot spigot(); --- \ No newline at end of file +-- +1.9.5.msysgit.1 + diff --git a/Spigot-Server-Patches/Add-FallingBlock-source-location-API.patch b/Spigot-Server-Patches/Add-FallingBlock-source-location-API.patch index ab5056730e..4e4afacce7 100644 --- a/Spigot-Server-Patches/Add-FallingBlock-source-location-API.patch +++ b/Spigot-Server-Patches/Add-FallingBlock-source-location-API.patch @@ -140,4 +140,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // PaperSpigot end } --- \ No newline at end of file +-- +1.9.5.msysgit.1 + diff --git a/Spigot-Server-Patches/Add-TNT-source-location-API.patch b/Spigot-Server-Patches/Add-TNT-source-location-API.patch index 2b3670a518..ab7aafc16c 100644 --- a/Spigot-Server-Patches/Add-TNT-source-location-API.patch +++ b/Spigot-Server-Patches/Add-TNT-source-location-API.patch @@ -127,4 +127,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // PaperSpigot end } --- \ No newline at end of file +-- +1.9.5.msysgit.1 + diff --git a/Spigot-Server-Patches/Add-async-chunk-load-API.patch b/Spigot-Server-Patches/Add-async-chunk-load-API.patch index 1357226929..0ae474ae27 100644 --- a/Spigot-Server-Patches/Add-async-chunk-load-API.patch +++ b/Spigot-Server-Patches/Add-async-chunk-load-API.patch @@ -33,4 +33,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public Chunk getChunkAt(int x, int z) { return this.world.chunkProviderServer.getChunkAt(x, z).bukkitChunk; } --- \ No newline at end of file +-- +1.9.5.msysgit.1 + diff --git a/Spigot-Server-Patches/Allow-specified-ItemStacks-to-retain-their-invalid-d.patch b/Spigot-Server-Patches/Allow-specified-ItemStacks-to-retain-their-invalid-d.patch index 381ada0d92..b98d126fca 100644 --- a/Spigot-Server-Patches/Allow-specified-ItemStacks-to-retain-their-invalid-d.patch +++ b/Spigot-Server-Patches/Allow-specified-ItemStacks-to-retain-their-invalid-d.patch @@ -63,4 +63,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + Bukkit.getLogger().info( "Data value allowed items: " + StringUtils.join(dataValueAllowedItems, ", ") ); + } } --- \ No newline at end of file +-- +1.9.5.msysgit.1 + diff --git a/Spigot-Server-Patches/Enderman-drop-the-block-they-re-holding-when-they-di.patch b/Spigot-Server-Patches/Enderman-drop-the-block-they-re-holding-when-they-di.patch index f3e243baba..4269beeaa3 100644 --- a/Spigot-Server-Patches/Enderman-drop-the-block-they-re-holding-when-they-di.patch +++ b/Spigot-Server-Patches/Enderman-drop-the-block-they-re-holding-when-they-di.patch @@ -22,4 +22,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } public void setCarried(IBlockData iblockdata) { --- \ No newline at end of file +-- +1.9.5.msysgit.1 + diff --git a/Spigot-Server-Patches/Fix-jar-being-shaded-multiple-times.patch b/Spigot-Server-Patches/Fix-jar-being-shaded-multiple-times.patch index b9e147197a..9b77fda0b8 100644 --- a/Spigot-Server-Patches/Fix-jar-being-shaded-multiple-times.patch +++ b/Spigot-Server-Patches/Fix-jar-being-shaded-multiple-times.patch @@ -16,4 +16,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 org.bukkit.craftbukkit.Main --- \ No newline at end of file +-- +1.9.5.msysgit.1 + diff --git a/Spigot-Server-Patches/Fix-lag-from-explosions-processing-dead-entities.patch b/Spigot-Server-Patches/Fix-lag-from-explosions-processing-dead-entities.patch index 538f200dd2..3f2e2f1737 100644 --- a/Spigot-Server-Patches/Fix-lag-from-explosions-processing-dead-entities.patch +++ b/Spigot-Server-Patches/Fix-lag-from-explosions-processing-dead-entities.patch @@ -24,4 +24,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 Vec3D vec3d = new Vec3D(this.posX, this.posY, this.posZ); for (int l1 = 0; l1 < list.size(); ++l1) { --- \ No newline at end of file +-- +1.9.5.msysgit.1 + diff --git a/Spigot-Server-Patches/Only-refresh-abilities-if-needed.patch b/Spigot-Server-Patches/Only-refresh-abilities-if-needed.patch index f9a19daca8..3468132629 100644 --- a/Spigot-Server-Patches/Only-refresh-abilities-if-needed.patch +++ b/Spigot-Server-Patches/Only-refresh-abilities-if-needed.patch @@ -23,4 +23,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } @Override --- \ No newline at end of file +-- +1.9.5.msysgit.1 + diff --git a/Spigot-Server-Patches/Player-affects-spawning-API.patch b/Spigot-Server-Patches/Player-affects-spawning-API.patch index fb12448c50..4c9942f655 100644 --- a/Spigot-Server-Patches/Player-affects-spawning-API.patch +++ b/Spigot-Server-Patches/Player-affects-spawning-API.patch @@ -197,4 +197,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 }; public Player.Spigot spigot() --- \ No newline at end of file +-- +1.9.5.msysgit.1 + diff --git a/Spigot-Server-Patches/Player-lookup-improvements.patch b/Spigot-Server-Patches/Player-lookup-improvements.patch deleted file mode 100644 index 4111f0f17e..0000000000 --- a/Spigot-Server-Patches/Player-lookup-improvements.patch +++ /dev/null @@ -1,174 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Sun, 8 Mar 2015 04:03:56 -0500 -Subject: [PATCH] Player lookup improvements - -Minecraft and CraftBukkit both use Arrays to store online players, -and any time a player needs to be looked up by name or UUID, -the system iterates all online players and does a name or UUID comparison. - -This is very ineffecient and can reduce performance on servers with high player count. - -By using a map based approach for player lookups, player lookup should -be consistent in performance regardless of how many players are online. - -diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/PlayerList.java -+++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -0,0 +0,0 @@ public abstract class PlayerList { - private static final SimpleDateFormat g = new SimpleDateFormat("yyyy-MM-dd \'at\' HH:mm:ss z"); - private final MinecraftServer server; - public final List players = new java.util.concurrent.CopyOnWriteArrayList(); // CraftBukkit - ArrayList -> CopyOnWriteArrayList: Iterator safety -+ // PaperSpigot start - Player lookup improvements -+ public final Map playerMap = new java.util.HashMap() { -+ @Override -+ public EntityPlayer put(String key, EntityPlayer value) { -+ return super.put(key.toLowerCase(), value); -+ } -+ -+ @Override -+ public EntityPlayer get(Object key) { -+ // put the .playerConnection check done in other places here -+ EntityPlayer player = super.get(key instanceof String ? ((String) key).toLowerCase() : key); -+ return (player != null && player.playerConnection != null) ? player : null; -+ } -+ -+ @Override -+ public boolean containsKey(Object key) { -+ return get(key) != null; -+ } -+ -+ @Override -+ public EntityPlayer remove(Object key) { -+ return super.remove(key instanceof String ? ((String) key).toLowerCase() : key); -+ } -+ }; -+ // PaperSpigot end - private final Map j = Maps.newHashMap(); - private final GameProfileBanList k; - private final IpBanList l; -@@ -0,0 +0,0 @@ public abstract class PlayerList { - - public void onPlayerJoin(EntityPlayer entityplayer, String joinMessage) { // CraftBukkit added param - this.players.add(entityplayer); -+ this.playerMap.put(entityplayer.getName(), entityplayer); // PaperSpigot - this.j.put(entityplayer.getUniqueID(), entityplayer); - // this.sendAll(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, new EntityPlayer[] { entityplayer})); // CraftBukkit - replaced with loop below - WorldServer worldserver = this.server.getWorldServer(entityplayer.dimension); -@@ -0,0 +0,0 @@ public abstract class PlayerList { - worldserver.kill(entityplayer); - worldserver.getPlayerChunkMap().removePlayer(entityplayer); - this.players.remove(entityplayer); -+ this.playerMap.remove(entityplayer.getName()); // PaperSpigot - UUID uuid = entityplayer.getUniqueID(); - EntityPlayer entityplayer1 = (EntityPlayer) this.j.get(uuid); - -@@ -0,0 +0,0 @@ public abstract class PlayerList { - - EntityPlayer entityplayer; - -+ // PaperSpigot start - Use exact lookup below -+ /* - for (int i = 0; i < this.players.size(); ++i) { - entityplayer = (EntityPlayer) this.players.get(i); - if (entityplayer.getUniqueID().equals(uuid)) { -@@ -0,0 +0,0 @@ public abstract class PlayerList { - - while (iterator.hasNext()) { - entityplayer = (EntityPlayer) iterator.next(); -+ */ -+ if ((entityplayer = this.a(uuid)) != null) { -+ // PaperSpigot end - savePlayerFile(entityplayer); // CraftBukkit - Force the player's inventory to be saved - entityplayer.playerConnection.disconnect("You logged in from another location"); - } -@@ -0,0 +0,0 @@ public abstract class PlayerList { - } - - public EntityPlayer getPlayer(String s) { -+ if (true) { return playerMap.get(s); } // PaperSpigot - Iterator iterator = this.players.iterator(); - - EntityPlayer entityplayer; -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java -+++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java -@@ -0,0 +0,0 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa - } - - public Player getPlayer() { -- for (Object obj : server.getHandle().players) { -- EntityPlayer player = (EntityPlayer) obj; -- if (player.getUniqueID().equals(getUniqueId())) { -- return (player.playerConnection != null) ? player.playerConnection.getPlayer() : null; -- } -- } -- -- return null; -+ // PaperSpigot - Improved player lookup, replace entire method -+ final EntityPlayer playerEntity = server.getHandle().a(getUniqueId()); -+ return playerEntity != null ? playerEntity.getBukkitEntity() : null; -+ // PaperSpigot end - } - - @Override -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java -+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -0,0 +0,0 @@ public final class CraftServer implements Server { - public Player getPlayer(final String name) { - Validate.notNull(name, "Name cannot be null"); - -- Player found = null; -+ // PaperSpigot start - Improved player lookup changes -+ Player found = getPlayerExact(name); -+ if (found != null) { -+ return found; -+ } -+ // PaperSpigot end - String lowerName = name.toLowerCase(); - int delta = Integer.MAX_VALUE; - for (Player player : getOnlinePlayers()) { -@@ -0,0 +0,0 @@ public final class CraftServer implements Server { - public Player getPlayerExact(String name) { - Validate.notNull(name, "Name cannot be null"); - -- String lname = name.toLowerCase(); -- -- for (Player player : getOnlinePlayers()) { -- if (player.getName().equalsIgnoreCase(lname)) { -- return player; -- } -- } -- -- return null; -+ // PaperSpigot start - Improved player lookup, replace whole method -+ EntityPlayer player = playerList.playerMap.get(name); -+ return player != null ? player.getBukkitEntity() : null; -+ // PaperSpigot end - } - - @Override -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - } - - public boolean isOnline() { -- for (Object obj : server.getHandle().players) { -- EntityPlayer player = (EntityPlayer) obj; -- if (player.getName().equalsIgnoreCase(getName())) { -- return true; -- } -- } -- return false; -+ return server.getHandle().a(getUniqueId()) != null; // PaperSpigot - replace whole method - } - - public InetSocketAddress getAddress() { --- \ No newline at end of file diff --git a/Spigot-Server-Patches/Prevent-tile-entity-and-entity-crashes.patch b/Spigot-Server-Patches/Prevent-tile-entity-and-entity-crashes.patch index 0c656539ef..f5a10ac706 100644 --- a/Spigot-Server-Patches/Prevent-tile-entity-and-entity-crashes.patch +++ b/Spigot-Server-Patches/Prevent-tile-entity-and-entity-crashes.patch @@ -63,4 +63,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } // Spigot start finally { --- \ No newline at end of file +-- +1.9.5.msysgit.1 + diff --git a/Spigot-Server-Patches/Show-PaperSpigot-in-client-crashes-server-lists-and-.patch b/Spigot-Server-Patches/Show-PaperSpigot-in-client-crashes-server-lists-and-.patch index e758aedcbc..a274df2058 100644 --- a/Spigot-Server-Patches/Show-PaperSpigot-in-client-crashes-server-lists-and-.patch +++ b/Spigot-Server-Patches/Show-PaperSpigot-in-client-crashes-server-lists-and-.patch @@ -18,4 +18,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } public CrashReport b(CrashReport crashreport) { --- \ No newline at end of file +-- +1.9.5.msysgit.1 + diff --git a/Spigot-Server-Patches/Stackable-Buckets.patch b/Spigot-Server-Patches/Stackable-Buckets.patch index f92f01cd06..fdde7ea119 100644 --- a/Spigot-Server-Patches/Stackable-Buckets.patch +++ b/Spigot-Server-Patches/Stackable-Buckets.patch @@ -169,4 +169,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + } } --- \ No newline at end of file +-- +1.9.5.msysgit.1 +