Skip to content

Commit a15720b

Browse files
committed
update decay timeout and use player screen handler when syncId is 0 in onSlotUpdate
1 parent 0bbcb0e commit a15720b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/kotlin/com/lambda/interaction/request/inventory/InventoryManager.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ object InventoryManager : RequestHandler<InventoryRequest>(
119119
PlaceManager.logger.debug("Populating from request", request)
120120
actions = request.actions.toMutableList()
121121
maxActionsThisSecond = request.inventoryConfig.actionsPerSecond
122+
alteredSlots.setDecayTime(AutomationConfig.desyncTimeout * 50L)
122123
}
123124

124125
private fun SafeContext.indexInventoryChanges() {
@@ -188,7 +189,7 @@ object InventoryManager : RequestHandler<InventoryRequest>(
188189

189190
if (packet.syncId == 0) {
190191
if (PlayerScreenHandler.isInHotbar(packet.slot) && !itemStack.isEmpty) {
191-
val itemStack2 = screenHandler?.getSlot(packet.slot)?.stack ?: return
192+
val itemStack2 = player.playerScreenHandler.getSlot(packet.slot).stack
192193
if (itemStack2.isEmpty || itemStack2.count < itemStack.count) {
193194
itemStack.bobbingAnimationTime = 5
194195
}

0 commit comments

Comments
 (0)