9
0
mirror of https://github.com/HibiscusMC/HMCCosmetics.git synced 2025-12-31 12:56:39 +00:00

check if user is created on potion effect event

This commit is contained in:
LoJoSho
2023-02-01 18:01:30 -06:00
parent 500b8ca0ce
commit e30451e972

View File

@@ -206,6 +206,7 @@ public class PlayerGameListener implements Listener {
if (!event.getEntityType().equals(EntityType.PLAYER)) return;
Player player = (Player) event.getEntity();
CosmeticUser user = CosmeticUsers.getUser(player);
if (user == null) return;
if (event.getAction().equals(EntityPotionEffectEvent.Action.ADDED)) {
user.hideCosmetics(CosmeticUser.HiddenReason.POTION);
return;