mirror of
https://github.com/carm-outsource/TimeReward.git
synced 2026-06-05 01:08:10 +08:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 871ba8d643 | |||
| 17d99fb1c0 | |||
| 28586bb086 | |||
| 184a0e480a | |||
| 7d0308afcd | |||
| 40b17ad9f2 | |||
| cb41485872 | |||
| f1e1c2606b |
@@ -18,21 +18,27 @@ jobs:
|
|||||||
- name: "Set up JDK"
|
- name: "Set up JDK"
|
||||||
uses: actions/setup-java@v2
|
uses: actions/setup-java@v2
|
||||||
with:
|
with:
|
||||||
java-version: '11'
|
java-version: '8'
|
||||||
distribution: 'adopt'
|
distribution: 'adopt'
|
||||||
cache: maven
|
cache: maven
|
||||||
server-id: github
|
server-id: github
|
||||||
server-username: MAVEN_USERNAME
|
server-username: MAVEN_USERNAME
|
||||||
server-password: MAVEN_TOKEN
|
server-password: MAVEN_TOKEN
|
||||||
|
|
||||||
- name: "Package"
|
- name: "Package"
|
||||||
run: mvn -B package --file pom.xml -Dmaven.javadoc.skip=true
|
run: mvn -B package --file pom.xml -Dmaven.javadoc.skip=true
|
||||||
env:
|
env:
|
||||||
MAVEN_USERNAME: ${{ github.repository_owner }}
|
MAVEN_USERNAME: ${{ github.repository_owner }}
|
||||||
MAVEN_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
MAVEN_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||||
- name: "Target Stage"
|
|
||||||
run: mkdir staging && cp asset/*.jar staging
|
- name: "Target Staging"
|
||||||
|
run: |
|
||||||
|
mkdir artifacts
|
||||||
|
cp -vrf target/ artifacts/target/
|
||||||
|
cp -vrf asset/*.jar artifacts
|
||||||
|
|
||||||
- name: "Upload artifact"
|
- name: "Upload artifact"
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: Artifact
|
name: Artifact
|
||||||
path: staging
|
path: artifacts
|
||||||
@@ -17,7 +17,7 @@ jobs:
|
|||||||
- name: "Set up JDK"
|
- name: "Set up JDK"
|
||||||
uses: actions/setup-java@v2
|
uses: actions/setup-java@v2
|
||||||
with:
|
with:
|
||||||
java-version: '11'
|
java-version: '8'
|
||||||
distribution: 'adopt'
|
distribution: 'adopt'
|
||||||
cache: maven
|
cache: maven
|
||||||
server-id: github
|
server-id: github
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
# TimeReward
|
# TimeReward
|
||||||
|
|
||||||
[](https://github.com/CarmJos/TimeReward/actions/workflows/maven.yml)
|
[](https://github.com/CarmJos/TimeReward/actions/workflows/maven.yml)
|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
在线时长自动领奖插件,通过指令发放奖励,基于EasyPlugin实现。
|
在线时长自动领奖插件,通过指令发放奖励,基于EasyPlugin实现。
|
||||||
|
|||||||
Binary file not shown.
@@ -5,7 +5,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>11</java.version>
|
<java.version>8</java.version>
|
||||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||||
<easyplugin.version>1.3.9</easyplugin.version>
|
<easyplugin.version>1.3.9</easyplugin.version>
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
<groupId>cc.carm.plugin</groupId>
|
<groupId>cc.carm.plugin</groupId>
|
||||||
<artifactId>timereward</artifactId>
|
<artifactId>timereward</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.2.1</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>TimeReward</name>
|
<name>TimeReward</name>
|
||||||
@@ -85,14 +85,6 @@
|
|||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>catserver</groupId>
|
|
||||||
<artifactId>CatServer</artifactId>
|
|
||||||
<version>1.12.2-b10faff</version>
|
|
||||||
<scope>system</scope>
|
|
||||||
<systemPath>${project.basedir}/lib/CatServerSRG-b10faff.jar</systemPath>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
<artifactId>spigot-api</artifactId>
|
<artifactId>spigot-api</artifactId>
|
||||||
@@ -133,6 +125,29 @@
|
|||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-clean-plugin</artifactId>
|
||||||
|
<version>2.5</version>
|
||||||
|
<configuration>
|
||||||
|
<filesets>
|
||||||
|
<fileset>
|
||||||
|
<directory>${project.basedir}/asset/</directory>
|
||||||
|
<useDefaultExcludes>true</useDefaultExcludes>
|
||||||
|
<includes>
|
||||||
|
<include>**/*</include>
|
||||||
|
</includes>
|
||||||
|
</fileset>
|
||||||
|
<fileset>
|
||||||
|
<directory>${project.basedir}/api-docs/</directory>
|
||||||
|
<useDefaultExcludes>true</useDefaultExcludes>
|
||||||
|
<includes>
|
||||||
|
<include>**/*</include>
|
||||||
|
</includes>
|
||||||
|
</fileset>
|
||||||
|
</filesets>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
@@ -188,6 +203,7 @@
|
|||||||
<configuration>
|
<configuration>
|
||||||
<finalName>${project.name}-${project.version}</finalName>
|
<finalName>${project.name}-${project.version}</finalName>
|
||||||
<outputDirectory>${project.basedir}/asset</outputDirectory>
|
<outputDirectory>${project.basedir}/asset</outputDirectory>
|
||||||
|
<minimizeJar>true</minimizeJar>
|
||||||
<relocations>
|
<relocations>
|
||||||
<relocation>
|
<relocation>
|
||||||
<pattern>cc.carm.lib</pattern>
|
<pattern>cc.carm.lib</pattern>
|
||||||
|
|||||||
@@ -14,8 +14,6 @@ public class PluginMessages extends MessagesRoot {
|
|||||||
"&8-&7 查看用户的在线时长信息与奖励领取情况。",
|
"&8-&7 查看用户的在线时长信息与奖励领取情况。",
|
||||||
"&8#&f list",
|
"&8#&f list",
|
||||||
"&8-&7 列出所有奖励与条件。",
|
"&8-&7 列出所有奖励与条件。",
|
||||||
"&8#&f info &6<奖励ID>",
|
|
||||||
"&8-&7 查看奖励详情。",
|
|
||||||
"&8#&f test &6<奖励ID>",
|
"&8#&f test &6<奖励ID>",
|
||||||
"&8-&7 测试执行奖励配置的指令。"
|
"&8-&7 测试执行奖励配置的指令。"
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package cc.carm.plugin.timereward.listener;
|
package cc.carm.plugin.timereward.listener;
|
||||||
|
|
||||||
|
import cc.carm.plugin.timereward.Main;
|
||||||
import cc.carm.plugin.timereward.TimeRewardAPI;
|
import cc.carm.plugin.timereward.TimeRewardAPI;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
@@ -10,12 +11,12 @@ public class UserListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onJoin(PlayerJoinEvent event) {
|
public void onJoin(PlayerJoinEvent event) {
|
||||||
TimeRewardAPI.getUserManager().load(event.getPlayer().getUniqueId());
|
Main.getInstance().getScheduler().runAsync(() -> TimeRewardAPI.getUserManager().load(event.getPlayer().getUniqueId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onQuit(PlayerQuitEvent event) {
|
public void onQuit(PlayerQuitEvent event) {
|
||||||
TimeRewardAPI.getUserManager().unload(event.getPlayer().getUniqueId());
|
Main.getInstance().getScheduler().runAsync(() -> TimeRewardAPI.getUserManager().unload(event.getPlayer().getUniqueId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public class JarResourceUtils {
|
|||||||
|
|
||||||
public static @Nullable String[] readResource(@Nullable InputStream resourceStream) {
|
public static @Nullable String[] readResource(@Nullable InputStream resourceStream) {
|
||||||
if (resourceStream == null) return null;
|
if (resourceStream == null) return null;
|
||||||
try (Scanner scanner = new Scanner(resourceStream, StandardCharsets.UTF_8)) {
|
try (Scanner scanner = new Scanner(resourceStream, StandardCharsets.UTF_8.name())) {
|
||||||
List<String> contents = new ArrayList<>();
|
List<String> contents = new ArrayList<>();
|
||||||
while (scanner.hasNextLine()) {
|
while (scanner.hasNextLine()) {
|
||||||
contents.add(scanner.nextLine());
|
contents.add(scanner.nextLine());
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ authors:
|
|||||||
softdepend:
|
softdepend:
|
||||||
- PlaceholderAPI
|
- PlaceholderAPI
|
||||||
|
|
||||||
|
api-version: 1.13
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
"TimeReward":
|
"TimeReward":
|
||||||
permission: "TimeReward.admin"
|
permission: "TimeReward.admin"
|
||||||
|
|||||||
Reference in New Issue
Block a user