Search in sources :

Example 1 with Condition

use of com.lying.variousoddities.condition.Condition in project VariousOddities by Lyinginbedmon.

the class VOBusClient method displayMindControl.

private static void displayMindControl(MatrixStack stack, PlayerEntity localPlayer) {
    LivingData playerData = LivingData.forEntity(localPlayer);
    List<LivingEntity> nearbyMobs = localPlayer.getEntityWorld().getEntitiesWithinAABB(LivingEntity.class, localPlayer.getBoundingBox().grow(16D));
    // FIXME Display mind control icons in a row instead of on top of one another when multiple are active
    for (Condition condition : Conditions.getAllConditions()) for (LivingEntity mob : nearbyMobs) {
        LivingData data = LivingData.forEntity(mob);
        if (data != null && data.hasCondition(condition, localPlayer))
            renderConditionIconAt(stack, mob, localPlayer, condition, true);
        else if (playerData.hasCondition(condition, mob))
            renderConditionIconAt(stack, mob, localPlayer, condition, false);
    }
}
Also used : LivingEntity(net.minecraft.entity.LivingEntity) BodyCondition(com.lying.variousoddities.capabilities.PlayerData.BodyCondition) Condition(com.lying.variousoddities.condition.Condition) LivingData(com.lying.variousoddities.capabilities.LivingData)

Aggregations

LivingData (com.lying.variousoddities.capabilities.LivingData)1 BodyCondition (com.lying.variousoddities.capabilities.PlayerData.BodyCondition)1 Condition (com.lying.variousoddities.condition.Condition)1 LivingEntity (net.minecraft.entity.LivingEntity)1