API - LandlordPlugin/LandLord Wiki

LandLord Developer API

Dependency

Sonatype Nexus (Releases) Sonatype Nexus (Development) Sonatype Nexus (Snapshots)

If you want to use landlord as a dependency you can these.
Make sure to replace the version with the release version from above.

Gradle

repositories {
    maven("https://eldonexus.de/repository/maven-public/")
}

dependencies {
    implementation("biz.princeps", "landlord-core", "{version}")
}

Maven

<repository>
    <id>EldoNexus</id>
    <url>https://eldonexus.de/repository/maven-releases/</url>
</repository>

<dependency>
    <groupId>biz.princeps</groupId>
    <artifactId>landlord-core</artifactId>
    <version>{version}</version>
</dependency>

Notes: How's landlord working internally?

LandLord itself doesnt store any lands. Weird, isnt it? All lands are stored via worldguard. That basically means, LandLord is just a fancy wrapper around worldguard with a shitton of extra functions.
Why did I decided to this way? Because I don't like to reinvent the wheel, but rather focus on features and stability.
Although LandLord is not storing any lands, its still storing something. There are two storage providers: FlatFile or SQL. FlatFile-sample:

0d6c305c-da31-4664-b9f3-bba7389f29ae:
  claims: 0
  home: ''
  lastlogin: 2019-06-08 14:18 

Database-scheme:

ll_players (uuid VARCHAR(36) NOT NULL, name VARCHAR(16), claims INTEGER, home TEXT, lastseen VARCHAR(50), PRIMARY KEY(uuid))

In case you wanna sync the playerdata across multiple servers, feel free to use mysql.

Hook into landlord

Into your plugin.yml:

depend: [Landlord]

In your Main class:

private ILandLord api;

@Override
public void enable(){
    try {
            this.api = (ILandLord) getServer().getPluginManager().getPlugin("Landlord");
        } catch (NoClassDefFoundError ex) {
            getLogger().warning("Landlord missing!");
            this.getPluginLoader().disablePlugin(this);
            return;
        }
}

The ILandLord interface

This methods are provided directly in 'this.api'.

public interface ILandLord {

    /**
     * Adapter to JavaPlugin#getConfig
     *
     * @return the config file
     */
    FileConfiguration getConfig();

    /**
     * Adapter to JavaPlugin#getConfig
     *
     * @return the config file
     */
    Logger getLogger();

    /**
     * Returns the instance of the JavaPlugin.
     * Useful for starting runnables.
     *
     * @return instance of JavaPlugin
     */
    JavaPlugin getPlugin();


    /**
     * Gets the reference to the WorldGuardManager.
     * This class is responsible to handle all interactions with worldguard.
     *
     * @return the worldguard manager
     */
    IWorldGuardManager getWGManager();

    /**
     * Gets the reference to the MaterialManager.
     * This class is responsible to handle Materials and Itemstacks, that change from version to version.
     *
     * @return the mat manager
     */
    IMaterialsManager getMaterialsManager();

    /**
     * Gets the reference to the UtilsManager
     * This class is responsible to handle interactions with spigot, that change from version to version.
     *
     * @return the utils manager
     */
    IUtilsManager getUtilsManager();

    /**
     * Gets the reference to the PlayerManager.
     * This class is responsible to handle interactions with LPlayers.
     *
     * @return the player manager
     */
    IPlayerManager getPlayerManager();

    /**
     * Gets the reference to the CostManager.
     * This class calculates costs for the next claim.
     *
     * @return the cost manager
     */
    ICostManager getCostManager();

    /**
     * Gets the reference to the MapManager.
     * This class handles interactions with the land map system.
     *
     * @return the map manager
     */
    IMapManager getMapManager();

    /**
     * Gets the reference to the language manager.
     * This class is responsible to handle translations.
     *
     * @return the language manager
     */
    ILangManager getLangManager();

    /**
     * Gets the reference to the vault manager.
     * This class is responsible for interactions with money.
     *
     * @return the vault manager
     */
    IVaultManager getVaultManager();

    /**
     * Gets the reference to the delimitation manager.
     * This class is responsible for the delimitation of lands.
     *
     * @return the delimitation manager
     */
    IDelimitationManager getDelimitationManager();

    /**
     * Sets up PrincepsLib. Also sets specific translated messages for princepslib.
     */
    void setupPrincepsLib();

    /**
     * Post load PrincepsLib. Also sets specific translated messages for princepslib and initializes commands.
     */
    void postloadPrincepsLib();

    /**
     * Get the reference to the MobManager.
     * This class is responsible to interact with spigot mobs that change from version to version.
     *
     * @return the mob manager
     */
    IMobManager getMobManager();

    /**
     * Get the reference to the RegenerationManager.
     * The RegenerationManager is used to regenerate single chunks.
     *
     * @return the regeneration manager
     */
    IRegenerationManager getRegenerationManager();

    /**
     * Get the reference to the MultiTaskManager.
     * The MultiTaskManager is used to spread load of huge multi tasks and their operations over ticks.
     *
     * @return the multi task manager
     */
    IMultiTaskManager getMultiTaskManager();

}

public class Options {
    // Provides some fancy static methods, so you don't have to query the landlord config. 
}

Events

  • LandPreClaimEvent - called when a land is about to happen. May be cancelled
  • LandPostClaimEvent - called when a land was successful
  • LandUnclaimEvent - called when a land was unclaimed
  • PlayerBrokeSecureWorldEvent - called when a player tried to break something, but was stopped by SecureWorld. Cancelling will allow the break process.
  • LandManageEvent - called when a land is managed and an option was changed
  • LandChangeEvent - called when a player changes the land
  • LandClearEvent - called when a land is cleared
  • LandClearInactivityEvent - called when a player is cleared due to its inactivity

Other

all of the other Interfaces (starting with a big I) can be found here.

⚠️ **GitHub.com Fallback** ⚠️