mirror of
https://github.com/itHotL/PlayerStats.git
synced 2025-02-13 01:11:23 +01:00
Added bStats!
This commit is contained in:
parent
fe4f5db12e
commit
810c93c5bd
11
pom.xml
11
pom.xml
@ -76,6 +76,13 @@
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.bstats</groupId>
|
||||
<artifactId>bstats-bukkit</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.jetbrains</groupId>
|
||||
<artifactId>annotations</artifactId>
|
||||
@ -127,6 +134,10 @@
|
||||
<pattern>com.tchristofferson</pattern>
|
||||
<shadedPattern>com.gmail.artemis.the.gr8.tchristofferson</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>org.bstats</pattern>
|
||||
<shadedPattern>com.gmail.artemis.the.gr8.bstats</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
<filters>
|
||||
<filter>
|
||||
|
@ -13,6 +13,7 @@ import com.gmail.artemis.the.gr8.playerstats.statistic.RequestManager;
|
||||
import com.gmail.artemis.the.gr8.playerstats.statistic.StatManager;
|
||||
import com.gmail.artemis.the.gr8.playerstats.utils.OfflinePlayerHandler;
|
||||
import net.kyori.adventure.platform.bukkit.BukkitAudiences;
|
||||
import org.bstats.bukkit.Metrics;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.PluginCommand;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
@ -32,6 +33,8 @@ public final class Main extends JavaPlugin {
|
||||
@Override
|
||||
public void onEnable() {
|
||||
//TODO fix (move these two into initializeMainClasses also, and remove all the Main.get... methods)
|
||||
Metrics metrics = new Metrics(this, 15923);
|
||||
|
||||
//first get an instance of all the classes that need to be passed along to different classes
|
||||
ConfigHandler config = new ConfigHandler(this);
|
||||
OfflinePlayerHandler offlinePlayerHandler = new OfflinePlayerHandler();
|
||||
|
@ -50,7 +50,7 @@ public interface PlayerStats {
|
||||
Adventure's TextComponents, you can call this method to turn any stat-result into a String.
|
||||
@return a String representation of this TextComponent, without color and style, but with line-breaks*/
|
||||
default String statResultComponentToString(TextComponent statResult) {
|
||||
return LegacyComponentSerializer.builder().hexColors().build().serialize(statResult);
|
||||
return LegacyComponentSerializer.builder().hexColors().useUnusualXRepeatedCharacterHexFormat().build().serialize(statResult);
|
||||
}
|
||||
|
||||
/** Get a formatted player-statistic of Statistic.Type UNTYPED.
|
||||
|
@ -4,6 +4,7 @@ import com.gmail.artemis.the.gr8.playerstats.enums.Target;
|
||||
import com.gmail.artemis.the.gr8.playerstats.models.StatRequest;
|
||||
import com.gmail.artemis.the.gr8.playerstats.statistic.RequestManager;
|
||||
import com.gmail.artemis.the.gr8.playerstats.statistic.StatManager;
|
||||
import com.gmail.artemis.the.gr8.playerstats.utils.MyLogger;
|
||||
import net.kyori.adventure.text.TextComponent;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Statistic;
|
||||
@ -79,6 +80,7 @@ public final class PlayerStatsAPI implements PlayerStats {
|
||||
@Nullable Material material, @Nullable EntityType entity, @Nullable String playerName) throws NullPointerException {
|
||||
StatRequest request = requestManager.generateRequest(selection, statistic, material, entity, playerName);
|
||||
if (requestManager.validateAPIRequest(request)) {
|
||||
MyLogger.logMsg("API is being called! We are calculating a " + selection + "for " + statistic);
|
||||
switch (selection) {
|
||||
case PLAYER -> {
|
||||
int stat = statManager.getPlayerStat(request);
|
||||
|
@ -51,7 +51,7 @@ public final class EasterEggProvider {
|
||||
}
|
||||
case "46dd0c5a-2b51-4ee6-80e8-29deca6dedc1" -> {
|
||||
if (sillyNumberIsBetween(sillyNumber, 0, 20)) {
|
||||
playerName = "<papi:luckperms_prefix><gradient:#f74040:#FF6600:#f74040>fire demon</gradient>";
|
||||
playerName = "<gradient:#f74040:#FF6600:#f74040>fire demon</gradient>";
|
||||
}
|
||||
else if (sillyNumberIsBetween(sillyNumber, 69, 69)) {
|
||||
playerName = "<gradient:blue:#b01bd1:blue>best admin</gradient>";
|
||||
|
Loading…
Reference in New Issue
Block a user