@EventHandler
public void onTick(TickEvent e) throws InterruptedException {
while (true) {
if (configureCommand.getSender() != null && configureCommand.getConfig() != null && urlCommand.getUrl() != null) {
logger.info("Пытаюсь подключиться к стриму...");
try {
streamViewer.view(urlCommand.getUrl(), configureCommand.getConfig(), configureCommand.getSender());
logger.info("Получилось!");
} catch (IOException ioException) {
ioException.printStackTrace();
logger.info("Не получилось!");
}
}
}
}
Это означает, что из твоего обработчика событий никогда нельзя будет выйти. Остальная игра не сможет ничего делатьwhile (true) {
@Mod(modid = Main.MODID, name = Main.NAME, version = Main.VERSION)
public class Main {
UrlCommand urlCommand = new UrlCommand();
ConfigureCommand configureCommand = new ConfigureCommand();
StreamViewer streamViewer = new StreamViewer();
public static final String MODID = "lim";
public static final String NAME = "LikesMod";
public static final String VERSION = "1.0";
private static Logger logger;
public void preInit(FMLPreInitializationEvent event) {
logger = event.getModLog();
}
public void load(FMLInitializationEvent event) {
logger.info(NAME + " " + VERSION + " успешно активирован!");
}
@EventHandler
public void postInit(FMLPostInitializationEvent e){
MinecraftForge.EVENT_BUS.register(this);
}
public void serverStart(FMLServerStartingEvent e) {
MinecraftServer server = e.getServer();
ICommandManager command = server.getCommandManager();
ServerCommandManager manager = (ServerCommandManager) command;
manager.registerCommand(new UrlCommand());
manager.registerCommand(new ConfigureCommand());
}
@SubscribeEvent
public void onTick(TickEvent e) throws InterruptedException {
if (configureCommand.getSender() != null && configureCommand.getConfig() != null && urlCommand.getUrl() != null) {
logger.info("Пытаюсь подключиться к стриму...");
try {
streamViewer.view(urlCommand.getUrl(), configureCommand.getConfig(), configureCommand.getSender());
logger.info("Получилось!");
} catch (IOException ioException) {
ioException.printStackTrace();
logger.info("Не получилось!");
}
}
}
}
В логе че-нить появляется?logger.info