-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
158 additions
and
3 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
BukkitPlugin/src/main/kotlin/br/com/gamemods/kotlinfun/bukkit/KotlinPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package br.com.gamemods.kotlinfun.bukkit | ||
|
||
import com.avaje.ebean.EbeanServer | ||
import org.bukkit.command.Command | ||
import org.bukkit.command.CommandSender | ||
import org.bukkit.command.PluginCommand | ||
import org.bukkit.configuration.file.FileConfiguration | ||
import org.bukkit.generator.ChunkGenerator | ||
import org.bukkit.plugin.java.JavaPlugin | ||
import java.io.File | ||
import java.io.InputStream | ||
|
||
open class KotlinPlugin : JavaPlugin() { | ||
override fun getResource(filename: String): InputStream { | ||
return super.getResource(filename) | ||
} | ||
|
||
override fun onTabComplete(sender: CommandSender, command: Command, alias: String, vararg args: String): MutableList<String> { | ||
return super.onTabComplete(sender, command, alias, args) | ||
} | ||
|
||
override fun getDatabase(): EbeanServer { | ||
return super.getDatabase() ?: throw IllegalStateException("Plugin has changed database to true at runtime") | ||
} | ||
|
||
override fun getDatabaseClasses(): MutableList<Class<*>> { | ||
return super.getDatabaseClasses() | ||
} | ||
|
||
override fun getFile(): File { | ||
return super.getFile() | ||
} | ||
|
||
override fun onCommand(sender: CommandSender, command: Command, label: String, vararg args: String): Boolean { | ||
return false | ||
} | ||
|
||
override fun getConfig(): FileConfiguration { | ||
return super.getConfig() | ||
} | ||
|
||
override fun getDefaultWorldGenerator(worldName: String, id: String): ChunkGenerator { | ||
return super.getDefaultWorldGenerator(worldName, id) | ||
} | ||
|
||
override fun getCommand(name: String?): PluginCommand { | ||
return super.getCommand(name) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
BungeePlugin/src/main/kotlin/br/com/gamemods/kotlinfun/bungee/KotlinCommand.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package br.com.gamemods.kotlinfun.bungee | ||
|
||
import net.md_5.bungee.api.CommandSender | ||
import net.md_5.bungee.api.plugin.Command | ||
import net.md_5.bungee.api.plugin.TabExecutor | ||
|
||
abstract class KotlinCommand(name: String, permission: String? = null, vararg aliases: String) : Command(name, permission, *aliases), TabExecutor { | ||
abstract override fun execute(sender: CommandSender, vararg args: String) | ||
|
||
override fun onTabComplete(sender: CommandSender, vararg args: String): MutableIterable<String> { | ||
return mutableSetOf() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters