Skip to content

Commit 2035c0a

Browse files
committed
Make config's great again.
1 parent 40c2418 commit 2035c0a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1432
-1079
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.eternalcode.core.bridge.litecommand.argument.messages;
2+
3+
import com.eternalcode.multification.notice.Notice;
4+
5+
public interface ArgumentMessages {
6+
Notice missingPlayerName();
7+
Notice permissionMessage();
8+
Notice usageMessage();
9+
Notice usageMessageHead();
10+
Notice usageMessageEntry();
11+
Notice offlinePlayer();
12+
Notice onlyPlayer();
13+
Notice numberBiggerThanOrEqualZero();
14+
Notice noItem();
15+
Notice noArgument();
16+
Notice noDamaged();
17+
Notice noDamagedItems();
18+
Notice noEnchantment();
19+
Notice noValidEnchantmentLevel();
20+
Notice invalidTimeFormat();
21+
Notice worldDoesntExist();
22+
Notice incorrectNumberOfChunks();
23+
Notice incorrectLocation();
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package com.eternalcode.core.bridge.litecommand.argument.messages;
2+
3+
import com.eternalcode.multification.notice.Notice;
4+
import lombok.Getter;
5+
import lombok.experimental.Accessors;
6+
import net.dzikoysk.cdn.entity.Contextual;
7+
import net.dzikoysk.cdn.entity.Description;
8+
9+
@Getter
10+
@Accessors(fluent = true)
11+
@Contextual
12+
public class ENArgumentMessages implements ArgumentMessages {
13+
@Description("# {PERMISSIONS} - Required permission")
14+
public Notice permissionMessage = Notice.chat("<red>✘ <dark_red>You don't have permission to perform this command! <red>({PERMISSIONS})");
15+
16+
@Description({" ", "# {USAGE} - Correct usage"})
17+
public Notice usageMessage = Notice.chat("<gold>✘ <white>Correct usage: <gold>{USAGE}");
18+
public Notice usageMessageHead = Notice.chat("<green>► <white>Correct usage:");
19+
public Notice usageMessageEntry = Notice.chat("<green>► <white>{USAGE}");
20+
21+
@Description(" ")
22+
public Notice missingPlayerName = Notice.chat("<red>✘ <dark_red>You must provide a player name!");
23+
public Notice offlinePlayer = Notice.chat("<red>✘ <dark_red>This player is currently offline!");
24+
public Notice onlyPlayer = Notice.chat("<red>✘ <dark_red>Command is only for players!");
25+
public Notice numberBiggerThanOrEqualZero = Notice.chat("<red>✘ <dark_red>The number must be greater than or equal to 0!");
26+
public Notice noItem = Notice.chat("<red>✘ <dark_red>You need item to use this command!");
27+
public Notice noMaterial = Notice.chat("<red>✘ <dark_red>This item doesn't exist");
28+
public Notice noArgument = Notice.chat("<red>✘ <dark_red>This argument doesn't exist");
29+
public Notice noDamaged = Notice.chat("<red>✘ <dark_red>This item can't be repaired");
30+
public Notice noDamagedItems = Notice.chat("<red>✘ <dark_red>You need damaged items to use this command!");
31+
public Notice noEnchantment = Notice.chat("<red>✘ <dark_red>This enchantment doesn't exist");
32+
public Notice noValidEnchantmentLevel = Notice.chat("<red>✘ <dark_red>This enchantment level is not supported!");
33+
public Notice invalidTimeFormat = Notice.chat("<red>✘ <dark_red>Invalid time format!");
34+
public Notice worldDoesntExist = Notice.chat("<red>✘ <dark_red>World <red>{WORLD} <dark_red>doesn't exist!");
35+
public Notice incorrectNumberOfChunks = Notice.chat("<red>✘ <dark_red>Incorrect number of chunks!");
36+
public Notice incorrectLocation = Notice.chat("<red>✘ <dark_red>Incorrect location format! <red>({LOCATION})");
37+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package com.eternalcode.core.bridge.litecommand.argument.messages;
2+
3+
import com.eternalcode.multification.notice.Notice;
4+
import lombok.Getter;
5+
import lombok.experimental.Accessors;
6+
import net.dzikoysk.cdn.entity.Contextual;
7+
import net.dzikoysk.cdn.entity.Description;
8+
9+
@Getter
10+
@Accessors(fluent = true)
11+
@Contextual
12+
public class PLArgumentMessages implements ArgumentMessages {
13+
@Description("# {PERMISSIONS} - Wyświetla wymagane uprawnienia")
14+
public Notice permissionMessage =
15+
Notice.chat("<red>✘ <dark_red>Nie masz uprawnień do tej komendy! <red>({PERMISSIONS})");
16+
17+
@Description({" ", "# {USAGE} - Wyświetla poprawne użycie komendy"})
18+
public Notice usageMessage = Notice.chat("<gold>✘ <white>Poprawne użycie: <gold>{USAGE}");
19+
public Notice usageMessageHead = Notice.chat("<gold>✘ <white>Poprawne użycie:");
20+
public Notice usageMessageEntry = Notice.chat("<gold>✘ <white>{USAGE}");
21+
22+
@Description(" ")
23+
public Notice missingPlayerName = Notice.chat("<red>✘ <dark_red>Musisz podać nazwę gracza!");
24+
public Notice offlinePlayer = Notice.chat("<red>✘ <dark_red>Ten gracz jest obecnie offline!");
25+
public Notice onlyPlayer = Notice.chat("<red>✘ <dark_red>Ta komenda jest dostępna tylko dla graczy!");
26+
public Notice numberBiggerThanOrEqualZero = Notice.chat("<red>✘ <dark_red>Liczba musi być równa lub większa od 0!");
27+
public Notice noItem = Notice.chat("<red>✘ <dark_red>Musisz trzymać przedmiot w dłoni!");
28+
public Notice noMaterial = Notice.chat("<red>✘ <dark_red>Taki materiał nie istnieje!");
29+
public Notice noArgument = Notice.chat("<red>✘ <dark_red>Taki argument nie istnieje!");
30+
public Notice noDamaged = Notice.chat("<red>✘ <dark_red>Ten przedmiot nie może być naprawiony!");
31+
public Notice noDamagedItems = Notice.chat("<red>✘ <dark_red>Musisz posiadać uszkodzone przedmioty!");
32+
public Notice noEnchantment = Notice.chat("<red>✘ <dark_red>Takie zaklęcie nie istnieje!");
33+
public Notice noValidEnchantmentLevel = Notice.chat("<red>✘ <dark_red>Ten poziom zaklęcia nie jest wspierany!");
34+
public Notice invalidTimeFormat = Notice.chat("<red>✘ <dark_red>Nieprawidłowy format czasu!");
35+
public Notice worldDoesntExist = Notice.chat("<red>✘ <dark_red>Świat <dark_red>{WORLD} <red>nie istnieje!");
36+
public Notice incorrectNumberOfChunks = Notice.chat("<red>✘ <dark_red>Niepoprawna liczba chunków!");
37+
public Notice incorrectLocation = Notice.chat("<red>✘ <dark_red>Niepoprawna lokalizacja! <red>({LOCATION})");
38+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.eternalcode.core.feature.adminchat.messages;
2+
3+
import com.eternalcode.multification.notice.Notice;
4+
5+
public interface AdminChatSection {
6+
Notice format();
7+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.eternalcode.core.feature.adminchat.messages;
2+
3+
import com.eternalcode.multification.notice.Notice;
4+
import lombok.Getter;
5+
import lombok.experimental.Accessors;
6+
import net.dzikoysk.cdn.entity.Contextual;
7+
import net.dzikoysk.cdn.entity.Description;
8+
9+
@Getter
10+
@Accessors(fluent = true)
11+
@Contextual
12+
public class ENAdminChatMessages implements AdminChatSection {
13+
@Description({"# {PLAYER} - Player who sent message on adminchat, {TEXT} - message"})
14+
public Notice format =
15+
Notice.chat("<dark_gray>[<dark_red>AdminChat<dark_gray>] <red>{PLAYER}<dark_gray>: <white>{TEXT}");
16+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.eternalcode.core.feature.adminchat.messages;
2+
3+
import com.eternalcode.multification.notice.Notice;
4+
import lombok.Getter;
5+
import lombok.experimental.Accessors;
6+
import net.dzikoysk.cdn.entity.Contextual;
7+
import net.dzikoysk.cdn.entity.Description;
8+
9+
@Getter
10+
@Accessors(fluent = true)
11+
@Contextual
12+
public class PLAdminChatMessages implements AdminChatSection {
13+
@Description({
14+
"# {PLAYER} - Gracz który wysłał wiadomość na czacie administracji, {TEXT} - Treść wysłanej wiadomości"})
15+
public Notice format =
16+
Notice.chat("<dark_gray>[<dark_red>Administracja<dark_gray>] <red>{PLAYER}<dark_gray>: <white>{TEXT}");
17+
}

eternalcore-core/src/main/java/com/eternalcode/core/feature/automessage/AutoMessageRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ interface AutoMessageRepository {
99

1010
CompletableFuture<Set<UUID>> findReceivers(Set<UUID> onlineUniqueIds);
1111

12-
// for nearby feafure like placeholders etc
12+
// for nearby feature like placeholders etc
1313
CompletableFuture<Boolean> isReceiving(UUID uniqueId);
1414

1515
CompletableFuture<Boolean> switchReceiving(UUID uniqueId);

eternalcore-core/src/main/java/com/eternalcode/core/feature/automessage/AutoMessageService.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import com.eternalcode.core.injector.annotations.Inject;
88
import com.eternalcode.core.injector.annotations.component.Service;
99
import com.eternalcode.core.notice.NoticeService;
10-
import com.eternalcode.core.translation.Translation;
10+
import com.eternalcode.core.feature.automessage.messages.AutoMessageMessages;
1111
import com.eternalcode.multification.notice.Notice;
1212
import java.util.Collection;
1313
import java.util.Optional;
@@ -18,7 +18,6 @@
1818
import java.util.stream.Collectors;
1919
import org.bukkit.Server;
2020
import org.bukkit.entity.Entity;
21-
import panda.std.reactive.Completable;
2221

2322
@FeatureDocs(name = "AutoMessage", description = "Automatically sends messages to players at a given time interval.")
2423
@Service
@@ -86,7 +85,7 @@ private void tick() {
8685
}
8786
}
8887

89-
private Optional<Notice> nextAutoMessage(Translation.AutoMessageSection messageSection) {
88+
private Optional<Notice> nextAutoMessage(AutoMessageMessages messageSection) {
9089
Collection<Notice> messages = messageSection.messages();
9190

9291
if (messages.isEmpty()) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.eternalcode.core.feature.automessage.messages;
2+
3+
import com.eternalcode.multification.notice.Notice;
4+
import java.util.Collection;
5+
6+
public interface AutoMessageMessages {
7+
Collection<Notice> messages();
8+
9+
Notice enabled();
10+
Notice disabled();
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
package com.eternalcode.core.feature.automessage.messages;
2+
3+
import com.eternalcode.multification.bukkit.notice.BukkitNotice;
4+
import com.eternalcode.multification.notice.Notice;
5+
import java.util.Collection;
6+
import java.util.Map;
7+
import lombok.Getter;
8+
import lombok.experimental.Accessors;
9+
import net.dzikoysk.cdn.entity.Contextual;
10+
import net.dzikoysk.cdn.entity.Description;
11+
import org.bukkit.Sound;
12+
13+
@Getter
14+
@Accessors(fluent = true)
15+
@Contextual
16+
public class ENAutoMessageMessages implements AutoMessageMessages {
17+
18+
@Description({
19+
"",
20+
"# If you want to useplaceholder %server_online% you need to install",
21+
"# PlaceholderAPI plugin and download placeholders for Server",
22+
"# like /papi ecloud download Server",
23+
})
24+
public Map<String, Notice> messages = Map.of(
25+
"1", BukkitNotice.builder()
26+
.actionBar("<dark_gray>» <gold>There are <white>%server_online% <gold>people online on the server!")
27+
.sound(Sound.ITEM_ARMOR_EQUIP_IRON, 1.0f, 1.0f)
28+
.build(),
29+
30+
"2", BukkitNotice.builder()
31+
.chat("<dark_gray>» <gold>You need help from an admin?")
32+
.chat("<dark_gray>» <gold>Type command <white>/helpop <gold>to ask!")
33+
.chat("<dark_gray>» <green><click:suggest_command:'/helpop'>Click to execute!</click></green>")
34+
.sound(Sound.BLOCK_ANVIL_BREAK, 1.0f, 1.0f)
35+
.build()
36+
);
37+
38+
public Notice enabled = Notice.chat("<green>► <white>Enabled auto messages!");
39+
public Notice disabled = Notice.chat("<green>► <white>Disabled auto messages!");
40+
41+
@Override
42+
public Collection<Notice> messages() {
43+
return this.messages.values();
44+
}
45+
46+
@Override
47+
public Notice enabled() {
48+
return this.enabled;
49+
}
50+
51+
@Override
52+
public Notice disabled() {
53+
return this.disabled;
54+
}
55+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
package com.eternalcode.core.feature.automessage.messages;
2+
3+
import com.eternalcode.multification.bukkit.notice.BukkitNotice;
4+
import com.eternalcode.multification.notice.Notice;
5+
import java.util.Collection;
6+
import java.util.Map;
7+
import lombok.Getter;
8+
import lombok.experimental.Accessors;
9+
import net.dzikoysk.cdn.entity.Contextual;
10+
import net.dzikoysk.cdn.entity.Description;
11+
import org.bukkit.Sound;
12+
13+
@Getter
14+
@Accessors(fluent = true)
15+
@Contextual
16+
public class PLAutoMessageMessages implements AutoMessageMessages {
17+
@Description({
18+
"",
19+
"# Jeżeli chcesz użyć placeholder'a %server_online% musisz zainstalować plugin",
20+
"# PlaceholderAPI oraz pobrać placeholdery dla Server'a",
21+
"# za pomocą komendy /papi ecloud download Server",
22+
})
23+
public Map<String, Notice> messages = Map.of(
24+
"1", BukkitNotice.builder()
25+
.actionBar("<dark_gray>» <gold>Na serwerze jest: <white>%server_online% <gold>graczy online!")
26+
.sound(Sound.ITEM_ARMOR_EQUIP_IRON, 1.0f, 1.0f)
27+
.build(),
28+
29+
"2", BukkitNotice.builder()
30+
.chat("<dark_gray>» <gold>Potrzebujesz pomocy od admina?")
31+
.chat("<dark_gray>» <gold>Użyj komendy <white>/helpop <gold>aby zgłosić problem!")
32+
.chat("<dark_gray>» <green><click:suggest_command:'/helpop'>Kliknij aby wykonać!</click></green>")
33+
.sound(Sound.BLOCK_ANVIL_BREAK, 1.0f, 1.0f)
34+
.build()
35+
);
36+
37+
public Notice enabled = Notice.chat("<green>► <white>Włączono automatyczne wiadomości!");
38+
public Notice disabled = Notice.chat("<green>► <white>Wyłączono automatyczne wiadomości!");
39+
40+
@Override
41+
public Collection<Notice> messages() {
42+
return this.messages.values();
43+
}
44+
45+
@Override
46+
public Notice enabled() {
47+
return this.enabled;
48+
}
49+
50+
@Override
51+
public Notice disabled() {
52+
return this.disabled;
53+
}
54+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.eternalcode.core.feature.helpop.messages;
2+
3+
import com.eternalcode.multification.notice.Notice;
4+
import lombok.Getter;
5+
import lombok.experimental.Accessors;
6+
import net.dzikoysk.cdn.entity.Contextual;
7+
import net.dzikoysk.cdn.entity.Description;
8+
9+
@Getter
10+
@Accessors(fluent = true)
11+
@Contextual
12+
public class ENHelpOpMessages implements HelpOpSection {
13+
@Description("# {PLAYER} - Player who send message on /helpop, {TEXT} - message")
14+
public Notice format =
15+
Notice.chat("<dark_gray>[<dark_red>HelpOp<dark_gray>] <yellow>{PLAYER}<dark_gray>: <white>{TEXT}");
16+
@Description(" ")
17+
public Notice send = Notice.chat("<green>► <white>This message has been successfully sent to administration");
18+
@Description("# {TIME} - Time to next use (cooldown)")
19+
public Notice helpOpDelay = Notice.chat("<gold>✘ <red>You can use this command for: <gold>{TIME}");
20+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.eternalcode.core.feature.helpop.messages;
2+
3+
import com.eternalcode.multification.notice.Notice;
4+
5+
public interface HelpOpSection {
6+
Notice format();
7+
Notice send();
8+
Notice helpOpDelay();
9+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.eternalcode.core.feature.helpop.messages;
2+
3+
import com.eternalcode.multification.notice.Notice;
4+
import lombok.Getter;
5+
import lombok.experimental.Accessors;
6+
import net.dzikoysk.cdn.entity.Contextual;
7+
import net.dzikoysk.cdn.entity.Description;
8+
9+
@Getter
10+
@Accessors(fluent = true)
11+
@Contextual
12+
public class PLHelpOpMessages implements HelpOpSection {
13+
@Description({"# {PLAYER} - Gracz który wysłał wiadomość na helpop, {TEXT} - Treść wysłanej wiadomości"})
14+
public Notice format =
15+
Notice.chat("<dark_gray>[<dark_red>HelpOp<dark_gray>] <yellow>{PLAYER}<white>: <white>{TEXT}");
16+
@Description(" ")
17+
public Notice send = Notice.chat("<green>► <white>Wiadomość została wysłana do administracji");
18+
@Description("# {TIME} - Czas do końca blokady (cooldown)")
19+
public Notice helpOpDelay = Notice.chat("<white>► <red>Możesz użyć tej komendy dopiero za <gold>{TIME}!");
20+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package com.eternalcode.core.feature.home.messages;
2+
3+
import com.eternalcode.multification.notice.Notice;
4+
import lombok.Getter;
5+
import lombok.experimental.Accessors;
6+
import net.dzikoysk.cdn.entity.Contextual;
7+
import net.dzikoysk.cdn.entity.Description;
8+
9+
@Getter
10+
@Accessors(fluent = true)
11+
@Contextual
12+
public class ENHomeMessages implements HomeMessages {
13+
@Description("# {HOMES} - List of homes (separated by commas)")
14+
public Notice homeList = Notice.chat("<green>► <white>Available homes: <green>{HOMES}");
15+
16+
@Description({" ", "# {HOME} - Home name"})
17+
public Notice create = Notice.chat("<green>► <white>Home <green>{HOME} <white>has been created.");
18+
public Notice delete = Notice.chat("<red>► <white>Home <red>{HOME} <white>has been deleted.");
19+
public Notice overrideHomeLocation = Notice.chat("<green>► <white>Home <green>{HOME} <white>has been overridden.");
20+
@Description({" ", "# {LIMIT} - Homes limit"})
21+
public Notice limit =
22+
Notice.chat("<red>► <white>You have reached the limit of homes! Your limit is <red>{LIMIT}<white>.");
23+
public Notice noHomesOwned = Notice.chat("<dark_red>✘ <red>You don't have any homes.");
24+
25+
@Description({" ", "# Placeholders messages"})
26+
public String noHomesOwnedPlaceholder = "You don't have any homes.";
27+
28+
@Description({
29+
" ",
30+
"# Home Admin Section, you can edit player homes as admin",
31+
"# {HOME} - Home name, {PLAYER} - Player name, {HOMES} - List of homes (separated by commas)"
32+
})
33+
public Notice overrideHomeLocationAsAdmin =
34+
Notice.chat("<green>► <white>Home <green>{HOME} <white>has been overridden for <green>{PLAYER}<white>.");
35+
public Notice playerNoOwnedHomes =
36+
Notice.chat("<dark_red>✘ <red>Player <dark_red>{PLAYER} <red>doesn't have any homes.");
37+
public Notice createAsAdmin =
38+
Notice.chat("<green>► <white>Home <green>{HOME} <white>has been created for <green>{PLAYER}<white>.");
39+
public Notice deleteAsAdmin =
40+
Notice.chat("<red>► <white>Home <red>{HOME} <white>has been deleted for <red>{PLAYER}<white>.");
41+
public Notice homeListAsAdmin =
42+
Notice.chat("<green>► <white>Available homes for <green>{PLAYER}<white>: <green>{HOMES}");
43+
}

0 commit comments

Comments
 (0)