Skip to content

Commit 9fd9315

Browse files
committed
Rename WorldGuard api module to common and reformat code
1 parent 375f0e3 commit 9fd9315

9 files changed

Lines changed: 17 additions & 22 deletions

File tree

bukkit/worldguard/api/src/main/kotlin/com/r4g3baby/simplescore/bukkit/worldguard/IWorldGuard.kt

Lines changed: 0 additions & 8 deletions
This file was deleted.

bukkit/worldguard/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
dependencies {
22
api(project(":core"))
3-
api(project(":bukkit:worldguard:api"))
43

54
implementation(project(":bukkit:worldguard:v6"))
65
implementation(project(":bukkit:worldguard:v7"))
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
kotlin {
2-
explicitApi()
3-
}
4-
51
dependencies {
62
compileOnly(libs.bukkit)
7-
}
3+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.r4g3baby.simplescore.bukkit.worldguard
2+
3+
import org.bukkit.Location
4+
import org.bukkit.entity.Player
5+
6+
interface IWorldGuard {
7+
fun getScoreboardFlag(player: Player, location: Location): List<String>
8+
}

bukkit/worldguard/src/main/kotlin/com/r4g3baby/simplescore/bukkit/worldguard/WorldGuardAPI.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ object WorldGuardAPI {
99
private lateinit var worldguard: IWorldGuard
1010

1111
fun initialize() {
12-
if (Bukkit.getPluginManager().getPlugin("WorldGuard") == null) return
12+
if (!Bukkit.getPluginManager().isPluginEnabled("WorldGuard")) return
1313

1414
if (classExists("com.sk89q.worldguard.WorldGuard")) {
1515
worldguard = com.r4g3baby.simplescore.bukkit.worldguard.v7.WorldGuardImpl()
@@ -24,4 +24,4 @@ object WorldGuardAPI {
2424
}
2525
return emptyList()
2626
}
27-
}
27+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
dependencies {
2-
api(project(":bukkit:worldguard:api"))
2+
api(project(":bukkit:worldguard:common"))
33

44
compileOnly(libs.bukkit)
55
compileOnly(libs.worldguardV6) {
66
exclude(module = "bukkit")
77
}
8-
}
8+
}

bukkit/worldguard/v6/src/main/kotlin/com/r4g3baby/simplescore/bukkit/worldguard/v6/WorldGuardImpl.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ class WorldGuardImpl : IWorldGuard {
3838
}
3939
return emptyList()
4040
}
41-
}
41+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
dependencies {
2-
api(project(":bukkit:worldguard:api"))
2+
api(project(":bukkit:worldguard:common"))
33

44
compileOnly(libs.bukkit)
55
compileOnly(libs.worldguardV7) {
66
exclude(module = "bukkit")
77
}
8-
}
8+
}

bukkit/worldguard/v7/src/main/kotlin/com/r4g3baby/simplescore/bukkit/worldguard/v7/WorldGuardImpl.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ class WorldGuardImpl : IWorldGuard {
4444
}
4545
return emptyList()
4646
}
47-
}
47+
}

0 commit comments

Comments
 (0)