From a15775fcf8bc264272e05b75d0b6f17dde6977a3 Mon Sep 17 00:00:00 2001 From: GitHub Actions <> Date: Fri, 24 May 2024 11:02:18 +0000 Subject: [PATCH 1/2] Set version to 15.0.1 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 623b306..98849bb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ mod_id = hardcorerevival mod_name = Hardcore Revival mod_main=HardcoreRevival description=Help your friends back up after they die (if you can make it in time). -version = 15.0.0 +version = 15.0.1 group = net.blay09.mods homepage=https://mods.twelveiterations.com/mc/hardcore-revival sources=https://github.com/TwelveIterationMods/HardcoreRevival From 716351b89052e432c5ea3e9eccffef0777a01336 Mon Sep 17 00:00:00 2001 From: MelanX Date: Fri, 24 May 2024 18:48:45 +0200 Subject: [PATCH 2/2] feat: Add knockout stat (#127) * Add knockout stat * fix lang key * Fix language key --------- Co-authored-by: BlayTheNinth <1933180+BlayTheNinth@users.noreply.github.com> --- .../mods/hardcorerevival/HardcoreRevival.java | 2 ++ .../hardcorerevival/HardcoreRevivalManager.java | 2 ++ .../mods/hardcorerevival/stats/ModStats.java | 14 ++++++++++++++ .../assets/hardcorerevival/lang/en_us.json | 1 + 4 files changed, 19 insertions(+) create mode 100644 common/src/main/java/net/blay09/mods/hardcorerevival/stats/ModStats.java diff --git a/common/src/main/java/net/blay09/mods/hardcorerevival/HardcoreRevival.java b/common/src/main/java/net/blay09/mods/hardcorerevival/HardcoreRevival.java index a647f8d..730e39e 100644 --- a/common/src/main/java/net/blay09/mods/hardcorerevival/HardcoreRevival.java +++ b/common/src/main/java/net/blay09/mods/hardcorerevival/HardcoreRevival.java @@ -10,6 +10,7 @@ import net.blay09.mods.hardcorerevival.config.HardcoreRevivalConfig; import net.blay09.mods.hardcorerevival.handler.*; import net.blay09.mods.hardcorerevival.network.ModNetworking; +import net.blay09.mods.hardcorerevival.stats.ModStats; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; import org.apache.logging.log4j.LogManager; @@ -27,6 +28,7 @@ public static void initialize() { HardcoreRevivalConfig.initialize(); ModNetworking.initialize(Balm.getNetworking()); + ModStats.initialize(Balm.getStats()); Balm.getCommands().register(ReviveCommand::register); diff --git a/common/src/main/java/net/blay09/mods/hardcorerevival/HardcoreRevivalManager.java b/common/src/main/java/net/blay09/mods/hardcorerevival/HardcoreRevivalManager.java index fb4cff0..157f40c 100644 --- a/common/src/main/java/net/blay09/mods/hardcorerevival/HardcoreRevivalManager.java +++ b/common/src/main/java/net/blay09/mods/hardcorerevival/HardcoreRevivalManager.java @@ -12,6 +12,7 @@ import net.blay09.mods.hardcorerevival.mixin.ServerPlayerAccessor; import net.blay09.mods.hardcorerevival.network.RevivalProgressMessage; import net.blay09.mods.hardcorerevival.network.RevivalSuccessMessage; +import net.blay09.mods.hardcorerevival.stats.ModStats; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.Registries; import net.minecraft.resources.ResourceKey; @@ -49,6 +50,7 @@ public void knockout(Player player, DamageSource source) { revivalData.setKnockedOut(true); revivalData.setKnockoutTicksPassed(0); revivalData.setLastKnockoutAt(System.currentTimeMillis()); + player.awardStat(ModStats.knockouts); // Punish consecutive knockouts final var lastRescuedAt = revivalData.getLastRescuedAt(); diff --git a/common/src/main/java/net/blay09/mods/hardcorerevival/stats/ModStats.java b/common/src/main/java/net/blay09/mods/hardcorerevival/stats/ModStats.java new file mode 100644 index 0000000..ac99cab --- /dev/null +++ b/common/src/main/java/net/blay09/mods/hardcorerevival/stats/ModStats.java @@ -0,0 +1,14 @@ +package net.blay09.mods.hardcorerevival.stats; + +import net.blay09.mods.balm.api.stats.BalmStats; +import net.blay09.mods.hardcorerevival.HardcoreRevival; +import net.minecraft.resources.ResourceLocation; + +public class ModStats { + + public static final ResourceLocation knockouts = new ResourceLocation(HardcoreRevival.MOD_ID, "knockouts"); + + public static void initialize(BalmStats stats) { + stats.registerCustomStat(knockouts); + } +} diff --git a/common/src/main/resources/assets/hardcorerevival/lang/en_us.json b/common/src/main/resources/assets/hardcorerevival/lang/en_us.json index f8a1f7c..f54ef69 100644 --- a/common/src/main/resources/assets/hardcorerevival/lang/en_us.json +++ b/common/src/main/resources/assets/hardcorerevival/lang/en_us.json @@ -9,6 +9,7 @@ "gui.hardcorerevival.rescuing": "Rescuing %s", "death.attack.not_rescued_in_time": "%1$s was not rescued in time", "death.attack.not_rescued_in_time.player": "%1$s was not rescued in time", + "stat.hardcorerevival.knockouts": "Knockouts", "config.hardcorerevival.secondsUntilDeath": "Seconds until Death", "config.hardcorerevival.secondsUntilDeath.tooltip": "The time in seconds in which a player can still be rescued from death. Set to 0 to disable the timer.", "config.hardcorerevival.continueTimerWhileOffline": "Continue Timer while Offline",