Update formatting

This commit is contained in:
Jakob K
2021-05-15 21:26:10 +02:00
parent ddc576a394
commit fa8fa9ae96
71 changed files with 203 additions and 249 deletions

View File

@@ -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

View File

@@ -17,4 +17,4 @@ fun CommandExecutor.register(commandName: String): Boolean {
return true
}
return false
}
}

View File

@@ -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")

View File

@@ -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)

View File

@@ -9,4 +9,4 @@ val GameMode.isDamageable: Boolean
get() = when (this) {
GameMode.SURVIVAL, GameMode.ADVENTURE -> true
GameMode.SPECTATOR, GameMode.CREATIVE -> false
}
}

View File

@@ -23,4 +23,4 @@ val Chunk.allBlocks
for (z in 0 until 16)
add(getBlock(x, y, z))
}
}
}

View File

@@ -10,4 +10,4 @@ val BookMeta.content
append('\n')
append(it)
}
}.toString()
}.toString()