diff --git a/eternalcore-core/src/main/java/com/eternalcode/core/feature/home/homeadmin/HomeAdminCommand.java b/eternalcore-core/src/main/java/com/eternalcode/core/feature/home/homeadmin/HomeAdminCommand.java index 23a632f21..3f3c5cd5d 100644 --- a/eternalcore-core/src/main/java/com/eternalcode/core/feature/home/homeadmin/HomeAdminCommand.java +++ b/eternalcore-core/src/main/java/com/eternalcode/core/feature/home/homeadmin/HomeAdminCommand.java @@ -1,6 +1,7 @@ package com.eternalcode.core.feature.home.homeadmin; import com.eternalcode.annotations.scan.command.DescriptionDocs; +import com.eternalcode.core.configuration.implementation.PluginConfiguration; import com.eternalcode.core.feature.home.Home; import com.eternalcode.core.feature.home.HomeManager; import com.eternalcode.core.injector.annotations.Inject; @@ -24,11 +25,17 @@ class HomeAdminCommand { private final HomeManager homeManager; private final NoticeService noticeService; + private final PluginConfiguration pluginConfiguration; @Inject - public HomeAdminCommand(HomeManager homeManager, NoticeService noticeService) { + public HomeAdminCommand( + HomeManager homeManager, + NoticeService noticeService, + PluginConfiguration pluginConfiguration + ) { this.homeManager = homeManager; this.noticeService = noticeService; + this.pluginConfiguration = pluginConfiguration; } @Execute(name = "sethome") @@ -48,6 +55,7 @@ void setHome(@Context Player sender, @Arg PlayerHomeEntry playerHomeEntry, @Arg this.noticeService.create() .notice(translate -> translate.home().overrideHomeLocationAsAdmin()) .placeholder("{HOME}", name) + .placeholder("{PLAYER}", player.getName()) .player(player.getUniqueId()) .send(); @@ -58,6 +66,7 @@ void setHome(@Context Player sender, @Arg PlayerHomeEntry playerHomeEntry, @Arg this.noticeService.create() .notice(translate -> translate.home().createAsAdmin()) .placeholder("{HOME}", name) + .placeholder("{PLAYER}", player.getName()) .player(player.getUniqueId()) .send(); } @@ -77,6 +86,7 @@ void deleteHome(@Context Player sender, @Arg PlayerHomeEntry playerHomeEntry) { this.noticeService.create() .notice(translate -> translate.home().homeList()) .placeholder("{HOMES}", homes) + .placeholder("{PLAYER}", player.getName()) .player(sender.getUniqueId()) .send(); @@ -104,6 +114,7 @@ void home(@Context Player player, @Arg PlayerHomeEntry playerHomeEntry) { this.noticeService.create() .notice(translate -> translate.home().playerNoOwnedHomes()) .placeholder("{HOME}", home.getName()) + .placeholder("{PLAYER}", user.getName()) .player(player.getUniqueId()) .send(); @@ -121,6 +132,7 @@ void list(@Context Viewer viewer, @Arg User user) { this.noticeService.create() .notice(translate -> translate.home().homeListAsAdmin()) .placeholder("{HOMES}", homes) + .placeholder("{PLAYER}", user.getName()) .viewer(viewer) .send(); } @@ -128,7 +140,7 @@ void list(@Context Viewer viewer, @Arg User user) { private String formattedListUserHomes(UUID uniqueId) { return this.homeManager.getHomes(uniqueId).stream() .map(home -> home.getName()) - .collect(Collectors.joining(", ")); + .collect(Collectors.joining(this.pluginConfiguration.format.separator)); } }