Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ public PlaceholderManager() {
new InMatchPlaceholder(),
new QueuedPlaceholder(),
new WinsPlaceholder(),
new LossesPlaceholder(),
new KillsPlaceholder(),
new DeathsPlaceholder(),
new MaxPingPlaceholder(),
new CurrentStreakPlaceholder(),
new BestStreakPlaceholder(),
Expand All @@ -27,6 +30,8 @@ public PlaceholderManager() {
new KitDivisionPlaceholder(),
new KitWinsPlaceholder(),
new KitLossesPlaceholder(),
new KitKillsPlaceholder(),
new KitDeathsPlaceholder(),
new KitCurrentStreakPlaceholder(),
new KitBestStreakPlaceholder(),
new LeaderboardPlaceholder(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package dev.lrxh.neptune.providers.placeholder.impl;

import dev.lrxh.neptune.API;
import dev.lrxh.neptune.profile.data.GlobalStats;
import dev.lrxh.neptune.profile.impl.Profile;
import dev.lrxh.neptune.providers.placeholder.Placeholder;
import org.bukkit.OfflinePlayer;

public class DeathsPlaceholder implements Placeholder {
@Override
public boolean match(String string) {
return string.equals("deaths");
}

@Override
public String parse(OfflinePlayer player, String string) {
Profile profile = API.getProfile(player.getUniqueId());
if (profile == null) return string;
GlobalStats globalStats = profile.getGameData().getGlobalStats();
return String.valueOf(globalStats.getDeaths());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package dev.lrxh.neptune.providers.placeholder.impl;

import dev.lrxh.neptune.API;
import dev.lrxh.neptune.profile.data.GlobalStats;
import dev.lrxh.neptune.profile.impl.Profile;
import dev.lrxh.neptune.providers.placeholder.Placeholder;
import org.bukkit.OfflinePlayer;

public class KillsPlaceholder implements Placeholder {
@Override
public boolean match(String string) {
return string.equals("kills");
}

@Override
public String parse(OfflinePlayer player, String string) {
Profile profile = API.getProfile(player.getUniqueId());
if (profile == null) return string;
GlobalStats globalStats = profile.getGameData().getGlobalStats();
return String.valueOf(globalStats.getKills());
}
}
Loading