Remove unnecesary item check for ServerboundPlayerActionPacket RELEASE_USE_ITEM (#12668)

This commit is contained in:
Pedro
2025-06-25 16:09:11 -04:00
committed by GitHub
parent ea10fa4a79
commit aa6cd74c03

View File

@@ -1146,8 +1146,7 @@
return; return;
case RELEASE_USE_ITEM: case RELEASE_USE_ITEM:
- this.player.releaseUsingItem(); this.player.releaseUsingItem();
+ if (this.player.getUseItem() == this.player.getItemInHand(this.player.getUsedItemHand())) this.player.releaseUsingItem(); // Paper - validate use item before processing release
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.updateEquipmentOnPlayerActions) this.player.detectEquipmentUpdates(); // Paper - Force update attributes. + if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.updateEquipmentOnPlayerActions) this.player.detectEquipmentUpdates(); // Paper - Force update attributes.
return; return;
case START_DESTROY_BLOCK: case START_DESTROY_BLOCK: