From 22e2858feeabdc4d6530ce753303f88d435e3aea Mon Sep 17 00:00:00 2001 From: Zach Brown <1254957+zachbr@users.noreply.github.com> Date: Sat, 22 Apr 2017 01:16:45 -0500 Subject: [PATCH] Update bStats implementation --- .../Add-PlayerInitialSpawnEvent.patch | 2 +- ...-option-to-remove-invalid-statistics.patch | 2 +- ...setting-for-proxy-online-mode-status.patch | 4 +- .../Add-velocity-warnings.patch | 2 +- .../Allow-Reloading-of-Command-Aliases.patch | 2 +- ...llow-Reloading-of-Custom-Permissions.patch | 2 +- .../Auto-Save-Improvements.patch | 16 +- ...heck-async-remove-unused-vars-GH-159.patch | 2 +- .../Chunk-save-queue-improvements.patch | 2 +- ...figurable-Chunk-IO-Thread-Base-Count.patch | 2 +- ...le-Keep-Spawn-Loaded-range-per-world.patch | 4 +- .../Configurable-Player-Collision.patch | 10 +- .../Configurable-flying-kick-messages.patch | 2 +- ...onfigurable-packet-in-spam-threshold.patch | 2 +- ...ading-permissions.yml-before-plugins.patch | 4 +- ...y-scoreboard-teams-to-scoreboard.dat.patch | 2 +- .../Enforce-Sync-Player-Saves.patch | 2 +- .../Expose-server-CommandMap.patch | 2 +- ...Fix-Bugs-with-Spigot-Mob-Spawn-Logic.patch | 2 +- ...x-inter-world-teleportation-glitches.patch | 2 +- ...dDebugInfo-not-initialized-on-client.patch | 2 +- .../Further-improve-server-tick-loop.patch | 6 +- Spigot-Server-Patches/Lighting-Queue.patch | 2 +- Spigot-Server-Patches/Metrics.patch | 20 - .../Optimize-Network-Queue.patch | 2 +- .../Optimize-UserCache-Thread-Safe.patch | 2 +- .../Optimize-explosions.patch | 2 +- Spigot-Server-Patches/Paper-Metrics.patch | 803 +++++------------- .../Player-Tab-List-and-Title-APIs.patch | 2 +- .../Remove-Metadata-on-reload.patch | 2 +- ...egionFileCache-and-make-configurable.patch | 2 +- .../Set-health-before-death-event.patch | 2 +- .../String-based-Action-Bar-API.patch | 2 +- Spigot-Server-Patches/Timings-v2.patch | 60 +- ...nd-for-setting-passengers-on-players.patch | 2 +- ...-possibility-for-getServer-singleton.patch | 2 +- 36 files changed, 289 insertions(+), 692 deletions(-) delete mode 100644 Spigot-Server-Patches/Metrics.patch diff --git a/Spigot-Server-Patches/Add-PlayerInitialSpawnEvent.patch b/Spigot-Server-Patches/Add-PlayerInitialSpawnEvent.patch index 8452840819..5ec07f1c22 100644 --- a/Spigot-Server-Patches/Add-PlayerInitialSpawnEvent.patch +++ b/Spigot-Server-Patches/Add-PlayerInitialSpawnEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add PlayerInitialSpawnEvent For modifying a player's initial spawn location as they join the server diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 676cc3f3e..4e35e9102 100644 +index d778eafb3..d6a2bbc08 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 { diff --git a/Spigot-Server-Patches/Add-option-to-remove-invalid-statistics.patch b/Spigot-Server-Patches/Add-option-to-remove-invalid-statistics.patch index 045e1d3a88..84e8b9b828 100644 --- a/Spigot-Server-Patches/Add-option-to-remove-invalid-statistics.patch +++ b/Spigot-Server-Patches/Add-option-to-remove-invalid-statistics.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add option to remove invalid statistics diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index ae69751c3..687c9d5ad 100644 +index 009bf0c8b..a901cd85c 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -0,0 +0,0 @@ public class PaperConfig { diff --git a/Spigot-Server-Patches/Add-setting-for-proxy-online-mode-status.patch b/Spigot-Server-Patches/Add-setting-for-proxy-online-mode-status.patch index cf84f95eb5..48d6a6395c 100644 --- a/Spigot-Server-Patches/Add-setting-for-proxy-online-mode-status.patch +++ b/Spigot-Server-Patches/Add-setting-for-proxy-online-mode-status.patch @@ -5,7 +5,7 @@ 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 5fbaa99e9..d1d50f0db 100644 +index e009e5cf2..276185d9a 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -0,0 +0,0 @@ public class PaperConfig { @@ -33,7 +33,7 @@ index 2ff8a6da0..52e736080 100644 } 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 8cb8cbe2d..1bbce7a78 100644 +index a958ce998..8ade16865 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 { diff --git a/Spigot-Server-Patches/Add-velocity-warnings.patch b/Spigot-Server-Patches/Add-velocity-warnings.patch index c3d8a074a5..9f53b367cc 100644 --- a/Spigot-Server-Patches/Add-velocity-warnings.patch +++ b/Spigot-Server-Patches/Add-velocity-warnings.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add velocity warnings diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 03bc0171b..c61752bc3 100644 +index cab671d68..28da39cbd 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 { diff --git a/Spigot-Server-Patches/Allow-Reloading-of-Command-Aliases.patch b/Spigot-Server-Patches/Allow-Reloading-of-Command-Aliases.patch index dd0054c9a1..83dfab8f18 100644 --- a/Spigot-Server-Patches/Allow-Reloading-of-Command-Aliases.patch +++ b/Spigot-Server-Patches/Allow-Reloading-of-Command-Aliases.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Allow Reloading of Command Aliases Reload the aliases stored in commands.yml diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 8ade1686..326196ce 100644 +index 8ade16865..326196ce4 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 { diff --git a/Spigot-Server-Patches/Allow-Reloading-of-Custom-Permissions.patch b/Spigot-Server-Patches/Allow-Reloading-of-Custom-Permissions.patch index 3174a4c62d..94b2e80302 100644 --- a/Spigot-Server-Patches/Allow-Reloading-of-Custom-Permissions.patch +++ b/Spigot-Server-Patches/Allow-Reloading-of-Custom-Permissions.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Allow Reloading of Custom Permissions https://github.com/PaperMC/Paper/issues/49 diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 9df6c0eb..e77307c3 100644 +index 9df6c0ebb..e77307c35 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 { diff --git a/Spigot-Server-Patches/Auto-Save-Improvements.patch b/Spigot-Server-Patches/Auto-Save-Improvements.patch index 1f31760464..905f20db62 100644 --- a/Spigot-Server-Patches/Auto-Save-Improvements.patch +++ b/Spigot-Server-Patches/Auto-Save-Improvements.patch @@ -12,7 +12,7 @@ Re-introduce a cap per tick for auto save (Spigot disabled the vanilla cap) and Adds incremental player auto saving too diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 468095a4..ae69751c 100644 +index f86729724..009bf0c8b 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -0,0 +0,0 @@ public class PaperConfig { @@ -26,7 +26,7 @@ index 468095a4..ae69751c 100644 + } } diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index dc96bd7f..bcf24cb4 100644 +index dc96bd7f4..bcf24cb49 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ package com.destroystokyo.paper; @@ -58,7 +58,7 @@ index dc96bd7f..bcf24cb4 100644 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 88437d77..9f7f32dc 100644 +index 88437d77a..9f7f32dc2 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk { @@ -76,7 +76,7 @@ index 88437d77..9f7f32dc 100644 public Random a(long i) { diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 0a8e09e5..ad668be6 100644 +index 0a8e09e5e..ad668be62 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -0,0 +0,0 @@ @@ -96,7 +96,7 @@ index 0a8e09e5..ad668be6 100644 } } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index acda1843..171ed25c 100644 +index acda1843d..171ed25c3 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -108,7 +108,7 @@ index acda1843..171ed25c 100644 public final MinecraftServer server; public final PlayerInteractManager playerInteractManager; diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 2349c3ad..8134501c 100644 +index 2349c3ade..8134501c7 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs @@ -155,7 +155,7 @@ index 2349c3ad..8134501c 100644 this.methodProfiler.a("tallying"); // Spigot start diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 50a3dfe4..185b5929 100644 +index 50a3dfe44..185b5929f 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 { @@ -192,7 +192,7 @@ index 50a3dfe4..185b5929 100644 public void addWhitelist(GameProfile gameprofile) { this.whitelist.add(new WhiteListEntry(gameprofile)); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index f969d2a7..cc0e8d2c 100644 +index f969d2a72..cc0e8d2c8 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { diff --git a/Spigot-Server-Patches/Check-async-remove-unused-vars-GH-159.patch b/Spigot-Server-Patches/Check-async-remove-unused-vars-GH-159.patch index 58fe156655..49dc24d68d 100644 --- a/Spigot-Server-Patches/Check-async-remove-unused-vars-GH-159.patch +++ b/Spigot-Server-Patches/Check-async-remove-unused-vars-GH-159.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Check async, remove unused vars, GH-159 diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index 29219ec7b..c95fb7f30 100644 +index c79fb7d57..8749a1879 100644 --- a/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java @@ -0,0 +0,0 @@ public final class SpawnerCreature { diff --git a/Spigot-Server-Patches/Chunk-save-queue-improvements.patch b/Spigot-Server-Patches/Chunk-save-queue-improvements.patch index 30ca2c2c72..c2c0711380 100644 --- a/Spigot-Server-Patches/Chunk-save-queue-improvements.patch +++ b/Spigot-Server-Patches/Chunk-save-queue-improvements.patch @@ -26,7 +26,7 @@ Then finally, Sleeping will by default be removed, but due to known issues with But if sleeps are to remain enabled, we at least lower the sleep interval so it doesn't have as much negative impact. diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 8c8bc4c86..b2fa32e41 100644 +index 9a6f87e59..873ffa77d 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -0,0 +0,0 @@ public class PaperConfig { diff --git a/Spigot-Server-Patches/Configurable-Chunk-IO-Thread-Base-Count.patch b/Spigot-Server-Patches/Configurable-Chunk-IO-Thread-Base-Count.patch index 992b97cbe3..3ebd09e004 100644 --- a/Spigot-Server-Patches/Configurable-Chunk-IO-Thread-Base-Count.patch +++ b/Spigot-Server-Patches/Configurable-Chunk-IO-Thread-Base-Count.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Configurable Chunk IO Thread Base Count diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 1ea799d59..8c8bc4c86 100644 +index 007589314..9a6f87e59 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -0,0 +0,0 @@ public class PaperConfig { diff --git a/Spigot-Server-Patches/Configurable-Keep-Spawn-Loaded-range-per-world.patch b/Spigot-Server-Patches/Configurable-Keep-Spawn-Loaded-range-per-world.patch index 93d701e1aa..10c87e461f 100644 --- a/Spigot-Server-Patches/Configurable-Keep-Spawn-Loaded-range-per-world.patch +++ b/Spigot-Server-Patches/Configurable-Keep-Spawn-Loaded-range-per-world.patch @@ -21,7 +21,7 @@ index 74a49a5fb..3a942c763 100644 + } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 3b67ff52e..33d23f4b2 100644 +index e7c63a953..3aea41f76 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs @@ -54,7 +54,7 @@ index 7e6459654..dba3fb167 100644 public void a(Packet<?> packet) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 540d57855..8cb8cbe2d 100644 +index 4d761d32a..a958ce998 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 { diff --git a/Spigot-Server-Patches/Configurable-Player-Collision.patch b/Spigot-Server-Patches/Configurable-Player-Collision.patch index 0ddcc03f69..2006eb4882 100644 --- a/Spigot-Server-Patches/Configurable-Player-Collision.patch +++ b/Spigot-Server-Patches/Configurable-Player-Collision.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Configurable Player Collision diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 6b694705..ee884ba5 100644 +index c3ff47e00..710c432d8 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -0,0 +0,0 @@ public class PaperConfig { @@ -19,7 +19,7 @@ index 6b694705..ee884ba5 100644 + } } diff --git a/src/main/java/net/minecraft/server/CommandScoreboard.java b/src/main/java/net/minecraft/server/CommandScoreboard.java -index ab9aa132..f9f59e55 100644 +index ab9aa132a..f9f59e559 100644 --- a/src/main/java/net/minecraft/server/CommandScoreboard.java +++ b/src/main/java/net/minecraft/server/CommandScoreboard.java @@ -0,0 +0,0 @@ public class CommandScoreboard extends CommandAbstract { @@ -37,7 +37,7 @@ index ab9aa132..f9f59e55 100644 } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 3aea41f7..430168d2 100644 +index 3aea41f76..430168d21 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs @@ -62,7 +62,7 @@ index 3aea41f7..430168d2 100644 protected void l() { diff --git a/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java -index d8ec5045..eb45d3cf 100644 +index d8ec50455..eb45d3cf2 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java @@ -0,0 +0,0 @@ public class PacketPlayOutScoreboardTeam implements Packet<PacketListenerPlayOut @@ -75,7 +75,7 @@ index d8ec5045..eb45d3cf 100644 } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index b8d48b45..50a3dfe4 100644 +index b8d48b45c..50a3dfe44 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 { diff --git a/Spigot-Server-Patches/Configurable-flying-kick-messages.patch b/Spigot-Server-Patches/Configurable-flying-kick-messages.patch index 3b1bcc9868..64ae1c22a0 100644 --- a/Spigot-Server-Patches/Configurable-flying-kick-messages.patch +++ b/Spigot-Server-Patches/Configurable-flying-kick-messages.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Configurable flying kick messages diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 2f17b9013..468095a44 100644 +index bb4114b8d..f86729724 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -0,0 +0,0 @@ public class PaperConfig { diff --git a/Spigot-Server-Patches/Configurable-packet-in-spam-threshold.patch b/Spigot-Server-Patches/Configurable-packet-in-spam-threshold.patch index 6742f5e86c..385e9da4f2 100644 --- a/Spigot-Server-Patches/Configurable-packet-in-spam-threshold.patch +++ b/Spigot-Server-Patches/Configurable-packet-in-spam-threshold.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Configurable packet in spam threshold diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index d1d50f0db..2f17b9013 100644 +index 276185d9a..bb4114b8d 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -0,0 +0,0 @@ public class PaperConfig { diff --git a/Spigot-Server-Patches/Default-loading-permissions.yml-before-plugins.patch b/Spigot-Server-Patches/Default-loading-permissions.yml-before-plugins.patch index 95657ae46a..434b71035d 100644 --- a/Spigot-Server-Patches/Default-loading-permissions.yml-before-plugins.patch +++ b/Spigot-Server-Patches/Default-loading-permissions.yml-before-plugins.patch @@ -16,7 +16,7 @@ modify that. Under the previous logic, plugins were unable (cleanly) override pe A config option has been added for those who depend on the previous behavior, but I don't expect that. diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index b2fa32e41..078e0d989 100644 +index 873ffa77d..b5ff26c71 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -0,0 +0,0 @@ public class PaperConfig { @@ -30,7 +30,7 @@ index b2fa32e41..078e0d989 100644 + } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index c61752bc3..e2afd9d93 100644 +index 28da39cbd..9df6c0ebb 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 { diff --git a/Spigot-Server-Patches/Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch b/Spigot-Server-Patches/Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch index 1443fedc35..522d3ea90a 100644 --- a/Spigot-Server-Patches/Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch +++ b/Spigot-Server-Patches/Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Don't save empty scoreboard teams to scoreboard.dat diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index ee884ba57..5fbaa99e9 100644 +index 710c432d8..e009e5cf2 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -0,0 +0,0 @@ public class PaperConfig { diff --git a/Spigot-Server-Patches/Enforce-Sync-Player-Saves.patch b/Spigot-Server-Patches/Enforce-Sync-Player-Saves.patch index 87b9de772a..b8fc0d01dc 100644 --- a/Spigot-Server-Patches/Enforce-Sync-Player-Saves.patch +++ b/Spigot-Server-Patches/Enforce-Sync-Player-Saves.patch @@ -7,7 +7,7 @@ Saving players async is extremely dangerous. This will force it to main the same way we handle async chunk loads. diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 185b5929..91a45a75 100644 +index 185b5929f..91a45a755 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 { diff --git a/Spigot-Server-Patches/Expose-server-CommandMap.patch b/Spigot-Server-Patches/Expose-server-CommandMap.patch index e1814437ac..7a6faeba90 100644 --- a/Spigot-Server-Patches/Expose-server-CommandMap.patch +++ b/Spigot-Server-Patches/Expose-server-CommandMap.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Expose server CommandMap diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index a795a165a..03bc0171b 100644 +index 5302bb283..cab671d68 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 { diff --git a/Spigot-Server-Patches/Fix-Bugs-with-Spigot-Mob-Spawn-Logic.patch b/Spigot-Server-Patches/Fix-Bugs-with-Spigot-Mob-Spawn-Logic.patch index c94735b556..2c3e0ae91f 100644 --- a/Spigot-Server-Patches/Fix-Bugs-with-Spigot-Mob-Spawn-Logic.patch +++ b/Spigot-Server-Patches/Fix-Bugs-with-Spigot-Mob-Spawn-Logic.patch @@ -27,7 +27,7 @@ index 61d34fc37..a6cf1d83d 100644 if (entity instanceof EntityItem) { itemCounts[i]--; diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index c95fb7f30..0a7a31086 100644 +index 8749a1879..29d4c0866 100644 --- a/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java @@ -0,0 +0,0 @@ public final class SpawnerCreature { diff --git a/Spigot-Server-Patches/Fix-inter-world-teleportation-glitches.patch b/Spigot-Server-Patches/Fix-inter-world-teleportation-glitches.patch index c987e3b363..5791999224 100644 --- a/Spigot-Server-Patches/Fix-inter-world-teleportation-glitches.patch +++ b/Spigot-Server-Patches/Fix-inter-world-teleportation-glitches.patch @@ -25,7 +25,7 @@ index 4cc74cd65..fa49397ea 100644 + } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 2bcf3976f..68ce11be8 100644 +index 0e7086da3..d72ff0af2 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 { diff --git a/Spigot-Server-Patches/Fix-reducedDebugInfo-not-initialized-on-client.patch b/Spigot-Server-Patches/Fix-reducedDebugInfo-not-initialized-on-client.patch index 8090d97529..69f62652ec 100644 --- a/Spigot-Server-Patches/Fix-reducedDebugInfo-not-initialized-on-client.patch +++ b/Spigot-Server-Patches/Fix-reducedDebugInfo-not-initialized-on-client.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix reducedDebugInfo not initialized on client diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 4e35e9102..a55a6fca0 100644 +index d6a2bbc08..b8d48b45c 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 { diff --git a/Spigot-Server-Patches/Further-improve-server-tick-loop.patch b/Spigot-Server-Patches/Further-improve-server-tick-loop.patch index f2222e62ba..f3370690fb 100644 --- a/Spigot-Server-Patches/Further-improve-server-tick-loop.patch +++ b/Spigot-Server-Patches/Further-improve-server-tick-loop.patch @@ -12,7 +12,7 @@ Previous implementation did not calculate TPS correctly. Switch to a realistic rolling average and factor in std deviation as an extra reporting variable diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index d9e4f1a9..c4497aaa 100644 +index d9e4f1a9f..c4497aaa6 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs @@ -147,7 +147,7 @@ index d9e4f1a9..c4497aaa 100644 } lastTick = curTime; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index db4ac484..0f77d067 100644 +index db4ac484f..0f77d0674 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 { @@ -169,7 +169,7 @@ index db4ac484..0f77d067 100644 { diff --git a/src/main/java/org/spigotmc/TicksPerSecondCommand.java b/src/main/java/org/spigotmc/TicksPerSecondCommand.java -index be2e31de..6d21c326 100644 +index be2e31dea..6d21c3269 100644 --- a/src/main/java/org/spigotmc/TicksPerSecondCommand.java +++ b/src/main/java/org/spigotmc/TicksPerSecondCommand.java @@ -0,0 +0,0 @@ diff --git a/Spigot-Server-Patches/Lighting-Queue.patch b/Spigot-Server-Patches/Lighting-Queue.patch index 39e9c2ed5f..8a195dcebe 100644 --- a/Spigot-Server-Patches/Lighting-Queue.patch +++ b/Spigot-Server-Patches/Lighting-Queue.patch @@ -97,7 +97,7 @@ index 3ba489d4f..f7f2d12cf 100644 // Update neighbor counts for (int x = -2; x < 3; x++) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 4476799d8..f953ef8e0 100644 +index c4497aaa6..ca0ff4d30 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs diff --git a/Spigot-Server-Patches/Metrics.patch b/Spigot-Server-Patches/Metrics.patch deleted file mode 100644 index dcbe47a7c5..0000000000 --- a/Spigot-Server-Patches/Metrics.patch +++ /dev/null @@ -1,20 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Zach Brown <1254957+zachbr@users.noreply.github.com> -Date: Tue, 1 Mar 2016 14:54:32 -0600 -Subject: [PATCH] Metrics - - -diff --git a/src/main/java/org/spigotmc/Metrics.java b/src/main/java/org/spigotmc/Metrics.java -index a5fd59d5e..680283ce0 100644 ---- a/src/main/java/org/spigotmc/Metrics.java -+++ b/src/main/java/org/spigotmc/Metrics.java -@@ -0,0 +0,0 @@ public class Metrics { - */ - private void postPlugin(final boolean isPing) throws IOException { - // Server software specific section -- String pluginName = "Spigot"; -+ String pluginName = "PaperSpigot"; // Paper - Keep old name for legacy data - boolean onlineMode = Bukkit.getServer().getOnlineMode(); // TRUE if online mode is enabled - String pluginVersion = (Metrics.class.getPackage().getImplementationVersion() != null) ? Metrics.class.getPackage().getImplementationVersion() : "unknown"; - String serverVersion = Bukkit.getVersion(); --- \ No newline at end of file diff --git a/Spigot-Server-Patches/Optimize-Network-Queue.patch b/Spigot-Server-Patches/Optimize-Network-Queue.patch index b9b88d4ab2..3eae7aeca8 100644 --- a/Spigot-Server-Patches/Optimize-Network-Queue.patch +++ b/Spigot-Server-Patches/Optimize-Network-Queue.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Optimize Network Queue diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index d49a4ded0..044ae22d4 100644 +index 8134501c7..8df30e3d0 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs diff --git a/Spigot-Server-Patches/Optimize-UserCache-Thread-Safe.patch b/Spigot-Server-Patches/Optimize-UserCache-Thread-Safe.patch index 97fe576793..8cf6a7eb69 100644 --- a/Spigot-Server-Patches/Optimize-UserCache-Thread-Safe.patch +++ b/Spigot-Server-Patches/Optimize-UserCache-Thread-Safe.patch @@ -10,7 +10,7 @@ Additionally, move Saving of the User cache to be done async, incase the user never changed the default setting for Spigot's save on stop only. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 410c9834b..f83cc7641 100644 +index 83b62da55..2349c3ade 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs diff --git a/Spigot-Server-Patches/Optimize-explosions.patch b/Spigot-Server-Patches/Optimize-explosions.patch index 341464f818..43eac89cf3 100644 --- a/Spigot-Server-Patches/Optimize-explosions.patch +++ b/Spigot-Server-Patches/Optimize-explosions.patch @@ -124,7 +124,7 @@ index 4e05bcdfa..49fc95e35 100644 + // Paper end } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index f953ef8e0..3b67ff52e 100644 +index ca0ff4d30..e7c63a953 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs diff --git a/Spigot-Server-Patches/Paper-Metrics.patch b/Spigot-Server-Patches/Paper-Metrics.patch index 84a3a12768..92195c7df9 100644 --- a/Spigot-Server-Patches/Paper-Metrics.patch +++ b/Spigot-Server-Patches/Paper-Metrics.patch @@ -15,20 +15,10 @@ decisions on behalf of the project. diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java new file mode 100644 -index 000000000..585260697 +index 000000000..91c2aae03 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/Metrics.java @@ -0,0 +0,0 @@ -+/* -+ * This is a modified version of the bStats-Metrics class, licensed under the GNU LGPL v3 -+ * -+ * The original version of this file, as of the creation of this modified version, can be found here: -+ * https://github.com/BtoBastian/bStats-Metrics/blob/94acfb0e97831d866b9e6a28d442a27e4862d954/bstats-bukkit/src/main/java/org/bstats/Metrics.java -+ * -+ * The license that accompanies that file, as of the creation of this modified version, can be found here: -+ * https://github.com/BtoBastian/bStats-Metrics/blob/94acfb0e97831d866b9e6a28d442a27e4862d954/LICENSE -+ */ -+ +package com.destroystokyo.paper; + +import net.minecraft.server.MinecraftServer; @@ -38,18 +28,15 @@ index 000000000..585260697 +import org.json.simple.JSONObject; + +import javax.net.ssl.HttpsURLConnection; -+import java.io.*; ++import java.io.ByteArrayOutputStream; ++import java.io.DataOutputStream; ++import java.io.File; ++import java.io.IOException; +import java.net.URL; -+import java.util.ArrayList; -+import java.util.HashMap; -+import java.util.List; -+import java.util.Locale; -+import java.util.Map; -+import java.util.UUID; -+import java.util.concurrent.Executors; -+import java.util.concurrent.ScheduledExecutorService; -+import java.util.concurrent.TimeUnit; ++import java.util.*; ++import java.util.concurrent.Callable; +import java.util.logging.Level; ++import java.util.logging.Logger; +import java.util.zip.GZIPOutputStream; + +/** @@ -57,73 +44,45 @@ index 000000000..585260697 + * + * Check out https://bStats.org/ to learn more about bStats! + */ -+class Metrics { -+ -+ static { -+ // Maven's Relocate is clever and changes strings, too. So we have to use this little "trick" ... :D -+ final String defaultPackage = new String(new byte[] { 'o', 'r', 'g', '.', 'b', 's', 't', 'a', 't', 's' }); -+ final String examplePackage = new String(new byte[] { 'y', 'o', 'u', 'r', '.', 'p', 'a', 'c', 'k', 'a', 'g', 'e' }); -+ // We want to make sure nobody just copy & pastes the example and use the wrong package names -+ if (Metrics.class.getPackage().getName().equals(defaultPackage) || Metrics.class.getPackage().getName().equals(examplePackage)) { -+ throw new IllegalStateException("bStats Metrics class has not been relocated correctly!"); -+ } -+ } ++public class Metrics { + + // The version of this bStats class + public static final int B_STATS_VERSION = 1; + + // The url to which the data is sent -+ private static final String URL = "https://bStats.org/submitData/bukkit"; ++ private static final String URL = "https://bStats.org/submitData/server-implementation"; + + // Should failed requests be logged? -+ private static boolean logFailedRequests; ++ private static boolean logFailedRequests = false; ++ ++ // The logger for the failed requests ++ private static Logger logger = Logger.getLogger("bStats"); ++ ++ // The name of the server software ++ private final String name; + + // The uuid of the server -+ private static String serverUUID; ++ private final String serverUUID; + + // A list with all custom charts + private final List<CustomChart> charts = new ArrayList<>(); -+ -+ // Executor for use in scheduling work and submitting data -+ private final ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(); + + /** + * Class constructor. ++ * ++ * @param name The name of the server software. ++ * @param serverUUID The uuid of the server. ++ * @param logFailedRequests Whether failed requests should be logged or not. ++ * @param logger The logger for the failed requests. + */ -+ public Metrics() { ++ public Metrics(String name, String serverUUID, boolean logFailedRequests, Logger logger) { ++ this.name = name; ++ this.serverUUID = serverUUID; ++ Metrics.logFailedRequests = logFailedRequests; ++ Metrics.logger = logger; + -+ // Get the config file -+ File configFile = new File(new File((File) MinecraftServer.getServer().options.valueOf("plugins"), "bStats"), "config.yml"); -+ YamlConfiguration config = YamlConfiguration.loadConfiguration(configFile); -+ -+ // Check if the config file exists -+ if (!config.isSet("serverUuid")) { -+ -+ // Add default values -+ config.addDefault("enabled", true); -+ // Every server gets it's unique random id. -+ config.addDefault("serverUuid", UUID.randomUUID().toString()); -+ // Should failed request be logged? -+ config.addDefault("logFailedRequests", false); -+ -+ // Inform the server owners about bStats -+ config.options().header( -+ "bStats collects some data for plugin authors like how many servers are using their plugins.\n" + -+ "To honor their work, you should not disable it.\n" + -+ "This has nearly no effect on the server performance!\n" + -+ "Check out https://bStats.org/ to learn more :)" -+ ).copyDefaults(true); -+ try { -+ config.save(configFile); -+ } catch (IOException ignored) { } -+ } -+ -+ // Load the data -+ serverUUID = config.getString("serverUuid"); -+ logFailedRequests = config.getBoolean("logFailedRequests", false); -+ if (config.getBoolean("enabled", true)) { -+ startSubmitting(); -+ } ++ // Start submitting the data ++ startSubmitting(); + } + + /** @@ -142,11 +101,13 @@ index 000000000..585260697 + * Starts the Scheduler which submits our data every 30 minutes. + */ + private void startSubmitting() { -+ executor.scheduleAtFixedRate(() -> { -+ // Nevertheless we want our code to run in the main thread, so we have to use the MC scheduler -+ // Don't be afraid! The connection to the bStats server is still async, only the stats collection is sync ;) -+ MinecraftServer.getServer().postToMainThread(this::submitData); -+ }, 5, 30, TimeUnit.MINUTES); ++ final Timer timer = new Timer(true); ++ timer.scheduleAtFixedRate(new TimerTask() { ++ @Override ++ public void run() { ++ submitData(); ++ } ++ }, 1000 * 60 * 5, 1000 * 60 * 30); + // Submit the data every 30 minutes, first time after 5 minutes to give other plugins enough time to start + // WARNING: Changing the frequency has no effect but your plugin WILL be blocked/deleted! + // WARNING: Just don't do it! @@ -157,14 +118,10 @@ index 000000000..585260697 + * + * @return The plugin specific data. + */ -+ public JSONObject getPluginData() { ++ private JSONObject getPluginData() { + JSONObject data = new JSONObject(); + -+ String pluginName = "Paper"; -+ String pluginVersion = (Metrics.class.getPackage().getImplementationVersion() != null) ? Metrics.class.getPackage().getImplementationVersion() : "unknown"; -+ -+ data.put("pluginName", pluginName); // Append the name of the plugin -+ data.put("pluginVersion", pluginVersion); // Append the version of the plugin ++ data.put("pluginName", name); // Append the name of the server software + JSONArray customCharts = new JSONArray(); + for (CustomChart customChart : charts) { + // Add the data of the custom charts @@ -185,14 +142,7 @@ index 000000000..585260697 + * @return The server specific data. + */ + private JSONObject getServerData() { -+ // Minecraft specific data -+ int playerAmount = Bukkit.getOnlinePlayers().size(); -+ int onlineMode = Bukkit.getOnlineMode() ? 1 : 0; -+ String bukkitVersion = org.bukkit.Bukkit.getVersion(); -+ bukkitVersion = bukkitVersion.substring(bukkitVersion.indexOf("MC: ") + 4, bukkitVersion.length() - 1); -+ -+ // OS/Java specific data -+ String javaVersion = System.getProperty("java.version"); ++ // OS specific data + String osName = System.getProperty("os.name"); + String osArch = System.getProperty("os.arch"); + String osVersion = System.getProperty("os.version"); @@ -202,11 +152,6 @@ index 000000000..585260697 + + data.put("serverUUID", serverUUID); + -+ data.put("playerAmount", playerAmount); -+ data.put("onlineMode", onlineMode); -+ data.put("bukkitVersion", bukkitVersion); -+ -+ data.put("javaVersion", javaVersion); + data.put("osName", osName); + data.put("osArch", osArch); + data.put("osVersion", osVersion); @@ -222,21 +167,18 @@ index 000000000..585260697 + final JSONObject data = getServerData(); + + JSONArray pluginData = new JSONArray(); -+ pluginData.add(this.getPluginData()); ++ pluginData.add(getPluginData()); + data.put("plugins", pluginData); + -+ // Post to separate thread for the connection to the bStats server -+ executor.execute(() -> { -+ try { -+ // Send the data -+ sendData(data); -+ } catch (Exception e) { -+ // Something went wrong! :( -+ if (logFailedRequests) { -+ Bukkit.getLogger().log(Level.WARNING, "Could not submit stats for Paper", e); -+ } ++ try { ++ // We are still in the Thread of the timer, so nothing get blocked :) ++ sendData(data); ++ } catch (Exception e) { ++ // Something went wrong! :( ++ if (logFailedRequests) { ++ logger.log(Level.WARNING, "Could not submit stats of " + name, e); + } -+ }); ++ } + } + + /** @@ -249,9 +191,6 @@ index 000000000..585260697 + if (data == null) { + throw new IllegalArgumentException("Data cannot be null!"); + } -+ if (Bukkit.isPrimaryThread()) { -+ throw new IllegalAccessException("This method must not be called from the main thread!"); -+ } + HttpsURLConnection connection = (HttpsURLConnection) new URL(URL).openConnection(); + + // Compress the data to save bandwidth @@ -300,21 +239,21 @@ index 000000000..585260697 + public static abstract class CustomChart { + + // The id of the chart -+ protected final String chartId; ++ final String chartId; + + /** + * Class constructor. + * + * @param chartId The id of the chart. + */ -+ public CustomChart(String chartId) { ++ CustomChart(String chartId) { + if (chartId == null || chartId.isEmpty()) { + throw new IllegalArgumentException("ChartId cannot be null or empty!"); + } + this.chartId = chartId; + } + -+ protected JSONObject getRequestJsonObject() { ++ private JSONObject getRequestJsonObject() { + JSONObject chart = new JSONObject(); + chart.put("chartId", chartId); + try { @@ -326,42 +265,39 @@ index 000000000..585260697 + chart.put("data", data); + } catch (Throwable t) { + if (logFailedRequests) { -+ Bukkit.getLogger().log(Level.WARNING, "Failed to get data for custom chart with id " + chartId, t); ++ logger.log(Level.WARNING, "Failed to get data for custom chart with id " + chartId, t); + } + return null; + } + return chart; + } + -+ protected abstract JSONObject getChartData(); ++ protected abstract JSONObject getChartData() throws Exception; + + } + + /** + * Represents a custom simple pie. + */ -+ public static abstract class SimplePie extends CustomChart { ++ public static class SimplePie extends CustomChart { ++ ++ private final Callable<String> callable; + + /** + * Class constructor. + * -+ * @param chartId The id of the chart. ++ * @param chartId The id of the chart. ++ * @param callable The callable which is used to request the chart data. + */ -+ public SimplePie(String chartId) { ++ public SimplePie(String chartId, Callable<String> callable) { + super(chartId); ++ this.callable = callable; + } + -+ /** -+ * Gets the value of the pie. -+ * -+ * @return The value of the pie. -+ */ -+ public abstract String getValue(); -+ + @Override -+ protected JSONObject getChartData() { ++ protected JSONObject getChartData() throws Exception { + JSONObject data = new JSONObject(); -+ String value = getValue(); ++ String value = callable.call(); + if (value == null || value.isEmpty()) { + // Null = skip the chart + return null; @@ -374,31 +310,26 @@ index 000000000..585260697 + /** + * Represents a custom advanced pie. + */ -+ public static abstract class AdvancedPie extends CustomChart { ++ public static class AdvancedPie extends CustomChart { ++ ++ private final Callable<Map<String, Integer>> callable; + + /** + * Class constructor. + * -+ * @param chartId The id of the chart. ++ * @param chartId The id of the chart. ++ * @param callable The callable which is used to request the chart data. + */ -+ public AdvancedPie(String chartId) { ++ public AdvancedPie(String chartId, Callable<Map<String, Integer>> callable) { + super(chartId); ++ this.callable = callable; + } + -+ /** -+ * Gets the values of the pie. -+ * -+ * @param valueMap Just an empty map. The only reason it exists is to make your life easier. -+ * You don't have to create a map yourself! -+ * @return The values of the pie. -+ */ -+ public abstract HashMap<String, Integer> getValues(HashMap<String, Integer> valueMap); -+ + @Override -+ protected JSONObject getChartData() { ++ protected JSONObject getChartData() throws Exception { + JSONObject data = new JSONObject(); + JSONObject values = new JSONObject(); -+ HashMap<String, Integer> map = getValues(new HashMap<String, Integer>()); ++ Map<String, Integer> map = callable.call(); + if (map == null || map.isEmpty()) { + // Null = skip the chart + return null; @@ -421,30 +352,76 @@ index 000000000..585260697 + } + + /** -+ * Represents a custom single line chart. ++ * Represents a custom drilldown pie. + */ -+ public static abstract class SingleLineChart extends CustomChart { ++ public static class DrilldownPie extends CustomChart { ++ ++ private final Callable<Map<String, Map<String, Integer>>> callable; + + /** + * Class constructor. + * -+ * @param chartId The id of the chart. ++ * @param chartId The id of the chart. ++ * @param callable The callable which is used to request the chart data. + */ -+ public SingleLineChart(String chartId) { ++ public DrilldownPie(String chartId, Callable<Map<String, Map<String, Integer>>> callable) { + super(chartId); ++ this.callable = callable; + } + ++ @Override ++ public JSONObject getChartData() throws Exception { ++ JSONObject data = new JSONObject(); ++ JSONObject values = new JSONObject(); ++ Map<String, Map<String, Integer>> map = callable.call(); ++ if (map == null || map.isEmpty()) { ++ // Null = skip the chart ++ return null; ++ } ++ boolean reallyAllSkipped = true; ++ for (Map.Entry<String, Map<String, Integer>> entryValues : map.entrySet()) { ++ JSONObject value = new JSONObject(); ++ boolean allSkipped = true; ++ for (Map.Entry<String, Integer> valueEntry : map.get(entryValues.getKey()).entrySet()) { ++ value.put(valueEntry.getKey(), valueEntry.getValue()); ++ allSkipped = false; ++ } ++ if (!allSkipped) { ++ reallyAllSkipped = false; ++ values.put(entryValues.getKey(), value); ++ } ++ } ++ if (reallyAllSkipped) { ++ // Null = skip the chart ++ return null; ++ } ++ data.put("values", values); ++ return data; ++ } ++ } ++ ++ /** ++ * Represents a custom single line chart. ++ */ ++ public static class SingleLineChart extends CustomChart { ++ ++ private final Callable<Integer> callable; ++ + /** -+ * Gets the value of the chart. ++ * Class constructor. + * -+ * @return The value of the chart. ++ * @param chartId The id of the chart. ++ * @param callable The callable which is used to request the chart data. + */ -+ public abstract int getValue(); ++ public SingleLineChart(String chartId, Callable<Integer> callable) { ++ super(chartId); ++ this.callable = callable; ++ } + + @Override -+ protected JSONObject getChartData() { ++ protected JSONObject getChartData() throws Exception { + JSONObject data = new JSONObject(); -+ int value = getValue(); ++ int value = callable.call(); + if (value == 0) { + // Null = skip the chart + return null; @@ -458,31 +435,26 @@ index 000000000..585260697 + /** + * Represents a custom multi line chart. + */ -+ public static abstract class MultiLineChart extends CustomChart { ++ public static class MultiLineChart extends CustomChart { ++ ++ private final Callable<Map<String, Integer>> callable; + + /** + * Class constructor. + * -+ * @param chartId The id of the chart. ++ * @param chartId The id of the chart. ++ * @param callable The callable which is used to request the chart data. + */ -+ public MultiLineChart(String chartId) { ++ public MultiLineChart(String chartId, Callable<Map<String, Integer>> callable) { + super(chartId); ++ this.callable = callable; + } + -+ /** -+ * Gets the values of the chart. -+ * -+ * @param valueMap Just an empty map. The only reason it exists is to make your life easier. -+ * You don't have to create a map yourself! -+ * @return The values of the chart. -+ */ -+ public abstract HashMap<String, Integer> getValues(HashMap<String, Integer> valueMap); -+ + @Override -+ protected JSONObject getChartData() { ++ protected JSONObject getChartData() throws Exception { + JSONObject data = new JSONObject(); + JSONObject values = new JSONObject(); -+ HashMap<String, Integer> map = getValues(new HashMap<String, Integer>()); ++ Map<String, Integer> map = callable.call(); + if (map == null || map.isEmpty()) { + // Null = skip the chart + return null; @@ -508,31 +480,26 @@ index 000000000..585260697 + /** + * Represents a custom simple bar chart. + */ -+ public static abstract class SimpleBarChart extends CustomChart { ++ public static class SimpleBarChart extends CustomChart { ++ ++ private final Callable<Map<String, Integer>> callable; + + /** + * Class constructor. + * -+ * @param chartId The id of the chart. ++ * @param chartId The id of the chart. ++ * @param callable The callable which is used to request the chart data. + */ -+ public SimpleBarChart(String chartId) { ++ public SimpleBarChart(String chartId, Callable<Map<String, Integer>> callable) { + super(chartId); ++ this.callable = callable; + } + -+ /** -+ * Gets the value of the chart. -+ * -+ * @param valueMap Just an empty map. The only reason it exists is to make your life easier. -+ * You don't have to create a map yourself! -+ * @return The value of the chart. -+ */ -+ public abstract HashMap<String, Integer> getValues(HashMap<String, Integer> valueMap); -+ + @Override -+ protected JSONObject getChartData() { ++ protected JSONObject getChartData() throws Exception { + JSONObject data = new JSONObject(); + JSONObject values = new JSONObject(); -+ HashMap<String, Integer> map = getValues(new HashMap<String, Integer>()); ++ Map<String, Integer> map = callable.call(); + if (map == null || map.isEmpty()) { + // Null = skip the chart + return null; @@ -551,31 +518,26 @@ index 000000000..585260697 + /** + * Represents a custom advanced bar chart. + */ -+ public static abstract class AdvancedBarChart extends CustomChart { ++ public static class AdvancedBarChart extends CustomChart { ++ ++ private final Callable<Map<String, int[]>> callable; + + /** + * Class constructor. + * -+ * @param chartId The id of the chart. ++ * @param chartId The id of the chart. ++ * @param callable The callable which is used to request the chart data. + */ -+ public AdvancedBarChart(String chartId) { ++ public AdvancedBarChart(String chartId, Callable<Map<String, int[]>> callable) { + super(chartId); ++ this.callable = callable; + } + -+ /** -+ * Gets the value of the chart. -+ * -+ * @param valueMap Just an empty map. The only reason it exists is to make your life easier. -+ * You don't have to create a map yourself! -+ * @return The value of the chart. -+ */ -+ public abstract HashMap<String, int[]> getValues(HashMap<String, int[]> valueMap); -+ + @Override -+ protected JSONObject getChartData() { ++ protected JSONObject getChartData() throws Exception { + JSONObject data = new JSONObject(); + JSONObject values = new JSONObject(); -+ HashMap<String, int[]> map = getValues(new HashMap<String, int[]>()); ++ Map<String, int[]> map = callable.call(); + if (map == null || map.isEmpty()) { + // Null = skip the chart + return null; @@ -602,429 +564,84 @@ index 000000000..585260697 + + } + -+ /** -+ * Represents a custom simple map chart. -+ */ -+ public static abstract class SimpleMapChart extends CustomChart { ++ static class PaperMetrics { ++ static void startMetrics() { ++ // Get the config file ++ File configFile = new File(new File((File) MinecraftServer.getServer().options.valueOf("plugins"), "bStats"), "config.yml"); ++ YamlConfiguration config = YamlConfiguration.loadConfiguration(configFile); + -+ /** -+ * Class constructor. -+ * -+ * @param chartId The id of the chart. -+ */ -+ public SimpleMapChart(String chartId) { -+ super(chartId); -+ } ++ // Check if the config file exists ++ if (!config.isSet("serverUuid")) { + -+ /** -+ * Gets the value of the chart. -+ * -+ * @return The value of the chart. -+ */ -+ public abstract Country getValue(); ++ // Add default values ++ config.addDefault("enabled", true); ++ // Every server gets it's unique random id. ++ config.addDefault("serverUuid", UUID.randomUUID().toString()); ++ // Should failed request be logged? ++ config.addDefault("logFailedRequests", false); + -+ @Override -+ protected JSONObject getChartData() { -+ JSONObject data = new JSONObject(); -+ Country value = getValue(); -+ -+ if (value == null) { -+ // Null = skip the chart -+ return null; -+ } -+ data.put("value", value.getCountryIsoTag()); -+ return data; -+ } -+ -+ } -+ -+ /** -+ * Represents a custom advanced map chart. -+ */ -+ public static abstract class AdvancedMapChart extends CustomChart { -+ -+ /** -+ * Class constructor. -+ * -+ * @param chartId The id of the chart. -+ */ -+ public AdvancedMapChart(String chartId) { -+ super(chartId); -+ } -+ -+ /** -+ * Gets the value of the chart. -+ * -+ * @param valueMap Just an empty map. The only reason it exists is to make your life easier. -+ * You don't have to create a map yourself! -+ * @return The value of the chart. -+ */ -+ public abstract HashMap<Country, Integer> getValues(HashMap<Country, Integer> valueMap); -+ -+ @Override -+ protected JSONObject getChartData() { -+ JSONObject data = new JSONObject(); -+ JSONObject values = new JSONObject(); -+ HashMap<Country, Integer> map = getValues(new HashMap<Country, Integer>()); -+ if (map == null || map.isEmpty()) { -+ // Null = skip the chart -+ return null; -+ } -+ boolean allSkipped = true; -+ for (Map.Entry<Country, Integer> entry : map.entrySet()) { -+ if (entry.getValue() == 0) { -+ continue; // Skip this invalid -+ } -+ allSkipped = false; -+ values.put(entry.getKey().getCountryIsoTag(), entry.getValue()); -+ } -+ if (allSkipped) { -+ // Null = skip the chart -+ return null; -+ } -+ data.put("values", values); -+ return data; -+ } -+ -+ } -+ -+ /** -+ * A enum which is used for custom maps. -+ */ -+ public enum Country { -+ -+ /** -+ * bStats will use the country of the server. -+ */ -+ AUTO_DETECT("AUTO", "Auto Detected"), -+ -+ ANDORRA("AD", "Andorra"), -+ UNITED_ARAB_EMIRATES("AE", "United Arab Emirates"), -+ AFGHANISTAN("AF", "Afghanistan"), -+ ANTIGUA_AND_BARBUDA("AG", "Antigua and Barbuda"), -+ ANGUILLA("AI", "Anguilla"), -+ ALBANIA("AL", "Albania"), -+ ARMENIA("AM", "Armenia"), -+ NETHERLANDS_ANTILLES("AN", "Netherlands Antilles"), -+ ANGOLA("AO", "Angola"), -+ ANTARCTICA("AQ", "Antarctica"), -+ ARGENTINA("AR", "Argentina"), -+ AMERICAN_SAMOA("AS", "American Samoa"), -+ AUSTRIA("AT", "Austria"), -+ AUSTRALIA("AU", "Australia"), -+ ARUBA("AW", "Aruba"), -+ ALAND_ISLANDS("AX", "Åland Islands"), -+ AZERBAIJAN("AZ", "Azerbaijan"), -+ BOSNIA_AND_HERZEGOVINA("BA", "Bosnia and Herzegovina"), -+ BARBADOS("BB", "Barbados"), -+ BANGLADESH("BD", "Bangladesh"), -+ BELGIUM("BE", "Belgium"), -+ BURKINA_FASO("BF", "Burkina Faso"), -+ BULGARIA("BG", "Bulgaria"), -+ BAHRAIN("BH", "Bahrain"), -+ BURUNDI("BI", "Burundi"), -+ BENIN("BJ", "Benin"), -+ SAINT_BARTHELEMY("BL", "Saint Barthélemy"), -+ BERMUDA("BM", "Bermuda"), -+ BRUNEI("BN", "Brunei"), -+ BOLIVIA("BO", "Bolivia"), -+ BONAIRE_SINT_EUSTATIUS_AND_SABA("BQ", "Bonaire, Sint Eustatius and Saba"), -+ BRAZIL("BR", "Brazil"), -+ BAHAMAS("BS", "Bahamas"), -+ BHUTAN("BT", "Bhutan"), -+ BOUVET_ISLAND("BV", "Bouvet Island"), -+ BOTSWANA("BW", "Botswana"), -+ BELARUS("BY", "Belarus"), -+ BELIZE("BZ", "Belize"), -+ CANADA("CA", "Canada"), -+ COCOS_ISLANDS("CC", "Cocos Islands"), -+ THE_DEMOCRATIC_REPUBLIC_OF_CONGO("CD", "The Democratic Republic Of Congo"), -+ CENTRAL_AFRICAN_REPUBLIC("CF", "Central African Republic"), -+ CONGO("CG", "Congo"), -+ SWITZERLAND("CH", "Switzerland"), -+ COTE_D_IVOIRE("CI", "Côte d'Ivoire"), -+ COOK_ISLANDS("CK", "Cook Islands"), -+ CHILE("CL", "Chile"), -+ CAMEROON("CM", "Cameroon"), -+ CHINA("CN", "China"), -+ COLOMBIA("CO", "Colombia"), -+ COSTA_RICA("CR", "Costa Rica"), -+ CUBA("CU", "Cuba"), -+ CAPE_VERDE("CV", "Cape Verde"), -+ CURACAO("CW", "Curaçao"), -+ CHRISTMAS_ISLAND("CX", "Christmas Island"), -+ CYPRUS("CY", "Cyprus"), -+ CZECH_REPUBLIC("CZ", "Czech Republic"), -+ GERMANY("DE", "Germany"), -+ DJIBOUTI("DJ", "Djibouti"), -+ DENMARK("DK", "Denmark"), -+ DOMINICA("DM", "Dominica"), -+ DOMINICAN_REPUBLIC("DO", "Dominican Republic"), -+ ALGERIA("DZ", "Algeria"), -+ ECUADOR("EC", "Ecuador"), -+ ESTONIA("EE", "Estonia"), -+ EGYPT("EG", "Egypt"), -+ WESTERN_SAHARA("EH", "Western Sahara"), -+ ERITREA("ER", "Eritrea"), -+ SPAIN("ES", "Spain"), -+ ETHIOPIA("ET", "Ethiopia"), -+ FINLAND("FI", "Finland"), -+ FIJI("FJ", "Fiji"), -+ FALKLAND_ISLANDS("FK", "Falkland Islands"), -+ MICRONESIA("FM", "Micronesia"), -+ FAROE_ISLANDS("FO", "Faroe Islands"), -+ FRANCE("FR", "France"), -+ GABON("GA", "Gabon"), -+ UNITED_KINGDOM("GB", "United Kingdom"), -+ GRENADA("GD", "Grenada"), -+ GEORGIA("GE", "Georgia"), -+ FRENCH_GUIANA("GF", "French Guiana"), -+ GUERNSEY("GG", "Guernsey"), -+ GHANA("GH", "Ghana"), -+ GIBRALTAR("GI", "Gibraltar"), -+ GREENLAND("GL", "Greenland"), -+ GAMBIA("GM", "Gambia"), -+ GUINEA("GN", "Guinea"), -+ GUADELOUPE("GP", "Guadeloupe"), -+ EQUATORIAL_GUINEA("GQ", "Equatorial Guinea"), -+ GREECE("GR", "Greece"), -+ SOUTH_GEORGIA_AND_THE_SOUTH_SANDWICH_ISLANDS("GS", "South Georgia And The South Sandwich Islands"), -+ GUATEMALA("GT", "Guatemala"), -+ GUAM("GU", "Guam"), -+ GUINEA_BISSAU("GW", "Guinea-Bissau"), -+ GUYANA("GY", "Guyana"), -+ HONG_KONG("HK", "Hong Kong"), -+ HEARD_ISLAND_AND_MCDONALD_ISLANDS("HM", "Heard Island And McDonald Islands"), -+ HONDURAS("HN", "Honduras"), -+ CROATIA("HR", "Croatia"), -+ HAITI("HT", "Haiti"), -+ HUNGARY("HU", "Hungary"), -+ INDONESIA("ID", "Indonesia"), -+ IRELAND("IE", "Ireland"), -+ ISRAEL("IL", "Israel"), -+ ISLE_OF_MAN("IM", "Isle Of Man"), -+ INDIA("IN", "India"), -+ BRITISH_INDIAN_OCEAN_TERRITORY("IO", "British Indian Ocean Territory"), -+ IRAQ("IQ", "Iraq"), -+ IRAN("IR", "Iran"), -+ ICELAND("IS", "Iceland"), -+ ITALY("IT", "Italy"), -+ JERSEY("JE", "Jersey"), -+ JAMAICA("JM", "Jamaica"), -+ JORDAN("JO", "Jordan"), -+ JAPAN("JP", "Japan"), -+ KENYA("KE", "Kenya"), -+ KYRGYZSTAN("KG", "Kyrgyzstan"), -+ CAMBODIA("KH", "Cambodia"), -+ KIRIBATI("KI", "Kiribati"), -+ COMOROS("KM", "Comoros"), -+ SAINT_KITTS_AND_NEVIS("KN", "Saint Kitts And Nevis"), -+ NORTH_KOREA("KP", "North Korea"), -+ SOUTH_KOREA("KR", "South Korea"), -+ KUWAIT("KW", "Kuwait"), -+ CAYMAN_ISLANDS("KY", "Cayman Islands"), -+ KAZAKHSTAN("KZ", "Kazakhstan"), -+ LAOS("LA", "Laos"), -+ LEBANON("LB", "Lebanon"), -+ SAINT_LUCIA("LC", "Saint Lucia"), -+ LIECHTENSTEIN("LI", "Liechtenstein"), -+ SRI_LANKA("LK", "Sri Lanka"), -+ LIBERIA("LR", "Liberia"), -+ LESOTHO("LS", "Lesotho"), -+ LITHUANIA("LT", "Lithuania"), -+ LUXEMBOURG("LU", "Luxembourg"), -+ LATVIA("LV", "Latvia"), -+ LIBYA("LY", "Libya"), -+ MOROCCO("MA", "Morocco"), -+ MONACO("MC", "Monaco"), -+ MOLDOVA("MD", "Moldova"), -+ MONTENEGRO("ME", "Montenegro"), -+ SAINT_MARTIN("MF", "Saint Martin"), -+ MADAGASCAR("MG", "Madagascar"), -+ MARSHALL_ISLANDS("MH", "Marshall Islands"), -+ MACEDONIA("MK", "Macedonia"), -+ MALI("ML", "Mali"), -+ MYANMAR("MM", "Myanmar"), -+ MONGOLIA("MN", "Mongolia"), -+ MACAO("MO", "Macao"), -+ NORTHERN_MARIANA_ISLANDS("MP", "Northern Mariana Islands"), -+ MARTINIQUE("MQ", "Martinique"), -+ MAURITANIA("MR", "Mauritania"), -+ MONTSERRAT("MS", "Montserrat"), -+ MALTA("MT", "Malta"), -+ MAURITIUS("MU", "Mauritius"), -+ MALDIVES("MV", "Maldives"), -+ MALAWI("MW", "Malawi"), -+ MEXICO("MX", "Mexico"), -+ MALAYSIA("MY", "Malaysia"), -+ MOZAMBIQUE("MZ", "Mozambique"), -+ NAMIBIA("NA", "Namibia"), -+ NEW_CALEDONIA("NC", "New Caledonia"), -+ NIGER("NE", "Niger"), -+ NORFOLK_ISLAND("NF", "Norfolk Island"), -+ NIGERIA("NG", "Nigeria"), -+ NICARAGUA("NI", "Nicaragua"), -+ NETHERLANDS("NL", "Netherlands"), -+ NORWAY("NO", "Norway"), -+ NEPAL("NP", "Nepal"), -+ NAURU("NR", "Nauru"), -+ NIUE("NU", "Niue"), -+ NEW_ZEALAND("NZ", "New Zealand"), -+ OMAN("OM", "Oman"), -+ PANAMA("PA", "Panama"), -+ PERU("PE", "Peru"), -+ FRENCH_POLYNESIA("PF", "French Polynesia"), -+ PAPUA_NEW_GUINEA("PG", "Papua New Guinea"), -+ PHILIPPINES("PH", "Philippines"), -+ PAKISTAN("PK", "Pakistan"), -+ POLAND("PL", "Poland"), -+ SAINT_PIERRE_AND_MIQUELON("PM", "Saint Pierre And Miquelon"), -+ PITCAIRN("PN", "Pitcairn"), -+ PUERTO_RICO("PR", "Puerto Rico"), -+ PALESTINE("PS", "Palestine"), -+ PORTUGAL("PT", "Portugal"), -+ PALAU("PW", "Palau"), -+ PARAGUAY("PY", "Paraguay"), -+ QATAR("QA", "Qatar"), -+ REUNION("RE", "Reunion"), -+ ROMANIA("RO", "Romania"), -+ SERBIA("RS", "Serbia"), -+ RUSSIA("RU", "Russia"), -+ RWANDA("RW", "Rwanda"), -+ SAUDI_ARABIA("SA", "Saudi Arabia"), -+ SOLOMON_ISLANDS("SB", "Solomon Islands"), -+ SEYCHELLES("SC", "Seychelles"), -+ SUDAN("SD", "Sudan"), -+ SWEDEN("SE", "Sweden"), -+ SINGAPORE("SG", "Singapore"), -+ SAINT_HELENA("SH", "Saint Helena"), -+ SLOVENIA("SI", "Slovenia"), -+ SVALBARD_AND_JAN_MAYEN("SJ", "Svalbard And Jan Mayen"), -+ SLOVAKIA("SK", "Slovakia"), -+ SIERRA_LEONE("SL", "Sierra Leone"), -+ SAN_MARINO("SM", "San Marino"), -+ SENEGAL("SN", "Senegal"), -+ SOMALIA("SO", "Somalia"), -+ SURINAME("SR", "Suriname"), -+ SOUTH_SUDAN("SS", "South Sudan"), -+ SAO_TOME_AND_PRINCIPE("ST", "Sao Tome And Principe"), -+ EL_SALVADOR("SV", "El Salvador"), -+ SINT_MAARTEN_DUTCH_PART("SX", "Sint Maarten (Dutch part)"), -+ SYRIA("SY", "Syria"), -+ SWAZILAND("SZ", "Swaziland"), -+ TURKS_AND_CAICOS_ISLANDS("TC", "Turks And Caicos Islands"), -+ CHAD("TD", "Chad"), -+ FRENCH_SOUTHERN_TERRITORIES("TF", "French Southern Territories"), -+ TOGO("TG", "Togo"), -+ THAILAND("TH", "Thailand"), -+ TAJIKISTAN("TJ", "Tajikistan"), -+ TOKELAU("TK", "Tokelau"), -+ TIMOR_LESTE("TL", "Timor-Leste"), -+ TURKMENISTAN("TM", "Turkmenistan"), -+ TUNISIA("TN", "Tunisia"), -+ TONGA("TO", "Tonga"), -+ TURKEY("TR", "Turkey"), -+ TRINIDAD_AND_TOBAGO("TT", "Trinidad and Tobago"), -+ TUVALU("TV", "Tuvalu"), -+ TAIWAN("TW", "Taiwan"), -+ TANZANIA("TZ", "Tanzania"), -+ UKRAINE("UA", "Ukraine"), -+ UGANDA("UG", "Uganda"), -+ UNITED_STATES_MINOR_OUTLYING_ISLANDS("UM", "United States Minor Outlying Islands"), -+ UNITED_STATES("US", "United States"), -+ URUGUAY("UY", "Uruguay"), -+ UZBEKISTAN("UZ", "Uzbekistan"), -+ VATICAN("VA", "Vatican"), -+ SAINT_VINCENT_AND_THE_GRENADINES("VC", "Saint Vincent And The Grenadines"), -+ VENEZUELA("VE", "Venezuela"), -+ BRITISH_VIRGIN_ISLANDS("VG", "British Virgin Islands"), -+ U_S__VIRGIN_ISLANDS("VI", "U.S. Virgin Islands"), -+ VIETNAM("VN", "Vietnam"), -+ VANUATU("VU", "Vanuatu"), -+ WALLIS_AND_FUTUNA("WF", "Wallis And Futuna"), -+ SAMOA("WS", "Samoa"), -+ YEMEN("YE", "Yemen"), -+ MAYOTTE("YT", "Mayotte"), -+ SOUTH_AFRICA("ZA", "South Africa"), -+ ZAMBIA("ZM", "Zambia"), -+ ZIMBABWE("ZW", "Zimbabwe"); -+ -+ private String isoTag; -+ private String name; -+ -+ Country(String isoTag, String name) { -+ this.isoTag = isoTag; -+ this.name = name; -+ } -+ -+ /** -+ * Gets the name of the country. -+ * -+ * @return The name of the country. -+ */ -+ public String getCountryName() { -+ return name; -+ } -+ -+ /** -+ * Gets the iso tag of the country. -+ * -+ * @return The iso tag of the country. -+ */ -+ public String getCountryIsoTag() { -+ return isoTag; -+ } -+ -+ /** -+ * Gets a country by it's iso tag. -+ * -+ * @param isoTag The iso tag of the county. -+ * @return The country with the given iso tag or <code>null</code> if unknown. -+ */ -+ public static Country byIsoTag(String isoTag) { -+ for (Country country : Country.values()) { -+ if (country.getCountryIsoTag().equals(isoTag)) { -+ return country; ++ // Inform the server owners about bStats ++ config.options().header( ++ "bStats collects some data for plugin authors like how many servers are using their plugins.\n" + ++ "To honor their work, you should not disable it.\n" + ++ "This has nearly no effect on the server performance!\n" + ++ "Check out https://bStats.org/ to learn more :)" ++ ).copyDefaults(true); ++ try { ++ config.save(configFile); ++ } catch (IOException ignored) { + } + } -+ return null; -+ } ++ // Load the data ++ String serverUUID = config.getString("serverUuid"); ++ boolean logFailedRequests = config.getBoolean("logFailedRequests", false); ++ // Only start Metrics, if it's enabled in the config ++ if (config.getBoolean("enabled", true)) { ++ Metrics metrics = new Metrics("Paper", serverUUID, logFailedRequests, Bukkit.getLogger()); + -+ /** -+ * Gets a country by a locale. -+ * -+ * @param locale The locale. -+ * @return The country from the giben locale or <code>null</code> if unknown country or -+ * if the locale does not contain a country. -+ */ -+ public static Country byLocale(Locale locale) { -+ return byIsoTag(locale.getCountry()); -+ } ++ metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> { ++ String minecraftVersion = Bukkit.getVersion(); ++ minecraftVersion = minecraftVersion.substring(minecraftVersion.indexOf("MC: ") + 4, minecraftVersion.length() - 1); ++ return minecraftVersion; ++ })); + ++ metrics.addCustomChart(new Metrics.SingleLineChart("players", () -> Bukkit.getOnlinePlayers().size())); ++ metrics.addCustomChart(new Metrics.SimplePie("online_mode", () -> Bukkit.getOnlineMode() ? "online" : "offline")); ++ metrics.addCustomChart(new Metrics.SimplePie("paper_version", () -> (Metrics.class.getPackage().getImplementationVersion() != null) ? Metrics.class.getPackage().getImplementationVersion() : "unknown")); ++ ++ metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> { ++ Map<String, Map<String, Integer>> map = new HashMap<>(); ++ String javaVersion = System.getProperty("java.version"); ++ Map<String, Integer> entry = new HashMap<>(); ++ entry.put(javaVersion, 1); ++ map.put("Java " + javaVersion.substring(0, 3), entry); ++ return map; ++ })); ++ } ++ ++ } + } -+ +} diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 328ff012b..75d4048a9 100644 +index 328ff012b..1594d7ca4 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -0,0 +0,0 @@ public class PaperConfig { static Map<String, Command> commands; private static boolean verbose; /*========================================================================*/ -- -+ private static Metrics metrics; -+ ++ private static boolean metricsStarted; + public static void init(File configFile) { CONFIG_FILE = configFile; - config = new YamlConfiguration(); @@ -0,0 +0,0 @@ public class PaperConfig { for (Map.Entry<String, Command> entry : commands.entrySet()) { MinecraftServer.getServer().server.getCommandMap().register(entry.getKey(), "Paper", entry.getValue()); } -+ -+ if (metrics == null) { -+ metrics = new Metrics(); ++ ++ if (!metricsStarted) { ++ Metrics.PaperMetrics.startMetrics(); ++ metricsStarted = true; + } } diff --git a/Spigot-Server-Patches/Player-Tab-List-and-Title-APIs.patch b/Spigot-Server-Patches/Player-Tab-List-and-Title-APIs.patch index c49aa69be3..0a7ead2ed4 100644 --- a/Spigot-Server-Patches/Player-Tab-List-and-Title-APIs.patch +++ b/Spigot-Server-Patches/Player-Tab-List-and-Title-APIs.patch @@ -78,7 +78,7 @@ index 7bcafa8bb..4f6c1c2e7 100644 if (this.a == PacketPlayOutTitle.EnumTitleAction.TIMES) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index cc26aa748..2bcf3976f 100644 +index 16dcaba3f..0e7086da3 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 @@ diff --git a/Spigot-Server-Patches/Remove-Metadata-on-reload.patch b/Spigot-Server-Patches/Remove-Metadata-on-reload.patch index 0a67e3c594..a4475fe788 100644 --- a/Spigot-Server-Patches/Remove-Metadata-on-reload.patch +++ b/Spigot-Server-Patches/Remove-Metadata-on-reload.patch @@ -7,7 +7,7 @@ Metadata is not meant to persist reload as things break badly with non primitive This will remove metadata on reload so it does not crash everything if a plugin uses it. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 40091231e..540d57855 100644 +index e77307c35..4d761d32a 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 { diff --git a/Spigot-Server-Patches/Sanitise-RegionFileCache-and-make-configurable.patch b/Spigot-Server-Patches/Sanitise-RegionFileCache-and-make-configurable.patch index a42e70cbd5..1a2bc5acf3 100644 --- a/Spigot-Server-Patches/Sanitise-RegionFileCache-and-make-configurable.patch +++ b/Spigot-Server-Patches/Sanitise-RegionFileCache-and-make-configurable.patch @@ -11,7 +11,7 @@ The implementation uses a LinkedHashMap as an LRU cache (modified from HashMap). The maximum size of the RegionFileCache is also made configurable. diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index a48f5cb51..6b694705b 100644 +index 6907d4680..c3ff47e00 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -0,0 +0,0 @@ public class PaperConfig { diff --git a/Spigot-Server-Patches/Set-health-before-death-event.patch b/Spigot-Server-Patches/Set-health-before-death-event.patch index 137d54c56a..6a66918a79 100644 --- a/Spigot-Server-Patches/Set-health-before-death-event.patch +++ b/Spigot-Server-Patches/Set-health-before-death-event.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Set health before death event diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 078e0d989..a48f5cb51 100644 +index b5ff26c71..6907d4680 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -0,0 +0,0 @@ public class PaperConfig { diff --git a/Spigot-Server-Patches/String-based-Action-Bar-API.patch b/Spigot-Server-Patches/String-based-Action-Bar-API.patch index 0882e6e885..3faf2b4fb5 100644 --- a/Spigot-Server-Patches/String-based-Action-Bar-API.patch +++ b/Spigot-Server-Patches/String-based-Action-Bar-API.patch @@ -62,7 +62,7 @@ index 1159eea1a..38359517c 100644 + } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index a2fb7d2be..2d8018a7c 100644 +index 233903b5f..a57034471 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 { diff --git a/Spigot-Server-Patches/Timings-v2.patch b/Spigot-Server-Patches/Timings-v2.patch index 31dcc84fa9..3d7d80e07d 100644 --- a/Spigot-Server-Patches/Timings-v2.patch +++ b/Spigot-Server-Patches/Timings-v2.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Timings v2 diff --git a/pom.xml b/pom.xml -index 8b96966d..8d1e8680 100644 +index 8b96966d8..8d1e8680b 100644 --- a/pom.xml +++ b/pom.xml @@ -0,0 +0,0 @@ @@ -23,7 +23,7 @@ index 8b96966d..8d1e8680 100644 <version>3.0.3</version> diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java new file mode 100644 -index 00000000..4b4b77a5 +index 000000000..4b4b77a5c --- /dev/null +++ b/src/main/java/co/aikar/timings/MinecraftTimings.java @@ -0,0 +0,0 @@ @@ -153,7 +153,7 @@ index 00000000..4b4b77a5 +} diff --git a/src/main/java/co/aikar/timings/TimedChunkGenerator.java b/src/main/java/co/aikar/timings/TimedChunkGenerator.java new file mode 100644 -index 00000000..b79f1be7 +index 000000000..b79f1be7a --- /dev/null +++ b/src/main/java/co/aikar/timings/TimedChunkGenerator.java @@ -0,0 +0,0 @@ @@ -285,7 +285,7 @@ index 00000000..b79f1be7 +} diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java new file mode 100644 -index 00000000..e7789117 +index 000000000..e7789117b --- /dev/null +++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java @@ -0,0 +0,0 @@ @@ -391,7 +391,7 @@ index 00000000..e7789117 + } +} diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 75d4048a..1ea799d5 100644 +index 1594d7ca4..007589314 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -0,0 +0,0 @@ import java.util.concurrent.TimeUnit; @@ -435,7 +435,7 @@ index 75d4048a..1ea799d5 100644 + } } diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java -index e8511ac9..d3f1a4ac 100644 +index e8511ac9a..d3f1a4ac0 100644 --- a/src/main/java/net/minecraft/server/Block.java +++ b/src/main/java/net/minecraft/server/Block.java @@ -0,0 +0,0 @@ public class Block { @@ -455,7 +455,7 @@ index e8511ac9..d3f1a4ac 100644 public static int getId(Block block) { return Block.REGISTRY.a(block); // CraftBukkit - decompile error diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 81fc04ed..bd3b1602 100644 +index 81fc04ed3..bd3b16025 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk { @@ -503,7 +503,7 @@ index 81fc04ed..bd3b1602 100644 private void z() { diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index daf2c0a6..3ba489d4 100644 +index daf2c0a67..3ba489d4f 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { @@ -525,7 +525,7 @@ index daf2c0a6..3ba489d4 100644 this.chunkLoader.a(this.world, chunk); } catch (IOException ioexception) { diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index a97e7d3c..4890023d 100644 +index a97e7d3c2..4890023d7 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { @@ -565,7 +565,7 @@ index a97e7d3c..4890023d 100644 // return chunk; // CraftBukkit } diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index cb83e4f5..e6819139 100644 +index cb83e4f56..e6819139f 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -0,0 +0,0 @@ import java.io.PrintStream; @@ -618,7 +618,7 @@ index cb83e4f5..e6819139 100644 return waitable.get(); } catch (java.util.concurrent.ExecutionException e) { diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 9bd9dc28..14d23556 100644 +index 9bd9dc28b..14d23556f 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ import org.bukkit.block.BlockFace; @@ -657,7 +657,7 @@ index 9bd9dc28..14d23556 100644 public void recalcPosition() { diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index e9002c95..b22f81b1 100644 +index e9002c953..b22f81b12 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -0,0 +0,0 @@ import org.bukkit.event.entity.EntityTeleportEvent; @@ -728,7 +728,7 @@ index e9002c95..b22f81b1 100644 } diff --git a/src/main/java/net/minecraft/server/EntityTracker.java b/src/main/java/net/minecraft/server/EntityTracker.java -index 347a2b67..aceb08ce 100644 +index 347a2b671..aceb08ce1 100644 --- a/src/main/java/net/minecraft/server/EntityTracker.java +++ b/src/main/java/net/minecraft/server/EntityTracker.java @@ -0,0 +0,0 @@ public class EntityTracker { @@ -759,7 +759,7 @@ index 347a2b67..aceb08ce 100644 } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index cc0efa2e..1b432f0d 100644 +index cc0efa2e0..1b432f0d7 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ import org.bukkit.Bukkit; @@ -900,7 +900,7 @@ index cc0efa2e..1b432f0d 100644 this.methodProfiler.b(); } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 703d5813..021dfba1 100644 +index 703d5813d..021dfba14 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -0,0 +0,0 @@ @@ -1000,7 +1000,7 @@ index 703d5813..021dfba1 100644 } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 9897bade..27283efa 100644 +index 9897bade8..27283efad 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ import org.bukkit.inventory.CraftingInventory; @@ -1048,7 +1048,7 @@ index 9897bade..27283efa 100644 // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/PlayerConnectionUtils.java b/src/main/java/net/minecraft/server/PlayerConnectionUtils.java -index f74b0679..1fc632e0 100644 +index f74b06794..1fc632e0c 100644 --- a/src/main/java/net/minecraft/server/PlayerConnectionUtils.java +++ b/src/main/java/net/minecraft/server/PlayerConnectionUtils.java @@ -0,0 +0,0 @@ @@ -1078,7 +1078,7 @@ index f74b0679..1fc632e0 100644 + // Paper end } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index be52f3ad..d778eafb 100644 +index be52f3ad1..d778eafb3 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -0,0 +0,0 @@ @@ -1102,7 +1102,7 @@ index be52f3ad..d778eafb 100644 public void addWhitelist(GameProfile gameprofile) { diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java -index f1f20650..fb350c40 100644 +index f1f206501..fb350c408 100644 --- a/src/main/java/net/minecraft/server/StructureGenerator.java +++ b/src/main/java/net/minecraft/server/StructureGenerator.java @@ -0,0 +0,0 @@ @@ -1144,7 +1144,7 @@ index f1f20650..fb350c40 100644 return flag; } diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index 6958a2e0..b3d3df4c 100644 +index 6958a2e0f..b3d3df4cf 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -0,0 +0,0 @@ import javax.annotation.Nullable; @@ -1164,7 +1164,7 @@ index 6958a2e0..b3d3df4c 100644 private static final RegistryMaterials<MinecraftKey, Class<? extends TileEntity>> f = new RegistryMaterials(); protected World world; diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 758962e6..a87b3727 100644 +index 758962e67..a87b37277 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ import com.google.common.collect.Maps; @@ -1270,7 +1270,7 @@ index 758962e6..a87b3727 100644 } diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 391a09c5..96693899 100644 +index 391a09c52..966938997 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { @@ -1403,7 +1403,7 @@ index 391a09c5..96693899 100644 // CraftBukkit start diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 587d23df..d27e2ce9 100644 +index 587d23dfd..d27e2ce98 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 { @@ -1441,7 +1441,7 @@ index 587d23df..d27e2ce9 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java b/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java deleted file mode 100644 -index 41d2d87e..00000000 +index 41d2d87ee..000000000 --- a/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java +++ /dev/null @@ -0,0 +0,0 @@ @@ -1619,7 +1619,7 @@ index 41d2d87e..00000000 - } -} diff --git a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java -index 3a95b446..b5efb9c3 100644 +index 3a95b4465..b5efb9c3f 100644 --- a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java +++ b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java @@ -0,0 +0,0 @@ @@ -1663,7 +1663,7 @@ index 3a95b446..b5efb9c3 100644 public void callStage3(QueuedChunk queuedChunk, Chunk chunk, Runnable runnable) throws RuntimeException { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 5ceb086e..b56ae7a3 100644 +index 5ceb086e5..b56ae7a36 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 @@ import org.bukkit.configuration.serialization.DelegateDeserialization; @@ -1697,7 +1697,7 @@ index 5ceb086e..b56ae7a3 100644 public Player.Spigot spigot() diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java -index 92d217bc..9952b64b 100644 +index 92d217bce..9952b64be 100644 --- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java +++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java @@ -0,0 +0,0 @@ import java.util.concurrent.atomic.AtomicInteger; @@ -1773,7 +1773,7 @@ index 92d217bc..9952b64b 100644 private boolean isReady(final int currentTick) { diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java -index 220e39ab..afc6c17e 100644 +index 220e39abe..afc6c17e6 100644 --- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java +++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java @@ -0,0 +0,0 @@ @@ -1855,7 +1855,7 @@ index 220e39ab..afc6c17e 100644 - // Spigot end } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftIconCache.java b/src/main/java/org/bukkit/craftbukkit/util/CraftIconCache.java -index e52ef47b..3d90b342 100644 +index e52ef47b7..3d90b3426 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftIconCache.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftIconCache.java @@ -0,0 +0,0 @@ import org.bukkit.util.CachedServerIcon; @@ -1867,7 +1867,7 @@ index e52ef47b..3d90b342 100644 this.value = value; } diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index c32d44df..5c2fb005 100644 +index c32d44df0..5c2fb0058 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java @@ -0,0 +0,0 @@ import net.minecraft.server.EntityWither; diff --git a/Spigot-Server-Patches/Workaround-for-setting-passengers-on-players.patch b/Spigot-Server-Patches/Workaround-for-setting-passengers-on-players.patch index ec3a3d714a..2ccc5e26f4 100644 --- a/Spigot-Server-Patches/Workaround-for-setting-passengers-on-players.patch +++ b/Spigot-Server-Patches/Workaround-for-setting-passengers-on-players.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Workaround for setting passengers on players SPIGOT-1915 & GH-114 diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index b2fe1afc0..a74d6c768 100644 +index 80a6a0b41..5f6b182d6 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 { diff --git a/Spigot-Server-Patches/remove-null-possibility-for-getServer-singleton.patch b/Spigot-Server-Patches/remove-null-possibility-for-getServer-singleton.patch index 5e29fa290b..0c9255f652 100644 --- a/Spigot-Server-Patches/remove-null-possibility-for-getServer-singleton.patch +++ b/Spigot-Server-Patches/remove-null-possibility-for-getServer-singleton.patch @@ -6,7 +6,7 @@ Subject: [PATCH] remove null possibility for getServer singleton to stop IDE complaining about potential NPE diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 988439a0a..410c9834b 100644 +index 430168d21..83b62da55 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ import co.aikar.timings.MinecraftTimings; // Paper