9
0
mirror of https://github.com/Xiao-MoMi/Custom-Crops.git synced 2025-12-21 07:59:16 +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 @Nullable
static CustomCropsAPI getInstance() { static CustomCropsAPI getInstance() {
Plugin plugin = Bukkit.getPluginManager().getPlugin("CustomCrops"); return CustomCropsPlugin.getInstance().getAPI();
if (plugin instanceof CustomCropsPlugin cc) {
return cc.getAPI();
}
return null;
} }
} }

View File

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

View File

@@ -57,9 +57,18 @@ allprojects {
} }
subprojects { subprojects {
tasks.processResources {
val props = mapOf("version" to version)
inputs.properties(props)
filteringCharset = "UTF-8"
filesMatching("*plugin.yml") {
expand(props)
}
}
tasks.withType<JavaCompile> { tasks.withType<JavaCompile> {
options.encoding = "UTF-8" options.encoding = "UTF-8"
options.release.set(17)
} }
tasks.shadowJar { tasks.shadowJar {
@@ -68,8 +77,17 @@ subprojects {
archiveFileName.set("CustomCrops-" + project.name + "-" + project.version + ".jar") archiveFileName.set("CustomCrops-" + project.name + "-" + project.version + ".jar")
} }
tasks.javadoc.configure { if ("api" == project.name) {
options.quiet() 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.proxyHost=127.0.0.1
#systemProp.socks.proxyPort=7890 #systemProp.socks.proxyPort=7890
#
#systemProp.http.proxyHost=127.0.0.1 #systemProp.http.proxyHost=127.0.0.1
#systemProp.http.proxyPort=7890 #systemProp.http.proxyPort=7890
#
#systemProp.https.proxyHost=127.0.0.1 #systemProp.https.proxyHost=127.0.0.1
#systemProp.https.proxyPort=7890 #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 @Override
public void onLoad(){ public void onLoad(){
plugin = this; plugin = this;
instance = this;
this.loadLibs(); this.loadLibs();
ProtectionLib.initialize(this); ProtectionLib.initialize(this);
} }