Skip to content

Commit

Permalink
Update to paper plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
0ffz committed Oct 23, 2023
1 parent 8bfbacb commit 18cf616
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 34 deletions.
3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ allprojects {

dependencies {
val libs = rootProject.libs
implementation(libs.bundles.idofront.core)
compileOnly(libs.bundles.idofront.core)
testImplementation(libs.bundles.idofront.core)
}

tasks {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import org.bukkit.plugin.java.JavaPlugin
class GearyProductionPaperConfigModule(
override val plugin: JavaPlugin,
) : GearyPaperConfigModule {
override val configHolder = config<GearyPaperConfig>("config", plugin.dataFolder.toPath(), GearyPaperConfig(), mergeUpdates = true)
override val configHolder = config("config", plugin.dataFolder.toPath(), GearyPaperConfig())

override val config: GearyPaperConfig by configHolder
}
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,12 @@ internal class GearyCommands : IdofrontCommandExecutor(), TabCompleter {
).filter { it.startsWith(args[0]) } else args[0]) {
"mobs", "m" -> when (if (args.size == 2) return listOf("spawn", "remove", "locate", "info") else args[1]) {
"spawn", "s" -> if (args.size == 3) {
return gearyMobs.prefabs.getKeys().filterPrefabs(args[2]).toList()
} else if (args.size == 4) {
val min = args[3].toIntOrNull()?.coerceAtLeast(1) ?: 1
return (min - 1 until min + 100).map { it.toString() }
}
return gearyMobs.prefabs.getKeys().filterPrefabs(args[2]).toList()
} else if (args.size == 4) {
val min = args[3].toIntOrNull()?.coerceAtLeast(1) ?: 1
return (min - 1 until min + 100).map { it.toString() }
}

"remove", "rm", "info", "i", "locate" -> if (args.size == 3) {
val query = args[2].lowercase()
val parts = query.split("+")
Expand All @@ -185,6 +186,7 @@ internal class GearyCommands : IdofrontCommandExecutor(), TabCompleter {
}.take(20).map { "$withoutLast$it" }.toList()
}
}

"items" -> when (if (args.size == 2) return listOf("give") else args[1]) {
"give" -> if (args.size == 3) {
return gearyItems.prefabs.getKeys().filterPrefabs(args[2]).toList()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import com.mineinabyss.geary.serialization.dsl.serialization
import com.mineinabyss.geary.uuid.UUIDTracking
import com.mineinabyss.idofront.di.DI
import com.mineinabyss.idofront.messaging.logSuccess
import com.mineinabyss.idofront.platforms.Platforms
import com.mineinabyss.idofront.plugin.listeners
import com.mineinabyss.serialization.formats.YamlFormat
import okio.FileSystem
Expand All @@ -35,10 +34,6 @@ import kotlin.io.path.name


class GearyPluginImpl : GearyPlugin() {
override fun onLoad() {
Platforms.load(this, "mineinabyss")
}

override fun onEnable() {
saveDefaultConfig()

Expand Down
1 change: 0 additions & 1 deletion geary-papermc-plugin/src/main/resources/config.yml

This file was deleted.

20 changes: 20 additions & 0 deletions geary-papermc-plugin/src/main/resources/paper-plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Geary
version: ${plugin_version}
author: Offz
load: STARTUP
main: com.mineinabyss.geary.papermc.plugin.GearyPluginImpl
api-version: '1.20'

prefix: Geary
description: An Entity Component System written for Spigot

dependencies:
server:
MythicMobs:
required: false
load: BEFORE
join-classpath: true
Idofront:
required: true
load: BEFORE
join-classpath: true
17 changes: 0 additions & 17 deletions geary-papermc-plugin/src/main/resources/plugin.yml

This file was deleted.

2 changes: 1 addition & 1 deletion geary-papermc-tracking/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ repositories {
}
dependencies {
compileOnly(libs.minecraft.plugin.mythic.dist)
compileOnly(libs.idofront.nms)
implementation(gearyLibs.uuid)
implementation(libs.idofront.nms)
api(project(":geary-papermc-datastore"))
api(project(":geary-papermc-core"))
}
2 changes: 0 additions & 2 deletions geary-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,4 @@ dependencies {
implementation(project(":"))

testImplementation(libs.minecraft.mockbukkit)
// testImplementation(libs.minecraft.papermc)

}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kotlin.code.style=official
group=com.mineinabyss
version=0.26
idofrontVersion=0.19.14
idofrontVersion=0.20.1
gearyVersion=0.23-SNAPSHOT
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pluginManagement {
repositories {
gradlePluginPortal()
maven("https://repo.mineinabyss.com/releases")
maven("https://repo.mineinabyss.com/snapshots")
maven("https://repo.papermc.io/repository/maven-public/")
}
}
Expand Down

0 comments on commit 18cf616

Please sign in to comment.