From 236eabd7517323dac69c4b0bf0a3a51db40c0f57 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Wed, 7 Jun 2023 17:54:54 -0700 Subject: [PATCH] some more patches --- ...0529-TODO-Registry-Modification-API.patch} | 0 .../0530-Add-StructuresLocateEvent.patch} | 2 +- ...-for-requiring-a-player-participant.patch} | 12 ++--- ...leHitEvent-call-when-fireballs-dead.patch} | 2 +- ...nent-with-empty-text-instead-of-thr.patch} | 2 +- ...534-Make-schedule-command-per-world.patch} | 4 +- ...535-Configurable-max-leash-distance.patch} | 10 ++-- ...536-Implement-BlockPreDispenseEvent.patch} | 6 +-- ...ng-of-PlayerChangeBeaconEffectEvent.patch} | 2 +- ...e-for-always-placing-the-dragon-egg.patch} | 6 +-- ...-PlayerStonecutterRecipeSelectEvent.patch} | 4 +- ...eash-variable-to-EntityUnleashEvent.patch} | 54 +++++++++---------- ...shield-blocking-on-dimension-change.patch} | 6 +-- .../0542-add-DragonEggFormEvent.patch} | 10 ++-- .../0543-EntityMoveEvent.patch} | 28 +++++----- ...isable-pathfinding-updates-on-block.patch} | 6 +-- .../0545-Inline-shift-direction-fields.patch} | 14 ++--- ...-adding-items-to-BlockDropItemEvent.patch} | 6 +-- ...inThreadExecutor-to-BukkitScheduler.patch} | 0 ...entity-allow-attribute-registration.patch} | 2 +- ...ix-dead-slime-setSize-invincibility.patch} | 0 ...pes-should-return-an-immutable-list.patch} | 0 ...port-for-hex-color-codes-in-console.patch} | 4 +- .../0552-Expose-Tracked-Players.patch} | 2 +- ...3-Remove-streams-from-SensorNearest.patch} | 0 ...er-exception-on-empty-JsonList-file.patch} | 0 .../0555-Improve-ServerGUI.patch} | 0 ...556-fix-converting-txt-to-json-file.patch} | 4 +- .../0557-Add-worldborder-events.patch} | 0 .../0558-added-PlayerNameEntityEvent.patch} | 22 +++----- ...grindstones-from-overstacking-items.patch} | 2 +- .../0560-Add-recipe-to-cook-events.patch} | 2 +- .../0561-Add-Block-isValidTool.patch} | 2 +- ...using-signs-inside-spawn-protection.patch} | 8 +-- .../0563-Expand-world-key-API.patch} | 6 +-- ...ternative-constructor-for-Rotations.patch} | 0 .../0565-Item-Rarity-API.patch} | 2 +- ...py-TESign-isEditable-from-snapshots.patch} | 6 +-- ...d-item-when-player-has-disconnected.patch} | 4 +- ...elist-use-configurable-kick-message.patch} | 4 +- ...gnore-result-of-PlayerEditBookEvent.patch} | 4 +- .../0570-Expose-protocol-version.patch} | 2 +- ...ab-completions-for-brigadier-comman.patch} | 2 +- ...sure-plate-EntityInteractEvent-for-i.patch | 19 ------- 44 files changed, 121 insertions(+), 150 deletions(-) rename patches/{unapplied/server/0546-TODO-Registry-Modification-API.patch => server/0529-TODO-Registry-Modification-API.patch} (100%) rename patches/{unapplied/server/0547-Add-StructuresLocateEvent.patch => server/0530-Add-StructuresLocateEvent.patch} (99%) rename patches/{unapplied/server/0548-Collision-option-for-requiring-a-player-participant.patch => server/0531-Collision-option-for-requiring-a-player-participant.patch} (84%) rename patches/{unapplied/server/0549-Remove-ProjectileHitEvent-call-when-fireballs-dead.patch => server/0532-Remove-ProjectileHitEvent-call-when-fireballs-dead.patch} (92%) rename patches/{unapplied/server/0550-Return-chat-component-with-empty-text-instead-of-thr.patch => server/0533-Return-chat-component-with-empty-text-instead-of-thr.patch} (92%) rename patches/{unapplied/server/0551-Make-schedule-command-per-world.patch => server/0534-Make-schedule-command-per-world.patch} (91%) rename patches/{unapplied/server/0552-Configurable-max-leash-distance.patch => server/0535-Configurable-max-leash-distance.patch} (62%) rename patches/{unapplied/server/0553-Implement-BlockPreDispenseEvent.patch => server/0536-Implement-BlockPreDispenseEvent.patch} (89%) rename patches/{unapplied/server/0554-Added-firing-of-PlayerChangeBeaconEffectEvent.patch => server/0537-Added-firing-of-PlayerChangeBeaconEffectEvent.patch} (95%) rename patches/{unapplied/server/0555-Add-toggle-for-always-placing-the-dragon-egg.patch => server/0538-Add-toggle-for-always-placing-the-dragon-egg.patch} (78%) rename patches/{unapplied/server/0556-Added-PlayerStonecutterRecipeSelectEvent.patch => server/0539-Added-PlayerStonecutterRecipeSelectEvent.patch} (95%) rename patches/{unapplied/server/0557-Add-dropLeash-variable-to-EntityUnleashEvent.patch => server/0540-Add-dropLeash-variable-to-EntityUnleashEvent.patch} (71%) rename patches/{unapplied/server/0558-Reset-shield-blocking-on-dimension-change.patch => server/0541-Reset-shield-blocking-on-dimension-change.patch} (73%) rename patches/{unapplied/server/0559-add-DragonEggFormEvent.patch => server/0542-add-DragonEggFormEvent.patch} (77%) rename patches/{unapplied/server/0560-EntityMoveEvent.patch => server/0543-EntityMoveEvent.patch} (63%) rename patches/{unapplied/server/0561-added-option-to-disable-pathfinding-updates-on-block.patch => server/0544-added-option-to-disable-pathfinding-updates-on-block.patch} (80%) rename patches/{unapplied/server/0562-Inline-shift-direction-fields.patch => server/0545-Inline-shift-direction-fields.patch} (79%) rename patches/{unapplied/server/0563-Allow-adding-items-to-BlockDropItemEvent.patch => server/0546-Allow-adding-items-to-BlockDropItemEvent.patch} (89%) rename patches/{unapplied/server/0564-Add-getMainThreadExecutor-to-BukkitScheduler.patch => server/0547-Add-getMainThreadExecutor-to-BukkitScheduler.patch} (100%) rename patches/{unapplied/server/0565-living-entity-allow-attribute-registration.patch => server/0548-living-entity-allow-attribute-registration.patch} (96%) rename patches/{unapplied/server/0566-fix-dead-slime-setSize-invincibility.patch => server/0549-fix-dead-slime-setSize-invincibility.patch} (100%) rename patches/{unapplied/server/0567-Merchant-getRecipes-should-return-an-immutable-list.patch => server/0550-Merchant-getRecipes-should-return-an-immutable-list.patch} (100%) rename patches/{unapplied/server/0568-Add-support-for-hex-color-codes-in-console.patch => server/0551-Add-support-for-hex-color-codes-in-console.patch} (99%) rename patches/{unapplied/server/0569-Expose-Tracked-Players.patch => server/0552-Expose-Tracked-Players.patch} (92%) rename patches/{unapplied/server/0570-Remove-streams-from-SensorNearest.patch => server/0553-Remove-streams-from-SensorNearest.patch} (100%) rename patches/{unapplied/server/0571-Throw-proper-exception-on-empty-JsonList-file.patch => server/0554-Throw-proper-exception-on-empty-JsonList-file.patch} (100%) rename patches/{unapplied/server/0572-Improve-ServerGUI.patch => server/0555-Improve-ServerGUI.patch} (100%) rename patches/{unapplied/server/0574-fix-converting-txt-to-json-file.patch => server/0556-fix-converting-txt-to-json-file.patch} (94%) rename patches/{unapplied/server/0575-Add-worldborder-events.patch => server/0557-Add-worldborder-events.patch} (100%) rename patches/{unapplied/server/0576-added-PlayerNameEntityEvent.patch => server/0558-added-PlayerNameEntityEvent.patch} (60%) rename patches/{unapplied/server/0577-Prevent-grindstones-from-overstacking-items.patch => server/0559-Prevent-grindstones-from-overstacking-items.patch} (94%) rename patches/{unapplied/server/0578-Add-recipe-to-cook-events.patch => server/0560-Add-recipe-to-cook-events.patch} (97%) rename patches/{unapplied/server/0579-Add-Block-isValidTool.patch => server/0561-Add-Block-isValidTool.patch} (87%) rename patches/{unapplied/server/0580-Allow-using-signs-inside-spawn-protection.patch => server/0562-Allow-using-signs-inside-spawn-protection.patch} (62%) rename patches/{unapplied/server/0581-Expand-world-key-API.patch => server/0563-Expand-world-key-API.patch} (93%) rename patches/{unapplied/server/0582-Add-fast-alternative-constructor-for-Rotations.patch => server/0564-Add-fast-alternative-constructor-for-Rotations.patch} (100%) rename patches/{unapplied/server/0583-Item-Rarity-API.patch => server/0565-Item-Rarity-API.patch} (96%) rename patches/{unapplied/server/0584-copy-TESign-isEditable-from-snapshots.patch => server/0566-copy-TESign-isEditable-from-snapshots.patch} (74%) rename patches/{unapplied/server/0585-Drop-carried-item-when-player-has-disconnected.patch => server/0567-Drop-carried-item-when-player-has-disconnected.patch} (88%) rename patches/{unapplied/server/0586-forced-whitelist-use-configurable-kick-message.patch => server/0568-forced-whitelist-use-configurable-kick-message.patch} (87%) rename patches/{unapplied/server/0587-Don-t-ignore-result-of-PlayerEditBookEvent.patch => server/0569-Don-t-ignore-result-of-PlayerEditBookEvent.patch} (86%) rename patches/{unapplied/server/0589-Expose-protocol-version.patch => server/0570-Expose-protocol-version.patch} (91%) rename patches/{unapplied/server/0590-Enhance-console-tab-completions-for-brigadier-comman.patch => server/0571-Enhance-console-tab-completions-for-brigadier-comman.patch} (99%) delete mode 100644 patches/unapplied/server/0573-stop-firing-pressure-plate-EntityInteractEvent-for-i.patch diff --git a/patches/unapplied/server/0546-TODO-Registry-Modification-API.patch b/patches/server/0529-TODO-Registry-Modification-API.patch similarity index 100% rename from patches/unapplied/server/0546-TODO-Registry-Modification-API.patch rename to patches/server/0529-TODO-Registry-Modification-API.patch diff --git a/patches/unapplied/server/0547-Add-StructuresLocateEvent.patch b/patches/server/0530-Add-StructuresLocateEvent.patch similarity index 99% rename from patches/unapplied/server/0547-Add-StructuresLocateEvent.patch rename to patches/server/0530-Add-StructuresLocateEvent.patch index 61c53d9c4c..8e4426cd75 100644 --- a/patches/unapplied/server/0547-Add-StructuresLocateEvent.patch +++ b/patches/server/0530-Add-StructuresLocateEvent.patch @@ -47,7 +47,7 @@ index 0000000000000000000000000000000000000000..09837f6e6c6ab8a1df2aacdb86646993 + } +} diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java -index 56033c41c2be567d6787420d319d4603fc0a1d10..354d386940b5ee7c92708390b83db51c281660f4 100644 +index d19585f0833d13867f242768dc7ed952add87e05..3ef4e3c028761ca1656b823eda3cf015c16075cf 100644 --- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java @@ -121,6 +121,24 @@ public abstract class ChunkGenerator { diff --git a/patches/unapplied/server/0548-Collision-option-for-requiring-a-player-participant.patch b/patches/server/0531-Collision-option-for-requiring-a-player-participant.patch similarity index 84% rename from patches/unapplied/server/0548-Collision-option-for-requiring-a-player-participant.patch rename to patches/server/0531-Collision-option-for-requiring-a-player-participant.patch index 0cb0acd11d..a1835c54f1 100644 --- a/patches/unapplied/server/0548-Collision-option-for-requiring-a-player-participant.patch +++ b/patches/server/0531-Collision-option-for-requiring-a-player-participant.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Collision option for requiring a player participant diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 909d9da2e0b30d4bf187623a46695c86d67b2248..4dc8a8fcffddfc6673d5c161be1224d822ad3dab 100644 +index ebafdcbea42abde85c63ad4bbb426a811d3811e9..1f92d5dbaad1fb2bdfedb6c2044aa99a61388b21 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -1800,6 +1800,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1834,6 +1834,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { public void push(Entity entity) { if (!this.isPassengerOfSameVehicle(entity)) { if (!entity.noPhysics && !this.noPhysics) { @@ -17,19 +17,19 @@ index 909d9da2e0b30d4bf187623a46695c86d67b2248..4dc8a8fcffddfc6673d5c161be1224d8 double d1 = entity.getZ() - this.getZ(); double d2 = Mth.absMax(d0, d1); diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java -index a2e3b3a60ec31f2399f733ab1931c060ced7ae6d..33dd6f9b3fde5bd19cfc6386dd9454df4a887489 100644 +index 1f909082eb123bfe37e1078962ee7d71c78a8194..b9ca93026797874c8fa2d68e7177ca1fc0724da7 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java -@@ -833,6 +833,7 @@ public abstract class AbstractMinecart extends Entity { +@@ -840,6 +840,7 @@ public abstract class AbstractMinecart extends Entity { public void push(Entity entity) { - if (!this.level.isClientSide) { + if (!this.level().isClientSide) { if (!entity.noPhysics && !this.noPhysics) { + if (!this.level.paperConfig().collisions.allowVehicleCollisions && this.level.paperConfig().collisions.onlyPlayersCollide && !(entity instanceof Player)) return; // Paper if (!this.hasPassenger(entity)) { // CraftBukkit start VehicleEntityCollisionEvent collisionEvent = new VehicleEntityCollisionEvent((Vehicle) this.getBukkitEntity(), entity.getBukkitEntity()); diff --git a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java -index b2ecd45588d930f6847d11d3fb3c5fb02abd7737..8b562ca6cc92c31c764aebf05d511e347cff8a83 100644 +index b978d5fb28ef1472bd890df0229cf7535ead6b00..9fd8c9b82ee6a2cf94a90d0acb42637a2fde7ad5 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java @@ -246,6 +246,7 @@ public class Boat extends Entity implements VariantHolder { diff --git a/patches/unapplied/server/0549-Remove-ProjectileHitEvent-call-when-fireballs-dead.patch b/patches/server/0532-Remove-ProjectileHitEvent-call-when-fireballs-dead.patch similarity index 92% rename from patches/unapplied/server/0549-Remove-ProjectileHitEvent-call-when-fireballs-dead.patch rename to patches/server/0532-Remove-ProjectileHitEvent-call-when-fireballs-dead.patch index 1eb191cb45..3f7c51ddfe 100644 --- a/patches/unapplied/server/0549-Remove-ProjectileHitEvent-call-when-fireballs-dead.patch +++ b/patches/server/0532-Remove-ProjectileHitEvent-call-when-fireballs-dead.patch @@ -7,7 +7,7 @@ The duplicate ProjectileHitEvent in EntityFireball was removed. The event was always called before the duplicate call. diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java -index cf87b51d1914274bd3e32a387629be7b04cf1734..2096e8a0bdbcfc865f175f3a01ab688542481531 100644 +index b430d508e69de01d8271a73e0ed41865dcf012c4..6c9a8f062f989db022154155e8a05b334a0510da 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java +++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java @@ -88,7 +88,7 @@ public abstract class AbstractHurtingProjectile extends Projectile { diff --git a/patches/unapplied/server/0550-Return-chat-component-with-empty-text-instead-of-thr.patch b/patches/server/0533-Return-chat-component-with-empty-text-instead-of-thr.patch similarity index 92% rename from patches/unapplied/server/0550-Return-chat-component-with-empty-text-instead-of-thr.patch rename to patches/server/0533-Return-chat-component-with-empty-text-instead-of-thr.patch index db35047751..a508906e35 100644 --- a/patches/unapplied/server/0550-Return-chat-component-with-empty-text-instead-of-thr.patch +++ b/patches/server/0533-Return-chat-component-with-empty-text-instead-of-thr.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Return chat component with empty text instead of throwing diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java -index 75f809ee3d46971ce2ae9ec5bc89aeec1e85fdfb..ec1da07fdfc86c2905766886f6f922320c73fb6a 100644 +index 4ac91ba7dc754b120189fd32d24076d51b17d7c6..19b0ae77e99c972159cb236403f420baa0cc46e0 100644 --- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java +++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java @@ -89,7 +89,12 @@ public abstract class AbstractContainerMenu { diff --git a/patches/unapplied/server/0551-Make-schedule-command-per-world.patch b/patches/server/0534-Make-schedule-command-per-world.patch similarity index 91% rename from patches/unapplied/server/0551-Make-schedule-command-per-world.patch rename to patches/server/0534-Make-schedule-command-per-world.patch index 60f5d1fc66..8e29559590 100644 --- a/patches/unapplied/server/0551-Make-schedule-command-per-world.patch +++ b/patches/server/0534-Make-schedule-command-per-world.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Make schedule command per-world diff --git a/src/main/java/net/minecraft/server/commands/ScheduleCommand.java b/src/main/java/net/minecraft/server/commands/ScheduleCommand.java -index 2c6d5f22ef41601f863b11e2e626621d8047dd14..1eb93353766208f52e385ab445cfb754e42b7f3d 100644 +index e4b4cea196cc3274317cd93351ec50196d318ee9..20d1cf83438272ad774a805b4b3b87546485c787 100644 --- a/src/main/java/net/minecraft/server/commands/ScheduleCommand.java +++ b/src/main/java/net/minecraft/server/commands/ScheduleCommand.java @@ -31,7 +31,7 @@ public class ScheduleCommand { @@ -17,7 +17,7 @@ index 2c6d5f22ef41601f863b11e2e626621d8047dd14..1eb93353766208f52e385ab445cfb754 }; public ScheduleCommand() {} -@@ -82,7 +82,7 @@ public class ScheduleCommand { +@@ -86,7 +86,7 @@ public class ScheduleCommand { } private static int remove(CommandSourceStack source, String eventName) throws CommandSyntaxException { diff --git a/patches/unapplied/server/0552-Configurable-max-leash-distance.patch b/patches/server/0535-Configurable-max-leash-distance.patch similarity index 62% rename from patches/unapplied/server/0552-Configurable-max-leash-distance.patch rename to patches/server/0535-Configurable-max-leash-distance.patch index aad84993f9..69bb7838fd 100644 --- a/patches/unapplied/server/0552-Configurable-max-leash-distance.patch +++ b/patches/server/0535-Configurable-max-leash-distance.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Configurable max leash distance diff --git a/src/main/java/net/minecraft/world/entity/PathfinderMob.java b/src/main/java/net/minecraft/world/entity/PathfinderMob.java -index bffec7fdf49994f702ea4c378237dac0983d0a19..56d64f3836391fabfa9d3362d9bd62182ea6e290 100644 +index 5f3a14ca456e65894e824864ccf3cd5fabc9c6bd..d84f49457a759f0dd556df8a9634239b530e2761 100644 --- a/src/main/java/net/minecraft/world/entity/PathfinderMob.java +++ b/src/main/java/net/minecraft/world/entity/PathfinderMob.java @@ -48,7 +48,7 @@ public abstract class PathfinderMob extends Mob { @@ -13,8 +13,8 @@ index bffec7fdf49994f702ea4c378237dac0983d0a19..56d64f3836391fabfa9d3362d9bd6218 if (this instanceof TamableAnimal && ((TamableAnimal) this).isInSittingPose()) { - if (f > 10.0F) { -+ if (f > entity.level.paperConfig().misc.maxLeashDistance) { // Paper - this.level.getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit ++ if (f > entity.level().paperConfig().misc.maxLeashDistance) { // Paper + this.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit this.dropLeash(true, true); } @@ -57,7 +57,7 @@ public abstract class PathfinderMob extends Mob { @@ -22,7 +22,7 @@ index bffec7fdf49994f702ea4c378237dac0983d0a19..56d64f3836391fabfa9d3362d9bd6218 this.onLeashDistance(f); - if (f > 10.0F) { -+ if (f > entity.level.paperConfig().misc.maxLeashDistance) { // Paper - this.level.getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit ++ if (f > entity.level().paperConfig().misc.maxLeashDistance) { // Paper + this.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit this.dropLeash(true, true); this.goalSelector.disableControlFlag(Goal.Flag.MOVE); diff --git a/patches/unapplied/server/0553-Implement-BlockPreDispenseEvent.patch b/patches/server/0536-Implement-BlockPreDispenseEvent.patch similarity index 89% rename from patches/unapplied/server/0553-Implement-BlockPreDispenseEvent.patch rename to patches/server/0536-Implement-BlockPreDispenseEvent.patch index e7a3c4af5f..100c2aa944 100644 --- a/patches/unapplied/server/0553-Implement-BlockPreDispenseEvent.patch +++ b/patches/server/0536-Implement-BlockPreDispenseEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Implement BlockPreDispenseEvent diff --git a/src/main/java/net/minecraft/world/level/block/DispenserBlock.java b/src/main/java/net/minecraft/world/level/block/DispenserBlock.java -index 85c5319837295bd2f85baebfe8d6660b267f1d5f..8f55d0753fa26924235c943595f0d1a06a933a6f 100644 +index 9ec043ff2cd38e589066a3eb7f42834e4e7592cf..4720b884e1e311f44a012f1219fe648a411247b4 100644 --- a/src/main/java/net/minecraft/world/level/block/DispenserBlock.java +++ b/src/main/java/net/minecraft/world/level/block/DispenserBlock.java -@@ -93,6 +93,7 @@ public class DispenserBlock extends BaseEntityBlock { +@@ -92,6 +92,7 @@ public class DispenserBlock extends BaseEntityBlock { DispenseItemBehavior idispensebehavior = this.getDispenseMethod(itemstack); if (idispensebehavior != DispenseItemBehavior.NOOP) { @@ -17,7 +17,7 @@ index 85c5319837295bd2f85baebfe8d6660b267f1d5f..8f55d0753fa26924235c943595f0d1a0 tileentitydispenser.setItem(i, idispensebehavior.dispense(sourceblock, itemstack)); } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index df9c057391d28fb47b722d006aa0c828863ea6b2..1e4d8cc53941ead119769d16cc82db1a7be1f6da 100644 +index 12a8e9f41dfff700a8e5b8874cf1317e6d68e43a..79451f5aec55829f41670cb4366e6971d18c6ece 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -1936,5 +1936,11 @@ public class CraftEventFactory { diff --git a/patches/unapplied/server/0554-Added-firing-of-PlayerChangeBeaconEffectEvent.patch b/patches/server/0537-Added-firing-of-PlayerChangeBeaconEffectEvent.patch similarity index 95% rename from patches/unapplied/server/0554-Added-firing-of-PlayerChangeBeaconEffectEvent.patch rename to patches/server/0537-Added-firing-of-PlayerChangeBeaconEffectEvent.patch index 60fd6a36d4..ff2199df0b 100644 --- a/patches/unapplied/server/0554-Added-firing-of-PlayerChangeBeaconEffectEvent.patch +++ b/patches/server/0537-Added-firing-of-PlayerChangeBeaconEffectEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Added firing of PlayerChangeBeaconEffectEvent diff --git a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java -index 31c7fc4eb9fc2bf0be1e4c45758b116e8e007747..1ffbb43bfdb173689fdd9d2398b021846e0246fa 100644 +index 79fba896aabe1ff2a19f6c50f5dfdb351587e391..335d0a85378c04dd466fafd42048b2474c815cb9 100644 --- a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java +++ b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java @@ -158,13 +158,27 @@ public class BeaconMenu extends AbstractContainerMenu { diff --git a/patches/unapplied/server/0555-Add-toggle-for-always-placing-the-dragon-egg.patch b/patches/server/0538-Add-toggle-for-always-placing-the-dragon-egg.patch similarity index 78% rename from patches/unapplied/server/0555-Add-toggle-for-always-placing-the-dragon-egg.patch rename to patches/server/0538-Add-toggle-for-always-placing-the-dragon-egg.patch index c3ddac9816..76a5cc04c4 100644 --- a/patches/unapplied/server/0555-Add-toggle-for-always-placing-the-dragon-egg.patch +++ b/patches/server/0538-Add-toggle-for-always-placing-the-dragon-egg.patch @@ -5,15 +5,15 @@ Subject: [PATCH] Add toggle for always placing the dragon egg diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java -index ed0d1d6285556f0949a7ea81ad692b663ec191a7..1ee1b757b90ae0d080aa57f4186228a6f4279c1f 100644 +index 58823aeb8316628be716051b74307b01c37ad8a0..2be95e545ca85cf94b1e847ff452cd586c4eea05 100644 --- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java +++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java -@@ -370,7 +370,7 @@ public class EndDragonFight { +@@ -356,7 +356,7 @@ public class EndDragonFight { this.dragonEvent.setVisible(false); this.spawnExitPortal(true); this.spawnNewGateway(); - if (!this.previouslyKilled) { + if (this.level.paperConfig().entities.behavior.enderDragonsDeathAlwaysPlacesDragonEgg || !this.previouslyKilled) { // Paper - always place dragon egg - this.level.setBlockAndUpdate(this.level.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, EndPodiumFeature.END_PODIUM_LOCATION), Blocks.DRAGON_EGG.defaultBlockState()); + this.level.setBlockAndUpdate(this.level.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, EndPodiumFeature.getLocation(this.origin)), Blocks.DRAGON_EGG.defaultBlockState()); } diff --git a/patches/unapplied/server/0556-Added-PlayerStonecutterRecipeSelectEvent.patch b/patches/server/0539-Added-PlayerStonecutterRecipeSelectEvent.patch similarity index 95% rename from patches/unapplied/server/0556-Added-PlayerStonecutterRecipeSelectEvent.patch rename to patches/server/0539-Added-PlayerStonecutterRecipeSelectEvent.patch index 82a8049655..68ca096d98 100644 --- a/patches/unapplied/server/0556-Added-PlayerStonecutterRecipeSelectEvent.patch +++ b/patches/server/0539-Added-PlayerStonecutterRecipeSelectEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Added PlayerStonecutterRecipeSelectEvent Co-Authored-By: MiniDigger diff --git a/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java b/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java -index 24c31e96be460bcb5062a1fcf7f86c1affc4978c..7b4f8e897e9876cea1562cdf746a57940044987a 100644 +index 00f01ab2eff69c18b50ec07b7623af66c66a28b6..1b1f814770d1a906ed880df578845be2e9a14f46 100644 --- a/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java +++ b/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java @@ -62,7 +62,7 @@ public class StonecutterMenu extends AbstractContainerMenu { @@ -18,7 +18,7 @@ index 24c31e96be460bcb5062a1fcf7f86c1affc4978c..7b4f8e897e9876cea1562cdf746a5794 this.recipes = Lists.newArrayList(); this.input = ItemStack.EMPTY; this.slotUpdateListener = () -> { -@@ -156,7 +156,29 @@ public class StonecutterMenu extends AbstractContainerMenu { +@@ -160,7 +160,29 @@ public class StonecutterMenu extends AbstractContainerMenu { @Override public boolean clickMenuButton(net.minecraft.world.entity.player.Player player, int id) { if (this.isValidRecipeIndex(id)) { diff --git a/patches/unapplied/server/0557-Add-dropLeash-variable-to-EntityUnleashEvent.patch b/patches/server/0540-Add-dropLeash-variable-to-EntityUnleashEvent.patch similarity index 71% rename from patches/unapplied/server/0557-Add-dropLeash-variable-to-EntityUnleashEvent.patch rename to patches/server/0540-Add-dropLeash-variable-to-EntityUnleashEvent.patch index 4a3e11183b..6ca1342382 100644 --- a/patches/unapplied/server/0557-Add-dropLeash-variable-to-EntityUnleashEvent.patch +++ b/patches/server/0540-Add-dropLeash-variable-to-EntityUnleashEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add dropLeash variable to EntityUnleashEvent diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index fa9cc50488d5044e13a97fb4aa9269fec999ad88..608cce7fe11cc873299440895f1fff62bdfcba8a 100644 +index 76b2772fb79ebb4e0712d1e501c37fd14ea2fa62..1887b9cd309556eeacac2a5e5cd922560101fa72 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -1295,12 +1295,15 @@ public abstract class Mob extends LivingEntity implements Targeting { +@@ -1298,12 +1298,15 @@ public abstract class Mob extends LivingEntity implements Targeting { return InteractionResult.PASS; } else if (this.getLeashHolder() == player) { // CraftBukkit start - fire PlayerUnleashEntityEvent @@ -24,63 +24,63 @@ index fa9cc50488d5044e13a97fb4aa9269fec999ad88..608cce7fe11cc873299440895f1fff62 - this.dropLeash(true, !player.getAbilities().instabuild); + this.dropLeash(true, event.isDropLeash()); // Paper - drop leash variable this.gameEvent(GameEvent.ENTITY_INTERACT, player); - return InteractionResult.sidedSuccess(this.level.isClientSide); + return InteractionResult.sidedSuccess(this.level().isClientSide); } else { -@@ -1469,8 +1472,11 @@ public abstract class Mob extends LivingEntity implements Targeting { +@@ -1471,8 +1474,11 @@ public abstract class Mob extends LivingEntity implements Targeting { if (this.leashHolder != null) { if (!this.isAlive() || !this.leashHolder.isAlive()) { -- this.level.getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), (!this.isAlive()) ? UnleashReason.PLAYER_UNLEASH : UnleashReason.HOLDER_GONE)); // CraftBukkit +- this.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), (!this.isAlive()) ? UnleashReason.PLAYER_UNLEASH : UnleashReason.HOLDER_GONE)); // CraftBukkit - this.dropLeash(true, true); + // Paper start - drop leash variable -+ EntityUnleashEvent event = new EntityUnleashEvent(this.getBukkitEntity(), (!this.isAlive()) ? UnleashReason.PLAYER_UNLEASH : UnleashReason.HOLDER_GONE, true); -+ this.level.getCraftServer().getPluginManager().callEvent(event); // CraftBukkit ++ EntityUnleashEvent event = new EntityUnleashEvent(this.getBukkitEntity(), (!this.isAlive()) ? EntityUnleashEvent.UnleashReason.PLAYER_UNLEASH : EntityUnleashEvent.UnleashReason.HOLDER_GONE, true); ++ this.level().getCraftServer().getPluginManager().callEvent(event); // CraftBukkit + this.dropLeash(true, event.isDropLeash()); + // Paper end } } -@@ -1533,8 +1539,11 @@ public abstract class Mob extends LivingEntity implements Targeting { +@@ -1535,8 +1541,11 @@ public abstract class Mob extends LivingEntity implements Targeting { boolean flag1 = super.startRiding(entity, force); if (flag1 && this.isLeashed()) { -- this.level.getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.UNKNOWN)); // CraftBukkit +- this.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.UNKNOWN)); // CraftBukkit - this.dropLeash(true, true); + // Paper start - drop leash variable -+ EntityUnleashEvent event = new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.UNKNOWN, true); -+ this.level.getCraftServer().getPluginManager().callEvent(event); // CraftBukkit ++ EntityUnleashEvent event = new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.UNKNOWN, true); ++ this.level().getCraftServer().getPluginManager().callEvent(event); // CraftBukkit + this.dropLeash(true, event.isDropLeash()); + // Paper end } return flag1; -@@ -1717,8 +1726,11 @@ public abstract class Mob extends LivingEntity implements Targeting { +@@ -1719,8 +1728,11 @@ public abstract class Mob extends LivingEntity implements Targeting { @Override protected void removeAfterChangingDimensions() { super.removeAfterChangingDimensions(); -- this.level.getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.UNKNOWN)); // CraftBukkit +- this.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.UNKNOWN)); // CraftBukkit - this.dropLeash(true, false); + // Paper start - drop leash variable -+ EntityUnleashEvent event = new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.UNKNOWN, false); -+ this.level.getCraftServer().getPluginManager().callEvent(event); // CraftBukkit ++ EntityUnleashEvent event = new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.UNKNOWN, false); ++ this.level().getCraftServer().getPluginManager().callEvent(event); // CraftBukkit + this.dropLeash(true, event.isDropLeash()); + // Paper end this.getAllSlots().forEach((itemstack) -> { - if (!itemstack.isEmpty()) itemstack.setCount(0); // CraftBukkit - }); + if (!itemstack.isEmpty()) { + itemstack.setCount(0); diff --git a/src/main/java/net/minecraft/world/entity/PathfinderMob.java b/src/main/java/net/minecraft/world/entity/PathfinderMob.java -index 56d64f3836391fabfa9d3362d9bd62182ea6e290..e49fb8be7d3975506a6c39c87cace664e45b3c86 100644 +index d84f49457a759f0dd556df8a9634239b530e2761..a4dfe40d30a5abf5d614d0921b3b23023fdbc4b1 100644 --- a/src/main/java/net/minecraft/world/entity/PathfinderMob.java +++ b/src/main/java/net/minecraft/world/entity/PathfinderMob.java @@ -49,8 +49,11 @@ public abstract class PathfinderMob extends Mob { if (this instanceof TamableAnimal && ((TamableAnimal) this).isInSittingPose()) { - if (f > entity.level.paperConfig().misc.maxLeashDistance) { // Paper -- this.level.getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit + if (f > entity.level().paperConfig().misc.maxLeashDistance) { // Paper +- this.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit - this.dropLeash(true, true); + // Paper start - drop leash variable + EntityUnleashEvent event = new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE, true); -+ this.level.getCraftServer().getPluginManager().callEvent(event); // CraftBukkit ++ this.level().getCraftServer().getPluginManager().callEvent(event); // CraftBukkit + this.dropLeash(true, event.isDropLeash()); + // Paper end } @@ -89,19 +89,19 @@ index 56d64f3836391fabfa9d3362d9bd62182ea6e290..e49fb8be7d3975506a6c39c87cace664 @@ -58,8 +61,11 @@ public abstract class PathfinderMob extends Mob { this.onLeashDistance(f); - if (f > entity.level.paperConfig().misc.maxLeashDistance) { // Paper -- this.level.getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit + if (f > entity.level().paperConfig().misc.maxLeashDistance) { // Paper +- this.level().getCraftServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE)); // CraftBukkit - this.dropLeash(true, true); + // Paper start - drop leash variable + EntityUnleashEvent event = new EntityUnleashEvent(this.getBukkitEntity(), EntityUnleashEvent.UnleashReason.DISTANCE, true); -+ this.level.getCraftServer().getPluginManager().callEvent(event); // CraftBukkit ++ this.level().getCraftServer().getPluginManager().callEvent(event); // CraftBukkit + this.dropLeash(true, event.isDropLeash()); + // Paper end this.goalSelector.disableControlFlag(Goal.Flag.MOVE); } else if (f > 6.0F) { double d0 = (entity.getX() - this.getX()) / (double) f; diff --git a/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java b/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java -index b5e35033e63da0e5f2c21fddf3b704d6730f0938..7a6cdae1b566f59508b180e720de4eff4ccf13d5 100644 +index 16784fcc853e23689a854e7dc6c03ed8182a164e..4eb97572a97a8d98af37c4223f42fc63659bc0ca 100644 --- a/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java +++ b/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java @@ -126,11 +126,14 @@ public class LeashFenceKnotEntity extends HangingEntity { @@ -122,7 +122,7 @@ index b5e35033e63da0e5f2c21fddf3b704d6730f0938..7a6cdae1b566f59508b180e720de4eff flag1 = true; } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 1e4d8cc53941ead119769d16cc82db1a7be1f6da..b20e4452b8cf5d7ed50db0de24f1167de6253a11 100644 +index 79451f5aec55829f41670cb4366e6971d18c6ece..484b318abe3353e551552fbebd611f9201311643 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -1558,8 +1558,10 @@ public class CraftEventFactory { @@ -135,6 +135,6 @@ index 1e4d8cc53941ead119769d16cc82db1a7be1f6da..b20e4452b8cf5d7ed50db0de24f1167d + public static PlayerUnleashEntityEvent callPlayerUnleashEntityEvent(Mob entity, net.minecraft.world.entity.player.Player player, InteractionHand enumhand, boolean dropLeash) { + PlayerUnleashEntityEvent event = new PlayerUnleashEntityEvent(entity.getBukkitEntity(), (Player) player.getBukkitEntity(), CraftEquipmentSlot.getHand(enumhand), dropLeash); + // Paper end - entity.level.getCraftServer().getPluginManager().callEvent(event); + entity.level().getCraftServer().getPluginManager().callEvent(event); return event; } diff --git a/patches/unapplied/server/0558-Reset-shield-blocking-on-dimension-change.patch b/patches/server/0541-Reset-shield-blocking-on-dimension-change.patch similarity index 73% rename from patches/unapplied/server/0558-Reset-shield-blocking-on-dimension-change.patch rename to patches/server/0541-Reset-shield-blocking-on-dimension-change.patch index 15ebdb71cd..9deb8002f6 100644 --- a/patches/unapplied/server/0558-Reset-shield-blocking-on-dimension-change.patch +++ b/patches/server/0541-Reset-shield-blocking-on-dimension-change.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Reset shield blocking on dimension change diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index cd2d5dc3a51a4600699bd20630d32a7d0897900e..ed9c6a4664b995fb62c97f86ce69a473b47f7efb 100644 +index 38a24e4561dc9be4f95db5c0d0e4465ce3b4a2a4..e38638cc2995ca9c49acb5fa50508db1c0ce00fd 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -1200,6 +1200,11 @@ public class ServerPlayer extends Player { - this.level.getCraftServer().getPluginManager().callEvent(changeEvent); +@@ -1198,6 +1198,11 @@ public class ServerPlayer extends Player { + this.level().getCraftServer().getPluginManager().callEvent(changeEvent); // CraftBukkit end } + // Paper start diff --git a/patches/unapplied/server/0559-add-DragonEggFormEvent.patch b/patches/server/0542-add-DragonEggFormEvent.patch similarity index 77% rename from patches/unapplied/server/0559-add-DragonEggFormEvent.patch rename to patches/server/0542-add-DragonEggFormEvent.patch index 7e39c25a22..e4abf96236 100644 --- a/patches/unapplied/server/0559-add-DragonEggFormEvent.patch +++ b/patches/server/0542-add-DragonEggFormEvent.patch @@ -5,24 +5,24 @@ Subject: [PATCH] add DragonEggFormEvent diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java -index 1ee1b757b90ae0d080aa57f4186228a6f4279c1f..abd13cefd3d8409e1ef8ea70d92877f76f89da6c 100644 +index 2be95e545ca85cf94b1e847ff452cd586c4eea05..eab54838ba540f41cc59a359dd00ba80d82c771e 100644 --- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java +++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java -@@ -370,9 +370,23 @@ public class EndDragonFight { +@@ -356,9 +356,23 @@ public class EndDragonFight { this.dragonEvent.setVisible(false); this.spawnExitPortal(true); this.spawnNewGateway(); + // Paper start - DragonEggFormEvent -+ BlockPos eggPosition = this.level.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, EndPodiumFeature.END_PODIUM_LOCATION); ++ BlockPos eggPosition = this.level.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, EndPodiumFeature.getLocation(this.origin)); + org.bukkit.craftbukkit.block.CraftBlockState eggState = org.bukkit.craftbukkit.block.CraftBlockStates.getBlockState(this.level, eggPosition); + eggState.setData(Blocks.DRAGON_EGG.defaultBlockState()); + io.papermc.paper.event.block.DragonEggFormEvent eggEvent = new io.papermc.paper.event.block.DragonEggFormEvent(org.bukkit.craftbukkit.block.CraftBlock.at(this.level, eggPosition), eggState, + new org.bukkit.craftbukkit.boss.CraftDragonBattle(this)); + // Paper end - DragonEggFormEvent if (this.level.paperConfig().entities.behavior.enderDragonsDeathAlwaysPlacesDragonEgg || !this.previouslyKilled) { // Paper - always place dragon egg -- this.level.setBlockAndUpdate(this.level.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, EndPodiumFeature.END_PODIUM_LOCATION), Blocks.DRAGON_EGG.defaultBlockState()); +- this.level.setBlockAndUpdate(this.level.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, EndPodiumFeature.getLocation(this.origin)), Blocks.DRAGON_EGG.defaultBlockState()); + // Paper start - DragonEggFormEvent -+ //this.level.setBlockAndUpdate(this.level.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, EndPodiumFeature.END_PODIUM_LOCATION), Blocks.DRAGON_EGG.defaultBlockState()); ++ // this.level.setBlockAndUpdate(this.level.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, EndPodiumFeature.getLocation(this.origin)), Blocks.DRAGON_EGG.defaultBlockState()); + } else { + eggEvent.setCancelled(true); + } diff --git a/patches/unapplied/server/0560-EntityMoveEvent.patch b/patches/server/0543-EntityMoveEvent.patch similarity index 63% rename from patches/unapplied/server/0560-EntityMoveEvent.patch rename to patches/server/0543-EntityMoveEvent.patch index 0d3348c779..813398d28e 100644 --- a/patches/unapplied/server/0560-EntityMoveEvent.patch +++ b/patches/server/0543-EntityMoveEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] EntityMoveEvent diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 9e3dc2ba64b146d1715b81be7202ddbd0122382e..7ad22703d50667849e195d3e7b6792078104425c 100644 +index 571352506c8c76cca674dcc0c6e17d8ab89d1572..31a9b86f9e9e837b10717a37177552cc4588a01a 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1507,6 +1507,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper @@ -17,10 +17,10 @@ index 9e3dc2ba64b146d1715b81be7202ddbd0122382e..7ad22703d50667849e195d3e7b679207 this.profiler.push(() -> { return worldserver + " " + worldserver.dimension().location(); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 2af673fe240fbb0ce7667e207a833d09afa7074b..652b2c5dc17c6ba65eb59cbd3ac218d280fef044 100644 +index 7222bee995a3628629d40e94d70ada0730d05e28..e3067058aacfcc06910d106b68934dc285bbd11a 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -217,6 +217,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -220,6 +220,7 @@ public class ServerLevel extends Level implements WorldGenLevel { public final LevelStorageSource.LevelStorageAccess convertable; public final UUID uuid; public boolean hasPhysicsEvent = true; // Paper @@ -29,27 +29,27 @@ index 2af673fe240fbb0ce7667e207a833d09afa7074b..652b2c5dc17c6ba65eb59cbd3ac218d2 final Throwable thr = new Throwable(entity + " Added to world at " + new java.util.Date()); io.papermc.paper.util.StacktraceDeobfuscator.INSTANCE.deobfuscateThrowable(thr); diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index fcd670d1371dca3bb644dfea79f98670d75a68a4..276cdeb349c6b9c23ff4198beb807b5f090de3b6 100644 +index 922e953234998f1322cb9fb72b02321b7975a674..7952ba7e7e9f36fe6dea851dbc239d39ff61a74a 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3291,6 +3291,20 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3340,6 +3340,20 @@ public abstract class LivingEntity extends Entity implements Attackable { this.pushEntities(); - this.level.getProfiler().pop(); + this.level().getProfiler().pop(); + // Paper start -+ if (((ServerLevel) this.level).hasEntityMoveEvent && !(this instanceof net.minecraft.world.entity.player.Player)) { -+ if (this.xo != getX() || this.yo != this.getY() || this.zo != this.getZ() || this.yRotO != this.getYRot() || this.xRotO != this.getXRot()) { -+ Location from = new Location(this.level.getWorld(), this.xo, this.yo, this.zo, this.yRotO, this.xRotO); -+ Location to = new Location (this.level.getWorld(), this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot()); ++ if (((ServerLevel) this.level()).hasEntityMoveEvent && !(this instanceof net.minecraft.world.entity.player.Player)) { ++ if (this.xo != this.getX() || this.yo != this.getY() || this.zo != this.getZ() || this.yRotO != this.getYRot() || this.xRotO != this.getXRot()) { ++ Location from = new Location(this.level().getWorld(), this.xo, this.yo, this.zo, this.yRotO, this.xRotO); ++ Location to = new Location (this.level().getWorld(), this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot()); + io.papermc.paper.event.entity.EntityMoveEvent event = new io.papermc.paper.event.entity.EntityMoveEvent(this.getBukkitLivingEntity(), from, to.clone()); + if (!event.callEvent()) { -+ absMoveTo(from.getX(), from.getY(), from.getZ(), from.getYaw(), from.getPitch()); ++ this.absMoveTo(from.getX(), from.getY(), from.getZ(), from.getYaw(), from.getPitch()); + } else if (!to.equals(event.getTo())) { -+ absMoveTo(event.getTo().getX(), event.getTo().getY(), event.getTo().getZ(), event.getTo().getYaw(), event.getTo().getPitch()); ++ this.absMoveTo(event.getTo().getX(), event.getTo().getY(), event.getTo().getZ(), event.getTo().getYaw(), event.getTo().getPitch()); + } + } + } + // Paper end - if (!this.level.isClientSide && this.isSensitiveToWater() && this.isInWaterRainOrBubble()) { + if (!this.level().isClientSide && this.isSensitiveToWater() && this.isInWaterRainOrBubble()) { this.hurt(this.damageSources().drown(), 1.0F); } diff --git a/patches/unapplied/server/0561-added-option-to-disable-pathfinding-updates-on-block.patch b/patches/server/0544-added-option-to-disable-pathfinding-updates-on-block.patch similarity index 80% rename from patches/unapplied/server/0561-added-option-to-disable-pathfinding-updates-on-block.patch rename to patches/server/0544-added-option-to-disable-pathfinding-updates-on-block.patch index 9cf015f84b..9616abb0fb 100644 --- a/patches/unapplied/server/0561-added-option-to-disable-pathfinding-updates-on-block.patch +++ b/patches/server/0544-added-option-to-disable-pathfinding-updates-on-block.patch @@ -5,10 +5,10 @@ Subject: [PATCH] added option to disable pathfinding updates on block changes diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 652b2c5dc17c6ba65eb59cbd3ac218d280fef044..421bec0fead072a8f0e8756f9ba3670d8465842f 100644 +index e3067058aacfcc06910d106b68934dc285bbd11a..010024a8ea56455ebfb16d70fffd1d51a169b411 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1511,6 +1511,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1420,6 +1420,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } this.getChunkSource().blockChanged(pos); @@ -16,7 +16,7 @@ index 652b2c5dc17c6ba65eb59cbd3ac218d280fef044..421bec0fead072a8f0e8756f9ba3670d VoxelShape voxelshape = oldState.getCollisionShape(this, pos); VoxelShape voxelshape1 = newState.getCollisionShape(this, pos); -@@ -1552,6 +1553,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1461,6 +1462,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } } diff --git a/patches/unapplied/server/0562-Inline-shift-direction-fields.patch b/patches/server/0545-Inline-shift-direction-fields.patch similarity index 79% rename from patches/unapplied/server/0562-Inline-shift-direction-fields.patch rename to patches/server/0545-Inline-shift-direction-fields.patch index 338237a2b0..f0c71d61f2 100644 --- a/patches/unapplied/server/0562-Inline-shift-direction-fields.patch +++ b/patches/server/0545-Inline-shift-direction-fields.patch @@ -7,13 +7,13 @@ Removes a layer of indirection for EnumDirection.getAdjacent(X|Y|Z)(), which is critical section for much of the server, including the lighting engine. diff --git a/src/main/java/net/minecraft/core/Direction.java b/src/main/java/net/minecraft/core/Direction.java -index 3010e5dfbed06ef61ccbc49de790209beff0259b..82bce6109d59cba30178a446f0ff129da6f3692f 100644 +index 3abec6de94f0ef1d788320e33653c598887f17ca..d0a8092bf57a29ab7c00ec0ddf52a9fdb2a33267 100644 --- a/src/main/java/net/minecraft/core/Direction.java +++ b/src/main/java/net/minecraft/core/Direction.java -@@ -62,6 +62,11 @@ public enum Direction implements StringRepresentable { - }, (direction1, direction2) -> { - throw new IllegalArgumentException("Duplicate keys"); - }, Long2ObjectOpenHashMap::new)); +@@ -52,6 +52,11 @@ public enum Direction implements StringRepresentable { + })).toArray((i) -> { + return new Direction[i]; + }); + // Paper start + private final int adjX; + private final int adjY; @@ -22,7 +22,7 @@ index 3010e5dfbed06ef61ccbc49de790209beff0259b..82bce6109d59cba30178a446f0ff129d private Direction(int id, int idOpposite, int idHorizontal, String name, Direction.AxisDirection direction, Direction.Axis axis, Vec3i vector) { this.data3d = id; -@@ -71,6 +76,11 @@ public enum Direction implements StringRepresentable { +@@ -61,6 +66,11 @@ public enum Direction implements StringRepresentable { this.axis = axis; this.axisDirection = direction; this.normal = vector; @@ -34,7 +34,7 @@ index 3010e5dfbed06ef61ccbc49de790209beff0259b..82bce6109d59cba30178a446f0ff129d } public static Direction[] orderedByNearest(Entity entity) { -@@ -358,15 +368,15 @@ public enum Direction implements StringRepresentable { +@@ -348,15 +358,15 @@ public enum Direction implements StringRepresentable { } public int getStepX() { diff --git a/patches/unapplied/server/0563-Allow-adding-items-to-BlockDropItemEvent.patch b/patches/server/0546-Allow-adding-items-to-BlockDropItemEvent.patch similarity index 89% rename from patches/unapplied/server/0563-Allow-adding-items-to-BlockDropItemEvent.patch rename to patches/server/0546-Allow-adding-items-to-BlockDropItemEvent.patch index a80491b6cb..82b65e9cec 100644 --- a/patches/unapplied/server/0563-Allow-adding-items-to-BlockDropItemEvent.patch +++ b/patches/server/0546-Allow-adding-items-to-BlockDropItemEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Allow adding items to BlockDropItemEvent diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index b20e4452b8cf5d7ed50db0de24f1167de6253a11..0e8029a9beeb8bee245f1c94c8ee596ec0131177 100644 +index 484b318abe3353e551552fbebd611f9201311643..7ef3e4dd903c77fd6112e90999a474ff674a5e7f 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -418,13 +418,30 @@ public class CraftEventFactory { @@ -24,12 +24,12 @@ index b20e4452b8cf5d7ed50db0de24f1167de6253a11..0e8029a9beeb8bee245f1c94c8ee596e if (!event.isCancelled()) { - for (ItemEntity item : items) { -- item.level.addFreshEntity(item); +- item.level().addFreshEntity(item); + // Paper start + for (Item bukkit : list) { + if (!bukkit.isValid()) { + Entity item = ((org.bukkit.craftbukkit.entity.CraftItem) bukkit).getHandle(); -+ item.level.addFreshEntity(item); ++ item.level().addFreshEntity(item); + } + } + } else { diff --git a/patches/unapplied/server/0564-Add-getMainThreadExecutor-to-BukkitScheduler.patch b/patches/server/0547-Add-getMainThreadExecutor-to-BukkitScheduler.patch similarity index 100% rename from patches/unapplied/server/0564-Add-getMainThreadExecutor-to-BukkitScheduler.patch rename to patches/server/0547-Add-getMainThreadExecutor-to-BukkitScheduler.patch diff --git a/patches/unapplied/server/0565-living-entity-allow-attribute-registration.patch b/patches/server/0548-living-entity-allow-attribute-registration.patch similarity index 96% rename from patches/unapplied/server/0565-living-entity-allow-attribute-registration.patch rename to patches/server/0548-living-entity-allow-attribute-registration.patch index 9ac5884f2e..2d3a7ab361 100644 --- a/patches/unapplied/server/0565-living-entity-allow-attribute-registration.patch +++ b/patches/server/0548-living-entity-allow-attribute-registration.patch @@ -41,7 +41,7 @@ index 233e372ba5d785352c9ac12dac37395bac63315c..0e61caa5c9f21788fbeaa90ed75d23e1 return BuiltInRegistries.ATTRIBUTE.get(CraftNamespacedKey.toMinecraft(attribute.getKey())); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index bec679a287ac26b6413b9d0b90a6758b905ecde6..44df0768689309cc492c101f97cafcd59081809d 100644 +index 7204d2b542d8454fe12cce1ff049363045d4f5e5..37148ccf704dd8e5aa7d9ab100e6df142e822255 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -705,6 +705,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { diff --git a/patches/unapplied/server/0566-fix-dead-slime-setSize-invincibility.patch b/patches/server/0549-fix-dead-slime-setSize-invincibility.patch similarity index 100% rename from patches/unapplied/server/0566-fix-dead-slime-setSize-invincibility.patch rename to patches/server/0549-fix-dead-slime-setSize-invincibility.patch diff --git a/patches/unapplied/server/0567-Merchant-getRecipes-should-return-an-immutable-list.patch b/patches/server/0550-Merchant-getRecipes-should-return-an-immutable-list.patch similarity index 100% rename from patches/unapplied/server/0567-Merchant-getRecipes-should-return-an-immutable-list.patch rename to patches/server/0550-Merchant-getRecipes-should-return-an-immutable-list.patch diff --git a/patches/unapplied/server/0568-Add-support-for-hex-color-codes-in-console.patch b/patches/server/0551-Add-support-for-hex-color-codes-in-console.patch similarity index 99% rename from patches/unapplied/server/0568-Add-support-for-hex-color-codes-in-console.patch rename to patches/server/0551-Add-support-for-hex-color-codes-in-console.patch index 9c48e211e1..19e067d274 100644 --- a/patches/unapplied/server/0568-Add-support-for-hex-color-codes-in-console.patch +++ b/patches/server/0551-Add-support-for-hex-color-codes-in-console.patch @@ -283,10 +283,10 @@ index 0000000000000000000000000000000000000000..b9922b07cb105618390187d98acdf89e + +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 7ad22703d50667849e195d3e7b6792078104425c..97ebd8d4bb8f0558d8b74782c810c5db0485d802 100644 +index 31a9b86f9e9e837b10717a37177552cc4588a01a..1565a32a4e388cb3aec5b8c8d2cdf684383a38eb 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1707,7 +1707,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop extends CraftBlockEntityState< - this.front.applyLegacyStringToSignSide(); +@@ -108,6 +108,7 @@ public class CraftSign extends CraftBlockEntityState< + this.back.applyLegacyStringToSignSide(); super.applyTo(sign); + sign.isEditable = getSnapshot().isEditable; // Paper - copy manually diff --git a/patches/unapplied/server/0585-Drop-carried-item-when-player-has-disconnected.patch b/patches/server/0567-Drop-carried-item-when-player-has-disconnected.patch similarity index 88% rename from patches/unapplied/server/0585-Drop-carried-item-when-player-has-disconnected.patch rename to patches/server/0567-Drop-carried-item-when-player-has-disconnected.patch index 5b671c35a4..ee4eef3673 100644 --- a/patches/unapplied/server/0585-Drop-carried-item-when-player-has-disconnected.patch +++ b/patches/server/0567-Drop-carried-item-when-player-has-disconnected.patch @@ -7,10 +7,10 @@ Fixes disappearance of held items, when a player gets disconnected and PlayerDro Closes #5036 diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 3ef97c793a85a9287b7fad66281e532285aaf5fc..481f2f5dc2e62ae0bbdb8bbac5e8c3c5e090def7 100644 +index 654d304582cc35989fcdb46b78724529f9ba40bc..3f6f946c5c4870826ae0749fcd1d816906f0f4c3 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -584,6 +584,14 @@ public abstract class PlayerList { +@@ -591,6 +591,14 @@ public abstract class PlayerList { } // Paper end diff --git a/patches/unapplied/server/0586-forced-whitelist-use-configurable-kick-message.patch b/patches/server/0568-forced-whitelist-use-configurable-kick-message.patch similarity index 87% rename from patches/unapplied/server/0586-forced-whitelist-use-configurable-kick-message.patch rename to patches/server/0568-forced-whitelist-use-configurable-kick-message.patch index b85180dd66..bc28e45c1b 100644 --- a/patches/unapplied/server/0586-forced-whitelist-use-configurable-kick-message.patch +++ b/patches/server/0568-forced-whitelist-use-configurable-kick-message.patch @@ -5,10 +5,10 @@ Subject: [PATCH] forced whitelist: use configurable kick message diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 97ebd8d4bb8f0558d8b74782c810c5db0485d802..fd9790dfd445481ed245b82255e05f5bc1459eae 100644 +index 1565a32a4e388cb3aec5b8c8d2cdf684383a38eb..84bc412a8169b07f63e9d0395df1b1f42e0f6a83 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2149,7 +2149,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop -Date: Tue, 2 Feb 2021 09:17:59 +0100 -Subject: [PATCH] stop firing pressure plate EntityInteractEvent for ignored - entities - - -diff --git a/src/main/java/net/minecraft/world/level/block/PressurePlateBlock.java b/src/main/java/net/minecraft/world/level/block/PressurePlateBlock.java -index ed4a954a07e69d36c61e69137a4907a43270942b..e47938e8353c9ada6e20d94fc4f129a419cad731 100644 ---- a/src/main/java/net/minecraft/world/level/block/PressurePlateBlock.java -+++ b/src/main/java/net/minecraft/world/level/block/PressurePlateBlock.java -@@ -59,6 +59,7 @@ public class PressurePlateBlock extends BasePressurePlateBlock { - - while (iterator.hasNext()) { - Entity entity = (Entity) iterator.next(); -+ if (entity.isIgnoringBlockTriggers()) continue; // Paper - don't call event for ignored entities - - // CraftBukkit start - Call interact event when turning on a pressure plate - if (this.getSignalForState(world.getBlockState(pos)) == 0) {