mirror of
https://github.com/HibiscusMC/HMCCosmetics.git
synced 2025-12-19 15:09:19 +00:00
fix: CosmeticUser not handling null entities
This commit is contained in:
@@ -626,7 +626,12 @@ public class CosmeticUser implements CosmeticHolder {
|
|||||||
if (isInWardrobe() && !ignoreWardrobe) {
|
if (isInWardrobe() && !ignoreWardrobe) {
|
||||||
if (WardrobeSettings.isTryCosmeticsInWardrobe() && userWardrobeManager.getWardrobeStatus().equals(UserWardrobeManager.WardrobeStatus.RUNNING)) return true;
|
if (WardrobeSettings.isTryCosmeticsInWardrobe() && userWardrobeManager.getWardrobeStatus().equals(UserWardrobeManager.WardrobeStatus.RUNNING)) return true;
|
||||||
}
|
}
|
||||||
return getEntity().hasPermission(cosmetic.getPermission());
|
final Player player = getPlayer();
|
||||||
|
if (player != null) return player.hasPermission(cosmetic.getPermission());
|
||||||
|
// This sucks, but basically if we can find a player, use that. If not, try to find the entity. If it can't find the entity, just return false.
|
||||||
|
final Entity entity = getEntity();
|
||||||
|
if (entity != null) return entity.hasPermission(cosmetic.getPermission());
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void hidePlayer() {
|
public void hidePlayer() {
|
||||||
|
|||||||
Reference in New Issue
Block a user