use of org.blockartistry.DynSurround.registry.BiomeInfo in project DynamicSurroundings by OreCruncher.
the class RainSplashAccent method provide.
@Override
@Nonnull
public ObjectArray<IAcoustic> provide(@Nonnull final EntityLivingBase entity, @Nullable final BlockPos blockPos, @Nonnull final ObjectArray<IAcoustic> in) {
if (ModOptions.sound.enablePuddleSound && Weather.isRaining() && EnvironState.isPlayer(entity)) {
if (blockPos != null) {
this.mutable.setPos(blockPos.getX(), blockPos.getY() + 1, blockPos.getZ());
} else {
this.mutable.setPos(entity);
}
final World world = entity.getEntityWorld();
final SeasonInfo season = ClientRegistry.SEASON.getData(world);
final int precipHeight = season.getPrecipitationHeight(world, this.mutable).getY();
if (precipHeight == this.mutable.getY()) {
final BiomeInfo biome = ClientRegistry.BIOME.get(ClientChunkCache.INSTANCE.getBiome(this.mutable));
if (biome.hasWeatherEffect() && !biome.getHasDust()) {
this.mutable.setY(precipHeight);
if (!season.canWaterFreeze(world, this.mutable))
in.addAll(AcousticsManager.SPLASH);
}
}
}
return in;
}
Aggregations