11package com .eternalcode .core .feature .home .homeadmin ;
22
33import com .eternalcode .annotations .scan .command .DescriptionDocs ;
4+ import com .eternalcode .core .configuration .implementation .PluginConfiguration ;
45import com .eternalcode .core .feature .home .Home ;
56import com .eternalcode .core .feature .home .HomeManager ;
67import com .eternalcode .core .injector .annotations .Inject ;
@@ -24,11 +25,17 @@ class HomeAdminCommand {
2425
2526 private final HomeManager homeManager ;
2627 private final NoticeService noticeService ;
28+ private final PluginConfiguration pluginConfiguration ;
2729
2830 @ Inject
29- public HomeAdminCommand (HomeManager homeManager , NoticeService noticeService ) {
31+ public HomeAdminCommand (
32+ HomeManager homeManager ,
33+ NoticeService noticeService ,
34+ PluginConfiguration pluginConfiguration
35+ ) {
3036 this .homeManager = homeManager ;
3137 this .noticeService = noticeService ;
38+ this .pluginConfiguration = pluginConfiguration ;
3239 }
3340
3441 @ Execute (name = "sethome" )
@@ -48,6 +55,7 @@ void setHome(@Context Player sender, @Arg PlayerHomeEntry playerHomeEntry, @Arg
4855 this .noticeService .create ()
4956 .notice (translate -> translate .home ().overrideHomeLocationAsAdmin ())
5057 .placeholder ("{HOME}" , name )
58+ .placeholder ("{PLAYER}" , player .getName ())
5159 .player (player .getUniqueId ())
5260 .send ();
5361
@@ -58,6 +66,7 @@ void setHome(@Context Player sender, @Arg PlayerHomeEntry playerHomeEntry, @Arg
5866 this .noticeService .create ()
5967 .notice (translate -> translate .home ().createAsAdmin ())
6068 .placeholder ("{HOME}" , name )
69+ .placeholder ("{PLAYER}" , player .getName ())
6170 .player (player .getUniqueId ())
6271 .send ();
6372 }
@@ -77,6 +86,7 @@ void deleteHome(@Context Player sender, @Arg PlayerHomeEntry playerHomeEntry) {
7786 this .noticeService .create ()
7887 .notice (translate -> translate .home ().homeList ())
7988 .placeholder ("{HOMES}" , homes )
89+ .placeholder ("{PLAYER}" , player .getName ())
8090 .player (sender .getUniqueId ())
8191 .send ();
8292
@@ -104,6 +114,7 @@ void home(@Context Player player, @Arg PlayerHomeEntry playerHomeEntry) {
104114 this .noticeService .create ()
105115 .notice (translate -> translate .home ().playerNoOwnedHomes ())
106116 .placeholder ("{HOME}" , home .getName ())
117+ .placeholder ("{PLAYER}" , user .getName ())
107118 .player (player .getUniqueId ())
108119 .send ();
109120
@@ -121,14 +132,15 @@ void list(@Context Viewer viewer, @Arg User user) {
121132 this .noticeService .create ()
122133 .notice (translate -> translate .home ().homeListAsAdmin ())
123134 .placeholder ("{HOMES}" , homes )
135+ .placeholder ("{PLAYER}" , user .getName ())
124136 .viewer (viewer )
125137 .send ();
126138 }
127139
128140 private String formattedListUserHomes (UUID uniqueId ) {
129141 return this .homeManager .getHomes (uniqueId ).stream ()
130142 .map (home -> home .getName ())
131- .collect (Collectors .joining (", " ));
143+ .collect (Collectors .joining (this . pluginConfiguration . format . separator ));
132144 }
133145}
134146
0 commit comments