Allow execution animation on other clients

This commit is contained in:
2026-01-07 18:14:25 +01:00
parent 976e73201e
commit 94fc6f79c6
6 changed files with 54 additions and 26 deletions
@@ -1,10 +1,16 @@
package net.fretux.knockedback.client;
import javax.annotation.Nullable;
import java.util.UUID;
public class ClientExecutionState {
private static int timeLeft = 0;
@Nullable
private static UUID executorId;
public static void setTimeLeft(int ticks) {
public static void setExecution(int ticks, @Nullable UUID executor) {
timeLeft = ticks;
executorId = ticks > 0 ? executor : null;
}
public static int getTimeLeft() {
@@ -14,4 +20,8 @@ public class ClientExecutionState {
public static boolean isExecuting() {
return timeLeft > 0;
}
}
public static boolean isExecutor(UUID playerId) {
return timeLeft > 0 && executorId != null && executorId.equals(playerId);
}
}