@@ -30,6 +30,7 @@ public SpawnerMenuFormUI(SmartSpawner plugin) {
3030 public void openSpawnerForm (Player player , SpawnerData spawner ) {
3131 String entityName = languageManager .getFormattedMobName (spawner .getEntityType ());
3232 Map <String , String > placeholders = new HashMap <>();
33+ placeholders .put ("ᴇɴᴛɪᴛʏ" , entityName );
3334 placeholders .put ("entity" , entityName );
3435 placeholders .put ("amount" , String .valueOf (spawner .getStackSize ()));
3536
@@ -50,7 +51,7 @@ public void openSpawnerForm(Player player, SpawnerData spawner) {
5051
5152 // Collect available buttons based on layout and permissions
5253 List <ButtonInfo > availableButtons = collectAvailableButtons (layout , player , spawner , placeholders );
53-
54+
5455 if (availableButtons .isEmpty ()) {
5556 messageService .sendMessage (player , "no_permission" );
5657 return ;
@@ -75,7 +76,7 @@ public void openSpawnerForm(Player player, SpawnerData spawner) {
7576 int buttonId = response .clickedButtonId ();
7677 if (buttonId >= 0 && buttonId < availableButtons .size ()) {
7778 ButtonInfo buttonInfo = availableButtons .get (buttonId );
78-
79+
7980 // Schedule the action to run on the main server thread
8081 plugin .getServer ().getScheduler ().runTask (plugin , () -> {
8182 handleButtonAction (player , spawner , buttonInfo .action );
@@ -90,18 +91,18 @@ public void openSpawnerForm(Player player, SpawnerData spawner) {
9091
9192 private List <ButtonInfo > collectAvailableButtons (GuiLayout layout , Player player , SpawnerData spawner , Map <String , String > placeholders ) {
9293 List <ButtonInfo > buttons = new ArrayList <>();
93-
94+
9495 // Check for storage button
9596 GuiButton storageButton = layout .getButton ("storage" );
9697 if (storageButton != null && storageButton .isEnabled ()) {
9798 String text = languageManager .getGuiItemName ("bedrock_gui.buttons.storage" , placeholders );
98- buttons .add (new ButtonInfo ("open_storage" , text , "https://img.icons8 .com/?size=100&id=e78DnJp8bhmX&format= png&color=000000 " ));
99+ buttons .add (new ButtonInfo ("open_storage" , text , "https://art.pixilart .com/sr2f53a0222ccaws3. png" ));
99100 }
100101
101102 // Check for spawner info/stacker button
102103 boolean hasShopPermission = plugin .hasSellIntegration () && player .hasPermission ("smartspawner.sellall" );
103104 GuiButton spawnerInfoButton = getSpawnerInfoButton (layout , hasShopPermission );
104- if (spawnerInfoButton != null && spawnerInfoButton .isEnabled () &&
105+ if (spawnerInfoButton != null && spawnerInfoButton .isEnabled () &&
105106 player .hasPermission ("smartspawner.stack" )) {
106107 String text = languageManager .getGuiItemName ("bedrock_gui.buttons.stack_info" , placeholders );
107108 buttons .add (new ButtonInfo ("open_stacker" , text , "https://static.wikia.nocookie.net/minecraft_gamepedia/images/c/cf/Spawner_with_fire.png/revision/latest?cb=20190925003048" ));
@@ -110,8 +111,8 @@ private List<ButtonInfo> collectAvailableButtons(GuiLayout layout, Player player
110111 // Check for sell_inventory button (Claim XP and Sell All)
111112 if (hasShopPermission ) {
112113 GuiButton sellInventoryButton = layout .getButton ("spawner_info_with_shop" );
113- if (sellInventoryButton != null && sellInventoryButton .isEnabled () &&
114- sellInventoryButton .getAction ("left_click" ) != null &&
114+ if (sellInventoryButton != null && sellInventoryButton .isEnabled () &&
115+ sellInventoryButton .getAction ("left_click" ) != null &&
115116 sellInventoryButton .getAction ("left_click" ).equals ("sell_inventory" )) {
116117 String text = languageManager .getGuiItemName ("bedrock_gui.buttons.sell_inventory" , placeholders );
117118 buttons .add (new ButtonInfo ("sell_inventory" , text , "https://img.icons8.com/?size=100&id=12815&format=png&color=FFD700" ));
@@ -156,7 +157,7 @@ private GuiButton getSpawnerInfoButton(GuiLayout layout, boolean hasShopPermissi
156157 private String createInfoContent (Player player , SpawnerData spawner ) {
157158 // Get configured info content from language file - use hardcoded header as fallback
158159 String header = "INFORMATION:" ;
159-
160+
160161 StringBuilder content = new StringBuilder ();
161162 content .append (header ).append ("\n \n " );
162163
@@ -165,10 +166,10 @@ private String createInfoContent(Player player, SpawnerData spawner) {
165166
166167 // Add spawner info section
167168 addConfiguredSection (content , "spawner_info" , placeholders );
168-
169+
169170 // Add storage info section
170171 addConfiguredSection (content , "storage_info" , placeholders );
171-
172+
172173 // Add experience info section
173174 addConfiguredSection (content , "experience_info" , placeholders );
174175
@@ -177,7 +178,7 @@ private String createInfoContent(Player player, SpawnerData spawner) {
177178
178179 private Map <String , String > createContentPlaceholders (Player player , SpawnerData spawner ) {
179180 Map <String , String > placeholders = new HashMap <>();
180-
181+
181182 // Entity information
182183 String entityName = languageManager .getFormattedMobName (spawner .getEntityType ());
183184 String entityNameSmallCaps = languageManager .getSmallCaps (entityName );
@@ -194,11 +195,10 @@ private Map<String, String> createContentPlaceholders(Player player, SpawnerData
194195 int maxSlots = spawner .getMaxSpawnerLootSlots ();
195196 double percentStorageDecimal = maxSlots > 0 ? ((double ) currentItems / maxSlots ) * 100 : 0 ;
196197 String formattedPercentStorage = String .format ("%.1f" , percentStorageDecimal );
197-
198+
198199 placeholders .put ("current_items" , String .valueOf (currentItems ));
199200 placeholders .put ("max_items" , languageManager .formatNumber (maxSlots ));
200201 placeholders .put ("formatted_storage" , formattedPercentStorage );
201- placeholders .put ("storage_status" , getStorageStatus (currentItems , maxSlots ));
202202
203203 // Experience information
204204 long currentExp = spawner .getSpawnerExp ();
@@ -211,21 +211,19 @@ private Map<String, String> createContentPlaceholders(Player player, SpawnerData
211211 placeholders .put ("current_exp" , formattedCurrentExp );
212212 placeholders .put ("max_exp" , formattedMaxExp );
213213 placeholders .put ("formatted_exp" , formattedPercentExp );
214- placeholders .put ("exp_status" , getExpStatus (currentExp , maxExp ));
215214
216215 return placeholders ;
217216 }
218217
219218 private void addConfiguredSection (StringBuilder content , String sectionName , Map <String , String > placeholders ) {
220219 // Use the GUI item lore method which can access configuration
221220 List <String > sectionLines = languageManager .getGuiItemLoreAsList ("bedrock_gui.info_content.sections." + sectionName , placeholders );
222-
223221 // If the configuration key doesn't exist, add default content
224222 if (sectionLines .isEmpty ()) {
225223 addDefaultSection (content , sectionName , placeholders );
226224 return ;
227225 }
228-
226+
229227 for (String line : sectionLines ) {
230228 content .append (line ).append ("\n " );
231229 }
@@ -253,28 +251,6 @@ private void addDefaultSection(StringBuilder content, String sectionName, Map<St
253251 }
254252 }
255253
256- private String getStorageStatus (int current , int max ) {
257- double ratio = max > 0 ? (double ) current / max : 0 ;
258- Map <String , String > placeholders = new HashMap <>();
259-
260- if (ratio >= 0.9 ) return languageManager .getGuiItemName ("bedrock_gui.status.storage.nearly_full" , placeholders );
261- if (ratio >= 0.7 ) return languageManager .getGuiItemName ("bedrock_gui.status.storage.filling_up" , placeholders );
262- if (ratio >= 0.4 ) return languageManager .getGuiItemName ("bedrock_gui.status.storage.half_full" , placeholders );
263- if (ratio > 0 ) return languageManager .getGuiItemName ("bedrock_gui.status.storage.plenty_space" , placeholders );
264- return languageManager .getGuiItemName ("bedrock_gui.status.storage.empty" , placeholders );
265- }
266-
267- private String getExpStatus (long current , long max ) {
268- double ratio = max > 0 ? (double ) current / max : 0 ;
269- Map <String , String > placeholders = new HashMap <>();
270-
271- if (ratio >= 0.9 ) return languageManager .getGuiItemName ("bedrock_gui.status.experience.almost_full" , placeholders );
272- if (ratio >= 0.7 ) return languageManager .getGuiItemName ("bedrock_gui.status.experience.large_amount" , placeholders );
273- if (ratio >= 0.4 ) return languageManager .getGuiItemName ("bedrock_gui.status.experience.medium_amount" , placeholders );
274- if (ratio > 0 ) return languageManager .getGuiItemName ("bedrock_gui.status.experience.small_amount" , placeholders );
275- return languageManager .getGuiItemName ("bedrock_gui.status.experience.empty" , placeholders );
276- }
277-
278254 private void handleButtonAction (Player player , SpawnerData spawner , String action ) {
279255 switch (action ) {
280256 case "open_storage" :
0 commit comments