Skip to content

Commit

Permalink
fix: effects persists after unvanish
Browse files Browse the repository at this point in the history
  • Loading branch information
Syrent committed Jan 30, 2024
1 parent 84376d3 commit 46d9357
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class VanishManager(
Ruom.runSync({
for (potionEffect in potions) {
if (ServerVersion.supports(10)) {
if (player.getPotionEffect(potionEffect.type)?.amplifier != potionEffect.amplifier) continue
if (player.hasPotionEffect(potionEffect.type) && player.getPotionEffect(potionEffect.type)?.amplifier != potionEffect.amplifier) continue
}
try {
@Suppress("DEPRECATION") NMSUtils.sendPacket(player, ClientboundRemoveMobEffectPacketAccessor.getConstructor0().newInstance(player.entityId, MobEffectAccessor.getMethodById1().invoke(null, potionEffect.type.id)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class PlaceholderAPIHook(plugin: VelocityVanishSpigot, name: String) : Dependenc
Ruom.onlinePlayers.filter { !plugin.vanishedNamesOnline.contains(it.name) }.size.toString()
} else if (type.equals("total", true)) {
val players = mutableListOf<String>()
for (serverPlayers in plugin.proxyPlayers.values.filter { it.isNotEmpty() }) {
for (serverPlayers in plugin.proxyPlayers.values.filter { it.isNotEmpty() }.distinct()) {
players.addAll(serverPlayers)
}
players.filter { !plugin.vanishedNamesOnline.contains(it) }.size.toString()
Expand Down

0 comments on commit 46d9357

Please sign in to comment.