From 1b9b751a8415069bbc94a456f356b9648bc47bb9 Mon Sep 17 00:00:00 2001 From: Slqmy <90862990+Slqmy@users.noreply.github.com> Date: Mon, 12 Aug 2024 19:14:06 +0100 Subject: [PATCH] Use the Minecraft server IP for the HTTP server --- .../template_paper_plugin/http_server/HttpServerManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/slqmy/template_paper_plugin/http_server/HttpServerManager.java b/src/main/java/net/slqmy/template_paper_plugin/http_server/HttpServerManager.java index d910b54e..83e733a8 100644 --- a/src/main/java/net/slqmy/template_paper_plugin/http_server/HttpServerManager.java +++ b/src/main/java/net/slqmy/template_paper_plugin/http_server/HttpServerManager.java @@ -21,7 +21,7 @@ public class HttpServerManager { private final TemplatePaperPlugin plugin; - private final String hostName = "localhost"; + private final String hostName; private final int port = 8000; private final int successResponseCode = 200; @@ -44,6 +44,8 @@ public String getSocketAddress() { public HttpServerManager(TemplatePaperPlugin plugin) { this.plugin = plugin; + hostName = Bukkit.getServer().getIp(); + try { server = HttpServer.create(new InetSocketAddress(hostName, port), 0); } catch (IOException exception) {