Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
219a8508
Commit
219a8508
authored
May 08, 2022
by
Akka
Browse files
Merge remote-tracking branch 'origin/development' into tower
parents
4b6842f0
65861c3c
Changes
66
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/command/commands/HealCommand.java
View file @
219a8508
...
...
@@ -11,9 +11,9 @@ import java.util.List;
import
static
emu
.
grasscutter
.
utils
.
Language
.
translate
;
@Command
(
label
=
"heal"
,
usage
=
"heal|h"
,
aliases
=
{
"h"
},
description
=
"Heal all characters in your current team."
,
permission
=
"player.heal"
)
@Command
(
label
=
"heal"
,
usage
=
"heal|h"
,
aliases
=
{
"h"
},
permission
=
"player.heal"
,
description
=
"commands.heal.description"
)
public
final
class
HealCommand
implements
CommandHandler
{
@Override
public
void
execute
(
Player
sender
,
Player
targetPlayer
,
List
<
String
>
args
)
{
if
(
targetPlayer
==
null
)
{
...
...
src/main/java/emu/grasscutter/command/commands/HelpCommand.java
View file @
219a8508
...
...
@@ -10,8 +10,7 @@ import java.util.*;
import
static
emu
.
grasscutter
.
utils
.
Language
.
translate
;
@Command
(
label
=
"help"
,
usage
=
"help [command]"
,
description
=
"Sends the help message or shows information about a specified command"
)
@Command
(
label
=
"help"
,
usage
=
"help [command]"
,
description
=
"commands.help.description"
)
public
final
class
HelpCommand
implements
CommandHandler
{
@Override
...
...
@@ -39,7 +38,7 @@ public final class HelpCommand implements CommandHandler {
}
else
{
Command
annotation
=
handler
.
getClass
().
getAnnotation
(
Command
.
class
);
builder
.
append
(
" "
).
append
(
annotation
.
description
()).
append
(
"\n"
);
builder
.
append
(
" "
).
append
(
translate
(
annotation
.
description
())
)
.
append
(
"\n"
);
builder
.
append
(
translate
(
"commands.help.usage"
)).
append
(
annotation
.
usage
());
if
(
annotation
.
aliases
().
length
>=
1
)
{
builder
.
append
(
"\n"
).
append
(
translate
(
"commands.help.aliases"
));
...
...
@@ -61,7 +60,7 @@ public final class HelpCommand implements CommandHandler {
StringBuilder
builder
=
new
StringBuilder
(
"\n"
+
translate
(
"commands.help.available_commands"
)
+
"\n"
);
annotations
.
forEach
(
annotation
->
{
builder
.
append
(
annotation
.
label
()).
append
(
"\n"
);
builder
.
append
(
" "
).
append
(
annotation
.
description
()).
append
(
"\n"
);
builder
.
append
(
" "
).
append
(
translate
(
annotation
.
description
())
)
.
append
(
"\n"
);
builder
.
append
(
translate
(
"commands.help.usage"
)).
append
(
annotation
.
usage
());
if
(
annotation
.
aliases
().
length
>=
1
)
{
builder
.
append
(
"\n"
).
append
(
translate
(
"commands.help.aliases"
));
...
...
@@ -78,7 +77,7 @@ public final class HelpCommand implements CommandHandler {
CommandHandler
.
sendMessage
(
player
,
translate
(
"commands.help.available_commands"
));
annotations
.
forEach
(
annotation
->
{
StringBuilder
builder
=
new
StringBuilder
(
annotation
.
label
()).
append
(
"\n"
);
builder
.
append
(
" "
).
append
(
annotation
.
description
()).
append
(
"\n"
);
builder
.
append
(
" "
).
append
(
translate
(
annotation
.
description
())
)
.
append
(
"\n"
);
builder
.
append
(
translate
(
"commands.help.usage"
)).
append
(
annotation
.
usage
());
if
(
annotation
.
aliases
().
length
>=
1
)
{
builder
.
append
(
"\n"
).
append
(
translate
(
"commands.help.aliases"
));
...
...
src/main/java/emu/grasscutter/command/commands/KickCommand.java
View file @
219a8508
...
...
@@ -8,8 +8,7 @@ import java.util.List;
import
static
emu
.
grasscutter
.
utils
.
Language
.
translate
;
@Command
(
label
=
"kick"
,
usage
=
"kick"
,
description
=
"Kicks the specified player from the server (WIP)"
,
permission
=
"server.kick"
)
@Command
(
label
=
"kick"
,
usage
=
"kick"
,
permission
=
"server.kick"
,
description
=
"commands.kick.description"
)
public
final
class
KickCommand
implements
CommandHandler
{
@Override
...
...
src/main/java/emu/grasscutter/command/commands/KillAllCommand.java
View file @
219a8508
...
...
@@ -12,8 +12,7 @@ import java.util.List;
import
static
emu
.
grasscutter
.
utils
.
Language
.
translate
;
@Command
(
label
=
"killall"
,
usage
=
"killall [sceneId]"
,
description
=
"Kill all entities"
,
permission
=
"server.killall"
)
@Command
(
label
=
"killall"
,
usage
=
"killall [sceneId]"
,
permission
=
"server.killall"
,
description
=
"commands.kill.description"
)
public
final
class
KillAllCommand
implements
CommandHandler
{
@Override
...
...
src/main/java/emu/grasscutter/command/commands/KillCharacterCommand.java
View file @
219a8508
...
...
@@ -13,8 +13,7 @@ import java.util.List;
import
static
emu
.
grasscutter
.
utils
.
Language
.
translate
;
@Command
(
label
=
"killcharacter"
,
usage
=
"killcharacter"
,
aliases
=
{
"suicide"
,
"kill"
},
description
=
"Kills the players current character"
,
permission
=
"player.killcharacter"
)
@Command
(
label
=
"killcharacter"
,
usage
=
"killcharacter"
,
aliases
=
{
"suicide"
,
"kill"
},
permission
=
"player.killcharacter"
,
description
=
"commands.list.description"
)
public
final
class
KillCharacterCommand
implements
CommandHandler
{
@Override
...
...
src/main/java/emu/grasscutter/command/commands/ListCommand.java
View file @
219a8508
...
...
@@ -10,8 +10,7 @@ import java.util.Map;
import
static
emu
.
grasscutter
.
utils
.
Language
.
translate
;
@Command
(
label
=
"list"
,
usage
=
"list [uid]"
,
description
=
"List online players"
,
aliases
=
{
"players"
})
@Command
(
label
=
"list"
,
usage
=
"list [uid]"
,
aliases
=
{
"players"
},
description
=
"commands.list.description"
)
public
final
class
ListCommand
implements
CommandHandler
{
@Override
...
...
src/main/java/emu/grasscutter/command/commands/PermissionCommand.java
View file @
219a8508
...
...
@@ -10,8 +10,7 @@ import java.util.List;
import
static
emu
.
grasscutter
.
utils
.
Language
.
translate
;
@Command
(
label
=
"permission"
,
usage
=
"permission <add|remove> <permission>"
,
description
=
"Grants or removes a permission for a user"
,
permission
=
"*"
)
@Command
(
label
=
"permission"
,
usage
=
"permission <add|remove> <permission>"
,
permission
=
"*"
,
description
=
"commands.permission.description"
)
public
final
class
PermissionCommand
implements
CommandHandler
{
@Override
...
...
src/main/java/emu/grasscutter/command/commands/PositionCommand.java
View file @
219a8508
...
...
@@ -9,8 +9,7 @@ import java.util.List;
import
static
emu
.
grasscutter
.
utils
.
Language
.
translate
;
@Command
(
label
=
"position"
,
usage
=
"position"
,
aliases
=
{
"pos"
},
description
=
"Get coordinates."
)
@Command
(
label
=
"position"
,
usage
=
"position"
,
aliases
=
{
"pos"
},
description
=
"commands.position.description"
)
public
final
class
PositionCommand
implements
CommandHandler
{
@Override
...
...
src/main/java/emu/grasscutter/command/commands/ReloadCommand.java
View file @
219a8508
...
...
@@ -9,8 +9,7 @@ import java.util.List;
import
static
emu
.
grasscutter
.
utils
.
Language
.
translate
;
@Command
(
label
=
"reload"
,
usage
=
"reload"
,
description
=
"Reload server config"
,
permission
=
"server.reload"
)
@Command
(
label
=
"reload"
,
usage
=
"reload"
,
permission
=
"server.reload"
,
description
=
"commands.reload.description"
)
public
final
class
ReloadCommand
implements
CommandHandler
{
@Override
...
...
src/main/java/emu/grasscutter/command/commands/ResetConstCommand.java
View file @
219a8508
...
...
@@ -11,8 +11,7 @@ import java.util.List;
import
static
emu
.
grasscutter
.
utils
.
Language
.
translate
;
@Command
(
label
=
"resetconst"
,
usage
=
"resetconst [all]"
,
description
=
"Resets the constellation level on your current active character, will need to relog after using the command to see any changes."
,
aliases
=
{
"resetconstellation"
},
permission
=
"player.resetconstellation"
)
aliases
=
{
"resetconstellation"
},
permission
=
"player.resetconstellation"
,
description
=
"commands.resetConst.description"
)
public
final
class
ResetConstCommand
implements
CommandHandler
{
@Override
...
...
src/main/java/emu/grasscutter/command/commands/ResetShopLimitCommand.java
View file @
219a8508
...
...
@@ -9,9 +9,9 @@ import java.util.List;
import
static
emu
.
grasscutter
.
utils
.
Language
.
translate
;
@Command
(
label
=
"resetshop"
,
usage
=
"resetshop"
,
description
=
"Reset target player's shop refresh time."
,
permission
=
"server.resetshop"
)
@Command
(
label
=
"resetshop"
,
usage
=
"resetshop"
,
permission
=
"server.resetshop"
,
description
=
"commands.status.description"
)
public
final
class
ResetShopLimitCommand
implements
CommandHandler
{
@Override
public
void
execute
(
Player
sender
,
Player
targetPlayer
,
List
<
String
>
args
)
{
if
(
targetPlayer
==
null
)
{
...
...
src/main/java/emu/grasscutter/command/commands/RestartCommand.java
View file @
219a8508
...
...
@@ -6,7 +6,9 @@ import emu.grasscutter.game.player.Player;
import
java.util.List
;
@Command
(
label
=
"restart"
,
usage
=
"restart - Restarts the current session"
)
import
static
emu
.
grasscutter
.
utils
.
Language
.
translate
;
@Command
(
label
=
"restart"
,
usage
=
"restart"
,
description
=
"commands.restart.description"
)
public
final
class
RestartCommand
implements
CommandHandler
{
@Override
...
...
src/main/java/emu/grasscutter/command/commands/SendMailCommand.java
View file @
219a8508
...
...
@@ -13,8 +13,7 @@ import java.util.List;
import
static
emu
.
grasscutter
.
utils
.
Language
.
translate
;
@SuppressWarnings
(
"ConstantConditions"
)
@Command
(
label
=
"sendmail"
,
usage
=
"sendmail <userId|all|help> [templateId]"
,
description
=
"Sends mail to the specified user. The usage of this command changes based on it's composition state."
,
permission
=
"server.sendmail"
)
@Command
(
label
=
"sendmail"
,
usage
=
"sendmail <userId|all|help> [templateId]"
,
permission
=
"server.sendmail"
,
description
=
"commands.sendMail.description"
)
public
final
class
SendMailCommand
implements
CommandHandler
{
// TODO: You should be able to do /sendmail and then just send subsequent messages until you finish
...
...
@@ -40,7 +39,7 @@ public final class SendMailCommand implements CommandHandler {
MailBuilder
mailBuilder
;
switch
(
args
.
get
(
0
).
toLowerCase
())
{
case
"help"
->
{
CommandHandler
.
sendMessage
(
sender
,
this
.
getClass
().
getAnnotation
(
Command
.
class
).
description
()
+
"\nUsage: "
+
this
.
getClass
().
getAnnotation
(
Command
.
class
).
usage
());
CommandHandler
.
sendMessage
(
sender
,
translate
(
this
.
getClass
().
getAnnotation
(
Command
.
class
).
description
()
)
+
"\nUsage: "
+
this
.
getClass
().
getAnnotation
(
Command
.
class
).
usage
());
return
;
}
case
"all"
->
mailBuilder
=
new
MailBuilder
(
true
,
new
Mail
());
...
...
src/main/java/emu/grasscutter/command/commands/SendMessageCommand.java
View file @
219a8508
...
...
@@ -8,8 +8,8 @@ import java.util.List;
import
static
emu
.
grasscutter
.
utils
.
Language
.
translate
;
@Command
(
label
=
"say"
,
usage
=
"say <message>"
,
description
=
"Sends a message to a player as the server"
,
aliases
=
{
"sendservmsg"
,
"sendservermessage"
,
"sendmessage"
},
permission
=
"server.sendmessage"
)
@Command
(
label
=
"say"
,
usage
=
"say <message>"
,
aliases
=
{
"sendservmsg"
,
"sendservermessage"
,
"sendmessage"
},
permission
=
"server.sendmessage"
,
description
=
"commands.sendMessage.description"
)
public
final
class
SendMessageCommand
implements
CommandHandler
{
@Override
...
...
src/main/java/emu/grasscutter/command/commands/SetFetterLevelCommand.java
View file @
219a8508
...
...
@@ -12,8 +12,7 @@ import emu.grasscutter.server.packet.send.PacketAvatarFetterDataNotify;
import
static
emu
.
grasscutter
.
utils
.
Language
.
translate
;
@Command
(
label
=
"setfetterlevel"
,
usage
=
"setfetterlevel <level>"
,
description
=
"Sets your fetter level for your current active character"
,
aliases
=
{
"setfetterlvl"
,
"setfriendship"
},
permission
=
"player.setfetterlevel"
)
aliases
=
{
"setfetterlvl"
,
"setfriendship"
},
permission
=
"player.setfetterlevel"
,
description
=
"commands.setFetterLevel.description"
)
public
final
class
SetFetterLevelCommand
implements
CommandHandler
{
@Override
...
...
src/main/java/emu/grasscutter/command/commands/SetStatsCommand.java
View file @
219a8508
...
...
@@ -15,8 +15,7 @@ import emu.grasscutter.utils.Language;
import
static
emu
.
grasscutter
.
utils
.
Language
.
translate
;
@Command
(
label
=
"setstats"
,
usage
=
"setstats|stats <stat> <value>"
,
description
=
"Set fight property for your current active character"
,
aliases
=
{
"stats"
},
permission
=
"player.setstats"
)
@Command
(
label
=
"setstats"
,
usage
=
"setstats|stats <stat> <value>"
,
aliases
=
{
"stats"
},
permission
=
"player.setstats"
,
description
=
"commands.setStats.description"
)
public
final
class
SetStatsCommand
implements
CommandHandler
{
static
class
Stat
{
String
name
;
...
...
src/main/java/emu/grasscutter/command/commands/SetWorldLevelCommand.java
View file @
219a8508
...
...
@@ -10,8 +10,7 @@ import java.util.List;
import
static
emu
.
grasscutter
.
utils
.
Language
.
translate
;
@Command
(
label
=
"setworldlevel"
,
usage
=
"setworldlevel <level>"
,
description
=
"Sets your world level (Relog to see proper effects)"
,
aliases
=
{
"setworldlvl"
},
permission
=
"player.setworldlevel"
)
aliases
=
{
"setworldlvl"
},
permission
=
"player.setworldlevel"
,
description
=
"commands.setWorldLevel.description"
)
public
final
class
SetWorldLevelCommand
implements
CommandHandler
{
@Override
...
...
src/main/java/emu/grasscutter/command/commands/SpawnCommand.java
View file @
219a8508
...
...
@@ -22,8 +22,7 @@ import java.util.Random;
import
static
emu
.
grasscutter
.
utils
.
Language
.
translate
;
@Command
(
label
=
"spawn"
,
usage
=
"spawn <entityId> [amount] [level(monster only)]"
,
description
=
"Spawns an entity near you"
,
permission
=
"server.spawn"
)
@Command
(
label
=
"spawn"
,
usage
=
"spawn <entityId> [amount] [level(monster only)]"
,
permission
=
"server.spawn"
,
description
=
"commands.spawn.description"
)
public
final
class
SpawnCommand
implements
CommandHandler
{
@Override
...
...
src/main/java/emu/grasscutter/command/commands/StopCommand.java
View file @
219a8508
...
...
@@ -9,8 +9,7 @@ import java.util.List;
import
static
emu
.
grasscutter
.
utils
.
Language
.
translate
;
@Command
(
label
=
"stop"
,
usage
=
"stop"
,
description
=
"Stops the server"
,
permission
=
"server.stop"
)
@Command
(
label
=
"stop"
,
usage
=
"stop"
,
permission
=
"server.stop"
,
description
=
"commands.stop.description"
)
public
final
class
StopCommand
implements
CommandHandler
{
@Override
...
...
src/main/java/emu/grasscutter/command/commands/TalentCommand.java
View file @
219a8508
...
...
@@ -14,8 +14,7 @@ import java.util.List;
import
static
emu
.
grasscutter
.
utils
.
Language
.
translate
;
@Command
(
label
=
"talent"
,
usage
=
"talent <talentID> <value>"
,
description
=
"Set talent level for your current active character"
,
permission
=
"player.settalent"
)
@Command
(
label
=
"talent"
,
usage
=
"talent <talentID> <value>"
,
permission
=
"player.settalent"
,
description
=
"commands.talent.description"
)
public
final
class
TalentCommand
implements
CommandHandler
{
private
void
setTalentLevel
(
Player
sender
,
Player
player
,
Avatar
avatar
,
int
talentId
,
int
talentLevel
)
{
int
oldLevel
=
avatar
.
getSkillLevelMap
().
get
(
talentId
);
...
...
Prev
1
2
3
4
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment