mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-05-06 12:03:46 +08:00
* Add targetRequirement annotation for Command * Added MTL lines for other langs * Fix TargetRequirement enum scoping * Adjust commands to targetRequirement system * Add translation message sugar to prevent future messages from being translated for wrong player * Temporarily disable offline targeting on /permission and /clear * Preliminary README cleanup * Readme commands cleanup * Clean up command table in README, including column shuffle Co-authored-by: AnimeGitB <AnimeGitB@bigblueball.in>
30 lines
842 B
Java
30 lines
842 B
Java
package emu.grasscutter.command;
|
|
|
|
import java.lang.annotation.Retention;
|
|
import java.lang.annotation.RetentionPolicy;
|
|
|
|
@Retention(RetentionPolicy.RUNTIME)
|
|
public @interface Command {
|
|
String label() default "";
|
|
|
|
String usage() default "No usage specified";
|
|
|
|
String description() default "commands.generic.no_description_specified";
|
|
|
|
String[] aliases() default {};
|
|
|
|
String permission() default "";
|
|
|
|
String permissionTargeted() default "";
|
|
|
|
public enum TargetRequirement {
|
|
NONE, // targetPlayer is not required
|
|
OFFLINE, // targetPlayer must be offline
|
|
PLAYER, // targetPlayer can be online or offline
|
|
ONLINE // targetPlayer must be online
|
|
}
|
|
TargetRequirement targetRequirement() default TargetRequirement.ONLINE;
|
|
|
|
boolean threading() default false;
|
|
}
|