mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-24 06:23:54 +08:00
Fix merge conflict
This commit is contained in:
parent
ad1e9400e3
commit
2632ae373c
@ -32,8 +32,8 @@ import java.util.List;
|
|||||||
* A container for player-related commands.
|
* A container for player-related commands.
|
||||||
*/
|
*/
|
||||||
public final class PlayerCommands {
|
public final class PlayerCommands {
|
||||||
@Command(label = "give", aliases = { "g", "item",
|
@Command(label = "give", aliases = {"g", "item", "giveitem"},
|
||||||
"giveitem" }, usage = "Usage: give [player] <itemId|itemName> [amount]")
|
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 {
|
public static class GiveCommand implements CommandHandler {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -158,9 +158,9 @@ public final class PlayerCommands {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@Command(label = "drop", aliases = {"d", "dropitem"},
|
||||||
@Command(label = "drop", aliases = { "d",
|
usage = "drop <itemId|itemName> [amount]",
|
||||||
"dropitem" }, usage = "Usage: drop <itemId|itemName> [amount]", execution = Command.Execution.PLAYER)
|
execution = Command.Execution.PLAYER, description = "Drops an item near you", permission = "server.drop")
|
||||||
public static class DropCommand implements CommandHandler {
|
public static class DropCommand implements CommandHandler {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -201,8 +201,8 @@ public final class PlayerCommands {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Command(label = "givechar", aliases = {
|
@Command(label = "givechar", aliases = { "givec" }, usage = "givechar <playerId> <avatarId> [level]",
|
||||||
"givec" }, usage = "Usage: givechar <player|avatarId> [level|avatarId] [level]")
|
description = "Gives the player a specified character", permission = "player.givechar")
|
||||||
public static class GiveCharCommand implements CommandHandler {
|
public static class GiveCharCommand implements CommandHandler {
|
||||||
@Override
|
@Override
|
||||||
public void execute(GenshinPlayer player, List<String> args) {
|
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 {
|
public static class SpawnCommand implements CommandHandler {
|
||||||
|
|
||||||
@Override
|
@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 {
|
public static class KillAllCommand implements CommandHandler {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -411,8 +413,9 @@ public final class PlayerCommands {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Command(label = "resetconst", aliases = {
|
@Command(label = "resetconst", aliases = {"resetconstellation"},
|
||||||
"resetconstellation" }, usage = "Usage: resetconst [all]", execution = Command.Execution.PLAYER)
|
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 {
|
public static class ResetConstellationCommand implements CommandHandler {
|
||||||
|
|
||||||
@Override
|
@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 {
|
public static class GodModeCommand implements CommandHandler {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -451,8 +455,9 @@ public final class PlayerCommands {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Command(label = "sethealth", aliases = {
|
@Command(label = "sethealth", aliases = {"sethp"},
|
||||||
"sethp" }, usage = "Usage: sethealth <hp>", execution = Command.Execution.PLAYER)
|
usage = "sethealth <hp>", execution = Command.Execution.PLAYER, description = "Sets your health to the specified value",
|
||||||
|
permission = "player.sethealth")
|
||||||
public static class SetHealthCommand implements CommandHandler {
|
public static class SetHealthCommand implements CommandHandler {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -478,8 +483,9 @@ public final class PlayerCommands {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Command(label = "setworldlevel", aliases = {
|
@Command(label = "setworldlevel", aliases = {"setworldlvl"}, usage = "setworldlevel <level>",
|
||||||
"setworldlvl" }, usage = "Usage: setworldlevel <level>", execution = Command.Execution.PLAYER)
|
description = "Sets your world level (Relog to see proper effects)", permission = "player.setworldlevel",
|
||||||
|
execution = Command.Execution.PLAYER)
|
||||||
public static class SetWorldLevelCommand implements CommandHandler {
|
public static class SetWorldLevelCommand implements CommandHandler {
|
||||||
@Override
|
@Override
|
||||||
public void execute(GenshinPlayer player, List<String> args) {
|
public void execute(GenshinPlayer player, List<String> args) {
|
||||||
@ -502,8 +508,9 @@ public final class PlayerCommands {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Command(label = "clearartifacts", aliases = {
|
@Command(label = "clearartifacts", aliases = {"clearart"},
|
||||||
"clearart" }, usage = "Usage: clearartifacts", execution = Command.Execution.PLAYER)
|
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 {
|
public static class ClearArtifactsCommand implements CommandHandler {
|
||||||
@Override
|
@Override
|
||||||
public void execute(GenshinPlayer player, List<String> args) {
|
public void execute(GenshinPlayer player, List<String> args) {
|
||||||
@ -516,8 +523,8 @@ public final class PlayerCommands {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Command(label = "changescene", aliases = {
|
@Command(label = "changescene", aliases = {"scene"},
|
||||||
"scene" }, usage = "Usage: changescene <scene id>", execution = Command.Execution.PLAYER)
|
usage = "changescene <scene id>", description = "Changes your scene", permission = "player.changescene", execution = Command.Execution.PLAYER)
|
||||||
public static class ChangeSceneCommand implements CommandHandler {
|
public static class ChangeSceneCommand implements CommandHandler {
|
||||||
@Override
|
@Override
|
||||||
public void execute(GenshinPlayer player, List<String> args) {
|
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)
|
@Command(label = "sendservermessage", aliases = {"sendservmsg"},
|
||||||
public static class RestartCommand implements CommandHandler {
|
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
|
@Override
|
||||||
public void execute(GenshinPlayer player, List<String> args) {
|
public void execute(GenshinPlayer player, List<String> args) {
|
||||||
player.getSession().close();
|
player.getSession().close();
|
||||||
|
Loading…
Reference in New Issue
Block a user