API/Guide to making a Toolset

Guide to making a toolset

Step 1: Making the toolset class

Before the toolset can be registered we first have to define a toolset class which defines the toolset.
Create a class that extends 'mcmount.trainjo.supertool.toolset.ToolSet'.
For this class we have to make a public constructor which calls the protected constructor of ToolSet.
The constructor of ToolSet requires a left tool, a right tool and a name.
The left and right tool can be given by calling the ToolLink.GetTool(String name) method. Do not pass other tool classes to the toolset constructor other than the registered ones. Using the GetTool method guarantees you that you passed the right tool and allows you to easily enter a tool by just entering it's name.
The name can be anything as long as it is a string.
That's all you need for the ToolSet class

Step 2: Registering the Toolset

To register your toolset, just pass a new instance of the toolset class you created to the ToolLink.RegisterToolSet method.
This method will return true if the toolset has been registered allowing you to easily check whether the register succeeded.
That's all folks


Comments

Posts Quoted:
Reply
Clear All Quotes