Skip to content
Fulminazzo edited this page Nov 5, 2023 · 3 revisions

Welcome to TeleportEffects Wiki!
Before we begin, TeleportEffects uses a reduced version of BearCommands to function and to provide an API. We will assume that you have a basic knowledge of this plugin and some experience with it.
TeleportEffects is a relatively small plugin, and some may want to integrate it in their custom mode core (for example a FactionCore) or in their teleportation plugin. In any case, achieving this goal is trivial.
First thing first, you will need to create a Custom Player that extends TeleportPlayer.

package it.fulminazzo.testplugin.Objects;

import it.fulminazzo.teleporteffects.Objects.TeleportPlayer;
import it.fulminazzo.testplugin.TestPlugin;
import org.bukkit.OfflinePlayer;

import java.io.File;

public class TestPlayer extends TeleportPlayer {
    public TestPlayer(TestPlugin plugin, File playersFolder, OfflinePlayer player) throws Exception {
        super(plugin, playersFolder, player);
    }
}

Also you will need a manager for your newly created player:

package it.fulminazzo.testplugin.Managers;

import it.fulminazzo.teleporteffects.Bukkit.BearPlugin;
import it.fulminazzo.teleporteffects.Managers.TeleportPlayersManager;
import it.fulminazzo.testplugin.Objects.TestPlayer;

public class TestPlayersManager extends TeleportPlayersManager<TestPlayer> {
    public TestPlayersManager(BearPlugin<?, ?> plugin, Class<TestPlayer> customPlayerClass) {
        super(plugin, customPlayerClass);
    }
}

Finally, you can tell your plugin main class to use the custom player and manager instead of the regular one:

package it.fulminazzo.testplugin;

import it.fulminazzo.teleporteffects.Bukkit.Objects.BearPlayer;
import it.fulminazzo.teleporteffects.TeleportEffects;
import it.fulminazzo.testplugin.Managers.TestPlayersManager;
import it.fulminazzo.testplugin.Objects.TestPlayer;

public class TestPlugin extends TeleportEffects<TestPlayer, BearPlayer> {
    public TestPlugin() {
        super(TestPlayersManager.class, TestPlayer.class);
    }
}

That's it! You now have a base to create your custom plugin on top of TeleportEffects.
Remember to compile TeleportEffects inside your plugin and to remove it from the plugins folder of your server. In Maven:

<dependency>
    <groupId>it.fulminazzo</groupId>
    <artifactId>TeleportEffects</artifactId>
    <version>{VERSION}</version>
    <scope>provided</scope>
</dependency>

General Features

For Developers

Clone this wiki locally