mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-15 18:34:56 -04:00
interactions: don't interact with offhand if unavailable (<1.9)
This commit is contained in:
parent
56b495a514
commit
bc0dc833f4
@ -89,6 +89,10 @@ class UseHandler(
|
|||||||
// check both hands if we can interact
|
// check both hands if we can interact
|
||||||
// if we can, stop further interactions
|
// if we can, stop further interactions
|
||||||
for (hand in Hands.VALUES) {
|
for (hand in Hands.VALUES) {
|
||||||
|
if (hand == Hands.OFF && !connection.version.hasOffhand) {
|
||||||
|
// only one hand available
|
||||||
|
return
|
||||||
|
}
|
||||||
val stack = connection.player.items.inventory[hand]
|
val stack = connection.player.items.inventory[hand]
|
||||||
|
|
||||||
if (target != null && short.tryUse(hand, target, stack)) {
|
if (target != null && short.tryUse(hand, target, stack)) {
|
||||||
@ -115,12 +119,6 @@ class UseHandler(
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
sendItemUse(hand, stack)
|
sendItemUse(hand, stack)
|
||||||
|
|
||||||
|
|
||||||
if (!connection.version.hasOffhand) {
|
|
||||||
// only one hand available
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user