diff --git a/patches/unapplied/server/1023-fix-horse-inventories.patch b/patches/server/1001-fix-horse-inventories.patch similarity index 100% rename from patches/unapplied/server/1023-fix-horse-inventories.patch rename to patches/server/1001-fix-horse-inventories.patch diff --git a/patches/unapplied/server/1024-Only-call-EntityDamageEvents-before-actuallyHurt.patch b/patches/server/1002-Only-call-EntityDamageEvents-before-actuallyHurt.patch similarity index 85% rename from patches/unapplied/server/1024-Only-call-EntityDamageEvents-before-actuallyHurt.patch rename to patches/server/1002-Only-call-EntityDamageEvents-before-actuallyHurt.patch index e1393a8173..8c259f8cbf 100644 --- a/patches/unapplied/server/1024-Only-call-EntityDamageEvents-before-actuallyHurt.patch +++ b/patches/server/1002-Only-call-EntityDamageEvents-before-actuallyHurt.patch @@ -12,10 +12,10 @@ This patch moves the invocation directly before the #actuallyHurt calls, respective invulnerable timings. diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 3b15995efc65a351da8dac009b9698494771fefb..5079775ce8f86fb061e616190513f56ff086e409 100644 +index f75b66c9ec786bc6f4d3f5cd5127c815f11166c4..b4d1848858fae20f81c27b31bc0c280c6705f082 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -1459,12 +1459,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1491,12 +1491,7 @@ public abstract class LivingEntity extends Entity implements Attackable { } // CraftBukkit start @@ -29,7 +29,7 @@ index 3b15995efc65a351da8dac009b9698494771fefb..5079775ce8f86fb061e616190513f56f // CraftBukkit end this.walkAnimation.setSpeed(1.5F); -@@ -1475,6 +1470,11 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1511,6 +1506,11 @@ public abstract class LivingEntity extends Entity implements Attackable { return false; } @@ -39,9 +39,9 @@ index 3b15995efc65a351da8dac009b9698494771fefb..5079775ce8f86fb061e616190513f56f + // Paper end - only call damage event when actuallyHurt will be called - move call logic down + // CraftBukkit start - if (!this.actuallyHurt(source, (float) event.getFinalDamage() - this.lastHurt, event)) { + if (!this.actuallyHurt(world, source, (float) event.getFinalDamage() - this.lastHurt, event)) { return false; -@@ -1484,6 +1484,10 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1520,6 +1520,10 @@ public abstract class LivingEntity extends Entity implements Attackable { this.lastHurt = amount; flag1 = false; } else { @@ -50,9 +50,9 @@ index 3b15995efc65a351da8dac009b9698494771fefb..5079775ce8f86fb061e616190513f56f + amount = computeAmountFromEntityDamageEvent(event); + // Paper end - only call damage event when actuallyHurt will be called - move call logic down // CraftBukkit start - if (!this.actuallyHurt(source, (float) event.getFinalDamage(), event)) { + if (!this.actuallyHurt(world, source, (float) event.getFinalDamage(), event)) { return false; -@@ -1615,6 +1619,18 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1655,6 +1659,18 @@ public abstract class LivingEntity extends Entity implements Attackable { } } diff --git a/patches/unapplied/server/1029-Add-ItemType-getItemRarity.patch b/patches/server/1003-Add-ItemType-getItemRarity.patch similarity index 86% rename from patches/unapplied/server/1029-Add-ItemType-getItemRarity.patch rename to patches/server/1003-Add-ItemType-getItemRarity.patch index 35ebf5036b..0863f02f5c 100644 --- a/patches/unapplied/server/1029-Add-ItemType-getItemRarity.patch +++ b/patches/server/1003-Add-ItemType-getItemRarity.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add ItemType#getItemRarity diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java -index bae3dd5fc67e6b3d98a5e63ffbf639c5042f8843..450c63c31d2f5d056d989aa00452231f50c8224d 100644 +index 96dfcfa12c63c682edcdec98647ca6a94d9fb4ed..d3f650d040afae8cb962696381c692cd7884bb4d 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java -@@ -265,4 +265,12 @@ public class CraftItemType implements ItemType.Typed, Han +@@ -262,4 +262,12 @@ public class CraftItemType implements ItemType.Typed, Han return this.item.getDescriptionId(); } // Paper end - add Translatable diff --git a/patches/unapplied/server/1033-Add-plugin-info-at-startup.patch b/patches/server/1004-Add-plugin-info-at-startup.patch similarity index 100% rename from patches/unapplied/server/1033-Add-plugin-info-at-startup.patch rename to patches/server/1004-Add-plugin-info-at-startup.patch diff --git a/patches/unapplied/server/1034-Make-interaction-leniency-distance-configurable.patch b/patches/server/1005-Make-interaction-leniency-distance-configurable.patch similarity index 87% rename from patches/unapplied/server/1034-Make-interaction-leniency-distance-configurable.patch rename to patches/server/1005-Make-interaction-leniency-distance-configurable.patch index c0f7fc9fdc..98eb372c1e 100644 --- a/patches/unapplied/server/1034-Make-interaction-leniency-distance-configurable.patch +++ b/patches/server/1005-Make-interaction-leniency-distance-configurable.patch @@ -12,15 +12,15 @@ This value however may be too low in high latency environments. The patch exposes a new configuration option to configure said value. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 4c04eb531b6989f7e618d201ecaa84298eab52c4..62d5ca25104e10ca16c2005ef9272bf8329ce145 100644 +index 14a8e05420ae4ca2f1d9028e19379d162a3e6971..c9fd2b8cc5a14d4ef4072765d5274d0c470bcfe6 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2702,7 +2702,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2722,7 +2722,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl AABB axisalignedbb = entity.getBoundingBox(); -- if (this.player.canInteractWithEntity(axisalignedbb, 1.0D)) { -+ if (this.player.canInteractWithEntity(axisalignedbb, io.papermc.paper.configuration.GlobalConfiguration.get().misc.clientInteractionLeniencyDistance.or(1.0D))) { // Paper - configurable lenience value for interact range +- if (this.player.canInteractWithEntity(axisalignedbb, 3.0D)) { ++ if (this.player.canInteractWithEntity(axisalignedbb, io.papermc.paper.configuration.GlobalConfiguration.get().misc.clientInteractionLeniencyDistance.or(3.0D))) { // Paper - configurable lenience value for interact range packet.dispatch(new ServerboundInteractPacket.Handler() { private void performInteraction(InteractionHand enumhand, ServerGamePacketListenerImpl.EntityInteraction playerconnection_a, PlayerInteractEntityEvent event) { // CraftBukkit ItemStack itemstack = ServerGamePacketListenerImpl.this.player.getItemInHand(enumhand); diff --git a/patches/unapplied/server/1035-Fix-PickupStatus-getting-reset.patch b/patches/server/1006-Fix-PickupStatus-getting-reset.patch similarity index 84% rename from patches/unapplied/server/1035-Fix-PickupStatus-getting-reset.patch rename to patches/server/1006-Fix-PickupStatus-getting-reset.patch index a952f8a688..c731057978 100644 --- a/patches/unapplied/server/1035-Fix-PickupStatus-getting-reset.patch +++ b/patches/server/1006-Fix-PickupStatus-getting-reset.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix PickupStatus getting reset diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java -index ddf47dab1ab92c45e3eea09239d418a9798ed59e..9ca29b3d4bf8bca5f51f3644e12fcbec2cb5d35e 100644 +index 14e31ae88e90d8ea1a98800cc6c1c3527bb2ed6b..accc246f441c8bf5e1a755cfc0db8f97c0c01c6b 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java +++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java -@@ -668,7 +668,14 @@ public abstract class AbstractArrow extends Projectile { +@@ -714,7 +714,14 @@ public abstract class AbstractArrow extends Projectile { @Override public void setOwner(@Nullable Entity entity) { @@ -24,13 +24,13 @@ index ddf47dab1ab92c45e3eea09239d418a9798ed59e..9ca29b3d4bf8bca5f51f3644e12fcbec byte b0 = 0; diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java -index f2bdd95a6ae77400742d87bcae35c09fb8b047ba..10ade433c083851d9ea4797c6ec618db122229f9 100644 +index 3982b32cf69250ebd138eff225b65313f75286ea..03c1bffd3125bb7a82ac921b0a23dcab55c33c4f 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java +++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java -@@ -240,7 +240,13 @@ public abstract class Projectile extends Entity implements TraceableEntity { +@@ -353,7 +353,13 @@ public abstract class Projectile extends Entity implements TraceableEntity { public boolean deflect(ProjectileDeflection deflection, @Nullable Entity deflector, @Nullable Entity owner, boolean fromAttack) { + deflection.deflect(this, deflector, this.random); if (!this.level().isClientSide) { - deflection.deflect(this, deflector, this.random); - this.setOwner(owner); + // Paper start - Fix PickupStatus getting reset + if (this instanceof AbstractArrow arrow) { @@ -43,10 +43,10 @@ index f2bdd95a6ae77400742d87bcae35c09fb8b047ba..10ade433c083851d9ea4797c6ec618db } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractArrow.java -index faa08ad912fa43e7a6c5a2359e23c04c059c5edf..501e2aa3a10dae94c4a8d9dfcdc902e434fcca62 100644 +index 1f30109abd86b76af343eb5eb75ec3db83ef9417..d0c30fd12aa9866900fe72b97d10c257479cf010 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractArrow.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractArrow.java -@@ -170,4 +170,16 @@ public class CraftAbstractArrow extends AbstractProjectile implements AbstractAr +@@ -173,4 +173,16 @@ public class CraftAbstractArrow extends AbstractProjectile implements AbstractAr this.getHandle().setSoundEvent(org.bukkit.craftbukkit.CraftSound.bukkitToMinecraft(sound)); } // Paper end diff --git a/patches/unapplied/server/1036-Check-for-block-type-in-SculkSensorBlock-canActivate.patch b/patches/server/1007-Check-for-block-type-in-SculkSensorBlock-canActivate.patch similarity index 85% rename from patches/unapplied/server/1036-Check-for-block-type-in-SculkSensorBlock-canActivate.patch rename to patches/server/1007-Check-for-block-type-in-SculkSensorBlock-canActivate.patch index c56c52b165..b06a0b6c33 100644 --- a/patches/unapplied/server/1036-Check-for-block-type-in-SculkSensorBlock-canActivate.patch +++ b/patches/server/1007-Check-for-block-type-in-SculkSensorBlock-canActivate.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Check for block type in SculkSensorBlock#canActivate diff --git a/src/main/java/net/minecraft/world/level/block/SculkSensorBlock.java b/src/main/java/net/minecraft/world/level/block/SculkSensorBlock.java -index b45bc43b5a59a95c50bd756a981368c7fdadbd41..8d57c68d2f20f7c0d5c1be5d5b12e6926aad8c58 100644 +index 22d299a19f19ad5dd13262792ae448311d1ea3e4..0ed449a188d98f87dbddd2d76009fed02a29ed25 100644 --- a/src/main/java/net/minecraft/world/level/block/SculkSensorBlock.java +++ b/src/main/java/net/minecraft/world/level/block/SculkSensorBlock.java -@@ -218,7 +218,7 @@ public class SculkSensorBlock extends BaseEntityBlock implements SimpleWaterlogg +@@ -219,7 +219,7 @@ public class SculkSensorBlock extends BaseEntityBlock implements SimpleWaterlogg } public static boolean canActivate(BlockState state) { diff --git a/patches/unapplied/server/1037-Add-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch b/patches/server/1008-Add-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch similarity index 97% rename from patches/unapplied/server/1037-Add-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch rename to patches/server/1008-Add-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch index 025db7dddb..61b8983112 100644 --- a/patches/unapplied/server/1037-Add-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch +++ b/patches/server/1008-Add-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add API for CanPlaceOn and CanDestroy NBT values diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 7f6f404f5a2be7876ae239355979e8c8a7a198ce..07f31bce96e3c47bea43b5d6443070ae158430ef 100644 +index 450c5aa14b4195eb7123492c7a111ec6f40ce412..7d9f75e680e243ac8c7defdd150e431b47225945 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -@@ -2185,4 +2185,117 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -2498,4 +2498,117 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { } // Paper end diff --git a/patches/unapplied/server/1038-Configuration-for-horizontal-only-item-merging.patch b/patches/server/1009-Configuration-for-horizontal-only-item-merging.patch similarity index 92% rename from patches/unapplied/server/1038-Configuration-for-horizontal-only-item-merging.patch rename to patches/server/1009-Configuration-for-horizontal-only-item-merging.patch index 76e790b082..4b16b244dd 100644 --- a/patches/unapplied/server/1038-Configuration-for-horizontal-only-item-merging.patch +++ b/patches/server/1009-Configuration-for-horizontal-only-item-merging.patch @@ -14,10 +14,10 @@ This allows us to have both the reduced number of item entities a high item-merg without most of the visual artifacts caused by items merging vertically. diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java -index cbfb07bdf8d5e2e5a462835184be2d47e59d506c..03cfa29bdb426a9fb6b1b6be6e897da48d4f2f3e 100644 +index e83a705f54063a17fc69a22683333aacad5a43ce..246b5649883e4f305afa5a887b9df0f3735f7593 100644 --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java -@@ -282,7 +282,7 @@ public class ItemEntity extends Entity implements TraceableEntity { +@@ -285,7 +285,7 @@ public class ItemEntity extends Entity implements TraceableEntity { if (this.isMergable()) { // Spigot start double radius = this.level().spigotConfig.itemMerge; diff --git a/patches/unapplied/server/1040-Add-skipping-world-symlink-scan.patch b/patches/server/1010-Add-skipping-world-symlink-scan.patch similarity index 90% rename from patches/unapplied/server/1040-Add-skipping-world-symlink-scan.patch rename to patches/server/1010-Add-skipping-world-symlink-scan.patch index edbbf7edf8..f3221508c6 100644 --- a/patches/unapplied/server/1040-Add-skipping-world-symlink-scan.patch +++ b/patches/server/1010-Add-skipping-world-symlink-scan.patch @@ -7,10 +7,10 @@ In worlds that are extremely large (greater than 1TB), it can take an insanely l This patch adds a system property to disable the symlink scan, which can be used to speed up world loading. diff --git a/src/main/java/net/minecraft/world/level/storage/LevelStorageSource.java b/src/main/java/net/minecraft/world/level/storage/LevelStorageSource.java -index 427ee4d6f12a7abd8da0c65e0b9081b25824df40..85ba843ce7e1f62971e736fa2cc028c47b274ce4 100644 +index b5abdd1498a3d19559149c30ba959aa2bcf0246c..79397b3c76e4b9d2ee03dfa16c2daf4f71ae8b4d 100644 --- a/src/main/java/net/minecraft/world/level/storage/LevelStorageSource.java +++ b/src/main/java/net/minecraft/world/level/storage/LevelStorageSource.java -@@ -420,7 +420,7 @@ public class LevelStorageSource { +@@ -411,7 +411,7 @@ public class LevelStorageSource { public LevelStorageSource.LevelStorageAccess validateAndCreateAccess(String s, ResourceKey dimensionType) throws IOException, ContentValidationException { // CraftBukkit Path path = this.getLevelPath(s); diff --git a/patches/unapplied/server/1041-Add-even-more-Enchantment-API.patch b/patches/server/1011-Add-even-more-Enchantment-API.patch similarity index 100% rename from patches/unapplied/server/1041-Add-even-more-Enchantment-API.patch rename to patches/server/1011-Add-even-more-Enchantment-API.patch diff --git a/patches/unapplied/server/1042-Leashable-API.patch b/patches/server/1012-Leashable-API.patch similarity index 87% rename from patches/unapplied/server/1042-Leashable-API.patch rename to patches/server/1012-Leashable-API.patch index 0450da40fd..20fc6fbdca 100644 --- a/patches/unapplied/server/1042-Leashable-API.patch +++ b/patches/server/1012-Leashable-API.patch @@ -61,23 +61,23 @@ index 0000000000000000000000000000000000000000..a9ddf9a4a07cd29833f38d7e5f42b2b1 + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java -index e33b1b6fd50a4eea57500cc00dba20d6edcab75d..01a9660de65688b7c1a4f9dafcb650774ce1853b 100644 +index 412fd9e87ec81cf50cb8bc82fe2dad5dd0029039..9046d6fa36b9f5e5d25835ad8d94c869c0764060 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java -@@ -7,7 +7,7 @@ import org.bukkit.craftbukkit.CraftServer; +@@ -8,7 +8,7 @@ import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.Boat; import org.bukkit.entity.Entity; --public class CraftBoat extends CraftVehicle implements Boat { -+public class CraftBoat extends CraftVehicle implements Boat, io.papermc.paper.entity.PaperLeashable { // Paper - Leashable API +-public abstract class CraftBoat extends CraftVehicle implements Boat { ++public abstract class CraftBoat extends CraftVehicle implements Boat, io.papermc.paper.entity.PaperLeashable { // Paper - Leashable API - public CraftBoat(CraftServer server, net.minecraft.world.entity.vehicle.Boat entity) { + public CraftBoat(CraftServer server, AbstractBoat entity) { super(server, entity); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 7e280955067169f63f15162e9cad1e86e824a8e5..4750df7354ccb5afd0910efe0415f3a2eb19a546 100644 +index f16067b674118a47735ad22797988d50b4415040..d0c409f4efad289e3e325f44b500fc72589d89d4 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -777,43 +777,17 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -784,43 +784,17 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @Override public boolean isLeashed() { @@ -125,7 +125,7 @@ index 7e280955067169f63f15162e9cad1e86e824a8e5..4750df7354ccb5afd0910efe0415f3a2 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -index deb66c04abefb4a88521483db1612e494bd27164..5f9f7e325e3e0276f7a475c4a4725cc0e1b54afd 100644 +index 95d7015a61098d1d22a501124d6bb8fba1516fe3..778a9d3f8bfe5dba59e1e655e4eeb8822678b8cf 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java @@ -11,7 +11,7 @@ import org.bukkit.entity.LivingEntity; @@ -138,7 +138,7 @@ index deb66c04abefb4a88521483db1612e494bd27164..5f9f7e325e3e0276f7a475c4a4725cc0 super(server, entity); paperPathfinder = new com.destroystokyo.paper.entity.PaperPathfinder(entity); // Paper - Mob Pathfinding API @@ -175,4 +175,21 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob { - return getHandle().getExperienceReward((ServerLevel) this.getHandle().level(), null); + return getHandle().getExperienceReward((net.minecraft.server.level.ServerLevel) this.getHandle().level(), null); } // Paper end + diff --git a/patches/unapplied/server/1043-Fix-CraftBukkit-drag-system.patch b/patches/server/1013-Fix-CraftBukkit-drag-system.patch similarity index 92% rename from patches/unapplied/server/1043-Fix-CraftBukkit-drag-system.patch rename to patches/server/1013-Fix-CraftBukkit-drag-system.patch index fe2da46cc5..09f889a5eb 100644 --- a/patches/unapplied/server/1043-Fix-CraftBukkit-drag-system.patch +++ b/patches/server/1013-Fix-CraftBukkit-drag-system.patch @@ -10,10 +10,10 @@ public net.minecraft.world.inventory.AbstractContainerMenu quickcraftType public net.minecraft.world.inventory.AbstractContainerMenu resetQuickCraft()V diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index f93edc8a6ed7c51ec6e9335f66ab146d6aeb69a0..589214abe82c2acf6bbfda54b25f9385a6b575c4 100644 +index c9fd2b8cc5a14d4ef4072765d5274d0c470bcfe6..1ab3f730301e8ac22702601a04ad8f1521585daa 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -3127,6 +3127,25 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -3080,6 +3080,25 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } break; case QUICK_CRAFT: @@ -40,10 +40,10 @@ index f93edc8a6ed7c51ec6e9335f66ab146d6aeb69a0..589214abe82c2acf6bbfda54b25f9385 break; case PICKUP_ALL: diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java -index 46159a127d910028c62ada90ff2d2dccc3b62fc3..dd4218e108f87f3305b76fbc8d88f488b447c609 100644 +index 78d0ff45c016e900d87010e8b26b0bb10e63f445..4680f77a275d8d2b226018db89a571ac25998dd8 100644 --- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java +++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java -@@ -431,7 +431,7 @@ public abstract class AbstractContainerMenu { +@@ -468,7 +468,7 @@ public abstract class AbstractContainerMenu { } } else if (this.quickcraftStatus == 2) { if (!this.quickcraftSlots.isEmpty()) { diff --git a/patches/unapplied/server/1044-Fix-SculkBloomEvent-firing-for-block-entity-loading.patch b/patches/server/1014-Fix-SculkBloomEvent-firing-for-block-entity-loading.patch similarity index 91% rename from patches/unapplied/server/1044-Fix-SculkBloomEvent-firing-for-block-entity-loading.patch rename to patches/server/1014-Fix-SculkBloomEvent-firing-for-block-entity-loading.patch index 052376aaeb..c2857c2245 100644 --- a/patches/unapplied/server/1044-Fix-SculkBloomEvent-firing-for-block-entity-loading.patch +++ b/patches/server/1014-Fix-SculkBloomEvent-firing-for-block-entity-loading.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix SculkBloomEvent firing for block entity loading diff --git a/src/main/java/net/minecraft/world/level/block/SculkSpreader.java b/src/main/java/net/minecraft/world/level/block/SculkSpreader.java -index dbdd9cb76f9e2d0962001d9a1e82896c907d7aea..427e9bcb1fa9436543d7ff974eb8642ccce4a6a3 100644 +index b9a1709b79c1f7a21c9d08f986d4ea3b546e4a67..24590d131587c4e1def920333140b1575f9d7471 100644 --- a/src/main/java/net/minecraft/world/level/block/SculkSpreader.java +++ b/src/main/java/net/minecraft/world/level/block/SculkSpreader.java -@@ -125,7 +125,7 @@ public class SculkSpreader { +@@ -126,7 +126,7 @@ public class SculkSpreader { int i = Math.min(list.size(), 32); for (int j = 0; j < i; ++j) { @@ -17,7 +17,7 @@ index dbdd9cb76f9e2d0962001d9a1e82896c907d7aea..427e9bcb1fa9436543d7ff974eb8642c } } -@@ -145,16 +145,16 @@ public class SculkSpreader { +@@ -146,16 +146,16 @@ public class SculkSpreader { while (charge > 0) { int j = Math.min(charge, 1000); diff --git a/patches/unapplied/server/1045-Remove-set-damage-lootable-item-function-from-compas.patch b/patches/server/1015-Remove-set-damage-lootable-item-function-from-compas.patch similarity index 100% rename from patches/unapplied/server/1045-Remove-set-damage-lootable-item-function-from-compas.patch rename to patches/server/1015-Remove-set-damage-lootable-item-function-from-compas.patch diff --git a/patches/unapplied/server/1047-Add-enchantment-seed-update-API.patch b/patches/server/1016-Add-enchantment-seed-update-API.patch similarity index 85% rename from patches/unapplied/server/1047-Add-enchantment-seed-update-API.patch rename to patches/server/1016-Add-enchantment-seed-update-API.patch index 16a2bfd389..3725102979 100644 --- a/patches/unapplied/server/1047-Add-enchantment-seed-update-API.patch +++ b/patches/server/1016-Add-enchantment-seed-update-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add enchantment seed update API diff --git a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java -index 1ef014b29645ed09ccffb898f1819428c3dc6259..9bc9b4218ffd966f43097c9e009b2926af58c810 100644 +index b7300052f3c3d496ea41b681a2d5d5b554e67c63..50a735dd97daab4fb9579f922a4c63de60204f29 100644 --- a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java +++ b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java -@@ -411,4 +411,10 @@ public class EnchantmentMenu extends AbstractContainerMenu { +@@ -399,4 +399,10 @@ public class EnchantmentMenu extends AbstractContainerMenu { return this.bukkitEntity; } // CraftBukkit end @@ -20,7 +20,7 @@ index 1ef014b29645ed09ccffb898f1819428c3dc6259..9bc9b4218ffd966f43097c9e009b2926 + // Paper end - add enchantment seed update API } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/view/CraftEnchantmentView.java b/src/main/java/org/bukkit/craftbukkit/inventory/view/CraftEnchantmentView.java -index 4d28a2e9a4bfd9adee934c3033f32a8cf66286db..3b3d2d6d23d8f3b75ec52df17b86f6639c8c349b 100644 +index 17f0ce8fcb6d44579d88cfcf01de40485b0037dc..abe709ab9002b30a996e46779843969c984c9be9 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/view/CraftEnchantmentView.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/view/CraftEnchantmentView.java @@ -26,6 +26,13 @@ public class CraftEnchantmentView extends CraftInventoryView implements - } else { +@@ -252,8 +252,7 @@ public class ChestBlock extends AbstractChestBlock implements + if (world instanceof ServerLevel worldserver) { MenuProvider itileinventory = this.getMenuProvider(state, world, pos); - if (itileinventory != null) { - player.openMenu(itileinventory); + if (itileinventory != null && player.openMenu(itileinventory).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation player.awardStat(this.getOpenChestStat()); - PiglinAi.angerNearbyPiglins(player, true); + PiglinAi.angerNearbyPiglins(worldserver, player, true); } diff --git a/src/main/java/net/minecraft/world/level/block/CraftingTableBlock.java b/src/main/java/net/minecraft/world/level/block/CraftingTableBlock.java -index 2dedbda759bd5cdc96e1296583cec600bc487464..ace45e3f95940a5770531da0f702dbee51b1032e 100644 +index 673a92d383db463b5c4e2ac3a4ecbd7e97c15c6d..6a2123cd808fa79f3cdb1cb56632d29bfe99058d 100644 --- a/src/main/java/net/minecraft/world/level/block/CraftingTableBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CraftingTableBlock.java -@@ -32,11 +32,10 @@ public class CraftingTableBlock extends Block { - protected InteractionResult useWithoutItem(BlockState state, Level world, BlockPos pos, Player player, BlockHitResult hit) { - if (world.isClientSide) { - return InteractionResult.SUCCESS; -- } else { -- player.openMenu(state.getMenuProvider(world, pos)); -+ } else if (player.openMenu(state.getMenuProvider(world, pos)).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation - player.awardStat(Stats.INTERACT_WITH_CRAFTING_TABLE); -- return InteractionResult.CONSUME; - } -+ return InteractionResult.CONSUME; // Paper - Fix InventoryOpenEvent cancellation - } - +@@ -31,8 +31,9 @@ public class CraftingTableBlock extends Block { @Override + protected InteractionResult useWithoutItem(BlockState state, Level world, BlockPos pos, Player player, BlockHitResult hit) { + if (!world.isClientSide) { +- player.openMenu(state.getMenuProvider(world, pos)); ++ if (player.openMenu(state.getMenuProvider(world, pos)).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation + player.awardStat(Stats.INTERACT_WITH_CRAFTING_TABLE); ++ } // Paper - Fix InventoryOpenEvent cancellation + } + + return InteractionResult.SUCCESS; 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 f6edfea463b3725d3a79aca38825e86dbf82175c..e1021d8be840f378568f28639c259182055c78ac 100644 +index a02f24448b002824b068278fa427003008c0d0f1..0427d590912561cb4f0354715e4ac513e53b3eb3 100644 --- a/src/main/java/net/minecraft/world/level/block/DispenserBlock.java +++ b/src/main/java/net/minecraft/world/level/block/DispenserBlock.java -@@ -78,8 +78,7 @@ public class DispenserBlock extends BaseEntityBlock { - } else { - BlockEntity tileentity = world.getBlockEntity(pos); +@@ -80,8 +80,9 @@ public class DispenserBlock extends BaseEntityBlock { + if (tileentity instanceof DispenserBlockEntity) { + DispenserBlockEntity tileentitydispenser = (DispenserBlockEntity) tileentity; + +- player.openMenu(tileentitydispenser); ++ if (player.openMenu(tileentitydispenser).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation + player.awardStat(tileentitydispenser instanceof DropperBlockEntity ? Stats.INSPECT_DROPPER : Stats.INSPECT_DISPENSER); ++ } // Paper - Fix InventoryOpenEvent cancellation + } + } -- if (tileentity instanceof DispenserBlockEntity) { -- player.openMenu((DispenserBlockEntity) tileentity); -+ if (tileentity instanceof DispenserBlockEntity && player.openMenu((DispenserBlockEntity) tileentity).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation - if (tileentity instanceof DropperBlockEntity) { - player.awardStat(Stats.INSPECT_DROPPER); - } else { diff --git a/src/main/java/net/minecraft/world/level/block/EnderChestBlock.java b/src/main/java/net/minecraft/world/level/block/EnderChestBlock.java -index ca92d49ef2010ba00c623491671dcde8ebe697c1..491a59336899179c79820cd61541d49f7337c0f6 100644 +index ef0d469176ee74b6bb5f9e9cc508735145fda5b8..ebb9baca7a65173f7c9fdf9bf47a8db876719625 100644 --- a/src/main/java/net/minecraft/world/level/block/EnderChestBlock.java +++ b/src/main/java/net/minecraft/world/level/block/EnderChestBlock.java -@@ -90,11 +90,14 @@ public class EnderChestBlock extends AbstractChestBlock i +@@ -86,11 +86,13 @@ public class EnderChestBlock extends AbstractChestBlock i + if (world.getBlockState(blockPos).isRedstoneConductor(world, blockPos)) { // Paper - diff on change; make sure that EnderChest#isBlocked uses the same logic + return InteractionResult.SUCCESS; } else { - EnderChestBlockEntity enderChestBlockEntity = (EnderChestBlockEntity)blockEntity; - playerEnderChestContainer.setActiveChest(enderChestBlockEntity); -- player.openMenu( -+ // Paper start - Fix InventoryOpenEvent cancellation -+ if (player.openMenu( - new SimpleMenuProvider((i, inventory, playerx) -> ChestMenu.threeRows(i, inventory, playerEnderChestContainer), CONTAINER_TITLE) -- ); -- player.awardStat(Stats.OPEN_ENDERCHEST); -- PiglinAi.angerNearbyPiglins(player, true); +- if (world instanceof ServerLevel serverLevel) { ++ // Paper start - Fix InventoryOpenEvent cancellation - moved up; ++ if (world instanceof ServerLevel serverLevel && player.openMenu( ++ new SimpleMenuProvider((i, inventory, playerx) -> ChestMenu.threeRows(i, inventory, playerEnderChestContainer), CONTAINER_TITLE) + ).isPresent()) { -+ player.awardStat(Stats.OPEN_ENDERCHEST); -+ PiglinAi.angerNearbyPiglins(player, true); -+ } -+ // Paper end - Fix InventoryOpenEvent cancellation - return InteractionResult.CONSUME; - } - } else { ++ // Paper end - Fix InventoryOpenEvent cancellation - moved up; + playerEnderChestContainer.setActiveChest(enderChestBlockEntity); +- player.openMenu( +- new SimpleMenuProvider((i, inventory, playerx) -> ChestMenu.threeRows(i, inventory, playerEnderChestContainer), CONTAINER_TITLE) +- ); ++ // Paper - Fix InventoryOpenEvent cancellation - moved up; + player.awardStat(Stats.OPEN_ENDERCHEST); + PiglinAi.angerNearbyPiglins(serverLevel, player, true); + } diff --git a/src/main/java/net/minecraft/world/level/block/FurnaceBlock.java b/src/main/java/net/minecraft/world/level/block/FurnaceBlock.java index 72a3002c291181e7d874a149a22b8004ee2a0b18..618b566f067d53f32351e13b692095ebf6402925 100644 --- a/src/main/java/net/minecraft/world/level/block/FurnaceBlock.java @@ -240,42 +234,39 @@ index 72a3002c291181e7d874a149a22b8004ee2a0b18..618b566f067d53f32351e13b692095eb } } diff --git a/src/main/java/net/minecraft/world/level/block/GrindstoneBlock.java b/src/main/java/net/minecraft/world/level/block/GrindstoneBlock.java -index c62c54fce864f3c28cff955f3030ceb7c3d125d9..ca57d3663afd1ebcbd80682c178344feecda3808 100644 +index 15fb9e8f63d1db1125680aced7f9b477d4ebf43a..59c000612bbf7beb7208af48001d3b1e5111ebd4 100644 --- a/src/main/java/net/minecraft/world/level/block/GrindstoneBlock.java +++ b/src/main/java/net/minecraft/world/level/block/GrindstoneBlock.java -@@ -158,11 +158,10 @@ public class GrindstoneBlock extends FaceAttachedHorizontalDirectionalBlock { - protected InteractionResult useWithoutItem(BlockState state, Level world, BlockPos pos, Player player, BlockHitResult hit) { - if (world.isClientSide) { - return InteractionResult.SUCCESS; -- } else { -- player.openMenu(state.getMenuProvider(world, pos)); -+ } else if (player.openMenu(state.getMenuProvider(world, pos)).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation - player.awardStat(Stats.INTERACT_WITH_GRINDSTONE); -- return InteractionResult.CONSUME; - } -+ return InteractionResult.CONSUME; // Paper - Fix InventoryOpenEvent cancellation - } - +@@ -157,8 +157,9 @@ public class GrindstoneBlock extends FaceAttachedHorizontalDirectionalBlock { @Override + protected InteractionResult useWithoutItem(BlockState state, Level world, BlockPos pos, Player player, BlockHitResult hit) { + if (!world.isClientSide) { +- player.openMenu(state.getMenuProvider(world, pos)); ++ if (player.openMenu(state.getMenuProvider(world, pos)).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation + player.awardStat(Stats.INTERACT_WITH_GRINDSTONE); ++ } // Paper - Fix InventoryOpenEvent cancellation + } + + return InteractionResult.SUCCESS; diff --git a/src/main/java/net/minecraft/world/level/block/HopperBlock.java b/src/main/java/net/minecraft/world/level/block/HopperBlock.java -index 86e5617d445ce762aa374e236a0ccdfe5901fce5..3e1c7d62c24dd48a805260d156135dc4f0c3d1fc 100644 +index b61324fe162f32817b87e4adb80df57b9433259f..005a2a66a6e8a492acfa7ba91117884cda08562d 100644 --- a/src/main/java/net/minecraft/world/level/block/HopperBlock.java +++ b/src/main/java/net/minecraft/world/level/block/HopperBlock.java -@@ -128,8 +128,7 @@ public class HopperBlock extends BaseEntityBlock { - return InteractionResult.SUCCESS; - } else { - BlockEntity blockEntity = world.getBlockEntity(pos); -- if (blockEntity instanceof HopperBlockEntity) { -- player.openMenu((HopperBlockEntity)blockEntity); -+ if (blockEntity instanceof HopperBlockEntity && player.openMenu((HopperBlockEntity)blockEntity).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation - player.awardStat(Stats.INSPECT_HOPPER); - } +@@ -125,8 +125,7 @@ public class HopperBlock extends BaseEntityBlock { + + @Override + protected InteractionResult useWithoutItem(BlockState state, Level world, BlockPos pos, Player player, BlockHitResult hit) { +- if (!world.isClientSide && world.getBlockEntity(pos) instanceof HopperBlockEntity hopperBlockEntity) { +- player.openMenu(hopperBlockEntity); ++ if (!world.isClientSide && world.getBlockEntity(pos) instanceof HopperBlockEntity hopperBlockEntity && player.openMenu(hopperBlockEntity).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation + player.awardStat(Stats.INSPECT_HOPPER); + } diff --git a/src/main/java/net/minecraft/world/level/block/LecternBlock.java b/src/main/java/net/minecraft/world/level/block/LecternBlock.java -index 0c52e1f8bc233bb66e53f4c69e1d8757382bbe81..ebb79907391fe3128d3d16fbe9d8cb0b22bcc9f7 100644 +index 3537795720be76483579fc50715914974c97c9c4..ec6ff0b192ae2f1586095519ad2472e76b2b5589 100644 --- a/src/main/java/net/minecraft/world/level/block/LecternBlock.java +++ b/src/main/java/net/minecraft/world/level/block/LecternBlock.java -@@ -295,8 +295,7 @@ public class LecternBlock extends BaseEntityBlock { +@@ -298,8 +298,7 @@ public class LecternBlock extends BaseEntityBlock { private void openScreen(Level world, BlockPos pos, Player player) { BlockEntity tileentity = world.getBlockEntity(pos); @@ -286,54 +277,50 @@ index 0c52e1f8bc233bb66e53f4c69e1d8757382bbe81..ebb79907391fe3128d3d16fbe9d8cb0b } diff --git a/src/main/java/net/minecraft/world/level/block/LoomBlock.java b/src/main/java/net/minecraft/world/level/block/LoomBlock.java -index 8dd9d92c4730ec9a1cea197817e28e60f70ae3a9..d2f5228e2b0848ca79a7fe6ea79095c230a5f243 100644 +index 2806ca5b0e3c73a3704a514dba2038072947d9ae..1b57f8cf3f4f27f6a76fec82a542ec1c582470c9 100644 --- a/src/main/java/net/minecraft/world/level/block/LoomBlock.java +++ b/src/main/java/net/minecraft/world/level/block/LoomBlock.java -@@ -34,11 +34,10 @@ public class LoomBlock extends HorizontalDirectionalBlock { - protected InteractionResult useWithoutItem(BlockState state, Level world, BlockPos pos, Player player, BlockHitResult hit) { - if (world.isClientSide) { - return InteractionResult.SUCCESS; -- } else { -- player.openMenu(state.getMenuProvider(world, pos)); -+ } else if (player.openMenu(state.getMenuProvider(world, pos)).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation - player.awardStat(Stats.INTERACT_WITH_LOOM); -- return InteractionResult.CONSUME; - } -+ return InteractionResult.CONSUME; // Paper - Fix InventoryOpenEvent cancellation - } - +@@ -33,8 +33,9 @@ public class LoomBlock extends HorizontalDirectionalBlock { @Override + protected InteractionResult useWithoutItem(BlockState state, Level world, BlockPos pos, Player player, BlockHitResult hit) { + if (!world.isClientSide) { +- player.openMenu(state.getMenuProvider(world, pos)); ++ if (player.openMenu(state.getMenuProvider(world, pos)).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation + player.awardStat(Stats.INTERACT_WITH_LOOM); ++ } // Paper - Fix InventoryOpenEvent cancellation + } + + return InteractionResult.SUCCESS; diff --git a/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java b/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java -index 6323c96d9b0cd14f89609b38da37d7fcc12d211b..6b2c3afa04a3564e435633b521d918ed795f9f65 100644 +index a0607cb6c6f74285363dfbd49033a8bde5ca6ae3..155c7240b1112729333e6968122568c707d8f66b 100644 --- a/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java +++ b/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java -@@ -106,8 +106,7 @@ public class ShulkerBoxBlock extends BaseEntityBlock { - } else if (player.isSpectator()) { - return InteractionResult.CONSUME; - } else if (world.getBlockEntity(pos) instanceof ShulkerBoxBlockEntity shulkerBoxBlockEntity) { -- if (canOpen(state, world, pos, shulkerBoxBlockEntity)) { -- player.openMenu(shulkerBoxBlockEntity); -+ if (canOpen(state, world, pos, shulkerBoxBlockEntity) && player.openMenu(shulkerBoxBlockEntity).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation - player.awardStat(Stats.OPEN_SHULKER_BOX); - PiglinAi.angerNearbyPiglins(player, true); - } +@@ -104,8 +104,8 @@ public class ShulkerBoxBlock extends BaseEntityBlock { + protected InteractionResult useWithoutItem(BlockState state, Level world, BlockPos pos, Player player, BlockHitResult hit) { + if (world instanceof ServerLevel serverLevel + && world.getBlockEntity(pos) instanceof ShulkerBoxBlockEntity shulkerBoxBlockEntity +- && canOpen(state, world, pos, shulkerBoxBlockEntity)) { +- player.openMenu(shulkerBoxBlockEntity); ++ && canOpen(state, world, pos, shulkerBoxBlockEntity) // Paper - Fix InventoryOpenEvent cancellation - expand if for belows check ++ && player.openMenu(shulkerBoxBlockEntity).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation + player.awardStat(Stats.OPEN_SHULKER_BOX); + PiglinAi.angerNearbyPiglins(serverLevel, player, true); + } diff --git a/src/main/java/net/minecraft/world/level/block/SmithingTableBlock.java b/src/main/java/net/minecraft/world/level/block/SmithingTableBlock.java -index cd93d0f5b2ba2d3162e14ded3db2e64b598e318f..dae5a125e90514d9eb920ff405c78eea43504698 100644 +index 6b316b8829f542023c20293d664a2d0716fb6c4c..43dc3d2c419a8b4a76de49a1e625076741a98c73 100644 --- a/src/main/java/net/minecraft/world/level/block/SmithingTableBlock.java +++ b/src/main/java/net/minecraft/world/level/block/SmithingTableBlock.java -@@ -39,10 +39,9 @@ public class SmithingTableBlock extends CraftingTableBlock { +@@ -38,8 +38,9 @@ public class SmithingTableBlock extends CraftingTableBlock { + @Override protected InteractionResult useWithoutItem(BlockState state, Level world, BlockPos pos, Player player, BlockHitResult hit) { - if (world.isClientSide) { - return InteractionResult.SUCCESS; -- } else { + if (!world.isClientSide) { - player.openMenu(state.getMenuProvider(world, pos)); -+ } else if (player.openMenu(state.getMenuProvider(world, pos)).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation ++ if (player.openMenu(state.getMenuProvider(world, pos)).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation player.awardStat(Stats.INTERACT_WITH_SMITHING_TABLE); -- return InteractionResult.CONSUME; ++ } // Paper - Fix InventoryOpenEvent cancellation } -+ return InteractionResult.CONSUME; // Paper - Fix InventoryOpenEvent cancellation - } - } + + return InteractionResult.SUCCESS; diff --git a/src/main/java/net/minecraft/world/level/block/SmokerBlock.java b/src/main/java/net/minecraft/world/level/block/SmokerBlock.java index b0929942ca06ee14d2ba4f2ec2ee93743ee6233e..83669dfbfec46d319aec82ea2beaa90c9f6b81c3 100644 --- a/src/main/java/net/minecraft/world/level/block/SmokerBlock.java @@ -349,20 +336,17 @@ index b0929942ca06ee14d2ba4f2ec2ee93743ee6233e..83669dfbfec46d319aec82ea2beaa90c } } diff --git a/src/main/java/net/minecraft/world/level/block/StonecutterBlock.java b/src/main/java/net/minecraft/world/level/block/StonecutterBlock.java -index c6ecb378d0cb2ac05b8f22f92fb85df060038f77..59fd521cd1e1101e2adce9830c43784e05abccdd 100644 +index 3a879d1a469a8f597bfba861d41abd75a5743ab8..e61644241f24b42bb4f702d3eef5b590b4d107c8 100644 --- a/src/main/java/net/minecraft/world/level/block/StonecutterBlock.java +++ b/src/main/java/net/minecraft/world/level/block/StonecutterBlock.java -@@ -49,11 +49,10 @@ public class StonecutterBlock extends Block { +@@ -48,8 +48,9 @@ public class StonecutterBlock extends Block { + @Override protected InteractionResult useWithoutItem(BlockState state, Level world, BlockPos pos, Player player, BlockHitResult hit) { - if (world.isClientSide) { - return InteractionResult.SUCCESS; -- } else { + if (!world.isClientSide) { - player.openMenu(state.getMenuProvider(world, pos)); -+ } else if (player.openMenu(state.getMenuProvider(world, pos)).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation ++ if (player.openMenu(state.getMenuProvider(world, pos)).isPresent()) { // Paper - Fix InventoryOpenEvent cancellation player.awardStat(Stats.INTERACT_WITH_STONECUTTER); -- return InteractionResult.CONSUME; ++ } // Paper - Fix InventoryOpenEvent cancellation } -+ return InteractionResult.CONSUME; // Paper - Fix InventoryOpenEvent cancellation - } - @Nullable + return InteractionResult.SUCCESS; diff --git a/patches/unapplied/server/1050-Fire-BlockExpEvent-on-grindstone-use.patch b/patches/server/1019-Fire-BlockExpEvent-on-grindstone-use.patch similarity index 94% rename from patches/unapplied/server/1050-Fire-BlockExpEvent-on-grindstone-use.patch rename to patches/server/1019-Fire-BlockExpEvent-on-grindstone-use.patch index 58783e8acd..e5944fabfe 100644 --- a/patches/unapplied/server/1050-Fire-BlockExpEvent-on-grindstone-use.patch +++ b/patches/server/1019-Fire-BlockExpEvent-on-grindstone-use.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fire BlockExpEvent on grindstone use diff --git a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java -index 1678f6c8b2c7db761783e53043169bf12bc2cb29..138f77d13dda574def523d74fa55bc71b5bfa01b 100644 +index 3b303d41b9facfb2892ff8402ee0de4608db7318..5687f492fc76f699e2a388790ca5380d9b8c8d0a 100644 --- a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java +++ b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java @@ -98,7 +98,11 @@ public class GrindstoneMenu extends AbstractContainerMenu { diff --git a/patches/unapplied/server/1051-Check-dead-flag-in-isAlive.patch b/patches/server/1020-Check-dead-flag-in-isAlive.patch similarity index 80% rename from patches/unapplied/server/1051-Check-dead-flag-in-isAlive.patch rename to patches/server/1020-Check-dead-flag-in-isAlive.patch index e00e21c5b9..c58a1f41f8 100644 --- a/patches/unapplied/server/1051-Check-dead-flag-in-isAlive.patch +++ b/patches/server/1020-Check-dead-flag-in-isAlive.patch @@ -15,10 +15,10 @@ Also, even if the plugin is responsibly checking !isDead() before modifying heal I am currently unable to replicate, these "revived" entities can still appear diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 13c93281f6b81e88f2f54befb8e6a3e4bdabf53d..30f4f1254fc295442d72d50479e8af635f2fe983 100644 +index b4d1848858fae20f81c27b31bc0c280c6705f082..f57c830a7286eb8cab1061c8ddebe6abab1fcced 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -2096,7 +2096,7 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -2147,7 +2147,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @Override public boolean isAlive() { @@ -26,4 +26,4 @@ index 13c93281f6b81e88f2f54befb8e6a3e4bdabf53d..30f4f1254fc295442d72d50479e8af63 + return !this.isRemoved() && this.getHealth() > 0.0F && !this.dead; // Paper - Check this.dead } - @Override + public boolean isLookingAtMe(LivingEntity entity, double d0, boolean flag, boolean visualShape, Predicate predicate, DoubleSupplier... entityYChecks) { diff --git a/patches/unapplied/server/1046-Properly-destroy-placed-blocks-on-the-end-platform.patch b/patches/unapplied/server/1046-Properly-destroy-placed-blocks-on-the-end-platform.patch deleted file mode 100644 index c81ee5b7b2..0000000000 --- a/patches/unapplied/server/1046-Properly-destroy-placed-blocks-on-the-end-platform.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: DerEchtePilz <81232921+DerEchtePilz@users.noreply.github.com> -Date: Sun, 18 Aug 2024 13:05:31 +0200 -Subject: [PATCH] Properly destroy placed blocks on the end platform - -The craftbukkit provided implementation of LevelAccessor, -BlockStateListPopulator, does not support destroyBlock calls, simply -ignoring them. - -This causes the destroyBlock calls during the generation of the end -platform to be lost. The patch moves the destroy calls and executes them -on the actual world access. - -diff --git a/src/main/java/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.java b/src/main/java/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.java -index ff1f151b342a1567605f92a921fc7ab01f1c4807..b92c40352e4f1af05a2f90701b3f74c235ae57cf 100644 ---- a/src/main/java/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.java -+++ b/src/main/java/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.java -@@ -44,7 +44,7 @@ public class EndPlatformFeature extends Feature { - // CraftBukkit start - if (!blockList.getBlockState(blockposition_mutableblockposition1).is(block)) { - if (flag) { -- blockList.destroyBlock(blockposition_mutableblockposition1, true, (Entity) null); -+ // blockList.destroyBlock(blockposition_mutableblockposition1, true, (Entity) null); // Paper - moved down - cb implementation of LevelAccessor does not support destroyBlock - } - - blockList.setBlock(blockposition_mutableblockposition1, block.defaultBlockState(), 3);