Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2025-01-12 08:01:06 +01:00
Only allow console to shut down Geyser with a command
Dieser Commit ist enthalten in:
Ursprung
c290e7a7fd
Commit
1670c77672
@ -108,4 +108,9 @@ public class GeyserLogger extends SimpleTerminalConsole implements IGeyserLogger
|
||||
public void sendMessage(String message) {
|
||||
info(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isConsole() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -11,4 +11,6 @@ public interface CommandSender {
|
||||
}
|
||||
|
||||
void sendMessage(String message);
|
||||
|
||||
boolean isConsole();
|
||||
}
|
||||
|
@ -44,6 +44,9 @@ public class StopCommand extends GeyserCommand {
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if (!sender.isConsole())
|
||||
return;
|
||||
|
||||
connector.shutdown();
|
||||
}
|
||||
}
|
||||
|
@ -324,6 +324,11 @@ public class GeyserSession implements CommandSender {
|
||||
upstream.sendPacket(textPacket);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isConsole() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void sendForm(FormWindow window, int id) {
|
||||
windowCache.showWindow(window, id);
|
||||
}
|
||||
|
Laden…
x
In neuem Issue referenzieren
Einen Benutzer sperren