static in Kotlin

Discussion in 'Spigot Plugin Help' started by JunoMC, Mar 4, 2020.

  1. Code (Java):
    package xyz.junomc.powerpoints
    import org.bukkit.Bukkit
    import org.bukkit.plugin.java.JavaPlugin
    import xyz.junomc.powerpoints.listener.PlayerJoinListener
    import xyz.junomc.powerpoints.utils.FileUtils
    open class PowerPoints : JavaPlugin() {
        private lateinit var powerPoints: PowerPoints
        private lateinit var fileUtils: FileUtils
        override fun onEnable() {
            powerPoints = this
            Bukkit.getPluginManager().registerEvents(PlayerJoinListener(), powerPoints)
            fileUtils.create("config", "yml", true)
        }
        override fun onDisable() {}
       
        fun getInstance() : PowerPoints = powerPoints
        fun getFileUtils(): FileUtils {
            return fileUtils
        }
    }
    i want to change getInstance() like:
    Code (Java):
    public static PowerPoints() {
        return powerPoints;
    }
    please help me! (sorry my bad english)