mirror of
https://github.com/Oth3r/Sit.git
synced 2025-09-19 16:03:22 +02:00
console reload support
This commit is contained in:
parent
683956585f
commit
05ed35e0ef
1 changed files with 8 additions and 1 deletions
|
@ -36,7 +36,6 @@ public class SitCommand {
|
||||||
}
|
}
|
||||||
private static int command(ServerCommandSource source, String arg) {
|
private static int command(ServerCommandSource source, String arg) {
|
||||||
ServerPlayerEntity player = source.getPlayer();
|
ServerPlayerEntity player = source.getPlayer();
|
||||||
if (player == null) return 1;
|
|
||||||
//trim all the arguments before the command
|
//trim all the arguments before the command
|
||||||
String keyword = "sit";
|
String keyword = "sit";
|
||||||
int index = Integer.MAX_VALUE;
|
int index = Integer.MAX_VALUE;
|
||||||
|
@ -46,6 +45,14 @@ public class SitCommand {
|
||||||
String[] args = arg.split(" ");
|
String[] args = arg.split(" ");
|
||||||
if (args[0].equalsIgnoreCase("sit"))
|
if (args[0].equalsIgnoreCase("sit"))
|
||||||
args = arg.replaceFirst("sit ", "").split(" ");
|
args = arg.replaceFirst("sit ", "").split(" ");
|
||||||
|
// if console
|
||||||
|
if (player == null) {
|
||||||
|
if (args[0].equalsIgnoreCase("reload")) {
|
||||||
|
config.load();
|
||||||
|
Sit.LOGGER.info(Sit.lang("key.sit.command.reloaded").getString());
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
if (args[0].equalsIgnoreCase("sit")) {
|
if (args[0].equalsIgnoreCase("sit")) {
|
||||||
BlockPos pos = player.getBlockPos();
|
BlockPos pos = player.getBlockPos();
|
||||||
if (!(player.getY() -((int) player.getY()) > 0.00)) {
|
if (!(player.getY() -((int) player.getY()) > 0.00)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue