9
0
mirror of https://github.com/HibiscusMC/HMCCosmetics.git synced 2025-12-30 12:29:16 +00:00

feat: add Hibiscus Commons / GSit compatibility

This commit is contained in:
LoJoSho
2024-10-10 22:50:58 -05:00
parent 60e23411dc
commit 439dc85aa3
2 changed files with 17 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.4.1")
compileOnly("me.lojosho:HibiscusCommons:0.4.9")
// Handled by Spigot Library Loader
compileOnly("net.kyori:adventure-api:4.17.0")

View File

@@ -455,6 +455,22 @@ public class PlayerGameListener implements Listener {
user.showCosmetics(CosmeticUser.HiddenReason.EMOTE);
}
@EventHandler(priority = EventPriority.LOW)
public void onPlayerHibiscusPose(HibiscusPlayerPoseEvent event) {
if (event.isGettingUp()) return;
CosmeticUser user = CosmeticUsers.getUser(event.getPlayer());
if (user == null) return;
user.hideCosmetics(CosmeticUser.HiddenReason.PLUGIN);
}
@EventHandler(priority = EventPriority.LOW)
public void onPlayerHibiscusGetUpPose(HibiscusPlayerPoseEvent event) {
if (!event.isGettingUp()) return;
CosmeticUser user = CosmeticUsers.getUser(event.getPlayer());
if (user == null) return;
user.showCosmetics(CosmeticUser.HiddenReason.PLUGIN);
}
private void registerInventoryClickListener() {
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(HMCCosmeticsPlugin.getInstance(), ListenerPriority.NORMAL, PacketType.Play.Client.WINDOW_CLICK) {
@Override