Skip to content

Developers

Ender edited this page Jul 5, 2023 · 4 revisions

Build

To build the plugin, you need to have Java 11 or higher and Maven installed on your computer. Run the following command in the root directory of the project:

mvn clean package

The .jar file will be in the \universal\target folder.

Api

EnderSS has an API that allows you to interact with the plugin. The jar of the API is downloadable in the GitHub Releases.
Make sure to add the plugin as a dependency in your project.

The API consists in 4 main objects:

  • SsPlayer to store data about the player
  • PlayersManager to manage players. Every time a player joins or left, they get register or unregistered in the player manager
  • ScreenShareManager to start o stop controls.
  • EnderSS contains all the method to access the other objects

The abstract class SsPlayer is extended by SpigotPlayer and ProxyPlayer which contains other specific data of the player for that specific platform, like the String lastServer or byte lastGamemode.

Get the API

EnderSS api = EnderSSProvider.getApi();

Events

EnderSS API has 3 events for all the 3 platform:

  • SsStartEvent - Fired when a control starts
  • SsEndEvent - Fired when a control ends
  • SsChatEvent - Fired when a player writes a message in the private chat. Can be cancelled by the user.

Examples

Start a ScreenShare

api.getScreenShareManager().startScreenShare(staffUUID, suspectUUID);

Get a player and returns true if they're staffer

SsPlayer ssPlayer = api.getPlayersManager().getPlayer(playerUUID);
return ssPlayer.isStaff();

Get all online staffers

HashMap<UUD, SsPlayer> stafferMap = api.getPlayersManager().getStaffers();
Set<SsPlayer> staffers = stafferMap.keySet();