From 9ce19f032175750c78eca42c46ff8b5b84aa153b Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 18 Jul 2018 00:52:33 -0400 Subject: [PATCH] NOT FINISHED: Current progress, updated upstream --- .../Ability-to-apply-mending-to-XP-API.patch | 56 +++------ .../Add-PlayerJumpEvent.patch | 4 +- .../Add-UnknownCommandEvent.patch | 2 +- ...n-option-to-prevent-player-names-fro.patch | 2 +- ...setting-for-proxy-online-mode-status.patch | 2 +- .../Allow-Reloading-of-Command-Aliases.patch | 2 +- ...llow-Reloading-of-Custom-Permissions.patch | 2 +- .../AsyncTabCompleteEvent.patch | 77 ++++++------ .../Avoid-NPE-in-PathfinderGoalTempt.patch | 2 +- .../Basic-PlayerProfile-API.patch | 2 +- .../Complete-resource-pack-API.patch | 19 --- ...urable-Chunks-Sends-per-Tick-setting.patch | 4 +- ...le-Keep-Spawn-Loaded-range-per-world.patch | 85 ++++++++++++++ ...Configurable-Max-Chunk-Gens-per-Tick.patch | 110 ------------------ ...onfigurable-packet-in-spam-threshold.patch | 2 +- ...nd-unlit-chunks-when-lighting-update.patch | 46 -------- .../Ensure-commands-are-not-ran-async.patch | 6 +- .../ExperienceOrbMergeEvent.patch | 4 +- .../Expose-server-CommandMap.patch | 2 +- .../Fix-block-break-desync.patch | 2 +- .../Further-improve-server-tick-loop.patch | 2 +- ...mplement-ensureServerConversions-API.patch | 2 +- .../Implement-getI18NDisplayName.patch | 2 +- .../Paper-config-files.patch | 2 +- .../PlayerPickupExperienceEvent.patch | 10 +- .../Remove-Metadata-on-reload.patch | 2 +- Spigot-Server-Patches/Timings-v2.patch | 4 +- ...oleAppender-for-console-improvements.patch | 2 +- work/CraftBukkit | 2 +- work/Spigot | 2 +- 30 files changed, 174 insertions(+), 287 deletions(-) create mode 100644 Spigot-Server-Patches/Configurable-Keep-Spawn-Loaded-range-per-world.patch delete mode 100644 Spigot-Server-Patches/Configurable-Max-Chunk-Gens-per-Tick.patch delete mode 100644 Spigot-Server-Patches/Don-t-blindly-send-unlit-chunks-when-lighting-update.patch diff --git a/Spigot-Server-Patches/Ability-to-apply-mending-to-XP-API.patch b/Spigot-Server-Patches/Ability-to-apply-mending-to-XP-API.patch index c1879be744..a3094e5a67 100644 --- a/Spigot-Server-Patches/Ability-to-apply-mending-to-XP-API.patch +++ b/Spigot-Server-Patches/Ability-to-apply-mending-to-XP-API.patch @@ -10,11 +10,11 @@ of giving the player experience points. Both an API To standalone mend, and apply mending logic to .giveExp has been added. diff --git a/src/main/java/net/minecraft/server/EnchantmentManager.java b/src/main/java/net/minecraft/server/EnchantmentManager.java -index 98300d0a2..f714dc326 100644 +index 3204d94c5..e4ed9e206 100644 --- a/src/main/java/net/minecraft/server/EnchantmentManager.java +++ b/src/main/java/net/minecraft/server/EnchantmentManager.java @@ -0,0 +0,0 @@ public class EnchantmentManager { - return getEnchantmentLevel(Enchantments.D, itemstack) > 0; + return getEnchantmentLevel(Enchantments.F, itemstack) > 0; } + public static ItemStack getRandomEquippedItemWithEnchant(Enchantment enchantment, EntityLiving entityliving) { return b(enchantment, entityliving); } // Paper - OBFHELPER @@ -22,63 +22,37 @@ index 98300d0a2..f714dc326 100644 List list = enchantment.a(entityliving); diff --git a/src/main/java/net/minecraft/server/Enchantments.java b/src/main/java/net/minecraft/server/Enchantments.java -index 35e87eb1c..74a6a4f60 100644 +index 0f4aad20f..3a5263fd9 100644 --- a/src/main/java/net/minecraft/server/Enchantments.java +++ b/src/main/java/net/minecraft/server/Enchantments.java @@ -0,0 +0,0 @@ public class Enchantments { - public static final Enchantment ARROW_INFINITE = a("infinity"); - public static final Enchantment LUCK = a("luck_of_the_sea"); - public static final Enchantment LURE = a("lure"); -- public static final Enchantment C = a("mending"); -+ public static final Enchantment C = a("mending"); public static final Enchantment MENDING = C; // Paper - OBFHELPER - public static final Enchantment D = a("vanishing_curse"); + public static final Enchantment D = a("impaling"); + public static final Enchantment E = a("riptide"); + public static final Enchantment F = a("channeling"); +- public static final Enchantment G = a("mending"); ++ public static final Enchantment G = a("mending");public static final Enchantment MENDING = G; // Paper - OBFHELPER + public static final Enchantment H = a("vanishing_curse"); @Nullable diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -index ff5cc74ba..1c59fd966 100644 +index a87ef5fb8..b8bfc7577 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java @@ -0,0 +0,0 @@ public class EntityExperienceOrb extends Entity { } } -+ public int durToXp(int i) { return c(i); } // Paper OBFHELPER - private int c(int i) { ++ public int durToXp(int i) { return b(i); } // Paper OBFHELPER + private int b(int i) { return i / 2; } -+ public int xpToDur(int i) { return d(i); } // Paper OBFHELPER - private int d(int i) { ++ public int xpToDur(int i) { return c(i); } // Paper OBFHELPER + private int c(int i) { return i * 2; } -diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index d666088f2..f6b802dc8 100644 ---- a/src/main/java/net/minecraft/server/ItemStack.java -+++ b/src/main/java/net/minecraft/server/ItemStack.java -@@ -0,0 +0,0 @@ public final class ItemStack { - private Item item; - private NBTTagCompound tag; - private boolean g; -- private int damage; -+ private int damage; public void setDamage(int i) { this.damage = i; } // Paper - OBFHELPER - private EntityItemFrame i; - private Block j; - private boolean k; -@@ -0,0 +0,0 @@ public final class ItemStack { - return this.getItem().k(); - } - -+ public boolean hasDamage() { return h(); } // Paper OBFHELPER - public boolean h() { - return this.f() && this.damage > 0; - } - -+ public int getDamage() { return i(); } // Paper OBFHELPER - public int i() { - return this.damage; - } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index d69784386..77c50ba14 100644 +index 9f9002dd8..c2cd5ac4b 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/Add-PlayerJumpEvent.patch b/Spigot-Server-Patches/Add-PlayerJumpEvent.patch index 1cbed082ca..cc0bd6a974 100644 --- a/Spigot-Server-Patches/Add-PlayerJumpEvent.patch +++ b/Spigot-Server-Patches/Add-PlayerJumpEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerJumpEvent diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 85e617979..8cf082d2e 100644 +index f08c0ba60..1b944abea 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving { @@ -17,7 +17,7 @@ index 85e617979..8cf082d2e 100644 super.cG(); this.a(StatisticList.JUMP); diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 128b2beb5..2255b8ccb 100644 +index bf549bfed..25c38f3bb 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; diff --git a/Spigot-Server-Patches/Add-UnknownCommandEvent.patch b/Spigot-Server-Patches/Add-UnknownCommandEvent.patch index 9f5197bb71..c2a10e9afb 100644 --- a/Spigot-Server-Patches/Add-UnknownCommandEvent.patch +++ b/Spigot-Server-Patches/Add-UnknownCommandEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add UnknownCommandEvent diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 3b10c5e61..46f86359c 100644 +index 9fe7c6a0d..69cfe5c4d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.util.Versioning; diff --git a/Spigot-Server-Patches/Add-configuration-option-to-prevent-player-names-fro.patch b/Spigot-Server-Patches/Add-configuration-option-to-prevent-player-names-fro.patch index 04e7adce3f..7f6fd0958a 100644 --- a/Spigot-Server-Patches/Add-configuration-option-to-prevent-player-names-fro.patch +++ b/Spigot-Server-Patches/Add-configuration-option-to-prevent-player-names-fro.patch @@ -20,7 +20,7 @@ index ea6fcb39f..dbafef023 100644 + } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index f3dfd65d6..6c611c0df 100644 +index 1b6a849e2..470e334f7 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-setting-for-proxy-online-mode-status.patch b/Spigot-Server-Patches/Add-setting-for-proxy-online-mode-status.patch index 623090a1d7..9610554a8d 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 @@ -33,7 +33,7 @@ index f13534917..85c7a96c5 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 2bcd1c3ca..a36192362 100644 +index 06b59657f..6c7151536 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 c492d93bd0..3ada77266f 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 a36192362..f3dfd65d6 100644 +index 6c7151536..1b6a849e2 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 ff987c119a..49dfb9bd0f 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 6dae117ac..5ffb335f5 100644 +index 4db5aacc4..1c9637ff7 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/AsyncTabCompleteEvent.patch b/Spigot-Server-Patches/AsyncTabCompleteEvent.patch index 48f0ede723..9ac440907f 100644 --- a/Spigot-Server-Patches/AsyncTabCompleteEvent.patch +++ b/Spigot-Server-Patches/AsyncTabCompleteEvent.patch @@ -14,46 +14,40 @@ completion, such as offline players. Also adds isCommand and getLocation to the sync TabCompleteEvent diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index e01013efd..74a665142 100644 +index d47805962..ea29b1b2a 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { - // CraftBukkit end } -- public void a(PacketPlayInTabComplete packetplayintabcomplete) { -- PlayerConnectionUtils.ensureMainThread(packetplayintabcomplete, this, this.player.x()); -+ // Paper start - async tab completion -+ public void a(PacketPlayInTabComplete packet) { + public void a(PacketPlayInTabComplete packetplayintabcomplete) { +- PlayerConnectionUtils.ensureMainThread(packetplayintabcomplete, this, this.player.getWorldServer()); ++ // PlayerConnectionUtils.ensureMainThread(packetplayintabcomplete, this, this.player.getWorldServer()); // Paper - run this async // CraftBukkit start - if (chatSpamField.addAndGet(this, 10) > 500 && !this.minecraftServer.getPlayerList().isOp(this.player.getProfile())) { + if (chatSpamField.addAndGet(this, 5) > 500 && !this.minecraftServer.getPlayerList().isOp(this.player.getProfile())) { - this.disconnect(new ChatMessage("disconnect.spam", new Object[0])); -+ minecraftServer.postToMainThread(() -> this.disconnect(new ChatMessage("disconnect.spam", new Object[0]))); ++ minecraftServer.postToMainThread(() -> this.disconnect(new ChatMessage("disconnect.spam", new Object[0]))); // Paper return; } - // CraftBukkit end -- ArrayList arraylist = Lists.newArrayList(); -- Iterator iterator = this.minecraftServer.tabCompleteCommand(this.player, packetplayintabcomplete.a(), packetplayintabcomplete.b(), packetplayintabcomplete.c()).iterator(); - -- while (iterator.hasNext()) { -- String s = (String) iterator.next(); +- // CraftBukkit end +- ParseResults parseresults = this.minecraftServer.getCommandDispatcher().a().parse(packetplayintabcomplete.c(), this.player.getCommandListener()); ++ // Paper start + com.destroystokyo.paper.event.server.AsyncTabCompleteEvent event; -+ java.util.List completions = new ArrayList<>(); -+ BlockPosition blockpos = packet.b(); -+ String buffer = packet.a(); -+ boolean isCommand = buffer.startsWith("/") || packet.c(); ++ java.util.List completions = new java.util.ArrayList<>(); ++ String buffer = packetplayintabcomplete.c(); + event = new com.destroystokyo.paper.event.server.AsyncTabCompleteEvent(this.getPlayer(), completions, -+ buffer, isCommand, blockpos != null ? MCUtil.toLocation(player.world, blockpos) : null); ++ buffer, true, null); + event.callEvent(); + completions = event.isCancelled() ? com.google.common.collect.ImmutableList.of() : event.getCompletions(); + if (event.isCancelled() || event.isHandled()) { ++ + // Still fire sync event with the provided completions, if someone is listening + if (!event.isCancelled() && org.bukkit.event.server.TabCompleteEvent.getHandlerList().getRegisteredListeners().length > 0) { + java.util.List finalCompletions = completions; + Waitable> syncCompletions = new Waitable>() { + @Override + protected java.util.List evaluate() { -+ org.bukkit.event.server.TabCompleteEvent syncEvent = new org.bukkit.event.server.TabCompleteEvent(PlayerConnection.this.getPlayer(), buffer, finalCompletions, isCommand, blockpos != null ? MCUtil.toLocation(player.world, blockpos) : null); ++ org.bukkit.event.server.TabCompleteEvent syncEvent = new org.bukkit.event.server.TabCompleteEvent(PlayerConnection.this.getPlayer(), buffer, finalCompletions, true, null); + return syncEvent.callEvent() ? syncEvent.getCompletions() : com.google.common.collect.ImmutableList.of(); + } + }; @@ -64,33 +58,42 @@ index e01013efd..74a665142 100644 + e1.printStackTrace(); + } + } - -- arraylist.add(s); -+ this.player.playerConnection.sendPacket(new PacketPlayOutTabComplete(completions.toArray(new String[completions.size()]))); ++ java.util.List otherSuggestions = completions; ++ minecraftServer.postToMainThread(() -> sendSuggestions(packetplayintabcomplete, otherSuggestions)); + return; - } -- -- this.player.playerConnection.sendPacket(new PacketPlayOutTabComplete((String[]) arraylist.toArray(new String[arraylist.size()]))); -+ minecraftServer.postToMainThread(() -> { -+ java.util.List syncCompletions = this.minecraftServer.tabCompleteCommand(this.player, buffer, blockpos, isCommand); -+ this.player.playerConnection.sendPacket(new PacketPlayOutTabComplete(syncCompletions.toArray(new String[syncCompletions.size()]))); -+ }); -+ // Paper end ++ } ++ minecraftServer.postToMainThread(() -> sendSuggestions(packetplayintabcomplete, null)); ++ } ++ public void sendSuggestions(PacketPlayInTabComplete packetplayintabcomplete, java.util.List otherSuggestions) { + +- this.minecraftServer.getCommandDispatcher().a().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> { +- if (((Suggestions) suggestions).isEmpty()) return; // CraftBukkit - don't send through empty suggestions - prevents [] from showing for plugins with nothing more to offer +- this.networkManager.sendPacket(new PacketPlayOutTabComplete(packetplayintabcomplete.b(), (Suggestions) suggestions)); // CraftBukkit - decompile error ++ ParseResults parseresults = this.minecraftServer.getCommandDispatcher().a().parse(packetplayintabcomplete.c(), this.player.getCommandListener()); ++ //noinspection unchecked ++ java.util.concurrent.CompletableFuture completionSuggestions = this.minecraftServer.getCommandDispatcher().a().getCompletionSuggestions(parseresults); ++ completionSuggestions.thenAccept((Suggestions suggestions) -> { ++ if (otherSuggestions != null && !otherSuggestions.isEmpty()) { ++ com.mojang.brigadier.suggestion.SuggestionsBuilder builder = new com.mojang.brigadier.suggestion.SuggestionsBuilder(packetplayintabcomplete.c(), packetplayintabcomplete.b()); ++ otherSuggestions.forEach(builder::suggest); ++ suggestions.getList().addAll(builder.build().getList()); ++ } ++ // Paper end ++ if (suggestions.isEmpty()) return; // CraftBukkit - don't send through empty suggestions - prevents [] from showing for plugins with nothing more to offer ++ this.networkManager.sendPacket(new PacketPlayOutTabComplete(packetplayintabcomplete.b(), suggestions)); // CraftBukkit - decompile error + }); } - public void a(PacketPlayInSettings packetplayinsettings) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 2dd7ed96a..e86c16755 100644 +index 0ef1186b9..d605e5792 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 { - } else { offers = tabCompleteChat(player, message); } -- + - TabCompleteEvent tabEvent = new TabCompleteEvent(player, message, offers); -+ -+ TabCompleteEvent tabEvent = new TabCompleteEvent(player, message, offers, message.startsWith("/") || forceCommand, pos != null ? MCUtil.toLocation(((CraftWorld) player.getWorld()).getHandle(), pos) : null); // Paper ++ TabCompleteEvent tabEvent = new TabCompleteEvent(player, message, offers, message.startsWith("/") || forceCommand, pos != null ? MCUtil.toLocation(((CraftWorld) player.getWorld()).getHandle(), new BlockPosition(pos)) : null); // Paper getPluginManager().callEvent(tabEvent); return tabEvent.isCancelled() ? Collections.EMPTY_LIST : tabEvent.getCompletions(); diff --git a/Spigot-Server-Patches/Avoid-NPE-in-PathfinderGoalTempt.patch b/Spigot-Server-Patches/Avoid-NPE-in-PathfinderGoalTempt.patch index 2b639431f0..c09f489930 100644 --- a/Spigot-Server-Patches/Avoid-NPE-in-PathfinderGoalTempt.patch +++ b/Spigot-Server-Patches/Avoid-NPE-in-PathfinderGoalTempt.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Avoid NPE in PathfinderGoalTempt diff --git a/src/main/java/net/minecraft/server/PathfinderGoalTempt.java b/src/main/java/net/minecraft/server/PathfinderGoalTempt.java -index 188825d19..8004f3a3f 100644 +index 154202700..64b1ac71b 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalTempt.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalTempt.java @@ -0,0 +0,0 @@ public class PathfinderGoalTempt extends PathfinderGoal { diff --git a/Spigot-Server-Patches/Basic-PlayerProfile-API.patch b/Spigot-Server-Patches/Basic-PlayerProfile-API.patch index 30a7471221..16b615dda7 100644 --- a/Spigot-Server-Patches/Basic-PlayerProfile-API.patch +++ b/Spigot-Server-Patches/Basic-PlayerProfile-API.patch @@ -486,7 +486,7 @@ index a47a51a41..4c476f757 100644 private UserCacheEntry(GameProfile gameprofile, Date date) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 46f86359c..26bbb0265 100644 +index 69cfe5c4d..0ef1186b9 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.util.CraftNamespacedKey; diff --git a/Spigot-Server-Patches/Complete-resource-pack-API.patch b/Spigot-Server-Patches/Complete-resource-pack-API.patch index b5bf269726..8236536ec1 100644 --- a/Spigot-Server-Patches/Complete-resource-pack-API.patch +++ b/Spigot-Server-Patches/Complete-resource-pack-API.patch @@ -4,25 +4,6 @@ Date: Sat, 4 Apr 2015 23:17:52 -0400 Subject: [PATCH] Complete resource pack API -diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 27c255c8d..2cc277e4f 100644 ---- a/src/main/java/net/minecraft/server/PlayerConnection.java -+++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { - - } - -- public void a(PacketPlayInResourcePackStatus packetplayinresourcepackstatus) {} -+ public void a(PacketPlayInResourcePackStatus packetplayinresourcepackstatus) { -+ // Paper start; -+ final PlayerResourcePackStatusEvent.Status status = PlayerResourcePackStatusEvent.Status.values()[packetplayinresourcepackstatus.status.ordinal()]; -+ this.getPlayer().setResourcePackStatus(status); -+ this.server.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(getPlayer(), status)); -+ // Paper end -+ } - - public void a(PacketPlayInBoatMove packetplayinboatmove) { - PlayerConnectionUtils.ensureMainThread(packetplayinboatmove, this, this.player.getWorldServer()); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index aacf8ea7f..f6a7f08f9 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/Spigot-Server-Patches/Configurable-Chunks-Sends-per-Tick-setting.patch b/Spigot-Server-Patches/Configurable-Chunks-Sends-per-Tick-setting.patch index 4154b20474..9d8f5faebf 100644 --- a/Spigot-Server-Patches/Configurable-Chunks-Sends-per-Tick-setting.patch +++ b/Spigot-Server-Patches/Configurable-Chunks-Sends-per-Tick-setting.patch @@ -8,7 +8,7 @@ Vanilla already had this limited, make it configurable. Limit how much exploration lags the server diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 535a8d3ed..e3ff78180 100644 +index 33743f8fd..49f282332 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -26,7 +26,7 @@ index 535a8d3ed..e3ff78180 100644 + } } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 4af557321..6ee9f6cfb 100644 +index bfe2d03a5..9fd07f859 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -0,0 +0,0 @@ public class PlayerChunkMap { 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 new file mode 100644 index 0000000000..811c4251c0 --- /dev/null +++ b/Spigot-Server-Patches/Configurable-Keep-Spawn-Loaded-range-per-world.patch @@ -0,0 +1,85 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Sat, 13 Sep 2014 23:14:43 -0400 +Subject: [PATCH] Configurable Keep Spawn Loaded range per world + +This lets you disable it for some worlds and lower it for others. + +diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +index eb09be512..6ac58e5ec 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +@@ -0,0 +0,0 @@ public class PaperWorldConfig { + grassUpdateRate = Math.max(0, getInt("grass-spread-tick-rate", grassUpdateRate)); + log("Grass Spread Tick Rate: " + grassUpdateRate); + } ++ ++ public short keepLoadedRange; ++ private void keepLoadedRange() { ++ keepLoadedRange = (short) (getInt("keep-spawn-loaded-range", Math.min(spigotConfig.viewDistance, 8)) * 16); ++ log( "Keep Spawn Loaded Range: " + (keepLoadedRange/16)); ++ } + } +diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java +index 1027b0588..b7aa9e869 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 IAsyncTaskHandler, IMojangStati + ArrayList arraylist = Lists.newArrayList(); + Set set = Sets.newConcurrentHashSet(); + +- for (int i = -192; i <= 192 && this.isRunning(); i += 16) { +- for (int j = -192; j <= 192 && this.isRunning(); j += 16) { ++ // Paper start ++ short radius = worldserver.paperConfig.keepLoadedRange; ++ for (int i = -radius; i <= radius && this.isRunning(); i += 16) { ++ for (int j = -radius; j <= radius && this.isRunning(); j += 16) { ++ // Paper end + arraylist.add(new ChunkCoordIntPair(blockposition.getX() + i >> 4, blockposition.getZ() + j >> 4)); + } + +diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java +index e42a334bc..d15afd595 100644 +--- a/src/main/java/net/minecraft/server/World.java ++++ b/src/main/java/net/minecraft/server/World.java +@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + int k = i * 16 + 8 - blockposition.getX(); + int l = j * 16 + 8 - blockposition.getZ(); + boolean flag = true; ++ short keepLoadedRange = paperConfig.keepLoadedRange; // Paper + +- return k >= -128 && k <= 128 && l >= -128 && l <= 128 && this.keepSpawnInMemory; // CraftBukkit - Added 'this.keepSpawnInMemory' ++ return k >= -keepLoadedRange && k <= keepLoadedRange && l >= -keepLoadedRange && l <= keepLoadedRange && this.keepSpawnInMemory; // CraftBukkit - Added 'this.keepSpawnInMemory' // Paper - Re-add range var + } + + 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 f90dc11f2..06b59657f 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 { + System.out.println("Preparing start region for level " + (console.worlds.size() - 1) + " (Seed: " + internal.getSeed() + ")"); + + if (internal.getWorld().getKeepSpawnInMemory()) { +- short short1 = 196; ++ short short1 = internal.paperConfig.keepLoadedRange; // Paper + long i = System.currentTimeMillis(); + for (int j = -short1; j <= short1; j += 16) { + for (int k = -short1; k <= short1; k += 16) { +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +index 4df849eef..9d88b9ddb 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +@@ -0,0 +0,0 @@ public class CraftWorld implements World { + int chunkCoordX = chunkcoordinates.getX() >> 4; + int chunkCoordZ = chunkcoordinates.getZ() >> 4; + // Cycle through the 25x25 Chunks around it to load/unload the chunks. +- for (int x = -12; x <= 12; x++) { +- for (int z = -12; z <= 12; z++) { ++ int radius = world.paperConfig.keepLoadedRange / 16; // Paper ++ for (int x = -radius; x <= radius; x++) { // Paper ++ for (int z = -radius; z <= radius; z++) { // Paper + if (keepLoaded) { + loadChunk(chunkCoordX + x, chunkCoordZ + z); + } else { +-- \ No newline at end of file diff --git a/Spigot-Server-Patches/Configurable-Max-Chunk-Gens-per-Tick.patch b/Spigot-Server-Patches/Configurable-Max-Chunk-Gens-per-Tick.patch deleted file mode 100644 index ffe02328b7..0000000000 --- a/Spigot-Server-Patches/Configurable-Max-Chunk-Gens-per-Tick.patch +++ /dev/null @@ -1,110 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Mon, 1 Jan 2018 16:10:24 -0500 -Subject: [PATCH] Configurable Max Chunk Gens per Tick - -Limit the number of generations that can occur in a single tick, forcing them -to be spread out more. - -Defaulting to 10 as an average generation is going to be 3-6ms, which means 10 will -likely cause the server to lose TPS, but constrain how much. - -This should result in no noticeable speed reduction in generation for servers not -lagging, and let larger servers reduce this value according to their own desires. - -diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index e3ff78180..0ddf826f9 100644 ---- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -0,0 +0,0 @@ public class PaperWorldConfig { - } - log("Max Chunk Sends Per Tick: " + maxChunkSendsPerTick); - } -+ -+ public int maxChunkGensPerTick = 10; -+ private void maxChunkGensPerTick() { -+ maxChunkGensPerTick = getInt("max-chunk-gens-per-tick", maxChunkGensPerTick); -+ if (maxChunkGensPerTick <= 0) { -+ maxChunkGensPerTick = Integer.MAX_VALUE; -+ log("Max Chunk Gens Per Tick: Unlimited (NOT RECOMMENDED)"); -+ } else { -+ log("Max Chunk Gens Per Tick: " + maxChunkGensPerTick); -+ } -+ } -+ - } -diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index 395386f29..baf72404e 100644 ---- a/src/main/java/net/minecraft/server/PlayerChunk.java -+++ b/src/main/java/net/minecraft/server/PlayerChunk.java -@@ -0,0 +0,0 @@ public class PlayerChunk { - private boolean done; - - // CraftBukkit start - add fields -+ boolean chunkExists; // Paper - private boolean loadInProgress = false; - private Runnable loadedRunnable = new Runnable() { - public void run() { -@@ -0,0 +0,0 @@ public class PlayerChunk { - // CraftBukkit start - loadInProgress = true; - this.chunk = playerchunkmap.getWorld().getChunkProviderServer().getChunkAt(i, j, loadedRunnable, false); -+ this.chunkExists = this.chunk != null || ChunkIOExecutor.hasQueuedChunkLoad(playerChunkMap.getWorld(), i, j); // Paper - markChunkUsed(); // Paper - delay chunk unloads - // CraftBukkit end - } -diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 6ee9f6cfb..99652ae3e 100644 ---- a/src/main/java/net/minecraft/server/PlayerChunkMap.java -+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -0,0 +0,0 @@ public class PlayerChunkMap { - // Spigot start - org.spigotmc.SlackActivityAccountant activityAccountant = this.world.getMinecraftServer().slackActivityAccountant; - activityAccountant.startActivity(0.5); -+ int chunkGensAllowed = world.paperConfig.maxChunkGensPerTick; // Paper - // Spigot end - - Iterator iterator1 = this.h.iterator(); -@@ -0,0 +0,0 @@ public class PlayerChunkMap { - - if (playerchunk1.f() == null) { - boolean flag = playerchunk1.a(PlayerChunkMap.b); -+ // Paper start -+ if (flag && !playerchunk1.chunkExists && chunkGensAllowed-- <= 0) { -+ continue; -+ } -+ // Paper end - - if (playerchunk1.a(flag)) { - iterator1.remove(); -diff --git a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOExecutor.java b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOExecutor.java -index 9aaca21a7..f50d55c8e 100644 ---- a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOExecutor.java -+++ b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOExecutor.java -@@ -0,0 +0,0 @@ public class ChunkIOExecutor { - public static void tick() { - instance.finishActive(); - } -+ -+ // Paper start -+ public static boolean hasQueuedChunkLoad(World world, int x, int z) { -+ return instance.hasTask(new QueuedChunk(x, z, null, world, null)); -+ } -+ // Paper end - } -diff --git a/src/main/java/org/bukkit/craftbukkit/util/AsynchronousExecutor.java b/src/main/java/org/bukkit/craftbukkit/util/AsynchronousExecutor.java -index 193c3621c..cf1258c55 100644 ---- a/src/main/java/org/bukkit/craftbukkit/util/AsynchronousExecutor.java -+++ b/src/main/java/org/bukkit/craftbukkit/util/AsynchronousExecutor.java -@@ -0,0 +0,0 @@ public final class AsynchronousExecutor { - public void setActiveThreads(final int coreSize) { - pool.setCorePoolSize(coreSize); - } -+ -+ // Paper start -+ public boolean hasTask(P parameter) throws IllegalStateException { -+ return tasks.get(parameter) != null; -+ } -+ // Paper end - } --- \ No newline at end of file diff --git a/Spigot-Server-Patches/Configurable-packet-in-spam-threshold.patch b/Spigot-Server-Patches/Configurable-packet-in-spam-threshold.patch index 3195b50e1c..ba1dc31e49 100644 --- a/Spigot-Server-Patches/Configurable-packet-in-spam-threshold.patch +++ b/Spigot-Server-Patches/Configurable-packet-in-spam-threshold.patch @@ -23,7 +23,7 @@ index cf06f8ac3..2001175bf 100644 + } } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index c09620b37..aa7c019ab 100644 +index e9ce81bfc..c757881b7 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { diff --git a/Spigot-Server-Patches/Don-t-blindly-send-unlit-chunks-when-lighting-update.patch b/Spigot-Server-Patches/Don-t-blindly-send-unlit-chunks-when-lighting-update.patch deleted file mode 100644 index 0286de617e..0000000000 --- a/Spigot-Server-Patches/Don-t-blindly-send-unlit-chunks-when-lighting-update.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shane Freeder -Date: Mon, 18 Dec 2017 07:26:56 +0000 -Subject: [PATCH] Don't blindly send unlit chunks when lighting updates are - allowed - -Spigot, by default, disables several mechanisms around how chunks are -lit, if ever, which has forced them to always send chunks before vanilla -would consider them ready to send, causing for lots of issues around -lighting glitches. - -Shamefully, the amount of work to relight chunks can be detremental -to some servers, meaning that forcibily disabling light updates can -cause major performance issues. - -as such, we make a compromise; if this "feature" is disabled, we will -only send chunks which are actually ready to be sent, otherwise, we -will always send chunks. - -diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index cb33cf902..87d0d426f 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 { - // Paper end - private boolean done; - private boolean lit; -- private boolean r; -+ private boolean r; private boolean isTicked() { return r; }; // Paper - OBFHELPER - private boolean s; - private boolean t; - private long lastSaved; -@@ -0,0 +0,0 @@ public class Chunk { - * We cannot unfortunately do this lighting stage during chunk gen as it appears to put a lot more noticeable load on the server, than when it is done at play time. - * For now at least we will simply send all chunks, in accordance with pre 1.7 behaviour. - */ -- return true; -+ // Paper Start -+ // if randomLightUpdates are disabled, we should always return true, otherwise chunks may never send -+ // to the client due to not being lit, otherwise retain standard behavior and only send properly lit chunks. -+ return !this.world.spigotConfig.randomLightUpdates || (this.isTicked() && this.done && this.lit); -+ // Paper End - // Spigot End - } - --- \ No newline at end of file diff --git a/Spigot-Server-Patches/Ensure-commands-are-not-ran-async.patch b/Spigot-Server-Patches/Ensure-commands-are-not-ran-async.patch index 833a07474a..55f9ee6995 100644 --- a/Spigot-Server-Patches/Ensure-commands-are-not-ran-async.patch +++ b/Spigot-Server-Patches/Ensure-commands-are-not-ran-async.patch @@ -14,7 +14,7 @@ big slowdown in execution but throwing an exception at same time to raise awaren that it is happening so that plugin authors can fix their code to stop executing commands async. diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 2adb21e55..27c255c8d 100644 +index c2eb3a58d..9c27966ea 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -48,12 +48,12 @@ index 2adb21e55..27c255c8d 100644 } else if (this.player.getChatFlags() == EntityHuman.EnumChatVisibility.SYSTEM) { // Do nothing, this is coming from a plugin diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 2055bf7de..29344593a 100644 +index 6e152fe17..d637199ca 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 { - Validate.notNull(sender, "Sender cannot be null"); Validate.notNull(commandLine, "CommandLine cannot be null"); + org.spigotmc.AsyncCatcher.catchOp( "command dispatch" ); // Spigot + // Paper Start + if (!org.spigotmc.AsyncCatcher.shuttingDown && !Bukkit.isPrimaryThread()) { diff --git a/Spigot-Server-Patches/ExperienceOrbMergeEvent.patch b/Spigot-Server-Patches/ExperienceOrbMergeEvent.patch index 57b7840c67..8c5161d044 100644 --- a/Spigot-Server-Patches/ExperienceOrbMergeEvent.patch +++ b/Spigot-Server-Patches/ExperienceOrbMergeEvent.patch @@ -8,10 +8,10 @@ Plugins can cancel this if they want to ensure experience orbs do not lose impor metadata such as spawn reason, or conditionally move data from source to target. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 39b90fb4c..c0816b9f8 100644 +index 069ba83db..ee061d693 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { +@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose for (Entity e : entities) { if (e instanceof EntityExperienceOrb) { EntityExperienceOrb loopItem = (EntityExperienceOrb) e; diff --git a/Spigot-Server-Patches/Expose-server-CommandMap.patch b/Spigot-Server-Patches/Expose-server-CommandMap.patch index 3c96425834..619cfdc808 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 29344593a..32a05ca18 100644 +index d637199ca..703d38f0c 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-block-break-desync.patch b/Spigot-Server-Patches/Fix-block-break-desync.patch index 379fa184e1..58459f7cbd 100644 --- a/Spigot-Server-Patches/Fix-block-break-desync.patch +++ b/Spigot-Server-Patches/Fix-block-break-desync.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix block break desync diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index b69c194bb..25e3d6423 100644 +index a7132427a..32c99085f 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { diff --git a/Spigot-Server-Patches/Further-improve-server-tick-loop.patch b/Spigot-Server-Patches/Further-improve-server-tick-loop.patch index af4c278714..9c58d7036a 100644 --- a/Spigot-Server-Patches/Further-improve-server-tick-loop.patch +++ b/Spigot-Server-Patches/Further-improve-server-tick-loop.patch @@ -148,7 +148,7 @@ index 4889a82a2..2e691b9f6 100644 } lastTick = curTime; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 28f6cdf96..2055bf7de 100644 +index 34a07a7e7..6e152fe17 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/Implement-ensureServerConversions-API.patch b/Spigot-Server-Patches/Implement-ensureServerConversions-API.patch index 432963366c..d09322099c 100644 --- a/Spigot-Server-Patches/Implement-ensureServerConversions-API.patch +++ b/Spigot-Server-Patches/Implement-ensureServerConversions-API.patch @@ -7,7 +7,7 @@ This will take a Bukkit ItemStack and run it through any conversions a server pr to ensure it meets latest minecraft expectations. diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index e305d663a..503dd5827 100644 +index 59d2685dc..27a264f54 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java @@ -0,0 +0,0 @@ public final class CraftItemFactory implements ItemFactory { diff --git a/Spigot-Server-Patches/Implement-getI18NDisplayName.patch b/Spigot-Server-Patches/Implement-getI18NDisplayName.patch index 1329903bc0..d3b25857fa 100644 --- a/Spigot-Server-Patches/Implement-getI18NDisplayName.patch +++ b/Spigot-Server-Patches/Implement-getI18NDisplayName.patch @@ -8,7 +8,7 @@ Currently the server only supports the English language. To override this, You must replace the language file embedded in the server jar. diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index 503dd5827..73785830f 100644 +index 27a264f54..6fc0ce050 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java @@ -0,0 +0,0 @@ public final class CraftItemFactory implements ItemFactory { diff --git a/Spigot-Server-Patches/Paper-config-files.patch b/Spigot-Server-Patches/Paper-config-files.patch index ac1e7a0821..919de379e8 100644 --- a/Spigot-Server-Patches/Paper-config-files.patch +++ b/Spigot-Server-Patches/Paper-config-files.patch @@ -576,7 +576,7 @@ index c7f5cba2d..330ea4e72 100644 this.world = new CraftWorld((WorldServer) this, gen, env); this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 8b118e81e..dad2dc959 100644 +index ce5ebcc54..88766d30d 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/PlayerPickupExperienceEvent.patch b/Spigot-Server-Patches/PlayerPickupExperienceEvent.patch index a66ab69356..db8ad7ed8e 100644 --- a/Spigot-Server-Patches/PlayerPickupExperienceEvent.patch +++ b/Spigot-Server-Patches/PlayerPickupExperienceEvent.patch @@ -6,16 +6,16 @@ Subject: [PATCH] PlayerPickupExperienceEvent Allows plugins to cancel a player picking up an experience orb diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -index d567ad4a5..ff5cc74ba 100644 +index 79d80596d..a87ef5fb8 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java @@ -0,0 +0,0 @@ public class EntityExperienceOrb extends Entity { public void d(EntityHuman entityhuman) { if (!this.world.isClientSide) { -- if (this.c == 0 && entityhuman.bD == 0) { -+ if (this.c == 0 && entityhuman.bD == 0 && new com.destroystokyo.paper.event.player.PlayerPickupExperienceEvent(((EntityPlayer) entityhuman).getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) this.getBukkitEntity()).callEvent()) { // Paper - entityhuman.bD = 2; +- if (this.c == 0 && entityhuman.bJ == 0) { ++ if (this.c == 0 && entityhuman.bJ == 0 && new com.destroystokyo.paper.event.player.PlayerPickupExperienceEvent(((EntityPlayer) entityhuman).getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) this.getBukkitEntity()).callEvent()) { // Paper + entityhuman.bJ = 2; entityhuman.receive(this, 1); - ItemStack itemstack = EnchantmentManager.b(Enchantments.C, (EntityLiving) entityhuman); + ItemStack itemstack = EnchantmentManager.b(Enchantments.G, (EntityLiving) entityhuman); -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Remove-Metadata-on-reload.patch b/Spigot-Server-Patches/Remove-Metadata-on-reload.patch index f8b8b7211a..534ca42b7a 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 5ffb335f5..f98f355dd 100644 +index 1c9637ff7..f90dc11f2 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/Timings-v2.patch b/Spigot-Server-Patches/Timings-v2.patch index 2bcf4c279b..8f679539d7 100644 --- a/Spigot-Server-Patches/Timings-v2.patch +++ b/Spigot-Server-Patches/Timings-v2.patch @@ -989,7 +989,7 @@ index ac6d8cc6e..d975c2ccf 100644 } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 227bc857e..2adb21e55 100644 +index 749be86fe..c2eb3a58d 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; @@ -1380,7 +1380,7 @@ index 784289c0d..d7f86bf76 100644 // CraftBukkit start diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index dad2dc959..88ea651ba 100644 +index 88766d30d..d33f237b7 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/Use-TerminalConsoleAppender-for-console-improvements.patch b/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch index 1fe73f63a0..2043a86ae2 100644 --- a/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch +++ b/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch @@ -310,7 +310,7 @@ index 5e833c378..0f39fa49f 100644 this.k = new GameProfileBanList(PlayerList.a); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 6c611c0df..3b10c5e61 100644 +index 470e334f7..9fe7c6a0d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ import java.nio.ByteBuffer; diff --git a/work/CraftBukkit b/work/CraftBukkit index a71d06a0c8..de019a35f0 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit a71d06a0c8426f7d1d23f9e76ea6cdf47b666db5 +Subproject commit de019a35f009518bbabb3f39383e374cf8aae799 diff --git a/work/Spigot b/work/Spigot index 11bdb291b3..83d9d09afb 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit 11bdb291b30fed321b346668a4b5e4ddf45229b6 +Subproject commit 83d9d09afb65204de4f6050c4033d482dd2a0d6a