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 @@ -13,7 +13,8 @@ public enum BanTimeType {
STATIC,
BANCOUNT,
PLAYTIME,
TIMESINCELASTDEATH;
TIMESINCELASTDEATH,
GLOBALREVIVE;

public int getBantime(Player player, PlayerData playerData, int max) {
GrowthType growthType = JavaPlugin.getPlugin(AugmentedHardcore.class).getConfigurations().getDeathBanConfiguration().getBanTimeByPlaytimeGrowthType();
Expand All @@ -26,6 +27,8 @@ public int getBantime(Player player, PlayerData playerData, int max) {
return growthType.getBanTime(player.getStatistic(Statistic.PLAY_ONE_MINUTE) / 1200, max);
case TIMESINCELASTDEATH:
return growthType.getBanTime((int) MessageUtils.timeBetweenDatesToTicks(LocalDateTime.now(), playerData.getLastDeath()) / 1200, max);
case GLOBALREVIVE:
return (int) Math.max(playerData.getTimeTillNextRevive() / 1200, 0);
default:
return 0;
}
Expand Down
4 changes: 3 additions & 1 deletion src/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,9 @@ BanType: name
#Timesincelastdeath: Time since last death will be used for determining the bantime.
# Bantimes will increase the longer the player stays alive.
# Every death will reset the bantime back to 0, above times will be used as maximum ban time.
# -> static/bancount/playtime/timesincelastdeath
#Globalrevive: Time until the next GlobalReviveUnDeathBan run will be used for determining the bantime.
# This effectively bans players until the next global revive/un-deathban executes.
# -> static/bancount/playtime/timesincelastdeath/globalrevive
BanTimeType: static

#At what rate should the ban time by playtime grow?
Expand Down