mirror of
https://github.com/GayPizzaSpecifications/concrete.git
synced 2025-08-04 05:31:34 +00:00
Add a concept of a concrete-library which has access to Bukkit but is not a plugin.
This commit is contained in:
@ -0,0 +1,3 @@
|
||||
plugins {
|
||||
id("lgbt.mystic.foundation.concrete-library")
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
package lgbt.mystic.foundation.conrete.sample.common
|
||||
|
||||
import org.bukkit.plugin.java.JavaPlugin
|
||||
|
||||
fun JavaPlugin.logOnEnable(name: String) = slF4JLogger.info("Enabled $name")
|
||||
fun JavaPlugin.logOnDisable(name: String) = slF4JLogger.info("Disabled $name")
|
@ -1,3 +1,7 @@
|
||||
plugins {
|
||||
id("lgbt.mystic.foundation.concrete-plugin")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(":bukkit-plugins:common-library"))
|
||||
}
|
||||
|
@ -1,13 +1,15 @@
|
||||
package lgbt.mystic.foundation.concrete.sample.goodbyeworld
|
||||
|
||||
import lgbt.mystic.foundation.conrete.sample.common.logOnDisable
|
||||
import lgbt.mystic.foundation.conrete.sample.common.logOnEnable
|
||||
import org.bukkit.plugin.java.JavaPlugin
|
||||
|
||||
class GoodbyeWorldPlugin : JavaPlugin() {
|
||||
override fun onEnable() {
|
||||
slF4JLogger.info("Enabled Goodbye World")
|
||||
logOnEnable("Goodbye World")
|
||||
}
|
||||
|
||||
override fun onDisable() {
|
||||
slF4JLogger.info("Disabled Goodbye World")
|
||||
logOnDisable("Goodbye World")
|
||||
}
|
||||
}
|
||||
|
@ -4,4 +4,5 @@ plugins {
|
||||
|
||||
dependencies {
|
||||
implementation(project(":other-library"))
|
||||
implementation(project(":bukkit-plugins:common-library"))
|
||||
}
|
||||
|
@ -1,14 +1,16 @@
|
||||
package lgbt.mystic.foundation.concrete.sample.helloworld
|
||||
|
||||
import lgbt.mystic.foundation.concrete.other.OtherLibrary
|
||||
import lgbt.mystic.foundation.conrete.sample.common.logOnDisable
|
||||
import lgbt.mystic.foundation.conrete.sample.common.logOnEnable
|
||||
import org.bukkit.plugin.java.JavaPlugin
|
||||
|
||||
class HelloWorldPlugin : JavaPlugin() {
|
||||
override fun onEnable() {
|
||||
slF4JLogger.info("Enabled Hello World (Constant is ${OtherLibrary.SOME_CONSTANT})")
|
||||
logOnEnable(OtherLibrary.HELLO_WORLD)
|
||||
}
|
||||
|
||||
override fun onDisable() {
|
||||
slF4JLogger.info("Disabled Hello World (Constant is ${OtherLibrary.SOME_CONSTANT})")
|
||||
logOnDisable(OtherLibrary.HELLO_WORLD)
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
package lgbt.mystic.foundation.concrete.other;
|
||||
|
||||
public class OtherLibrary {
|
||||
public static final String SOME_CONSTANT = "HelloWorld";
|
||||
public static final String HELLO_WORLD = "Hello World";
|
||||
}
|
||||
|
@ -2,4 +2,5 @@ includeBuild("../..")
|
||||
include(":bukkit-plugins")
|
||||
include(":bukkit-plugins:hello-world")
|
||||
include(":bukkit-plugins:goodbye-world")
|
||||
include(":bukkit-plugins:common-library")
|
||||
include(":other-library")
|
||||
|
Reference in New Issue
Block a user