From a454da6da8c74676cf46593801e54eea45a20375 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Thu, 25 Dec 2025 21:07:53 +0100 Subject: [PATCH 01/16] Change Bug Button to Link Signed-off-by: Chaoscaot --- .../velocitycore/discord/DiscordTicketType.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/VelocityCore/src/de/steamwar/velocitycore/discord/DiscordTicketType.java b/VelocityCore/src/de/steamwar/velocitycore/discord/DiscordTicketType.java index 6d3921dc..11944ff2 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/discord/DiscordTicketType.java +++ b/VelocityCore/src/de/steamwar/velocitycore/discord/DiscordTicketType.java @@ -26,19 +26,23 @@ import net.dv8tion.jda.api.interactions.components.buttons.ButtonStyle; @AllArgsConstructor public enum DiscordTicketType { - REPORT("U+1F46E", "Spieler melden", ButtonStyle.DANGER), - IDEA("U+1F4A1", "Feature vorschlagen", ButtonStyle.SUCCESS), - BUG("U+1F41B", "Bug melden", ButtonStyle.SECONDARY), - QUESTION("U+2753", "Fragen", ButtonStyle.PRIMARY), - APPEAL("U+1F528", "Entbannungsantrag", ButtonStyle.SECONDARY), - SCHEMATIC("U+1F4BE", "Schematic melden", ButtonStyle.DANGER); + REPORT("U+1F46E", "Spieler melden", ButtonStyle.DANGER, null), + IDEA("U+1F4A1", "Feature vorschlagen", ButtonStyle.SUCCESS, null), + BUG("U+1F41B", "Bug melden", ButtonStyle.LINK, "https://git.steamwar.de/SteamWar/SteamWar/issues/new"), + QUESTION("U+2753", "Fragen", ButtonStyle.PRIMARY, null), + APPEAL("U+1F528", "Entbannungsantrag", ButtonStyle.SECONDARY, null), + SCHEMATIC("U+1F4BE", "Schematic melden", ButtonStyle.DANGER, null); private final String emoji; private final String label; private final ButtonStyle style; + private final String url; public Button toButton() { + if(style == ButtonStyle.LINK) { + return Button.link(url, label).withEmoji(Emoji.fromUnicode(emoji)); + } return Button.of(style, name().toLowerCase(), Emoji.fromUnicode(emoji)).withLabel(label); } From ebb2ec817d9b16a190c1fbc2bebb20fa73676799 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 27 Dec 2025 19:18:31 +0100 Subject: [PATCH 02/16] Fix Windcharge Damage on Arena Signed-off-by: Chaoscaot --- .../src/de/steamwar/fightsystem/listener/Permanent.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Permanent.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Permanent.java index f4489caf..f878e12c 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Permanent.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/listener/Permanent.java @@ -35,6 +35,7 @@ import org.bukkit.GameMode; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.entity.Player; +import org.bukkit.entity.TNTPrimed; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; @@ -180,6 +181,7 @@ public class Permanent implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onExplosion(EntityExplodeEvent e) { + if (!(e.getEntity() instanceof TNTPrimed)) return; e.blockList().removeIf(block -> { if(block.getType() == Material.TNT) { return false; From e4676d5ebacfeaf895d25fde127ff5376da73743 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Thu, 1 Jan 2026 15:08:37 +0100 Subject: [PATCH 03/16] Test hotpatch kit --- .../src/de/steamwar/fightsystem/fight/Kit.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/fight/Kit.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/fight/Kit.java index 0bba6ae5..f5489be1 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/fight/Kit.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/fight/Kit.java @@ -117,7 +117,7 @@ public class Kit { if(kit.isList("Armor")) armor = Objects.requireNonNull(kit.getList("Armor")).toArray(new ItemStack[0]); else - armor = null; + armor = new ItemStack[]{ null, null, null, null}; leaderAllowed = kit.getBoolean("LeaderAllowed"); memberAllowed = kit.getBoolean("MemberAllowed"); if(kit.isList("Effects")) @@ -261,7 +261,7 @@ public class Kit { player.getInventory().setContents(inventory); if(armor != null) player.getInventory().setArmorContents(armor); - player.updateInventory(); + player.updateInventory(); //TODO issue in 1.21.6? if(effects != null) player.addPotionEffects(effects); } From 1f64c3383da14a25954f7c02e7ccb1a79354e620 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Thu, 1 Jan 2026 17:04:09 +0100 Subject: [PATCH 04/16] Fix HotbarKitListener Signed-off-by: Chaoscaot --- CommonCore/SQL/src/de/steamwar/sql/PersonalKit.kt | 5 +++-- .../src/de/steamwar/fightsystem/fight/HotbarKitListener.java | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CommonCore/SQL/src/de/steamwar/sql/PersonalKit.kt b/CommonCore/SQL/src/de/steamwar/sql/PersonalKit.kt index 55d38a6a..5f4c873b 100644 --- a/CommonCore/SQL/src/de/steamwar/sql/PersonalKit.kt +++ b/CommonCore/SQL/src/de/steamwar/sql/PersonalKit.kt @@ -73,8 +73,8 @@ class InternalKit(id: EntityID): CompositeEntity(id) { this.rawInventory = rawInventory this.rawArmor = rawArmor this.inUse = false - } - }.also { it.setDefault() } + }.also { it.setDefault() } + } @JvmStatic fun getKitInUse(userId: Int, gamemode: String) = useDb { @@ -110,6 +110,7 @@ class InternalKit(id: EntityID): CompositeEntity(id) { fun setDefault() = useDb { find { PersonalKitTable.userId eq userID and (PersonalKitTable.gamemode eq gameMode) and (PersonalKitTable.inUse eq true) } + .filter { it.id.value != this@InternalKit.id.value } .forEach { it.inUse = false } inUse = true } diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/fight/HotbarKitListener.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/fight/HotbarKitListener.java index fa8e1dc3..afc735a2 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/fight/HotbarKitListener.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/fight/HotbarKitListener.java @@ -34,6 +34,7 @@ import org.bukkit.event.block.Action; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.inventory.EquipmentSlot; +import org.bukkit.inventory.PlayerInventory; import java.util.HashSet; import java.util.Set; @@ -62,6 +63,7 @@ public class HotbarKitListener implements Listener { public void onInventoryClick(InventoryClickEvent event) { int slot = event.getSlot(); if (slot < 0 || slot >= HotbarKit.HOTBAR_SIZE) return; + if (!(event.getClickedInventory() instanceof PlayerInventory)) return; Player player = (Player) event.getWhoClicked(); click(player, slot, event); From 663a745d8fc23373ae0a1e7981e063e55e5cef6d Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Fri, 2 Jan 2026 14:08:49 +0100 Subject: [PATCH 05/16] Fix Kits Signed-off-by: Chaoscaot --- .../src/de/steamwar/fightsystem/utils/ReflectionWrapper21.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/ReflectionWrapper21.java b/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/ReflectionWrapper21.java index 118bfba1..3b9f901d 100644 --- a/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/ReflectionWrapper21.java +++ b/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/ReflectionWrapper21.java @@ -31,6 +31,6 @@ public class ReflectionWrapper21 implements ReflectionWrapper { @Override public boolean hasItems(ItemStack stack) { - return stack.getDataTypes().stream().anyMatch(dataComponentType -> dataComponentType != DataComponentTypes.ENCHANTMENTS || dataComponentType != DataComponentTypes.DAMAGE); + return stack.getDataTypes().stream().anyMatch(dataComponentType -> dataComponentType != DataComponentTypes.ENCHANTMENTS); } } From d9f905d957756aecbc4446bed7e12f84492f4976 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Fri, 2 Jan 2026 14:24:49 +0100 Subject: [PATCH 06/16] Fix Kits Signed-off-by: Chaoscaot --- .../utils/ReflectionWrapper21.java | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/ReflectionWrapper21.java b/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/ReflectionWrapper21.java index 3b9f901d..ae461357 100644 --- a/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/ReflectionWrapper21.java +++ b/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/ReflectionWrapper21.java @@ -19,11 +19,27 @@ package de.steamwar.fightsystem.utils; +import io.papermc.paper.datacomponent.DataComponentType; import io.papermc.paper.datacomponent.DataComponentTypes; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; +import java.util.HashSet; +import java.util.Set; + public class ReflectionWrapper21 implements ReflectionWrapper { + private static final Set FORBIDDEN_TYPES = new HashSet<>(); + + static { + FORBIDDEN_TYPES.add(DataComponentTypes.CUSTOM_NAME); + FORBIDDEN_TYPES.add(DataComponentTypes.PROFILE); + FORBIDDEN_TYPES.add(DataComponentTypes.UNBREAKABLE); + FORBIDDEN_TYPES.add(DataComponentTypes.BLOCK_DATA); + FORBIDDEN_TYPES.add(DataComponentTypes.BLOCKS_ATTACKS); + FORBIDDEN_TYPES.add(DataComponentTypes.BUNDLE_CONTENTS); + FORBIDDEN_TYPES.add(DataComponentTypes.CUSTOM_MODEL_DATA); + } + @Override public Object explosionHider(Player player, Object packet, PacketHiderFunction packetHiderFunction) { return packet; @@ -31,6 +47,9 @@ public class ReflectionWrapper21 implements ReflectionWrapper { @Override public boolean hasItems(ItemStack stack) { - return stack.getDataTypes().stream().anyMatch(dataComponentType -> dataComponentType != DataComponentTypes.ENCHANTMENTS); + return stack.getDataTypes().stream().filter(FORBIDDEN_TYPES::contains).allMatch(dataComponentType -> { + System.out.println(dataComponentType); + return true; + }); } } From 74d6ccc24f030619a82dbcd9f3be93275d406d5c Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 3 Jan 2026 02:22:55 +0100 Subject: [PATCH 07/16] Fix Kits Signed-off-by: Chaoscaot --- .../de/steamwar/fightsystem/utils/ReflectionWrapper21.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/ReflectionWrapper21.java b/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/ReflectionWrapper21.java index ae461357..7ea7a6c4 100644 --- a/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/ReflectionWrapper21.java +++ b/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/ReflectionWrapper21.java @@ -47,9 +47,6 @@ public class ReflectionWrapper21 implements ReflectionWrapper { @Override public boolean hasItems(ItemStack stack) { - return stack.getDataTypes().stream().filter(FORBIDDEN_TYPES::contains).allMatch(dataComponentType -> { - System.out.println(dataComponentType); - return true; - }); + return stack.getDataTypes().stream().anyMatch(FORBIDDEN_TYPES::contains); } } From 4bea077d36057388bd507ce60b4a3cc6f037478a Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 3 Jan 2026 02:25:52 +0100 Subject: [PATCH 08/16] Fix Kits Signed-off-by: Chaoscaot --- .../src/de/steamwar/fightsystem/utils/ReflectionWrapper21.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/ReflectionWrapper21.java b/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/ReflectionWrapper21.java index 7ea7a6c4..ea8b2d7f 100644 --- a/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/ReflectionWrapper21.java +++ b/FightSystem/FightSystem_21/src/de/steamwar/fightsystem/utils/ReflectionWrapper21.java @@ -47,6 +47,7 @@ public class ReflectionWrapper21 implements ReflectionWrapper { @Override public boolean hasItems(ItemStack stack) { - return stack.getDataTypes().stream().anyMatch(FORBIDDEN_TYPES::contains); + FORBIDDEN_TYPES.forEach(stack::resetData); + return false; } } From 834767edbe6c3a69a0ddc24ba54b9f598b83fb11 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sun, 4 Jan 2026 12:35:11 +0100 Subject: [PATCH 09/16] Fix API Signed-off-by: Chaoscaot --- CommonCore/SQL/src/de/steamwar/sql/SchematicNode.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CommonCore/SQL/src/de/steamwar/sql/SchematicNode.kt b/CommonCore/SQL/src/de/steamwar/sql/SchematicNode.kt index 8cc0363f..d27c2890 100644 --- a/CommonCore/SQL/src/de/steamwar/sql/SchematicNode.kt +++ b/CommonCore/SQL/src/de/steamwar/sql/SchematicNode.kt @@ -116,7 +116,7 @@ class SchematicNode(id: EntityID) : IntEntity(id) { @JvmStatic fun schematicAccessibleForUser(user: SteamwarUser, schematicId: Int?) = fromSql( - "WITH RECURSIVE Nodes AS (SELECT NodeId, ParentId as ParentNode FROM NodeMember WHERE UserId = ? UNION SELECT NodeId, ParentNode FROM SchematicNode WHERE NodeOwner = ?), RSN AS ( SELECT NodeId, ParentNode FROM Nodes UNION SELECT SN.NodeId, SN.ParentNode FROM SchematicNode SN, RSN WHERE SN.ParentNode = RSN.NodeId ) SELECT SN.*, ? AS EffectiveOwner FROM RSN INNER JOIN SchematicNode SN ON RSN.NodeId = SN.NodeId WHERE NodeId = ?", + "WITH RECURSIVE Nodes AS (SELECT NodeId, ParentId as ParentNode FROM NodeMember WHERE UserId = ? UNION SELECT NodeId, ParentNode FROM SchematicNode WHERE NodeOwner = ?), RSN AS ( SELECT NodeId, ParentNode FROM Nodes UNION SELECT SN.NodeId, SN.ParentNode FROM SchematicNode SN, RSN WHERE SN.ParentNode = RSN.NodeId ) SELECT SN.*, ? AS EffectiveOwner FROM RSN INNER JOIN SchematicNode SN ON RSN.NodeId = SN.NodeId WHERE SN.NodeId = ?", listOf( IntegerColumnType() to user.getId(), IntegerColumnType() to user.getId(), From 4b2970d24314ef7f6226935e0846ecb99c726251 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Fri, 9 Jan 2026 09:53:30 +0100 Subject: [PATCH 10/16] Check why StaticMessageChannel does not work? --- .../velocitycore/discord/channels/StaticMessageChannel.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java b/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java index f959e1f4..a3248635 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java +++ b/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java @@ -70,8 +70,10 @@ public class StaticMessageChannel extends DiscordChannel { public void update() { if (message == null) { + System.out.println("Sending message " + getChannel() + " " + message); getChannel().sendMessage(supplier.get().build()).queue(m -> message = m); } else { + System.out.println("Updating message: " + getChannel() + " " + message); message.editMessage(MessageEditData.fromCreateData(supplier.get().build())).queue(); } } From bb9caa28a38ad9f8c7df44c6874220066adcc287 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Fri, 9 Jan 2026 09:57:18 +0100 Subject: [PATCH 11/16] Check why StaticMessageChannel does not work? --- .../src/de/steamwar/velocitycore/discord/DiscordBot.java | 1 + .../velocitycore/discord/channels/StaticMessageChannel.java | 1 + 2 files changed, 2 insertions(+) diff --git a/VelocityCore/src/de/steamwar/velocitycore/discord/DiscordBot.java b/VelocityCore/src/de/steamwar/velocitycore/discord/DiscordBot.java index 40dee4b1..cf56ea58 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/discord/DiscordBot.java +++ b/VelocityCore/src/de/steamwar/velocitycore/discord/DiscordBot.java @@ -159,6 +159,7 @@ public class DiscordBot { if (!list.isEmpty()) { actionRows.add(ActionRow.of(list.toArray(Button[]::new))); } + System.out.println("Initializing Ticket channel"); new StaticMessageChannel(config.channel("ticket"), () -> new MessageCreateBuilder() .setEmbeds(new EmbedBuilder() .setDescription("Hier kannst du Tickets öffnen, welche nur von dir und Teammitgliedern eingesehen werden können.") diff --git a/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java b/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java index a3248635..4c8d832b 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java +++ b/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java @@ -62,6 +62,7 @@ public class StaticMessageChannel extends DiscordChannel { } private void init() { + System.out.println("Initializing " + getChannel()); if(getChannel().getLatestMessageIdLong() != 0) message = getChannel().getIterableHistory().complete().stream().filter(m -> m.getAuthor().isBot()).findFirst().orElse(null); From 61bd28150b41b8fce2af7030e5f968529cbbdd86 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Fri, 9 Jan 2026 09:59:22 +0100 Subject: [PATCH 12/16] Check why StaticMessageChannel does not work? --- .../src/de/steamwar/velocitycore/discord/DiscordBot.java | 1 - .../velocitycore/discord/channels/StaticMessageChannel.java | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/VelocityCore/src/de/steamwar/velocitycore/discord/DiscordBot.java b/VelocityCore/src/de/steamwar/velocitycore/discord/DiscordBot.java index cf56ea58..40dee4b1 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/discord/DiscordBot.java +++ b/VelocityCore/src/de/steamwar/velocitycore/discord/DiscordBot.java @@ -159,7 +159,6 @@ public class DiscordBot { if (!list.isEmpty()) { actionRows.add(ActionRow.of(list.toArray(Button[]::new))); } - System.out.println("Initializing Ticket channel"); new StaticMessageChannel(config.channel("ticket"), () -> new MessageCreateBuilder() .setEmbeds(new EmbedBuilder() .setDescription("Hier kannst du Tickets öffnen, welche nur von dir und Teammitgliedern eingesehen werden können.") diff --git a/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java b/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java index 4c8d832b..6d43b8f7 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java +++ b/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java @@ -27,6 +27,7 @@ import net.dv8tion.jda.api.events.interaction.component.GenericComponentInteract import net.dv8tion.jda.api.utils.messages.MessageCreateBuilder; import net.dv8tion.jda.api.utils.messages.MessageEditData; +import java.util.Collections; import java.util.concurrent.TimeoutException; import java.util.function.Consumer; import java.util.function.Supplier; @@ -62,9 +63,8 @@ public class StaticMessageChannel extends DiscordChannel { } private void init() { - System.out.println("Initializing " + getChannel()); if(getChannel().getLatestMessageIdLong() != 0) - message = getChannel().getIterableHistory().complete().stream().filter(m -> m.getAuthor().isBot()).findFirst().orElse(null); + message = getChannel().getIterableHistory().onErrorMap(throwable -> Collections.emptyList()).complete().stream().filter(m -> m.getAuthor().isBot()).findFirst().orElse(null); VelocityCore.schedule(this::update); } From ce3d50fcb75a0c92d2426ea385fc036ba4d7516e Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Fri, 9 Jan 2026 10:01:36 +0100 Subject: [PATCH 13/16] Check why StaticMessageChannel does not work? --- .../velocitycore/discord/channels/StaticMessageChannel.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java b/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java index 6d43b8f7..9de9c5b5 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java +++ b/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java @@ -63,9 +63,7 @@ public class StaticMessageChannel extends DiscordChannel { } private void init() { - if(getChannel().getLatestMessageIdLong() != 0) - message = getChannel().getIterableHistory().onErrorMap(throwable -> Collections.emptyList()).complete().stream().filter(m -> m.getAuthor().isBot()).findFirst().orElse(null); - + message = getChannel().getIterableHistory().onErrorMap(throwable -> Collections.emptyList()).complete().stream().filter(m -> m.getAuthor().isBot()).findFirst().orElse(null); VelocityCore.schedule(this::update); } From 3cecc58bced3c1c534be31167aa504c371e39612 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Fri, 9 Jan 2026 10:03:14 +0100 Subject: [PATCH 14/16] Check why StaticMessageChannel does not work? --- .../discord/channels/StaticMessageChannel.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java b/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java index 9de9c5b5..359ff4ce 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java +++ b/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java @@ -63,7 +63,14 @@ public class StaticMessageChannel extends DiscordChannel { } private void init() { - message = getChannel().getIterableHistory().onErrorMap(throwable -> Collections.emptyList()).complete().stream().filter(m -> m.getAuthor().isBot()).findFirst().orElse(null); + message = getChannel().getIterableHistory() + .onErrorMap(throwable -> Collections.emptyList()) + .deadline(System.currentTimeMillis() + 5000) + .complete() + .stream() + .filter(m -> m.getAuthor().isBot()) + .findFirst() + .orElse(null); VelocityCore.schedule(this::update); } From db4ea2d69d96b0d7d7b3455814dcf95794dcb045 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Fri, 9 Jan 2026 10:05:17 +0100 Subject: [PATCH 15/16] Check why StaticMessageChannel does not work? --- .../velocitycore/discord/channels/StaticMessageChannel.java | 1 + 1 file changed, 1 insertion(+) diff --git a/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java b/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java index 359ff4ce..d93f8dae 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java +++ b/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java @@ -71,6 +71,7 @@ public class StaticMessageChannel extends DiscordChannel { .filter(m -> m.getAuthor().isBot()) .findFirst() .orElse(null); + System.out.println("Initialized " + getChannel()); VelocityCore.schedule(this::update); } From 361c6983234cfbd7780893c585a6d0747bc47445 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Fri, 9 Jan 2026 10:07:26 +0100 Subject: [PATCH 16/16] Check why StaticMessageChannel does not work? --- .../channels/StaticMessageChannel.java | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java b/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java index d93f8dae..915affbe 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java +++ b/VelocityCore/src/de/steamwar/velocitycore/discord/channels/StaticMessageChannel.java @@ -63,24 +63,23 @@ public class StaticMessageChannel extends DiscordChannel { } private void init() { - message = getChannel().getIterableHistory() - .onErrorMap(throwable -> Collections.emptyList()) - .deadline(System.currentTimeMillis() + 5000) - .complete() - .stream() - .filter(m -> m.getAuthor().isBot()) - .findFirst() - .orElse(null); - System.out.println("Initialized " + getChannel()); - VelocityCore.schedule(this::update); + if (getChannel().getLatestMessageIdLong() != 0) { + message = getChannel().getIterableHistory() + .onErrorMap(throwable -> Collections.emptyList()) + .deadline(System.currentTimeMillis() + 5000) + .complete() + .stream() + .filter(m -> m.getAuthor().isBot()) + .findFirst() + .orElse(null); + } + VelocityCore.schedule(this::update).schedule(); } public void update() { if (message == null) { - System.out.println("Sending message " + getChannel() + " " + message); getChannel().sendMessage(supplier.get().build()).queue(m -> message = m); } else { - System.out.println("Updating message: " + getChannel() + " " + message); message.editMessage(MessageEditData.fromCreateData(supplier.get().build())).queue(); } }