Skip to content

Commit d50d73d

Browse files
committed
1.0.7
0 parents  commit d50d73d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+5041
-0
lines changed

.github/workflows/build.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Java
20+
uses: actions/setup-java@v4
21+
with:
22+
distribution: 'temurin'
23+
java-version: '21'
24+
25+
- name: Cache Maven dependencies
26+
uses: actions/cache@v4
27+
with:
28+
path: ~/.m2/repository
29+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
30+
restore-keys: |
31+
${{ runner.os }}-maven-
32+
33+
- name: Decode and set up Maven settings
34+
run: echo "${{ secrets.MAVEN_SETTINGS_BASE64 }}" | base64 --decode > $HOME/.m2/settings.xml
35+
36+
- name: Build with Maven
37+
run: mvn --batch-mode clean install
38+
39+
- name: Find built JAR
40+
id: find-jar
41+
run: |
42+
JAR_PATH=$(find target -name '*.jar' | grep -v 'original' | head -n 1)
43+
echo "JAR_PATH=$JAR_PATH" >> $GITHUB_ENV
44+
45+
- name: Upload JAR file
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: PlayerReturn Artifacts
49+
path: ${{ env.JAR_PATH }}
50+
retention-days: 7

.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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+
/.idea/

README-CH.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# PlayerReturn
2+
3+
-------------------------------------------------------------------------------
4+
5+
[**🌎English Documentation**](README.md)
6+
7+
-------------------------------------------------------------------------------
8+
9+
![适用核心](https://img.shields.io/badge/适用核心-Spigot-blue)
10+
![适用版本](https://img.shields.io/badge/适用版本-1.7.x--1.21.x-blue)
11+
![是否付费](https://img.shields.io/badge/是否付费-是-blue)
12+
![购买价格](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fafdian.com%2Fapi%2Fcreator%2Fget-plan-skus%3Fplan_id%3D03acf4a0495f11edb82352540025c377&query=%24.data.plan.show_price&suffix=CNY&label=%E8%B4%AD%E4%B9%B0%E4%BB%B7%E6%A0%BC)
13+
![最新版本](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fricedoc.handyplus.cn%2Fversion.json&query=%24.PlayerReturn&prefix=v&label=%E6%9C%80%E6%96%B0%E7%89%88%E6%9C%AC)
14+
15+
一款有点好用的玩家回归插件
16+
17+
如果本插件帮助到你,请帮忙右上角点个Star就对作者很大的支持了~
18+
19+
使用教程: [点击查看](https://ricedoc.handyplus.cn/wiki/PlayerReturn/README/)
20+
购买地址: [点击查看](https://afdian.com/item/03acf4a0495f11edb82352540025c377)
21+
22+
购买后可获得售后服务,作者会指导使用,如未购买请自行查阅wiki了解如何使用
23+
24+
## 贡献免费许可证
25+
26+
对本开源项目贡献代码、文档或其他资源,经审核通过后,您将获得免费的许可证。
27+
28+
## 贡献者
29+
30+
[![Contrib](https://contrib.rocks/image?repo=handy-git/PlayerReturn)](https://github.com/handy-git/PlayerReturn/graphs/contributors)
31+
32+
开发版本下载渠道:
33+
34+
[GITHUB ACTIONS](https://github.com/handy-git/PlayerReturn/actions)
35+
36+
## 使用统计
37+
38+
![使用统计](https://bstats.org/signatures/bukkit/PlayerReturn.svg)
39+
40+
## Star History
41+
42+
[![Star History Chart](https://api.star-history.com/svg?repos=handy-git/PlayerReturn&type=Date)](https://star-history.com/#handy-git/PlayerReturn&Date)
43+

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# PlayerReturn
2+
3+
-------------------------------------------------------------------------------
4+
5+
[**🌎中文文档**](README-CH.md)
6+
7+
-------------------------------------------------------------------------------
8+
9+
![Compatible Core](https://img.shields.io/badge/Compatible%20Core-Spigot-blue)
10+
![Compatible Versions](https://img.shields.io/badge/Compatible%20Versions-1.7.x--1.21.x-blue)
11+
![Paid Plugin](https://img.shields.io/badge/Paid%20Plugin-Yes-blue)
12+
![Purchase Price](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fafdian.com%2Fapi%2Fcreator%2Fget-plan-skus%3Fplan_id%3D03acf4a0495f11edb82352540025c377&query=%24.data.plan.show_price&suffix=CNY&label=Purchase%20Price)
13+
![Latest Version](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fricedoc.handyplus.cn%2Fversion.json&query=%24.PlayerReturn&prefix=v&label=Latest%20Version)
14+
15+
A quite useful player return plugin
16+
17+
If this plugin helps you, please give it a star in the top right corner - it means a lot to the author!
18+
19+
Usage Tutorial: [Click to View](https://ricedoc.handyplus.cn/wiki/PlayerReturn/README/)
20+
Purchase Address: [Click to View](https://afdian.com/item/03acf4a0495f11edb82352540025c377)
21+
22+
After purchase, you will receive after-sales service and guidance from the author. If you haven't purchased, please refer to the wiki for usage instructions.
23+
24+
## Contribute for Free License
25+
26+
Contribute code, documentation, or other resources to this open source project. After review and approval, you will receive a free license.
27+
28+
## Contributors
29+
30+
[![Contrib](https://contrib.rocks/image?repo=handy-git/PlayerReturn)](https://github.com/handy-git/PlayerReturn/graphs/contributors)
31+
32+
Development Version Download Channels:
33+
34+
[GITHUB ACTIONS](https://github.com/handy-git/PlayerReturn/actions)
35+
36+
## Usage Statistics
37+
38+
![Usage Statistics](https://bstats.org/signatures/bukkit/PlayerReturn.svg)
39+
40+
## Star History
41+
42+
[![Star History Chart](https://api.star-history.com/svg?repos=handy-git/PlayerReturn&type=Date)](https://star-history.com/#handy-git/PlayerReturn&Date)

pom.xml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>cn.handyplus.pln</groupId>
8+
<artifactId>PlayerReturn</artifactId>
9+
<version>1.0.7</version>
10+
<description>一个有点好用的玩家回归插件</description>
11+
12+
<properties>
13+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14+
<spigot-api.vesion>1.21.10-R0.1-SNAPSHOT</spigot-api.vesion>
15+
<lombok.version>1.18.38</lombok.version>
16+
<annotations.version>26.0.2</annotations.version>
17+
<HandyLib.version>3.28.2</HandyLib.version>
18+
<PlayerTask.verison>2.8.0</PlayerTask.verison>
19+
<authme.verison>5.7.0</authme.verison>
20+
<placeholderapi.version>2.11.6</placeholderapi.version>
21+
</properties>
22+
23+
<dependencies>
24+
<dependency>
25+
<groupId>cn.handyplus.lib</groupId>
26+
<artifactId>HandyLib</artifactId>
27+
<version>${HandyLib.version}</version>
28+
<optional>true</optional>
29+
</dependency>
30+
<dependency>
31+
<groupId>org.spigotmc</groupId>
32+
<artifactId>spigot-api</artifactId>
33+
<version>${spigot-api.vesion}</version>
34+
<scope>provided</scope>
35+
</dependency>
36+
<dependency>
37+
<groupId>me.clip</groupId>
38+
<artifactId>placeholderapi</artifactId>
39+
<version>${placeholderapi.version}</version>
40+
<scope>provided</scope>
41+
</dependency>
42+
<dependency>
43+
<groupId>org.projectlombok</groupId>
44+
<artifactId>lombok</artifactId>
45+
<version>${lombok.version}</version>
46+
<scope>provided</scope>
47+
</dependency>
48+
<dependency>
49+
<groupId>com.handy.playertask</groupId>
50+
<artifactId>PlayerTask</artifactId>
51+
<version>${PlayerTask.verison}</version>
52+
<scope>provided</scope>
53+
</dependency>
54+
<dependency>
55+
<groupId>fr.xephi</groupId>
56+
<artifactId>authme</artifactId>
57+
<version>${authme.verison}</version>
58+
<scope>provided</scope>
59+
</dependency>
60+
<dependency>
61+
<groupId>org.jetbrains</groupId>
62+
<artifactId>annotations</artifactId>
63+
<version>${annotations.version}</version>
64+
<scope>compile</scope>
65+
</dependency>
66+
</dependencies>
67+
68+
<build>
69+
<plugins>
70+
<!--指定1.8jdk-->
71+
<plugin>
72+
<groupId>org.apache.maven.plugins</groupId>
73+
<artifactId>maven-compiler-plugin</artifactId>
74+
<version>3.8.1</version>
75+
<configuration>
76+
<source>1.8</source>
77+
<target>1.8</target>
78+
</configuration>
79+
</plugin>
80+
<!--将依赖的jar包打包到当前jar包-->
81+
<plugin>
82+
<groupId>org.apache.maven.plugins</groupId>
83+
<artifactId>maven-shade-plugin</artifactId>
84+
<version>3.2.4</version>
85+
<configuration>
86+
<createDependencyReducedPom>false</createDependencyReducedPom>
87+
<artifactSet>
88+
<includes>
89+
<include>cn.handyplus.lib:*:*:*</include>
90+
</includes>
91+
</artifactSet>
92+
<relocations>
93+
<relocation>
94+
<pattern>cn.handyplus.lib</pattern>
95+
<shadedPattern>cn.handyplus.pln.lib</shadedPattern>
96+
</relocation>
97+
</relocations>
98+
</configuration>
99+
<executions>
100+
<execution>
101+
<phase>package</phase>
102+
<goals>
103+
<goal>shade</goal>
104+
</goals>
105+
</execution>
106+
</executions>
107+
</plugin>
108+
</plugins>
109+
</build>
110+
111+
</project>
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
package cn.handyplus.pln;
2+
3+
import cn.handyplus.lib.InitApi;
4+
import cn.handyplus.lib.constants.HookPluginEnum;
5+
import cn.handyplus.lib.util.BaseUtil;
6+
import cn.handyplus.lib.util.MessageUtil;
7+
import cn.handyplus.pln.hook.PlaceholderUtil;
8+
import cn.handyplus.pln.listener.PlayerTaskScheduleEventListener;
9+
import cn.handyplus.pln.util.ConfigUtil;
10+
import org.bukkit.ChatColor;
11+
import org.bukkit.plugin.java.JavaPlugin;
12+
13+
import java.util.ArrayList;
14+
import java.util.List;
15+
16+
/**
17+
* 主类
18+
*
19+
* @author handy
20+
*/
21+
public class PlayerReturn extends JavaPlugin {
22+
public static PlayerReturn INSTANCE;
23+
public static boolean USE_PAPI;
24+
public static boolean USE_TASK;
25+
public static boolean USE_AUTH_ME;
26+
27+
@Override
28+
public void onEnable() {
29+
INSTANCE = this;
30+
InitApi initApi = InitApi.getInstance(this);
31+
// 加载配置文件
32+
ConfigUtil.init();
33+
// 加载PlaceholderApi
34+
USE_PAPI = BaseUtil.hook(HookPluginEnum.PLACEHOLDER_API);
35+
if (USE_PAPI) {
36+
new PlaceholderUtil(this).register();
37+
}
38+
// 加载PlayerTask
39+
USE_TASK = BaseUtil.hook(HookPluginEnum.PLAYER_TASK);
40+
// 加载authme
41+
USE_AUTH_ME = BaseUtil.hook(HookPluginEnum.AUTH_ME);
42+
// 查询是否开启plk系统
43+
List<String> classList = new ArrayList<>();
44+
if (!USE_TASK) {
45+
classList.add(PlayerTaskScheduleEventListener.class.getName());
46+
}
47+
initApi.initCommand("cn.handyplus.pln.command")
48+
.initListener("cn.handyplus.pln.listener", classList)
49+
.initClickEvent("cn.handyplus.pln.listener.gui")
50+
.enableSql("cn.handyplus.pln.enter")
51+
.addMetrics(16638)
52+
.checkVersion();
53+
MessageUtil.sendConsoleMessage(ChatColor.GREEN + "已成功载入服务器!");
54+
MessageUtil.sendConsoleMessage(ChatColor.GREEN + "author:handy WIKI: https://ricedoc.handyplus.cn/wiki/PlayerReturn/README/");
55+
}
56+
57+
@Override
58+
public void onDisable() {
59+
InitApi.disable();
60+
}
61+
62+
}

0 commit comments

Comments
 (0)