mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-28 13:36:33 +01:00
Improve timeframe requirement check message
This commit is contained in:
parent
1cecd77d80
commit
85bfacc9ec
@ -95,6 +95,13 @@ public enum DMessage implements Message {
|
|||||||
CMD_TEST_HELP("cmd.test.help"),
|
CMD_TEST_HELP("cmd.test.help"),
|
||||||
CMD_UNINVITE_HELP("cmd.uninvite.help"),
|
CMD_UNINVITE_HELP("cmd.uninvite.help"),
|
||||||
CMD_UNINVITE_SUCCESS("cmd.uninvite.success"),
|
CMD_UNINVITE_SUCCESS("cmd.uninvite.success"),
|
||||||
|
DAY_OF_WEEK_0("dayOfWeek.0"),
|
||||||
|
DAY_OF_WEEK_1("dayOfWeek.1"),
|
||||||
|
DAY_OF_WEEK_2("dayOfWeek.2"),
|
||||||
|
DAY_OF_WEEK_3("dayOfWeek.3"),
|
||||||
|
DAY_OF_WEEK_4("dayOfWeek.4"),
|
||||||
|
DAY_OF_WEEK_5("dayOfWeek.5"),
|
||||||
|
DAY_OF_WEEK_6("dayOfWeek.6"),
|
||||||
ERROR_BED("error.bed"),
|
ERROR_BED("error.bed"),
|
||||||
ERROR_CHEST_IS_OPENED("error.chestIsOpened"),
|
ERROR_CHEST_IS_OPENED("error.chestIsOpened"),
|
||||||
ERROR_CMD("error.cmd"),
|
ERROR_CMD("error.cmd"),
|
||||||
|
@ -42,7 +42,12 @@ public class TimeframeRequirement implements Requirement {
|
|||||||
WEDNESDAY,
|
WEDNESDAY,
|
||||||
THURSDAY,
|
THURSDAY,
|
||||||
FRIDAY,
|
FRIDAY,
|
||||||
SATURDAY
|
SATURDAY;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return DMessage.valueOf("DAY_OF_WEEK_" + ordinal()).getMessage();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Timeframe<T> {
|
public static class Timeframe<T> {
|
||||||
@ -138,22 +143,26 @@ public class TimeframeRequirement implements Requirement {
|
|||||||
for (Timeframe<Weekday> timeframe : weekdays) {
|
for (Timeframe<Weekday> timeframe : weekdays) {
|
||||||
ChatColor color = isInDayTimeframe(timeframe) ? ChatColor.GREEN : ChatColor.DARK_RED;
|
ChatColor color = isInDayTimeframe(timeframe) ? ChatColor.GREEN : ChatColor.DARK_RED;
|
||||||
if (!first) {
|
if (!first) {
|
||||||
builder.append(" | ").color(ChatColor.WHITE);
|
builder.append(" & ").color(ChatColor.WHITE);
|
||||||
} else {
|
} else {
|
||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
builder.append(timeframe.getStart() + "-" + timeframe.getEnd()).color(color);
|
if (timeframe.getStart() != timeframe.getEnd()) {
|
||||||
|
builder.append(timeframe.getStart() + "-" + timeframe.getEnd()).color(color);
|
||||||
|
} else {
|
||||||
|
builder.append(timeframe.getStart().toString()).color(color);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
first = true;
|
first = true;
|
||||||
for (Timeframe<Integer> timeframe : daytimes) {
|
for (Timeframe<Integer> timeframe : daytimes) {
|
||||||
ChatColor color = isInHourTimeframe(timeframe) ? ChatColor.GREEN : ChatColor.DARK_RED;
|
ChatColor color = isInHourTimeframe(timeframe) ? ChatColor.GREEN : ChatColor.DARK_RED;
|
||||||
if (!first) {
|
if (!first) {
|
||||||
builder.append(" | ").color(ChatColor.WHITE);
|
builder.append(" & ").color(ChatColor.WHITE);
|
||||||
} else {
|
} else {
|
||||||
first = false;
|
first = false;
|
||||||
if (!weekdays.isEmpty()) {
|
if (!weekdays.isEmpty()) {
|
||||||
builder.append(" & ").color(ChatColor.WHITE);
|
builder.append(" | ").color(ChatColor.WHITE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
builder.append(timeframe.getStart() + "-" + timeframe.getEnd()).color(color);
|
builder.append(timeframe.getStart() + "-" + timeframe.getEnd()).color(color);
|
||||||
|
@ -107,6 +107,14 @@ cmd:
|
|||||||
uninvite:
|
uninvite:
|
||||||
help: "/dxl uninvite [player] [map] - Uninvite a player from editing a map"
|
help: "/dxl uninvite [player] [map] - Uninvite a player from editing a map"
|
||||||
success: "&4&v1&6's permission to edit the map &4&v2&6 has been removed successfully."
|
success: "&4&v1&6's permission to edit the map &4&v2&6 has been removed successfully."
|
||||||
|
dayOfWeek:
|
||||||
|
0: "Sunday"
|
||||||
|
1: "Monday"
|
||||||
|
2: "Tuesday"
|
||||||
|
3: "Wednesday"
|
||||||
|
4: "Thursday"
|
||||||
|
5: "Friday"
|
||||||
|
6: "Saturday"
|
||||||
error:
|
error:
|
||||||
bed: "&4You cannot use a bed while in a dungeon."
|
bed: "&4You cannot use a bed while in a dungeon."
|
||||||
blockOwnTeam: "&4This block belongs to your own group."
|
blockOwnTeam: "&4This block belongs to your own group."
|
||||||
|
@ -103,6 +103,14 @@ cmd:
|
|||||||
uninvite:
|
uninvite:
|
||||||
help: "/dxl uninvite [player] [dungeon] - Désinvite un joueur à éditer un donjon"
|
help: "/dxl uninvite [player] [dungeon] - Désinvite un joueur à éditer un donjon"
|
||||||
success: "&4&v1&6 a été désinviter avec succès à éditer la carte &4&v1&6."
|
success: "&4&v1&6 a été désinviter avec succès à éditer la carte &4&v1&6."
|
||||||
|
dayOfWeek:
|
||||||
|
0: "Dimanche"
|
||||||
|
1: "Lundi"
|
||||||
|
2: "Mardi"
|
||||||
|
3: "Mercredi"
|
||||||
|
4: "Jeudi"
|
||||||
|
5: "Vendredi"
|
||||||
|
6: "Samedi"
|
||||||
error:
|
error:
|
||||||
bed: "&4Vous ne pouvez utiliser un lit en étant dans un donjon."
|
bed: "&4Vous ne pouvez utiliser un lit en étant dans un donjon."
|
||||||
blockOwnTeam: "&4Ce bloque appartient à votre groupe."
|
blockOwnTeam: "&4Ce bloque appartient à votre groupe."
|
||||||
@ -178,7 +186,7 @@ button:
|
|||||||
player:
|
player:
|
||||||
blockInfo: "&6Block ID: &2&v1"
|
blockInfo: "&6Block ID: &2&v1"
|
||||||
checkpointReached: "&6Point de sauvegarde atteint."
|
checkpointReached: "&6Point de sauvegarde atteint."
|
||||||
death: "&6Vous êtes mort, vies restantes: &2&v1"
|
death: "&4&v1 &6est mort, vies restantes: &4&v2"
|
||||||
deathKick: "&2&v1&6 est mort et a perdu sa dernière vie."
|
deathKick: "&2&v1&6 est mort et a perdu sa dernière vie."
|
||||||
finishedDungeon: "&6Vous avez terminé le donjon avec succès."
|
finishedDungeon: "&6Vous avez terminé le donjon avec succès."
|
||||||
finished_Floor: "&6Vous avez terminé l'étage avec succès."
|
finished_Floor: "&6Vous avez terminé l'étage avec succès."
|
||||||
|
@ -107,6 +107,14 @@ cmd:
|
|||||||
uninvite:
|
uninvite:
|
||||||
help: "/dxl uninvite [player] [map] - Lädt einen Spieler davon aus, eine Welt zu bearbeiten"
|
help: "/dxl uninvite [player] [map] - Lädt einen Spieler davon aus, eine Welt zu bearbeiten"
|
||||||
success: "&4&v1&6's Berechtigung zum Bearbeiten der Welt &4&v2&6 wurde erfolgreich entfernt."
|
success: "&4&v1&6's Berechtigung zum Bearbeiten der Welt &4&v2&6 wurde erfolgreich entfernt."
|
||||||
|
dayOfWeek:
|
||||||
|
0: "Sonntag"
|
||||||
|
1: "Montag"
|
||||||
|
2: "Dienstag"
|
||||||
|
3: "Mittwoch"
|
||||||
|
4: "Donnerstag"
|
||||||
|
5: "Freitag"
|
||||||
|
6: "Samstag"
|
||||||
error:
|
error:
|
||||||
bed: "&4Du kannst im Dungeon kein Bett benutzen."
|
bed: "&4Du kannst im Dungeon kein Bett benutzen."
|
||||||
blockOwnTeam: "&4Dieser Block gehört zu Deiner eigenen Gruppe."
|
blockOwnTeam: "&4Dieser Block gehört zu Deiner eigenen Gruppe."
|
||||||
|
Loading…
Reference in New Issue
Block a user