Skip to content

Commit 08a35b3

Browse files
committed
Move Teleport-related messages to dedicate classes. (migration is not needed, nothing changed).
1 parent 65ebd6c commit 08a35b3

File tree

10 files changed

+156
-138
lines changed

10 files changed

+156
-138
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
package com.eternalcode.core.feature.teleport.messages;
2+
3+
import com.eternalcode.multification.notice.Notice;
4+
import eu.okaeri.configs.OkaeriConfig;
5+
import eu.okaeri.configs.annotation.Comment;
6+
import lombok.Getter;
7+
import lombok.experimental.Accessors;
8+
9+
@Getter
10+
@Accessors(fluent = true)
11+
public class ENTeleportMessages extends OkaeriConfig implements TeleportMessages {
12+
// teleport
13+
@Comment({"# {PLAYER} - Teleported players"})
14+
Notice teleportedToPlayer =
15+
Notice.chat("<green>► <white>Successfully teleported to <green>{PLAYER}<white>!");
16+
17+
@Comment({"# {PLAYER} - Teleported player, {ARG-PLAYER} - Player to whom another player has been transferred"})
18+
Notice teleportedPlayerToPlayer =
19+
Notice.chat("<green>► <white>Successfully teleported <green>{PLAYER} <white>to <green>{ARG-PLAYER}<white>!");
20+
21+
@Comment({"# {Y} - Y coordinate of the highest block"})
22+
Notice teleportedToHighestBlock =
23+
Notice.chat("<green>► <white>Teleported successfully to the highest block! (Y: {Y})");
24+
25+
@Comment(" ")
26+
Notice teleportedAllToPlayer = Notice.chat("<green>► <white>All players have been teleported to you!");
27+
28+
// Task
29+
@Comment({"# {TIME} - Teleportation time"})
30+
Notice teleportTimerFormat = Notice.actionbar("<green>► <white>Teleporting in <green>{TIME}");
31+
@Comment(" ")
32+
Notice teleported = Notice.chat("<green>► <white>Teleported!");
33+
Notice teleporting = Notice.chat("<green>► <white>Teleporting...");
34+
Notice teleportTaskCanceled = Notice.chat("<red>✘ <dark_red>You've moved, teleportation canceled!");
35+
Notice teleportTaskAlreadyExist = Notice.chat("<red>✘ <dark_red>You are in teleport!");
36+
37+
// Coordinates XYZ
38+
@Comment({" ", "# {X} - X coordinate, {Y} - Y coordinate, {Z} - Z coordinate"})
39+
Notice teleportedToCoordinates = Notice.chat(
40+
"<green>► <white>Teleported to location x: <green>{X}<white>, y: <green>{Y}<white>, z: <green>{Z}");
41+
@Comment({" ",
42+
"# {PLAYER} - Player who has been teleported, {X} - X coordinate, {Y} - Y coordinate, {Z} - Z coordinate"})
43+
Notice teleportedSpecifiedPlayerToCoordinates = Notice.chat(
44+
"<green>► <white>Teleported <green>{PLAYER} <white>to location x: <green>{X}<white>, y: <green>{Y}<white>, z: <green>{Z}");
45+
46+
// Back
47+
@Comment(" ")
48+
Notice teleportedToLastLocation = Notice.chat("<green>► <white>Teleported to the last location!");
49+
@Comment({" ", "# {PLAYER} - Player who has been teleported"})
50+
Notice teleportedSpecifiedPlayerLastLocation =
51+
Notice.chat("<green>► <white>Teleported <green>{PLAYER} <white>to the last location!");
52+
@Comment(" ")
53+
Notice lastLocationNoExist = Notice.chat("<red>✘ <dark_red>Last location is not exist!");
54+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
package com.eternalcode.core.feature.teleport.messages;
2+
3+
import com.eternalcode.multification.notice.Notice;
4+
import eu.okaeri.configs.OkaeriConfig;
5+
import eu.okaeri.configs.annotation.Comment;
6+
import lombok.Getter;
7+
import lombok.experimental.Accessors;
8+
9+
@Getter
10+
@Accessors(fluent = true)
11+
public class PLTeleportMessages extends OkaeriConfig implements TeleportMessages {
12+
// teleport
13+
@Comment({"# {PLAYER} - Gracz który został teleportowany"})
14+
Notice teleportedToPlayer =
15+
Notice.chat("<green>► <white>Przeteleportowano do gracza <green>{PLAYER}<white>!");
16+
17+
@Comment({
18+
"# {PLAYER} - Gracz który został teleportowany, {ARG-PLAYER} - Gracz do którego został teleportowany inny gracz"})
19+
Notice teleportedPlayerToPlayer = Notice.chat(
20+
"<green>► <white>Przeteleportowano gracza <green>{PLAYER} <white>do gracza <green>{ARG-PLAYER}<white>!");
21+
22+
@Comment({"# {Y} - Koordynat Y najwyżej położonego bloku"})
23+
Notice teleportedToHighestBlock =
24+
Notice.chat("<green>► <white>Pomyślnie przeteleportowano do najwyższego bloku! (Y: {Y})");
25+
26+
@Comment(" ")
27+
Notice teleportedAllToPlayer =
28+
Notice.chat("<green>► <white>Przeteleportowano wszystkich graczy do ciebie!");
29+
30+
// Task
31+
@Comment({"# {TIME} - Czas teleportacji"})
32+
Notice teleportTimerFormat = Notice.actionbar("<green>► <white>Teleportacja za <green>{TIME}");
33+
@Comment(" ")
34+
Notice teleported = Notice.builder()
35+
.chat("<green>► <white>Przeteleportowano!")
36+
.actionBar("<green>► <white>Przeteleportowano!")
37+
.build();
38+
39+
Notice teleporting = Notice.chat("<green>► <white>Teleportowanie...");
40+
Notice teleportTaskCanceled =
41+
Notice.chat("<red>✘ <dark_red>Ruszyłeś się, teleportacja została przerwana!");
42+
Notice teleportTaskAlreadyExist = Notice.chat("<red>✘ <dark_red>Teleportujesz się już!");
43+
44+
// Coordinates XYZ
45+
@Comment({" ", "# {X} - Koordynat X, {Y} - Koordynat Y, {Z} - Koordynat Z"})
46+
Notice teleportedToCoordinates = Notice.chat(
47+
"<green>► <white>Przeteleportowano na współrzędne x: <green>{X}<white>, y: <green>{Y}<white>, z: <green>{Z}");
48+
@Comment({" ",
49+
"# {PLAYER} - Gracz który został teleportowany, {X} - Koordynat X, {Y} - Koordynat Y, {Z} - Koordynat Z"})
50+
Notice teleportedSpecifiedPlayerToCoordinates = Notice.chat(
51+
"<green>► <white>Przeteleportowano gracza <green>{PLAYER} <white>na współrzędne x: <green>{X}<white>, y: <green>{Y}<white>, z: <green>{Z}");
52+
53+
// Back
54+
@Comment(" ")
55+
Notice teleportedToLastLocation =
56+
Notice.chat("<green>► <white>Przeteleportowano do ostatniej lokalizacji!");
57+
@Comment({" ", "# {PLAYER} - Gracz który został teleportowany"})
58+
Notice teleportedSpecifiedPlayerLastLocation =
59+
Notice.chat("<green>► <white>Przeteleportowano gracza <green>{PLAYER} <white>do ostatniej lokalizacji!");
60+
@Comment(" ")
61+
Notice lastLocationNoExist = Notice.chat("<red>✘ <dark_red>Nie ma zapisanej ostatniej lokalizacji!");
62+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package com.eternalcode.core.feature.teleport.messages;
2+
3+
import com.eternalcode.multification.notice.Notice;
4+
5+
public interface TeleportMessages {
6+
// teleport
7+
Notice teleportedToPlayer();
8+
Notice teleportedPlayerToPlayer();
9+
Notice teleportedToHighestBlock();
10+
Notice teleportedAllToPlayer();
11+
12+
// Task
13+
Notice teleportTimerFormat();
14+
Notice teleported();
15+
Notice teleporting();
16+
Notice teleportTaskCanceled();
17+
Notice teleportTaskAlreadyExist();
18+
19+
// Coordinates XYZ
20+
Notice teleportedToCoordinates();
21+
Notice teleportedSpecifiedPlayerToCoordinates();
22+
23+
// Back
24+
Notice teleportedToLastLocation();
25+
Notice teleportedSpecifiedPlayerLastLocation();
26+
Notice lastLocationNoExist();
27+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.eternalcode.core.feature.teleport.messages;
1+
package com.eternalcode.core.feature.teleportoffline;
22

33
import com.eternalcode.multification.notice.Notice;
44
import eu.okaeri.configs.OkaeriConfig;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.eternalcode.core.feature.teleport.messages;
1+
package com.eternalcode.core.feature.teleportoffline;
22

33
import com.eternalcode.multification.notice.Notice;
44
import eu.okaeri.configs.OkaeriConfig;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.eternalcode.core.feature.teleport.command;
1+
package com.eternalcode.core.feature.teleportoffline;
22

33
import com.eternalcode.core.feature.teleport.TeleportService;
44
import com.eternalcode.core.injector.annotations.Inject;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.eternalcode.core.feature.teleport.messages;
1+
package com.eternalcode.core.feature.teleportoffline;
22

33
import com.eternalcode.multification.notice.Notice;
44

eternalcore-core/src/main/java/com/eternalcode/core/translation/Translation.java

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@
4646
import com.eternalcode.core.feature.spawn.messages.SpawnMessages;
4747
import com.eternalcode.core.feature.speed.messages.SpeedMessages;
4848
import com.eternalcode.core.feature.sudo.messages.SudoMessages;
49-
import com.eternalcode.core.feature.teleport.messages.TeleportOfflineMessages;
49+
import com.eternalcode.core.feature.teleport.messages.TeleportMessages;
50+
import com.eternalcode.core.feature.teleportoffline.TeleportOfflineMessages;
5051
import com.eternalcode.core.feature.teleportrandomplayer.messages.TeleportToRandomPlayerMessages;
5152
import com.eternalcode.core.feature.teleportrequest.messages.TeleportRequestMessages;
5253
import com.eternalcode.core.feature.time.messages.TimeAndWeatherMessages;
5354
import com.eternalcode.core.feature.vanish.messages.VanishMessages;
5455
import com.eternalcode.core.feature.warp.messages.WarpMessages;
5556
import com.eternalcode.core.feature.whois.WhoIsMessages;
5657
import com.eternalcode.core.litecommand.argument.messages.ArgumentMessages;
57-
import com.eternalcode.multification.notice.Notice;
5858

5959
public interface Translation {
6060

@@ -63,31 +63,6 @@ interface Format {
6363
String disable();
6464
}
6565

66-
interface TeleportSection {
67-
// teleport
68-
Notice teleportedToPlayer();
69-
Notice teleportedPlayerToPlayer();
70-
Notice teleportedToHighestBlock();
71-
Notice teleportedAllToPlayer();
72-
73-
// Task
74-
Notice teleportTimerFormat();
75-
Notice teleported();
76-
Notice teleporting();
77-
Notice teleportTaskCanceled();
78-
Notice teleportTaskAlreadyExist();
79-
80-
// Coordinates XYZ
81-
Notice teleportedToCoordinates();
82-
Notice teleportedSpecifiedPlayerToCoordinates();
83-
84-
// Back
85-
Notice teleportedToLastLocation();
86-
Notice teleportedSpecifiedPlayerLastLocation();
87-
Notice lastLocationNoExist();
88-
}
89-
90-
9166
ChatMessages chat();
9267

9368
DisposalMessages disposal();
@@ -157,7 +132,7 @@ interface TeleportSection {
157132
// sudo
158133
SudoMessages sudo();
159134
// Teleport Section
160-
TeleportSection teleport();
135+
TeleportMessages teleport();
161136
// teleport to random player section.
162137
TeleportToRandomPlayerMessages teleportToRandomPlayer();
163138
// Random Teleport Section

eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/ENTranslation.java

Lines changed: 3 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
import com.eternalcode.core.feature.spawn.messages.ENSpawnMessages;
4747
import com.eternalcode.core.feature.speed.messages.ENSpeedMessages;
4848
import com.eternalcode.core.feature.sudo.messages.ENSudoMessages;
49-
import com.eternalcode.core.feature.teleport.messages.ENTeleportOfflineMessages;
49+
import com.eternalcode.core.feature.teleport.messages.ENTeleportMessages;
50+
import com.eternalcode.core.feature.teleportoffline.ENTeleportOfflineMessages;
5051
import com.eternalcode.core.feature.teleportrandomplayer.messages.ENTeleportToRandomPlayerMessages;
5152
import com.eternalcode.core.feature.teleportrequest.messages.ENTeleportRequestMessages;
5253
import com.eternalcode.core.feature.time.messages.ENTimeAndWeatherMessages;
@@ -56,7 +57,6 @@
5657
import com.eternalcode.core.litecommand.argument.messages.ENArgumentMessages;
5758
import com.eternalcode.core.translation.AbstractTranslation;
5859
import com.eternalcode.core.translation.Language;
59-
import com.eternalcode.multification.notice.Notice;
6060
import eu.okaeri.configs.OkaeriConfig;
6161
import eu.okaeri.configs.annotation.Comment;
6262
import java.io.File;
@@ -200,53 +200,7 @@ public static class ENFormatSection extends OkaeriConfig implements Format {
200200
" ",
201201
"# This section is responsible for messages related to teleportation",
202202
})
203-
public ENTeleportSection teleport = new ENTeleportSection();
204-
205-
@Getter
206-
public static class ENTeleportSection extends OkaeriConfig implements TeleportSection {
207-
// teleport
208-
@Comment({"# {PLAYER} - Teleported players"})
209-
Notice teleportedToPlayer =
210-
Notice.chat("<green>► <white>Successfully teleported to <green>{PLAYER}<white>!");
211-
212-
@Comment({"# {PLAYER} - Teleported player, {ARG-PLAYER} - Player to whom another player has been transferred"})
213-
Notice teleportedPlayerToPlayer =
214-
Notice.chat("<green>► <white>Successfully teleported <green>{PLAYER} <white>to <green>{ARG-PLAYER}<white>!");
215-
216-
@Comment({"# {Y} - Y coordinate of the highest block"})
217-
Notice teleportedToHighestBlock =
218-
Notice.chat("<green>► <white>Teleported successfully to the highest block! (Y: {Y})");
219-
220-
@Comment(" ")
221-
Notice teleportedAllToPlayer = Notice.chat("<green>► <white>All players have been teleported to you!");
222-
223-
// Task
224-
@Comment({"# {TIME} - Teleportation time"})
225-
Notice teleportTimerFormat = Notice.actionbar("<green>► <white>Teleporting in <green>{TIME}");
226-
@Comment(" ")
227-
Notice teleported = Notice.chat("<green>► <white>Teleported!");
228-
Notice teleporting = Notice.chat("<green>► <white>Teleporting...");
229-
Notice teleportTaskCanceled = Notice.chat("<red>✘ <dark_red>You've moved, teleportation canceled!");
230-
Notice teleportTaskAlreadyExist = Notice.chat("<red>✘ <dark_red>You are in teleport!");
231-
232-
// Coordinates XYZ
233-
@Comment({" ", "# {X} - X coordinate, {Y} - Y coordinate, {Z} - Z coordinate"})
234-
Notice teleportedToCoordinates = Notice.chat(
235-
"<green>► <white>Teleported to location x: <green>{X}<white>, y: <green>{Y}<white>, z: <green>{Z}");
236-
@Comment({" ",
237-
"# {PLAYER} - Player who has been teleported, {X} - X coordinate, {Y} - Y coordinate, {Z} - Z coordinate"})
238-
Notice teleportedSpecifiedPlayerToCoordinates = Notice.chat(
239-
"<green>► <white>Teleported <green>{PLAYER} <white>to location x: <green>{X}<white>, y: <green>{Y}<white>, z: <green>{Z}");
240-
241-
// Back
242-
@Comment(" ")
243-
Notice teleportedToLastLocation = Notice.chat("<green>► <white>Teleported to the last location!");
244-
@Comment({" ", "# {PLAYER} - Player who has been teleported"})
245-
Notice teleportedSpecifiedPlayerLastLocation =
246-
Notice.chat("<green>► <white>Teleported <green>{PLAYER} <white>to the last location!");
247-
@Comment(" ")
248-
Notice lastLocationNoExist = Notice.chat("<red>✘ <dark_red>Last location is not exist!");
249-
}
203+
public ENTeleportMessages teleport = new ENTeleportMessages();
250204

251205
@Comment({
252206
" ",

eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/PLTranslation.java

Lines changed: 3 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
import com.eternalcode.core.feature.spawn.messages.PLSpawnMessages;
4747
import com.eternalcode.core.feature.speed.messages.PLSpeedMessages;
4848
import com.eternalcode.core.feature.sudo.messages.PLSudoMessages;
49-
import com.eternalcode.core.feature.teleport.messages.PLTeleportOfflineMessages;
49+
import com.eternalcode.core.feature.teleport.messages.PLTeleportMessages;
50+
import com.eternalcode.core.feature.teleportoffline.PLTeleportOfflineMessages;
5051
import com.eternalcode.core.feature.teleportrandomplayer.messages.PLTeleportToRandomPlayerMessages;
5152
import com.eternalcode.core.feature.teleportrequest.messages.PLTeleportRequestMessages;
5253
import com.eternalcode.core.feature.time.messages.PLTimeAndWeatherMessages;
@@ -56,7 +57,6 @@
5657
import com.eternalcode.core.litecommand.argument.messages.PLArgumentMessages;
5758
import com.eternalcode.core.translation.AbstractTranslation;
5859
import com.eternalcode.core.translation.Language;
59-
import com.eternalcode.multification.notice.Notice;
6060
import eu.okaeri.configs.OkaeriConfig;
6161
import eu.okaeri.configs.annotation.Comment;
6262
import java.io.File;
@@ -202,61 +202,7 @@ public static class PLFormatSection extends OkaeriConfig implements Format {
202202
" ",
203203
"# Ta sekcja odpowiada za komunikaty związane z teleportacją",
204204
})
205-
public PLTeleportSection teleport = new PLTeleportSection();
206-
207-
@Getter
208-
public static class PLTeleportSection extends OkaeriConfig implements TeleportSection {
209-
// teleport
210-
@Comment({"# {PLAYER} - Gracz który został teleportowany"})
211-
Notice teleportedToPlayer =
212-
Notice.chat("<green>► <white>Przeteleportowano do gracza <green>{PLAYER}<white>!");
213-
214-
@Comment({
215-
"# {PLAYER} - Gracz który został teleportowany, {ARG-PLAYER} - Gracz do którego został teleportowany inny gracz"})
216-
Notice teleportedPlayerToPlayer = Notice.chat(
217-
"<green>► <white>Przeteleportowano gracza <green>{PLAYER} <white>do gracza <green>{ARG-PLAYER}<white>!");
218-
219-
@Comment({"# {Y} - Koordynat Y najwyżej położonego bloku"})
220-
Notice teleportedToHighestBlock =
221-
Notice.chat("<green>► <white>Pomyślnie przeteleportowano do najwyższego bloku! (Y: {Y})");
222-
223-
@Comment(" ")
224-
Notice teleportedAllToPlayer =
225-
Notice.chat("<green>► <white>Przeteleportowano wszystkich graczy do ciebie!");
226-
227-
// Task
228-
@Comment({"# {TIME} - Czas teleportacji"})
229-
Notice teleportTimerFormat = Notice.actionbar("<green>► <white>Teleportacja za <green>{TIME}");
230-
@Comment(" ")
231-
Notice teleported = Notice.builder()
232-
.chat("<green>► <white>Przeteleportowano!")
233-
.actionBar("<green>► <white>Przeteleportowano!")
234-
.build();
235-
236-
Notice teleporting = Notice.chat("<green>► <white>Teleportowanie...");
237-
Notice teleportTaskCanceled =
238-
Notice.chat("<red>✘ <dark_red>Ruszyłeś się, teleportacja została przerwana!");
239-
Notice teleportTaskAlreadyExist = Notice.chat("<red>✘ <dark_red>Teleportujesz się już!");
240-
241-
// Coordinates XYZ
242-
@Comment({" ", "# {X} - Koordynat X, {Y} - Koordynat Y, {Z} - Koordynat Z"})
243-
Notice teleportedToCoordinates = Notice.chat(
244-
"<green>► <white>Przeteleportowano na współrzędne x: <green>{X}<white>, y: <green>{Y}<white>, z: <green>{Z}");
245-
@Comment({" ",
246-
"# {PLAYER} - Gracz który został teleportowany, {X} - Koordynat X, {Y} - Koordynat Y, {Z} - Koordynat Z"})
247-
Notice teleportedSpecifiedPlayerToCoordinates = Notice.chat(
248-
"<green>► <white>Przeteleportowano gracza <green>{PLAYER} <white>na współrzędne x: <green>{X}<white>, y: <green>{Y}<white>, z: <green>{Z}");
249-
250-
// Back
251-
@Comment(" ")
252-
Notice teleportedToLastLocation =
253-
Notice.chat("<green>► <white>Przeteleportowano do ostatniej lokalizacji!");
254-
@Comment({" ", "# {PLAYER} - Gracz który został teleportowany"})
255-
Notice teleportedSpecifiedPlayerLastLocation =
256-
Notice.chat("<green>► <white>Przeteleportowano gracza <green>{PLAYER} <white>do ostatniej lokalizacji!");
257-
@Comment(" ")
258-
Notice lastLocationNoExist = Notice.chat("<red>✘ <dark_red>Nie ma zapisanej ostatniej lokalizacji!");
259-
}
205+
public PLTeleportMessages teleport = new PLTeleportMessages();
260206

261207
@Comment({
262208
" ",

0 commit comments

Comments
 (0)