diff --git a/src/main/java/ovh/sad/animalrp/AnimalRP.java b/src/main/java/ovh/sad/animalrp/AnimalRP.java index 26bb806..df03a8e 100644 --- a/src/main/java/ovh/sad/animalrp/AnimalRP.java +++ b/src/main/java/ovh/sad/animalrp/AnimalRP.java @@ -2,6 +2,7 @@ package ovh.sad.animalrp; import net.fabricmc.api.ModInitializer; import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback; +import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; import net.minecraft.util.Identifier; import ovh.sad.animalrp.animals.Animal; import ovh.sad.animalrp.animals.Cat; @@ -98,5 +99,9 @@ ZZZzz /,`.-'`' -. ;-;;,_ (new InteractionCommand("cuddle", Mood.CUTE, "%s cuddles with you. %s", "You and %s start cuddling. How cute! %s")).Command(dispatcher, registryAccess, environment); }); + + ServerLifecycleEvents.SERVER_STOPPING.register((server) -> { + executor.shutdownNow(); + }); } } \ No newline at end of file