add "Help Up" feature for knocked players, improve execution handling, and update mod version to 1.6.0

This commit is contained in:
2026-05-23 19:37:58 +02:00
parent 25d0ae5229
commit 332b6552cf
30 changed files with 956 additions and 42 deletions
@@ -76,6 +76,7 @@ public class PlayerExecutionHandler {
executor.sendSystemMessage(Component.translatable("message.knockedback.cannot_execute_carried_player"));
return;
}
if (HelpUpHandler.isBeingHelped(knockedId)) return;
if (executionAttempts.containsKey(knockedId)) return;
executionAttempts.put(knockedId, new PlayerExecutionAttempt(executor.getUUID()));
executor.sendSystemMessage(Component.translatable("message.knockedback.execution_started"));
@@ -139,6 +140,7 @@ public class PlayerExecutionHandler {
new ExecutionProgressPacket(0, null)
);
}
KnockedbackAdvancements.recordExecution(executor);
executor.sendSystemMessage(Component.translatable("message.knockedback.you_executed", knockedPlayer.getDisplayName()));
if (knockedPlayer instanceof ServerPlayer serverPlayer) {
serverPlayer.sendSystemMessage(Component.translatable("message.knockedback.you_were_executed", executor.getDisplayName()));
@@ -168,11 +170,11 @@ public class PlayerExecutionHandler {
attempt.timeLeft--;
NetworkHandler.CHANNEL.send(
PacketDistributor.PLAYER.with(() -> executor),
new ExecutionProgressPacket(attempt.timeLeft, attempt.executorUuid)
new ExecutionProgressPacket(attempt.timeLeft, getExecutionTime(), ExecutionProgressPacket.Action.EXECUTION, knocked.getDisplayName().getString(), attempt.executorUuid)
);
NetworkHandler.CHANNEL.send(
PacketDistributor.PLAYER.with(() -> knocked),
new ExecutionProgressPacket(attempt.timeLeft, attempt.executorUuid)
new ExecutionProgressPacket(attempt.timeLeft, getExecutionTime(), ExecutionProgressPacket.Action.EXECUTION, knocked.getDisplayName().getString(), attempt.executorUuid)
);
if (attempt.timeLeft <= 0) {
toExecute.add(knockedId);