Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/1.20.x' into 1.20.x
Browse files Browse the repository at this point in the history
  • Loading branch information
BlayTheNinth committed May 25, 2024
2 parents 20285e4 + 716351b commit 4525eed
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -27,6 +28,7 @@ public static void initialize() {
HardcoreRevivalConfig.initialize();

ModNetworking.initialize(Balm.getNetworking());
ModStats.initialize(Balm.getStats());

Balm.getCommands().register(ReviveCommand::register);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4525eed

Please sign in to comment.