diff --git a/patches/unapplied/server/Ability-to-control-player-s-insomnia-and-phantoms.patch b/patches/server/Ability-to-control-player-s-insomnia-and-phantoms.patch similarity index 100% rename from patches/unapplied/server/Ability-to-control-player-s-insomnia-and-phantoms.patch rename to patches/server/Ability-to-control-player-s-insomnia-and-phantoms.patch diff --git a/patches/unapplied/server/Add-Alternate-Current-redstone-implementation.patch b/patches/server/Add-Alternate-Current-redstone-implementation.patch similarity index 99% rename from patches/unapplied/server/Add-Alternate-Current-redstone-implementation.patch rename to patches/server/Add-Alternate-Current-redstone-implementation.patch index e25055c3ef..42e8aff922 100644 --- a/patches/unapplied/server/Add-Alternate-Current-redstone-implementation.patch +++ b/patches/server/Add-Alternate-Current-redstone-implementation.patch @@ -1027,7 +1027,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + + /** -+ * Retrieve the {@link alternate.current.wire.Node Node} that represents the ++ * Retrieve the {@link Node Node} that represents the + * block at the given position in the level. + */ + private Node getOrAddNode(BlockPos pos) { @@ -1046,7 +1046,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + + /** -+ * Remove and return the {@link alternate.current.wire.Node Node} at the given ++ * Remove and return the {@link Node Node} at the given + * position. + */ + private Node removeNode(BlockPos pos) { @@ -1054,7 +1054,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + + /** -+ * Return a {@link alternate.current.wire.Node Node} that represents the block ++ * Return a {@link Node Node} that represents the block + * at the given position. + */ + private Node getNextNode(BlockPos pos) { @@ -1063,8 +1063,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + /** + * Return a node that represents the given position and block state. If it is a -+ * wire, then create a new {@link alternate.current.wire.WireNode WireNode}. -+ * Otherwise, grab the next {@link alternate.current.wire.Node Node} from the ++ * wire, then create a new {@link WireNode WireNode}. ++ * Otherwise, grab the next {@link Node Node} from the + * cache and update it. + */ + private Node getNextNode(BlockPos pos, BlockState state) { @@ -2020,7 +2020,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 final Throwable thr = new Throwable(entity + " Added to world at " + new java.util.Date()); io.papermc.paper.util.StacktraceDeobfuscator.INSTANCE.deobfuscateThrowable(thr); @@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel { - return this.randomSequences; + return crashreportsystemdetails; } + // Paper start - optimize redstone (Alternate Current) diff --git a/patches/unapplied/server/Add-BlockLockCheckEvent.patch b/patches/server/Add-BlockLockCheckEvent.patch similarity index 100% rename from patches/unapplied/server/Add-BlockLockCheckEvent.patch rename to patches/server/Add-BlockLockCheckEvent.patch diff --git a/patches/unapplied/server/Add-CompostItemEvent-and-EntityCompostItemEvent.patch b/patches/server/Add-CompostItemEvent-and-EntityCompostItemEvent.patch similarity index 100% rename from patches/unapplied/server/Add-CompostItemEvent-and-EntityCompostItemEvent.patch rename to patches/server/Add-CompostItemEvent-and-EntityCompostItemEvent.patch diff --git a/patches/unapplied/server/Add-Entity-Body-Yaw-API.patch b/patches/server/Add-Entity-Body-Yaw-API.patch similarity index 100% rename from patches/unapplied/server/Add-Entity-Body-Yaw-API.patch rename to patches/server/Add-Entity-Body-Yaw-API.patch diff --git a/patches/unapplied/server/Add-EntityDyeEvent-and-CollarColorable-interface.patch b/patches/server/Add-EntityDyeEvent-and-CollarColorable-interface.patch similarity index 100% rename from patches/unapplied/server/Add-EntityDyeEvent-and-CollarColorable-interface.patch rename to patches/server/Add-EntityDyeEvent-and-CollarColorable-interface.patch diff --git a/patches/unapplied/server/Add-EntityFertilizeEggEvent.patch b/patches/server/Add-EntityFertilizeEggEvent.patch similarity index 100% rename from patches/unapplied/server/Add-EntityFertilizeEggEvent.patch rename to patches/server/Add-EntityFertilizeEggEvent.patch diff --git a/patches/unapplied/server/Add-EntityPortalReadyEvent.patch b/patches/server/Add-EntityPortalReadyEvent.patch similarity index 96% rename from patches/unapplied/server/Add-EntityPortalReadyEvent.patch rename to patches/server/Add-EntityPortalReadyEvent.patch index 8a6b7558f0..c14ccbc07f 100644 --- a/patches/unapplied/server/Add-EntityPortalReadyEvent.patch +++ b/patches/server/Add-EntityPortalReadyEvent.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S if (true && !this.isPassenger() && this.portalTime++ >= i) { // CraftBukkit this.level().getProfiler().push("portal"); this.portalTime = i; @@ -22,7 +22,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.setPortalCooldown(); // CraftBukkit start if (this instanceof ServerPlayer) { -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } else { this.changeDimension(worldserver1); } diff --git a/patches/unapplied/server/Add-Mob-Experience-reward-API.patch b/patches/server/Add-Mob-Experience-reward-API.patch similarity index 100% rename from patches/unapplied/server/Add-Mob-Experience-reward-API.patch rename to patches/server/Add-Mob-Experience-reward-API.patch diff --git a/patches/unapplied/server/Add-Moving-Piston-API.patch b/patches/server/Add-Moving-Piston-API.patch similarity index 100% rename from patches/unapplied/server/Add-Moving-Piston-API.patch rename to patches/server/Add-Moving-Piston-API.patch diff --git a/patches/unapplied/server/Add-NamespacedKey-biome-methods.patch b/patches/server/Add-NamespacedKey-biome-methods.patch similarity index 100% rename from patches/unapplied/server/Add-NamespacedKey-biome-methods.patch rename to patches/server/Add-NamespacedKey-biome-methods.patch diff --git a/patches/unapplied/server/Add-Player-Warden-Warning-API.patch b/patches/server/Add-Player-Warden-Warning-API.patch similarity index 100% rename from patches/unapplied/server/Add-Player-Warden-Warning-API.patch rename to patches/server/Add-Player-Warden-Warning-API.patch diff --git a/patches/unapplied/server/Add-Player-getFishHook.patch b/patches/server/Add-Player-getFishHook.patch similarity index 100% rename from patches/unapplied/server/Add-Player-getFishHook.patch rename to patches/server/Add-Player-getFishHook.patch diff --git a/patches/unapplied/server/Add-PlayerInventorySlotChangeEvent.patch b/patches/server/Add-PlayerInventorySlotChangeEvent.patch similarity index 100% rename from patches/unapplied/server/Add-PlayerInventorySlotChangeEvent.patch rename to patches/server/Add-PlayerInventorySlotChangeEvent.patch diff --git a/patches/unapplied/server/Add-PlayerStopUsingItemEvent.patch b/patches/server/Add-PlayerStopUsingItemEvent.patch similarity index 100% rename from patches/unapplied/server/Add-PlayerStopUsingItemEvent.patch rename to patches/server/Add-PlayerStopUsingItemEvent.patch diff --git a/patches/unapplied/server/Add-PrePlayerAttackEntityEvent.patch b/patches/server/Add-PrePlayerAttackEntityEvent.patch similarity index 100% rename from patches/unapplied/server/Add-PrePlayerAttackEntityEvent.patch rename to patches/server/Add-PrePlayerAttackEntityEvent.patch diff --git a/patches/unapplied/server/Add-Shearable-API.patch b/patches/server/Add-Shearable-API.patch similarity index 100% rename from patches/unapplied/server/Add-Shearable-API.patch rename to patches/server/Add-Shearable-API.patch diff --git a/patches/unapplied/server/Add-Sneaking-API-for-Entities.patch b/patches/server/Add-Sneaking-API-for-Entities.patch similarity index 100% rename from patches/unapplied/server/Add-Sneaking-API-for-Entities.patch rename to patches/server/Add-Sneaking-API-for-Entities.patch diff --git a/patches/unapplied/server/Add-Velocity-IP-Forwarding-Support.patch b/patches/server/Add-Velocity-IP-Forwarding-Support.patch similarity index 100% rename from patches/unapplied/server/Add-Velocity-IP-Forwarding-Support.patch rename to patches/server/Add-Velocity-IP-Forwarding-Support.patch diff --git a/patches/unapplied/server/Add-WardenAngerChangeEvent.patch b/patches/server/Add-WardenAngerChangeEvent.patch similarity index 100% rename from patches/unapplied/server/Add-WardenAngerChangeEvent.patch rename to patches/server/Add-WardenAngerChangeEvent.patch diff --git a/patches/unapplied/server/Add-a-consumer-parameter-to-ProjectileSource-launchP.patch b/patches/server/Add-a-consumer-parameter-to-ProjectileSource-launchP.patch similarity index 100% rename from patches/unapplied/server/Add-a-consumer-parameter-to-ProjectileSource-launchP.patch rename to patches/server/Add-a-consumer-parameter-to-ProjectileSource-launchP.patch diff --git a/patches/unapplied/server/Add-and-fix-missing-BlockFadeEvents.patch b/patches/server/Add-and-fix-missing-BlockFadeEvents.patch similarity index 100% rename from patches/unapplied/server/Add-and-fix-missing-BlockFadeEvents.patch rename to patches/server/Add-and-fix-missing-BlockFadeEvents.patch diff --git a/patches/unapplied/server/Add-config-option-for-spider-worldborder-climbing.patch b/patches/server/Add-config-option-for-spider-worldborder-climbing.patch similarity index 97% rename from patches/unapplied/server/Add-config-option-for-spider-worldborder-climbing.patch rename to patches/server/Add-config-option-for-spider-worldborder-climbing.patch index cadb5d3f48..3808fdaa60 100644 --- a/patches/unapplied/server/Add-config-option-for-spider-worldborder-climbing.patch +++ b/patches/server/Add-config-option-for-spider-worldborder-climbing.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @javax.annotation.Nullable private UUID originWorld; public boolean freezeLocked = false; // Paper - Freeze Tick Lock API @@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public void setOrigin(@javax.annotation.Nonnull Location location) { this.origin = location.toVector(); -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S null, null ); diff --git a/patches/unapplied/server/Add-entity-knockback-API.patch b/patches/server/Add-entity-knockback-API.patch similarity index 100% rename from patches/unapplied/server/Add-entity-knockback-API.patch rename to patches/server/Add-entity-knockback-API.patch diff --git a/patches/unapplied/server/Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch b/patches/server/Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch similarity index 95% rename from patches/unapplied/server/Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch rename to patches/server/Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch index 285af3dac1..701e3ae641 100644 --- a/patches/unapplied/server/Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch +++ b/patches/server/Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch @@ -46,12 +46,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/world/level/Explosion.java @@ -0,0 +0,0 @@ public class Explosion { bukkitBlocks = event.blockList(); - yield = event.getYield(); + this.yield = event.getYield(); } else { -- BlockExplodeEvent event = new BlockExplodeEvent(location.getBlock(), blockList, this.blockInteraction == Explosion.BlockInteraction.DESTROY_WITH_DECAY ? 1.0F / this.radius : 1.0F); -+ BlockExplodeEvent event = new BlockExplodeEvent(location.getBlock(), blockList, this.blockInteraction == Explosion.BlockInteraction.DESTROY_WITH_DECAY ? 1.0F / this.radius : 1.0F, this.damageSource.explodedBlockState); // Paper - exploded block state +- BlockExplodeEvent event = new BlockExplodeEvent(location.getBlock(), blockList, this.yield); ++ BlockExplodeEvent event = new BlockExplodeEvent(location.getBlock(), blockList, this.yield, this.damageSource.explodedBlockState); // Paper - exploded block state this.level.getCraftServer().getPluginManager().callEvent(event); - cancelled = event.isCancelled(); + this.wasCanceled = event.isCancelled(); bukkitBlocks = event.blockList(); diff --git a/src/main/java/net/minecraft/world/level/block/BedBlock.java b/src/main/java/net/minecraft/world/level/block/BedBlock.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 diff --git a/patches/unapplied/server/Add-fire-tick-delay-option.patch b/patches/server/Add-fire-tick-delay-option.patch similarity index 100% rename from patches/unapplied/server/Add-fire-tick-delay-option.patch rename to patches/server/Add-fire-tick-delay-option.patch diff --git a/patches/unapplied/server/Add-getDrops-to-BlockState.patch b/patches/server/Add-getDrops-to-BlockState.patch similarity index 100% rename from patches/unapplied/server/Add-getDrops-to-BlockState.patch rename to patches/server/Add-getDrops-to-BlockState.patch diff --git a/patches/unapplied/server/Add-missing-SpigotConfig-logCommands-check.patch b/patches/server/Add-missing-SpigotConfig-logCommands-check.patch similarity index 100% rename from patches/unapplied/server/Add-missing-SpigotConfig-logCommands-check.patch rename to patches/server/Add-missing-SpigotConfig-logCommands-check.patch diff --git a/patches/unapplied/server/Add-missing-important-BlockStateListPopulator-method.patch b/patches/server/Add-missing-important-BlockStateListPopulator-method.patch similarity index 100% rename from patches/unapplied/server/Add-missing-important-BlockStateListPopulator-method.patch rename to patches/server/Add-missing-important-BlockStateListPopulator-method.patch diff --git a/patches/unapplied/server/Add-option-for-strict-advancement-dimension-checks.patch b/patches/server/Add-option-for-strict-advancement-dimension-checks.patch similarity index 100% rename from patches/unapplied/server/Add-option-for-strict-advancement-dimension-checks.patch rename to patches/server/Add-option-for-strict-advancement-dimension-checks.patch diff --git a/patches/unapplied/server/Add-paper-dumplisteners-command.patch b/patches/server/Add-paper-dumplisteners-command.patch similarity index 100% rename from patches/unapplied/server/Add-paper-dumplisteners-command.patch rename to patches/server/Add-paper-dumplisteners-command.patch diff --git a/patches/unapplied/server/Add-support-for-Proxy-Protocol.patch b/patches/server/Add-support-for-Proxy-Protocol.patch similarity index 100% rename from patches/unapplied/server/Add-support-for-Proxy-Protocol.patch rename to patches/server/Add-support-for-Proxy-Protocol.patch diff --git a/patches/unapplied/server/Add-transient-modifier-API.patch b/patches/server/Add-transient-modifier-API.patch similarity index 100% rename from patches/unapplied/server/Add-transient-modifier-API.patch rename to patches/server/Add-transient-modifier-API.patch diff --git a/patches/unapplied/server/Add-various-missing-EntityDropItemEvent-calls.patch b/patches/server/Add-various-missing-EntityDropItemEvent-calls.patch similarity index 97% rename from patches/unapplied/server/Add-various-missing-EntityDropItemEvent-calls.patch rename to patches/server/Add-various-missing-EntityDropItemEvent-calls.patch index f7cf0ad3a0..2f7a8c573c 100644 --- a/patches/unapplied/server/Add-various-missing-EntityDropItemEvent-calls.patch +++ b/patches/server/Add-various-missing-EntityDropItemEvent-calls.patch @@ -8,11 +8,11 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S stack.setCount(0); // Paper - destroy this item - if this ever leaks due to game bugs, ensure it doesn't dupe entityitem.setDefaultPickUpDelay(); -+ // Paper start ++ // Paper start + return this.spawnAtLocation(entityitem); + } + } @@ -42,7 +42,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/world/entity/animal/Fox.java @@ -0,0 +0,0 @@ public class Fox extends Animal implements VariantHolder { entityitem.setPickUpDelay(40); - entityitem.setThrower(this.getUUID()); + entityitem.setThrower(this); this.playSound(SoundEvents.FOX_SPIT, 1.0F, 1.0F); - this.level().addFreshEntity(entityitem); + this.spawnAtLocation(entityitem); // Paper - call EntityDropItemEvent diff --git a/patches/unapplied/server/Added-EntityToggleSitEvent.patch b/patches/server/Added-EntityToggleSitEvent.patch similarity index 100% rename from patches/unapplied/server/Added-EntityToggleSitEvent.patch rename to patches/server/Added-EntityToggleSitEvent.patch diff --git a/patches/unapplied/server/Added-byte-array-serialization-deserialization-for-P.patch b/patches/server/Added-byte-array-serialization-deserialization-for-P.patch similarity index 100% rename from patches/unapplied/server/Added-byte-array-serialization-deserialization-for-P.patch rename to patches/server/Added-byte-array-serialization-deserialization-for-P.patch diff --git a/patches/unapplied/server/Allow-changing-bed-s-occupied-property.patch b/patches/server/Allow-changing-bed-s-occupied-property.patch similarity index 100% rename from patches/unapplied/server/Allow-changing-bed-s-occupied-property.patch rename to patches/server/Allow-changing-bed-s-occupied-property.patch diff --git a/patches/unapplied/server/Avoid-Lazy-Initialization-for-Enum-Fields.patch b/patches/server/Avoid-Lazy-Initialization-for-Enum-Fields.patch similarity index 100% rename from patches/unapplied/server/Avoid-Lazy-Initialization-for-Enum-Fields.patch rename to patches/server/Avoid-Lazy-Initialization-for-Enum-Fields.patch diff --git a/patches/unapplied/server/Block-Ticking-API.patch b/patches/server/Block-Ticking-API.patch similarity index 100% rename from patches/unapplied/server/Block-Ticking-API.patch rename to patches/server/Block-Ticking-API.patch diff --git a/patches/unapplied/server/Break-redstone-on-top-of-trap-doors-early.patch b/patches/server/Break-redstone-on-top-of-trap-doors-early.patch similarity index 100% rename from patches/unapplied/server/Break-redstone-on-top-of-trap-doors-early.patch rename to patches/server/Break-redstone-on-top-of-trap-doors-early.patch diff --git a/patches/unapplied/server/Call-BlockPhysicsEvent-more-often.patch b/patches/server/Call-BlockPhysicsEvent-more-often.patch similarity index 100% rename from patches/unapplied/server/Call-BlockPhysicsEvent-more-often.patch rename to patches/server/Call-BlockPhysicsEvent-more-often.patch diff --git a/patches/unapplied/server/Collision-API.patch b/patches/server/Collision-API.patch similarity index 100% rename from patches/unapplied/server/Collision-API.patch rename to patches/server/Collision-API.patch diff --git a/patches/unapplied/server/Configurable-chat-thread-limit.patch b/patches/server/Configurable-chat-thread-limit.patch similarity index 100% rename from patches/unapplied/server/Configurable-chat-thread-limit.patch rename to patches/server/Configurable-chat-thread-limit.patch diff --git a/patches/unapplied/server/Correctly-handle-ArmorStand-invisibility.patch b/patches/server/Correctly-handle-ArmorStand-invisibility.patch similarity index 100% rename from patches/unapplied/server/Correctly-handle-ArmorStand-invisibility.patch rename to patches/server/Correctly-handle-ArmorStand-invisibility.patch diff --git a/patches/unapplied/server/Correctly-handle-interactions-with-items-on-cooldown.patch b/patches/server/Correctly-handle-interactions-with-items-on-cooldown.patch similarity index 100% rename from patches/unapplied/server/Correctly-handle-interactions-with-items-on-cooldown.patch rename to patches/server/Correctly-handle-interactions-with-items-on-cooldown.patch diff --git a/patches/unapplied/server/Correctly-shrink-items-during-EntityResurrectEvent.patch b/patches/server/Correctly-shrink-items-during-EntityResurrectEvent.patch similarity index 100% rename from patches/unapplied/server/Correctly-shrink-items-during-EntityResurrectEvent.patch rename to patches/server/Correctly-shrink-items-during-EntityResurrectEvent.patch diff --git a/patches/unapplied/server/Custom-Chat-Completion-Suggestions-API.patch b/patches/server/Custom-Chat-Completion-Suggestions-API.patch similarity index 100% rename from patches/unapplied/server/Custom-Chat-Completion-Suggestions-API.patch rename to patches/server/Custom-Chat-Completion-Suggestions-API.patch diff --git a/patches/unapplied/server/Detect-headless-JREs.patch b/patches/server/Detect-headless-JREs.patch similarity index 100% rename from patches/unapplied/server/Detect-headless-JREs.patch rename to patches/server/Detect-headless-JREs.patch diff --git a/patches/unapplied/server/Disable-component-selector-resolving-in-books-by-def.patch b/patches/server/Disable-component-selector-resolving-in-books-by-def.patch similarity index 100% rename from patches/unapplied/server/Disable-component-selector-resolving-in-books-by-def.patch rename to patches/server/Disable-component-selector-resolving-in-books-by-def.patch diff --git a/patches/unapplied/server/Do-not-accept-invalid-client-settings.patch b/patches/server/Do-not-accept-invalid-client-settings.patch similarity index 100% rename from patches/unapplied/server/Do-not-accept-invalid-client-settings.patch rename to patches/server/Do-not-accept-invalid-client-settings.patch diff --git a/patches/unapplied/server/Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch b/patches/server/Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch similarity index 100% rename from patches/unapplied/server/Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch rename to patches/server/Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch diff --git a/patches/unapplied/server/Don-t-broadcast-messages-to-command-blocks.patch b/patches/server/Don-t-broadcast-messages-to-command-blocks.patch similarity index 100% rename from patches/unapplied/server/Don-t-broadcast-messages-to-command-blocks.patch rename to patches/server/Don-t-broadcast-messages-to-command-blocks.patch diff --git a/patches/unapplied/server/Don-t-tick-markers.patch b/patches/server/Don-t-tick-markers.patch similarity index 100% rename from patches/unapplied/server/Don-t-tick-markers.patch rename to patches/server/Don-t-tick-markers.patch diff --git a/patches/unapplied/server/Don-t-use-level-random-in-entity-constructors.patch b/patches/server/Don-t-use-level-random-in-entity-constructors.patch similarity index 100% rename from patches/unapplied/server/Don-t-use-level-random-in-entity-constructors.patch rename to patches/server/Don-t-use-level-random-in-entity-constructors.patch diff --git a/patches/unapplied/server/Dont-resent-entity-on-art-update.patch b/patches/server/Dont-resent-entity-on-art-update.patch similarity index 100% rename from patches/unapplied/server/Dont-resent-entity-on-art-update.patch rename to patches/server/Dont-resent-entity-on-art-update.patch diff --git a/patches/unapplied/server/Elder-Guardian-appearance-API.patch b/patches/server/Elder-Guardian-appearance-API.patch similarity index 100% rename from patches/unapplied/server/Elder-Guardian-appearance-API.patch rename to patches/server/Elder-Guardian-appearance-API.patch diff --git a/patches/unapplied/server/EntityPickupItemEvent-fixes.patch b/patches/server/EntityPickupItemEvent-fixes.patch similarity index 100% rename from patches/unapplied/server/EntityPickupItemEvent-fixes.patch rename to patches/server/EntityPickupItemEvent-fixes.patch diff --git a/patches/unapplied/server/Expand-FallingBlock-API.patch b/patches/server/Expand-FallingBlock-API.patch similarity index 100% rename from patches/unapplied/server/Expand-FallingBlock-API.patch rename to patches/server/Expand-FallingBlock-API.patch diff --git a/patches/unapplied/server/Expand-PlayerItemMendEvent.patch b/patches/server/Expand-PlayerItemMendEvent.patch similarity index 98% rename from patches/unapplied/server/Expand-PlayerItemMendEvent.patch rename to patches/server/Expand-PlayerItemMendEvent.patch index 599b0aba5c..f702fcad3f 100644 --- a/patches/unapplied/server/Expand-PlayerItemMendEvent.patch +++ b/patches/server/Expand-PlayerItemMendEvent.patch @@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java @@ -0,0 +0,0 @@ public class ExperienceOrb extends Entity { ItemStack itemstack = (ItemStack) entry.getValue(); - int j = Math.min(this.xpToDurability(this.value), itemstack.getDamageValue()); + int j = Math.min(this.xpToDurability(amount), itemstack.getDamageValue()); // CraftBukkit start - org.bukkit.event.player.PlayerItemMendEvent event = CraftEventFactory.callPlayerItemMendEvent(player, this, itemstack, entry.getKey(), j); + org.bukkit.event.player.PlayerItemMendEvent event = CraftEventFactory.callPlayerItemMendEvent(player, this, itemstack, entry.getKey(), j, this::durabilityToXp); // Paper diff --git a/patches/unapplied/server/Expose-pre-collision-moving-velocity-to-VehicleBlock.patch b/patches/server/Expose-pre-collision-moving-velocity-to-VehicleBlock.patch similarity index 97% rename from patches/unapplied/server/Expose-pre-collision-moving-velocity-to-VehicleBlock.patch rename to patches/server/Expose-pre-collision-moving-velocity-to-VehicleBlock.patch index ecd084afa8..7abdca57cf 100644 --- a/patches/unapplied/server/Expose-pre-collision-moving-velocity-to-VehicleBlock.patch +++ b/patches/server/Expose-pre-collision-moving-velocity-to-VehicleBlock.patch @@ -9,7 +9,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } if (!bl.getType().isAir()) { diff --git a/patches/unapplied/server/Fire-CauldronLevelChange-on-initial-fill.patch b/patches/server/Fire-CauldronLevelChange-on-initial-fill.patch similarity index 100% rename from patches/unapplied/server/Fire-CauldronLevelChange-on-initial-fill.patch rename to patches/server/Fire-CauldronLevelChange-on-initial-fill.patch diff --git a/patches/unapplied/server/Fire-EntityChangeBlockEvent-in-more-places.patch b/patches/server/Fire-EntityChangeBlockEvent-in-more-places.patch similarity index 98% rename from patches/unapplied/server/Fire-EntityChangeBlockEvent-in-more-places.patch rename to patches/server/Fire-EntityChangeBlockEvent-in-more-places.patch index df95a33601..e267bd9b1d 100644 --- a/patches/unapplied/server/Fire-EntityChangeBlockEvent-in-more-places.patch +++ b/patches/server/Fire-EntityChangeBlockEvent-in-more-places.patch @@ -100,11 +100,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/item/AxeItem.java +++ b/src/main/java/net/minecraft/world/item/AxeItem.java @@ -0,0 +0,0 @@ public class AxeItem extends DiggerItem { - } - - if (optional4.isPresent()) { + return InteractionResult.PASS; + } else { + ItemStack itemStack = context.getItemInHand(); + // Paper start - EntityChangeBlockEvent -+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(player, blockPos, optional4.get())) { ++ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(player, blockPos, optional.get())) { + return InteractionResult.PASS; + } + // Paper end diff --git a/patches/unapplied/server/Fix-Bee-flower-NPE.patch b/patches/server/Fix-Bee-flower-NPE.patch similarity index 100% rename from patches/unapplied/server/Fix-Bee-flower-NPE.patch rename to patches/server/Fix-Bee-flower-NPE.patch diff --git a/patches/unapplied/server/Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch b/patches/server/Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch similarity index 100% rename from patches/unapplied/server/Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch rename to patches/server/Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch diff --git a/patches/unapplied/server/Fix-DamageCause-for-Falling-Blocks.patch b/patches/server/Fix-DamageCause-for-Falling-Blocks.patch similarity index 100% rename from patches/unapplied/server/Fix-DamageCause-for-Falling-Blocks.patch rename to patches/server/Fix-DamageCause-for-Falling-Blocks.patch diff --git a/patches/unapplied/server/Fix-EntityArgument-suggestion-permissions-to-align-w.patch b/patches/server/Fix-EntityArgument-suggestion-permissions-to-align-w.patch similarity index 100% rename from patches/unapplied/server/Fix-EntityArgument-suggestion-permissions-to-align-w.patch rename to patches/server/Fix-EntityArgument-suggestion-permissions-to-align-w.patch diff --git a/patches/unapplied/server/Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch b/patches/server/Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch similarity index 98% rename from patches/unapplied/server/Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch rename to patches/server/Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch index 2d92c76bd9..a5b1caa1ef 100644 --- a/patches/unapplied/server/Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch +++ b/patches/server/Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch @@ -9,7 +9,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S pluginManager.callEvent(entityCombustEvent); if (!entityCombustEvent.isCancelled()) { this.setSecondsOnFire(entityCombustEvent.getDuration(), false); diff --git a/patches/unapplied/server/Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch b/patches/server/Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch similarity index 100% rename from patches/unapplied/server/Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch rename to patches/server/Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch diff --git a/patches/unapplied/server/Fix-HumanEntity-drop-not-updating-the-client-inv.patch b/patches/server/Fix-HumanEntity-drop-not-updating-the-client-inv.patch similarity index 100% rename from patches/unapplied/server/Fix-HumanEntity-drop-not-updating-the-client-inv.patch rename to patches/server/Fix-HumanEntity-drop-not-updating-the-client-inv.patch diff --git a/patches/unapplied/server/Fix-MC-157464-Prevent-sleeping-villagers-moving-towa.patch b/patches/server/Fix-MC-157464-Prevent-sleeping-villagers-moving-towa.patch similarity index 100% rename from patches/unapplied/server/Fix-MC-157464-Prevent-sleeping-villagers-moving-towa.patch rename to patches/server/Fix-MC-157464-Prevent-sleeping-villagers-moving-towa.patch diff --git a/patches/unapplied/server/Fix-NPE-on-Allay-stopDancing-while-not-dancing.patch b/patches/server/Fix-NPE-on-Allay-stopDancing-while-not-dancing.patch similarity index 100% rename from patches/unapplied/server/Fix-NPE-on-Allay-stopDancing-while-not-dancing.patch rename to patches/server/Fix-NPE-on-Allay-stopDancing-while-not-dancing.patch diff --git a/patches/unapplied/server/Fix-OfflinePlayer-getBedSpawnLocation.patch b/patches/server/Fix-OfflinePlayer-getBedSpawnLocation.patch similarity index 100% rename from patches/unapplied/server/Fix-OfflinePlayer-getBedSpawnLocation.patch rename to patches/server/Fix-OfflinePlayer-getBedSpawnLocation.patch diff --git a/patches/unapplied/server/Fix-SpawnEggMeta-get-setSpawnedType.patch b/patches/server/Fix-SpawnEggMeta-get-setSpawnedType.patch similarity index 94% rename from patches/unapplied/server/Fix-SpawnEggMeta-get-setSpawnedType.patch rename to patches/server/Fix-SpawnEggMeta-get-setSpawnedType.patch index 4f67a23f3f..87808178a4 100644 --- a/patches/unapplied/server/Fix-SpawnEggMeta-get-setSpawnedType.patch +++ b/patches/server/Fix-SpawnEggMeta-get-setSpawnedType.patch @@ -9,9 +9,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java @@ -0,0 +0,0 @@ public class CraftMetaSpawnEgg extends CraftMetaItem implements SpawnEggMeta { + public void setSpawnedType(EntityType type) { throw new UnsupportedOperationException("Must change item type to set spawned type"); } - + // Paper start + @Override + public EntityType getCustomSpawnedType() { @@ -36,7 +36,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + } + // Paper end -+ + @Override - boolean equalsCommon(CraftMetaItem meta) { - if (!super.equalsCommon(meta)) { + public EntitySnapshot getSpawnedEntity() { diff --git a/patches/unapplied/server/Fix-Spigot-Config-not-using-commands.spam-exclusions.patch b/patches/server/Fix-Spigot-Config-not-using-commands.spam-exclusions.patch similarity index 100% rename from patches/unapplied/server/Fix-Spigot-Config-not-using-commands.spam-exclusions.patch rename to patches/server/Fix-Spigot-Config-not-using-commands.spam-exclusions.patch diff --git a/patches/unapplied/server/Fix-a-bunch-of-vanilla-bugs.patch b/patches/server/Fix-a-bunch-of-vanilla-bugs.patch similarity index 92% rename from patches/unapplied/server/Fix-a-bunch-of-vanilla-bugs.patch rename to patches/server/Fix-a-bunch-of-vanilla-bugs.patch index 2fe35717ca..2f34244be1 100644 --- a/patches/unapplied/server/Fix-a-bunch-of-vanilla-bugs.patch +++ b/patches/server/Fix-a-bunch-of-vanilla-bugs.patch @@ -66,9 +66,6 @@ https://bugs.mojang.com/browse/MC-174630 https://bugs.mojang.com/browse/MC-153086 Fix the beacon deactivation sound always playing when broken -https://bugs.mojang.com/browse/MC-259321 - Fix spawners checking max nearby entities with correct type - https://bugs.mojang.com/browse/MC-200092 Fix yaw being ignored for a player's first spawn pos @@ -135,7 +132,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel { } else { - AABB axisalignedbb = (new AABB(blockposition1, new BlockPos(blockposition1.getX(), this.getMaxBuildHeight(), blockposition1.getZ()))).inflate(3.0D); + AABB axisalignedbb = AABB.encapsulatingFullBlocks(blockposition1, new BlockPos(blockposition1.atY(this.getMaxBuildHeight()))).inflate(3.0D); List list = this.getEntitiesOfClass(LivingEntity.class, axisalignedbb, (entityliving) -> { - return entityliving != null && entityliving.isAlive() && this.canSeeSky(entityliving.blockPosition()); + return entityliving != null && entityliving.isAlive() && this.canSeeSky(entityliving.blockPosition()) && !entityliving.isSpectator(); // Paper - Fix lightning being able to hit spectators (MC-262422) @@ -422,49 +419,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 entity.level().gameEvent(entity, GameEvent.EQUIP, entity.position()); stack.shrink(1); } -diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/level/BaseSpawner.java -+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java -@@ -0,0 +0,0 @@ public abstract class BaseSpawner { - public int requiredPlayerRange = 16; - public int spawnRange = 4; - private int tickDelay = 0; // Paper -+ // Paper start - ported from 1.20.3 Fix MC-259321 -+ static net.minecraft.world.level.entity.EntityTypeTest forExactClass(Class clazz) { -+ return new net.minecraft.world.level.entity.EntityTypeTest<>() { -+ @Nullable -+ @Override -+ public T tryCast(B entity) { -+ return (T)(clazz.equals(entity.getClass()) ? entity : null); -+ } -+ -+ @Override -+ public Class getBaseClass() { -+ return clazz; -+ } -+ }; -+ } -+ // Paper end - - public BaseSpawner() {} - -@@ -0,0 +0,0 @@ public abstract class BaseSpawner { - return; - } - -- int k = world.getEntitiesOfClass(entity.getClass(), (new AABB((double) pos.getX(), (double) pos.getY(), (double) pos.getZ(), (double) (pos.getX() + 1), (double) (pos.getY() + 1), (double) (pos.getZ() + 1))).inflate((double) this.spawnRange)).size(); -+ int k = world.getEntities(forExactClass(entity.getClass()), (new AABB((double) pos.getX(), (double) pos.getY(), (double) pos.getZ(), (double) (pos.getX() + 1), (double) (pos.getY() + 1), (double) (pos.getZ() + 1))).inflate((double) this.spawnRange), net.minecraft.world.entity.EntitySelector.NO_SPECTATORS).size(); // Paper - Fix MC-259321 (only count exact entity types for nearby checks) - - if (k >= this.maxNearbyEntities) { - this.delay(world, pos); diff --git a/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java b/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java +++ b/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java @@ -0,0 +0,0 @@ public class AzaleaBlock extends BushBlock implements BonemealableBlock { public void performBonemeal(ServerLevel world, RandomSource random, BlockPos pos, BlockState state) { - TREE_GROWER.growTree(world, world.getChunkSource().getGenerator(), pos, state, random); + TreeGrower.AZALEA.growTree(world, world.getChunkSource().getGenerator(), pos, state, random); } + + // Paper start - Fix MC-224454 diff --git a/patches/unapplied/server/Fix-a-couple-of-upstream-bed-issues.patch b/patches/server/Fix-a-couple-of-upstream-bed-issues.patch similarity index 100% rename from patches/unapplied/server/Fix-a-couple-of-upstream-bed-issues.patch rename to patches/server/Fix-a-couple-of-upstream-bed-issues.patch diff --git a/patches/unapplied/server/Fix-advancement-triggers-for-entity-damage.patch b/patches/server/Fix-advancement-triggers-for-entity-damage.patch similarity index 100% rename from patches/unapplied/server/Fix-advancement-triggers-for-entity-damage.patch rename to patches/server/Fix-advancement-triggers-for-entity-damage.patch diff --git a/patches/unapplied/server/Fix-async-entity-add-due-to-fungus-trees.patch b/patches/server/Fix-async-entity-add-due-to-fungus-trees.patch similarity index 100% rename from patches/unapplied/server/Fix-async-entity-add-due-to-fungus-trees.patch rename to patches/server/Fix-async-entity-add-due-to-fungus-trees.patch diff --git a/patches/unapplied/server/Fix-beehives-generating-from-using-bonemeal.patch b/patches/server/Fix-beehives-generating-from-using-bonemeal.patch similarity index 100% rename from patches/unapplied/server/Fix-beehives-generating-from-using-bonemeal.patch rename to patches/server/Fix-beehives-generating-from-using-bonemeal.patch diff --git a/patches/unapplied/server/Fix-block-place-logic.patch b/patches/server/Fix-block-place-logic.patch similarity index 95% rename from patches/unapplied/server/Fix-block-place-logic.patch rename to patches/server/Fix-block-place-logic.patch index 3c5f8891d2..70fa38293e 100644 --- a/patches/unapplied/server/Fix-block-place-logic.patch +++ b/patches/server/Fix-block-place-logic.patch @@ -35,8 +35,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - record.setCount(1); - } - -- tileentityjukebox.setFirstItem(record); -+ tileentityjukebox.setFirstItem(this.copy()); // Paper - sync this with record item, jukebox has now an inventory +- tileentityjukebox.setTheItem(record); ++ tileentityjukebox.setTheItem(this.copy()); // Paper - sync this with record item, jukebox has now an inventory world.gameEvent(GameEvent.BLOCK_CHANGE, blockposition, GameEvent.Context.of(entityhuman, world.getBlockState(blockposition))); } diff --git a/patches/unapplied/server/Fix-certain-inventories-returning-null-Locations.patch b/patches/server/Fix-certain-inventories-returning-null-Locations.patch similarity index 100% rename from patches/unapplied/server/Fix-certain-inventories-returning-null-Locations.patch rename to patches/server/Fix-certain-inventories-returning-null-Locations.patch diff --git a/patches/unapplied/server/Fix-concurrenct-access-to-lookups-field-in-RegistryO.patch b/patches/server/Fix-concurrenct-access-to-lookups-field-in-RegistryO.patch similarity index 100% rename from patches/unapplied/server/Fix-concurrenct-access-to-lookups-field-in-RegistryO.patch rename to patches/server/Fix-concurrenct-access-to-lookups-field-in-RegistryO.patch diff --git a/patches/unapplied/server/Fix-crash-relating-to-bad-recipes-in-furnace-like-ti.patch b/patches/server/Fix-crash-relating-to-bad-recipes-in-furnace-like-ti.patch similarity index 100% rename from patches/unapplied/server/Fix-crash-relating-to-bad-recipes-in-furnace-like-ti.patch rename to patches/server/Fix-crash-relating-to-bad-recipes-in-furnace-like-ti.patch diff --git a/patches/unapplied/server/Fix-custom-piglin-loved-items.patch b/patches/server/Fix-custom-piglin-loved-items.patch similarity index 100% rename from patches/unapplied/server/Fix-custom-piglin-loved-items.patch rename to patches/server/Fix-custom-piglin-loved-items.patch diff --git a/patches/unapplied/server/Fix-demo-flag-not-enabling-demo-mode.patch b/patches/server/Fix-demo-flag-not-enabling-demo-mode.patch similarity index 100% rename from patches/unapplied/server/Fix-demo-flag-not-enabling-demo-mode.patch rename to patches/server/Fix-demo-flag-not-enabling-demo-mode.patch diff --git a/patches/unapplied/server/Fix-force-opening-enchantment-tables.patch b/patches/server/Fix-force-opening-enchantment-tables.patch similarity index 100% rename from patches/unapplied/server/Fix-force-opening-enchantment-tables.patch rename to patches/server/Fix-force-opening-enchantment-tables.patch diff --git a/patches/unapplied/server/Fix-inconsistencies-in-dispense-events-regarding-sta.patch b/patches/server/Fix-inconsistencies-in-dispense-events-regarding-sta.patch similarity index 90% rename from patches/unapplied/server/Fix-inconsistencies-in-dispense-events-regarding-sta.patch rename to patches/server/Fix-inconsistencies-in-dispense-events-regarding-sta.patch index 4e1b20a4c2..8125524686 100644 --- a/patches/unapplied/server/Fix-inconsistencies-in-dispense-events-regarding-sta.patch +++ b/patches/server/Fix-inconsistencies-in-dispense-events-regarding-sta.patch @@ -76,7 +76,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem()); @@ -0,0 +0,0 @@ public class BoatDispenseItemBehavior extends DefaultDispenseItemBehavior { - + EntityType.createDefaultStackConfig(worldserver, stack, (Player) null).accept(object); ((Boat) object).setVariant(this.type); ((Boat) object).setYRot(enumdirection.toYRot()); - if (!worldserver.addFreshEntity((Entity) object)) stack.grow(1); // CraftBukkit @@ -334,6 +334,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector(x, y, z)); if (!DispenserBlock.eventFired) { @@ -0,0 +0,0 @@ public interface DispenseItemBehavior { + return stack; + } + ++ boolean shrink = true; // Paper + if (!event.getItem().equals(craftItem)) { + // Chain to handler for new item + ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); +@@ -0,0 +0,0 @@ public interface DispenseItemBehavior { // CraftBukkit start org.bukkit.block.Block bukkitBlock = CraftBlock.at(worldserver, pointer.pos()); @@ -342,6 +350,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(blockposition.getX(), blockposition.getY(), blockposition.getZ())); if (!DispenserBlock.eventFired) { +@@ -0,0 +0,0 @@ public interface DispenseItemBehavior { + return stack; + } + ++ boolean shrink = true; // Paper + if (!event.getItem().equals(craftItem)) { ++ shrink = false; // Paper - shrink below (this was actually missing and should be here, added it commented out just for less confusion) + // Chain to handler for new item + ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); + DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem()); @@ -0,0 +0,0 @@ public interface DispenseItemBehavior { BlockPos blockposition = pointer.pos().relative((Direction) pointer.state().getValue(DispenserBlock.FACING)); // CraftBukkit start @@ -351,6 +369,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector(0, 0, 0)); if (!DispenserBlock.eventFired) { +@@ -0,0 +0,0 @@ public interface DispenseItemBehavior { + return stack; + } + ++ boolean shrink = true; // Paper + if (!event.getItem().equals(craftItem)) { + // Chain to handler for new item + ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); @@ -0,0 +0,0 @@ public interface DispenseItemBehavior { // CraftBukkit start // EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(worldserver, (double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, (EntityLiving) null); @@ -395,6 +421,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(blockposition.getX(), blockposition.getY(), blockposition.getZ())); if (!DispenserBlock.eventFired) { @@ -0,0 +0,0 @@ public interface DispenseItemBehavior { + } + + if (event.isCancelled()) { ++ // stack.grow(1); // Paper - shrink below (this was actually missing and should be here, added it commented out just for less confusion) + return stack; + } + ++ boolean shrink = true; // Paper + if (!event.getItem().equals(craftItem)) { + // Chain to handler for new item + ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); +@@ -0,0 +0,0 @@ public interface DispenseItemBehavior { // CraftBukkit start org.bukkit.block.Block bukkitBlock = CraftBlock.at(worldserver, pointer.pos()); @@ -404,6 +442,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(blockposition.getX(), blockposition.getY(), blockposition.getZ())); if (!DispenserBlock.eventFired) { @@ -0,0 +0,0 @@ public interface DispenseItemBehavior { + return stack; + } + ++ boolean shrink = true; // Paper + if (!event.getItem().equals(craftItem)) { + // Chain to handler for new item + ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); +@@ -0,0 +0,0 @@ public interface DispenseItemBehavior { // CraftBukkit start org.bukkit.block.Block bukkitBlock = CraftBlock.at(worldserver, pointer.pos()); @@ -412,6 +458,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(blockposition.getX(), blockposition.getY(), blockposition.getZ())); if (!DispenserBlock.eventFired) { +@@ -0,0 +0,0 @@ public interface DispenseItemBehavior { + return stack; + } + ++ boolean shrink = true; // Paper + if (!event.getItem().equals(craftItem)) { + // Chain to handler for new item + ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); diff --git a/src/main/java/net/minecraft/core/dispenser/ShulkerBoxDispenseBehavior.java b/src/main/java/net/minecraft/core/dispenser/ShulkerBoxDispenseBehavior.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/core/dispenser/ShulkerBoxDispenseBehavior.java @@ -492,8 +546,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem()); @@ -0,0 +0,0 @@ public class MinecartItem extends Item { - entityminecartabstract.setCustomName(stack.getHoverName()); - } + itemstack1 = CraftItemStack.asNMSCopy(event.getItem()); + AbstractMinecart entityminecartabstract = AbstractMinecart.createMinecart(worldserver, event.getVelocity().getX(), event.getVelocity().getY(), event.getVelocity().getZ(), ((MinecartItem) itemstack1.getItem()).type, itemstack1, (Player) null); - if (!worldserver.addFreshEntity(entityminecartabstract)) stack.grow(1); - // itemstack.shrink(1); // CraftBukkit - handled during event processing diff --git a/patches/unapplied/server/Fix-player-kick-on-shutdown.patch b/patches/server/Fix-player-kick-on-shutdown.patch similarity index 100% rename from patches/unapplied/server/Fix-player-kick-on-shutdown.patch rename to patches/server/Fix-player-kick-on-shutdown.patch diff --git a/patches/unapplied/server/Fix-plugin-loggers-on-server-shutdown.patch b/patches/server/Fix-plugin-loggers-on-server-shutdown.patch similarity index 100% rename from patches/unapplied/server/Fix-plugin-loggers-on-server-shutdown.patch rename to patches/server/Fix-plugin-loggers-on-server-shutdown.patch diff --git a/patches/unapplied/server/Fix-spigot-sound-playing-for-BlockItem-ItemStacks.patch b/patches/server/Fix-spigot-sound-playing-for-BlockItem-ItemStacks.patch similarity index 100% rename from patches/unapplied/server/Fix-spigot-sound-playing-for-BlockItem-ItemStacks.patch rename to patches/server/Fix-spigot-sound-playing-for-BlockItem-ItemStacks.patch diff --git a/patches/server/Fix-suggest-command-message-for-brigadier-syntax-exc.patch b/patches/server/Fix-suggest-command-message-for-brigadier-syntax-exc.patch new file mode 100644 index 0000000000..899514bf7c --- /dev/null +++ b/patches/server/Fix-suggest-command-message-for-brigadier-syntax-exc.patch @@ -0,0 +1,20 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: chickeneer +Date: Mon, 1 Aug 2022 20:13:02 -0500 +Subject: [PATCH] Fix suggest command message for brigadier syntax exceptions + +This is a bug accidentally introduced in upstream CB + +diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/commands/Commands.java ++++ b/src/main/java/net/minecraft/commands/Commands.java +@@ -0,0 +0,0 @@ public class Commands { + if (commandsyntaxexception.getInput() != null && commandsyntaxexception.getCursor() >= 0) { + int i = Math.min(commandsyntaxexception.getInput().length(), commandsyntaxexception.getCursor()); + MutableComponent ichatmutablecomponent = Component.empty().withStyle(ChatFormatting.GRAY).withStyle((chatmodifier) -> { +- return chatmodifier.withClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, label)); // CraftBukkit ++ return chatmodifier.withClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/" + label)); // CraftBukkit // Paper + }); + + if (i > 10) { diff --git a/patches/unapplied/server/Fix-text-display-error-on-spawn.patch b/patches/server/Fix-text-display-error-on-spawn.patch similarity index 100% rename from patches/unapplied/server/Fix-text-display-error-on-spawn.patch rename to patches/server/Fix-text-display-error-on-spawn.patch diff --git a/patches/unapplied/server/Fixes-and-additions-to-the-SpawnReason-API.patch b/patches/server/Fixes-and-additions-to-the-SpawnReason-API.patch similarity index 100% rename from patches/unapplied/server/Fixes-and-additions-to-the-SpawnReason-API.patch rename to patches/server/Fixes-and-additions-to-the-SpawnReason-API.patch diff --git a/patches/unapplied/server/Flying-Fall-Damage.patch b/patches/server/Flying-Fall-Damage.patch similarity index 100% rename from patches/unapplied/server/Flying-Fall-Damage.patch rename to patches/server/Flying-Fall-Damage.patch diff --git a/patches/unapplied/server/Friction-API.patch b/patches/server/Friction-API.patch similarity index 99% rename from patches/unapplied/server/Friction-API.patch rename to patches/server/Friction-API.patch index 66690c0e00..941739b432 100644 --- a/patches/unapplied/server/Friction-API.patch +++ b/patches/server/Friction-API.patch @@ -91,7 +91,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 nbt.putShort("Age", (short) this.age); nbt.putShort("PickupDelay", (short) this.pickupDelay); @@ -0,0 +0,0 @@ public class ItemEntity extends Entity implements TraceableEntity { - this.thrower = nbt.getUUID("Thrower"); + this.cachedThrower = null; } + // Paper start diff --git a/patches/unapplied/server/Ignore-impossible-spawn-tick.patch b/patches/server/Ignore-impossible-spawn-tick.patch similarity index 100% rename from patches/unapplied/server/Ignore-impossible-spawn-tick.patch rename to patches/server/Ignore-impossible-spawn-tick.patch diff --git a/patches/unapplied/server/Ignore-inline-definitions-of-trim-material-pattern.patch b/patches/server/Ignore-inline-definitions-of-trim-material-pattern.patch similarity index 100% rename from patches/unapplied/server/Ignore-inline-definitions-of-trim-material-pattern.patch rename to patches/server/Ignore-inline-definitions-of-trim-material-pattern.patch diff --git a/patches/unapplied/server/Improve-PortalEvents.patch b/patches/server/Improve-PortalEvents.patch similarity index 97% rename from patches/unapplied/server/Improve-PortalEvents.patch rename to patches/server/Improve-PortalEvents.patch index 8d6e463843..b65d1c7122 100644 --- a/patches/unapplied/server/Improve-PortalEvents.patch +++ b/patches/server/Improve-PortalEvents.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S Location enter = bukkitEntity.getLocation(); Location exit = CraftLocation.toBukkit(exitPosition, exitWorldServer.getWorld()); diff --git a/patches/unapplied/server/Improve-inlining-for-some-hot-BlockBehavior-and-Flui.patch b/patches/server/Improve-inlining-for-some-hot-BlockBehavior-and-Flui.patch similarity index 97% rename from patches/unapplied/server/Improve-inlining-for-some-hot-BlockBehavior-and-Flui.patch rename to patches/server/Improve-inlining-for-some-hot-BlockBehavior-and-Flui.patch index 0bed3e6278..166b497f8c 100644 --- a/patches/unapplied/server/Improve-inlining-for-some-hot-BlockBehavior-and-Flui.patch +++ b/patches/server/Improve-inlining-for-some-hot-BlockBehavior-and-Flui.patch @@ -38,7 +38,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } @@ -0,0 +0,0 @@ public abstract class BlockBehaviour implements FeatureElement { - return this.getBlock() == block; + return this.getBlock().builtInRegistryHolder().is(key); } - public FluidState getFluidState() { diff --git a/patches/unapplied/server/Improve-logging-and-errors.patch b/patches/server/Improve-logging-and-errors.patch similarity index 100% rename from patches/unapplied/server/Improve-logging-and-errors.patch rename to patches/server/Improve-logging-and-errors.patch diff --git a/patches/unapplied/server/ItemStack-damage-API.patch b/patches/server/ItemStack-damage-API.patch similarity index 100% rename from patches/unapplied/server/ItemStack-damage-API.patch rename to patches/server/ItemStack-damage-API.patch diff --git a/patches/unapplied/server/Limit-pet-look-distance.patch b/patches/server/Limit-pet-look-distance.patch similarity index 100% rename from patches/unapplied/server/Limit-pet-look-distance.patch rename to patches/server/Limit-pet-look-distance.patch diff --git a/patches/unapplied/server/Missing-eating-regain-reason.patch b/patches/server/Missing-eating-regain-reason.patch similarity index 100% rename from patches/unapplied/server/Missing-eating-regain-reason.patch rename to patches/server/Missing-eating-regain-reason.patch diff --git a/patches/unapplied/server/Missing-effect-cause.patch b/patches/server/Missing-effect-cause.patch similarity index 100% rename from patches/unapplied/server/Missing-effect-cause.patch rename to patches/server/Missing-effect-cause.patch diff --git a/patches/unapplied/server/Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch b/patches/server/Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch similarity index 100% rename from patches/unapplied/server/Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch rename to patches/server/Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch diff --git a/patches/unapplied/server/More-Teleport-API.patch b/patches/server/More-Teleport-API.patch similarity index 100% rename from patches/unapplied/server/More-Teleport-API.patch rename to patches/server/More-Teleport-API.patch diff --git a/patches/unapplied/server/More-accurate-isInOpenWater-impl.patch b/patches/server/More-accurate-isInOpenWater-impl.patch similarity index 100% rename from patches/unapplied/server/More-accurate-isInOpenWater-impl.patch rename to patches/server/More-accurate-isInOpenWater-impl.patch diff --git a/patches/unapplied/server/More-vanilla-friendly-methods-to-update-trades.patch b/patches/server/More-vanilla-friendly-methods-to-update-trades.patch similarity index 100% rename from patches/unapplied/server/More-vanilla-friendly-methods-to-update-trades.patch rename to patches/server/More-vanilla-friendly-methods-to-update-trades.patch diff --git a/patches/unapplied/server/Nameable-Banner-API.patch b/patches/server/Nameable-Banner-API.patch similarity index 100% rename from patches/unapplied/server/Nameable-Banner-API.patch rename to patches/server/Nameable-Banner-API.patch diff --git a/patches/unapplied/server/Optimise-recalcBlockCounts-for-empty-sections.patch b/patches/server/Optimise-recalcBlockCounts-for-empty-sections.patch similarity index 100% rename from patches/unapplied/server/Optimise-recalcBlockCounts-for-empty-sections.patch rename to patches/server/Optimise-recalcBlockCounts-for-empty-sections.patch diff --git a/patches/unapplied/server/Optimize-Hoppers.patch b/patches/server/Optimize-Hoppers.patch similarity index 100% rename from patches/unapplied/server/Optimize-Hoppers.patch rename to patches/server/Optimize-Hoppers.patch diff --git a/patches/unapplied/server/Player-Entity-Tracking-Events.patch b/patches/server/Player-Entity-Tracking-Events.patch similarity index 100% rename from patches/unapplied/server/Player-Entity-Tracking-Events.patch rename to patches/server/Player-Entity-Tracking-Events.patch diff --git a/patches/unapplied/server/Prevent-GameEvents-being-fired-from-unloaded-chunks.patch b/patches/server/Prevent-GameEvents-being-fired-from-unloaded-chunks.patch similarity index 100% rename from patches/unapplied/server/Prevent-GameEvents-being-fired-from-unloaded-chunks.patch rename to patches/server/Prevent-GameEvents-being-fired-from-unloaded-chunks.patch diff --git a/patches/unapplied/server/Prevent-causing-expired-keys-from-impacting-new-join.patch b/patches/server/Prevent-causing-expired-keys-from-impacting-new-join.patch similarity index 91% rename from patches/unapplied/server/Prevent-causing-expired-keys-from-impacting-new-join.patch rename to patches/server/Prevent-causing-expired-keys-from-impacting-new-join.patch index dd287273fc..a81e432950 100644 --- a/patches/unapplied/server/Prevent-causing-expired-keys-from-impacting-new-join.patch +++ b/patches/server/Prevent-causing-expired-keys-from-impacting-new-join.patch @@ -28,13 +28,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - private final AtomicReference lastChatTimeStamp; + private int knownMovePacketCount; @Nullable private RemoteChatSession chatSession; + private boolean hasLoggedExpiry = false; // Paper private SignedMessageChain.Decoder signedMessageDecoder; - private final LastSeenMessagesValidator lastSeenMessages; - private final MessageSignatureCache messageSignatureCache; + private final LastSeenMessagesValidator lastSeenMessages = new LastSeenMessagesValidator(20); + private final MessageSignatureCache messageSignatureCache = MessageSignatureCache.createDefault(); @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.disconnect(Component.translatable("multiplayer.disconnect.idling"), org.bukkit.event.player.PlayerKickEvent.Cause.IDLING); // Paper - kick event cause } @@ -55,5 +55,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.chatSession = session; + this.hasLoggedExpiry = false; // Paper this.signedMessageDecoder = session.createMessageDecoder(this.player.getUUID()); - this.chatMessageChain.append((executor) -> { + this.chatMessageChain.append(() -> { this.player.setChatSession(session); diff --git a/patches/unapplied/server/Prevent-compass-from-loading-chunks.patch b/patches/server/Prevent-compass-from-loading-chunks.patch similarity index 100% rename from patches/unapplied/server/Prevent-compass-from-loading-chunks.patch rename to patches/server/Prevent-compass-from-loading-chunks.patch diff --git a/patches/unapplied/server/Prevent-empty-items-from-being-added-to-world.patch b/patches/server/Prevent-empty-items-from-being-added-to-world.patch similarity index 100% rename from patches/unapplied/server/Prevent-empty-items-from-being-added-to-world.patch rename to patches/server/Prevent-empty-items-from-being-added-to-world.patch diff --git a/patches/unapplied/server/Prevent-entity-loading-causing-async-lookups.patch b/patches/server/Prevent-entity-loading-causing-async-lookups.patch similarity index 98% rename from patches/unapplied/server/Prevent-entity-loading-causing-async-lookups.patch rename to patches/server/Prevent-entity-loading-causing-async-lookups.patch index a979cfe696..50dbe41ba2 100644 --- a/patches/unapplied/server/Prevent-entity-loading-causing-async-lookups.patch +++ b/patches/server/Prevent-entity-loading-causing-async-lookups.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S public void baseTick() { this.level().getProfiler().push("entityBaseTick"); diff --git a/patches/unapplied/server/Properly-resend-entities.patch b/patches/server/Properly-resend-entities.patch similarity index 100% rename from patches/unapplied/server/Properly-resend-entities.patch rename to patches/server/Properly-resend-entities.patch diff --git a/patches/unapplied/server/Refresh-ProjectileSource-for-projectiles.patch b/patches/server/Refresh-ProjectileSource-for-projectiles.patch similarity index 91% rename from patches/unapplied/server/Refresh-ProjectileSource-for-projectiles.patch rename to patches/server/Refresh-ProjectileSource-for-projectiles.patch index b883c244fa..ecadb17bca 100644 --- a/patches/unapplied/server/Refresh-ProjectileSource-for-projectiles.patch +++ b/patches/server/Refresh-ProjectileSource-for-projectiles.patch @@ -17,8 +17,8 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { - public boolean valid; +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S + public boolean inWorld = false; public boolean generation; public int maxAirTicks = this.getDefaultMaxAirSupply(); // CraftBukkit - SPIGOT-6907: re-implement LivingEntity#setMaximumAir() + @Nullable // Paper @@ -61,16 +61,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (this.cachedOwner != null && !this.cachedOwner.isRemoved()) { + this.refreshProjectileSource(false); // Paper return this.cachedOwner; - } else if (this.ownerUUID != null && this.level() instanceof ServerLevel) { - this.cachedOwner = ((ServerLevel) this.level()).getEntity(this.ownerUUID); + } else { + if (this.ownerUUID != null) { @@ -0,0 +0,0 @@ public abstract class Projectile extends Entity implements TraceableEntity { + } + } + // Paper end ++ this.refreshProjectileSource(false); // Paper + return this.cachedOwner; } } - // Paper end -+ this.refreshProjectileSource(false); // Paper - return this.cachedOwner; - } else { - return null; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java b/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java diff --git a/patches/unapplied/server/Remove-CraftItemStack-setAmount-null-assignment.patch b/patches/server/Remove-CraftItemStack-setAmount-null-assignment.patch similarity index 100% rename from patches/unapplied/server/Remove-CraftItemStack-setAmount-null-assignment.patch rename to patches/server/Remove-CraftItemStack-setAmount-null-assignment.patch diff --git a/patches/unapplied/server/Remove-unnecessary-onTrackingStart-during-navigation.patch b/patches/server/Remove-unnecessary-onTrackingStart-during-navigation.patch similarity index 100% rename from patches/unapplied/server/Remove-unnecessary-onTrackingStart-during-navigation.patch rename to patches/server/Remove-unnecessary-onTrackingStart-during-navigation.patch diff --git a/patches/unapplied/server/Sanitize-Sent-BlockEntity-NBT.patch b/patches/server/Sanitize-Sent-BlockEntity-NBT.patch similarity index 100% rename from patches/unapplied/server/Sanitize-Sent-BlockEntity-NBT.patch rename to patches/server/Sanitize-Sent-BlockEntity-NBT.patch diff --git a/patches/unapplied/server/Send-block-entities-after-destroy-prediction.patch b/patches/server/Send-block-entities-after-destroy-prediction.patch similarity index 100% rename from patches/unapplied/server/Send-block-entities-after-destroy-prediction.patch rename to patches/server/Send-block-entities-after-destroy-prediction.patch diff --git a/patches/unapplied/server/Stop-large-look-changes-from-crashing-the-server.patch b/patches/server/Stop-large-look-changes-from-crashing-the-server.patch similarity index 100% rename from patches/unapplied/server/Stop-large-look-changes-from-crashing-the-server.patch rename to patches/server/Stop-large-look-changes-from-crashing-the-server.patch diff --git a/patches/unapplied/server/Sync-offhand-slot-in-menus.patch b/patches/server/Sync-offhand-slot-in-menus.patch similarity index 100% rename from patches/unapplied/server/Sync-offhand-slot-in-menus.patch rename to patches/server/Sync-offhand-slot-in-menus.patch diff --git a/patches/unapplied/server/Throw-exception-on-world-create-while-being-ticked.patch b/patches/server/Throw-exception-on-world-create-while-being-ticked.patch similarity index 99% rename from patches/unapplied/server/Throw-exception-on-world-create-while-being-ticked.patch rename to patches/server/Throw-exception-on-world-create-while-being-ticked.patch index a3b557b2bf..bafae85183 100644 --- a/patches/unapplied/server/Throw-exception-on-world-create-while-being-ticked.patch +++ b/patches/server/Throw-exception-on-world-create-while-being-ticked.patch @@ -43,7 +43,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + this.isIteratingOverLevels = false; // Paper this.profiler.popPush("connection"); - MinecraftTimings.connectionTimer.startTiming(); // Spigot + MinecraftTimings.connectionTimer.startTiming(); // Spigot // Paper diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/patches/unapplied/server/Track-projectile-source-for-fireworks-from-dispenser.patch b/patches/server/Track-projectile-source-for-fireworks-from-dispenser.patch similarity index 100% rename from patches/unapplied/server/Track-projectile-source-for-fireworks-from-dispenser.patch rename to patches/server/Track-projectile-source-for-fireworks-from-dispenser.patch diff --git a/patches/unapplied/server/Treat-sequence-violations-like-they-should-be.patch b/patches/server/Treat-sequence-violations-like-they-should-be.patch similarity index 100% rename from patches/unapplied/server/Treat-sequence-violations-like-they-should-be.patch rename to patches/server/Treat-sequence-violations-like-they-should-be.patch diff --git a/patches/unapplied/server/Update-the-flag-when-a-captured-block-state-is-outda.patch b/patches/server/Update-the-flag-when-a-captured-block-state-is-outda.patch similarity index 100% rename from patches/unapplied/server/Update-the-flag-when-a-captured-block-state-is-outda.patch rename to patches/server/Update-the-flag-when-a-captured-block-state-is-outda.patch diff --git a/patches/unapplied/server/Use-array-for-gamerule-storage.patch b/patches/server/Use-array-for-gamerule-storage.patch similarity index 100% rename from patches/unapplied/server/Use-array-for-gamerule-storage.patch rename to patches/server/Use-array-for-gamerule-storage.patch diff --git a/patches/unapplied/server/Use-single-player-info-update-packet-on-join.patch b/patches/server/Use-single-player-info-update-packet-on-join.patch similarity index 96% rename from patches/unapplied/server/Use-single-player-info-update-packet-on-join.patch rename to patches/server/Use-single-player-info-update-packet-on-join.patch index 511cea71c4..5d0e5551dd 100644 --- a/patches/unapplied/server/Use-single-player-info-update-packet-on-join.patch +++ b/patches/server/Use-single-player-info-update-packet-on-join.patch @@ -10,13 +10,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.signedMessageDecoder = session.createMessageDecoder(this.player.getUUID()); - this.chatMessageChain.append((executor) -> { + this.chatMessageChain.append(() -> { this.player.setChatSession(session); - this.server.getPlayerList().broadcastAll(new ClientboundPlayerInfoUpdatePacket(EnumSet.of(ClientboundPlayerInfoUpdatePacket.Action.INITIALIZE_CHAT), List.of(this.player))); + this.server.getPlayerList().broadcastAll(new ClientboundPlayerInfoUpdatePacket(EnumSet.of(ClientboundPlayerInfoUpdatePacket.Action.INITIALIZE_CHAT), List.of(this.player)), this.player); // Paper - return CompletableFuture.completedFuture((Object) null); }); } + diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/patches/unapplied/server/Use-thread-safe-random-in-ServerLoginPacketListenerI.patch b/patches/server/Use-thread-safe-random-in-ServerLoginPacketListenerI.patch similarity index 77% rename from patches/unapplied/server/Use-thread-safe-random-in-ServerLoginPacketListenerI.patch rename to patches/server/Use-thread-safe-random-in-ServerLoginPacketListenerI.patch index 283d116f94..670d9bf9f1 100644 --- a/patches/unapplied/server/Use-thread-safe-random-in-ServerLoginPacketListenerI.patch +++ b/patches/server/Use-thread-safe-random-in-ServerLoginPacketListenerI.patch @@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java @@ -0,0 +0,0 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, - static final Logger LOGGER = LogUtils.getLogger(); + private static final java.util.concurrent.ExecutorService authenticatorPool = java.util.concurrent.Executors.newCachedThreadPool(new com.google.common.util.concurrent.ThreadFactoryBuilder().setNameFormat("User Authenticator #%d").setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(LOGGER)).build()); // Paper - Cache authenticator threads private static final int MAX_TICKS_BEFORE_LOGIN = 600; private static final Component DISCONNECT_UNEXPECTED_QUERY = Component.translatable("multiplayer.disconnect.unexpected_query_response"); + private static final RandomSource RANDOM = new org.bukkit.craftbukkit.util.RandomSourceWrapper(new java.util.Random()); // Paper - This is called across threads, make safe diff --git a/patches/unapplied/server/Warn-on-plugins-accessing-faraway-chunks.patch b/patches/server/Warn-on-plugins-accessing-faraway-chunks.patch similarity index 100% rename from patches/unapplied/server/Warn-on-plugins-accessing-faraway-chunks.patch rename to patches/server/Warn-on-plugins-accessing-faraway-chunks.patch diff --git a/patches/unapplied/server/Win-Screen-API.patch b/patches/server/Win-Screen-API.patch similarity index 100% rename from patches/unapplied/server/Win-Screen-API.patch rename to patches/server/Win-Screen-API.patch diff --git a/patches/unapplied/server/check-global-player-list-where-appropriate.patch b/patches/server/check-global-player-list-where-appropriate.patch similarity index 100% rename from patches/unapplied/server/check-global-player-list-where-appropriate.patch rename to patches/server/check-global-player-list-where-appropriate.patch diff --git a/patches/unapplied/server/config-for-disabling-entity-tag-tags.patch b/patches/server/config-for-disabling-entity-tag-tags.patch similarity index 100% rename from patches/unapplied/server/config-for-disabling-entity-tag-tags.patch rename to patches/server/config-for-disabling-entity-tag-tags.patch diff --git a/patches/unapplied/server/ensure-reset-EnderDragon-boss-event-name.patch b/patches/server/ensure-reset-EnderDragon-boss-event-name.patch similarity index 100% rename from patches/unapplied/server/ensure-reset-EnderDragon-boss-event-name.patch rename to patches/server/ensure-reset-EnderDragon-boss-event-name.patch diff --git a/patches/unapplied/server/fix-Instruments.patch b/patches/server/fix-Instruments.patch similarity index 100% rename from patches/unapplied/server/fix-Instruments.patch rename to patches/server/fix-Instruments.patch diff --git a/patches/unapplied/server/fix-Jigsaw-block-kicking-user.patch b/patches/server/fix-Jigsaw-block-kicking-user.patch similarity index 100% rename from patches/unapplied/server/fix-Jigsaw-block-kicking-user.patch rename to patches/server/fix-Jigsaw-block-kicking-user.patch diff --git a/patches/unapplied/server/fix-MC-252817-green-map-markers-do-not-disappear.patch b/patches/server/fix-MC-252817-green-map-markers-do-not-disappear.patch similarity index 100% rename from patches/unapplied/server/fix-MC-252817-green-map-markers-do-not-disappear.patch rename to patches/server/fix-MC-252817-green-map-markers-do-not-disappear.patch diff --git a/patches/unapplied/server/fix-powder-snow-cauldrons-not-turning-to-water.patch b/patches/server/fix-powder-snow-cauldrons-not-turning-to-water.patch similarity index 57% rename from patches/unapplied/server/fix-powder-snow-cauldrons-not-turning-to-water.patch rename to patches/server/fix-powder-snow-cauldrons-not-turning-to-water.patch index 612c5af425..b09bf388a0 100644 --- a/patches/unapplied/server/fix-powder-snow-cauldrons-not-turning-to-water.patch +++ b/patches/server/fix-powder-snow-cauldrons-not-turning-to-water.patch @@ -24,8 +24,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } + @Deprecated // Paper - use #handleEntityOnFireInsideWithEvent - protected void handleEntityOnFireInside(BlockState state, Level world, BlockPos pos) { - LayeredCauldronBlock.lowerFillLevel(state, world, pos); + private void handleEntityOnFireInside(BlockState state, Level world, BlockPos pos) { + if (this.precipitationType == Biome.Precipitation.SNOW) { + LayeredCauldronBlock.lowerFillLevel((BlockState) Blocks.WATER_CAULDRON.defaultBlockState().setValue(LayeredCauldronBlock.LEVEL, (Integer) state.getValue(LayeredCauldronBlock.LEVEL)), world, pos); +@@ -0,0 +0,0 @@ public class LayeredCauldronBlock extends AbstractCauldronBlock { + } + } + // Paper start + protected boolean handleEntityOnFireInsideWithEvent(BlockState state, Level world, BlockPos pos, Entity entity) { @@ -35,22 +39,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public static void lowerFillLevel(BlockState state, Level world, BlockPos pos) { // CraftBukkit start -diff --git a/src/main/java/net/minecraft/world/level/block/PowderSnowCauldronBlock.java b/src/main/java/net/minecraft/world/level/block/PowderSnowCauldronBlock.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/level/block/PowderSnowCauldronBlock.java -+++ b/src/main/java/net/minecraft/world/level/block/PowderSnowCauldronBlock.java -@@ -0,0 +0,0 @@ public class PowderSnowCauldronBlock extends LayeredCauldronBlock { - } - - @Override -+ @Deprecated // Paper - use #handleEntityOnFireInsideWithEvent - protected void handleEntityOnFireInside(BlockState state, Level world, BlockPos pos) { - lowerFillLevel(Blocks.WATER_CAULDRON.defaultBlockState().setValue(LEVEL, state.getValue(LEVEL)), world, pos); - } -+ // Paper - replace powdered snow with water (taken from #handleEntityOnFireInside) -+ @Override -+ protected boolean handleEntityOnFireInsideWithEvent(BlockState state, Level world, BlockPos pos, net.minecraft.world.entity.Entity entity) { -+ return super.handleEntityOnFireInsideWithEvent(Blocks.WATER_CAULDRON.defaultBlockState().setValue(LEVEL, state.getValue(LEVEL)), world, pos, entity); -+ } -+ // Paper end - } diff --git a/patches/unapplied/server/fixed-entity-vehicle-collision-event-not-called.patch b/patches/server/fixed-entity-vehicle-collision-event-not-called.patch similarity index 94% rename from patches/unapplied/server/fixed-entity-vehicle-collision-event-not-called.patch rename to patches/server/fixed-entity-vehicle-collision-event-not-called.patch index 0f9ec24850..eea7887a17 100644 --- a/patches/unapplied/server/fixed-entity-vehicle-collision-event-not-called.patch +++ b/patches/server/fixed-entity-vehicle-collision-event-not-called.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.j index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java -@@ -0,0 +0,0 @@ public abstract class AbstractMinecart extends Entity { +@@ -0,0 +0,0 @@ public abstract class AbstractMinecart extends VehicleEntity { @Override public boolean canCollideWith(Entity other) { diff --git a/patches/unapplied/server/optimized-dirt-and-snow-spreading.patch b/patches/server/optimized-dirt-and-snow-spreading.patch similarity index 98% rename from patches/unapplied/server/optimized-dirt-and-snow-spreading.patch rename to patches/server/optimized-dirt-and-snow-spreading.patch index 3bfafdd9f9..439d917c04 100644 --- a/patches/unapplied/server/optimized-dirt-and-snow-spreading.patch +++ b/patches/server/optimized-dirt-and-snow-spreading.patch @@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (iblockdata1.is(Blocks.SNOW) && (Integer) iblockdata1.getValue(SnowLayerBlock.LAYERS) == 1) { return true; @@ -0,0 +0,0 @@ public abstract class SpreadingSnowyDirtBlock extends SnowyDirtBlock { - } + protected abstract MapCodec codec(); private static boolean canPropagate(BlockState state, LevelReader world, BlockPos pos) { + // Paper start diff --git a/patches/unapplied/server/remove-duplicate-animate-packet-for-records.patch b/patches/server/remove-duplicate-animate-packet-for-records.patch similarity index 100% rename from patches/unapplied/server/remove-duplicate-animate-packet-for-records.patch rename to patches/server/remove-duplicate-animate-packet-for-records.patch diff --git a/patches/unapplied/server/use-BlockFormEvent-for-mud-converting-into-clay.patch b/patches/server/use-BlockFormEvent-for-mud-converting-into-clay.patch similarity index 100% rename from patches/unapplied/server/use-BlockFormEvent-for-mud-converting-into-clay.patch rename to patches/server/use-BlockFormEvent-for-mud-converting-into-clay.patch diff --git a/patches/unapplied/server/Add-some-minimal-debug-information-to-chat-packet-er.patch b/patches/unapplied/server/Add-some-minimal-debug-information-to-chat-packet-er.patch deleted file mode 100644 index 61799f4c4a..0000000000 --- a/patches/unapplied/server/Add-some-minimal-debug-information-to-chat-packet-er.patch +++ /dev/null @@ -1,20 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shane Freeder -Date: Wed, 6 Jul 2022 05:52:22 +0100 -Subject: [PATCH] Add some minimal debug information to chat packet errors - -TODO: potentially add some kick leeway - -diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - - private Optional tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) { - if (!this.updateChatOrder(timestamp)) { -- ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}'", this.player.getName().getString(), message); -+ ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}': {} > {}", this.player.getName().getString(), message, this.lastChatTimeStamp.get().getEpochSecond(), timestamp.getEpochSecond()); // Paper - this.server.scheduleOnMain(() -> { // Paper - push to main - this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat"), org.bukkit.event.player.PlayerKickEvent.Cause.OUT_OF_ORDER_CHAT); // Paper - kick event causes - }); // Paper - push to main diff --git a/patches/unapplied/server/Fix-suggest-command-message-for-brigadier-syntax-exc.patch b/patches/unapplied/server/Fix-suggest-command-message-for-brigadier-syntax-exc.patch deleted file mode 100644 index 10fbab3adb..0000000000 --- a/patches/unapplied/server/Fix-suggest-command-message-for-brigadier-syntax-exc.patch +++ /dev/null @@ -1,20 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: chickeneer -Date: Mon, 1 Aug 2022 20:13:02 -0500 -Subject: [PATCH] Fix suggest command message for brigadier syntax exceptions - -This is a bug accidentally introduced in upstream CB - -diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/commands/Commands.java -+++ b/src/main/java/net/minecraft/commands/Commands.java -@@ -0,0 +0,0 @@ public class Commands { - if (commandsyntaxexception.getInput() != null && commandsyntaxexception.getCursor() >= 0) { - int j = Math.min(commandsyntaxexception.getInput().length(), commandsyntaxexception.getCursor()); - MutableComponent ichatmutablecomponent = Component.empty().withStyle(ChatFormatting.GRAY).withStyle((chatmodifier) -> { -- return chatmodifier.withClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, label)); // CraftBukkit -+ return chatmodifier.withClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/" + label)); // CraftBukkit // Paper - }); - - if (j > 10) {