Compare commits
8 Commits
d4ddc609b3
...
d5de97e110
Author | SHA1 | Date | |
---|---|---|---|
d5de97e110 | |||
99f24441bc | |||
1a1038ceec | |||
a73e43168c | |||
ffeef0b7ac | |||
c73269a37b | |||
d140aa6b6c | |||
14f0ff59c5 |
53
.gitea/workflows/build.yml
Normal file
53
.gitea/workflows/build.yml
Normal file
@ -0,0 +1,53 @@
|
||||
name: build
|
||||
on:
|
||||
pull_request: {}
|
||||
push: {}
|
||||
workflow_dispatch: {}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
env:
|
||||
RUN_NUMBER: ${{ gitea.run_number }}
|
||||
strategy:
|
||||
matrix:
|
||||
java: [ '21' ]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup JDK ${{ matrix.java }}
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'oracle'
|
||||
java-version: ${{ matrix.java }}
|
||||
cache: 'gradle'
|
||||
|
||||
- name: Loom Cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: "**/.gradle/loom-cache"
|
||||
key: "${{ runner.os }}-gradle-${{ hashFiles('**/libs.versions.*', '**/*.gradle*', '**/gradle-wrapper.properties') }}"
|
||||
restore-keys: "${{ runner.os }}-gradle-"
|
||||
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
with:
|
||||
gradle-home-cache-cleanup: true
|
||||
|
||||
- name: Validate Gradle Wrapper Integrity
|
||||
uses: gradle/wrapper-validation-action@v2
|
||||
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew clean build --no-daemon
|
||||
|
||||
- name: Make release
|
||||
uses: akkuman/gitea-release-action@v1
|
||||
with:
|
||||
name: DonatePay Integration ${{ matrix.java }}-${{ gitea.run_number }}
|
||||
tag_name: donpayintegplug-${{ matrix.java }}-${{ gitea.run_number }}
|
||||
md5sum: true
|
||||
sha256sum: true
|
||||
files: |-
|
||||
# *.jar
|
||||
build/libs/**
|
@ -2,8 +2,9 @@ plugins {
|
||||
id 'java'
|
||||
}
|
||||
|
||||
String buildNumber = System.getenv("RUN_NUMBER")
|
||||
group = 'ru.bitheaven'
|
||||
version = '1.0.0'
|
||||
version = (buildNumber != null ? buildNumber : "dev")
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@ -22,7 +23,7 @@ configurations {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("io.papermc.paper:paper-api:1.21.1-R0.1-SNAPSHOT")
|
||||
compileOnly("io.papermc.paper:paper-api:1.20-R0.1-SNAPSHOT")
|
||||
|
||||
implementation group: 'org.yaml', name: 'snakeyaml', version: '2.3'
|
||||
includedJars group: 'org.yaml', name: 'snakeyaml', version: '2.3'
|
||||
|
@ -22,13 +22,13 @@ public final class DonPayIntegPlug extends JavaPlugin {
|
||||
scheduler.runTaskTimer(this, () -> {
|
||||
thread.set(new DonateThread(this.getLogger()));
|
||||
thread.get().start();
|
||||
}, 1, 20 * 15);
|
||||
}, 1, 20 * ConfigHandler.load().getReqCooldown());
|
||||
scheduler.runTaskTimer(this, () -> {
|
||||
if (!commands.isEmpty()) {
|
||||
this.getServer().dispatchCommand(Bukkit.getConsoleSender(), commands.getFirst());
|
||||
commands.removeFirst();
|
||||
}
|
||||
}, 1, 20 * 2);
|
||||
}, 1, 20 * ConfigHandler.load().getCmdCooldown());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -52,7 +52,7 @@ public class DonateThread extends Thread {
|
||||
|
||||
lastDonate = objects.getInt("id");
|
||||
|
||||
DonPayIntegPlug.commands.addLast("title @a title \"" + msg.replace("{username}", objects.getJSONObject("vars").getString("name")) + "\"");
|
||||
DonPayIntegPlug.commands.addLast(ConfigHandler.load().getMessageCmd().replace("{message}", msg.replace("{username}", objects.getJSONObject("vars").getString("name"))));
|
||||
DonPayIntegPlug.commands.addLast(cmd.replace("{username}", objects.getJSONObject("vars").getString("name")));
|
||||
|
||||
logger.info(String.format("Exec donate #%d", lastDonate));
|
||||
|
@ -4,6 +4,9 @@ import java.util.List;
|
||||
|
||||
public class Config {
|
||||
private String donpayToken = "<YOUR_TOKEN>";
|
||||
private String messageCmd = "title @a title \"{message}\"";
|
||||
private int reqCooldown = 15;
|
||||
private int cmdCooldown = 2;
|
||||
private int lastDonate = 0;
|
||||
private List<Action> actions = List.of(new Action());
|
||||
|
||||
@ -31,4 +34,28 @@ public class Config {
|
||||
public void setActions(List<Action> actions) {
|
||||
this.actions = actions;
|
||||
}
|
||||
|
||||
public int getReqCooldown() {
|
||||
return reqCooldown;
|
||||
}
|
||||
|
||||
public void setReqCooldown(int reqCooldown) {
|
||||
this.reqCooldown = reqCooldown;
|
||||
}
|
||||
|
||||
public int getCmdCooldown() {
|
||||
return cmdCooldown;
|
||||
}
|
||||
|
||||
public void setCmdCooldown(int cmdCooldown) {
|
||||
this.cmdCooldown = cmdCooldown;
|
||||
}
|
||||
|
||||
public String getMessageCmd() {
|
||||
return messageCmd;
|
||||
}
|
||||
|
||||
public void setMessageCmd(String messageCmd) {
|
||||
this.messageCmd = messageCmd;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user