Skip to content

Commit

Permalink
chore(bukkit): enable checkPermissionOnQuit and `checkPermissionOnJ…
Browse files Browse the repository at this point in the history
…oin` by default in state feature
  • Loading branch information
Syrent committed Jun 5, 2024
1 parent 9f64c8e commit 2601065
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ interface User : BasicUser {
SayanVanishAPI.getInstance().addUser(this)
}

fun delete() {
SayanVanishAPI.getInstance().removeUser(uniqueId)
}

override fun toJson(): String {
val json = JsonObject()
json.addProperty("unique-id", uniqueId.toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class FeatureState(
@Configurable val remember: Boolean = true,
@Configurable val vanishOnJoin: Boolean = false,
@Configurable val reappearOnQuit: Boolean = false,
@Configurable val checkPermissionOnQuit: Boolean = false,
@Configurable val checkPermissionOnJoin: Boolean = false,
@Configurable val checkPermissionOnQuit: Boolean = true,
@Configurable val checkPermissionOnJoin: Boolean = true,
) : ListenedFeature("state") {

@EventHandler(priority = EventPriority.LOWEST)
Expand Down Expand Up @@ -54,7 +54,7 @@ class FeatureState(

if (checkPermissionOnJoin && !user.hasPermission(Permission.VANISH)) {
user.unVanish()
user.save()
user.delete()
return
}

Expand Down

0 comments on commit 2601065

Please sign in to comment.