Skip to content

Commit de702dd

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 772b525 + 50f3b07 commit de702dd

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/main/java/com/derongan/minecraft/deeperworld/config/DeeperConfig.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ object DeeperConfig : IdofrontConfig<DeeperConfig.Data>(deeperWorld, Data.serial
2020
val remountPacketDelay: TimeSpan = 40.ticks,
2121
val fall: FallDamageConfig = FallDamageConfig(),
2222
val time: TimeConfig = TimeConfig(),
23-
)
23+
) {
24+
val worlds = sections.map { it.world }.toSet()
25+
}
2426

2527
init {
2628
load()

src/main/java/com/derongan/minecraft/deeperworld/listeners/MovementListener.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,10 @@ object MovementListener : Listener {
5555
private fun onPlayerMoveInternal(player: Player, from: Location, to: Location) {
5656
val current = WorldManager.getSectionFor(player.location) ?: let {
5757
//damage players outside of sections
58-
if (!DeeperConfig.data.damageExcludedWorlds.contains(player.location.world)
59-
&& DeeperConfig.data.damageOutsideSections > 0.0
58+
if (DeeperConfig.data.damageOutsideSections > 0.0
59+
&& player.location.world !in DeeperConfig.data.damageExcludedWorlds
6060
&& (player.gameMode == GameMode.SURVIVAL || player.gameMode == GameMode.ADVENTURE)
61+
&& player.location.world in (DeeperConfig.data.worlds)
6162
) {
6263
player.damage(0.01) //give a damage effect
6364
player.health = (player.health - DeeperConfig.data.damageOutsideSections / 10)

0 commit comments

Comments
 (0)