1- package com .eternalcode .core .feature .essentials . item . itemedit ;
1+ package com .eternalcode .core .feature .itemedit ;
22
33import com .eternalcode .annotations .scan .command .DescriptionDocs ;
44import com .eternalcode .commons .adventure .AdventureUtil ;
55import com .eternalcode .core .injector .annotations .Inject ;
66import com .eternalcode .core .notice .NoticeService ;
77import dev .rollczi .litecommands .annotations .argument .Arg ;
8+ import dev .rollczi .litecommands .annotations .command .Command ;
89import dev .rollczi .litecommands .annotations .context .Context ;
9- import dev .rollczi .litecommands .annotations .join .Join ;
1010import dev .rollczi .litecommands .annotations .execute .Execute ;
11+ import dev .rollczi .litecommands .annotations .join .Join ;
1112import dev .rollczi .litecommands .annotations .permission .Permission ;
12- import dev .rollczi .litecommands .annotations .command .Command ;
13+ import java .util .ArrayList ;
14+ import java .util .List ;
1315import net .kyori .adventure .text .minimessage .MiniMessage ;
14- import net .kyori .adventure .text .serializer .gson .GsonComponentSerializer ;
1516import org .bukkit .Material ;
1617import org .bukkit .entity .Player ;
1718import org .bukkit .inventory .ItemStack ;
1819import org .bukkit .inventory .meta .ItemMeta ;
1920
20- import java .util .ArrayList ;
21- import java .util .List ;
22-
2321@ Command (name = "itemlore" )
2422@ Permission ("eternalcore.itemlore" )
2523class ItemLoreCommand {
@@ -44,19 +42,14 @@ void execute(@Context Player player, @Arg(ItemLoreArgument.KEY) int line, @Join
4442 }
4543
4644 ItemMeta itemMeta = itemStack .getItemMeta ();
47-
4845 List <String > lore = itemMeta .getLore ();
4946 lore = lore == null ? new ArrayList <>() : new ArrayList <>(lore );
5047
5148 while (lore .size () <= line ) {
5249 lore .add ("" );
5350 }
5451
55- // Serialize using GsonComponentSerializer for modern Minecraft versions
56- String json = GsonComponentSerializer .gson ().serialize (
57- AdventureUtil .resetItalic (this .miniMessage .deserialize (text ))
58- );
59- lore .set (line , json );
52+ lore .set (line , AdventureUtil .SECTION_SERIALIZER .serialize (AdventureUtil .resetItalic (this .miniMessage .deserialize (text ))));
6053
6154 itemMeta .setLore (lore );
6255 itemStack .setItemMeta (itemMeta );
@@ -95,7 +88,11 @@ void remove(@Context Player player, @Arg(ItemLoreArgument.KEY) int line) {
9588 itemMeta .setLore (lore );
9689 itemStack .setItemMeta (itemMeta );
9790
98- this .noticeService .player (player .getUniqueId (), translation -> translation .itemEdit ().itemLoreLineRemoved ());
91+ this .noticeService .create ()
92+ .player (player .getUniqueId ())
93+ .notice (translation -> translation .itemEdit ().itemLoreLineRemoved ())
94+ .placeholder ("{LINE}" , String .valueOf (line + 1 ))
95+ .send ();
9996 }
10097
10198 @ Execute (name = "clear" )
0 commit comments