Skip to content

Commit

Permalink
1.0.9
Browse files Browse the repository at this point in the history
修复bug
  • Loading branch information
YsGqHY committed Nov 3, 2024
1 parent 343fcfb commit dc00ad6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
group=kim.hhhhhy.regions
version=1.0.8
version=1.0.9
9 changes: 5 additions & 4 deletions src/main/kotlin/kim/hhhhhy/regions/data/AreaSettings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import org.bukkit.Location
import org.bukkit.entity.Player
import taboolib.module.navigation.BoundingBox
import taboolib.common.platform.function.console
import taboolib.common.platform.function.info
import taboolib.common.platform.function.submit
import taboolib.common.platform.service.PlatformExecutor
import taboolib.module.configuration.Config
Expand Down Expand Up @@ -57,9 +58,9 @@ data class AreaSettings(
}

private fun getAreas(location: Location): List<String> {
val x = location.x
val y = location.y
val z = location.z
val x = location.blockX
val y = location.blockY
val z = location.blockZ
val worldName = location.world?.name

return areasData
Expand All @@ -84,12 +85,12 @@ data class AreaSettings(
startTick(player, id)
}
private fun runLeaveAction(player: Player, id: String) {
stopTick(player, id)
val actions = areasData[id]?.actions?.leave
if (ConfigSettings.baffleCache.hasNext("${player.name}-Leave-$id").not()) {
return
}
actions?.evalKether(player)
stopTick(player, id)
}
private fun runTickAction(player: Player, id: String) {
val actions = areasData[id]?.actions?.tick
Expand Down
7 changes: 5 additions & 2 deletions src/main/kotlin/kim/hhhhhy/regions/listeners/AreaListener.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ import org.bukkit.event.player.PlayerMoveEvent
import org.bukkit.event.player.PlayerQuitEvent
import org.bukkit.event.player.PlayerTeleportEvent
import taboolib.common.platform.event.SubscribeEvent
import taboolib.platform.util.isBlockMovement
import taboolib.platform.util.isMovement

object AreaListener {
val playerSet = mutableSetOf<Pair<String, String>>()

@SubscribeEvent
fun onPlayerMove(e: PlayerMoveEvent) {
val from = e.from
val to = e.to ?: return
if (from.x == to.x && from.y == to.y && from.z == to.z) return
if (!e.isBlockMovement()) {
return
}
val player = e.player
AreaSettings.check(player, to)
}
Expand Down

0 comments on commit dc00ad6

Please sign in to comment.