61 lines
1.5 KiB
Kotlin
61 lines
1.5 KiB
Kotlin
package codes.som.hibiscus.features.visual
|
|
|
|
import codes.som.hibiscus.HibiscusLog
|
|
import codes.som.hibiscus.api.feature.Feature
|
|
import codes.som.hibiscus.api.feature.FeatureCategory
|
|
import codes.som.hibiscus.events.WorldCullingEvent
|
|
import codes.som.hibiscus.mc
|
|
|
|
class Xray : Feature("X-ray", FeatureCategory.VISUAL) {
|
|
val xrayBlocks = mutableSetOf(
|
|
"#minecraft:diamond_ores",
|
|
"#minecraft:iron_ores",
|
|
"#minecraft:portals",
|
|
"minecraft:obsidian",
|
|
"minecraft:furnace",
|
|
"minecraft:blast_furnace",
|
|
"minecraft:smoker",
|
|
"minecraft:dropper",
|
|
"minecraft:hopper",
|
|
"minecraft:barrel",
|
|
"minecraft:dispenser",
|
|
"minecraft:brewing_stand",
|
|
)
|
|
|
|
init {
|
|
on { event: WorldCullingEvent -> event.cancel() }
|
|
}
|
|
|
|
override fun onEnable() {
|
|
mc.worldRenderer.reload()
|
|
}
|
|
|
|
override fun onDisable() {
|
|
mc.worldRenderer.reload()
|
|
}
|
|
|
|
override fun createFeatureCommand() = super.createFeatureCommand().apply {
|
|
alias("xray")
|
|
|
|
// TODO: Database stuff
|
|
|
|
branch("add") { blockOrTag: String ->
|
|
xrayBlocks.add(blockOrTag)
|
|
}
|
|
|
|
branch("del") { blockOrTag: String ->
|
|
xrayBlocks.remove(blockOrTag)
|
|
}
|
|
|
|
branch("list") {
|
|
HibiscusLog.info(buildString {
|
|
append("X-Ray Blocks: ${xrayBlocks.size}")
|
|
for (block in xrayBlocks) {
|
|
append("\n - ")
|
|
append(block)
|
|
}
|
|
})
|
|
}
|
|
}
|
|
}
|