Add check for when the session state doesn't actually change

This commit is contained in:
Norbi Peti 2021-07-15 22:37:08 +02:00
parent 2d08ef55fa
commit f4871574d3
No known key found for this signature in database
GPG key ID: DBA4C4549A927E56

View file

@ -105,6 +105,10 @@ public final class Computer {
*/
public void onLock(CommandSender sender) {
System.out.println("A");
if (session.getState() != SessionState.Locked) {
sendMessage(sender, "§cFailed to start computer! Failed to lock session");
return;
}
machine = session.getMachine(); // This is the Machine object we can work with
final IConsole console = session.getConsole();
if (embedded) { //Otherwise it's set while starting the VM