Settings
These are the settings that can be used to configure the plugin. You will be able to click on the gear button in the plugin list to access these settings in the GUI. These settings will be saved with your normal Mint Client settings and will be loaded when the plugin is loaded.
Important about settings
Settings are located in the com.originmint.plugin.settings package.
Settings can only be used as a field in the class where IPlugin is implemented.
Boolean
A boolean setting can be either true or false. This is imported from com.originmint.plugin.settings.Boolean.
Boolean booleanExample = new Boolean("id", "Example", "Description", false);
And this is how you can use it in your plugin via the .value property:
if (booleanExample.value) {
// Do something
}
Number
A number is an integer setting. This is imported from com.originmint.plugin.settings.Number.
Number numberExample = new Number("id", "Example", "Description", 5);
And this is how you can use it in your plugin via the .value property:
if (numberExample.value > 5) {
// Do something
}
Integer Slider
An integer slider is a setting that can be set with a slider in the GUI.
This is imported from com.originmint.plugin.settings.IntSlider.
IntSlider intSliderExample = new IntSlider("id", "Example", "Description", 0, 15, 5);
And this is how you can use it in your plugin via the .value property:
if (intSliderExample.value > 5) {
// Do something
}
Float Slider
A float slider is a setting that can be set with a slider in the GUI.
This is imported from com.originmint.plugin.settings.FloatSlider.
FloatSlider floatSliderExample = new FloatSlider("id", "Example", "Description", 0.0f, 1.0f, 0.5f);
And this is how you can use it in your plugin via the .value property:
if (floatSliderExample.value > 0.5f) {
// Do something
}
String / Text
A string setting is a setting that can be set with a text field in the GUI.
This is imported from com.originmint.plugin.settings.Text.
Text textExample = new Text("id", "Example", "Description", "Default Value");
And this is how you can use it in your plugin via the .value property:
if (textExample.value.equals("Default Value")) {
// Do something
}
String / Text List
A string list setting is a setting that can be set with a text field in the GUI.
This is mostly used to be edited in the GUI as a list of strings.
This is imported from com.originmint.plugin.settings.TextList.
TextList textListExample = new TextList("id", "Example", "Description", new ArrayList<>());
And this is how you can use it in your plugin via the .value property:
if (textListExample.value.contains("Example")) {
// Do something
}
Coords
A coords setting is a setting that can be set with a text field in the GUI.
It contains 3 float values for x, y, and z.
This is imported from com.originmint.plugin.settings.Coords.
Coords coordsExample = new Coords("id", "Example", "Description", 0.0f, 0.0f, 0.0f);
And this is how you can use it in your plugin via the .x, .y, and .z properties:
if (coordsExample.x > 0.0f) {
// Do something
}
Coords List
A coords list setting is a setting that can be set with a text field in the GUI.
This is mostly used to be edited in the GUI as a list of coords.
This is imported from com.originmint.plugin.settings.CoordsList.
CoordsList coordsListExample = new CoordsList("id", "Example", "Description", new ArrayList<>());
The positions field is a list of Pos objects with x, y, and z properties:
public class CoordsList$Pos {
public int x;
public int y;
public int z;
public CoordsList$Pos(int x, int y, int z) {
this.x = x;
this.y = y;
this.z = z;
}
}
You can define and create a new Pos object like this:
CoordsList.Pos pos = new CoordsList.Pos(0, 0, 0);
And this is how you can use it in your plugin via the .positions property:
if (coordsListExample.positions.get(0).x > 0.0f) {
// Do something
}
or you can loop through the list:
for (CoordsList.Pos pos : coordsListExample.positions) {
if (pos.x > 0.0f) {
// Do something
}
}