-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5bdd15f
commit a350e01
Showing
24 changed files
with
523 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
package cn.lunadeer.dominion.api; | ||
|
||
public interface Dominion { | ||
import org.bukkit.Bukkit; | ||
|
||
static Cache getInstance() throws ClassNotFoundException, NoSuchFieldException, IllegalAccessException { | ||
// Cache.instance is a static field in the Cache class | ||
return (Cache) Class.forName("cn.lunadeer.dominion.Cache").getDeclaredField("instance").get(null); | ||
public class Dominion { | ||
|
||
public static DominionAPI getInstance() throws ClassNotFoundException, NoSuchFieldException, IllegalAccessException { | ||
// 通过反射获取 Cache 类中的 instance 字段 | ||
var instanceField = Class.forName("cn.lunadeer.dominion.Cache").getDeclaredField("instance"); | ||
// 设置可访问 | ||
instanceField.setAccessible(true); | ||
// 返回 Cache 的实例 | ||
return (DominionAPI) instanceField.get(null); | ||
} | ||
|
||
public static boolean isDominionEnabled() { | ||
return Bukkit.getPluginManager().isPluginEnabled("Dominion"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,40 @@ | ||
package cn.lunadeer.dominion.api.dtos; | ||
|
||
public interface Flag { | ||
/** | ||
* 权限名称(英文) | ||
* | ||
* @return 权限名称 | ||
*/ | ||
String getFlagName(); | ||
|
||
/** | ||
* 权限显示名称(中文) | ||
* 该名称从languages文件中加载 | ||
* | ||
* @return 权限显示名称 | ||
*/ | ||
String getDisplayName(); | ||
|
||
/** | ||
* 权限描述 | ||
* 该描述从languages文件中加载 | ||
* | ||
* @return 权限描述 | ||
*/ | ||
String getDescription(); | ||
|
||
/** | ||
* 获取权限默认值 | ||
* | ||
* @return 权限默认值 | ||
*/ | ||
Boolean getDefaultValue(); | ||
|
||
/** | ||
* 获取权限是否启用 | ||
* | ||
* @return 权限是否启用 | ||
*/ | ||
Boolean getEnable(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
api/src/main/java/cn/lunadeer/dominion/api/dtos/PrivilegeTemplateDTO.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.