Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
Map<String,String> serverPoperties =
Files
.lines(new File("./server.properties").toPath)
.map(line->line.split('='))
.collect(toMap(a->a[0],a->a[1]));
serverPoperties.get("port")
Map<String,String> serverPoperties =
Files
.lines(new File("./server.properties").toPath)
.map(line->line.split('='))
.collect(toMap(a->a[0],a->a[1]));
serverPoperties.get("port")
Хм, какой-же чудесный майнкрафт говнокод, порт возвращает правильно, а ip нет, я когда ip пытался получить он мне бред кидал, даже не думал что порт правильно вернет.Попробуй получать эту инфу в FMLServerStartingEvent (вроде он, где можно получить объект MinecraftServer из аргументов ивента).
Мерси, учтуJava:Map<String,String> serverPoperties = Files .lines(new File("./server.properties ").toPath) .map(line->line.split('=')) .collect(toMap(a->a[0],a->a[1])); serverPoperties.get("port")
@Mod.EventHandler
@SideOnly(Side.SERVER)
public void onPreInitServer(FMLPreInitializationEvent e) {
// Тут все вызывал
}