Skip to content

Commit

Permalink
添加getId方法
Browse files Browse the repository at this point in the history
  • Loading branch information
CSneko committed Apr 13, 2024
1 parent c95fb74 commit 21ba408
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 32 deletions.
75 changes: 44 additions & 31 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ interface Description{
*/
@NotNull
String getName();

/**
* 获取插件ID
* @return 插件ID
*/
@NotNull
String getId();
/**
* 获取插件版本
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,17 @@ public BukkitDescription(JavaPlugin plugin) {
this.plugin = plugin;
}


@Override
public @NotNull String getName() {
return plugin.getName();
}

@Override
public @NotNull String getId() {
return plugin.getDescription().getName();
}

@Nullable
@Override
public String getVersion() {
Expand All @@ -71,7 +77,7 @@ public String getWebsite() {
}

@Override
public String @javax.annotation.Nullable [] getAuthors() {
public String [] getAuthors() {
return plugin.getDescription().getAuthors().toArray(new String[100]);
}
}
Expand Down

0 comments on commit 21ba408

Please sign in to comment.