Skip to content

Commit 48e0103

Browse files
authored
feat: adding log info for block config
1 parent 81a734b commit 48e0103

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/main/kotlin/dev/themeinerlp/attollo/Attollo.kt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,16 @@ open class Attollo : JavaPlugin() {
1313
}
1414

1515
override fun onEnable() {
16-
elevatorBlock = Material.matchMaterial(config.getString("elevatorBlock") ?: "DAYLIGHT_DETECTOR")
17-
?: Material.DAYLIGHT_DETECTOR
16+
val rawValue = config.getString("elevatorBlock") ?: "DAYLIGHT_DETECTOR"
17+
val material = Material.matchMaterial(rawValue)
18+
19+
if (material == null) {
20+
logger.warning("Invalid elevatorBlock material in config.yml: '$rawValue'. Defaulting to DAYLIGHT_DETECTOR.")
21+
}
22+
23+
elevatorBlock = material ?: Material.DAYLIGHT_DETECTOR
24+
logger.info("Using elevatorBlock: $elevatorBlock")
1825
server.pluginManager.registerEvents(AttolloListener(this), this)
1926
}
20-
}
27+
28+
}

0 commit comments

Comments
 (0)