Skip to content

Commit

Permalink
修复实体爆炸时的debug信息错误显示的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
4o4E committed Jun 30, 2022
1 parent 30af84f commit ae55dbb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/kotlin/listener/ExplosionListener.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ object ExplosionListener : EListener(PL) {
@EventHandler
fun EntityExplodeEvent.onEvent() {
val world = entity.world.name
println(Config.each)
val map = Config.getEachOrGlobal(world) { explosion } ?: return
val type = entity.type.name
val config = map[type]
val location = entity.location
if (config == null || !config.enable) {
plugin.debug(
"debug_pass",
"explosion.debug_pass",
"entity" to type,
"world" to world,
"x" to location.blockX,
Expand All @@ -30,7 +31,7 @@ object ExplosionListener : EListener(PL) {
if (config.cancel) {
isCancelled = true
plugin.debug(
"debug_cancel",
"explosion.debug_cancel",
"entity" to type,
"world" to world,
"x" to location.blockX,
Expand All @@ -40,7 +41,7 @@ object ExplosionListener : EListener(PL) {
} else {
blockList().clear()
plugin.debug(
"debug_prevent",
"explosion.debug_prevent",
"entity" to type,
"world" to world,
"x" to location.blockX,
Expand Down

0 comments on commit ae55dbb

Please sign in to comment.