/* * This file is a part of the SteamWar software. * * Copyright (C) 2024 SteamWar.de-Serverteam * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ package de.steamwar.tntleague import de.steamwar.message.Message import de.steamwar.tntleague.command.AcceptCommand import de.steamwar.tntleague.command.InviteCommand import de.steamwar.tntleague.command.LeaveCommand import de.steamwar.tntleague.command.RemoveCommand import de.steamwar.tntleague.events.GlobalListener import de.steamwar.tntleague.events.LobbyListener import de.steamwar.tntleague.game.TNTLeagueTeam import org.bukkit.plugin.java.JavaPlugin lateinit var plugin: TNTLeague lateinit var message: Message class TNTLeague : JavaPlugin() { init { plugin = this } override fun onEnable() { message = Message("de.steamwar.tntleague.TNTLeague", classLoader) server.pluginManager.registerEvents(LobbyListener, this) server.pluginManager.registerEvents(GlobalListener, this) logger.info("TNTLeague enabled") InviteCommand.register() AcceptCommand.register() RemoveCommand.register() LeaveCommand.register() } } fun String.colorByTeam(team: TNTLeagueTeam?) = when (team) { null -> "§7${this}" else -> "§${team.color}${this}" }