mirror of
https://github.com/YouHaveTrouble/NotJustNameplates.git
synced 2026-05-11 22:16:57 +00:00
supervanish hook
This commit is contained in:
@@ -3,9 +3,6 @@ package me.youhavetrouble.notjustnameplates;
|
||||
import me.youhavetrouble.notjustnameplates.commands.MainCommand;
|
||||
import me.youhavetrouble.notjustnameplates.displays.DisplayContent;
|
||||
import me.youhavetrouble.notjustnameplates.nameplates.NameplateManager;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
|
||||
import net.kyori.adventure.text.minimessage.tag.standard.StandardTags;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.permissions.PermissionDefault;
|
||||
@@ -23,9 +20,7 @@ public final class NotJustNameplates extends JavaPlugin {
|
||||
private final TeamManager teamManager = new TeamManager();
|
||||
private NameplateManager nameplateManager = null;
|
||||
|
||||
private static boolean papiHook = false;
|
||||
|
||||
public static final MiniMessage miniMessage = null;
|
||||
private static boolean papiHook, superVanishHook = false;
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
@@ -33,6 +28,7 @@ public final class NotJustNameplates extends JavaPlugin {
|
||||
|
||||
config = new NJNConfig(this);
|
||||
papiHook = Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null && Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI");
|
||||
superVanishHook = Bukkit.getPluginManager().isPluginEnabled("SuperVanish") || Bukkit.getPluginManager().isPluginEnabled("PremiumVanish");
|
||||
|
||||
DefaultPermissions.registerPermission("notjustnameplates.seeown", "Allows a player to see their own nameplate", PermissionDefault.FALSE);
|
||||
DefaultPermissions.registerPermission("notjustnameplates.command", "Allows a player to use the /njn command", PermissionDefault.TRUE);
|
||||
@@ -110,4 +106,7 @@ public final class NotJustNameplates extends JavaPlugin {
|
||||
return papiHook;
|
||||
}
|
||||
|
||||
public static boolean isSuperVanishHooked() {
|
||||
return superVanishHook;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package me.youhavetrouble.notjustnameplates.nameplates;
|
||||
|
||||
import de.myzelyam.api.vanish.VanishAPI;
|
||||
import me.youhavetrouble.notjustnameplates.NotJustNameplates;
|
||||
import me.youhavetrouble.notjustnameplates.displays.DisplayContent;
|
||||
import me.youhavetrouble.notjustnameplates.text.TextParser;
|
||||
@@ -148,6 +149,11 @@ public class Nameplate {
|
||||
return;
|
||||
}
|
||||
|
||||
if (NotJustNameplates.isSuperVanishHooked() && VanishAPI.isInvisible(player)) {
|
||||
remove();
|
||||
return;
|
||||
}
|
||||
|
||||
createDisplayEntity();
|
||||
if (textDisplay == null || textDisplay.isDead()) return;
|
||||
if (!player.getPassengers().contains(textDisplay)) {
|
||||
|
||||
@@ -8,3 +8,7 @@ website: https://youhavetrouble.me
|
||||
dependencies:
|
||||
- name: PlaceholderAPI
|
||||
required: false
|
||||
- name: SuperVanish
|
||||
required: false
|
||||
- name: PremiumVanish
|
||||
required: false
|
||||
|
||||
Reference in New Issue
Block a user