This file contains hidden or 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
package br.com.devsrsouza.kotlinbukkitapi.controllers | |
import kotlinx.coroutines.delay | |
import kotlinx.coroutines.runBlocking | |
import java.util.concurrent.ConcurrentHashMap | |
import kotlin.coroutines.CoroutineContext | |
import kotlin.coroutines.coroutineContext | |
import kotlin.system.measureTimeMillis | |
fun main() { |
This file contains hidden or 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
fun <T : CommandSender> Executor<T>.argumentExecutorBuilder( | |
posIndex: Int = 1, | |
label: String | |
) = Executor( | |
sender, | |
[email protected] + " " + label, | |
runCatching { args.sliceArray(posIndex..args.size) }.getOrDefault((emptyArray())), | |
command | |
) |
This file contains hidden or 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
import br.com.devsrsouza.kotlinbukkitapi.server.extensions.itemFromByteArray | |
import br.com.devsrsouza.kotlinbukkitapi.server.extensions.toByteArray | |
import org.bukkit.inventory.ItemStack | |
import org.jetbrains.exposed.dao.Entity | |
import org.jetbrains.exposed.sql.Column | |
import java.sql.Blob | |
import javax.sql.rowset.serial.SerialBlob | |
import kotlin.reflect.KProperty | |
fun Entity<*>.itemStack(column: Column<Blob>) = ItemStackExposedDelegate(column) |
This file contains hidden or 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
/** | |
* @author DevSrSouza | |
* github: https://github.com/DevSrSouza | |
* twitter: https://twitter.com/DevSrSouza | |
*/ | |
val BLOCK_NAMES_PT_BR = mapOf( | |
MaterialData(Material.ACACIA_FENCE, 0) to "Cerca de Acácia", | |
MaterialData(Material.ACACIA_FENCE_GATE, 0) to "Portão de Acácia", | |
MaterialData(Material.ACTIVATOR_RAIL, 0) to "Trilho Ativador", |
This file contains hidden or 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
class Root<E>(var value: E, var root: Root<E>?, var left: Root<E>? = null, var right: Root<E>? = null) | |
enum class Ordem { V, R, L } | |
interface IBinaryTree<E> { | |
val size: Int | |
fun insert(element: E) |
This file contains hidden or 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
import br.com.devsrsouza.kotlinbukkitapi.attributestorage.setStorageData | |
import br.com.devsrsouza.kotlinbukkitapi.dsl.item.meta | |
import org.bukkit.inventory.ItemStack | |
import org.bukkit.inventory.meta.ItemMeta | |
import java.util.* | |
class EnchantmentCustom( | |
val uuid: UUID, | |
val name: String, | |
val maxLevel: Int |
This file contains hidden or 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
plugins { | |
id 'java' | |
id 'org.jetbrains.kotlin.jvm' version '1.3.20' | |
id 'com.github.johnrengelman.shadow' version '4.0.3' | |
} | |
group = pluginGroup | |
version = pluginVersion | |
sourceCompatibility = 1.8 |
This file contains hidden or 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
import com.google.gson.JsonArray | |
import com.google.gson.JsonElement | |
import com.google.gson.JsonObject | |
import com.google.gson.JsonPrimitive | |
@DslMarker | |
annotation class JsonMarker | |
@JsonMarker | |
fun json(block: JsonObjectBuilder.() -> Unit): JsonObject { |
This file contains hidden or 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
package br.com.devsrsouza.kotlinbukkitapi.dsl.command | |
import br.com.devsrsouza.kotlinbukkitapi.extensions.text.asText | |
import br.com.devsrsouza.kotlinbukkitapi.extensions.text.color | |
import br.com.devsrsouza.kotlinbukkitapi.extensions.text.unaryPlus | |
import net.md_5.bungee.api.chat.TextComponent | |
import org.bukkit.Bukkit | |
import org.bukkit.ChatColor | |
import org.bukkit.Location | |
import org.bukkit.World |
This file contains hidden or 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
import br.com.devsrsouza.kotlinbukkitapi.dsl.config.YamlConfig | |
import br.com.devsrsouza.kotlinbukkitapi.dsl.config.loadAndSetDefault | |
import br.com.devsrsouza.kotlinbukkitapi.dsl.config.loadTransformerChangeColor | |
import br.com.devsrsouza.kotlinbukkitapi.dsl.config.saveTransformerChangeColor | |
import org.bukkit.plugin.Plugin | |
import java.io.File | |
import kotlin.reflect.KClass | |
fun Plugin.configLazy(file: String, model: KClass<*>) = lazy { | |
File(dataFolder, file).let { |