Fixes, added plugin.yml...

Now it works!
This commit is contained in:
Norbi Peti 2017-05-31 17:15:20 +02:00
parent e5c8c5a1e0
commit f1a20c1498
2 changed files with 13 additions and 4 deletions

6
plugin.yml Normal file
View file

@ -0,0 +1,6 @@
name: ButtonWebsiteModule
main: buttondevteam.website.ButtonWebsiteModule
version: 4.0
author: NorbiPeti
depend:
- ButtonCore

View file

@ -16,11 +16,14 @@ public class ButtonWebsiteModule extends JavaPlugin {
@Override
public void onEnable() {
try {
server = HttpServer.create(new InetSocketAddress(InetAddress.getLocalHost(), 8080), 10);
server = HttpServer.create(new InetSocketAddress((InetAddress) null, 8080), 10);
addPage(new IndexPage());
Bukkit.getScheduler().runTaskAsynchronously(this, () -> this.getLogger().info("Starting webserver..."));
Bukkit.getScheduler().runTaskAsynchronously(this, server::start);
Bukkit.getScheduler().runTaskAsynchronously(this, () -> this.getLogger().info("Webserver started"));
Bukkit.getScheduler().runTaskAsynchronously(this, () -> {
this.getLogger().info("Starting webserver...");
((Runnable) server::start).run(); // Totally normal way of calling a method
this.getLogger().info("Webserver started");
});
} catch (Exception e) {
TBMCCoreAPI.SendException("An error occured while starting the webserver!", e);
}