mirror of
https://github.com/HibiscusMC/HMCCosmetics.git
synced 2025-12-19 15:09:19 +00:00
feat: Add CMI vanish support
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -23,7 +23,6 @@ atlassian-ide-plugin.xml
|
||||
*.ctxt
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
*.nar
|
||||
*.ear
|
||||
|
||||
@@ -62,7 +62,7 @@ allprojects {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
compileOnly(fileTree("${project.rootDir}/lib") { include("*.jar") })
|
||||
compileOnly("com.mojang:authlib:1.5.25")
|
||||
compileOnly("org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT")
|
||||
compileOnly("org.jetbrains:annotations:23.0.0")
|
||||
@@ -77,7 +77,6 @@ allprojects {
|
||||
compileOnly("com.sk89q.worldguard:worldguard-bukkit:7.1.0-SNAPSHOT")
|
||||
compileOnly("it.unimi.dsi:fastutil:8.5.11")
|
||||
compileOnly("com.github.LeonMangler:SuperVanish:6.2.6-4")
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.hibiscusmc.hmccosmetics.hooks;
|
||||
|
||||
import com.hibiscusmc.hmccosmetics.HMCCosmeticsPlugin;
|
||||
import com.hibiscusmc.hmccosmetics.hooks.items.*;
|
||||
import com.hibiscusmc.hmccosmetics.hooks.misc.HookCMI;
|
||||
import com.hibiscusmc.hmccosmetics.hooks.misc.HookHMCColor;
|
||||
import com.hibiscusmc.hmccosmetics.hooks.misc.HookPremiumVanish;
|
||||
import com.hibiscusmc.hmccosmetics.hooks.misc.HookSuperVanish;
|
||||
@@ -26,6 +27,7 @@ public class Hooks {
|
||||
private static HookPremiumVanish PREMIUM_VANISH_HOOK = new HookPremiumVanish();
|
||||
private static HookSuperVanish SUPER_VANISH_HOOK = new HookSuperVanish();
|
||||
private static HookHMCColor HMC_COLOR_HOOK = new HookHMCColor();
|
||||
private static HookCMI CMI_HOOK = new HookCMI();
|
||||
|
||||
public static Hook getHook(@NotNull String id) {
|
||||
return hooks.get(id.toLowerCase());
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.hibiscusmc.hmccosmetics.hooks.misc;
|
||||
|
||||
import com.Zrips.CMI.events.CMIPlayerUnVanishEvent;
|
||||
import com.Zrips.CMI.events.CMIPlayerVanishEvent;
|
||||
import com.hibiscusmc.hmccosmetics.hooks.Hook;
|
||||
import com.hibiscusmc.hmccosmetics.user.CosmeticUser;
|
||||
import com.hibiscusmc.hmccosmetics.user.CosmeticUsers;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class HookCMI extends Hook implements Listener {
|
||||
|
||||
public HookCMI() {
|
||||
super("CMI");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerVanish(@NotNull CMIPlayerVanishEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
CosmeticUser user = CosmeticUsers.getUser(player);
|
||||
if (user == null) return;
|
||||
user.hideCosmetics(CosmeticUser.HiddenReason.PLUGIN);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerShow(@NotNull CMIPlayerUnVanishEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
CosmeticUser user = CosmeticUsers.getUser(player);
|
||||
if (user == null) return;
|
||||
user.showCosmetics();
|
||||
}
|
||||
}
|
||||
BIN
lib/CMI-API9.3.1.5.jar
Normal file
BIN
lib/CMI-API9.3.1.5.jar
Normal file
Binary file not shown.
BIN
lib/CMILib1.2.4.6.jar
Normal file
BIN
lib/CMILib1.2.4.6.jar
Normal file
Binary file not shown.
Reference in New Issue
Block a user