Skip to content
Snippets Groups Projects
Commit 2632ae37 authored by memetrollsXD's avatar memetrollsXD Committed by GitHub
Browse files

Fix merge conflict

parent ad1e9400
Branches
Tags
No related merge requests found
......@@ -32,8 +32,8 @@ import java.util.List;
* A container for player-related commands.
*/
public final class PlayerCommands {
@Command(label = "give", aliases = { "g", "item",
"giveitem" }, usage = "Usage: give [player] <itemId|itemName> [amount]")
@Command(label = "give", aliases = {"g", "item", "giveitem"},
usage = "give [player] <itemId|itemName> [amount]", description = "Gives an item to you or the specified player", permission = "player.give")
public static class GiveCommand implements CommandHandler {
@Override
......@@ -158,9 +158,9 @@ public final class PlayerCommands {
}
}
}
@Command(label = "drop", aliases = { "d",
"dropitem" }, usage = "Usage: drop <itemId|itemName> [amount]", execution = Command.Execution.PLAYER)
@Command(label = "drop", aliases = {"d", "dropitem"},
usage = "drop <itemId|itemName> [amount]",
execution = Command.Execution.PLAYER, description = "Drops an item near you", permission = "server.drop")
public static class DropCommand implements CommandHandler {
@Override
......@@ -201,8 +201,8 @@ public final class PlayerCommands {
}
}
@Command(label = "givechar", aliases = {
"givec" }, usage = "Usage: givechar <player|avatarId> [level|avatarId] [level]")
@Command(label = "givechar", aliases = { "givec" }, usage = "givechar <playerId> <avatarId> [level]",
description = "Gives the player a specified character", permission = "player.givechar")
public static class GiveCharCommand implements CommandHandler {
@Override
public void execute(GenshinPlayer player, List<String> args) {
......@@ -328,7 +328,8 @@ public final class PlayerCommands {
}
}
@Command(label = "spawn", execution = Command.Execution.PLAYER, usage = "Usage: spawn <entityId|entityName> [level] [amount]")
@Command(label = "spawn", execution = Command.Execution.PLAYER,
usage = "spawn <entityId|entityName> [level] [amount]", description = "Spawns an entity near you", permission = "server.spawn")
public static class SpawnCommand implements CommandHandler {
@Override
......@@ -366,7 +367,8 @@ public final class PlayerCommands {
}
}
@Command(label = "killall", usage = "Usage: killall [playerUid] [sceneId]")
@Command(label = "killall",
usage = "killall [playerUid] [sceneId]", description = "Kill all entities", permission = "server.killall")
public static class KillAllCommand implements CommandHandler {
@Override
......@@ -411,8 +413,9 @@ public final class PlayerCommands {
}
}
@Command(label = "resetconst", aliases = {
"resetconstellation" }, usage = "Usage: resetconst [all]", execution = Command.Execution.PLAYER)
@Command(label = "resetconst", aliases = {"resetconstellation"},
usage = "resetconst [all]", execution = Command.Execution.PLAYER, permission = "player.resetconstellation",
description = "Resets the constellation level on your current active character, will need to relog after using the command to see any changes.")
public static class ResetConstellationCommand implements CommandHandler {
@Override
......@@ -441,7 +444,8 @@ public final class PlayerCommands {
}
}
@Command(label = "godmode", usage = "Usage: godmode", execution = Command.Execution.PLAYER)
@Command(label = "godmode",
usage = "godmode", execution = Command.Execution.PLAYER, description = "Prevents you from taking damage", permission = "player.godmode")
public static class GodModeCommand implements CommandHandler {
@Override
......@@ -451,8 +455,9 @@ public final class PlayerCommands {
}
}
@Command(label = "sethealth", aliases = {
"sethp" }, usage = "Usage: sethealth <hp>", execution = Command.Execution.PLAYER)
@Command(label = "sethealth", aliases = {"sethp"},
usage = "sethealth <hp>", execution = Command.Execution.PLAYER, description = "Sets your health to the specified value",
permission = "player.sethealth")
public static class SetHealthCommand implements CommandHandler {
@Override
......@@ -478,8 +483,9 @@ public final class PlayerCommands {
}
}
@Command(label = "setworldlevel", aliases = {
"setworldlvl" }, usage = "Usage: setworldlevel <level>", execution = Command.Execution.PLAYER)
@Command(label = "setworldlevel", aliases = {"setworldlvl"}, usage = "setworldlevel <level>",
description = "Sets your world level (Relog to see proper effects)", permission = "player.setworldlevel",
execution = Command.Execution.PLAYER)
public static class SetWorldLevelCommand implements CommandHandler {
@Override
public void execute(GenshinPlayer player, List<String> args) {
......@@ -502,8 +508,9 @@ public final class PlayerCommands {
}
}
@Command(label = "clearartifacts", aliases = {
"clearart" }, usage = "Usage: clearartifacts", execution = Command.Execution.PLAYER)
@Command(label = "clearartifacts", aliases = {"clearart"},
usage = "clearartifacts", execution = Command.Execution.PLAYER, permission = "player.clearartifacts",
description = "Deletes all unequipped and unlocked level 0 artifacts, including yellow rarity ones from your inventory")
public static class ClearArtifactsCommand implements CommandHandler {
@Override
public void execute(GenshinPlayer player, List<String> args) {
......@@ -516,8 +523,8 @@ public final class PlayerCommands {
}
}
@Command(label = "changescene", aliases = {
"scene" }, usage = "Usage: changescene <scene id>", execution = Command.Execution.PLAYER)
@Command(label = "changescene", aliases = {"scene"},
usage = "changescene <scene id>", description = "Changes your scene", permission = "player.changescene", execution = Command.Execution.PLAYER)
public static class ChangeSceneCommand implements CommandHandler {
@Override
public void execute(GenshinPlayer player, List<String> args) {
......@@ -540,9 +547,35 @@ public final class PlayerCommands {
}
}
@Command(label = "restart", usage = "Usage: restart - Restarts the current session", execution = Command.Execution.PLAYER)
public static class RestartCommand implements CommandHandler {
@Command(label = "sendservermessage", aliases = {"sendservmsg"},
usage = "sendservermessage <player> <message>", description = "Sends a message to a player as the server",
execution = Command.Execution.PLAYER, permission = "server.sendmessage")
public static class SendServerMessageCommand implements CommandHandler {
@Override
public void execute(GenshinPlayer player, List<String> args) {
if(args.size() < 2) {
CommandHandler.sendMessage(null, "Usage: sendmessage <player> <message>"); return;
}
try {
int target = Integer.parseInt(args.get(0));
String message = String.join(" ", args.subList(1, args.size()));
GenshinPlayer targetPlayer = Grasscutter.getGameServer().getPlayerByUid(target);
if(targetPlayer == null) {
CommandHandler.sendMessage(null, "Player not found."); return;
}
targetPlayer.dropMessage(message);
CommandHandler.sendMessage(null, "Message sent.");
} catch (NumberFormatException ignored) {
CommandHandler.sendMessage(null, "Invalid player ID.");
}
}
}
@Command(label = "restart", usage = "Usage: restart", description = "Restarts the current session", execution = Command.Execution.PLAYER, permission = "player.restart")
public static class RestartCommand implements CommandHandler {
@Override
public void execute(GenshinPlayer player, List<String> args) {
player.getSession().close();
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment