mirror of
https://github.com/HibiscusMC/HibiscusCommons.git
synced 2025-12-20 07:29:15 +00:00
squash! feat: use vanished metadata rather than apis for each plugin
This commit is contained in:
@@ -89,6 +89,7 @@ allprojects {
|
|||||||
compileOnly("it.unimi.dsi:fastutil:8.5.15")
|
compileOnly("it.unimi.dsi:fastutil:8.5.15")
|
||||||
compileOnly("com.denizenscript:denizen:1.2.7-SNAPSHOT")
|
compileOnly("com.denizenscript:denizen:1.2.7-SNAPSHOT")
|
||||||
compileOnly("io.lumine:Mythic-Dist:5.8.0")
|
compileOnly("io.lumine:Mythic-Dist:5.8.0")
|
||||||
|
compileOnly("com.github.LeonMangler:SuperVanish:6.2.17")
|
||||||
compileOnly("net.Indyuce:MMOItems-API:6.9.4-SNAPSHOT")
|
compileOnly("net.Indyuce:MMOItems-API:6.9.4-SNAPSHOT")
|
||||||
compileOnly("com.willfp:eco:6.74.5")
|
compileOnly("com.willfp:eco:6.74.5")
|
||||||
compileOnly("me.clip:placeholderapi:2.11.6")
|
compileOnly("me.clip:placeholderapi:2.11.6")
|
||||||
|
|||||||
@@ -40,6 +40,8 @@ public class Hooks {
|
|||||||
private static final HookCustomFishing CF_HOOK = new HookCustomFishing();
|
private static final HookCustomFishing CF_HOOK = new HookCustomFishing();
|
||||||
private static final HookGSit GSIT_HOOK = new HookGSit();
|
private static final HookGSit GSIT_HOOK = new HookGSit();
|
||||||
private static final HookCraftEngine CRAFT_ENGINE_HOOK = new HookCraftEngine();
|
private static final HookCraftEngine CRAFT_ENGINE_HOOK = new HookCraftEngine();
|
||||||
|
private static final HookPremiumVanish PREMIUM_VANISH_HOOK = new HookPremiumVanish();
|
||||||
|
private static final HookSuperVanish SUPER_VANISH_HOOK = new HookSuperVanish();
|
||||||
|
|
||||||
private static boolean allHooksActive = false;
|
private static boolean allHooksActive = false;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package me.lojosho.hibiscuscommons.hooks.misc;
|
||||||
|
|
||||||
|
import de.myzelyam.api.vanish.PlayerHideEvent;
|
||||||
|
import de.myzelyam.api.vanish.PlayerShowEvent;
|
||||||
|
import me.lojosho.hibiscuscommons.api.events.HibiscusPlayerUnVanishEvent;
|
||||||
|
import me.lojosho.hibiscuscommons.api.events.HibiscusPlayerVanishEvent;
|
||||||
|
import me.lojosho.hibiscuscommons.hooks.Hook;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A hook that integrates the plugin {@link de.myzelyam.api.vanish.VanishAPI Supervanish}
|
||||||
|
*
|
||||||
|
* @implSpec Supervanish and Premium Vanish both use the same api
|
||||||
|
*/
|
||||||
|
public class HookPremiumVanish extends Hook {
|
||||||
|
public HookPremiumVanish() {
|
||||||
|
super("PremiumVanish");
|
||||||
|
setActive(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||||
|
public void onPlayerVanish(@NotNull PlayerHideEvent event) {
|
||||||
|
HibiscusPlayerVanishEvent newEvent = new HibiscusPlayerVanishEvent(this, event.getPlayer());
|
||||||
|
Bukkit.getPluginManager().callEvent(newEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||||
|
public void onPlayerShow(@NotNull PlayerShowEvent event) {
|
||||||
|
HibiscusPlayerUnVanishEvent newEvent = new HibiscusPlayerUnVanishEvent(this, event.getPlayer());
|
||||||
|
Bukkit.getPluginManager().callEvent(newEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package me.lojosho.hibiscuscommons.hooks.misc;
|
||||||
|
|
||||||
|
import de.myzelyam.api.vanish.PlayerHideEvent;
|
||||||
|
import de.myzelyam.api.vanish.PlayerShowEvent;
|
||||||
|
import me.lojosho.hibiscuscommons.api.events.HibiscusPlayerUnVanishEvent;
|
||||||
|
import me.lojosho.hibiscuscommons.api.events.HibiscusPlayerVanishEvent;
|
||||||
|
import me.lojosho.hibiscuscommons.hooks.Hook;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A hook that integrates the plugin {@link de.myzelyam.api.vanish.VanishAPI Supervanish}
|
||||||
|
*
|
||||||
|
* @implSpec Supervanish and Premium Vanish both use the same api
|
||||||
|
*/
|
||||||
|
public class HookSuperVanish extends Hook {
|
||||||
|
public HookSuperVanish() {
|
||||||
|
super("SuperVanish");
|
||||||
|
setActive(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||||
|
public void onPlayerVanish(@NotNull PlayerHideEvent event) {
|
||||||
|
HibiscusPlayerVanishEvent newEvent = new HibiscusPlayerVanishEvent(this, event.getPlayer());
|
||||||
|
Bukkit.getPluginManager().callEvent(newEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||||
|
public void onPlayerShow(@NotNull PlayerShowEvent event) {
|
||||||
|
HibiscusPlayerUnVanishEvent newEvent = new HibiscusPlayerUnVanishEvent(this, event.getPlayer());
|
||||||
|
Bukkit.getPluginManager().callEvent(newEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user