-
Notifications
You must be signed in to change notification settings - Fork 10
Developer Documentation
This page will guide you through the use of FlyPE's API. The purpose of this documentation is to only make it easier to look. Do not copy this documentation blindly and use only what you need!
NOTE: THE DOCUMENTATION IS BASED ON AN UNRELEASED/UNPUSHED VERSION OF FLYPE!
CURRENTLY UPDATED FOR: v5.2.0
Start by getting an instance of the plugin. Make sure that FlyPE has loaded in before using.
$flyPE = Server::getInstance()->getPluginManager()->getPlugin('FlyPE');
Upon getting an instance of the plugin, you'll have access to all the classes in the plugin. They can be accessed through the class properties as shown below.
$flyPE = Server::getInstance()->getPluginManager()->getPlugin('FlyPE'); //$util = $flyPE->util; //$config = $flyPE->config; //$dataBase = $flyPE->dataBase; //$economy = $flyPE->economy; //$sessionManager = $flyPE->sessionManager; //$integration = $flyPE->integration; //$flight = $flyPE->flight; //$soundList = $flyPE->soundList; //$soundManager = $flyPE->soundManager; //$particleList = $flyPE->particleList; //$particleManager = $flyPE->particleManager; //$effectList = $flyPE->effectList; //$effectManager = $flyPE->effectManager; //$capeList = $flyPE->capeList; //$capeManager = $flyPE->capeManager; //$flightForm = $flyPE->flightForm; //$soundForm = $flyPE->soundForm; //$particleForm = $flyPE->particleForm; //$effectForm = $flyPE->effectForm; //$capeForm = $flyPE->capeForm;
This class is used to keep code that cannot be classified into a specific class.
/** Schedules repeating tasks. */ public function prepareTasks(): void /** Prepares cosmetics by excluding cosmetics based on the cosmetic config. */ public function prepareCosmetics(): void /** Sends a translated message to a player. **(DEPRECATED)** */ public function sendTranslated(CommandSender $sender, string $id): void
This class is used to manage configs.
/** @var pocketmine\utils\Config[] */ public array $configs; /** Returns a config value in a file. Look at generateConfigs() for file name. */ public function getConfig(string $fileName, string $configName): mixed /** Returns the default config value in the plugin. Used as a backup value for config values. */ public function getConfigDefault(string $fileName, string $configName): mixed /** Generates all the configs in plugin data automatically. */ public function generateConfigs(): void /** Checks the version of the config files and takes action. */ public function checkConfigs(): bool /** Update the configs to the configs in the plugin. */ public function updateConfigs(array $configTypes): void /** Updates the languages to the languages in the plugin. */ public function updateLanguageFiles(): void /** Saves all resources/files in the plugin data folder. */ public function saveAllResources(): void /** Reloads all the configs. */ public function reloadConfigs(): void
This class is used to manage database providers.
public const SQLITE = 'sqlite'; public const MYSQL = 'mysql'; public const YAML = 'yaml'; public const JSON = 'json'; /** @var DataConnector */ public DataConnector $libasynql; /** Initialize databases based on type. */ public function initDB(): void /** Disable databases based on type. */ public function runDisable(): void /** Returns the default keys and values of database. */ public function getDefaults(Player $player): array /** Returns the type of database. */ public function getType(): string
This class is
/** */
This class is
/** */
This class is used to manage integration with other plugins.
/** Returns whether another flight plugin is detected and will make a warning. */ public function checkFlightPlugins(): bool /** Returns the names of the flight plugins detected. */ public function getFlightPlugins(): array /** Returns whether plugin integration is required. */ public function isAdjustmentRequired(Player $player): bool /** Returns the [name, instance] of integration plugins detected. */ public function getIntegrationPlugins(): array
This class is used to manage flight for players/worlds.
/** Toggles flight for a player and adjusts based on parameters given. Returns successful or not. */ public function toggleFlight(Player $player, ?bool $toggleMode = null, ?int $flightTime = null, bool $ignoreWorld = false): bool /** Returns whether flight is toggled for a player, including flight state check. */ public function isFlightToggled(Player $player, bool $strictCheck = false): bool /** Returns whether gamemode is allowed. */ public function isGamemodeAllowed(Player $player): bool /** Returns whether the world given is allowed. */ public function isWorldAllowed(World $world): bool
This class is used to list all available sounds.
/** @var string[] */ public array $allSounds = []; //check source code /** Removes sounds that are excluded based on the cosmetic config. */ public function excludeSounds(): void
This class is to manage sounds.
/** Sets toggle flight sound for a player. */ public function setFlightSound(Player $player, string $soundName): void /** Removes toggle flight sound for a player. */ public function removeFlightSound(Player $player): void /** Returns sound based on the sound name given. Returns null if doesn't exist. */ public function getSoundFromString(string $soundName): ?Sound
This class is
/** */
This class is
/** */
This class is
/** */
This class is
/** */
This class is
/** */
This class is
/** */
This class is
/** */
This class is
/** */
This class is
/** */
This class is
/** */