mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 06:28:54 +00:00
It works kinda
This commit is contained in:
1 parent
ace3a496ef
commit
ecb80cef34
23 files changed
+407
-264
No files matched your search
+3
-1
@@ -75,4 +75,6 @@ gradle-app.setting
|
||||
!gradle-wrapper.jar
|
||||
|
||||
# Cache of project
|
||||
.gradletasknamecache
|
||||
.gradletasknamecache
|
||||
|
||||
**/run/
|
||||
@@ -1,51 +0,0 @@
|
||||
import net.draycia.carbon.*
|
||||
|
||||
|
||||
plugins {
|
||||
id "java-library"
|
||||
id "maven-publish"
|
||||
}
|
||||
|
||||
description "CarbonChat-API"
|
||||
|
||||
dependencies {
|
||||
api "org.checkerframework:checker-qual:${CHECKER_QUAL_VER}"
|
||||
|
||||
api "net.kyori:adventure-api:$ADVENTURE_VER"
|
||||
api "net.kyori:adventure-nbt:$ADVENTURE_VER"
|
||||
api "net.kyori:adventure-platform-api:$ADVENTURE_PLATFORM_VER"
|
||||
api "net.kyori:adventure-text-serializer-plain:$ADVENTURE_VER"
|
||||
api("net.kyori:adventure-text-serializer-gson:$ADVENTURE_VER") {
|
||||
exclude group: "com.google.code.gson"
|
||||
}
|
||||
api "net.kyori:adventure-text-serializer-legacy:$ADVENTURE_VER"
|
||||
api "net.kyori:adventure-text-minimessage:$MINIMESSAGE_VER}"
|
||||
|
||||
api("net.kyori:event-api:${vers["kyori-event-api"]}")
|
||||
api("net.kyori:registry:${vers["kyori-registry"]}")
|
||||
|
||||
api "cloud.commandframework:cloud-core:${vers["cloud"]}"
|
||||
|
||||
api "org.spongepowered:configurate-core:${vers["configurate"]}"
|
||||
|
||||
api "com.google.guava:guava:${vers["guava"]}"
|
||||
|
||||
compileOnlyApi "com.proximyst.moonshine:core:${vers["moonshine"]}"
|
||||
|
||||
compileOnlyApi "org.slf4j:slf4j-api:${vers["slf4j-api"]}"
|
||||
|
||||
compileOnlyApi "net.luckperms:api:${vers["luckperms-api"]}"
|
||||
}
|
||||
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
maven(MavenPublication) {
|
||||
groupId = "net.draycia"
|
||||
artifactId = description
|
||||
version = projectVersion // No hash
|
||||
|
||||
from components.java
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package net.draycia.carbon.api;
|
||||
|
||||
public interface CarbonChat {
|
||||
|
||||
}
|
||||
@@ -1,112 +0,0 @@
|
||||
import java.nio.charset.StandardCharsets
|
||||
|
||||
plugins {
|
||||
id 'com.github.johnrengelman.shadow' version '6.1.0'
|
||||
id 'net.minecrell.plugin-yml.bukkit' version '0.3.0'
|
||||
}
|
||||
|
||||
description = 'CarbonChat-Bukkit'
|
||||
|
||||
dependencies {
|
||||
implementation project(":CarbonChat-API")
|
||||
|
||||
// Server
|
||||
compileOnly "com.destroystokyo.paper:paper-api:${vers['paper-api']}"
|
||||
|
||||
// Adventure
|
||||
implementation "net.kyori:adventure-platform-bukkit:${vers['adventure-platform']}"
|
||||
implementation "net.kyori:adventure-text-serializer-bungeecord:${vers['adventure-platform']}"
|
||||
|
||||
// Config
|
||||
implementation "org.spongepowered:configurate-yaml:${vers['configurate']}"
|
||||
implementation "org.yaml:snakeyaml:${vers['snakeyaml']}"
|
||||
|
||||
// Commands
|
||||
implementation "cloud.commandframework:cloud-paper:${vers['cloud']}"
|
||||
|
||||
// SLF4J Binding
|
||||
implementation 'org.slf4j:slf4j-jdk14:1.7.28'
|
||||
|
||||
// Plugins
|
||||
compileOnly "me.clip:placeholderapi:${vers['placeholder-api']}"
|
||||
compileOnly "net.luckperms:api:${vers['luckperms-api']}"
|
||||
compileOnly "com.github.MilkBowl:VaultAPI:${vers['vault']}"
|
||||
}
|
||||
|
||||
// Generates plugin.yml automatically
|
||||
bukkit {
|
||||
name = "CarbonChat"
|
||||
version = rootProject.version
|
||||
main = 'net.draycia.carbon.bukkit.CarbonChatBukkit'
|
||||
apiVersion = '1.13'
|
||||
author = 'Draycia'
|
||||
depend = ['PlaceholderAPI', 'Vault', 'LuckPerms']
|
||||
loadBefore = ["Essentials"]
|
||||
permissions {
|
||||
'carbonchat.channels.global.see' {
|
||||
setDefault("TRUE")
|
||||
}
|
||||
|
||||
'carbonchat.channels.global.use' {
|
||||
setDefault("TRUE")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
checkstyle {
|
||||
def configRoot = new File(rootProject.projectDir, '.checkstyle')
|
||||
toolVersion = vers['checkstyle']
|
||||
configDirectory = configRoot
|
||||
configProperties = [basedir: configRoot.getAbsolutePath()]
|
||||
}
|
||||
|
||||
// Set output directory and encoding
|
||||
tasks.withType(JavaCompile) {
|
||||
options.encoding = StandardCharsets.UTF_8.name()
|
||||
options.compilerArgs += ['-Xlint:all']
|
||||
}
|
||||
|
||||
// Automatically shadowJar when building
|
||||
tasks.build.dependsOn tasks.shadowJar
|
||||
|
||||
// Output a single jar
|
||||
shadowJar {
|
||||
minimize()
|
||||
archiveFileName.set(project.description + "-" + project.property('projectVersion') + ".jar")
|
||||
destinationDirectory = rootProject.getBuildDir()
|
||||
relocate("org.yaml", "net.draycia.carbon.libs.org.yaml")
|
||||
relocate("net.kyori", "net.draycia.carbon.libs.kyori")
|
||||
relocate("org.spongepowered.configurate", "net.draycia.carbon.libs.configurate")
|
||||
relocate("org.checkerframework", "net.draycia.carbon.libs.checkerframework")
|
||||
relocate("org.reactivestreams", "net.draycia.carbon.libs.reactivestreams")
|
||||
relocate("org.codehaus", "net.draycia.carbon.libs.codehaus")
|
||||
relocate("org.slf4j", "net.draycia.carbon.libs.slf4j")
|
||||
relocate("io.leangen.geantyref", "net.draycia.carbon.libs.typereference")
|
||||
relocate("io.lettuce", "net.draycia.carbon.libs.lettuce")
|
||||
relocate("co.aikar.idb", "net.draycia.carbon.libs.idb")
|
||||
relocate("cloud.commandframework", "net.draycia.carbon.libs.cloud")
|
||||
relocate("com.zaxxer.hikari", "net.draycia.carbon.libs.hikari")
|
||||
relocate("com.typesafe.config", "net.draycia.carbon.libs.typesafe.config")
|
||||
relocate("com.google.common", "net.draycia.carbon.libs.google.common")
|
||||
relocate("reactor", "net.draycia.carbon.libs.reactor")
|
||||
relocate("javax.annotation", "net.draycia.carbon.libs.javax.annotation")
|
||||
}
|
||||
|
||||
jar {
|
||||
archiveFileName.set(project.description + "-" + project.property('projectVersion') + ".jar")
|
||||
}
|
||||
|
||||
//// Automatically relocate all shaded dependencies
|
||||
//import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
|
||||
//
|
||||
//task relocateShadowJar(type: ConfigureShadowRelocation) {
|
||||
// target = tasks.shadowJar
|
||||
// prefix = "net.draycia.carbon.libs" // Default value is "shadow"
|
||||
//}
|
||||
//
|
||||
//tasks.shadowJar.dependsOn tasks.relocateShadowJar
|
||||
|
||||
// Cleanup custom output directory on clean task
|
||||
clean.doFirst {
|
||||
delete "$rootDir/build/bundled"
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package net.draycia.carbon.bukkit;
|
||||
|
||||
import net.draycia.carbon.api.CarbonChat;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
@SuppressWarnings("initialization.fields.uninitialized")
|
||||
public final class CarbonChatBukkit extends JavaPlugin implements CarbonChat {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
plugins {
|
||||
id 'org.spongepowered.plugin' version '0.9.0'
|
||||
}
|
||||
|
||||
description = "CarbonChat-Sponge"
|
||||
|
||||
dependencies {
|
||||
implementation project(":CarbonChat-API")
|
||||
compileOnly 'org.spongepowered:spongeapi:8.0.0-SNAPSHOT'
|
||||
annotationProcessor 'org.spongepowered:spongeapi:7.3.0'
|
||||
implementation "cloud.commandframework:cloud-sponge:${vers['cloud']}"
|
||||
}
|
||||
|
||||
sponge.plugin.id = 'CarbonChat-Sponge8'
|
||||
@@ -1,23 +0,0 @@
|
||||
package net.draycia.carbon.sponge;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import net.draycia.carbon.api.CarbonChat;
|
||||
import org.slf4j.Logger;
|
||||
import org.spongepowered.api.event.game.state.GameStartedServerEvent;
|
||||
import org.spongepowered.api.event.Listener;
|
||||
import org.spongepowered.api.plugin.Plugin;
|
||||
|
||||
@Plugin(
|
||||
id = "carbonchat-sponge",
|
||||
name = "carbonchat"
|
||||
)
|
||||
public class CarbonChatSponge implements CarbonChat {
|
||||
|
||||
@Inject
|
||||
private Logger logger;
|
||||
|
||||
@Listener
|
||||
public void onServerStart(GameStartedServerEvent event) {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
import net.draycia.carbon.*
|
||||
|
||||
description="CarbonChat-API"
|
||||
|
||||
dependencies {
|
||||
api("org.checkerframework:checker-qual:${CHECKER_QUAL_VER}")
|
||||
|
||||
api("net.kyori:adventure-api:$ADVENTURE_VER")
|
||||
api("net.kyori:adventure-nbt:$ADVENTURE_VER")
|
||||
api("net.kyori:adventure-platform-api:$ADVENTURE_PLATFORM_VER")
|
||||
api("net.kyori:adventure-text-serializer-plain:$ADVENTURE_VER")
|
||||
api("net.kyori:adventure-text-serializer-gson:$ADVENTURE_VER") {
|
||||
//excludeGroup("com.google.code.gson")
|
||||
}
|
||||
api("net.kyori:adventure-text-serializer-legacy:$ADVENTURE_VER")
|
||||
api("net.kyori:adventure-text-minimessage:$MINIMESSAGE_VER")
|
||||
|
||||
api("net.kyori:event-api:$KYORI_EVENT_API_VER")
|
||||
api("net.kyori:registry:$KYORI_REGISTRY_VER")
|
||||
|
||||
api("cloud.commandframework:cloud-core:$CLOUD_VER")
|
||||
|
||||
api("org.spongepowered:configurate-core:$CONFIGURATE_VER")
|
||||
|
||||
api("com.google.guava:guava:$GUAVA_VER")
|
||||
|
||||
compileOnlyApi("com.proximyst.moonshine:core:$MOONSHINE_VER")
|
||||
|
||||
// Provided by Minecraft
|
||||
compileOnlyApi("org.apache.logging.log4j:log4j-api:2.11.2")
|
||||
|
||||
compileOnlyApi("net.luckperms:api:$LUCKPERMS_API_VER")
|
||||
}
|
||||
|
||||
|
||||
publishing {
|
||||
/*
|
||||
publications {
|
||||
maven(MavenPublication) {
|
||||
groupId = "net.draycia"
|
||||
artifactId = description
|
||||
version = projectVersion // No hash
|
||||
|
||||
from components.java
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package net.draycia.carbon.api;
|
||||
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
public interface CarbonChat {
|
||||
|
||||
@NonNull Logger logger();
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
+51
-37
@@ -1,62 +1,69 @@
|
||||
import org.checkerframework.gradle.plugin.CheckerFrameworkPlugin
|
||||
import net.draycia.carbon.*
|
||||
|
||||
//import org.checkerframework.gradle.plugin.CheckerFrameworkPlugin
|
||||
|
||||
plugins {
|
||||
java
|
||||
`java-library`
|
||||
`maven-publish`
|
||||
checkstyle
|
||||
id("org.checkerframework") version "0.5.12"
|
||||
id("com.github.johnrengelman.shadow") version "7.0.0" apply false
|
||||
//checkstyle
|
||||
//id("org.checkerframework") version "0.5.12"
|
||||
}
|
||||
|
||||
ext["github"] = "https://github.com/Hexaoxide/Carbon"
|
||||
|
||||
val projectVersion: String by project
|
||||
|
||||
allprojects {
|
||||
group = "net.draycia"
|
||||
description = "CarbonChat"
|
||||
version = project.property("projectVersion") // TODO: include git hash
|
||||
description = "CarbonChat - A modern chat plugin"
|
||||
version = projectVersion // todo: include git hash
|
||||
}
|
||||
|
||||
allprojects {
|
||||
configure<JavaPluginConvention> {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = sourceCompatibility
|
||||
disableAutoTargetJvm()
|
||||
}
|
||||
//configure<JavaPluginConvention> {
|
||||
// sourceCompatibility = JavaVersion.VERSION_11
|
||||
// targetCompatibility = sourceCompatibility
|
||||
// disableAutoTargetJvm()
|
||||
//}
|
||||
|
||||
checkstyle {
|
||||
toolVersion = "8.36.2"
|
||||
val configRoot = rootProject.projectDir
|
||||
configDirectory.set(configRoot)
|
||||
configProperties["basedir"] = configRoot.absolutePath
|
||||
}
|
||||
//checkstyle {
|
||||
// toolVersion = "8.36.2"
|
||||
// val configRoot = rootProject.projectDir
|
||||
// configDirectory.set(configRoot)
|
||||
// configProperties["basedir"] = configRoot.absolutePath
|
||||
//}
|
||||
}
|
||||
|
||||
subprojects {
|
||||
apply {
|
||||
plugin<JavaPlugin>()
|
||||
plugin<JavaLibraryPlugin>()
|
||||
plugin<MavenPublishPlugin>()
|
||||
plugin<CheckstylePlugin>()
|
||||
plugin<CheckerFrameworkPlugin>()
|
||||
}
|
||||
apply<JavaLibraryPlugin>()
|
||||
apply<MavenPublishPlugin>()
|
||||
//apply<CheckstylePlugin>()
|
||||
//apply<CheckerFrameworkPlugin>()
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
||||
maven { url = uri("https://nexus.proximyst.com/repository/maven-public/") }
|
||||
maven { url = uri("https://repo.maven.apache.org/maven2") }
|
||||
maven { url = uri("https://oss.sonatype.org/content/groups/public/") }
|
||||
maven { url = uri("https://maven.enginehub.org/repo/") }
|
||||
maven { url = uri("https://papermc.io/repo/repository/maven-public/") }
|
||||
maven { url = uri("https://repo.extendedclip.com/content/repositories/placeholderapi/") }
|
||||
maven { url = uri("https://jitpack.io") }
|
||||
maven { url = uri("https://dl.bintray.com/ichbinjoe/public/") }
|
||||
maven { url = uri("https://repo.codemc.org/repository/maven-public/") }
|
||||
maven { url = uri("https://repo.glaremasters.me/repository/public/") }
|
||||
maven { url = uri("https://repo.aikar.co/content/groups/aikar/") }
|
||||
maven("https://nexus.proximyst.com/repository/maven-public/")
|
||||
maven("https://repo.maven.apache.org/maven2")
|
||||
maven("https://oss.sonatype.org/content/groups/public/")
|
||||
//maven("https://repo.incendo.org/content/repositories/snapshots") // normal cloud snapshot repo
|
||||
maven("https://repo.jpenilla.xyz/snapshots/") { // temp cloud snapshot repo for sponge-8
|
||||
content {
|
||||
includeGroup("cloud.commandframework")
|
||||
}
|
||||
}
|
||||
maven("https://maven.enginehub.org/repo/")
|
||||
maven("https://papermc.io/repo/repository/maven-public/")
|
||||
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/")
|
||||
maven("https://jitpack.io")
|
||||
maven("https://dl.bintray.com/ichbinjoe/public/")
|
||||
maven("https://repo.codemc.org/repository/maven-public/")
|
||||
maven("https://repo.glaremasters.me/repository/public/")
|
||||
maven("https://repo.aikar.co/content/groups/aikar/")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
checkstyle("ca.stellardrift:stylecheck:$STYLECHECK_VER")
|
||||
//checkstyle("ca.stellardrift:stylecheck:$STYLECHECK_VER")
|
||||
}
|
||||
|
||||
// checkerFramework {
|
||||
@@ -65,3 +72,10 @@ subprojects {
|
||||
// ]
|
||||
// }
|
||||
}
|
||||
|
||||
tasks {
|
||||
// Root project has no useful artifacts
|
||||
withType<Jar> {
|
||||
onlyIf { false }
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,16 @@
|
||||
package net.draycia.carbon
|
||||
|
||||
// Carbon
|
||||
const val CARBON_VER = "1.0.0-SNAPSHOT"
|
||||
|
||||
// Misc
|
||||
const val CHECKSTYLE_VER = "8.34"
|
||||
const val CHECKER_QUAL_VER = "3.8.0"
|
||||
const val GUAVA_VER = "26.0-jre"
|
||||
const val SLF4J_API_VER = "1.7.25"
|
||||
const val STYLECHECK_VER = "0.1-SNAPSHOT"
|
||||
const val MOONSHINE_VER = "0.2.4-SNAPSHOT"
|
||||
const val CLOUD_VER = "1.2.0"
|
||||
const val CONFIGURATE_VER = "4.0.0"
|
||||
const val CLOUD_VER = "1.5.0-SNAPSHOT"
|
||||
const val CONFIGURATE_VER = "4.1.1-SNAPSHOT"
|
||||
|
||||
// Kyori
|
||||
const val ADVENTURE = "4.3.0"
|
||||
const val ADVENTURE_VER = "4.7.0"
|
||||
const val ADVENTURE_PLATFORM_VER = "4.0.0-SNAPSHOT"
|
||||
const val MINIMESSAGE_VER = "4.1.0-SNAPSHOT"
|
||||
const val KYORI_EVENT_API_VER = "3.0.0"
|
||||
@@ -27,7 +23,7 @@ const val HIKARI_VER = "2.4.1"
|
||||
const val GSON_VER = "2.8.0"
|
||||
|
||||
// Bukkit
|
||||
const val PAPER_API_VER = "1.16.4-R0.1-SNAPSHOT"
|
||||
const val PAPER_API_VER = "1.16.5-R0.1-SNAPSHOT"
|
||||
const val SNAKEYAML_VER = "1.27"
|
||||
|
||||
// Plugins
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
import net.draycia.carbon.*
|
||||
import java.nio.charset.StandardCharsets
|
||||
|
||||
plugins {
|
||||
id("com.github.johnrengelman.shadow")
|
||||
id("net.minecrell.plugin-yml.bukkit") version "0.4.0"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(projects.carbonchatApi)
|
||||
|
||||
// Server
|
||||
compileOnly("com.destroystokyo.paper:paper-api:$PAPER_API_VER")
|
||||
implementation("io.papermc", "paperlib", "1.0.6")
|
||||
|
||||
// Adventure
|
||||
implementation("net.kyori:adventure-platform-bukkit:$ADVENTURE_PLATFORM_VER")
|
||||
implementation("net.kyori:adventure-text-serializer-bungeecord:$ADVENTURE_PLATFORM_VER")
|
||||
|
||||
// Config
|
||||
implementation("org.spongepowered:configurate-yaml:$CONFIGURATE_VER")
|
||||
implementation("org.yaml:snakeyaml:$SNAKEYAML_VER")
|
||||
|
||||
// Commands
|
||||
implementation("cloud.commandframework:cloud-paper:$CLOUD_VER")
|
||||
|
||||
// Plugins
|
||||
compileOnly("me.clip:placeholderapi:$PLACEHOLDER_API_VER")
|
||||
compileOnly("net.luckperms:api:$LUCKPERMS_API_VER")
|
||||
compileOnly("com.github.MilkBowl:VaultAPI:$VAULT_VER")
|
||||
}
|
||||
|
||||
// Generates plugin.yml automatically
|
||||
bukkit {
|
||||
name = rootProject.name
|
||||
version = rootProject.version as String
|
||||
main = "net.draycia.carbon.bukkit.CarbonChatBukkit"
|
||||
apiVersion = "1.13"
|
||||
author = "Draycia"
|
||||
depend = listOf("PlaceholderAPI", "Vault", "LuckPerms")
|
||||
loadBefore = listOf("Essentials")
|
||||
website = rootProject.ext["github"] as String
|
||||
permissions {
|
||||
create("carbonchat.channels.global.see") {
|
||||
//default = "TRUE"
|
||||
}
|
||||
|
||||
create("carbonchat.channels.global.use") {
|
||||
//default = "TRUE"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
checkstyle {
|
||||
def configRoot = new File(rootProject.projectDir, '.checkstyle')
|
||||
toolVersion = vers['checkstyle']
|
||||
configDirectory = configRoot
|
||||
configProperties = [basedir: configRoot.getAbsolutePath()]
|
||||
}
|
||||
*/
|
||||
|
||||
// Set output directory and encoding
|
||||
tasks {
|
||||
withType<JavaCompile> {
|
||||
options.encoding = StandardCharsets.UTF_8.name()
|
||||
options.compilerArgs.addAll(listOf("-Xlint:all"))
|
||||
}
|
||||
}
|
||||
|
||||
// Automatically shadowJar when building
|
||||
tasks {
|
||||
build {
|
||||
dependsOn(shadowJar)
|
||||
}
|
||||
}
|
||||
|
||||
// Output a single jar
|
||||
tasks {
|
||||
shadowJar {
|
||||
minimize()
|
||||
archiveFileName.set(project.name + "-" + project.version + ".jar")
|
||||
doLast {
|
||||
val archive = archiveFile.get().asFile
|
||||
val libs = rootProject.buildDir.resolve("libs")
|
||||
libs.mkdirs()
|
||||
archive.copyTo(libs.resolve(archive.name), overwrite = true)
|
||||
}
|
||||
relocate("org.yaml", "net.draycia.carbon.libs.org.yaml")
|
||||
relocate("org.spongepowered.configurate", "net.draycia.carbon.libs.configurate")
|
||||
relocate("org.checkerframework", "net.draycia.carbon.libs.checkerframework")
|
||||
relocate("org.reactivestreams", "net.draycia.carbon.libs.reactivestreams")
|
||||
relocate("org.codehaus", "net.draycia.carbon.libs.codehaus")
|
||||
relocate("io.leangen.geantyref", "net.draycia.carbon.libs.typereference")
|
||||
relocate("io.lettuce", "net.draycia.carbon.libs.lettuce")
|
||||
relocate("co.aikar.idb", "net.draycia.carbon.libs.idb")
|
||||
relocate("cloud.commandframework", "net.draycia.carbon.libs.cloud")
|
||||
relocate("com.zaxxer.hikari", "net.draycia.carbon.libs.hikari")
|
||||
relocate("com.typesafe.config", "net.draycia.carbon.libs.typesafe.config")
|
||||
relocate("com.google.common", "net.draycia.carbon.libs.google.common")
|
||||
relocate("reactor", "net.draycia.carbon.libs.reactor")
|
||||
relocate("javax.annotation", "net.draycia.carbon.libs.javax.annotation")
|
||||
}
|
||||
}
|
||||
|
||||
//// Automatically relocate all shaded dependencies
|
||||
//import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
|
||||
//
|
||||
//task relocateShadowJar(type: ConfigureShadowRelocation) {
|
||||
// target = tasks.shadowJar
|
||||
// prefix = "net.draycia.carbon.libs" // Default value is "shadow"
|
||||
//}
|
||||
//
|
||||
//tasks.shadowJar.dependsOn tasks.relocateShadowJar
|
||||
|
||||
// Cleanup custom output directory on clean task
|
||||
tasks {
|
||||
clean {
|
||||
doFirst {
|
||||
delete("$rootDir/build/bundled")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package net.draycia.carbon.bukkit;
|
||||
|
||||
import io.papermc.lib.PaperLib;
|
||||
import net.draycia.carbon.api.CarbonChat;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.logging.Level;
|
||||
|
||||
public final class CarbonChatBukkit extends JavaPlugin implements CarbonChat {
|
||||
private final Logger logger = LogManager.getLogger("CarbonChat");
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
if (!PaperLib.isPaper()) {
|
||||
this.logger.error("*");
|
||||
this.logger.error("* CarbonChat makes extensive use of APIs added by Paper.");
|
||||
this.logger.error("* For this reason, CarbonChat is not compatible with Spigot or CraftBukkit servers.");
|
||||
this.logger.error("* Upgrade your server to Paper in order to use CarbonChat.");
|
||||
this.logger.error("*");
|
||||
PaperLib.suggestPaper(this, Level.SEVERE);
|
||||
Bukkit.getPluginManager().disablePlugin(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull Logger logger() {
|
||||
return this.logger;
|
||||
}
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,3 +1,7 @@
|
||||
# Project Properties
|
||||
projectVersion=1.0.0-SNAPSHOT
|
||||
|
||||
# Gradle Properties
|
||||
org.gradle.caching=true
|
||||
org.gradle.parallel=true
|
||||
org.gradle.daemon=true
|
||||
+30
-3
@@ -1,3 +1,30 @@
|
||||
include("CarbonChat-API")
|
||||
include("CarbonChat-Bukkit")
|
||||
include("CarbonChat-Sponge")
|
||||
enableFeaturePreview("VERSION_CATALOGS")
|
||||
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
|
||||
|
||||
pluginManagement {
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
maven("https://repo.stellardrift.ca/repository/snapshots/") // todo: polyglot-version-catalogs is not relased on the gradle plugin portal yet
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("ca.stellardrift.polyglot-version-catalogs") version "5.0.0-SNAPSHOT"
|
||||
}
|
||||
|
||||
rootProject.name = "CarbonChat"
|
||||
|
||||
setupSubproject("carbonchat-api") {
|
||||
projectDir = file("api")
|
||||
}
|
||||
setupSubproject("carbonchat-bukkit") {
|
||||
projectDir = file("bukkit")
|
||||
}
|
||||
setupSubproject("carbonchat-sponge") {
|
||||
projectDir = file("sponge")
|
||||
}
|
||||
|
||||
inline fun setupSubproject(name: String, block: ProjectDescriptor.() -> Unit) {
|
||||
include(name)
|
||||
project(":$name").apply(block)
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
import net.draycia.carbon.CLOUD_VER
|
||||
import java.util.Locale
|
||||
import org.spongepowered.plugin.metadata.PluginDependency
|
||||
import org.spongepowered.gradle.plugin.config.PluginLoaders
|
||||
|
||||
plugins {
|
||||
id("com.github.johnrengelman.shadow")
|
||||
id("org.spongepowered.gradle.plugin") version "1.0.3"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(projects.carbonchatApi)
|
||||
implementation("cloud.commandframework:cloud-sponge:$CLOUD_VER")
|
||||
}
|
||||
|
||||
tasks {
|
||||
runServer {
|
||||
classpath(shadowJar)
|
||||
}
|
||||
build {
|
||||
dependsOn(shadowJar)
|
||||
}
|
||||
shadowJar {
|
||||
minimize()
|
||||
archiveFileName.set(project.name + "-" + project.version + ".jar")
|
||||
doLast {
|
||||
val archive = archiveFile.get().asFile
|
||||
val libs = rootProject.buildDir.resolve("libs")
|
||||
libs.mkdirs()
|
||||
archive.copyTo(libs.resolve(archive.name), overwrite = true)
|
||||
}
|
||||
relocate("org.yaml", "net.draycia.carbon.libs.org.yaml")
|
||||
relocate("org.spongepowered.configurate", "net.draycia.carbon.libs.configurate")
|
||||
relocate("org.checkerframework", "net.draycia.carbon.libs.checkerframework")
|
||||
relocate("org.reactivestreams", "net.draycia.carbon.libs.reactivestreams")
|
||||
relocate("org.codehaus", "net.draycia.carbon.libs.codehaus")
|
||||
relocate("io.leangen.geantyref", "net.draycia.carbon.libs.typereference")
|
||||
relocate("io.lettuce", "net.draycia.carbon.libs.lettuce")
|
||||
relocate("co.aikar.idb", "net.draycia.carbon.libs.idb")
|
||||
relocate("cloud.commandframework", "net.draycia.carbon.libs.cloud")
|
||||
relocate("com.zaxxer.hikari", "net.draycia.carbon.libs.hikari")
|
||||
relocate("com.typesafe.config", "net.draycia.carbon.libs.typesafe.config")
|
||||
relocate("com.google.common", "net.draycia.carbon.libs.google.common")
|
||||
relocate("reactor", "net.draycia.carbon.libs.reactor")
|
||||
relocate("javax.annotation", "net.draycia.carbon.libs.javax.annotation")
|
||||
}
|
||||
}
|
||||
|
||||
sponge {
|
||||
apiVersion("8.0.0")
|
||||
plugin(rootProject.name.toLowerCase(Locale.ROOT)) {
|
||||
loader(PluginLoaders.JAVA_PLAIN)
|
||||
displayName(rootProject.name)
|
||||
mainClass("net.draycia.carbon.sponge.CarbonChatSponge")
|
||||
description(project.description)
|
||||
links {
|
||||
val url = rootProject.ext["github"] as String
|
||||
homepage(url)
|
||||
source(url)
|
||||
issues("$url/issues")
|
||||
}
|
||||
contributor("Vicarious") {
|
||||
description("Lead Developer")
|
||||
}
|
||||
dependency("spongeapi") {
|
||||
loadOrder(PluginDependency.LoadOrder.AFTER)
|
||||
optional(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
File renamed without changes.
@@ -0,0 +1,28 @@
|
||||
package net.draycia.carbon.sponge;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import net.draycia.carbon.api.CarbonChat;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.spongepowered.plugin.PluginContainer;
|
||||
import org.spongepowered.plugin.jvm.Plugin;
|
||||
|
||||
@Plugin("carbonchat")
|
||||
public class CarbonChatSponge implements CarbonChat {
|
||||
private final PluginContainer pluginContainer;
|
||||
private final Logger logger;
|
||||
|
||||
@Inject
|
||||
public CarbonChatSponge(
|
||||
final @NonNull PluginContainer pluginContainer,
|
||||
final @NonNull Logger logger
|
||||
) {
|
||||
this.pluginContainer = pluginContainer;
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull Logger logger() {
|
||||
return this.logger;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user