Skip to content

Commit 42f3b70

Browse files
committed
Incorrect permissions checking fixed.
Signed-off-by: Pavel Erokhin (MairwunNx) <MairwunNx@gmail.com>
1 parent 36ccbc2 commit 42f3b70

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main/kotlin/com/mairwunnx/projectessentials/core/EntryPoint.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ internal class EntryPoint : EssBase() {
3737
internal fun hasPermission(
3838
player: ServerPlayerEntity,
3939
node: String,
40-
opLevel: Int = 4
40+
opLevel: Int
4141
): Boolean = if (permissionsInstalled) {
4242
PermissionsAPI.hasPermission(player.name.string, node)
4343
} else {
44-
player.server.opPermissionLevel >= opLevel
44+
player.hasPermissionLevel(opLevel)
4545
}
4646
}
4747

src/main/kotlin/com/mairwunnx/projectessentials/core/JavaCompatibility.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ internal object JavaCompatibility {
77
fun hasPermission(
88
player: ServerPlayerEntity,
99
node: String,
10-
opLevel: Int = 4
10+
opLevel: Int
1111
): Boolean = if (EntryPoint.permissionsInstalled) {
1212
PermissionsAPI.hasPermission(player.name.string, node)
1313
} else {
14-
player.server.opPermissionLevel >= opLevel
14+
player.hasPermissionLevel(opLevel)
1515
}
1616
}

0 commit comments

Comments
 (0)