1919import net .swofty .commons .skyblock .statistics .ItemStatistic ;
2020import net .swofty .commons .skyblock .statistics .ItemStatistics ;
2121import net .swofty .commons .skyblock .item .attribute .attributes .ItemAttributePotionData ;
22+ import net .swofty .type .generic .i18n .I18n ;
2223import net .swofty .type .skyblockgeneric .collection .CollectionCategories ;
2324import net .swofty .type .skyblockgeneric .gems .GemRarity ;
2425import net .swofty .type .skyblockgeneric .gems .Gemstone ;
@@ -73,18 +74,18 @@ public void updateLore(@Nullable SkyBlockPlayer player) {
7374 if (effectForName != null ) {
7475 String effectDisplay = effectForName .getLevelDisplay (potionDataForName .getLevel ());
7576 if (potionDataForName .isSplash ()) {
76- displayName = effectDisplay + " Splash Potion" ;
77+ displayName = effectDisplay + " " + I18n . string ( "items.lore.splash_potion_suffix" ) ;
7778 } else {
78- displayName = effectDisplay + " Potion" ;
79+ displayName = effectDisplay + " " + I18n . string ( "items.lore.potion_suffix" ) ;
7980 }
8081 } else if (handler .getPotentialType () != null ) {
81- displayName = handler .getPotentialType ().getDisplayName ( );
82+ displayName = I18n . string ( "items." + handler .getPotentialType ().name () );
8283 } else {
8384 Material material = stack .material ();
8485 displayName = StringUtility .toNormalCase (material .key ().value ());
8586 }
8687 } else if (handler .getPotentialType () != null ) {
87- displayName = handler .getPotentialType ().getDisplayName ( );
88+ displayName = I18n . string ( "items." + handler .getPotentialType ().name () );
8889 } else {
8990 Material material = stack .material ();
9091 displayName = StringUtility .toNormalCase (material .key ().value ());
@@ -123,20 +124,20 @@ public void updateLore(@Nullable SkyBlockPlayer player) {
123124 underNameDisplay .getDisplays ().forEach (line -> addLoreLine ("§8" + line ));
124125
125126 if (type != null && CollectionCategories .getCategory (type ) != null ) {
126- addLoreLine ("§8Collection Item" );
127+ addLoreLine (I18n . string ( "items.lore.collection_item" ) );
127128 }
128129
129130 addLoreLine (null );
130131 } else {
131132 if (type != null && CollectionCategories .getCategory (type ) != null ) {
132- addLoreLine ("§8Collection Item" );
133+ addLoreLine (I18n . string ( "items.lore.collection_item" ) );
133134 addLoreLine (null );
134135 }
135136 }
136137
137138 // Handle Item Statistics
138139 if (handler .isMiningTool ()) {
139- addLoreLine ("§8Breaking Power " + handler .getBreakingPower ());
140+ addLoreLine (I18n . string ( "items.lore.breaking_power" , Map . of ( "value" , String . valueOf ( handler .getBreakingPower ())) ));
140141 addLoreLine (null );
141142 }
142143
@@ -157,7 +158,7 @@ public void updateLore(@Nullable SkyBlockPlayer player) {
157158
158159 if (item .hasComponent (ShortBowComponent .class )) {
159160 ShortBowComponent shortBowComponent = item .getComponent (ShortBowComponent .class );
160- addLoreLine ("§7Shot Cooldown: §a" + shortBowComponent .getCooldown () + "s" );
161+ addLoreLine (I18n . string ( "items.lore.shot_cooldown" , Map . of ( "cooldown" , String . valueOf ( shortBowComponent .getCooldown ()))) );
161162 addNextLine = true ;
162163 }
163164
@@ -291,16 +292,15 @@ public void updateLore(@Nullable SkyBlockPlayer player) {
291292 AbilityComponent abilityComponent = item .getComponent (AbilityComponent .class );
292293
293294 abilityComponent .getAbilities ().forEach (ability -> {
294- addLoreLine ("§6Ability: " + ability .getName () + " §e§l" +
295- ability .getActivation ().getDisplay ());
295+ addLoreLine (I18n .string ("items.lore.ability_label" , Map .of ("name" , ability .getName (), "activation" , ability .getActivation ().getDisplay ())));
296296 for (String line : StringUtility .splitByWordAndLength (ability .getDescription ().apply (player , item ), 40 ))
297297 addLoreLine ("§7" + line );
298298
299299 String costDisplay = ability .getCost ().getLoreDisplay ();
300300 if (costDisplay != null ) addLoreLine (costDisplay );
301301
302302 if (ability .getCooldownTicks () > 20 ) {
303- addLoreLine ("§8Cooldown: §a" + StringUtility .decimalify ((double ) ability .getCooldownTicks () / 20 , 1 ) + "s" );
303+ addLoreLine (I18n . string ( "items.lore.ability_cooldown" , Map . of ( "cooldown" , StringUtility .decimalify ((double ) ability .getCooldownTicks () / 20 , 1 ))) );
304304 }
305305
306306 addLoreLine (null );
@@ -333,13 +333,13 @@ public void updateLore(@Nullable SkyBlockPlayer player) {
333333 }
334334 }
335335 int totalPieces = ArmorSetRegistry .getPieceCount (ArmorSetRegistry .getArmorSet (armorSet .getClass ()));
336- addLoreLine ("§6Full Set Bonus: " + armorSet .getName () + " (" + wearingAmount + "/" + totalPieces + ")" );
336+ addLoreLine (I18n . string ( "items.lore.full_set_bonus" , Map . of ( "name" , armorSet .getName (), "wearing" , String . valueOf ( wearingAmount ), "total" , String . valueOf ( totalPieces ))) );
337337 armorSet .getDescription ().forEach (line -> addLoreLine ("§7" + line ));
338338 addLoreLine (null );
339339 }
340340
341341 if (item .hasComponent (RightClickRecipeComponent .class )) {
342- addLoreLine ("§eRight-click to view recipes!" );
342+ addLoreLine (I18n . string ( "items.lore.right_click_recipes" ) );
343343 addLoreLine (null );
344344 }
345345
@@ -349,19 +349,20 @@ public void updateLore(@Nullable SkyBlockPlayer player) {
349349 }
350350
351351 if (item .hasComponent (ReforgableComponent .class )) {
352- addLoreLine ("§8This item can be reforged!" );
352+ addLoreLine (I18n . string ( "items.lore.reforgeable" ) );
353353 if (handler .getReforge () != null ) displayName = handler .getReforge ().getPrefix () + " " + displayName ;
354354 }
355355
356356 ItemAttributeSoulbound .SoulBoundData bound = handler .getSoulBoundData ();
357- if (bound != null ) addLoreLine ("§8* " + (bound .isCoopAllowed () ? "Co-op " : "" ) + "Soulbound *" );
357+ if (bound != null )
358+ addLoreLine (I18n .string ("items.lore.soulbound" , Map .of ("prefix" , bound .isCoopAllowed () ? I18n .string ("items.lore.soulbound_coop_prefix" ) : "" )));
358359
359360 if (item .hasComponent (ArrowComponent .class )) {
360- addLoreLine ("§8Stats added when shot!" );
361+ addLoreLine (I18n . string ( "items.lore.stats_when_shot" ) );
361362 }
362363
363364 if (item .hasComponent (NotFinishedYetComponent .class )) {
364- addLoreLine ("§c§lITEM IS NOT FINISHED!" );
365+ addLoreLine (I18n . string ( "items.lore.not_finished" ) );
365366 addLoreLine (null );
366367 }
367368
@@ -425,4 +426,3 @@ private void addLoreLine(String line) {
425426 .decorations (Collections .singleton (TextDecoration .ITALIC ), false ));
426427 }
427428}
428-
0 commit comments