rename plugin as api

This commit is contained in:
Michel Roux 2012-05-11 11:15:54 +02:00
parent 1ebfca911c
commit becbe1be80
2 changed files with 8 additions and 8 deletions

View File

@ -20,7 +20,7 @@ public class Group {
} }
public List<String> getPlayers() { public List<String> getPlayers() {
return plugin.plugin.getAllPlayers(); return plugin.api.getAllPlayers();
} }
public List<Player> getOnlinePlayers() { public List<Player> getOnlinePlayers() {

View File

@ -10,10 +10,10 @@ import org.bukkit.plugin.java.JavaPlugin;
public class PermissionsPlugin extends JavaPlugin { public class PermissionsPlugin extends JavaPlugin {
protected SimplyAPI plugin; protected SimplyAPI api;
public void onEnable() { public void onEnable() {
plugin = ((SimplyPlugin) getServer().getPluginManager().getPlugin("SimplyPerms")).getAPI(); api = ((SimplyPlugin) getServer().getPluginManager().getPlugin("SimplyPerms")).getAPI();
} }
// -- External API // -- External API
@ -25,7 +25,7 @@ public class PermissionsPlugin extends JavaPlugin {
* @return A Group if it exists or null otherwise. * @return A Group if it exists or null otherwise.
*/ */
public Group getGroup(String groupName) { public Group getGroup(String groupName) {
if (plugin.getAllGroups().contains(groupName)) { if (api.getAllGroups().contains(groupName)) {
return new Group(this, groupName); return new Group(this, groupName);
} }
return null; return null;
@ -40,12 +40,12 @@ public class PermissionsPlugin extends JavaPlugin {
*/ */
public List<Group> getGroups(String playerName) { public List<Group> getGroups(String playerName) {
ArrayList<Group> result = new ArrayList<Group>(); ArrayList<Group> result = new ArrayList<Group>();
if (plugin.isPlayerInDB(playerName)) { if (api.isPlayerInDB(playerName)) {
for (String key : plugin.getPlayerGroups(playerName)) { for (String key : api.getPlayerGroups(playerName)) {
result.add(new Group(this, key)); result.add(new Group(this, key));
} }
} else { } else {
result.add(new Group(this, plugin.getDefaultGroup())); result.add(new Group(this, api.getDefaultGroup()));
} }
return result; return result;
} }
@ -57,7 +57,7 @@ public class PermissionsPlugin extends JavaPlugin {
*/ */
public List<Group> getAllGroups() { public List<Group> getAllGroups() {
ArrayList<Group> result = new ArrayList<Group>(); ArrayList<Group> result = new ArrayList<Group>();
for (String key : plugin.getAllGroups()) { for (String key : api.getAllGroups()) {
result.add(new Group(this, key)); result.add(new Group(this, key));
} }
return result; return result;