From 474a02835d905cafe8f83933af23eca9b7b1943f Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Wed, 7 Jun 2023 21:19:26 +0200 Subject: [PATCH] More more more work --- .../1.20}/0103-Fix-Old-Sign-Conversion.patch | 0 ...API-Replenishable-Lootables-Feature.patch} | 57 +++++---- ...-scoreboard-teams-to-scoreboard.dat.patch} | 0 ...em-property-for-disabling-watchdoge.patch} | 4 +- .../0096-Async-GameProfileCache-saving.patch} | 8 +- ...-Optional-TNT-doesn-t-move-in-water.patch} | 6 +- ...-redstone-torch-rapid-clock-removal.patch} | 4 +- .../0099-Add-server-name-parameter.patch} | 2 +- ...sounds-to-same-world-if-limiting-ra.patch} | 22 ++-- ...locking-on-Network-Manager-creation.patch} | 0 ...-profiles-that-have-no-UUID-and-no-.patch} | 0 ...etting-for-proxy-online-mode-status.patch} | 4 +- ...timise-BlockState-s-hashCode-equals.patch} | 0 ...nfigurable-packet-in-spam-threshold.patch} | 4 +- ...6-Configurable-flying-kick-messages.patch} | 2 +- .../0107-Add-EntityZapEvent.patch} | 6 +- ...entity-nbt-data-from-falling-blocks.patch} | 2 +- ...09-Cache-user-authenticator-threads.patch} | 0 ...-Allow-Reloading-of-Command-Aliases.patch} | 4 +- ...-Add-source-to-PlayerExpChangeEvent.patch} | 6 +- .../0112-Add-ProjectileCollideEvent.patch} | 4 +- ...ent-Pathfinding-out-of-World-Border.patch} | 2 +- ...mize-World.isLoaded-BlockPosition-Z.patch} | 4 +- ...Bound-Treasure-Maps-to-World-Border.patch} | 2 +- ...igurable-Cartographer-Treasure-Maps.patch} | 6 +- ...o-control-if-armour-stands-can-move.patch} | 4 +- .../0118-String-based-Action-Bar-API.patch} | 4 +- ...9-Properly-fix-item-duplication-bug.patch} | 8 +- .../0120-Firework-API-s.patch} | 4 +- .../0121-PlayerTeleportEndGatewayEvent.patch} | 2 +- ...ovide-E-TE-Chunk-count-stat-methods.patch} | 6 +- .../0123-Enforce-Sync-Player-Saves.patch} | 4 +- ...low-entities-to-ride-themselves-572.patch} | 4 +- ...I-for-Reason-Source-Triggering-play.patch} | 113 ++++++++---------- .../0126-Cap-Entity-Collisions.patch} | 8 +- ...-CraftScheduler-Async-Task-Debugger.patch} | 0 .../0128-Do-not-let-armorstands-drown.patch} | 4 +- ...e-async-calls-to-restart-the-server.patch} | 10 +- ...e-parrots-stay-on-shoulders-despite.patch} | 15 ++- ...-option-to-prevent-player-names-fro.patch} | 4 +- ...leAppender-for-console-improvements.patch} | 18 +-- ...rable-option-to-disable-creeper-lin.patch} | 6 +- .../0134-Item-canEntityPickup.patch} | 6 +- ...layerPickupItemEvent-setFlyAtPlayer.patch} | 10 +- .../0136-PlayerAttemptPickupItemEvent.patch} | 4 +- .../0120-Optimize-ItemStack.isEmpty.patch | 20 ---- 46 files changed, 183 insertions(+), 220 deletions(-) rename patches/{unapplied/server => removed/1.20}/0103-Fix-Old-Sign-Conversion.patch (100%) rename patches/{unapplied/server/0095-LootTable-API-Replenishable-Lootables-Feature.patch => server/0093-LootTable-API-Replenishable-Lootables-Feature.patch} (93%) rename patches/{unapplied/server/0096-Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch => server/0094-Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch} (100%) rename patches/{unapplied/server/0097-System-property-for-disabling-watchdoge.patch => server/0095-System-property-for-disabling-watchdoge.patch} (83%) rename patches/{unapplied/server/0098-Async-GameProfileCache-saving.patch => server/0096-Async-GameProfileCache-saving.patch} (90%) rename patches/{unapplied/server/0099-Optional-TNT-doesn-t-move-in-water.patch => server/0097-Optional-TNT-doesn-t-move-in-water.patch} (93%) rename patches/{unapplied/server/0100-Faster-redstone-torch-rapid-clock-removal.patch => server/0098-Faster-redstone-torch-rapid-clock-removal.patch} (96%) rename patches/{unapplied/server/0101-Add-server-name-parameter.patch => server/0099-Add-server-name-parameter.patch} (90%) rename patches/{unapplied/server/0102-Only-send-global-sounds-to-same-world-if-limiting-ra.patch => server/0100-Only-send-global-sounds-to-same-world-if-limiting-ra.patch} (73%) rename patches/{unapplied/server/0104-Avoid-blocking-on-Network-Manager-creation.patch => server/0101-Avoid-blocking-on-Network-Manager-creation.patch} (100%) rename patches/{unapplied/server/0105-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch => server/0102-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch} (100%) rename patches/{unapplied/server/0106-Add-setting-for-proxy-online-mode-status.patch => server/0103-Add-setting-for-proxy-online-mode-status.patch} (95%) rename patches/{unapplied/server/0107-Optimise-BlockState-s-hashCode-equals.patch => server/0104-Optimise-BlockState-s-hashCode-equals.patch} (100%) rename patches/{unapplied/server/0108-Configurable-packet-in-spam-threshold.patch => server/0105-Configurable-packet-in-spam-threshold.patch} (90%) rename patches/{unapplied/server/0109-Configurable-flying-kick-messages.patch => server/0106-Configurable-flying-kick-messages.patch} (95%) rename patches/{unapplied/server/0110-Add-EntityZapEvent.patch => server/0107-Add-EntityZapEvent.patch} (91%) rename patches/{unapplied/server/0111-Filter-bad-tile-entity-nbt-data-from-falling-blocks.patch => server/0108-Filter-bad-tile-entity-nbt-data-from-falling-blocks.patch} (91%) rename patches/{unapplied/server/0112-Cache-user-authenticator-threads.patch => server/0109-Cache-user-authenticator-threads.patch} (100%) rename patches/{unapplied/server/0113-Allow-Reloading-of-Command-Aliases.patch => server/0110-Allow-Reloading-of-Command-Aliases.patch} (90%) rename patches/{unapplied/server/0114-Add-source-to-PlayerExpChangeEvent.patch => server/0111-Add-source-to-PlayerExpChangeEvent.patch} (89%) rename patches/{unapplied/server/0115-Add-ProjectileCollideEvent.patch => server/0112-Add-ProjectileCollideEvent.patch} (92%) rename patches/{unapplied/server/0116-Prevent-Pathfinding-out-of-World-Border.patch => server/0113-Prevent-Pathfinding-out-of-World-Border.patch} (94%) rename patches/{unapplied/server/0117-Optimize-World.isLoaded-BlockPosition-Z.patch => server/0114-Optimize-World.isLoaded-BlockPosition-Z.patch} (86%) rename patches/{unapplied/server/0118-Bound-Treasure-Maps-to-World-Border.patch => server/0115-Bound-Treasure-Maps-to-World-Border.patch} (96%) rename patches/{unapplied/server/0119-Configurable-Cartographer-Treasure-Maps.patch => server/0116-Configurable-Cartographer-Treasure-Maps.patch} (95%) rename patches/{unapplied/server/0121-Add-API-methods-to-control-if-armour-stands-can-move.patch => server/0117-Add-API-methods-to-control-if-armour-stands-can-move.patch} (93%) rename patches/{unapplied/server/0122-String-based-Action-Bar-API.patch => server/0118-String-based-Action-Bar-API.patch} (94%) rename patches/{unapplied/server/0123-Properly-fix-item-duplication-bug.patch => server/0119-Properly-fix-item-duplication-bug.patch} (81%) rename patches/{unapplied/server/0124-Firework-API-s.patch => server/0120-Firework-API-s.patch} (96%) rename patches/{unapplied/server/0125-PlayerTeleportEndGatewayEvent.patch => server/0121-PlayerTeleportEndGatewayEvent.patch} (94%) rename patches/{unapplied/server/0126-Provide-E-TE-Chunk-count-stat-methods.patch => server/0122-Provide-E-TE-Chunk-count-stat-methods.patch} (92%) rename patches/{unapplied/server/0127-Enforce-Sync-Player-Saves.patch => server/0123-Enforce-Sync-Player-Saves.patch} (87%) rename patches/{unapplied/server/0128-Don-t-allow-entities-to-ride-themselves-572.patch => server/0124-Don-t-allow-entities-to-ride-themselves-572.patch} (84%) rename patches/{unapplied/server/0129-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch => server/0125-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch} (72%) rename patches/{unapplied/server/0130-Cap-Entity-Collisions.patch => server/0126-Cap-Entity-Collisions.patch} (85%) rename patches/{unapplied/server/0131-Remove-CraftScheduler-Async-Task-Debugger.patch => server/0127-Remove-CraftScheduler-Async-Task-Debugger.patch} (100%) rename patches/{unapplied/server/0132-Do-not-let-armorstands-drown.patch => server/0128-Do-not-let-armorstands-drown.patch} (83%) rename patches/{unapplied/server/0133-Properly-handle-async-calls-to-restart-the-server.patch => server/0129-Properly-handle-async-calls-to-restart-the-server.patch} (96%) rename patches/{unapplied/server/0134-Add-option-to-make-parrots-stay-on-shoulders-despite.patch => server/0130-Add-option-to-make-parrots-stay-on-shoulders-despite.patch} (74%) rename patches/{unapplied/server/0135-Add-configuration-option-to-prevent-player-names-fro.patch => server/0131-Add-configuration-option-to-prevent-player-names-fro.patch} (83%) rename patches/{unapplied/server/0136-Use-TerminalConsoleAppender-for-console-improvements.patch => server/0132-Use-TerminalConsoleAppender-for-console-improvements.patch} (97%) rename patches/{unapplied/server/0137-provide-a-configurable-option-to-disable-creeper-lin.patch => server/0133-provide-a-configurable-option-to-disable-creeper-lin.patch} (75%) rename patches/{unapplied/server/0138-Item-canEntityPickup.patch => server/0134-Item-canEntityPickup.patch} (90%) rename patches/{unapplied/server/0139-PlayerPickupItemEvent-setFlyAtPlayer.patch => server/0135-PlayerPickupItemEvent-setFlyAtPlayer.patch} (83%) rename patches/{unapplied/server/0140-PlayerAttemptPickupItemEvent.patch => server/0136-PlayerAttemptPickupItemEvent.patch} (91%) delete mode 100644 patches/unapplied/server/0120-Optimize-ItemStack.isEmpty.patch diff --git a/patches/unapplied/server/0103-Fix-Old-Sign-Conversion.patch b/patches/removed/1.20/0103-Fix-Old-Sign-Conversion.patch similarity index 100% rename from patches/unapplied/server/0103-Fix-Old-Sign-Conversion.patch rename to patches/removed/1.20/0103-Fix-Old-Sign-Conversion.patch diff --git a/patches/unapplied/server/0095-LootTable-API-Replenishable-Lootables-Feature.patch b/patches/server/0093-LootTable-API-Replenishable-Lootables-Feature.patch similarity index 93% rename from patches/unapplied/server/0095-LootTable-API-Replenishable-Lootables-Feature.patch rename to patches/server/0093-LootTable-API-Replenishable-Lootables-Feature.patch index 18a5705aa7..952ef34f2e 100644 --- a/patches/unapplied/server/0095-LootTable-API-Replenishable-Lootables-Feature.patch +++ b/patches/server/0093-LootTable-API-Replenishable-Lootables-Feature.patch @@ -490,7 +490,7 @@ index 0000000000000000000000000000000000000000..9cfa5d36a6991067a3866e0d437749fa + } +} diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 4d2491c04b587c8315173ccbcac9686f42937358..d40c4706918aa2cebc1422fba1a09c83e75e6bf7 100644 +index 09cf1125221bdbebddabfc46095c3dbd153714c1..49f465d0009b084be2a8e809c53126af1ad72cd2 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -235,6 +235,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -502,7 +502,7 @@ index 4d2491c04b587c8315173ccbcac9686f42937358..d40c4706918aa2cebc1422fba1a09c83 public CraftEntity getBukkitEntity() { diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java -index a73a4dc52467fbb5980c2d819083b9461fcb8018..08f027cdcaeeca7b545483cb8c5eb8d13e4933b9 100644 +index 0ec2db500e4a0230a91286a709b8d444d1b529f4..272095d7a09ab41227d741172735f66fd2798ce1 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecartContainer.java @@ -32,6 +32,20 @@ public abstract class AbstractMinecartContainer extends AbstractMinecart impleme @@ -542,7 +542,7 @@ index a73a4dc52467fbb5980c2d819083b9461fcb8018..08f027cdcaeeca7b545483cb8c5eb8d1 } diff --git a/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java b/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java -index 229e9923584e96b9094dfd9d10818d4ced7cdccb..3a720375c3daa961a34363f78c2c51d301c3fa06 100644 +index d88a6501917306eab57f46cb0d10dc03164a94da..e88c39d405fc7068db64ad34a03dec8d559e749e 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java @@ -65,12 +65,14 @@ public class ChestBoat extends Boat implements HasCustomInventoryScreen, Contain @@ -561,7 +561,7 @@ index 229e9923584e96b9094dfd9d10818d4ced7cdccb..3a720375c3daa961a34363f78c2c51d3 } @@ -245,6 +247,20 @@ public class ChestBoat extends Boat implements HasCustomInventoryScreen, Contain - this.level.gameEvent(GameEvent.CONTAINER_CLOSE, this.position(), GameEvent.Context.of((Entity) player)); + this.level().gameEvent(GameEvent.CONTAINER_CLOSE, this.position(), GameEvent.Context.of((Entity) player)); } + // Paper start @@ -582,7 +582,7 @@ index 229e9923584e96b9094dfd9d10818d4ced7cdccb..3a720375c3daa961a34363f78c2c51d3 public List transaction = new java.util.ArrayList(); private int maxStack = MAX_STACK; diff --git a/src/main/java/net/minecraft/world/entity/vehicle/ContainerEntity.java b/src/main/java/net/minecraft/world/entity/vehicle/ContainerEntity.java -index d5cb231495bae089b3ad21e3259ab08afbbcd46b..e30938ed1782d59177e24bb3989d87d3945af0e4 100644 +index e0fbacd574e0c83c2e1d164ded8e9ccf4af30480..94252d346c4f8dfbd1501b142ea0b6985dc8e19a 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/ContainerEntity.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/ContainerEntity.java @@ -59,7 +59,7 @@ public interface ContainerEntity extends Container, MenuProvider { @@ -603,25 +603,23 @@ index d5cb231495bae089b3ad21e3259ab08afbbcd46b..e30938ed1782d59177e24bb3989d87d3 ContainerHelper.loadAllItems(nbt, this.getItemStacks()); } -@@ -96,13 +96,15 @@ public interface ContainerEntity extends Container, MenuProvider { +@@ -96,13 +96,13 @@ public interface ContainerEntity extends Container, MenuProvider { default void unpackChestVehicleLootTable(@Nullable Player player) { - MinecraftServer minecraftServer = this.getLevel().getServer(); + MinecraftServer minecraftServer = this.level().getServer(); - if (this.getLootTable() != null && minecraftServer != null) { + if (this.getLootableData().shouldReplenish(player) && minecraftServer != null) { // Paper - LootTable lootTable = minecraftServer.getLootTables().get(this.getLootTable()); + LootTable lootTable = minecraftServer.getLootData().getLootTable(this.getLootTable()); if (player != null) { CriteriaTriggers.GENERATE_LOOT.trigger((ServerPlayer)player, this.getLootTable()); } - this.setLootTable((ResourceLocation)null); -+ // this.setLootTable((ResourceLocation)null); // Paper + this.getLootableData().processRefill(player); // Paper -+ - LootContext.Builder builder = (new LootContext.Builder((ServerLevel)this.getLevel())).withParameter(LootContextParams.ORIGIN, this.position()).withOptionalRandomSeed(this.getLootTableSeed()); + LootParams.Builder builder = (new LootParams.Builder((ServerLevel)this.level())).withParameter(LootContextParams.ORIGIN, this.position()); if (player != null) { builder.withLuck(player.getLuck()).withParameter(LootContextParams.THIS_ENTITY, player); -@@ -176,4 +178,13 @@ public interface ContainerEntity extends Container, MenuProvider { +@@ -176,4 +176,13 @@ public interface ContainerEntity extends Container, MenuProvider { default boolean isChestVehicleStillValid(Player player) { return !this.isRemoved() && this.position().closerThan(player.position(), 8.0D); } @@ -636,7 +634,7 @@ index d5cb231495bae089b3ad21e3259ab08afbbcd46b..e30938ed1782d59177e24bb3989d87d3 + // Paper end } diff --git a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java -index ce0f766fd5f4bb30102f25ed4c68efa6f3c73835..b9f0dae1ec96194fe78c086b63d8a18b1d0cfcf7 100644 +index 111494c30a2b7d8464237a92cf5c98f7f4cca19d..e11618247ad889fa8fadbb2c7addd0de94caf249 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java @@ -29,6 +29,7 @@ public abstract class RandomizableContainerBlockEntity extends BaseContainerBloc @@ -668,7 +666,7 @@ index ce0f766fd5f4bb30102f25ed4c68efa6f3c73835..b9f0dae1ec96194fe78c086b63d8a18b if (this.lootTable == null) { return false; } else { -@@ -61,18 +65,19 @@ public abstract class RandomizableContainerBlockEntity extends BaseContainerBloc +@@ -61,18 +65,18 @@ public abstract class RandomizableContainerBlockEntity extends BaseContainerBloc nbt.putLong("LootTableSeed", this.lootTableSeed); } @@ -680,17 +678,29 @@ index ce0f766fd5f4bb30102f25ed4c68efa6f3c73835..b9f0dae1ec96194fe78c086b63d8a18b public void unpackLootTable(@Nullable Player player) { - if (this.lootTable != null && this.level.getServer() != null) { + if (this.lootableData.shouldReplenish(player) && this.level.getServer() != null) { // Paper - LootTable lootTable = this.level.getServer().getLootTables().get(this.lootTable); + LootTable lootTable = this.level.getServer().getLootData().getLootTable(this.lootTable); if (player instanceof ServerPlayer) { CriteriaTriggers.GENERATE_LOOT.trigger((ServerPlayer)player, this.lootTable); } - this.lootTable = null; -+ //this.lootTable = null; // Paper + this.lootableData.processRefill(player); // Paper - LootContext.Builder builder = (new LootContext.Builder((ServerLevel)this.level)).withParameter(LootContextParams.ORIGIN, Vec3.atCenterOf(this.worldPosition)).withOptionalRandomSeed(this.lootTableSeed); + LootParams.Builder builder = (new LootParams.Builder((ServerLevel)this.level)).withParameter(LootContextParams.ORIGIN, Vec3.atCenterOf(this.worldPosition)); if (player != null) { builder.withLuck(player.getLuck()).withParameter(LootContextParams.THIS_ENTITY, player); +diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBrushableBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBrushableBlock.java +index d5bfa06a90158fb6d9cc54f7a9b44a277f2c480f..dbdf9b009a488767bb63b0867943fd932fac16e4 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBrushableBlock.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBrushableBlock.java +@@ -60,7 +60,7 @@ public class CraftBrushableBlock extends CraftBlockEntityState> trackedDataValues; // CraftBukkit start @@ -18,7 +18,7 @@ index 813994c9f4efc7611cad1633b1a1ea0c99e244d3..b3bc4af0b0be7223318e945c6eee4fe0 public ServerEntity(ServerLevel worldserver, Entity entity, int i, boolean flag, Consumer> consumer, Set trackedPlayers) { this.trackedPlayers = trackedPlayers; diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java -index ab5817df2c98d24ee627fd5cf1f71e40b044e43e..94e3ce40da0401a94a24a6c0f9e7ffa3d0ef850d 100644 +index 223cd451a952addec522711b6d3a0d6c0ab0f797..31473200264e6365fb149b11d0965f509f78218c 100644 --- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java +++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java @@ -95,6 +95,27 @@ public class PrimedTnt extends Entity implements TraceableEntity { diff --git a/patches/unapplied/server/0100-Faster-redstone-torch-rapid-clock-removal.patch b/patches/server/0098-Faster-redstone-torch-rapid-clock-removal.patch similarity index 96% rename from patches/unapplied/server/0100-Faster-redstone-torch-rapid-clock-removal.patch rename to patches/server/0098-Faster-redstone-torch-rapid-clock-removal.patch index 85d53edff4..d0be5a7ad9 100644 --- a/patches/unapplied/server/0100-Faster-redstone-torch-rapid-clock-removal.patch +++ b/patches/server/0098-Faster-redstone-torch-rapid-clock-removal.patch @@ -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/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index ebad2e1bac84bade6dd2b893de832b77705a6f57..7ea68dc8e8bf3795013acbbde0c55a9ff833dfbd 100644 +index dc84da6d6036802792cf9a31bb219cc24bb9e57b..9ac9a40e442a30b785ba79e015389f3308ae37c3 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -174,6 +174,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -173,6 +173,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { private org.spigotmc.TickLimiter tileLimiter; private int tileTickPosition; public final Map explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions diff --git a/patches/unapplied/server/0101-Add-server-name-parameter.patch b/patches/server/0099-Add-server-name-parameter.patch similarity index 90% rename from patches/unapplied/server/0101-Add-server-name-parameter.patch rename to patches/server/0099-Add-server-name-parameter.patch index f2e3b715a9..1f3f4ef7b9 100644 --- a/patches/unapplied/server/0101-Add-server-name-parameter.patch +++ b/patches/server/0099-Add-server-name-parameter.patch @@ -5,7 +5,7 @@ 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 2d1df61cc7ec645add8f729cc6cfdea0c56755aa..34dc3555dbff9942a3ee39b27da44831f280b5a8 100644 +index a20eaa9b1d030ccd7e1fc49df47acee46f4e7e20..b96652b7bcad07c39a81858c1a2c285efbf67905 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -166,6 +166,14 @@ public class Main { diff --git a/patches/unapplied/server/0102-Only-send-global-sounds-to-same-world-if-limiting-ra.patch b/patches/server/0100-Only-send-global-sounds-to-same-world-if-limiting-ra.patch similarity index 73% rename from patches/unapplied/server/0102-Only-send-global-sounds-to-same-world-if-limiting-ra.patch rename to patches/server/0100-Only-send-global-sounds-to-same-world-if-limiting-ra.patch index 7808ba83d9..87410a6096 100644 --- a/patches/unapplied/server/0102-Only-send-global-sounds-to-same-world-if-limiting-ra.patch +++ b/patches/server/0100-Only-send-global-sounds-to-same-world-if-limiting-ra.patch @@ -7,33 +7,33 @@ Co-authored-by: Evan McCarthy Co-authored-by: lexikiq diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java -index 6c951d25de5fb9301daf46fb412dd766e90c6379..039a5246a2e9a5e84f3b712f1d138053605b33ec 100644 +index 29798faa9cc9aead40e3329307dc63cb7bf838b6..27f99f9ce39aac0bae5e9a7b34fd63833aa4ad26 100644 --- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java +++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java -@@ -656,7 +656,7 @@ public class EnderDragon extends Mob implements Enemy { +@@ -689,7 +689,7 @@ public class EnderDragon extends Mob implements Enemy { // CraftBukkit start - Use relative location for far away sounds - // this.world.b(1028, this.getChunkCoordinates(), 0); - int viewDistance = ((ServerLevel) this.level).getCraftServer().getViewDistance() * 16; -- for (net.minecraft.server.level.ServerPlayer player : this.level.getServer().getPlayerList().players) { -+ for (net.minecraft.server.level.ServerPlayer player : level.spigotConfig.dragonDeathSoundRadius > 0 ? ((ServerLevel) level).players() : level.getServer().getPlayerList().players) { // Paper + // this.level().globalLevelEvent(1028, this.blockPosition(), 0); + int viewDistance = ((ServerLevel) this.level()).getCraftServer().getViewDistance() * 16; +- for (net.minecraft.server.level.ServerPlayer player : this.level().getServer().getPlayerList().players) { ++ for (net.minecraft.server.level.ServerPlayer player : this.level().spigotConfig.dragonDeathSoundRadius > 0 ? ((ServerLevel) this.level()).players() : this.level().getServer().getPlayerList().players) { // Paper double deltaX = this.getX() - player.getX(); double deltaZ = this.getZ() - player.getZ(); double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java -index e6f51c5cc960de30be32df45c1f01d7b4cf314ed..2cbcd304b1117d4791d7e32d7738c12cfd4d1c9e 100644 +index e23347faf763f22301136a013034367ac847c35b..4576c96f85fe5a614a78e53926dfbc2705618423 100644 --- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java +++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java @@ -271,7 +271,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob // CraftBukkit start - Use relative location for far away sounds - // this.world.globalLevelEvent(1023, new BlockPosition(this), 0); - int viewDistance = ((ServerLevel) this.level).getCraftServer().getViewDistance() * 16; + // this.level().globalLevelEvent(1023, new BlockPosition(this), 0); + int viewDistance = ((ServerLevel) this.level()).getCraftServer().getViewDistance() * 16; - for (ServerPlayer player : (List) MinecraftServer.getServer().getPlayerList().players) { -+ for (ServerPlayer player : level.spigotConfig.witherSpawnSoundRadius > 0 ? ((ServerLevel) level).players() : level.getServer().getPlayerList().players) { // Paper ++ for (ServerPlayer player : this.level().spigotConfig.witherSpawnSoundRadius > 0 ? ((ServerLevel) this.level()).players() : this.level().getServer().getPlayerList().players) { // Paper double deltaX = this.getX() - player.getX(); double deltaZ = this.getZ() - player.getZ(); double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; diff --git a/src/main/java/net/minecraft/world/item/EnderEyeItem.java b/src/main/java/net/minecraft/world/item/EnderEyeItem.java -index a88ffff41481d346a99762352094cdb4e8dd6cc2..e0c3aa1285709a40ff0ea8c1d74d43d2b341aecc 100644 +index 5bc68514a1e8a212e2681f06b918548c0ec565b6..1fddc9025a9e5079f05dd6c86f6ca43c5d51d9c3 100644 --- a/src/main/java/net/minecraft/world/item/EnderEyeItem.java +++ b/src/main/java/net/minecraft/world/item/EnderEyeItem.java @@ -64,7 +64,7 @@ public class EnderEyeItem extends Item { diff --git a/patches/unapplied/server/0104-Avoid-blocking-on-Network-Manager-creation.patch b/patches/server/0101-Avoid-blocking-on-Network-Manager-creation.patch similarity index 100% rename from patches/unapplied/server/0104-Avoid-blocking-on-Network-Manager-creation.patch rename to patches/server/0101-Avoid-blocking-on-Network-Manager-creation.patch diff --git a/patches/unapplied/server/0105-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch b/patches/server/0102-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch similarity index 100% rename from patches/unapplied/server/0105-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch rename to patches/server/0102-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch diff --git a/patches/unapplied/server/0106-Add-setting-for-proxy-online-mode-status.patch b/patches/server/0103-Add-setting-for-proxy-online-mode-status.patch similarity index 95% rename from patches/unapplied/server/0106-Add-setting-for-proxy-online-mode-status.patch rename to patches/server/0103-Add-setting-for-proxy-online-mode-status.patch index d7f2c9730c..d7841040d8 100644 --- a/patches/unapplied/server/0106-Add-setting-for-proxy-online-mode-status.patch +++ b/patches/server/0103-Add-setting-for-proxy-online-mode-status.patch @@ -43,10 +43,10 @@ index da98f074ccd5a40c635824112c97fd174c393cb1..6599f874d9f97e9ef4862039ecad7277 } 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 cf9db3ed2c9caba0bd40d310aaf1cc10603926c4..f526b2701756062ef17ed0496685c4ac2d6288a6 100644 +index bc0bff6f06a74e2bb3f00fac2fdcc543bc970c2f..0b9eccd6bfb90fe282a9ce48dbf6379c717ec83a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1737,7 +1737,7 @@ public final class CraftServer implements Server { +@@ -1735,7 +1735,7 @@ public final class CraftServer implements Server { // Spigot Start GameProfile profile = null; // Only fetch an online UUID in online mode diff --git a/patches/unapplied/server/0107-Optimise-BlockState-s-hashCode-equals.patch b/patches/server/0104-Optimise-BlockState-s-hashCode-equals.patch similarity index 100% rename from patches/unapplied/server/0107-Optimise-BlockState-s-hashCode-equals.patch rename to patches/server/0104-Optimise-BlockState-s-hashCode-equals.patch diff --git a/patches/unapplied/server/0108-Configurable-packet-in-spam-threshold.patch b/patches/server/0105-Configurable-packet-in-spam-threshold.patch similarity index 90% rename from patches/unapplied/server/0108-Configurable-packet-in-spam-threshold.patch rename to patches/server/0105-Configurable-packet-in-spam-threshold.patch index 6bb43dba02..b83b05934c 100644 --- a/patches/unapplied/server/0108-Configurable-packet-in-spam-threshold.patch +++ b/patches/server/0105-Configurable-packet-in-spam-threshold.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Configurable packet in spam threshold diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 20b9fa814d85b83d46714f4d3743647af473acb6..97996eb06efdf275f34f4aba14b0e377d4515ccf 100644 +index c65282a85e2822b86f56c528ab838e628ea27411..96e38a914db34ed165bd5071585bc7e5ec7fb41d 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1596,13 +1596,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1588,13 +1588,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic // Spigot start - limit place/interactions private int limitedPackets; private long lastLimitedPacket = -1; diff --git a/patches/unapplied/server/0109-Configurable-flying-kick-messages.patch b/patches/server/0106-Configurable-flying-kick-messages.patch similarity index 95% rename from patches/unapplied/server/0109-Configurable-flying-kick-messages.patch rename to patches/server/0106-Configurable-flying-kick-messages.patch index c390ccb293..dba9db70eb 100644 --- a/patches/unapplied/server/0109-Configurable-flying-kick-messages.patch +++ b/patches/server/0106-Configurable-flying-kick-messages.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Configurable flying kick messages diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 97996eb06efdf275f34f4aba14b0e377d4515ccf..fcb56b5c3eb2aa7de373fc3f1f410e5e5e287765 100644 +index 96e38a914db34ed165bd5071585bc7e5ec7fb41d..590880b71c3c1930eb84538af5f6c3b690bb690f 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -355,7 +355,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic diff --git a/patches/unapplied/server/0110-Add-EntityZapEvent.patch b/patches/server/0107-Add-EntityZapEvent.patch similarity index 91% rename from patches/unapplied/server/0110-Add-EntityZapEvent.patch rename to patches/server/0107-Add-EntityZapEvent.patch index 5659e3e59d..2f10f3924c 100644 --- a/patches/unapplied/server/0110-Add-EntityZapEvent.patch +++ b/patches/server/0107-Add-EntityZapEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add EntityZapEvent diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java -index efbf6b316a70b94e4bd490df8ebe77cd9f638ba4..cad8854cc7523d60c06ca1f03bfd4fbff984087c 100644 +index f9704b20e71564ac721a24655b2792c689edf6ba..e04f3f1159c5d5fa2e3956a36e95f8afb5a1d4aa 100644 --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java -@@ -849,10 +849,17 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -850,10 +850,17 @@ public class Villager extends AbstractVillager implements ReputationEventHandler @Override public void thunderHit(ServerLevel world, LightningBolt lightning) { if (world.getDifficulty() != Difficulty.PEACEFUL) { @@ -28,7 +28,7 @@ index efbf6b316a70b94e4bd490df8ebe77cd9f638ba4..cad8854cc7523d60c06ca1f03bfd4fbf entitywitch.finalizeSpawn(world, world.getCurrentDifficultyAt(entitywitch.blockPosition()), MobSpawnType.CONVERSION, (SpawnGroupData) null, (CompoundTag) 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 f1dc8eaa571f54e5885ceada9929d965992d7760..04b5b28e9127a0e94515d261f6d7d34230cbf447 100644 +index 1b9a08098199f305606289724ee047e8075ffcea..8d9b25f3c8c840baf9c203f80d46201434920aa5 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -1189,6 +1189,14 @@ public class CraftEventFactory { diff --git a/patches/unapplied/server/0111-Filter-bad-tile-entity-nbt-data-from-falling-blocks.patch b/patches/server/0108-Filter-bad-tile-entity-nbt-data-from-falling-blocks.patch similarity index 91% rename from patches/unapplied/server/0111-Filter-bad-tile-entity-nbt-data-from-falling-blocks.patch rename to patches/server/0108-Filter-bad-tile-entity-nbt-data-from-falling-blocks.patch index 97e3512461..d831859ba8 100644 --- a/patches/unapplied/server/0111-Filter-bad-tile-entity-nbt-data-from-falling-blocks.patch +++ b/patches/server/0108-Filter-bad-tile-entity-nbt-data-from-falling-blocks.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Filter bad tile entity nbt data from falling blocks diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java -index 5e93e55df24941a21721295ef8a3381ae19e1f26..d5c30c48a6b59b01041dffc8b4b7b70ea27f0c7d 100644 +index 4488d112b280a2020712708940adf65b69ca0a3c..d859e01a6cc4225c514c4023b8adc066e73d3bb7 100644 --- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java @@ -332,7 +332,7 @@ public class FallingBlockEntity extends Entity { diff --git a/patches/unapplied/server/0112-Cache-user-authenticator-threads.patch b/patches/server/0109-Cache-user-authenticator-threads.patch similarity index 100% rename from patches/unapplied/server/0112-Cache-user-authenticator-threads.patch rename to patches/server/0109-Cache-user-authenticator-threads.patch diff --git a/patches/unapplied/server/0113-Allow-Reloading-of-Command-Aliases.patch b/patches/server/0110-Allow-Reloading-of-Command-Aliases.patch similarity index 90% rename from patches/unapplied/server/0113-Allow-Reloading-of-Command-Aliases.patch rename to patches/server/0110-Allow-Reloading-of-Command-Aliases.patch index 374e5cfdad..1e7c3bd392 100644 --- a/patches/unapplied/server/0113-Allow-Reloading-of-Command-Aliases.patch +++ b/patches/server/0110-Allow-Reloading-of-Command-Aliases.patch @@ -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 f526b2701756062ef17ed0496685c4ac2d6288a6..ded2e2df6bed222779a39e6f3cfd9170fdc0b494 100644 +index 0b9eccd6bfb90fe282a9ce48dbf6379c717ec83a..3d6c25424c859f63c8f4661b39c82c269c3837fb 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2631,5 +2631,24 @@ public final class CraftServer implements Server { +@@ -2629,5 +2629,24 @@ public final class CraftServer implements Server { DefaultPermissions.registerCorePermissions(); CraftDefaultPermissions.registerCorePermissions(); } diff --git a/patches/unapplied/server/0114-Add-source-to-PlayerExpChangeEvent.patch b/patches/server/0111-Add-source-to-PlayerExpChangeEvent.patch similarity index 89% rename from patches/unapplied/server/0114-Add-source-to-PlayerExpChangeEvent.patch rename to patches/server/0111-Add-source-to-PlayerExpChangeEvent.patch index 3c14c471ea..b85cdb8ac7 100644 --- a/patches/unapplied/server/0114-Add-source-to-PlayerExpChangeEvent.patch +++ b/patches/server/0111-Add-source-to-PlayerExpChangeEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add source to PlayerExpChangeEvent diff --git a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java -index 588deb938ca710de33bb42bb02c7015b8cbd8eef..f9ccde41eb20c1d53c438ddb40ca7cc5d2b89836 100644 +index 93c83cfedc7d3a169ad0504aa6e63f600873501b..9dffdfe5bbd0517e9a2c6a6770eea07b43ef9b33 100644 --- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java +++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java -@@ -249,7 +249,7 @@ public class ExperienceOrb extends Entity { +@@ -254,7 +254,7 @@ public class ExperienceOrb extends Entity { int i = this.repairPlayerItems(player, this.value); if (i > 0) { @@ -18,7 +18,7 @@ index 588deb938ca710de33bb42bb02c7015b8cbd8eef..f9ccde41eb20c1d53c438ddb40ca7cc5 --this.count; diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 04b5b28e9127a0e94515d261f6d7d34230cbf447..87da5cfb3be65c57ada7dbfc1f345f27533df064 100644 +index 8d9b25f3c8c840baf9c203f80d46201434920aa5..09d11ea7905a5760ab5ee63e5976d67fb6392bed 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -1148,6 +1148,17 @@ public class CraftEventFactory { diff --git a/patches/unapplied/server/0115-Add-ProjectileCollideEvent.patch b/patches/server/0112-Add-ProjectileCollideEvent.patch similarity index 92% rename from patches/unapplied/server/0115-Add-ProjectileCollideEvent.patch rename to patches/server/0112-Add-ProjectileCollideEvent.patch index 4b25053508..5de3c13ece 100644 --- a/patches/unapplied/server/0115-Add-ProjectileCollideEvent.patch +++ b/patches/server/0112-Add-ProjectileCollideEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add ProjectileCollideEvent Deprecated now and replaced with ProjectileHitEvent diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 87da5cfb3be65c57ada7dbfc1f345f27533df064..64ddab11cc8bd9e8063450f2bec22a4277e49414 100644 +index 09d11ea7905a5760ab5ee63e5976d67fb6392bed..beacc9af36eface8cf855ee15fb7bcf7e08f9439 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -1292,6 +1292,17 @@ public class CraftEventFactory { @@ -40,6 +40,6 @@ index 87da5cfb3be65c57ada7dbfc1f345f27533df064..64ddab11cc8bd9e8063450f2bec22a42 ProjectileHitEvent event = new ProjectileHitEvent((Projectile) entity.getBukkitEntity(), hitEntity, hitBlock, hitFace); + event.setCancelled(cancelled); // Paper - propagate legacy event cancellation to modern event - entity.level.getCraftServer().getPluginManager().callEvent(event); + entity.level().getCraftServer().getPluginManager().callEvent(event); return event; } diff --git a/patches/unapplied/server/0116-Prevent-Pathfinding-out-of-World-Border.patch b/patches/server/0113-Prevent-Pathfinding-out-of-World-Border.patch similarity index 94% rename from patches/unapplied/server/0116-Prevent-Pathfinding-out-of-World-Border.patch rename to patches/server/0113-Prevent-Pathfinding-out-of-World-Border.patch index ab2c4ff13d..8df27e5e5d 100644 --- a/patches/unapplied/server/0116-Prevent-Pathfinding-out-of-World-Border.patch +++ b/patches/server/0113-Prevent-Pathfinding-out-of-World-Border.patch @@ -13,7 +13,7 @@ by adding code to all overrides in: to return BLOCKED if it is outside the world border. diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java -index 64b64fb0b72eccade63fac99b7b363aafe59169b..46c2885097ab768bb9d62187fe0ad2d61007d353 100644 +index de87f2e7b8a1662767bab4b0c86ee7cf014ed5cf..eb10ecb4dde7a3df869307fd96c652eb62a8f83e 100644 --- a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java +++ b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java @@ -158,7 +158,7 @@ public abstract class PathNavigation { diff --git a/patches/unapplied/server/0117-Optimize-World.isLoaded-BlockPosition-Z.patch b/patches/server/0114-Optimize-World.isLoaded-BlockPosition-Z.patch similarity index 86% rename from patches/unapplied/server/0117-Optimize-World.isLoaded-BlockPosition-Z.patch rename to patches/server/0114-Optimize-World.isLoaded-BlockPosition-Z.patch index 294953144f..5e094d358a 100644 --- a/patches/unapplied/server/0117-Optimize-World.isLoaded-BlockPosition-Z.patch +++ b/patches/server/0114-Optimize-World.isLoaded-BlockPosition-Z.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Optimize World.isLoaded(BlockPosition)Z Reduce method invocations for World.isLoaded(BlockPosition)Z diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 7ea68dc8e8bf3795013acbbde0c55a9ff833dfbd..1a0accca970ca5eb895c63c5a45a5261440d0e12 100644 +index 9ac9a40e442a30b785ba79e015389f3308ae37c3..2bf5dffc7f392278bff9f07e97bef95ba786a916 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -344,6 +344,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -343,6 +343,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable { return chunk == null ? null : chunk.getFluidState(blockposition); } diff --git a/patches/unapplied/server/0118-Bound-Treasure-Maps-to-World-Border.patch b/patches/server/0115-Bound-Treasure-Maps-to-World-Border.patch similarity index 96% rename from patches/unapplied/server/0118-Bound-Treasure-Maps-to-World-Border.patch rename to patches/server/0115-Bound-Treasure-Maps-to-World-Border.patch index ebccf361c8..0395512caa 100644 --- a/patches/unapplied/server/0118-Bound-Treasure-Maps-to-World-Border.patch +++ b/patches/server/0115-Bound-Treasure-Maps-to-World-Border.patch @@ -34,7 +34,7 @@ index 52325a99ea38530ad69a39ac0215233139f35268..dd74e8a034022fe72a1652f92712182b return (double) pos.getMaxBlockX() > this.getMinX() && (double) pos.getMinBlockX() < this.getMaxX() && (double) pos.getMaxBlockZ() > this.getMinZ() && (double) pos.getMinBlockZ() < this.getMaxZ(); } diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java -index 5ca3987683f7cecbce24bac434dc387bb5e9bf08..56033c41c2be567d6787420d319d4603fc0a1d10 100644 +index 8bb14230beb4b012f38997eec70934b96bae4db5..d19585f0833d13867f242768dc7ed952add87e05 100644 --- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java @@ -217,6 +217,7 @@ public abstract class ChunkGenerator { diff --git a/patches/unapplied/server/0119-Configurable-Cartographer-Treasure-Maps.patch b/patches/server/0116-Configurable-Cartographer-Treasure-Maps.patch similarity index 95% rename from patches/unapplied/server/0119-Configurable-Cartographer-Treasure-Maps.patch rename to patches/server/0116-Configurable-Cartographer-Treasure-Maps.patch index bd827dfdda..b28084eadf 100644 --- a/patches/unapplied/server/0119-Configurable-Cartographer-Treasure-Maps.patch +++ b/patches/server/0116-Configurable-Cartographer-Treasure-Maps.patch @@ -9,13 +9,13 @@ 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/net/minecraft/world/entity/npc/VillagerTrades.java b/src/main/java/net/minecraft/world/entity/npc/VillagerTrades.java -index baaaac692df14a7ef66c3fa3bacaf7108d0712da..abb39a5b9d9ce50dbba80661f5c63dc9f31b784a 100644 +index c29d488d223d817f46bf777656a0c737916c4416..518ef9867421ed9c489fbf5f15e9cbdcaceef6a5 100644 --- a/src/main/java/net/minecraft/world/entity/npc/VillagerTrades.java +++ b/src/main/java/net/minecraft/world/entity/npc/VillagerTrades.java -@@ -387,7 +387,8 @@ public class VillagerTrades { +@@ -386,7 +386,8 @@ public class VillagerTrades { return null; } else { - ServerLevel serverLevel = (ServerLevel)entity.level; + ServerLevel serverLevel = (ServerLevel)entity.level(); - BlockPos blockPos = serverLevel.findNearestMapStructure(this.destination, entity.blockPosition(), 100, true); + if (!serverLevel.paperConfig().environment.treasureMaps.enabled) return null; // Paper + BlockPos blockPos = serverLevel.findNearestMapStructure(this.destination, entity.blockPosition(), 100, !serverLevel.paperConfig().environment.treasureMaps.findAlreadyDiscoveredVillager); // Paper diff --git a/patches/unapplied/server/0121-Add-API-methods-to-control-if-armour-stands-can-move.patch b/patches/server/0117-Add-API-methods-to-control-if-armour-stands-can-move.patch similarity index 93% rename from patches/unapplied/server/0121-Add-API-methods-to-control-if-armour-stands-can-move.patch rename to patches/server/0117-Add-API-methods-to-control-if-armour-stands-can-move.patch index cf45718015..5ecdd621ee 100644 --- a/patches/unapplied/server/0121-Add-API-methods-to-control-if-armour-stands-can-move.patch +++ b/patches/server/0117-Add-API-methods-to-control-if-armour-stands-can-move.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add API methods to control if armour stands can move diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java -index 426364e0d47c022000813d2945a98d9edb6f6028..970beff5d2c5b3ba3e3b733183d6876d8bc37da9 100644 +index af6a2e8c4ce41aaf55b645c37f809c2de7ea780a..be7ed906b4a5a8ffda87ecf66f967061b58f8034 100644 --- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java @@ -92,6 +92,7 @@ public class ArmorStand extends LivingEntity { @@ -16,7 +16,7 @@ index 426364e0d47c022000813d2945a98d9edb6f6028..970beff5d2c5b3ba3e3b733183d6876d public ArmorStand(EntityType type, Level world) { super(type, world); -@@ -943,4 +944,13 @@ public class ArmorStand extends LivingEntity { +@@ -942,4 +943,13 @@ public class ArmorStand extends LivingEntity { public boolean canBeSeenByAnyone() { return !this.isInvisible() && !this.isMarker(); } diff --git a/patches/unapplied/server/0122-String-based-Action-Bar-API.patch b/patches/server/0118-String-based-Action-Bar-API.patch similarity index 94% rename from patches/unapplied/server/0122-String-based-Action-Bar-API.patch rename to patches/server/0118-String-based-Action-Bar-API.patch index e9f2445fe9..7cee02fda1 100644 --- a/patches/unapplied/server/0122-String-based-Action-Bar-API.patch +++ b/patches/server/0118-String-based-Action-Bar-API.patch @@ -26,10 +26,10 @@ index 32ef3edebe94a2014168b7e438752a80b2687e5f..ab6c58eed6707ab7b0aa3e7549a871ad // Paper end buf.writeComponent(this.text); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 16dc9546303d692c62b6a1538106019f6bbe149b..d9205d45b72c5d36feeb4da8a70532eaf0ff215f 100644 +index 55715c017e4e08a0e3db95dea5b8ec4fd4acf00d..2dc0233821172a91f471bf7099f2c051c11331e6 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -364,6 +364,29 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -289,6 +289,29 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // Paper start diff --git a/patches/unapplied/server/0123-Properly-fix-item-duplication-bug.patch b/patches/server/0119-Properly-fix-item-duplication-bug.patch similarity index 81% rename from patches/unapplied/server/0123-Properly-fix-item-duplication-bug.patch rename to patches/server/0119-Properly-fix-item-duplication-bug.patch index e374d16f4e..66162b379b 100644 --- a/patches/unapplied/server/0123-Properly-fix-item-duplication-bug.patch +++ b/patches/server/0119-Properly-fix-item-duplication-bug.patch @@ -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/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index fef0ce65c01fd56a0ed62de27e8d8457324bb295..7395cdcf618033f10482001cb9e2a7727e1e8bb2 100644 +index d834b6570c9a45fb415afc19262c8735463c27d9..8b35e6804aba52865bda5d9f17ca5cb8576fba6f 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -2307,7 +2307,7 @@ public class ServerPlayer extends Player { +@@ -2350,7 +2350,7 @@ public class ServerPlayer extends Player { @Override public boolean isImmobile() { @@ -19,10 +19,10 @@ index fef0ce65c01fd56a0ed62de27e8d8457324bb295..7395cdcf618033f10482001cb9e2a772 @Override diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 7e24a354a513a452aa1f7babb3ee402de8f6e72d..ba493c748c810e4ba452d59bcf8f1b7599f09b04 100644 +index 590880b71c3c1930eb84538af5f6c3b690bb690f..ec78328916a7cc544fea868afc904208d446739f 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -3186,7 +3186,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -3142,7 +3142,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } public final boolean isDisconnected() { diff --git a/patches/unapplied/server/0124-Firework-API-s.patch b/patches/server/0120-Firework-API-s.patch similarity index 96% rename from patches/unapplied/server/0124-Firework-API-s.patch rename to patches/server/0120-Firework-API-s.patch index 1b23b10a05..ac1814d178 100644 --- a/patches/unapplied/server/0124-Firework-API-s.patch +++ b/patches/server/0120-Firework-API-s.patch @@ -7,7 +7,7 @@ Subject: [PATCH] Firework API's public net.minecraft.world.entity.projectile.FireworkRocketEntity attachedToEntity diff --git a/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java b/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java -index 26a7e2fb8d403c748925bc34a0a9b0e63a6c3452..fca27f98989bf106060ba08196255fe32f850df5 100644 +index b16add0be6ac782a7e40be0cdeea4c1829a19d4e..288910fb168ddc5d3a61971778b8038a56772fa8 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java +++ b/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java @@ -38,6 +38,7 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier { @@ -44,7 +44,7 @@ index 26a7e2fb8d403c748925bc34a0a9b0e63a6c3452..fca27f98989bf106060ba08196255fe3 @Override diff --git a/src/main/java/net/minecraft/world/item/CrossbowItem.java b/src/main/java/net/minecraft/world/item/CrossbowItem.java -index 98b353d059aa0a08d41973344ee0b56cde90b8be..e6249409d01aee2bdc84821d40ce4551c102d307 100644 +index da12a95c230129a3a57dc3d2d7d64012dd8bbae6..9bea5e94c246d843f3d67680ffb57075bd9d3467 100644 --- a/src/main/java/net/minecraft/world/item/CrossbowItem.java +++ b/src/main/java/net/minecraft/world/item/CrossbowItem.java @@ -221,6 +221,7 @@ public class CrossbowItem extends ProjectileWeaponItem implements Vanishable { diff --git a/patches/unapplied/server/0125-PlayerTeleportEndGatewayEvent.patch b/patches/server/0121-PlayerTeleportEndGatewayEvent.patch similarity index 94% rename from patches/unapplied/server/0125-PlayerTeleportEndGatewayEvent.patch rename to patches/server/0121-PlayerTeleportEndGatewayEvent.patch index 98163ff384..cb1489e15c 100644 --- a/patches/unapplied/server/0125-PlayerTeleportEndGatewayEvent.patch +++ b/patches/server/0121-PlayerTeleportEndGatewayEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] PlayerTeleportEndGatewayEvent Allows you to access the Gateway being used in a teleport event diff --git a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java -index 904e23ad2f148f991ab8d94e5d8d989cdc98268a..7d2b15edbd1a6bf663c29b7bc63c73d34fefd999 100644 +index 97c57619ebcf31f17f8430ffb68043771d1377f9..9f685b4fe6d57d921e9e7a4d817e0913b863c0ad 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java @@ -12,6 +12,7 @@ import net.minecraft.data.worldgen.features.EndFeatures; diff --git a/patches/unapplied/server/0126-Provide-E-TE-Chunk-count-stat-methods.patch b/patches/server/0122-Provide-E-TE-Chunk-count-stat-methods.patch similarity index 92% rename from patches/unapplied/server/0126-Provide-E-TE-Chunk-count-stat-methods.patch rename to patches/server/0122-Provide-E-TE-Chunk-count-stat-methods.patch index 1470d48e7a..d670f72001 100644 --- a/patches/unapplied/server/0126-Provide-E-TE-Chunk-count-stat-methods.patch +++ b/patches/server/0122-Provide-E-TE-Chunk-count-stat-methods.patch @@ -7,10 +7,10 @@ Provides counts without the ineffeciency of using .getEntities().size() which creates copy of the collections. diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 1a0accca970ca5eb895c63c5a45a5261440d0e12..35eecb719a813fda6113da24a858188aef31466b 100644 +index 2bf5dffc7f392278bff9f07e97bef95ba786a916..3d04a9f0e9dd14e34c82c0b6225a6ee6d464ee5c 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -117,7 +117,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -116,7 +116,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public static final int TICKS_PER_DAY = 24000; public static final int MAX_ENTITY_SPAWN_Y = 20000000; public static final int MIN_ENTITY_SPAWN_Y = -20000000; @@ -20,7 +20,7 @@ index 1a0accca970ca5eb895c63c5a45a5261440d0e12..35eecb719a813fda6113da24a858188a private final List pendingBlockEntityTickers = Lists.newArrayList(); private boolean tickingBlockEntities; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 61189dc031be93f2cd0a819598049fcb5e2ed6bc..632cc1e185b61677d42405d212f41833ee1bc9d4 100644 +index 1440b6b8b71ece71b076601752b06bdcff45542f..1278b114db828606dcd2f70c8f0ab53da490c19f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -155,6 +155,56 @@ public class CraftWorld extends CraftRegionAccessor implements World { diff --git a/patches/unapplied/server/0127-Enforce-Sync-Player-Saves.patch b/patches/server/0123-Enforce-Sync-Player-Saves.patch similarity index 87% rename from patches/unapplied/server/0127-Enforce-Sync-Player-Saves.patch rename to patches/server/0123-Enforce-Sync-Player-Saves.patch index 309ffb9171..652cff63b4 100644 --- a/patches/unapplied/server/0127-Enforce-Sync-Player-Saves.patch +++ b/patches/server/0123-Enforce-Sync-Player-Saves.patch @@ -7,10 +7,10 @@ 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/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 1cd7a99a6280975dac96a33b077b372d358f967c..4066a3c6b032d13e4c303b10b012f1224925710f 100644 +index 1fa3e06326a871d2d9562433c31e3b17a80fd08c..985b23356a7b5a18b358b5bedd21c5fdd57d6504 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -1062,11 +1062,13 @@ public abstract class PlayerList { +@@ -1069,11 +1069,13 @@ public abstract class PlayerList { } public void saveAll() { diff --git a/patches/unapplied/server/0128-Don-t-allow-entities-to-ride-themselves-572.patch b/patches/server/0124-Don-t-allow-entities-to-ride-themselves-572.patch similarity index 84% rename from patches/unapplied/server/0128-Don-t-allow-entities-to-ride-themselves-572.patch rename to patches/server/0124-Don-t-allow-entities-to-ride-themselves-572.patch index bd6c93d1d0..c435a11785 100644 --- a/patches/unapplied/server/0128-Don-t-allow-entities-to-ride-themselves-572.patch +++ b/patches/server/0124-Don-t-allow-entities-to-ride-themselves-572.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Don't allow entities to ride themselves - #572 diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index d40c4706918aa2cebc1422fba1a09c83e75e6bf7..368a6d73c94addcf948e7cf8f3a026ab2017731e 100644 +index 49f465d0009b084be2a8e809c53126af1ad72cd2..20d5a46c4022dfea24f275fe143c32b8ddf629cb 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2418,6 +2418,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -2485,6 +2485,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } protected boolean addPassenger(Entity entity) { // CraftBukkit diff --git a/patches/unapplied/server/0129-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch b/patches/server/0125-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch similarity index 72% rename from patches/unapplied/server/0129-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch rename to patches/server/0125-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch index 4d3809cf68..1062db0e08 100644 --- a/patches/unapplied/server/0129-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch +++ b/patches/server/0125-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch @@ -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/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -index 2f21c7920148b812c48da95168fbc63b86b86c9c..fc42bc68ae31f4fad1c382ef3d3c482c1f335f52 100644 +index b1fcdd896fe76fc96f94b626c5a8ffbcce8008ef..2e3b1eb4c4303d40f12c2e80f0608f2308225e97 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java @@ -427,7 +427,7 @@ public class ServerPlayerGameMode { @@ -21,7 +21,7 @@ index 2f21c7920148b812c48da95168fbc63b86b86c9c..fc42bc68ae31f4fad1c382ef3d3c482c return true; diff --git a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java -index f9ccde41eb20c1d53c438ddb40ca7cc5d2b89836..e952aae85a80a020087c3697624c8c13eab3f914 100644 +index 9dffdfe5bbd0517e9a2c6a6770eea07b43ef9b33..558b09a482da3035e37c108e60e9d08849017a8d 100644 --- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java +++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java @@ -39,13 +39,65 @@ public class ExperienceOrb extends Entity { @@ -92,7 +92,7 @@ index f9ccde41eb20c1d53c438ddb40ca7cc5d2b89836..e952aae85a80a020087c3697624c8c13 } public ExperienceOrb(EntityType type, Level world) { -@@ -155,12 +207,20 @@ public class ExperienceOrb extends Entity { +@@ -160,12 +212,20 @@ public class ExperienceOrb extends Entity { } public static void award(ServerLevel world, Vec3 pos, int amount) { @@ -114,7 +114,7 @@ index f9ccde41eb20c1d53c438ddb40ca7cc5d2b89836..e952aae85a80a020087c3697624c8c13 } } -@@ -230,6 +290,7 @@ public class ExperienceOrb extends Entity { +@@ -235,6 +295,7 @@ public class ExperienceOrb extends Entity { nbt.putShort("Age", (short) this.age); nbt.putShort("Value", (short) this.value); nbt.putInt("Count", this.count); @@ -122,7 +122,7 @@ index f9ccde41eb20c1d53c438ddb40ca7cc5d2b89836..e952aae85a80a020087c3697624c8c13 } @Override -@@ -238,6 +299,7 @@ public class ExperienceOrb extends Entity { +@@ -243,6 +304,7 @@ public class ExperienceOrb extends Entity { this.age = nbt.getShort("Age"); this.value = nbt.getShort("Value"); this.count = Math.max(nbt.getInt("Count"), 1); @@ -131,34 +131,34 @@ index f9ccde41eb20c1d53c438ddb40ca7cc5d2b89836..e952aae85a80a020087c3697624c8c13 @Override diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 46701f9c30c5b85b49311ad15da7e1fe2993c789..08087527293c5137af078fa17b6c0f219eab15d0 100644 +index ad9f1b9b7adc799af751bfbd0ee6fe6d27a58851..61ee6996b412d74c0d4e632ef05992c6e93187d0 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -1716,7 +1716,8 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1769,7 +1769,8 @@ public abstract class LivingEntity extends Entity implements Attackable { protected void dropExperience() { // CraftBukkit start - Update getExpReward() above if the removed if() changes! if (true && !(this instanceof net.minecraft.world.entity.boss.enderdragon.EnderDragon)) { // CraftBukkit - SPIGOT-2420: Special case ender dragon will drop the xp over time -- ExperienceOrb.award((ServerLevel) this.level, this.position(), this.expToDrop); +- ExperienceOrb.award((ServerLevel) this.level(), this.position(), this.expToDrop); + LivingEntity attacker = this.lastHurtByPlayer != null ? this.lastHurtByPlayer : this.lastHurtByMob; // Paper -+ ExperienceOrb.award((ServerLevel) this.level, this.position(), this.expToDrop, this instanceof ServerPlayer ? org.bukkit.entity.ExperienceOrb.SpawnReason.PLAYER_DEATH : org.bukkit.entity.ExperienceOrb.SpawnReason.ENTITY_DEATH, attacker, this); // Paper ++ ExperienceOrb.award((ServerLevel) this.level(), this.position(), this.expToDrop, this instanceof ServerPlayer ? org.bukkit.entity.ExperienceOrb.SpawnReason.PLAYER_DEATH : org.bukkit.entity.ExperienceOrb.SpawnReason.ENTITY_DEATH, attacker, this); // Paper this.expToDrop = 0; } // CraftBukkit end diff --git a/src/main/java/net/minecraft/world/entity/animal/Animal.java b/src/main/java/net/minecraft/world/entity/animal/Animal.java -index 3cdd7180a41b87caa942d2b3436ba90726686ecb..6216513805add7c8f52e1ed6c77e2d26786b3ab5 100644 +index fb207550efc5a387ea3346664998882b89e5cdae..8b5e0b9624bdecc3e158d9fc4b2c78f526c6bdeb 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Animal.java +++ b/src/main/java/net/minecraft/world/entity/animal/Animal.java -@@ -262,7 +262,7 @@ public abstract class Animal extends AgeableMob { - if (world.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) { - // CraftBukkit start - use event experience - if (experience > 0) { -- world.addFreshEntity(new ExperienceOrb(world, this.getX(), this.getY(), this.getZ(), experience)); -+ world.addFreshEntity(new ExperienceOrb(world, this.getX(), this.getY(), this.getZ(), experience, org.bukkit.entity.ExperienceOrb.SpawnReason.BREED, entityplayer, entityageable)); // Paper - } - // CraftBukkit end +@@ -264,7 +264,7 @@ public abstract class Animal extends AgeableMob { + if (world.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) { + // CraftBukkit start - use event experience + if (experience > 0) { +- world.addFreshEntity(new ExperienceOrb(world, this.getX(), this.getY(), this.getZ(), experience)); ++ world.addFreshEntity(new ExperienceOrb(world, this.getX(), this.getY(), this.getZ(), experience, org.bukkit.entity.ExperienceOrb.SpawnReason.BREED, null)); // Paper //TODO trigger } + // CraftBukkit end + } diff --git a/src/main/java/net/minecraft/world/entity/animal/Fox.java b/src/main/java/net/minecraft/world/entity/animal/Fox.java -index 18344ba254756bcf81061f46bc44c0cc37358433..13061aed29649acfc52d13207aaebcd8ba339ebe 100644 +index 79b99311bcf318aa1aff78c0c905378d99147716..c2a87255178917a9555ec48ff7e705efef2da7ab 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Fox.java +++ b/src/main/java/net/minecraft/world/entity/animal/Fox.java @@ -898,7 +898,7 @@ public class Fox extends Animal implements VariantHolder { @@ -171,7 +171,7 @@ index 18344ba254756bcf81061f46bc44c0cc37358433..13061aed29649acfc52d13207aaebcd8 // CraftBukkit end } diff --git a/src/main/java/net/minecraft/world/entity/animal/Turtle.java b/src/main/java/net/minecraft/world/entity/animal/Turtle.java -index a42f419524ddb5263467b59075850ff24920d21d..fb5af59559bc18ce2850d95ef73e5545dcab5ebc 100644 +index 6ab7ffe2b0da45c38edd46e9d29df603d3a0b0bc..fcd760cb88f84ff79811631612956fde79905132 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Turtle.java +++ b/src/main/java/net/minecraft/world/entity/animal/Turtle.java @@ -455,7 +455,7 @@ public class Turtle extends Animal { @@ -183,95 +183,82 @@ index a42f419524ddb5263467b59075850ff24920d21d..fb5af59559bc18ce2850d95ef73e5545 } } -diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java -index c12b8831deb54deb191908ba8a769d4c78825d5b..1b3d462e1e229970c53f763b5cdce7d21f1b1703 100644 ---- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java -+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java -@@ -264,7 +264,7 @@ public class Frog extends Animal implements VariantHolder { - this.getBrain().setMemory(MemoryModuleType.IS_PREGNANT, Unit.INSTANCE); - world.broadcastEntityEvent(this, (byte)18); - if (world.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) { -- world.addFreshEntity(new ExperienceOrb(world, this.getX(), this.getY(), this.getZ(), this.getRandom().nextInt(7) + 1)); -+ world.addFreshEntity(new ExperienceOrb(world, this.getX(), this.getY(), this.getZ(), this.getRandom().nextInt(7) + 1, org.bukkit.entity.ExperienceOrb.SpawnReason.BREED, serverPlayer)); // Paper - } - - } diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java -index 039a5246a2e9a5e84f3b712f1d138053605b33ec..18a9050158f71245d5d88f9c0833fd5d4e5fdca6 100644 +index 27f99f9ce39aac0bae5e9a7b34fd63833aa4ad26..0f39550f82aa1646dd5e4a887e33c414160ee7d9 100644 --- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java +++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java -@@ -649,7 +649,7 @@ public class EnderDragon extends Mob implements Enemy { +@@ -682,7 +682,7 @@ public class EnderDragon extends Mob implements Enemy { - if (this.level instanceof ServerLevel) { + if (this.level() instanceof ServerLevel) { if (this.dragonDeathTime > 150 && this.dragonDeathTime % 5 == 0 && true) { // CraftBukkit - SPIGOT-2420: Already checked for the game rule when calculating the xp -- ExperienceOrb.award((ServerLevel) this.level, this.position(), Mth.floor((float) short0 * 0.08F)); -+ ExperienceOrb.award((ServerLevel) this.level, this.position(), Mth.floor((float) short0 * 0.08F), org.bukkit.entity.ExperienceOrb.SpawnReason.ENTITY_DEATH, this.lastHurtByPlayer, this); // Paper +- ExperienceOrb.award((ServerLevel) this.level(), this.position(), Mth.floor((float) short0 * 0.08F)); ++ ExperienceOrb.award((ServerLevel) this.level(), this.position(), Mth.floor((float) short0 * 0.08F), org.bukkit.entity.ExperienceOrb.SpawnReason.ENTITY_DEATH, this.lastHurtByPlayer, this); // Paper } if (this.dragonDeathTime == 1 && !this.isSilent()) { -@@ -677,7 +677,7 @@ public class EnderDragon extends Mob implements Enemy { +@@ -710,7 +710,7 @@ public class EnderDragon extends Mob implements Enemy { this.move(MoverType.SELF, new Vec3(0.0D, 0.10000000149011612D, 0.0D)); - if (this.dragonDeathTime == 200 && this.level instanceof ServerLevel) { + if (this.dragonDeathTime == 200 && this.level() instanceof ServerLevel) { if (true) { // CraftBukkit - SPIGOT-2420: Already checked for the game rule when calculating the xp -- ExperienceOrb.award((ServerLevel) this.level, this.position(), Mth.floor((float) short0 * 0.2F)); -+ ExperienceOrb.award((ServerLevel) this.level, this.position(), Mth.floor((float) short0 * 0.2F), org.bukkit.entity.ExperienceOrb.SpawnReason.ENTITY_DEATH, this.lastHurtByPlayer, this); // Paper +- ExperienceOrb.award((ServerLevel) this.level(), this.position(), Mth.floor((float) short0 * 0.2F)); ++ ExperienceOrb.award((ServerLevel) this.level(), this.position(), Mth.floor((float) short0 * 0.2F), org.bukkit.entity.ExperienceOrb.SpawnReason.ENTITY_DEATH, this.lastHurtByPlayer, this); // Paper } if (this.dragonFight != null) { diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java -index cad8854cc7523d60c06ca1f03bfd4fbff984087c..806c49c127578a8f0a0bde11a4ad213e18d629af 100644 +index e04f3f1159c5d5fa2e3956a36e95f8afb5a1d4aa..68594d2621267f4b112b4d14d2bec3a0dd6a044a 100644 --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java -@@ -636,7 +636,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -637,7 +637,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler } if (offer.shouldRewardExp()) { -- this.level.addFreshEntity(new ExperienceOrb(this.level, this.getX(), this.getY() + 0.5D, this.getZ(), i)); -+ this.level.addFreshEntity(new ExperienceOrb(this.level, this.getX(), this.getY() + 0.5D, this.getZ(), i, org.bukkit.entity.ExperienceOrb.SpawnReason.VILLAGER_TRADE, this.getTradingPlayer(), this)); // Paper +- this.level().addFreshEntity(new ExperienceOrb(this.level(), this.getX(), this.getY() + 0.5D, this.getZ(), i)); ++ this.level().addFreshEntity(new ExperienceOrb(this.level(), this.getX(), this.getY() + 0.5D, this.getZ(), i, org.bukkit.entity.ExperienceOrb.SpawnReason.VILLAGER_TRADE, this.getTradingPlayer(), this)); // Paper } } diff --git a/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java b/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java -index 6a56b3c12a733662b23c984975f8dfdb43cf6f9b..69ab58f2d8d9287a64f330a02e7cd3be3fe02402 100644 +index fb80311e90ec83ca39b213d9348c821c402a1933..65592c41b1519eff77ccd7ddd3c885058f3ed138 100644 --- a/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java +++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java -@@ -197,7 +197,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill +@@ -186,7 +186,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill if (offer.shouldRewardExp()) { int i = 3 + this.random.nextInt(4); -- this.level.addFreshEntity(new ExperienceOrb(this.level, this.getX(), this.getY() + 0.5D, this.getZ(), i)); -+ this.level.addFreshEntity(new ExperienceOrb(this.level, this.getX(), this.getY() + 0.5D, this.getZ(), i, org.bukkit.entity.ExperienceOrb.SpawnReason.VILLAGER_TRADE, this.getTradingPlayer(), this)); // Paper +- this.level().addFreshEntity(new ExperienceOrb(this.level(), this.getX(), this.getY() + 0.5D, this.getZ(), i)); ++ this.level().addFreshEntity(new ExperienceOrb(this.level(), this.getX(), this.getY() + 0.5D, this.getZ(), i, org.bukkit.entity.ExperienceOrb.SpawnReason.VILLAGER_TRADE, this.getTradingPlayer(), this)); // Paper } } diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java -index 9a753ffd35403358df07408ffe85197ee3318f39..082fa4318dc03defbdb76e99250b7d71aa6710f5 100644 +index 4377a0f7387a09983a5580d408775f386ea5f487..dbff697927e6a6c745377aafd3b476b58f005882 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java +++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java @@ -522,7 +522,7 @@ public class FishingHook extends Projectile { - this.level.addFreshEntity(entityitem); + this.level().addFreshEntity(entityitem); // CraftBukkit start - this.random.nextInt(6) + 1 -> playerFishEvent.getExpToDrop() if (playerFishEvent.getExpToDrop() > 0) { -- entityhuman.level.addFreshEntity(new ExperienceOrb(entityhuman.level, entityhuman.getX(), entityhuman.getY() + 0.5D, entityhuman.getZ() + 0.5D, playerFishEvent.getExpToDrop())); -+ entityhuman.level.addFreshEntity(new ExperienceOrb(entityhuman.level, entityhuman.getX(), entityhuman.getY() + 0.5D, entityhuman.getZ() + 0.5D, playerFishEvent.getExpToDrop(), org.bukkit.entity.ExperienceOrb.SpawnReason.FISHING, this.getPlayerOwner(), this)); // Paper +- entityhuman.level().addFreshEntity(new ExperienceOrb(entityhuman.level(), entityhuman.getX(), entityhuman.getY() + 0.5D, entityhuman.getZ() + 0.5D, playerFishEvent.getExpToDrop())); ++ entityhuman.level().addFreshEntity(new ExperienceOrb(entityhuman.level(), entityhuman.getX(), entityhuman.getY() + 0.5D, entityhuman.getZ() + 0.5D, playerFishEvent.getExpToDrop(), org.bukkit.entity.ExperienceOrb.SpawnReason.FISHING, this.getPlayerOwner(), this)); // Paper } // CraftBukkit end if (itemstack1.is(ItemTags.FISHES)) { diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownExperienceBottle.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownExperienceBottle.java -index db6b1a9804a6d75dce22b780044beb04ca69cc94..dcbbff3a8dfcac869f07025e0e8e3d9c47956093 100644 +index 2191af62f4202413738542d738456ca71febdbf4..5b3059460d4b18d984483d655526d83204fb1c73 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/ThrownExperienceBottle.java +++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownExperienceBottle.java @@ -51,7 +51,7 @@ public class ThrownExperienceBottle extends ThrowableItemProjectile { } // CraftBukkit end -- ExperienceOrb.award((ServerLevel) this.level, this.position(), i); -+ ExperienceOrb.award((ServerLevel) this.level, this.position(), i, org.bukkit.entity.ExperienceOrb.SpawnReason.EXP_BOTTLE, this.getOwner(), this); // Paper +- ExperienceOrb.award((ServerLevel) this.level(), this.position(), i); ++ ExperienceOrb.award((ServerLevel) this.level(), this.position(), i, org.bukkit.entity.ExperienceOrb.SpawnReason.EXP_BOTTLE, this.getOwner(), this); // Paper this.discard(); } diff --git a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java -index 2ad1bffec6242af06b33cc777f27034ed6d6c437..5bcd3857fd30ec43e0191a862fc9c7712149e3dd 100644 +index c858b987cb6f92cc6fa705bbe1ae11a720eb242c..2c263447aa8853f18d1c1d476b49a47f6e9ca2ad 100644 --- a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java +++ b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java @@ -97,7 +97,7 @@ public class GrindstoneMenu extends AbstractContainerMenu { @@ -284,10 +271,10 @@ index 2ad1bffec6242af06b33cc777f27034ed6d6c437..5bcd3857fd30ec43e0191a862fc9c771 world.levelEvent(1042, blockposition, 0); diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java -index 6603be2c0906c8d78e7de5c3dbed56f9552ff9c1..f475926cfa6fc98f9f8f4fe8be6fd200cce39c7e 100644 +index 7ed82beb538a25a5246f6288c1dddb4f5f85e997..7646b66bc5ba0288608de0d836c7307e02eebe67 100644 --- a/src/main/java/net/minecraft/world/level/block/Block.java +++ b/src/main/java/net/minecraft/world/level/block/Block.java -@@ -374,8 +374,13 @@ public class Block extends BlockBehaviour implements ItemLike { +@@ -362,8 +362,13 @@ public class Block extends BlockBehaviour implements ItemLike { } public void popExperience(ServerLevel world, BlockPos pos, int size) { @@ -303,10 +290,10 @@ index 6603be2c0906c8d78e7de5c3dbed56f9552ff9c1..f475926cfa6fc98f9f8f4fe8be6fd200 } diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -index 9b54fd08fae889ac9db09ba67deb5eaae0f3d010..4ed87cc5a46d9e10c755631a16f0e0cb388fb7f2 100644 +index 9113fd7070596ecf504837f335022d5eb4ef9a77..d56a64b058d8848e405e33d9884a61ea952a8f71 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -@@ -637,7 +637,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -647,7 +647,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit j = event.getExpToDrop(); // CraftBukkit end @@ -316,7 +303,7 @@ index 9b54fd08fae889ac9db09ba67deb5eaae0f3d010..4ed87cc5a46d9e10c755631a16f0e0cb @Override diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -index 0b4f7953d88971fd86f85d29beefbb84cd2121b1..7c5d5355237bc00f1c8c8433351ca7a9938f2e8b 100644 +index e6eb4a903a43572cfda72db52a1d9c6a6fd46dee..101dac0fcabc5fd696f58ec52ad1fc93a2d0afeb 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java @@ -946,7 +946,7 @@ public abstract class CraftRegionAccessor implements RegionAccessor { diff --git a/patches/unapplied/server/0130-Cap-Entity-Collisions.patch b/patches/server/0126-Cap-Entity-Collisions.patch similarity index 85% rename from patches/unapplied/server/0130-Cap-Entity-Collisions.patch rename to patches/server/0126-Cap-Entity-Collisions.patch index 53286bcb9f..d97ca41ae3 100644 --- a/patches/unapplied/server/0130-Cap-Entity-Collisions.patch +++ b/patches/server/0126-Cap-Entity-Collisions.patch @@ -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/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 368a6d73c94addcf948e7cf8f3a026ab2017731e..1658a5263f0905c2938dae10b8d3d603fcd4bdca 100644 +index 20d5a46c4022dfea24f275fe143c32b8ddf629cb..568631c8711788053af407574ab928cb57c11560 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -383,6 +383,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -387,6 +387,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { public void inactiveTick() { } // Spigot end // Paper start @@ -24,10 +24,10 @@ index 368a6d73c94addcf948e7cf8f3a026ab2017731e..1658a5263f0905c2938dae10b8d3d603 private org.bukkit.util.Vector origin; @javax.annotation.Nullable diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 08087527293c5137af078fa17b6c0f219eab15d0..4505bd3a2b3854b6d2c7e87ee67df338397a1fa8 100644 +index 61ee6996b412d74c0d4e632ef05992c6e93187d0..a266f06422ddf52666eb11663cbf287279245596 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3277,8 +3277,11 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3327,8 +3327,11 @@ public abstract class LivingEntity extends Entity implements Attackable { } } diff --git a/patches/unapplied/server/0131-Remove-CraftScheduler-Async-Task-Debugger.patch b/patches/server/0127-Remove-CraftScheduler-Async-Task-Debugger.patch similarity index 100% rename from patches/unapplied/server/0131-Remove-CraftScheduler-Async-Task-Debugger.patch rename to patches/server/0127-Remove-CraftScheduler-Async-Task-Debugger.patch diff --git a/patches/unapplied/server/0132-Do-not-let-armorstands-drown.patch b/patches/server/0128-Do-not-let-armorstands-drown.patch similarity index 83% rename from patches/unapplied/server/0132-Do-not-let-armorstands-drown.patch rename to patches/server/0128-Do-not-let-armorstands-drown.patch index d2dc0bd607..46c6f0263a 100644 --- a/patches/unapplied/server/0132-Do-not-let-armorstands-drown.patch +++ b/patches/server/0128-Do-not-let-armorstands-drown.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Do not let armorstands drown diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java -index 970beff5d2c5b3ba3e3b733183d6876d8bc37da9..8de5a556d364f29706e3391825288c8a3a75c9c8 100644 +index be7ed906b4a5a8ffda87ecf66f967061b58f8034..68ac3ffae5d800bde3c5b5163a52768a43bb5963 100644 --- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java -@@ -952,5 +952,12 @@ public class ArmorStand extends LivingEntity { +@@ -951,5 +951,12 @@ public class ArmorStand extends LivingEntity { super.move(type, movement); } } diff --git a/patches/unapplied/server/0133-Properly-handle-async-calls-to-restart-the-server.patch b/patches/server/0129-Properly-handle-async-calls-to-restart-the-server.patch similarity index 96% rename from patches/unapplied/server/0133-Properly-handle-async-calls-to-restart-the-server.patch rename to patches/server/0129-Properly-handle-async-calls-to-restart-the-server.patch index 4274290956..72e43ba138 100644 --- a/patches/unapplied/server/0133-Properly-handle-async-calls-to-restart-the-server.patch +++ b/patches/server/0129-Properly-handle-async-calls-to-restart-the-server.patch @@ -30,7 +30,7 @@ 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 e845baf287da216bc5c1d2588b8e720212318266..d9ceef3d9694ab85f807a732789b2871bb734e50 100644 +index 857cc4fcc586f7a8ea5baeeae69da62ebfdac77a..e292035cf361c8efa8845450b72a6986694a8ca9 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -237,6 +237,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0.5F || this.isInWater()) || this.abilities.flying || this.isSleeping() || this.isInPowderSnow) { -- this.removeEntitiesOnShoulder(); -+ if (!this.level.paperConfig().entities.behavior.parrotsAreUnaffectedByPlayerMovement) this.removeEntitiesOnShoulder(); // Paper - Hang on! + if (!this.level().isClientSide && (this.fallDistance > 0.5F || this.isInWater()) || this.abilities.flying || this.isSleeping() || this.isInPowderSnow) { ++ if (!this.level().paperConfig().entities.behavior.parrotsAreUnaffectedByPlayerMovement) // Paper - Hang on! + this.removeEntitiesOnShoulder(); } - } diff --git a/patches/unapplied/server/0135-Add-configuration-option-to-prevent-player-names-fro.patch b/patches/server/0131-Add-configuration-option-to-prevent-player-names-fro.patch similarity index 83% rename from patches/unapplied/server/0135-Add-configuration-option-to-prevent-player-names-fro.patch rename to patches/server/0131-Add-configuration-option-to-prevent-player-names-fro.patch index 51190e133a..42bdcaafaa 100644 --- a/patches/unapplied/server/0135-Add-configuration-option-to-prevent-player-names-fro.patch +++ b/patches/server/0131-Add-configuration-option-to-prevent-player-names-fro.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add configuration option to prevent player names from being diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index ded2e2df6bed222779a39e6f3cfd9170fdc0b494..a4b3d4c72295d46cbd5901c0f5c59cb897c05b0e 100644 +index 3d6c25424c859f63c8f4661b39c82c269c3837fb..12c36e02e271cc8e13b20059fbfb30f4e8172023 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2650,5 +2650,10 @@ public final class CraftServer implements Server { +@@ -2648,5 +2648,10 @@ public final class CraftServer implements Server { commandMap.registerServerAliases(); return true; } diff --git a/patches/unapplied/server/0136-Use-TerminalConsoleAppender-for-console-improvements.patch b/patches/server/0132-Use-TerminalConsoleAppender-for-console-improvements.patch similarity index 97% rename from patches/unapplied/server/0136-Use-TerminalConsoleAppender-for-console-improvements.patch rename to patches/server/0132-Use-TerminalConsoleAppender-for-console-improvements.patch index e01b91b795..b0bff9c77b 100644 --- a/patches/unapplied/server/0136-Use-TerminalConsoleAppender-for-console-improvements.patch +++ b/patches/server/0132-Use-TerminalConsoleAppender-for-console-improvements.patch @@ -19,7 +19,7 @@ Other changes: configuration diff --git a/build.gradle.kts b/build.gradle.kts -index b0facb2b0b86fafbfd5776eba2e5bdb69cc1cbed..4a222d6769fe8dd33bcffa2e312e9bdf106e3eee 100644 +index bdd78d14723211bfec493126d603b99611cdf748..9fb608d9cfb0dcd8d937244ecbe97487757af479 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,17 @@ plugins { @@ -112,10 +112,10 @@ index 0000000000000000000000000000000000000000..685deaa0e5d1ddc13e3a7c0471b1cfcf + +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index d9ceef3d9694ab85f807a732789b2871bb734e50..4e263a0ca438ffd1253cda577689a1b6d2d55992 100644 +index e292035cf361c8efa8845450b72a6986694a8ca9..9fad7c117033694bc5850b9f9585e439c44ef0dd 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -168,7 +168,7 @@ import com.mojang.datafixers.util.Pair; +@@ -165,7 +165,7 @@ import com.mojang.datafixers.util.Pair; import com.mojang.serialization.DynamicOps; import com.mojang.serialization.Lifecycle; import java.util.Random; @@ -152,7 +152,7 @@ index d9ceef3d9694ab85f807a732789b2871bb734e50..4e263a0ca438ffd1253cda577689a1b6 Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this)); this.paperConfigurations = services.paperConfigurations(); // Paper } -@@ -1137,7 +1141,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop collection = this.getActiveEffects(); - if (!collection.isEmpty()) { -+ if (!collection.isEmpty() && !level.paperConfig().entities.behavior.disableCreeperLingeringEffect) { // Paper - AreaEffectCloud entityareaeffectcloud = new AreaEffectCloud(this.level, this.getX(), this.getY(), this.getZ()); ++ if (!collection.isEmpty() && !this.level().paperConfig().entities.behavior.disableCreeperLingeringEffect) { // Paper + AreaEffectCloud entityareaeffectcloud = new AreaEffectCloud(this.level(), this.getX(), this.getY(), this.getZ()); entityareaeffectcloud.setOwner(this); // CraftBukkit diff --git a/patches/unapplied/server/0138-Item-canEntityPickup.patch b/patches/server/0134-Item-canEntityPickup.patch similarity index 90% rename from patches/unapplied/server/0138-Item-canEntityPickup.patch rename to patches/server/0134-Item-canEntityPickup.patch index 35734d9354..7126c2c8bc 100644 --- a/patches/unapplied/server/0138-Item-canEntityPickup.patch +++ b/patches/server/0134-Item-canEntityPickup.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Item#canEntityPickup diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index eee466e718f52329f8200ff830f5f1e44cda3e7e..dad26405e90c7a784266a336ff1b0aa58b961261 100644 +index 2dc21048b968e7aa63b5b28cacdd1ae407c06958..fec33a79fc9681ef51899a92ebb43c27126bd7ac 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -665,6 +665,11 @@ public abstract class Mob extends LivingEntity implements Targeting { +@@ -668,6 +668,11 @@ public abstract class Mob extends LivingEntity implements Targeting { ItemEntity entityitem = (ItemEntity) iterator.next(); if (!entityitem.isRemoved() && !entityitem.getItem().isEmpty() && !entityitem.hasPickUpDelay() && this.wantsToPickUp(entityitem.getItem())) { @@ -21,7 +21,7 @@ index eee466e718f52329f8200ff830f5f1e44cda3e7e..dad26405e90c7a784266a336ff1b0aa5 } } diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java -index 9ffcccef6266e1a61cfae36cbc205b8178a732de..62288f9152a6fb2c272c7e84649af06b24032542 100644 +index dbe07ffbc6310828370be69081ac6d6f3085e4ac..1503d143429f0b73935004a7061d0409dcb24c2c 100644 --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java @@ -51,6 +51,7 @@ public class ItemEntity extends Entity implements TraceableEntity { diff --git a/patches/unapplied/server/0139-PlayerPickupItemEvent-setFlyAtPlayer.patch b/patches/server/0135-PlayerPickupItemEvent-setFlyAtPlayer.patch similarity index 83% rename from patches/unapplied/server/0139-PlayerPickupItemEvent-setFlyAtPlayer.patch rename to patches/server/0135-PlayerPickupItemEvent-setFlyAtPlayer.patch index 7524649eeb..53e74468d0 100644 --- a/patches/unapplied/server/0139-PlayerPickupItemEvent-setFlyAtPlayer.patch +++ b/patches/server/0135-PlayerPickupItemEvent-setFlyAtPlayer.patch @@ -5,10 +5,10 @@ Subject: [PATCH] PlayerPickupItemEvent#setFlyAtPlayer diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java -index 62288f9152a6fb2c272c7e84649af06b24032542..a6d2bacfa186a0b1c72d3761a134ce623fa6ccec 100644 +index 1503d143429f0b73935004a7061d0409dcb24c2c..8357ef35c374c6a6602eb96d4281da0210aea757 100644 --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java -@@ -395,6 +395,7 @@ public class ItemEntity extends Entity implements TraceableEntity { +@@ -399,6 +399,7 @@ public class ItemEntity extends Entity implements TraceableEntity { // CraftBukkit start - fire PlayerPickupItemEvent int canHold = player.getInventory().canHold(itemstack); int remaining = i - canHold; @@ -16,10 +16,10 @@ index 62288f9152a6fb2c272c7e84649af06b24032542..a6d2bacfa186a0b1c72d3761a134ce62 if (this.pickupDelay <= 0 && canHold > 0) { itemstack.setCount(canHold); -@@ -402,8 +403,14 @@ public class ItemEntity extends Entity implements TraceableEntity { +@@ -406,8 +407,14 @@ public class ItemEntity extends Entity implements TraceableEntity { PlayerPickupItemEvent playerEvent = new PlayerPickupItemEvent((org.bukkit.entity.Player) player.getBukkitEntity(), (org.bukkit.entity.Item) this.getBukkitEntity(), remaining); playerEvent.setCancelled(!playerEvent.getPlayer().getCanPickupItems()); - this.level.getCraftServer().getPluginManager().callEvent(playerEvent); + this.level().getCraftServer().getPluginManager().callEvent(playerEvent); + flyAtPlayer = playerEvent.getFlyAtPlayer(); // Paper if (playerEvent.isCancelled()) { itemstack.setCount(i); // SPIGOT-5294 - restore count @@ -31,7 +31,7 @@ index 62288f9152a6fb2c272c7e84649af06b24032542..a6d2bacfa186a0b1c72d3761a134ce62 return; } -@@ -433,6 +440,7 @@ public class ItemEntity extends Entity implements TraceableEntity { +@@ -437,6 +444,7 @@ public class ItemEntity extends Entity implements TraceableEntity { // CraftBukkit end if (this.pickupDelay == 0 && (this.target == null || this.target.equals(player.getUUID())) && player.getInventory().add(itemstack)) { diff --git a/patches/unapplied/server/0140-PlayerAttemptPickupItemEvent.patch b/patches/server/0136-PlayerAttemptPickupItemEvent.patch similarity index 91% rename from patches/unapplied/server/0140-PlayerAttemptPickupItemEvent.patch rename to patches/server/0136-PlayerAttemptPickupItemEvent.patch index 98a493034a..586375dfe5 100644 --- a/patches/unapplied/server/0140-PlayerAttemptPickupItemEvent.patch +++ b/patches/server/0136-PlayerAttemptPickupItemEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] PlayerAttemptPickupItemEvent diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java -index a6d2bacfa186a0b1c72d3761a134ce623fa6ccec..298dff12c511e8b767d5a7ee14f94fe0745e5338 100644 +index 8357ef35c374c6a6602eb96d4281da0210aea757..04b4c7af20d6aa9924fb1d345f11cb51dcadc708 100644 --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java @@ -35,6 +35,7 @@ import net.minecraft.stats.Stats; @@ -16,7 +16,7 @@ index a6d2bacfa186a0b1c72d3761a134ce623fa6ccec..298dff12c511e8b767d5a7ee14f94fe0 public class ItemEntity extends Entity implements TraceableEntity { -@@ -397,6 +398,22 @@ public class ItemEntity extends Entity implements TraceableEntity { +@@ -401,6 +402,22 @@ public class ItemEntity extends Entity implements TraceableEntity { int remaining = i - canHold; boolean flyAtPlayer = false; // Paper diff --git a/patches/unapplied/server/0120-Optimize-ItemStack.isEmpty.patch b/patches/unapplied/server/0120-Optimize-ItemStack.isEmpty.patch deleted file mode 100644 index f08ead4616..0000000000 --- a/patches/unapplied/server/0120-Optimize-ItemStack.isEmpty.patch +++ /dev/null @@ -1,20 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Wed, 21 Dec 2016 03:48:29 -0500 -Subject: [PATCH] Optimize ItemStack.isEmpty() - -Remove hashMap lookup every check, simplify code to remove ternary - -diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index 9b358c8e464c67c4953749cda6d2983db98e0c5f..a598b6522ce4d41575f04425d189319fa12a7b70 100644 ---- a/src/main/java/net/minecraft/world/item/ItemStack.java -+++ b/src/main/java/net/minecraft/world/item/ItemStack.java -@@ -252,7 +252,7 @@ public final class ItemStack { - } - - public boolean isEmpty() { -- return this == ItemStack.EMPTY ? true : (this.getItem() != null && !this.is(Items.AIR) ? this.count <= 0 : true); -+ return this == ItemStack.EMPTY || this.item == null || this.item == Items.AIR || this.count <= 0; // Paper - } - - public boolean isItemEnabled(FeatureFlagSet enabledFeatures) {