From b7ee1ae38a464d94d3d411e59bf89cbaffde0876 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Tue, 14 Mar 2023 20:54:57 +0100 Subject: [PATCH] More more more more more patches --- .../server/Add-Heightmap-API.patch | 0 ...PlayerAttackEntityCooldownResetEvent.patch | 2 +- ...-Plugin-Tickets-to-API-Chunk-Methods.patch | 0 .../server/Add-PrepareResultEvent.patch | 0 ...Add-Raw-Byte-ItemStack-Serialization.patch | 0 .../server/Add-ThrownEggHatchEvent.patch | 0 ...implement-PlayerRecipeBookClickEvent.patch | 0 .../Add-debug-for-sync-chunk-loads.patch | 0 .../server/Add-entity-liquid-API.patch | 0 ...n-for-console-having-all-permissions.patch | 0 ...to-allow-iron-golems-to-spawn-in-air.patch | 0 ...d-option-to-disable-pillager-patrols.patch | 0 ...n-to-nerf-pigmen-from-nether-portals.patch | 0 .../Add-permission-for-command-blocks.patch | 0 ...ntom-creative-and-insomniac-controls.patch | 0 .../Add-tick-times-API-and-mspt-command.patch | 13 +- .../server/Add-villager-reputation-API.patch | 0 .../Allow-Saving-of-Oversized-Chunks.patch | 0 .../{unapplied => }/server/Anti-Xray.patch | 24 +- ...get-gravity-in-void.-Fixes-MC-167279.patch | 0 ...up-duplicated-GameProfile-Properties.patch | 0 ...le-Keep-Spawn-Loaded-range-per-world.patch | 0 ...-chance-of-villager-zombie-infection.patch | 0 ...gurable-projectile-relative-velocity.patch | 2 +- ...nvert-legacy-attributes-in-Item-Meta.patch | 0 ...d-Player-s-shouldn-t-be-able-to-move.patch | 0 ...ktraces-in-log-messages-crash-report.patch | 4 +- ...low-bees-to-load-chunks-for-beehives.patch | 0 ...k-for-portal-on-world-gen-entity-add.patch | 2 +- ...layer-is-attempted-to-be-removed-fro.patch | 0 ...t-fire-BlockFade-on-worldgen-threads.patch | 0 ...Chunks-from-Hoppers-and-other-things.patch | 0 ...move-existing-players-to-world-spawn.patch | 2 +- ...-entity-collision-code-if-not-needed.patch | 2 +- .../server/Don-t-tick-dead-players.patch | 0 .../Dont-send-unnecessary-sign-update.patch | 0 .../Duplicate-UUID-Resolve-Option.patch | 0 ...sure-Entity-AABB-s-are-never-invalid.patch | 0 ...der-respects-game-and-entity-rules-f.patch | 0 .../server/Ensure-safe-gateway-teleport.patch | 0 .../server/Entity-Activation-Range-2.0.patch | 17 +- .../server/Entity-Jump-API.patch | 2 +- .../server/ExperienceOrbMergeEvent.patch | 0 .../Expose-MinecraftServer-isRunning.patch | 0 .../server/Expose-game-version.patch | 0 .../Expose-the-internal-current-tick.patch | 0 ...l-to-changed-postToMainThread-method.patch | 0 ...er-runTaskTimerAsynchronously-Plugin.patch | 0 ...g-Broken-behavior-of-PlayerJoinEvent.patch | 0 .../server/Fix-MC-158900.patch | 2 +- ...ld-Difficulty-Remembering-Difficulty.patch | 0 .../Fix-PotionEffect-ignores-icon-flag.patch | 0 ...4-Bukkit-world-container-is-not-used.patch | 0 ...-5885-Unable-to-disable-advancements.patch | 0 .../server/Fix-SPIGOT-5989.patch | 0 .../Fix-World-isChunkGenerated-calls.patch | 0 ...ix-arrows-never-despawning-MC-125757.patch | 0 .../Fix-items-not-falling-correctly.patch | 2 +- ...x-items-vanishing-through-end-portal.patch | 0 ...k-in-stack-not-having-effects-when-d.patch | 0 ...ssing-chunks-due-to-integer-overflow.patch | 0 ...m-duplication-issues-and-teleport-is.patch | 8 +- ...ston-physics-inconsistency-MC-188840.patch | 0 .../server/Fix-sand-duping.patch | 0 ...n-item-frames-are-modified-MC-123450.patch | 0 ...ix-villager-trading-demand-MC-163962.patch | 0 .../Flat-bedrock-generator-settings.patch | 0 ...rializing-mismatching-chunk-coordina.patch | 0 .../Hide-sync-chunk-writes-behind-flag.patch | 2 +- .../Implement-CraftBlockSoundGroup.patch | 0 .../server/Implement-Mob-Goal-API.patch | 0 .../Implement-Player-Client-Options-API.patch | 2 +- ...lement-alternative-item-despawn-rate.patch | 12 +- .../server/Improve-Arrow-API.patch | 0 .../Improve-Block-breakNaturally-API.patch | 10 +- ...-Legacy-Component-serialization-size.patch | 0 ...ve-fix-EntityTargetLivingEntityEvent.patch | 0 .../server/Improved-Watchdog-Support.patch | 17 +- .../server/Increase-Light-Queue-Size.patch | 0 ...Holder-method-without-block-snapshot.patch | 0 .../server/Lag-compensate-eating.patch | 10 +- ...5656-Fix-Follow-Range-Initial-Target.patch | 0 .../server/Make-the-GUI-graph-fancier.patch | 0 .../server/Maps-shouldn-t-load-chunks.patch | 0 .../server/Mob-Spawner-API-Enhancements.patch | 0 ...pawn-point-if-spawn-in-unloaded-worl.patch | 0 ...al-Spawned-mobs-towards-natural-spaw.patch | 0 .../server/Optimise-Chunk-getFluid.patch | 0 ...ptimise-EntityGetter-getPlayerByUUID.patch | 2 +- ...e-getChunkAt-calls-for-loaded-chunks.patch | 0 .../Optimize-Bit-Operations-by-inlining.patch | 2 +- .../Optimize-Captured-TileEntity-Lookup.patch | 0 ...ptimize-Collision-to-not-load-chunks.patch | 0 ...oalSelector-Goal.Flag-Set-operations.patch | 0 ...ze-NetworkManager-Exception-Handling.patch | 2 +- .../server/Optimize-Pathfinding.patch | 0 .../server/Optimize-Voxel-Shape-Merging.patch | 0 ...erCloseEnoughForSpawning-to-use-dist.patch | 0 ...-brigadier-child-sorting-performance.patch | 0 ...mize-call-to-getFluid-for-explosions.patch | 2 +- ...-maximum-exp-value-when-merging-orbs.patch | 0 .../server/Paper-dumpitem-command.patch | 0 ...spawn-settings-and-per-player-option.patch | 0 .../PlayerDeathEvent-getItemsToKeep.patch | 0 ...layerDeathEvent-shouldDropExperience.patch | 0 .../server/Potential-bed-API.patch | 0 ...-PlayerChunkMap-adds-crashing-server.patch | 0 ...oading-chunks-checking-hive-position.patch | 0 ...revent-consuming-the-wrong-itemstack.patch | 6 +- ...vent-opening-inventories-when-frozen.patch | 0 ...-desync-in-playerconnection-causing-.patch | 0 ...nk-loads-when-villagers-try-to-find-.patch | 0 .../Prevent-teleporting-dead-entities.patch | 2 +- ...and-End-Portal-Frames-from-being-des.patch | 2 +- .../Reduce-Either-Optional-allocation.patch | 0 ...bleInt-allocations-from-light-engine.patch | 0 ...llocation-of-Vec3D-by-entity-tracker.patch | 0 ...e-memory-footprint-of-NBTTagCompound.patch | 0 ...nnections-shouldn-t-hold-up-shutdown.patch | 0 .../Remove-garbage-Java-version-check.patch | 0 .../Remove-some-streams-from-structures.patch | 0 ...from-classes-related-villager-gossip.patch | 0 .../server/Server-Tick-Events.patch | 2 +- ...-per-thread-native-byte-buffer-cache.patch | 0 ...erbose-world-setting-to-false-by-def.patch | 0 ...ate-location-if-we-failed-to-read-it.patch | 0 ...awn-player-in-correct-world-on-login.patch | 0 ...te-operations-for-updating-light-dat.patch | 0 .../Support-components-in-ItemMeta.patch | 0 .../Support-old-UUID-format-for-NBT.patch | 0 ...-Vanilla-Command-permission-checking.patch | 0 .../server/Tracking-Range-Improvements.patch | 0 ...pdate-itemstack-legacy-name-and-lore.patch | 0 ...tance-map-to-optimise-entity-tracker.patch | 0 ...ookup-for-Treasure-Maps-Fixes-lag-fr.patch | 0 ...PickItem-Packet-and-kick-for-invalid.patch | 0 ...ripwire-hook-placement-before-update.patch | 0 .../server/Villager-Restocks-API.patch | 0 ...Wait-for-Async-Tasks-during-shutdown.patch | 0 .../add-hand-to-BlockMultiPlaceEvent.patch | 0 ...ement-optional-per-player-mob-spawns.patch | 2 +- .../incremental-chunk-and-player-saving.patch | 2 +- .../server/misc-debugging-dumps.patch | 0 .../server/offset-item-frame-ticking.patch | 0 .../unapplied/server/Optimize-Hoppers.patch | 585 ------------------ ...ancement-data-player-iteration-to-be.patch | 54 -- 146 files changed, 68 insertions(+), 730 deletions(-) rename patches/{unapplied => }/server/Add-Heightmap-API.patch (100%) rename patches/{unapplied => }/server/Add-PlayerAttackEntityCooldownResetEvent.patch (98%) rename patches/{unapplied => }/server/Add-Plugin-Tickets-to-API-Chunk-Methods.patch (100%) rename patches/{unapplied => }/server/Add-PrepareResultEvent.patch (100%) rename patches/{unapplied => }/server/Add-Raw-Byte-ItemStack-Serialization.patch (100%) rename patches/{unapplied => }/server/Add-ThrownEggHatchEvent.patch (100%) rename patches/{unapplied => }/server/Add-and-implement-PlayerRecipeBookClickEvent.patch (100%) rename patches/{unapplied => }/server/Add-debug-for-sync-chunk-loads.patch (100%) rename patches/{unapplied => }/server/Add-entity-liquid-API.patch (100%) rename patches/{unapplied => }/server/Add-option-for-console-having-all-permissions.patch (100%) rename patches/{unapplied => }/server/Add-option-to-allow-iron-golems-to-spawn-in-air.patch (100%) rename patches/{unapplied => }/server/Add-option-to-disable-pillager-patrols.patch (100%) rename patches/{unapplied => }/server/Add-option-to-nerf-pigmen-from-nether-portals.patch (100%) rename patches/{unapplied => }/server/Add-permission-for-command-blocks.patch (100%) rename patches/{unapplied => }/server/Add-phantom-creative-and-insomniac-controls.patch (100%) rename patches/{unapplied => }/server/Add-tick-times-API-and-mspt-command.patch (96%) rename patches/{unapplied => }/server/Add-villager-reputation-API.patch (100%) rename patches/{unapplied => }/server/Allow-Saving-of-Oversized-Chunks.patch (100%) rename patches/{unapplied => }/server/Anti-Xray.patch (96%) rename patches/{unapplied => }/server/Bees-get-gravity-in-void.-Fixes-MC-167279.patch (100%) rename patches/{unapplied => }/server/Clean-up-duplicated-GameProfile-Properties.patch (100%) rename patches/{unapplied => }/server/Configurable-Keep-Spawn-Loaded-range-per-world.patch (100%) rename patches/{unapplied => }/server/Configurable-chance-of-villager-zombie-infection.patch (100%) rename patches/{unapplied => }/server/Configurable-projectile-relative-velocity.patch (98%) rename patches/{unapplied => }/server/Convert-legacy-attributes-in-Item-Meta.patch (100%) rename patches/{unapplied => }/server/Dead-Player-s-shouldn-t-be-able-to-move.patch (100%) rename patches/{unapplied => }/server/Deobfuscate-stacktraces-in-log-messages-crash-report.patch (99%) rename patches/{unapplied => }/server/Do-not-allow-bees-to-load-chunks-for-beehives.patch (100%) rename patches/{unapplied => }/server/Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch (97%) rename patches/{unapplied => }/server/Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch (100%) rename patches/{unapplied => }/server/Don-t-fire-BlockFade-on-worldgen-threads.patch (100%) rename patches/{unapplied => }/server/Don-t-load-Chunks-from-Hoppers-and-other-things.patch (100%) rename patches/{unapplied => }/server/Don-t-move-existing-players-to-world-spawn.patch (98%) rename patches/{unapplied => }/server/Don-t-run-entity-collision-code-if-not-needed.patch (98%) rename patches/{unapplied => }/server/Don-t-tick-dead-players.patch (100%) rename patches/{unapplied => }/server/Dont-send-unnecessary-sign-update.patch (100%) rename patches/{unapplied => }/server/Duplicate-UUID-Resolve-Option.patch (100%) rename patches/{unapplied => }/server/Ensure-Entity-AABB-s-are-never-invalid.patch (100%) rename patches/{unapplied => }/server/Ensure-EntityRaider-respects-game-and-entity-rules-f.patch (100%) rename patches/{unapplied => }/server/Ensure-safe-gateway-teleport.patch (100%) rename patches/{unapplied => }/server/Entity-Activation-Range-2.0.patch (98%) rename patches/{unapplied => }/server/Entity-Jump-API.patch (99%) rename patches/{unapplied => }/server/ExperienceOrbMergeEvent.patch (100%) rename patches/{unapplied => }/server/Expose-MinecraftServer-isRunning.patch (100%) rename patches/{unapplied => }/server/Expose-game-version.patch (100%) rename patches/{unapplied => }/server/Expose-the-internal-current-tick.patch (100%) rename patches/{unapplied => }/server/Fix-CB-call-to-changed-postToMainThread-method.patch (100%) rename patches/{unapplied => }/server/Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch (100%) rename patches/{unapplied => }/server/Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch (100%) rename patches/{unapplied => }/server/Fix-MC-158900.patch (96%) rename patches/{unapplied => }/server/Fix-Per-World-Difficulty-Remembering-Difficulty.patch (100%) rename patches/{unapplied => }/server/Fix-PotionEffect-ignores-icon-flag.patch (100%) rename patches/{unapplied => }/server/Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch (100%) rename patches/{unapplied => }/server/Fix-SPIGOT-5885-Unable-to-disable-advancements.patch (100%) rename patches/{unapplied => }/server/Fix-SPIGOT-5989.patch (100%) rename patches/{unapplied => }/server/Fix-World-isChunkGenerated-calls.patch (100%) rename patches/{unapplied => }/server/Fix-arrows-never-despawning-MC-125757.patch (100%) rename patches/{unapplied => }/server/Fix-items-not-falling-correctly.patch (96%) rename patches/{unapplied => }/server/Fix-items-vanishing-through-end-portal.patch (100%) rename patches/{unapplied => }/server/Fix-last-firework-in-stack-not-having-effects-when-d.patch (100%) rename patches/{unapplied => }/server/Fix-missing-chunks-due-to-integer-overflow.patch (100%) rename patches/{unapplied => }/server/Fix-numerous-item-duplication-issues-and-teleport-is.patch (98%) rename patches/{unapplied => }/server/Fix-piston-physics-inconsistency-MC-188840.patch (100%) rename patches/{unapplied => }/server/Fix-sand-duping.patch (100%) rename patches/{unapplied => }/server/Fix-sounds-when-item-frames-are-modified-MC-123450.patch (100%) rename patches/{unapplied => }/server/Fix-villager-trading-demand-MC-163962.patch (100%) rename patches/{unapplied => }/server/Flat-bedrock-generator-settings.patch (100%) rename patches/{unapplied => }/server/Guard-against-serializing-mismatching-chunk-coordina.patch (100%) rename patches/{unapplied => }/server/Hide-sync-chunk-writes-behind-flag.patch (95%) rename patches/{unapplied => }/server/Implement-CraftBlockSoundGroup.patch (100%) rename patches/{unapplied => }/server/Implement-Mob-Goal-API.patch (100%) rename patches/{unapplied => }/server/Implement-Player-Client-Options-API.patch (99%) rename patches/{unapplied => }/server/Implement-alternative-item-despawn-rate.patch (86%) rename patches/{unapplied => }/server/Improve-Arrow-API.patch (100%) rename patches/{unapplied => }/server/Improve-Block-breakNaturally-API.patch (97%) rename patches/{unapplied => }/server/Improve-Legacy-Component-serialization-size.patch (100%) rename patches/{unapplied => }/server/Improve-fix-EntityTargetLivingEntityEvent.patch (100%) rename patches/{unapplied => }/server/Improved-Watchdog-Support.patch (97%) rename patches/{unapplied => }/server/Increase-Light-Queue-Size.patch (100%) rename patches/{unapplied => }/server/Inventory-getHolder-method-without-block-snapshot.patch (100%) rename patches/{unapplied => }/server/Lag-compensate-eating.patch (96%) rename patches/{unapplied => }/server/MC-145656-Fix-Follow-Range-Initial-Target.patch (100%) rename patches/{unapplied => }/server/Make-the-GUI-graph-fancier.patch (100%) rename patches/{unapplied => }/server/Maps-shouldn-t-load-chunks.patch (100%) rename patches/{unapplied => }/server/Mob-Spawner-API-Enhancements.patch (100%) rename patches/{unapplied => }/server/Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch (100%) rename patches/{unapplied => }/server/Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch (100%) rename patches/{unapplied => }/server/Optimise-Chunk-getFluid.patch (100%) rename patches/{unapplied => }/server/Optimise-EntityGetter-getPlayerByUUID.patch (92%) rename patches/{unapplied => }/server/Optimise-getChunkAt-calls-for-loaded-chunks.patch (100%) rename patches/{unapplied => }/server/Optimize-Bit-Operations-by-inlining.patch (99%) rename patches/{unapplied => }/server/Optimize-Captured-TileEntity-Lookup.patch (100%) rename patches/{unapplied => }/server/Optimize-Collision-to-not-load-chunks.patch (100%) rename patches/{unapplied => }/server/Optimize-GoalSelector-Goal.Flag-Set-operations.patch (100%) rename patches/{unapplied => }/server/Optimize-NetworkManager-Exception-Handling.patch (98%) rename patches/{unapplied => }/server/Optimize-Pathfinding.patch (100%) rename patches/{unapplied => }/server/Optimize-Voxel-Shape-Merging.patch (100%) rename patches/{unapplied => }/server/Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch (100%) rename patches/{unapplied => }/server/Optimize-brigadier-child-sorting-performance.patch (100%) rename patches/{unapplied => }/server/Optimize-call-to-getFluid-for-explosions.patch (92%) rename patches/{unapplied => }/server/Option-for-maximum-exp-value-when-merging-orbs.patch (100%) rename patches/{unapplied => }/server/Paper-dumpitem-command.patch (100%) rename patches/{unapplied => }/server/Pillager-patrol-spawn-settings-and-per-player-option.patch (100%) rename patches/{unapplied => }/server/PlayerDeathEvent-getItemsToKeep.patch (100%) rename patches/{unapplied => }/server/PlayerDeathEvent-shouldDropExperience.patch (100%) rename patches/{unapplied => }/server/Potential-bed-API.patch (100%) rename patches/{unapplied => }/server/Prevent-Double-PlayerChunkMap-adds-crashing-server.patch (100%) rename patches/{unapplied => }/server/Prevent-bees-loading-chunks-checking-hive-position.patch (100%) rename patches/{unapplied => }/server/Prevent-consuming-the-wrong-itemstack.patch (96%) rename patches/{unapplied => }/server/Prevent-opening-inventories-when-frozen.patch (100%) rename patches/{unapplied => }/server/Prevent-position-desync-in-playerconnection-causing-.patch (100%) rename patches/{unapplied => }/server/Prevent-sync-chunk-loads-when-villagers-try-to-find-.patch (100%) rename patches/{unapplied => }/server/Prevent-teleporting-dead-entities.patch (92%) rename patches/{unapplied => }/server/Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch (99%) rename patches/{unapplied => }/server/Reduce-Either-Optional-allocation.patch (100%) rename patches/{unapplied => }/server/Reduce-MutableInt-allocations-from-light-engine.patch (100%) rename patches/{unapplied => }/server/Reduce-allocation-of-Vec3D-by-entity-tracker.patch (100%) rename patches/{unapplied => }/server/Reduce-memory-footprint-of-NBTTagCompound.patch (100%) rename patches/{unapplied => }/server/Remote-Connections-shouldn-t-hold-up-shutdown.patch (100%) rename patches/{unapplied => }/server/Remove-garbage-Java-version-check.patch (100%) rename patches/{unapplied => }/server/Remove-some-streams-from-structures.patch (100%) rename patches/{unapplied => }/server/Remove-streams-from-classes-related-villager-gossip.patch (100%) rename patches/{unapplied => }/server/Server-Tick-Events.patch (95%) rename patches/{unapplied => }/server/Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch (100%) rename patches/{unapplied => }/server/Set-spigots-verbose-world-setting-to-false-by-def.patch (100%) rename patches/{unapplied => }/server/Show-blockstate-location-if-we-failed-to-read-it.patch (100%) rename patches/{unapplied => }/server/Spawn-player-in-correct-world-on-login.patch (100%) rename patches/{unapplied => }/server/Stop-copy-on-write-operations-for-updating-light-dat.patch (100%) rename patches/{unapplied => }/server/Support-components-in-ItemMeta.patch (100%) rename patches/{unapplied => }/server/Support-old-UUID-format-for-NBT.patch (100%) rename patches/{unapplied => }/server/Thread-Safe-Vanilla-Command-permission-checking.patch (100%) rename patches/{unapplied => }/server/Tracking-Range-Improvements.patch (100%) rename patches/{unapplied => }/server/Update-itemstack-legacy-name-and-lore.patch (100%) rename patches/{unapplied => }/server/Use-distance-map-to-optimise-entity-tracker.patch (100%) rename patches/{unapplied => }/server/Use-seed-based-lookup-for-Treasure-Maps-Fixes-lag-fr.patch (100%) rename patches/{unapplied => }/server/Validate-PickItem-Packet-and-kick-for-invalid.patch (100%) rename patches/{unapplied => }/server/Validate-tripwire-hook-placement-before-update.patch (100%) rename patches/{unapplied => }/server/Villager-Restocks-API.patch (100%) rename patches/{unapplied => }/server/Wait-for-Async-Tasks-during-shutdown.patch (100%) rename patches/{unapplied => }/server/add-hand-to-BlockMultiPlaceEvent.patch (100%) rename patches/{unapplied => }/server/implement-optional-per-player-mob-spawns.patch (99%) rename patches/{unapplied => }/server/incremental-chunk-and-player-saving.patch (99%) rename patches/{unapplied => }/server/misc-debugging-dumps.patch (100%) rename patches/{unapplied => }/server/offset-item-frame-ticking.patch (100%) delete mode 100644 patches/unapplied/server/Optimize-Hoppers.patch delete mode 100644 patches/unapplied/server/Optimize-the-advancement-data-player-iteration-to-be.patch diff --git a/patches/unapplied/server/Add-Heightmap-API.patch b/patches/server/Add-Heightmap-API.patch similarity index 100% rename from patches/unapplied/server/Add-Heightmap-API.patch rename to patches/server/Add-Heightmap-API.patch diff --git a/patches/unapplied/server/Add-PlayerAttackEntityCooldownResetEvent.patch b/patches/server/Add-PlayerAttackEntityCooldownResetEvent.patch similarity index 98% rename from patches/unapplied/server/Add-PlayerAttackEntityCooldownResetEvent.patch rename to patches/server/Add-PlayerAttackEntityCooldownResetEvent.patch index aac82f9255..34aad73b10 100644 --- a/patches/unapplied/server/Add-PlayerAttackEntityCooldownResetEvent.patch +++ b/patches/server/Add-PlayerAttackEntityCooldownResetEvent.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/ma index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { +@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { EntityDamageEvent event = CraftEventFactory.handleLivingEntityDamageEvent(this, damagesource, originalDamage, hardHatModifier, blockingModifier, armorModifier, resistanceModifier, magicModifier, absorptionModifier, hardHat, blocking, armor, resistance, magic, absorption); if (damagesource.getEntity() instanceof net.minecraft.world.entity.player.Player) { diff --git a/patches/unapplied/server/Add-Plugin-Tickets-to-API-Chunk-Methods.patch b/patches/server/Add-Plugin-Tickets-to-API-Chunk-Methods.patch similarity index 100% rename from patches/unapplied/server/Add-Plugin-Tickets-to-API-Chunk-Methods.patch rename to patches/server/Add-Plugin-Tickets-to-API-Chunk-Methods.patch diff --git a/patches/unapplied/server/Add-PrepareResultEvent.patch b/patches/server/Add-PrepareResultEvent.patch similarity index 100% rename from patches/unapplied/server/Add-PrepareResultEvent.patch rename to patches/server/Add-PrepareResultEvent.patch diff --git a/patches/unapplied/server/Add-Raw-Byte-ItemStack-Serialization.patch b/patches/server/Add-Raw-Byte-ItemStack-Serialization.patch similarity index 100% rename from patches/unapplied/server/Add-Raw-Byte-ItemStack-Serialization.patch rename to patches/server/Add-Raw-Byte-ItemStack-Serialization.patch diff --git a/patches/unapplied/server/Add-ThrownEggHatchEvent.patch b/patches/server/Add-ThrownEggHatchEvent.patch similarity index 100% rename from patches/unapplied/server/Add-ThrownEggHatchEvent.patch rename to patches/server/Add-ThrownEggHatchEvent.patch diff --git a/patches/unapplied/server/Add-and-implement-PlayerRecipeBookClickEvent.patch b/patches/server/Add-and-implement-PlayerRecipeBookClickEvent.patch similarity index 100% rename from patches/unapplied/server/Add-and-implement-PlayerRecipeBookClickEvent.patch rename to patches/server/Add-and-implement-PlayerRecipeBookClickEvent.patch diff --git a/patches/unapplied/server/Add-debug-for-sync-chunk-loads.patch b/patches/server/Add-debug-for-sync-chunk-loads.patch similarity index 100% rename from patches/unapplied/server/Add-debug-for-sync-chunk-loads.patch rename to patches/server/Add-debug-for-sync-chunk-loads.patch diff --git a/patches/unapplied/server/Add-entity-liquid-API.patch b/patches/server/Add-entity-liquid-API.patch similarity index 100% rename from patches/unapplied/server/Add-entity-liquid-API.patch rename to patches/server/Add-entity-liquid-API.patch diff --git a/patches/unapplied/server/Add-option-for-console-having-all-permissions.patch b/patches/server/Add-option-for-console-having-all-permissions.patch similarity index 100% rename from patches/unapplied/server/Add-option-for-console-having-all-permissions.patch rename to patches/server/Add-option-for-console-having-all-permissions.patch diff --git a/patches/unapplied/server/Add-option-to-allow-iron-golems-to-spawn-in-air.patch b/patches/server/Add-option-to-allow-iron-golems-to-spawn-in-air.patch similarity index 100% rename from patches/unapplied/server/Add-option-to-allow-iron-golems-to-spawn-in-air.patch rename to patches/server/Add-option-to-allow-iron-golems-to-spawn-in-air.patch diff --git a/patches/unapplied/server/Add-option-to-disable-pillager-patrols.patch b/patches/server/Add-option-to-disable-pillager-patrols.patch similarity index 100% rename from patches/unapplied/server/Add-option-to-disable-pillager-patrols.patch rename to patches/server/Add-option-to-disable-pillager-patrols.patch diff --git a/patches/unapplied/server/Add-option-to-nerf-pigmen-from-nether-portals.patch b/patches/server/Add-option-to-nerf-pigmen-from-nether-portals.patch similarity index 100% rename from patches/unapplied/server/Add-option-to-nerf-pigmen-from-nether-portals.patch rename to patches/server/Add-option-to-nerf-pigmen-from-nether-portals.patch diff --git a/patches/unapplied/server/Add-permission-for-command-blocks.patch b/patches/server/Add-permission-for-command-blocks.patch similarity index 100% rename from patches/unapplied/server/Add-permission-for-command-blocks.patch rename to patches/server/Add-permission-for-command-blocks.patch diff --git a/patches/unapplied/server/Add-phantom-creative-and-insomniac-controls.patch b/patches/server/Add-phantom-creative-and-insomniac-controls.patch similarity index 100% rename from patches/unapplied/server/Add-phantom-creative-and-insomniac-controls.patch rename to patches/server/Add-phantom-creative-and-insomniac-controls.patch diff --git a/patches/unapplied/server/Add-tick-times-API-and-mspt-command.patch b/patches/server/Add-tick-times-API-and-mspt-command.patch similarity index 96% rename from patches/unapplied/server/Add-tick-times-API-and-mspt-command.patch rename to patches/server/Add-tick-times-API-and-mspt-command.patch index b7a5954c3d..0ccb68b609 100644 --- a/patches/unapplied/server/Add-tick-times-API-and-mspt-command.patch +++ b/patches/server/Add-tick-times-API-and-mspt-command.patch @@ -141,16 +141,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private KeyPair keyPair; @Nullable @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop refreshPackets = new java.util.HashMap<>(); // Paper - Anti-Xray - Bypass - for (Iterator iterator = this.getPlayers(chunkcoordintpair, false).iterator(); iterator.hasNext(); entityplayer.trackChunk(chunkcoordintpair, (Packet) mutableobject.getValue())) { - entityplayer = (ServerPlayer) iterator.next(); -- if (mutableobject.getValue() == null) { -- mutableobject.setValue(new ClientboundLevelChunkWithLightPacket(chunk1, this.lightEngine, (BitSet) null, (BitSet) null, true)); -- } -+ Boolean shouldModify = chunk1.getLevel().chunkPacketBlockController.shouldModify(entityplayer, chunk1); -+ mutableobject.setValue(refreshPackets.computeIfAbsent(shouldModify, s -> new ClientboundLevelChunkWithLightPacket(chunk1, this.lightEngine, (BitSet) null, (BitSet) null, true, (Boolean) s))); // Paper - Anti-Xray - Bypass - } - + }); } - private void playerLoadedChunk(ServerPlayer player, MutableObject cachedDataPacket, LevelChunk chunk) { @@ -1130,11 +1118,11 @@ 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 { - public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) { // Holder holder = worlddimension.type(); // CraftBukkit - decompile error + // Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error -- super(iworlddataserver, resourcekey, worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig))); // Paper -+ super(iworlddataserver, resourcekey, worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), executor); // Paper - Async-Anti-Xray - Pass executor +- super(iworlddataserver, resourcekey, minecraftserver.registryAccess(), worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig))); // Paper ++ super(iworlddataserver, resourcekey, minecraftserver.registryAccess(), worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig)), executor); // Paper - Async-Anti-Xray - Pass executor this.pvpMode = minecraftserver.isPvpAllowed(); this.convertable = convertable_conversionsession; this.uuid = WorldUUID.getUUID(convertable_conversionsession.levelDirectory.path().toFile()); @@ -1176,8 +1164,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public abstract ResourceKey getTypeKey(); -- protected Level(WritableLevelData worlddatamutable, ResourceKey resourcekey, Holder holder, Supplier supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function paperWorldConfigCreator) { // Paper -+ protected Level(WritableLevelData worlddatamutable, ResourceKey resourcekey, Holder holder, Supplier supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor +- protected Level(WritableLevelData worlddatamutable, ResourceKey resourcekey, RegistryAccess iregistrycustom, Holder holder, Supplier supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function paperWorldConfigCreator) { // Paper ++ protected Level(WritableLevelData worlddatamutable, ResourceKey resourcekey, RegistryAccess iregistrycustom, Holder holder, Supplier supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper this.generator = gen; diff --git a/patches/unapplied/server/Bees-get-gravity-in-void.-Fixes-MC-167279.patch b/patches/server/Bees-get-gravity-in-void.-Fixes-MC-167279.patch similarity index 100% rename from patches/unapplied/server/Bees-get-gravity-in-void.-Fixes-MC-167279.patch rename to patches/server/Bees-get-gravity-in-void.-Fixes-MC-167279.patch diff --git a/patches/unapplied/server/Clean-up-duplicated-GameProfile-Properties.patch b/patches/server/Clean-up-duplicated-GameProfile-Properties.patch similarity index 100% rename from patches/unapplied/server/Clean-up-duplicated-GameProfile-Properties.patch rename to patches/server/Clean-up-duplicated-GameProfile-Properties.patch diff --git a/patches/unapplied/server/Configurable-Keep-Spawn-Loaded-range-per-world.patch b/patches/server/Configurable-Keep-Spawn-Loaded-range-per-world.patch similarity index 100% rename from patches/unapplied/server/Configurable-Keep-Spawn-Loaded-range-per-world.patch rename to patches/server/Configurable-Keep-Spawn-Loaded-range-per-world.patch diff --git a/patches/unapplied/server/Configurable-chance-of-villager-zombie-infection.patch b/patches/server/Configurable-chance-of-villager-zombie-infection.patch similarity index 100% rename from patches/unapplied/server/Configurable-chance-of-villager-zombie-infection.patch rename to patches/server/Configurable-chance-of-villager-zombie-infection.patch diff --git a/patches/unapplied/server/Configurable-projectile-relative-velocity.patch b/patches/server/Configurable-projectile-relative-velocity.patch similarity index 98% rename from patches/unapplied/server/Configurable-projectile-relative-velocity.patch rename to patches/server/Configurable-projectile-relative-velocity.patch index 9bfd48c059..f8359f0cd0 100644 --- a/patches/unapplied/server/Configurable-projectile-relative-velocity.patch +++ b/patches/server/Configurable-projectile-relative-velocity.patch @@ -28,7 +28,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java +++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java -@@ -0,0 +0,0 @@ public abstract class Projectile extends Entity { +@@ -0,0 +0,0 @@ public abstract class Projectile extends Entity implements TraceableEntity { this.shoot((double) f5, (double) f6, (double) f7, speed, divergence); Vec3 vec3d = shooter.getDeltaMovement(); diff --git a/patches/unapplied/server/Convert-legacy-attributes-in-Item-Meta.patch b/patches/server/Convert-legacy-attributes-in-Item-Meta.patch similarity index 100% rename from patches/unapplied/server/Convert-legacy-attributes-in-Item-Meta.patch rename to patches/server/Convert-legacy-attributes-in-Item-Meta.patch diff --git a/patches/unapplied/server/Dead-Player-s-shouldn-t-be-able-to-move.patch b/patches/server/Dead-Player-s-shouldn-t-be-able-to-move.patch similarity index 100% rename from patches/unapplied/server/Dead-Player-s-shouldn-t-be-able-to-move.patch rename to patches/server/Dead-Player-s-shouldn-t-be-able-to-move.patch diff --git a/patches/unapplied/server/Deobfuscate-stacktraces-in-log-messages-crash-report.patch b/patches/server/Deobfuscate-stacktraces-in-log-messages-crash-report.patch similarity index 99% rename from patches/unapplied/server/Deobfuscate-stacktraces-in-log-messages-crash-report.patch rename to patches/server/Deobfuscate-stacktraces-in-log-messages-crash-report.patch index ddd1bbff1f..bb5beceb72 100644 --- a/patches/unapplied/server/Deobfuscate-stacktraces-in-log-messages-crash-report.patch +++ b/patches/server/Deobfuscate-stacktraces-in-log-messages-crash-report.patch @@ -22,8 +22,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 implementation("org.spongepowered:configurate-yaml:4.1.2") // Paper - config files implementation("commons-lang:commons-lang:2.6") + implementation("net.fabricmc:mapping-io:0.3.0") // Paper - needed to read mappings for stacktrace deobfuscation - runtimeOnly("org.xerial:sqlite-jdbc:3.36.0.3") - runtimeOnly("mysql:mysql-connector-java:8.0.29") + runtimeOnly("org.xerial:sqlite-jdbc:3.41.0.0") + runtimeOnly("com.mysql:mysql-connector-j:8.0.32") runtimeOnly("com.lmax:disruptor:3.4.4") // Paper @@ -0,0 +0,0 @@ tasks.check { } diff --git a/patches/unapplied/server/Do-not-allow-bees-to-load-chunks-for-beehives.patch b/patches/server/Do-not-allow-bees-to-load-chunks-for-beehives.patch similarity index 100% rename from patches/unapplied/server/Do-not-allow-bees-to-load-chunks-for-beehives.patch rename to patches/server/Do-not-allow-bees-to-load-chunks-for-beehives.patch diff --git a/patches/unapplied/server/Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch b/patches/server/Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch similarity index 97% rename from patches/unapplied/server/Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch rename to patches/server/Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch index 302fd9eaf2..668189d250 100644 --- a/patches/unapplied/server/Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch +++ b/patches/server/Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/ma index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { +@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { Entity entity = this.getVehicle(); super.stopRiding(suppressCancellation); // Paper - suppress diff --git a/patches/unapplied/server/Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch b/patches/server/Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch similarity index 100% rename from patches/unapplied/server/Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch rename to patches/server/Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch diff --git a/patches/unapplied/server/Don-t-fire-BlockFade-on-worldgen-threads.patch b/patches/server/Don-t-fire-BlockFade-on-worldgen-threads.patch similarity index 100% rename from patches/unapplied/server/Don-t-fire-BlockFade-on-worldgen-threads.patch rename to patches/server/Don-t-fire-BlockFade-on-worldgen-threads.patch diff --git a/patches/unapplied/server/Don-t-load-Chunks-from-Hoppers-and-other-things.patch b/patches/server/Don-t-load-Chunks-from-Hoppers-and-other-things.patch similarity index 100% rename from patches/unapplied/server/Don-t-load-Chunks-from-Hoppers-and-other-things.patch rename to patches/server/Don-t-load-Chunks-from-Hoppers-and-other-things.patch diff --git a/patches/unapplied/server/Don-t-move-existing-players-to-world-spawn.patch b/patches/server/Don-t-move-existing-players-to-world-spawn.patch similarity index 98% rename from patches/unapplied/server/Don-t-move-existing-players-to-world-spawn.patch rename to patches/server/Don-t-move-existing-players-to-world-spawn.patch index e0206c1cdc..fa94a3a2e9 100644 --- a/patches/unapplied/server/Don-t-move-existing-players-to-world-spawn.patch +++ b/patches/server/Don-t-move-existing-players-to-world-spawn.patch @@ -19,7 +19,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public class ServerPlayer extends Player { this.stats = server.getPlayerList().getPlayerStats(this); this.advancements = server.getPlayerList().getPlayerAdvancements(this); - this.maxUpStep = 1.0F; + this.setMaxUpStep(1.0F); - this.fudgeSpawnLocation(world); + //this.fudgeSpawnLocation(world); // Paper - don't move to spawn on login, only first join diff --git a/patches/unapplied/server/Don-t-run-entity-collision-code-if-not-needed.patch b/patches/server/Don-t-run-entity-collision-code-if-not-needed.patch similarity index 98% rename from patches/unapplied/server/Don-t-run-entity-collision-code-if-not-needed.patch rename to patches/server/Don-t-run-entity-collision-code-if-not-needed.patch index 76937117e3..71283a5e3d 100644 --- a/patches/unapplied/server/Don-t-run-entity-collision-code-if-not-needed.patch +++ b/patches/server/Don-t-run-entity-collision-code-if-not-needed.patch @@ -15,7 +15,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/ma index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { +@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { if (this.level.isClientSide()) { this.level.getEntities(EntityTypeTest.forClass(net.minecraft.world.entity.player.Player.class), this.getBoundingBox(), EntitySelector.pushableBy(this)).forEach(this::doPush); } else { diff --git a/patches/unapplied/server/Don-t-tick-dead-players.patch b/patches/server/Don-t-tick-dead-players.patch similarity index 100% rename from patches/unapplied/server/Don-t-tick-dead-players.patch rename to patches/server/Don-t-tick-dead-players.patch diff --git a/patches/unapplied/server/Dont-send-unnecessary-sign-update.patch b/patches/server/Dont-send-unnecessary-sign-update.patch similarity index 100% rename from patches/unapplied/server/Dont-send-unnecessary-sign-update.patch rename to patches/server/Dont-send-unnecessary-sign-update.patch diff --git a/patches/unapplied/server/Duplicate-UUID-Resolve-Option.patch b/patches/server/Duplicate-UUID-Resolve-Option.patch similarity index 100% rename from patches/unapplied/server/Duplicate-UUID-Resolve-Option.patch rename to patches/server/Duplicate-UUID-Resolve-Option.patch diff --git a/patches/unapplied/server/Ensure-Entity-AABB-s-are-never-invalid.patch b/patches/server/Ensure-Entity-AABB-s-are-never-invalid.patch similarity index 100% rename from patches/unapplied/server/Ensure-Entity-AABB-s-are-never-invalid.patch rename to patches/server/Ensure-Entity-AABB-s-are-never-invalid.patch diff --git a/patches/unapplied/server/Ensure-EntityRaider-respects-game-and-entity-rules-f.patch b/patches/server/Ensure-EntityRaider-respects-game-and-entity-rules-f.patch similarity index 100% rename from patches/unapplied/server/Ensure-EntityRaider-respects-game-and-entity-rules-f.patch rename to patches/server/Ensure-EntityRaider-respects-game-and-entity-rules-f.patch diff --git a/patches/unapplied/server/Ensure-safe-gateway-teleport.patch b/patches/server/Ensure-safe-gateway-teleport.patch similarity index 100% rename from patches/unapplied/server/Ensure-safe-gateway-teleport.patch rename to patches/server/Ensure-safe-gateway-teleport.patch diff --git a/patches/unapplied/server/Entity-Activation-Range-2.0.patch b/patches/server/Entity-Activation-Range-2.0.patch similarity index 98% rename from patches/unapplied/server/Entity-Activation-Range-2.0.patch rename to patches/server/Entity-Activation-Range-2.0.patch index d7209eddd3..2b0b6da9ca 100644 --- a/patches/unapplied/server/Entity-Activation-Range-2.0.patch +++ b/patches/server/Entity-Activation-Range-2.0.patch @@ -151,7 +151,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/n index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity { +@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements Targeting { return this.lookControl; } @@ -169,8 +169,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end + public MoveControl getMoveControl() { - if (this.isPassenger() && this.getVehicle() instanceof Mob) { - Mob entityinsentient = (Mob) this.getVehicle(); + Entity entity = this.getControlledVehicle(); + diff --git a/src/main/java/net/minecraft/world/entity/PathfinderMob.java b/src/main/java/net/minecraft/world/entity/PathfinderMob.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/PathfinderMob.java @@ -325,13 +325,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + this.immunize(); // Paper return true; } else { - List list = this.level.getEntitiesOfClass(ItemEntity.class, this.getBoundingBox().inflate(0.25D, 0.0D, 0.25D), EntitySelector.ENTITY_STILL_ALIVE); - if (!list.isEmpty()) { - HopperBlockEntity.addItem(this, list.get(0)); -+ this.immunize(); // Paper + for(ItemEntity itemEntity : this.level.getEntitiesOfClass(ItemEntity.class, this.getBoundingBox().inflate(0.25D, 0.0D, 0.25D), EntitySelector.ENTITY_STILL_ALIVE)) { + if (HopperBlockEntity.addItem(this, itemEntity)) { ++ this.immunize(); // Paper + return true; + } } - - return false; @@ -0,0 +0,0 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper public AbstractContainerMenu createMenu(int syncId, Inventory playerInventory) { return new HopperMenu(syncId, playerInventory, this); diff --git a/patches/unapplied/server/Entity-Jump-API.patch b/patches/server/Entity-Jump-API.patch similarity index 99% rename from patches/unapplied/server/Entity-Jump-API.patch rename to patches/server/Entity-Jump-API.patch index a45c7289b6..13a5fccbe0 100644 --- a/patches/unapplied/server/Entity-Jump-API.patch +++ b/patches/server/Entity-Jump-API.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/ma index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { +@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { } else if (this.isInLava() && (!this.onGround || d7 > d8)) { this.jumpInLiquid(FluidTags.LAVA); } else if ((this.onGround || flag && d7 <= d8) && this.noJumpDelay == 0) { diff --git a/patches/unapplied/server/ExperienceOrbMergeEvent.patch b/patches/server/ExperienceOrbMergeEvent.patch similarity index 100% rename from patches/unapplied/server/ExperienceOrbMergeEvent.patch rename to patches/server/ExperienceOrbMergeEvent.patch diff --git a/patches/unapplied/server/Expose-MinecraftServer-isRunning.patch b/patches/server/Expose-MinecraftServer-isRunning.patch similarity index 100% rename from patches/unapplied/server/Expose-MinecraftServer-isRunning.patch rename to patches/server/Expose-MinecraftServer-isRunning.patch diff --git a/patches/unapplied/server/Expose-game-version.patch b/patches/server/Expose-game-version.patch similarity index 100% rename from patches/unapplied/server/Expose-game-version.patch rename to patches/server/Expose-game-version.patch diff --git a/patches/unapplied/server/Expose-the-internal-current-tick.patch b/patches/server/Expose-the-internal-current-tick.patch similarity index 100% rename from patches/unapplied/server/Expose-the-internal-current-tick.patch rename to patches/server/Expose-the-internal-current-tick.patch diff --git a/patches/unapplied/server/Fix-CB-call-to-changed-postToMainThread-method.patch b/patches/server/Fix-CB-call-to-changed-postToMainThread-method.patch similarity index 100% rename from patches/unapplied/server/Fix-CB-call-to-changed-postToMainThread-method.patch rename to patches/server/Fix-CB-call-to-changed-postToMainThread-method.patch diff --git a/patches/unapplied/server/Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch b/patches/server/Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch similarity index 100% rename from patches/unapplied/server/Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch rename to patches/server/Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch diff --git a/patches/unapplied/server/Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch b/patches/server/Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch similarity index 100% rename from patches/unapplied/server/Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch rename to patches/server/Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch diff --git a/patches/unapplied/server/Fix-MC-158900.patch b/patches/server/Fix-MC-158900.patch similarity index 96% rename from patches/unapplied/server/Fix-MC-158900.patch rename to patches/server/Fix-MC-158900.patch index 9477150e33..d4893ae672 100644 --- a/patches/unapplied/server/Fix-MC-158900.patch +++ b/patches/server/Fix-MC-158900.patch @@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -0,0 +0,0 @@ public abstract class PlayerList { Player player = entity.getBukkitEntity(); - PlayerLoginEvent event = new PlayerLoginEvent(player, loginlistener.connection.hostname, ((java.net.InetSocketAddress) socketaddress).getAddress(), ((java.net.InetSocketAddress) loginlistener.connection.getRawAddress()).getAddress()); + PlayerLoginEvent event = new PlayerLoginEvent(player, loginlistener.connection.hostname, ((java.net.InetSocketAddress) socketaddress).getAddress(), ((java.net.InetSocketAddress) loginlistener.connection.channel.remoteAddress()).getAddress()); - if (this.getBans().isBanned(gameprofile) && !this.getBans().get(gameprofile).hasExpired()) { - UserBanListEntry gameprofilebanentry = (UserBanListEntry) this.bans.get(gameprofile); diff --git a/patches/unapplied/server/Fix-Per-World-Difficulty-Remembering-Difficulty.patch b/patches/server/Fix-Per-World-Difficulty-Remembering-Difficulty.patch similarity index 100% rename from patches/unapplied/server/Fix-Per-World-Difficulty-Remembering-Difficulty.patch rename to patches/server/Fix-Per-World-Difficulty-Remembering-Difficulty.patch diff --git a/patches/unapplied/server/Fix-PotionEffect-ignores-icon-flag.patch b/patches/server/Fix-PotionEffect-ignores-icon-flag.patch similarity index 100% rename from patches/unapplied/server/Fix-PotionEffect-ignores-icon-flag.patch rename to patches/server/Fix-PotionEffect-ignores-icon-flag.patch diff --git a/patches/unapplied/server/Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch b/patches/server/Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch similarity index 100% rename from patches/unapplied/server/Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch rename to patches/server/Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch diff --git a/patches/unapplied/server/Fix-SPIGOT-5885-Unable-to-disable-advancements.patch b/patches/server/Fix-SPIGOT-5885-Unable-to-disable-advancements.patch similarity index 100% rename from patches/unapplied/server/Fix-SPIGOT-5885-Unable-to-disable-advancements.patch rename to patches/server/Fix-SPIGOT-5885-Unable-to-disable-advancements.patch diff --git a/patches/unapplied/server/Fix-SPIGOT-5989.patch b/patches/server/Fix-SPIGOT-5989.patch similarity index 100% rename from patches/unapplied/server/Fix-SPIGOT-5989.patch rename to patches/server/Fix-SPIGOT-5989.patch diff --git a/patches/unapplied/server/Fix-World-isChunkGenerated-calls.patch b/patches/server/Fix-World-isChunkGenerated-calls.patch similarity index 100% rename from patches/unapplied/server/Fix-World-isChunkGenerated-calls.patch rename to patches/server/Fix-World-isChunkGenerated-calls.patch diff --git a/patches/unapplied/server/Fix-arrows-never-despawning-MC-125757.patch b/patches/server/Fix-arrows-never-despawning-MC-125757.patch similarity index 100% rename from patches/unapplied/server/Fix-arrows-never-despawning-MC-125757.patch rename to patches/server/Fix-arrows-never-despawning-MC-125757.patch diff --git a/patches/unapplied/server/Fix-items-not-falling-correctly.patch b/patches/server/Fix-items-not-falling-correctly.patch similarity index 96% rename from patches/unapplied/server/Fix-items-not-falling-correctly.patch rename to patches/server/Fix-items-not-falling-correctly.patch index 24a6f273d6..aef8ea533d 100644 --- a/patches/unapplied/server/Fix-items-not-falling-correctly.patch +++ b/patches/server/Fix-items-not-falling-correctly.patch @@ -18,7 +18,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java -@@ -0,0 +0,0 @@ public class ItemEntity extends Entity { +@@ -0,0 +0,0 @@ public class ItemEntity extends Entity implements TraceableEntity { } } diff --git a/patches/unapplied/server/Fix-items-vanishing-through-end-portal.patch b/patches/server/Fix-items-vanishing-through-end-portal.patch similarity index 100% rename from patches/unapplied/server/Fix-items-vanishing-through-end-portal.patch rename to patches/server/Fix-items-vanishing-through-end-portal.patch diff --git a/patches/unapplied/server/Fix-last-firework-in-stack-not-having-effects-when-d.patch b/patches/server/Fix-last-firework-in-stack-not-having-effects-when-d.patch similarity index 100% rename from patches/unapplied/server/Fix-last-firework-in-stack-not-having-effects-when-d.patch rename to patches/server/Fix-last-firework-in-stack-not-having-effects-when-d.patch diff --git a/patches/unapplied/server/Fix-missing-chunks-due-to-integer-overflow.patch b/patches/server/Fix-missing-chunks-due-to-integer-overflow.patch similarity index 100% rename from patches/unapplied/server/Fix-missing-chunks-due-to-integer-overflow.patch rename to patches/server/Fix-missing-chunks-due-to-integer-overflow.patch diff --git a/patches/unapplied/server/Fix-numerous-item-duplication-issues-and-teleport-is.patch b/patches/server/Fix-numerous-item-duplication-issues-and-teleport-is.patch similarity index 98% rename from patches/unapplied/server/Fix-numerous-item-duplication-issues-and-teleport-is.patch rename to patches/server/Fix-numerous-item-duplication-issues-and-teleport-is.patch index 035de2983c..d91260c361 100644 --- a/patches/unapplied/server/Fix-numerous-item-duplication-issues-and-teleport-is.patch +++ b/patches/server/Fix-numerous-item-duplication-issues-and-teleport-is.patch @@ -74,8 +74,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } public boolean canChangeDimensions() { -- return true; -+ return isAlive() && valid; // Paper +- return !this.isPassenger() && !this.isVehicle(); ++ return !this.isPassenger() && !this.isVehicle() && isAlive() && valid; // Paper } public float getBlockExplosionResistance(Explosion explosion, BlockGetter world, BlockPos pos, BlockState blockState, FluidState fluidState, float max) { @@ -83,7 +83,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/ma index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { +@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { // Paper start org.bukkit.event.entity.EntityDeathEvent deathEvent = this.dropAllDeathLoot(damageSource); if (deathEvent == null || !deathEvent.isCancelled()) { @@ -96,7 +96,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // Paper start - clear equipment if event is not cancelled if (this instanceof Mob) { for (EquipmentSlot slot : this.clearedEquipmentSlots) { -@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { +@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { this.dropCustomDeathLoot(source, i, flag); this.clearEquipmentSlots = prev; // Paper } diff --git a/patches/unapplied/server/Fix-piston-physics-inconsistency-MC-188840.patch b/patches/server/Fix-piston-physics-inconsistency-MC-188840.patch similarity index 100% rename from patches/unapplied/server/Fix-piston-physics-inconsistency-MC-188840.patch rename to patches/server/Fix-piston-physics-inconsistency-MC-188840.patch diff --git a/patches/unapplied/server/Fix-sand-duping.patch b/patches/server/Fix-sand-duping.patch similarity index 100% rename from patches/unapplied/server/Fix-sand-duping.patch rename to patches/server/Fix-sand-duping.patch diff --git a/patches/unapplied/server/Fix-sounds-when-item-frames-are-modified-MC-123450.patch b/patches/server/Fix-sounds-when-item-frames-are-modified-MC-123450.patch similarity index 100% rename from patches/unapplied/server/Fix-sounds-when-item-frames-are-modified-MC-123450.patch rename to patches/server/Fix-sounds-when-item-frames-are-modified-MC-123450.patch diff --git a/patches/unapplied/server/Fix-villager-trading-demand-MC-163962.patch b/patches/server/Fix-villager-trading-demand-MC-163962.patch similarity index 100% rename from patches/unapplied/server/Fix-villager-trading-demand-MC-163962.patch rename to patches/server/Fix-villager-trading-demand-MC-163962.patch diff --git a/patches/unapplied/server/Flat-bedrock-generator-settings.patch b/patches/server/Flat-bedrock-generator-settings.patch similarity index 100% rename from patches/unapplied/server/Flat-bedrock-generator-settings.patch rename to patches/server/Flat-bedrock-generator-settings.patch diff --git a/patches/unapplied/server/Guard-against-serializing-mismatching-chunk-coordina.patch b/patches/server/Guard-against-serializing-mismatching-chunk-coordina.patch similarity index 100% rename from patches/unapplied/server/Guard-against-serializing-mismatching-chunk-coordina.patch rename to patches/server/Guard-against-serializing-mismatching-chunk-coordina.patch diff --git a/patches/unapplied/server/Hide-sync-chunk-writes-behind-flag.patch b/patches/server/Hide-sync-chunk-writes-behind-flag.patch similarity index 95% rename from patches/unapplied/server/Hide-sync-chunk-writes-behind-flag.patch rename to patches/server/Hide-sync-chunk-writes-behind-flag.patch index 29f37fe4b3..e20d2ab23d 100644 --- a/patches/unapplied/server/Hide-sync-chunk-writes-behind-flag.patch +++ b/patches/server/Hide-sync-chunk-writes-behind-flag.patch @@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java @@ -0,0 +0,0 @@ public class DedicatedServerProperties extends Settings { - return Mth.clamp(integer, (int) 1, 29999984); + return Mth.clamp(integer, 1, 29999984); }, 29999984); - this.syncChunkWrites = this.get("sync-chunk-writes", true); + this.syncChunkWrites = this.get("sync-chunk-writes", true) && Boolean.getBoolean("Paper.enable-sync-chunk-writes"); // Paper - hide behind flag diff --git a/patches/unapplied/server/Implement-CraftBlockSoundGroup.patch b/patches/server/Implement-CraftBlockSoundGroup.patch similarity index 100% rename from patches/unapplied/server/Implement-CraftBlockSoundGroup.patch rename to patches/server/Implement-CraftBlockSoundGroup.patch diff --git a/patches/unapplied/server/Implement-Mob-Goal-API.patch b/patches/server/Implement-Mob-Goal-API.patch similarity index 100% rename from patches/unapplied/server/Implement-Mob-Goal-API.patch rename to patches/server/Implement-Mob-Goal-API.patch diff --git a/patches/unapplied/server/Implement-Player-Client-Options-API.patch b/patches/server/Implement-Player-Client-Options-API.patch similarity index 99% rename from patches/unapplied/server/Implement-Player-Client-Options-API.patch rename to patches/server/Implement-Player-Client-Options-API.patch index 1906704d4d..58a3afebf8 100644 --- a/patches/unapplied/server/Implement-Player-Client-Options-API.patch +++ b/patches/server/Implement-Player-Client-Options-API.patch @@ -91,7 +91,7 @@ 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 { - return s; + } } + // Paper start - Client option API diff --git a/patches/unapplied/server/Implement-alternative-item-despawn-rate.patch b/patches/server/Implement-alternative-item-despawn-rate.patch similarity index 86% rename from patches/unapplied/server/Implement-alternative-item-despawn-rate.patch rename to patches/server/Implement-alternative-item-despawn-rate.patch index b674dc1e77..26e9218ccd 100644 --- a/patches/unapplied/server/Implement-alternative-item-despawn-rate.patch +++ b/patches/server/Implement-alternative-item-despawn-rate.patch @@ -9,7 +9,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java -@@ -0,0 +0,0 @@ public class ItemEntity extends Entity { +@@ -0,0 +0,0 @@ public class ItemEntity extends Entity implements TraceableEntity { public final float bobOffs; private int lastTick = MinecraftServer.currentTick - 1; // CraftBukkit public boolean canMobPickup = true; // Paper @@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public ItemEntity(EntityType type, Level world) { super(type, world); -@@ -0,0 +0,0 @@ public class ItemEntity extends Entity { +@@ -0,0 +0,0 @@ public class ItemEntity extends Entity implements TraceableEntity { } } @@ -26,7 +26,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // CraftBukkit start - fire ItemDespawnEvent if (org.bukkit.craftbukkit.event.CraftEventFactory.callItemDespawnEvent(this).isCancelled()) { this.age = 0; -@@ -0,0 +0,0 @@ public class ItemEntity extends Entity { +@@ -0,0 +0,0 @@ public class ItemEntity extends Entity implements TraceableEntity { this.lastTick = MinecraftServer.currentTick; // CraftBukkit end @@ -35,7 +35,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // CraftBukkit start - fire ItemDespawnEvent if (org.bukkit.craftbukkit.event.CraftEventFactory.callItemDespawnEvent(this).isCancelled()) { this.age = 0; -@@ -0,0 +0,0 @@ public class ItemEntity extends Entity { +@@ -0,0 +0,0 @@ public class ItemEntity extends Entity implements TraceableEntity { private boolean isMergable() { ItemStack itemstack = this.getItem(); @@ -44,7 +44,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } private void tryToMerge(ItemEntity other) { -@@ -0,0 +0,0 @@ public class ItemEntity extends Entity { +@@ -0,0 +0,0 @@ public class ItemEntity extends Entity implements TraceableEntity { com.google.common.base.Preconditions.checkArgument(!stack.isEmpty(), "Cannot drop air"); // CraftBukkit this.getEntityData().set(ItemEntity.DATA_ITEM, stack); this.getEntityData().markDirty(ItemEntity.DATA_ITEM); // CraftBukkit - SPIGOT-4591, must mark dirty @@ -52,7 +52,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } @Override -@@ -0,0 +0,0 @@ public class ItemEntity extends Entity { +@@ -0,0 +0,0 @@ public class ItemEntity extends Entity implements TraceableEntity { public void makeFakeItem() { this.setNeverPickUp(); diff --git a/patches/unapplied/server/Improve-Arrow-API.patch b/patches/server/Improve-Arrow-API.patch similarity index 100% rename from patches/unapplied/server/Improve-Arrow-API.patch rename to patches/server/Improve-Arrow-API.patch diff --git a/patches/unapplied/server/Improve-Block-breakNaturally-API.patch b/patches/server/Improve-Block-breakNaturally-API.patch similarity index 97% rename from patches/unapplied/server/Improve-Block-breakNaturally-API.patch rename to patches/server/Improve-Block-breakNaturally-API.patch index 7bcbefb049..78421f2cd3 100644 --- a/patches/unapplied/server/Improve-Block-breakNaturally-API.patch +++ b/patches/server/Improve-Block-breakNaturally-API.patch @@ -23,14 +23,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/world/level/block/IceBlock.java @@ -0,0 +0,0 @@ public class IceBlock extends HalfTransparentBlock { @Override - public void playerDestroy(Level world, Player player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity, ItemStack stack) { - super.playerDestroy(world, player, pos, state, blockEntity, stack); + public void playerDestroy(Level world, Player player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity, ItemStack tool) { + super.playerDestroy(world, player, pos, state, blockEntity, tool); + // Paper start -+ this.afterDestroy(world, pos, stack); ++ this.afterDestroy(world, pos, tool); + } -+ public void afterDestroy(Level world, BlockPos pos, ItemStack stack) { ++ public void afterDestroy(Level world, BlockPos pos, ItemStack tool) { + // Paper end - if (EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, stack) == 0) { + if (EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) == 0) { if (world.dimensionType().ultraWarm()) { world.removeBlock(pos, false); diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java diff --git a/patches/unapplied/server/Improve-Legacy-Component-serialization-size.patch b/patches/server/Improve-Legacy-Component-serialization-size.patch similarity index 100% rename from patches/unapplied/server/Improve-Legacy-Component-serialization-size.patch rename to patches/server/Improve-Legacy-Component-serialization-size.patch diff --git a/patches/unapplied/server/Improve-fix-EntityTargetLivingEntityEvent.patch b/patches/server/Improve-fix-EntityTargetLivingEntityEvent.patch similarity index 100% rename from patches/unapplied/server/Improve-fix-EntityTargetLivingEntityEvent.patch rename to patches/server/Improve-fix-EntityTargetLivingEntityEvent.patch diff --git a/patches/unapplied/server/Improved-Watchdog-Support.patch b/patches/server/Improved-Watchdog-Support.patch similarity index 97% rename from patches/unapplied/server/Improved-Watchdog-Support.patch rename to patches/server/Improved-Watchdog-Support.patch index 0c7af85372..f8e0d113f0 100644 --- a/patches/unapplied/server/Improved-Watchdog-Support.patch +++ b/patches/server/Improved-Watchdog-Support.patch @@ -149,7 +149,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 throw new IllegalStateException("Failed to initialize server"); } @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0 ? InteractionHand.OFF_HAND : InteractionHand.MAIN_HAND; } @@ -22,7 +22,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private void updatingUsingItem() { if (this.isUsingItem()) { if (ItemStack.isSame(this.getItemInHand(this.getUsedItemHand()), this.useItem)) { -@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { +@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { if (this.shouldTriggerItemUseEffects()) { this.triggerItemUseEffects(stack, 5); } @@ -37,7 +37,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.completeUsingItem(); } -@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { +@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { if (!itemstack.isEmpty() && !this.isUsingItem() || forceUpdate) { // Paper use override flag this.useItem = itemstack; @@ -49,7 +49,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (!this.level.isClientSide) { this.setLivingEntityFlag(1, true); this.setLivingEntityFlag(2, hand == InteractionHand.OFF_HAND); -@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { +@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { } } else if (!this.isUsingItem() && !this.useItem.isEmpty()) { this.useItem = ItemStack.EMPTY; @@ -61,7 +61,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } } -@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { +@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { } this.useItem = ItemStack.EMPTY; diff --git a/patches/unapplied/server/MC-145656-Fix-Follow-Range-Initial-Target.patch b/patches/server/MC-145656-Fix-Follow-Range-Initial-Target.patch similarity index 100% rename from patches/unapplied/server/MC-145656-Fix-Follow-Range-Initial-Target.patch rename to patches/server/MC-145656-Fix-Follow-Range-Initial-Target.patch diff --git a/patches/unapplied/server/Make-the-GUI-graph-fancier.patch b/patches/server/Make-the-GUI-graph-fancier.patch similarity index 100% rename from patches/unapplied/server/Make-the-GUI-graph-fancier.patch rename to patches/server/Make-the-GUI-graph-fancier.patch diff --git a/patches/unapplied/server/Maps-shouldn-t-load-chunks.patch b/patches/server/Maps-shouldn-t-load-chunks.patch similarity index 100% rename from patches/unapplied/server/Maps-shouldn-t-load-chunks.patch rename to patches/server/Maps-shouldn-t-load-chunks.patch diff --git a/patches/unapplied/server/Mob-Spawner-API-Enhancements.patch b/patches/server/Mob-Spawner-API-Enhancements.patch similarity index 100% rename from patches/unapplied/server/Mob-Spawner-API-Enhancements.patch rename to patches/server/Mob-Spawner-API-Enhancements.patch diff --git a/patches/unapplied/server/Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch b/patches/server/Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch similarity index 100% rename from patches/unapplied/server/Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch rename to patches/server/Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch diff --git a/patches/unapplied/server/Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch b/patches/server/Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch similarity index 100% rename from patches/unapplied/server/Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch rename to patches/server/Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch diff --git a/patches/unapplied/server/Optimise-Chunk-getFluid.patch b/patches/server/Optimise-Chunk-getFluid.patch similarity index 100% rename from patches/unapplied/server/Optimise-Chunk-getFluid.patch rename to patches/server/Optimise-Chunk-getFluid.patch diff --git a/patches/unapplied/server/Optimise-EntityGetter-getPlayerByUUID.patch b/patches/server/Optimise-EntityGetter-getPlayerByUUID.patch similarity index 92% rename from patches/unapplied/server/Optimise-EntityGetter-getPlayerByUUID.patch rename to patches/server/Optimise-EntityGetter-getPlayerByUUID.patch index 398ebd05d7..7b8c4c90d1 100644 --- a/patches/unapplied/server/Optimise-EntityGetter-getPlayerByUUID.patch +++ b/patches/server/Optimise-EntityGetter-getPlayerByUUID.patch @@ -24,4 +24,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Add env and gen to constructor, IWorldDataServer -> WorldDataServer public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) { - // Holder holder = worlddimension.type(); // CraftBukkit - decompile error + // IRegistryCustom.Dimension iregistrycustom_dimension = minecraftserver.registryAccess(); // CraftBukkit - decompile error diff --git a/patches/unapplied/server/Optimise-getChunkAt-calls-for-loaded-chunks.patch b/patches/server/Optimise-getChunkAt-calls-for-loaded-chunks.patch similarity index 100% rename from patches/unapplied/server/Optimise-getChunkAt-calls-for-loaded-chunks.patch rename to patches/server/Optimise-getChunkAt-calls-for-loaded-chunks.patch diff --git a/patches/unapplied/server/Optimize-Bit-Operations-by-inlining.patch b/patches/server/Optimize-Bit-Operations-by-inlining.patch similarity index 99% rename from patches/unapplied/server/Optimize-Bit-Operations-by-inlining.patch rename to patches/server/Optimize-Bit-Operations-by-inlining.patch index 2b6ccba107..d94f068866 100644 --- a/patches/unapplied/server/Optimize-Bit-Operations-by-inlining.patch +++ b/patches/server/Optimize-Bit-Operations-by-inlining.patch @@ -70,7 +70,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return new BlockPos((int) (packedPos >> 38), (int) ((packedPos << 52) >> 52), (int) ((packedPos << 26) >> 38)); // Paper - simplify/inline } - public long asLong() { + public static BlockPos containing(double x, double y, double z) { @@ -0,0 +0,0 @@ public class BlockPos extends Vec3i { } diff --git a/patches/unapplied/server/Optimize-Captured-TileEntity-Lookup.patch b/patches/server/Optimize-Captured-TileEntity-Lookup.patch similarity index 100% rename from patches/unapplied/server/Optimize-Captured-TileEntity-Lookup.patch rename to patches/server/Optimize-Captured-TileEntity-Lookup.patch diff --git a/patches/unapplied/server/Optimize-Collision-to-not-load-chunks.patch b/patches/server/Optimize-Collision-to-not-load-chunks.patch similarity index 100% rename from patches/unapplied/server/Optimize-Collision-to-not-load-chunks.patch rename to patches/server/Optimize-Collision-to-not-load-chunks.patch diff --git a/patches/unapplied/server/Optimize-GoalSelector-Goal.Flag-Set-operations.patch b/patches/server/Optimize-GoalSelector-Goal.Flag-Set-operations.patch similarity index 100% rename from patches/unapplied/server/Optimize-GoalSelector-Goal.Flag-Set-operations.patch rename to patches/server/Optimize-GoalSelector-Goal.Flag-Set-operations.patch diff --git a/patches/unapplied/server/Optimize-NetworkManager-Exception-Handling.patch b/patches/server/Optimize-NetworkManager-Exception-Handling.patch similarity index 98% rename from patches/unapplied/server/Optimize-NetworkManager-Exception-Handling.patch rename to patches/server/Optimize-NetworkManager-Exception-Handling.patch index 6e2d457c78..17c8a8fe76 100644 --- a/patches/unapplied/server/Optimize-NetworkManager-Exception-Handling.patch +++ b/patches/server/Optimize-NetworkManager-Exception-Handling.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/network/ConnectionProtocol.java b/src/m index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/network/ConnectionProtocol.java +++ b/src/main/java/net/minecraft/network/ConnectionProtocol.java -@@ -0,0 +0,0 @@ public enum ConnectionProtocol { +@@ -0,0 +0,0 @@ public enum ConnectionProtocol implements BundlerInfo.Provider { @Nullable public Packet createPacket(int id, FriendlyByteBuf buf) { diff --git a/patches/unapplied/server/Optimize-Pathfinding.patch b/patches/server/Optimize-Pathfinding.patch similarity index 100% rename from patches/unapplied/server/Optimize-Pathfinding.patch rename to patches/server/Optimize-Pathfinding.patch diff --git a/patches/unapplied/server/Optimize-Voxel-Shape-Merging.patch b/patches/server/Optimize-Voxel-Shape-Merging.patch similarity index 100% rename from patches/unapplied/server/Optimize-Voxel-Shape-Merging.patch rename to patches/server/Optimize-Voxel-Shape-Merging.patch diff --git a/patches/unapplied/server/Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch b/patches/server/Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch similarity index 100% rename from patches/unapplied/server/Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch rename to patches/server/Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch diff --git a/patches/unapplied/server/Optimize-brigadier-child-sorting-performance.patch b/patches/server/Optimize-brigadier-child-sorting-performance.patch similarity index 100% rename from patches/unapplied/server/Optimize-brigadier-child-sorting-performance.patch rename to patches/server/Optimize-brigadier-child-sorting-performance.patch diff --git a/patches/unapplied/server/Optimize-call-to-getFluid-for-explosions.patch b/patches/server/Optimize-call-to-getFluid-for-explosions.patch similarity index 92% rename from patches/unapplied/server/Optimize-call-to-getFluid-for-explosions.patch rename to patches/server/Optimize-call-to-getFluid-for-explosions.patch index a76c97decb..d5d64cc740 100644 --- a/patches/unapplied/server/Optimize-call-to-getFluid-for-explosions.patch +++ b/patches/server/Optimize-call-to-getFluid-for-explosions.patch @@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/world/level/Explosion.java @@ -0,0 +0,0 @@ public class Explosion { for (float f1 = 0.3F; f > 0.0F; f -= 0.22500001F) { - BlockPos blockposition = new BlockPos(d4, d5, d6); + BlockPos blockposition = BlockPos.containing(d4, d5, d6); BlockState iblockdata = this.level.getBlockState(blockposition); - FluidState fluid = this.level.getFluidState(blockposition); + FluidState fluid = iblockdata.getFluidState(); // Paper diff --git a/patches/unapplied/server/Option-for-maximum-exp-value-when-merging-orbs.patch b/patches/server/Option-for-maximum-exp-value-when-merging-orbs.patch similarity index 100% rename from patches/unapplied/server/Option-for-maximum-exp-value-when-merging-orbs.patch rename to patches/server/Option-for-maximum-exp-value-when-merging-orbs.patch diff --git a/patches/unapplied/server/Paper-dumpitem-command.patch b/patches/server/Paper-dumpitem-command.patch similarity index 100% rename from patches/unapplied/server/Paper-dumpitem-command.patch rename to patches/server/Paper-dumpitem-command.patch diff --git a/patches/unapplied/server/Pillager-patrol-spawn-settings-and-per-player-option.patch b/patches/server/Pillager-patrol-spawn-settings-and-per-player-option.patch similarity index 100% rename from patches/unapplied/server/Pillager-patrol-spawn-settings-and-per-player-option.patch rename to patches/server/Pillager-patrol-spawn-settings-and-per-player-option.patch diff --git a/patches/unapplied/server/PlayerDeathEvent-getItemsToKeep.patch b/patches/server/PlayerDeathEvent-getItemsToKeep.patch similarity index 100% rename from patches/unapplied/server/PlayerDeathEvent-getItemsToKeep.patch rename to patches/server/PlayerDeathEvent-getItemsToKeep.patch diff --git a/patches/unapplied/server/PlayerDeathEvent-shouldDropExperience.patch b/patches/server/PlayerDeathEvent-shouldDropExperience.patch similarity index 100% rename from patches/unapplied/server/PlayerDeathEvent-shouldDropExperience.patch rename to patches/server/PlayerDeathEvent-shouldDropExperience.patch diff --git a/patches/unapplied/server/Potential-bed-API.patch b/patches/server/Potential-bed-API.patch similarity index 100% rename from patches/unapplied/server/Potential-bed-API.patch rename to patches/server/Potential-bed-API.patch diff --git a/patches/unapplied/server/Prevent-Double-PlayerChunkMap-adds-crashing-server.patch b/patches/server/Prevent-Double-PlayerChunkMap-adds-crashing-server.patch similarity index 100% rename from patches/unapplied/server/Prevent-Double-PlayerChunkMap-adds-crashing-server.patch rename to patches/server/Prevent-Double-PlayerChunkMap-adds-crashing-server.patch diff --git a/patches/unapplied/server/Prevent-bees-loading-chunks-checking-hive-position.patch b/patches/server/Prevent-bees-loading-chunks-checking-hive-position.patch similarity index 100% rename from patches/unapplied/server/Prevent-bees-loading-chunks-checking-hive-position.patch rename to patches/server/Prevent-bees-loading-chunks-checking-hive-position.patch diff --git a/patches/unapplied/server/Prevent-consuming-the-wrong-itemstack.patch b/patches/server/Prevent-consuming-the-wrong-itemstack.patch similarity index 96% rename from patches/unapplied/server/Prevent-consuming-the-wrong-itemstack.patch rename to patches/server/Prevent-consuming-the-wrong-itemstack.patch index bdef90371d..21c2bde1a6 100644 --- a/patches/unapplied/server/Prevent-consuming-the-wrong-itemstack.patch +++ b/patches/server/Prevent-consuming-the-wrong-itemstack.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/ma index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { +@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { } public void startUsingItem(InteractionHand hand) { @@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.useItem = itemstack; this.useItemRemaining = itemstack.getUseDuration(); if (!this.level.isClientSide) { -@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { +@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { this.releaseUsingItem(); } else { if (!this.useItem.isEmpty() && this.isUsingItem()) { @@ -32,7 +32,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.triggerItemUseEffects(this.useItem, 16); // CraftBukkit start - fire PlayerItemConsumeEvent ItemStack itemstack; -@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { +@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { } this.stopUsingItem(); diff --git a/patches/unapplied/server/Prevent-opening-inventories-when-frozen.patch b/patches/server/Prevent-opening-inventories-when-frozen.patch similarity index 100% rename from patches/unapplied/server/Prevent-opening-inventories-when-frozen.patch rename to patches/server/Prevent-opening-inventories-when-frozen.patch diff --git a/patches/unapplied/server/Prevent-position-desync-in-playerconnection-causing-.patch b/patches/server/Prevent-position-desync-in-playerconnection-causing-.patch similarity index 100% rename from patches/unapplied/server/Prevent-position-desync-in-playerconnection-causing-.patch rename to patches/server/Prevent-position-desync-in-playerconnection-causing-.patch diff --git a/patches/unapplied/server/Prevent-sync-chunk-loads-when-villagers-try-to-find-.patch b/patches/server/Prevent-sync-chunk-loads-when-villagers-try-to-find-.patch similarity index 100% rename from patches/unapplied/server/Prevent-sync-chunk-loads-when-villagers-try-to-find-.patch rename to patches/server/Prevent-sync-chunk-loads-when-villagers-try-to-find-.patch diff --git a/patches/unapplied/server/Prevent-teleporting-dead-entities.patch b/patches/server/Prevent-teleporting-dead-entities.patch similarity index 92% rename from patches/unapplied/server/Prevent-teleporting-dead-entities.patch rename to patches/server/Prevent-teleporting-dead-entities.patch index eef84715a7..df3ef65764 100644 --- a/patches/unapplied/server/Prevent-teleporting-dead-entities.patch +++ b/patches/server/Prevent-teleporting-dead-entities.patch @@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } - public void internalTeleport(double d0, double d1, double d2, float f, float f1, Set set, boolean flag) { + public void internalTeleport(double d0, double d1, double d2, float f, float f1, Set set) { // Paper + // Paper start + if (player.isRemoved()) { + LOGGER.info("Attempt to teleport removed player {} restricted", player.getScoreboardName()); diff --git a/patches/unapplied/server/Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch b/patches/server/Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch similarity index 99% rename from patches/unapplied/server/Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch rename to patches/server/Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch index bf56b059f7..8da3855735 100644 --- a/patches/unapplied/server/Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch +++ b/patches/server/Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch @@ -18,7 +18,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/world/level/Explosion.java @@ -0,0 +0,0 @@ public class Explosion { for (float f1 = 0.3F; f > 0.0F; f -= 0.22500001F) { - BlockPos blockposition = new BlockPos(d4, d5, d6); + BlockPos blockposition = BlockPos.containing(d4, d5, d6); BlockState iblockdata = this.level.getBlockState(blockposition); + if (!iblockdata.isDestroyable()) continue; // Paper FluidState fluid = iblockdata.getFluidState(); // Paper diff --git a/patches/unapplied/server/Reduce-Either-Optional-allocation.patch b/patches/server/Reduce-Either-Optional-allocation.patch similarity index 100% rename from patches/unapplied/server/Reduce-Either-Optional-allocation.patch rename to patches/server/Reduce-Either-Optional-allocation.patch diff --git a/patches/unapplied/server/Reduce-MutableInt-allocations-from-light-engine.patch b/patches/server/Reduce-MutableInt-allocations-from-light-engine.patch similarity index 100% rename from patches/unapplied/server/Reduce-MutableInt-allocations-from-light-engine.patch rename to patches/server/Reduce-MutableInt-allocations-from-light-engine.patch diff --git a/patches/unapplied/server/Reduce-allocation-of-Vec3D-by-entity-tracker.patch b/patches/server/Reduce-allocation-of-Vec3D-by-entity-tracker.patch similarity index 100% rename from patches/unapplied/server/Reduce-allocation-of-Vec3D-by-entity-tracker.patch rename to patches/server/Reduce-allocation-of-Vec3D-by-entity-tracker.patch diff --git a/patches/unapplied/server/Reduce-memory-footprint-of-NBTTagCompound.patch b/patches/server/Reduce-memory-footprint-of-NBTTagCompound.patch similarity index 100% rename from patches/unapplied/server/Reduce-memory-footprint-of-NBTTagCompound.patch rename to patches/server/Reduce-memory-footprint-of-NBTTagCompound.patch diff --git a/patches/unapplied/server/Remote-Connections-shouldn-t-hold-up-shutdown.patch b/patches/server/Remote-Connections-shouldn-t-hold-up-shutdown.patch similarity index 100% rename from patches/unapplied/server/Remote-Connections-shouldn-t-hold-up-shutdown.patch rename to patches/server/Remote-Connections-shouldn-t-hold-up-shutdown.patch diff --git a/patches/unapplied/server/Remove-garbage-Java-version-check.patch b/patches/server/Remove-garbage-Java-version-check.patch similarity index 100% rename from patches/unapplied/server/Remove-garbage-Java-version-check.patch rename to patches/server/Remove-garbage-Java-version-check.patch diff --git a/patches/unapplied/server/Remove-some-streams-from-structures.patch b/patches/server/Remove-some-streams-from-structures.patch similarity index 100% rename from patches/unapplied/server/Remove-some-streams-from-structures.patch rename to patches/server/Remove-some-streams-from-structures.patch diff --git a/patches/unapplied/server/Remove-streams-from-classes-related-villager-gossip.patch b/patches/server/Remove-streams-from-classes-related-villager-gossip.patch similarity index 100% rename from patches/unapplied/server/Remove-streams-from-classes-related-villager-gossip.patch rename to patches/server/Remove-streams-from-classes-related-villager-gossip.patch diff --git a/patches/unapplied/server/Server-Tick-Events.patch b/patches/server/Server-Tick-Events.patch similarity index 95% rename from patches/unapplied/server/Server-Tick-Events.patch rename to patches/server/Server-Tick-Events.patch index 42d8da8af5..7d6efaba5f 100644 --- a/patches/unapplied/server/Server-Tick-Events.patch +++ b/patches/server/Server-Tick-Events.patch @@ -27,5 +27,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + new com.destroystokyo.paper.event.server.ServerTickEndEvent(this.tickCount, ((double)(endTime - lastTick) / 1000000D), remaining).callEvent(); + // Paper end this.profiler.push("tallying"); - long l = this.tickTimes[this.tickCount % 100] = Util.getNanos() - i; + long j = this.tickTimes[this.tickCount % 100] = Util.getNanos() - i; diff --git a/patches/unapplied/server/Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch b/patches/server/Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch similarity index 100% rename from patches/unapplied/server/Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch rename to patches/server/Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch diff --git a/patches/unapplied/server/Set-spigots-verbose-world-setting-to-false-by-def.patch b/patches/server/Set-spigots-verbose-world-setting-to-false-by-def.patch similarity index 100% rename from patches/unapplied/server/Set-spigots-verbose-world-setting-to-false-by-def.patch rename to patches/server/Set-spigots-verbose-world-setting-to-false-by-def.patch diff --git a/patches/unapplied/server/Show-blockstate-location-if-we-failed-to-read-it.patch b/patches/server/Show-blockstate-location-if-we-failed-to-read-it.patch similarity index 100% rename from patches/unapplied/server/Show-blockstate-location-if-we-failed-to-read-it.patch rename to patches/server/Show-blockstate-location-if-we-failed-to-read-it.patch diff --git a/patches/unapplied/server/Spawn-player-in-correct-world-on-login.patch b/patches/server/Spawn-player-in-correct-world-on-login.patch similarity index 100% rename from patches/unapplied/server/Spawn-player-in-correct-world-on-login.patch rename to patches/server/Spawn-player-in-correct-world-on-login.patch diff --git a/patches/unapplied/server/Stop-copy-on-write-operations-for-updating-light-dat.patch b/patches/server/Stop-copy-on-write-operations-for-updating-light-dat.patch similarity index 100% rename from patches/unapplied/server/Stop-copy-on-write-operations-for-updating-light-dat.patch rename to patches/server/Stop-copy-on-write-operations-for-updating-light-dat.patch diff --git a/patches/unapplied/server/Support-components-in-ItemMeta.patch b/patches/server/Support-components-in-ItemMeta.patch similarity index 100% rename from patches/unapplied/server/Support-components-in-ItemMeta.patch rename to patches/server/Support-components-in-ItemMeta.patch diff --git a/patches/unapplied/server/Support-old-UUID-format-for-NBT.patch b/patches/server/Support-old-UUID-format-for-NBT.patch similarity index 100% rename from patches/unapplied/server/Support-old-UUID-format-for-NBT.patch rename to patches/server/Support-old-UUID-format-for-NBT.patch diff --git a/patches/unapplied/server/Thread-Safe-Vanilla-Command-permission-checking.patch b/patches/server/Thread-Safe-Vanilla-Command-permission-checking.patch similarity index 100% rename from patches/unapplied/server/Thread-Safe-Vanilla-Command-permission-checking.patch rename to patches/server/Thread-Safe-Vanilla-Command-permission-checking.patch diff --git a/patches/unapplied/server/Tracking-Range-Improvements.patch b/patches/server/Tracking-Range-Improvements.patch similarity index 100% rename from patches/unapplied/server/Tracking-Range-Improvements.patch rename to patches/server/Tracking-Range-Improvements.patch diff --git a/patches/unapplied/server/Update-itemstack-legacy-name-and-lore.patch b/patches/server/Update-itemstack-legacy-name-and-lore.patch similarity index 100% rename from patches/unapplied/server/Update-itemstack-legacy-name-and-lore.patch rename to patches/server/Update-itemstack-legacy-name-and-lore.patch diff --git a/patches/unapplied/server/Use-distance-map-to-optimise-entity-tracker.patch b/patches/server/Use-distance-map-to-optimise-entity-tracker.patch similarity index 100% rename from patches/unapplied/server/Use-distance-map-to-optimise-entity-tracker.patch rename to patches/server/Use-distance-map-to-optimise-entity-tracker.patch diff --git a/patches/unapplied/server/Use-seed-based-lookup-for-Treasure-Maps-Fixes-lag-fr.patch b/patches/server/Use-seed-based-lookup-for-Treasure-Maps-Fixes-lag-fr.patch similarity index 100% rename from patches/unapplied/server/Use-seed-based-lookup-for-Treasure-Maps-Fixes-lag-fr.patch rename to patches/server/Use-seed-based-lookup-for-Treasure-Maps-Fixes-lag-fr.patch diff --git a/patches/unapplied/server/Validate-PickItem-Packet-and-kick-for-invalid.patch b/patches/server/Validate-PickItem-Packet-and-kick-for-invalid.patch similarity index 100% rename from patches/unapplied/server/Validate-PickItem-Packet-and-kick-for-invalid.patch rename to patches/server/Validate-PickItem-Packet-and-kick-for-invalid.patch diff --git a/patches/unapplied/server/Validate-tripwire-hook-placement-before-update.patch b/patches/server/Validate-tripwire-hook-placement-before-update.patch similarity index 100% rename from patches/unapplied/server/Validate-tripwire-hook-placement-before-update.patch rename to patches/server/Validate-tripwire-hook-placement-before-update.patch diff --git a/patches/unapplied/server/Villager-Restocks-API.patch b/patches/server/Villager-Restocks-API.patch similarity index 100% rename from patches/unapplied/server/Villager-Restocks-API.patch rename to patches/server/Villager-Restocks-API.patch diff --git a/patches/unapplied/server/Wait-for-Async-Tasks-during-shutdown.patch b/patches/server/Wait-for-Async-Tasks-during-shutdown.patch similarity index 100% rename from patches/unapplied/server/Wait-for-Async-Tasks-during-shutdown.patch rename to patches/server/Wait-for-Async-Tasks-during-shutdown.patch diff --git a/patches/unapplied/server/add-hand-to-BlockMultiPlaceEvent.patch b/patches/server/add-hand-to-BlockMultiPlaceEvent.patch similarity index 100% rename from patches/unapplied/server/add-hand-to-BlockMultiPlaceEvent.patch rename to patches/server/add-hand-to-BlockMultiPlaceEvent.patch diff --git a/patches/unapplied/server/implement-optional-per-player-mob-spawns.patch b/patches/server/implement-optional-per-player-mob-spawns.patch similarity index 99% rename from patches/unapplied/server/implement-optional-per-player-mob-spawns.patch rename to patches/server/implement-optional-per-player-mob-spawns.patch index 2c1c15129b..f565c02217 100644 --- a/patches/unapplied/server/implement-optional-per-player-mob-spawns.patch +++ b/patches/server/implement-optional-per-player-mob-spawns.patch @@ -403,7 +403,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 Object2IntOpenHashMap object2intopenhashmap = new Object2IntOpenHashMap(); Iterator iterator = entities.iterator(); @@ -0,0 +0,0 @@ public final class NaturalSpawner { - spawnercreatureprobabilities.addCharge(entity.blockPosition(), biomesettingsmobs_b.getCharge()); + spawnercreatureprobabilities.addCharge(entity.blockPosition(), biomesettingsmobs_b.charge()); } - if (entity instanceof Mob) { diff --git a/patches/unapplied/server/incremental-chunk-and-player-saving.patch b/patches/server/incremental-chunk-and-player-saving.patch similarity index 99% rename from patches/unapplied/server/incremental-chunk-and-player-saving.patch rename to patches/server/incremental-chunk-and-player-saving.patch index 67ac0e2997..feb8e02733 100644 --- a/patches/unapplied/server/incremental-chunk-and-player-saving.patch +++ b/patches/server/incremental-chunk-and-player-saving.patch @@ -18,7 +18,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } finally { this.isSaving = false; @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0 && this.tickCount % this.autosavePeriod == 0) { // CraftBukkit diff --git a/patches/unapplied/server/misc-debugging-dumps.patch b/patches/server/misc-debugging-dumps.patch similarity index 100% rename from patches/unapplied/server/misc-debugging-dumps.patch rename to patches/server/misc-debugging-dumps.patch diff --git a/patches/unapplied/server/offset-item-frame-ticking.patch b/patches/server/offset-item-frame-ticking.patch similarity index 100% rename from patches/unapplied/server/offset-item-frame-ticking.patch rename to patches/server/offset-item-frame-ticking.patch diff --git a/patches/unapplied/server/Optimize-Hoppers.patch b/patches/unapplied/server/Optimize-Hoppers.patch deleted file mode 100644 index cfa19d00cf..0000000000 --- a/patches/unapplied/server/Optimize-Hoppers.patch +++ /dev/null @@ -1,585 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Wed, 27 Apr 2016 22:09:52 -0400 -Subject: [PATCH] Optimize Hoppers - -* Removes unnecessary extra calls to .update() that are very expensive -* Lots of itemstack cloning removed. Only clone if the item is actually moved -* Return true when a plugin cancels inventory move item event instead of false, as false causes pulls to cycle through all items. - However, pushes do not exhibit the same behavior, so this is not something plugins could of been relying on. -* Add option (Default on) to cooldown hoppers when they fail to move an item due to full inventory -* Skip subsequent InventoryMoveItemEvents if a plugin does not use the item after first event fire for an iteration -* Don't check for Entities with Inventories if the block above us is also occluding (not just Inventoried) -* Remove Streams from Item Suck In and restore restore 1.12 AABB checks which is simpler and no voxel allocations (was doing TWO Item Suck ins) - -diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/MinecraftServer.java -+++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper -+ net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = worldserver.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper - - this.profiler.push(() -> { - return worldserver + " " + worldserver.dimension().location(); -diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/item/ItemStack.java -+++ b/src/main/java/net/minecraft/world/item/ItemStack.java -@@ -0,0 +0,0 @@ public final class ItemStack { - return this.getItem().interactLivingEntity(this, user, entity, hand); - } - -- public ItemStack copy() { -- if (this.isEmpty()) { -+ public ItemStack copy() { return cloneItemStack(false); } // Paper -+ public ItemStack cloneItemStack(boolean origItem) { // Paper -+ if (!origItem && this.isEmpty()) { // Paper - return ItemStack.EMPTY; - } else { -- ItemStack itemstack = new ItemStack(this.getItem(), this.count); -+ ItemStack itemstack = new ItemStack(origItem ? this.item : this.getItem(), this.count); // Paper - - itemstack.setPopTime(this.getPopTime()); - if (this.tag != null) { -diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java -+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java -@@ -0,0 +0,0 @@ import co.aikar.timings.MinecraftTimings; // Paper - import co.aikar.timings.Timing; // Paper - - public abstract class BlockEntity { -+ static boolean ignoreTileUpdates; // Paper - - public Timing tickTimer = MinecraftTimings.getTileEntityTimings(this); // Paper - // CraftBukkit start - data containers -@@ -0,0 +0,0 @@ public abstract class BlockEntity { - - public void setChanged() { - if (this.level != null) { -+ if (ignoreTileUpdates) return; // Paper - BlockEntity.setChanged(this.level, this.worldPosition, this.blockState); - } - -diff --git a/src/main/java/net/minecraft/world/level/block/entity/ChiseledBookShelfBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ChiseledBookShelfBlockEntity.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/level/block/entity/ChiseledBookShelfBlockEntity.java -+++ b/src/main/java/net/minecraft/world/level/block/entity/ChiseledBookShelfBlockEntity.java -@@ -0,0 +0,0 @@ public class ChiseledBookShelfBlockEntity extends BlockEntity implements Contain - - @Override - public void setItem(int slot, ItemStack stack) { -- if (stack.is(ItemTags.BOOKSHELF_BOOKS)) { -+ if (stack.isEmpty() || stack.is(ItemTags.BOOKSHELF_BOOKS)) { // Paper - this.items.set(slot, stack); - this.updateState(slot); - } -diff --git a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java -+++ b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java -@@ -0,0 +0,0 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen - - return false; - } -+ // Paper start - Optimize Hoppers -+ private static boolean skipPullModeEventFire; -+ private static boolean skipPushModeEventFire; -+ public static boolean skipHopperEvents; -+ -+ private static boolean hopperPush(final Level level, final Container destination, final Direction direction, final HopperBlockEntity hopper) { -+ skipPushModeEventFire = skipHopperEvents; -+ boolean foundItem = false; -+ for (int i = 0; i < hopper.getContainerSize(); ++i) { -+ final ItemStack item = hopper.getItem(i); -+ if (!item.isEmpty()) { -+ foundItem = true; -+ ItemStack origItemStack = item; -+ ItemStack movedItem = origItemStack; -+ -+ final int originalItemCount = origItemStack.getCount(); -+ final int movedItemCount = Math.min(level.spigotConfig.hopperAmount, originalItemCount); -+ origItemStack.setCount(movedItemCount); -+ -+ // We only need to fire the event once to give protection plugins a chance to cancel this event -+ // Because nothing uses getItem, every event call should end up the same result. -+ if (!skipPushModeEventFire) { -+ movedItem = callPushMoveEvent(destination, movedItem, hopper); -+ if (movedItem == null) { // cancelled -+ origItemStack.setCount(originalItemCount); -+ return false; -+ } -+ } -+ -+ final ItemStack remainingItem = addItem(hopper, destination, movedItem, direction); -+ final int remainingItemCount = remainingItem.getCount(); -+ if (remainingItemCount != movedItemCount) { -+ origItemStack = origItemStack.cloneItemStack(true); -+ origItemStack.setCount(originalItemCount); -+ if (!origItemStack.isEmpty()) { -+ origItemStack.setCount(originalItemCount - movedItemCount + remainingItemCount); -+ } -+ hopper.setItem(i, origItemStack); -+ destination.setChanged(); -+ return true; -+ } -+ origItemStack.setCount(originalItemCount); -+ } -+ } -+ if (foundItem && level.paperConfig().hopper.cooldownWhenFull) { // Inventory was full - cooldown -+ hopper.setCooldown(level.spigotConfig.hopperTransfer); -+ } -+ return false; -+ } -+ -+ private static boolean hopperPull(final Level level, final Hopper hopper, final Container container, ItemStack origItemStack, final int i) { -+ ItemStack movedItem = origItemStack; -+ final int originalItemCount = origItemStack.getCount(); -+ final int movedItemCount = Math.min(level.spigotConfig.hopperAmount, originalItemCount); -+ movedItem.setCount(movedItemCount); -+ -+ if (!skipPullModeEventFire) { -+ movedItem = callPullMoveEvent(hopper, container, movedItem); -+ if (movedItem == null) { // cancelled -+ origItemStack.setCount(originalItemCount); -+ // Drastically improve performance by returning true. -+ // No plugin could of relied on the behavior of false as the other call -+ // site for IMIE did not exhibit the same behavior -+ return true; -+ } -+ } -+ -+ final ItemStack remainingItem = addItem(container, hopper, movedItem, null); -+ final int remainingItemCount = remainingItem.getCount(); -+ if (remainingItemCount != movedItemCount) { -+ origItemStack = origItemStack.cloneItemStack(true); -+ origItemStack.setCount(originalItemCount); -+ if (!origItemStack.isEmpty()) { -+ origItemStack.setCount(originalItemCount - movedItemCount + remainingItemCount); -+ } -+ -+ ignoreTileUpdates = true; -+ container.setItem(i, origItemStack); -+ ignoreTileUpdates = false; -+ container.setChanged(); -+ return true; -+ } -+ origItemStack.setCount(originalItemCount); -+ -+ if (level.paperConfig().hopper.cooldownWhenFull) { -+ cooldownHopper(hopper); -+ } -+ -+ return false; -+ } -+ -+ @Nullable -+ private static ItemStack callPushMoveEvent(Container iinventory, ItemStack itemstack, HopperBlockEntity hopper) { -+ final Inventory destinationInventory = getInventory(iinventory); -+ final InventoryMoveItemEvent event = new InventoryMoveItemEvent(hopper.getOwner(false).getInventory(), -+ CraftItemStack.asCraftMirror(itemstack), destinationInventory, true); -+ final boolean result = event.callEvent(); -+ if (!event.calledGetItem && !event.calledSetItem) { -+ skipPushModeEventFire = true; -+ } -+ if (!result) { -+ cooldownHopper(hopper); -+ return null; -+ } -+ -+ if (event.calledSetItem) { -+ return CraftItemStack.asNMSCopy(event.getItem()); -+ } else { -+ return itemstack; -+ } -+ } -+ -+ @Nullable -+ private static ItemStack callPullMoveEvent(final Hopper hopper, final Container container, final ItemStack itemstack) { -+ final Inventory sourceInventory = getInventory(container); -+ final Inventory destination = getInventory(hopper); -+ -+ // Mirror is safe as no plugins ever use this item -+ final InventoryMoveItemEvent event = new InventoryMoveItemEvent(sourceInventory, CraftItemStack.asCraftMirror(itemstack), destination, false); -+ final boolean result = event.callEvent(); -+ if (!event.calledGetItem && !event.calledSetItem) { -+ skipPullModeEventFire = true; -+ } -+ if (!result) { -+ cooldownHopper(hopper); -+ return null; -+ } -+ -+ if (event.calledSetItem) { -+ return CraftItemStack.asNMSCopy(event.getItem()); -+ } else { -+ return itemstack; -+ } -+ } -+ -+ private static Inventory getInventory(final Container container) { -+ final Inventory sourceInventory; -+ if (container instanceof CompoundContainer compoundContainer) { -+ // Have to special-case large chests as they work oddly -+ sourceInventory = new org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest(compoundContainer); -+ } else if (container instanceof BlockEntity blockEntity) { -+ sourceInventory = blockEntity.getOwner(false).getInventory(); -+ } else { -+ sourceInventory = container.getOwner().getInventory(); -+ } -+ return sourceInventory; -+ } -+ -+ private static void cooldownHopper(final Hopper hopper) { -+ if (hopper instanceof HopperBlockEntity blockEntity) { -+ blockEntity.setCooldown(blockEntity.getLevel().spigotConfig.hopperTransfer); -+ } else if (hopper instanceof MinecartHopper blockEntity) { -+ blockEntity.setCooldown(blockEntity.getLevel().spigotConfig.hopperTransfer / 2); -+ } -+ } -+ // Paper end - - private static boolean ejectItems(Level world, BlockPos blockposition, BlockState iblockdata, Container iinventory, HopperBlockEntity hopper) { // CraftBukkit - Container iinventory1 = HopperBlockEntity.getAttachedContainer(world, blockposition, iblockdata); -@@ -0,0 +0,0 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen - if (HopperBlockEntity.isFullContainer(iinventory1, enumdirection)) { - return false; - } else { -- for (int i = 0; i < iinventory.getContainerSize(); ++i) { -- if (!iinventory.getItem(i).isEmpty()) { -- ItemStack itemstack = iinventory.getItem(i).copy(); -- // ItemStack itemstack1 = addItem(iinventory, iinventory1, iinventory.removeItem(i, 1), enumdirection); -- -- // CraftBukkit start - Call event when pushing items into other inventories -- CraftItemStack oitemstack = CraftItemStack.asCraftMirror(iinventory.removeItem(i, world.spigotConfig.hopperAmount)); // Spigot -- -- Inventory destinationInventory; -- // Have to special case large chests as they work oddly -- if (iinventory1 instanceof CompoundContainer) { -- destinationInventory = new org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest((CompoundContainer) iinventory1); -- } else { -- destinationInventory = iinventory1.getOwner().getInventory(); -- } -- -- InventoryMoveItemEvent event = new InventoryMoveItemEvent(iinventory.getOwner().getInventory(), oitemstack.clone(), destinationInventory, true); -- world.getCraftServer().getPluginManager().callEvent(event); -- if (event.isCancelled()) { -- hopper.setItem(i, itemstack); -- hopper.setCooldown(world.spigotConfig.hopperTransfer); // Spigot -- return false; -- } -- int origCount = event.getItem().getAmount(); // Spigot -- ItemStack itemstack1 = HopperBlockEntity.addItem(iinventory, iinventory1, CraftItemStack.asNMSCopy(event.getItem()), enumdirection); -+ // Paper start - replace logic; MAKE SURE TO CHECK FOR DIFFS ON UPDATES -+ return hopperPush(world, iinventory1, enumdirection, hopper); -+ //for (int i = 0; i < iinventory.getContainerSize(); ++i) { -+ // if (!iinventory.getItem(i).isEmpty()) { -+ // ItemStack itemstack = iinventory.getItem(i).copy(); -+ // // ItemStack itemstack1 = addItem(iinventory, iinventory1, iinventory.removeItem(i, 1), enumdirection); -+ -+ // // CraftBukkit start - Call event when pushing items into other inventories -+ // CraftItemStack oitemstack = CraftItemStack.asCraftMirror(iinventory.removeItem(i, world.spigotConfig.hopperAmount)); // Spigot -+ -+ // Inventory destinationInventory; -+ // // Have to special case large chests as they work oddly -+ // if (iinventory1 instanceof CompoundContainer) { -+ // destinationInventory = new org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest((CompoundContainer) iinventory1); -+ // } else { -+ // destinationInventory = iinventory1.getOwner().getInventory(); -+ // } -+ -+ // InventoryMoveItemEvent event = new InventoryMoveItemEvent(iinventory.getOwner().getInventory(), oitemstack.clone(), destinationInventory, true); -+ // world.getCraftServer().getPluginManager().callEvent(event); -+ // if (event.isCancelled()) { -+ // hopper.setItem(i, itemstack); -+ // hopper.setCooldown(world.spigotConfig.hopperTransfer); // Spigot -+ // return false; -+ // } -+ // int origCount = event.getItem().getAmount(); // Spigot -+ // ItemStack itemstack1 = HopperBlockEntity.addItem(iinventory, iinventory1, CraftItemStack.asNMSCopy(event.getItem()), enumdirection); - // CraftBukkit end - -- if (itemstack1.isEmpty()) { -- iinventory1.setChanged(); -- return true; -- } -+ // if (itemstack1.isEmpty()) { -+ // iinventory1.setChanged(); -+ // return true; -+ // } - -- itemstack.shrink(origCount - itemstack1.getCount()); // Spigot -- iinventory.setItem(i, itemstack); -- } -- } -+ // itemstack.shrink(origCount - itemstack1.getCount()); // Spigot -+ // iinventory.setItem(i, itemstack); -+ // } -+ //} - -- return false; -+ //return false; -+ // Paper end - } - } - } -@@ -0,0 +0,0 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen - } - - private static boolean isFullContainer(Container inventory, Direction direction) { -- return HopperBlockEntity.getSlots(inventory, direction).allMatch((i) -> { -- ItemStack itemstack = inventory.getItem(i); -- -- return itemstack.getCount() >= itemstack.getMaxStackSize(); -- }); -+ return allMatch(inventory, direction, STACK_SIZE_TEST); // Paper - no streams - } - - private static boolean isEmptyContainer(Container inv, Direction facing) { -- return HopperBlockEntity.getSlots(inv, facing).allMatch((i) -> { -- return inv.getItem(i).isEmpty(); -- }); -+ // Paper start -+ return allMatch(inv, facing, IS_EMPTY_TEST); -+ } -+ private static boolean allMatch(Container iinventory, Direction enumdirection, java.util.function.BiPredicate test) { -+ if (iinventory instanceof WorldlyContainer) { -+ for (int i : ((WorldlyContainer) iinventory).getSlotsForFace(enumdirection)) { -+ if (!test.test(iinventory.getItem(i), i)) { -+ return false; -+ } -+ } -+ } else { -+ int size = iinventory.getContainerSize(); -+ for (int i = 0; i < size; i++) { -+ if (!test.test(iinventory.getItem(i), i)) { -+ return false; -+ } -+ } -+ } -+ return true; -+ } -+ -+ private static boolean anyMatch(Container iinventory, Direction enumdirection, java.util.function.BiPredicate test) { -+ if (iinventory instanceof WorldlyContainer) { -+ for (int i : ((WorldlyContainer) iinventory).getSlotsForFace(enumdirection)) { -+ if (test.test(iinventory.getItem(i), i)) { -+ return true; -+ } -+ } -+ } else { -+ int size = iinventory.getContainerSize(); -+ for (int i = 0; i < size; i++) { -+ if (test.test(iinventory.getItem(i), i)) { -+ return true; -+ } -+ } -+ } -+ return true; - } -+ private static final java.util.function.BiPredicate STACK_SIZE_TEST = (itemstack, i) -> itemstack.getCount() >= itemstack.getMaxStackSize(); -+ private static final java.util.function.BiPredicate IS_EMPTY_TEST = (itemstack, i) -> itemstack.isEmpty(); -+ // Paper end - - public static boolean suckInItems(Level world, Hopper hopper) { - Container iinventory = HopperBlockEntity.getSourceContainer(world, hopper); -@@ -0,0 +0,0 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen - if (iinventory != null) { - Direction enumdirection = Direction.DOWN; - -- return HopperBlockEntity.isEmptyContainer(iinventory, enumdirection) ? false : HopperBlockEntity.getSlots(iinventory, enumdirection).anyMatch((i) -> { -- return HopperBlockEntity.a(hopper, iinventory, i, enumdirection, world); // Spigot -+ // Paper start - optimize hoppers and remove streams -+ skipPullModeEventFire = skipHopperEvents; -+ return !HopperBlockEntity.isEmptyContainer(iinventory, enumdirection) && anyMatch(iinventory, enumdirection, (item, i) -> { -+ // Logic copied from below to avoid extra getItem calls -+ if (!item.isEmpty() && canTakeItemFromContainer(iinventory, item, i, enumdirection)) { -+ return hopperPull(world, hopper, iinventory, item, i); -+ } else { -+ return false; -+ } -+ // Paper end - }); - } else { - Iterator iterator = HopperBlockEntity.getItemsAtAndAbove(world, hopper).iterator(); -@@ -0,0 +0,0 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen - } - } - -+ // Paper - method unused as logic is inlined above - private static boolean a(Hopper ihopper, Container iinventory, int i, Direction enumdirection, Level world) { // Spigot - ItemStack itemstack = iinventory.getItem(i); - -- if (!itemstack.isEmpty() && HopperBlockEntity.canTakeItemFromContainer(iinventory, itemstack, i, enumdirection)) { -- ItemStack itemstack1 = itemstack.copy(); -- // ItemStack itemstack2 = addItem(iinventory, ihopper, iinventory.removeItem(i, 1), (EnumDirection) null); -- // CraftBukkit start - Call event on collection of items from inventories into the hopper -- CraftItemStack oitemstack = CraftItemStack.asCraftMirror(iinventory.removeItem(i, world.spigotConfig.hopperAmount)); // Spigot -- -- Inventory sourceInventory; -- // Have to special case large chests as they work oddly -- if (iinventory instanceof CompoundContainer) { -- sourceInventory = new org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest((CompoundContainer) iinventory); -- } else { -- sourceInventory = iinventory.getOwner().getInventory(); -- } -- -- InventoryMoveItemEvent event = new InventoryMoveItemEvent(sourceInventory, oitemstack.clone(), ihopper.getOwner().getInventory(), false); -- -- Bukkit.getServer().getPluginManager().callEvent(event); -- if (event.isCancelled()) { -- iinventory.setItem(i, itemstack1); -- -- if (ihopper instanceof HopperBlockEntity) { -- ((HopperBlockEntity) ihopper).setCooldown(world.spigotConfig.hopperTransfer); // Spigot -- } else if (ihopper instanceof MinecartHopper) { -- ((MinecartHopper) ihopper).setCooldown(world.spigotConfig.hopperTransfer / 2); // Spigot -- } -- return false; -- } -- int origCount = event.getItem().getAmount(); // Spigot -- ItemStack itemstack2 = HopperBlockEntity.addItem(iinventory, ihopper, CraftItemStack.asNMSCopy(event.getItem()), null); -- // CraftBukkit end -- -- if (itemstack2.isEmpty()) { -- iinventory.setChanged(); -- return true; -- } -- -- itemstack1.shrink(origCount - itemstack2.getCount()); // Spigot -- iinventory.setItem(i, itemstack1); -+ if (!itemstack.isEmpty() && HopperBlockEntity.canTakeItemFromContainer(iinventory, itemstack, i, enumdirection)) { // If this logic changes, update above. this is left inused incase reflective plugins -+ // Paper start - replace pull logic; MAKE SURE TO CHECK FOR DIFFS WHEN UPDATING -+ return hopperPull(world, ihopper, iinventory, itemstack, i); -+ //ItemStack itemstack1 = itemstack.copy(); -+ //// ItemStack itemstack2 = addItem(iinventory, ihopper, iinventory.removeItem(i, 1), (EnumDirection) null); -+ //// CraftBukkit start - Call event on collection of items from inventories into the hopper -+ //CraftItemStack oitemstack = CraftItemStack.asCraftMirror(iinventory.removeItem(i, world.spigotConfig.hopperAmount)); // Spigot -+ -+ //Inventory sourceInventory; -+ //// Have to special case large chests as they work oddly -+ //if (iinventory instanceof CompoundContainer) { -+ // sourceInventory = new org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest((CompoundContainer) iinventory); -+ //} else { -+ // sourceInventory = iinventory.getOwner().getInventory(); -+ //} -+ -+ //InventoryMoveItemEvent event = new InventoryMoveItemEvent(sourceInventory, oitemstack.clone(), ihopper.getOwner().getInventory(), false); -+ -+ //Bukkit.getServer().getPluginManager().callEvent(event); -+ //if (event.isCancelled()) { -+ // iinventory.setItem(i, itemstack1); -+ -+ // if (ihopper instanceof HopperBlockEntity) { -+ // ((HopperBlockEntity) ihopper).setCooldown(world.spigotConfig.hopperTransfer); // Spigot -+ // } else if (ihopper instanceof MinecartHopper) { -+ // ((MinecartHopper) ihopper).setCooldown(world.spigotConfig.hopperTransfer / 2); // Spigot -+ // } -+ // return false; -+ //} -+ //int origCount = event.getItem().getAmount(); // Spigot -+ //ItemStack itemstack2 = HopperBlockEntity.addItem(iinventory, ihopper, CraftItemStack.asNMSCopy(event.getItem()), null); -+ //// CraftBukkit end -+ -+ //if (itemstack2.isEmpty()) { -+ // iinventory.setChanged(); -+ // return true; -+ //} -+ -+ //itemstack1.shrink(origCount - itemstack2.getCount()); // Spigot -+ //iinventory.setItem(i, itemstack1); -+ // Paper end - } - - return false; -@@ -0,0 +0,0 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen - public static boolean addItem(Container inventory, ItemEntity itemEntity) { - boolean flag = false; - // CraftBukkit start -- InventoryPickupItemEvent event = new InventoryPickupItemEvent(inventory.getOwner().getInventory(), (org.bukkit.entity.Item) itemEntity.getBukkitEntity()); -+ InventoryPickupItemEvent event = new InventoryPickupItemEvent(getInventory(inventory), (org.bukkit.entity.Item) itemEntity.getBukkitEntity()); // Paper - use getInventory() to avoid snapshot creation - itemEntity.level.getCraftServer().getPluginManager().callEvent(event); - if (event.isCancelled()) { - return false; -@@ -0,0 +0,0 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen - stack = stack.split(to.getMaxStackSize()); - } - // Spigot end -+ ignoreTileUpdates = true; // Paper - to.setItem(slot, stack); -+ ignoreTileUpdates = false; // Paper - stack = ItemStack.EMPTY; - flag = true; - } else if (HopperBlockEntity.canMergeItems(itemstack1, stack)) { -@@ -0,0 +0,0 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen - } - - public static List getItemsAtAndAbove(Level world, Hopper hopper) { -- return (List) hopper.getSuckShape().toAabbs().stream().flatMap((axisalignedbb) -> { -- return world.getEntitiesOfClass(ItemEntity.class, axisalignedbb.move(hopper.getLevelX() - 0.5D, hopper.getLevelY() - 0.5D, hopper.getLevelZ() - 0.5D), EntitySelector.ENTITY_STILL_ALIVE).stream(); -- }).collect(Collectors.toList()); -+ // Paper start - Optimize item suck in. remove streams, restore 1.12 checks. Seriously checking the bowl?! -+ double d0 = hopper.getLevelX(); -+ double d1 = hopper.getLevelY(); -+ double d2 = hopper.getLevelZ(); -+ AABB bb = new AABB(d0 - 0.5D, d1, d2 - 0.5D, d0 + 0.5D, d1 + 1.5D, d2 + 0.5D); -+ return world.getEntitiesOfClass(ItemEntity.class, bb, Entity::isAlive); -+ // Paper end - } - - @Nullable - public static Container getContainerAt(Level world, BlockPos pos) { -- return HopperBlockEntity.getContainerAt(world, (double) pos.getX() + 0.5D, (double) pos.getY() + 0.5D, (double) pos.getZ() + 0.5D); -+ return HopperBlockEntity.getContainerAt(world, (double) pos.getX() + 0.5D, (double) pos.getY() + 0.5D, (double) pos.getZ() + 0.5D, true); // Paper - } - - @Nullable -- private static Container getContainerAt(Level world, double x, double y, double z) { -+ public static Container getContainerAt(Level world, double x, double y, double z) { -+ // Paper start - add optimizeEntities parameter -+ return getContainerAt(world, x, y, z, false); -+ } -+ @Nullable -+ private static Container getContainerAt(Level world, double x, double y, double z, final boolean optimizeEntities) { -+ // Paper end - add optimizeEntities parameter - Object object = null; - BlockPos blockposition = new BlockPos(x, y, z); - if ( !world.spigotConfig.hopperCanLoadChunks && !world.hasChunkAt( blockposition ) ) return null; // Spigot -@@ -0,0 +0,0 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen - } - } - -- if (object == null) { -+ if (object == null && (!optimizeEntities || !world.paperConfig().hopper.ignoreOccludingBlocks || !org.bukkit.craftbukkit.util.CraftMagicNumbers.getMaterial(block).isOccluding())) { // Paper - List list = world.getEntities((Entity) null, new AABB(x - 0.5D, y - 0.5D, z - 0.5D, x + 0.5D, y + 0.5D, z + 0.5D), EntitySelector.CONTAINER_ENTITY_SELECTOR); - - if (!list.isEmpty()) { -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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 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 -@@ -0,0 +0,0 @@ public abstract class RandomizableContainerBlockEntity extends BaseContainerBloc - @Override - public boolean isEmpty() { - this.unpackLootTable((Player)null); -- return this.getItems().stream().allMatch(ItemStack::isEmpty); -+ // Paper start -+ for (ItemStack itemStack : this.getItems()) { -+ if (!itemStack.isEmpty()) { -+ return false; -+ } -+ } -+ // Paper end -+ return true; - } - - @Override - public ItemStack getItem(int slot) { -- this.unpackLootTable((Player)null); -+ if (slot == 0) this.unpackLootTable((Player) null); // Paper - return this.getItems().get(slot); - } - diff --git a/patches/unapplied/server/Optimize-the-advancement-data-player-iteration-to-be.patch b/patches/unapplied/server/Optimize-the-advancement-data-player-iteration-to-be.patch deleted file mode 100644 index 2a16d2f93c..0000000000 --- a/patches/unapplied/server/Optimize-the-advancement-data-player-iteration-to-be.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Wyatt Childers -Date: Sat, 4 Jul 2020 23:07:43 -0400 -Subject: [PATCH] Optimize the advancement data player iteration to be O(N) - rather than O(N^2) - - -diff --git a/src/main/java/net/minecraft/server/PlayerAdvancements.java b/src/main/java/net/minecraft/server/PlayerAdvancements.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/PlayerAdvancements.java -+++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java -@@ -0,0 +0,0 @@ public class PlayerAdvancements { - } - - private void ensureVisibility(Advancement advancement) { -+ // Paper start -+ ensureVisibility(advancement, IterationEntryPoint.ROOT); -+ } -+ private enum IterationEntryPoint { -+ ROOT, -+ ITERATOR, -+ PARENT_OF_ITERATOR -+ } -+ private void ensureVisibility(Advancement advancement, IterationEntryPoint entryPoint) { -+ // Paper end - boolean flag = this.shouldBeVisible(advancement); - boolean flag1 = this.visible.contains(advancement); - -@@ -0,0 +0,0 @@ public class PlayerAdvancements { - } - - if (flag != flag1 && advancement.getParent() != null) { -- this.ensureVisibility(advancement.getParent()); -+ // Paper start - If we're not coming from an iterator consider this to be a root entry, otherwise -+ // market that we're entering from the parent of an iterator. -+ this.ensureVisibility(advancement.getParent(), entryPoint == IterationEntryPoint.ITERATOR ? IterationEntryPoint.PARENT_OF_ITERATOR : IterationEntryPoint.ROOT); - } - -+ // If this is true, we've went through a child iteration, entered the parent, processed the parent -+ // and are about to reprocess the children. Stop processing here to prevent O(N^2) processing. -+ if (entryPoint == IterationEntryPoint.PARENT_OF_ITERATOR) { -+ return; -+ } // Paper end -+ - Iterator iterator = advancement.getChildren().iterator(); - - while (iterator.hasNext()) { - Advancement advancement1 = (Advancement) iterator.next(); - -- this.ensureVisibility(advancement1); -+ this.ensureVisibility(advancement1, IterationEntryPoint.ITERATOR); // Paper - Mark this call as being from iteration - } - - }