Skip to content

Commit

Permalink
Added power placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
PeachesMLG committed Feb 24, 2024
1 parent 8567b9f commit 09e6a07
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public Configuration() {
public double maxPower = 10;
public double minPower = -10;
public double startingPower = 10;
public int powerLossPerDeath = 3;
public double powerLossPerDeath = 3;
public int powerRecoveryDelayInSeconds = 600;
public double powerRecoveryAmount = 1;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.iridium.iridiumcore.dependencies.xseries.XMaterial;
import com.iridium.iridiumteams.configs.inventories.InventoryConfig;

import java.util.Arrays;
import java.util.Collections;

public class Inventories extends com.iridium.iridiumteams.configs.Inventories {
Expand Down Expand Up @@ -43,5 +44,7 @@ public class Inventories extends com.iridium.iridiumteams.configs.Inventories {
public Inventories() {
super("Faction", "&c");
missionTypeSelectorGUI.weekly.enabled = false;

membersGUI.item.lore = Arrays.asList("&cJoined: &7%player_join%", "&cRank: &7%player_rank%", "&cPower: &7%player_power%", "", "&c&l[!] &7Right Click to promote", "&c&l[!] &7Left click to demote/kick");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@ public class UserPlaceholderBuilder implements PlaceholderBuilder<User> {
private final List<Placeholder> defaultPlaceholders = Arrays.asList(
new Placeholder("player_rank", "N/A"),
new Placeholder("player_name", "N/A"),
new Placeholder("player_join", "N/A")
new Placeholder("player_join", "N/A"),
new Placeholder("player_power", "N/A")
);

@Override
public List<Placeholder> getPlaceholders(User user) {
return cache.get(user, Duration.ofSeconds(1), () -> Arrays.asList(
new Placeholder("player_rank", IridiumFactions.getInstance().getUserRanks().getOrDefault(user.getUserRank(), new UserRank("N/A", null)).name),
new Placeholder("player_name", user.getName()),
new Placeholder("player_join", user.getJoinTime().format(DateTimeFormatter.ofPattern(IridiumFactions.getInstance().getConfiguration().dateTimeFormat)))
new Placeholder("player_join", user.getJoinTime().format(DateTimeFormatter.ofPattern(IridiumFactions.getInstance().getConfiguration().dateTimeFormat))),
new Placeholder("player_power", String.valueOf(user.getPower()))
));
}

Expand Down

0 comments on commit 09e6a07

Please sign in to comment.