From 6e8c298e6bfcb1b49bc4b70ef775ffc543b4a6db Mon Sep 17 00:00:00 2001 From: Jake <84546680+Nergly@users.noreply.github.com> Date: Fri, 24 Apr 2026 11:48:50 -0500 Subject: [PATCH] Add global revive as death-ban time type --- .../augmentedhardcore/domain/enums/BanTimeType.java | 5 ++++- src/resources/config.yml | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/com/backtobedrock/augmentedhardcore/domain/enums/BanTimeType.java b/src/com/backtobedrock/augmentedhardcore/domain/enums/BanTimeType.java index 0152f72..c45afca 100644 --- a/src/com/backtobedrock/augmentedhardcore/domain/enums/BanTimeType.java +++ b/src/com/backtobedrock/augmentedhardcore/domain/enums/BanTimeType.java @@ -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(); @@ -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; } diff --git a/src/resources/config.yml b/src/resources/config.yml index 45fbf22..0b964ee 100644 --- a/src/resources/config.yml +++ b/src/resources/config.yml @@ -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?