blob: 5e1b894348aa30a27b03002417e8e85a343f602c [file] [log] [blame] [raw]
package li.cil.oc.common.item
import li.cil.oc.common.entity
import net.minecraft.entity.player.EntityPlayer
import net.minecraft.item.ItemStack
import net.minecraft.world.World
class Drone(val parent: Delegator) extends Delegate {
override def onItemUse(stack: ItemStack, player: EntityPlayer, world: World, x: Int, y: Int, z: Int, side: Int, hitX: Float, hitY: Float, hitZ: Float) = {
if (!world.isRemote) {
val drone = new entity.Drone(world)
drone.initializeAfterPlacement(stack, player, x, y, z, hitX, hitY, hitZ)
world.spawnEntityInWorld(drone)
}
stack.stackSize -= 1
true
}
}