stop threadexecutor on server shutdown
All checks were successful
build / build (21) (push) Successful in 1m32s

This commit is contained in:
Soph :3 2024-11-10 17:05:06 +02:00
parent 4c09e501b4
commit 42daa7c8cd
Signed by: sophie
GPG key ID: EDA5D222A0C270F2

View file

@ -2,6 +2,7 @@ package ovh.sad.animalrp;
import net.fabricmc.api.ModInitializer; import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback; import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import ovh.sad.animalrp.animals.Animal; import ovh.sad.animalrp.animals.Animal;
import ovh.sad.animalrp.animals.Cat; import ovh.sad.animalrp.animals.Cat;
@ -98,5 +99,9 @@ ZZZzz /,`.-'`' -. ;-;;,_
(new InteractionCommand("cuddle", Mood.CUTE, "%s cuddles with you. %s", (new InteractionCommand("cuddle", Mood.CUTE, "%s cuddles with you. %s",
"You and %s start cuddling. How cute! %s")).Command(dispatcher, registryAccess, environment); "You and %s start cuddling. How cute! %s")).Command(dispatcher, registryAccess, environment);
}); });
ServerLifecycleEvents.SERVER_STOPPING.register((server) -> {
executor.shutdownNow();
});
} }
} }