|
577 | 577 |
|
578 | 578 | this.player.connection.send(new ClientboundSetHeldSlotPacket(inventory.selected));
|
579 | 579 | this.player.inventoryMenu.broadcastChanges();
|
580 |
| -+ this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes. |
| 580 | ++ if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.updateEquipmentOnPlayerActions) this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes. |
581 | 581 | }
|
582 | 582 | }
|
583 | 583 |
|
|
1103 | 1103 | + }
|
1104 | 1104 | + // CraftBukkit end
|
1105 | 1105 | this.player.stopUsingItem();
|
1106 |
| -+ this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes. |
| 1106 | ++ if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.updateEquipmentOnPlayerActions) this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes. |
1107 | 1107 | }
|
1108 | 1108 |
|
1109 | 1109 | return;
|
|
1125 | 1125 | + }
|
1126 | 1126 | + // CraftBukkit end
|
1127 | 1127 | this.player.drop(false);
|
1128 |
| -+ this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes. |
| 1128 | ++ if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.updateEquipmentOnPlayerActions) this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes. |
1129 | 1129 | }
|
1130 | 1130 |
|
1131 | 1131 | return;
|
1132 | 1132 | case DROP_ALL_ITEMS:
|
1133 | 1133 | if (!this.player.isSpectator()) {
|
1134 | 1134 | this.player.drop(true);
|
1135 |
| -+ this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes. |
| 1135 | ++ if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.updateEquipmentOnPlayerActions) this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes. |
1136 | 1136 | }
|
1137 | 1137 |
|
1138 | 1138 | return;
|
1139 | 1139 | case RELEASE_USE_ITEM:
|
1140 | 1140 | - this.player.releaseUsingItem();
|
1141 | 1141 | + if (this.player.getUseItem() == this.player.getItemInHand(this.player.getUsedItemHand())) this.player.releaseUsingItem(); // Paper - validate use item before processing release
|
1142 |
| -+ this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes. |
| 1142 | ++ if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.updateEquipmentOnPlayerActions) this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes. |
1143 | 1143 | return;
|
1144 | 1144 | case START_DESTROY_BLOCK:
|
1145 | 1145 | case ABORT_DESTROY_BLOCK:
|
|
1172 | 1172 | + }
|
1173 | 1173 | + }
|
1174 | 1174 | + // Paper end - Send block entities after destroy prediction
|
1175 |
| -+ this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes. |
| 1175 | ++ if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.updateEquipmentOnPlayerActions) this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes. |
1176 | 1176 | return;
|
1177 | 1177 | default:
|
1178 | 1178 | throw new IllegalArgumentException("Invalid player action");
|
|
1247 | 1247 |
|
1248 | 1248 | this.player.connection.send(new ClientboundBlockUpdatePacket(serverLevel, blockPos));
|
1249 | 1249 | this.player.connection.send(new ClientboundBlockUpdatePacket(serverLevel, blockPos.relative(direction)));
|
1250 |
| -+ this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes. |
| 1250 | ++ if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.updateEquipmentOnPlayerActions) this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes. |
1251 | 1251 | } else {
|
1252 | 1252 | LOGGER.warn(
|
1253 | 1253 | "Rejecting UseItemOnPacket from {}: Location {} too far away from hit block {}.",
|
|
1397 | 1397 |
|
1398 | 1398 | this.player.getInventory().selected = packet.getSlot();
|
1399 | 1399 | this.player.resetLastActionTime();
|
1400 |
| -+ this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes. |
| 1400 | ++ if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.updateEquipmentOnPlayerActions) this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes. |
1401 | 1401 | } else {
|
1402 | 1402 | LOGGER.warn("{} tried to set an invalid carried item", this.player.getName().getString());
|
1403 | 1403 | + this.disconnect(Component.literal("Invalid hotbar selection (Hacking?)"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // CraftBukkit // Paper - kick event cause
|
|
2004 | 2004 | + });
|
2005 | 2005 | + }
|
2006 | 2006 | + // Paper end - PlayerUseUnknownEntityEvent
|
2007 |
| -+ this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes. |
| 2007 | ++ if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.updateEquipmentOnPlayerActions) this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes. |
2008 | 2008 | }
|
2009 | 2009 | }
|
2010 | 2010 |
|
|
2410 | 2410 | } else {
|
2411 | 2411 | this.player.containerMenu.broadcastChanges();
|
2412 | 2412 | }
|
2413 |
| -+ this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes. |
| 2413 | ++ if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.updateEquipmentOnPlayerActions) this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes. |
2414 | 2414 | }
|
2415 | 2415 | }
|
2416 | 2416 | }
|
|
2487 | 2487 | if (flag) {
|
2488 | 2488 | this.player.containerMenu.broadcastChanges();
|
2489 | 2489 | }
|
2490 |
| -+ this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes. |
| 2490 | ++ if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.updateEquipmentOnPlayerActions) this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes. |
2491 | 2491 | }
|
2492 | 2492 | }
|
2493 | 2493 | }
|
|
2536 | 2536 | this.player.inventoryMenu.getSlot(packet.slotNum()).setByPlayer(itemStack);
|
2537 | 2537 | this.player.inventoryMenu.setRemoteSlot(packet.slotNum(), itemStack);
|
2538 | 2538 | this.player.inventoryMenu.broadcastChanges();
|
2539 |
| -+ this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes. |
| 2539 | ++ if (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.updateEquipmentOnPlayerActions) this.player.detectEquipmentUpdatesPublic(); // Paper - Force update attributes. |
2540 | 2540 | } else if (flag && flag2) {
|
2541 | 2541 | if (this.dropSpamThrottler.isUnderThreshold()) {
|
2542 | 2542 | this.dropSpamThrottler.increment();
|
|
0 commit comments