Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rollczi/liteskullapi
💜 LiteSkullAPI - Fast and extensive skull library for Bukkit/Spigot/Paper plugins.
https://github.com/rollczi/liteskullapi
bukkit hacktoberfest minecraft minecraft-api minecraft-library minecraft-skull papermc skin skull spigot
Last synced: 3 months ago
JSON representation
💜 LiteSkullAPI - Fast and extensive skull library for Bukkit/Spigot/Paper plugins.
- Host: GitHub
- URL: https://github.com/rollczi/liteskullapi
- Owner: Rollczi
- License: apache-2.0
- Created: 2022-03-09T19:48:57.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-10-27T12:39:13.000Z (3 months ago)
- Last Synced: 2024-10-27T23:09:48.152Z (3 months ago)
- Topics: bukkit, hacktoberfest, minecraft, minecraft-api, minecraft-library, minecraft-skull, papermc, skin, skull, spigot
- Language: Java
- Homepage: https://docs.rollczi.dev
- Size: 220 KB
- Stars: 18
- Watchers: 1
- Forks: 1
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 💜 LiteSkullAPI
#### Fast and extensive skull library for Bukkit/Spigot/Paper plugins.
Helpful links:
- [Support Discord](https://discord.gg/6cUhkj6uZJ)
- [GitHub issues](https://github.com/Rollczi/LiteSkullAPI/issues)### mineCodes Repository (Maven or Gradle) ❤️
```xmlminecodes-repository
https://repository.minecodes.pl/releases```
```groovy
maven { url "https://repository.minecodes.pl/releases" }
```
### Dependencies (Maven or Gradle)
Framework Core
```xmldev.rollczi
liteskullapi
1.3.0```
```groovy
implementation 'dev.rollczi:liteskullapi:1.3.0'
```
### How use LiteSkullAPI?
```java
public final class ExamplePlugin extends JavaPlugin {
private SkullAPI skullAPI;@Override
public void onEnable() {
this.skullAPI = LiteSkullFactory.builder()
.cacheExpireAfterWrite(Duration.ofMinutes(45L))
.bukkitScheduler(this)
.build();
}
}
```
#### Accept synchronous with Minecraft Server
Lambda will be run in the server sync task (see `.bukkitScheduler()` or `.scheduler()`)
```java
// you can use this item when skull will be found (synchronous)
skullAPI.acceptSyncSkull("Rollczi", itemStack -> {
player.getInventory().addItem(itemStack);
});skullAPI.acceptSyncSkullData("Rollczi", skullData -> {
String value = skullData.getValue();
String signature = skullData.getSignature();
});
```
#### Accept asynchronous
```java
// you can use this item when skull will be found (asynchronous)
skullAPI.acceptAsyncSkull("Rollczi", itemStack -> {
itemStack
// some code
});
skullAPI.acceptAsyncSkullData("Rollczi", skullData -> {
String value = skullData.getValue(); // texture value
String signature = skullData.getSignature(); // texture signature
});
```
#### CompletableFuture
```java
// you can get completable future with skull item
CompletableFuture completableFuture = skullAPI.getSkull("Rollczi");
completableFuture.thenAcceptAsync(itemStack -> {
itemStack
// some code
});// you can get completable future with skull data
CompletableFuture completableFuture = skullAPI.getSkullData("Rollczi");
completableFuture.thenAcceptAsync(skullData -> {
String value = skullData.getValue(); // texture value
String signature = skullData.getSignature(); // texture signature
});
```
#### Await for skull (⚠️ Blocking)
```java
ItemStack itemStack = skullAPI.awaitForSkull("Rollczi", 10, TimeUnit.SECONDS);
SkullData skullData = skullAPI.awaitForSkullData("Rollczi", 10, TimeUnit.SECONDS);
```