feat: run cspy self-care from the core if possible

This commit is contained in:
Chayapak Supasakul 2025-05-07 09:10:09 +07:00
parent b27140951b
commit 82ef0daf88
Signed by: ChomeNS
SSH key fingerprint: SHA256:0YoxhdyXsgbc0nfeB2N6FYE60mxMU7DS4uCUMaw2mvA

View file

@ -62,7 +62,16 @@ public class SelfCare implements Listener {
else if (!player.isInCreativeMode() && gamemodeEnabled)
networkHandler.sendChatCommand("gamemode creative");
else if (!cspy && cspyEnabled && serverHasCommand("c"))
if (
!CommandCore.INSTANCE.ready
|| !CommandCore.INSTANCE.runFillCommand
|| !player.isInCreativeMode()
|| !player.hasPermissionLevel(2)
) {
networkHandler.sendChatCommand("c on");
} else {
CommandCore.INSTANCE.run("c " + player.getUuidAsString() + " on");
}
else if (!hasSkin && !skin.equalsIgnoreCase("off"))
networkHandler.sendChatCommand("skin " + skin);
}