├── .gitignore ├── LICENSE ├── README.md ├── docs ├── allclasses-index.html ├── allpackages-index.html ├── cn │ └── handyplus │ │ └── lib │ │ └── adapter │ │ ├── BukkitScheduler.html │ │ ├── FoliaScheduler.html │ │ ├── HandyRunnable.html │ │ ├── HandySchedulerUtil.html │ │ ├── HandySchedulerUtilTest.html │ │ ├── PlayerSchedulerUtil.html │ │ ├── ServerTypeEnum.html │ │ ├── WorldSchedulerUtil.html │ │ ├── package-summary.html │ │ └── package-tree.html ├── copy.svg ├── element-list ├── help-doc.html ├── index-files │ ├── index-1.html │ ├── index-10.html │ ├── index-11.html │ ├── index-12.html │ ├── index-13.html │ ├── index-14.html │ ├── index-15.html │ ├── index-2.html │ ├── index-3.html │ ├── index-4.html │ ├── index-5.html │ ├── index-6.html │ ├── index-7.html │ ├── index-8.html │ └── index-9.html ├── index.html ├── legal │ ├── COPYRIGHT │ ├── LICENSE │ ├── jquery.md │ └── jqueryUI.md ├── link.svg ├── member-search-index.js ├── module-search-index.js ├── overview-tree.html ├── package-search-index.js ├── resources │ ├── glass.png │ └── x.png ├── script-dir │ ├── jquery-3.6.1.min.js │ ├── jquery-ui.min.css │ └── jquery-ui.min.js ├── script.js ├── search-page.js ├── search.html ├── search.js ├── stylesheet.css ├── tag-search-index.js └── type-search-index.js ├── pom.xml └── src ├── main └── java │ └── cn │ └── handyplus │ └── lib │ └── adapter │ ├── BukkitScheduler.java │ ├── FoliaScheduler.java │ ├── HandyRunnable.java │ ├── HandySchedulerUtil.java │ ├── PlayerSchedulerUtil.java │ ├── ServerTypeEnum.java │ └── WorldSchedulerUtil.java └── test └── java └── cn └── handyplus └── lib └── adapter └── HandySchedulerUtilTest.java /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | !**/src/main/**/target/ 4 | !**/src/test/**/target/ 5 | 6 | ### IntelliJ IDEA ### 7 | .idea/modules.xml 8 | .idea/jarRepositories.xml 9 | .idea/compiler.xml 10 | .idea/libraries/ 11 | *.iws 12 | *.iml 13 | *.ipr 14 | 15 | ### Eclipse ### 16 | .apt_generated 17 | .classpath 18 | .factorypath 19 | .project 20 | .settings 21 | .springBeans 22 | .sts4-cache 23 | 24 | ### NetBeans ### 25 | /nbproject/private/ 26 | /nbbuild/ 27 | /dist/ 28 | /nbdist/ 29 | /.nb-gradle/ 30 | build/ 31 | !**/src/main/**/build/ 32 | !**/src/test/**/build/ 33 | 34 | ### VS Code ### 35 | .vscode/ 36 | 37 | ### Mac OS ### 38 | .DS_Store 39 | 40 | /.idea -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FoliaLib 2 | 3 | > 同时适配Folia和bukkit核心 4 | 5 | ## 使用方法(本jar已经发布到maven中央仓库) 6 | 7 | [![Maven Central](https://img.shields.io/maven-central/v/cn.handyplus.lib.adapter/FoliaLib.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22cn.handyplus.lib.adapter%22%20AND%20a:%22FoliaLib%22) 8 | 9 | 首先: Folia要求 在plugin.yml 中添加配置 `folia-supported: true` 10 | 11 | 1. maven引入 12 | ```xml 13 | 14 | cn.handyplus.lib.adapter 15 | FoliaLib 16 | 最新版本 17 | 18 | ``` 19 | 20 | 2. maven shade 21 | 22 | ```xml 23 | 24 | 25 | org.apache.maven.plugins 26 | maven-shade-plugin 27 | 3.5.3 28 | 29 | false 30 | 31 | 32 | cn.handyplus.lib.adapter:*:*:* 33 | 34 | 35 | 36 | 37 | cn.handyplus.lib.adapter 38 | 您的自定义包 39 | 40 | 41 | 42 | 43 | 44 | package 45 | 46 | shade 47 | 48 | 49 | 50 | 51 | ``` 52 | 53 | 3. 初始化; 54 | ```java 55 | public class MyPlugin extends JavaPlugin { 56 | @Override 57 | public void onEnable() { 58 | // 初始化 59 | HandySchedulerUtil.init(this); 60 | } 61 | } 62 | ``` 63 | 64 | ## 使用示例 65 | 66 | ```java 67 | // 同步方法 68 | public void test1(Player player) { 69 | HandySchedulerUtil.runTask(() -> { 70 | // 执行方法 71 | }); 72 | } 73 | 74 | // 异步方法 75 | public void test2() { 76 | HandySchedulerUtil.runTaskAsynchronously(() -> { 77 | // 执行方法 78 | }); 79 | } 80 | 81 | // 定时方法 82 | public void test3() { 83 | HandyRunnable handyRunnable = new HandyRunnable() { 84 | @Override 85 | public void run() { 86 | try { 87 | // 执行逻辑 88 | } catch (Exception ignored) { 89 | this.cancel(); 90 | } 91 | } 92 | }; 93 | HandySchedulerUtil.runTaskTimerAsynchronously(handyRunnable, 20 * 2, 20 * 60); 94 | } 95 | 96 | // TP方法 97 | public void test4(Player player, Location location) { 98 | PlayerSchedulerUtil.teleport(player, location); 99 | } 100 | 101 | // 执行命令 102 | public void test5(Player player, String command) { 103 | // 执行命令 104 | PlayerSchedulerUtil.performCommand(player, command); 105 | // 执行命令 指定同步 106 | PlayerSchedulerUtil.syncPerformCommand(player, command); 107 | // op身份执行命令 108 | PlayerSchedulerUtil.performOpCommand(player, command); 109 | // op身份执行命令 指定同步 110 | PlayerSchedulerUtil.syncPerformOpCommand(player, command); 111 | } 112 | 113 | // 打开gui 114 | public void test6(Player player, Inventory inv) { 115 | PlayerSchedulerUtil.syncOpenInventory(player, inv); 116 | } 117 | 118 | // 关闭gui 119 | public void test7(Player player, Inventory inv) { 120 | PlayerSchedulerUtil.syncOpenInventory(player, inv); 121 | } 122 | ``` 123 | 124 | ## javadoc 125 | 126 | [点击查看](https://handyplus.github.io/FoliaLib/) 127 | 128 | ## 建议 129 | 130 | 可以在[issues](https://github.com/handyplus/FoliaLib/issues)提出 131 | 132 | ## 贡献者 133 | 134 | [![Contrib](https://contrib.rocks/image?repo=handyplus/FoliaLib)](https://github.com/handyplus/FoliaLib/graphs/contributors) 135 | 136 | ## Star History 137 | 138 | [![Star History Chart](https://api.star-history.com/svg?repos=handyplus/FoliaLib&type=Date)](https://star-history.com/#handyplus/FoliaLib&Date) 139 | -------------------------------------------------------------------------------- /docs/allclasses-index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 所有类和接口 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 47 |
48 |
49 |
50 |

所有类和接口

51 |
52 |
53 |
54 |
55 |
56 |
57 |
说明
58 | 59 |
60 |
Bukkit内部调度器
61 |
62 | 63 |
64 |
Folia内部调度器
65 |
66 | 67 |
68 |
抽象Runnable
69 |
70 | 71 |
72 |
HandyLib调度器
73 |
74 | 75 |
76 |
测试方法
77 |
78 | 79 |
80 |
玩家相关调度器
81 |
82 | 83 |
84 |
服务器类型
85 |
86 | 87 |
88 |
世界调度工具
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 | 97 | 98 | -------------------------------------------------------------------------------- /docs/allpackages-index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 所有程序包 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 47 |
48 |
49 |
50 |

所有程序包

51 |
52 |
程序包概要
53 |
54 |
程序包
55 |
说明
56 | 57 |
 
58 |
59 |
60 |
61 |
62 | 63 | 64 | -------------------------------------------------------------------------------- /docs/cn/handyplus/lib/adapter/BukkitScheduler.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BukkitScheduler 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 80 |
81 |
82 | 83 |
84 | 85 |

类 BukkitScheduler

86 |
87 |
java.lang.Object 88 |
cn.handyplus.lib.adapter.BukkitScheduler
89 |
90 |
91 |
92 |
public class BukkitScheduler 93 | extends Object
94 |
Bukkit内部调度器
95 |
96 |
从以下版本开始:
97 |
1.0.0
98 |
99 |
100 |
101 | 112 |
113 | 114 |
115 |
116 |
117 | 118 | 119 | -------------------------------------------------------------------------------- /docs/cn/handyplus/lib/adapter/FoliaScheduler.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | FoliaScheduler 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 80 |
81 |
82 | 83 |
84 | 85 |

类 FoliaScheduler

86 |
87 |
java.lang.Object 88 |
cn.handyplus.lib.adapter.FoliaScheduler
89 |
90 |
91 |
92 |
public class FoliaScheduler 93 | extends Object
94 |
Folia内部调度器
95 |
96 |
从以下版本开始:
97 |
1.0.0
98 |
99 |
100 |
101 | 112 |
113 | 114 |
115 |
116 |
117 | 118 | 119 | -------------------------------------------------------------------------------- /docs/cn/handyplus/lib/adapter/WorldSchedulerUtil.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | WorldSchedulerUtil 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 80 |
81 |
82 | 83 |
84 | 85 |

类 WorldSchedulerUtil

86 |
87 |
java.lang.Object 88 |
cn.handyplus.lib.adapter.WorldSchedulerUtil
89 |
90 |
91 |
92 |
public class WorldSchedulerUtil 93 | extends Object
94 |
世界调度工具
95 |
96 |
从以下版本开始:
97 |
1.1.3
98 |
99 |
100 |
101 |
    102 | 103 |
  • 104 |
    105 |

    方法概要

    106 |
    107 |
    108 |
    109 |
    110 |
    修饰符和类型
    111 |
    方法
    112 |
    说明
    113 |
    static void
    114 |
    getChunkAtAsync(org.bukkit.Location location)
    115 |
    116 |
    异步加载对应坐标的区块
    117 |
    118 |
    119 |
    120 |
    121 |
    122 |

    从类继承的方法 java.lang.Object

    123 | equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    124 |
    125 |
  • 126 |
127 |
128 |
129 |
    130 | 131 |
  • 132 |
    133 |

    方法详细资料

    134 |
      135 |
    • 136 |
      137 |

      getChunkAtAsync

      138 |
      public static void getChunkAtAsync(org.bukkit.Location location)
      139 |
      异步加载对应坐标的区块
      140 |
      141 |
      参数:
      142 |
      location - 坐标
      143 |
      从以下版本开始:
      144 |
      1.1.3
      145 |
      146 |
      147 |
    • 148 |
    149 |
    150 |
  • 151 |
152 |
153 | 154 |
155 |
156 |
157 | 158 | 159 | -------------------------------------------------------------------------------- /docs/cn/handyplus/lib/adapter/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | cn.handyplus.lib.adapter 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 64 |
65 |
66 |
67 |

程序包 cn.handyplus.lib.adapter

68 |
69 |
70 |
package cn.handyplus.lib.adapter
71 |
72 | 117 |
118 |
119 |
120 |
121 | 122 | 123 | -------------------------------------------------------------------------------- /docs/cn/handyplus/lib/adapter/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | cn.handyplus.lib.adapter 类分层结构 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 47 |
48 |
49 |
50 |

程序包cn.handyplus.lib.adapter的分层结构

51 |
52 |
53 |

类分层结构

54 | 67 |
68 |
69 |

枚举类分层结构

70 | 81 |
82 |
83 |
84 |
85 | 86 | 87 | -------------------------------------------------------------------------------- /docs/copy.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 27 | 28 | 29 | 31 | 33 | 34 | -------------------------------------------------------------------------------- /docs/element-list: -------------------------------------------------------------------------------- 1 | cn.handyplus.lib.adapter 2 | -------------------------------------------------------------------------------- /docs/help-doc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | API 帮助 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 62 |
63 |
64 |

JavaDoc 帮助

65 | 83 |
84 |
85 |

导航

86 | 从 概览 页开始,您可以使用每页中的链接以及每页顶部导航栏中的链接来浏览文档。 使用 索引 和搜索框可以导航到特定声明和概要页,包括:所有程序包, 所有类和接口 87 | 97 |
98 |
99 |
100 |

页面类型

101 | 以下各部分介绍了此集合中不同类型的页面。 102 |
103 |

程序包

104 |

每个程序包都有一页,其中包含它的类和接口的列表及其概要。这些页可以包含以下类别:

105 |
    106 |
  • 接口
  • 107 |
  • 108 |
  • 枚举类
  • 109 |
  • 异常错误类
  • 110 |
  • 批注接口
  • 111 |
112 |
113 |
114 |

类或接口

115 |

每个类、接口、嵌套类和嵌套接口都有自己独立的页面。如果这些部分中每个部分的条目为空或不适用,则省略这些条目。

116 |
    117 |
  • 类继承图
  • 118 |
  • 直接子类
  • 119 |
  • 所有已知子接口
  • 120 |
  • 所有已知实现类
  • 121 |
  • 类或接口声明
  • 122 |
  • 类或接口说明
  • 123 |
124 |
125 |
    126 |
  • 嵌套类概要
  • 127 |
  • 枚举常量概要
  • 128 |
  • 字段概要
  • 129 |
  • 属性概要
  • 130 |
  • 构造器概要
  • 131 |
  • 方法概要
  • 132 |
  • 必需元素概要
  • 133 |
  • 可选元素概要
  • 134 |
135 |
136 |
    137 |
  • 枚举常量详细资料
  • 138 |
  • 字段详细资料
  • 139 |
  • 属性详细资料
  • 140 |
  • 构造器详细资料
  • 141 |
  • 方法详细资料
  • 142 |
  • 元素详细资料
  • 143 |
144 |

注: 批注接口有必需的元素和可选的元素,但没有方法。 只有枚举类有枚举常量。 记录类的组件显示为记录类声明的一部分。 属性是 JavaFX 的一个特性。

145 |

概要条目按字母顺序排列,而详细说明则按其在源代码中出现的顺序排列。这有助于保持程序员所建立的逻辑分组。

146 |
147 |
148 |

其他文件

149 |

程序包和模块所包含的页面中可能带有与附近声明相关的附加信息。

150 |
151 |
152 |

树 (类分层结构)

153 |

对于所有程序包,都有一个 类分层结构 页,以及每个程序包的分层结构。每个分层结构页都包含类的列表和接口的列表。从 java.lang.Object 开始,按继承结构对类进行排列。接口不从 java.lang.Object 继承。

154 |
    155 |
  • 查看“概览”页面时,单击“树”将显示所有程序包的分层结构。
  • 156 |
  • 查看特定程序包、类或接口页时,单击“树”将仅显示该程序包的分层结构。
  • 157 |
158 |
159 |
160 |

所有程序包

161 |

所有程序包 包含文档中所有程序包的按字母顺序排列的索引。

162 |
163 |
164 |

所有类和接口

165 |

所有类和接口 包含文档中所有类和接口(包括批注接口、枚举类和记录类)的按字母顺序排列的索引。

166 |
167 |
168 |

索引

169 |

索引 包含文档中所有类、接口、构造器、方法和字段的按字母顺序排列的索引,以及概要页(例如 所有程序包, 所有类和接口)。

170 |
171 |
172 |
173 | 此帮助文件适用于由标准 doclet 生成的 API 文档。
174 |
175 |
176 | 177 | 178 | -------------------------------------------------------------------------------- /docs/index-files/index-1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | A - 索引 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 47 |
48 |
49 |
50 |

索引

51 |
52 | A B C D F G H I O P R S T V W 
所有程序包|所有类和接口 53 |

A

54 |
55 |
addPotionEffects(LivingEntity, List<PotionEffect>) - 类中的静态方法 cn.handyplus.lib.adapter.PlayerSchedulerUtil
56 |
57 |
实体添加药水效果 同步
58 |
59 |
addPotionEffects(LivingEntity, PotionEffect) - 类中的静态方法 cn.handyplus.lib.adapter.PlayerSchedulerUtil
60 |
61 |
实体添加药水效果 同步
62 |
63 |
64 | A B C D F G H I O P R S T V W 
所有程序包|所有类和接口
65 |
66 |
67 | 68 | 69 | -------------------------------------------------------------------------------- /docs/index-files/index-10.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | P - 索引 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 47 |
48 |
49 |
50 |

索引

51 |
52 | A B C D F G H I O P R S T V W 
所有程序包|所有类和接口 53 |

P

54 |
55 |
performCommand(Player, String) - 类中的静态方法 cn.handyplus.lib.adapter.PlayerSchedulerUtil
56 |
57 |
玩家执行命令 chat方式
58 |
59 |
performOpCommand(Player, String) - 类中的静态方法 cn.handyplus.lib.adapter.PlayerSchedulerUtil
60 |
61 |
玩家已OP身份执行命令 chat方式
62 |
63 |
playerPerformCommand(Player, String) - 类中的静态方法 cn.handyplus.lib.adapter.PlayerSchedulerUtil
64 |
65 |
玩家执行命令 performCommand 方式
66 |
67 |
playerPerformOpCommand(Player, String) - 类中的静态方法 cn.handyplus.lib.adapter.PlayerSchedulerUtil
68 |
69 |
玩家已OP身份执行命令 performCommand 方式
70 |
71 |
PlayerSchedulerUtil - cn.handyplus.lib.adapter中的类
72 |
73 |
玩家相关调度器
74 |
75 |
playSound(Player, String, float, float) - 类中的静态方法 cn.handyplus.lib.adapter.PlayerSchedulerUtil
76 |
77 |
播放声音 同步
78 |
79 |
playSound(Player, Sound, float, float) - 类中的静态方法 cn.handyplus.lib.adapter.PlayerSchedulerUtil
80 |
81 |
播放声音 同步
82 |
83 |
84 | A B C D F G H I O P R S T V W 
所有程序包|所有类和接口
85 |
86 |
87 | 88 | 89 | -------------------------------------------------------------------------------- /docs/index-files/index-11.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | R - 索引 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 47 |
48 |
49 |
50 |

索引

51 |
52 | A B C D F G H I O P R S T V W 
所有程序包|所有类和接口 53 |

R

54 |
55 |
removePotionEffect(LivingEntity, PotionEffectType) - 类中的静态方法 cn.handyplus.lib.adapter.PlayerSchedulerUtil
56 |
57 |
实体添加药水效果 同步
58 |
59 |
runTask(Runnable) - 类中的静态方法 cn.handyplus.lib.adapter.HandySchedulerUtil
60 |
61 |
同步
62 |
63 |
runTaskAsynchronously(Runnable) - 类中的静态方法 cn.handyplus.lib.adapter.HandySchedulerUtil
64 |
65 |
异步
66 |
67 |
runTaskLater(HandyRunnable, long) - 类中的静态方法 cn.handyplus.lib.adapter.HandySchedulerUtil
68 |
69 |
延迟同步 可取消
70 |
71 |
runTaskLater(Runnable, long) - 类中的静态方法 cn.handyplus.lib.adapter.HandySchedulerUtil
72 |
73 |
延迟同步
74 |
75 |
runTaskLaterAsynchronously(HandyRunnable, long) - 类中的静态方法 cn.handyplus.lib.adapter.HandySchedulerUtil
76 |
77 |
延迟异步 可取消
78 |
79 |
runTaskLaterAsynchronously(Runnable, long) - 类中的静态方法 cn.handyplus.lib.adapter.HandySchedulerUtil
80 |
81 |
延迟异步
82 |
83 |
runTaskTimer(HandyRunnable, long, long) - 类中的静态方法 cn.handyplus.lib.adapter.HandySchedulerUtil
84 |
85 |
循环同步 可取消
86 |
87 |
runTaskTimer(Runnable, long, long) - 类中的静态方法 cn.handyplus.lib.adapter.HandySchedulerUtil
88 |
89 |
循环同步
90 |
91 |
runTaskTimerAsynchronously(HandyRunnable, long, long) - 类中的静态方法 cn.handyplus.lib.adapter.HandySchedulerUtil
92 |
93 |
循环异步 可取消
94 |
95 |
runTaskTimerAsynchronously(Runnable, long, long) - 类中的静态方法 cn.handyplus.lib.adapter.HandySchedulerUtil
96 |
97 |
循环异步
98 |
99 |
100 | A B C D F G H I O P R S T V W 
所有程序包|所有类和接口
101 |
102 |
103 | 104 | 105 | -------------------------------------------------------------------------------- /docs/index-files/index-12.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | S - 索引 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 47 |
48 |
49 |
50 |

索引

51 |
52 | A B C D F G H I O P R S T V W 
所有程序包|所有类和接口 53 |

S

54 |
55 |
ServerTypeEnum - cn.handyplus.lib.adapter中的枚举类
56 |
57 |
服务器类型
58 |
59 |
setupTask(ScheduledTask) - 类中的方法 cn.handyplus.lib.adapter.HandyRunnable
60 |
61 |
设置任务
62 |
63 |
setupTask(BukkitTask) - 类中的方法 cn.handyplus.lib.adapter.HandyRunnable
64 |
65 |
设置任务
66 |
67 |
syncCloseInventory(Player) - 类中的静态方法 cn.handyplus.lib.adapter.PlayerSchedulerUtil
68 |
69 |
玩家关闭gui 使用同步
70 |
71 |
syncDispatchCommand(String) - 类中的静态方法 cn.handyplus.lib.adapter.PlayerSchedulerUtil
72 |
73 |
控制台执行命令 同步
74 |
75 |
syncOpenInventory(Player, Inventory) - 类中的静态方法 cn.handyplus.lib.adapter.PlayerSchedulerUtil
76 |
77 |
玩家打开gui 使用同步
78 |
79 |
syncPerformCommand(Player, String) - 类中的静态方法 cn.handyplus.lib.adapter.PlayerSchedulerUtil
80 |
81 |
玩家执行命令 chat方式 同步
82 |
83 |
syncPerformOpCommand(Player, String) - 类中的静态方法 cn.handyplus.lib.adapter.PlayerSchedulerUtil
84 |
85 |
玩家已OP身份执行命令 chat方式 同步
86 |
87 |
syncPerformReplaceCommand(Player, String) - 类中的静态方法 cn.handyplus.lib.adapter.PlayerSchedulerUtil
88 |
89 |
玩家执行替换命令 同步
90 |
91 |
syncPlayerPerformCommand(Player, String) - 类中的静态方法 cn.handyplus.lib.adapter.PlayerSchedulerUtil
92 |
93 |
玩家执行命令 performCommand 方式 同步
94 |
95 |
syncPlayerPerformOpCommand(Player, String) - 类中的静态方法 cn.handyplus.lib.adapter.PlayerSchedulerUtil
96 |
97 |
玩家已OP身份执行命令 performCommand 方式 同步
98 |
99 |
syncTeleport(Entity, Location) - 类中的静态方法 cn.handyplus.lib.adapter.PlayerSchedulerUtil
100 |
101 |
传送实体 同步
102 |
103 |
syncTeleport(Entity, Location, PlayerTeleportEvent.TeleportCause) - 类中的静态方法 cn.handyplus.lib.adapter.PlayerSchedulerUtil
104 |
105 |
传送实体 同步
106 |
107 |
108 | A B C D F G H I O P R S T V W 
所有程序包|所有类和接口
109 |
110 |
111 | 112 | 113 | -------------------------------------------------------------------------------- /docs/index-files/index-13.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | T - 索引 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 47 |
48 |
49 |
50 |

索引

51 |
52 | A B C D F G H I O P R S T V W 
所有程序包|所有类和接口 53 |

T

54 |
55 |
teleport(Entity, Location) - 类中的静态方法 cn.handyplus.lib.adapter.PlayerSchedulerUtil
56 |
57 |
传送实体
58 |
59 |
teleport(Entity, Location, PlayerTeleportEvent.TeleportCause) - 类中的静态方法 cn.handyplus.lib.adapter.PlayerSchedulerUtil
60 |
61 |
传送实体
62 |
63 |
test1(Player) - 类中的方法 cn.handyplus.lib.adapter.HandySchedulerUtilTest
64 |
 
65 |
test2() - 类中的方法 cn.handyplus.lib.adapter.HandySchedulerUtilTest
66 |
 
67 |
test3() - 类中的方法 cn.handyplus.lib.adapter.HandySchedulerUtilTest
68 |
 
69 |
test4(Player, Location) - 类中的方法 cn.handyplus.lib.adapter.HandySchedulerUtilTest
70 |
 
71 |
test5(Player, String) - 类中的方法 cn.handyplus.lib.adapter.HandySchedulerUtilTest
72 |
 
73 |
test6(Player, Inventory) - 类中的方法 cn.handyplus.lib.adapter.HandySchedulerUtilTest
74 |
 
75 |
test7(Player, Inventory) - 类中的方法 cn.handyplus.lib.adapter.HandySchedulerUtilTest
76 |
 
77 |
78 | A B C D F G H I O P R S T V W 
所有程序包|所有类和接口
79 |
80 |
81 | 82 | 83 | -------------------------------------------------------------------------------- /docs/index-files/index-14.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | V - 索引 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 47 |
48 |
49 |
50 |

索引

51 |
52 | A B C D F G H I O P R S T V W 
所有程序包|所有类和接口 53 |

V

54 |
55 |
valueOf(String) - 枚举类中的静态方法 cn.handyplus.lib.adapter.ServerTypeEnum
56 |
57 |
返回带有指定名称的该类的枚举常量。
58 |
59 |
values() - 枚举类中的静态方法 cn.handyplus.lib.adapter.ServerTypeEnum
60 |
61 |
返回包含该枚举类的常量的数组, 62 | 顺序与声明这些常量的顺序相同
63 |
64 |
65 | A B C D F G H I O P R S T V W 
所有程序包|所有类和接口
66 |
67 |
68 | 69 | 70 | -------------------------------------------------------------------------------- /docs/index-files/index-15.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | W - 索引 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 47 |
48 |
49 |
50 |

索引

51 |
52 | A B C D F G H I O P R S T V W 
所有程序包|所有类和接口 53 |

W

54 |
55 |
WorldSchedulerUtil - cn.handyplus.lib.adapter中的类
56 |
57 |
世界调度工具
58 |
59 |
60 | A B C D F G H I O P R S T V W 
所有程序包|所有类和接口
61 |
62 |
63 | 64 | 65 | -------------------------------------------------------------------------------- /docs/index-files/index-2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | B - 索引 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 47 |
48 |
49 |
50 |

索引

51 |
52 | A B C D F G H I O P R S T V W 
所有程序包|所有类和接口 53 |

B

54 |
55 |
BUKKIT - 枚举类 中的枚举常量 cn.handyplus.lib.adapter.ServerTypeEnum
56 |
57 |
bukkit
58 |
59 |
BukkitScheduler - cn.handyplus.lib.adapter中的类
60 |
61 |
Bukkit内部调度器
62 |
63 |
64 | A B C D F G H I O P R S T V W 
所有程序包|所有类和接口
65 |
66 |
67 | 68 | 69 | -------------------------------------------------------------------------------- /docs/index-files/index-3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | C - 索引 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 47 |
48 |
49 |
50 |

索引

51 |
52 | A B C D F G H I O P R S T V W 
所有程序包|所有类和接口 53 |

C

54 |
55 |
cancel() - 类中的方法 cn.handyplus.lib.adapter.HandyRunnable
56 |
57 |
取消
58 |
59 |
cancelTask() - 类中的静态方法 cn.handyplus.lib.adapter.HandySchedulerUtil
60 |
61 |
取消所有调度任务
62 |
63 |
closeInventory(Player) - 类中的静态方法 cn.handyplus.lib.adapter.PlayerSchedulerUtil
64 |
65 |
玩家关闭gui
66 |
67 |
cn.handyplus.lib.adapter - 程序包 cn.handyplus.lib.adapter
68 |
 
69 |
70 | A B C D F G H I O P R S T V W 
所有程序包|所有类和接口
71 |
72 |
73 | 74 | 75 | -------------------------------------------------------------------------------- /docs/index-files/index-4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | D - 索引 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 47 |
48 |
49 |
50 |

索引

51 |
52 | A B C D F G H I O P R S T V W 
所有程序包|所有类和接口 53 |

D

54 |
55 |
dispatchCommand(String) - 类中的静态方法 cn.handyplus.lib.adapter.PlayerSchedulerUtil
56 |
57 |
控制台执行命令
58 |
59 |
dropItem(Player, List<ItemStack>) - 类中的静态方法 cn.handyplus.lib.adapter.PlayerSchedulerUtil
60 |
61 |
掉落物品处理
62 |
63 |
64 | A B C D F G H I O P R S T V W 
所有程序包|所有类和接口
65 |
66 |
67 | 68 | 69 | -------------------------------------------------------------------------------- /docs/index-files/index-5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | F - 索引 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 47 |
48 |
49 |
50 |

索引

51 |
52 | A B C D F G H I O P R S T V W 
所有程序包|所有类和接口 53 |

F

54 |
55 |
FOLIA - 枚举类 中的枚举常量 cn.handyplus.lib.adapter.ServerTypeEnum
56 |
57 |
folia
58 |
59 |
FoliaScheduler - cn.handyplus.lib.adapter中的类
60 |
61 |
Folia内部调度器
62 |
63 |
64 | A B C D F G H I O P R S T V W 
所有程序包|所有类和接口
65 |
66 |
67 | 68 | 69 | -------------------------------------------------------------------------------- /docs/index-files/index-6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | G - 索引 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 47 |
48 |
49 |
50 |

索引

51 |
52 | A B C D F G H I O P R S T V W 
所有程序包|所有类和接口 53 |

G

54 |
55 |
getChunkAtAsync(Location) - 类中的静态方法 cn.handyplus.lib.adapter.WorldSchedulerUtil
56 |
57 |
异步加载对应坐标的区块
58 |
59 |
60 | A B C D F G H I O P R S T V W 
所有程序包|所有类和接口
61 |
62 |
63 | 64 | 65 | -------------------------------------------------------------------------------- /docs/index-files/index-7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | H - 索引 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 47 |
48 |
49 |
50 |

索引

51 |
52 | A B C D F G H I O P R S T V W 
所有程序包|所有类和接口 53 |

H

54 |
55 |
HandyRunnable - cn.handyplus.lib.adapter中的类
56 |
57 |
抽象Runnable
58 |
59 |
HandyRunnable() - 类的构造器 cn.handyplus.lib.adapter.HandyRunnable
60 |
61 |
构造
62 |
63 |
HandySchedulerUtil - cn.handyplus.lib.adapter中的类
64 |
65 |
HandyLib调度器
66 |
67 |
HandySchedulerUtilTest - cn.handyplus.lib.adapter中的类
68 |
69 |
测试方法
70 |
71 |
HandySchedulerUtilTest() - 类的构造器 cn.handyplus.lib.adapter.HandySchedulerUtilTest
72 |
 
73 |
74 | A B C D F G H I O P R S T V W 
所有程序包|所有类和接口
75 |
76 |
77 | 78 | 79 | -------------------------------------------------------------------------------- /docs/index-files/index-8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | I - 索引 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 47 |
48 |
49 |
50 |

索引

51 |
52 | A B C D F G H I O P R S T V W 
所有程序包|所有类和接口 53 |

I

54 |
55 |
init(Plugin) - 类中的静态方法 cn.handyplus.lib.adapter.HandySchedulerUtil
56 |
57 |
初始化方法
58 |
59 |
isFolia() - 类中的静态方法 cn.handyplus.lib.adapter.HandySchedulerUtil
60 |
61 |
是否Folia
62 |
63 |
64 | A B C D F G H I O P R S T V W 
所有程序包|所有类和接口
65 |
66 |
67 | 68 | 69 | -------------------------------------------------------------------------------- /docs/index-files/index-9.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | O - 索引 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 47 |
48 |
49 |
50 |

索引

51 |
52 | A B C D F G H I O P R S T V W 
所有程序包|所有类和接口 53 |

O

54 |
55 |
openInventory(Player, Inventory) - 类中的静态方法 cn.handyplus.lib.adapter.PlayerSchedulerUtil
56 |
57 |
玩家打开gui
58 |
59 |
60 | A B C D F G H I O P R S T V W 
所有程序包|所有类和接口
61 |
62 |
63 | 64 | 65 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 生成的文档 (无标题) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 |
20 | 23 |

cn/handyplus/lib/adapter/package-summary.html

24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/legal/COPYRIGHT: -------------------------------------------------------------------------------- 1 | Please see ..\java.base\COPYRIGHT 2 | -------------------------------------------------------------------------------- /docs/legal/LICENSE: -------------------------------------------------------------------------------- 1 | Please see ..\java.base\LICENSE 2 | -------------------------------------------------------------------------------- /docs/legal/jquery.md: -------------------------------------------------------------------------------- 1 | ## jQuery v3.6.1 2 | 3 | ### jQuery License 4 | ``` 5 | jQuery v 3.6.1 6 | Copyright OpenJS Foundation and other contributors, https://openjsf.org/ 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining 9 | a copy of this software and associated documentation files (the 10 | "Software"), to deal in the Software without restriction, including 11 | without limitation the rights to use, copy, modify, merge, publish, 12 | distribute, sublicense, and/or sell copies of the Software, and to 13 | permit persons to whom the Software is furnished to do so, subject to 14 | the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be 17 | included in all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 23 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 24 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 25 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | 27 | ****************************************** 28 | 29 | The jQuery JavaScript Library v3.6.1 also includes Sizzle.js 30 | 31 | Sizzle.js includes the following license: 32 | 33 | Copyright JS Foundation and other contributors, https://js.foundation/ 34 | 35 | This software consists of voluntary contributions made by many 36 | individuals. For exact contribution history, see the revision history 37 | available at https://github.com/jquery/sizzle 38 | 39 | The following license applies to all parts of this software except as 40 | documented below: 41 | 42 | ==== 43 | 44 | Permission is hereby granted, free of charge, to any person obtaining 45 | a copy of this software and associated documentation files (the 46 | "Software"), to deal in the Software without restriction, including 47 | without limitation the rights to use, copy, modify, merge, publish, 48 | distribute, sublicense, and/or sell copies of the Software, and to 49 | permit persons to whom the Software is furnished to do so, subject to 50 | the following conditions: 51 | 52 | The above copyright notice and this permission notice shall be 53 | included in all copies or substantial portions of the Software. 54 | 55 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 56 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 57 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 58 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 59 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 60 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 61 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 62 | 63 | ==== 64 | 65 | All files located in the node_modules and external directories are 66 | externally maintained libraries used by this software which have their 67 | own licenses; we recommend you read them, as their terms may differ from 68 | the terms above. 69 | 70 | ********************* 71 | 72 | ``` 73 | -------------------------------------------------------------------------------- /docs/legal/jqueryUI.md: -------------------------------------------------------------------------------- 1 | ## jQuery UI v1.13.2 2 | 3 | ### jQuery UI License 4 | ``` 5 | Copyright jQuery Foundation and other contributors, https://jquery.org/ 6 | 7 | This software consists of voluntary contributions made by many 8 | individuals. For exact contribution history, see the revision history 9 | available at https://github.com/jquery/jquery-ui 10 | 11 | The following license applies to all parts of this software except as 12 | documented below: 13 | 14 | ==== 15 | 16 | Permission is hereby granted, free of charge, to any person obtaining 17 | a copy of this software and associated documentation files (the 18 | "Software"), to deal in the Software without restriction, including 19 | without limitation the rights to use, copy, modify, merge, publish, 20 | distribute, sublicense, and/or sell copies of the Software, and to 21 | permit persons to whom the Software is furnished to do so, subject to 22 | the following conditions: 23 | 24 | The above copyright notice and this permission notice shall be 25 | included in all copies or substantial portions of the Software. 26 | 27 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 28 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 29 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 30 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 31 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 32 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 33 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 34 | 35 | ==== 36 | 37 | Copyright and related rights for sample code are waived via CC0. Sample 38 | code is defined as all source code contained within the demos directory. 39 | 40 | CC0: http://creativecommons.org/publicdomain/zero/1.0/ 41 | 42 | ==== 43 | 44 | All files located in the node_modules and external directories are 45 | externally maintained libraries used by this software which have their 46 | own licenses; we recommend you read them, as their terms may differ from 47 | the terms above. 48 | 49 | ``` 50 | -------------------------------------------------------------------------------- /docs/link.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /docs/member-search-index.js: -------------------------------------------------------------------------------- 1 | memberSearchIndex = [{"p":"cn.handyplus.lib.adapter","c":"PlayerSchedulerUtil","l":"addPotionEffects(LivingEntity, List)","u":"addPotionEffects(org.bukkit.entity.LivingEntity,java.util.List)"},{"p":"cn.handyplus.lib.adapter","c":"PlayerSchedulerUtil","l":"addPotionEffects(LivingEntity, PotionEffect)","u":"addPotionEffects(org.bukkit.entity.LivingEntity,org.bukkit.potion.PotionEffect)"},{"p":"cn.handyplus.lib.adapter","c":"ServerTypeEnum","l":"BUKKIT"},{"p":"cn.handyplus.lib.adapter","c":"HandyRunnable","l":"cancel()"},{"p":"cn.handyplus.lib.adapter","c":"HandySchedulerUtil","l":"cancelTask()"},{"p":"cn.handyplus.lib.adapter","c":"PlayerSchedulerUtil","l":"closeInventory(Player)","u":"closeInventory(org.bukkit.entity.Player)"},{"p":"cn.handyplus.lib.adapter","c":"PlayerSchedulerUtil","l":"dispatchCommand(String)","u":"dispatchCommand(java.lang.String)"},{"p":"cn.handyplus.lib.adapter","c":"PlayerSchedulerUtil","l":"dropItem(Player, List)","u":"dropItem(org.bukkit.entity.Player,java.util.List)"},{"p":"cn.handyplus.lib.adapter","c":"ServerTypeEnum","l":"FOLIA"},{"p":"cn.handyplus.lib.adapter","c":"WorldSchedulerUtil","l":"getChunkAtAsync(Location)","u":"getChunkAtAsync(org.bukkit.Location)"},{"p":"cn.handyplus.lib.adapter","c":"HandyRunnable","l":"HandyRunnable()","u":"%3Cinit%3E()"},{"p":"cn.handyplus.lib.adapter","c":"HandySchedulerUtilTest","l":"HandySchedulerUtilTest()","u":"%3Cinit%3E()"},{"p":"cn.handyplus.lib.adapter","c":"HandySchedulerUtil","l":"init(Plugin)","u":"init(org.bukkit.plugin.Plugin)"},{"p":"cn.handyplus.lib.adapter","c":"HandySchedulerUtil","l":"isFolia()"},{"p":"cn.handyplus.lib.adapter","c":"PlayerSchedulerUtil","l":"openInventory(Player, Inventory)","u":"openInventory(org.bukkit.entity.Player,org.bukkit.inventory.Inventory)"},{"p":"cn.handyplus.lib.adapter","c":"PlayerSchedulerUtil","l":"performCommand(Player, String)","u":"performCommand(org.bukkit.entity.Player,java.lang.String)"},{"p":"cn.handyplus.lib.adapter","c":"PlayerSchedulerUtil","l":"performOpCommand(Player, String)","u":"performOpCommand(org.bukkit.entity.Player,java.lang.String)"},{"p":"cn.handyplus.lib.adapter","c":"PlayerSchedulerUtil","l":"playerPerformCommand(Player, String)","u":"playerPerformCommand(org.bukkit.entity.Player,java.lang.String)"},{"p":"cn.handyplus.lib.adapter","c":"PlayerSchedulerUtil","l":"playerPerformOpCommand(Player, String)","u":"playerPerformOpCommand(org.bukkit.entity.Player,java.lang.String)"},{"p":"cn.handyplus.lib.adapter","c":"PlayerSchedulerUtil","l":"playSound(Player, Sound, float, float)","u":"playSound(org.bukkit.entity.Player,org.bukkit.Sound,float,float)"},{"p":"cn.handyplus.lib.adapter","c":"PlayerSchedulerUtil","l":"playSound(Player, String, float, float)","u":"playSound(org.bukkit.entity.Player,java.lang.String,float,float)"},{"p":"cn.handyplus.lib.adapter","c":"PlayerSchedulerUtil","l":"removePotionEffect(LivingEntity, PotionEffectType)","u":"removePotionEffect(org.bukkit.entity.LivingEntity,org.bukkit.potion.PotionEffectType)"},{"p":"cn.handyplus.lib.adapter","c":"HandySchedulerUtil","l":"runTask(Runnable)","u":"runTask(java.lang.Runnable)"},{"p":"cn.handyplus.lib.adapter","c":"HandySchedulerUtil","l":"runTaskAsynchronously(Runnable)","u":"runTaskAsynchronously(java.lang.Runnable)"},{"p":"cn.handyplus.lib.adapter","c":"HandySchedulerUtil","l":"runTaskLater(HandyRunnable, long)","u":"runTaskLater(cn.handyplus.lib.adapter.HandyRunnable,long)"},{"p":"cn.handyplus.lib.adapter","c":"HandySchedulerUtil","l":"runTaskLater(Runnable, long)","u":"runTaskLater(java.lang.Runnable,long)"},{"p":"cn.handyplus.lib.adapter","c":"HandySchedulerUtil","l":"runTaskLaterAsynchronously(HandyRunnable, long)","u":"runTaskLaterAsynchronously(cn.handyplus.lib.adapter.HandyRunnable,long)"},{"p":"cn.handyplus.lib.adapter","c":"HandySchedulerUtil","l":"runTaskLaterAsynchronously(Runnable, long)","u":"runTaskLaterAsynchronously(java.lang.Runnable,long)"},{"p":"cn.handyplus.lib.adapter","c":"HandySchedulerUtil","l":"runTaskTimer(HandyRunnable, long, long)","u":"runTaskTimer(cn.handyplus.lib.adapter.HandyRunnable,long,long)"},{"p":"cn.handyplus.lib.adapter","c":"HandySchedulerUtil","l":"runTaskTimer(Runnable, long, long)","u":"runTaskTimer(java.lang.Runnable,long,long)"},{"p":"cn.handyplus.lib.adapter","c":"HandySchedulerUtil","l":"runTaskTimerAsynchronously(HandyRunnable, long, long)","u":"runTaskTimerAsynchronously(cn.handyplus.lib.adapter.HandyRunnable,long,long)"},{"p":"cn.handyplus.lib.adapter","c":"HandySchedulerUtil","l":"runTaskTimerAsynchronously(Runnable, long, long)","u":"runTaskTimerAsynchronously(java.lang.Runnable,long,long)"},{"p":"cn.handyplus.lib.adapter","c":"HandyRunnable","l":"setupTask(BukkitTask)","u":"setupTask(org.bukkit.scheduler.BukkitTask)"},{"p":"cn.handyplus.lib.adapter","c":"HandyRunnable","l":"setupTask(ScheduledTask)","u":"setupTask(io.papermc.paper.threadedregions.scheduler.ScheduledTask)"},{"p":"cn.handyplus.lib.adapter","c":"PlayerSchedulerUtil","l":"syncCloseInventory(Player)","u":"syncCloseInventory(org.bukkit.entity.Player)"},{"p":"cn.handyplus.lib.adapter","c":"PlayerSchedulerUtil","l":"syncDispatchCommand(String)","u":"syncDispatchCommand(java.lang.String)"},{"p":"cn.handyplus.lib.adapter","c":"PlayerSchedulerUtil","l":"syncOpenInventory(Player, Inventory)","u":"syncOpenInventory(org.bukkit.entity.Player,org.bukkit.inventory.Inventory)"},{"p":"cn.handyplus.lib.adapter","c":"PlayerSchedulerUtil","l":"syncPerformCommand(Player, String)","u":"syncPerformCommand(org.bukkit.entity.Player,java.lang.String)"},{"p":"cn.handyplus.lib.adapter","c":"PlayerSchedulerUtil","l":"syncPerformOpCommand(Player, String)","u":"syncPerformOpCommand(org.bukkit.entity.Player,java.lang.String)"},{"p":"cn.handyplus.lib.adapter","c":"PlayerSchedulerUtil","l":"syncPerformReplaceCommand(Player, String)","u":"syncPerformReplaceCommand(org.bukkit.entity.Player,java.lang.String)"},{"p":"cn.handyplus.lib.adapter","c":"PlayerSchedulerUtil","l":"syncPlayerPerformCommand(Player, String)","u":"syncPlayerPerformCommand(org.bukkit.entity.Player,java.lang.String)"},{"p":"cn.handyplus.lib.adapter","c":"PlayerSchedulerUtil","l":"syncPlayerPerformOpCommand(Player, String)","u":"syncPlayerPerformOpCommand(org.bukkit.entity.Player,java.lang.String)"},{"p":"cn.handyplus.lib.adapter","c":"PlayerSchedulerUtil","l":"syncTeleport(Entity, Location)","u":"syncTeleport(org.bukkit.entity.Entity,org.bukkit.Location)"},{"p":"cn.handyplus.lib.adapter","c":"PlayerSchedulerUtil","l":"syncTeleport(Entity, Location, PlayerTeleportEvent.TeleportCause)","u":"syncTeleport(org.bukkit.entity.Entity,org.bukkit.Location,org.bukkit.event.player.PlayerTeleportEvent.TeleportCause)"},{"p":"cn.handyplus.lib.adapter","c":"PlayerSchedulerUtil","l":"teleport(Entity, Location)","u":"teleport(org.bukkit.entity.Entity,org.bukkit.Location)"},{"p":"cn.handyplus.lib.adapter","c":"PlayerSchedulerUtil","l":"teleport(Entity, Location, PlayerTeleportEvent.TeleportCause)","u":"teleport(org.bukkit.entity.Entity,org.bukkit.Location,org.bukkit.event.player.PlayerTeleportEvent.TeleportCause)"},{"p":"cn.handyplus.lib.adapter","c":"HandySchedulerUtilTest","l":"test1(Player)","u":"test1(org.bukkit.entity.Player)"},{"p":"cn.handyplus.lib.adapter","c":"HandySchedulerUtilTest","l":"test2()"},{"p":"cn.handyplus.lib.adapter","c":"HandySchedulerUtilTest","l":"test3()"},{"p":"cn.handyplus.lib.adapter","c":"HandySchedulerUtilTest","l":"test4(Player, Location)","u":"test4(org.bukkit.entity.Player,org.bukkit.Location)"},{"p":"cn.handyplus.lib.adapter","c":"HandySchedulerUtilTest","l":"test5(Player, String)","u":"test5(org.bukkit.entity.Player,java.lang.String)"},{"p":"cn.handyplus.lib.adapter","c":"HandySchedulerUtilTest","l":"test6(Player, Inventory)","u":"test6(org.bukkit.entity.Player,org.bukkit.inventory.Inventory)"},{"p":"cn.handyplus.lib.adapter","c":"HandySchedulerUtilTest","l":"test7(Player, Inventory)","u":"test7(org.bukkit.entity.Player,org.bukkit.inventory.Inventory)"},{"p":"cn.handyplus.lib.adapter","c":"ServerTypeEnum","l":"valueOf(String)","u":"valueOf(java.lang.String)"},{"p":"cn.handyplus.lib.adapter","c":"ServerTypeEnum","l":"values()"}];updateSearchResults(); -------------------------------------------------------------------------------- /docs/module-search-index.js: -------------------------------------------------------------------------------- 1 | moduleSearchIndex = [];updateSearchResults(); -------------------------------------------------------------------------------- /docs/overview-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 类分层结构 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 47 |
48 |
49 |
50 |

所有程序包的分层结构

51 |
52 | 程序包分层结构: 53 | 56 |
57 |

类分层结构

58 | 71 |
72 |
73 |

枚举类分层结构

74 | 85 |
86 |
87 |
88 |
89 | 90 | 91 | -------------------------------------------------------------------------------- /docs/package-search-index.js: -------------------------------------------------------------------------------- 1 | packageSearchIndex = [{"l":"cn.handyplus.lib.adapter"},{"l":"所有程序包","u":"allpackages-index.html"}];updateSearchResults(); -------------------------------------------------------------------------------- /docs/resources/glass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/handyplus/FoliaLib/da02c12914a7980c5a12f03c436dab62a4845e87/docs/resources/glass.png -------------------------------------------------------------------------------- /docs/resources/x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/handyplus/FoliaLib/da02c12914a7980c5a12f03c436dab62a4845e87/docs/resources/x.png -------------------------------------------------------------------------------- /docs/script-dir/jquery-ui.min.css: -------------------------------------------------------------------------------- 1 | /*! jQuery UI - v1.13.2 - 2023-02-27 2 | * http://jqueryui.com 3 | * Includes: core.css, autocomplete.css, menu.css 4 | * Copyright jQuery Foundation and other contributors; Licensed MIT */ 5 | 6 | .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;-ms-filter:"alpha(opacity=0)"}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important;pointer-events:none}.ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:0}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{margin:0;cursor:pointer;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-item-wrapper{position:relative;padding:3px 1em 3px .4em}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item-wrapper{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0} -------------------------------------------------------------------------------- /docs/script.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. 3 | * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 4 | * 5 | * 6 | * 7 | * 8 | * 9 | * 10 | * 11 | * 12 | * 13 | * 14 | * 15 | * 16 | * 17 | * 18 | * 19 | * 20 | * 21 | * 22 | * 23 | * 24 | */ 25 | 26 | var moduleSearchIndex; 27 | var packageSearchIndex; 28 | var typeSearchIndex; 29 | var memberSearchIndex; 30 | var tagSearchIndex; 31 | 32 | var oddRowColor = "odd-row-color"; 33 | var evenRowColor = "even-row-color"; 34 | var sortAsc = "sort-asc"; 35 | var sortDesc = "sort-desc"; 36 | var tableTab = "table-tab"; 37 | var activeTableTab = "active-table-tab"; 38 | 39 | function loadScripts(doc, tag) { 40 | createElem(doc, tag, 'search.js'); 41 | 42 | createElem(doc, tag, 'module-search-index.js'); 43 | createElem(doc, tag, 'package-search-index.js'); 44 | createElem(doc, tag, 'type-search-index.js'); 45 | createElem(doc, tag, 'member-search-index.js'); 46 | createElem(doc, tag, 'tag-search-index.js'); 47 | } 48 | 49 | function createElem(doc, tag, path) { 50 | var script = doc.createElement(tag); 51 | var scriptElement = doc.getElementsByTagName(tag)[0]; 52 | script.src = pathtoroot + path; 53 | scriptElement.parentNode.insertBefore(script, scriptElement); 54 | } 55 | 56 | // Helper for making content containing release names comparable lexicographically 57 | function makeComparable(s) { 58 | return s.toLowerCase().replace(/(\d+)/g, 59 | function(n, m) { 60 | return ("000" + m).slice(-4); 61 | }); 62 | } 63 | 64 | // Switches between two styles depending on a condition 65 | function toggleStyle(classList, condition, trueStyle, falseStyle) { 66 | if (condition) { 67 | classList.remove(falseStyle); 68 | classList.add(trueStyle); 69 | } else { 70 | classList.remove(trueStyle); 71 | classList.add(falseStyle); 72 | } 73 | } 74 | 75 | // Sorts the rows in a table lexicographically by the content of a specific column 76 | function sortTable(header, columnIndex, columns) { 77 | var container = header.parentElement; 78 | var descending = header.classList.contains(sortAsc); 79 | container.querySelectorAll("div.table-header").forEach( 80 | function(header) { 81 | header.classList.remove(sortAsc); 82 | header.classList.remove(sortDesc); 83 | } 84 | ) 85 | var cells = container.children; 86 | var rows = []; 87 | for (var i = columns; i < cells.length; i += columns) { 88 | rows.push(Array.prototype.slice.call(cells, i, i + columns)); 89 | } 90 | var comparator = function(a, b) { 91 | var ka = makeComparable(a[columnIndex].textContent); 92 | var kb = makeComparable(b[columnIndex].textContent); 93 | if (ka < kb) 94 | return descending ? 1 : -1; 95 | if (ka > kb) 96 | return descending ? -1 : 1; 97 | return 0; 98 | }; 99 | var sorted = rows.sort(comparator); 100 | var visible = 0; 101 | sorted.forEach(function(row) { 102 | if (row[0].style.display !== 'none') { 103 | var isEvenRow = visible++ % 2 === 0; 104 | } 105 | row.forEach(function(cell) { 106 | toggleStyle(cell.classList, isEvenRow, evenRowColor, oddRowColor); 107 | container.appendChild(cell); 108 | }) 109 | }); 110 | toggleStyle(header.classList, descending, sortDesc, sortAsc); 111 | } 112 | 113 | // Toggles the visibility of a table category in all tables in a page 114 | function toggleGlobal(checkbox, selected, columns) { 115 | var display = checkbox.checked ? '' : 'none'; 116 | document.querySelectorAll("div.table-tabs").forEach(function(t) { 117 | var id = t.parentElement.getAttribute("id"); 118 | var selectedClass = id + "-tab" + selected; 119 | // if selected is empty string it selects all uncategorized entries 120 | var selectUncategorized = !Boolean(selected); 121 | var visible = 0; 122 | document.querySelectorAll('div.' + id) 123 | .forEach(function(elem) { 124 | if (selectUncategorized) { 125 | if (elem.className.indexOf(selectedClass) === -1) { 126 | elem.style.display = display; 127 | } 128 | } else if (elem.classList.contains(selectedClass)) { 129 | elem.style.display = display; 130 | } 131 | if (elem.style.display === '') { 132 | var isEvenRow = visible++ % (columns * 2) < columns; 133 | toggleStyle(elem.classList, isEvenRow, evenRowColor, oddRowColor); 134 | } 135 | }); 136 | var displaySection = visible === 0 ? 'none' : ''; 137 | t.parentElement.style.display = displaySection; 138 | document.querySelector("li#contents-" + id).style.display = displaySection; 139 | }) 140 | } 141 | 142 | // Shows the elements of a table belonging to a specific category 143 | function show(tableId, selected, columns) { 144 | if (tableId !== selected) { 145 | document.querySelectorAll('div.' + tableId + ':not(.' + selected + ')') 146 | .forEach(function(elem) { 147 | elem.style.display = 'none'; 148 | }); 149 | } 150 | document.querySelectorAll('div.' + selected) 151 | .forEach(function(elem, index) { 152 | elem.style.display = ''; 153 | var isEvenRow = index % (columns * 2) < columns; 154 | toggleStyle(elem.classList, isEvenRow, evenRowColor, oddRowColor); 155 | }); 156 | updateTabs(tableId, selected); 157 | } 158 | 159 | function updateTabs(tableId, selected) { 160 | document.querySelector('div#' + tableId +' .summary-table') 161 | .setAttribute('aria-labelledby', selected); 162 | document.querySelectorAll('button[id^="' + tableId + '"]') 163 | .forEach(function(tab, index) { 164 | if (selected === tab.id || (tableId === selected && index === 0)) { 165 | tab.className = activeTableTab; 166 | tab.setAttribute('aria-selected', true); 167 | tab.setAttribute('tabindex',0); 168 | } else { 169 | tab.className = tableTab; 170 | tab.setAttribute('aria-selected', false); 171 | tab.setAttribute('tabindex',-1); 172 | } 173 | }); 174 | } 175 | 176 | function switchTab(e) { 177 | var selected = document.querySelector('[aria-selected=true]'); 178 | if (selected) { 179 | if ((e.keyCode === 37 || e.keyCode === 38) && selected.previousSibling) { 180 | // left or up arrow key pressed: move focus to previous tab 181 | selected.previousSibling.click(); 182 | selected.previousSibling.focus(); 183 | e.preventDefault(); 184 | } else if ((e.keyCode === 39 || e.keyCode === 40) && selected.nextSibling) { 185 | // right or down arrow key pressed: move focus to next tab 186 | selected.nextSibling.click(); 187 | selected.nextSibling.focus(); 188 | e.preventDefault(); 189 | } 190 | } 191 | } 192 | 193 | var updateSearchResults = function() {}; 194 | 195 | function indexFilesLoaded() { 196 | return moduleSearchIndex 197 | && packageSearchIndex 198 | && typeSearchIndex 199 | && memberSearchIndex 200 | && tagSearchIndex; 201 | } 202 | // Copy the contents of the local snippet to the clipboard 203 | function copySnippet(button) { 204 | copyToClipboard(button.nextElementSibling.innerText); 205 | switchCopyLabel(button, button.firstElementChild); 206 | } 207 | function copyToClipboard(content) { 208 | var textarea = document.createElement("textarea"); 209 | textarea.style.height = 0; 210 | document.body.appendChild(textarea); 211 | textarea.value = content; 212 | textarea.select(); 213 | document.execCommand("copy"); 214 | document.body.removeChild(textarea); 215 | } 216 | function switchCopyLabel(button, span) { 217 | var copied = span.getAttribute("data-copied"); 218 | button.classList.add("visible"); 219 | var initialLabel = span.innerHTML; 220 | span.innerHTML = copied; 221 | setTimeout(function() { 222 | button.classList.remove("visible"); 223 | setTimeout(function() { 224 | if (initialLabel !== copied) { 225 | span.innerHTML = initialLabel; 226 | } 227 | }, 100); 228 | }, 1900); 229 | } 230 | // Workaround for scroll position not being included in browser history (8249133) 231 | document.addEventListener("DOMContentLoaded", function(e) { 232 | var contentDiv = document.querySelector("div.flex-content"); 233 | window.addEventListener("popstate", function(e) { 234 | if (e.state !== null) { 235 | contentDiv.scrollTop = e.state; 236 | } 237 | }); 238 | window.addEventListener("hashchange", function(e) { 239 | history.replaceState(contentDiv.scrollTop, document.title); 240 | }); 241 | var timeoutId; 242 | contentDiv.addEventListener("scroll", function(e) { 243 | if (timeoutId) { 244 | clearTimeout(timeoutId); 245 | } 246 | timeoutId = setTimeout(function() { 247 | history.replaceState(contentDiv.scrollTop, document.title); 248 | }, 100); 249 | }); 250 | if (!location.hash) { 251 | history.replaceState(contentDiv.scrollTop, document.title); 252 | } 253 | }); 254 | -------------------------------------------------------------------------------- /docs/search-page.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. 3 | * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 4 | * 5 | * 6 | * 7 | * 8 | * 9 | * 10 | * 11 | * 12 | * 13 | * 14 | * 15 | * 16 | * 17 | * 18 | * 19 | * 20 | * 21 | * 22 | * 23 | * 24 | */ 25 | 26 | "use strict"; 27 | $(function() { 28 | var copy = $("#page-search-copy"); 29 | var expand = $("#page-search-expand"); 30 | var searchLink = $("span#page-search-link"); 31 | var redirect = $("input#search-redirect"); 32 | function setSearchUrlTemplate() { 33 | var href = document.location.href.split(/[#?]/)[0]; 34 | href += "?q=" + "%s"; 35 | if (redirect.is(":checked")) { 36 | href += "&r=1"; 37 | } 38 | searchLink.html(href); 39 | copy[0].onmouseenter(); 40 | } 41 | function copyLink(e) { 42 | copyToClipboard(this.previousSibling.innerText); 43 | switchCopyLabel(this, this.lastElementChild); 44 | } 45 | copy.click(copyLink); 46 | copy[0].onmouseenter = function() {}; 47 | redirect.click(setSearchUrlTemplate); 48 | setSearchUrlTemplate(); 49 | copy.prop("disabled", false); 50 | redirect.prop("disabled", false); 51 | expand.click(function (e) { 52 | var searchInfo = $("div.page-search-info"); 53 | if(this.parentElement.hasAttribute("open")) { 54 | searchInfo.attr("style", "border-width: 0;"); 55 | } else { 56 | searchInfo.attr("style", "border-width: 1px;").height(searchInfo.prop("scrollHeight")); 57 | } 58 | }); 59 | }); 60 | $(window).on("load", function() { 61 | var input = $("#page-search-input"); 62 | var reset = $("#page-search-reset"); 63 | var notify = $("#page-search-notify"); 64 | var resultSection = $("div#result-section"); 65 | var resultContainer = $("div#result-container"); 66 | var searchTerm = ""; 67 | var activeTab = ""; 68 | var fixedTab = false; 69 | var visibleTabs = []; 70 | var feelingLucky = false; 71 | function renderResults(result) { 72 | if (!result.length) { 73 | notify.html(messages.noResult); 74 | } else if (result.length === 1) { 75 | notify.html(messages.oneResult); 76 | } else { 77 | notify.html(messages.manyResults.replace("{0}", result.length)); 78 | } 79 | resultContainer.empty(); 80 | var r = { 81 | "types": [], 82 | "members": [], 83 | "packages": [], 84 | "modules": [], 85 | "searchTags": [] 86 | }; 87 | for (var i in result) { 88 | var item = result[i]; 89 | var arr = r[item.category]; 90 | arr.push(item); 91 | } 92 | if (!activeTab || r[activeTab].length === 0 || !fixedTab) { 93 | Object.keys(r).reduce(function(prev, curr) { 94 | if (r[curr].length > 0 && r[curr][0].score > prev) { 95 | activeTab = curr; 96 | return r[curr][0].score; 97 | } 98 | return prev; 99 | }, 0); 100 | } 101 | if (feelingLucky && activeTab) { 102 | notify.html(messages.redirecting) 103 | var firstItem = r[activeTab][0]; 104 | window.location = getURL(firstItem.indexItem, firstItem.category); 105 | return; 106 | } 107 | if (result.length > 20) { 108 | if (searchTerm[searchTerm.length - 1] === ".") { 109 | if (activeTab === "types" && r["members"].length > r["types"].length) { 110 | activeTab = "members"; 111 | } else if (activeTab === "packages" && r["types"].length > r["packages"].length) { 112 | activeTab = "types"; 113 | } 114 | } 115 | } 116 | var categoryCount = Object.keys(r).reduce(function(prev, curr) { 117 | return prev + (r[curr].length > 0 ? 1 : 0); 118 | }, 0); 119 | visibleTabs = []; 120 | var tabContainer = $("
").appendTo(resultContainer); 121 | for (var key in r) { 122 | var id = "#result-tab-" + key.replace("searchTags", "search_tags"); 123 | if (r[key].length) { 124 | var count = r[key].length >= 1000 ? "999+" : r[key].length; 125 | if (result.length > 20 && categoryCount > 1) { 126 | var button = $("").appendTo(tabContainer); 129 | button.click(key, function(e) { 130 | fixedTab = true; 131 | renderResult(e.data, $(this)); 132 | }); 133 | visibleTabs.push(key); 134 | } else { 135 | $("" + categories[key] 136 | + " (" + count + ")").appendTo(tabContainer); 137 | renderTable(key, r[key]).appendTo(resultContainer); 138 | tabContainer = $("
").appendTo(resultContainer); 139 | 140 | } 141 | } 142 | } 143 | if (activeTab && result.length > 20 && categoryCount > 1) { 144 | $("button#result-tab-" + activeTab).addClass("active-table-tab"); 145 | renderTable(activeTab, r[activeTab]).appendTo(resultContainer); 146 | } 147 | resultSection.show(); 148 | function renderResult(category, button) { 149 | activeTab = category; 150 | setSearchUrl(); 151 | resultContainer.find("div.summary-table").remove(); 152 | renderTable(activeTab, r[activeTab]).appendTo(resultContainer); 153 | button.siblings().removeClass("active-table-tab"); 154 | button.addClass("active-table-tab"); 155 | } 156 | } 157 | function selectTab(category) { 158 | $("button#result-tab-" + category).click(); 159 | } 160 | function renderTable(category, items) { 161 | var table = $("
") 162 | .addClass(category === "modules" 163 | ? "one-column-search-results" 164 | : "two-column-search-results"); 165 | var col1, col2; 166 | if (category === "modules") { 167 | col1 = "Module"; 168 | } else if (category === "packages") { 169 | col1 = "Module"; 170 | col2 = "Package"; 171 | } else if (category === "types") { 172 | col1 = "Package"; 173 | col2 = "Class" 174 | } else if (category === "members") { 175 | col1 = "Class"; 176 | col2 = "Member"; 177 | } else if (category === "searchTags") { 178 | col1 = "Location"; 179 | col2 = "Name"; 180 | } 181 | $("
" + col1 + "
").appendTo(table); 182 | if (category !== "modules") { 183 | $("
" + col2 + "
").appendTo(table); 184 | } 185 | $.each(items, function(index, item) { 186 | var rowColor = index % 2 ? "odd-row-color" : "even-row-color"; 187 | renderItem(item, table, rowColor); 188 | }); 189 | return table; 190 | } 191 | function renderItem(item, table, rowColor) { 192 | var label = getHighlightedText(item.input, item.boundaries, item.prefix.length, item.input.length); 193 | var link = $("") 194 | .attr("href", getURL(item.indexItem, item.category)) 195 | .attr("tabindex", "0") 196 | .addClass("search-result-link") 197 | .html(label); 198 | var container = getHighlightedText(item.input, item.boundaries, 0, item.prefix.length - 1); 199 | if (item.category === "searchTags") { 200 | container = item.indexItem.h || ""; 201 | } 202 | if (item.category !== "modules") { 203 | $("
").html(container).addClass("col-plain").addClass(rowColor).appendTo(table); 204 | } 205 | $("
").html(link).addClass("col-last").addClass(rowColor).appendTo(table); 206 | } 207 | var timeout; 208 | function schedulePageSearch() { 209 | if (timeout) { 210 | clearTimeout(timeout); 211 | } 212 | timeout = setTimeout(function () { 213 | doPageSearch() 214 | }, 100); 215 | } 216 | function doPageSearch() { 217 | setSearchUrl(); 218 | var term = searchTerm = input.val().trim(); 219 | if (term === "") { 220 | notify.html(messages.enterTerm); 221 | activeTab = ""; 222 | fixedTab = false; 223 | resultContainer.empty(); 224 | resultSection.hide(); 225 | } else { 226 | notify.html(messages.searching); 227 | doSearch({ term: term, maxResults: 1200 }, renderResults); 228 | } 229 | } 230 | function setSearchUrl() { 231 | var query = input.val().trim(); 232 | var url = document.location.pathname; 233 | if (query) { 234 | url += "?q=" + encodeURI(query); 235 | if (activeTab && fixedTab) { 236 | url += "&c=" + activeTab; 237 | } 238 | } 239 | history.replaceState({query: query}, "", url); 240 | } 241 | input.on("input", function(e) { 242 | feelingLucky = false; 243 | schedulePageSearch(); 244 | }); 245 | $(document).keydown(function(e) { 246 | if ((e.ctrlKey || e.metaKey) && (e.key === "ArrowLeft" || e.key === "ArrowRight")) { 247 | if (activeTab && visibleTabs.length > 1) { 248 | var idx = visibleTabs.indexOf(activeTab); 249 | idx += e.key === "ArrowLeft" ? visibleTabs.length - 1 : 1; 250 | selectTab(visibleTabs[idx % visibleTabs.length]); 251 | return false; 252 | } 253 | } 254 | }); 255 | reset.click(function() { 256 | notify.html(messages.enterTerm); 257 | resultSection.hide(); 258 | activeTab = ""; 259 | fixedTab = false; 260 | resultContainer.empty(); 261 | input.val('').focus(); 262 | setSearchUrl(); 263 | }); 264 | input.prop("disabled", false); 265 | reset.prop("disabled", false); 266 | 267 | var urlParams = new URLSearchParams(window.location.search); 268 | if (urlParams.has("q")) { 269 | input.val(urlParams.get("q")) 270 | } 271 | if (urlParams.has("c")) { 272 | activeTab = urlParams.get("c"); 273 | fixedTab = true; 274 | } 275 | if (urlParams.get("r")) { 276 | feelingLucky = true; 277 | } 278 | if (input.val()) { 279 | doPageSearch(); 280 | } else { 281 | notify.html(messages.enterTerm); 282 | } 283 | input.select().focus(); 284 | }); 285 | -------------------------------------------------------------------------------- /docs/search.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 搜索 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 23 |
24 | 43 |
44 |
45 |

搜索

46 |
47 | 48 | 49 |
50 | 其他资源 51 |
52 |
53 |
54 |

帮助页 介绍了 JavaDoc 搜索的范围和语法。

55 |

您可以使用 <ctrl> 或 <cmd> 键与左箭头和右箭头键组合在此页面中的结果选项卡之间切换。

56 |

下面的 URL 模板可用于在支持此功能的浏览器中将此页面配置为搜索引擎。已经对其进行了测试以在 Google Chrome 和 Mozilla Firefox 中使用。请注意,其他浏览器可能不支持此功能或需要不同的 URL 格式。

57 | link 58 |

59 | 60 |

61 |
62 |

正在加载搜索索引...

63 | 67 |
68 |
69 |
70 | 71 | 72 | -------------------------------------------------------------------------------- /docs/tag-search-index.js: -------------------------------------------------------------------------------- 1 | tagSearchIndex = [];updateSearchResults(); -------------------------------------------------------------------------------- /docs/type-search-index.js: -------------------------------------------------------------------------------- 1 | typeSearchIndex = [{"p":"cn.handyplus.lib.adapter","l":"BukkitScheduler"},{"p":"cn.handyplus.lib.adapter","l":"FoliaScheduler"},{"p":"cn.handyplus.lib.adapter","l":"HandyRunnable"},{"p":"cn.handyplus.lib.adapter","l":"HandySchedulerUtil"},{"p":"cn.handyplus.lib.adapter","l":"HandySchedulerUtilTest"},{"p":"cn.handyplus.lib.adapter","l":"PlayerSchedulerUtil"},{"p":"cn.handyplus.lib.adapter","l":"ServerTypeEnum"},{"p":"cn.handyplus.lib.adapter","l":"WorldSchedulerUtil"},{"l":"所有类和接口","u":"allclasses-index.html"}];updateSearchResults(); -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | cn.handyplus.lib.adapter 8 | FoliaLib 9 | 1.2.0 10 | FoliaLib 11 | handy的Minecraft快速开发框架-Folia适配 12 | https://github.com/handyplus/FoliaLib 13 | 14 | 15 | UTF-8 16 | UTF-8 17 | UTF-8 18 | 1.20.2-R0.1-SNAPSHOT 19 | 20 | 21 | 22 | github Issue 23 | https://github.com/handyplus/FoliaLib/issues 24 | 25 | 26 | 27 | 28 | GNU LESSER GENERAL PUBLIC LICENSE v3.0 29 | https://github.com/handyplus/FoliaLib/blob/master/LICENSE 30 | 31 | 32 | 33 | 34 | 35 | handy 36 | handyplus@163.com 37 | 38 | 39 | 40 | 41 | scm:git@github.com:handy-git/FoliaLib.git 42 | scm:git@github.com:handy-git/FoliaLib.git 43 | git@github.com:handy-git/FoliaLib.git 44 | 45 | 46 | 47 | 48 | papermc 49 | https://repo.papermc.io/repository/maven-public/ 50 | 51 | 52 | 53 | 54 | 55 | dev.folia 56 | folia-api 57 | ${folia-api.vesion} 58 | true 59 | 60 | 61 | 62 | 63 | 64 | ossrh 65 | https://s01.oss.sonatype.org/content/repositories/snapshots 66 | 67 | 68 | ossrh 69 | https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | org.apache.maven.plugins 78 | maven-source-plugin 79 | 3.3.0 80 | 81 | 82 | attach-sources 83 | 84 | jar-no-fork 85 | 86 | 87 | 88 | 89 | 90 | 91 | org.apache.maven.plugins 92 | maven-javadoc-plugin 93 | 3.5.0 94 | 95 | 96 | attach-javadocs 97 | 98 | jar 99 | 100 | 101 | 102 | 103 | 104 | 105 | org.apache.maven.plugins 106 | maven-gpg-plugin 107 | 3.1.0 108 | 109 | 110 | sign-artifacts 111 | verify 112 | 113 | sign 114 | 115 | 116 | handy 117 | 118 | 119 | 120 | 121 | 122 | 123 | org.sonatype.plugins 124 | nexus-staging-maven-plugin 125 | 1.6.13 126 | true 127 | 128 | ossrh 129 | https://s01.oss.sonatype.org/ 130 | true 131 | 132 | 133 | 134 | 135 | org.apache.maven.plugins 136 | maven-compiler-plugin 137 | 3.11.0 138 | 139 | 1.8 140 | 1.8 141 | 142 | 143 | 144 | 145 | 146 | -------------------------------------------------------------------------------- /src/main/java/cn/handyplus/lib/adapter/BukkitScheduler.java: -------------------------------------------------------------------------------- 1 | package cn.handyplus.lib.adapter; 2 | 3 | import org.bukkit.Bukkit; 4 | 5 | /** 6 | * Bukkit内部调度器 7 | * 8 | * @author handy 9 | * @since 1.0.0 10 | */ 11 | public class BukkitScheduler { 12 | 13 | private BukkitScheduler() { 14 | 15 | } 16 | 17 | /** 18 | * 同步 19 | * 20 | * @param task 方法 21 | */ 22 | protected static void runTask(Runnable task) { 23 | Bukkit.getScheduler().runTask(HandySchedulerUtil.BUKKIT_PLUGIN, task); 24 | } 25 | 26 | /** 27 | * 延迟同步 28 | * 29 | * @param task 方法 30 | * @param delay 延迟 31 | */ 32 | protected static void runTaskLater(Runnable task, long delay) { 33 | Bukkit.getScheduler().runTaskLater(HandySchedulerUtil.BUKKIT_PLUGIN, task, delay); 34 | } 35 | 36 | /** 37 | * 延迟同步 38 | * 39 | * @param task 方法 40 | * @param delay 延迟 41 | */ 42 | protected static void runTaskLater(HandyRunnable task, long delay) { 43 | task.setupTask(Bukkit.getScheduler().runTaskLater(HandySchedulerUtil.BUKKIT_PLUGIN, task, delay)); 44 | } 45 | 46 | /** 47 | * 循环同步 48 | * 49 | * @param task 方法 50 | * @param delay 延迟 51 | * @param period 期间 52 | */ 53 | protected static void runTaskTimer(Runnable task, long delay, long period) { 54 | Bukkit.getScheduler().runTaskTimer(HandySchedulerUtil.BUKKIT_PLUGIN, task, delay, period); 55 | } 56 | 57 | /** 58 | * 循环同步 59 | * 60 | * @param task 方法 61 | * @param delay 延迟 62 | * @param period 期间 63 | */ 64 | protected static void runTaskTimer(HandyRunnable task, long delay, long period) { 65 | task.setupTask(Bukkit.getScheduler().runTaskTimer(HandySchedulerUtil.BUKKIT_PLUGIN, task, delay, period)); 66 | } 67 | 68 | /** 69 | * 异步 70 | * 71 | * @param task 方法 72 | */ 73 | protected static void runTaskAsynchronously(Runnable task) { 74 | Bukkit.getScheduler().runTaskAsynchronously(HandySchedulerUtil.BUKKIT_PLUGIN, task); 75 | } 76 | 77 | /** 78 | * 延迟异步 79 | * 80 | * @param task 方法 81 | * @param delay 延迟 82 | */ 83 | protected static void runTaskLaterAsynchronously(Runnable task, long delay) { 84 | Bukkit.getScheduler().runTaskLaterAsynchronously(HandySchedulerUtil.BUKKIT_PLUGIN, task, delay); 85 | } 86 | 87 | /** 88 | * 延迟异步 89 | * 90 | * @param task 方法 91 | * @param delay 延迟 92 | * @since 1.0.5 93 | */ 94 | protected static void runTaskLaterAsynchronously(HandyRunnable task, long delay) { 95 | task.setupTask(Bukkit.getScheduler().runTaskLaterAsynchronously(HandySchedulerUtil.BUKKIT_PLUGIN, task, delay)); 96 | } 97 | 98 | /** 99 | * 循环异步 100 | * 101 | * @param task 方法 102 | * @param delay 延迟 103 | * @param period 期间 104 | */ 105 | protected static void runTaskTimerAsynchronously(Runnable task, long delay, long period) { 106 | Bukkit.getScheduler().runTaskTimerAsynchronously(HandySchedulerUtil.BUKKIT_PLUGIN, task, delay, period); 107 | } 108 | 109 | /** 110 | * 循环异步 111 | * 112 | * @param task 方法 113 | * @param delay 延迟 114 | * @param period 期间 115 | */ 116 | protected static void runTaskTimerAsynchronously(HandyRunnable task, long delay, long period) { 117 | task.setupTask(Bukkit.getScheduler().runTaskTimerAsynchronously(HandySchedulerUtil.BUKKIT_PLUGIN, task, delay, period)); 118 | } 119 | 120 | /** 121 | * 取消所有调度任务 122 | */ 123 | protected static void cancelTask() { 124 | Bukkit.getScheduler().cancelTasks(HandySchedulerUtil.BUKKIT_PLUGIN); 125 | } 126 | 127 | } -------------------------------------------------------------------------------- /src/main/java/cn/handyplus/lib/adapter/FoliaScheduler.java: -------------------------------------------------------------------------------- 1 | package cn.handyplus.lib.adapter; 2 | 3 | import org.bukkit.Bukkit; 4 | 5 | import java.util.concurrent.TimeUnit; 6 | 7 | /** 8 | * Folia内部调度器 9 | * 10 | * @author handy 11 | * @since 1.0.0 12 | */ 13 | public class FoliaScheduler { 14 | 15 | private FoliaScheduler() { 16 | 17 | } 18 | 19 | /** 20 | * 同步 21 | * 22 | * @param task 方法 23 | */ 24 | protected static void runTask(Runnable task) { 25 | Bukkit.getGlobalRegionScheduler().run(HandySchedulerUtil.BUKKIT_PLUGIN, a -> task.run()); 26 | } 27 | 28 | /** 29 | * 延迟同步 30 | * 31 | * @param task 方法 32 | * @param delay 延迟 33 | */ 34 | protected static void runTaskLater(Runnable task, long delay) { 35 | delay = getOneIfNotPositive(delay); 36 | Bukkit.getGlobalRegionScheduler().runDelayed(HandySchedulerUtil.BUKKIT_PLUGIN, a -> task.run(), delay); 37 | } 38 | 39 | /** 40 | * 延迟同步 41 | * 42 | * @param task 方法 43 | * @param delay 延迟 44 | * @since 1.0.5 45 | */ 46 | protected static void runTaskLater(HandyRunnable task, long delay) { 47 | delay = getOneIfNotPositive(delay); 48 | task.setupTask(Bukkit.getGlobalRegionScheduler().runDelayed(HandySchedulerUtil.BUKKIT_PLUGIN, a -> task.run(), delay)); 49 | } 50 | 51 | /** 52 | * 循环同步 53 | * 54 | * @param task 方法 55 | * @param delay 延迟 56 | * @param period 期间 57 | */ 58 | protected static void runTaskTimer(Runnable task, long delay, long period) { 59 | delay = getOneIfNotPositive(delay); 60 | Bukkit.getGlobalRegionScheduler().runAtFixedRate(HandySchedulerUtil.BUKKIT_PLUGIN, a -> task.run(), delay, period); 61 | } 62 | 63 | /** 64 | * 循环同步 65 | * 66 | * @param task 方法 67 | * @param delay 延迟 68 | * @param period 期间 69 | */ 70 | protected static void runTaskTimer(HandyRunnable task, long delay, long period) { 71 | delay = getOneIfNotPositive(delay); 72 | task.setupTask(Bukkit.getGlobalRegionScheduler().runAtFixedRate(HandySchedulerUtil.BUKKIT_PLUGIN, a -> task.run(), delay, period)); 73 | } 74 | 75 | /** 76 | * 异步 77 | * 78 | * @param task 方法 79 | */ 80 | protected static void runTaskAsynchronously(Runnable task) { 81 | Bukkit.getAsyncScheduler().runNow(HandySchedulerUtil.BUKKIT_PLUGIN, a -> task.run()); 82 | } 83 | 84 | /** 85 | * 延迟异步 86 | * 87 | * @param task 方法 88 | * @param delay 延迟 89 | */ 90 | protected static void runTaskLaterAsynchronously(Runnable task, long delay) { 91 | delay = getOneIfNotPositive(delay); 92 | Bukkit.getAsyncScheduler().runDelayed(HandySchedulerUtil.BUKKIT_PLUGIN, a -> task.run(), delay * 50, TimeUnit.MILLISECONDS); 93 | } 94 | 95 | /** 96 | * 延迟异步 97 | * 98 | * @param task 方法 99 | * @param delay 延迟 100 | * @since 1.0.5 101 | */ 102 | protected static void runTaskLaterAsynchronously(HandyRunnable task, long delay) { 103 | delay = getOneIfNotPositive(delay); 104 | task.setupTask(Bukkit.getAsyncScheduler().runDelayed(HandySchedulerUtil.BUKKIT_PLUGIN, a -> task.run(), delay * 50, TimeUnit.MILLISECONDS)); 105 | } 106 | 107 | /** 108 | * 循环异步 109 | * 110 | * @param task 方法 111 | * @param delay 延迟 112 | * @param period 期间 113 | */ 114 | protected static void runTaskTimerAsynchronously(Runnable task, long delay, long period) { 115 | delay = getOneIfNotPositive(delay); 116 | Bukkit.getAsyncScheduler().runAtFixedRate(HandySchedulerUtil.BUKKIT_PLUGIN, a -> task.run(), delay * 50, period * 50, TimeUnit.MILLISECONDS); 117 | } 118 | 119 | /** 120 | * 循环异步 121 | * 122 | * @param task 方法 123 | * @param delay 延迟 124 | * @param period 期间 125 | */ 126 | protected static void runTaskTimerAsynchronously(HandyRunnable task, long delay, long period) { 127 | delay = getOneIfNotPositive(delay); 128 | task.setupTask(Bukkit.getAsyncScheduler().runAtFixedRate(HandySchedulerUtil.BUKKIT_PLUGIN, a -> task.run(), delay * 50, period * 50, TimeUnit.MILLISECONDS)); 129 | } 130 | 131 | /** 132 | * 取消所有调度任务 133 | */ 134 | protected static void cancelTask() { 135 | Bukkit.getGlobalRegionScheduler().cancelTasks(HandySchedulerUtil.BUKKIT_PLUGIN); 136 | Bukkit.getAsyncScheduler().cancelTasks(HandySchedulerUtil.BUKKIT_PLUGIN); 137 | } 138 | 139 | /** 140 | * Folia异常:delay 不能<=0 141 | * 142 | * @param delay 延迟 143 | * @return delay 144 | * @since 1.0.1 145 | */ 146 | private static long getOneIfNotPositive(long delay) { 147 | return delay <= 0 ? 1L : delay; 148 | } 149 | 150 | } -------------------------------------------------------------------------------- /src/main/java/cn/handyplus/lib/adapter/HandyRunnable.java: -------------------------------------------------------------------------------- 1 | package cn.handyplus.lib.adapter; 2 | 3 | import io.papermc.paper.threadedregions.scheduler.ScheduledTask; 4 | import org.bukkit.Bukkit; 5 | import org.bukkit.scheduler.BukkitTask; 6 | import org.jetbrains.annotations.NotNull; 7 | 8 | /** 9 | * 抽象Runnable 10 | * 11 | * @author handy 12 | */ 13 | public abstract class HandyRunnable implements Runnable { 14 | private BukkitTask bukkitTask; 15 | private ScheduledTask scheduledTask; 16 | 17 | /** 18 | * 构造 19 | */ 20 | public HandyRunnable() { 21 | } 22 | 23 | /** 24 | * 取消 25 | * 26 | * @throws IllegalStateException IllegalStateException 27 | */ 28 | public synchronized void cancel() throws IllegalStateException { 29 | // 检查任务 30 | this.checkScheduled(); 31 | // 取消 32 | if (!HandySchedulerUtil.isFolia()) { 33 | Bukkit.getScheduler().cancelTask(this.bukkitTask.getTaskId()); 34 | return; 35 | } 36 | scheduledTask.cancel(); 37 | } 38 | 39 | /** 40 | * 检查是否存在任务 41 | */ 42 | private void checkScheduled() { 43 | if (HandySchedulerUtil.isFolia() && this.scheduledTask == null) { 44 | throw new IllegalStateException("Not scheduled yet"); 45 | } 46 | if (!HandySchedulerUtil.isFolia() && this.bukkitTask == null) { 47 | throw new IllegalStateException("Not scheduled yet"); 48 | } 49 | } 50 | 51 | /** 52 | * 设置任务 53 | * 54 | * @param task 任务 55 | * @return BukkitTask 56 | */ 57 | public @NotNull BukkitTask setupTask(@NotNull BukkitTask task) { 58 | this.bukkitTask = task; 59 | return task; 60 | } 61 | 62 | /** 63 | * 设置任务 64 | * 65 | * @param task 任务 66 | * @return ScheduledTask 67 | */ 68 | public @NotNull ScheduledTask setupTask(@NotNull ScheduledTask task) { 69 | this.scheduledTask = task; 70 | return task; 71 | } 72 | 73 | } -------------------------------------------------------------------------------- /src/main/java/cn/handyplus/lib/adapter/HandySchedulerUtil.java: -------------------------------------------------------------------------------- 1 | package cn.handyplus.lib.adapter; 2 | 3 | import org.bukkit.plugin.Plugin; 4 | 5 | /** 6 | * HandyLib调度器 7 | * 8 | * @author handy 9 | * @since 1.0.0 10 | */ 11 | public class HandySchedulerUtil { 12 | 13 | private HandySchedulerUtil() { 14 | 15 | } 16 | 17 | /** 18 | * 插件 19 | */ 20 | protected static Plugin BUKKIT_PLUGIN; 21 | 22 | /** 23 | * 服务器类型 24 | */ 25 | private static ServerTypeEnum SERVER_TYPE; 26 | 27 | /** 28 | * 初始化方法 29 | * 30 | * @param plugin 插件 31 | */ 32 | public static void init(Plugin plugin) { 33 | BUKKIT_PLUGIN = plugin; 34 | SERVER_TYPE = ServerTypeEnum.getServerType(); 35 | } 36 | 37 | /** 38 | * 同步 39 | * 40 | * @param task 方法 41 | */ 42 | public static void runTask(Runnable task) { 43 | if (isFolia()) { 44 | FoliaScheduler.runTask(task); 45 | return; 46 | } 47 | BukkitScheduler.runTask(task); 48 | } 49 | 50 | /** 51 | * 延迟同步 52 | * 53 | * @param task 方法 54 | * @param delay 延迟 55 | */ 56 | public static void runTaskLater(Runnable task, long delay) { 57 | if (isFolia()) { 58 | FoliaScheduler.runTaskLater(task, delay); 59 | return; 60 | } 61 | BukkitScheduler.runTaskLater(task, delay); 62 | } 63 | 64 | /** 65 | * 延迟同步 可取消 66 | * 67 | * @param task 方法 68 | * @param delay 延迟 69 | * @since 1.0.5 70 | */ 71 | public static void runTaskLater(HandyRunnable task, long delay) { 72 | if (isFolia()) { 73 | FoliaScheduler.runTaskLater(task, delay); 74 | return; 75 | } 76 | BukkitScheduler.runTaskLater(task, delay); 77 | } 78 | 79 | /** 80 | * 循环同步 81 | * 82 | * @param task 方法 83 | * @param delay 延迟 84 | * @param period 期间 85 | */ 86 | public static void runTaskTimer(Runnable task, long delay, long period) { 87 | if (isFolia()) { 88 | FoliaScheduler.runTaskTimer(task, delay, period); 89 | return; 90 | } 91 | BukkitScheduler.runTaskTimer(task, delay, period); 92 | } 93 | 94 | /** 95 | * 循环同步 可取消 96 | * 97 | * @param task 方法 98 | * @param delay 延迟 99 | * @param period 期间 100 | */ 101 | public static void runTaskTimer(HandyRunnable task, long delay, long period) { 102 | if (isFolia()) { 103 | FoliaScheduler.runTaskTimer(task, delay, period); 104 | return; 105 | } 106 | BukkitScheduler.runTaskTimer(task, delay, period); 107 | } 108 | 109 | /** 110 | * 异步 111 | * 112 | * @param task 方法 113 | */ 114 | public static void runTaskAsynchronously(Runnable task) { 115 | if (isFolia()) { 116 | FoliaScheduler.runTaskAsynchronously(task); 117 | return; 118 | } 119 | BukkitScheduler.runTaskAsynchronously(task); 120 | } 121 | 122 | /** 123 | * 延迟异步 124 | * 125 | * @param task 方法 126 | * @param delay 延迟 127 | */ 128 | public static void runTaskLaterAsynchronously(Runnable task, long delay) { 129 | if (isFolia()) { 130 | FoliaScheduler.runTaskLaterAsynchronously(task, delay); 131 | return; 132 | } 133 | BukkitScheduler.runTaskLaterAsynchronously(task, delay); 134 | } 135 | 136 | /** 137 | * 延迟异步 可取消 138 | * 139 | * @param task 方法 140 | * @param delay 延迟 141 | * @since 1.0.5 142 | */ 143 | public static void runTaskLaterAsynchronously(HandyRunnable task, long delay) { 144 | if (isFolia()) { 145 | FoliaScheduler.runTaskLaterAsynchronously(task, delay); 146 | return; 147 | } 148 | BukkitScheduler.runTaskLaterAsynchronously(task, delay); 149 | } 150 | 151 | /** 152 | * 循环异步 153 | * 154 | * @param task 方法 155 | * @param delay 延迟 156 | * @param period 期间 157 | */ 158 | public static void runTaskTimerAsynchronously(Runnable task, long delay, long period) { 159 | if (isFolia()) { 160 | FoliaScheduler.runTaskTimerAsynchronously(task, delay, period); 161 | return; 162 | } 163 | BukkitScheduler.runTaskTimerAsynchronously(task, delay, period); 164 | } 165 | 166 | /** 167 | * 循环异步 可取消 168 | * 169 | * @param task 方法 170 | * @param delay 延迟 171 | * @param period 期间 172 | */ 173 | public static void runTaskTimerAsynchronously(HandyRunnable task, long delay, long period) { 174 | if (isFolia()) { 175 | FoliaScheduler.runTaskTimerAsynchronously(task, delay, period); 176 | return; 177 | } 178 | BukkitScheduler.runTaskTimerAsynchronously(task, delay, period); 179 | } 180 | 181 | /** 182 | * 取消所有调度任务 183 | */ 184 | public static void cancelTask() { 185 | if (isFolia()) { 186 | FoliaScheduler.cancelTask(); 187 | } else { 188 | BukkitScheduler.cancelTask(); 189 | } 190 | } 191 | 192 | /** 193 | * 是否Folia 194 | * 195 | * @return true是 196 | */ 197 | public static boolean isFolia() { 198 | return ServerTypeEnum.FOLIA.equals(SERVER_TYPE); 199 | } 200 | 201 | } -------------------------------------------------------------------------------- /src/main/java/cn/handyplus/lib/adapter/ServerTypeEnum.java: -------------------------------------------------------------------------------- 1 | package cn.handyplus.lib.adapter; 2 | 3 | 4 | /** 5 | * 服务器类型 6 | * 7 | * @author handy 8 | * @since 1.0.0 9 | */ 10 | public enum ServerTypeEnum { 11 | 12 | /** 13 | * folia 14 | */ 15 | FOLIA("io.papermc.paper.threadedregions.RegionizedServerInitEvent"), 16 | /** 17 | * bukkit 18 | */ 19 | BUKKIT("org.bukkit.Bukkit"); 20 | 21 | private final String className; 22 | 23 | ServerTypeEnum(String className) { 24 | this.className = className; 25 | } 26 | 27 | static ServerTypeEnum getServerType() { 28 | try { 29 | Class.forName(FOLIA.className); 30 | return FOLIA; 31 | } catch (ClassNotFoundException e) { 32 | return BUKKIT; 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/cn/handyplus/lib/adapter/WorldSchedulerUtil.java: -------------------------------------------------------------------------------- 1 | package cn.handyplus.lib.adapter; 2 | 3 | import org.bukkit.Chunk; 4 | import org.bukkit.Location; 5 | 6 | /** 7 | * 世界调度工具 8 | * 9 | * @author handy 10 | * @since 1.1.3 11 | */ 12 | public class WorldSchedulerUtil { 13 | 14 | private WorldSchedulerUtil() { 15 | 16 | } 17 | 18 | /** 19 | * 异步加载对应坐标的区块 20 | * 21 | * @param location 坐标 22 | * @since 1.1.3 23 | */ 24 | public static void getChunkAtAsync(Location location) { 25 | if (location == null || location.getWorld() == null) { 26 | return; 27 | } 28 | if (HandySchedulerUtil.isFolia()) { 29 | location.getWorld().getChunkAtAsync(location); 30 | return; 31 | } 32 | Chunk chunk = location.getWorld().getChunkAt(location); 33 | if (!chunk.isLoaded()) { 34 | chunk.load(); 35 | } 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/test/java/cn/handyplus/lib/adapter/HandySchedulerUtilTest.java: -------------------------------------------------------------------------------- 1 | package cn.handyplus.lib.adapter; 2 | 3 | import org.bukkit.Location; 4 | import org.bukkit.entity.Player; 5 | import org.bukkit.inventory.Inventory; 6 | 7 | /** 8 | * 测试方法 9 | * 10 | * @author handy 11 | */ 12 | public class HandySchedulerUtilTest { 13 | 14 | // 同步方法 15 | public void test1(Player player) { 16 | HandySchedulerUtil.runTask(() -> { 17 | // 执行方法 18 | }); 19 | } 20 | 21 | // 异步方法 22 | public void test2() { 23 | HandySchedulerUtil.runTaskAsynchronously(() -> { 24 | // 执行方法 25 | }); 26 | } 27 | 28 | // 定时方法 29 | public void test3() { 30 | HandyRunnable handyRunnable = new HandyRunnable() { 31 | @Override 32 | public void run() { 33 | try { 34 | // 执行逻辑 35 | } catch (Exception ignored) { 36 | this.cancel(); 37 | } 38 | } 39 | }; 40 | HandySchedulerUtil.runTaskTimerAsynchronously(handyRunnable, 20 * 2, 20 * 60); 41 | } 42 | 43 | // TP方法 44 | public void test4(Player player, Location location) { 45 | PlayerSchedulerUtil.teleport(player, location); 46 | } 47 | 48 | // 执行命令 49 | public void test5(Player player, String command) { 50 | // 执行命令 51 | PlayerSchedulerUtil.performCommand(player, command); 52 | // 执行命令 指定同步 53 | PlayerSchedulerUtil.syncPerformCommand(player, command); 54 | // op身份执行命令 55 | PlayerSchedulerUtil.performOpCommand(player, command); 56 | // op身份执行命令 指定同步 57 | PlayerSchedulerUtil.syncPerformOpCommand(player, command); 58 | } 59 | 60 | // 打开gui 61 | public void test6(Player player, Inventory inv) { 62 | PlayerSchedulerUtil.syncOpenInventory(player, inv); 63 | } 64 | 65 | // 关闭gui 66 | public void test7(Player player, Inventory inv) { 67 | PlayerSchedulerUtil.syncOpenInventory(player, inv); 68 | } 69 | 70 | } 71 | --------------------------------------------------------------------------------