Skip to content

Commit eec880e

Browse files
authored
GH-1110 Added vanish messages by staff (#1117)
* Added vanish messages by staff * follow gemini's suggestion * follow mr piotrulla suggestion
1 parent f0d890d commit eec880e

File tree

4 files changed

+22
-7
lines changed

4 files changed

+22
-7
lines changed

eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/VanishCommand.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,14 @@ void vanishSelf(@Context Player player) {
3636
@Permission(VanishPermissionConstant.VANISH_COMMAND_PERMISSION_OTHER)
3737
@DescriptionDocs(description = "Toggle vanish state for another player")
3838
void vanishOther(@Context Player player, @Arg Player target) {
39+
if (player.equals(target)) {
40+
this.vanishSelf(player);
41+
return;
42+
}
43+
3944
boolean vanished = this.vanishService.toggleVanish(target);
40-
this.sendMessage(player, target, vanished ? VanishMessages::vanishEnabledOther : VanishMessages::vanishDisabledOther);
45+
this.sendMessage(player, target, vanished ? VanishMessages::vanishEnabledForOther : VanishMessages::vanishDisabledForOther);
46+
this.sendMessage(target, player, vanished ? VanishMessages::vanishEnabledByStaff : VanishMessages::vanishDisabledByStaff);
4147
}
4248

4349
private void sendMessage(Player sender, Player target, NoticeProvider<VanishMessages> message) {

eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/messages/ENVanishMessages.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ public class ENVanishMessages extends OkaeriConfig implements VanishMessages {
1212
public Notice vanishEnabled = Notice.chat("<green>► <white>Vanish mode enabled!");
1313
public Notice vanishDisabled = Notice.chat("<red>► <white>Vanish mode disabled!");
1414

15-
public Notice vanishEnabledOther = Notice.chat("<green>► <white>{PLAYER} has enabled vanish mode!");
16-
public Notice vanishDisabledOther = Notice.chat("<red>► <white>{PLAYER} has disabled vanish mode!");
15+
public Notice vanishEnabledForOther = Notice.chat("<green>► <white>Enabled vanish mode for <green>{PLAYER}!");
16+
public Notice vanishDisabledForOther = Notice.chat("<red>► <white>Disabled vanish mode for <green>{PLAYER}!");
17+
18+
public Notice vanishEnabledByStaff = Notice.chat("<green>► <white>Administrator <green>{PLAYER} <white>has enabled your vanish mode!");
19+
public Notice vanishDisabledByStaff = Notice.chat("<green>► <white>Administrator <green>{PLAYER} <white>has disabled your vanish mode!");
1720

1821
public Notice currentlyInVanish = Notice.actionbar("<gradient:#9d6eef:#A1AAFF:#9d6eef>You are currently invisible!</gradient> <dark_gray>(<gray>/vanish</gray>)</dark_gray>");
1922

eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/messages/PLVanishMessages.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ public class PLVanishMessages extends OkaeriConfig implements VanishMessages {
1212
public Notice vanishEnabled = Notice.chat("<green>► <white>Włączono tryb niewidoczności!");
1313
public Notice vanishDisabled = Notice.chat("<red>► <white>Wyłączono tryb niewidoczności!");
1414

15-
public Notice vanishEnabledOther = Notice.chat("<green>► <white>{PLAYER} włączył tryb niewidoczności!");
16-
public Notice vanishDisabledOther = Notice.chat("<red>► <white>{PLAYER} wyłączył tryb niewidoczności!");
15+
public Notice vanishEnabledForOther = Notice.chat("<green>► <white>Włączono tryb niewidzialności dla <green>{PLAYER}!");
16+
public Notice vanishDisabledForOther = Notice.chat("<red>► <white>Wyłączono tryb niewidzialności dla <green>{PLAYER}!");
17+
18+
public Notice vanishEnabledByStaff = Notice.chat("<green>► <white>Administrator <green>{PLAYER} <white>włączył Ci tryb niewidzialności!");
19+
public Notice vanishDisabledByStaff = Notice.chat("<green>► <white>Administrator <green>{PLAYER} <white>wyłączył Ci tryb niewidzialności!");
1720

1821
public Notice currentlyInVanish = Notice.actionbar("<gradient:#9d6eef:#A1AAFF:#9d6eef>Jesteś obecnie niewidzialny!</gradient> <dark_gray>(<gray>/vanish</gray>)</dark_gray>");
1922

eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/messages/VanishMessages.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ public interface VanishMessages {
77
Notice vanishEnabled();
88
Notice vanishDisabled();
99

10-
Notice vanishEnabledOther();
11-
Notice vanishDisabledOther();
10+
Notice vanishEnabledForOther();
11+
Notice vanishDisabledForOther();
12+
13+
Notice vanishEnabledByStaff();
14+
Notice vanishDisabledByStaff();
1215

1316
Notice currentlyInVanish();
1417

0 commit comments

Comments
 (0)