Skip to content

Commit

Permalink
[feat] 更新版本: 3.1.6
Browse files Browse the repository at this point in the history
1.调整指令访问权限

Signed-off-by: Saukiya <[email protected]>
  • Loading branch information
Saukiya committed Jan 29, 2023
1 parent 97f34fa commit 1a59677
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ allprojects {
apply plugin: 'java'

group 'github.saukiya'
version '3.1.5'
version '3.1.6'

repositories {
mavenCentral()
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/github/saukiya/sxitem/command/SubCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ public List<String> onTabComplete(CommandSender sender, String[] args) {
return null;
}

public boolean isUse(CommandSender sender, SenderType type) {
return sender.hasPermission(permission()) && Arrays.stream(types).anyMatch(senderType -> senderType.equals(type) || senderType.equals(SenderType.ALL));
}

protected String permission() {
return SXItem.getInst().getName() + "." + cmd;
}
Expand Down Expand Up @@ -61,10 +65,6 @@ protected final void setType(SenderType... types) {
this.types = types;
}

public final boolean isUse(CommandSender sender, SenderType type) {
return sender.hasPermission(permission()) && Arrays.stream(types).anyMatch(senderType -> senderType.equals(type) || senderType.equals(SenderType.ALL));
}

public final void sendIntroduction(CommandSender sender, String color, String label) {
String clickCommand = MessageFormat.format("/{0} {1}", label, cmd);
MessageUtil.getInst().componentBuilder()
Expand Down

0 comments on commit 1a59677

Please sign in to comment.