Skip to content

voidpointer0x00/MorePaperLib

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MorePaperLib

Discord GitHubStar

License

Gracefully and simultaneously support Spigot, Paper, Folia, etc.

Need to support Folia? Spigot? Well, MorePaperLib has you covered. Now you can effortlessly support multiple versions of Spigot, Paper, and Folia.

MorePaperLib covers common use cases which may require different approaches depending on the target platform. It also provides shortcuts and optimizations for platforms supporting certain API.

Testing Rigor

Simple, useful libraries should have one purpose and carry it out effectively. There should be no bugs in such an elemental use-case.

  • MorePaperLib is covered by rigorous unit test and integration tests for every feature on every supported platform.
  • Additionally, the library is manually tested through its downstream plugins, such as in LibertyBans.

Examples

Plugin plugin = /* your plugin */;
MorePaperLib morePaperLib = new MorePaperLib(plugin);

// Scheduling
morePaperLib.scheduling().asyncScheduler().run(() -> plugin.getLogger().info("This runs asynchronously"));
morePaperLib.scheduling().regionScheduler(new Location(10, 64, 15, Bukkit.getWorld("world_nether"))).run(() -> plugin.getLogger().info("This runs on the region at 10, 64, 15 in 'world_nether'"));
morePaperLib.cancelGlobalTasks();

// Command map
CommandMap commandMap = morePaperLib.commandRegistration().getServerCommandMap();

Features

Folia scheduling

Paper's Folia project refactored the scheduling APIs. MorePaperLib provides a scheduling API that automatically switches between the Bukkit scheduler and the Folia schedulers.

Correct usage of the Folia API is critical to server success. Unlike other Folia wrappers you may have found, the correctness of this library is guaranteed by the reputation of this author. I have personally already noticed, and reported, bugs in other Folia wrappers based on API abuse.

Access the command map

On Spigot, accessing the command map must be done with reflection. On Paper there is supported API: server.getCommandMap(). Relying on API, if it exists, makes your plugin more stable and impervious to future changes in the Paper implementation.

MorePaperLib's getServerCommandMap method automatically uses whichever approach is suitable to the platform.

Adventure methods

Kick players with a Component. Disallow login events with a Component reason. If Adventure is not supported, fallback occurs automatically to legacy text serialization.

Library Details

Artifact Info

The artifact is:

<dependency>
    <groupId>space.arim.morepaperlib</groupId>
    <artifactId>morepaperlib</artifactId>
    <version>0.4.2</version>
</dependency>

From repository:

<repository>
    <id>arim-mvn-lgpl3</id>
    <url>https://mvn-repo.arim.space/lesser-gpl3/</url>
</repository>

License

Licensed under the GNU Lesser GPL v3, or later. See the license file for details.

About

Because PaperLib isn't enough

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%