Archiviert
1
0

Finalize CalendarCommand

Dieser Commit ist enthalten in:
yoyosource 2022-11-24 17:26:29 +01:00
Ursprung ca4a5b49dd
Commit 6b0c30c241
3 geänderte Dateien mit 13 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -22,6 +22,9 @@ package de.steamwar.bungeecore.commands;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.inventory.SWInventory;
import de.steamwar.bungeecore.inventory.SWItem;
import de.steamwar.bungeecore.sql.NodeMember;
import de.steamwar.bungeecore.sql.SchematicNode;
import de.steamwar.bungeecore.sql.SteamwarUser;
import de.steamwar.command.SWCommand;
import net.md_5.bungee.api.connection.ProxiedPlayer;
@ -78,16 +81,18 @@ public class CalendarCommand extends SWCommand {
return;
}
SteamwarUser user = SteamwarUser.get(player.getUniqueId());
List<SWItem> items = new ArrayList<>();
for (Map.Entry<Integer, Integer> present : dayToSchematicId.entrySet()) {
boolean b = false; // TODO: Add check if player has schematic
boolean b = NodeMember.getNodeMember(present.getValue(), user.getId()) != null;
SWItem swItem = b ? SWItem.getSkull("MHF_Chest") : SWItem.getSkull("MHF_Present1");
swItem.setName(Message.parse("ADVENT_CALENDAR_DAY", player, present.getKey()));
swItem.setCallback(click -> {
if (!click.isRightClick()) return;
if (month != Month.NOVEMBER) return;
if (b) return;
if (month != Month.DECEMBER) return;
if (present.getKey() != day) return;
// TODO: Add to schematic
NodeMember.createNodeMember(present.getValue(), user.getId());
Message.send("ADVENT_CALENDAR_OPEN", player, SchematicNode.getSchematicNode(present.getValue()).getName());
});
items.add(swItem);
}

Datei anzeigen

@ -654,4 +654,5 @@ BUILDERCLOUD_VERSION=§cUnknown version.
ADVENT_CALENDAR_TITLE=§eAdvent Calendar
ADVENT_CALENDAR_DAY=§7Day§8: §e{0}
ADVENT_CALENDAR_MESSAGE=§eDid you already open your advent calendar?
ADVENT_CALENDAR_MESSAGE_HOVER=§eClick to open!
ADVENT_CALENDAR_MESSAGE_HOVER=§eClick to open!
ADVENT_CALENDAR_OPEN=§7You got §e{0} §7from the advent calendar!

Datei anzeigen

@ -632,4 +632,5 @@ BUILDERCLOUD_VERSION=§cUnbekannte Version.
ADVENT_CALENDAR_TITLE=§eAdventskalender
ADVENT_CALENDAR_DAY=§7Tag§8: §e{0}
ADVENT_CALENDAR_MESSAGE=§eHast du heute schon dein Geschenk geholt?
ADVENT_CALENDAR_MESSAGE_HOVER=§eKlicken zum öffnen!
ADVENT_CALENDAR_MESSAGE_HOVER=§eKlicken zum öffnen!
ADVENT_CALENDAR_OPEN=§7Du hast §e{0}§7 aus dem Adventskalender erhalten!