Skip to content

Commit

Permalink
Merge pull request #118 from TheProgramSrc/patch/performance-improvem…
Browse files Browse the repository at this point in the history
…ents-and-fixes

Improved Performance & Fixes
  • Loading branch information
Im-Fran authored Sep 21, 2023
2 parents e30dea1 + 998de94 commit 946beee
Show file tree
Hide file tree
Showing 33 changed files with 614 additions and 1,051 deletions.
46 changes: 40 additions & 6 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

178 changes: 0 additions & 178 deletions CHANGELOG.md

This file was deleted.

14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,17 @@ _The best way to create a plugin_<br>

## Where is the documentation?
This can be found [here](https://docs.theprogramsrc.xyz/SimpleCoreAPI/) (it's a Dokka Resource), everything is documented through the Kotlin Docs (Similar to JavaDocs but for Kotlin :p )

## How does this work?
Ok, so we have multiple types of initializers for different software, Spigot, Bungee, Velocity and Standalone.

The Standalone system works by loading all jars under the modules/ folder into the current classpath.<br/>
The other kinds of software will use their embedded plugin system to avoid difficult tasks, like sorting modules to be loaded.

## Ok, and how do I use the Standalone mode?
In the Standalone system you will naturally shade SimpleCoreAPI and use the `xyz.theprogramsrc.simplecoreapi.standalone.StandaloneLoader` as your main class.<br/>
Later you will mark your main class with the `@EntryPoint` annotation. Then SimpleCoreAPI will load all modules, then execute the `@EntryPoint` class.

## How do I use the other modes?
Depending on the software you're using you'll need to mark SimpleCoreAPI and the modules you need as `dependency` (NOT `soft-dependency`) so the system will load all
modules and files you need before your plugin is loaded.
7 changes: 4 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ val env = project.rootProject.file(".env").let { file ->
if(file.exists()) file.readLines().filter { it.isNotBlank() && !it.startsWith("#") && it.split("=").size == 2 }.associate { it.split("=")[0] to it.split("=")[1] } else emptyMap()
}.toMutableMap().apply { putAll(System.getenv()) }

val projectVersion = env["VERSION"] ?: "0.6.3-SNAPSHOT"
val projectVersion = env["VERSION"] ?: "0.7.0-SNAPSHOT"

group = "xyz.theprogramsrc"
version = projectVersion.replaceFirst("v", "").replace("/", "")
Expand Down Expand Up @@ -114,7 +114,8 @@ tasks {
}

dokkaHtml {
outputDirectory.set(file(project.buildDir.absolutePath + "/dokka"))
outputDirectory.set(layout.buildDirectory.dir("dokka/"))

}
}

Expand Down Expand Up @@ -189,7 +190,7 @@ publishing {

if(env["ENV"] == "prod") {
nexusPublishing {
repositories {
this.repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,4 @@ class BungeeLoader: Plugin() {
SimpleCoreAPI(JavaLogger(this.logger))
}

override fun onEnable() {
SimpleCoreAPI.instance.moduleManager?.enableModules()
}

override fun onDisable() {
SimpleCoreAPI.instance.moduleManager?.disableModules()
}

}
Loading

0 comments on commit 946beee

Please sign in to comment.