use of org.blockartistry.mod.DynSurround.client.footsteps.mcpackage.implem.AcousticsManager in project BetterRain by OreCruncher.
the class Footsteps method reloadAcoustics.
private void reloadAcoustics(final List<IResourcePack> repo) {
AcousticsManager acoustics = new AcousticsManager(this.isolator);
Scanner scanner = null;
InputStream stream = null;
for (final IResourcePack pack : repo) {
try {
stream = this.dealer.openAcoustics(pack);
if (stream != null) {
scanner = new Scanner(stream);
final String jasonString = scanner.useDelimiter("\\Z").next();
new AcousticsJsonReader("").parseJSON(jasonString, acoustics);
}
} catch (final IOException e) {
ModLog.debug("Unable to load acoustic data from pack %s", pack.getPackName());
} finally {
try {
if (scanner != null)
scanner.close();
if (stream != null)
stream.close();
} catch (final IOException e) {
;
}
}
}
this.isolator.setAcoustics(acoustics);
this.isolator.setSoundPlayer(new UserConfigSoundPlayerWrapper(acoustics));
this.isolator.setDefaultStepPlayer(acoustics);
}
Aggregations