9
0
mirror of https://github.com/HibiscusMC/HMCCosmetics.git synced 2025-12-19 15:09:19 +00:00

feat: hook into hooks to check invisibility

This commit is contained in:
LoJoSho
2025-01-16 20:53:05 -06:00
parent 68d94be743
commit 1873f5b9b5
2 changed files with 4 additions and 1 deletions

View File

@@ -80,7 +80,7 @@ allprojects {
compileOnly("com.sk89q.worldguard:worldguard-bukkit:7.0.12")
//compileOnly("it.unimi.dsi:fastutil:8.5.14")
compileOnly("org.projectlombok:lombok:1.18.34")
compileOnly("me.lojosho:HibiscusCommons:0.6.0-0a688635")
compileOnly("me.lojosho:HibiscusCommons:0.6.0-85d65299")
// Handled by Spigot Library Loader
compileOnly("net.kyori:adventure-api:4.18.0")

View File

@@ -79,6 +79,8 @@ public class CosmeticUser {
// Occasionally updates the entity cosmetics
Runnable run = () -> {
MessagesUtil.sendDebugMessages("Tick[uuid=" + uniqueId + "]", Level.INFO);
if (Hooks.isInvisible(uniqueId)) hideCosmetics(HiddenReason.VANISH);
else showCosmetics(HiddenReason.VANISH);
updateCosmetic();
if (isHidden() && !getUserEmoteManager().isPlayingEmote() && !getCosmetics().isEmpty()) MessagesUtil.sendActionBar(getPlayer(), "hidden-cosmetics");
};
@@ -692,6 +694,7 @@ public class CosmeticUser {
NONE,
WORLDGUARD,
PLUGIN,
VANISH,
POTION,
ACTION,
COMMAND,