Search in sources :

Example 1 with ArmorClass

use of org.blockartistry.DynSurround.registry.ArmorClass in project DynamicSurroundings by OreCruncher.

the class ArmorAccents method provide.

@Override
@Nonnull
public ObjectArray<IAcoustic> provide(@Nonnull final EntityLivingBase entity, @Nullable final BlockPos pos, @Nonnull final ObjectArray<IAcoustic> in) {
    final ArmorClass armor;
    final ArmorClass foot;
    if (EnvironState.isPlayer(entity)) {
        armor = EnvironState.getPlayerArmorClass();
        foot = EnvironState.getPlayerFootArmorClass();
    } else {
        armor = ArmorClass.effectiveArmorClass(entity);
        foot = ArmorClass.footArmorClass(entity);
    }
    final IAcoustic armorAddon = ClientRegistry.FOOTSTEPS.getArmorAcoustic(armor);
    IAcoustic footAddon = ClientRegistry.FOOTSTEPS.getFootArmorAcoustic(foot);
    if (armorAddon != null || footAddon != null) {
        // Eliminate duplicates
        if (armorAddon == footAddon)
            footAddon = null;
        in.add(armorAddon);
        in.add(footAddon);
    }
    return in;
}
Also used : IAcoustic(org.blockartistry.DynSurround.client.footsteps.interfaces.IAcoustic) ArmorClass(org.blockartistry.DynSurround.registry.ArmorClass) Nonnull(javax.annotation.Nonnull)

Aggregations

Nonnull (javax.annotation.Nonnull)1 IAcoustic (org.blockartistry.DynSurround.client.footsteps.interfaces.IAcoustic)1 ArmorClass (org.blockartistry.DynSurround.registry.ArmorClass)1