Fix incorrect latest version in minimal mode popup (fixes #375)
Also clean up the `1.7.6-1.7.10` to just `1.7.10`.
This commit is contained in:
@@ -66,6 +66,7 @@ import java.security.cert.CertificateException;
|
|||||||
import java.security.cert.CertificateFactory;
|
import java.security.cert.CertificateFactory;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
@@ -350,6 +351,10 @@ public class Utils {
|
|||||||
super(container);
|
super(container);
|
||||||
setBackgroundColor(Colors.DARK_TRANSPARENT);
|
setBackgroundColor(Colors.DARK_TRANSPARENT);
|
||||||
|
|
||||||
|
ProtocolVersion latestVersion = ProtocolVersion.getProtocols()
|
||||||
|
.stream()
|
||||||
|
.max(Comparator.comparing(ProtocolVersion::getId))
|
||||||
|
.orElseThrow(RuntimeException::new);
|
||||||
getInfo().addElements(new VerticalLayout.Data(0.5),
|
getInfo().addElements(new VerticalLayout.Data(0.5),
|
||||||
new GuiLabel()
|
new GuiLabel()
|
||||||
.setColor(Colors.BLACK)
|
.setColor(Colors.BLACK)
|
||||||
@@ -357,10 +362,7 @@ public class Utils {
|
|||||||
new GuiLabel()
|
new GuiLabel()
|
||||||
.setColor(Colors.BLACK)
|
.setColor(Colors.BLACK)
|
||||||
.setI18nText("replaymod.gui.minimalmode.supportedversion",
|
.setI18nText("replaymod.gui.minimalmode.supportedversion",
|
||||||
ProtocolVersion.v1_7_6.getName()
|
"1.7.10 - " + latestVersion.getName()));
|
||||||
+ " - "
|
|
||||||
+ Iterables.getLast(ProtocolVersion.getProtocols()).getName()
|
|
||||||
));
|
|
||||||
|
|
||||||
open();
|
open();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user