From e8c930e418c5803dcb97ed2a1379a6f203fb3a1b Mon Sep 17 00:00:00 2001 From: Shevchik Date: Wed, 9 Jul 2014 09:19:31 +0400 Subject: [PATCH] Hide ChairsAPI init method --- src/com/cnaude/chairs/api/APIInit.java | 11 +++++++++++ src/com/cnaude/chairs/api/ChairsAPI.java | 2 +- src/com/cnaude/chairs/core/Chairs.java | 4 ++-- 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 src/com/cnaude/chairs/api/APIInit.java diff --git a/src/com/cnaude/chairs/api/APIInit.java b/src/com/cnaude/chairs/api/APIInit.java new file mode 100644 index 0000000..06cfe8f --- /dev/null +++ b/src/com/cnaude/chairs/api/APIInit.java @@ -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); + } + +} diff --git a/src/com/cnaude/chairs/api/ChairsAPI.java b/src/com/cnaude/chairs/api/ChairsAPI.java index 7c2abbf..87cdbeb 100644 --- a/src/com/cnaude/chairs/api/ChairsAPI.java +++ b/src/com/cnaude/chairs/api/ChairsAPI.java @@ -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; } diff --git a/src/com/cnaude/chairs/core/Chairs.java b/src/com/cnaude/chairs/core/Chairs.java index 3c81d85..6275cf9 100644 --- a/src/com/cnaude/chairs/core/Chairs.java +++ b/src/com/cnaude/chairs/core/Chairs.java @@ -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