aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoranhgelus <anhgelus.morhtuuzh@proton.me>2025-06-01 19:35:46 +0000
committeranhgelus <anhgelus.morhtuuzh@proton.me>2025-06-01 19:35:46 +0000
commit2a4928e703690eee439b38a0be857eb0ff44b532 (patch)
tree21ae62f3126b2503fb7d682af61d94a8f67ee281 /src
parent90516641f69f37b459a0ce084d8ffd28bbf9c7fc (diff)
fix(stop): not canceling timer
Diffstat (limited to 'src')
-rw-r--r--src/main/java/world/anhgelus/manhunt/Manhunt.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/world/anhgelus/manhunt/Manhunt.java b/src/main/java/world/anhgelus/manhunt/Manhunt.java
index f97e58b..2ba2ad5 100644
--- a/src/main/java/world/anhgelus/manhunt/Manhunt.java
+++ b/src/main/java/world/anhgelus/manhunt/Manhunt.java
@@ -8,6 +8,7 @@ import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
import net.fabricmc.fabric.api.entity.event.v1.ServerPlayerEvents;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerEntityEvents;
+import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
import net.minecraft.command.EntitySelector;
import net.minecraft.command.argument.EntityArgumentType;
import net.minecraft.component.DataComponentTypes;
@@ -210,6 +211,10 @@ public class Manhunt implements ModInitializer {
EntityType.PIGLIN.spawn(world, entity.getBlockPos(), SpawnReason.MOB_SUMMONED);
entity.discard();
});
+
+ ServerLifecycleEvents.SERVER_STOPPED.register((server) -> {
+ timer.cancel();
+ });
}
private void setTimer(PlayerManager pm) {