GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - RefineDevelopment/PhoenixAPI: The API for Phoenix and pxQueue.

BranchesTags
Open more actions menu

Latest commit

 

History

66 Commits
66 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
src/main/java/xyz/refinedev
src/main/java/xyz/refinedev
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 

Repository files navigation

Phoenix API

The public API for Phoenix, pxQueue and pxCosmetics.

This artifact contains interfaces and stubs only — every method throws until the real plugin is installed, so always depend on it with provided scope and never shade it into your jar.

Installing

Add our repository to your pom.xml:

<repositories>
    <repository>
        <id>refine-public</id>
        <url>https://maven.refinedev.org/public-repo/</url>
    </repository>
</repositories>

Then add the dependency:

<dependency>
    <groupId>xyz.refinedev.phoenix</groupId>
    <artifactId>pxAPI</artifactId>
    <version>3.0</version>
    <scope>provided</scope>
</dependency>

Building it yourself

Building needs JDK 17 or newer, because the Velocity API cannot be read by JDK 8. The jar itself still targets Java 8.

git clone https://github.com/RefineDevelopment/Phoenix-API.git
cd Phoenix-API
mvn clean install

Usage

On Bukkit, Phoenix is the entry point to everything:

Phoenix phoenix = Phoenix.getInstance();

For code that also has to run on Bungee or Velocity, use CommonPlatform, which exposes every handler that is shared across the three platforms:

CommonPlatform platform = PlatformGetter.getInstance();

pxQueue and pxCosmetics have their own entry points:

QueueAPI queueApi = QueueAPI.INSTANCE;
pxCosmetics cosmetics = pxCosmetics.getInstance();

Handlers

CommonPlatform gives you the cross-platform handlers, including:

Handler What it covers
IProfileHandler Player profiles
IRankHandler Ranks and scopes
IGrantHandler Rank grants
IPunishmentHandler, IPunishmentLadderHandler Punishments and ladders
IReportHandler, IReportCategoryHandler Reports
IAltHandler, IAddressStatsHandler Alt detection and address stats
IServerHopHandler Server hopping
ITagHandler, ICustomTagHandler Tags
INetworkHandler, IWhitelistHandler Servers and whitelisting
IChatLogHandler, IChatSnapshotHandler, ICommandLogHandler Logging
ISecurityHandler, ILoginHandler Staff security and logins
IAnalyticsHandler, IMetricsHandler Analytics and metrics
IAntiVPNHandler, IFilterHandler Anti-VPN and chat filters
ICooldownHandler, INotificationHandler, IPlaceholderHandler, IDatabaseHandler, IHashHandler Misc

Phoenix adds the Bukkit-only handlers on top: ChatHandler, DisguiseHandler, VisibilityHandler, AuthHandler, RebootHandler, HookHandler, AfkHandler, AnomalyHandler, BanWaveHandler, FreezeHandler, PanicHandler, VanishHandler, WaypointHandler, ConfigSyncHandler, BukkitLocaleHandler, MenuHandler, MenuTitleHandler, PhoenixCommandHandler and PhoenixTimeoutManager.

Examples

Getting a player's highest rank:

Phoenix phoenix = Phoenix.getInstance();

IProfile profile = phoenix.getProfileHandler().getProfile(player.getUniqueId());
if (profile != null) {
    player.sendMessage(profile.getName() + "'s highest rank is " + profile.getHighestRank().getName());
}

Listing a player's punishments:

List<IPunishment> punishments = Phoenix.getInstance().getPunishmentHandler().getPunishments(uuid);
player.sendMessage("That player has " + punishments.size() + " punishments.");

Checking whether a player is queued:

Queue queue = QueueAPI.INSTANCE.getPlayerQueue(uuid);
if (queue != null) {
    player.sendMessage("Player is currently queued for " + queue.getName());
} else {
    player.sendMessage("Player is currently not in a queue");
}

Events

Phoenix fires its own Bukkit events, which you listen to as usual:

  • Profiles: ProfileNetworkJoinEvent, ProfileNetworkLeaveEvent, ProfileSettingUpdateEvent
  • Ranks: ProfileGrantEvent, ProfileGrantRevokeEvent
  • Punishments: ProfilePunishmentEvent, ProfilePunishmentRevokeEvent
  • Disguises: ProfileDisguiseEvent, ProfileUndisguiseEvent
  • Staff: PlayerFreezeEvent, PlayerUnFreezeEvent, PlayerVanishUpdateEvent, PlayerModModeUpdateEvent, PlayerReportEvent
  • Chat: PlayerChatInChannelEvent
@EventHandler
public void onGrant(ProfileGrantEvent event) {
    IGrant grant = event.getGrant();
    Bukkit.broadcastMessage(event.getProfile().getName() + " was granted " + grant.getRank().getName());
}

Support

Questions and bug reports: dsc.gg/refine

About

The API for Phoenix and pxQueue.

Resources

Readme
Activity
Custom properties

Stars

3 stars

Watchers

0 watching

Forks

7 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.