A port of MCVHost from C# to Java (plus some fixes).