mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-08-03 19:17:27 -04:00
Fixed check for whether used item has been 'used up' in robots for cases where the stack is replaced by the interact function. Fixes #583.
This commit is contained in:
parent
2d9cdfac72
commit
860130cff2
@ -128,13 +128,11 @@ class Player(val robot: tileentity.Robot) extends FakePlayer(robot.world.asInsta
|
|||||||
false
|
false
|
||||||
}
|
}
|
||||||
!cancel && callUsingItemInSlot(0, stack => {
|
!cancel && callUsingItemInSlot(0, stack => {
|
||||||
val current = getCurrentEquippedItem
|
|
||||||
|
|
||||||
val result = isItemUseAllowed(stack) && (entity.interactFirst(this) || (entity match {
|
val result = isItemUseAllowed(stack) && (entity.interactFirst(this) || (entity match {
|
||||||
case living: EntityLivingBase if current != null => current.func_111282_a(this, living)
|
case living: EntityLivingBase if getCurrentEquippedItem != null => getCurrentEquippedItem.func_111282_a(this, living)
|
||||||
case _ => false
|
case _ => false
|
||||||
}))
|
}))
|
||||||
if (current != null && current.stackSize <= 0) {
|
if (getCurrentEquippedItem != null && getCurrentEquippedItem.stackSize <= 0) {
|
||||||
destroyCurrentEquippedItem()
|
destroyCurrentEquippedItem()
|
||||||
}
|
}
|
||||||
result
|
result
|
||||||
|
Loading…
x
Reference in New Issue
Block a user