From 96179f3a51788dca56c305934ddc8b792338de52 Mon Sep 17 00:00:00 2001 From: Vexatos Date: Sun, 12 Feb 2017 12:56:18 +0100 Subject: [PATCH 1/2] Fix #2272. --- src/main/scala/li/cil/oc/common/entity/Drone.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/scala/li/cil/oc/common/entity/Drone.scala b/src/main/scala/li/cil/oc/common/entity/Drone.scala index aeabb8a59..7d8ffeba8 100644 --- a/src/main/scala/li/cil/oc/common/entity/Drone.scala +++ b/src/main/scala/li/cil/oc/common/entity/Drone.scala @@ -465,6 +465,7 @@ class Drone(val world: World) extends Entity(world) with MachineHost with intern } override def interactFirst(player: EntityPlayer) = { + if(isDead) return false if (player.isSneaking) { if (Wrench.isWrench(player.getHeldItem)) { if(!world.isRemote) { @@ -536,6 +537,7 @@ class Drone(val world: World) extends Entity(world) with MachineHost with intern } override def kill(): Unit = { + if(isDead) return super.kill() if (!world.isRemote) { val stack = api.Items.get(Constants.ItemName.Drone).createItemStack(1) From eaa6582cdeb3e49a35c15b449a6ed21e83a8e36d Mon Sep 17 00:00:00 2001 From: Vexatos Date: Sun, 12 Feb 2017 13:01:29 +0100 Subject: [PATCH 2/2] Made everything compile. --- src/main/scala/li/cil/oc/common/entity/Drone.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/scala/li/cil/oc/common/entity/Drone.scala b/src/main/scala/li/cil/oc/common/entity/Drone.scala index 7d8ffeba8..5641a56d8 100644 --- a/src/main/scala/li/cil/oc/common/entity/Drone.scala +++ b/src/main/scala/li/cil/oc/common/entity/Drone.scala @@ -464,8 +464,8 @@ class Drone(val world: World) extends Entity(world) with MachineHost with intern super.hitByEntity(entity) } - override def interactFirst(player: EntityPlayer) = { - if(isDead) return false + override def interactFirst(player: EntityPlayer): Boolean = { + if (isDead) return false if (player.isSneaking) { if (Wrench.isWrench(player.getHeldItem)) { if(!world.isRemote) { @@ -537,7 +537,7 @@ class Drone(val world: World) extends Entity(world) with MachineHost with intern } override def kill(): Unit = { - if(isDead) return + if (isDead) return super.kill() if (!world.isRemote) { val stack = api.Items.get(Constants.ItemName.Drone).createItemStack(1)