generated from Matt-MX/KtPaperPluginTemplate
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/com/mattmx/nametags/hook/NeznamyTABHook.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.mattmx.nametags.hook; | ||
|
||
import com.mattmx.nametags.NameTags; | ||
import me.neznamy.tab.api.TabAPI; | ||
import me.neznamy.tab.api.nametag.NameTagManager; | ||
import me.neznamy.tab.api.nametag.UnlimitedNameTagManager; | ||
import org.bukkit.Bukkit; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class NeznamyTABHook { | ||
|
||
public static void inject(@NotNull NameTags plugin) { | ||
Bukkit.getScheduler().runTask(plugin, NeznamyTABHook::start); | ||
} | ||
|
||
private static void start() { | ||
final boolean isTab = Bukkit.getPluginManager().isPluginEnabled("TAB"); | ||
|
||
if (!isTab) return; | ||
|
||
NameTagManager nameTagManager = TabAPI.getInstance().getNameTagManager(); | ||
|
||
if (nameTagManager instanceof UnlimitedNameTagManager unlimitedNameTagManager) { | ||
// TODO(matt): Disable this module somehow? | ||
// Maybe we need to use the TAB jar as a dependency, i don't think api exposes it. | ||
} | ||
} | ||
|
||
} |