From ab6a46c565cf710accb3f66de9988a8e6cf43dbd Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Wed, 24 Nov 2021 17:39:04 +0100 Subject: [PATCH] More more more more more more more more more more more more more more more work --- .../api/Add-API-for-quit-reason.patch | 0 .../api/Add-Destroy-Speed-API.patch | 0 .../Add-LivingEntity-clearActiveItem.patch | 0 .../api/Add-PlayerItemCooldownEvent.patch | 0 .../api/Add-PlayerShearBlockEvent.patch | 0 ...al-open-container-api-to-HumanEntity.patch | 0 .../Add-getOfflinePlayerIfCached-String.patch | 0 .../api/Add-ignore-discounts-API.patch | 0 .../Add-methods-to-get-translation-keys.patch | 0 .../api/Add-more-Evoker-API.patch | 0 .../api/Beacon-API-custom-effect-ranges.patch | 0 ...docs-for-Entity.getEntitySpawnReason.patch | 0 ...ate-HoverEvent-from-ItemStack-Entity.patch | 0 .../Enable-multi-release-plugin-jars.patch | 0 .../api/Entity-isTicking.patch | 0 ...y-Counter-to-allow-plugins-to-use-va.patch | 0 .../api/Item-no-age-no-player-pickup.patch | 0 .../api/More-lightning-API.patch | 0 .../api/Player-elytra-boost-API.patch | 0 .../api/Villager-resetOffers.patch | 0 .../server/Add-API-for-quit-reason.patch | 4 +- .../server/Add-Destroy-Speed-API.patch | 0 .../Add-LivingEntity-clearActiveItem.patch | 0 .../server/Add-PlayerItemCooldownEvent.patch | 0 .../server/Add-PlayerShearBlockEvent.patch | 0 ...ing-Trader-spawn-rate-config-options.patch | 2 +- ...al-open-container-api-to-HumanEntity.patch | 0 .../Add-getOfflinePlayerIfCached-String.patch | 0 .../server/Add-ignore-discounts-API.patch | 0 .../Add-methods-to-get-translation-keys.patch | 0 .../server/Add-more-Evoker-API.patch | 0 ...d-missing-default-perms-for-commands.patch | 0 ...ling-up-when-item-stack-is-empty-in-.patch | 0 .../Beacon-API-custom-effect-ranges.patch | 2 +- ...taFixerUpper-Rewrite-Rules-on-demand.patch | 0 .../server/Cache-block-data-strings.patch | 0 ...-should-not-bypass-cramming-gamerule.patch | 6 +- ...ate-HoverEvent-from-ItemStack-Entity.patch | 0 ...rty-in-invalid-locations-SPIGOT-6086.patch | 2 +- .../server/Entity-isTicking.patch | 6 +- ...y-Counter-to-allow-plugins-to-use-va.patch | 2 +- .../server/Expose-world-spawn-angle.patch | 0 ...p-capture-to-capture-all-items-added.patch | 12 +--- ...ix-Concurrency-issue-in-WeightedList.patch | 0 ...x-CraftSound-backwards-compatibility.patch | 0 .../server/Fix-CraftTeam-null-check.patch | 0 ...ortation-and-cancel-velocity-if-tele.patch | 6 +- ...r-spawnParticle-x-y-z-precision-loss.patch | 0 ...ix-client-lag-on-advancement-loading.patch | 0 ...ing-zombie-villager-discount-exploit.patch | 0 ...-non-whitelisted-player-when-white-l.patch | 0 ...r-large-move-vectors-crashing-server.patch | 0 ...rs-not-working-in-some-kick-messages.patch | 0 ...tem-locations-dropped-from-campfires.patch | 0 .../Fixed-TileEntityBell-memory-leak.patch | 0 ...inig-for-some-hot-IBlockData-methods.patch | 0 .../server/Item-no-age-no-player-pickup.patch | 0 ...-track-plugin-scoreboards-by-default.patch | 8 ++- .../server/Limit-recipe-packets.patch | 2 +- .../server/More-lightning-API.patch | 0 .../server/Optimise-getType-calls.patch | 2 +- ...der-Remove-Streams-Optimized-collect.patch | 0 .../server/Player-elytra-boost-API.patch | 0 ...CreateEvent-needs-to-know-its-entity.patch | 32 ++++----- ...blockpos-allocation-from-pathfinding.patch | 0 ...Reset-Ender-Crystals-on-Dragon-Spawn.patch | 0 ...ace-order-when-capturing-blockstates.patch | 0 ...prove-performance-of-the-end-generat.patch | 0 .../Toggle-for-removing-existing-dragon.patch | 0 .../server/Villager-resetOffers.patch | 0 .../server/Seed-based-feature-search.patch | 71 ------------------- 71 files changed, 36 insertions(+), 121 deletions(-) rename patches/{unapplied => }/api/Add-API-for-quit-reason.patch (100%) rename patches/{unapplied => }/api/Add-Destroy-Speed-API.patch (100%) rename patches/{unapplied => }/api/Add-LivingEntity-clearActiveItem.patch (100%) rename patches/{unapplied => }/api/Add-PlayerItemCooldownEvent.patch (100%) rename patches/{unapplied => }/api/Add-PlayerShearBlockEvent.patch (100%) rename patches/{unapplied => }/api/Add-additional-open-container-api-to-HumanEntity.patch (100%) rename patches/{unapplied => }/api/Add-getOfflinePlayerIfCached-String.patch (100%) rename patches/{unapplied => }/api/Add-ignore-discounts-API.patch (100%) rename patches/{unapplied => }/api/Add-methods-to-get-translation-keys.patch (100%) rename patches/{unapplied => }/api/Add-more-Evoker-API.patch (100%) rename patches/{unapplied => }/api/Beacon-API-custom-effect-ranges.patch (100%) rename patches/{unapplied => }/api/Clarify-the-Javadocs-for-Entity.getEntitySpawnReason.patch (100%) rename patches/{unapplied => }/api/Create-HoverEvent-from-ItemStack-Entity.patch (100%) rename patches/{unapplied => }/api/Enable-multi-release-plugin-jars.patch (100%) rename patches/{unapplied => }/api/Entity-isTicking.patch (100%) rename patches/{unapplied => }/api/Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch (100%) rename patches/{unapplied => }/api/Item-no-age-no-player-pickup.patch (100%) rename patches/{unapplied => }/api/More-lightning-API.patch (100%) rename patches/{unapplied => }/api/Player-elytra-boost-API.patch (100%) rename patches/{unapplied => }/api/Villager-resetOffers.patch (100%) rename patches/{unapplied => }/server/Add-API-for-quit-reason.patch (96%) rename patches/{unapplied => }/server/Add-Destroy-Speed-API.patch (100%) rename patches/{unapplied => }/server/Add-LivingEntity-clearActiveItem.patch (100%) rename patches/{unapplied => }/server/Add-PlayerItemCooldownEvent.patch (100%) rename patches/{unapplied => }/server/Add-PlayerShearBlockEvent.patch (100%) rename patches/{unapplied => }/server/Add-Wandering-Trader-spawn-rate-config-options.patch (99%) rename patches/{unapplied => }/server/Add-additional-open-container-api-to-HumanEntity.patch (100%) rename patches/{unapplied => }/server/Add-getOfflinePlayerIfCached-String.patch (100%) rename patches/{unapplied => }/server/Add-ignore-discounts-API.patch (100%) rename patches/{unapplied => }/server/Add-methods-to-get-translation-keys.patch (100%) rename patches/{unapplied => }/server/Add-more-Evoker-API.patch (100%) rename patches/{unapplied => }/server/Added-missing-default-perms-for-commands.patch (100%) rename patches/{unapplied => }/server/Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch (100%) rename patches/{unapplied => }/server/Beacon-API-custom-effect-ranges.patch (99%) rename patches/{unapplied => }/server/Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch (100%) rename patches/{unapplied => }/server/Cache-block-data-strings.patch (100%) rename patches/{unapplied => }/server/Climbing-should-not-bypass-cramming-gamerule.patch (95%) rename patches/{unapplied => }/server/Create-HoverEvent-from-ItemStack-Entity.patch (100%) rename patches/{unapplied => }/server/Don-t-mark-dirty-in-invalid-locations-SPIGOT-6086.patch (90%) rename patches/{unapplied => }/server/Entity-isTicking.patch (92%) rename patches/{unapplied => }/server/Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch (98%) rename patches/{unapplied => }/server/Expose-world-spawn-angle.patch (100%) rename patches/{unapplied => }/server/Extend-block-drop-capture-to-capture-all-items-added.patch (80%) rename patches/{unapplied => }/server/Fix-Concurrency-issue-in-WeightedList.patch (100%) rename patches/{unapplied => }/server/Fix-CraftSound-backwards-compatibility.patch (100%) rename patches/{unapplied => }/server/Fix-CraftTeam-null-check.patch (100%) rename patches/{unapplied => }/server/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch (97%) rename patches/{unapplied => }/server/Fix-Player-spawnParticle-x-y-z-precision-loss.patch (100%) rename patches/{unapplied => }/server/Fix-client-lag-on-advancement-loading.patch (100%) rename patches/{unapplied => }/server/Fix-curing-zombie-villager-discount-exploit.patch (100%) rename patches/{unapplied => }/server/Fix-deop-kicking-non-whitelisted-player-when-white-l.patch (100%) rename patches/{unapplied => }/server/Fix-for-large-move-vectors-crashing-server.patch (100%) rename patches/{unapplied => }/server/Fix-hex-colors-not-working-in-some-kick-messages.patch (100%) rename patches/{unapplied => }/server/Fix-item-locations-dropped-from-campfires.patch (100%) rename patches/{unapplied => }/server/Fixed-TileEntityBell-memory-leak.patch (100%) rename patches/{unapplied => }/server/Improve-inlinig-for-some-hot-IBlockData-methods.patch (100%) rename patches/{unapplied => }/server/Item-no-age-no-player-pickup.patch (100%) rename patches/{unapplied => }/server/Lazily-track-plugin-scoreboards-by-default.patch (96%) rename patches/{unapplied => }/server/Limit-recipe-packets.patch (98%) rename patches/{unapplied => }/server/More-lightning-API.patch (100%) rename patches/{unapplied => }/server/Optimise-getType-calls.patch (98%) rename patches/{unapplied => }/server/Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch (100%) rename patches/{unapplied => }/server/Player-elytra-boost-API.patch (100%) rename patches/{unapplied => }/server/PortalCreateEvent-needs-to-know-its-entity.patch (86%) rename patches/{unapplied => }/server/Reduce-blockpos-allocation-from-pathfinding.patch (100%) rename patches/{unapplied => }/server/Reset-Ender-Crystals-on-Dragon-Spawn.patch (100%) rename patches/{unapplied => }/server/Retain-block-place-order-when-capturing-blockstates.patch (100%) rename patches/{unapplied => }/server/Significantly-improve-performance-of-the-end-generat.patch (100%) rename patches/{unapplied => }/server/Toggle-for-removing-existing-dragon.patch (100%) rename patches/{unapplied => }/server/Villager-resetOffers.patch (100%) delete mode 100644 patches/unapplied/server/Seed-based-feature-search.patch diff --git a/patches/unapplied/api/Add-API-for-quit-reason.patch b/patches/api/Add-API-for-quit-reason.patch similarity index 100% rename from patches/unapplied/api/Add-API-for-quit-reason.patch rename to patches/api/Add-API-for-quit-reason.patch diff --git a/patches/unapplied/api/Add-Destroy-Speed-API.patch b/patches/api/Add-Destroy-Speed-API.patch similarity index 100% rename from patches/unapplied/api/Add-Destroy-Speed-API.patch rename to patches/api/Add-Destroy-Speed-API.patch diff --git a/patches/unapplied/api/Add-LivingEntity-clearActiveItem.patch b/patches/api/Add-LivingEntity-clearActiveItem.patch similarity index 100% rename from patches/unapplied/api/Add-LivingEntity-clearActiveItem.patch rename to patches/api/Add-LivingEntity-clearActiveItem.patch diff --git a/patches/unapplied/api/Add-PlayerItemCooldownEvent.patch b/patches/api/Add-PlayerItemCooldownEvent.patch similarity index 100% rename from patches/unapplied/api/Add-PlayerItemCooldownEvent.patch rename to patches/api/Add-PlayerItemCooldownEvent.patch diff --git a/patches/unapplied/api/Add-PlayerShearBlockEvent.patch b/patches/api/Add-PlayerShearBlockEvent.patch similarity index 100% rename from patches/unapplied/api/Add-PlayerShearBlockEvent.patch rename to patches/api/Add-PlayerShearBlockEvent.patch diff --git a/patches/unapplied/api/Add-additional-open-container-api-to-HumanEntity.patch b/patches/api/Add-additional-open-container-api-to-HumanEntity.patch similarity index 100% rename from patches/unapplied/api/Add-additional-open-container-api-to-HumanEntity.patch rename to patches/api/Add-additional-open-container-api-to-HumanEntity.patch diff --git a/patches/unapplied/api/Add-getOfflinePlayerIfCached-String.patch b/patches/api/Add-getOfflinePlayerIfCached-String.patch similarity index 100% rename from patches/unapplied/api/Add-getOfflinePlayerIfCached-String.patch rename to patches/api/Add-getOfflinePlayerIfCached-String.patch diff --git a/patches/unapplied/api/Add-ignore-discounts-API.patch b/patches/api/Add-ignore-discounts-API.patch similarity index 100% rename from patches/unapplied/api/Add-ignore-discounts-API.patch rename to patches/api/Add-ignore-discounts-API.patch diff --git a/patches/unapplied/api/Add-methods-to-get-translation-keys.patch b/patches/api/Add-methods-to-get-translation-keys.patch similarity index 100% rename from patches/unapplied/api/Add-methods-to-get-translation-keys.patch rename to patches/api/Add-methods-to-get-translation-keys.patch diff --git a/patches/unapplied/api/Add-more-Evoker-API.patch b/patches/api/Add-more-Evoker-API.patch similarity index 100% rename from patches/unapplied/api/Add-more-Evoker-API.patch rename to patches/api/Add-more-Evoker-API.patch diff --git a/patches/unapplied/api/Beacon-API-custom-effect-ranges.patch b/patches/api/Beacon-API-custom-effect-ranges.patch similarity index 100% rename from patches/unapplied/api/Beacon-API-custom-effect-ranges.patch rename to patches/api/Beacon-API-custom-effect-ranges.patch diff --git a/patches/unapplied/api/Clarify-the-Javadocs-for-Entity.getEntitySpawnReason.patch b/patches/api/Clarify-the-Javadocs-for-Entity.getEntitySpawnReason.patch similarity index 100% rename from patches/unapplied/api/Clarify-the-Javadocs-for-Entity.getEntitySpawnReason.patch rename to patches/api/Clarify-the-Javadocs-for-Entity.getEntitySpawnReason.patch diff --git a/patches/unapplied/api/Create-HoverEvent-from-ItemStack-Entity.patch b/patches/api/Create-HoverEvent-from-ItemStack-Entity.patch similarity index 100% rename from patches/unapplied/api/Create-HoverEvent-from-ItemStack-Entity.patch rename to patches/api/Create-HoverEvent-from-ItemStack-Entity.patch diff --git a/patches/unapplied/api/Enable-multi-release-plugin-jars.patch b/patches/api/Enable-multi-release-plugin-jars.patch similarity index 100% rename from patches/unapplied/api/Enable-multi-release-plugin-jars.patch rename to patches/api/Enable-multi-release-plugin-jars.patch diff --git a/patches/unapplied/api/Entity-isTicking.patch b/patches/api/Entity-isTicking.patch similarity index 100% rename from patches/unapplied/api/Entity-isTicking.patch rename to patches/api/Entity-isTicking.patch diff --git a/patches/unapplied/api/Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch b/patches/api/Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch similarity index 100% rename from patches/unapplied/api/Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch rename to patches/api/Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch diff --git a/patches/unapplied/api/Item-no-age-no-player-pickup.patch b/patches/api/Item-no-age-no-player-pickup.patch similarity index 100% rename from patches/unapplied/api/Item-no-age-no-player-pickup.patch rename to patches/api/Item-no-age-no-player-pickup.patch diff --git a/patches/unapplied/api/More-lightning-API.patch b/patches/api/More-lightning-API.patch similarity index 100% rename from patches/unapplied/api/More-lightning-API.patch rename to patches/api/More-lightning-API.patch diff --git a/patches/unapplied/api/Player-elytra-boost-API.patch b/patches/api/Player-elytra-boost-API.patch similarity index 100% rename from patches/unapplied/api/Player-elytra-boost-API.patch rename to patches/api/Player-elytra-boost-API.patch diff --git a/patches/unapplied/api/Villager-resetOffers.patch b/patches/api/Villager-resetOffers.patch similarity index 100% rename from patches/unapplied/api/Villager-resetOffers.patch rename to patches/api/Villager-resetOffers.patch diff --git a/patches/unapplied/server/Add-API-for-quit-reason.patch b/patches/server/Add-API-for-quit-reason.patch similarity index 96% rename from patches/unapplied/server/Add-API-for-quit-reason.patch rename to patches/server/Add-API-for-quit-reason.patch index 3bcccc3c97..4da82e338f 100644 --- a/patches/unapplied/server/Add-API-for-quit-reason.patch +++ b/patches/server/Add-API-for-quit-reason.patch @@ -29,9 +29,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -0,0 +0,0 @@ public class ServerPlayer extends Player { - public double lastEntitySpawnRadiusSquared; // Paper - optimise isOutsideRange, this field is in blocks + public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper + public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet cachedSingleHashSet; // Paper - boolean needsChunkCenterUpdate; // Paper - no-tick view distance + public org.bukkit.event.player.PlayerQuitEvent.QuitReason quitReason = null; // Paper - there are a lot of changes to do if we change all methods leading to the event public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile) { diff --git a/patches/unapplied/server/Add-Destroy-Speed-API.patch b/patches/server/Add-Destroy-Speed-API.patch similarity index 100% rename from patches/unapplied/server/Add-Destroy-Speed-API.patch rename to patches/server/Add-Destroy-Speed-API.patch diff --git a/patches/unapplied/server/Add-LivingEntity-clearActiveItem.patch b/patches/server/Add-LivingEntity-clearActiveItem.patch similarity index 100% rename from patches/unapplied/server/Add-LivingEntity-clearActiveItem.patch rename to patches/server/Add-LivingEntity-clearActiveItem.patch diff --git a/patches/unapplied/server/Add-PlayerItemCooldownEvent.patch b/patches/server/Add-PlayerItemCooldownEvent.patch similarity index 100% rename from patches/unapplied/server/Add-PlayerItemCooldownEvent.patch rename to patches/server/Add-PlayerItemCooldownEvent.patch diff --git a/patches/unapplied/server/Add-PlayerShearBlockEvent.patch b/patches/server/Add-PlayerShearBlockEvent.patch similarity index 100% rename from patches/unapplied/server/Add-PlayerShearBlockEvent.patch rename to patches/server/Add-PlayerShearBlockEvent.patch diff --git a/patches/unapplied/server/Add-Wandering-Trader-spawn-rate-config-options.patch b/patches/server/Add-Wandering-Trader-spawn-rate-config-options.patch similarity index 99% rename from patches/unapplied/server/Add-Wandering-Trader-spawn-rate-config-options.patch rename to patches/server/Add-Wandering-Trader-spawn-rate-config-options.patch index 997d3c93be..4658da764c 100644 --- a/patches/unapplied/server/Add-Wandering-Trader-spawn-rate-config-options.patch +++ b/patches/server/Add-Wandering-Trader-spawn-rate-config-options.patch @@ -96,7 +96,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } else { int i = this.spawnChance; -- this.spawnChance = Mth.clamp(this.spawnChance + 25, 25, 75); +- this.spawnChance = Mth.clamp(this.spawnChance + 25, (int) 25, (int) 75); - this.serverLevelData.setWanderingTraderSpawnChance(this.spawnChance); + this.spawnChance = Mth.clamp(i + world.paperConfig.wanderingTraderSpawnChanceFailureIncrement, world.paperConfig.wanderingTraderSpawnChanceMin, world.paperConfig.wanderingTraderSpawnChanceMax); + //this.serverLevelData.setWanderingTraderSpawnChance(this.spawnChance); // Paper - We don't need to save this value to disk if it gets set back to a hardcoded value anyways diff --git a/patches/unapplied/server/Add-additional-open-container-api-to-HumanEntity.patch b/patches/server/Add-additional-open-container-api-to-HumanEntity.patch similarity index 100% rename from patches/unapplied/server/Add-additional-open-container-api-to-HumanEntity.patch rename to patches/server/Add-additional-open-container-api-to-HumanEntity.patch diff --git a/patches/unapplied/server/Add-getOfflinePlayerIfCached-String.patch b/patches/server/Add-getOfflinePlayerIfCached-String.patch similarity index 100% rename from patches/unapplied/server/Add-getOfflinePlayerIfCached-String.patch rename to patches/server/Add-getOfflinePlayerIfCached-String.patch diff --git a/patches/unapplied/server/Add-ignore-discounts-API.patch b/patches/server/Add-ignore-discounts-API.patch similarity index 100% rename from patches/unapplied/server/Add-ignore-discounts-API.patch rename to patches/server/Add-ignore-discounts-API.patch diff --git a/patches/unapplied/server/Add-methods-to-get-translation-keys.patch b/patches/server/Add-methods-to-get-translation-keys.patch similarity index 100% rename from patches/unapplied/server/Add-methods-to-get-translation-keys.patch rename to patches/server/Add-methods-to-get-translation-keys.patch diff --git a/patches/unapplied/server/Add-more-Evoker-API.patch b/patches/server/Add-more-Evoker-API.patch similarity index 100% rename from patches/unapplied/server/Add-more-Evoker-API.patch rename to patches/server/Add-more-Evoker-API.patch diff --git a/patches/unapplied/server/Added-missing-default-perms-for-commands.patch b/patches/server/Added-missing-default-perms-for-commands.patch similarity index 100% rename from patches/unapplied/server/Added-missing-default-perms-for-commands.patch rename to patches/server/Added-missing-default-perms-for-commands.patch diff --git a/patches/unapplied/server/Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch b/patches/server/Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch similarity index 100% rename from patches/unapplied/server/Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch rename to patches/server/Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch diff --git a/patches/unapplied/server/Beacon-API-custom-effect-ranges.patch b/patches/server/Beacon-API-custom-effect-ranges.patch similarity index 99% rename from patches/unapplied/server/Beacon-API-custom-effect-ranges.patch rename to patches/server/Beacon-API-custom-effect-ranges.patch index e18a608b0e..940516493a 100644 --- a/patches/unapplied/server/Beacon-API-custom-effect-ranges.patch +++ b/patches/server/Beacon-API-custom-effect-ranges.patch @@ -91,9 +91,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.lockKey.addToTag(nbt); + nbt.putDouble(PAPER_RANGE_TAG, this.effectRange); // Paper - return nbt; } + public void setCustomName(@Nullable Component customName) { diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java diff --git a/patches/unapplied/server/Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch b/patches/server/Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch similarity index 100% rename from patches/unapplied/server/Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch rename to patches/server/Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch diff --git a/patches/unapplied/server/Cache-block-data-strings.patch b/patches/server/Cache-block-data-strings.patch similarity index 100% rename from patches/unapplied/server/Cache-block-data-strings.patch rename to patches/server/Cache-block-data-strings.patch diff --git a/patches/unapplied/server/Climbing-should-not-bypass-cramming-gamerule.patch b/patches/server/Climbing-should-not-bypass-cramming-gamerule.patch similarity index 95% rename from patches/unapplied/server/Climbing-should-not-bypass-cramming-gamerule.patch rename to patches/server/Climbing-should-not-bypass-cramming-gamerule.patch index 3e70015e7f..16bc2fdd40 100644 --- a/patches/unapplied/server/Climbing-should-not-bypass-cramming-gamerule.patch +++ b/patches/server/Climbing-should-not-bypass-cramming-gamerule.patch @@ -24,7 +24,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i } public boolean isPushable() { @@ -68,8 +68,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return; } // Paper end - don't run getEntities if we're not going to use its result -- List list = this.level.getEntities(this, this.getBoundingBox(), EntitySelector.pushableBy(this)); -+ List list = this.level.getEntities(this, this.getBoundingBox(), EntitySelector.pushable(this, level.paperConfig.fixClimbingBypassingCrammingRule)); // Paper - fix climbing bypassing cramming rule +- List list = this.level.getEntities((Entity) this, this.getBoundingBox(), EntitySelector.pushableBy(this)); ++ List list = this.level.getEntities((Entity) this, this.getBoundingBox(), EntitySelector.pushable(this, level.paperConfig.fixClimbingBypassingCrammingRule)); // Paper - fix climbing bypassing cramming rule if (!list.isEmpty()) { // Paper - move up diff --git a/patches/unapplied/server/Create-HoverEvent-from-ItemStack-Entity.patch b/patches/server/Create-HoverEvent-from-ItemStack-Entity.patch similarity index 100% rename from patches/unapplied/server/Create-HoverEvent-from-ItemStack-Entity.patch rename to patches/server/Create-HoverEvent-from-ItemStack-Entity.patch diff --git a/patches/unapplied/server/Don-t-mark-dirty-in-invalid-locations-SPIGOT-6086.patch b/patches/server/Don-t-mark-dirty-in-invalid-locations-SPIGOT-6086.patch similarity index 90% rename from patches/unapplied/server/Don-t-mark-dirty-in-invalid-locations-SPIGOT-6086.patch rename to patches/server/Don-t-mark-dirty-in-invalid-locations-SPIGOT-6086.patch index a6f3949f00..dff5e447b9 100644 --- a/patches/unapplied/server/Don-t-mark-dirty-in-invalid-locations-SPIGOT-6086.patch +++ b/patches/server/Don-t-mark-dirty-in-invalid-locations-SPIGOT-6086.patch @@ -13,6 +13,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public void blockChanged(BlockPos pos) { + if (!pos.isValidLocation(levelHeightAccessor)) return; // Paper - SPIGOT-6086 for all invalid locations; avoid acquiring locks - LevelChunk chunk = this.getSendingChunk(); // Paper - no-tick view distance + LevelChunk chunk = this.getTickingChunk(); if (chunk != null) { diff --git a/patches/unapplied/server/Entity-isTicking.patch b/patches/server/Entity-isTicking.patch similarity index 92% rename from patches/unapplied/server/Entity-isTicking.patch rename to patches/server/Entity-isTicking.patch index b3f149125e..0ba82d101b 100644 --- a/patches/unapplied/server/Entity-isTicking.patch +++ b/patches/server/Entity-isTicking.patch @@ -8,15 +8,15 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ import net.minecraft.resources.ResourceKey; +@@ -0,0 +0,0 @@ import net.minecraft.network.syncher.SynchedEntityData; + import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; - import net.minecraft.server.MCUtil; import net.minecraft.server.MinecraftServer; +import net.minecraft.server.level.ServerChunkCache; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.level.TicketType; -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i public static int nextEntityId() { return ENTITY_COUNTER.incrementAndGet(); } diff --git a/patches/unapplied/server/Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch b/patches/server/Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch similarity index 98% rename from patches/unapplied/server/Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch rename to patches/server/Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch index 72a796cd5f..c01c83ca0e 100644 --- a/patches/unapplied/server/Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch +++ b/patches/server/Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch @@ -9,7 +9,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i void accept(Entity entity, double x, double y, double z); } diff --git a/patches/unapplied/server/Expose-world-spawn-angle.patch b/patches/server/Expose-world-spawn-angle.patch similarity index 100% rename from patches/unapplied/server/Expose-world-spawn-angle.patch rename to patches/server/Expose-world-spawn-angle.patch diff --git a/patches/unapplied/server/Extend-block-drop-capture-to-capture-all-items-added.patch b/patches/server/Extend-block-drop-capture-to-capture-all-items-added.patch similarity index 80% rename from patches/unapplied/server/Extend-block-drop-capture-to-capture-all-items-added.patch rename to patches/server/Extend-block-drop-capture-to-capture-all-items-added.patch index 5b2fd4e6bc..789cae79ec 100644 --- a/patches/unapplied/server/Extend-block-drop-capture-to-capture-all-items-added.patch +++ b/patches/server/Extend-block-drop-capture-to-capture-all-items-added.patch @@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel { - // WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getName(entity.getEntityType())); // CraftBukkit + // WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit return false; } else { + // Paper start - capture all item additions to the world @@ -27,19 +27,11 @@ diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -@@ -0,0 +0,0 @@ import net.minecraft.world.InteractionResult; - import net.minecraft.world.InteractionResultHolder; - import net.minecraft.world.MenuProvider; - import net.minecraft.world.entity.EquipmentSlot; -+import net.minecraft.world.entity.item.ItemEntity; - import net.minecraft.world.entity.player.Player; - import net.minecraft.world.item.DoubleHighBlockItem; - import net.minecraft.world.item.ItemStack; @@ -0,0 +0,0 @@ public class ServerPlayerGameMode { // return true; // CraftBukkit } // CraftBukkit start -+ java.util.List itemsToDrop = level.captureDrops; // Paper - store current list ++ java.util.List itemsToDrop = level.captureDrops; // Paper - store current list + level.captureDrops = null; // Paper - Remove this earlier so that we can actually drop stuff if (event.isDropItems()) { - org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockDropItemEvent(bblock, state, this.player, level.captureDrops); diff --git a/patches/unapplied/server/Fix-Concurrency-issue-in-WeightedList.patch b/patches/server/Fix-Concurrency-issue-in-WeightedList.patch similarity index 100% rename from patches/unapplied/server/Fix-Concurrency-issue-in-WeightedList.patch rename to patches/server/Fix-Concurrency-issue-in-WeightedList.patch diff --git a/patches/unapplied/server/Fix-CraftSound-backwards-compatibility.patch b/patches/server/Fix-CraftSound-backwards-compatibility.patch similarity index 100% rename from patches/unapplied/server/Fix-CraftSound-backwards-compatibility.patch rename to patches/server/Fix-CraftSound-backwards-compatibility.patch diff --git a/patches/unapplied/server/Fix-CraftTeam-null-check.patch b/patches/server/Fix-CraftTeam-null-check.patch similarity index 100% rename from patches/unapplied/server/Fix-CraftTeam-null-check.patch rename to patches/server/Fix-CraftTeam-null-check.patch diff --git a/patches/unapplied/server/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch b/patches/server/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch similarity index 97% rename from patches/unapplied/server/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch rename to patches/server/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch index 0c7be35d3b..151bd60e5e 100644 --- a/patches/unapplied/server/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch +++ b/patches/server/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch @@ -27,14 +27,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.awaitingTeleportTime = this.tickCount; - this.player.absMoveTo(d0, d1, d2, f, f1); + this.player.moveTo(d0, d1, d2, f, f1); // Paper - use proper setPositionRotation for teleportation - this.player.forceCheckHighPriority(); // Paper this.player.connection.send(new ClientboundPlayerPositionPacket(d0 - d3, d1 - d4, d2 - d5, f - f2, f1 - f3, set, this.awaitingTeleport, flag)); } + diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i // CraftBukkit start private static final int CURRENT_LEVEL = 2; @@ -42,7 +42,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 static boolean isLevelAtLeast(CompoundTag tag, int level) { return tag.contains("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level; } -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i } public void moveTo(double x, double y, double z, float yaw, float pitch) { diff --git a/patches/unapplied/server/Fix-Player-spawnParticle-x-y-z-precision-loss.patch b/patches/server/Fix-Player-spawnParticle-x-y-z-precision-loss.patch similarity index 100% rename from patches/unapplied/server/Fix-Player-spawnParticle-x-y-z-precision-loss.patch rename to patches/server/Fix-Player-spawnParticle-x-y-z-precision-loss.patch diff --git a/patches/unapplied/server/Fix-client-lag-on-advancement-loading.patch b/patches/server/Fix-client-lag-on-advancement-loading.patch similarity index 100% rename from patches/unapplied/server/Fix-client-lag-on-advancement-loading.patch rename to patches/server/Fix-client-lag-on-advancement-loading.patch diff --git a/patches/unapplied/server/Fix-curing-zombie-villager-discount-exploit.patch b/patches/server/Fix-curing-zombie-villager-discount-exploit.patch similarity index 100% rename from patches/unapplied/server/Fix-curing-zombie-villager-discount-exploit.patch rename to patches/server/Fix-curing-zombie-villager-discount-exploit.patch diff --git a/patches/unapplied/server/Fix-deop-kicking-non-whitelisted-player-when-white-l.patch b/patches/server/Fix-deop-kicking-non-whitelisted-player-when-white-l.patch similarity index 100% rename from patches/unapplied/server/Fix-deop-kicking-non-whitelisted-player-when-white-l.patch rename to patches/server/Fix-deop-kicking-non-whitelisted-player-when-white-l.patch diff --git a/patches/unapplied/server/Fix-for-large-move-vectors-crashing-server.patch b/patches/server/Fix-for-large-move-vectors-crashing-server.patch similarity index 100% rename from patches/unapplied/server/Fix-for-large-move-vectors-crashing-server.patch rename to patches/server/Fix-for-large-move-vectors-crashing-server.patch diff --git a/patches/unapplied/server/Fix-hex-colors-not-working-in-some-kick-messages.patch b/patches/server/Fix-hex-colors-not-working-in-some-kick-messages.patch similarity index 100% rename from patches/unapplied/server/Fix-hex-colors-not-working-in-some-kick-messages.patch rename to patches/server/Fix-hex-colors-not-working-in-some-kick-messages.patch diff --git a/patches/unapplied/server/Fix-item-locations-dropped-from-campfires.patch b/patches/server/Fix-item-locations-dropped-from-campfires.patch similarity index 100% rename from patches/unapplied/server/Fix-item-locations-dropped-from-campfires.patch rename to patches/server/Fix-item-locations-dropped-from-campfires.patch diff --git a/patches/unapplied/server/Fixed-TileEntityBell-memory-leak.patch b/patches/server/Fixed-TileEntityBell-memory-leak.patch similarity index 100% rename from patches/unapplied/server/Fixed-TileEntityBell-memory-leak.patch rename to patches/server/Fixed-TileEntityBell-memory-leak.patch diff --git a/patches/unapplied/server/Improve-inlinig-for-some-hot-IBlockData-methods.patch b/patches/server/Improve-inlinig-for-some-hot-IBlockData-methods.patch similarity index 100% rename from patches/unapplied/server/Improve-inlinig-for-some-hot-IBlockData-methods.patch rename to patches/server/Improve-inlinig-for-some-hot-IBlockData-methods.patch diff --git a/patches/unapplied/server/Item-no-age-no-player-pickup.patch b/patches/server/Item-no-age-no-player-pickup.patch similarity index 100% rename from patches/unapplied/server/Item-no-age-no-player-pickup.patch rename to patches/server/Item-no-age-no-player-pickup.patch diff --git a/patches/unapplied/server/Lazily-track-plugin-scoreboards-by-default.patch b/patches/server/Lazily-track-plugin-scoreboards-by-default.patch similarity index 96% rename from patches/unapplied/server/Lazily-track-plugin-scoreboards-by-default.patch rename to patches/server/Lazily-track-plugin-scoreboards-by-default.patch index baae44e919..817052afc2 100644 --- a/patches/unapplied/server/Lazily-track-plugin-scoreboards-by-default.patch +++ b/patches/server/Lazily-track-plugin-scoreboards-by-default.patch @@ -18,15 +18,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -0,0 +0,0 @@ public class PaperConfig { - private static void maxJoinsPerTick() { maxJoinsPerTick = getInt("settings.max-joins-per-tick", 3); } -+ + + public static boolean trackPluginScoreboards; + private static void trackPluginScoreboards() { + trackPluginScoreboards = getBoolean("settings.track-plugin-scoreboards", false); + } - } ++ + public static void registerCommands() { + for (Map.Entry entry : commands.entrySet()) { + MinecraftServer.getServer().server.getCommandMap().register(entry.getKey(), "Paper", entry.getValue()); diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java diff --git a/patches/unapplied/server/Limit-recipe-packets.patch b/patches/server/Limit-recipe-packets.patch similarity index 98% rename from patches/unapplied/server/Limit-recipe-packets.patch rename to patches/server/Limit-recipe-packets.patch index 993815cc8a..b32798ffa2 100644 --- a/patches/unapplied/server/Limit-recipe-packets.patch +++ b/patches/server/Limit-recipe-packets.patch @@ -28,7 +28,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser // CraftBukkit start - multithreaded fields - private AtomicInteger chatSpamTickCount = new AtomicInteger(); + private final AtomicInteger chatSpamTickCount = new AtomicInteger(); private final java.util.concurrent.atomic.AtomicInteger tabSpamLimiter = new java.util.concurrent.atomic.AtomicInteger(); // Paper - configurable tab spam limits + private final java.util.concurrent.atomic.AtomicInteger recipeSpamPackets = new java.util.concurrent.atomic.AtomicInteger(); // Paper - auto recipe limit // CraftBukkit end diff --git a/patches/unapplied/server/More-lightning-API.patch b/patches/server/More-lightning-API.patch similarity index 100% rename from patches/unapplied/server/More-lightning-API.patch rename to patches/server/More-lightning-API.patch diff --git a/patches/unapplied/server/Optimise-getType-calls.patch b/patches/server/Optimise-getType-calls.patch similarity index 98% rename from patches/unapplied/server/Optimise-getType-calls.patch rename to patches/server/Optimise-getType-calls.patch index 8a97a1575d..ce479f6785 100644 --- a/patches/unapplied/server/Optimise-getType-calls.patch +++ b/patches/server/Optimise-getType-calls.patch @@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/world/level/block/state/BlockState.java @@ -0,0 +0,0 @@ import net.minecraft.world.level.block.state.properties.Property; public class BlockState extends BlockBehaviour.BlockStateBase { - public static final Codec CODEC = codec(Registry.BLOCK, Block::defaultBlockState).stable(); + public static final Codec CODEC = codec(Registry.BLOCK.byNameCodec(), Block::defaultBlockState).stable(); + // Paper start - optimise getType calls + org.bukkit.Material cachedMaterial; diff --git a/patches/unapplied/server/Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch b/patches/server/Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch similarity index 100% rename from patches/unapplied/server/Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch rename to patches/server/Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch diff --git a/patches/unapplied/server/Player-elytra-boost-API.patch b/patches/server/Player-elytra-boost-API.patch similarity index 100% rename from patches/unapplied/server/Player-elytra-boost-API.patch rename to patches/server/Player-elytra-boost-API.patch diff --git a/patches/unapplied/server/PortalCreateEvent-needs-to-know-its-entity.patch b/patches/server/PortalCreateEvent-needs-to-know-its-entity.patch similarity index 86% rename from patches/unapplied/server/PortalCreateEvent-needs-to-know-its-entity.patch rename to patches/server/PortalCreateEvent-needs-to-know-its-entity.patch index e6e1f4ac81..12e5856fcc 100644 --- a/patches/unapplied/server/PortalCreateEvent-needs-to-know-its-entity.patch +++ b/patches/server/PortalCreateEvent-needs-to-know-its-entity.patch @@ -21,14 +21,6 @@ diff --git a/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java b/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java +++ b/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java -@@ -0,0 +0,0 @@ import net.minecraft.world.damagesource.DamageSource; - import net.minecraft.world.entity.Entity; - import net.minecraft.world.entity.player.Player; - import net.minecraft.world.item.context.BlockPlaceContext; -+import net.minecraft.world.item.context.UseOnContext; - import net.minecraft.world.level.BlockGetter; - import net.minecraft.world.level.Level; - import net.minecraft.world.level.LevelAccessor; @@ -0,0 +0,0 @@ public abstract class BaseFireBlock extends Block { super.entityInside(state, world, pos, entity); } @@ -38,16 +30,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override - public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) { - if (!oldState.is(state.getBlock())) { -+ public void onPlace(BlockState iblockdata, Level world, BlockPos blockposition, BlockState iblockdata1, boolean flag, UseOnContext itemActionContext) { ++ public void onPlace(BlockState iblockdata, Level world, BlockPos blockposition, BlockState iblockdata1, boolean flag, net.minecraft.world.item.context.UseOnContext itemActionContext) { + // Paper end + if (!iblockdata1.is(iblockdata.getBlock())) { if (BaseFireBlock.inPortalDimension(world)) { -- Optional optional = PortalShape.findEmptyPortalShape((LevelAccessor) world, pos, Direction.Axis.X); -+ Optional optional = PortalShape.findEmptyPortalShape((LevelAccessor) world, blockposition, Direction.Axis.X); +- Optional optional = PortalShape.findEmptyPortalShape(world, pos, Direction.Axis.X); ++ Optional optional = PortalShape.findEmptyPortalShape(world, blockposition, Direction.Axis.X); if (optional.isPresent()) { -- ((PortalShape) optional.get()).createPortal(); -+ ((PortalShape) optional.get()).createPortal(itemActionContext); // Paper - pass ItemActionContext param +- ((PortalShape) optional.get()).createPortalBlocks(); ++ ((PortalShape) optional.get()).createPortalBlocks(itemActionContext); // Paper - pass ItemActionContext param return; } } @@ -63,8 +55,8 @@ diff --git a/src/main/java/net/minecraft/world/level/block/FireBlock.java b/src/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/FireBlock.java +++ b/src/main/java/net/minecraft/world/level/block/FireBlock.java -@@ -0,0 +0,0 @@ import net.minecraft.core.Direction; - import net.minecraft.core.Vec3i; +@@ -0,0 +0,0 @@ import net.minecraft.core.BlockPos; + import net.minecraft.core.Direction; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.item.context.BlockPlaceContext; +import net.minecraft.world.item.context.UseOnContext; @@ -77,12 +69,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override - public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) { - super.onPlace(state, world, pos, oldState, notify); -- world.getBlockTicks().scheduleTick(pos, this, FireBlock.getFireTickDelay(world.random)); +- world.scheduleTick(pos, (Block) this, FireBlock.getFireTickDelay(world.random)); + // Paper start - ItemActionContext param + public void onPlace(BlockState iblockdata, Level world, BlockPos blockposition, BlockState iblockdata1, boolean flag, UseOnContext itemActionContext) { + super.onPlace(iblockdata, world, blockposition, iblockdata1, flag, itemActionContext); + // Paper end -+ world.getBlockTicks().scheduleTick(blockposition, this, getFireTickDelay(world.random)); ++ world.scheduleTick(blockposition, this, getFireTickDelay(world.random)); } private static int getFireTickDelay(Random random) { @@ -127,10 +119,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } // CraftBukkit start - return boolean -- public boolean createPortal() { +- public boolean createPortalBlocks() { + // Paper start - ItemActionContext param -+ @Deprecated public boolean createPortal() { return this.createPortal(null); } -+ public boolean createPortal(UseOnContext itemActionContext) { ++ @Deprecated public boolean createPortalBlocks() { return this.createPortalBlocks(null); } ++ public boolean createPortalBlocks(UseOnContext itemActionContext) { + // Paper end org.bukkit.World bworld = this.level.getMinecraftWorld().getWorld(); diff --git a/patches/unapplied/server/Reduce-blockpos-allocation-from-pathfinding.patch b/patches/server/Reduce-blockpos-allocation-from-pathfinding.patch similarity index 100% rename from patches/unapplied/server/Reduce-blockpos-allocation-from-pathfinding.patch rename to patches/server/Reduce-blockpos-allocation-from-pathfinding.patch diff --git a/patches/unapplied/server/Reset-Ender-Crystals-on-Dragon-Spawn.patch b/patches/server/Reset-Ender-Crystals-on-Dragon-Spawn.patch similarity index 100% rename from patches/unapplied/server/Reset-Ender-Crystals-on-Dragon-Spawn.patch rename to patches/server/Reset-Ender-Crystals-on-Dragon-Spawn.patch diff --git a/patches/unapplied/server/Retain-block-place-order-when-capturing-blockstates.patch b/patches/server/Retain-block-place-order-when-capturing-blockstates.patch similarity index 100% rename from patches/unapplied/server/Retain-block-place-order-when-capturing-blockstates.patch rename to patches/server/Retain-block-place-order-when-capturing-blockstates.patch diff --git a/patches/unapplied/server/Significantly-improve-performance-of-the-end-generat.patch b/patches/server/Significantly-improve-performance-of-the-end-generat.patch similarity index 100% rename from patches/unapplied/server/Significantly-improve-performance-of-the-end-generat.patch rename to patches/server/Significantly-improve-performance-of-the-end-generat.patch diff --git a/patches/unapplied/server/Toggle-for-removing-existing-dragon.patch b/patches/server/Toggle-for-removing-existing-dragon.patch similarity index 100% rename from patches/unapplied/server/Toggle-for-removing-existing-dragon.patch rename to patches/server/Toggle-for-removing-existing-dragon.patch diff --git a/patches/unapplied/server/Villager-resetOffers.patch b/patches/server/Villager-resetOffers.patch similarity index 100% rename from patches/unapplied/server/Villager-resetOffers.patch rename to patches/server/Villager-resetOffers.patch diff --git a/patches/unapplied/server/Seed-based-feature-search.patch b/patches/unapplied/server/Seed-based-feature-search.patch deleted file mode 100644 index 9217e92cc9..0000000000 --- a/patches/unapplied/server/Seed-based-feature-search.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Phoenix616 -Date: Mon, 13 Jan 2020 15:40:32 +0100 -Subject: [PATCH] Seed based feature search - -This tries to work around the issue where the server will load -surrounding chunks up to a radius of 100 chunks in order to search for -features e.g. when running the /locate command or for treasure maps -(issue #2312). -This is done by backporting Mojang's change in 1.17 which makes it so -that the biome (generated by the seed) is checked first if the feature -can be generated before actually to load the chunk. - -Additionally to that the center location of the target chunk is simply -returned if the chunk is not loaded to avoid the sync chunk load. -As this can lead to less precise locations a toggle is provided to -enable the sync loading of the target chunk again. - -The main downside of this is that it breaks once the seed or generator -changes but this should usually not happen. A config option to disable -this completely is added though in case that should ever be necessary. - -diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -0,0 +0,0 @@ public class PaperWorldConfig { - } - } - -+ public boolean seedBasedFeatureSearch = true; -+ public boolean seedBasedFeatureSearchLoadsChunks = true; -+ private void seedBasedFeatureSearch() { -+ seedBasedFeatureSearch = getBoolean("seed-based-feature-search", seedBasedFeatureSearch); -+ seedBasedFeatureSearchLoadsChunks = getBoolean("seed-based-feature-search-loads-chunks", seedBasedFeatureSearchLoadsChunks); -+ log("Feature search is based on seed: " + seedBasedFeatureSearch + ", loads chunks:" + seedBasedFeatureSearchLoadsChunks); -+ } -+ - public int maxCollisionsPerEntity; - private void maxEntityCollision() { - maxCollisionsPerEntity = getInt( "max-entity-collisions", this.spigotConfig.getInt("max-entity-collisions", 8) ); -diff --git a/src/main/java/net/minecraft/world/level/levelgen/feature/StructureFeature.java b/src/main/java/net/minecraft/world/level/levelgen/feature/StructureFeature.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/level/levelgen/feature/StructureFeature.java -+++ b/src/main/java/net/minecraft/world/level/levelgen/feature/StructureFeature.java -@@ -0,0 +0,0 @@ public abstract class StructureFeature { - if (!world.getWorldBorder().isChunkInBounds(chunkPos.x, chunkPos.z)) { continue; } // Paper - boolean bl3 = world.getBiomeManager().getPrimaryBiomeAtChunk(chunkPos).getGenerationSettings().isValidStart(this); - if (bl3) { -- ChunkAccess chunkAccess = world.getChunk(chunkPos.x, chunkPos.z, ChunkStatus.STRUCTURE_STARTS); -+ // Paper start - seed based feature search -+ ChunkAccess chunkAccess = null; -+ if (structureAccessor.getWorld().paperConfig.seedBasedFeatureSearch) { -+ Biome biomeBase = structureAccessor.getWorld().getBiomeManager().getBiome(new BlockPos(chunkPos.getMinBlockX() + 9, 0, chunkPos.getMinBlockZ() + 9)); -+ if (!biomeBase.getGenerationSettings().isValidStart(this)) { -+ continue; -+ } -+ if (!structureAccessor.getWorld().paperConfig.seedBasedFeatureSearchLoadsChunks) { -+ chunkAccess = structureAccessor.getWorld().getChunkIfLoaded(chunkPos.x, chunkPos.z); -+ if (chunkAccess == null) { -+ return chunkPos.getWorldPosition().offset(8, searchStartPos.getY(), 8); -+ } -+ } -+ } -+ if (chunkAccess == null) { -+ chunkAccess = world.getChunk(chunkPos.x, chunkPos.z, ChunkStatus.STRUCTURE_STARTS); -+ } -+ // Paper end - StructureStart structureStart = structureAccessor.getStartForFeature(SectionPos.bottomOf(chunkAccess), this, chunkAccess); - if (structureStart != null && structureStart.isValid()) { - if (skipExistingChunks && structureStart.canBeReferenced()) {