mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-19 04:06:43 -04:00
added check in block break callback of robots to avoid having them break themselves (e.g. with tools that break multiple blocks at once)
This commit is contained in:
parent
16e9aead60
commit
a685c22499
@ -143,10 +143,11 @@ class RobotProxy(val parent: SpecialDelegator) extends RedstoneAware with Specia
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override def removedByEntity(world: World, x: Int, y: Int, z: Int, player: EntityPlayer) = {
|
override def removedByEntity(world: World, x: Int, y: Int, z: Int, player: EntityPlayer): Boolean = {
|
||||||
world.getBlockTileEntity(x, y, z) match {
|
world.getBlockTileEntity(x, y, z) match {
|
||||||
case proxy: tileentity.RobotProxy =>
|
case proxy: tileentity.RobotProxy =>
|
||||||
val robot = proxy.robot
|
val robot = proxy.robot
|
||||||
|
if (robot.player == player) return false
|
||||||
if (!world.isRemote && (!player.capabilities.isCreativeMode || proxy.globalBuffer > 1 || proxy.robot.xp > 0)) {
|
if (!world.isRemote && (!player.capabilities.isCreativeMode || proxy.globalBuffer > 1 || proxy.robot.xp > 0)) {
|
||||||
parent.dropBlockAsItem(world, x, y, z, robot.createItemStack())
|
parent.dropBlockAsItem(world, x, y, z, robot.createItemStack())
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user