Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-11-20 06:50:09 +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) {
|
public void sendMessage(String message) {
|
||||||
info(message);
|
info(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isConsole() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,4 +11,6 @@ public interface CommandSender {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void sendMessage(String message);
|
void sendMessage(String message);
|
||||||
|
|
||||||
|
boolean isConsole();
|
||||||
}
|
}
|
||||||
|
@ -44,6 +44,9 @@ public class StopCommand extends GeyserCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(CommandSender sender, String[] args) {
|
public void execute(CommandSender sender, String[] args) {
|
||||||
|
if (!sender.isConsole())
|
||||||
|
return;
|
||||||
|
|
||||||
connector.shutdown();
|
connector.shutdown();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -324,6 +324,11 @@ public class GeyserSession implements CommandSender {
|
|||||||
upstream.sendPacket(textPacket);
|
upstream.sendPacket(textPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isConsole() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public void sendForm(FormWindow window, int id) {
|
public void sendForm(FormWindow window, int id) {
|
||||||
windowCache.showWindow(window, id);
|
windowCache.showWindow(window, id);
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren