Skip to content

Commit

Permalink
Make config's great again.
Browse files Browse the repository at this point in the history
  • Loading branch information
vLuckyyy committed Jan 19, 2025
1 parent 40c2418 commit 2035c0a
Show file tree
Hide file tree
Showing 47 changed files with 1,432 additions and 1,079 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.eternalcode.core.bridge.litecommand.argument.messages;

import com.eternalcode.multification.notice.Notice;

public interface ArgumentMessages {
Notice missingPlayerName();
Notice permissionMessage();
Notice usageMessage();
Notice usageMessageHead();
Notice usageMessageEntry();
Notice offlinePlayer();
Notice onlyPlayer();
Notice numberBiggerThanOrEqualZero();
Notice noItem();
Notice noArgument();
Notice noDamaged();
Notice noDamagedItems();
Notice noEnchantment();
Notice noValidEnchantmentLevel();
Notice invalidTimeFormat();
Notice worldDoesntExist();
Notice incorrectNumberOfChunks();
Notice incorrectLocation();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.eternalcode.core.bridge.litecommand.argument.messages;

import com.eternalcode.multification.notice.Notice;
import lombok.Getter;
import lombok.experimental.Accessors;
import net.dzikoysk.cdn.entity.Contextual;
import net.dzikoysk.cdn.entity.Description;

@Getter
@Accessors(fluent = true)
@Contextual
public class ENArgumentMessages implements ArgumentMessages {
@Description("# {PERMISSIONS} - Required permission")
public Notice permissionMessage = Notice.chat("<red>✘ <dark_red>You don't have permission to perform this command! <red>({PERMISSIONS})");

@Description({" ", "# {USAGE} - Correct usage"})
public Notice usageMessage = Notice.chat("<gold>✘ <white>Correct usage: <gold>{USAGE}");
public Notice usageMessageHead = Notice.chat("<green>► <white>Correct usage:");
public Notice usageMessageEntry = Notice.chat("<green>► <white>{USAGE}");

@Description(" ")
public Notice missingPlayerName = Notice.chat("<red>✘ <dark_red>You must provide a player name!");
public Notice offlinePlayer = Notice.chat("<red>✘ <dark_red>This player is currently offline!");
public Notice onlyPlayer = Notice.chat("<red>✘ <dark_red>Command is only for players!");
public Notice numberBiggerThanOrEqualZero = Notice.chat("<red>✘ <dark_red>The number must be greater than or equal to 0!");
public Notice noItem = Notice.chat("<red>✘ <dark_red>You need item to use this command!");
public Notice noMaterial = Notice.chat("<red>✘ <dark_red>This item doesn't exist");
public Notice noArgument = Notice.chat("<red>✘ <dark_red>This argument doesn't exist");
public Notice noDamaged = Notice.chat("<red>✘ <dark_red>This item can't be repaired");
public Notice noDamagedItems = Notice.chat("<red>✘ <dark_red>You need damaged items to use this command!");
public Notice noEnchantment = Notice.chat("<red>✘ <dark_red>This enchantment doesn't exist");
public Notice noValidEnchantmentLevel = Notice.chat("<red>✘ <dark_red>This enchantment level is not supported!");
public Notice invalidTimeFormat = Notice.chat("<red>✘ <dark_red>Invalid time format!");
public Notice worldDoesntExist = Notice.chat("<red>✘ <dark_red>World <red>{WORLD} <dark_red>doesn't exist!");
public Notice incorrectNumberOfChunks = Notice.chat("<red>✘ <dark_red>Incorrect number of chunks!");
public Notice incorrectLocation = Notice.chat("<red>✘ <dark_red>Incorrect location format! <red>({LOCATION})");
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.eternalcode.core.bridge.litecommand.argument.messages;

import com.eternalcode.multification.notice.Notice;
import lombok.Getter;
import lombok.experimental.Accessors;
import net.dzikoysk.cdn.entity.Contextual;
import net.dzikoysk.cdn.entity.Description;

@Getter
@Accessors(fluent = true)
@Contextual
public class PLArgumentMessages implements ArgumentMessages {
@Description("# {PERMISSIONS} - Wyświetla wymagane uprawnienia")
public Notice permissionMessage =
Notice.chat("<red>✘ <dark_red>Nie masz uprawnień do tej komendy! <red>({PERMISSIONS})");

@Description({" ", "# {USAGE} - Wyświetla poprawne użycie komendy"})
public Notice usageMessage = Notice.chat("<gold>✘ <white>Poprawne użycie: <gold>{USAGE}");
public Notice usageMessageHead = Notice.chat("<gold>✘ <white>Poprawne użycie:");
public Notice usageMessageEntry = Notice.chat("<gold>✘ <white>{USAGE}");

@Description(" ")
public Notice missingPlayerName = Notice.chat("<red>✘ <dark_red>Musisz podać nazwę gracza!");
public Notice offlinePlayer = Notice.chat("<red>✘ <dark_red>Ten gracz jest obecnie offline!");
public Notice onlyPlayer = Notice.chat("<red>✘ <dark_red>Ta komenda jest dostępna tylko dla graczy!");
public Notice numberBiggerThanOrEqualZero = Notice.chat("<red>✘ <dark_red>Liczba musi być równa lub większa od 0!");
public Notice noItem = Notice.chat("<red>✘ <dark_red>Musisz trzymać przedmiot w dłoni!");
public Notice noMaterial = Notice.chat("<red>✘ <dark_red>Taki materiał nie istnieje!");
public Notice noArgument = Notice.chat("<red>✘ <dark_red>Taki argument nie istnieje!");
public Notice noDamaged = Notice.chat("<red>✘ <dark_red>Ten przedmiot nie może być naprawiony!");
public Notice noDamagedItems = Notice.chat("<red>✘ <dark_red>Musisz posiadać uszkodzone przedmioty!");
public Notice noEnchantment = Notice.chat("<red>✘ <dark_red>Takie zaklęcie nie istnieje!");
public Notice noValidEnchantmentLevel = Notice.chat("<red>✘ <dark_red>Ten poziom zaklęcia nie jest wspierany!");
public Notice invalidTimeFormat = Notice.chat("<red>✘ <dark_red>Nieprawidłowy format czasu!");
public Notice worldDoesntExist = Notice.chat("<red>✘ <dark_red>Świat <dark_red>{WORLD} <red>nie istnieje!");
public Notice incorrectNumberOfChunks = Notice.chat("<red>✘ <dark_red>Niepoprawna liczba chunków!");
public Notice incorrectLocation = Notice.chat("<red>✘ <dark_red>Niepoprawna lokalizacja! <red>({LOCATION})");
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.eternalcode.core.feature.adminchat.messages;

import com.eternalcode.multification.notice.Notice;

public interface AdminChatSection {
Notice format();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.eternalcode.core.feature.adminchat.messages;

import com.eternalcode.multification.notice.Notice;
import lombok.Getter;
import lombok.experimental.Accessors;
import net.dzikoysk.cdn.entity.Contextual;
import net.dzikoysk.cdn.entity.Description;

@Getter
@Accessors(fluent = true)
@Contextual
public class ENAdminChatMessages implements AdminChatSection {
@Description({"# {PLAYER} - Player who sent message on adminchat, {TEXT} - message"})
public Notice format =
Notice.chat("<dark_gray>[<dark_red>AdminChat<dark_gray>] <red>{PLAYER}<dark_gray>: <white>{TEXT}");
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.eternalcode.core.feature.adminchat.messages;

import com.eternalcode.multification.notice.Notice;
import lombok.Getter;
import lombok.experimental.Accessors;
import net.dzikoysk.cdn.entity.Contextual;
import net.dzikoysk.cdn.entity.Description;

@Getter
@Accessors(fluent = true)
@Contextual
public class PLAdminChatMessages implements AdminChatSection {
@Description({
"# {PLAYER} - Gracz który wysłał wiadomość na czacie administracji, {TEXT} - Treść wysłanej wiadomości"})
public Notice format =
Notice.chat("<dark_gray>[<dark_red>Administracja<dark_gray>] <red>{PLAYER}<dark_gray>: <white>{TEXT}");
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface AutoMessageRepository {

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

// for nearby feafure like placeholders etc
// for nearby feature like placeholders etc
CompletableFuture<Boolean> isReceiving(UUID uniqueId);

CompletableFuture<Boolean> switchReceiving(UUID uniqueId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import com.eternalcode.core.injector.annotations.Inject;
import com.eternalcode.core.injector.annotations.component.Service;
import com.eternalcode.core.notice.NoticeService;
import com.eternalcode.core.translation.Translation;
import com.eternalcode.core.feature.automessage.messages.AutoMessageMessages;
import com.eternalcode.multification.notice.Notice;
import java.util.Collection;
import java.util.Optional;
Expand All @@ -18,7 +18,6 @@
import java.util.stream.Collectors;
import org.bukkit.Server;
import org.bukkit.entity.Entity;
import panda.std.reactive.Completable;

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

private Optional<Notice> nextAutoMessage(Translation.AutoMessageSection messageSection) {
private Optional<Notice> nextAutoMessage(AutoMessageMessages messageSection) {
Collection<Notice> messages = messageSection.messages();

if (messages.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.eternalcode.core.feature.automessage.messages;

import com.eternalcode.multification.notice.Notice;
import java.util.Collection;

public interface AutoMessageMessages {
Collection<Notice> messages();

Notice enabled();
Notice disabled();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package com.eternalcode.core.feature.automessage.messages;

import com.eternalcode.multification.bukkit.notice.BukkitNotice;
import com.eternalcode.multification.notice.Notice;
import java.util.Collection;
import java.util.Map;
import lombok.Getter;
import lombok.experimental.Accessors;
import net.dzikoysk.cdn.entity.Contextual;
import net.dzikoysk.cdn.entity.Description;
import org.bukkit.Sound;

@Getter
@Accessors(fluent = true)
@Contextual
public class ENAutoMessageMessages implements AutoMessageMessages {

@Description({
"",
"# If you want to useplaceholder %server_online% you need to install",
"# PlaceholderAPI plugin and download placeholders for Server",
"# like /papi ecloud download Server",
})
public Map<String, Notice> messages = Map.of(
"1", BukkitNotice.builder()
.actionBar("<dark_gray>» <gold>There are <white>%server_online% <gold>people online on the server!")
.sound(Sound.ITEM_ARMOR_EQUIP_IRON, 1.0f, 1.0f)
.build(),

"2", BukkitNotice.builder()
.chat("<dark_gray>» <gold>You need help from an admin?")
.chat("<dark_gray>» <gold>Type command <white>/helpop <gold>to ask!")
.chat("<dark_gray>» <green><click:suggest_command:'/helpop'>Click to execute!</click></green>")
.sound(Sound.BLOCK_ANVIL_BREAK, 1.0f, 1.0f)
.build()
);

public Notice enabled = Notice.chat("<green>► <white>Enabled auto messages!");
public Notice disabled = Notice.chat("<green>► <white>Disabled auto messages!");

@Override
public Collection<Notice> messages() {
return this.messages.values();
}

@Override
public Notice enabled() {
return this.enabled;
}

@Override
public Notice disabled() {
return this.disabled;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package com.eternalcode.core.feature.automessage.messages;

import com.eternalcode.multification.bukkit.notice.BukkitNotice;
import com.eternalcode.multification.notice.Notice;
import java.util.Collection;
import java.util.Map;
import lombok.Getter;
import lombok.experimental.Accessors;
import net.dzikoysk.cdn.entity.Contextual;
import net.dzikoysk.cdn.entity.Description;
import org.bukkit.Sound;

@Getter
@Accessors(fluent = true)
@Contextual
public class PLAutoMessageMessages implements AutoMessageMessages {
@Description({
"",
"# Jeżeli chcesz użyć placeholder'a %server_online% musisz zainstalować plugin",
"# PlaceholderAPI oraz pobrać placeholdery dla Server'a",
"# za pomocą komendy /papi ecloud download Server",
})
public Map<String, Notice> messages = Map.of(
"1", BukkitNotice.builder()
.actionBar("<dark_gray>» <gold>Na serwerze jest: <white>%server_online% <gold>graczy online!")
.sound(Sound.ITEM_ARMOR_EQUIP_IRON, 1.0f, 1.0f)
.build(),

"2", BukkitNotice.builder()
.chat("<dark_gray>» <gold>Potrzebujesz pomocy od admina?")
.chat("<dark_gray>» <gold>Użyj komendy <white>/helpop <gold>aby zgłosić problem!")
.chat("<dark_gray>» <green><click:suggest_command:'/helpop'>Kliknij aby wykonać!</click></green>")
.sound(Sound.BLOCK_ANVIL_BREAK, 1.0f, 1.0f)
.build()
);

public Notice enabled = Notice.chat("<green>► <white>Włączono automatyczne wiadomości!");
public Notice disabled = Notice.chat("<green>► <white>Wyłączono automatyczne wiadomości!");

@Override
public Collection<Notice> messages() {
return this.messages.values();
}

@Override
public Notice enabled() {
return this.enabled;
}

@Override
public Notice disabled() {
return this.disabled;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.eternalcode.core.feature.helpop.messages;

import com.eternalcode.multification.notice.Notice;
import lombok.Getter;
import lombok.experimental.Accessors;
import net.dzikoysk.cdn.entity.Contextual;
import net.dzikoysk.cdn.entity.Description;

@Getter
@Accessors(fluent = true)
@Contextual
public class ENHelpOpMessages implements HelpOpSection {
@Description("# {PLAYER} - Player who send message on /helpop, {TEXT} - message")
public Notice format =
Notice.chat("<dark_gray>[<dark_red>HelpOp<dark_gray>] <yellow>{PLAYER}<dark_gray>: <white>{TEXT}");
@Description(" ")
public Notice send = Notice.chat("<green>► <white>This message has been successfully sent to administration");
@Description("# {TIME} - Time to next use (cooldown)")
public Notice helpOpDelay = Notice.chat("<gold>✘ <red>You can use this command for: <gold>{TIME}");
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.eternalcode.core.feature.helpop.messages;

import com.eternalcode.multification.notice.Notice;

public interface HelpOpSection {
Notice format();
Notice send();
Notice helpOpDelay();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.eternalcode.core.feature.helpop.messages;

import com.eternalcode.multification.notice.Notice;
import lombok.Getter;
import lombok.experimental.Accessors;
import net.dzikoysk.cdn.entity.Contextual;
import net.dzikoysk.cdn.entity.Description;

@Getter
@Accessors(fluent = true)
@Contextual
public class PLHelpOpMessages implements HelpOpSection {
@Description({"# {PLAYER} - Gracz który wysłał wiadomość na helpop, {TEXT} - Treść wysłanej wiadomości"})
public Notice format =
Notice.chat("<dark_gray>[<dark_red>HelpOp<dark_gray>] <yellow>{PLAYER}<white>: <white>{TEXT}");
@Description(" ")
public Notice send = Notice.chat("<green>► <white>Wiadomość została wysłana do administracji");
@Description("# {TIME} - Czas do końca blokady (cooldown)")
public Notice helpOpDelay = Notice.chat("<white>► <red>Możesz użyć tej komendy dopiero za <gold>{TIME}!");
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package com.eternalcode.core.feature.home.messages;

import com.eternalcode.multification.notice.Notice;
import lombok.Getter;
import lombok.experimental.Accessors;
import net.dzikoysk.cdn.entity.Contextual;
import net.dzikoysk.cdn.entity.Description;

@Getter
@Accessors(fluent = true)
@Contextual
public class ENHomeMessages implements HomeMessages {
@Description("# {HOMES} - List of homes (separated by commas)")
public Notice homeList = Notice.chat("<green>► <white>Available homes: <green>{HOMES}");

@Description({" ", "# {HOME} - Home name"})
public Notice create = Notice.chat("<green>► <white>Home <green>{HOME} <white>has been created.");
public Notice delete = Notice.chat("<red>► <white>Home <red>{HOME} <white>has been deleted.");
public Notice overrideHomeLocation = Notice.chat("<green>► <white>Home <green>{HOME} <white>has been overridden.");
@Description({" ", "# {LIMIT} - Homes limit"})
public Notice limit =
Notice.chat("<red>► <white>You have reached the limit of homes! Your limit is <red>{LIMIT}<white>.");
public Notice noHomesOwned = Notice.chat("<dark_red>✘ <red>You don't have any homes.");

@Description({" ", "# Placeholders messages"})
public String noHomesOwnedPlaceholder = "You don't have any homes.";

@Description({
" ",
"# Home Admin Section, you can edit player homes as admin",
"# {HOME} - Home name, {PLAYER} - Player name, {HOMES} - List of homes (separated by commas)"
})
public Notice overrideHomeLocationAsAdmin =
Notice.chat("<green>► <white>Home <green>{HOME} <white>has been overridden for <green>{PLAYER}<white>.");
public Notice playerNoOwnedHomes =
Notice.chat("<dark_red>✘ <red>Player <dark_red>{PLAYER} <red>doesn't have any homes.");
public Notice createAsAdmin =
Notice.chat("<green>► <white>Home <green>{HOME} <white>has been created for <green>{PLAYER}<white>.");
public Notice deleteAsAdmin =
Notice.chat("<red>► <white>Home <red>{HOME} <white>has been deleted for <red>{PLAYER}<white>.");
public Notice homeListAsAdmin =
Notice.chat("<green>► <white>Available homes for <green>{PLAYER}<white>: <green>{HOMES}");
}
Loading

0 comments on commit 2035c0a

Please sign in to comment.