Hide ChairsAPI init method

This commit is contained in:
Shevchik 2014-07-09 09:19:31 +04:00
parent 05de30f689
commit e8c930e418
3 changed files with 14 additions and 3 deletions

View File

@ -0,0 +1,11 @@
package com.cnaude.chairs.api;
import com.cnaude.chairs.core.PlayerSitData;
public class APIInit {
public void initAPI(PlayerSitData data) {
ChairsAPI.init(data);
}
}

View File

@ -7,7 +7,7 @@ import com.cnaude.chairs.core.PlayerSitData;
public class ChairsAPI {
private static PlayerSitData pdata;
public static void init(PlayerSitData pdata) {
protected static void init(PlayerSitData pdata) {
ChairsAPI.pdata = pdata;
}

View File

@ -14,7 +14,7 @@ import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import com.cnaude.chairs.api.ChairsAPI;
import com.cnaude.chairs.api.APIInit;
import com.cnaude.chairs.commands.ChairsCommand;
import com.cnaude.chairs.commands.ChairsIgnoreList;
import com.cnaude.chairs.listeners.NANLoginListener;
@ -83,7 +83,7 @@ public class Chairs extends JavaPlugin {
getServer().getPluginManager().registerEvents(new TryUnsitEventListener(this), this);
getServer().getPluginManager().registerEvents(new CommandRestrict(this), this);
getCommand("chairs").setExecutor(new ChairsCommand(this, ignoreList));
ChairsAPI.init(getPlayerSitData());
new APIInit().initAPI(getPlayerSitData());
}
@Override