Skip to content

Commit

Permalink
chore: rework message types and custom characters
Browse files Browse the repository at this point in the history
  • Loading branch information
Snabeldier committed Jan 24, 2025
1 parent 2cf7aab commit 84220d4
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 62 deletions.
99 changes: 51 additions & 48 deletions src/main/java/minevalley/core/api/enums/CustomCharacter.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,64 +6,67 @@
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
public enum CustomCharacter {

MV('\uef00'),
MV_BW('\uef01'),
SUPPORT_QUESTION_MARK('\uef02'),
HELP_QUESTION_MARK('\uef03'),
TEAM('\uef04'),
EMOJI_HEART('\ue000'),
EMOJI_LAUGH('\ue001'),
EMOJI_SMILE('\ue002'),
EMOJI_GRIN('\ue003'),
EMOJI_WINK('\ue004'),
EMOJI_WINKING_WITH_TONGUE('\ue005'),
EMOJI_KISSES('\ue006'),
EMOJI_SHOCK('\ue007'),
EMOJI_BIG_SHOCK('\ue008'),
EMOJI_PAIN('\ue009'),
EMOJI_ANNOYED('\ue010'),
EMOJI_CRYING('\ue011'),

SUPPORT_QUESTION_MARK_TRANSPARENT('\uef05'),
RADIO('\uea00'),
SHOUT('\uea01'),
EXCLAMATION_MARK('\uea02'),
CROSS('\uea03'),
CHECKMARK('\uea04'),
LOG('\uea05'),
BUG('\uea06'),
EYE('\uea07'),
WRENCH('\uea08'),
CIRCLE('\uea09'),
HOUSE('\uea10'),
EURO_NOTES('\uea11'),
DRIFTING_CAR('\uea12'),

MEDICS('\uef06'),
COPS('\uef07'),
MAIL('\uef08'),
DISPOSAL('\uef09'),
HANDCUFFS('\uef10'),
BELL('\ueb00'),
PHONE('\ueb01'),

MEDICS_TRANSPARENT('\uef11'),
COPS_TRANSPARENT('\uef12'),
MAIL_TRANSPARENT('\uef13'),
DISPOSAL_TRANSPARENT('\uef14'),
HANDCUFFS_TRANSPARENT('\uef15'),
MV('\uec00'),
MV_BW('\uec01'),

EURO_NOTES('\uef16'),
BELL('\uef17'),
DRIFTING_CAR('\uef18'),
PHONE('\uef19'),
HELP_QUESTION_MARK('\ued00'),
TEAM('\ued01'),

MEDICS('\uee00'),
COPS('\uee01'),
MAIL('\uee02'),
DISPOSAL('\uee03'),
HANDCUFFS('\uee04'),
PREMIUM('\uee05'),
SUPPORT_QUESTION_MARK('\uee06'),

EMOJI_HEART('\uef20'),
EMOJI_LAUGH('\uef21'),
EMOJI_SMILE('\uef22'),
EMOJI_GRIN('\uef23'),
EMOJI_WINK('\uef24'),
EMOJI_WINKING_WITH_TONGUE('\uef25'),
EMOJI_KISSES('\uef26'),
EMOJI_SHOCK('\uef27'),
EMOJI_BIG_SHOCK('\uef28'),
EMOJI_PAIN('\uef29'),
EMOJI_ANNOYED('\uef30'),
EMOJI_CRYING('\uef31'),
MEDICS_TRANSPARENT('\uef00'),
COPS_TRANSPARENT('\uef01'),
MAIL_TRANSPARENT('\uef02'),
DISPOSAL_TRANSPARENT('\uef03'),
HANDCUFFS_TRANSPARENT('\uef04'),
PREMIUM_TRANSPARENT('\uef05'),
SUPPORT_QUESTION_MARK_TRANSPARENT('\uef06'),

PREMIUM('\uef32'),

RADIO('\uef33'),
SHOUT('\uef34'),
CROSS('\uef35'),
CHECKMARK('\uef36'),
LOG('\uef37'),
BUG('\uef38'),
EYE('\uef39'),
WRENCH('\uef40'),
CIRCLE('\uef41'),
HOUSE('\uef42'),

PREMIUM_TRANSPARENT('\uef43'),

SINGLE_WHITE_SPACE('\uef44');
SINGLE_WHITE_SPACE('\ueeee');

private final char c;

@SuppressWarnings("unused")
public char getChar() {
return c;
}

@Override
public String toString() {
return Character.toString(c);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,38 @@
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import minevalley.core.api.enums.CustomCharacter;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.TextComponent;
import net.kyori.adventure.text.format.NamedTextColor;

@Getter
import javax.annotation.Nonnull;

import static minevalley.core.api.enums.CustomCharacter.CHECKMARK;
import static minevalley.core.api.enums.CustomCharacter.CROSS;
import static net.kyori.adventure.text.format.NamedTextColor.*;

@Getter(onMethod_ = @Nonnull)
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
public enum ActionBarType {

/**
* Used to signal the success of a process or action, by using the action-bar.
* Used to signal the failure of a process or an action.
*/
SUCCESS("§a✔§8 ━ §7"),
ERROR(CROSS, RED),

/**
* Used to signal the failure of a process or action, by using the action-bar.
* Used to signal the success of a process or action.
*/
ERROR("§c✘§8 ━ §7");
SUCCESS(CHECKMARK, GREEN);

private final @Nonnull CustomCharacter symbol;
private final @Nonnull NamedTextColor color;

private final String prefix;
@SuppressWarnings("unused")
public TextComponent getPrefix() {
return Component.space()
.append(Component.text(symbol.getChar(), color))
.append(Component.text(" ━ ", DARK_GRAY));
}
}
41 changes: 33 additions & 8 deletions src/main/java/minevalley/core/api/messaging/types/MessageType.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,51 @@
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import minevalley.core.api.enums.CustomCharacter;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.TextComponent;
import net.kyori.adventure.text.format.NamedTextColor;

@Getter
import javax.annotation.Nonnull;

import static minevalley.core.api.enums.CustomCharacter.*;
import static net.kyori.adventure.text.format.NamedTextColor.*;

@Getter(onMethod_ = @Nonnull)
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
public enum MessageType {

/**
* Used to signal the success of a process or action.
* Used to signal a warning.
*/
SUCCESS(" §a✔§8 ━ §7"),
WARNING(EXCLAMATION_MARK, YELLOW),

/**
* Used to signal the failure of a process or an action.
*/
ERROR(" §c§l!§8 ━ §7"),
ERROR(CROSS, RED),

INFO(" §f" + CustomCharacter.MV + " §8━ §7"),
/**
* Used to signal the success of a process or action.
*/
SUCCESS(CHECKMARK, GREEN),

INFO_BW(" §f" + CustomCharacter.MV_BW + " §8━ §7"),
/**
* Used to signal an information.
*/
INFO(MV, WHITE),

/**
* Used to signal an information in black and white.
*/
INFO_BW(MV_BW, WHITE);

WARNING(" §e§l! §8━ §7");
private final @Nonnull CustomCharacter symbol;
private final @Nonnull NamedTextColor color;

private final String prefix;
@SuppressWarnings("unused")
public TextComponent getPrefix() {
return Component.space()
.append(Component.text(symbol.getChar(), color))
.append(Component.text(" ━ ", DARK_GRAY));
}
}

0 comments on commit 84220d4

Please sign in to comment.