-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
50b621b
commit d3d88f4
Showing
4 changed files
with
26 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 11 additions & 1 deletion
12
src/main/java/com/github/mori01231/lifecore/config/TownConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
package com.github.mori01231.lifecore.config | ||
|
||
import com.github.mori01231.lifecore.listener.TownyOutlawListener | ||
import kotlinx.serialization.Serializable | ||
import org.bukkit.Location | ||
|
||
@Serializable | ||
data class TownConfig( | ||
@JvmField var allowInvisibility: Boolean = true, | ||
@JvmField var allowSit: Boolean = true, | ||
) | ||
) { | ||
companion object { | ||
fun getTownConfigAt(lifeCoreConfig: LifeCoreConfig, location: Location): TownConfig? { | ||
val town = TownyOutlawListener.getTownAt(location) ?: return null | ||
val townName = TownyOutlawListener.getNameTownyObject(town) | ||
return lifeCoreConfig.townConfig.computeIfAbsent(townName) { TownConfig() } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters