diff --git a/src/main/java/buttondevteam/presents/hello/HelloComponent.java b/src/main/java/buttondevteam/presents/hello/HelloComponent.java index 3a93a41..bc66783 100644 --- a/src/main/java/buttondevteam/presents/hello/HelloComponent.java +++ b/src/main/java/buttondevteam/presents/hello/HelloComponent.java @@ -15,6 +15,7 @@ import buttondevteam.presents.hello.effects.HelloMagicPotato; import buttondevteam.presents.hello.effects.HelloParticle; import buttondevteam.presents.hello.effects.HelloSound; import buttondevteam.presents.hello.pages.HelloDataPage; +import buttondevteam.presents.hello.pages.HelloPlayersPage; import buttondevteam.presents.hello.pages.HelloWorldPage; public class HelloComponent extends Component{ @@ -35,5 +36,6 @@ public class HelloComponent extends Component{ this.addPage(plugin, new HelloWorldPage()); this.addPage(plugin, new HelloDataPage()); + this.addPage(plugin, new HelloPlayersPage(plugin)); } } diff --git a/src/main/java/buttondevteam/presents/hello/pages/HelloDataPage.java b/src/main/java/buttondevteam/presents/hello/pages/HelloDataPage.java index 2c2dc84..b673a14 100644 --- a/src/main/java/buttondevteam/presents/hello/pages/HelloDataPage.java +++ b/src/main/java/buttondevteam/presents/hello/pages/HelloDataPage.java @@ -15,10 +15,7 @@ public class HelloDataPage extends Page{ @Override public Response handlePage(HttpExchange exchange) { - String responseString = - "
" + data + "
" - + "This is not suspicious shit at all
"; + String responseString = String.valueOf(data); return new Response(200, responseString, exchange); } diff --git a/src/main/java/buttondevteam/presents/hello/pages/HelloPlayersPage.java b/src/main/java/buttondevteam/presents/hello/pages/HelloPlayersPage.java new file mode 100644 index 0000000..1eea68a --- /dev/null +++ b/src/main/java/buttondevteam/presents/hello/pages/HelloPlayersPage.java @@ -0,0 +1,33 @@ +package buttondevteam.presents.hello.pages; + +import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; + +import com.sun.net.httpserver.HttpExchange; + +import buttondevteam.website.io.Response; +import buttondevteam.website.page.Page; + +public class HelloPlayersPage extends Page{ + private JavaPlugin plugin; + + public HelloPlayersPage(JavaPlugin plugin){ + this.plugin = plugin; + } + + @Override + public String GetName() { + // TODO Auto-generated method stub + return "ali/hello/players"; + } + + @Override + public Response handlePage(HttpExchange exchange) { + String playerList = ""; + for(Player player : plugin.getServer().getOnlinePlayers()){ + playerList += player.getPlayerListName() + "