Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@
</build>

<repositories>
<repository>
<id>placeholderapi</id>
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
<repository>
<id>papermc-repo</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
Expand All @@ -80,6 +84,12 @@
</repositories>

<dependencies>
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.11.6</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.technicjelle</groupId>
<artifactId>UpdateChecker</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import de.bluecolored.bluemap.api.BlueMapAPI;
import de.bluecolored.bluemap.api.plugin.SkinProvider;
import org.bstats.bukkit.Metrics;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
import org.jetbrains.annotations.NotNull;

Expand Down Expand Up @@ -56,6 +57,7 @@ public void onEnable() {
.replace("{UUID}", uuid)
.replace("{USERNAME}", username)
.replace("{UUID-}", uuid.replace("-", ""));
localUrl = PAPIUtil.processPAPI(Bukkit.getPlayer(playerUUID), localUrl);
getLogger().info("Downloading skin for " + username + " from " + localUrl);
BufferedImage img = downloadImage(localUrl);
return Optional.ofNullable(img);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.technicjelle.bluemapcustomskinprovider;

import me.clip.placeholderapi.PlaceholderAPI;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;

public final class PAPIUtil {
private PAPIUtil() {}

public static String processPAPI(Player player, String str) {
if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null && player != null) {
return PlaceholderAPI.setPlaceholders(player, str);
}
else return str;
}
}
2 changes: 2 additions & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Available placeholders: {UUID},{UUID-},{USERNAME}
# {UUID-}: UUID of the player without "-"
# Supports PAPI placeholders!
# Example: %player_displayname% (don't forget to install extension in PAPI -> /papi ecloud download Player)
url: "https://minotar.net/skin/{UUID}"
2 changes: 2 additions & 0 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ main: com.technicjelle.bluemapcustomskinprovider.BlueMapCustomSkinProvider
api-version: 1.13
depend:
- BlueMap
softdepend:
- PlaceholderAPI
authors: [ TechnicJelle ]
description: ${project.description}
website: ${project.url}
Expand Down