Make "PluginInstance" available internally

This commit is contained in:
Jakob K
2021-08-24 01:47:38 +02:00
parent 4d3e25af32
commit fa71b0cc0e
11 changed files with 48 additions and 43 deletions

View File

@@ -3,7 +3,7 @@ package net.axay.kspigot.extensions.bukkit
import net.axay.kspigot.annotations.NMS_General
import net.axay.kspigot.chat.literalText
import net.axay.kspigot.extensions.onlinePlayers
import net.axay.kspigot.main.KSpigotMainInstance
import net.axay.kspigot.main.PluginInstance
import net.axay.kspigot.pluginmessages.PluginMessageConnect
import net.md_5.bungee.api.ChatMessageType
import org.bukkit.Location
@@ -73,28 +73,28 @@ fun Player.feedSaturate() {
* Hides the player for all [onlinePlayers].
*/
fun Player.disappear() {
onlinePlayers.filter { it != this }.forEach { it.hidePlayer(KSpigotMainInstance, this) }
onlinePlayers.filter { it != this }.forEach { it.hidePlayer(PluginInstance, this) }
}
/**
* Shows the player for all [onlinePlayers].
*/
fun Player.appear() {
onlinePlayers.filter { it != this }.forEach { it.showPlayer(KSpigotMainInstance, this) }
onlinePlayers.filter { it != this }.forEach { it.showPlayer(PluginInstance, this) }
}
/**
* Hides all online players from this player.
*/
fun Player.hideOnlinePlayers() {
onlinePlayers.filter { it != this }.forEach { this.hidePlayer(KSpigotMainInstance, it) }
onlinePlayers.filter { it != this }.forEach { this.hidePlayer(PluginInstance, it) }
}
/**
* Shows all online players to this player.
*/
fun Player.showOnlinePlayers() {
onlinePlayers.filter { it != this }.forEach { this.showPlayer(KSpigotMainInstance, it) }
onlinePlayers.filter { it != this }.forEach { this.showPlayer(PluginInstance, it) }
}
/**