Developer API
Supreme does not provide a JavaDoc or a Maven/Gradle repo.

Environment Setup

Supreme Printer clients can download the API jar in #FAQ. Developers should ONLY have access to the API jar as everything required to use the API is included. Developers will NEVER need the real supremeprinter.jar to make addons. To import via Maven as a System dependency, use the following.
1
<dependency>
2
<groupId>life.savav3</groupId>
3
<artifactId>SupremePrinter</artifactId>
4
<version>1.0.0</version>
5
<scope>system</scope>
6
<systemPath>${project.basedir}/dependencies/SupremePrinter.jar</systemPath>
7
</dependency>
Copied!

Getting the Player Object

1
Player p = ...;
2
3
if (PrintingPlayers.getInstance().isPrintingPlayer(p)) {
4
PrintingPlayer player = PrintingPlayers.getInstance().getByPlayer(p);
5
...
6
}
7
8
// Get all currently active printing players (online & offline)
9
List<PrintingPlayer> printers = PrintingPlayers.getInstance().getAllPrintingPlayers();
Copied!

Printer Player Object

1
PrintingPlayer player = ...;
2
3
// Force a player to leave printer, and restore thier inventory.
4
player.leavePrinterMode();
5
6
// Take money for all current blocks (task does this normally)
7
player.purchase();
Copied!

Printer Events

1
@EventHandler
2
public void onPlayerEnterPrinter(PrinterEnterEvent e) {
3
Player player = e.getPlayer(); // get the player entering printer mode
4
5
if (...) e.setCancelled(true);
6
}
7
8
@EventHandler
9
public void onPlayerLeavePrinter(PrinterLeaveEvent e) {
10
Player player = e.getPlayer(); // get the player leaving printer mode
11
...
12
}
Copied!
Last modified 11mo ago