mirror of
https://github.com/YouHaveTrouble/NotJustNameplates.git
synced 2026-05-11 22:16:57 +00:00
supervanish hook
This commit is contained in:
@@ -16,11 +16,13 @@ java {
|
|||||||
repositories {
|
repositories {
|
||||||
maven("https://repo.purpurmc.org/snapshots/")
|
maven("https://repo.purpurmc.org/snapshots/")
|
||||||
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/")
|
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/")
|
||||||
|
maven("https://jitpack.io")
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
paperweight.paperDevBundle("1.20.1-R0.1-SNAPSHOT", "org.purpurmc.purpur")
|
paperweight.paperDevBundle("1.20.1-R0.1-SNAPSHOT", "org.purpurmc.purpur")
|
||||||
compileOnly("me.clip:placeholderapi:2.11.3")
|
compileOnly("me.clip:placeholderapi:2.11.3")
|
||||||
|
compileOnly("com.github.LeonMangler:SuperVanish:6.2.17")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
|
|||||||
@@ -3,9 +3,6 @@ package me.youhavetrouble.notjustnameplates;
|
|||||||
import me.youhavetrouble.notjustnameplates.commands.MainCommand;
|
import me.youhavetrouble.notjustnameplates.commands.MainCommand;
|
||||||
import me.youhavetrouble.notjustnameplates.displays.DisplayContent;
|
import me.youhavetrouble.notjustnameplates.displays.DisplayContent;
|
||||||
import me.youhavetrouble.notjustnameplates.nameplates.NameplateManager;
|
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.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.permissions.PermissionDefault;
|
import org.bukkit.permissions.PermissionDefault;
|
||||||
@@ -23,9 +20,7 @@ public final class NotJustNameplates extends JavaPlugin {
|
|||||||
private final TeamManager teamManager = new TeamManager();
|
private final TeamManager teamManager = new TeamManager();
|
||||||
private NameplateManager nameplateManager = null;
|
private NameplateManager nameplateManager = null;
|
||||||
|
|
||||||
private static boolean papiHook = false;
|
private static boolean papiHook, superVanishHook = false;
|
||||||
|
|
||||||
public static final MiniMessage miniMessage = null;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
@@ -33,6 +28,7 @@ public final class NotJustNameplates extends JavaPlugin {
|
|||||||
|
|
||||||
config = new NJNConfig(this);
|
config = new NJNConfig(this);
|
||||||
papiHook = Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null && Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI");
|
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.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);
|
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;
|
return papiHook;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isSuperVanishHooked() {
|
||||||
|
return superVanishHook;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package me.youhavetrouble.notjustnameplates.nameplates;
|
package me.youhavetrouble.notjustnameplates.nameplates;
|
||||||
|
|
||||||
|
import de.myzelyam.api.vanish.VanishAPI;
|
||||||
import me.youhavetrouble.notjustnameplates.NotJustNameplates;
|
import me.youhavetrouble.notjustnameplates.NotJustNameplates;
|
||||||
import me.youhavetrouble.notjustnameplates.displays.DisplayContent;
|
import me.youhavetrouble.notjustnameplates.displays.DisplayContent;
|
||||||
import me.youhavetrouble.notjustnameplates.text.TextParser;
|
import me.youhavetrouble.notjustnameplates.text.TextParser;
|
||||||
@@ -148,6 +149,11 @@ public class Nameplate {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (NotJustNameplates.isSuperVanishHooked() && VanishAPI.isInvisible(player)) {
|
||||||
|
remove();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
createDisplayEntity();
|
createDisplayEntity();
|
||||||
if (textDisplay == null || textDisplay.isDead()) return;
|
if (textDisplay == null || textDisplay.isDead()) return;
|
||||||
if (!player.getPassengers().contains(textDisplay)) {
|
if (!player.getPassengers().contains(textDisplay)) {
|
||||||
|
|||||||
@@ -8,3 +8,7 @@ website: https://youhavetrouble.me
|
|||||||
dependencies:
|
dependencies:
|
||||||
- name: PlaceholderAPI
|
- name: PlaceholderAPI
|
||||||
required: false
|
required: false
|
||||||
|
- name: SuperVanish
|
||||||
|
required: false
|
||||||
|
- name: PremiumVanish
|
||||||
|
required: false
|
||||||
|
|||||||
Reference in New Issue
Block a user