Update formatting
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package net.axay.kspigot.extensions.bukkit
|
||||
|
||||
// FROM BUNGEE COLOR
|
||||
|
||||
/**
|
||||
* Returns the corresponding Bukkit Color object.
|
||||
*/
|
||||
@@ -12,7 +14,9 @@ val net.md_5.bungee.api.ChatColor.bukkitColor
|
||||
*/
|
||||
val net.md_5.bungee.api.ChatColor.javaAwtColor: java.awt.Color
|
||||
get() = color
|
||||
|
||||
// FROM BUKKIT COLOR
|
||||
|
||||
/**
|
||||
* Returns the corresponding Bungee Color object.
|
||||
*/
|
||||
@@ -24,7 +28,9 @@ val org.bukkit.Color.bungeeColor: net.md_5.bungee.api.ChatColor
|
||||
*/
|
||||
val org.bukkit.Color.javaAwtColor: java.awt.Color
|
||||
get() = java.awt.Color(asRGB())
|
||||
|
||||
// FROM JAVA AWT COLOR
|
||||
|
||||
/**
|
||||
* Returns the corresponding Bukkit Color object.
|
||||
*/
|
||||
@@ -36,7 +42,9 @@ val java.awt.Color.bukkitColor
|
||||
*/
|
||||
val java.awt.Color.bungeeColor: net.md_5.bungee.api.ChatColor
|
||||
get() = net.md_5.bungee.api.ChatColor.of(this)
|
||||
|
||||
// FROM BUKKIT CHAT COLOR
|
||||
|
||||
/**
|
||||
* Returns the corresponding Bukkit Color object.
|
||||
*/
|
||||
@@ -53,4 +61,4 @@ val org.bukkit.ChatColor.bungeeColor: net.md_5.bungee.api.ChatColor
|
||||
* Returns the corresponding Java Color object.
|
||||
*/
|
||||
val org.bukkit.ChatColor.javaAwtColor: java.awt.Color
|
||||
get() = bungeeColor.javaAwtColor
|
||||
get() = bungeeColor.javaAwtColor
|
||||
|
@@ -17,4 +17,4 @@ fun CommandExecutor.register(commandName: String): Boolean {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
@@ -29,4 +29,4 @@ fun CommandSender.error(text: String, plugin: Plugin? = KSpigotMainInstance) =
|
||||
* Sends the given message and adds the given prefix with the given color to it.
|
||||
*/
|
||||
fun CommandSender.printColoredPrefix(text: String, textColor: ChatColor, prefix: String, prefixColor: ChatColor) =
|
||||
sendMessage("${prefixColor}[${prefix}]${textColor} $text")
|
||||
sendMessage("${prefixColor}[${prefix}]${textColor} $text")
|
||||
|
@@ -14,11 +14,6 @@ import org.bukkit.entity.*
|
||||
import org.bukkit.inventory.EquipmentSlot
|
||||
import org.bukkit.inventory.ItemStack
|
||||
|
||||
/**
|
||||
* Checks if the entity is completely in water.
|
||||
*/
|
||||
val LivingEntity.isInWater: Boolean get() = isFeetInWater && isHeadInWater
|
||||
|
||||
/**
|
||||
* Checks if the entities' head is in water.
|
||||
*/
|
||||
@@ -167,4 +162,4 @@ fun Player.sendToServer(servername: String) {
|
||||
* Adds the given ItemStacks to the player's inventory.
|
||||
* @return The items that did not fit into the player's inventory.
|
||||
*/
|
||||
fun Player.give(vararg itemStacks: ItemStack) = inventory.addItem(*itemStacks)
|
||||
fun Player.give(vararg itemStacks: ItemStack) = inventory.addItem(*itemStacks)
|
||||
|
@@ -9,4 +9,4 @@ val GameMode.isDamageable: Boolean
|
||||
get() = when (this) {
|
||||
GameMode.SURVIVAL, GameMode.ADVENTURE -> true
|
||||
GameMode.SPECTATOR, GameMode.CREATIVE -> false
|
||||
}
|
||||
}
|
||||
|
@@ -23,4 +23,4 @@ val Chunk.allBlocks
|
||||
for (z in 0 until 16)
|
||||
add(getBlock(x, y, z))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -10,4 +10,4 @@ val BookMeta.content
|
||||
append('\n')
|
||||
append(it)
|
||||
}
|
||||
}.toString()
|
||||
}.toString()
|
||||
|
Reference in New Issue
Block a user