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;
}
Aggregations