Compare commits
6 Commits
7c1499a48b
...
a2ca409583
Author | SHA1 | Date |
---|---|---|
Ryder Belserion | a2ca409583 | |
Ryder Belserion | c6fb04673e | |
Ryder Belserion | 71d086cb6e | |
Ryder Belserion | 31fb2920c9 | |
Ryder Belserion | 3a01b97d09 | |
Ryder Belserion | f307d436c6 |
|
@ -0,0 +1,6 @@
|
|||
## Fixes:
|
||||
* Fix an NPE with item builder
|
||||
|
||||
## Other:
|
||||
* [Feature Requests](https://github.com/Crazy-Crew/CrazyCrates/issues)
|
||||
* [Bug Reports](https://github.com/Crazy-Crew/CrazyCrates/issues)
|
|
@ -1,72 +1,38 @@
|
|||
import org.gradle.kotlin.dsl.support.uppercaseFirstChar
|
||||
|
||||
plugins {
|
||||
`java-library`
|
||||
id("root-plugin")
|
||||
}
|
||||
|
||||
tasks {
|
||||
assemble {
|
||||
val jarsDir = File("$rootDir/jars")
|
||||
if (jarsDir.exists()) jarsDir.delete()
|
||||
|
||||
jarsDir.mkdirs()
|
||||
doFirst {
|
||||
delete(jarsDir)
|
||||
|
||||
jarsDir.mkdirs()
|
||||
}
|
||||
|
||||
subprojects.forEach { project ->
|
||||
dependsOn(":${project.name}:build")
|
||||
|
||||
doLast {
|
||||
if (project.name == "common" || project.name == "api") return@doLast
|
||||
|
||||
copy {
|
||||
from(project.layout.buildDirectory.file("libs/${rootProject.name}-${rootProject.version}.jar"))
|
||||
into(jarsDir)
|
||||
runCatching {
|
||||
if (project.name != "api") {
|
||||
copy {
|
||||
from(project.layout.buildDirectory.file("libs/${rootProject.name}-${project.name.uppercaseFirstChar()}-${project.version}.jar"))
|
||||
into(jarsDir)
|
||||
}
|
||||
}
|
||||
}.onSuccess {
|
||||
// Delete to save space on jenkins.
|
||||
delete(project.layout.buildDirectory.get())
|
||||
delete(rootProject.layout.buildDirectory.get())
|
||||
}.onFailure {
|
||||
println("Failed to copy file out of build folder into jars directory: Likely does not exist.")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
subprojects {
|
||||
apply(plugin = "java-library")
|
||||
|
||||
repositories {
|
||||
maven("https://repo.crazycrew.us/snapshots/")
|
||||
|
||||
maven("https://repo.crazycrew.us/releases/")
|
||||
|
||||
maven("https://jitpack.io/")
|
||||
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
if (name == "paper") {
|
||||
repositories {
|
||||
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/")
|
||||
|
||||
maven("https://repo.codemc.io/repository/maven-public/")
|
||||
|
||||
maven("https://repo.triumphteam.dev/snapshots/")
|
||||
|
||||
maven("https://repo.oraxen.com/releases/")
|
||||
|
||||
flatDir { dirs("libs") }
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
compileJava {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
options.release.set(17)
|
||||
}
|
||||
|
||||
javadoc {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
}
|
||||
|
||||
processResources {
|
||||
filteringCharset = Charsets.UTF_8.name()
|
||||
}
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of("17"))
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
plugins {
|
||||
`kotlin-dsl`
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.paperweight)
|
||||
|
||||
implementation(libs.shadowjar)
|
||||
|
||||
implementation(libs.runpaper)
|
||||
|
||||
implementation(libs.modrinth)
|
||||
|
||||
implementation(libs.hangar)
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
dependencyResolutionManagement {
|
||||
repositories {
|
||||
maven("https://repo.papermc.io/repository/maven-public/")
|
||||
|
||||
gradlePluginPortal()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
versionCatalogs {
|
||||
create("libs") {
|
||||
from(files("../gradle/libs.versions.toml"))
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
import org.gradle.kotlin.dsl.support.uppercaseFirstChar
|
||||
|
||||
plugins {
|
||||
id("root-plugin")
|
||||
}
|
||||
|
||||
base {
|
||||
archivesName.set("${rootProject.name}-${project.name.uppercaseFirstChar()}")
|
||||
}
|
||||
|
||||
val mcVersion = rootProject.properties["minecraftVersion"] as String
|
||||
val fabricVersion = rootProject.properties["fabricVersion"] as String
|
||||
|
||||
project.version = if (System.getenv("BUILD_NUMBER") != null) "$fabricVersion-${System.getenv("BUILD_NUMBER")}" else fabricVersion
|
||||
|
||||
tasks {
|
||||
val isBeta: Boolean = rootProject.extra["isBeta"]?.toString()?.toBoolean() ?: false
|
||||
val type = if (isBeta) "Beta" else "Release"
|
||||
|
||||
modrinth {
|
||||
versionType.set(type.lowercase())
|
||||
|
||||
loaders.addAll("fabric")
|
||||
}
|
||||
}
|
|
@ -0,0 +1,86 @@
|
|||
import gradle.kotlin.dsl.accessors._3c6de1dd92ae3b7d1ad54590cc9ae150.base
|
||||
import io.papermc.hangarpublishplugin.model.Platforms
|
||||
import org.gradle.kotlin.dsl.support.uppercaseFirstChar
|
||||
|
||||
plugins {
|
||||
id("io.papermc.hangar-publish-plugin")
|
||||
|
||||
id("io.papermc.paperweight.userdev")
|
||||
|
||||
id("xyz.jpenilla.run-paper")
|
||||
|
||||
id("root-plugin")
|
||||
}
|
||||
|
||||
base {
|
||||
archivesName.set("${rootProject.name}-${project.name.uppercaseFirstChar()}")
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/")
|
||||
|
||||
maven("https://repo.papermc.io/repository/maven-public/")
|
||||
|
||||
maven("https://repo.codemc.io/repository/maven-public/")
|
||||
|
||||
maven("https://repo.triumphteam.dev/snapshots/")
|
||||
|
||||
maven("https://repo.oraxen.com/releases/")
|
||||
|
||||
flatDir { dirs("libs") }
|
||||
}
|
||||
|
||||
val mcVersion = rootProject.properties["minecraftVersion"] as String
|
||||
|
||||
project.version = if (System.getenv("BUILD_NUMBER") != null) "${rootProject.version}-${System.getenv("BUILD_NUMBER")}" else rootProject.version
|
||||
|
||||
dependencies {
|
||||
paperweight.paperDevBundle("$mcVersion-R0.1-SNAPSHOT")
|
||||
}
|
||||
|
||||
tasks {
|
||||
assemble {
|
||||
dependsOn(reobfJar)
|
||||
}
|
||||
|
||||
runServer {
|
||||
jvmArgs("-Dnet.kyori.ansi.colorLevel=truecolor")
|
||||
|
||||
defaultCharacterEncoding = Charsets.UTF_8.name()
|
||||
|
||||
minecraftVersion(mcVersion)
|
||||
}
|
||||
|
||||
val directory = File("$rootDir/jars")
|
||||
val isBeta: Boolean = rootProject.extra["isBeta"]?.toString()?.toBoolean() ?: false
|
||||
val type = if (isBeta) "Beta" else "Release"
|
||||
|
||||
// Publish to hangar.papermc.io.
|
||||
hangarPublish {
|
||||
publications.register("plugin") {
|
||||
version.set("${project.version}")
|
||||
|
||||
id.set(rootProject.name)
|
||||
|
||||
channel.set(type)
|
||||
|
||||
changelog.set(rootProject.file("CHANGELOG.md").readText())
|
||||
|
||||
apiKey.set(System.getenv("hangar_key"))
|
||||
|
||||
platforms {
|
||||
register(Platforms.PAPER) {
|
||||
jar.set(file("$directory/${rootProject.name}-${project.name.uppercaseFirstChar()}-${project.version}.jar"))
|
||||
|
||||
platformVersions.set(listOf(mcVersion))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
modrinth {
|
||||
versionType.set(type.lowercase())
|
||||
|
||||
loaders.addAll("paper", "purpur")
|
||||
}
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
import org.gradle.kotlin.dsl.support.uppercaseFirstChar
|
||||
|
||||
plugins {
|
||||
id("com.github.johnrengelman.shadow")
|
||||
|
||||
id("com.modrinth.minotaur")
|
||||
|
||||
`java-library`
|
||||
|
||||
`maven-publish`
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
|
||||
|
||||
maven("https://repo.codemc.org/repository/maven-public/")
|
||||
|
||||
maven("https://repo.crazycrew.us/snapshots/")
|
||||
|
||||
maven("https://repo.crazycrew.us/releases/")
|
||||
|
||||
maven("https://jitpack.io/")
|
||||
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
tasks {
|
||||
compileJava {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
options.release.set(17)
|
||||
}
|
||||
|
||||
javadoc {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
}
|
||||
|
||||
processResources {
|
||||
filteringCharset = Charsets.UTF_8.name()
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
archiveClassifier.set("")
|
||||
|
||||
exclude("META-INF/**")
|
||||
}
|
||||
|
||||
val directory = File("$rootDir/jars")
|
||||
val mcVersion = rootProject.properties["minecraftVersion"] as String
|
||||
|
||||
modrinth {
|
||||
autoAddDependsOn.set(false)
|
||||
|
||||
token.set(System.getenv("modrinth_token"))
|
||||
|
||||
projectId.set(rootProject.name.lowercase())
|
||||
|
||||
versionName.set("${rootProject.name} ${project.version}")
|
||||
|
||||
versionNumber.set("${project.version}")
|
||||
|
||||
uploadFile.set("$directory/${rootProject.name}-${project.name.uppercaseFirstChar()}-${project.version}.jar")
|
||||
|
||||
gameVersions.add(mcVersion)
|
||||
|
||||
changelog.set(rootProject.file("CHANGELOG.md").readText())
|
||||
}
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of("17"))
|
||||
}
|
|
@ -1,11 +1,13 @@
|
|||
plugins {
|
||||
id("root-plugin")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnlyApi(libs.bundles.adventure)
|
||||
|
||||
compileOnly(libs.clusterApi5)
|
||||
compileOnly(libs.cluster.api)
|
||||
|
||||
implementation(libs.cloud.core)
|
||||
|
||||
api(libs.configme) {
|
||||
api(libs.config.me) {
|
||||
exclude(group = "org.yaml", module = "snakeyaml")
|
||||
}
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
package com.badbones69.crazyauctions.common.api.engine.command;
|
||||
|
||||
import cloud.commandframework.Command;
|
||||
import cloud.commandframework.CommandManager;
|
||||
import cloud.commandframework.meta.CommandMeta;
|
||||
import com.ryderbelserion.cluster.utils.AdvUtils;
|
||||
import net.kyori.adventure.audience.Audience;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public abstract class CommandHandler {
|
||||
|
||||
@NotNull
|
||||
public abstract CommandManager<Audience> getManager();
|
||||
|
||||
@NotNull
|
||||
public abstract Command.Builder<Audience> getRoot();
|
||||
|
||||
//TODO() Add exception handler.
|
||||
//TODO() Add register command method
|
||||
//TODO() Add a method to get the root command.
|
||||
//TODO() Add a way to expose registered commands, args etc for the help generator.
|
||||
|
||||
private Command.Builder<Audience> root() {
|
||||
return getManager().commandBuilder("crazyauctions", "ca", "ah")
|
||||
.permission("crazyauctions.access")
|
||||
.meta(CommandMeta.DESCRIPTION, "CrazyAuctions command. /crazyauctions help")
|
||||
.handler(context -> {
|
||||
context.getSender().sendMessage(AdvUtils.parse("<red>This is the base command."));
|
||||
|
||||
//TODO() Add some type of wrapper to open gui's
|
||||
});
|
||||
}
|
||||
|
||||
protected void register() {
|
||||
|
||||
}
|
||||
}
|
|
@ -6,6 +6,7 @@ public enum StorageType {
|
|||
|
||||
H2("H2", "h2"),
|
||||
YAML("YAML", "yml"),
|
||||
SQLITE("SQLite", "sqlite"),
|
||||
MARIADB("MariaDB", "mariadb");
|
||||
|
||||
private final String name;
|
||||
|
|
|
@ -7,7 +7,7 @@ website = https://modrinth.com/plugin/crazyauctions
|
|||
sources = https://github.com/Crazy-Crew/CrazyAuctions
|
||||
issues = https://github.com/Crazy-Crew/CrazyAuctions/issues
|
||||
|
||||
group = us.crazycrew.crazyauctions
|
||||
group = com.ryderbelserion.crazyauctions
|
||||
description = Auction off items in style.
|
||||
version = 2.0
|
||||
apiVersion = 1.20
|
||||
|
|
|
@ -1,9 +1,14 @@
|
|||
[versions]
|
||||
configurate4 = "4.1.2"
|
||||
adventure4 = "4.14.0"
|
||||
cluster5 = "6.3"
|
||||
|
||||
cloud1 = "1.8.4"
|
||||
cluster_version = "6.3"
|
||||
|
||||
shadow_version = "8.1.1"
|
||||
paperweight_version = "1.5.9"
|
||||
runpaper_version = "2.2.3"
|
||||
|
||||
modrinth_version = "2.8.7"
|
||||
hangar_version = "0.1.2"
|
||||
|
||||
[plugins]
|
||||
hangar = { id = "io.papermc.hangar-publish-plugin", version = "0.1.0" }
|
||||
|
@ -17,28 +22,25 @@ shadowjar = { id = "com.github.johnrengelman.shadow", version = "8.1.1" }
|
|||
adventure4 = { module = "net.kyori:adventure-api", version.ref = "adventure4" }
|
||||
minimessage4 = { module = "net.kyori:adventure-text-minimessage", version.ref = "adventure4" }
|
||||
|
||||
cluster5 = { module = "com.ryderbelserion.cluster:paper", version.ref = "cluster5" }
|
||||
clusterApi5 = { module = "com.ryderbelserion.cluster:api", version.ref = "cluster5" }
|
||||
cluster_paper = { module = "com.ryderbelserion.cluster:paper", version.ref = "cluster_version" }
|
||||
cluster_api = { module = "com.ryderbelserion.cluster:api", version.ref = "cluster_version" }
|
||||
|
||||
configurate4-yaml = { module = "org.spongepowered:configurate-yaml", version.ref = "configurate4" }
|
||||
jorel_bukkit = { module = "dev.jorel:commandapi-bukkit-shade", version = "9.4.0-SNAPSHOT" }
|
||||
|
||||
config_me = { module = "ch.jalu:configme", version = "1.4.1" }
|
||||
|
||||
hikari = { module = "com.zaxxer:HikariCP", version = "5.1.0" }
|
||||
|
||||
vault = { module = "com.github.MilkBowl:VaultAPI", version = "1.7.1" }
|
||||
|
||||
configme = { module = "ch.jalu:configme", version = "1.4.1" }
|
||||
|
||||
bstats = { module = "org.bstats:bstats-bukkit", version = "3.0.2" }
|
||||
|
||||
commandApi = { module = "dev.jorel:commandapi-bukkit-shade", version = "9.3.0" }
|
||||
paperweight = { module = "io.papermc.paperweight:paperweight-userdev", version.ref = "paperweight_version" }
|
||||
shadowjar = { module = "com.github.johnrengelman:shadow", version.ref = "shadow_version" }
|
||||
runpaper = { module = "xyz.jpenilla:run-task", version.ref = "runpaper_version" }
|
||||
|
||||
cloud-core = { module = "cloud.commandframework:cloud-core", version.ref = "cloud1" }
|
||||
cloud-paper = { module = "cloud.commandframework:cloud-paper", version.ref = "cloud1" }
|
||||
cloud-fabric = { module = "cloud.commandframework:cloud-fabric", version.ref = "cloud1" }
|
||||
cloud-sponge = { module = "cloud.commandframework:cloud-sponge7", version.ref = "cloud1" }
|
||||
cloud-extras = { module = "cloud.commandframework:cloud-minecraft-extras", version.ref = "cloud1" }
|
||||
hangar = { module = "io.papermc:hangar-publish-plugin", version.ref = "hangar_version" }
|
||||
modrinth = { module = "com.modrinth.minotaur:Minotaur", version.ref = "modrinth_version" }
|
||||
|
||||
[bundles]
|
||||
adventure = ["adventure4", "minimessage4"]
|
||||
|
||||
configurate4 = ["configurate4-yaml"]
|
||||
adventure = ["adventure4", "minimessage4"]
|
Binary file not shown.
|
@ -4,4 +4,4 @@ distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
|
|||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
zipStorePath=wrapper/dists
|
||||
|
|
|
@ -1,20 +1,5 @@
|
|||
import io.papermc.hangarpublishplugin.model.Platforms
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.paperweight)
|
||||
alias(libs.plugins.shadowjar)
|
||||
|
||||
alias(libs.plugins.modrinth)
|
||||
|
||||
alias(libs.plugins.runpaper)
|
||||
|
||||
alias(libs.plugins.hangar)
|
||||
|
||||
`maven-publish`
|
||||
}
|
||||
|
||||
base {
|
||||
archivesName.set(rootProject.name)
|
||||
id("paper-plugin")
|
||||
}
|
||||
|
||||
val mcVersion = rootProject.properties["minecraftVersion"] as String
|
||||
|
@ -22,122 +7,20 @@ val mcVersion = rootProject.properties["minecraftVersion"] as String
|
|||
dependencies {
|
||||
api(project(":common"))
|
||||
|
||||
implementation(libs.cluster.paper)
|
||||
|
||||
implementation(libs.jorel.bukkit)
|
||||
|
||||
implementation(libs.bstats)
|
||||
|
||||
implementation(libs.cluster5)
|
||||
|
||||
implementation(libs.commandApi)
|
||||
|
||||
compileOnly(libs.vault)
|
||||
|
||||
paperweightDevelopmentBundle("io.papermc.paper:dev-bundle:$mcVersion-R0.1-SNAPSHOT")
|
||||
compileOnly(fileTree("libs").include("*.jar"))
|
||||
}
|
||||
|
||||
val isBeta: Boolean get() = rootProject.extra["isBeta"]?.toString()?.toBoolean() ?: false
|
||||
val type = if (isBeta) "Beta" else "Release"
|
||||
|
||||
val description = """
|
||||
## Changes:
|
||||
* data.yml has been renamed to users.yml
|
||||
|
||||
## Other:
|
||||
* [Feature Requests](https://github.com/Crazy-Crew/${rootProject.name}/issues)
|
||||
* [Bug Reports](https://github.com/Crazy-Crew/${rootProject.name}/issues)
|
||||
"""
|
||||
|
||||
val file = project.layout.buildDirectory.file("libs/${rootProject.name}-${rootProject.version}.jar").get().asFile
|
||||
|
||||
val component: SoftwareComponent = components["java"]
|
||||
|
||||
tasks {
|
||||
// Publish to hangar.papermc.io.
|
||||
hangarPublish {
|
||||
publications.register("plugin") {
|
||||
version.set("$rootProject.version")
|
||||
|
||||
id.set(rootProject.name)
|
||||
|
||||
channel.set(type)
|
||||
|
||||
changelog.set(description)
|
||||
|
||||
apiKey.set(System.getenv("hangar_key"))
|
||||
|
||||
platforms {
|
||||
register(Platforms.PAPER) {
|
||||
jar.set(file)
|
||||
|
||||
platformVersions.set(listOf(mcVersion))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Publish to modrinth.
|
||||
modrinth {
|
||||
autoAddDependsOn.set(false)
|
||||
|
||||
token.set(System.getenv("modrinth_token"))
|
||||
|
||||
projectId.set(rootProject.name.lowercase())
|
||||
|
||||
versionName.set("${rootProject.name} ${rootProject.version}")
|
||||
|
||||
versionNumber.set("${rootProject.version}")
|
||||
|
||||
versionType.set(type.lowercase())
|
||||
|
||||
uploadFile.set(file)
|
||||
|
||||
gameVersions.add(mcVersion)
|
||||
|
||||
changelog.set(description)
|
||||
|
||||
loaders.addAll("paper", "purpur")
|
||||
}
|
||||
|
||||
// Runs a test server.
|
||||
runServer {
|
||||
jvmArgs("-Dnet.kyori.ansi.colorLevel=truecolor")
|
||||
|
||||
minecraftVersion(mcVersion)
|
||||
}
|
||||
|
||||
// Assembles the plugin.
|
||||
assemble {
|
||||
dependsOn(reobfJar)
|
||||
}
|
||||
|
||||
publishing {
|
||||
repositories {
|
||||
maven {
|
||||
url = uri("https://repo.crazycrew.us/releases/")
|
||||
|
||||
credentials {
|
||||
this.username = System.getenv("GRADLE_USERNAME")
|
||||
this.password = System.getenv("GRADLE_PASSWORD")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
publications {
|
||||
create<MavenPublication>("maven") {
|
||||
groupId = rootProject.group.toString()
|
||||
artifactId = "${rootProject.name.lowercase()}-${project.name.lowercase()}-api"
|
||||
version = rootProject.version.toString()
|
||||
|
||||
from(component)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
archiveClassifier.set("")
|
||||
|
||||
exclude("META-INF/**")
|
||||
|
||||
listOf(
|
||||
"org.bstats", "com.ryderbelserion.cluster", "dev.jorel.commandapi"
|
||||
//"com.ryderbelserion.cluster.paper",
|
||||
"org.bstats"
|
||||
).forEach {
|
||||
relocate(it, "libs.$it")
|
||||
}
|
||||
|
@ -145,13 +28,13 @@ tasks {
|
|||
|
||||
processResources {
|
||||
val properties = hashMapOf(
|
||||
"name" to rootProject.name,
|
||||
"version" to rootProject.version,
|
||||
"group" to rootProject.group,
|
||||
"description" to rootProject.description,
|
||||
"apiVersion" to rootProject.properties["apiVersion"],
|
||||
"authors" to rootProject.properties["authors"],
|
||||
"website" to rootProject.properties["website"]
|
||||
"name" to rootProject.name,
|
||||
"version" to project.version,
|
||||
"group" to rootProject.group,
|
||||
"description" to rootProject.description,
|
||||
"apiVersion" to rootProject.properties["apiVersion"],
|
||||
"authors" to rootProject.properties["authors"],
|
||||
"website" to rootProject.properties["website"]
|
||||
)
|
||||
|
||||
inputs.properties(properties)
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
package us.crazycrew.crazyauctions.api.builders;
|
||||
|
||||
import com.ryderbelserion.cluster.utils.AdvUtils;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.InventoryHolder;
|
||||
import org.bukkit.inventory.InventoryView;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import us.crazycrew.crazyauctions.CrazyAuctions;
|
||||
|
||||
@SuppressWarnings("ALL")
|
||||
public abstract class InventoryBuilder implements InventoryHolder {
|
||||
|
||||
@NotNull
|
||||
protected final CrazyAuctions plugin = CrazyAuctions.get();
|
||||
|
||||
private final Inventory inventory;
|
||||
private final Player player;
|
||||
private String title;
|
||||
private int size;
|
||||
private int page;
|
||||
|
||||
public InventoryBuilder(Player player, int size, String title) {
|
||||
this.title = title;
|
||||
this.size = size;
|
||||
|
||||
this.player = player;
|
||||
|
||||
this.inventory = this.plugin.getServer().createInventory(this, this.size, AdvUtils.parse(this.title));
|
||||
}
|
||||
|
||||
public abstract InventoryBuilder build();
|
||||
|
||||
public void size(int size) {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
public int getSize() {
|
||||
return this.size;
|
||||
}
|
||||
|
||||
public void setPage(int page) {
|
||||
this.page = page;
|
||||
}
|
||||
|
||||
public int getPage() {
|
||||
return this.page;
|
||||
}
|
||||
|
||||
public void title(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public boolean contains(String message) {
|
||||
return this.title.contains(message);
|
||||
}
|
||||
|
||||
public Player getPlayer() {
|
||||
return this.player;
|
||||
}
|
||||
|
||||
public InventoryView getInventoryView() {
|
||||
return getPlayer().getOpenInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public Inventory getInventory() {
|
||||
return this.inventory;
|
||||
}
|
||||
}
|
|
@ -23,11 +23,11 @@ public class StorageFactory {
|
|||
|
||||
private StorageImpl create(StorageType type) {
|
||||
switch (type) {
|
||||
case H2 -> {
|
||||
case SQLITE -> {
|
||||
return new SqlStorage(new SqliteConnection(new File(CrazyAuctions.get().getDataFolder(), "users.db")));
|
||||
}
|
||||
|
||||
case MARIADB -> {
|
||||
case MARIADB, H2 -> {
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ public class CommandManager {
|
|||
public void load() {
|
||||
// Create command config.
|
||||
CommandAPIBukkitConfig config = new CommandAPIBukkitConfig(this.plugin);
|
||||
config.shouldHookPaperReload(true).silentLogs(!CrazyAuctionsPlugin.get().getConfig().getProperty(Config.verbose_logging));
|
||||
config.shouldHookPaperReload(true).silentLogs(!CrazyAuctionsPlugin.get().getConfig().getProperty(Config.verbose_logging)).setNamespace("crazycrates");
|
||||
|
||||
// Load command api.
|
||||
CommandAPI.onLoad(config);
|
||||
|
|
Loading…
Reference in New Issue