Flectone LogoFlectonePulse

Component reference

Every service, registry, adapter, the scheduler and the utilities of the FlectonePulse API and where they live

Any component comes from the injector, building implementations by hand is not allowed

FlectonePulse flectonePulse = FlectonePulseAPI.getInstance();

FPlayerService fPlayerService = flectonePulse.get(FPlayerService.class);

Every component lives as a single instance, so a repeated get() gives the same object back


Package map

PackageWhat is inside
net.flectone.pulseFlectonePulse and FlectonePulseAPI
net.flectone.pulse.annotationThe @Pulse annotation
net.flectone.pulse.listenerThe PulseListener interface
net.flectone.pulse.dispatcherEventDispatcher and MessageDispatcher
net.flectone.pulse.model.eventEvery event and EventMetadata
net.flectone.pulse.model.entityFEntity and FPlayer
net.flectone.pulse.model.valueRange, Destination, Sound, Moderation, Cooldown, FColor and other values
net.flectone.pulse.constantModuleName, MessageFlag, SettingText, HookType, PlatformType
net.flectone.pulse.serviceThe data services
net.flectone.pulse.platform.registryThe registries of listeners, commands, permissions, caches and proxies
net.flectone.pulse.platform.controllerModule and command control
net.flectone.pulse.platform.senderReady senders and checks
net.flectone.pulse.platform.adapterAccess to the platform
net.flectone.pulse.platform.formatterFormatting of time, links and punishments
net.flectone.pulse.pipelineMessagePipeline
net.flectone.pulse.checkerPinpoint checks
net.flectone.pulse.schedulerTaskScheduler
net.flectone.pulse.moduleThe module interfaces
net.flectone.pulse.fileFileFacade
net.flectone.pulse.loggingFLogger
net.flectone.pulse.exceptionThe exceptions

Services

Package net.flectone.pulse.service
ServiceWhat it is for
FPlayerServicePlayer lookup, cache and saving, described on the players page
SocialServiceChat settings, colors, ignores, mail and vanish
ModerationServiceBans, mutes, warns, kicks, whitelist and violations
PlaytimeServicePlayed time and AFK sessions
SkinServiceSkins, avatars and body images
TranslationServiceLoading of the platform translations
MetricsServiceCollecting and sending statistics

ModerationService

One place for all the work with punishments

import net.flectone.pulse.model.value.Moderation;
import net.flectone.pulse.service.ModerationService;

ModerationService moderationService = flectonePulse.get(ModerationService.class);

// give an hour long mute
moderationService.mute(fPlayer, System.currentTimeMillis() + 3_600_000L, "Spam", moderatorId);

// check for an active ban
boolean banned = moderationService.hasValid(fPlayer, Moderation.Type.BAN);

// take an active punishment
Optional<Moderation> mute = moderationService.getValid(fPlayer, Moderation.Type.MUTE);
Method groupExamples
Givingban, mute, warn, kick, maintenance, whitelist, add
CheckinghasValid, getValid, getValidNames, getTotalValidCount
Liftingremove
ViolationsaddViolation, isViolationRestricted, getFirstViolationTimestamp
LimitsisAllowedTime, hasHigherGroupThan
Cacheinvalidate

The punishment types in Moderation.Type are BAN, MUTE, WARN, KICK, WHITELIST, MAINTENANCE and their paired liftings UNBAN, UNMUTE, UNWARN, UNWHITELIST, UNMAINTENANCE


Registries

Package net.flectone.pulse.platform.registry
RegistryWhat it is for
ListenerRegistryRegisters listeners, described on the events page
CommandRegistryRegisters commands, described on the modules page
PermissionRegistryRegisters permissions with the platform
ProxyRegistryHolds the network transports, described on the proxy page
CacheRegistryHolds the internal caches of the project

Controllers

Package net.flectone.pulse.platform.controller
ControllerWhat it is for
ModuleControllerTurns modules on and off and checks them
ModuleCommandControllerRegisters module commands and translatable argument names

Senders

Package net.flectone.pulse.platform.sender
ComponentWhat it is for
MessageSenderSends a ready component to a player or the console
ProxySenderSends data to other servers
SoundPlayerPlays a sound with a permission check
CooldownSenderChecks the cooldown and writes to the player
MuteSenderChecks the mute and writes to the player
DisableSenderChecks a disabled module and writes to the player
IgnoreSenderChecks the ignore and writes to the player
ModerationListSenderPrints punishment lists
MetricsSenderSends statistics

Checks

Package net.flectone.pulse.checker
ComponentMethodWhat it checks
PermissionCheckercheck(FEntity, String)Whether an entity holds a permission
CooldownCheckercheck(UUID, Cooldown, String)Whether the cooldown ran out
MuteCheckercheck(FPlayer)Whether a player is muted
ValidNameCheckercheck(String)Whether a nickname is correct

Platform adapters

Package net.flectone.pulse.platform.adapter

They give the same access to server and player data on every platform

PlatformPlayerAdapter

MethodWhat it gives
getName(UUID)The nickname of a player
getPing(FPlayer)The latency
getWorldName(UUID)The world name
getWorldEnvironment(UUID)The world type
getLocale(UUID)The client language
getIp(UUID)The connection address
getGamemode(UUID)The gamemode
getCoordinates(UUID)The coordinates
distance(UUID, UUID)The distance between players
getStatistics(UUID)The statistics of a player
getPlayedTime(FPlayer)The played time
getOnlinePlayers()Every player online
findPlayersWhoCanSee(UUID, double, double, double)Those who can see a point
convertToPlatformPlayer(UUID)The platform object of a player
kick(FPlayer, Component)Disconnects a player

There are also state checks, isOnline, isDead, isSneaking, isOperator, hasPlayedBefore and hasPotionEffect

PlatformServerAdapter

MethodWhat it gives
getPlatformType()The current platform
getServerCore()The server core
getServerVersionName()The server version
getTPS(FEntity)The current TPS
getMaxPlayers()The player limit
getOnlinePlayerCount()The number of players online
isOnlineMode()Whether the license check is on
isPrimaryThread()Whether the code runs on the main thread
hasProject(String)Whether a named plugin or mod is installed
dispatchCommand(String)Runs a command as the console
getMOTD()The data for a status response
getIcon()The server icon
getItemName(Object)The name of an item
import net.flectone.pulse.platform.adapter.PlatformServerAdapter;

PlatformServerAdapter serverAdapter = flectonePulse.get(PlatformServerAdapter.class);

if (serverAdapter.hasProject("LuckPerms")) {
    // LuckPerms is installed on the server
}

Formatters

Package net.flectone.pulse.platform.formatter
ComponentWhat it is for
TimeFormatterFormats a duration and a date in the language of a player
UrlFormatterEscapes and converts links
ModerationMessageFormatterBuilds the texts of punishment messages
IntegrationFormatterFormats text for Discord, Telegram and Twitch
import net.flectone.pulse.platform.formatter.TimeFormatter;

TimeFormatter timeFormatter = flectonePulse.get(TimeFormatter.class);

String duration = timeFormatter.format(fPlayer, 3_600_000L);
String date = timeFormatter.formatDate(System.currentTimeMillis());

Scheduler

Package net.flectone.pulse.scheduler

TaskScheduler works the same on every platform, Folia included. Time is set in ticks

import net.flectone.pulse.scheduler.TaskScheduler;

TaskScheduler taskScheduler = flectonePulse.get(TaskScheduler.class);

// async right now
taskScheduler.runAsync(() -> loadDataFromDatabase());

// async in 5 seconds
taskScheduler.runAsyncLater(() -> sendDelayedMessage(), 100L);

// every 30 seconds
taskScheduler.runAsyncTimer(() -> updateStatistics(), 600L);
MethodWhat it does
runAsync(SchedulerRunnable)Runs a task async
runAsync(SchedulerRunnable, boolean independent)The same, but the false value runs it right away when the thread is already async
runAsyncLater(SchedulerRunnable, long delay)Runs async after a delay, 20 ticks by default
runAsyncTimer(SchedulerRunnable, long period)Runs async on a schedule
runSync(SchedulerRunnable)Runs a task sync
runSyncLater(SchedulerRunnable, long delay)Runs sync after a delay
getExecutorService()Gives the thread pool of the scheduler

Every method gives a CompletableFuture<Void>. For repeating tasks it never completes on its own, so cancel it once the task is no longer needed

Attention

Do not block the main thread. Put every database call and network request into runAsync, because event handlers run synchronously against the message pipeline


Configuration

Package net.flectone.pulse.file

FileFacade gives access to every settings file

import net.flectone.pulse.file.FileFacade;

FileFacade fileFacade = flectonePulse.get(FileFacade.class);

// config.yml
var config = fileFacade.config();
// message.yml
var message = fileFacade.message();
// command.yml
var command = fileFacade.command();
// integration.yml
var integration = fileFacade.integration();
// permission.yml
var permission = fileFacade.permission();
// localizations/ru_ru.yml
var localization = fileFacade.localization("ru_ru");
MethodWhat it gives
config(), message(), command(), integration(), permission()The sections of their files
localization()The default localization
localization(String locale)The localization of one language
localizations()Every loaded localization
saveFiles(), updateFiles()Save and update the files
Warning

Treat the configuration as read only. Changing FlectonePulse settings from your own plugin is a bad idea


Logging

Package net.flectone.pulse.logging

FLogger can write colored text to the console

import net.flectone.pulse.logging.FLogger;

FLogger fLogger = flectonePulse.get(FLogger.class);

fLogger.info("A message");
fLogger.warning("A warning");

if (FLogger.DEBUG_ENABLED) {
    // debug mode is on through -Dflectonepulse.debug=true
}

Utilities

ComponentWhat it is for
net.flectone.pulse.util.payload.ProxyPayloadReads the data of a proxy message
net.flectone.pulse.util.random.RandomGeneratorGenerates random values
net.flectone.pulse.util.WebUtilMakes HTTP requests
net.flectone.pulse.decorator.ComponentDecoratorSafely adds tooltips and decorations to components
net.flectone.pulse.resolver.ReflectionResolverWorks with platform classes through reflection
net.flectone.pulse.resolver.SystemVariableResolverReads environment variables and system properties
net.flectone.pulse.resolver.ProfileResolverFetches Mojang player profiles
net.flectone.pulse.resolver.LibraryResolverDownloads external libraries
Note

The artifact carries only interfaces, their implementations are closed and differ between platforms. Javadoc is published together with the artifact, so the description of any method shows up right in your IDE

Last update August 11, 2026
Edit on Github

On this page