44import java .util .List ;
55
66import org .bukkit .Server ;
7+ import org .bukkit .entity .Player ;
78import org .bukkit .plugin .java .JavaPlugin ;
89import org .slf4j .Logger ;
910
1011import com .froxynetwork .froxyapi .command .Command ;
1112import com .froxynetwork .froxyapi .command .CommandManager ;
13+ import com .froxynetwork .froxyapi .inventory .Inventory ;
14+ import com .froxynetwork .froxyapi .inventory .InventoryManager ;
15+ import com .froxynetwork .froxyapi .inventory .InventoryProvider ;
1216import com .froxynetwork .froxyapi .language .LanguageManager ;
1317import com .froxynetwork .froxyapi .language .Languages ;
1418
@@ -86,7 +90,8 @@ public default Languages getDefaultLanguage() {
8690 * Files name MUST be of this form: "{name}.lang".<br />
8791 * Example: <code>fr_FR.lang or en_US.lang</code>
8892 *
89- * @param path The directory
93+ * @param path
94+ * The directory
9095 */
9196 public default void register (File path ) {
9297 getLanguageManager ().register (path );
@@ -96,21 +101,29 @@ public default void register(File path) {
96101 * Get the default translate of specific message id.<br />
97102 * Same as <code>$(id, getDefaultLanguage(), params)</code>
98103 *
99- * @param id The id of the message
100- * @param params The parameters
101- * @return The message translated by default language, or the id if message id doesn't exist
104+ * @param id
105+ * The id of the message
106+ * @param params
107+ * The parameters
108+ * @return The message translated by default language, or the id if message id
109+ * doesn't exist
102110 */
103111 public default String $ (String id , String ... params ) {
104112 return getLanguageManager ().$ (id , params );
105113 }
106114
107115 /**
108- * Get the translation of specific message id with specific language. If message id not found, return the translation with DEFAULT language
116+ * Get the translation of specific message id with specific language. If message
117+ * id not found, return the translation with DEFAULT language
109118 *
110- * @param id The id of the message
111- * @param lang The specific language
112- * @param params The parameters
113- * @return The message translated by specific language, or the message translated by default language, or the id if message id doesn't exist
119+ * @param id
120+ * The id of the message
121+ * @param lang
122+ * The specific language
123+ * @param params
124+ * The parameters
125+ * @return The message translated by specific language, or the message
126+ * translated by default language, or the id if message id doesn't exist
114127 */
115128 public default String $ (String id , Languages lang , String ... params ) {
116129 return getLanguageManager ().$ (id , lang , params );
@@ -119,22 +132,25 @@ public default void register(File path) {
119132 /**
120133 * Get the translate of specific id with specific language
121134 *
122- * @param id The id of the message
123- * @param lang The specific language
124- * @param params The parameters
125- * @return The message translated by specific language, or the id if message id doesn't exist
135+ * @param id
136+ * The id of the message
137+ * @param lang
138+ * The specific language
139+ * @param params
140+ * The parameters
141+ * @return The message translated by specific language, or the id if message id
142+ * doesn't exist
126143 */
127144 public default String $_ (String id , Languages lang , String ... params ) {
128145 return getLanguageManager ().$_ (id , lang , params );
129146 }
130-
131147
132148 // -----------------------------------------
133149 // | |
134150 // | Command Manager |
135151 // | |
136152 // -----------------------------------------
137-
153+
138154 /**
139155 * @return The CommandManager
140156 */
@@ -169,8 +185,55 @@ public default List<Command> getCommands() {
169185
170186 // -----------------------------------------
171187 // | |
172- // | Other |
188+ // | Inventory Manager |
173189 // | |
174190 // -----------------------------------------
175191
192+ /**
193+ * @return The InventoryManager
194+ */
195+ public InventoryManager getInventoryManager ();
196+
197+ /**
198+ * Create an Inventory and open it
199+ *
200+ * @param provider
201+ * The provider
202+ * @param player
203+ * The player
204+ * @return An inventory
205+ */
206+ public default Inventory openInventory (InventoryProvider provider , Player player ) {
207+ return getInventoryManager ().openInventory (provider , player );
208+ }
209+
210+ /**
211+ * @param p
212+ * Player to check
213+ *
214+ * @return true if specific Player has an opened inventory
215+ */
216+ public default boolean hasInventoryOpened (Player p ) {
217+ return getInventoryManager ().hasInventoryOpened (p );
218+ }
219+
220+ /**
221+ * @param p
222+ * Specific player
223+ * @return The inventory of specific Player. Null if not opened
224+ */
225+ public default Inventory getInventory (Player p ) {
226+ return getInventoryManager ().getInventory (p );
227+ }
228+
229+ /**
230+ * Close player's inventory.<br />
231+ * Same as <code>p.closeInventory();</code>
232+ *
233+ * @param p
234+ * The player
235+ */
236+ public default void closeInventory (Player p ) {
237+ getInventoryManager ().closeInventory (p );
238+ }
176239}
0 commit comments