stop threadexecutor on server shutdown
All checks were successful
build / build (21) (push) Successful in 1m32s
All checks were successful
build / build (21) (push) Successful in 1m32s
This commit is contained in:
parent
4c09e501b4
commit
42daa7c8cd
|
@ -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();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue