From 11a63101f1c16d634e6ff285610ce7f5bf53147c Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 21 Nov 2022 18:02:50 +0100 Subject: [PATCH 1/8] Add CalendarCommand --- src/de/steamwar/bungeecore/BungeeCore.java | 1 + .../bungeecore/commands/CalendarCommand.java | 76 +++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 src/de/steamwar/bungeecore/commands/CalendarCommand.java diff --git a/src/de/steamwar/bungeecore/BungeeCore.java b/src/de/steamwar/bungeecore/BungeeCore.java index 4013f34..6051a85 100644 --- a/src/de/steamwar/bungeecore/BungeeCore.java +++ b/src/de/steamwar/bungeecore/BungeeCore.java @@ -156,6 +156,7 @@ public class BungeeCore extends Plugin { new LocalCommand(); new SetLocaleCommand(); new BuilderCloudCommand(); + new CalendarCommand(); // Punishment Commands: new PunishmentCommand("ban", Punishment.PunishmentType.Ban); diff --git a/src/de/steamwar/bungeecore/commands/CalendarCommand.java b/src/de/steamwar/bungeecore/commands/CalendarCommand.java new file mode 100644 index 0000000..2c5aa2b --- /dev/null +++ b/src/de/steamwar/bungeecore/commands/CalendarCommand.java @@ -0,0 +1,76 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2022 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.bungeecore.commands; + +import de.steamwar.bungeecore.inventory.SWInventory; +import de.steamwar.bungeecore.inventory.SWItem; +import de.steamwar.command.SWCommand; +import net.md_5.bungee.api.connection.ProxiedPlayer; +import sun.awt.OSInfo; + +import java.time.LocalDate; +import java.time.Month; +import java.util.*; + +public class CalendarCommand extends SWCommand { + + private Map dayToSchematicId = new HashMap<>(); + + { + for (int i = 1; i < 31; i++) { + dayToSchematicId.put(i, 0); + } + } + + public CalendarCommand() { + super("calendar", null, "cal"); + } + + @Register + public void genericCommand(ProxiedPlayer player) { + LocalDate localDate = LocalDate.now(); + int day = localDate.getDayOfMonth(); + Month month = localDate.getMonth(); + Random random = new Random(localDate.getYear()); + + if (month != Month.NOVEMBER && month != Month.DECEMBER && month != Month.JANUARY) { + return; + } + + List items = new ArrayList<>(); + for (Map.Entry present : dayToSchematicId.entrySet()) { + boolean b = false; // TODO: Add check if player has schematic + SWItem swItem = new SWItem(b ? "iron_door" : "dark_oak_door", "§fTag " + present.getKey()); + swItem.setCallback(click -> { + if (month != Month.DECEMBER) return; + if (present.getKey() != day) return; + // TODO: Add to schematic + }); + items.add(swItem); + } + Collections.shuffle(items, random); + + SWInventory inventory = new SWInventory(player, 36, "§6§lAdventskalender"); + for (int i = 0; i < items.size(); i++) { + inventory.addItem(i, items.get(i)); + } + inventory.open(); + } +} -- 2.39.2 From e024282a20df86b2f52b000a5a0d0a422e36adb8 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Tue, 22 Nov 2022 16:39:24 +0100 Subject: [PATCH 2/8] Add CalendarListener --- .../bungeecore/commands/CalendarCommand.java | 18 ++++--- .../listeners/CalendarListener.java | 49 +++++++++++++++++++ .../steamwar/messages/BungeeCore.properties | 7 ++- .../messages/BungeeCore_de.properties | 7 ++- 4 files changed, 73 insertions(+), 8 deletions(-) create mode 100644 src/de/steamwar/bungeecore/listeners/CalendarListener.java diff --git a/src/de/steamwar/bungeecore/commands/CalendarCommand.java b/src/de/steamwar/bungeecore/commands/CalendarCommand.java index 2c5aa2b..95bfd23 100644 --- a/src/de/steamwar/bungeecore/commands/CalendarCommand.java +++ b/src/de/steamwar/bungeecore/commands/CalendarCommand.java @@ -19,11 +19,11 @@ 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.command.SWCommand; import net.md_5.bungee.api.connection.ProxiedPlayer; -import sun.awt.OSInfo; import java.time.LocalDate; import java.time.Month; @@ -31,12 +31,13 @@ import java.util.*; public class CalendarCommand extends SWCommand { - private Map dayToSchematicId = new HashMap<>(); + private static Map dayToSchematicId = new HashMap<>(); - { - for (int i = 1; i < 31; i++) { + static { + for (int i = 1; i < 27; i++) { dayToSchematicId.put(i, 0); } + dayToSchematicId.put(31, 0); } public CalendarCommand() { @@ -57,7 +58,8 @@ public class CalendarCommand extends SWCommand { List items = new ArrayList<>(); for (Map.Entry present : dayToSchematicId.entrySet()) { boolean b = false; // TODO: Add check if player has schematic - SWItem swItem = new SWItem(b ? "iron_door" : "dark_oak_door", "§fTag " + present.getKey()); + 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 (month != Month.DECEMBER) return; if (present.getKey() != day) return; @@ -67,10 +69,14 @@ public class CalendarCommand extends SWCommand { } Collections.shuffle(items, random); - SWInventory inventory = new SWInventory(player, 36, "§6§lAdventskalender"); + SWInventory inventory = new SWInventory(player, 27, Message.parse("ADVENT_CALENDAR_TITLE", player)); for (int i = 0; i < items.size(); i++) { inventory.addItem(i, items.get(i)); } inventory.open(); } + + public static boolean hasDay(int day) { + return dayToSchematicId.containsKey(day); + } } diff --git a/src/de/steamwar/bungeecore/listeners/CalendarListener.java b/src/de/steamwar/bungeecore/listeners/CalendarListener.java new file mode 100644 index 0000000..935ac5c --- /dev/null +++ b/src/de/steamwar/bungeecore/listeners/CalendarListener.java @@ -0,0 +1,49 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2022 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.bungeecore.listeners; + +import de.steamwar.bungeecore.Message; +import de.steamwar.bungeecore.commands.CalendarCommand; +import net.md_5.bungee.api.chat.ClickEvent; +import net.md_5.bungee.api.event.PostLoginEvent; +import net.md_5.bungee.event.EventHandler; + +import java.time.LocalDate; +import java.time.Month; + +public class CalendarListener extends BasicListener { + + @EventHandler + public void onPostLogin(PostLoginEvent event) { + LocalDate localDate = LocalDate.now(); + int day = localDate.getDayOfMonth(); + Month month = localDate.getMonth(); + + if (month != Month.DECEMBER) { + return; + } + + if (!CalendarCommand.hasDay(day)) { + return; + } + + Message.send("ADVENT_CALENDAR_MESSAGE", event.getPlayer(), null, new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/calendar")); + } +} diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index 878ede1..b8d510c 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -648,4 +648,9 @@ LOCK_LOCALE_CHANGED=§aLanguage saved #Builder Cloud BUILDERCLOUD_USAGE=§8/§7buildercloud §8[§eversion§8] §8[§emap§8] §8<§7generator§8> -BUILDERCLOUD_VERSION=§cUnknown version. \ No newline at end of file +BUILDERCLOUD_VERSION=§cUnknown version. + +# Advent Calendar +ADVENT_CALENDAR_TITLE=§eAdvent Calendar +ADVENT_CALENDAR_DAY=§7Day§8: §e{0} +ADVENT_CALENDAR_MESSAGE=§7Did you already open your advent calendar? \ No newline at end of file diff --git a/src/de/steamwar/messages/BungeeCore_de.properties b/src/de/steamwar/messages/BungeeCore_de.properties index 24f0a3d..280b2f4 100644 --- a/src/de/steamwar/messages/BungeeCore_de.properties +++ b/src/de/steamwar/messages/BungeeCore_de.properties @@ -626,4 +626,9 @@ LOCK_LOCALE_CHANGED=§aSprache gespeichert #Builder Cloud BUILDERCLOUD_USAGE=§8/§7buildercloud §8[§eVersion§8] §8[§eWelt§8] §8<§7Generator§8> -BUILDERCLOUD_VERSION=§cUnbekannte Version. \ No newline at end of file +BUILDERCLOUD_VERSION=§cUnbekannte Version. + +# Advent Calendar +ADVENT_CALENDAR_TITLE=§eAdventskalender +ADVENT_CALENDAR_DAY=§7Tag§8: §e{0} +ADVENT_CALENDAR_MESSAGE=§7Hast du heute schon dein Geschenk geholt? \ No newline at end of file -- 2.39.2 From 2e7c9e0fc73f9ed6148b6fa5b82201132a1b3aa4 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Tue, 22 Nov 2022 16:43:53 +0100 Subject: [PATCH 3/8] Fix click --- src/de/steamwar/bungeecore/commands/CalendarCommand.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/commands/CalendarCommand.java b/src/de/steamwar/bungeecore/commands/CalendarCommand.java index 95bfd23..ee80b1d 100644 --- a/src/de/steamwar/bungeecore/commands/CalendarCommand.java +++ b/src/de/steamwar/bungeecore/commands/CalendarCommand.java @@ -61,7 +61,8 @@ public class CalendarCommand extends SWCommand { 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 (month != Month.DECEMBER) return; + if (!click.isRightClick()) return; + if (month != Month.NOVEMBER) return; if (present.getKey() != day) return; // TODO: Add to schematic }); -- 2.39.2 From dbd9f977fd48c8d551de13f4b94b40c3daa40c92 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Tue, 22 Nov 2022 16:44:35 +0100 Subject: [PATCH 4/8] Add Listener --- src/de/steamwar/bungeecore/BungeeCore.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/de/steamwar/bungeecore/BungeeCore.java b/src/de/steamwar/bungeecore/BungeeCore.java index 6051a85..6465671 100644 --- a/src/de/steamwar/bungeecore/BungeeCore.java +++ b/src/de/steamwar/bungeecore/BungeeCore.java @@ -156,7 +156,9 @@ public class BungeeCore extends Plugin { new LocalCommand(); new SetLocaleCommand(); new BuilderCloudCommand(); + new CalendarCommand(); + new CalendarListener(); // Punishment Commands: new PunishmentCommand("ban", Punishment.PunishmentType.Ban); -- 2.39.2 From 40d10b5e3972477043c8ec9134ec920b22694744 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Tue, 22 Nov 2022 16:51:13 +0100 Subject: [PATCH 5/8] Add message to CalendarListener --- src/de/steamwar/bungeecore/listeners/CalendarListener.java | 7 ++++++- src/de/steamwar/messages/BungeeCore.properties | 3 ++- src/de/steamwar/messages/BungeeCore_de.properties | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/de/steamwar/bungeecore/listeners/CalendarListener.java b/src/de/steamwar/bungeecore/listeners/CalendarListener.java index 935ac5c..530b926 100644 --- a/src/de/steamwar/bungeecore/listeners/CalendarListener.java +++ b/src/de/steamwar/bungeecore/listeners/CalendarListener.java @@ -19,14 +19,17 @@ package de.steamwar.bungeecore.listeners; +import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.Message; import de.steamwar.bungeecore.commands.CalendarCommand; +import net.md_5.bungee.BungeeCord; import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.event.PostLoginEvent; import net.md_5.bungee.event.EventHandler; import java.time.LocalDate; import java.time.Month; +import java.util.concurrent.TimeUnit; public class CalendarListener extends BasicListener { @@ -44,6 +47,8 @@ public class CalendarListener extends BasicListener { return; } - Message.send("ADVENT_CALENDAR_MESSAGE", event.getPlayer(), null, new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/calendar")); + BungeeCord.getInstance().getScheduler().schedule(BungeeCore.get(), () -> { + Message.send("ADVENT_CALENDAR_MESSAGE", event.getPlayer(), Message.parse("ADVENT_CALENDAR_MESSAGE_HOVER", event.getPlayer()), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/calendar")); + }, 2, TimeUnit.SECONDS); } } diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index b8d510c..583327d 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -653,4 +653,5 @@ BUILDERCLOUD_VERSION=§cUnknown version. # Advent Calendar ADVENT_CALENDAR_TITLE=§eAdvent Calendar ADVENT_CALENDAR_DAY=§7Day§8: §e{0} -ADVENT_CALENDAR_MESSAGE=§7Did you already open your advent calendar? \ No newline at end of file +ADVENT_CALENDAR_MESSAGE=§eDid you already open your advent calendar? +ADVENT_CALENDAR_MESSAGE_HOVER=§eClick to open! \ No newline at end of file diff --git a/src/de/steamwar/messages/BungeeCore_de.properties b/src/de/steamwar/messages/BungeeCore_de.properties index 280b2f4..89e1ea4 100644 --- a/src/de/steamwar/messages/BungeeCore_de.properties +++ b/src/de/steamwar/messages/BungeeCore_de.properties @@ -631,4 +631,5 @@ BUILDERCLOUD_VERSION=§cUnbekannte Version. # Advent Calendar ADVENT_CALENDAR_TITLE=§eAdventskalender ADVENT_CALENDAR_DAY=§7Tag§8: §e{0} -ADVENT_CALENDAR_MESSAGE=§7Hast du heute schon dein Geschenk geholt? \ No newline at end of file +ADVENT_CALENDAR_MESSAGE=§eHast du heute schon dein Geschenk geholt? +ADVENT_CALENDAR_MESSAGE_HOVER=§eKlicken zum öffnen! \ No newline at end of file -- 2.39.2 From ca4a5b49dd5e929f1c13cc0190a1674f78317ef7 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Wed, 23 Nov 2022 21:02:31 +0100 Subject: [PATCH 6/8] Update calendar content --- .../bungeecore/commands/CalendarCommand.java | 31 ++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/CalendarCommand.java b/src/de/steamwar/bungeecore/commands/CalendarCommand.java index ee80b1d..72863d0 100644 --- a/src/de/steamwar/bungeecore/commands/CalendarCommand.java +++ b/src/de/steamwar/bungeecore/commands/CalendarCommand.java @@ -34,10 +34,33 @@ public class CalendarCommand extends SWCommand { private static Map dayToSchematicId = new HashMap<>(); static { - for (int i = 1; i < 27; i++) { - dayToSchematicId.put(i, 0); - } - dayToSchematicId.put(31, 0); + dayToSchematicId.put(1, 105386); + dayToSchematicId.put(2, 105463); + dayToSchematicId.put(3, 105438); + dayToSchematicId.put(4, 105383); + dayToSchematicId.put(5, 105381); + dayToSchematicId.put(6, 105396); + dayToSchematicId.put(7, 105462); + dayToSchematicId.put(8, 105457); + dayToSchematicId.put(9, 105388); + dayToSchematicId.put(10, 105390); + dayToSchematicId.put(11, 105385); + dayToSchematicId.put(12, 105397); + dayToSchematicId.put(13, 105455); + dayToSchematicId.put(14, 105389); + dayToSchematicId.put(15, 105454); + dayToSchematicId.put(16, 105394); + dayToSchematicId.put(17, 105459); + dayToSchematicId.put(18, 105384); + dayToSchematicId.put(19, 105392); + dayToSchematicId.put(20, 105465); + dayToSchematicId.put(21, 105393); + dayToSchematicId.put(22, 105464); + dayToSchematicId.put(23, 105380); + dayToSchematicId.put(24, 105505); + dayToSchematicId.put(25, 105517); + dayToSchematicId.put(26, 105517); + dayToSchematicId.put(31, 105507); } public CalendarCommand() { -- 2.39.2 From 6b0c30c2415294667253dd88964c40df4e53d8ab Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 24 Nov 2022 17:26:29 +0100 Subject: [PATCH 7/8] Finalize CalendarCommand --- .../bungeecore/commands/CalendarCommand.java | 13 +++++++++---- src/de/steamwar/messages/BungeeCore.properties | 3 ++- src/de/steamwar/messages/BungeeCore_de.properties | 3 ++- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/CalendarCommand.java b/src/de/steamwar/bungeecore/commands/CalendarCommand.java index 72863d0..65431e3 100644 --- a/src/de/steamwar/bungeecore/commands/CalendarCommand.java +++ b/src/de/steamwar/bungeecore/commands/CalendarCommand.java @@ -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 items = new ArrayList<>(); for (Map.Entry 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); } diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index 583327d..314f26d 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -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! \ No newline at end of file +ADVENT_CALENDAR_MESSAGE_HOVER=§eClick to open! +ADVENT_CALENDAR_OPEN=§7You got §e{0} §7from the advent calendar! \ No newline at end of file diff --git a/src/de/steamwar/messages/BungeeCore_de.properties b/src/de/steamwar/messages/BungeeCore_de.properties index 89e1ea4..97de4ee 100644 --- a/src/de/steamwar/messages/BungeeCore_de.properties +++ b/src/de/steamwar/messages/BungeeCore_de.properties @@ -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! \ No newline at end of file +ADVENT_CALENDAR_MESSAGE_HOVER=§eKlicken zum öffnen! +ADVENT_CALENDAR_OPEN=§7Du hast §e{0}§7 aus dem Adventskalender erhalten! \ No newline at end of file -- 2.39.2 From b2b51fa9b2d13f0173c930096a7c41c227eb16e7 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 25 Nov 2022 08:05:40 +0100 Subject: [PATCH 8/8] Finalize CalendarCommand --- src/de/steamwar/bungeecore/commands/CalendarCommand.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/commands/CalendarCommand.java b/src/de/steamwar/bungeecore/commands/CalendarCommand.java index 65431e3..45bf05b 100644 --- a/src/de/steamwar/bungeecore/commands/CalendarCommand.java +++ b/src/de/steamwar/bungeecore/commands/CalendarCommand.java @@ -85,7 +85,8 @@ public class CalendarCommand extends SWCommand { List items = new ArrayList<>(); for (Map.Entry present : dayToSchematicId.entrySet()) { boolean b = NodeMember.getNodeMember(present.getValue(), user.getId()) != null; - SWItem swItem = b ? SWItem.getSkull("MHF_Chest") : SWItem.getSkull("MHF_Present1"); + SWItem randomPresent = random.nextDouble() > 0.5 ? SWItem.getSkull("MHF_Present1") : SWItem.getSkull("MHF_Present2"); + SWItem swItem = b ? SWItem.getSkull("MHF_Chest") : randomPresent; swItem.setName(Message.parse("ADVENT_CALENDAR_DAY", player, present.getKey())); swItem.setCallback(click -> { if (b) return; -- 2.39.2