From 10469dfd46d7a0fb517e6e3847b7596e0eb2447b Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Wed, 5 Oct 2016 15:46:44 -0500 Subject: Remove TE Fixer changes Ultimately they should be unnecessary now that upstream's fix has been in place for a while. Removing this reduces our own footprint, and gets rid of any possible unintended behavior. --- ...p-game-profiles-that-have-no-UUID-and-no-.patch | 22 ++++ ...-and-fix-TileEntities-as-they-are-removed.patch | 119 ----------------- ...p-game-profiles-that-have-no-UUID-and-no-.patch | 22 ---- ...informative-vehicle-moved-wrongly-message.patch | 22 ++++ ...informative-vehicle-moved-wrongly-message.patch | 22 ---- ...-players-that-dismount-from-other-players.patch | 27 ++++ ...-Add-setting-for-proxy-online-mode-status.patch | 51 ++++++++ ...-players-that-dismount-from-other-players.patch | 27 ---- ...-Add-setting-for-proxy-online-mode-status.patch | 51 -------- ...timise-BlockStateEnum-hashCode-and-equals.patch | 62 +++++++++ .../0166-Disable-ticking-of-snow-blocks.patch | 38 ++++++ ...timise-BlockStateEnum-hashCode-and-equals.patch | 62 --------- ...-Convert-new-health-to-a-float-during-set.patch | 22 ++++ .../0167-Disable-ticking-of-snow-blocks.patch | 38 ------ ...-Convert-new-health-to-a-float-during-set.patch | 22 ---- .../0168-Fix-AIOOBE-in-inventory-handling.patch | 22 ++++ ...169-Configurable-packet-in-spam-threshold.patch | 48 +++++++ .../0169-Fix-AIOOBE-in-inventory-handling.patch | 22 ---- .../0170-Configurable-flying-kick-messages.patch | 47 +++++++ ...170-Configurable-packet-in-spam-threshold.patch | 48 ------- .../0171-Auto-Save-Improvements.patch | 142 +++++++++++++++++++++ .../0171-Configurable-flying-kick-messages.patch | 47 ------- .../0172-Auto-Save-Improvements.patch | 142 --------------------- .../0172-Chunk-registration-fixes.patch | 25 ++++ .../0173-Chunk-registration-fixes.patch | 25 ---- ...NMS-Data-Conversion-post-ItemMeta-on-Copy.patch | 65 ++++++++++ ...NMS-Data-Conversion-post-ItemMeta-on-Copy.patch | 65 ---------- ...ingHook-reference-on-Craft-Entity-removal.patch | 30 +++++ ...175-Auto-fix-bad-Y-levels-on-player-login.patch | 22 ++++ ...ingHook-reference-on-Craft-Entity-removal.patch | 30 ----- ...176-Auto-fix-bad-Y-levels-on-player-login.patch | 22 ---- ...ise-string-limit-for-packet-serialization.patch | 27 ++++ .../0177-Disable-Vanilla-Chunk-GC.patch | 33 +++++ ...ise-string-limit-for-packet-serialization.patch | 27 ---- .../0178-Disable-Vanilla-Chunk-GC.patch | 33 ----- 35 files changed, 705 insertions(+), 824 deletions(-) create mode 100644 Spigot-Server-Patches/0161-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch delete mode 100644 Spigot-Server-Patches/0161-Don-t-try-and-fix-TileEntities-as-they-are-removed.patch delete mode 100644 Spigot-Server-Patches/0162-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch create mode 100644 Spigot-Server-Patches/0162-More-informative-vehicle-moved-wrongly-message.patch delete mode 100644 Spigot-Server-Patches/0163-More-informative-vehicle-moved-wrongly-message.patch create mode 100644 Spigot-Server-Patches/0163-Re-track-players-that-dismount-from-other-players.patch create mode 100644 Spigot-Server-Patches/0164-Add-setting-for-proxy-online-mode-status.patch delete mode 100644 Spigot-Server-Patches/0164-Re-track-players-that-dismount-from-other-players.patch delete mode 100644 Spigot-Server-Patches/0165-Add-setting-for-proxy-online-mode-status.patch create mode 100644 Spigot-Server-Patches/0165-Optimise-BlockStateEnum-hashCode-and-equals.patch create mode 100644 Spigot-Server-Patches/0166-Disable-ticking-of-snow-blocks.patch delete mode 100644 Spigot-Server-Patches/0166-Optimise-BlockStateEnum-hashCode-and-equals.patch create mode 100644 Spigot-Server-Patches/0167-Convert-new-health-to-a-float-during-set.patch delete mode 100644 Spigot-Server-Patches/0167-Disable-ticking-of-snow-blocks.patch delete mode 100644 Spigot-Server-Patches/0168-Convert-new-health-to-a-float-during-set.patch create mode 100644 Spigot-Server-Patches/0168-Fix-AIOOBE-in-inventory-handling.patch create mode 100644 Spigot-Server-Patches/0169-Configurable-packet-in-spam-threshold.patch delete mode 100644 Spigot-Server-Patches/0169-Fix-AIOOBE-in-inventory-handling.patch create mode 100644 Spigot-Server-Patches/0170-Configurable-flying-kick-messages.patch delete mode 100644 Spigot-Server-Patches/0170-Configurable-packet-in-spam-threshold.patch create mode 100644 Spigot-Server-Patches/0171-Auto-Save-Improvements.patch delete mode 100644 Spigot-Server-Patches/0171-Configurable-flying-kick-messages.patch delete mode 100644 Spigot-Server-Patches/0172-Auto-Save-Improvements.patch create mode 100644 Spigot-Server-Patches/0172-Chunk-registration-fixes.patch delete mode 100644 Spigot-Server-Patches/0173-Chunk-registration-fixes.patch create mode 100644 Spigot-Server-Patches/0173-Process-NMS-Data-Conversion-post-ItemMeta-on-Copy.patch delete mode 100644 Spigot-Server-Patches/0174-Process-NMS-Data-Conversion-post-ItemMeta-on-Copy.patch create mode 100644 Spigot-Server-Patches/0174-Remove-FishingHook-reference-on-Craft-Entity-removal.patch create mode 100644 Spigot-Server-Patches/0175-Auto-fix-bad-Y-levels-on-player-login.patch delete mode 100644 Spigot-Server-Patches/0175-Remove-FishingHook-reference-on-Craft-Entity-removal.patch delete mode 100644 Spigot-Server-Patches/0176-Auto-fix-bad-Y-levels-on-player-login.patch create mode 100644 Spigot-Server-Patches/0176-Raise-string-limit-for-packet-serialization.patch create mode 100644 Spigot-Server-Patches/0177-Disable-Vanilla-Chunk-GC.patch delete mode 100644 Spigot-Server-Patches/0177-Raise-string-limit-for-packet-serialization.patch delete mode 100644 Spigot-Server-Patches/0178-Disable-Vanilla-Chunk-GC.patch diff --git a/Spigot-Server-Patches/0161-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch b/Spigot-Server-Patches/0161-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch new file mode 100644 index 0000000000..e295471011 --- /dev/null +++ b/Spigot-Server-Patches/0161-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch @@ -0,0 +1,22 @@ +From fe188eddc55c94500583679f02ce99c1a45c4843 Mon Sep 17 00:00:00 2001 +From: Zach Brown +Date: Sat, 16 Jul 2016 19:11:17 -0500 +Subject: [PATCH] Don't lookup game profiles that have no UUID and no name + + +diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java +index 989758c..1c619c5 100644 +--- a/src/main/java/net/minecraft/server/UserCache.java ++++ b/src/main/java/net/minecraft/server/UserCache.java +@@ -86,7 +86,7 @@ public class UserCache { + }; + + gameprofilerepository.findProfilesByNames(new String[] { s}, Agent.MINECRAFT, profilelookupcallback); +- if (!d() && agameprofile[0] == null) { ++ if (!d() && agameprofile[0] == null && !org.apache.commons.lang3.StringUtils.isBlank(s)) { // Paper - Don't lookup a profile with a blank name + UUID uuid = EntityHuman.a(new GameProfile((UUID) null, s)); + GameProfile gameprofile = new GameProfile(uuid, s); + +-- +2.10.0 + diff --git a/Spigot-Server-Patches/0161-Don-t-try-and-fix-TileEntities-as-they-are-removed.patch b/Spigot-Server-Patches/0161-Don-t-try-and-fix-TileEntities-as-they-are-removed.patch deleted file mode 100644 index 41ad00d1ac..0000000000 --- a/Spigot-Server-Patches/0161-Don-t-try-and-fix-TileEntities-as-they-are-removed.patch +++ /dev/null @@ -1,119 +0,0 @@ -From b9c0f03504ca656ebe63b673f857b6ef62759c30 Mon Sep 17 00:00:00 2001 -From: Zach Brown -Date: Sat, 25 Jun 2016 23:55:56 -0500 -Subject: [PATCH] Don't try and fix TileEntities as they are removed - -Currently, CraftBukkit tries to fix TEs that do not match the present block at the location. This is normally good, -however, this same fixer runs when the TE removal functions go through to remove a TE after its block has been changed. -So a block will be changed, the server will attempt to remove the TE present, but will then get caught up in CB's overzealous -TE fixer. That fixer checks the block against the TE present, and throws a fit because it doesn't match. Which is why we're -removing it in the first place. - -The 'fix' to this issue is to skip the fixer entirely when we're removing the TE, as it shouldn't ever need to run -then anyway, we're removing it. - -diff --git a/src/main/java/net/minecraft/server/BlockChest.java b/src/main/java/net/minecraft/server/BlockChest.java -index a5f2fc0..ef525ea 100644 ---- a/src/main/java/net/minecraft/server/BlockChest.java -+++ b/src/main/java/net/minecraft/server/BlockChest.java -@@ -288,7 +288,7 @@ public class BlockChest extends BlockTileEntity { - } - - public void remove(World world, BlockPosition blockposition, IBlockData iblockdata) { -- TileEntity tileentity = world.getTileEntity(blockposition); -+ TileEntity tileentity = world.getTileEntity(blockposition, true); // Paper - This is being removed, don't fix - - if (tileentity instanceof IInventory) { - InventoryUtils.dropInventory(world, blockposition, (IInventory) tileentity); -diff --git a/src/main/java/net/minecraft/server/BlockDispenser.java b/src/main/java/net/minecraft/server/BlockDispenser.java -index 024ce36..c423663 100644 ---- a/src/main/java/net/minecraft/server/BlockDispenser.java -+++ b/src/main/java/net/minecraft/server/BlockDispenser.java -@@ -144,7 +144,7 @@ public class BlockDispenser extends BlockTileEntity { - } - - public void remove(World world, BlockPosition blockposition, IBlockData iblockdata) { -- TileEntity tileentity = world.getTileEntity(blockposition); -+ TileEntity tileentity = world.getTileEntity(blockposition, true); // Paper - This is being removed, don't fix - - if (tileentity instanceof TileEntityDispenser) { - InventoryUtils.dropInventory(world, blockposition, (TileEntityDispenser) tileentity); -diff --git a/src/main/java/net/minecraft/server/BlockFurnace.java b/src/main/java/net/minecraft/server/BlockFurnace.java -index 25f7b4b..898be91 100644 ---- a/src/main/java/net/minecraft/server/BlockFurnace.java -+++ b/src/main/java/net/minecraft/server/BlockFurnace.java -@@ -109,7 +109,7 @@ public class BlockFurnace extends BlockTileEntity { - - public void remove(World world, BlockPosition blockposition, IBlockData iblockdata) { - if (!BlockFurnace.c) { -- TileEntity tileentity = world.getTileEntity(blockposition); -+ TileEntity tileentity = world.getTileEntity(blockposition, true); // Paper - This is being removed, don't fix - - if (tileentity instanceof TileEntityFurnace) { - InventoryUtils.dropInventory(world, blockposition, (TileEntityFurnace) tileentity); -diff --git a/src/main/java/net/minecraft/server/BlockSkull.java b/src/main/java/net/minecraft/server/BlockSkull.java -index 404793a..0d4d29b 100644 ---- a/src/main/java/net/minecraft/server/BlockSkull.java -+++ b/src/main/java/net/minecraft/server/BlockSkull.java -@@ -122,7 +122,7 @@ public class BlockSkull extends BlockTileEntity { - // if (!((Boolean) iblockdata.get(BlockSkull.NODROP)).booleanValue()) { - if (false) { - // CraftBukkit end -- TileEntity tileentity = world.getTileEntity(blockposition); -+ TileEntity tileentity = world.getTileEntity(blockposition, true); // Paper - This is being removed, don't fix - - if (tileentity instanceof TileEntitySkull) { - TileEntitySkull tileentityskull = (TileEntitySkull) tileentity; -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index f7d9a7c..383eef2 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -2071,8 +2071,14 @@ public abstract class World implements IBlockAccess { - } - - public Map capturedTileEntities = Maps.newHashMap(); -+ // Paper start - Add additional param so we can ignore fixing on removals - @Nullable - public TileEntity getTileEntity(BlockPosition blockposition) { -+ return getTileEntity(blockposition, false); -+ } -+ -+ public TileEntity getTileEntity(BlockPosition blockposition, boolean isRemoving) { -+ // Paper end - if (blockposition.isInvalidYLocation()) { // Paper - return null; - } else { -@@ -2149,7 +2155,7 @@ public abstract class World implements IBlockAccess { - } - - public void s(BlockPosition blockposition) { -- TileEntity tileentity = this.getTileEntity(blockposition); -+ TileEntity tileentity = this.getTileEntity(blockposition, true); // Paper - This is being removed, don't fix - - if (tileentity != null && this.M) { - tileentity.y(); -diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 87abf7f..5ed6d3e 100644 ---- a/src/main/java/net/minecraft/server/WorldServer.java -+++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -123,8 +123,16 @@ public class WorldServer extends World implements IAsyncTaskHandler { - - // CraftBukkit start - @Override -+ // Paper start - Add additional param so we can ignore fixing on removals - public TileEntity getTileEntity(BlockPosition pos) { -- TileEntity result = super.getTileEntity(pos); -+ return getTileEntity(pos, false); -+ } -+ -+ @Override -+ public TileEntity getTileEntity(BlockPosition pos, boolean isRemoving) { -+ TileEntity result = super.getTileEntity(pos, isRemoving); -+ if (isRemoving) return result; -+ // Paper end - Block type = getType(pos).getBlock(); - - if (type == Blocks.CHEST || type == Blocks.TRAPPED_CHEST) { // Spigot --- -2.10.0.windows.1 - diff --git a/Spigot-Server-Patches/0162-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch b/Spigot-Server-Patches/0162-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch deleted file mode 100644 index 64f7357f80..0000000000 --- a/Spigot-Server-Patches/0162-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch +++ /dev/null @@ -1,22 +0,0 @@ -From e972102cd812e252b5ad14ae0254c4b060a50907 Mon Sep 17 00:00:00 2001 -From: Zach Brown -Date: Sat, 16 Jul 2016 19:11:17 -0500 -Subject: [PATCH] Don't lookup game profiles that have no UUID and no name - - -diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java -index 989758c..1c619c5 100644 ---- a/src/main/java/net/minecraft/server/UserCache.java -+++ b/src/main/java/net/minecraft/server/UserCache.java -@@ -86,7 +86,7 @@ public class UserCache { - }; - - gameprofilerepository.findProfilesByNames(new String[] { s}, Agent.MINECRAFT, profilelookupcallback); -- if (!d() && agameprofile[0] == null) { -+ if (!d() && agameprofile[0] == null && !org.apache.commons.lang3.StringUtils.isBlank(s)) { // Paper - Don't lookup a profile with a blank name - UUID uuid = EntityHuman.a(new GameProfile((UUID) null, s)); - GameProfile gameprofile = new GameProfile(uuid, s); - --- -2.10.0.windows.1 - diff --git a/Spigot-Server-Patches/0162-More-informative-vehicle-moved-wrongly-message.patch b/Spigot-Server-Patches/0162-More-informative-vehicle-moved-wrongly-message.patch new file mode 100644 index 0000000000..ec7976a87c --- /dev/null +++ b/Spigot-Server-Patches/0162-More-informative-vehicle-moved-wrongly-message.patch @@ -0,0 +1,22 @@ +From fa32cabbc0e1c0a33e370ba2732f40c7f06823f9 Mon Sep 17 00:00:00 2001 +From: Zach Brown +Date: Thu, 28 Jul 2016 17:58:53 -0500 +Subject: [PATCH] More informative vehicle moved wrongly message + + +diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java +index b6dfffc..972b85b 100644 +--- a/src/main/java/net/minecraft/server/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/PlayerConnection.java +@@ -343,7 +343,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { + + if (d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot + flag1 = true; +- PlayerConnection.LOGGER.warn("{} moved wrongly!", new Object[] { entity.getName()}); ++ PlayerConnection.LOGGER.warn(entity.getName() + " (vehicle of " + this.player.getName() + ") moved wrongly!"); // Paper - More informative + } + + entity.setLocation(d3, d4, d5, f, f1); +-- +2.10.0 + diff --git a/Spigot-Server-Patches/0163-More-informative-vehicle-moved-wrongly-message.patch b/Spigot-Server-Patches/0163-More-informative-vehicle-moved-wrongly-message.patch deleted file mode 100644 index 1c5f6fc334..0000000000 --- a/Spigot-Server-Patches/0163-More-informative-vehicle-moved-wrongly-message.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 559fff38085830930c7e8c381e505aafb7cec4d8 Mon Sep 17 00:00:00 2001 -From: Zach Brown -Date: Thu, 28 Jul 2016 17:58:53 -0500 -Subject: [PATCH] More informative vehicle moved wrongly message - - -diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 9911265..90f2247 100644 ---- a/src/main/java/net/minecraft/server/PlayerConnection.java -+++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -343,7 +343,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { - - if (d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot - flag1 = true; -- PlayerConnection.LOGGER.warn("{} moved wrongly!", new Object[] { entity.getName()}); -+ PlayerConnection.LOGGER.warn(entity.getName() + " (vehicle of " + this.player.getName() + ") moved wrongly!"); // Paper - More informative - } - - entity.setLocation(d3, d4, d5, f, f1); --- -2.10.0.windows.1 - diff --git a/Spigot-Server-Patches/0163-Re-track-players-that-dismount-from-other-players.patch b/Spigot-Server-Patches/0163-Re-track-players-that-dismount-from-other-players.patch new file mode 100644 index 0000000000..d808228128 --- /dev/null +++ b/Spigot-Server-Patches/0163-Re-track-players-that-dismount-from-other-players.patch @@ -0,0 +1,27 @@ +From 43cab707048fcf57959710da853803e5c7b0f1e1 Mon Sep 17 00:00:00 2001 +From: Zach Brown +Date: Sun, 31 Jul 2016 16:33:03 -0500 +Subject: [PATCH] Re-track players that dismount from other players + + +diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java +index d084fc2..ec3a60a 100644 +--- a/src/main/java/net/minecraft/server/EntityPlayer.java ++++ b/src/main/java/net/minecraft/server/EntityPlayer.java +@@ -648,6 +648,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + if (entity1 != entity && this.playerConnection != null) { + this.playerConnection.a(this.locX, this.locY, this.locZ, this.yaw, this.pitch); + } ++ // Paper start - "Fixes" an issue in which the vehicle player would not be notified that the passenger dismounted ++ if (entity instanceof EntityPlayer) { ++ WorldServer worldServer = (WorldServer) entity.getWorld(); ++ worldServer.tracker.untrackEntity(this); ++ worldServer.tracker.track(this); ++ } ++ // Paper end + + } + +-- +2.10.0 + diff --git a/Spigot-Server-Patches/0164-Add-setting-for-proxy-online-mode-status.patch b/Spigot-Server-Patches/0164-Add-setting-for-proxy-online-mode-status.patch new file mode 100644 index 0000000000..5fb6ba2975 --- /dev/null +++ b/Spigot-Server-Patches/0164-Add-setting-for-proxy-online-mode-status.patch @@ -0,0 +1,51 @@ +From c8174cd77412dae0abef65ec95504e78645689fb Mon Sep 17 00:00:00 2001 +From: Gabriele C +Date: Fri, 5 Aug 2016 01:03:08 +0200 +Subject: [PATCH] Add setting for proxy online mode status + + +diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java +index ecf18eb..91546b6 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java +@@ -220,4 +220,9 @@ public class PaperConfig { + private static void saveEmptyScoreboardTeams() { + saveEmptyScoreboardTeams = getBoolean("settings.save-empty-scoreboard-teams", false); + } ++ ++ public static boolean bungeeOnlineMode = true; ++ private static void bungeeOnlineMode() { ++ bungeeOnlineMode = getBoolean("settings.bungee-online-mode", true); ++ } + } +diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java +index e21a8c4..41f6300 100644 +--- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java ++++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java +@@ -65,7 +65,8 @@ public class NameReferencingFileConverter { + } + }), String.class); + +- if (minecraftserver.getOnlineMode() || org.spigotmc.SpigotConfig.bungee) { // Spigot: bungee = online mode, for now. ++ if (minecraftserver.getOnlineMode() ++ || (org.spigotmc.SpigotConfig.bungee && com.destroystokyo.paper.PaperConfig.bungeeOnlineMode)) { // Spigot: bungee = online mode, for now. // Paper - Handle via setting + minecraftserver.getGameProfileRepository().findProfilesByNames(astring, Agent.MINECRAFT, profilelookupcallback); + } else { + String[] astring1 = astring; +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +index 100142e..4fb9c5e 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +@@ -1350,7 +1350,8 @@ public final class CraftServer implements Server { + // Spigot Start + GameProfile profile = null; + // Only fetch an online UUID in online mode +- if ( MinecraftServer.getServer().getOnlineMode() || org.spigotmc.SpigotConfig.bungee ) ++ if ( MinecraftServer.getServer().getOnlineMode() ++ || (org.spigotmc.SpigotConfig.bungee && com.destroystokyo.paper.PaperConfig.bungeeOnlineMode)) // Paper - Handle via setting + { + profile = console.getUserCache().getProfile( name ); + } +-- +2.10.0 + diff --git a/Spigot-Server-Patches/0164-Re-track-players-that-dismount-from-other-players.patch b/Spigot-Server-Patches/0164-Re-track-players-that-dismount-from-other-players.patch deleted file mode 100644 index 2b51ba8c9a..0000000000 --- a/Spigot-Server-Patches/0164-Re-track-players-that-dismount-from-other-players.patch +++ /dev/null @@ -1,27 +0,0 @@ -From b7fff98e508a6e9bcb41fb6d11e6328d4a7de102 Mon Sep 17 00:00:00 2001 -From: Zach Brown -Date: Sun, 31 Jul 2016 16:33:03 -0500 -Subject: [PATCH] Re-track players that dismount from other players - - -diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index d084fc2..ec3a60a 100644 ---- a/src/main/java/net/minecraft/server/EntityPlayer.java -+++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -648,6 +648,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting { - if (entity1 != entity && this.playerConnection != null) { - this.playerConnection.a(this.locX, this.locY, this.locZ, this.yaw, this.pitch); - } -+ // Paper start - "Fixes" an issue in which the vehicle player would not be notified that the passenger dismounted -+ if (entity instanceof EntityPlayer) { -+ WorldServer worldServer = (WorldServer) entity.getWorld(); -+ worldServer.tracker.untrackEntity(this); -+ worldServer.tracker.track(this); -+ } -+ // Paper end - - } - --- -2.10.0.windows.1 - diff --git a/Spigot-Server-Patches/0165-Add-setting-for-proxy-online-mode-status.patch b/Spigot-Server-Patches/0165-Add-setting-for-proxy-online-mode-status.patch deleted file mode 100644 index 38c8618c0d..0000000000 --- a/Spigot-Server-Patches/0165-Add-setting-for-proxy-online-mode-status.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 6b5df38a5b989dff9296d93f1c27f18559b22cd9 Mon Sep 17 00:00:00 2001 -From: Gabriele C -Date: Fri, 5 Aug 2016 01:03:08 +0200 -Subject: [PATCH] Add setting for proxy online mode status - - -diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 82e6365..f40440f 100644 ---- a/src/main/java/com/destroystokyo/paper/PaperConfig.java -+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java -@@ -220,4 +220,9 @@ public class PaperConfig { - private static void saveEmptyScoreboardTeams() { - saveEmptyScoreboardTeams = getBoolean("settings.save-empty-scoreboard-teams", false); - } -+ -+ public static boolean bungeeOnlineMode = true; -+ private static void bungeeOnlineMode() { -+ bungeeOnlineMode = getBoolean("settings.bungee-online-mode", true); -+ } - } -diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java -index e21a8c4..41f6300 100644 ---- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java -+++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java -@@ -65,7 +65,8 @@ public class NameReferencingFileConverter { - } - }), String.class); - -- if (minecraftserver.getOnlineMode() || org.spigotmc.SpigotConfig.bungee) { // Spigot: bungee = online mode, for now. -+ if (minecraftserver.getOnlineMode() -+ || (org.spigotmc.SpigotConfig.bungee && com.destroystokyo.paper.PaperConfig.bungeeOnlineMode)) { // Spigot: bungee = online mode, for now. // Paper - Handle via setting - minecraftserver.getGameProfileRepository().findProfilesByNames(astring, Agent.MINECRAFT, profilelookupcallback); - } else { - String[] astring1 = astring; -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 100142e..4fb9c5e 100644 ---- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java -+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1350,7 +1350,8 @@ public final class CraftServer implements Server { - // Spigot Start - GameProfile profile = null; - // Only fetch an online UUID in online mode -- if ( MinecraftServer.getServer().getOnlineMode() || org.spigotmc.SpigotConfig.bungee ) -+ if ( MinecraftServer.getServer().getOnlineMode() -+ || (org.spigotmc.SpigotConfig.bungee && com.destroystokyo.paper.PaperConfig.bungeeOnlineMode)) // Paper - Handle via setting - { - profile = console.getUserCache().getProfile( name ); - } --- -2.10.0.windows.1 - diff --git a/Spigot-Server-Patches/0165-Optimise-BlockStateEnum-hashCode-and-equals.patch b/Spigot-Server-Patches/0165-Optimise-BlockStateEnum-hashCode-and-equals.patch new file mode 100644 index 0000000000..8ea40947d3 --- /dev/null +++ b/Spigot-Server-Patches/0165-Optimise-BlockStateEnum-hashCode-and-equals.patch @@ -0,0 +1,62 @@ +From a1bfad07929148b106e494ae6e1ae158f987755c Mon Sep 17 00:00:00 2001 +From: Alfie Cleveland +Date: Fri, 19 Aug 2016 01:52:56 +0100 +Subject: [PATCH] Optimise BlockStateEnum hashCode and equals + + +diff --git a/src/main/java/net/minecraft/server/BlockStateEnum.java b/src/main/java/net/minecraft/server/BlockStateEnum.java +index 288c52c..66c459d 100644 +--- a/src/main/java/net/minecraft/server/BlockStateEnum.java ++++ b/src/main/java/net/minecraft/server/BlockStateEnum.java +@@ -16,6 +16,11 @@ public class BlockStateEnum & INamable> extends BlockState + private final ImmutableSet a; + private final Map b = Maps.newHashMap(); + ++ // Paper start - BlockStateEnum is a singleton, so we can use our own hashCode ++ private static int hashId = 0; ++ private int hashCode; ++ // Paper end ++ + protected BlockStateEnum(String s, Class oclass, Collection collection) { + super(s, oclass); + this.a = ImmutableSet.copyOf(collection); +@@ -32,6 +37,7 @@ public class BlockStateEnum & INamable> extends BlockState + this.b.put(s1, (T) oenum); + } + ++ this.hashCode = hashId++; // Paper + } + + public Collection c() { +@@ -46,24 +52,14 @@ public class BlockStateEnum & INamable> extends BlockState + return ((INamable) t0).getName(); + } + ++ @Override // Paper - override equals as BlockStateEnum is a singleton + public boolean equals(Object object) { +- if (this == object) { +- return true; +- } else if (object instanceof BlockStateEnum && super.equals(object)) { +- BlockStateEnum blockstateenum = (BlockStateEnum) object; +- +- return this.a.equals(blockstateenum.a) && this.b.equals(blockstateenum.b); +- } else { +- return false; +- } ++ return this == object; + } + ++ @Override // Paper - override hashCode as BlockStateEnum is a singleton + public int hashCode() { +- int i = super.hashCode(); +- +- i = 31 * i + this.a.hashCode(); +- i = 31 * i + this.b.hashCode(); +- return i; ++ return hashCode; + } + + public static & INamable> BlockStateEnum of(String s, Class oclass) { +-- +2.10.0 + diff --git a/Spigot-Server-Patches/0166-Disable-ticking-of-snow-blocks.patch b/Spigot-Server-Patches/0166-Disable-ticking-of-snow-blocks.patch new file mode 100644 index 0000000000..0398667a71 --- /dev/null +++ b/Spigot-Server-Patches/0166-Disable-ticking-of-snow-blocks.patch @@ -0,0 +1,38 @@ +From 1bb2986f9b28b8ce72d4edcd0c202190261856c6 Mon Sep 17 00:00:00 2001 +From: killme +Date: Tue, 30 Aug 2016 16:39:48 +0200 +Subject: [PATCH] Disable ticking of snow blocks + + +diff --git a/src/main/java/net/minecraft/server/BlockSnowBlock.java b/src/main/java/net/minecraft/server/BlockSnowBlock.java +index 1c43a37..a3b1998 100644 +--- a/src/main/java/net/minecraft/server/BlockSnowBlock.java ++++ b/src/main/java/net/minecraft/server/BlockSnowBlock.java +@@ -7,7 +7,7 @@ public class BlockSnowBlock extends Block { + + protected BlockSnowBlock() { + super(Material.SNOW_BLOCK); +- this.a(true); ++ // this.a(true); // Paper - snow blocks don't need to tick + this.a(CreativeModeTab.b); + } + +@@ -20,6 +20,8 @@ public class BlockSnowBlock extends Block { + return 4; + } + ++ // Paper start - snow blocks don't need to tick ++ /* + public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) { + if (world.b(EnumSkyBlock.BLOCK, blockposition) > 11) { + this.b(world, blockposition, world.getType(blockposition), 0); +@@ -27,4 +29,6 @@ public class BlockSnowBlock extends Block { + } + + } ++ */ ++ //Paper end + } +-- +2.10.0 + diff --git a/Spigot-Server-Patches/0166-Optimise-BlockStateEnum-hashCode-and-equals.patch b/Spigot-Server-Patches/0166-Optimise-BlockStateEnum-hashCode-and-equals.patch deleted file mode 100644 index 51d2439274..0000000000 --- a/Spigot-Server-Patches/0166-Optimise-BlockStateEnum-hashCode-and-equals.patch +++ /dev/null @@ -1,62 +0,0 @@ -From f4ce497b75a49f07923d20fe17383d5e90133202 Mon Sep 17 00:00:00 2001 -From: Alfie Cleveland -Date: Fri, 19 Aug 2016 01:52:56 +0100 -Subject: [PATCH] Optimise BlockStateEnum hashCode and equals - - -diff --git a/src/main/java/net/minecraft/server/BlockStateEnum.java b/src/main/java/net/minecraft/server/BlockStateEnum.java -index 288c52c..66c459d 100644 ---- a/src/main/java/net/minecraft/server/BlockStateEnum.java -+++ b/src/main/java/net/minecraft/server/BlockStateEnum.java -@@ -16,6 +16,11 @@ public class BlockStateEnum & INamable> extends BlockState - private final ImmutableSet a; - private final Map b = Maps.newHashMap(); - -+ // Paper start - BlockStateEnum is a singleton, so we can use our own hashCode -+ private static int hashId = 0; -+ private int hashCode; -+ // Paper end -+ - protected BlockStateEnum(String s, Class oclass, Collection collection) { - super(s, oclass); - this.a = ImmutableSet.copyOf(collection); -@@ -32,6 +37,7 @@ public class BlockStateEnum & INamable> extends BlockState - this.b.put(s1, (T) oenum); - } - -+ this.hashCode = hashId++; // Paper - } - - public Collection c() { -@@ -46,24 +52,14 @@ public class BlockStateEnum & INamable> extends BlockState - return ((INamable) t0).getName(); - } - -+ @Override // Paper - override equals as BlockStateEnum is a singleton - public boolean equals(Object object) { -- if (this == object) { -- return true; -- } else if (object instanceof BlockStateEnum && super.equals(object)) { -- BlockStateEnum blockstateenum = (BlockStateEnum) object; -- -- return this.a.equals(blockstateenum.a) && this.b.equals(blockstateenum.b); -- } else { -- return false; -- } -+ return this == object; - } - -+ @Override // Paper - override hashCode as BlockStateEnum is a singleton - public int hashCode() { -- int i = super.hashCode(); -- -- i = 31 * i + this.a.hashCode(); -- i = 31 * i + this.b.hashCode(); -- return i; -+ return hashCode; - } - - public static & INamable> BlockStateEnum of(String s, Class oclass) { --- -2.10.0.windows.1 - diff --git a/Spigot-Server-Patches/0167-Convert-new-health-to-a-float-during-set.patch b/Spigot-Server-Patches/0167-Convert-new-health-to-a-float-during-set.patch new file mode 100644 index 0000000000..a9e79e25f8 --- /dev/null +++ b/Spigot-Server-Patches/0167-Convert-new-health-to-a-float-during-set.patch @@ -0,0 +1,22 @@ +From 87609705a4c0c86119a8deeb7f4b31325cca030a Mon Sep 17 00:00:00 2001 +From: kashike +Date: Thu, 1 Sep 2016 09:51:31 +0000 +Subject: [PATCH] Convert new health to a float during set + +Convert the new health value to a float before doing any validation logic + +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +index b807a3f..9e19e7c 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +@@ -91,6 +91,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { + } + + public void setHealth(double health) { ++ health = (float) health; // Paper - convert health to a float during set to avoid the below error + if ((health < 0) || (health > getMaxHealth())) { + // Paper - Be more informative + throw new IllegalArgumentException("Health must be between 0 and " + getMaxHealth() + ", but was " + health +-- +2.10.0 + diff --git a/Spigot-Server-Patches/0167-Disable-ticking-of-snow-blocks.patch b/Spigot-Server-Patches/0167-Disable-ticking-of-snow-blocks.patch deleted file mode 100644 index 6827852b31..0000000000 --- a/Spigot-Server-Patches/0167-Disable-ticking-of-snow-blocks.patch +++ /dev/null @@ -1,38 +0,0 @@ -From f2cbfdf2075c15a632cecaa3d7885a7479ef9c95 Mon Sep 17 00:00:00 2001 -From: killme -Date: Tue, 30 Aug 2016 16:39:48 +0200 -Subject: [PATCH] Disable ticking of snow blocks - - -diff --git a/src/main/java/net/minecraft/server/BlockSnowBlock.java b/src/main/java/net/minecraft/server/BlockSnowBlock.java -index 1c43a37..a3b1998 100644 ---- a/src/main/java/net/minecraft/server/BlockSnowBlock.java -+++ b/src/main/java/net/minecraft/server/BlockSnowBlock.java -@@ -7,7 +7,7 @@ public class BlockSnowBlock extends Block { - - protected BlockSnowBlock() { - super(Material.SNOW_BLOCK); -- this.a(true); -+ // this.a(true); // Paper - snow blocks don't need to tick - this.a(CreativeModeTab.b); - } - -@@ -20,6 +20,8 @@ public class BlockSnowBlock extends Block { - return 4; - } - -+ // Paper start - snow blocks don't need to tick -+ /* - public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) { - if (world.b(EnumSkyBlock.BLOCK, blockposition) > 11) { - this.b(world, blockposition, world.getType(blockposition), 0); -@@ -27,4 +29,6 @@ public class BlockSnowBlock extends Block { - } - - } -+ */ -+ //Paper end - } --- -2.10.0.windows.1 - diff --git a/Spigot-Server-Patches/0168-Convert-new-health-to-a-float-during-set.patch b/Spigot-Server-Patches/0168-Convert-new-health-to-a-float-during-set.patch deleted file mode 100644 index a86bc0c524..0000000000 --- a/Spigot-Server-Patches/0168-Convert-new-health-to-a-float-during-set.patch +++ /dev/null @@ -1,22 +0,0 @@ -From d99c319cab6c38f3ca1eb048cd23af14d66a25a6 Mon Sep 17 00:00:00 2001 -From: kashike -Date: Thu, 1 Sep 2016 09:51:31 +0000 -Subject: [PATCH] Convert new health to a float during set - -Convert the new health value to a float before doing any validation logic - -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index b807a3f..9e19e7c 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -91,6 +91,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { - } - - public void setHealth(double health) { -+ health = (float) health; // Paper - convert health to a float during set to avoid the below error - if ((health < 0) || (health > getMaxHealth())) { - // Paper - Be more informative - throw new IllegalArgumentException("Health must be between 0 and " + getMaxHealth() + ", but was " + health --- -2.10.0.windows.1 - diff --git a/Spigot-Server-Patches/0168-Fix-AIOOBE-in-inventory-handling.patch b/Spigot-Server-Patches/0168-Fix-AIOOBE-in-inventory-handling.patch new file mode 100644 index 0000000000..0c0106da48 --- /dev/null +++ b/Spigot-Server-Patches/0168-Fix-AIOOBE-in-inventory-handling.patch @@ -0,0 +1,22 @@ +From c0bf573cbb3f25ec137f12dcfccf400e38debba2 Mon Sep 17 00:00:00 2001 +From: Brokkonaut +Date: Sun, 4 Sep 2016 16:35:43 -0500 +Subject: [PATCH] Fix AIOOBE in inventory handling + + +diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java +index 972b85b..50b23ed 100644 +--- a/src/main/java/net/minecraft/server/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/PlayerConnection.java +@@ -1822,7 +1822,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { + case CLONE: + if (packetplayinwindowclick.c() == 2) { + click = ClickType.MIDDLE; +- if (packetplayinwindowclick.b() == -999) { ++ if (packetplayinwindowclick.b() < 0) { // Paper - GH-404 + action = InventoryAction.NOTHING; + } else { + Slot slot = this.player.activeContainer.getSlot(packetplayinwindowclick.b()); +-- +2.10.0 + diff --git a/Spigot-Server-Patches/0169-Configurable-packet-in-spam-threshold.patch b/Spigot-Server-Patches/0169-Configurable-packet-in-spam-threshold.patch new file mode 100644 index 0000000000..8e6513198e --- /dev/null +++ b/Spigot-Server-Patches/0169-Configurable-packet-in-spam-threshold.patch @@ -0,0 +1,48 @@ +From 09d45262f0de84815a53417f657bdb605018887b Mon Sep 17 00:00:00 2001 +From: Zach Brown +Date: Sun, 11 Sep 2016 14:30:57 -0500 +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 91546b6..211b88a 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java +@@ -225,4 +225,13 @@ public class PaperConfig { + private static void bungeeOnlineMode() { + bungeeOnlineMode = getBoolean("settings.bungee-online-mode", true); + } ++ ++ public static int packetInSpamThreshold = 300; ++ private static void packetInSpamThreshold() { ++ if (version < 11) { ++ int oldValue = getInt("settings.play-in-use-item-spam-threshold", 300); ++ set("settings.incoming-packet-spam-threshold", oldValue); ++ } ++ packetInSpamThreshold = getInt("settings.incoming-packet-spam-threshold", 300); ++ } + } +diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java +index 50b23ed..29653cf 100644 +--- a/src/main/java/net/minecraft/server/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/PlayerConnection.java +@@ -868,13 +868,14 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { + // Spigot start - limit place/interactions + private int limitedPackets; + private long lastLimitedPacket = -1; ++ private static final int THRESHOLD = com.destroystokyo.paper.PaperConfig.packetInSpamThreshold; // Paper - Configurable threshold + + private boolean checkLimit(long timestamp) { +- if (lastLimitedPacket != -1 && timestamp - lastLimitedPacket < 30 && limitedPackets++ >= 4) { ++ if (lastLimitedPacket != -1 && timestamp - lastLimitedPacket < THRESHOLD && limitedPackets++ >= 4) { // Paper + return false; + } + +- if (lastLimitedPacket == -1 || timestamp - lastLimitedPacket >= 30) { ++ if (lastLimitedPacket == -1 || timestamp - lastLimitedPacket >= THRESHOLD) { // Paper + lastLimitedPacket = timestamp; + limitedPackets = 0; + return true; +-- +2.10.0 + diff --git a/Spigot-Server-Patches/0169-Fix-AIOOBE-in-inventory-handling.patch b/Spigot-Server-Patches/0169-Fix-AIOOBE-in-inventory-handling.patch deleted file mode 100644 index ccbab84ff8..0000000000 --- a/Spigot-Server-Patches/0169-Fix-AIOOBE-in-inventory-handling.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 8debac859916f49cb64523bc834de01bb25baeb9 Mon Sep 17 00:00:00 2001 -From: Brokkonaut -Date: Sun, 4 Sep 2016 16:35:43 -0500 -Subject: [PATCH] Fix AIOOBE in inventory handling - - -diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 972b85b..50b23ed 100644 ---- a/src/main/java/net/minecraft/server/PlayerConnection.java -+++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1822,7 +1822,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { - case CLONE: - if (packetplayinwindowclick.c() == 2) { - click = ClickType.MIDDLE; -- if (packetplayinwindowclick.b() == -999) { -+ if (packetplayinwindowclick.b() < 0) { // Paper - GH-404 - action = InventoryAction.NOTHING; - } else { - Slot slot = this.player.activeContainer.getSlot(packetplayinwindowclick.b()); --- -2.10.0.windows.1 - diff --git a/Spigot-Server-Patches/0170-Configurable-flying-kick-messages.patch b/Spigot-Server-Patches/0170-Configurable-flying-kick-messages.patch new file mode 100644 index 0000000000..fcbf28fab5 --- /dev/null +++ b/Spigot-Server-Patches/0170-Configurable-flying-kick-messages.patch @@ -0,0 +1,47 @@ +From 5277018aa6deb3c472fb9a31375dd52d7380d8c6 Mon Sep 17 00:00:00 2001 +From: kashike +Date: Tue, 20 Sep 2016 00:58:01 +0000 +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 211b88a..3161dad 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java +@@ -234,4 +234,11 @@ public class PaperConfig { + } + packetInSpamThreshold = getInt("settings.incoming-packet-spam-threshold", 300); + } ++ ++ public static String flyingKickPlayerMessage = "Flying is not enabled on this server"; ++ public static String flyingKickVehicleMessage = "Flying is not enabled on this server"; ++ private static void flyingKickMessages() { ++ flyingKickPlayerMessage = getString("messages.kick.flying-player", flyingKickPlayerMessage); ++ flyingKickVehicleMessage = getString("messages.kick.flying-vehicle", flyingKickVehicleMessage); ++ } + } +diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java +index 29653cf..7bac585 100644 +--- a/src/main/java/net/minecraft/server/PlayerConnection.java ++++ b/src/main/java/net/minecraft/server/PlayerConnection.java +@@ -143,7 +143,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { + if (this.B) { + if (++this.C > 80) { + PlayerConnection.LOGGER.warn("{} was kicked for floating too long!", new Object[] { this.player.getName()}); +- this.disconnect("Flying is not enabled on this server"); ++ this.disconnect(com.destroystokyo.paper.PaperConfig.flyingKickPlayerMessage); // Paper - use configurable kick message + return; + } + } else { +@@ -162,7 +162,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { + if (this.D && this.player.getVehicle().bw() == this.player) { + if (++this.E > 80) { + PlayerConnection.LOGGER.warn("{} was kicked for floating a vehicle too long!", new Object[] { this.player.getName()}); +- this.disconnect("Flying is not enabled on this server"); ++ this.disconnect(com.destroystokyo.paper.PaperConfig.flyingKickVehicleMessage); // Paper - use configurable kick message + return; + } + } else { +-- +2.10.0 + diff --git a/Spigot-Server-Patches/0170-Configurable-packet-in-spam-threshold.patch b/Spigot-Server-Patches/0170-Configurable-packet-in-spam-threshold.patch deleted file mode 100644 index 999b538bcd..0000000000 --- a/Spigot-Server-Patches/0170-Configurable-packet-in-spam-threshold.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 773bff8a1da3bc233cf712731981aa3020669410 Mon Sep 17 00:00:00 2001 -From: Zach Brown -Date: Sun, 11 Sep 2016 14:30:57 -0500 -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 91546b6..211b88a 100644 ---- a/src/main/java/com/destroystokyo/paper/PaperConfig.java -+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java -@@ -225,4 +225,13 @@ public class PaperConfig { - private static void bungeeOnlineMode() { - bungeeOnlineMode = getBoolean("settings.bungee-online-mode", true); - } -+ -+ public static int packetInSpamThreshold = 300; -+ private static void packetInSpamThreshold() { -+ if (version < 11) { -+ int oldValue = getInt("settings.play-in-use-item-spam-threshold", 300); -+ set("settings.incoming-packet-spam-threshold", oldValue); -+ } -+ packetInSpamThreshold = getInt("settings.incoming-packet-spam-threshold", 300); -+ } - } -diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 50b23ed..29653cf 100644 ---- a/src/main/java/net/minecraft/server/PlayerConnection.java -+++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -868,13 +868,14 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { - // Spigot start - limit place/interactions - private int limitedPackets; - private long lastLimitedPacket = -1; -+ private static final int THRESHOLD = com.destroystokyo.paper.PaperConfig.packetInSpamThreshold; // Paper - Configurable threshold - - private boolean checkLimit(long timestamp) { -- if (lastLimitedPacket != -1 && timestamp - lastLimitedPacket < 30 && limitedPackets++ >= 4) { -+ if (lastLimitedPacket != -1 && timestamp - lastLimitedPacket < THRESHOLD && limitedPackets++ >= 4) { // Paper - return false; - } - -- if (lastLimitedPacket == -1 || timestamp - lastLimitedPacket >= 30) { -+ if (lastLimitedPacket == -1 || timestamp - lastLimitedPacket >= THRESHOLD) { // Paper - lastLimitedPacket = timestamp; - limitedPackets = 0; - return true; --- -2.10.0.windows.1 - diff --git a/Spigot-Server-Patches/0171-Auto-Save-Improvements.patch b/Spigot-Server-Patches/0171-Auto-Save-Improvements.patch new file mode 100644 index 0000000000..756d0a856c --- /dev/null +++ b/Spigot-Server-Patches/0171-Auto-Save-Improvements.patch @@ -0,0 +1,142 @@ +From edb088fcf6a8ab77306a2007ca7137c52616a656 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Mon, 19 Sep 2016 23:16:39 -0400 +Subject: [PATCH] Auto Save Improvements + +Makes Auto Save Rate setting configurable per-world. If the auto save rate is left -1, the global bukkit.yml value will be used. + +Process auto save every tick instead of once per auto tick interval, so that chunk saves will distribute over many ticks instead of all at once. + +Re-introduce a cap per tick for auto save (Spigot disabled the vanilla cap) and make it configurable. + +diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +index fb67306..eacb1f6 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +@@ -2,6 +2,7 @@ package com.destroystokyo.paper; + + import java.util.List; + ++import net.minecraft.server.MinecraftServer; + import org.bukkit.Bukkit; + import org.bukkit.configuration.file.YamlConfiguration; + import org.spigotmc.SpigotWorldConfig; +@@ -377,4 +378,19 @@ public class PaperWorldConfig { + private void elytraHitWallDamage() { + elytraHitWallDamage = getBoolean("elytra-hit-wall-damage", true); + } ++ ++ public int autoSavePeriod = -1; ++ private void autoSavePeriod() { ++ autoSavePeriod = getInt("auto-save-interval", -1); ++ if (autoSavePeriod > 0) { ++ log("Auto Save Interval: " +autoSavePeriod + " (" + (autoSavePeriod / 20) + "s)"); ++ } else if (autoSavePeriod < 0) { ++ autoSavePeriod = MinecraftServer.getServer().autosavePeriod; ++ } ++ } ++ ++ public int maxAutoSaveChunksPerTick = 24; ++ private void maxAutoSaveChunksPerTick() { ++ maxAutoSaveChunksPerTick = getInt("max-auto-save-chunks-per-tick", 24); ++ } + } +diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java +index 683a6dd..547628a 100644 +--- a/src/main/java/net/minecraft/server/Chunk.java ++++ b/src/main/java/net/minecraft/server/Chunk.java +@@ -960,7 +960,7 @@ public class Chunk { + if (this.t && this.world.getTime() != this.lastSaved || this.s) { + return true; + } +- } else if (this.t && this.world.getTime() >= this.lastSaved + MinecraftServer.getServer().autosavePeriod * 4) { // Spigot - Only save if we've passed 2 auto save intervals without modification ++ } else if (this.t && this.world.getTime() >= this.lastSaved + world.paperConfig.autoSavePeriod) { // Spigot // Paper - Make world configurable and incremental + return true; + } + +diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java +index 1ba02f1..65de280 100644 +--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java ++++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java +@@ -1,5 +1,6 @@ + package net.minecraft.server; + ++import com.destroystokyo.paper.PaperConfig; + import com.google.common.collect.Lists; + import com.google.common.collect.Sets; + import it.unimi.dsi.fastutil.longs.Long2ObjectMap; +@@ -265,7 +266,7 @@ public class ChunkProviderServer implements IChunkProvider { + this.saveChunk(chunk); + chunk.f(false); + ++i; +- if (i == 24 && !flag && false) { // Spigot ++ if (!flag && i >= world.paperConfig.maxAutoSaveChunksPerTick) { // Spigot - // Paper - Incremental Auto Save - cap max per tick + return false; + } + } +diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java +index 8ca8fbf..c19bde9 100644 +--- a/src/main/java/net/minecraft/server/MinecraftServer.java ++++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -114,6 +114,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs + public final Thread primaryThread; + public java.util.Queue processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); + public int autosavePeriod; ++ public boolean serverAutoSave = false; // Paper + // CraftBukkit end + + public MinecraftServer(OptionSet options, Proxy proxy, DataConverterManager dataconvertermanager, YggdrasilAuthenticationService yggdrasilauthenticationservice, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache) { +@@ -745,24 +746,28 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs + this.q.b().a(agameprofile); + } + +- if (autosavePeriod > 0 && this.ticks % autosavePeriod == 0) { // CraftBukkit + MinecraftTimings.worldSaveTimer.startTiming(); // Spigot + this.methodProfiler.a("save"); ++ ++ serverAutoSave = (autosavePeriod > 0 && this.ticks % autosavePeriod == 0); // Paper ++ if (serverAutoSave) { // CraftBukkit // Paper + this.v.savePlayers(); + // Spigot Start ++ } // Paper - Incremental Auto Saving ++ + // We replace this with saving each individual world as this.saveChunks(...) is broken, + // and causes the main thread to sleep for random amounts of time depending on chunk activity + // Also pass flag to only save modified chunks + server.playerCommandState = true; + for (World world : worlds) { +- world.getWorld().save(false); ++ if (world.paperConfig.autoSavePeriod > 0) world.getWorld().save(false); // Paper - Incremental / Configurable Auto Saving + } + server.playerCommandState = false; + // this.saveChunks(true); + // Spigot End + this.methodProfiler.b(); + MinecraftTimings.worldSaveTimer.stopTiming(); // Spigot +- } ++ //} // Paper - Incremental Auto Saving + + this.methodProfiler.a("tallying"); + this.h[this.ticks % 100] = System.nanoTime() - i; +diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java +index 87abf7f..ed3805d 100644 +--- a/src/main/java/net/minecraft/server/WorldServer.java ++++ b/src/main/java/net/minecraft/server/WorldServer.java +@@ -1016,12 +1016,12 @@ public class WorldServer extends World implements IAsyncTaskHandler { + ChunkProviderServer chunkproviderserver = this.getChunkProviderServer(); + + if (chunkproviderserver.e()) { +- org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit ++ if (flag) org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit // Paper - Incremental Auto Saving - Only fire event on full save + if (iprogressupdate != null) { + iprogressupdate.a("Saving level"); + } + +- this.a(); ++ if (flag || server.serverAutoSave) this.a(); // Paper + if (iprogressupdate != null) { + iprogressupdate.c("Saving chunks"); + } +-- +2.10.0 + diff --git a/Spigot-Server-Patches/0171-Configurable-flying-kick-messages.patch b/Spigot-Server-Patches/0171-Configurable-flying-kick-messages.patch deleted file mode 100644 index 55486d1c5e..0000000000 --- a/Spigot-Server-Patches/0171-Configurable-flying-kick-messages.patch +++ /dev/null @@ -1,47 +0,0 @@ -From e5c7d5f9e92d0e35a180fd8776fc9d2a2734b360 Mon Sep 17 00:00:00 2001 -From: kashike -Date: Tue, 20 Sep 2016 00:58:01 +0000 -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 211b88a..3161dad 100644 ---- a/src/main/java/com/destroystokyo/paper/PaperConfig.java -+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java -@@ -234,4 +234,11 @@ public class PaperConfig { - } - packetInSpamThreshold = getInt("settings.incoming-packet-spam-threshold", 300); - } -+ -+ public static String flyingKickPlayerMessage = "Flying is not enabled on this server"; -+ public static String flyingKickVehicleMessage = "Flying is not enabled on this server"; -+ private static void flyingKickMessages() { -+ flyingKickPlayerMessage = getString("messages.kick.flying-player", flyingKickPlayerMessage); -+ flyingKickVehicleMessage = getString("messages.kick.flying-vehicle", flyingKickVehicleMessage); -+ } - } -diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 29653cf..7bac585 100644 ---- a/src/main/java/net/minecraft/server/PlayerConnection.java -+++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -143,7 +143,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { - if (this.B) { - if (++this.C > 80) { - PlayerConnection.LOGGER.warn("{} was kicked for floating too long!", new Object[] { this.player.getName()}); -- this.disconnect("Flying is not enabled on this server"); -+ this.disconnect(com.destroystokyo.paper.PaperConfig.flyingKickPlayerMessage); // Paper - use configurable kick message - return; - } - } else { -@@ -162,7 +162,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { - if (this.D && this.player.getVehicle().bw() == this.player) { - if (++this.E > 80) { - PlayerConnection.LOGGER.warn("{} was kicked for floating a vehicle too long!", new Object[] { this.player.getName()}); -- this.disconnect("Flying is not enabled on this server"); -+ this.disconnect(com.destroystokyo.paper.PaperConfig.flyingKickVehicleMessage); // Paper - use configurable kick message - return; - } - } else { --- -2.5.0 - diff --git a/Spigot-Server-Patches/0172-Auto-Save-Improvements.patch b/Spigot-Server-Patches/0172-Auto-Save-Improvements.patch deleted file mode 100644 index a5677ba8e8..0000000000 --- a/Spigot-Server-Patches/0172-Auto-Save-Improvements.patch +++ /dev/null @@ -1,142 +0,0 @@ -From 32c1bb9c17914f7cc61e21e39f1fa31520ac069a Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Mon, 19 Sep 2016 23:16:39 -0400 -Subject: [PATCH] Auto Save Improvements - -Makes Auto Save Rate setting configurable per-world. If the auto save rate is left -1, the global bukkit.yml value will be used. - -Process auto save every tick instead of once per auto tick interval, so that chunk saves will distribute over many ticks instead of all at once. - -Re-introduce a cap per tick for auto save (Spigot disabled the vanilla cap) and make it configurable. - -diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index fb67306..eacb1f6 100644 ---- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -2,6 +2,7 @@ package com.destroystokyo.paper; - - import java.util.List; - -+import net.minecraft.server.MinecraftServer; - import org.bukkit.Bukkit; - import org.bukkit.configuration.file.YamlConfiguration; - import org.spigotmc.SpigotWorldConfig; -@@ -377,4 +378,19 @@ public class PaperWorldConfig { - private void elytraHitWallDamage() { - elytraHitWallDamage = getBoolean("elytra-hit-wall-damage", true); - } -+ -+ public int autoSavePeriod = -1; -+ private void autoSavePeriod() { -+ autoSavePeriod = getInt("auto-save-interval", -1); -+ if (autoSavePeriod > 0) { -+ log("Auto Save Interval: " +autoSavePeriod + " (" + (autoSavePeriod / 20) + "s)"); -+ } else if (autoSavePeriod < 0) { -+ autoSavePeriod = MinecraftServer.getServer().autosavePeriod; -+ } -+ } -+ -+ public int maxAutoSaveChunksPerTick = 24; -+ private void maxAutoSaveChunksPerTick() { -+ maxAutoSaveChunksPerTick = getInt("max-auto-save-chunks-per-tick", 24); -+ } - } -diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 683a6dd..547628a 100644 ---- a/src/main/java/net/minecraft/server/Chunk.java -+++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -960,7 +960,7 @@ public class Chunk { - if (this.t && this.world.getTime() != this.lastSaved || this.s) { - return true; - } -- } else if (this.t && this.world.getTime() >= this.lastSaved + MinecraftServer.getServer().autosavePeriod * 4) { // Spigot - Only save if we've passed 2 auto save intervals without modification -+ } else if (this.t && this.world.getTime() >= this.lastSaved + world.paperConfig.autoSavePeriod) { // Spigot // Paper - Make world configurable and incremental - return true; - } - -diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 1ba02f1..65de280 100644 ---- a/src/main/java/net/minecraft/server/ChunkProviderServer.java -+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -1,5 +1,6 @@ - package net.minecraft.server; - -+import com.destroystokyo.paper.PaperConfig; - import com.google.common.collect.Lists; - import com.google.common.collect.Sets; - import it.unimi.dsi.fastutil.longs.Long2ObjectMap; -@@ -265,7 +266,7 @@ public class ChunkProviderServer implements IChunkProvider { - this.saveChunk(chunk); - chunk.f(false); - ++i; -- if (i == 24 && !flag && false) { // Spigot -+ if (!flag && i >= world.paperConfig.maxAutoSaveChunksPerTick) { // Spigot - // Paper - Incremental Auto Save - cap max per tick - return false; - } - } -diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 8ca8fbf..c19bde9 100644 ---- a/src/main/java/net/minecraft/server/MinecraftServer.java -+++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -114,6 +114,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs - public final Thread primaryThread; - public java.util.Queue processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); - public int autosavePeriod; -+ public boolean serverAutoSave = false; // Paper - // CraftBukkit end - - public MinecraftServer(OptionSet options, Proxy proxy, DataConverterManager dataconvertermanager, YggdrasilAuthenticationService yggdrasilauthenticationservice, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache) { -@@ -745,24 +746,28 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs - this.q.b().a(agameprofile); - } - -- if (autosavePeriod > 0 && this.ticks % autosavePeriod == 0) { // CraftBukkit - MinecraftTimings.worldSaveTimer.startTiming(); // Spigot - this.methodProfiler.a("save"); -+ -+ serverAutoSave = (autosavePeriod > 0 && this.ticks % autosavePeriod == 0); // Paper -+ if (serverAutoSave) { // CraftBukkit // Paper - this.v.savePlayers(); - // Spigot Start -+ } // Paper - Incremental Auto Saving -+ - // We replace this with saving each individual world as this.saveChunks(...) is broken, - // and causes the main thread to sleep for random amounts of time depending on chunk activity - // Also pass flag to only save modified chunks - server.playerCommandState = true; - for (World world : worlds) { -- world.getWorld().save(false); -+ if (world.paperConfig.autoSavePeriod > 0) world.getWorld().save(false); // Paper - Incremental / Configurable Auto Saving - } - server.playerCommandState = false; - // this.saveChunks(true); - // Spigot End - this.methodProfiler.b(); - MinecraftTimings.worldSaveTimer.stopTiming(); // Spigot -- } -+ //} // Paper - Incremental Auto Saving - - this.methodProfiler.a("tallying"); - this.h[this.ticks % 100] = System.nanoTime() - i; -diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 5ed6d3e..26ab536 100644 ---- a/src/main/java/net/minecraft/server/WorldServer.java -+++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1024,12 +1024,12 @@ public class WorldServer extends World implements IAsyncTaskHandler { - ChunkProviderServer chunkproviderserver = this.getChunkProviderServer(); - - if (chunkproviderserver.e()) { -- org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit -+ if (flag) org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit // Paper - Incremental Auto Saving - Only fire event on full save - if (iprogressupdate != null) { - iprogressupdate.a("Saving level"); - } - -- this.a(); -+ if (flag || server.serverAutoSave) this.a(); // Paper - if (iprogressupdate != null) { - iprogressupdate.c("Saving chunks"); - } --- -1.9.1 - diff --git a/Spigot-Server-Patches/0172-Chunk-registration-fixes.patch b/Spigot-Server-Patches/0172-Chunk-registration-fixes.patch new file mode 100644 index 0000000000..5124767ffe --- /dev/null +++ b/Spigot-Server-Patches/0172-Chunk-registration-fixes.patch @@ -0,0 +1,25 @@ +From 759bf7de29d799f60c5c2abe6594ff4fdac06d3c Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Wed, 21 Sep 2016 22:54:28 -0400 +Subject: [PATCH] Chunk registration fixes + +World checks and the Chunk Add logic are inconsistent on how Y > 256, < 0, is treated + +Keep them consistent + +diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java +index f7d9a7c..9eaab84 100644 +--- a/src/main/java/net/minecraft/server/World.java ++++ b/src/main/java/net/minecraft/server/World.java +@@ -1761,7 +1761,7 @@ public abstract class World implements IBlockAccess { + } + + int k = MathHelper.floor(entity.locX / 16.0D); +- int l = MathHelper.floor(entity.locY / 16.0D); ++ int l = Math.min(15, Math.max(0, MathHelper.floor(entity.locY / 16.0D))); // Paper - stay consistent with chunk add/remove behavior + int i1 = MathHelper.floor(entity.locZ / 16.0D); + + if (!entity.ab || entity.ac != k || entity.ad != l || entity.ae != i1) { +-- +2.10.0 + diff --git a/Spigot-Server-Patches/0173-Chunk-registration-fixes.patch b/Spigot-Server-Patches/0173-Chunk-registration-fixes.patch deleted file mode 100644 index f27ba55b4e..0000000000 --- a/Spigot-Server-Patches/0173-Chunk-registration-fixes.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 13e68d27421f3691be5abae087a12fe87612a032 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Wed, 21 Sep 2016 22:54:28 -0400 -Subject: [PATCH] Chunk registration fixes - -World checks and the Chunk Add logic are inconsistent on how Y > 256, < 0, is treated - -Keep them consistent - -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 383eef2..b026e2b 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -1761,7 +1761,7 @@ public abstract class World implements IBlockAccess { - } - - int k = MathHelper.floor(entity.locX / 16.0D); -- int l = MathHelper.floor(entity.locY / 16.0D); -+ int l = Math.min(15, Math.max(0, MathHelper.floor(entity.locY / 16.0D))); // Paper - stay consistent with chunk add/remove behavior - int i1 = MathHelper.floor(entity.locZ / 16.0D); - - if (!entity.ab || entity.ac != k || entity.ad != l || entity.ae != i1) { --- -2.9.3 - diff --git a/Spigot-Server-Patches/0173-Process-NMS-Data-Conversion-post-ItemMeta-on-Copy.patch b/Spigot-Server-Patches/0173-Process-NMS-Data-Conversion-post-ItemMeta-on-Copy.patch new file mode 100644 index 0000000000..e838d77129 --- /dev/null +++ b/Spigot-Server-Patches/0173-Process-NMS-Data-Conversion-post-ItemMeta-on-Copy.patch @@ -0,0 +1,65 @@ +From a00026a267f7b82fd9fa666b008a5e2f2e4f84d7 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Wed, 4 May 2016 22:31:18 -0400 +Subject: [PATCH] Process NMS Data Conversion post ItemMeta on Copy + +ItemMeta apply is a destructive process that expects to be the authority on +what the items NBT data is. + +When CraftItemStack.asNMSCopy was called, the conversion ran, potentially setting +the converted data into the ItemStacks tag. + +Then if that item had ItemMeta, it would completely undo that conversion by +erasing the NBT Tag. + +On copy, run conversion post ItemMeta apply. + +diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java +index d45a9ec..a8874d2 100644 +--- a/src/main/java/net/minecraft/server/ItemStack.java ++++ b/src/main/java/net/minecraft/server/ItemStack.java +@@ -53,7 +53,12 @@ public final class ItemStack { + this(item, i, 0); + } + ++ // Paper start + public ItemStack(Item item, int i, int j) { ++ this(item, i, j, true); ++ } ++ public ItemStack(Item item, int i, int j, boolean convert) { ++ // Paper end + this.item = item; + this.count = i; + +@@ -63,6 +68,11 @@ public final class ItemStack { + //if (this.damage < 0) { + // this.damage = 0; + //} ++ // Paper start ++ if (convert) convertData(); ++ } ++ public final void convertData() { ++ // Paper end + if (MinecraftServer.getServer() != null) { + NBTTagCompound savedStack = new NBTTagCompound(); + this.save(savedStack); +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +index 88f0292..7f77d44 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +@@ -45,10 +45,11 @@ public final class CraftItemStack extends ItemStack { + return null; + } + +- net.minecraft.server.ItemStack stack = new net.minecraft.server.ItemStack(item, original.getAmount(), original.getDurability()); ++ net.minecraft.server.ItemStack stack = new net.minecraft.server.ItemStack(item, original.getAmount(), original.getDurability(), false); // Paper + if (original.hasItemMeta()) { + setItemMeta(stack, original.getItemMeta()); + } ++ stack.convertData(); // Paper + return stack; + } + +-- +2.10.0 + diff --git a/Spigot-Server-Patches/0174-Process-NMS-Data-Conversion-post-ItemMeta-on-Copy.patch b/Spigot-Server-Patches/0174-Process-NMS-Data-Conversion-post-ItemMeta-on-Copy.patch deleted file mode 100644 index d7a941797e..0000000000 --- a/Spigot-Server-Patches/0174-Process-NMS-Data-Conversion-post-ItemMeta-on-Copy.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 1db407564fbdd4f31b348c62f11b15be0eb27c7c Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Wed, 4 May 2016 22:31:18 -0400 -Subject: [PATCH] Process NMS Data Conversion post ItemMeta on Copy - -ItemMeta apply is a destructive process that expects to be the authority on -what the items NBT data is. - -When CraftItemStack.asNMSCopy was called, the conversion ran, potentially setting -the converted data into the ItemStacks tag. - -Then if that item had ItemMeta, it would completely undo that conversion by -erasing the NBT Tag. - -On copy, run conversion post ItemMeta apply. - -diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index d45a9ec..a8874d2 100644 ---- a/src/main/java/net/minecraft/server/ItemStack.java -+++ b/src/main/java/net/minecraft/server/ItemStack.java -@@ -53,7 +53,12 @@ public final class ItemStack { - this(item, i, 0); - } - -+ // Paper start - public ItemStack(Item item, int i, int j) { -+ this(item, i, j, true); -+ } -+ public ItemStack(Item item, int i, int j, boolean convert) { -+ // Paper end - this.item = item; - this.count = i; - -@@ -63,6 +68,11 @@ public final class ItemStack { - //if (this.damage < 0) { - // this.damage = 0; - //} -+ // Paper start -+ if (convert) convertData(); -+ } -+ public final void convertData() { -+ // Paper end - if (MinecraftServer.getServer() != null) { - NBTTagCompound savedStack = new NBTTagCompound(); - this.save(savedStack); -diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index 88f0292..7f77d44 100644 ---- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -@@ -45,10 +45,11 @@ public final class CraftItemStack extends ItemStack { - return null; - } - -- net.minecraft.server.ItemStack stack = new net.minecraft.server.ItemStack(item, original.getAmount(), original.getDurability()); -+ net.minecraft.server.ItemStack stack = new net.minecraft.server.ItemStack(item, original.getAmount(), original.getDurability(), false); // Paper - if (original.hasItemMeta()) { - setItemMeta(stack, original.getItemMeta()); - } -+ stack.convertData(); // Paper - return stack; - } - --- -2.9.3 - diff --git a/Spigot-Server-Patches/0174-Remove-FishingHook-reference-on-Craft-Entity-removal.patch b/Spigot-Server-Patches/0174-Remove-FishingHook-reference-on-Craft-Entity-removal.patch new file mode 100644 index 0000000000..c7f2e14011 --- /dev/null +++ b/Spigot-Server-Patches/0174-Remove-FishingHook-reference-on-Craft-Entity-removal.patch @@ -0,0 +1,30 @@ +From 9392526a42291798757abda1942e41d5fc2d8ef8 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Thu, 16 Jun 2016 00:17:23 -0400 +Subject: [PATCH] Remove FishingHook reference on Craft Entity removal + + +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFish.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFish.java +index ecfc316..3f909c1 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFish.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFish.java +@@ -64,6 +64,16 @@ public class CraftFish extends AbstractProjectile implements Fish { + this.biteChance = chance; + } + ++ // Paper start ++ @Override ++ public void remove() { ++ super.remove(); ++ if (getHandle().owner != null) { ++ getHandle().owner.hookedFish = null; ++ } ++ } ++ // Paper end ++ + @Deprecated + public LivingEntity _INVALID_getShooter() { + return (LivingEntity) getShooter(); +-- +2.10.0 + diff --git a/Spigot-Server-Patches/0175-Auto-fix-bad-Y-levels-on-player-login.patch b/Spigot-Server-Patches/0175-Auto-fix-bad-Y-levels-on-player-login.patch new file mode 100644 index 0000000000..b99080f052 --- /dev/null +++ b/Spigot-Server-Patches/0175-Auto-fix-bad-Y-levels-on-player-login.patch @@ -0,0 +1,22 @@ +From dd9660855df152cd179f5c3a21c7ab645b70ece5 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Wed, 21 Sep 2016 23:48:39 -0400 +Subject: [PATCH] Auto fix bad Y levels on player login + +Bring down to a saner Y level if super high, as this can cause the server to crash + +diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java +index ec3a60a..da2b5bb 100644 +--- a/src/main/java/net/minecraft/server/EntityPlayer.java ++++ b/src/main/java/net/minecraft/server/EntityPlayer.java +@@ -126,6 +126,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + } + } + ++ if (this.locY > 300) this.locY = 257; // Paper - bring down to a saner Y level if out of world + this.getBukkitEntity().readExtraData(nbttagcompound); // CraftBukkit + } + +-- +2.10.0 + diff --git a/Spigot-Server-Patches/0175-Remove-FishingHook-reference-on-Craft-Entity-removal.patch b/Spigot-Server-Patches/0175-Remove-FishingHook-reference-on-Craft-Entity-removal.patch deleted file mode 100644 index a2f43a7dc7..0000000000 --- a/Spigot-Server-Patches/0175-Remove-FishingHook-reference-on-Craft-Entity-removal.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 3766c64b653c0ddc3b3688acf16029ded14bbcff Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Thu, 16 Jun 2016 00:17:23 -0400 -Subject: [PATCH] Remove FishingHook reference on Craft Entity removal - - -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFish.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFish.java -index ecfc316..3f909c1 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFish.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFish.java -@@ -64,6 +64,16 @@ public class CraftFish extends AbstractProjectile implements Fish { - this.biteChance = chance; - } - -+ // Paper start -+ @Override -+ public void remove() { -+ super.remove(); -+ if (getHandle().owner != null) { -+ getHandle().owner.hookedFish = null; -+ } -+ } -+ // Paper end -+ - @Deprecated - public LivingEntity _INVALID_getShooter() { - return (LivingEntity) getShooter(); --- -2.9.3 - diff --git a/Spigot-Server-Patches/0176-Auto-fix-bad-Y-levels-on-player-login.patch b/Spigot-Server-Patches/0176-Auto-fix-bad-Y-levels-on-player-login.patch deleted file mode 100644 index 7c299aa695..0000000000 --- a/Spigot-Server-Patches/0176-Auto-fix-bad-Y-levels-on-player-login.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 97c0a0a4d4ca2797ea4b10bfad875c777379d66b Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Wed, 21 Sep 2016 23:48:39 -0400 -Subject: [PATCH] Auto fix bad Y levels on player login - -Bring down to a saner Y level if super high, as this can cause the server to crash - -diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index ec3a60a..da2b5bb 100644 ---- a/src/main/java/net/minecraft/server/EntityPlayer.java -+++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -126,6 +126,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { - } - } - -+ if (this.locY > 300) this.locY = 257; // Paper - bring down to a saner Y level if out of world - this.getBukkitEntity().readExtraData(nbttagcompound); // CraftBukkit - } - --- -2.10.0 - diff --git a/Spigot-Server-Patches/0176-Raise-string-limit-for-packet-serialization.patch b/Spigot-Server-Patches/0176-Raise-string-limit-for-packet-serialization.patch new file mode 100644 index 0000000000..aa2994e2fa --- /dev/null +++ b/Spigot-Server-Patches/0176-Raise-string-limit-for-packet-serialization.patch @@ -0,0 +1,27 @@ +From 37b1119fcaf9a311e2cd20262498d11e598466f6 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Wed, 21 Sep 2016 23:54:20 -0400 +Subject: [PATCH] Raise string limit for packet serialization + +The default limit is possible to hit with 50 page books with color codes, causing clients to disconnect. + +Bump the limit up a hair to above currently seen sizes. + +diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java +index b056457..662bd1e 100644 +--- a/src/main/java/net/minecraft/server/PacketDataSerializer.java ++++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java +@@ -298,8 +298,8 @@ public class PacketDataSerializer extends ByteBuf { + public PacketDataSerializer a(String s) { + byte[] abyte = s.getBytes(Charsets.UTF_8); + +- if (abyte.length > 32767) { +- throw new EncoderException("String too big (was " + s.length() + " bytes encoded, max " + 32767 + ")"); ++ if (abyte.length > 44767) { // Paper - raise limit a bit more as normal means can trigger this ++ throw new EncoderException("String too big (was " + s.length() + " bytes encoded, max " + 44767 + ")"); // Paper + } else { + this.d(abyte.length); + this.writeBytes(abyte); +-- +2.10.0 + diff --git a/Spigot-Server-Patches/0177-Disable-Vanilla-Chunk-GC.patch b/Spigot-Server-Patches/0177-Disable-Vanilla-Chunk-GC.patch new file mode 100644 index 0000000000..0ac6af69af --- /dev/null +++ b/Spigot-Server-Patches/0177-Disable-Vanilla-Chunk-GC.patch @@ -0,0 +1,33 @@ +From 0de0dd7bad529706df1d5266a83f8fa7162eda1a Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Mon, 26 Sep 2016 01:51:30 -0400 +Subject: [PATCH] Disable Vanilla Chunk GC + +Bukkit has its own system for this. + +diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java +index ed3805d..a1350b0 100644 +--- a/src/main/java/net/minecraft/server/WorldServer.java ++++ b/src/main/java/net/minecraft/server/WorldServer.java +@@ -1028,7 +1028,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { + + chunkproviderserver.a(flag); + // CraftBukkit - ArrayList -> Collection +- Collection arraylist = chunkproviderserver.a(); ++ /* //Paper start Collection arraylist = chunkproviderserver.a(); + Iterator iterator = arraylist.iterator(); + + while (iterator.hasNext()) { +@@ -1037,7 +1037,8 @@ public class WorldServer extends World implements IAsyncTaskHandler { + if (chunk != null && !this.manager.a(chunk.locX, chunk.locZ)) { + chunkproviderserver.unload(chunk); + } +- } ++ }*/ ++ // Paper end + + } + } +-- +2.10.0 + diff --git a/Spigot-Server-Patches/0177-Raise-string-limit-for-packet-serialization.patch b/Spigot-Server-Patches/0177-Raise-string-limit-for-packet-serialization.patch deleted file mode 100644 index b4aaccd8dc..0000000000 --- a/Spigot-Server-Patches/0177-Raise-string-limit-for-packet-serialization.patch +++ /dev/null @@ -1,27 +0,0 @@ -From bf6bbe6de6123f41a7a3b879bef3bfa0be290e24 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Wed, 21 Sep 2016 23:54:20 -0400 -Subject: [PATCH] Raise string limit for packet serialization - -The default limit is possible to hit with 50 page books with color codes, causing clients to disconnect. - -Bump the limit up a hair to above currently seen sizes. - -diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java -index b056457..662bd1e 100644 ---- a/src/main/java/net/minecraft/server/PacketDataSerializer.java -+++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java -@@ -298,8 +298,8 @@ public class PacketDataSerializer extends ByteBuf { - public PacketDataSerializer a(String s) { - byte[] abyte = s.getBytes(Charsets.UTF_8); - -- if (abyte.length > 32767) { -- throw new EncoderException("String too big (was " + s.length() + " bytes encoded, max " + 32767 + ")"); -+ if (abyte.length > 44767) { // Paper - raise limit a bit more as normal means can trigger this -+ throw new EncoderException("String too big (was " + s.length() + " bytes encoded, max " + 44767 + ")"); // Paper - } else { - this.d(abyte.length); - this.writeBytes(abyte); --- -2.9.3 - diff --git a/Spigot-Server-Patches/0178-Disable-Vanilla-Chunk-GC.patch b/Spigot-Server-Patches/0178-Disable-Vanilla-Chunk-GC.patch deleted file mode 100644 index d629e7a0f4..0000000000 --- a/Spigot-Server-Patches/0178-Disable-Vanilla-Chunk-GC.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 8e28660b4ee39ff1513a7aed26639e343bc7050e Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Mon, 26 Sep 2016 01:51:30 -0400 -Subject: [PATCH] Disable Vanilla Chunk GC - -Bukkit has its own system for this. - -diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 26ab536..777a5df 100644 ---- a/src/main/java/net/minecraft/server/WorldServer.java -+++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1036,7 +1036,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { - - chunkproviderserver.a(flag); - // CraftBukkit - ArrayList -> Collection -- Collection arraylist = chunkproviderserver.a(); -+ /* //Paper start Collection arraylist = chunkproviderserver.a(); - Iterator iterator = arraylist.iterator(); - - while (iterator.hasNext()) { -@@ -1045,7 +1045,8 @@ public class WorldServer extends World implements IAsyncTaskHandler { - if (chunk != null && !this.manager.a(chunk.locX, chunk.locZ)) { - chunkproviderserver.unload(chunk); - } -- } -+ }*/ -+ // Paper end - - } - } --- -1.9.1 - -- cgit v1.2.3