Dieser Commit ist enthalten in:
Ursprung
02407e6e88
Commit
27326b43de
@ -112,7 +112,7 @@ DIFFICULTY_HARD = §cHard
|
||||
DIFFICULTY_EXTREME = §5Extreme
|
||||
DIFFICULTY_ADVANCED = §5Advanced
|
||||
|
||||
EASTER_EGG_MENU = §0Easter Egg Hunt
|
||||
EASTER_EGG_MENU = §0Easter Egg Hunt {0}/{1}
|
||||
|
||||
EASTER_EGG_SELECTION_ALL = §eAll
|
||||
EASTER_EGG_SELECTION_FOUND = §aFound
|
||||
|
@ -106,7 +106,7 @@ DIFFICULTY_HARD = §cHart
|
||||
DIFFICULTY_EXTREME = §5Extrem
|
||||
DIFFICULTY_ADVANCED = §5Advanced
|
||||
|
||||
EASTER_EGG_MENU = §0Oster Eierer Suche
|
||||
EASTER_EGG_MENU = §0Oster Eier Suche {0}/{1}
|
||||
|
||||
EASTER_EGG_SELECTION_ALL = §eAlle
|
||||
EASTER_EGG_SELECTION_FOUND = §aGefunden
|
||||
|
@ -24,10 +24,12 @@ public class EggHuntCommand extends SWCommand {
|
||||
public void genericCommand(Player player, @OptionalValue("ALL") Selection selection) {
|
||||
AtomicInteger atomicInteger = new AtomicInteger();
|
||||
String found = UserConfig.getConfig(player.getUniqueId(), EggHunt.EGG_HUNT_CONFIG_KEY);
|
||||
AtomicInteger foundCount = new AtomicInteger();
|
||||
List<SWListInv.SWListEntry<Egg>> entries = EggHunt.getEggList().stream()
|
||||
.map(egg -> {
|
||||
int index = atomicInteger.getAndIncrement();
|
||||
boolean isFound = found != null && found.length() > index && found.charAt(index) == '1';
|
||||
if (isFound) foundCount.getAndIncrement();
|
||||
if (selection == Selection.FOUND && !isFound) return null;
|
||||
if (selection == Selection.NOT_FOUND && isFound) return null;
|
||||
SWItem swItem = egg.getItem(player, isFound);
|
||||
@ -37,7 +39,7 @@ public class EggHuntCommand extends SWCommand {
|
||||
.filter(Objects::nonNull)
|
||||
.sorted(Comparator.comparing(eggSWListEntry -> eggSWListEntry.getObject().getDifficulty()))
|
||||
.collect(Collectors.toList());
|
||||
SWListInv<Egg> inv = new SWListInv<>(player, LobbySystem.getMessage().parse("EASTER_EGG_MENU", player), false, entries, (clickType, egg) -> {
|
||||
SWListInv<Egg> inv = new SWListInv<>(player, LobbySystem.getMessage().parse("EASTER_EGG_MENU", player, foundCount.get(), EggHunt.getEggList().size()), false, entries, (clickType, egg) -> {
|
||||
});
|
||||
inv.setItem(49, new SWItem(SWItem.getDye(15), (byte) 15, LobbySystem.getMessage().parse(Selection.ALL.key, player), Collections.emptyList(), selection == Selection.ALL, clickType -> {
|
||||
genericCommand(player, Selection.ALL);
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren