1111import fr .maxlego08 .menu .api .players .inventory .InventoriesPlayer ;
1212import fr .maxlego08 .menu .api .storage .StorageManager ;
1313import fr .maxlego08 .menu .api .utils .MetaUpdater ;
14+ import fr .maxlego08 .menu .api .utils .toast .ToastHelper ;
1415import org .bukkit .OfflinePlayer ;
1516import org .bukkit .configuration .file .YamlConfiguration ;
1617import org .bukkit .entity .Player ;
2223
2324public interface MenuPlugin extends Plugin {
2425
26+ /**
27+ * Retrieves the scheduler associated with this plugin.
28+ * This scheduler is responsible for running tasks asynchronously.
29+ *
30+ * @return the scheduler.
31+ */
2532 PlatformScheduler getScheduler ();
2633
34+ /**
35+ * Retrieves the manager responsible for handling inventory-related operations.
36+ * This manager provides methods for creating, managing and retrieving inventories.
37+ *
38+ * @return the inventory manager.
39+ */
2740 InventoryManager getInventoryManager ();
2841
42+ /**
43+ * Retrieves the manager responsible for handling button-related operations.
44+ * This manager provides methods for managing button states and interactions.
45+ *
46+ * @return the button manager.
47+ */
2948 ButtonManager getButtonManager ();
3049
50+ /**
51+ * Returns the instance of the pattern manager.
52+ *
53+ * @return the pattern manager.
54+ */
3155 PatternManager getPatternManager ();
3256
33- <T > T getProvider (Class <T > headManagerClass );
57+ /**
58+ * Retrieves a service provider of the specified class type.
59+ *
60+ * @param classPath the class type of the provider to retrieve.
61+ * @param <T> the type of the service provider.
62+ */
63+ <T > T getProvider (Class <T > classPath );
3464
65+ /**
66+ * Replaces placeholders in the given string with actual values for the given player.
67+ * Placeholders are specified in the format %placeholder% and are replaced with actual values.
68+ * If the placeholder does not exist, the placeholder is kept as is.
69+ *
70+ * @param player the player to substitute placeholders for.
71+ * @param string the string to replace placeholders in.
72+ * @return a string with placeholders replaced.
73+ */
3574 String parse (Player player , String string );
3675
76+ /**
77+ * Replaces placeholders in the given string with actual values for the given offline player.
78+ * Placeholders are specified in the format %placeholder% and are replaced with actual values.
79+ * If the placeholder does not exist, the placeholder is kept as is.
80+ *
81+ * @param offlinePlayer the offline player to substitute placeholders for.
82+ * @param string the string to replace placeholders in.
83+ * @return a string with placeholders replaced.
84+ */
3785 String parse (OfflinePlayer offlinePlayer , String string );
3886
87+ /**
88+ * Replaces placeholders in a list of strings with actual values for the given player.
89+ * Placeholders are specified in the format %placeholder% and are replaced with actual values.
90+ * If the placeholder does not exist, the placeholder is kept as is.
91+ *
92+ * @param player the player to substitute placeholders for.
93+ * @param strings the list of strings to replace placeholders in.
94+ * @return a list of strings with placeholders replaced.
95+ */
3996 List <String > parse (Player player , List <String > strings );
4097
98+ /**
99+ * Replaces placeholders in a list of strings with actual values for the given offline player.
100+ * Placeholders are specified in the format %placeholder% and are replaced with actual values.
101+ * If the placeholder does not exist, the placeholder is kept as is.
102+ *
103+ * @param offlinePlayer the player to substitute placeholders for.
104+ * @param strings the list of strings to replace placeholders in.
105+ * @return a list of strings with placeholders replaced.
106+ */
41107 List <String > parse (OfflinePlayer offlinePlayer , List <String > strings );
42108
109+ /**
110+ * Retrieves the manager responsible for player inventory related operations.
111+ * This manager provides methods for managing player inventory state,
112+ * such as saving, loading, and clearing inventories.
113+ *
114+ * @return The manager responsible for player inventory related operations.
115+ */
43116 InventoriesPlayer getInventoriesPlayer ();
44117
118+ /**
119+ * Retrieves a map of global placeholders.
120+ * This method returns a map where the keys are placeholder strings
121+ * and the values are the corresponding objects.
122+ * These placeholders are used for dynamic content replacement
123+ * throughout the plugin.
124+ *
125+ * @return A map containing global placeholders and their values.
126+ */
45127 Map <String , Object > getGlobalPlaceholders ();
46128
129+ /**
130+ * Retrieves the font image utility for managing custom fonts.
131+ *
132+ * @return An instance of {@link FontImage} for handling font images.
133+ */
47134 FontImage getFontImage ();
48135
136+ /**
137+ * Returns the data manager.
138+ * This method returns the data manager, which is used for managing data related to players.
139+ * The data manager is used for managing data related to players.
140+ *
141+ * @return the data manager
142+ */
49143 DataManager getDataManager ();
50144
145+ /**
146+ * Returns the dupe manager.
147+ * This method returns the dupe manager, which is responsible for managing
148+ * the duplication detection and protection logic within the plugin.
149+ * The dupe manager can be used to check if items are duplicated and to
150+ * apply protection against duplication exploits.
151+ *
152+ * @return the dupe manager
153+ */
51154 DupeManager getDupeManager ();
52155
156+ /**
157+ * Returns the enchantments manager.
158+ * This method returns the enchantments manager, which is used for managing custom enchantments.
159+ * The enchantments manager is used for managing custom enchantments.
160+ *
161+ * @return the enchantments manager
162+ */
53163 Enchantments getEnchantments ();
54164
165+ /**
166+ * Returns the meta updater.
167+ * This method returns the meta updater, which is used for updating the item meta.
168+ * The meta updater is used for updating the item meta.
169+ *
170+ * @return the meta updater
171+ */
55172 MetaUpdater getMetaUpdater ();
56173
174+ /**
175+ * Returns the command manager.
176+ * This method returns the command manager, which is used for registering and
177+ * executing commands.
178+ * The command manager is used for registering and executing commands.
179+ *
180+ * @return the command manager
181+ */
57182 CommandManager getCommandManager ();
58183
184+ /**
185+ * Returns the storage manager.
186+ * This method returns the storage manager, which is used for storing and retrieving data.
187+ * The storage manager is used for storing and retrieving data from the database or other
188+ * storage systems.
189+ *
190+ * @return the storage manager
191+ */
59192 StorageManager getStorageManager ();
60193
194+ /**
195+ * Checks if the plugin is a Folia plugin.
196+ * This method returns a boolean indicating whether the plugin is a Folia plugin.
197+ * This method is useful for checking if the plugin is a Folia plugin before using any
198+ * methods that require a Folia plugin.
199+ *
200+ * @return true if the plugin is a Folia plugin, false otherwise
201+ */
61202 boolean isFolia ();
62203
204+ /**
205+ * Registers a placeholder that can be used globally in the plugin.
206+ * This method allows you to register a placeholder that can be used in any menu item stack.
207+ * The placeholder is specified by the given startWith string, and the biConsumer parameter
208+ * is a function that takes an OfflinePlayer and returns a string. The return value of this
209+ * function is the replacement string for the given placeholder.
210+ *
211+ * @param startWith the startWith string for the placeholder.
212+ * @param biConsumer the function that provides the replacement string for the placeholder.
213+ */
63214 void registerPlaceholder (String startWith , ReturnBiConsumer <OfflinePlayer , String , String > biConsumer );
64215
65216 /**
@@ -73,4 +224,12 @@ public interface MenuPlugin extends Plugin {
73224 * @return the loaded menu item stack.
74225 */
75226 MenuItemStack loadItemStack (YamlConfiguration configuration , String path , File file );
227+
228+ /**
229+ * Returns the ToastHelper object for this plugin.
230+ * The ToastHelper allows you to create and send toasts to players.
231+ *
232+ * @return the ToastHelper object.
233+ */
234+ ToastHelper getToastHelper ();
76235}
0 commit comments