From b4b181a1fb503673da63df78a140d985b974afca Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Fri, 26 Apr 2019 23:26:04 -0700 Subject: [PATCH] More 1.14 work --- ...PI-for-Reason-Source-Triggering-play.patch | 10 +- ...0103-Optimize-UserCache-Thread-Safe.patch} | 8 +- ...locking-on-Network-Manager-creation.patch} | 4 +- ...-Optional-TNT-doesn-t-move-in-water.patch} | 27 +- ...-redstone-torch-rapid-clock-removal.patch} | 8 +- ...h => 0107-Add-server-name-parameter.patch} | 6 +- ...n-Wither-Death-sounds-to-same-world.patch} | 26 +- .../0109-Fix-Double-World-Add-issues.patch | 24 ++ ...tch => 0110-Fix-Old-Sign-Conversion.patch} | 38 +-- ...-profiles-that-have-no-UUID-and-no-.patch} | 4 +- ...ative-vehicle-moved-wrongly-message.patch} | 6 +- ...rs-that-dismount-from-other-players.patch} | 6 +- ...etting-for-proxy-online-mode-status.patch} | 18 +- ...timise-BlockState-s-hashCode-equals.patch} | 25 +- ...nfigurable-packet-in-spam-threshold.patch} | 10 +- ...7-Configurable-flying-kick-messages.patch} | 14 +- .../0118-Chunk-registration-fixes.patch | 25 ++ ...k-reference-on-Craft-Entity-removal.patch} | 6 +- ...to-fix-bad-Y-levels-on-player-login.patch} | 12 +- ...ion-to-remove-corrupt-tile-entities.patch} | 24 +- ...nt.patch => 0122-Add-EntityZapEvent.patch} | 54 ++-- ...hunks-from-Hoppers-and-other-things.patch} | 18 +- ...-from-ArmorStand-and-SpawnEgg-items.patch} | 16 +- .../0124-Fix-Double-World-Add-issues.patch | 37 --- ...25-Cache-user-authenticator-threads.patch} | 20 +- ....patch => 0126-Optimise-removeQueue.patch} | 26 +- ...-Allow-Reloading-of-Command-Aliases.patch} | 6 +- ...-Add-source-to-PlayerExpChangeEvent.patch} | 14 +- ...mize-World.isLoaded-BlockPosition-Z.patch} | 8 +- ...-Don-t-let-fishinghooks-use-portals.patch} | 24 +- ... => 0131-Add-ProjectileCollideEvent.patch} | 93 +++--- .../0131-Disable-ticking-of-snow-blocks.patch | 29 -- ...ent-Pathfinding-out-of-World-Border.patch} | 27 +- ...Bound-Treasure-Maps-to-World-Border.patch} | 24 +- ...figurable-Cartographer-Treasure-Maps.patch | 60 ++++ .../0135-Chunk-registration-fixes.patch | 25 -- ... => 0135-Optimize-ItemStack.isEmpty.patch} | 6 +- ...o-control-if-armour-stands-can-move.patch} | 22 +- ...7-Properly-fix-item-duplication-bug.patch} | 12 +- ...=> 0138-String-based-Action-Bar-API.patch} | 8 +- ...-API-s.patch => 0139-Firework-API-s.patch} | 90 +++--- ... 0140-PlayerTeleportEndGatewayEvent.patch} | 6 +- ...ovide-E-TE-Chunk-count-stat-methods.patch} | 10 +- ...h => 0142-Enforce-Sync-Player-Saves.patch} | 18 +- ...low-entities-to-ride-themselves-572.patch} | 6 +- ...atch => 0144-Fix-block-break-desync.patch} | 6 +- ...I-for-Reason-Source-Triggering-play.patch} | 158 ++++++---- ...patch => 0146-Cap-Entity-Collisions.patch} | 16 +- ...-CraftScheduler-Async-Task-Debugger.patch} | 10 +- ...more-aggressive-in-the-chunk-unload-.patch | 22 ++ ...> 0149-Do-not-let-armorstands-drown.patch} | 20 +- ...e-async-calls-to-restart-the-server.patch} | 277 +++++++++--------- ...roperty-to-disable-book-size-limits.patch} | 12 +- ...e-parrots-stay-on-shoulders-despite.patch} | 14 +- ...-option-to-prevent-player-names-fro.patch} | 14 +- ...figurable-Cartographer-Treasure-Maps.patch | 44 --- ...leAppender-for-console-improvements.patch} | 148 +++++----- ...rable-option-to-disable-creeper-lin.patch} | 10 +- ....patch => 0156-Item-canEntityPickup.patch} | 26 +- ...layerPickupItemEvent-setFlyAtPlayer.patch} | 12 +- ...> 0158-PlayerAttemptPickupItemEvent.patch} | 8 +- ...tch => 0159-Add-UnknownCommandEvent.patch} | 8 +- ...tch => 0160-Basic-PlayerProfile-API.patch} | 52 ++-- .../0164-Enforce-Sync-Chunk-Unloads.patch | 31 -- ...more-aggressive-in-the-chunk-unload-.patch | 22 -- .../0115-Activation-Range-Improvements.patch | 0 ...-Ensure-Chunks-never-ever-load-async.patch | 0 ...unk-Unloads-based-on-Player-Movement.patch | 2 +- .../1.14}/0134-Auto-Save-Improvements.patch | 0 .../1.14}/0138-Disable-Vanilla-Chunk-GC.patch | 0 ...vent-Auto-Save-if-Save-Queue-is-full.patch | 0 .../0143-Chunk-Save-Stats-Debug-Option.patch | 0 .../0161-ShulkerBox-Dupe-Prevention.patch | 0 73 files changed, 936 insertions(+), 936 deletions(-) rename Spigot-Server-Patches/{0116-Optimize-UserCache-Thread-Safe.patch => 0103-Optimize-UserCache-Thread-Safe.patch} (93%) rename Spigot-Server-Patches/{0117-Avoid-blocking-on-Network-Manager-creation.patch => 0104-Avoid-blocking-on-Network-Manager-creation.patch} (96%) rename Spigot-Server-Patches/{0118-Optional-TNT-doesn-t-move-in-water.patch => 0105-Optional-TNT-doesn-t-move-in-water.patch} (86%) rename Spigot-Server-Patches/{0119-Faster-redstone-torch-rapid-clock-removal.patch => 0106-Faster-redstone-torch-rapid-clock-removal.patch} (88%) rename Spigot-Server-Patches/{0121-Add-server-name-parameter.patch => 0107-Add-server-name-parameter.patch} (86%) rename Spigot-Server-Patches/{0122-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch => 0108-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch} (73%) create mode 100644 Spigot-Server-Patches/0109-Fix-Double-World-Add-issues.patch rename Spigot-Server-Patches/{0125-Fix-Old-Sign-Conversion.patch => 0110-Fix-Old-Sign-Conversion.patch} (61%) rename Spigot-Server-Patches/{0126-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch => 0111-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch} (90%) rename Spigot-Server-Patches/{0127-More-informative-vehicle-moved-wrongly-message.patch => 0112-More-informative-vehicle-moved-wrongly-message.patch} (82%) rename Spigot-Server-Patches/{0128-Re-track-players-that-dismount-from-other-players.patch => 0113-Re-track-players-that-dismount-from-other-players.patch} (85%) rename Spigot-Server-Patches/{0129-Add-setting-for-proxy-online-mode-status.patch => 0114-Add-setting-for-proxy-online-mode-status.patch} (84%) rename Spigot-Server-Patches/{0130-Optimise-BlockState-s-hashCode-equals.patch => 0115-Optimise-BlockState-s-hashCode-equals.patch} (79%) rename Spigot-Server-Patches/{0132-Configurable-packet-in-spam-threshold.patch => 0116-Configurable-packet-in-spam-threshold.patch} (88%) rename Spigot-Server-Patches/{0133-Configurable-flying-kick-messages.patch => 0117-Configurable-flying-kick-messages.patch} (82%) create mode 100644 Spigot-Server-Patches/0118-Chunk-registration-fixes.patch rename Spigot-Server-Patches/{0136-Remove-FishingHook-reference-on-Craft-Entity-removal.patch => 0119-Remove-FishingHook-reference-on-Craft-Entity-removal.patch} (83%) rename Spigot-Server-Patches/{0137-Auto-fix-bad-Y-levels-on-player-login.patch => 0120-Auto-fix-bad-Y-levels-on-player-login.patch} (68%) rename Spigot-Server-Patches/{0139-Option-to-remove-corrupt-tile-entities.patch => 0121-Option-to-remove-corrupt-tile-entities.patch} (56%) rename Spigot-Server-Patches/{0140-Add-EntityZapEvent.patch => 0122-Add-EntityZapEvent.patch} (53%) rename Spigot-Server-Patches/{0141-Don-t-load-Chunks-from-Hoppers-and-other-things.patch => 0123-Don-t-load-Chunks-from-Hoppers-and-other-things.patch} (67%) rename Spigot-Server-Patches/{0144-Filter-bad-data-from-ArmorStand-and-SpawnEgg-items.patch => 0124-Filter-bad-data-from-ArmorStand-and-SpawnEgg-items.patch} (86%) delete mode 100644 Spigot-Server-Patches/0124-Fix-Double-World-Add-issues.patch rename Spigot-Server-Patches/{0145-Cache-user-authenticator-threads.patch => 0125-Cache-user-authenticator-threads.patch} (78%) rename Spigot-Server-Patches/{0146-Optimise-removeQueue.patch => 0126-Optimise-removeQueue.patch} (80%) rename Spigot-Server-Patches/{0147-Allow-Reloading-of-Command-Aliases.patch => 0127-Allow-Reloading-of-Command-Aliases.patch} (89%) rename Spigot-Server-Patches/{0148-Add-source-to-PlayerExpChangeEvent.patch => 0128-Add-source-to-PlayerExpChangeEvent.patch} (86%) rename Spigot-Server-Patches/{0149-Optimize-World.isLoaded-BlockPosition-Z.patch => 0129-Optimize-World.isLoaded-BlockPosition-Z.patch} (76%) rename Spigot-Server-Patches/{0150-Don-t-let-fishinghooks-use-portals.patch => 0130-Don-t-let-fishinghooks-use-portals.patch} (66%) rename Spigot-Server-Patches/{0151-Add-ProjectileCollideEvent.patch => 0131-Add-ProjectileCollideEvent.patch} (51%) delete mode 100644 Spigot-Server-Patches/0131-Disable-ticking-of-snow-blocks.patch rename Spigot-Server-Patches/{0152-Prevent-Pathfinding-out-of-World-Border.patch => 0132-Prevent-Pathfinding-out-of-World-Border.patch} (50%) rename Spigot-Server-Patches/{0153-Bound-Treasure-Maps-to-World-Border.patch => 0133-Bound-Treasure-Maps-to-World-Border.patch} (64%) create mode 100644 Spigot-Server-Patches/0134-Configurable-Cartographer-Treasure-Maps.patch delete mode 100644 Spigot-Server-Patches/0135-Chunk-registration-fixes.patch rename Spigot-Server-Patches/{0155-Optimize-ItemStack.isEmpty.patch => 0135-Optimize-ItemStack.isEmpty.patch} (83%) rename Spigot-Server-Patches/{0156-Add-API-methods-to-control-if-armour-stands-can-move.patch => 0136-Add-API-methods-to-control-if-armour-stands-can-move.patch} (72%) rename Spigot-Server-Patches/{0157-Properly-fix-item-duplication-bug.patch => 0137-Properly-fix-item-duplication-bug.patch} (80%) rename Spigot-Server-Patches/{0158-String-based-Action-Bar-API.patch => 0138-String-based-Action-Bar-API.patch} (92%) rename Spigot-Server-Patches/{0159-Firework-API-s.patch => 0139-Firework-API-s.patch} (55%) rename Spigot-Server-Patches/{0160-PlayerTeleportEndGatewayEvent.patch => 0140-PlayerTeleportEndGatewayEvent.patch} (88%) rename Spigot-Server-Patches/{0162-Provide-E-TE-Chunk-count-stat-methods.patch => 0141-Provide-E-TE-Chunk-count-stat-methods.patch} (85%) rename Spigot-Server-Patches/{0163-Enforce-Sync-Player-Saves.patch => 0142-Enforce-Sync-Player-Saves.patch} (59%) rename Spigot-Server-Patches/{0165-Don-t-allow-entities-to-ride-themselves-572.patch => 0143-Don-t-allow-entities-to-ride-themselves-572.patch} (82%) rename Spigot-Server-Patches/{0166-Fix-block-break-desync.patch => 0144-Fix-block-break-desync.patch} (82%) rename Spigot-Server-Patches/{0167-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch => 0145-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch} (63%) rename Spigot-Server-Patches/{0168-Cap-Entity-Collisions.patch => 0146-Cap-Entity-Collisions.patch} (85%) rename Spigot-Server-Patches/{0169-Remove-CraftScheduler-Async-Task-Debugger.patch => 0147-Remove-CraftScheduler-Async-Task-Debugger.patch} (87%) create mode 100644 Spigot-Server-Patches/0148-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch rename Spigot-Server-Patches/{0171-Do-not-let-armorstands-drown.patch => 0149-Do-not-let-armorstands-drown.patch} (74%) rename Spigot-Server-Patches/{0172-Properly-handle-async-calls-to-restart-the-server.patch => 0150-Properly-handle-async-calls-to-restart-the-server.patch} (73%) rename Spigot-Server-Patches/{0173-Add-system-property-to-disable-book-size-limits.patch => 0151-Add-system-property-to-disable-book-size-limits.patch} (87%) rename Spigot-Server-Patches/{0174-Add-option-to-make-parrots-stay-on-shoulders-despite.patch => 0152-Add-option-to-make-parrots-stay-on-shoulders-despite.patch} (87%) rename Spigot-Server-Patches/{0175-Add-configuration-option-to-prevent-player-names-fro.patch => 0153-Add-configuration-option-to-prevent-player-names-fro.patch} (73%) delete mode 100644 Spigot-Server-Patches/0154-Configurable-Cartographer-Treasure-Maps.patch rename Spigot-Server-Patches/{0176-Use-TerminalConsoleAppender-for-console-improvements.patch => 0154-Use-TerminalConsoleAppender-for-console-improvements.patch} (88%) rename Spigot-Server-Patches/{0177-provide-a-configurable-option-to-disable-creeper-lin.patch => 0155-provide-a-configurable-option-to-disable-creeper-lin.patch} (86%) rename Spigot-Server-Patches/{0178-Item-canEntityPickup.patch => 0156-Item-canEntityPickup.patch} (74%) rename Spigot-Server-Patches/{0179-PlayerPickupItemEvent-setFlyAtPlayer.patch => 0157-PlayerPickupItemEvent-setFlyAtPlayer.patch} (79%) rename Spigot-Server-Patches/{0180-PlayerAttemptPickupItemEvent.patch => 0158-PlayerAttemptPickupItemEvent.patch} (88%) rename Spigot-Server-Patches/{0181-Add-UnknownCommandEvent.patch => 0159-Add-UnknownCommandEvent.patch} (85%) rename Spigot-Server-Patches/{0182-Basic-PlayerProfile-API.patch => 0160-Basic-PlayerProfile-API.patch} (94%) delete mode 100644 Spigot-Server-Patches/0164-Enforce-Sync-Chunk-Unloads.patch delete mode 100644 Spigot-Server-Patches/0170-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch rename {Spigot-Server-Patches => removed/1.14}/0115-Activation-Range-Improvements.patch (100%) rename {Spigot-Server-Patches => removed/1.14}/0120-Ensure-Chunks-never-ever-load-async.patch (100%) rename {Spigot-Server-Patches => removed/1.14}/0123-Delay-Chunk-Unloads-based-on-Player-Movement.patch (99%) mode change 100644 => 100755 rename {Spigot-Server-Patches => removed/1.14}/0134-Auto-Save-Improvements.patch (100%) rename {Spigot-Server-Patches => removed/1.14}/0138-Disable-Vanilla-Chunk-GC.patch (100%) rename {Spigot-Server-Patches => removed/1.14}/0142-Prevent-Auto-Save-if-Save-Queue-is-full.patch (100%) rename {Spigot-Server-Patches => removed/1.14}/0143-Chunk-Save-Stats-Debug-Option.patch (100%) rename {Spigot-Server-Patches => removed/1.14}/0161-ShulkerBox-Dupe-Prevention.patch (100%) mode change 100644 => 100755 diff --git a/Spigot-API-Patches/0048-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch b/Spigot-API-Patches/0048-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch index cf572c13a5..294f9e6326 100644 --- a/Spigot-API-Patches/0048-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch +++ b/Spigot-API-Patches/0048-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch @@ -1,4 +1,4 @@ -From 59ae19524b32260191e1daaa772623d3c08255d1 Mon Sep 17 00:00:00 2001 +From 73882b98ebeec264ffcbd3e0d396e85b9d7dfba0 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 19 Dec 2017 16:28:32 -0500 Subject: [PATCH] ExperienceOrbs API for Reason/Source/Triggering player @@ -8,7 +8,7 @@ Adds lots of information about why this orb exists. Replaces isFromBottle() with logic that persists entity reloads too. diff --git a/src/main/java/org/bukkit/entity/ExperienceOrb.java b/src/main/java/org/bukkit/entity/ExperienceOrb.java -index c286edfd..57029d9b 100644 +index c286edfd..dec70bbf 100644 --- a/src/main/java/org/bukkit/entity/ExperienceOrb.java +++ b/src/main/java/org/bukkit/entity/ExperienceOrb.java @@ -1,5 +1,8 @@ @@ -20,7 +20,7 @@ index c286edfd..57029d9b 100644 /** * Represents an Experience Orb. */ -@@ -18,4 +21,95 @@ public interface ExperienceOrb extends Entity { +@@ -18,4 +21,99 @@ public interface ExperienceOrb extends Entity { * @param value Amount of experience */ public void setExperience(int value); @@ -78,6 +78,10 @@ index c286edfd..57029d9b 100644 + */ + EXP_BOTTLE, + /** ++ * Spawned by a player using a grindstone ++ */ ++ GRINDSTONE, ++ /** + * We do not know why it was spawned + */ + UNKNOWN diff --git a/Spigot-Server-Patches/0116-Optimize-UserCache-Thread-Safe.patch b/Spigot-Server-Patches/0103-Optimize-UserCache-Thread-Safe.patch similarity index 93% rename from Spigot-Server-Patches/0116-Optimize-UserCache-Thread-Safe.patch rename to Spigot-Server-Patches/0103-Optimize-UserCache-Thread-Safe.patch index e55ca7d5ed..c736a95aee 100644 --- a/Spigot-Server-Patches/0116-Optimize-UserCache-Thread-Safe.patch +++ b/Spigot-Server-Patches/0103-Optimize-UserCache-Thread-Safe.patch @@ -1,4 +1,4 @@ -From fad39d84f9fedb2d3b8d1484417472592904368e Mon Sep 17 00:00:00 2001 +From 245f3f088315c482ace01add5ac71d7876577d44 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 16 May 2016 20:47:41 -0400 Subject: [PATCH] Optimize UserCache / Thread Safe @@ -10,10 +10,10 @@ Additionally, move Saving of the User cache to be done async, incase the user never changed the default setting for Spigot's save on stop only. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 78b60d0e35..7ffb061414 100644 +index cddb4311a..c41adf441 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -687,7 +687,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati +@@ -727,7 +727,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant Date: Mon, 16 May 2016 23:19:16 -0400 Subject: [PATCH] Avoid blocking on Network Manager creation @@ -6,7 +6,7 @@ Subject: [PATCH] Avoid blocking on Network Manager creation Per Paper issue 294 diff --git a/src/main/java/net/minecraft/server/ServerConnection.java b/src/main/java/net/minecraft/server/ServerConnection.java -index 41ff55e9e2..baabcd19c4 100644 +index 42c654a1d..e7ed6af9c 100644 --- a/src/main/java/net/minecraft/server/ServerConnection.java +++ b/src/main/java/net/minecraft/server/ServerConnection.java @@ -39,6 +39,15 @@ public class ServerConnection { diff --git a/Spigot-Server-Patches/0118-Optional-TNT-doesn-t-move-in-water.patch b/Spigot-Server-Patches/0105-Optional-TNT-doesn-t-move-in-water.patch similarity index 86% rename from Spigot-Server-Patches/0118-Optional-TNT-doesn-t-move-in-water.patch rename to Spigot-Server-Patches/0105-Optional-TNT-doesn-t-move-in-water.patch index f8570ebab4..5ac0d87bed 100644 --- a/Spigot-Server-Patches/0118-Optional-TNT-doesn-t-move-in-water.patch +++ b/Spigot-Server-Patches/0105-Optional-TNT-doesn-t-move-in-water.patch @@ -1,11 +1,11 @@ -From 63ff9250af978a4b43ee5463b0efd46a67e530eb Mon Sep 17 00:00:00 2001 +From d9d785e3118eb7f30611eca9330f0c5aab6ae80e Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sun, 22 May 2016 20:20:55 -0500 Subject: [PATCH] Optional TNT doesn't move in water diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 720b87a5ec..bcc2ecaa3a 100644 +index 805aa5699..92ab55182 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -2,7 +2,6 @@ package com.destroystokyo.paper; @@ -16,7 +16,7 @@ index 720b87a5ec..bcc2ecaa3a 100644 import org.bukkit.configuration.file.YamlConfiguration; import org.spigotmc.SpigotWorldConfig; -@@ -301,4 +300,14 @@ public class PaperWorldConfig { +@@ -287,4 +286,14 @@ public class PaperWorldConfig { ); } } @@ -32,26 +32,27 @@ index 720b87a5ec..bcc2ecaa3a 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 462f94ed18..113264981e 100644 +index 3dcd93e5e..b68e2fc04 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1190,6 +1190,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1094,6 +1094,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } - public boolean aq() { + public boolean au() { + // Paper start + return this.doWaterMovement(); + } + + public boolean doWaterMovement() { + // Paper end - return this.isInWater() || this.q(); + return this.isInWater() || this.l(); } -@@ -2741,6 +2747,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2620,6 +2626,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } - public boolean bw() { + public boolean bD() { ++ // Paper start + return this.pushedByWater(); + } + @@ -61,12 +62,12 @@ index 462f94ed18..113264981e 100644 } diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java -index 7f4b68dcc0..7a8670323c 100644 +index e0535604b..91e332c3a 100644 --- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java +++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java -@@ -146,4 +146,49 @@ public class EntityTNTPrimed extends Entity { - public int getFuseTicks() { - return this.c; +@@ -149,4 +149,49 @@ public class EntityTNTPrimed extends Entity { + public Packet N() { + return new PacketPlayOutSpawnEntity(this); } + + // Paper start - Optional prevent TNT from moving in water diff --git a/Spigot-Server-Patches/0119-Faster-redstone-torch-rapid-clock-removal.patch b/Spigot-Server-Patches/0106-Faster-redstone-torch-rapid-clock-removal.patch similarity index 88% rename from Spigot-Server-Patches/0119-Faster-redstone-torch-rapid-clock-removal.patch rename to Spigot-Server-Patches/0106-Faster-redstone-torch-rapid-clock-removal.patch index c40143a1cd..b69417ce07 100644 --- a/Spigot-Server-Patches/0119-Faster-redstone-torch-rapid-clock-removal.patch +++ b/Spigot-Server-Patches/0106-Faster-redstone-torch-rapid-clock-removal.patch @@ -1,4 +1,4 @@ -From 724e26451f8b6dedc7b7013fcbc0aded8efd85a7 Mon Sep 17 00:00:00 2001 +From 1d7fc3c3ce80240e99ea57a6c854b515b3880f3a Mon Sep 17 00:00:00 2001 From: Martin Panzer Date: Mon, 23 May 2016 12:12:37 +0200 Subject: [PATCH] Faster redstone torch rapid clock removal @@ -6,10 +6,10 @@ Subject: [PATCH] Faster redstone torch rapid clock removal Only resize the the redstone torch list once, since resizing arrays / lists is costly diff --git a/src/main/java/net/minecraft/server/BlockRedstoneTorch.java b/src/main/java/net/minecraft/server/BlockRedstoneTorch.java -index d8a0b73c31..74b63fe1d1 100644 +index a99f979ef..a79484e3e 100644 --- a/src/main/java/net/minecraft/server/BlockRedstoneTorch.java +++ b/src/main/java/net/minecraft/server/BlockRedstoneTorch.java -@@ -63,9 +63,17 @@ public class BlockRedstoneTorch extends BlockTorch { +@@ -68,9 +68,17 @@ public class BlockRedstoneTorch extends BlockTorch { public static void a(IBlockData iblockdata, World world, BlockPosition blockposition, Random random, boolean flag) { List list = (List) BlockRedstoneTorch.b.get(world); @@ -29,7 +29,7 @@ index d8a0b73c31..74b63fe1d1 100644 // CraftBukkit start org.bukkit.plugin.PluginManager manager = world.getServer().getPluginManager(); -@@ -169,7 +177,7 @@ public class BlockRedstoneTorch extends BlockTorch { +@@ -167,7 +175,7 @@ public class BlockRedstoneTorch extends BlockTorch { public static class RedstoneUpdateInfo { private final BlockPosition a; diff --git a/Spigot-Server-Patches/0121-Add-server-name-parameter.patch b/Spigot-Server-Patches/0107-Add-server-name-parameter.patch similarity index 86% rename from Spigot-Server-Patches/0121-Add-server-name-parameter.patch rename to Spigot-Server-Patches/0107-Add-server-name-parameter.patch index 54f7def9db..7c942c8831 100644 --- a/Spigot-Server-Patches/0121-Add-server-name-parameter.patch +++ b/Spigot-Server-Patches/0107-Add-server-name-parameter.patch @@ -1,14 +1,14 @@ -From 254da8d94b3a51da9dedea35952ab380fecdd3ad Mon Sep 17 00:00:00 2001 +From 1b2bce1bc325f0feb676e7d86a35588a9a598278 Mon Sep 17 00:00:00 2001 From: Martin Panzer Date: Sat, 28 May 2016 16:54:03 +0200 Subject: [PATCH] Add server-name parameter diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index c85a9bfb91..472a8070e7 100644 +index a96c144fc..5203e781e 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java -@@ -136,6 +136,14 @@ public class Main { +@@ -135,6 +135,14 @@ public class Main { .defaultsTo(new File("paper.yml")) .describedAs("Yml file"); // Paper end diff --git a/Spigot-Server-Patches/0122-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch b/Spigot-Server-Patches/0108-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch similarity index 73% rename from Spigot-Server-Patches/0122-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch rename to Spigot-Server-Patches/0108-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch index 287303ef75..0836783ef9 100644 --- a/Spigot-Server-Patches/0122-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch +++ b/Spigot-Server-Patches/0108-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch @@ -1,4 +1,4 @@ -From 3d9e07b20844b8039fe250c34ff50cf330622471 Mon Sep 17 00:00:00 2001 +From 20610473d3c678f6e38715f7f1c094873a86c5e9 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 31 May 2016 22:53:50 -0400 Subject: [PATCH] Only send Dragon/Wither Death sounds to same world @@ -6,39 +6,37 @@ Subject: [PATCH] Only send Dragon/Wither Death sounds to same world Also fix view distance lookup diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java -index 967aae838e..b3fbc8249e 100644 +index 245b1d100..bfdb63094 100644 --- a/src/main/java/net/minecraft/server/EntityEnderDragon.java +++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java -@@ -573,8 +573,12 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo - if (this.bO == 1) { +@@ -558,8 +558,11 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { + if (this.bL == 1) { // CraftBukkit start - Use relative location for far away sounds - // this.world.a(1028, new BlockPosition(this), 0); + // this.world.b(1028, new BlockPosition(this), 0); - int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; - for (EntityPlayer player : (List) MinecraftServer.getServer().getPlayerList().players) { + // Paper start + //int viewDistance = ((WorldServer) this.world).spigotConfig.viewDistance * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API -+ for (EntityHuman human : world.players) { -+ EntityPlayer player = (EntityPlayer) human; -+ int viewDistance = player.getViewDistance(); ++ for (EntityPlayer player : ((WorldServer)world).getPlayers()) { ++ final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch + // Paper end double deltaX = this.locX - player.locX; double deltaZ = this.locZ - player.locZ; double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java -index c43a90333b..ed4ca8abb2 100644 +index f23f09430..48b22894a 100644 --- a/src/main/java/net/minecraft/server/EntityWither.java +++ b/src/main/java/net/minecraft/server/EntityWither.java -@@ -200,8 +200,12 @@ public class EntityWither extends EntityMonster implements IRangedEntity { +@@ -207,8 +207,11 @@ public class EntityWither extends EntityMonster implements IRangedEntity { // CraftBukkit start - Use relative location for far away sounds - // this.world.a(1023, new BlockPosition(this), 0); + // this.world.b(1023, new BlockPosition(this), 0); - int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; - for (EntityPlayer player : (List) MinecraftServer.getServer().getPlayerList().players) { + // Paper start + //int viewDistance = ((WorldServer) this.world).spigotConfig.viewDistance * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API -+ for (EntityHuman human : world.players) { -+ EntityPlayer player = (EntityPlayer) human; -+ int viewDistance = player.getViewDistance(); ++ for (EntityPlayer player : ((WorldServer)world).getPlayers()) { ++ final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch + // Paper end double deltaX = this.locX - player.locX; double deltaZ = this.locZ - player.locZ; diff --git a/Spigot-Server-Patches/0109-Fix-Double-World-Add-issues.patch b/Spigot-Server-Patches/0109-Fix-Double-World-Add-issues.patch new file mode 100644 index 0000000000..8009a65433 --- /dev/null +++ b/Spigot-Server-Patches/0109-Fix-Double-World-Add-issues.patch @@ -0,0 +1,24 @@ +From baaddf7e045aa037211e6721e02193fd49d933f2 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Tue, 21 Jun 2016 22:54:34 -0400 +Subject: [PATCH] Fix Double World Add issues + +Vanilla will double add Spider Jockeys to the world, so ignore already added. + +Also add debug if something else tries to, and abort before world gets bad state + +diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java +index 1e718e4db..464a132a3 100644 +--- a/src/main/java/net/minecraft/server/WorldServer.java ++++ b/src/main/java/net/minecraft/server/WorldServer.java +@@ -935,6 +935,7 @@ public class WorldServer extends World { + // CraftBukkit start + private boolean addEntity0(Entity entity, CreatureSpawnEvent.SpawnReason spawnReason) { + org.spigotmc.AsyncCatcher.catchOp( "entity add"); // Spigot ++ if (entity.valid) { MinecraftServer.LOGGER.error("Attempted Double World add on " + entity, new Throwable()); return true; } // Paper + if (entity.dead) { + // WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getName(entity.getEntityType())); // CraftBukkit + return false; +-- +2.21.0 + diff --git a/Spigot-Server-Patches/0125-Fix-Old-Sign-Conversion.patch b/Spigot-Server-Patches/0110-Fix-Old-Sign-Conversion.patch similarity index 61% rename from Spigot-Server-Patches/0125-Fix-Old-Sign-Conversion.patch rename to Spigot-Server-Patches/0110-Fix-Old-Sign-Conversion.patch index 8519cd6728..42858a7eb0 100644 --- a/Spigot-Server-Patches/0125-Fix-Old-Sign-Conversion.patch +++ b/Spigot-Server-Patches/0110-Fix-Old-Sign-Conversion.patch @@ -1,4 +1,4 @@ -From 049ceb1e1da52d7580d5f05bff70a4d9955f589b Mon Sep 17 00:00:00 2001 +From 8199add0f4a50441fb4a954f46f98486a36f8d75 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 17 Jun 2016 20:50:11 -0400 Subject: [PATCH] Fix Old Sign Conversion @@ -9,38 +9,38 @@ Subject: [PATCH] Fix Old Sign Conversion This causes Igloos and such to render broken signs. We fix this by ignoring sign conversion for Defined Structures diff --git a/src/main/java/net/minecraft/server/DefinedStructure.java b/src/main/java/net/minecraft/server/DefinedStructure.java -index 83db94c4ab..dd635292ec 100644 +index dabfb8067..f80ba567f 100644 --- a/src/main/java/net/minecraft/server/DefinedStructure.java +++ b/src/main/java/net/minecraft/server/DefinedStructure.java -@@ -215,9 +215,11 @@ public class DefinedStructure { - definedstructure_blockinfo1.c.setInt("x", blockposition1.getX()); - definedstructure_blockinfo1.c.setInt("y", blockposition1.getY()); - definedstructure_blockinfo1.c.setInt("z", blockposition1.getZ()); -+ tileentity.isLoadingStructure = true; // Paper - tileentity.load(definedstructure_blockinfo1.c); - tileentity.a(definedstructureinfo.b()); - tileentity.a(definedstructureinfo.c()); -+ tileentity.isLoadingStructure = false; // Paper - } +@@ -203,9 +203,11 @@ public class DefinedStructure { + definedstructure_blockinfo.c.setInt("x", blockposition1.getX()); + definedstructure_blockinfo.c.setInt("y", blockposition1.getY()); + definedstructure_blockinfo.c.setInt("z", blockposition1.getZ()); ++ tileentity.isLoadingStructure = true; // Paper + tileentity.load(definedstructure_blockinfo.c); + tileentity.a(definedstructureinfo.c()); + tileentity.a(definedstructureinfo.d()); ++ tileentity.isLoadingStructure = false; // Paper } + } diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index c5212417c6..b3c5766a27 100644 +index 85a1c5666..d8cc35352 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java -@@ -11,6 +11,7 @@ import org.bukkit.inventory.InventoryHolder; // CraftBukkit - public abstract class TileEntity implements KeyedObject { // Paper +@@ -12,6 +12,7 @@ public abstract class TileEntity implements KeyedObject { // Paper public Timing tickTimer = MinecraftTimings.getTileEntityTimings(this); // Paper + private static final Logger LOGGER = LogManager.getLogger(); + boolean isLoadingStructure = false; // Paper - private static final Logger a = LogManager.getLogger(); - private final TileEntityTypes e; public TileEntityTypes getTileEntityType() { return e; } // Paper - OBFHELPER + private final TileEntityTypes b; public TileEntityTypes getTileEntityType() { return b; } // Paper - OBFHELPER + @Nullable protected World world; diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java -index 31a9d45727..458d1561d0 100644 +index 86505f25c..9de03a24c 100644 --- a/src/main/java/net/minecraft/server/TileEntitySign.java +++ b/src/main/java/net/minecraft/server/TileEntitySign.java -@@ -50,13 +50,14 @@ public class TileEntitySign extends TileEntity implements ICommandListener { +@@ -58,13 +58,14 @@ public class TileEntitySign extends TileEntity implements ICommandListener { // } try { diff --git a/Spigot-Server-Patches/0126-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch b/Spigot-Server-Patches/0111-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch similarity index 90% rename from Spigot-Server-Patches/0126-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch rename to Spigot-Server-Patches/0111-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch index 1ad1670d21..9e8bf2004a 100644 --- a/Spigot-Server-Patches/0126-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch +++ b/Spigot-Server-Patches/0111-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch @@ -1,11 +1,11 @@ -From 3453dbe4b3b797d14ea8dfdb6e2c010e47335fcb Mon Sep 17 00:00:00 2001 +From 503c53decf8c3e502927a285808f3449b5535be0 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 65d230d45f..9bf2521be6 100644 +index cd8a652eb..409bc6da9 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 { diff --git a/Spigot-Server-Patches/0127-More-informative-vehicle-moved-wrongly-message.patch b/Spigot-Server-Patches/0112-More-informative-vehicle-moved-wrongly-message.patch similarity index 82% rename from Spigot-Server-Patches/0127-More-informative-vehicle-moved-wrongly-message.patch rename to Spigot-Server-Patches/0112-More-informative-vehicle-moved-wrongly-message.patch index c74387b1c4..4d7a567490 100644 --- a/Spigot-Server-Patches/0127-More-informative-vehicle-moved-wrongly-message.patch +++ b/Spigot-Server-Patches/0112-More-informative-vehicle-moved-wrongly-message.patch @@ -1,14 +1,14 @@ -From d62a0a28a9163ccd576919761253e42ae6b97097 Mon Sep 17 00:00:00 2001 +From 5519add5355658a7cf972992a598a442e340a47f 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 66aa3bde64..73907b4f0e 100644 +index 42eac6b71..57ef91a43 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -355,7 +355,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -363,7 +363,7 @@ public class PlayerConnection implements PacketListenerPlayIn { if (d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot flag1 = true; diff --git a/Spigot-Server-Patches/0128-Re-track-players-that-dismount-from-other-players.patch b/Spigot-Server-Patches/0113-Re-track-players-that-dismount-from-other-players.patch similarity index 85% rename from Spigot-Server-Patches/0128-Re-track-players-that-dismount-from-other-players.patch rename to Spigot-Server-Patches/0113-Re-track-players-that-dismount-from-other-players.patch index db941ba847..ec26efb360 100644 --- a/Spigot-Server-Patches/0128-Re-track-players-that-dismount-from-other-players.patch +++ b/Spigot-Server-Patches/0113-Re-track-players-that-dismount-from-other-players.patch @@ -1,14 +1,14 @@ -From a0c08cd775b6d772d818a8571d388d6746320fa3 Mon Sep 17 00:00:00 2001 +From 5b9cdf4cc017b2fd5336a16d5463a014d8a1d02a 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 7ed9903a8c..621e79bc53 100644 +index 6b6c14567..c1ba294ec 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -760,6 +760,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -959,6 +959,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); } diff --git a/Spigot-Server-Patches/0129-Add-setting-for-proxy-online-mode-status.patch b/Spigot-Server-Patches/0114-Add-setting-for-proxy-online-mode-status.patch similarity index 84% rename from Spigot-Server-Patches/0129-Add-setting-for-proxy-online-mode-status.patch rename to Spigot-Server-Patches/0114-Add-setting-for-proxy-online-mode-status.patch index 8d3cc99164..a89457c0fe 100644 --- a/Spigot-Server-Patches/0129-Add-setting-for-proxy-online-mode-status.patch +++ b/Spigot-Server-Patches/0114-Add-setting-for-proxy-online-mode-status.patch @@ -1,11 +1,11 @@ -From 2dc12219463415aebdee8014771aeced2951e9ef Mon Sep 17 00:00:00 2001 +From 67285c293c5b07083146b9c3b1c06efe8c7ca294 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 c6d2c30339..b7b28591e4 100644 +index a89a9bfcb..1089be17d 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -22,6 +22,7 @@ import org.bukkit.configuration.InvalidConfigurationException; @@ -16,7 +16,7 @@ index c6d2c30339..b7b28591e4 100644 public class PaperConfig { -@@ -243,4 +244,13 @@ public class PaperConfig { +@@ -230,4 +231,13 @@ public class PaperConfig { private static void saveEmptyScoreboardTeams() { saveEmptyScoreboardTeams = getBoolean("settings.save-empty-scoreboard-teams", false); } @@ -31,7 +31,7 @@ index c6d2c30339..b7b28591e4 100644 + } } diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java -index bf67dbf54a..dcaba3c401 100644 +index 61ea2818b..26c786106 100644 --- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java +++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java @@ -58,7 +58,8 @@ public class NameReferencingFileConverter { @@ -45,16 +45,16 @@ index bf67dbf54a..dcaba3c401 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 b0ae0365e0..c26da09849 100644 +index cf9594ea2..46f902073 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1413,7 +1413,8 @@ public final class CraftServer implements Server { +@@ -1349,7 +1349,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() -+ || com.destroystokyo.paper.PaperConfig.isProxyOnlineMode()) // Paper - Handle via setting +- if ( getOnlineMode() || org.spigotmc.SpigotConfig.bungee ) ++ if ( getOnlineMode() ++ || com.destroystokyo.paper.PaperConfig.isProxyOnlineMode() ) // Paper - Handle via setting { profile = console.getUserCache().getProfile( name ); } diff --git a/Spigot-Server-Patches/0130-Optimise-BlockState-s-hashCode-equals.patch b/Spigot-Server-Patches/0115-Optimise-BlockState-s-hashCode-equals.patch similarity index 79% rename from Spigot-Server-Patches/0130-Optimise-BlockState-s-hashCode-equals.patch rename to Spigot-Server-Patches/0115-Optimise-BlockState-s-hashCode-equals.patch index 7fd0ab38ab..56a5e3f948 100644 --- a/Spigot-Server-Patches/0130-Optimise-BlockState-s-hashCode-equals.patch +++ b/Spigot-Server-Patches/0115-Optimise-BlockState-s-hashCode-equals.patch @@ -1,4 +1,4 @@ -From c9f0709ef168a8c27dc55d0238e9519489c42dba Mon Sep 17 00:00:00 2001 +From 111e6d81ee7f75c570d33392fb174aaeabdd5f54 Mon Sep 17 00:00:00 2001 From: Alfie Cleveland Date: Fri, 19 Aug 2016 01:52:56 +0100 Subject: [PATCH] Optimise BlockState's hashCode/equals @@ -9,10 +9,10 @@ object identity checks safely. Use a simpler optimized hashcode diff --git a/src/main/java/net/minecraft/server/BlockState.java b/src/main/java/net/minecraft/server/BlockState.java -index d95c0955a9..ea0e0ff4fe 100644 +index 77b25317a..be7e10d85 100644 --- a/src/main/java/net/minecraft/server/BlockState.java +++ b/src/main/java/net/minecraft/server/BlockState.java -@@ -26,23 +26,13 @@ public abstract class BlockState> implements IBlockState +@@ -28,23 +28,13 @@ public abstract class BlockState> implements IBlockState } public boolean equals(Object object) { @@ -28,7 +28,7 @@ index d95c0955a9..ea0e0ff4fe 100644 + return this == object; // Paper - only one instance per configuration } -+ private static java.util.concurrent.atomic.AtomicInteger hashId = new java.util.concurrent.atomic.AtomicInteger(1);// Paper - only one instance per configuration ++ private static final java.util.concurrent.atomic.AtomicInteger hashId = new java.util.concurrent.atomic.AtomicInteger(1); // Paper - only one instance per configuration + private final int hashCode = 92821 * hashId.getAndIncrement(); // Paper - only one instance per configuration public final int hashCode() { - if (this.c == null) { @@ -36,44 +36,47 @@ index d95c0955a9..ea0e0ff4fe 100644 - } - - return this.c; -+ return hashCode; // Paper - only one instance per configuration ++ return this.hashCode; // Paper - only one instance per configuration } public int c() { diff --git a/src/main/java/net/minecraft/server/BlockStateBoolean.java b/src/main/java/net/minecraft/server/BlockStateBoolean.java -index 4c1d39d67c..71d2ad9703 100644 +index 31cb8ac84..3f085c7d6 100644 --- a/src/main/java/net/minecraft/server/BlockStateBoolean.java +++ b/src/main/java/net/minecraft/server/BlockStateBoolean.java -@@ -28,7 +28,7 @@ public class BlockStateBoolean extends BlockState { +@@ -30,8 +30,7 @@ public class BlockStateBoolean extends BlockState { return obool.toString(); } +- @Override - public boolean equals(Object object) { + public boolean equals_unused(Object object) { // Paper if (this == object) { return true; } else if (object instanceof BlockStateBoolean && super.equals(object)) { diff --git a/src/main/java/net/minecraft/server/BlockStateEnum.java b/src/main/java/net/minecraft/server/BlockStateEnum.java -index 986b9ccea8..facbf30b4e 100644 +index 59d86fc66..82a1fac6f 100644 --- a/src/main/java/net/minecraft/server/BlockStateEnum.java +++ b/src/main/java/net/minecraft/server/BlockStateEnum.java -@@ -47,7 +47,7 @@ public class BlockStateEnum & INamable> extends BlockState +@@ -49,8 +49,7 @@ public class BlockStateEnum & INamable> extends BlockState return ((INamable) t0).getName(); } +- @Override - public boolean equals(Object object) { + public boolean equals_unused(Object object) { // Paper if (this == object) { return true; } else if (object instanceof BlockStateEnum && super.equals(object)) { diff --git a/src/main/java/net/minecraft/server/BlockStateInteger.java b/src/main/java/net/minecraft/server/BlockStateInteger.java -index 2f12e15e07..613cd0bce2 100644 +index 6861c2b05..74ef69952 100644 --- a/src/main/java/net/minecraft/server/BlockStateInteger.java +++ b/src/main/java/net/minecraft/server/BlockStateInteger.java -@@ -37,7 +37,7 @@ public class BlockStateInteger extends BlockState { +@@ -38,8 +38,7 @@ public class BlockStateInteger extends BlockState { return this.a; } +- @Override - public boolean equals(Object object) { + public boolean equals_unused(Object object) { // Paper if (this == object) { diff --git a/Spigot-Server-Patches/0132-Configurable-packet-in-spam-threshold.patch b/Spigot-Server-Patches/0116-Configurable-packet-in-spam-threshold.patch similarity index 88% rename from Spigot-Server-Patches/0132-Configurable-packet-in-spam-threshold.patch rename to Spigot-Server-Patches/0116-Configurable-packet-in-spam-threshold.patch index 8ee9ed2b0c..9466037233 100644 --- a/Spigot-Server-Patches/0132-Configurable-packet-in-spam-threshold.patch +++ b/Spigot-Server-Patches/0116-Configurable-packet-in-spam-threshold.patch @@ -1,14 +1,14 @@ -From b347ba0ec3484271a1a45b3c628032e2ebfb5410 Mon Sep 17 00:00:00 2001 +From 5570566531af5978d5fe573b05b3e6fe43119a77 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 b7b28591e4..6562cf54b7 100644 +index 1089be17d..a2e204014 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java -@@ -253,4 +253,13 @@ public class PaperConfig { +@@ -240,4 +240,13 @@ public class PaperConfig { public static boolean isProxyOnlineMode() { return Bukkit.getOnlineMode() || (SpigotConfig.bungee && bungeeOnlineMode); } @@ -23,10 +23,10 @@ index b7b28591e4..6562cf54b7 100644 + } } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 73907b4f0e..b29a1f340f 100644 +index 57ef91a43..cb6199603 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1177,13 +1177,14 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -1217,13 +1217,14 @@ public class PlayerConnection implements PacketListenerPlayIn { // Spigot start - limit place/interactions private int limitedPackets; private long lastLimitedPacket = -1; diff --git a/Spigot-Server-Patches/0133-Configurable-flying-kick-messages.patch b/Spigot-Server-Patches/0117-Configurable-flying-kick-messages.patch similarity index 82% rename from Spigot-Server-Patches/0133-Configurable-flying-kick-messages.patch rename to Spigot-Server-Patches/0117-Configurable-flying-kick-messages.patch index fbf57e8748..137d8f489e 100644 --- a/Spigot-Server-Patches/0133-Configurable-flying-kick-messages.patch +++ b/Spigot-Server-Patches/0117-Configurable-flying-kick-messages.patch @@ -1,14 +1,14 @@ -From 5e25d2de180bcf44040d6b17e0b15109bf3fb194 Mon Sep 17 00:00:00 2001 +From 4f280e6c0438b87dafa7a464285978a00c2f362b 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 6562cf54b7..fb7ada8139 100644 +index a2e204014..7ce370e92 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java -@@ -262,4 +262,11 @@ public class PaperConfig { +@@ -249,4 +249,11 @@ public class PaperConfig { } packetInSpamThreshold = getInt("settings.incoming-packet-spam-threshold", 300); } @@ -21,10 +21,10 @@ index 6562cf54b7..fb7ada8139 100644 + } } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index b29a1f340f..4a06527b6f 100644 +index cb6199603..982b15dec 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -144,7 +144,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -146,7 +146,7 @@ public class PlayerConnection implements PacketListenerPlayIn { if (this.B) { if (++this.C > 80) { PlayerConnection.LOGGER.warn("{} was kicked for floating too long!", this.player.getDisplayName().getString()); @@ -33,8 +33,8 @@ index b29a1f340f..4a06527b6f 100644 return; } } else { -@@ -163,7 +163,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { - if (this.D && this.player.getRootVehicle().bO() == this.player) { +@@ -165,7 +165,7 @@ public class PlayerConnection implements PacketListenerPlayIn { + if (this.D && this.player.getRootVehicle().getRidingPassenger() == this.player) { if (++this.E > 80) { PlayerConnection.LOGGER.warn("{} was kicked for floating a vehicle too long!", this.player.getDisplayName().getString()); - this.disconnect(new ChatMessage("multiplayer.disconnect.flying", new Object[0])); diff --git a/Spigot-Server-Patches/0118-Chunk-registration-fixes.patch b/Spigot-Server-Patches/0118-Chunk-registration-fixes.patch new file mode 100644 index 0000000000..fdedc7865e --- /dev/null +++ b/Spigot-Server-Patches/0118-Chunk-registration-fixes.patch @@ -0,0 +1,25 @@ +From f355773996d96cee145d4cd5e257b0273fb37927 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/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java +index 464a132a3..bbf676958 100644 +--- a/src/main/java/net/minecraft/server/WorldServer.java ++++ b/src/main/java/net/minecraft/server/WorldServer.java +@@ -631,7 +631,7 @@ public class WorldServer extends World { + public void chunkCheck(Entity entity) { + this.getMethodProfiler().enter("chunkCheck"); + int i = MathHelper.floor(entity.locX / 16.0D); +- int j = MathHelper.floor(entity.locY / 16.0D); ++ int j = Math.min(15, Math.max(0, MathHelper.floor(entity.locY / 16.0D))); // Paper - stay consistent with chunk add/remove behavior + int k = MathHelper.floor(entity.locZ / 16.0D); + + if (!entity.inChunk || entity.chunkX != i || entity.chunkY != j || entity.chunkZ != k) { +-- +2.21.0 + diff --git a/Spigot-Server-Patches/0136-Remove-FishingHook-reference-on-Craft-Entity-removal.patch b/Spigot-Server-Patches/0119-Remove-FishingHook-reference-on-Craft-Entity-removal.patch similarity index 83% rename from Spigot-Server-Patches/0136-Remove-FishingHook-reference-on-Craft-Entity-removal.patch rename to Spigot-Server-Patches/0119-Remove-FishingHook-reference-on-Craft-Entity-removal.patch index e7d623b189..40d48fc08b 100644 --- a/Spigot-Server-Patches/0136-Remove-FishingHook-reference-on-Craft-Entity-removal.patch +++ b/Spigot-Server-Patches/0119-Remove-FishingHook-reference-on-Craft-Entity-removal.patch @@ -1,14 +1,14 @@ -From 7e64d04da6a50ad54160001dd38f093058c925ff Mon Sep 17 00:00:00 2001 +From 3a18bc30e3b1330325004d59524861dfe4769ba8 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/CraftFishHook.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java -index 8392b16b3b..752b56435d 100644 +index 75aae03b6..fea7ca9db 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java -@@ -62,4 +62,15 @@ public class CraftFishHook extends AbstractProjectile implements FishHook { +@@ -61,4 +61,15 @@ public class CraftFishHook extends AbstractProjectile implements FishHook { Validate.isTrue(chance >= 0 && chance <= 1, "The bite chance must be between 0 and 1."); this.biteChance = chance; } diff --git a/Spigot-Server-Patches/0137-Auto-fix-bad-Y-levels-on-player-login.patch b/Spigot-Server-Patches/0120-Auto-fix-bad-Y-levels-on-player-login.patch similarity index 68% rename from Spigot-Server-Patches/0137-Auto-fix-bad-Y-levels-on-player-login.patch rename to Spigot-Server-Patches/0120-Auto-fix-bad-Y-levels-on-player-login.patch index 6c1b886039..aaf5e615de 100644 --- a/Spigot-Server-Patches/0137-Auto-fix-bad-Y-levels-on-player-login.patch +++ b/Spigot-Server-Patches/0120-Auto-fix-bad-Y-levels-on-player-login.patch @@ -1,4 +1,4 @@ -From 656019b7f95b56cca236de20cb9940e6f438769a Mon Sep 17 00:00:00 2001 +From f86a4c50936dac9d4370480b8ffacf603b5c1543 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 @@ -6,17 +6,17 @@ 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 260fa3e678..fcb5f590df 100644 +index c1ba294ec..5610c539a 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -187,6 +187,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { - +@@ -190,6 +190,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + @Override public void a(NBTTagCompound nbttagcompound) { super.a(nbttagcompound); + if (this.locY > 300) this.locY = 257; // Paper - bring down to a saner Y level if out of world if (nbttagcompound.hasKeyOfType("playerGameType", 99)) { - if (this.bK().getForceGamemode()) { - this.playerInteractManager.setGameMode(this.bK().getGamemode()); + if (this.getMinecraftServer().getForceGamemode()) { + this.playerInteractManager.setGameMode(this.getMinecraftServer().getGamemode()); -- 2.21.0 diff --git a/Spigot-Server-Patches/0139-Option-to-remove-corrupt-tile-entities.patch b/Spigot-Server-Patches/0121-Option-to-remove-corrupt-tile-entities.patch similarity index 56% rename from Spigot-Server-Patches/0139-Option-to-remove-corrupt-tile-entities.patch rename to Spigot-Server-Patches/0121-Option-to-remove-corrupt-tile-entities.patch index 3fa8477aa1..0e6186185a 100644 --- a/Spigot-Server-Patches/0139-Option-to-remove-corrupt-tile-entities.patch +++ b/Spigot-Server-Patches/0121-Option-to-remove-corrupt-tile-entities.patch @@ -1,16 +1,16 @@ -From 6a37f4af427998aa81105d6a80cca73b74427ee7 Mon Sep 17 00:00:00 2001 +From 1320b81faa9a9bbf0aaebbab509c6b6fb579afc7 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Wed, 5 Oct 2016 16:27:36 -0500 Subject: [PATCH] Option to remove corrupt tile entities diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 6e28410c37..7e847af00b 100644 +index 92ab55182..eed454bf4 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -340,4 +340,9 @@ public class PaperWorldConfig { - private void maxAutoSaveChunksPerTick() { - maxAutoSaveChunksPerTick = getInt("max-auto-save-chunks-per-tick", 24); +@@ -296,4 +296,9 @@ public class PaperWorldConfig { + preventTntFromMovingInWater = getBoolean("prevent-tnt-from-moving-in-water", false); + log("Prevent TNT from moving in water: " + preventTntFromMovingInWater); } + + public boolean removeCorruptTEs = false; @@ -19,11 +19,11 @@ index 6e28410c37..7e847af00b 100644 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 0bf614ce57..a6cacd7da9 100644 +index a413dc73b..54bb7f551 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -844,6 +844,12 @@ public class Chunk implements IChunkAccess { - "Chunk coordinates: " + (this.locX * 16) + "," + (this.locZ * 16)); +@@ -550,6 +550,12 @@ public class Chunk implements IChunkAccess { + "Chunk coordinates: " + (this.loc.x * 16) + "," + (this.loc.z * 16)); e.printStackTrace(); ServerInternalException.reportInternalException(e); + @@ -35,14 +35,6 @@ index 0bf614ce57..a6cacd7da9 100644 // Paper end // CraftBukkit end } -@@ -853,6 +859,7 @@ public class Chunk implements IChunkAccess { - this.h.put(new BlockPosition(nbttagcompound.getInt("x"), nbttagcompound.getInt("y"), nbttagcompound.getInt("z")), nbttagcompound); - } - -+ public void removeTileEntity(BlockPosition blockposition) { this.d(blockposition); } // Paper - OBFHELPER - public void d(BlockPosition blockposition) { - if (this.i) { - TileEntity tileentity = (TileEntity) this.tileEntities.remove(blockposition); -- 2.21.0 diff --git a/Spigot-Server-Patches/0140-Add-EntityZapEvent.patch b/Spigot-Server-Patches/0122-Add-EntityZapEvent.patch similarity index 53% rename from Spigot-Server-Patches/0140-Add-EntityZapEvent.patch rename to Spigot-Server-Patches/0122-Add-EntityZapEvent.patch index f203862c5b..6e0708761b 100644 --- a/Spigot-Server-Patches/0140-Add-EntityZapEvent.patch +++ b/Spigot-Server-Patches/0122-Add-EntityZapEvent.patch @@ -1,48 +1,48 @@ -From b179aa6184990023731937ba9669775897cae5a5 Mon Sep 17 00:00:00 2001 +From beab69d9648328eeebe81983434ee0f661a7b31a Mon Sep 17 00:00:00 2001 From: AlphaBlend Date: Sun, 16 Oct 2016 23:19:30 -0700 Subject: [PATCH] Add EntityZapEvent diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java -index 7ef67350a5..9dc2d8be27 100644 +index 01202e4d5..616075569 100644 --- a/src/main/java/net/minecraft/server/EntityPig.java +++ b/src/main/java/net/minecraft/server/EntityPig.java -@@ -163,6 +163,12 @@ public class EntityPig extends EntityAnimal { - entitypigzombie.setCustomNameVisible(this.getCustomNameVisible()); - } +@@ -168,6 +168,12 @@ public class EntityPig extends EntityAnimal { + entitypigzombie.setCustomNameVisible(this.getCustomNameVisible()); + } -+ // Paper start -+ if (CraftEventFactory.callEntityZapEvent(this, entitylightning, entitypigzombie).isCancelled()) { -+ return; -+ } -+ // Paper end ++ // Paper start ++ if (CraftEventFactory.callEntityZapEvent(this, entitylightning, entitypigzombie).isCancelled()) { ++ return; ++ } ++ // Paper end + - // CraftBukkit start - if (CraftEventFactory.callPigZapEvent(this, entitylightning, entitypigzombie).isCancelled()) { - return; + // CraftBukkit start + if (CraftEventFactory.callPigZapEvent(this, entitylightning, entitypigzombie).isCancelled()) { + return; diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index f8e05b75de..213d0b18c9 100644 +index cc66f565c..c34868324 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java -@@ -606,6 +606,12 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant { - if (!this.world.isClientSide && !this.dead) { - EntityWitch entitywitch = new EntityWitch(this.world); +@@ -573,6 +573,12 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + public void onLightningStrike(EntityLightning entitylightning) { + EntityWitch entitywitch = (EntityWitch) EntityTypes.WITCH.a(this.world); -+ // Paper start -+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityZapEvent(this, entitylightning, entitywitch).isCancelled()) { -+ return; -+ } -+ // Paper end ++ // Paper start ++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityZapEvent(this, entitylightning, entitywitch).isCancelled()) { ++ return; ++ } ++ // Paper end + - entitywitch.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, this.pitch); - entitywitch.prepare(this.world.getDamageScaler(new BlockPosition(entitywitch)), (GroupDataEntity) null, (NBTTagCompound) null); - entitywitch.setNoAI(this.isNoAI()); + entitywitch.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, this.pitch); + entitywitch.prepare(this.world, this.world.getDamageScaler(new BlockPosition(entitywitch)), EnumMobSpawn.CONVERSION, (GroupDataEntity) null, (NBTTagCompound) null); + entitywitch.setNoAI(this.isNoAI()); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 4d2fdfe286..fa0eb2ebeb 100644 +index 9f592d2fc..0d16d1430 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -875,6 +875,14 @@ public class CraftEventFactory { +@@ -980,6 +980,14 @@ public class CraftEventFactory { return event; } diff --git a/Spigot-Server-Patches/0141-Don-t-load-Chunks-from-Hoppers-and-other-things.patch b/Spigot-Server-Patches/0123-Don-t-load-Chunks-from-Hoppers-and-other-things.patch similarity index 67% rename from Spigot-Server-Patches/0141-Don-t-load-Chunks-from-Hoppers-and-other-things.patch rename to Spigot-Server-Patches/0123-Don-t-load-Chunks-from-Hoppers-and-other-things.patch index bec415521b..e222e8998e 100644 --- a/Spigot-Server-Patches/0141-Don-t-load-Chunks-from-Hoppers-and-other-things.patch +++ b/Spigot-Server-Patches/0123-Don-t-load-Chunks-from-Hoppers-and-other-things.patch @@ -1,4 +1,4 @@ -From 12c6e1557233d240f7f5ef44e6b5dcd93c19c097 Mon Sep 17 00:00:00 2001 +From 8b7b6d6567969fde109ee4cc9ff7f4cd95823fa3 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 3 Nov 2016 20:28:12 -0400 Subject: [PATCH] Don't load Chunks from Hoppers and other things @@ -13,22 +13,22 @@ This of course is undesirable, so just return the loaded side as "primary" and treat it as a single chest if the other sides are unloaded diff --git a/src/main/java/net/minecraft/server/BlockChest.java b/src/main/java/net/minecraft/server/BlockChest.java -index e94786138e..c61721bc3d 100644 +index ee9d91a8c..e71178ac1 100644 --- a/src/main/java/net/minecraft/server/BlockChest.java +++ b/src/main/java/net/minecraft/server/BlockChest.java -@@ -193,7 +193,12 @@ public class BlockChest extends BlockTileEntity implements IFluidSource, IFluidC - return (ITileInventory) object; +@@ -227,7 +227,12 @@ public class BlockChest extends BlockTileEntity implements IBlockWaterlogged { + return blockchest_chestfinder.b(tileentitychest); } else { - BlockPosition blockposition1 = blockposition.shift(k(iblockdata)); -- IBlockData iblockdata1 = world.getType(blockposition1); + BlockPosition blockposition1 = blockposition.shift(j(iblockdata)); +- IBlockData iblockdata1 = generatoraccess.getType(blockposition1); + // Paper start - don't load chunks if the other side of the chest is in unloaded chunk -+ final IBlockData iblockdata1 = world.getTypeIfLoaded(blockposition1); // Paper -+ if (iblockdata1 == null) { ++ IBlockData iblockdata1 = generatoraccess.getTypeIfLoaded(blockposition1); ++ if (iblockdata1 == null) { + return null; + } + // Paper end - if (iblockdata1.getBlock() == this) { + if (iblockdata1.getBlock() == iblockdata.getBlock()) { BlockPropertyChestType blockpropertychesttype1 = (BlockPropertyChestType) iblockdata1.get(BlockChest.b); -- 2.21.0 diff --git a/Spigot-Server-Patches/0144-Filter-bad-data-from-ArmorStand-and-SpawnEgg-items.patch b/Spigot-Server-Patches/0124-Filter-bad-data-from-ArmorStand-and-SpawnEgg-items.patch similarity index 86% rename from Spigot-Server-Patches/0144-Filter-bad-data-from-ArmorStand-and-SpawnEgg-items.patch rename to Spigot-Server-Patches/0124-Filter-bad-data-from-ArmorStand-and-SpawnEgg-items.patch index 5f4cc445ef..0aad39646c 100644 --- a/Spigot-Server-Patches/0144-Filter-bad-data-from-ArmorStand-and-SpawnEgg-items.patch +++ b/Spigot-Server-Patches/0124-Filter-bad-data-from-ArmorStand-and-SpawnEgg-items.patch @@ -1,22 +1,22 @@ -From 2c4fa5b98bf65f05b2aa3bfbd8fc3582f4d1b441 Mon Sep 17 00:00:00 2001 +From 6a535c23280839bd1920db5c8cdb6c2c1200c017 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sat, 12 Nov 2016 23:25:22 -0600 Subject: [PATCH] Filter bad data from ArmorStand and SpawnEgg items diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 9829b3b64b..104a3acf31 100644 +index eed454bf4..4892113a1 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -3,6 +3,7 @@ package com.destroystokyo.paper; +@@ -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; -@@ -350,4 +351,12 @@ public class PaperWorldConfig { +@@ -301,4 +302,12 @@ public class PaperWorldConfig { private void removeCorruptTEs() { removeCorruptTEs = getBoolean("remove-corrupt-tile-entities", false); } @@ -30,11 +30,11 @@ index 9829b3b64b..104a3acf31 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java -index 489dd861d2..3eaee8d890 100644 +index 90becdfde..f54887e5e 100644 --- a/src/main/java/net/minecraft/server/EntityFallingBlock.java +++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java -@@ -228,6 +228,15 @@ public class EntityFallingBlock extends Entity { - +@@ -224,6 +224,15 @@ public class EntityFallingBlock extends Entity { + @Override protected void a(NBTTagCompound nbttagcompound) { this.block = GameProfileSerializer.d(nbttagcompound.getCompound("BlockState")); + diff --git a/Spigot-Server-Patches/0124-Fix-Double-World-Add-issues.patch b/Spigot-Server-Patches/0124-Fix-Double-World-Add-issues.patch deleted file mode 100644 index 516c48aaa4..0000000000 --- a/Spigot-Server-Patches/0124-Fix-Double-World-Add-issues.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 61e6eb2cca1a5dc3e4a514af80353eaa98cd7bd9 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Tue, 21 Jun 2016 22:54:34 -0400 -Subject: [PATCH] Fix Double World Add issues - -Vanilla will double add Spider Jockeys to the world, so ignore already added. - -Also add debug if something else tries to, and abort before world gets bad state - -diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 21ee154a57..a144118f66 100644 ---- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java -+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -@@ -1041,7 +1041,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { - } - - public static void a(Entity entity, GeneratorAccess generatoraccess, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) { -- if (generatoraccess.addEntity(entity, reason) && entity.isVehicle()) { -+ if (!entity.valid && generatoraccess.addEntity(entity, reason) && entity.isVehicle()) { // Paper - // CraftBukkit end - Iterator iterator = entity.bP().iterator(); - -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index dcff6c8d8a..336e6aeef6 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -992,6 +992,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc - - public boolean addEntity(Entity entity, SpawnReason spawnReason) { // Changed signature, added SpawnReason - org.spigotmc.AsyncCatcher.catchOp( "entity add"); // Spigot -+ if (entity.valid) { MinecraftServer.LOGGER.error("Attempted Double World add on " + entity, new Throwable()); return true; } // Paper - if (!CraftEventFactory.doEntityAddEventCalling(this, entity, spawnReason)) { - return false; - } --- -2.21.0 - diff --git a/Spigot-Server-Patches/0145-Cache-user-authenticator-threads.patch b/Spigot-Server-Patches/0125-Cache-user-authenticator-threads.patch similarity index 78% rename from Spigot-Server-Patches/0145-Cache-user-authenticator-threads.patch rename to Spigot-Server-Patches/0125-Cache-user-authenticator-threads.patch index 10c8d9a5e2..394cdf5d1f 100644 --- a/Spigot-Server-Patches/0145-Cache-user-authenticator-threads.patch +++ b/Spigot-Server-Patches/0125-Cache-user-authenticator-threads.patch @@ -1,14 +1,14 @@ -From 4432738f08d935dd5677b7ea6fe78be700ee1c95 Mon Sep 17 00:00:00 2001 +From ff8aab9bd4f2d75aff418f3c73d4fa45fa2805d3 Mon Sep 17 00:00:00 2001 From: vemacs Date: Wed, 23 Nov 2016 08:31:45 -0500 Subject: [PATCH] Cache user authenticator threads diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index 0f6ac493f6..e901c066ac 100644 +index b85b048ac..22d5c7d20 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java -@@ -92,6 +92,12 @@ public class LoginListener implements PacketLoginInListener, ITickable { +@@ -92,6 +92,12 @@ public class LoginListener implements PacketLoginInListener { } @@ -21,8 +21,8 @@ index 0f6ac493f6..e901c066ac 100644 // Spigot start public void initUUID() { -@@ -168,8 +174,8 @@ public class LoginListener implements PacketLoginInListener, ITickable { - this.networkManager.sendPacket(new PacketLoginOutEncryptionBegin("", this.server.E().getPublic(), this.e)); +@@ -170,8 +176,8 @@ public class LoginListener implements PacketLoginInListener { + this.networkManager.sendPacket(new PacketLoginOutEncryptionBegin("", this.server.getKeyPair().getPublic(), this.e)); } else { // Spigot start - new Thread("User Authenticator #" + LoginListener.b.incrementAndGet()) { @@ -32,7 +32,7 @@ index 0f6ac493f6..e901c066ac 100644 @Override public void run() { try { -@@ -180,7 +186,8 @@ public class LoginListener implements PacketLoginInListener, ITickable { +@@ -182,7 +188,8 @@ public class LoginListener implements PacketLoginInListener { server.server.getLogger().log(java.util.logging.Level.WARNING, "Exception verifying " + i.getName(), ex); } } @@ -42,7 +42,7 @@ index 0f6ac493f6..e901c066ac 100644 // Spigot end } -@@ -196,7 +203,8 @@ public class LoginListener implements PacketLoginInListener, ITickable { +@@ -199,7 +206,8 @@ public class LoginListener implements PacketLoginInListener { this.loginKey = packetlogininencryptionbegin.a(privatekey); this.g = LoginListener.EnumProtocolState.AUTHENTICATING; this.networkManager.a(this.loginKey); @@ -52,13 +52,13 @@ index 0f6ac493f6..e901c066ac 100644 public void run() { GameProfile gameprofile = LoginListener.this.i; -@@ -243,10 +251,8 @@ public class LoginListener implements PacketLoginInListener, ITickable { +@@ -246,10 +254,8 @@ public class LoginListener implements PacketLoginInListener { - return LoginListener.this.server.S() && socketaddress instanceof InetSocketAddress ? ((InetSocketAddress) socketaddress).getAddress() : null; + return LoginListener.this.server.T() && socketaddress instanceof InetSocketAddress ? ((InetSocketAddress) socketaddress).getAddress() : null; } - }; - -- thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(LoginListener.c)); +- thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(LoginListener.LOGGER)); - thread.start(); + }); + // Paper end diff --git a/Spigot-Server-Patches/0146-Optimise-removeQueue.patch b/Spigot-Server-Patches/0126-Optimise-removeQueue.patch similarity index 80% rename from Spigot-Server-Patches/0146-Optimise-removeQueue.patch rename to Spigot-Server-Patches/0126-Optimise-removeQueue.patch index 43d93ed255..cd8e2977a4 100644 --- a/Spigot-Server-Patches/0146-Optimise-removeQueue.patch +++ b/Spigot-Server-Patches/0126-Optimise-removeQueue.patch @@ -1,33 +1,33 @@ -From 12d9e3e33da074a495df49f3e4c97181f69b4bce Mon Sep 17 00:00:00 2001 +From d0badaff2fdf04edf104e78702414937df7af010 Mon Sep 17 00:00:00 2001 From: Alfie Cleveland Date: Fri, 25 Nov 2016 13:22:40 +0000 Subject: [PATCH] Optimise removeQueue diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index fcb5f590df..6b9bbc77c0 100644 +index 5610c539a..ecdfd306b 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -4,7 +4,9 @@ import com.google.common.collect.Lists; import com.mojang.authlib.GameProfile; - import io.netty.buffer.Unpooled; + import com.mojang.datafixers.util.Either; import io.netty.util.concurrent.Future; +import java.util.ArrayDeque; // Paper import java.util.Collection; +import java.util.Deque; // Paper import java.util.Iterator; import java.util.List; - import java.util.Random; + import java.util.OptionalInt; @@ -40,7 +42,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + public PlayerConnection playerConnection; + public final MinecraftServer server; public final PlayerInteractManager playerInteractManager; - public double d; - public double e; - public final List removeQueue = Lists.newLinkedList(); + public final Deque removeQueue = new ArrayDeque<>(); // Paper - private final AdvancementDataPlayer cf; - private final ServerStatisticManager cg; - private float ch = Float.MIN_VALUE; -@@ -349,13 +351,20 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + private final AdvancementDataPlayer advancementDataPlayer; + private final ServerStatisticManager serverStatisticManager; + private float lastHealthScored = Float.MIN_VALUE; +@@ -364,13 +366,20 @@ public class EntityPlayer extends EntityHuman implements ICrafting { while (!this.removeQueue.isEmpty()) { int i = Math.min(this.removeQueue.size(), Integer.MAX_VALUE); int[] aint = new int[i]; @@ -50,7 +50,7 @@ index fcb5f590df..6b9bbc77c0 100644 this.playerConnection.sendPacket(new PacketPlayOutEntityDestroy(aint)); } -@@ -1153,7 +1162,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1298,7 +1307,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.lastHealthSent = -1.0F; this.lastFoodSent = -1; // this.recipeBook.a((RecipeBook) entityplayer.recipeBook); // CraftBukkit @@ -63,8 +63,8 @@ index fcb5f590df..6b9bbc77c0 100644 + this.removeQueue.addAll(entityplayer.removeQueue); + } + // Paper end - this.cx = entityplayer.cx; - this.cC = entityplayer.cC; + this.cp = entityplayer.cp; + this.cu = entityplayer.cu; this.setShoulderEntityLeft(entityplayer.getShoulderEntityLeft()); -- 2.21.0 diff --git a/Spigot-Server-Patches/0147-Allow-Reloading-of-Command-Aliases.patch b/Spigot-Server-Patches/0127-Allow-Reloading-of-Command-Aliases.patch similarity index 89% rename from Spigot-Server-Patches/0147-Allow-Reloading-of-Command-Aliases.patch rename to Spigot-Server-Patches/0127-Allow-Reloading-of-Command-Aliases.patch index 575eee59e0..224c188b25 100644 --- a/Spigot-Server-Patches/0147-Allow-Reloading-of-Command-Aliases.patch +++ b/Spigot-Server-Patches/0127-Allow-Reloading-of-Command-Aliases.patch @@ -1,4 +1,4 @@ -From 43cf6218919f25f7750453574512b30ba1c579a0 Mon Sep 17 00:00:00 2001 +From f6b2bcea328754fe2f0c853fedd20742ea002443 Mon Sep 17 00:00:00 2001 From: willies952002 Date: Mon, 28 Nov 2016 10:21:52 -0500 Subject: [PATCH] Allow Reloading of Command Aliases @@ -6,10 +6,10 @@ 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 c26da09849..bb7792ce2a 100644 +index 46f902073..bc1de9d9e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2122,5 +2122,24 @@ public final class CraftServer implements Server { +@@ -2058,5 +2058,24 @@ public final class CraftServer implements Server { DefaultPermissions.registerCorePermissions(); CraftDefaultPermissions.registerCorePermissions(); } diff --git a/Spigot-Server-Patches/0148-Add-source-to-PlayerExpChangeEvent.patch b/Spigot-Server-Patches/0128-Add-source-to-PlayerExpChangeEvent.patch similarity index 86% rename from Spigot-Server-Patches/0148-Add-source-to-PlayerExpChangeEvent.patch rename to Spigot-Server-Patches/0128-Add-source-to-PlayerExpChangeEvent.patch index eed356fdd7..0c4eebf415 100644 --- a/Spigot-Server-Patches/0148-Add-source-to-PlayerExpChangeEvent.patch +++ b/Spigot-Server-Patches/0128-Add-source-to-PlayerExpChangeEvent.patch @@ -1,14 +1,14 @@ -From 276826e62696d8d63e0f05d41ea8613873b04dfd Mon Sep 17 00:00:00 2001 +From f72c891cbff8397c4fa29c971acffa84c971a860 Mon Sep 17 00:00:00 2001 From: AlphaBlend Date: Thu, 8 Sep 2016 08:48:33 -0700 Subject: [PATCH] Add source to PlayerExpChangeEvent diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -index 808d1a120a..3030dd9c31 100644 +index b20813be6..bfba08fb2 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -@@ -185,7 +185,7 @@ public class EntityExperienceOrb extends Entity { +@@ -190,7 +190,7 @@ public class EntityExperienceOrb extends Entity { } if (this.value > 0) { @@ -18,18 +18,18 @@ index 808d1a120a..3030dd9c31 100644 this.die(); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index fa0eb2ebeb..3785d4f096 100644 +index 0d16d1430..f22319d78 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -52,6 +52,7 @@ import org.bukkit.entity.Player; - import org.bukkit.entity.Projectile; +@@ -99,6 +99,7 @@ import org.bukkit.entity.Projectile; import org.bukkit.entity.ThrownExpBottle; import org.bukkit.entity.ThrownPotion; + import org.bukkit.entity.Vehicle; +import org.bukkit.entity.ExperienceOrb; // Paper import org.bukkit.event.Cancellable; import org.bukkit.event.Event; import org.bukkit.event.Event.Result; -@@ -838,6 +839,17 @@ public class CraftEventFactory { +@@ -943,6 +944,17 @@ public class CraftEventFactory { return event; } diff --git a/Spigot-Server-Patches/0149-Optimize-World.isLoaded-BlockPosition-Z.patch b/Spigot-Server-Patches/0129-Optimize-World.isLoaded-BlockPosition-Z.patch similarity index 76% rename from Spigot-Server-Patches/0149-Optimize-World.isLoaded-BlockPosition-Z.patch rename to Spigot-Server-Patches/0129-Optimize-World.isLoaded-BlockPosition-Z.patch index 3f342b7e96..1311a77379 100644 --- a/Spigot-Server-Patches/0149-Optimize-World.isLoaded-BlockPosition-Z.patch +++ b/Spigot-Server-Patches/0129-Optimize-World.isLoaded-BlockPosition-Z.patch @@ -1,4 +1,4 @@ -From ee914b4b6a1aa8140e7f599cfab6dfe1bc78e995 Mon Sep 17 00:00:00 2001 +From 40572ae9162a641bd6cea6dd281a7ef4faf25f38 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 2 Dec 2016 00:11:43 -0500 Subject: [PATCH] Optimize World.isLoaded(BlockPosition)Z @@ -6,11 +6,11 @@ Subject: [PATCH] Optimize World.isLoaded(BlockPosition)Z Reduce method invocations for World.isLoaded(BlockPosition)Z diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 282d6ae84c..5e1ab431dc 100644 +index 5637c3872..1286703bf 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -268,6 +268,10 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc - return this.getType(blockposition).isAir(); +@@ -208,6 +208,10 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose + return i < 0 || i >= 256; } + public boolean isLoaded(BlockPosition blockposition) { diff --git a/Spigot-Server-Patches/0150-Don-t-let-fishinghooks-use-portals.patch b/Spigot-Server-Patches/0130-Don-t-let-fishinghooks-use-portals.patch similarity index 66% rename from Spigot-Server-Patches/0150-Don-t-let-fishinghooks-use-portals.patch rename to Spigot-Server-Patches/0130-Don-t-let-fishinghooks-use-portals.patch index 0650b7eabc..ac076106ec 100644 --- a/Spigot-Server-Patches/0150-Don-t-let-fishinghooks-use-portals.patch +++ b/Spigot-Server-Patches/0130-Don-t-let-fishinghooks-use-portals.patch @@ -1,29 +1,29 @@ -From 5b2757104d7ef336e2b64ced2a0d0662eae91cc6 Mon Sep 17 00:00:00 2001 +From 8fd0513571c259e78452131eb90b5ce32a8e212d Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Fri, 16 Dec 2016 16:03:19 -0600 Subject: [PATCH] Don't let fishinghooks use portals diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 113264981e..b6ed9082fd 100644 +index b68e2fc04..cbdc267fa 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -156,7 +156,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - public boolean ak; +@@ -153,7 +153,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + public boolean af; public boolean impulse; public int portalCooldown; -- protected boolean an; -+ protected boolean an; public boolean inPortal() { return an; } // Paper - OBFHELPER - protected int ao; +- protected boolean ai; ++ protected boolean ai; public final boolean inPortal() { return this.ai; } // Paper - OBFHELPER + protected int aj; public DimensionManager dimension; - protected BlockPosition aq; + protected BlockPosition al; diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java -index 118b974d76..861fc6fd5c 100644 +index b082d0a82..15a686cb2 100644 --- a/src/main/java/net/minecraft/server/EntityFishingHook.java +++ b/src/main/java/net/minecraft/server/EntityFishingHook.java -@@ -190,6 +190,12 @@ public class EntityFishingHook extends Entity { - this.motY *= 0.92D; - this.motZ *= 0.92D; +@@ -163,6 +163,12 @@ public class EntityFishingHook extends Entity { + + this.setMot(this.getMot().a(0.92D)); this.setPosition(this.locX, this.locY, this.locZ); + + // Paper start - These shouldn't be going through portals diff --git a/Spigot-Server-Patches/0151-Add-ProjectileCollideEvent.patch b/Spigot-Server-Patches/0131-Add-ProjectileCollideEvent.patch similarity index 51% rename from Spigot-Server-Patches/0151-Add-ProjectileCollideEvent.patch rename to Spigot-Server-Patches/0131-Add-ProjectileCollideEvent.patch index 2b1fa19da3..db7430c942 100644 --- a/Spigot-Server-Patches/0151-Add-ProjectileCollideEvent.patch +++ b/Spigot-Server-Patches/0131-Add-ProjectileCollideEvent.patch @@ -1,103 +1,108 @@ -From 4628e67615e80fef7ba4ee589dcf418b16014a6e Mon Sep 17 00:00:00 2001 +From 65dc485716c009ae92fda5358ad3b8615a30c9d0 Mon Sep 17 00:00:00 2001 From: Techcable Date: Fri, 16 Dec 2016 21:25:39 -0600 Subject: [PATCH] Add ProjectileCollideEvent diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java -index feafb82dd3..6aa518f17f 100644 +index b5b569ef9..43ece829f 100644 --- a/src/main/java/net/minecraft/server/EntityArrow.java +++ b/src/main/java/net/minecraft/server/EntityArrow.java -@@ -194,6 +194,16 @@ public abstract class EntityArrow extends Entity implements IProjectile { +@@ -184,6 +184,16 @@ public abstract class EntityArrow extends Entity implements IProjectile { + } } - } -+ // Paper start - Call ProjectileCollideEvent -+ // TODO: flag - noclip - call cancelled? -+ if (movingobjectposition != null && movingobjectposition.entity != null) { -+ com.destroystokyo.paper.event.entity.ProjectileCollideEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileCollideEvent(this, movingobjectposition); -+ if (event.isCancelled()) { -+ movingobjectposition = null; ++ // Paper start - Call ProjectileCollideEvent ++ // TODO: flag - noclip - call cancelled? ++ if (object instanceof MovingObjectPositionEntity) { ++ com.destroystokyo.paper.event.entity.ProjectileCollideEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileCollideEvent(this, (MovingObjectPositionEntity)object); ++ if (event.isCancelled()) { ++ object = null; ++ } + } -+ } -+ // Paper end ++ // Paper end + - if (movingobjectposition != null && !flag) { - this.a(movingobjectposition); - this.impulse = true; + if (object != null && !flag) { + this.a((MovingObjectPosition) object); + this.impulse = true; diff --git a/src/main/java/net/minecraft/server/EntityFireball.java b/src/main/java/net/minecraft/server/EntityFireball.java -index 3e3619d79f..58cc4824cf 100644 +index 739e48ec7..192ee928f 100644 --- a/src/main/java/net/minecraft/server/EntityFireball.java +++ b/src/main/java/net/minecraft/server/EntityFireball.java -@@ -68,6 +68,15 @@ public abstract class EntityFireball extends Entity { - ++this.f; - MovingObjectPosition movingobjectposition = ProjectileHelper.a(this, true, this.f >= 25, this.shooter); +@@ -67,7 +67,16 @@ public abstract class EntityFireball extends Entity { + ++this.g; + MovingObjectPosition movingobjectposition = ProjectileHelper.a(this, true, this.g >= 25, this.shooter, RayTrace.BlockCollisionOption.COLLIDER); +- if (movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS) { + // Paper start - Call ProjectileCollideEvent -+ if (movingobjectposition != null && movingobjectposition.entity != null) { -+ com.destroystokyo.paper.event.entity.ProjectileCollideEvent event = CraftEventFactory.callProjectileCollideEvent(this, movingobjectposition); ++ if (movingobjectposition instanceof MovingObjectPositionEntity) { ++ com.destroystokyo.paper.event.entity.ProjectileCollideEvent event = CraftEventFactory.callProjectileCollideEvent(this, (MovingObjectPositionEntity)movingobjectposition); + if (event.isCancelled()) { + movingobjectposition = null; + } + } + // Paper end + - if (movingobjectposition != null) { ++ if (movingobjectposition != null && movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS) { // Paper - add null check in case cancelled this.a(movingobjectposition); + // CraftBukkit start - Fire ProjectileHitEvent diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java -index 861fc6fd5c..202b8d2158 100644 +index 15a686cb2..78527f350 100644 --- a/src/main/java/net/minecraft/server/EntityFishingHook.java +++ b/src/main/java/net/minecraft/server/EntityFishingHook.java -@@ -245,6 +245,16 @@ public class EntityFishingHook extends Entity { +@@ -217,7 +217,16 @@ public class EntityFishingHook extends Entity { + return !entity.t() && (entity.isInteractable() || entity instanceof EntityItem) && (entity != this.owner || this.g >= 5); + }, RayTrace.BlockCollisionOption.COLLIDER, true); - vec3d = new Vec3D(this.locX, this.locY, this.locZ); - vec3d1 = new Vec3D(this.locX + this.motX, this.locY + this.motY, this.locZ + this.motZ); -+ +- if (movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS) { + // Paper start - Call ProjectileCollideEvent -+ if (movingobjectposition != null && movingobjectposition.entity != null) { -+ com.destroystokyo.paper.event.entity.ProjectileCollideEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileCollideEvent(this, movingobjectposition); ++ if (movingobjectposition instanceof MovingObjectPositionEntity) { ++ com.destroystokyo.paper.event.entity.ProjectileCollideEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileCollideEvent(this, (MovingObjectPositionEntity)movingobjectposition); + if (event.isCancelled()) { + movingobjectposition = null; + } + } + // Paper end + - if (movingobjectposition != null) { - vec3d1 = new Vec3D(movingobjectposition.pos.x, movingobjectposition.pos.y, movingobjectposition.pos.z); - } ++ if (movingobjectposition != null && movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS) { // Paper - add null check in case cancelled + org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this, movingobjectposition); // Craftbukkit - Call event + if (movingobjectposition.getType() == MovingObjectPosition.EnumMovingObjectType.ENTITY) { + this.hooked = ((MovingObjectPositionEntity) movingobjectposition).getEntity(); diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java -index 751ea456b9..bab5b89fe9 100644 +index ac62f836d..bb4679cf7 100644 --- a/src/main/java/net/minecraft/server/EntityProjectile.java +++ b/src/main/java/net/minecraft/server/EntityProjectile.java -@@ -144,6 +144,15 @@ public abstract class EntityProjectile extends Entity implements IProjectile { - movingobjectposition = new MovingObjectPosition(entity); +@@ -102,7 +102,16 @@ public abstract class EntityProjectile extends Entity implements IProjectile { + this.as = null; } +- if (movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS) { + // Paper start - Call ProjectileCollideEvent -+ if (movingobjectposition != null && movingobjectposition.entity != null) { -+ com.destroystokyo.paper.event.entity.ProjectileCollideEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileCollideEvent(this, movingobjectposition); ++ if (movingobjectposition instanceof MovingObjectPositionEntity) { ++ com.destroystokyo.paper.event.entity.ProjectileCollideEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileCollideEvent(this, (MovingObjectPositionEntity)movingobjectposition); + if (event.isCancelled()) { + movingobjectposition = null; + } + } + // Paper end + - if (movingobjectposition != null) { - if (movingobjectposition.type == MovingObjectPosition.EnumMovingObjectType.BLOCK && this.world.getType(movingobjectposition.getBlockPosition()).getBlock() == Blocks.NETHER_PORTAL) { - this.e(movingobjectposition.getBlockPosition()); ++ if (movingobjectposition != null && movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS) { // Paper - add null check in case cancelled + if (movingobjectposition.getType() == MovingObjectPosition.EnumMovingObjectType.BLOCK && this.world.getType(((MovingObjectPositionBlock) movingobjectposition).getBlockPosition()).getBlock() == Blocks.NETHER_PORTAL) { + this.c(((MovingObjectPositionBlock) movingobjectposition).getBlockPosition()); + } else { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 3785d4f096..9cbbfed4fe 100644 +index f22319d78..b75369275 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -979,6 +979,16 @@ public class CraftEventFactory { +@@ -1084,6 +1084,16 @@ public class CraftEventFactory { return CraftItemStack.asNMSCopy(bitem); } + // Paper start -+ public static com.destroystokyo.paper.event.entity.ProjectileCollideEvent callProjectileCollideEvent(Entity entity, MovingObjectPosition position) { ++ public static com.destroystokyo.paper.event.entity.ProjectileCollideEvent callProjectileCollideEvent(Entity entity, MovingObjectPositionEntity position) { + Projectile projectile = (Projectile) entity.getBukkitEntity(); -+ org.bukkit.entity.Entity collided = position.entity.getBukkitEntity(); ++ org.bukkit.entity.Entity collided = position.getEntity().getBukkitEntity(); + com.destroystokyo.paper.event.entity.ProjectileCollideEvent event = new com.destroystokyo.paper.event.entity.ProjectileCollideEvent(projectile, collided); + Bukkit.getPluginManager().callEvent(event); + return event; diff --git a/Spigot-Server-Patches/0131-Disable-ticking-of-snow-blocks.patch b/Spigot-Server-Patches/0131-Disable-ticking-of-snow-blocks.patch deleted file mode 100644 index e070786b5c..0000000000 --- a/Spigot-Server-Patches/0131-Disable-ticking-of-snow-blocks.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 196af651b80059962f3a70483626f52c60df29b9 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 0c8f9d37fd..44ed656263 100644 ---- a/src/main/java/net/minecraft/server/BlockSnowBlock.java -+++ b/src/main/java/net/minecraft/server/BlockSnowBlock.java -@@ -16,6 +16,8 @@ public class BlockSnowBlock extends Block { - return 4; - } - -+ // Paper start - snow blocks don't need to tick -+ /* - public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) { - if (world.getBrightness(EnumSkyBlock.BLOCK, blockposition) > 11) { - // CraftBukkit start -@@ -28,4 +30,6 @@ public class BlockSnowBlock extends Block { - } - - } -+ */ -+ //Paper end - } --- -2.21.0 - diff --git a/Spigot-Server-Patches/0152-Prevent-Pathfinding-out-of-World-Border.patch b/Spigot-Server-Patches/0132-Prevent-Pathfinding-out-of-World-Border.patch similarity index 50% rename from Spigot-Server-Patches/0152-Prevent-Pathfinding-out-of-World-Border.patch rename to Spigot-Server-Patches/0132-Prevent-Pathfinding-out-of-World-Border.patch index 1777f1c5a5..906a070cff 100644 --- a/Spigot-Server-Patches/0152-Prevent-Pathfinding-out-of-World-Border.patch +++ b/Spigot-Server-Patches/0132-Prevent-Pathfinding-out-of-World-Border.patch @@ -1,4 +1,4 @@ -From 2ffd8e341776fa64537f3474cdd35f18ee5ca681 Mon Sep 17 00:00:00 2001 +From d11a8e763b8d40afcfb60ecbda4c3c53a111b005 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 19 Dec 2016 23:07:42 -0500 Subject: [PATCH] Prevent Pathfinding out of World Border @@ -6,28 +6,19 @@ Subject: [PATCH] Prevent Pathfinding out of World Border This prevents Entities from trying to run outside of the World Border diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java -index 716d00afb1..c55aadb536 100644 +index 2a391be28..0586597e7 100644 --- a/src/main/java/net/minecraft/server/NavigationAbstract.java +++ b/src/main/java/net/minecraft/server/NavigationAbstract.java -@@ -75,6 +75,7 @@ public abstract class NavigationAbstract { - +@@ -100,6 +100,7 @@ public abstract class NavigationAbstract { @Nullable - public PathEntity b(BlockPosition blockposition) { + protected PathEntity a(BlockPosition blockposition, Entity target, double d0, double d1, double d2, int i, boolean flag) { + // Paper end + if (!getEntity().getWorld().getWorldBorder().isInBounds(blockposition)) return null; // Paper - don't path out of world border - if (!this.b()) { + if (!this.a()) { return null; } else if (this.c != null && !this.c.b() && blockposition.equals(this.q)) { -@@ -101,7 +102,7 @@ public abstract class NavigationAbstract { - return null; - } else { - BlockPosition blockposition = new BlockPosition(entity); -- -+ if (!getEntity().getWorld().getWorldBorder().isInBounds(blockposition)) return null; // Paper - don't path out of world border - if (this.c != null && !this.c.b() && blockposition.equals(this.q)) { - return this.c; - } else { diff --git a/src/main/java/net/minecraft/server/WorldBorder.java b/src/main/java/net/minecraft/server/WorldBorder.java -index beac8ac0b9..86ada40a10 100644 +index 94d1c2be1..51739e254 100644 --- a/src/main/java/net/minecraft/server/WorldBorder.java +++ b/src/main/java/net/minecraft/server/WorldBorder.java @@ -19,7 +19,7 @@ public class WorldBorder { @@ -35,8 +26,8 @@ index beac8ac0b9..86ada40a10 100644 public WorldBorder() {} - public boolean a(BlockPosition blockposition) { -+ public boolean isInBounds(BlockPosition blockposition) { return a(blockposition); }public boolean a(BlockPosition blockposition) { // Paper - OBFHELPER - return (double) (blockposition.getX() + 1) > this.b() && (double) blockposition.getX() < this.d() && (double) (blockposition.getZ() + 1) > this.c() && (double) blockposition.getZ() < this.e(); ++ public final boolean isInBounds(BlockPosition blockposition) { return this.a(blockposition); } public boolean a(BlockPosition blockposition) { // Paper - OBFHELPER + return (double) (blockposition.getX() + 1) > this.c() && (double) blockposition.getX() < this.e() && (double) (blockposition.getZ() + 1) > this.d() && (double) blockposition.getZ() < this.f(); } -- diff --git a/Spigot-Server-Patches/0153-Bound-Treasure-Maps-to-World-Border.patch b/Spigot-Server-Patches/0133-Bound-Treasure-Maps-to-World-Border.patch similarity index 64% rename from Spigot-Server-Patches/0153-Bound-Treasure-Maps-to-World-Border.patch rename to Spigot-Server-Patches/0133-Bound-Treasure-Maps-to-World-Border.patch index d1d3e78fd9..ca243cf338 100644 --- a/Spigot-Server-Patches/0153-Bound-Treasure-Maps-to-World-Border.patch +++ b/Spigot-Server-Patches/0133-Bound-Treasure-Maps-to-World-Border.patch @@ -1,4 +1,4 @@ -From 1d5387e7ec06f4e21d06d383cc57a3f957b3d1c0 Mon Sep 17 00:00:00 2001 +From 405c98bc83a1719e73b831630e22620e39d0d307 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 20 Dec 2016 15:15:11 -0500 Subject: [PATCH] Bound Treasure Maps to World Border @@ -11,39 +11,39 @@ that is outside happens to be closer, but unreachable, yet another reachable one is in border that would of been missed. diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java -index 7194c048c9..2ea5ac3161 100644 +index 464e1e101..7b2eace75 100644 --- a/src/main/java/net/minecraft/server/StructureGenerator.java +++ b/src/main/java/net/minecraft/server/StructureGenerator.java -@@ -122,6 +122,7 @@ public abstract class StructureGenerator +@@ -103,6 +103,7 @@ public abstract class StructureGenerator if (flag1 || flag2) { ChunkCoordIntPair chunkcoordintpair = this.a(chunkgenerator, seededrandom, j, k, i1, j1); + if (!world.getWorldBorder().isChunkInBounds(chunkcoordintpair.x, chunkcoordintpair.z)) { continue; } // Paper - StructureStart structurestart = this.a(world, chunkgenerator, seededrandom, chunkcoordintpair.a()); + StructureStart structurestart = world.getChunkAt(chunkcoordintpair.x, chunkcoordintpair.z, ChunkStatus.STRUCTURE_STARTS).a(this.b()); - if (structurestart != StructureGenerator.a) { + if (structurestart != null && structurestart.e()) { diff --git a/src/main/java/net/minecraft/server/WorldBorder.java b/src/main/java/net/minecraft/server/WorldBorder.java -index 86ada40a10..a2e856952e 100644 +index 51739e254..2b5c09c62 100644 --- a/src/main/java/net/minecraft/server/WorldBorder.java +++ b/src/main/java/net/minecraft/server/WorldBorder.java @@ -23,6 +23,18 @@ public class WorldBorder { - return (double) (blockposition.getX() + 1) > this.b() && (double) blockposition.getX() < this.d() && (double) (blockposition.getZ() + 1) > this.c() && (double) blockposition.getZ() < this.e(); + return (double) (blockposition.getX() + 1) > this.c() && (double) blockposition.getX() < this.e() && (double) (blockposition.getZ() + 1) > this.d() && (double) blockposition.getZ() < this.f(); } + // Paper start + private final BlockPosition.MutableBlockPosition mutPos = new BlockPosition.MutableBlockPosition(); + public boolean isBlockInBounds(int chunkX, int chunkZ) { -+ mutPos.setValues(chunkX, 64, chunkZ); -+ return isInBounds(mutPos); ++ this.mutPos.setValues(chunkX, 64, chunkZ); ++ return this.isInBounds(this.mutPos); + } + public boolean isChunkInBounds(int chunkX, int chunkZ) { -+ mutPos.setValues(((chunkX << 4) + 15), 64, (chunkZ << 4) + 15); -+ return isInBounds(mutPos); ++ this.mutPos.setValues(((chunkX << 4) + 15), 64, (chunkZ << 4) + 15); ++ return this.isInBounds(this.mutPos); + } + // Paper end + public boolean isInBounds(ChunkCoordIntPair chunkcoordintpair) { - return (double) chunkcoordintpair.f() > this.b() && (double) chunkcoordintpair.d() < this.d() && (double) chunkcoordintpair.g() > this.c() && (double) chunkcoordintpair.e() < this.e(); + return (double) chunkcoordintpair.f() > this.c() && (double) chunkcoordintpair.d() < this.e() && (double) chunkcoordintpair.g() > this.d() && (double) chunkcoordintpair.e() < this.f(); } -- 2.21.0 diff --git a/Spigot-Server-Patches/0134-Configurable-Cartographer-Treasure-Maps.patch b/Spigot-Server-Patches/0134-Configurable-Cartographer-Treasure-Maps.patch new file mode 100644 index 0000000000..504b504b52 --- /dev/null +++ b/Spigot-Server-Patches/0134-Configurable-Cartographer-Treasure-Maps.patch @@ -0,0 +1,60 @@ +From a77af2c91e5f163c00454d5decf54d9c36aea050 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Tue, 20 Dec 2016 15:26:27 -0500 +Subject: [PATCH] Configurable Cartographer Treasure Maps + +Allow configuring for cartographers to return the same map location + +Also allow turning off treasure maps all together as they can eat up Map ID's +which are limited in quantity. + +diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +index 4892113a1..406bc611c 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +@@ -310,4 +310,14 @@ public class PaperWorldConfig { + Bukkit.getLogger().warning("Spawn Egg and Armor Stand NBT filtering disabled, this is a potential security risk"); + } + } ++ ++ public boolean enableTreasureMaps = true; ++ public boolean treasureMapsAlreadyDiscovered = false; ++ private void treasureMapsAlreadyDiscovered() { ++ enableTreasureMaps = getBoolean("enable-treasure-maps", true); ++ treasureMapsAlreadyDiscovered = getBoolean("treasure-maps-return-already-discovered", false); ++ if (treasureMapsAlreadyDiscovered) { ++ log("Treasure Maps will return already discovered locations"); ++ } ++ } + } +diff --git a/src/main/java/net/minecraft/server/VillagerTrades.java b/src/main/java/net/minecraft/server/VillagerTrades.java +index 1df86e3bb..83bf9bea2 100644 +--- a/src/main/java/net/minecraft/server/VillagerTrades.java ++++ b/src/main/java/net/minecraft/server/VillagerTrades.java +@@ -15,12 +15,12 @@ import javax.annotation.Nullable; + + public class VillagerTrades { + +- public static final Map> a = (Map) SystemUtils.a((Object) Maps.newHashMap(), (hashmap) -> { ++ public static final Map> a = SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // Paper - decompile fix + hashmap.put(VillagerProfession.FARMER, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.WHEAT, 20, 8, 2), new VillagerTrades.b(Items.POTATO, 26, 8, 2), new VillagerTrades.b(Items.CARROT, 22, 8, 2), new VillagerTrades.b(Items.BEETROOT, 15, 8, 2), new VillagerTrades.h(Items.BREAD, 1, 6, 8, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Blocks.PUMPKIN, 6, 6, 10), new VillagerTrades.h(Items.PUMPKIN_PIE, 1, 4, 5), new VillagerTrades.h(Items.APPLE, 1, 4, 8, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.h(Items.COOKIE, 3, 18, 10), new VillagerTrades.b(Blocks.MELON, 4, 6, 20)}, 4, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.h(Blocks.CAKE, 1, 1, 6, 15), new VillagerTrades.i(MobEffects.FASTER_MOVEMENT, 160, 15), new VillagerTrades.i(MobEffects.JUMP, 160, 15), new VillagerTrades.i(MobEffects.WEAKNESS, 140, 15), new VillagerTrades.i(MobEffects.BLINDNESS, 120, 15), new VillagerTrades.i(MobEffects.POISON, 280, 15), new VillagerTrades.i(MobEffects.SATURATION, 7, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.h(Items.GOLDEN_CARROT, 3, 3, 30), new VillagerTrades.h(Items.GLISTERING_MELON_SLICE, 4, 3, 30)}))); +- hashmap.put(VillagerProfession.FISHERMAN, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.STRING, 20, 8, 2), new VillagerTrades.b(Items.COAL, 10, 8, 2), new VillagerTrades.g(Items.COD, 6, Items.COOKED_COD, 6, 8, 1), new VillagerTrades.h(Items.COD_BUCKET, 3, 1, 8, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.COD, 15, 8, 10), new VillagerTrades.g(Items.SALMON, 6, Items.COOKED_SALMON, 6, 8, 5), new VillagerTrades.h(Items.pS, 2, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.SALMON, 13, 8, 20), new VillagerTrades.e(Items.FISHING_ROD, 3, 2, 10, 0.2F)}, 4, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.TROPICAL_FISH, 6, 6, 30)}, 5, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.PUFFERFISH, 4, 6, 30), new VillagerTrades.c(1, 6, 30, ImmutableMap.builder().put(VillagerType.c, Items.OAK_BOAT).put(VillagerType.g, Items.SPRUCE_BOAT).put(VillagerType.e, Items.SPRUCE_BOAT).put(VillagerType.a, Items.JUNGLE_BOAT).put(VillagerType.b, Items.JUNGLE_BOAT).put(VillagerType.d, Items.ACACIA_BOAT).put(VillagerType.f, Items.DARK_OAK_BOAT).build())}))); ++ hashmap.put(VillagerProfession.FISHERMAN, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.STRING, 20, 8, 2), new VillagerTrades.b(Items.COAL, 10, 8, 2), new VillagerTrades.g(Items.COD, 6, Items.COOKED_COD, 6, 8, 1), new VillagerTrades.h(Items.COD_BUCKET, 3, 1, 8, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.COD, 15, 8, 10), new VillagerTrades.g(Items.SALMON, 6, Items.COOKED_SALMON, 6, 8, 5), new VillagerTrades.h(Items.pS, 2, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.SALMON, 13, 8, 20), new VillagerTrades.e(Items.FISHING_ROD, 3, 2, 10, 0.2F)}, 4, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.TROPICAL_FISH, 6, 6, 30)}, 5, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.PUFFERFISH, 4, 6, 30), new VillagerTrades.c(1, 6, 30, ImmutableMap.builder().put(VillagerType.c, Items.OAK_BOAT).put(VillagerType.g, Items.SPRUCE_BOAT).put(VillagerType.e, Items.SPRUCE_BOAT).put(VillagerType.a, Items.JUNGLE_BOAT).put(VillagerType.b, Items.JUNGLE_BOAT).put(VillagerType.d, Items.ACACIA_BOAT).put(VillagerType.f, Items.DARK_OAK_BOAT).build())}))); // Paper - decompile fix + hashmap.put(VillagerProfession.SHEPHERD, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Blocks.WHITE_WOOL, 18, 8, 2), new VillagerTrades.b(Blocks.BROWN_WOOL, 18, 8, 2), new VillagerTrades.b(Blocks.BLACK_WOOL, 18, 8, 2), new VillagerTrades.b(Blocks.GRAY_WOOL, 18, 8, 2), new VillagerTrades.h(Items.SHEARS, 2, 1, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.WHITE_DYE, 12, 8, 10), new VillagerTrades.b(Items.GRAY_DYE, 12, 8, 10), new VillagerTrades.b(Items.BLACK_DYE, 12, 8, 10), new VillagerTrades.b(Items.LIGHT_BLUE_DYE, 12, 8, 10), new VillagerTrades.b(Items.LIME_DYE, 12, 8, 10), new VillagerTrades.h(Blocks.WHITE_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.ORANGE_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.MAGENTA_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.LIGHT_BLUE_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.YELLOW_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.LIME_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.PINK_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.GRAY_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.LIGHT_GRAY_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.CYAN_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.PURPLE_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.BLUE_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.BROWN_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.GREEN_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.RED_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.BLACK_WOOL, 1, 1, 8, 5), new VillagerTrades.h(Blocks.WHITE_CARPET, 1, 4, 8, 5), new VillagerTrades.h(Blocks.ORANGE_CARPET, 1, 4, 8, 5), new VillagerTrades.h(Blocks.MAGENTA_CARPET, 1, 4, 8, 5), new VillagerTrades.h(Blocks.LIGHT_BLUE_CARPET, 1, 4, 8, 5), new VillagerTrades.h(Blocks.YELLOW_CARPET, 1, 4, 8, 5), new VillagerTrades.h(Blocks.LIME_CARPET, 1, 4, 8, 5), new VillagerTrades.h(Blocks.PINK_CARPET, 1, 4, 8, 5), new VillagerTrades.h(Blocks.GRAY_CARPET, 1, 4, 8, 5), new VillagerTrades.h(Blocks.LIGHT_GRAY_CARPET, 1, 4, 8, 5), new VillagerTrades.h(Blocks.CYAN_CARPET, 1, 4, 8, 5), new VillagerTrades.h(Blocks.PURPLE_CARPET, 1, 4, 8, 5), new VillagerTrades.h(Blocks.BLUE_CARPET, 1, 4, 8, 5), new VillagerTrades.h(Blocks.BROWN_CARPET, 1, 4, 8, 5), new VillagerTrades.h(Blocks.GREEN_CARPET, 1, 4, 8, 5), new VillagerTrades.h(Blocks.RED_CARPET, 1, 4, 8, 5), new VillagerTrades.h(Blocks.BLACK_CARPET, 1, 4, 8, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.YELLOW_DYE, 12, 8, 20), new VillagerTrades.b(Items.LIGHT_GRAY_DYE, 12, 8, 20), new VillagerTrades.b(Items.ORANGE_DYE, 12, 8, 20), new VillagerTrades.b(Items.RED_DYE, 12, 8, 20), new VillagerTrades.b(Items.PINK_DYE, 12, 8, 20), new VillagerTrades.h(Blocks.WHITE_BED, 3, 1, 6, 10), new VillagerTrades.h(Blocks.YELLOW_BED, 3, 1, 6, 10), new VillagerTrades.h(Blocks.RED_BED, 3, 1, 6, 10), new VillagerTrades.h(Blocks.BLACK_BED, 3, 1, 6, 10), new VillagerTrades.h(Blocks.BLUE_BED, 3, 1, 6, 10), new VillagerTrades.h(Blocks.BROWN_BED, 3, 1, 6, 10), new VillagerTrades.h(Blocks.CYAN_BED, 3, 1, 6, 10), new VillagerTrades.h(Blocks.GRAY_BED, 3, 1, 6, 10), new VillagerTrades.h(Blocks.GREEN_BED, 3, 1, 6, 10), new VillagerTrades.h(Blocks.LIGHT_BLUE_BED, 3, 1, 6, 10), new VillagerTrades.h(Blocks.LIGHT_GRAY_BED, 3, 1, 6, 10), new VillagerTrades.h(Blocks.LIME_BED, 3, 1, 6, 10), new VillagerTrades.h(Blocks.MAGENTA_BED, 3, 1, 6, 10), new VillagerTrades.h(Blocks.ORANGE_BED, 3, 1, 6, 10), new VillagerTrades.h(Blocks.PINK_BED, 3, 1, 6, 10), new VillagerTrades.h(Blocks.PURPLE_BED, 3, 1, 6, 10)}, 4, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.BROWN_DYE, 12, 8, 30), new VillagerTrades.b(Items.PURPLE_DYE, 12, 8, 30), new VillagerTrades.b(Items.BLUE_DYE, 12, 8, 30), new VillagerTrades.b(Items.GREEN_DYE, 12, 8, 30), new VillagerTrades.b(Items.MAGENTA_DYE, 12, 8, 30), new VillagerTrades.b(Items.CYAN_DYE, 12, 8, 30), new VillagerTrades.h(Items.WHITE_BANNER, 3, 1, 6, 15), new VillagerTrades.h(Items.BLUE_BANNER, 3, 1, 6, 15), new VillagerTrades.h(Items.LIGHT_BLUE_BANNER, 3, 1, 6, 15), new VillagerTrades.h(Items.RED_BANNER, 3, 1, 6, 15), new VillagerTrades.h(Items.PINK_BANNER, 3, 1, 6, 15), new VillagerTrades.h(Items.GREEN_BANNER, 3, 1, 6, 15), new VillagerTrades.h(Items.LIME_BANNER, 3, 1, 6, 15), new VillagerTrades.h(Items.GRAY_BANNER, 3, 1, 6, 15), new VillagerTrades.h(Items.BLACK_BANNER, 3, 1, 6, 15), new VillagerTrades.h(Items.PURPLE_BANNER, 3, 1, 6, 15), new VillagerTrades.h(Items.MAGENTA_BANNER, 3, 1, 6, 15), new VillagerTrades.h(Items.CYAN_BANNER, 3, 1, 6, 15), new VillagerTrades.h(Items.BROWN_BANNER, 3, 1, 6, 15), new VillagerTrades.h(Items.YELLOW_BANNER, 3, 1, 6, 15), new VillagerTrades.h(Items.ORANGE_BANNER, 3, 1, 6, 15), new VillagerTrades.h(Items.LIGHT_GRAY_BANNER, 3, 1, 6, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.h(Items.PAINTING, 2, 3, 30)}))); + hashmap.put(VillagerProfession.FLETCHER, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.STICK, 32, 8, 2), new VillagerTrades.h(Items.ARROW, 1, 16, 1), new VillagerTrades.g(Blocks.GRAVEL, 10, Items.FLINT, 10, 6, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.FLINT, 26, 6, 10), new VillagerTrades.h(Items.BOW, 2, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.STRING, 14, 8, 20), new VillagerTrades.h(Items.CROSSBOW, 3, 1, 10)}, 4, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.FEATHER, 24, 8, 30), new VillagerTrades.e(Items.BOW, 2, 2, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.dE, 8, 6, 30), new VillagerTrades.e(Items.CROSSBOW, 3, 2, 15), new VillagerTrades.j(Items.ARROW, 5, Items.TIPPED_ARROW, 5, 2, 6, 30)}))); +- hashmap.put(VillagerProfession.LIBRARIAN, a(ImmutableMap.builder().put(1, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.PAPER, 24, 8, 2), new VillagerTrades.d(1), new VillagerTrades.h(Blocks.BOOKSHELF, 6, 3, 6, 1)}).put(2, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.BOOK, 4, 6, 10), new VillagerTrades.d(5), new VillagerTrades.h(Items.pQ, 1, 1, 5)}).put(3, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.INK_SAC, 5, 6, 20), new VillagerTrades.d(10), new VillagerTrades.h(Items.am, 1, 4, 10)}).put(4, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.WRITABLE_BOOK, 2, 6, 30), new VillagerTrades.d(15), new VillagerTrades.h(Items.CLOCK, 5, 1, 15), new VillagerTrades.h(Items.COMPASS, 4, 1, 15)}).put(5, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.h(Items.NAME_TAG, 20, 1, 30)}).build())); ++ hashmap.put(VillagerProfession.LIBRARIAN, a(ImmutableMap.builder().put(1, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.PAPER, 24, 8, 2), new VillagerTrades.d(1), new VillagerTrades.h(Blocks.BOOKSHELF, 6, 3, 6, 1)}).put(2, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.BOOK, 4, 6, 10), new VillagerTrades.d(5), new VillagerTrades.h(Items.pQ, 1, 1, 5)}).put(3, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.INK_SAC, 5, 6, 20), new VillagerTrades.d(10), new VillagerTrades.h(Items.am, 1, 4, 10)}).put(4, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.WRITABLE_BOOK, 2, 6, 30), new VillagerTrades.d(15), new VillagerTrades.h(Items.CLOCK, 5, 1, 15), new VillagerTrades.h(Items.COMPASS, 4, 1, 15)}).put(5, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.h(Items.NAME_TAG, 20, 1, 30)}).build())); // Paper - decompile fix + hashmap.put(VillagerProfession.CARTOGRAPHER, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.PAPER, 24, 8, 2), new VillagerTrades.h(Items.MAP, 7, 1, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.df, 10, 8, 10), new VillagerTrades.k(13, "Monument", MapIcon.Type.MONUMENT, 6, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.COMPASS, 1, 6, 20), new VillagerTrades.k(14, "Mansion", MapIcon.Type.MANSION, 6, 10)}, 4, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.h(Items.ITEM_FRAME, 7, 1, 15), new VillagerTrades.h(Items.WHITE_BANNER, 3, 1, 15), new VillagerTrades.h(Items.BLUE_BANNER, 3, 1, 15), new VillagerTrades.h(Items.LIGHT_BLUE_BANNER, 3, 1, 15), new VillagerTrades.h(Items.RED_BANNER, 3, 1, 15), new VillagerTrades.h(Items.PINK_BANNER, 3, 1, 15), new VillagerTrades.h(Items.GREEN_BANNER, 3, 1, 15), new VillagerTrades.h(Items.LIME_BANNER, 3, 1, 15), new VillagerTrades.h(Items.GRAY_BANNER, 3, 1, 15), new VillagerTrades.h(Items.BLACK_BANNER, 3, 1, 15), new VillagerTrades.h(Items.PURPLE_BANNER, 3, 1, 15), new VillagerTrades.h(Items.MAGENTA_BANNER, 3, 1, 15), new VillagerTrades.h(Items.CYAN_BANNER, 3, 1, 15), new VillagerTrades.h(Items.BROWN_BANNER, 3, 1, 15), new VillagerTrades.h(Items.YELLOW_BANNER, 3, 1, 15), new VillagerTrades.h(Items.ORANGE_BANNER, 3, 1, 15), new VillagerTrades.h(Items.LIGHT_GRAY_BANNER, 3, 1, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.h(Items.GLOBE_BANNER_PATTERN, 8, 1, 30)}))); + hashmap.put(VillagerProfession.CLERIC, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.ROTTEN_FLESH, 32, 8, 2), new VillagerTrades.h(Items.REDSTONE, 1, 2, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.GOLD_INGOT, 3, 6, 10), new VillagerTrades.h(Items.LAPIS_LAZULI, 1, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.RABBIT_FOOT, 2, 6, 20), new VillagerTrades.h(Blocks.GLOWSTONE, 4, 1, 6, 10)}, 4, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.SCUTE, 4, 6, 30), new VillagerTrades.b(Items.GLASS_BOTTLE, 9, 6, 30), new VillagerTrades.h(Items.ENDER_PEARL, 5, 1, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.NETHER_WART, 22, 6, 30), new VillagerTrades.h(Items.EXPERIENCE_BOTTLE, 3, 1, 30)}))); + hashmap.put(VillagerProfession.ARMORER, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.COAL, 15, 8, 2), new VillagerTrades.h(new ItemStack(Items.IRON_LEGGINGS), 7, 1, 6, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_BOOTS), 4, 1, 6, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_HELMET), 5, 1, 6, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_CHESTPLATE), 9, 1, 6, 1, 0.2F)}, 2, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.IRON_INGOT, 4, 6, 10), new VillagerTrades.h(new ItemStack(Items.pP), 36, 1, 6, 5, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_BOOTS), 1, 1, 6, 5, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_LEGGINGS), 3, 1, 6, 5, 0.2F)}, 3, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.b(Items.LAVA_BUCKET, 1, 6, 20), new VillagerTrades.b(Items.DIAMOND, 1, 6, 20), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_HELMET), 1, 1, 6, 10, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_CHESTPLATE), 4, 1, 6, 10, 0.2F), new VillagerTrades.h(new ItemStack(Items.SHIELD), 5, 1, 6, 10, 0.2F)}, 4, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.e(Items.DIAMOND_LEGGINGS, 14, 2, 15, 0.2F), new VillagerTrades.e(Items.DIAMOND_BOOTS, 8, 2, 15, 0.2F)}, 5, new VillagerTrades.IMerchantRecipeOption[] { new VillagerTrades.e(Items.DIAMOND_HELMET, 8, 2, 30, 0.2F), new VillagerTrades.e(Items.DIAMOND_CHESTPLATE, 16, 2, 30, 0.2F)}))); +@@ -89,6 +89,7 @@ public class VillagerTrades { + @Override + public MerchantRecipe a(Entity entity, Random random) { + World world = entity.world; ++ if (!world.paperConfig.enableTreasureMaps) return null; //Paper + BlockPosition blockposition = world.a(this.b, new BlockPosition(entity), 100, true); + + if (blockposition != null) { +-- +2.21.0 + diff --git a/Spigot-Server-Patches/0135-Chunk-registration-fixes.patch b/Spigot-Server-Patches/0135-Chunk-registration-fixes.patch deleted file mode 100644 index 2fc6ba3cca..0000000000 --- a/Spigot-Server-Patches/0135-Chunk-registration-fixes.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 3b58205c29904e995b9ea750ec5d41de9427897b 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 336e6aeef6..282d6ae84c 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -1473,7 +1473,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc - } - - i = MathHelper.floor(entity.locX / 16.0D); -- j = MathHelper.floor(entity.locY / 16.0D); -+ j = Math.min(15, Math.max(0, MathHelper.floor(entity.locY / 16.0D))); // Paper - stay consistent with chunk add/remove behavior - int k = MathHelper.floor(entity.locZ / 16.0D); - - if (!entity.inChunk || entity.chunkX != i || entity.chunkY != j || entity.chunkZ != k) { --- -2.21.0 - diff --git a/Spigot-Server-Patches/0155-Optimize-ItemStack.isEmpty.patch b/Spigot-Server-Patches/0135-Optimize-ItemStack.isEmpty.patch similarity index 83% rename from Spigot-Server-Patches/0155-Optimize-ItemStack.isEmpty.patch rename to Spigot-Server-Patches/0135-Optimize-ItemStack.isEmpty.patch index 60be2dc9ef..3f5ceb1cf1 100644 --- a/Spigot-Server-Patches/0155-Optimize-ItemStack.isEmpty.patch +++ b/Spigot-Server-Patches/0135-Optimize-ItemStack.isEmpty.patch @@ -1,4 +1,4 @@ -From 853a5b33b53b85bff4fe55e2b8f50e68b1d044e2 Mon Sep 17 00:00:00 2001 +From 1d88861a7a12606b16577ab0926d5a0df1e17af4 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 21 Dec 2016 03:48:29 -0500 Subject: [PATCH] Optimize ItemStack.isEmpty() @@ -6,10 +6,10 @@ Subject: [PATCH] Optimize ItemStack.isEmpty() Remove hashMap lookup every check, simplify code to remove ternary diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 37d37f1f64..927394333a 100644 +index b643a4123..b7d327211 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java -@@ -151,7 +151,7 @@ public final class ItemStack { +@@ -145,7 +145,7 @@ public final class ItemStack { } public boolean isEmpty() { diff --git a/Spigot-Server-Patches/0156-Add-API-methods-to-control-if-armour-stands-can-move.patch b/Spigot-Server-Patches/0136-Add-API-methods-to-control-if-armour-stands-can-move.patch similarity index 72% rename from Spigot-Server-Patches/0156-Add-API-methods-to-control-if-armour-stands-can-move.patch rename to Spigot-Server-Patches/0136-Add-API-methods-to-control-if-armour-stands-can-move.patch index dce19231fe..44719111b9 100644 --- a/Spigot-Server-Patches/0156-Add-API-methods-to-control-if-armour-stands-can-move.patch +++ b/Spigot-Server-Patches/0136-Add-API-methods-to-control-if-armour-stands-can-move.patch @@ -1,37 +1,37 @@ -From 80e8e20cd171794077cc488a21f686a4e586fbd3 Mon Sep 17 00:00:00 2001 +From 63c3ad6f835f1e17f8cc069274d67b20ef43ec86 Mon Sep 17 00:00:00 2001 From: kashike Date: Wed, 21 Dec 2016 11:47:25 -0600 Subject: [PATCH] Add API methods to control if armour stands can move diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index cdbc82bf9e..b570882340 100644 +index 823041f06..8c6a9ec68 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java -@@ -44,6 +44,7 @@ public class EntityArmorStand extends EntityLiving { +@@ -43,6 +43,7 @@ public class EntityArmorStand extends EntityLiving { public Vector3f rightArmPose; public Vector3f leftLegPose; public Vector3f rightLegPose; + public boolean canMove = true; // Paper - public EntityArmorStand(World world) { - super(EntityTypes.ARMOR_STAND, world); -@@ -754,4 +755,13 @@ public class EntityArmorStand extends EntityLiving { - public boolean df() { - return false; + public EntityArmorStand(EntityTypes entitytypes, World world) { + super(entitytypes, world); +@@ -788,4 +789,13 @@ public class EntityArmorStand extends EntityLiving { + + return this.getEntityType().j().a(f); } + + // Paper start + @Override -+ public void move(EnumMoveType moveType, double x, double y, double z) { ++ public void move(EnumMoveType moveType, Vec3D vec3d) { + if (this.canMove) { -+ super.move(moveType, x, y, z); ++ super.move(moveType, vec3d); + } + } + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java -index 2b66a08ade..124c3185bc 100644 +index 2b66a08ad..124c3185b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java @@ -211,4 +211,16 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand { diff --git a/Spigot-Server-Patches/0157-Properly-fix-item-duplication-bug.patch b/Spigot-Server-Patches/0137-Properly-fix-item-duplication-bug.patch similarity index 80% rename from Spigot-Server-Patches/0157-Properly-fix-item-duplication-bug.patch rename to Spigot-Server-Patches/0137-Properly-fix-item-duplication-bug.patch index 112759ad4f..f00fb82c06 100644 --- a/Spigot-Server-Patches/0157-Properly-fix-item-duplication-bug.patch +++ b/Spigot-Server-Patches/0137-Properly-fix-item-duplication-bug.patch @@ -1,4 +1,4 @@ -From cc45f36d257d5838e9293dd0bd31353bf3950949 Mon Sep 17 00:00:00 2001 +From 7e001c26638d91d2ec6eb0e510684b4284e0181f Mon Sep 17 00:00:00 2001 From: Alfie Cleveland Date: Tue, 27 Dec 2016 01:57:57 +0000 Subject: [PATCH] Properly fix item duplication bug @@ -6,10 +6,10 @@ Subject: [PATCH] Properly fix item duplication bug Credit to prplz for figuring out the real issue diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 6b9bbc77c0..e4e1d999e9 100644 +index ecdfd306b..27ade8d7d 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -1567,7 +1567,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1769,7 +1769,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @Override protected boolean isFrozen() { @@ -19,10 +19,10 @@ index 6b9bbc77c0..e4e1d999e9 100644 @Override diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 4a06527b6f..1c4842a263 100644 +index 982b15dec..6874563e4 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -2485,7 +2485,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -2541,7 +2541,7 @@ public class PlayerConnection implements PacketListenerPlayIn { } public final boolean isDisconnected() { @@ -30,7 +30,7 @@ index 4a06527b6f..1c4842a263 100644 + return (!this.player.joining && !this.networkManager.isConnected()) || this.processedDisconnect; // Paper } // CraftBukkit end - } + -- 2.21.0 diff --git a/Spigot-Server-Patches/0158-String-based-Action-Bar-API.patch b/Spigot-Server-Patches/0138-String-based-Action-Bar-API.patch similarity index 92% rename from Spigot-Server-Patches/0158-String-based-Action-Bar-API.patch rename to Spigot-Server-Patches/0138-String-based-Action-Bar-API.patch index a7f0f041d6..fea147ab9a 100644 --- a/Spigot-Server-Patches/0158-String-based-Action-Bar-API.patch +++ b/Spigot-Server-Patches/0138-String-based-Action-Bar-API.patch @@ -1,11 +1,11 @@ -From d4a4bb2f503564a74e49d7640f1273c1977cd253 Mon Sep 17 00:00:00 2001 +From f333f65aab67ab8c458cf23bdf17639f475fce50 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 27 Dec 2016 15:02:42 -0500 Subject: [PATCH] String based Action Bar API diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index c97e116aaf..e1af5c4885 100644 +index c97e116aa..e1af5c488 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -2,6 +2,7 @@ package net.minecraft.server; @@ -42,10 +42,10 @@ index c97e116aaf..e1af5c4885 100644 public static boolean isMainThread() { return MinecraftServer.getServer().isMainThread(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 59bfcce68d..c5f2284553 100644 +index 4e12b6406..0b0053207 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -207,6 +207,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -212,6 +212,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // Paper start diff --git a/Spigot-Server-Patches/0159-Firework-API-s.patch b/Spigot-Server-Patches/0139-Firework-API-s.patch similarity index 55% rename from Spigot-Server-Patches/0159-Firework-API-s.patch rename to Spigot-Server-Patches/0139-Firework-API-s.patch index 4f26ec4b84..488d357bc6 100644 --- a/Spigot-Server-Patches/0159-Firework-API-s.patch +++ b/Spigot-Server-Patches/0139-Firework-API-s.patch @@ -1,116 +1,120 @@ -From 9432bcdfe213cdd8fa3b301413db8e7b0bae3b3b Mon Sep 17 00:00:00 2001 +From 98eddee130ce845f97aadda24a463864fa004b97 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 28 Dec 2016 01:18:33 -0500 Subject: [PATCH] Firework API's diff --git a/src/main/java/net/minecraft/server/EntityFireworks.java b/src/main/java/net/minecraft/server/EntityFireworks.java -index 9b6d217df8..9764c76fba 100644 +index d6bde129e..5cee161b6 100644 --- a/src/main/java/net/minecraft/server/EntityFireworks.java +++ b/src/main/java/net/minecraft/server/EntityFireworks.java -@@ -2,6 +2,8 @@ package net.minecraft.server; - +@@ -3,6 +3,8 @@ package net.minecraft.server; import java.util.Iterator; import java.util.List; + import java.util.OptionalInt; +import java.util.UUID; + import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit - public class EntityFireworks extends Entity { -@@ -10,7 +12,8 @@ public class EntityFireworks extends Entity { - private static final DataWatcherObject b = DataWatcher.a(EntityFireworks.class, DataWatcherRegistry.b); + public class EntityFireworks extends Entity implements IProjectile { +@@ -12,7 +14,8 @@ public class EntityFireworks extends Entity implements IProjectile { + private static final DataWatcherObject d = DataWatcher.a(EntityFireworks.class, DataWatcherRegistry.i); private int ticksFlown; public int expectedLifespan; -- private EntityLiving e; +- private EntityLiving ridingEntity; ++ private EntityLiving ridingEntity; public final EntityLiving getBoostedEntity() { return this.ridingEntity; } // Paper - OBFHELPER + public UUID spawningEntity; // Paper -+ private EntityLiving e;public EntityLiving getBoostedEntity() { return e; } // Paper - OBFHELPER - public EntityFireworks(World world) { - super(EntityTypes.FIREWORK_ROCKET, world); -@@ -197,6 +200,12 @@ public class EntityFireworks extends Entity { - nbttagcompound.set("FireworksItem", itemstack.save(new NBTTagCompound())); + public EntityFireworks(EntityTypes entitytypes, World world) { + super(entitytypes, world); +@@ -255,6 +258,11 @@ public class EntityFireworks extends Entity implements IProjectile { } + nbttagcompound.setBoolean("ShotAtAngle", (Boolean) this.datawatcher.get(EntityFireworks.d)); + // Paper start -+ if (spawningEntity != null) { -+ nbttagcompound.setUUID("SpawningEntity", spawningEntity); ++ if (this.spawningEntity != null) { ++ nbttagcompound.setUUID("SpawningEntity", this.spawningEntity); + } + // Paper end -+ } - public void a(NBTTagCompound nbttagcompound) { -@@ -207,7 +216,11 @@ public class EntityFireworks extends Entity { - if (!itemstack.isEmpty()) { - this.datawatcher.set(EntityFireworks.FIREWORK_ITEM, itemstack); + @Override +@@ -270,7 +278,11 @@ public class EntityFireworks extends Entity implements IProjectile { + if (nbttagcompound.hasKey("ShotAtAngle")) { + this.datawatcher.set(EntityFireworks.d, nbttagcompound.getBoolean("ShotAtAngle")); } - + // Paper start + if (nbttagcompound.hasUUID("SpawningEntity")) { -+ spawningEntity = nbttagcompound.getUUID("SpawningEntity"); ++ this.spawningEntity = nbttagcompound.getUUID("SpawningEntity"); + } + // Paper end } - public boolean bk() { + @Override diff --git a/src/main/java/net/minecraft/server/ItemFireworks.java b/src/main/java/net/minecraft/server/ItemFireworks.java -index 68bd2af261..dbb422e9da 100644 +index 37caa79cb..aea46ffae 100644 --- a/src/main/java/net/minecraft/server/ItemFireworks.java +++ b/src/main/java/net/minecraft/server/ItemFireworks.java -@@ -16,6 +16,7 @@ public class ItemFireworks extends Item { - BlockPosition blockposition = itemactioncontext.getClickPosition(); +@@ -17,6 +17,7 @@ public class ItemFireworks extends Item { ItemStack itemstack = itemactioncontext.getItemStack(); - EntityFireworks entityfireworks = new EntityFireworks(world, (double) ((float) blockposition.getX() + itemactioncontext.m()), (double) ((float) blockposition.getY() + itemactioncontext.n()), (double) ((float) blockposition.getZ() + itemactioncontext.o()), itemstack); -+ entityfireworks.spawningEntity = itemactioncontext.b.getUniqueID(); // Paper + Vec3D vec3d = itemactioncontext.j(); + EntityFireworks entityfireworks = new EntityFireworks(world, vec3d.x, vec3d.y, vec3d.z, itemstack); ++ entityfireworks.spawningEntity = itemactioncontext.getEntity().getUniqueID(); // Paper world.addEntity(entityfireworks); itemstack.subtract(1); -@@ -30,6 +31,7 @@ public class ItemFireworks extends Item { +@@ -31,7 +32,11 @@ public class ItemFireworks extends Item { + ItemStack itemstack = entityhuman.b(enumhand); if (!world.isClientSide) { - EntityFireworks entityfireworks = new EntityFireworks(world, itemstack, entityhuman); -+ entityfireworks.spawningEntity = entityhuman.getUniqueID(); // Paper - - world.addEntity(entityfireworks); +- world.addEntity(new EntityFireworks(world, itemstack, entityhuman)); ++ // Paper start ++ final EntityFireworks entityfireworks = new EntityFireworks(world, itemstack, entityhuman); ++ entityfireworks.spawningEntity = entityhuman.getUniqueID(); ++ world.addEntity(entityfireworks); ++ // Paper end if (!entityhuman.abilities.canInstantlyBuild) { + itemstack.subtract(1); + } diff --git a/src/main/java/net/minecraft/server/NBTTagCompound.java b/src/main/java/net/minecraft/server/NBTTagCompound.java -index 8c5d6c1d38..d4165f7e44 100644 +index 3f6d2676e..b1fd18151 100644 --- a/src/main/java/net/minecraft/server/NBTTagCompound.java +++ b/src/main/java/net/minecraft/server/NBTTagCompound.java -@@ -107,7 +107,7 @@ public class NBTTagCompound implements NBTBase { +@@ -112,7 +112,7 @@ public class NBTTagCompound implements NBTBase { return new UUID(this.getLong(s + "Most"), this.getLong(s + "Least")); } - public boolean b(String s) { -+ public boolean hasUUID(String s) { return b(s); } public boolean b(String s) { // Paper - OBFHELPER ++ public final boolean hasUUID(String s) { return this.b(s); } public boolean b(String s) { // Paper - OBFHELPER return this.hasKeyOfType(s + "Most", 99) && this.hasKeyOfType(s + "Least", 99); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java -index 7b3b206823..b39e33f4f0 100644 +index 6b69be742..37374ae5b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java -@@ -1,6 +1,7 @@ - package org.bukkit.craftbukkit.entity; +@@ -2,6 +2,7 @@ package org.bukkit.craftbukkit.entity; + import java.util.Random; import net.minecraft.server.EntityFireworks; +import net.minecraft.server.EntityLiving; import net.minecraft.server.ItemStack; import net.minecraft.server.Items; - -@@ -9,9 +10,11 @@ import org.bukkit.craftbukkit.CraftServer; + import org.bukkit.Material; +@@ -9,8 +10,11 @@ import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.entity.EntityType; import org.bukkit.entity.Firework; +import org.bukkit.entity.LivingEntity; import org.bukkit.inventory.meta.FireworkMeta; - import java.util.Random; +import java.util.UUID; - ++ public class CraftFirework extends CraftEntity implements Firework { -@@ -70,4 +73,18 @@ public class CraftFirework extends CraftEntity implements Firework { + private final Random random = new Random(); +@@ -68,4 +72,18 @@ public class CraftFirework extends CraftEntity implements Firework { public void detonate() { getHandle().expectedLifespan = 0; } diff --git a/Spigot-Server-Patches/0160-PlayerTeleportEndGatewayEvent.patch b/Spigot-Server-Patches/0140-PlayerTeleportEndGatewayEvent.patch similarity index 88% rename from Spigot-Server-Patches/0160-PlayerTeleportEndGatewayEvent.patch rename to Spigot-Server-Patches/0140-PlayerTeleportEndGatewayEvent.patch index c30721dbb2..5be45a49f5 100644 --- a/Spigot-Server-Patches/0160-PlayerTeleportEndGatewayEvent.patch +++ b/Spigot-Server-Patches/0140-PlayerTeleportEndGatewayEvent.patch @@ -1,4 +1,4 @@ -From 656d256bb375706e0843d0c2ddf0843c7c9a358a Mon Sep 17 00:00:00 2001 +From 0bb363ae5e65babf767f8a9229010c5681c11568 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 31 Dec 2016 21:44:50 -0500 Subject: [PATCH] PlayerTeleportEndGatewayEvent @@ -6,10 +6,10 @@ Subject: [PATCH] PlayerTeleportEndGatewayEvent Allows you to access the Gateway being used in a teleport event diff --git a/src/main/java/net/minecraft/server/TileEntityEndGateway.java b/src/main/java/net/minecraft/server/TileEntityEndGateway.java -index a7efe5664a..d2b29ecbe0 100644 +index bfc147059..5dd670615 100644 --- a/src/main/java/net/minecraft/server/TileEntityEndGateway.java +++ b/src/main/java/net/minecraft/server/TileEntityEndGateway.java -@@ -126,7 +126,7 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick +@@ -132,7 +132,7 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick location.setPitch(player.getLocation().getPitch()); location.setYaw(player.getLocation().getYaw()); diff --git a/Spigot-Server-Patches/0162-Provide-E-TE-Chunk-count-stat-methods.patch b/Spigot-Server-Patches/0141-Provide-E-TE-Chunk-count-stat-methods.patch similarity index 85% rename from Spigot-Server-Patches/0162-Provide-E-TE-Chunk-count-stat-methods.patch rename to Spigot-Server-Patches/0141-Provide-E-TE-Chunk-count-stat-methods.patch index f47ae991f5..07decbbb95 100644 --- a/Spigot-Server-Patches/0162-Provide-E-TE-Chunk-count-stat-methods.patch +++ b/Spigot-Server-Patches/0141-Provide-E-TE-Chunk-count-stat-methods.patch @@ -1,4 +1,4 @@ -From c2d5c09d75edae0d2352770fcbd4cb9ca21cf714 Mon Sep 17 00:00:00 2001 +From 0e3a58ce27f0f4622708b7a49ce885158b9420f2 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 7 Jan 2017 15:24:46 -0500 Subject: [PATCH] Provide E/TE/Chunk count stat methods @@ -7,12 +7,12 @@ Provides counts without the ineffeciency of using .getEntities().size() which creates copy of the collections. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index f7883e7085..010c5fc731 100644 +index 90b87bb01..3c7f62fc5 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -88,6 +88,29 @@ public class CraftWorld implements World { - private int chunkLoadCount = 0; - private int chunkGCTickCount; +@@ -264,6 +264,29 @@ public class CraftWorld implements World { + private int waterAnimalSpawn = -1; + private int ambientSpawn = -1; + // Paper start - Provide fast information methods + public int getEntityCount() { diff --git a/Spigot-Server-Patches/0163-Enforce-Sync-Player-Saves.patch b/Spigot-Server-Patches/0142-Enforce-Sync-Player-Saves.patch similarity index 59% rename from Spigot-Server-Patches/0163-Enforce-Sync-Player-Saves.patch rename to Spigot-Server-Patches/0142-Enforce-Sync-Player-Saves.patch index 7465108da9..7af6c2fe05 100644 --- a/Spigot-Server-Patches/0163-Enforce-Sync-Player-Saves.patch +++ b/Spigot-Server-Patches/0142-Enforce-Sync-Player-Saves.patch @@ -1,4 +1,4 @@ -From 6dac784f4401b784add8dd0703128ff13c4ae288 Mon Sep 17 00:00:00 2001 +From 7775e6a4b54fa6fed95237091b82abbb736158c0 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 7 Jan 2017 15:41:58 -0500 Subject: [PATCH] Enforce Sync Player Saves @@ -7,25 +7,23 @@ Saving players async is extremely dangerous. This will force it to main the same way we handle async chunk loads. diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index fe6649224a..9570a8800b 100644 +index 7003c4a93..a1659e6a2 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -1214,6 +1214,7 @@ public abstract class PlayerList { +@@ -927,11 +927,13 @@ public abstract class PlayerList { } - public void savePlayers(Integer interval) { -+ MCUtil.ensureMain("Save Players", () -> { // Paper - ensure main - long now = MinecraftServer.currentTick; + public void savePlayers() { ++ MCUtil.ensureMain("Save Players" , () -> { // Paper - Ensure main MinecraftTimings.savePlayers.startTiming(); // Paper - int numSaved = 0; // Paper -@@ -1225,6 +1226,7 @@ public abstract class PlayerList { - } + for (int i = 0; i < this.players.size(); ++i) { + this.savePlayerFile((EntityPlayer) this.players.get(i)); } MinecraftTimings.savePlayers.stopTiming(); // Paper + return null; }); // Paper - ensure main } - // Paper end + public WhiteList getWhitelist() { -- 2.21.0 diff --git a/Spigot-Server-Patches/0165-Don-t-allow-entities-to-ride-themselves-572.patch b/Spigot-Server-Patches/0143-Don-t-allow-entities-to-ride-themselves-572.patch similarity index 82% rename from Spigot-Server-Patches/0165-Don-t-allow-entities-to-ride-themselves-572.patch rename to Spigot-Server-Patches/0143-Don-t-allow-entities-to-ride-themselves-572.patch index 8d50715447..590754590b 100644 --- a/Spigot-Server-Patches/0165-Don-t-allow-entities-to-ride-themselves-572.patch +++ b/Spigot-Server-Patches/0143-Don-t-allow-entities-to-ride-themselves-572.patch @@ -1,14 +1,14 @@ -From 9e46153783206330175be6c33c41155fbd865d16 Mon Sep 17 00:00:00 2001 +From ef810037b85957693112a707cc2c2983c4678a46 Mon Sep 17 00:00:00 2001 From: Alfie Cleveland Date: Sun, 8 Jan 2017 04:31:36 +0000 Subject: [PATCH] Don't allow entities to ride themselves - #572 diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index b6ed9082fd..80ff428656 100644 +index cbdc267fa..3fd560027 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2094,6 +2094,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1980,6 +1980,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } protected boolean addPassenger(Entity entity) { // CraftBukkit diff --git a/Spigot-Server-Patches/0166-Fix-block-break-desync.patch b/Spigot-Server-Patches/0144-Fix-block-break-desync.patch similarity index 82% rename from Spigot-Server-Patches/0166-Fix-block-break-desync.patch rename to Spigot-Server-Patches/0144-Fix-block-break-desync.patch index c9f7e09cbe..bbd50e2c11 100644 --- a/Spigot-Server-Patches/0166-Fix-block-break-desync.patch +++ b/Spigot-Server-Patches/0144-Fix-block-break-desync.patch @@ -1,14 +1,14 @@ -From 5ae8df3009225b24837b764e02db1f24fd6ad265 Mon Sep 17 00:00:00 2001 +From ac742bd2ace2f239eefa33afb4f7cced59f3680e Mon Sep 17 00:00:00 2001 From: Michael Himing Date: Sun, 8 Jan 2017 18:50:35 +1100 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 1c4842a263..05cc5afea6 100644 +index 6874563e4..37caa2a70 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1136,6 +1136,8 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -1176,6 +1176,8 @@ public class PlayerConnection implements PacketListenerPlayIn { double d3 = d0 * d0 + d1 * d1 + d2 * d2; if (d3 > 36.0D) { diff --git a/Spigot-Server-Patches/0167-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch b/Spigot-Server-Patches/0145-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch similarity index 63% rename from Spigot-Server-Patches/0167-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch rename to Spigot-Server-Patches/0145-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch index 2339dd351c..0d2a7eb104 100644 --- a/Spigot-Server-Patches/0167-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch +++ b/Spigot-Server-Patches/0145-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch @@ -1,4 +1,4 @@ -From 8ca07b6a51fa3b4c31456f4a0363422607a712d5 Mon Sep 17 00:00:00 2001 +From 9716d2455797ed8b3dad7d75f7b6e0cd3c0d1f98 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 19 Dec 2017 16:31:46 -0500 Subject: [PATCH] ExperienceOrbs API for Reason/Source/Triggering player @@ -8,10 +8,10 @@ Adds lots of information about why this orb exists. Replaces isFromBottle() with logic that persists entity reloads too. diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java -index 1dc13fcc30..c674aa13d8 100644 +index fd23d4534..69e65ea6c 100644 --- a/src/main/java/net/minecraft/server/Block.java +++ b/src/main/java/net/minecraft/server/Block.java -@@ -450,13 +450,13 @@ public class Block implements IMaterial { +@@ -504,13 +504,13 @@ public class Block implements IMaterial { } } @@ -27,11 +27,24 @@ index 1dc13fcc30..c674aa13d8 100644 } } +diff --git a/src/main/java/net/minecraft/server/ContainerGrindstone.java b/src/main/java/net/minecraft/server/ContainerGrindstone.java +index 2e4f81ebe..88b9655bb 100644 +--- a/src/main/java/net/minecraft/server/ContainerGrindstone.java ++++ b/src/main/java/net/minecraft/server/ContainerGrindstone.java +@@ -81,7 +81,7 @@ public class ContainerGrindstone extends Container { + int k = EntityExperienceOrb.getOrbValue(j); + + j -= k; +- world.addEntity(new EntityExperienceOrb(world, (double) blockposition.getX(), (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, k)); ++ world.addEntity(new EntityExperienceOrb(world, (double) blockposition.getX(), (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, k, org.bukkit.entity.ExperienceOrb.SpawnReason.GRINDSTONE, entityhuman)); // Paper + } + + world.triggerEffect(1042, blockposition, 0); diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java -index b3fbc8249e..79d8be8d46 100644 +index bfdb63094..3a6ae654c 100644 --- a/src/main/java/net/minecraft/server/EntityEnderDragon.java +++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java -@@ -618,7 +618,7 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo +@@ -602,7 +602,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { int j = EntityExperienceOrb.getOrbValue(i); i -= j; @@ -41,10 +54,10 @@ index b3fbc8249e..79d8be8d46 100644 } diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -index 3030dd9c31..404a222b45 100644 +index bfba08fb2..49668f2c2 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -@@ -15,9 +15,59 @@ public class EntityExperienceOrb extends Entity { +@@ -16,9 +16,59 @@ public class EntityExperienceOrb extends Entity { public int value; private EntityHuman targetPlayer; private int targetTime; @@ -67,7 +80,7 @@ index 3030dd9c31..404a222b45 100644 + if (comp.hasKey("reason")) { + String reason = comp.getString("reason"); + try { -+ spawnReason = org.bukkit.entity.ExperienceOrb.SpawnReason.valueOf(reason); ++ this.spawnReason = org.bukkit.entity.ExperienceOrb.SpawnReason.valueOf(reason); + } catch (Exception e) { + this.world.getServer().getLogger().warning("Invalid spawnReason set for experience orb: " + e.getMessage() + " - " + reason); + } @@ -75,14 +88,14 @@ index 3030dd9c31..404a222b45 100644 + } + private void savePaperNBT(NBTTagCompound nbttagcompound) { + NBTTagCompound comp = new NBTTagCompound(); -+ if (sourceEntityId != null) { -+ comp.setUUID("source", sourceEntityId); ++ if (this.sourceEntityId != null) { ++ comp.setUUID("source", this.sourceEntityId); + } -+ if (triggerEntityId != null) { ++ if (this.triggerEntityId != null) { + comp.setUUID("trigger", triggerEntityId); + } -+ if (spawnReason != null && spawnReason != org.bukkit.entity.ExperienceOrb.SpawnReason.UNKNOWN) { -+ comp.setString("reason", spawnReason.name()); ++ if (this.spawnReason != null && this.spawnReason != org.bukkit.entity.ExperienceOrb.SpawnReason.UNKNOWN) { ++ comp.setString("reason", this.spawnReason.name()); + } + nbttagcompound.set("Paper.ExpData", comp); + } @@ -96,34 +109,35 @@ index 3030dd9c31..404a222b45 100644 + } + + public EntityExperienceOrb(World world, double d0, double d1, double d2, int i, org.bukkit.entity.ExperienceOrb.SpawnReason reason, Entity triggerId, Entity sourceId) { - super(EntityTypes.EXPERIENCE_ORB, world); + this(EntityTypes.EXPERIENCE_ORB, world); + this.sourceEntityId = sourceId != null ? sourceId.getUniqueID() : null; + this.triggerEntityId = triggerId != null ? triggerId.getUniqueID() : null; + this.spawnReason = reason != null ? reason : org.bukkit.entity.ExperienceOrb.SpawnReason.UNKNOWN; + // Paper end - this.setSize(0.5F, 0.5F); this.setPosition(d0, d1, d2); - this.yaw = (float) (Math.random() * 360.0D); -@@ -156,12 +206,14 @@ public class EntityExperienceOrb extends Entity { - nbttagcompound.setShort("Health", (short) this.d); - nbttagcompound.setShort("Age", (short) this.b); + this.yaw = (float) (this.random.nextDouble() * 360.0D); + this.setMot((this.random.nextDouble() * 0.20000000298023224D - 0.10000000149011612D) * 2.0D, this.random.nextDouble() * 0.2D * 2.0D, (this.random.nextDouble() * 0.20000000298023224D - 0.10000000149011612D) * 2.0D); +@@ -155,6 +205,7 @@ public class EntityExperienceOrb extends Entity { + nbttagcompound.setShort("Health", (short) this.e); + nbttagcompound.setShort("Age", (short) this.c); nbttagcompound.setShort("Value", (short) this.value); -+ savePaperNBT(nbttagcompound); // Paper ++ this.savePaperNBT(nbttagcompound); // Paper } - public void a(NBTTagCompound nbttagcompound) { - this.d = nbttagcompound.getShort("Health"); - this.b = nbttagcompound.getShort("Age"); + @Override +@@ -162,6 +213,7 @@ public class EntityExperienceOrb extends Entity { + this.e = nbttagcompound.getShort("Health"); + this.c = nbttagcompound.getShort("Age"); this.value = nbttagcompound.getShort("Value"); -+ loadPaperNBT(nbttagcompound); // Paper ++ this.loadPaperNBT(nbttagcompound); // Paper } - public void d(EntityHuman entityhuman) { + @Override diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java -index 202b8d2158..ee71c326ae 100644 +index 78527f350..03f782d4b 100644 --- a/src/main/java/net/minecraft/server/EntityFishingHook.java +++ b/src/main/java/net/minecraft/server/EntityFishingHook.java -@@ -468,7 +468,7 @@ public class EntityFishingHook extends Entity { +@@ -404,7 +404,7 @@ public class EntityFishingHook extends Entity { this.world.addEntity(entityitem); // CraftBukkit start - this.random.nextInt(6) + 1 -> playerFishEvent.getExpToDrop() if (playerFishEvent.getExpToDrop() > 0) { @@ -133,10 +147,10 @@ index 202b8d2158..ee71c326ae 100644 // CraftBukkit end if (itemstack1.getItem().a(TagsItem.FISHES)) { diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index c0ef0c51f1..3bc1f8f9b5 100644 +index 780287f91..014404ade 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -354,7 +354,8 @@ public abstract class EntityLiving extends Entity { +@@ -381,7 +381,8 @@ public abstract class EntityLiving extends Entity { int j = EntityExperienceOrb.getOrbValue(i); i -= j; @@ -147,10 +161,10 @@ index c0ef0c51f1..3bc1f8f9b5 100644 this.expToDrop = 0; // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/EntityThrownExpBottle.java b/src/main/java/net/minecraft/server/EntityThrownExpBottle.java -index a5e1939e05..e73dba09a6 100644 +index 77dd4c99a..398b499bb 100644 --- a/src/main/java/net/minecraft/server/EntityThrownExpBottle.java +++ b/src/main/java/net/minecraft/server/EntityThrownExpBottle.java -@@ -36,7 +36,7 @@ public class EntityThrownExpBottle extends EntityProjectile { +@@ -43,7 +43,7 @@ public class EntityThrownExpBottle extends EntityProjectileThrowable { int j = EntityExperienceOrb.getOrbValue(i); i -= j; @@ -159,24 +173,50 @@ index a5e1939e05..e73dba09a6 100644 } this.die(); +diff --git a/src/main/java/net/minecraft/server/EntityTurtle.java b/src/main/java/net/minecraft/server/EntityTurtle.java +index 7c6506a91..1b4933c07 100644 +--- a/src/main/java/net/minecraft/server/EntityTurtle.java ++++ b/src/main/java/net/minecraft/server/EntityTurtle.java +@@ -512,7 +512,7 @@ public class EntityTurtle extends EntityAnimal { + Random random = this.animal.getRandom(); + + if (this.b.getGameRules().getBoolean("doMobLoot")) { +- this.b.addEntity(new EntityExperienceOrb(this.b, this.animal.locX, this.animal.locY, this.animal.locZ, random.nextInt(7) + 1)); ++ this.b.addEntity(new EntityExperienceOrb(this.b, this.animal.locX, this.animal.locY, this.animal.locZ, random.nextInt(7) + 1, org.bukkit.entity.ExperienceOrb.SpawnReason.BREED, entityplayer)); // Paper + } + + } diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index ebe397b15a..78acac4ca7 100644 +index c34868324..bc04086d7 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java -@@ -412,7 +412,7 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant { +@@ -421,7 +421,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation } - if (merchantrecipe.j()) { + if (merchantrecipe.q()) { - this.world.addEntity(new EntityExperienceOrb(this.world, this.locX, this.locY + 0.5D, this.locZ, i)); -+ this.world.addEntity(new EntityExperienceOrb(this.world, this.locX, this.locY + 0.5D, this.locZ, i, org.bukkit.entity.ExperienceOrb.SpawnReason.VILLAGER_TRADE, tradingPlayer, this)); // Paper ++ this.world.addEntity(new EntityExperienceOrb(this.world, this.locX, this.locY + 0.5D, this.locZ, i, org.bukkit.entity.ExperienceOrb.SpawnReason.VILLAGER_TRADE, this.getTrader(), this)); // Paper } - if (this.tradingPlayer instanceof EntityPlayer) { + } +diff --git a/src/main/java/net/minecraft/server/EntityVillagerTrader.java b/src/main/java/net/minecraft/server/EntityVillagerTrader.java +index 1d612d828..002ff8880 100644 +--- a/src/main/java/net/minecraft/server/EntityVillagerTrader.java ++++ b/src/main/java/net/minecraft/server/EntityVillagerTrader.java +@@ -147,7 +147,7 @@ public class EntityVillagerTrader extends EntityVillagerAbstract { + if (merchantrecipe.q()) { + int i = 3 + this.random.nextInt(4); + +- this.world.addEntity(new EntityExperienceOrb(this.world, this.locX, this.locY + 0.5D, this.locZ, i)); ++ this.world.addEntity(new EntityExperienceOrb(this.world, this.locX, this.locY + 0.5D, this.locZ, i, org.bukkit.entity.ExperienceOrb.SpawnReason.VILLAGER_TRADE, this.getTrader(), this)); // Paper + } + + } diff --git a/src/main/java/net/minecraft/server/PathfinderGoalBreed.java b/src/main/java/net/minecraft/server/PathfinderGoalBreed.java -index bf061cf064..55f9787680 100644 +index d25a05736..9d0b1ffef 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalBreed.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalBreed.java -@@ -122,7 +122,7 @@ public class PathfinderGoalBreed extends PathfinderGoal { +@@ -117,7 +117,7 @@ public class PathfinderGoalBreed extends PathfinderGoal { if (this.b.getGameRules().getBoolean("doMobLoot")) { // CraftBukkit start - use event experience if (experience > 0) { @@ -186,10 +226,10 @@ index bf061cf064..55f9787680 100644 // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java -index 0baf0100c9..6ae6afa339 100644 +index 6e90f21ea..a7411c75a 100644 --- a/src/main/java/net/minecraft/server/PlayerInteractManager.java +++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java -@@ -391,7 +391,7 @@ public class PlayerInteractManager { +@@ -367,7 +367,7 @@ public class PlayerInteractManager { // CraftBukkit start - Drop event experience if (flag && event != null) { @@ -199,42 +239,46 @@ index 0baf0100c9..6ae6afa339 100644 // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/SlotFurnaceResult.java b/src/main/java/net/minecraft/server/SlotFurnaceResult.java -index 5ac554d65e..d70c4dda5a 100644 +index d2698e847..edc4a5c34 100644 --- a/src/main/java/net/minecraft/server/SlotFurnaceResult.java +++ b/src/main/java/net/minecraft/server/SlotFurnaceResult.java -@@ -9,7 +9,7 @@ import org.bukkit.event.inventory.FurnaceExtractEvent; +@@ -2,7 +2,7 @@ package net.minecraft.server; public class SlotFurnaceResult extends Slot { - private final EntityHuman a; -+ private final EntityHuman a;public EntityHuman getPlayer() { return a; } // Paper OBFHELPER ++ private final EntityHuman a; public final EntityHuman getPlayer() { return this.a; } // Paper OBFHELPER private int b; public SlotFurnaceResult(EntityHuman entityhuman, IInventory iinventory, int i, int j, int k) { -@@ -85,7 +85,7 @@ public class SlotFurnaceResult extends Slot { - while (i > 0) { - j = EntityExperienceOrb.getOrbValue(i); - i -= j; -- this.a.world.addEntity(new EntityExperienceOrb(this.a.world, this.a.locX, this.a.locY + 0.5D, this.a.locZ + 0.5D, j)); -+ this.a.world.addEntity(new EntityExperienceOrb(this.a.world, this.a.locX, this.a.locY + 0.5D, this.a.locZ + 0.5D, j, org.bukkit.entity.ExperienceOrb.SpawnReason.FURNACE, getPlayer())); // Paper - } - } +diff --git a/src/main/java/net/minecraft/server/TileEntityFurnace.java b/src/main/java/net/minecraft/server/TileEntityFurnace.java +index adb1a0913..be16fe9a9 100644 +--- a/src/main/java/net/minecraft/server/TileEntityFurnace.java ++++ b/src/main/java/net/minecraft/server/TileEntityFurnace.java +@@ -554,7 +554,7 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I + while (i > 0) { + j = EntityExperienceOrb.getOrbValue(i); + i -= j; +- entityhuman.world.addEntity(new EntityExperienceOrb(entityhuman.world, entityhuman.locX, entityhuman.locY + 0.5D, entityhuman.locZ + 0.5D, j)); ++ entityhuman.world.addEntity(new EntityExperienceOrb(entityhuman.world, entityhuman.locX, entityhuman.locY + 0.5D, entityhuman.locZ + 0.5D, j, org.bukkit.entity.ExperienceOrb.SpawnReason.FURNACE, entityhuman)); // Paper + } + } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 6718028190..d72f393a75 100644 +index 3c7f62fc5..3fbc48150 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1354,7 +1354,7 @@ public class CraftWorld implements World { +@@ -1540,7 +1540,7 @@ public class CraftWorld implements World { } else if (TNTPrimed.class.isAssignableFrom(clazz)) { entity = new EntityTNTPrimed(world, x, y, z, null); } else if (ExperienceOrb.class.isAssignableFrom(clazz)) { - entity = new EntityExperienceOrb(world, x, y, z, 0); + entity = new EntityExperienceOrb(world, x, y, z, 0, org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM, null, null); // Paper - } else if (Weather.class.isAssignableFrom(clazz)) { - // not sure what this can do - if (LightningStrike.class.isAssignableFrom(clazz)) { + } else if (LightningStrike.class.isAssignableFrom(clazz)) { + entity = new EntityLightning(world, x, y, z, false); + } else if (Firework.class.isAssignableFrom(clazz)) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java -index 3a09cab3d4..3302af0e45 100644 +index 3a09cab3d..3302af0e4 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java @@ -18,6 +18,18 @@ public class CraftExperienceOrb extends CraftEntity implements ExperienceOrb { diff --git a/Spigot-Server-Patches/0168-Cap-Entity-Collisions.patch b/Spigot-Server-Patches/0146-Cap-Entity-Collisions.patch similarity index 85% rename from Spigot-Server-Patches/0168-Cap-Entity-Collisions.patch rename to Spigot-Server-Patches/0146-Cap-Entity-Collisions.patch index 967a9835f0..a0521eaa08 100644 --- a/Spigot-Server-Patches/0168-Cap-Entity-Collisions.patch +++ b/Spigot-Server-Patches/0146-Cap-Entity-Collisions.patch @@ -1,4 +1,4 @@ -From fcb228cc399c4d659994a49376ae0a7bebe6a61d Mon Sep 17 00:00:00 2001 +From ff7027977adf0a4d6114e34fd1d7dc19fcdb2169 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 22 Jan 2017 18:07:56 -0500 Subject: [PATCH] Cap Entity Collisions @@ -12,10 +12,10 @@ just as it does in Vanilla, but entity pushing logic will be capped. You can set this to 0 to disable collisions. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 13f54e05ab..72eb530d7e 100644 +index 406bc611c..58fe5a8c4 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -369,4 +369,10 @@ public class PaperWorldConfig { +@@ -320,4 +320,10 @@ public class PaperWorldConfig { log("Treasure Maps will return already discovered locations"); } } @@ -27,10 +27,10 @@ index 13f54e05ab..72eb530d7e 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 80ff428656..291a304172 100644 +index 3fd560027..ee7fe30c7 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -182,6 +182,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -181,6 +181,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke public final boolean defaultActivationState; public long activatedTick = Integer.MIN_VALUE; public boolean fromMobSpawner; @@ -39,10 +39,10 @@ index 80ff428656..291a304172 100644 // Spigot end diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 3bc1f8f9b5..34fbf83621 100644 +index 014404ade..b0c9eda48 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -2355,8 +2355,11 @@ public abstract class EntityLiving extends Entity { +@@ -2553,8 +2553,11 @@ public abstract class EntityLiving extends Entity { } } @@ -53,7 +53,7 @@ index 3bc1f8f9b5..34fbf83621 100644 + entity.numCollisions++; // Paper + numCollisions++; // Paper - this.C(entity); + this.D(entity); } -- 2.21.0 diff --git a/Spigot-Server-Patches/0169-Remove-CraftScheduler-Async-Task-Debugger.patch b/Spigot-Server-Patches/0147-Remove-CraftScheduler-Async-Task-Debugger.patch similarity index 87% rename from Spigot-Server-Patches/0169-Remove-CraftScheduler-Async-Task-Debugger.patch rename to Spigot-Server-Patches/0147-Remove-CraftScheduler-Async-Task-Debugger.patch index 1923503eb9..c3d20e72d9 100644 --- a/Spigot-Server-Patches/0169-Remove-CraftScheduler-Async-Task-Debugger.patch +++ b/Spigot-Server-Patches/0147-Remove-CraftScheduler-Async-Task-Debugger.patch @@ -1,4 +1,4 @@ -From db940aa3927da56a0d8eb595198bd9c9341379cf Mon Sep 17 00:00:00 2001 +From 551d84659a7b941c757445155a784a02238d7122 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 5 Feb 2017 00:04:04 -0500 Subject: [PATCH] Remove CraftScheduler Async Task Debugger @@ -9,10 +9,10 @@ One report of a suspected memory leak with the system. This adds additional overhead to asynchronous task dispatching diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java -index 0e9d5fe3a7..3ef79e3e94 100644 +index 86a5ee8aa..36eecb670 100644 --- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java +++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java -@@ -412,7 +412,7 @@ public class CraftScheduler implements BukkitScheduler { +@@ -411,7 +411,7 @@ public class CraftScheduler implements BukkitScheduler { } parsePending(); } else { @@ -21,7 +21,7 @@ index 0e9d5fe3a7..3ef79e3e94 100644 executor.execute(new ServerSchedulerReportingWrapper(task)); // Paper // We don't need to parse pending // (async tasks must live with race-conditions if they attempt to cancel between these few lines of code) -@@ -429,7 +429,7 @@ public class CraftScheduler implements BukkitScheduler { +@@ -428,7 +428,7 @@ public class CraftScheduler implements BukkitScheduler { pending.addAll(temp); temp.clear(); MinecraftTimings.bukkitSchedulerFinishTimer.stopTiming(); @@ -30,7 +30,7 @@ index 0e9d5fe3a7..3ef79e3e94 100644 } private void addTask(final CraftTask task) { -@@ -489,10 +489,15 @@ public class CraftScheduler implements BukkitScheduler { +@@ -488,10 +488,15 @@ public class CraftScheduler implements BukkitScheduler { @Override public String toString() { diff --git a/Spigot-Server-Patches/0148-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch b/Spigot-Server-Patches/0148-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch new file mode 100644 index 0000000000..1c0d2da491 --- /dev/null +++ b/Spigot-Server-Patches/0148-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch @@ -0,0 +1,22 @@ +From ee00b8612da19fa628bc39473263d4bb4a124bf2 Mon Sep 17 00:00:00 2001 +From: Brokkonaut +Date: Tue, 7 Feb 2017 16:55:35 -0600 +Subject: [PATCH] Make targetSize more aggressive in the chunk unload queue + + +diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java +index be903252b..89a00ff8d 100644 +--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java ++++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java +@@ -314,7 +314,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + // Spigot start + org.spigotmc.SlackActivityAccountant activityAccountant = this.world.getMinecraftServer().slackActivityAccountant; + activityAccountant.startActivity(0.5); +- int targetSize = (int) (this.unloadQueue.size() * UNLOAD_QUEUE_RESIZE_FACTOR); ++ int targetSize = Math.min(this.unloadQueue.size() - 100, (int) (this.unloadQueue.size() * UNLOAD_QUEUE_RESIZE_FACTOR)); // Paper - Make more aggressive + // Spigot end + while (longiterator.hasNext()) { // Spigot + long j = longiterator.nextLong(); +-- +2.21.0 + diff --git a/Spigot-Server-Patches/0171-Do-not-let-armorstands-drown.patch b/Spigot-Server-Patches/0149-Do-not-let-armorstands-drown.patch similarity index 74% rename from Spigot-Server-Patches/0171-Do-not-let-armorstands-drown.patch rename to Spigot-Server-Patches/0149-Do-not-let-armorstands-drown.patch index 2d70de4db6..a5d6b88172 100644 --- a/Spigot-Server-Patches/0171-Do-not-let-armorstands-drown.patch +++ b/Spigot-Server-Patches/0149-Do-not-let-armorstands-drown.patch @@ -1,15 +1,15 @@ -From acb04e7af931a4ae09b5ac254c3e29220e1976fd Mon Sep 17 00:00:00 2001 +From 2cf238ab74719beb6cb72b9e8826bb4a387a820d Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sat, 18 Feb 2017 19:29:58 -0600 Subject: [PATCH] Do not let armorstands drown diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index b570882340..694df9e185 100644 +index 8c6a9ec68..f8cd62199 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java -@@ -763,5 +763,10 @@ public class EntityArmorStand extends EntityLiving { - super.move(moveType, x, y, z); +@@ -797,5 +797,10 @@ public class EntityArmorStand extends EntityLiving { + super.move(moveType, vec3d); } } + @@ -20,22 +20,22 @@ index b570882340..694df9e185 100644 // Paper end } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 34fbf83621..138a224e04 100644 +index b0c9eda48..121925046 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -202,6 +202,7 @@ public abstract class EntityLiving extends Entity { +@@ -223,6 +223,7 @@ public abstract class EntityLiving extends Entity { super.a(d0, flag, iblockdata, blockposition); } -+ public boolean canBreatheUnderwater() { return this.ca(); } // Paper - OBFHELPER - public boolean ca() { ++ public boolean canBreatheUnderwater() { return this.cl(); } // Paper - OBFHELPER + public boolean cl() { return this.getMonsterType() == EnumMonsterType.UNDEAD; } -@@ -236,7 +237,7 @@ public abstract class EntityLiving extends Entity { +@@ -258,7 +259,7 @@ public abstract class EntityLiving extends Entity { if (this.isAlive()) { if (this.a(TagsFluid.WATER) && this.world.getType(new BlockPosition(this.locX, this.locY + (double) this.getHeadHeight(), this.locZ)).getBlock() != Blocks.BUBBLE_COLUMN) { -- if (!this.ca() && !MobEffectUtil.c(this) && !flag1) { +- if (!this.cl() && !MobEffectUtil.c(this) && !flag1) { + if (!this.canBreatheUnderwater() && !MobEffectUtil.c(this) && !flag1) { // Paper - use OBFHELPER so it can be overridden this.setAirTicks(this.k(this.getAirTicks())); if (this.getAirTicks() == -20) { diff --git a/Spigot-Server-Patches/0172-Properly-handle-async-calls-to-restart-the-server.patch b/Spigot-Server-Patches/0150-Properly-handle-async-calls-to-restart-the-server.patch similarity index 73% rename from Spigot-Server-Patches/0172-Properly-handle-async-calls-to-restart-the-server.patch rename to Spigot-Server-Patches/0150-Properly-handle-async-calls-to-restart-the-server.patch index c772e3b152..64b48f85b5 100644 --- a/Spigot-Server-Patches/0172-Properly-handle-async-calls-to-restart-the-server.patch +++ b/Spigot-Server-Patches/0150-Properly-handle-async-calls-to-restart-the-server.patch @@ -1,4 +1,4 @@ -From b7ea92e1f8098d7899cc53e97cbb602b9f2f24e5 Mon Sep 17 00:00:00 2001 +From a5592be696baf2e08fb817f8d29c2a90a559c241 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Fri, 12 May 2017 23:34:11 -0500 Subject: [PATCH] Properly handle async calls to restart the server @@ -30,57 +30,62 @@ will have plugins and worlds saving to the disk has a high potential to result in corruption/dataloss. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 6283c774d6..db511c1fe8 100644 +index c41adf441..2d5e340ee 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -85,6 +85,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati +@@ -80,6 +80,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant worldServer = Maps.newLinkedHashMap(); // CraftBukkit - keep order, k+v already use identity methods private PlayerList playerList; - private boolean isRunning = true; -+ private boolean isRestarting = false; // Paper - flag to signify we're attempting to restart + private volatile boolean isRunning = true; ++ private volatile boolean isRestarting = false; // Paper - flag to signify we're attempting to restart private boolean isStopped; private int ticks; - protected final Proxy c; -@@ -655,7 +656,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati + protected final Proxy proxy; +@@ -690,7 +691,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant 0 && new File( split[0] ).isFile() ) + // Paper - extract method and cleanup -+ boolean isRestarting = addShutdownHook(restartScript); -+ if (isRestarting) { -+ System.out.println("Attempting to restart with " + SpigotConfig.restartScript); -+ } else { ++ boolean isRestarting = addShutdownHook( restartScript ); ++ if ( isRestarting ) + { +- System.out.println( "Attempting to restart with " + restartScript ); ++ System.out.println( "Attempting to restart with " + SpigotConfig.restartScript ); ++ } else ++ { + System.out.println( "Startup script '" + SpigotConfig.restartScript + "' does not exist! Stopping server." ); + } -+ + // Stop the watchdog + WatchdogThread.doStop(); -+ -+ shutdownServer(isRestarting); + +- // Disable Watchdog +- WatchdogThread.doStop(); ++ shutdownServer( isRestarting ); ++ // Paper end + } catch ( Exception ex ) + { + ex.printStackTrace(); + } + } -+ -+ // Paper start - sync copied from above with minor changes, async added -+ private static void shutdownServer(boolean isRestarting) -+ { -+ if (MinecraftServer.getServer().isMainThread()) -+ { -+ // Kick all players -+ for ( EntityPlayer p : com.google.common.collect.ImmutableList.copyOf( MinecraftServer.getServer().getPlayerList().players ) ) - { -- System.out.println( "Attempting to restart with " + restartScript ); -+ p.playerConnection.disconnect(SpigotConfig.restartMessage); -+ } -+ // Give the socket a chance to send the packets -+ try -+ { -+ Thread.sleep( 100 ); -+ } catch ( InterruptedException ex ) -+ { -+ } - -- // Disable Watchdog -- WatchdogThread.doStop(); -+ closeSocket(); - // Kick all players - for ( EntityPlayer p : (List< EntityPlayer>) MinecraftServer.getServer().getPlayerList().players ) @@ -161,11 +148,21 @@ index 944151d140..061cbe7fcf 100644 - } - // Close the socket so we can rebind with the new process - MinecraftServer.getServer().getServerConnection().b(); -+ // Actually shutdown ++ // Paper start - sync copied from above with minor changes, async added ++ private static void shutdownServer(boolean isRestarting) ++ { ++ if ( MinecraftServer.getServer().isMainThread() ) ++ { ++ // Kick all players ++ for ( EntityPlayer p : com.google.common.collect.ImmutableList.copyOf( MinecraftServer.getServer().getPlayerList().players ) ) ++ { ++ p.playerConnection.disconnect(SpigotConfig.restartMessage); ++ } ++ // Give the socket a chance to send the packets + try + { -+ MinecraftServer.getServer().stop(); -+ } catch ( Throwable t ) ++ Thread.sleep( 100 ); ++ } catch ( InterruptedException ex ) + { + } @@ -176,29 +173,88 @@ index 944151d140..061cbe7fcf 100644 - } catch ( InterruptedException ex ) - { - } -+ // Actually stop the JVM -+ System.exit(0); ++ closeSocket(); - // Actually shutdown - try - { -- MinecraftServer.getServer().stop(); +- MinecraftServer.getServer().close(); - } catch ( Throwable t ) - { - } -+ } else -+ { -+ // Mark the server to shutdown at the end of the tick -+ MinecraftServer.getServer().safeShutdown(isRestarting); ++ // Actually shutdown ++ try ++ { ++ MinecraftServer.getServer().close(); // calls stop() ++ } catch ( Throwable t ) ++ { ++ } ++ ++ // Actually stop the JVM ++ System.exit( 0 ); - // This will be done AFTER the server has completely halted - Thread shutdownHook = new Thread() -- { ++ } else ++ { ++ // Mark the server to shutdown at the end of the tick ++ MinecraftServer.getServer().safeShutdown( false, isRestarting ); ++ ++ // wait 10 seconds to see if we're actually going to try shutdown ++ try ++ { ++ Thread.sleep( 10000 ); ++ } ++ catch (InterruptedException ignored) ++ { ++ } ++ ++ // Check if we've actually hit a state where the server is going to safely shutdown ++ // if we have, let the server stop as usual ++ if (MinecraftServer.getServer().isStopped()) return; ++ ++ // If the server hasn't stopped by now, assume worse case and kill ++ closeSocket(); ++ System.exit( 0 ); ++ } ++ } ++ // Paper end ++ ++ // Paper - Split from moved code ++ private static void closeSocket() ++ { ++ // Close the socket so we can rebind with the new process ++ MinecraftServer.getServer().getServerConnection().b(); ++ ++ // Give time for it to kick in ++ try ++ { ++ Thread.sleep( 100 ); ++ } catch ( InterruptedException ex ) ++ { ++ } ++ } ++ // Paper end ++ ++ // Paper start - copied from above and modified to return if the hook registered ++ private static boolean addShutdownHook(String restartScript) ++ { ++ String[] split = restartScript.split( " " ); ++ if ( split.length > 0 && new File( split[0] ).isFile() ) ++ { ++ Thread shutdownHook = new Thread() ++ { ++ @Override ++ public void run() + { - @Override - public void run() -- { ++ try + { - try -- { ++ String os = System.getProperty( "os.name" ).toLowerCase(java.util.Locale.ENGLISH); ++ if ( os.contains( "win" ) ) + { - String os = System.getProperty( "os.name" ).toLowerCase(java.util.Locale.ENGLISH); - if ( os.contains( "win" ) ) - { @@ -208,90 +264,47 @@ index 944151d140..061cbe7fcf 100644 - Runtime.getRuntime().exec( "sh " + restartScript ); - } - } catch ( Exception e ) -- { ++ Runtime.getRuntime().exec( "cmd /c start " + restartScript ); ++ } else + { - e.printStackTrace(); -- } -- } ++ Runtime.getRuntime().exec( "sh " + restartScript ); + } ++ } catch ( Exception e ) ++ { ++ e.printStackTrace(); + } - }; - +- - shutdownHook.setDaemon( true ); - Runtime.getRuntime().addShutdownHook( shutdownHook ); - } else - { - System.out.println( "Startup script '" + SpigotConfig.restartScript + "' does not exist! Stopping server." ); - +- - // Actually shutdown - try - { -- MinecraftServer.getServer().stop(); +- MinecraftServer.getServer().close(); - } catch ( Throwable t ) - { -- } -+ // wait 10 seconds to see if we're actually going to try shutdown -+ try -+ { -+ Thread.sleep(10000); -+ } -+ catch (InterruptedException ignored) -+ { - } -+ -+ // Check if we've actually hit a state where the server is going to safely shutdown -+ // if we have, let the server stop as usual -+ if (MinecraftServer.getServer().isStopped()) return; -+ -+ // If the server hasn't stopped by now, assume worse case and kill -+ closeSocket(); - System.exit( 0 ); + } +- } +- System.exit( 0 ); - } catch ( Exception ex ) -+ } -+ } -+ -+ // Paper - Split from moved code -+ private static void closeSocket() { -+ // Close the socket so we can rebind with the new process -+ MinecraftServer.getServer().getServerConnection().b(); -+ -+ // Give time for it to kick in -+ try - { -- ex.printStackTrace(); -+ Thread.sleep( 100 ); -+ } catch ( InterruptedException ex ) -+ { -+ } -+ } -+ // Paper end -+ -+ // Paper - copied from above and modified to return if the hook registered -+ private static boolean addShutdownHook(final String restartScript) { -+ -+ String[] split = restartScript.split( " " ); -+ if ( split.length > 0 && new File( split[0] ).isFile() ) -+ { -+ Thread shutdownHook = new Thread() { -+ @Override -+ public void run() { -+ try { -+ String os = System.getProperty("os.name").toLowerCase(java.util.Locale.ENGLISH); -+ if (os.contains("win")) { -+ Runtime.getRuntime().exec("cmd /c start " + restartScript); -+ } else { -+ Runtime.getRuntime().exec( "sh " + restartScript ); -+ } -+ } catch (Exception e) { -+ e.printStackTrace(); -+ } -+ } + }; + -+ shutdownHook.setDaemon(true); -+ Runtime.getRuntime().addShutdownHook(shutdownHook); ++ shutdownHook.setDaemon( true ); ++ Runtime.getRuntime().addShutdownHook( shutdownHook ); + return true; -+ } else { ++ } else + { +- ex.printStackTrace(); + return false; } } ++ // Paper end ++ } -- 2.21.0 diff --git a/Spigot-Server-Patches/0173-Add-system-property-to-disable-book-size-limits.patch b/Spigot-Server-Patches/0151-Add-system-property-to-disable-book-size-limits.patch similarity index 87% rename from Spigot-Server-Patches/0173-Add-system-property-to-disable-book-size-limits.patch rename to Spigot-Server-Patches/0151-Add-system-property-to-disable-book-size-limits.patch index a0cba85a5b..723cb9ec27 100644 --- a/Spigot-Server-Patches/0173-Add-system-property-to-disable-book-size-limits.patch +++ b/Spigot-Server-Patches/0151-Add-system-property-to-disable-book-size-limits.patch @@ -1,4 +1,4 @@ -From e5c716622f3a6f09eb0d1977ba6eebcf0d296973 Mon Sep 17 00:00:00 2001 +From 8b8bf29963073a01cab38ed94ca062b0621fb85a Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sat, 13 May 2017 20:11:21 -0500 Subject: [PATCH] Add system property to disable book size limits @@ -11,10 +11,10 @@ to make books with as much data as they want. Do not use this without limiting incoming data from packets in some other way. diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java -index a23ec1461d..20cddd5065 100644 +index 0291ff194..49c93b75c 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java -@@ -40,6 +40,7 @@ public class CraftMetaBook extends CraftMetaItem implements BookMeta { +@@ -36,6 +36,7 @@ public class CraftMetaBook extends CraftMetaItem implements BookMeta { static final int MAX_PAGES = 50; static final int MAX_PAGE_LENGTH = 320; // 256 limit + 64 characters to allow for psuedo colour codes static final int MAX_TITLE_LENGTH = 32; @@ -22,7 +22,7 @@ index a23ec1461d..20cddd5065 100644 protected String title; protected String author; -@@ -196,7 +197,7 @@ public class CraftMetaBook extends CraftMetaItem implements BookMeta { +@@ -192,7 +193,7 @@ public class CraftMetaBook extends CraftMetaItem implements BookMeta { if (title == null) { this.title = null; return true; @@ -31,7 +31,7 @@ index a23ec1461d..20cddd5065 100644 return false; } -@@ -232,7 +233,7 @@ public class CraftMetaBook extends CraftMetaItem implements BookMeta { +@@ -228,7 +229,7 @@ public class CraftMetaBook extends CraftMetaItem implements BookMeta { throw new IllegalArgumentException("Invalid page number " + page + "/" + pages.size()); } @@ -40,7 +40,7 @@ index a23ec1461d..20cddd5065 100644 pages.set(page - 1, CraftChatMessage.fromString(newText, true)[0]); } -@@ -244,13 +245,13 @@ public class CraftMetaBook extends CraftMetaItem implements BookMeta { +@@ -240,13 +241,13 @@ public class CraftMetaBook extends CraftMetaItem implements BookMeta { public void addPage(final String... pages) { for (String page : pages) { diff --git a/Spigot-Server-Patches/0174-Add-option-to-make-parrots-stay-on-shoulders-despite.patch b/Spigot-Server-Patches/0152-Add-option-to-make-parrots-stay-on-shoulders-despite.patch similarity index 87% rename from Spigot-Server-Patches/0174-Add-option-to-make-parrots-stay-on-shoulders-despite.patch rename to Spigot-Server-Patches/0152-Add-option-to-make-parrots-stay-on-shoulders-despite.patch index ea5e65fab6..567853c3bf 100644 --- a/Spigot-Server-Patches/0174-Add-option-to-make-parrots-stay-on-shoulders-despite.patch +++ b/Spigot-Server-Patches/0152-Add-option-to-make-parrots-stay-on-shoulders-despite.patch @@ -1,4 +1,4 @@ -From 9fa77cfb17de18c16aaa9f1bf8a73f2a841c3ef8 Mon Sep 17 00:00:00 2001 +From 57c8f5b53873eb694f6cd8bf78808bbdcab3ca48 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 16 May 2017 21:29:08 -0500 Subject: [PATCH] Add option to make parrots stay on shoulders despite movement @@ -11,10 +11,10 @@ I suspect Mojang may switch to this behavior before full release. To be converted into a Paper-API event at some point in the future? diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 72eb530d7e..8ff454e259 100644 +index 58fe5a8c4..a34121495 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -375,4 +375,10 @@ public class PaperWorldConfig { +@@ -326,4 +326,10 @@ public class PaperWorldConfig { maxCollisionsPerEntity = getInt( "max-entity-collisions", this.spigotConfig.getInt("max-entity-collisions", 8) ); log( "Max Entity Collisions: " + maxCollisionsPerEntity ); } @@ -26,10 +26,10 @@ index 72eb530d7e..8ff454e259 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 5e5a747e9f..23e7cdfe88 100644 +index 8a6f8e875..5df763d92 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -465,7 +465,7 @@ public abstract class EntityHuman extends EntityLiving { +@@ -436,7 +436,7 @@ public abstract class EntityHuman extends EntityLiving { this.j(this.getShoulderEntityLeft()); this.j(this.getShoulderEntityRight()); if (!this.world.isClientSide && (this.fallDistance > 0.5F || this.isInWater() || this.isPassenger()) || this.abilities.isFlying) { @@ -39,10 +39,10 @@ index 5e5a747e9f..23e7cdfe88 100644 } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 05cc5afea6..ac64fcfb31 100644 +index 37caa2a70..69a786e8d 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1736,6 +1736,13 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { +@@ -1784,6 +1784,13 @@ public class PlayerConnection implements PacketListenerPlayIn { switch (packetplayinentityaction.c()) { case START_SNEAKING: this.player.setSneaking(true); diff --git a/Spigot-Server-Patches/0175-Add-configuration-option-to-prevent-player-names-fro.patch b/Spigot-Server-Patches/0153-Add-configuration-option-to-prevent-player-names-fro.patch similarity index 73% rename from Spigot-Server-Patches/0175-Add-configuration-option-to-prevent-player-names-fro.patch rename to Spigot-Server-Patches/0153-Add-configuration-option-to-prevent-player-names-fro.patch index 62194c8a3d..d2edf79855 100644 --- a/Spigot-Server-Patches/0175-Add-configuration-option-to-prevent-player-names-fro.patch +++ b/Spigot-Server-Patches/0153-Add-configuration-option-to-prevent-player-names-fro.patch @@ -1,4 +1,4 @@ -From 382faa5dd1c013c3dab3034934534a8fcbe2ea0b Mon Sep 17 00:00:00 2001 +From 5a583fb24c0c02301aa12e9bdae2c64344868a4f Mon Sep 17 00:00:00 2001 From: kashike Date: Fri, 9 Jun 2017 07:24:34 -0700 Subject: [PATCH] Add configuration option to prevent player names from being @@ -6,12 +6,12 @@ Subject: [PATCH] Add configuration option to prevent player names from being diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 17b4e01aa4..d10d60921b 100644 +index 7ce370e92..1adbb2480 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java -@@ -280,4 +280,9 @@ public class PaperConfig { - maxPlayerAutoSavePerTick = (playerAutoSaveRate == -1 || playerAutoSaveRate > 100) ? 10 : 20; - } +@@ -256,4 +256,9 @@ public class PaperConfig { + flyingKickPlayerMessage = getString("messages.kick.flying-player", flyingKickPlayerMessage); + flyingKickVehicleMessage = getString("messages.kick.flying-vehicle", flyingKickVehicleMessage); } + + public static boolean suggestPlayersWhenNullTabCompletions = true; @@ -20,10 +20,10 @@ index 17b4e01aa4..d10d60921b 100644 + } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index bb7792ce2a..962170cd3f 100644 +index bc1de9d9e..b2aee24e5 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2141,5 +2141,10 @@ public final class CraftServer implements Server { +@@ -2077,5 +2077,10 @@ public final class CraftServer implements Server { commandMap.registerServerAliases(); return true; } diff --git a/Spigot-Server-Patches/0154-Configurable-Cartographer-Treasure-Maps.patch b/Spigot-Server-Patches/0154-Configurable-Cartographer-Treasure-Maps.patch deleted file mode 100644 index 963b865544..0000000000 --- a/Spigot-Server-Patches/0154-Configurable-Cartographer-Treasure-Maps.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 924ca775f5c4e2ecbc9fd05cff40e22687ebedc5 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Tue, 20 Dec 2016 15:26:27 -0500 -Subject: [PATCH] Configurable Cartographer Treasure Maps - -Allow configuring for cartographers to return the same map location - -Also allow turning off treasure maps all together as they can eat up Map ID's -which are limited in quantity. - -diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 104a3acf31..13f54e05ab 100644 ---- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -359,4 +359,14 @@ public class PaperWorldConfig { - Bukkit.getLogger().warning("Spawn Egg and Armor Stand NBT filtering disabled, this is a potential security risk"); - } - } -+ -+ public boolean enableTreasureMaps = true; -+ public boolean treasureMapsAlreadyDiscovered = false; -+ private void treasureMapsAlreadyDiscovered() { -+ enableTreasureMaps = getBoolean("enable-treasure-maps", true); -+ treasureMapsAlreadyDiscovered = getBoolean("treasure-maps-return-already-discovered", false); -+ if (treasureMapsAlreadyDiscovered) { -+ log("Treasure Maps will return already discovered locations"); -+ } -+ } - } -diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index 213d0b18c9..ebe397b15a 100644 ---- a/src/main/java/net/minecraft/server/EntityVillager.java -+++ b/src/main/java/net/minecraft/server/EntityVillager.java -@@ -752,6 +752,7 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant { - public void a(IMerchant imerchant, MerchantRecipeList merchantrecipelist, Random random) { - int i = this.a.a(random); - World world = imerchant.getWorld(); -+ if (!world.paperConfig.enableTreasureMaps) return; //Paper - BlockPosition blockposition = world.a(this.b, imerchant.getPosition(), 100, true); - - if (blockposition != null) { --- -2.21.0 - diff --git a/Spigot-Server-Patches/0176-Use-TerminalConsoleAppender-for-console-improvements.patch b/Spigot-Server-Patches/0154-Use-TerminalConsoleAppender-for-console-improvements.patch similarity index 88% rename from Spigot-Server-Patches/0176-Use-TerminalConsoleAppender-for-console-improvements.patch rename to Spigot-Server-Patches/0154-Use-TerminalConsoleAppender-for-console-improvements.patch index 07d458753e..4643f26d92 100644 --- a/Spigot-Server-Patches/0176-Use-TerminalConsoleAppender-for-console-improvements.patch +++ b/Spigot-Server-Patches/0154-Use-TerminalConsoleAppender-for-console-improvements.patch @@ -1,4 +1,4 @@ -From b6d424028e3980f33b12cf8b24fc51eaf7f3a613 Mon Sep 17 00:00:00 2001 +From ee5622690e3f68cb3c8e31a3b30763994b3f4371 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Fri, 9 Jun 2017 19:03:43 +0200 Subject: [PATCH] Use TerminalConsoleAppender for console improvements @@ -19,7 +19,7 @@ Other changes: configuration diff --git a/pom.xml b/pom.xml -index 51cefc0a1b..2b73ec28a1 100644 +index 099d7218c..108c8c05e 100644 --- a/pom.xml +++ b/pom.xml @@ -41,10 +41,27 @@ @@ -54,7 +54,7 @@ index 51cefc0a1b..2b73ec28a1 100644 org.ow2.asm -@@ -207,10 +224,18 @@ +@@ -230,10 +247,18 @@ META-INF/services/java.sql.Driver @@ -75,7 +75,7 @@ index 51cefc0a1b..2b73ec28a1 100644 org.apache.maven.plugins diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java new file mode 100644 -index 0000000000..688b4715eb +index 000000000..688b4715e --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java @@ -0,0 +1,40 @@ @@ -121,7 +121,7 @@ index 0000000000..688b4715eb +} diff --git a/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java b/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java new file mode 100644 -index 0000000000..685deaa0e5 +index 000000000..685deaa0e --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java @@ -0,0 +1,17 @@ @@ -143,10 +143,10 @@ index 0000000000..685deaa0e5 + +} diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 4e9ef43b45..5bb1ea880a 100644 +index 19e2df309..3d0cb874d 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java -@@ -79,6 +79,9 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +@@ -83,6 +83,9 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer if (!org.bukkit.craftbukkit.Main.useConsole) { return; } @@ -156,7 +156,7 @@ index 4e9ef43b45..5bb1ea880a 100644 jline.console.ConsoleReader bufferedreader = reader; // CraftBukkit end -@@ -101,6 +104,8 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +@@ -105,6 +108,8 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer DedicatedServer.LOGGER.error("Exception handling console input", ioexception); } @@ -165,7 +165,7 @@ index 4e9ef43b45..5bb1ea880a 100644 } }; -@@ -112,6 +117,9 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +@@ -116,6 +121,9 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer } global.addHandler(new org.bukkit.craftbukkit.util.ForwardLogHandler()); @@ -175,38 +175,39 @@ index 4e9ef43b45..5bb1ea880a 100644 final org.apache.logging.log4j.core.Logger logger = ((org.apache.logging.log4j.core.Logger) LogManager.getRootLogger()); for (org.apache.logging.log4j.core.Appender appender : logger.getAppenders().values()) { if (appender instanceof org.apache.logging.log4j.core.appender.ConsoleAppender) { -@@ -120,6 +128,8 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +@@ -124,6 +132,8 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer } - new Thread(new org.bukkit.craftbukkit.util.TerminalConsoleWriterThread(System.out, this.reader)).start(); + new org.bukkit.craftbukkit.util.TerminalConsoleWriterThread(System.out, this.reader).start(); + */ + // Paper end System.setOut(new PrintStream(new LoggerOutputStream(logger, Level.INFO), true)); System.setErr(new PrintStream(new LoggerOutputStream(logger, Level.WARN), true)); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index db511c1fe8..c6ecdf6e8e 100644 +index 2d5e340ee..dc6d7b3a2 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -56,7 +56,6 @@ import org.apache.commons.lang3.Validate; +@@ -50,7 +50,7 @@ import org.apache.commons.lang3.Validate; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; // CraftBukkit start -import jline.console.ConsoleReader; - import joptsimple.OptionSet; ++import joptsimple.OptionSet; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.CraftServer; -@@ -142,7 +141,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati + import org.bukkit.craftbukkit.Main; +@@ -151,7 +151,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); + public int autosavePeriod; +@@ -199,7 +199,9 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant> waitable = new Waitable>() { @Override protected List evaluate() { -@@ -30,25 +40,37 @@ public class ConsoleCommandCompleter implements Completer { +@@ -28,25 +39,37 @@ public class ConsoleCommandCompleter implements Completer { return tabEvent.isCancelled() ? Collections.EMPTY_LIST : tabEvent.getCompletions(); } }; @@ -452,9 +452,8 @@ index 33e8ea02c4..1e3aae3b8f 100644 if (offers == null) { - return cursor; + return; // Paper - Method returns void - } -- candidates.addAll(offers); - ++ } ++ + // Paper start - JLine update + for (String completion : offers) { + if (completion.isEmpty()) { @@ -462,9 +461,10 @@ index 33e8ea02c4..1e3aae3b8f 100644 + } + + candidates.add(new Candidate(completion)); -+ } + } +- candidates.addAll(offers); + // Paper end -+ + + // Paper start - JLine handles cursor now + /* final int lastSpace = buffer.lastIndexOf(' '); @@ -485,11 +485,11 @@ index 33e8ea02c4..1e3aae3b8f 100644 } } diff --git a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java b/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java -index 984df4083d..bbb5a84f36 100644 +index 70f8d4299..449e99d1b 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java +++ b/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java -@@ -20,7 +20,7 @@ public class ServerShutdownThread extends Thread { - ex.printStackTrace(); +@@ -17,7 +17,7 @@ public class ServerShutdownThread extends Thread { + server.close(); } finally { try { - server.reader.getTerminal().restore(); @@ -499,29 +499,31 @@ index 984df4083d..bbb5a84f36 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java b/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java deleted file mode 100644 -index b640971130..0000000000 +index f239cd623..000000000 --- a/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java +++ /dev/null -@@ -1,54 +0,0 @@ +@@ -1,56 +0,0 @@ -package org.bukkit.craftbukkit.util; - +-import com.mojang.util.QueueLogAppender; -import java.io.IOException; -import java.io.OutputStream; -import java.util.logging.Level; -import java.util.logging.Logger; -import jline.console.ConsoleReader; --import com.mojang.util.QueueLogAppender; -import org.bukkit.craftbukkit.Main; -import org.fusesource.jansi.Ansi; -import org.fusesource.jansi.Ansi.Erase; - --public class TerminalConsoleWriterThread implements Runnable { -- final private ConsoleReader reader; -- final private OutputStream output; +-public class TerminalConsoleWriterThread extends Thread { +- private final ConsoleReader reader; +- private final OutputStream output; - - public TerminalConsoleWriterThread(OutputStream output, ConsoleReader reader) { - this.output = output; - this.reader = reader; +- +- this.setDaemon(true); - } - - public void run() { @@ -558,7 +560,7 @@ index b640971130..0000000000 - } -} diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml -index 5cee8f00ef..08b6bb7f97 100644 +index 490a9acc7..08b6bb7f9 100644 --- a/src/main/resources/log4j2.xml +++ b/src/main/resources/log4j2.xml @@ -1,12 +1,11 @@ @@ -568,7 +570,7 @@ index 5cee8f00ef..08b6bb7f97 100644 - - -- +- - + + diff --git a/Spigot-Server-Patches/0177-provide-a-configurable-option-to-disable-creeper-lin.patch b/Spigot-Server-Patches/0155-provide-a-configurable-option-to-disable-creeper-lin.patch similarity index 86% rename from Spigot-Server-Patches/0177-provide-a-configurable-option-to-disable-creeper-lin.patch rename to Spigot-Server-Patches/0155-provide-a-configurable-option-to-disable-creeper-lin.patch index 5fabded05b..5248224419 100644 --- a/Spigot-Server-Patches/0177-provide-a-configurable-option-to-disable-creeper-lin.patch +++ b/Spigot-Server-Patches/0155-provide-a-configurable-option-to-disable-creeper-lin.patch @@ -1,4 +1,4 @@ -From 23d7e81210b0cf3e58cfaeb0a8362a20b1cf8c38 Mon Sep 17 00:00:00 2001 +From e79896a5e06f75fb67c7c3a3506da1332b7abb26 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sun, 11 Jun 2017 21:01:18 +0100 Subject: [PATCH] provide a configurable option to disable creeper lingering @@ -6,10 +6,10 @@ Subject: [PATCH] provide a configurable option to disable creeper lingering diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 8ff454e259..3baf0380c0 100644 +index a34121495..abc967d3f 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -381,4 +381,10 @@ public class PaperWorldConfig { +@@ -332,4 +332,10 @@ public class PaperWorldConfig { parrotsHangOnBetter = getBoolean("parrots-are-unaffected-by-player-movement", false); log("Parrots are unaffected by player movement: " + parrotsHangOnBetter); } @@ -21,10 +21,10 @@ index 8ff454e259..3baf0380c0 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java -index 81e602d1b9..b6af429044 100644 +index 13ddc00d6..9f03d0337 100644 --- a/src/main/java/net/minecraft/server/EntityCreeper.java +++ b/src/main/java/net/minecraft/server/EntityCreeper.java -@@ -214,7 +214,7 @@ public class EntityCreeper extends EntityMonster { +@@ -225,7 +225,7 @@ public class EntityCreeper extends EntityMonster { private void createEffectCloud() { Collection collection = this.getEffects(); diff --git a/Spigot-Server-Patches/0178-Item-canEntityPickup.patch b/Spigot-Server-Patches/0156-Item-canEntityPickup.patch similarity index 74% rename from Spigot-Server-Patches/0178-Item-canEntityPickup.patch rename to Spigot-Server-Patches/0156-Item-canEntityPickup.patch index 032db69848..3961d9f57b 100644 --- a/Spigot-Server-Patches/0178-Item-canEntityPickup.patch +++ b/Spigot-Server-Patches/0156-Item-canEntityPickup.patch @@ -1,14 +1,14 @@ -From 1853596fcd97ca2e82211602010b3c14e08ffbf7 Mon Sep 17 00:00:00 2001 +From e165a8a956f42b823b6cf6597b5ed62d6fb9e404 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 5 May 2017 03:57:17 -0500 Subject: [PATCH] Item#canEntityPickup diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index c530824596..98e214cdd6 100644 +index 5d830b245..f1621a9e9 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -530,6 +530,11 @@ public abstract class EntityInsentient extends EntityLiving { +@@ -510,6 +510,11 @@ public abstract class EntityInsentient extends EntityLiving { EntityItem entityitem = (EntityItem) iterator.next(); if (!entityitem.dead && !entityitem.getItemStack().isEmpty() && !entityitem.q()) { @@ -21,22 +21,22 @@ index c530824596..98e214cdd6 100644 } } diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index 9b854d64fb..39a804b7cb 100644 +index fe70a3a8b..36b5fb537 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java -@@ -13,6 +13,7 @@ public class EntityItem extends Entity { - private static final DataWatcherObject b = DataWatcher.a(EntityItem.class, DataWatcherRegistry.g); - public int age; // PAIL - public int pickupDelay; +@@ -19,6 +19,7 @@ public class EntityItem extends Entity { + private UUID owner; + public final float b; + private int lastTick = MinecraftServer.currentTick - 1; // CraftBukkit + public boolean canMobPickup = true; // Paper - private int e; - private UUID f; - private UUID g; + + public EntityItem(EntityTypes entitytypes, World world) { + super(entitytypes, world); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java -index 55d6bacf77..6036592f76 100644 +index 0dbca8f00..65b23f511 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java -@@ -45,6 +45,16 @@ public class CraftItem extends CraftEntity implements Item { +@@ -44,6 +44,16 @@ public class CraftItem extends CraftEntity implements Item { item.age = value; } diff --git a/Spigot-Server-Patches/0179-PlayerPickupItemEvent-setFlyAtPlayer.patch b/Spigot-Server-Patches/0157-PlayerPickupItemEvent-setFlyAtPlayer.patch similarity index 79% rename from Spigot-Server-Patches/0179-PlayerPickupItemEvent-setFlyAtPlayer.patch rename to Spigot-Server-Patches/0157-PlayerPickupItemEvent-setFlyAtPlayer.patch index 689cc5ee09..32472a1532 100644 --- a/Spigot-Server-Patches/0179-PlayerPickupItemEvent-setFlyAtPlayer.patch +++ b/Spigot-Server-Patches/0157-PlayerPickupItemEvent-setFlyAtPlayer.patch @@ -1,14 +1,14 @@ -From 7146ff6a0122d0a286b5bda25234c78a43bbb4bd Mon Sep 17 00:00:00 2001 +From a901f50b7ca1bb20b0587dad07e4affc10fb35fa Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sun, 7 May 2017 06:26:09 -0500 Subject: [PATCH] PlayerPickupItemEvent#setFlyAtPlayer diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index 39a804b7cb..921a56c312 100644 +index 36b5fb537..e02df8987 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java -@@ -308,6 +308,7 @@ public class EntityItem extends Entity { +@@ -316,6 +316,7 @@ public class EntityItem extends Entity { // CraftBukkit start - fire PlayerPickupItemEvent int canHold = entityhuman.inventory.canHold(itemstack); int remaining = i - canHold; @@ -16,7 +16,7 @@ index 39a804b7cb..921a56c312 100644 if (this.pickupDelay <= 0 && canHold > 0) { itemstack.setCount(canHold); -@@ -315,7 +316,13 @@ public class EntityItem extends Entity { +@@ -323,7 +324,13 @@ public class EntityItem extends Entity { PlayerPickupItemEvent playerEvent = new PlayerPickupItemEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), (org.bukkit.entity.Item) this.getBukkitEntity(), remaining); playerEvent.setCancelled(!entityhuman.canPickUpLoot); this.world.getServer().getPluginManager().callEvent(playerEvent); @@ -30,10 +30,10 @@ index 39a804b7cb..921a56c312 100644 return; } -@@ -335,7 +342,11 @@ public class EntityItem extends Entity { +@@ -343,7 +350,11 @@ public class EntityItem extends Entity { // CraftBukkit end - if (this.pickupDelay == 0 && (this.g == null || 6000 - this.age <= 200 || this.g.equals(entityhuman.getUniqueID())) && entityhuman.inventory.pickup(itemstack)) { + if (this.pickupDelay == 0 && (this.owner == null || 6000 - this.age <= 200 || this.owner.equals(entityhuman.getUniqueID())) && entityhuman.inventory.pickup(itemstack)) { - entityhuman.receive(this, i); + // Paper Start + if (flyAtPlayer) { diff --git a/Spigot-Server-Patches/0180-PlayerAttemptPickupItemEvent.patch b/Spigot-Server-Patches/0158-PlayerAttemptPickupItemEvent.patch similarity index 88% rename from Spigot-Server-Patches/0180-PlayerAttemptPickupItemEvent.patch rename to Spigot-Server-Patches/0158-PlayerAttemptPickupItemEvent.patch index 4a63b7903a..ccfd2a27cb 100644 --- a/Spigot-Server-Patches/0180-PlayerAttemptPickupItemEvent.patch +++ b/Spigot-Server-Patches/0158-PlayerAttemptPickupItemEvent.patch @@ -1,14 +1,14 @@ -From a52801098de2cc54251d3838c161e80c207f0277 Mon Sep 17 00:00:00 2001 +From 8559585ae4946733a3fd8d088a3509f9348ac663 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sun, 11 Jun 2017 16:30:30 -0500 Subject: [PATCH] PlayerAttemptPickupItemEvent diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index 921a56c312..e9986420c2 100644 +index e02df8987..c582c6711 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java -@@ -7,6 +7,7 @@ import javax.annotation.Nullable; +@@ -8,6 +8,7 @@ import javax.annotation.Nullable; import org.bukkit.event.entity.EntityPickupItemEvent; import org.bukkit.event.player.PlayerPickupItemEvent; // CraftBukkit end @@ -16,7 +16,7 @@ index 921a56c312..e9986420c2 100644 public class EntityItem extends Entity { -@@ -310,6 +311,22 @@ public class EntityItem extends Entity { +@@ -318,6 +319,22 @@ public class EntityItem extends Entity { int remaining = i - canHold; boolean flyAtPlayer = false; // Paper diff --git a/Spigot-Server-Patches/0181-Add-UnknownCommandEvent.patch b/Spigot-Server-Patches/0159-Add-UnknownCommandEvent.patch similarity index 85% rename from Spigot-Server-Patches/0181-Add-UnknownCommandEvent.patch rename to Spigot-Server-Patches/0159-Add-UnknownCommandEvent.patch index e8f2594f20..03774864ec 100644 --- a/Spigot-Server-Patches/0181-Add-UnknownCommandEvent.patch +++ b/Spigot-Server-Patches/0159-Add-UnknownCommandEvent.patch @@ -1,14 +1,14 @@ -From 000033b190d3ae3628da53a244ebda476e91e045 Mon Sep 17 00:00:00 2001 +From 024f41d77e9e1bf1d59b70e41b1a72e47205c216 Mon Sep 17 00:00:00 2001 From: Sweepyoface Date: Sat, 17 Jun 2017 18:48:21 -0400 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 7e4f42b3f4..e8991ce1c9 100644 +index 2bdbc939e..4e5e2d109 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -83,6 +83,7 @@ import org.bukkit.craftbukkit.util.Versioning; +@@ -148,6 +148,7 @@ import org.bukkit.craftbukkit.util.Versioning; import org.bukkit.craftbukkit.util.permissions.CraftDefaultPermissions; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; @@ -16,7 +16,7 @@ index 7e4f42b3f4..e8991ce1c9 100644 import org.bukkit.event.inventory.InventoryType; import org.bukkit.event.player.PlayerChatTabCompleteEvent; import org.bukkit.event.server.BroadcastMessageEvent; -@@ -732,7 +733,13 @@ public final class CraftServer implements Server { +@@ -734,7 +735,13 @@ public final class CraftServer implements Server { // Spigot start if (!org.spigotmc.SpigotConfig.unknownCommandMessage.isEmpty()) { diff --git a/Spigot-Server-Patches/0182-Basic-PlayerProfile-API.patch b/Spigot-Server-Patches/0160-Basic-PlayerProfile-API.patch similarity index 94% rename from Spigot-Server-Patches/0182-Basic-PlayerProfile-API.patch rename to Spigot-Server-Patches/0160-Basic-PlayerProfile-API.patch index 0dfb1b38a7..5b129e2389 100644 --- a/Spigot-Server-Patches/0182-Basic-PlayerProfile-API.patch +++ b/Spigot-Server-Patches/0160-Basic-PlayerProfile-API.patch @@ -1,4 +1,4 @@ -From 84287d566df3a35f5121f707f2801f9ca9d325b8 Mon Sep 17 00:00:00 2001 +From 23cbe9f146fddcdc7b886f7d8951163dc89dddc7 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 15 Jan 2018 22:11:48 -0500 Subject: [PATCH] Basic PlayerProfile API @@ -7,7 +7,7 @@ Establishes base extension of profile systems for future edits too diff --git a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java new file mode 100644 -index 0000000000..b151a13c1b +index 000000000..b151a13c1 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java @@ -0,0 +1,280 @@ @@ -293,7 +293,7 @@ index 0000000000..b151a13c1b +} diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java b/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java new file mode 100644 -index 0000000000..25836b975b +index 000000000..25836b975 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java @@ -0,0 +1,30 @@ @@ -329,7 +329,7 @@ index 0000000000..25836b975b +} diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperGameProfileRepository.java b/src/main/java/com/destroystokyo/paper/profile/PaperGameProfileRepository.java new file mode 100644 -index 0000000000..3bcdb8f93f +index 000000000..3bcdb8f93 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/profile/PaperGameProfileRepository.java @@ -0,0 +1,17 @@ @@ -352,7 +352,7 @@ index 0000000000..3bcdb8f93f +} diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java b/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java new file mode 100644 -index 0000000000..4b2a67423f +index 000000000..4b2a67423 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java @@ -0,0 +1,29 @@ @@ -387,7 +387,7 @@ index 0000000000..4b2a67423f +} diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperUserAuthentication.java b/src/main/java/com/destroystokyo/paper/profile/PaperUserAuthentication.java new file mode 100644 -index 0000000000..3aceb0ea8a +index 000000000..3aceb0ea8 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/profile/PaperUserAuthentication.java @@ -0,0 +1,11 @@ @@ -403,7 +403,7 @@ index 0000000000..3aceb0ea8a + } +} diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index e1af5c4885..0ef5ad1165 100644 +index e1af5c488..0ef5ad116 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -1,7 +1,10 @@ @@ -429,28 +429,28 @@ index e1af5c4885..0ef5ad1165 100644 * Calculates distance between 2 entities * @param e1 diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index c6ecdf6e8e..5517c5fe81 100644 +index dc6d7b3a2..27d0d818b 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1186,7 +1186,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - */ // CraftBukkit end - - String s1 = "."; // PAIL? +@@ -1237,7 +1237,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant -Date: Sat, 7 Jan 2017 16:06:44 -0500 -Subject: [PATCH] Enforce Sync Chunk Unloads - -Unloading Chunks async is extremely dangerous. This will force it to main -the same way we handle async chunk loads. - -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 010c5fc731..6718028190 100644 ---- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -236,6 +236,7 @@ public class CraftWorld implements World { - } - - private boolean unloadChunk0(int x, int z, boolean save) { -+ Boolean result = MCUtil.ensureMain("Unload Chunk", () -> { // Paper - Ensure never async - net.minecraft.server.Chunk chunk = world.getChunkProvider().getChunkAt(x, z, false, false); - if (chunk == null) { - return true; -@@ -243,6 +244,7 @@ public class CraftWorld implements World { - - // If chunk had previously been queued to save, must do save to avoid loss of that data - return world.getChunkProvider().unloadChunk(chunk, chunk.mustSave || save); -+ }); return result != null ? result : false; // Paper - Ensure never async - } - - public boolean regenerateChunk(int x, int z) { --- -2.21.0 - diff --git a/Spigot-Server-Patches/0170-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch b/Spigot-Server-Patches/0170-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch deleted file mode 100644 index 440b7117ec..0000000000 --- a/Spigot-Server-Patches/0170-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 5d07c6b4f0e47adab15bb8f1ef878b92af6b715c Mon Sep 17 00:00:00 2001 -From: Brokkonaut -Date: Tue, 7 Feb 2017 16:55:35 -0600 -Subject: [PATCH] Make targetSize more aggressive in the chunk unload queue - - -diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 2997767282..41926a361b 100644 ---- a/src/main/java/net/minecraft/server/ChunkProviderServer.java -+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -313,7 +313,7 @@ public class ChunkProviderServer implements IChunkProvider { - // Spigot start - org.spigotmc.SlackActivityAccountant activityAccountant = this.world.getMinecraftServer().slackActivityAccountant; - activityAccountant.startActivity(0.5); -- int targetSize = (int) (this.unloadQueue.size() * UNLOAD_QUEUE_RESIZE_FACTOR); -+ int targetSize = Math.min(this.unloadQueue.size() - 100, (int) (this.unloadQueue.size() * UNLOAD_QUEUE_RESIZE_FACTOR)); // Paper - Make more aggressive - // Spigot end - Iterator iterator = this.unloadQueue.iterator(); - --- -2.21.0 - diff --git a/Spigot-Server-Patches/0115-Activation-Range-Improvements.patch b/removed/1.14/0115-Activation-Range-Improvements.patch similarity index 100% rename from Spigot-Server-Patches/0115-Activation-Range-Improvements.patch rename to removed/1.14/0115-Activation-Range-Improvements.patch diff --git a/Spigot-Server-Patches/0120-Ensure-Chunks-never-ever-load-async.patch b/removed/1.14/0120-Ensure-Chunks-never-ever-load-async.patch similarity index 100% rename from Spigot-Server-Patches/0120-Ensure-Chunks-never-ever-load-async.patch rename to removed/1.14/0120-Ensure-Chunks-never-ever-load-async.patch diff --git a/Spigot-Server-Patches/0123-Delay-Chunk-Unloads-based-on-Player-Movement.patch b/removed/1.14/0123-Delay-Chunk-Unloads-based-on-Player-Movement.patch old mode 100644 new mode 100755 similarity index 99% rename from Spigot-Server-Patches/0123-Delay-Chunk-Unloads-based-on-Player-Movement.patch rename to removed/1.14/0123-Delay-Chunk-Unloads-based-on-Player-Movement.patch index 91576aca84..33d5985c69 --- a/Spigot-Server-Patches/0123-Delay-Chunk-Unloads-based-on-Player-Movement.patch +++ b/removed/1.14/0123-Delay-Chunk-Unloads-based-on-Player-Movement.patch @@ -1,4 +1,4 @@ -From 5fe4df0be5a011f8ee6610a8fdf97b15fc8a4e1d Mon Sep 17 00:00:00 2001 +From 2fbf2c556d7840198741959940696a14c7e3c26a Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 18 Jun 2016 23:22:12 -0400 Subject: [PATCH] Delay Chunk Unloads based on Player Movement diff --git a/Spigot-Server-Patches/0134-Auto-Save-Improvements.patch b/removed/1.14/0134-Auto-Save-Improvements.patch similarity index 100% rename from Spigot-Server-Patches/0134-Auto-Save-Improvements.patch rename to removed/1.14/0134-Auto-Save-Improvements.patch diff --git a/Spigot-Server-Patches/0138-Disable-Vanilla-Chunk-GC.patch b/removed/1.14/0138-Disable-Vanilla-Chunk-GC.patch similarity index 100% rename from Spigot-Server-Patches/0138-Disable-Vanilla-Chunk-GC.patch rename to removed/1.14/0138-Disable-Vanilla-Chunk-GC.patch diff --git a/Spigot-Server-Patches/0142-Prevent-Auto-Save-if-Save-Queue-is-full.patch b/removed/1.14/0142-Prevent-Auto-Save-if-Save-Queue-is-full.patch similarity index 100% rename from Spigot-Server-Patches/0142-Prevent-Auto-Save-if-Save-Queue-is-full.patch rename to removed/1.14/0142-Prevent-Auto-Save-if-Save-Queue-is-full.patch diff --git a/Spigot-Server-Patches/0143-Chunk-Save-Stats-Debug-Option.patch b/removed/1.14/0143-Chunk-Save-Stats-Debug-Option.patch similarity index 100% rename from Spigot-Server-Patches/0143-Chunk-Save-Stats-Debug-Option.patch rename to removed/1.14/0143-Chunk-Save-Stats-Debug-Option.patch diff --git a/Spigot-Server-Patches/0161-ShulkerBox-Dupe-Prevention.patch b/removed/1.14/0161-ShulkerBox-Dupe-Prevention.patch old mode 100644 new mode 100755 similarity index 100% rename from Spigot-Server-Patches/0161-ShulkerBox-Dupe-Prevention.patch rename to removed/1.14/0161-ShulkerBox-Dupe-Prevention.patch