9
0
mirror of https://github.com/Xiao-MoMi/Custom-Crops.git synced 2025-12-19 15:09:25 +00:00

test build

This commit is contained in:
XiaoMoMi
2023-10-26 22:06:06 +08:00
parent e4d5c4a9c4
commit 0d4f6a686d
6 changed files with 32 additions and 9 deletions

View File

@@ -130,10 +130,6 @@ public interface CustomCropsAPI {
*/
@Nullable
static CustomCropsAPI getInstance() {
Plugin plugin = Bukkit.getPluginManager().getPlugin("CustomCrops");
if (plugin instanceof CustomCropsPlugin cc) {
return cc.getAPI();
}
return null;
return CustomCropsPlugin.getInstance().getAPI();
}
}

View File

@@ -21,9 +21,15 @@ import org.bukkit.plugin.java.JavaPlugin;
public abstract class CustomCropsPlugin extends JavaPlugin {
protected static CustomCropsPlugin instance;
protected CustomCropsAPI customCropsAPI;
public CustomCropsAPI getAPI() {
return customCropsAPI;
}
public static CustomCropsPlugin getInstance() {
return instance;
}
}

View File

@@ -57,9 +57,18 @@ allprojects {
}
subprojects {
tasks.processResources {
val props = mapOf("version" to version)
inputs.properties(props)
filteringCharset = "UTF-8"
filesMatching("*plugin.yml") {
expand(props)
}
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
options.release.set(17)
}
tasks.shadowJar {
@@ -68,8 +77,17 @@ subprojects {
archiveFileName.set("CustomCrops-" + project.name + "-" + project.version + ".jar")
}
tasks.javadoc.configure {
options.quiet()
if ("api" == project.name) {
publishing {
publications {
create<MavenPublication>("mavenJava") {
groupId = "net.momirealms"
artifactId = "CustomCrops"
version = rootProject.version.toString()
artifact(tasks.shadowJar)
}
}
}
}
}

View File

@@ -1,8 +1,8 @@
#systemProp.socks.proxyHost=127.0.0.1
#systemProp.socks.proxyPort=7890
#
#systemProp.http.proxyHost=127.0.0.1
#systemProp.http.proxyPort=7890
#
#systemProp.https.proxyHost=127.0.0.1
#systemProp.https.proxyPort=7890

2
jitpack.yml Normal file
View File

@@ -0,0 +1,2 @@
jdk:
- openjdk17

View File

@@ -80,6 +80,7 @@ public final class CustomCrops extends CustomCropsPlugin {
@Override
public void onLoad(){
plugin = this;
instance = this;
this.loadLibs();
ProtectionLib.initialize(this);
}