Eliminated plugin and kSpigot parameters
This commit is contained in:
@@ -1,27 +1,28 @@
|
||||
package net.axay.kspigot.extensions.bukkit
|
||||
|
||||
import net.axay.kspigot.main.KSpigotMainInstance
|
||||
import net.md_5.bungee.api.ChatColor
|
||||
import org.bukkit.command.CommandSender
|
||||
import org.bukkit.plugin.Plugin
|
||||
|
||||
/** @see printColoredPrefix */
|
||||
fun CommandSender.print(text: String, plugin: Plugin? = null)
|
||||
fun CommandSender.print(text: String, plugin: Plugin? = KSpigotMainInstance)
|
||||
= printColoredPrefix(text, ChatColor.RESET, plugin?.name ?: "INFO", ChatColor.GRAY)
|
||||
|
||||
/** @see printColoredPrefix */
|
||||
fun CommandSender.info(text: String, plugin: Plugin? = null)
|
||||
fun CommandSender.info(text: String, plugin: Plugin? = KSpigotMainInstance)
|
||||
= printColoredPrefix(text, ChatColor.WHITE, plugin?.name ?: "INFO", ChatColor.DARK_AQUA)
|
||||
|
||||
/** @see printColoredPrefix */
|
||||
fun CommandSender.success(text: String, plugin: Plugin? = null)
|
||||
fun CommandSender.success(text: String, plugin: Plugin? = KSpigotMainInstance)
|
||||
= printColoredPrefix(text, ChatColor.GREEN, plugin?.name ?: "SUCCESS", ChatColor.DARK_AQUA)
|
||||
|
||||
/** @see printColoredPrefix */
|
||||
fun CommandSender.warn(text: String, plugin: Plugin? = null)
|
||||
fun CommandSender.warn(text: String, plugin: Plugin? = KSpigotMainInstance)
|
||||
= printColoredPrefix(text, ChatColor.WHITE, plugin?.name?.plus(" - WARN") ?: "WARN", ChatColor.YELLOW)
|
||||
|
||||
/** @see printColoredPrefix */
|
||||
fun CommandSender.error(text: String, plugin: Plugin? = null)
|
||||
fun CommandSender.error(text: String, plugin: Plugin? = KSpigotMainInstance)
|
||||
= printColoredPrefix(text, ChatColor.RED, plugin?.name?.plus(" - ERROR") ?: "ERROR", ChatColor.DARK_RED)
|
||||
|
||||
/**
|
||||
|
@@ -2,12 +2,12 @@ package net.axay.kspigot.extensions.bukkit
|
||||
|
||||
import net.axay.kspigot.annotations.NMS_General
|
||||
import net.axay.kspigot.extensions.onlinePlayers
|
||||
import net.axay.kspigot.main.KSpigotMainInstance
|
||||
import org.bukkit.Location
|
||||
import org.bukkit.Material
|
||||
import org.bukkit.attribute.Attribute
|
||||
import org.bukkit.craftbukkit.v1_16_R2.CraftWorld
|
||||
import org.bukkit.entity.*
|
||||
import org.bukkit.plugin.Plugin
|
||||
|
||||
/**
|
||||
* Checks if the entity is completely in water.
|
||||
@@ -72,15 +72,15 @@ fun Player.feedSaturate() {
|
||||
/**
|
||||
* Hides the player for all [onlinePlayers].
|
||||
*/
|
||||
fun Player.disappear(plugin: Plugin) {
|
||||
onlinePlayers.filter { it != this }.forEach { it.hidePlayer(plugin, this) }
|
||||
fun Player.disappear() {
|
||||
onlinePlayers.filter { it != this }.forEach { it.hidePlayer(KSpigotMainInstance, this) }
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows the player for all [onlinePlayers].
|
||||
*/
|
||||
fun Player.appear(plugin: Plugin) {
|
||||
onlinePlayers.filter { it != this }.forEach { it.showPlayer(plugin, this) }
|
||||
fun Player.appear() {
|
||||
onlinePlayers.filter { it != this }.forEach { it.showPlayer(KSpigotMainInstance, this) }
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user