From 94c43fd0faae4b52ef534381db29800565278b46 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Wed, 22 Dec 2010 15:21:16 +0000 Subject: [PATCH] Add Player interface By: Dinnerbone --- paper-api/src/org/bukkit/Player.java | 22 ++++++++++++++++++++++ paper-api/src/org/bukkit/Server.java | 7 +++++++ 2 files changed, 29 insertions(+) create mode 100644 paper-api/src/org/bukkit/Player.java diff --git a/paper-api/src/org/bukkit/Player.java b/paper-api/src/org/bukkit/Player.java new file mode 100644 index 0000000000..3d14384998 --- /dev/null +++ b/paper-api/src/org/bukkit/Player.java @@ -0,0 +1,22 @@ + +package org.bukkit; + +/** + * Represents a player, connected or not + * + */ +public interface Player { + /** + * Returns the name of this player + * + * @return Player name + */ + public String getName(); + + /** + * Checks if this player is currently online + * + * @return true if they are online + */ + public boolean isOnline(); +} diff --git a/paper-api/src/org/bukkit/Server.java b/paper-api/src/org/bukkit/Server.java index bae1b707d2..f6ab34ec2c 100644 --- a/paper-api/src/org/bukkit/Server.java +++ b/paper-api/src/org/bukkit/Server.java @@ -18,4 +18,11 @@ public interface Server { * @return version of this server implementation */ public String getVersion(); + + /** + * Gets a list of all currently logged in players + * + * @return An array of Players that are currently online + */ + public Player[] getOnlinePlayers(); }