项目作者: zixuan2020

项目描述 :
公会插件
高级语言: Java
项目地址: git://github.com/zixuan2020/ZSociety.git
创建时间: 2020-02-25T12:04:17Z
项目社区:https://github.com/zixuan2020/ZSociety

开源协议:GNU General Public License v3.0

下载


Zsociety

作者: zixuan007

License MCBBS build

介绍

一款功能全面基础功能的公会插件。

简单的GUI操作让玩家远离命令操作

当前插件版本: 1.0.8alpha

欢迎你贡献代码给这个项目! 无论 PR 还是 issue.

功能

  1. 公会系统

  2. 称号系统

  3. 结婚系统

  4. SVIP系统

命令

  • OP:

    1. /管理 公会
    2. /管理 称号
    3. /管理 结婚
    4. /管理 特权
    5. /管理 给予 称号 [玩家名字] [给予的称号]
  • User:

    1. /公会
    2. /称号
    3. /结婚
    4. /特权

API

  1. package com.zixuan007.society.api;
  2. import com.zixuan007.society.pojo.Society;
  3. import com.zixuan007.society.utils.*;
  4. public class ZsocietyAPI {
  5. public static ZsocietyAPI instance;
  6. private ZsocietyAPI(){
  7. }
  8. static {
  9. instance=new ZsocietyAPI();
  10. }
  11. /**
  12. * 获取公会名称
  13. * @param playerNmae 玩家名字
  14. * @return
  15. */
  16. public static String getSocietyName(String playerNmae) {
  17. Society society = SocietyUtils.getSocietyByPlayerName(playerNmae);
  18. return society != null ? society.getSocietyName() : "无公会";
  19. }
  20. /**
  21. * 获取指定玩家所在的公会
  22. * @param playerName
  23. * @return
  24. */
  25. public static Society getSocietyByPlayerName(String playerName){
  26. return SocietyUtils.getSocietyByPlayerName(playerName);
  27. }
  28. /**
  29. * 获取职位名称
  30. * @param playerName 玩家名字
  31. * @param society 玩家所在的公会
  32. * @return
  33. */
  34. public static String getPostName(String playerName, Society society) {
  35. String postByName = null;
  36. if (society != null) {
  37. postByName = SocietyUtils.getPostByName(playerName, society);
  38. }
  39. return postByName != null ? postByName : "无职位";
  40. }
  41. /**
  42. * 获取公会等级
  43. * @param society 玩家当前所存在的公会
  44. * @return
  45. */
  46. public static int getSocietyGrade(Society society) {
  47. return society != null ? society.getGrade() : -1;
  48. }
  49. /**
  50. * 获取指定玩家的称号
  51. * @param playerName 玩家名字
  52. * @return
  53. */
  54. public static String getTitle(String playerName) {
  55. String title = TitleUtils.getTitles(playerName).size()<=0 ? null : TitleUtils.getTitles(playerName).get(0);
  56. return title != null ? title : "无称号";
  57. }
  58. /**
  59. * 检测玩家是否结婚
  60. * @return
  61. */
  62. public static boolean isMarry(String playerName){
  63. return MarryUtils.isMarry(playerName);
  64. }
  65. /**
  66. * 获取玩家性别
  67. * @param playerName
  68. * @return
  69. */
  70. public static String getGenderbyPlayerName(String playerName){
  71. if(!PluginUtils.isOnlineByName(playerName)) {
  72. return "未知性别";
  73. }
  74. int genderByPlayerName = MarryUtils.getGenderByPlayerName(playerName);
  75. if (genderByPlayerName < 0) {
  76. return "未知性别";
  77. }
  78. return (genderByPlayerName == 0)? "女" : "男";
  79. }
  80. /**
  81. * 是否是VIP
  82. * @param playerName
  83. * @return
  84. */
  85. public static boolean isVIP(String playerName){
  86. if(PrivilegeUtils.isVIP(playerName)) {
  87. return true;
  88. }
  89. return false;
  90. }
  91. /**
  92. * 是否是SVIP
  93. * @param playerName
  94. * @return
  95. */
  96. public static boolean isSVIP(String playerName){
  97. if(PrivilegeUtils.isSvip(playerName)) {
  98. return true;
  99. }
  100. return false;
  101. }
  102. public static ZsocietyAPI getInstance() {
  103. return instance;
  104. }
  105. public static void setInstance(ZsocietyAPI instance) {
  106. ZsocietyAPI.instance = instance;
  107. }
  108. }

结语

尽力做好第一个插件,使插件的健壮性更加强大,设计更加的优雅!