mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-18 11:48:02 -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 {
|
||||
case proxy: tileentity.RobotProxy =>
|
||||
val robot = proxy.robot
|
||||
if (robot.player == player) return false
|
||||
if (!world.isRemote && (!player.capabilities.isCreativeMode || proxy.globalBuffer > 1 || proxy.robot.xp > 0)) {
|
||||
parent.dropBlockAsItem(world, x, y, z, robot.createItemStack())
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user