77 lines
2.6 KiB
Kotlin
77 lines
2.6 KiB
Kotlin
package cc.maxmc.blastingcrisis
|
|
|
|
import cc.maxmc.blastingcrisis.command.DebugCommand
|
|
import cc.maxmc.blastingcrisis.game.Game
|
|
import cc.maxmc.blastingcrisis.map.GameMap
|
|
import cc.maxmc.blastingcrisis.map.MapTeam
|
|
import cc.maxmc.blastingcrisis.misc.Area
|
|
import cc.maxmc.blastingcrisis.misc.GameManager
|
|
import cc.maxmc.blastingcrisis.misc.info
|
|
import cc.maxmc.blastingcrisis.misc.pluginScope
|
|
import kotlinx.coroutines.cancel
|
|
import org.bukkit.Bukkit
|
|
import org.bukkit.ChatColor
|
|
import org.bukkit.Location
|
|
import taboolib.common.env.RuntimeDependency
|
|
import taboolib.common.platform.Plugin
|
|
|
|
@RuntimeDependency(
|
|
"org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4",
|
|
)
|
|
object BlastingCrisis : Plugin() {
|
|
override fun onEnable() {
|
|
info("§a| §7Loading BlastingCrisis")
|
|
DebugCommand.debug("debugcmd")
|
|
info("§a| §7Loading BlastingCrisis")
|
|
createDefaultGame()
|
|
}
|
|
|
|
override fun onDisable() {
|
|
pluginScope.cancel()
|
|
}
|
|
|
|
private fun createDefaultGame() {
|
|
fun location(x: Int, y: Int, z: Int) =
|
|
Location(Bukkit.getWorlds().first(), x.toDouble(), y.toDouble(), z.toDouble())
|
|
|
|
val teamRed = MapTeam(
|
|
"红队",
|
|
ChatColor.RED,
|
|
location(0, 72, -44),
|
|
location(0, 72, -44),
|
|
location(-8, 73, -47),
|
|
Area(location(14, 72, -48), location(-13, 78, -34)),
|
|
Area(location(-13, 78, -33), location(13, 72, -33)),
|
|
Area(location(-13, 78, -32), location(13, 71, -1)),
|
|
Area(location(7, 72, -45), location(9, 74, -48)),
|
|
listOf(
|
|
Area(location(15, 72, -1), location(19, 78, -48)), Area(location(19, 78, -48), location(-15, 72, -1))
|
|
),
|
|
)
|
|
val teamGreen = MapTeam(
|
|
"绿队",
|
|
ChatColor.GREEN,
|
|
location(0, 72, 44),
|
|
location(0, 72, 44),
|
|
location(8, 73, 47),
|
|
Area(location(-14, 72, 48), location(13, 78, 34)),
|
|
Area(location(13, 78, 33), location(-13, 72, 33)),
|
|
Area(location(13, 78, 32), location(-13, 71, 1)),
|
|
Area(location(-7, 72, 45), location(-9, 74, 48)),
|
|
listOf(
|
|
Area(location(-15, 72, 1), location(-19, 78, 48)), Area(location(-19, 78, 48), location(15, 72, 1))
|
|
),
|
|
)
|
|
val map = GameMap(
|
|
"test",
|
|
Area(location(20, 70, -49), location(-20, 79, 49)),
|
|
Area(location(-13, 78, 0), location(13, 72, 0)),
|
|
listOf(
|
|
teamRed, teamGreen
|
|
),
|
|
1
|
|
)
|
|
DebugCommand.game = Game(map)
|
|
GameManager.currentGame = DebugCommand.game
|
|
}
|
|
} |