fix(multiplayer): bind to 0.0.0.0 instead of 127.0.0.1.
This commit is contained in:
@@ -330,6 +330,25 @@ public final class Lang {
|
||||
return optional.map(Stream::of).orElseGet(Stream::empty);
|
||||
}
|
||||
|
||||
public static <T> Iterable<T> toIterable(Enumeration<T> enumeration) {
|
||||
if (enumeration == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
return () -> new Iterator<T>() {
|
||||
public boolean hasNext() {
|
||||
return enumeration.hasMoreElements();
|
||||
}
|
||||
|
||||
public T next() {
|
||||
return enumeration.nextElement();
|
||||
}
|
||||
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static <T> Iterable<T> toIterable(Stream<T> stream) {
|
||||
return stream::iterator;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Hello Minecraft! Launcher
|
||||
* Copyright (C) 2020 huangyuhui <huanghongxun2008@126.com> and contributors
|
||||
* Copyright (C) 2021 huangyuhui <huanghongxun2008@126.com> and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -72,6 +72,16 @@ public final class Logging {
|
||||
LOG.addHandler(streamHandler);
|
||||
}
|
||||
|
||||
public static void initForTest() {
|
||||
LOG.setLevel(Level.ALL);
|
||||
LOG.setUseParentHandlers(false);
|
||||
|
||||
ConsoleHandler consoleHandler = new ConsoleHandler();
|
||||
consoleHandler.setFormatter(DefaultFormatter.INSTANCE);
|
||||
consoleHandler.setLevel(Level.FINER);
|
||||
LOG.addHandler(consoleHandler);
|
||||
}
|
||||
|
||||
public static byte[] getRawLogs() {
|
||||
return storedLogs.toByteArray();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user