Skip to content

Options

Asintoto edited this page Jul 15, 2024 · 2 revisions

Basic Options

Here you will find all the (currenly) avaible Basic Options and how to use them


Primary Method (Reccomended)

Initialize the componets

public final class YourPlugin extends BasicPlugin{
    @Override
    public void onPluginLoad() {

        Basic.options().saveRegions() // Enable Region saving and loading (see more in the "Regions" page)
        Basic.options().saveHolograms() // Enable Holograms saving and loading (see more in the "Holograms" page)
        Basic.options().dataFolderName("your folder name") // Edit the name of the folder used to store data (such as regions and holograms)
        Basic.options().debug() // Enable Debug Mode: it prints status messages in the server console. Useful in case of errors

        // Your plugin loading logic
    }

    @Override
    public void onPluginEnable() {
        // Your plugin start up logic
    }

    @Override
    public void onPluginDisable() {
        // Your plugin disabling logic
    }
    

    // Other plugin logic

}

Note: You can also put Basic's Options in the onPluginEnable() method but it is NOT reccomended

Alternative Method (NOT Reccomended)

Initialize the componets

public final class YourPlugin extends JavaPlugin {

    @Override
    public void onEnable() {

        Basic.options().saveRegions() // Enable Region saving and loading (see more in the "Regions" page)
        Basic.options().saveHolograms() // Enable Holograms saving and loading (see more in the "Holograms" page)
        Basic.options().dataFolderName("your folder name") // Edit the name of the folder used to store data (such as regions and holograms)
        Basic.options().debug() // Enable Debug Mode: it prints status messages in the server console. Useful in case of errors

        Basic.init(this);

        // Your plugin start up logic

    }

   // Other plugin logic
}

The method Basic.options() returns and object Options which can be edited using its Getters and Setters. The methods shown in the example all return and Options object so you can just call them one after each other (Ex. Basic.options().saveRegions().debug())

Note: You can also put Basic's Options in the onLoad() method and keep the Basic.init() method in the onEnable() method

Note: You must specify all Basic's Options before initializing it otherwise they won't work during the initialization process.

Note: It's highly reccomented NOT to edit options outside the onEnable() method, they might not work as intended.