Parameters
- tooltype
- the
Type
of the tool to be replaced; this should not be a base class of the actual tool instance type - newtool
- the tool to use instead of the existing one of
Type
tooltype; if null, the old tool is only removed
Return Value
the tool that was replaced, or null if no such instance was found