9
0
mirror of https://github.com/HibiscusMC/HMCCosmetics.git synced 2026-01-04 15:41:45 +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

@@ -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