From 3f9f9546f6a687b6c7302d07e2e70f7359b3237e Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 17 Feb 2023 14:51:03 +0100 Subject: [PATCH 01/10] Improve needed mods check --- src/de/steamwar/bungeecore/listeners/mods/Fabric.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/de/steamwar/bungeecore/listeners/mods/Fabric.java b/src/de/steamwar/bungeecore/listeners/mods/Fabric.java index 440ab12..24b4804 100644 --- a/src/de/steamwar/bungeecore/listeners/mods/Fabric.java +++ b/src/de/steamwar/bungeecore/listeners/mods/Fabric.java @@ -122,12 +122,8 @@ public class Fabric extends BasicListener { mods.add(Mod.get(mod.getAsString(), Mod.Platform.FABRIC)); } - if(!neededModsContained(mods)) { - logMessage(user, "Needed mods are not contained", dataString); - return; - } - - if(Utils.handleMods(player,mods)) { + boolean neededMods = neededModsContained(mods); + if(Utils.handleMods(player,mods) && neededMods) { if (Storage.fabricCheckedPlayers.containsKey(player)) { long current = Storage.fabricCheckedPlayers.get(player); if (current != dataString.hashCode()) { @@ -139,6 +135,8 @@ public class Fabric extends BasicListener { Storage.fabricCheckedPlayers.put(player, dataString.hashCode()); } Storage.fabricPlayers.remove(player); + } else if (!neededMods) { + logMessage(user, "Needed mods are not contained", dataString); } } From a0dd4f5c575e0320c58b9a29312469f665b0ae03 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Fri, 17 Feb 2023 17:08:59 +0100 Subject: [PATCH 02/10] HotFix Tablistpart Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/tablist/TablistPart.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/tablist/TablistPart.java b/src/de/steamwar/bungeecore/tablist/TablistPart.java index b140114..e784d78 100644 --- a/src/de/steamwar/bungeecore/tablist/TablistPart.java +++ b/src/de/steamwar/bungeecore/tablist/TablistPart.java @@ -38,7 +38,11 @@ interface TablistPart { class Item { public static Property[] playerProperties(ProxiedPlayer player) { - return ((InitialHandler) player.getPendingConnection()).getLoginProfile().getProperties(); + InitialHandler handler = (InitialHandler) player.getPendingConnection(); + if(handler == null) + return new Property[0]; + + return handler.getLoginProfile().getProperties(); } private final UUID uuid; From bc44380c32071e8b9a1c227b0543b37799c7beaa Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 17 Feb 2023 17:13:46 +0100 Subject: [PATCH 03/10] Add NonFabricFabricCheck --- src/de/steamwar/bungeecore/BungeeCore.java | 7 +- .../listeners/NonFabricFabricCheck.java | 82 +++++++++++++++++++ .../steamwar/messages/BungeeCore.properties | 2 + .../messages/BungeeCore_de.properties | 2 + 4 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 src/de/steamwar/bungeecore/listeners/NonFabricFabricCheck.java diff --git a/src/de/steamwar/bungeecore/BungeeCore.java b/src/de/steamwar/bungeecore/BungeeCore.java index b0c69b6..ea959b7 100644 --- a/src/de/steamwar/bungeecore/BungeeCore.java +++ b/src/de/steamwar/bungeecore/BungeeCore.java @@ -28,7 +28,10 @@ import de.steamwar.bungeecore.listeners.ping.PingListener; import de.steamwar.bungeecore.network.BungeeNetworkHandler; import de.steamwar.bungeecore.network.NetworkReceiver; import de.steamwar.bungeecore.network.SWScriptSyntaxForwarder; -import de.steamwar.bungeecore.sql.*; +import de.steamwar.bungeecore.sql.Punishment; +import de.steamwar.bungeecore.sql.SteamwarUser; +import de.steamwar.bungeecore.sql.Team; +import de.steamwar.bungeecore.sql.UserElo; import de.steamwar.bungeecore.tablist.TablistManager; import de.steamwar.command.SWCommandUtils; import de.steamwar.command.SWTypeMapperCreator; @@ -102,6 +105,8 @@ public class BungeeCore extends Plugin { }); BungeeCord.getInstance().getScheduler().schedule(this, TabCompletionCache::invalidateOldEntries, 1, 1, TimeUnit.SECONDS); + new NonFabricFabricCheck(); + new SWScriptSyntaxForwarder(); new ConnectionListener(); new Forge(); diff --git a/src/de/steamwar/bungeecore/listeners/NonFabricFabricCheck.java b/src/de/steamwar/bungeecore/listeners/NonFabricFabricCheck.java new file mode 100644 index 0000000..3dab7f1 --- /dev/null +++ b/src/de/steamwar/bungeecore/listeners/NonFabricFabricCheck.java @@ -0,0 +1,82 @@ +/* + * 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.BungeeCore; +import de.steamwar.bungeecore.Message; +import de.steamwar.bungeecore.Storage; +import net.md_5.bungee.BungeeCord; +import net.md_5.bungee.api.connection.Connection; +import net.md_5.bungee.api.connection.ProxiedPlayer; +import net.md_5.bungee.api.event.PlayerDisconnectEvent; +import net.md_5.bungee.api.event.PluginMessageEvent; +import net.md_5.bungee.api.event.PostLoginEvent; +import net.md_5.bungee.event.EventHandler; + +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +public class NonFabricFabricCheck extends BasicListener { + + private Set usingFabric = new HashSet<>(); + + private Set checking = new HashSet<>(); + + @EventHandler + public void pluginMessageEvent(PluginMessageEvent e) { + Connection sender = e.getSender(); + if(!(sender instanceof ProxiedPlayer)) + return; + + if(!e.getTag().equals("minecraft:brand")) + return; + + if(!new String(e.getData()).contains("vanilla")){ + return; + } + + ProxiedPlayer p = (ProxiedPlayer) sender; + + BungeeCord.getInstance().getScheduler().schedule(BungeeCore.get(), () -> { + if (!p.isConnected()) return; + if (Storage.fabricCheckedPlayers.containsKey(p)) return; + checking.add(p); + p.sendData("fabric-screen-handler-api-v1:open_screen", new byte[] {0}); + BungeeCord.getInstance().getScheduler().schedule(BungeeCore.get(), () -> checking.remove(p), 1, TimeUnit.SECONDS); + }, 30, TimeUnit.SECONDS); + } + + @EventHandler + public void onPlayerPreLogin(PostLoginEvent e) { + if (usingFabric.contains(e.getPlayer())) { + e.getPlayer().disconnect(Message.parse("MOD_USE_MODSENDER", e.getPlayer())); + usingFabric.remove(e.getPlayer()); + } + } + + @EventHandler + public void onPlayerDisconnect(PlayerDisconnectEvent e) { + if (checking.contains(e.getPlayer())) { + usingFabric.add(e.getPlayer()); + } + checking.remove(e.getPlayer()); + } +} diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index fb44d5a..5725c9b 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -116,6 +116,8 @@ MOD_RED_PLUR=Attempted use of mods:\n{0} MOD_YELLOW_SING=§7Deactivate the mod §e{0}§7 to continue playing on §eSteam§8War§7. MOD_YELLOW_PLUR=§7Deactivate the mods\n§e{0}\n§7to continue playing on §eSteam§8War§7. +MOD_USE_MODSENDER=§cPlease use the §c§lSteamWarModSender§c. + #Various commands ALERT=§f{0} STAT_SERVER=§7Server §e{0}§8: §7Below limit §e{1} §7Server count §e{2} diff --git a/src/de/steamwar/messages/BungeeCore_de.properties b/src/de/steamwar/messages/BungeeCore_de.properties index f9b11af..6111018 100644 --- a/src/de/steamwar/messages/BungeeCore_de.properties +++ b/src/de/steamwar/messages/BungeeCore_de.properties @@ -102,6 +102,8 @@ MOD_RED_PLUR=Versuchte Benutzung der Mods:\n{0} MOD_YELLOW_SING=§7Deaktiviere den Mod §e{0}§7, um weiter auf §eSteam§8War §7spielen zu können. MOD_YELLOW_PLUR=§7Deaktiviere die Mods\n§e{0}\n§7um weiter auf §eSteam§8War §7spielen zu können. +MOD_USE_MODSENDER=§cBitte nutze den §c§lSteamWarModSender§c. + #Various commands STAT_SERVER=§7Server §e{0}§8: §7Startfähig §e{1} §7Serveranzahl §e{2} From 277304b7f2d3b195fc4e4f2bf749a68e0868fb4f Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 17 Feb 2023 17:15:30 +0100 Subject: [PATCH 04/10] Fix vanilla brand check --- src/de/steamwar/bungeecore/listeners/NonFabricFabricCheck.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/listeners/NonFabricFabricCheck.java b/src/de/steamwar/bungeecore/listeners/NonFabricFabricCheck.java index 3dab7f1..72cbb42 100644 --- a/src/de/steamwar/bungeecore/listeners/NonFabricFabricCheck.java +++ b/src/de/steamwar/bungeecore/listeners/NonFabricFabricCheck.java @@ -49,7 +49,7 @@ public class NonFabricFabricCheck extends BasicListener { if(!e.getTag().equals("minecraft:brand")) return; - if(!new String(e.getData()).contains("vanilla")){ + if(!new String(e.getData()).equals("vanilla")){ return; } From e4ab48a386e79575ee8dee41925320d28a760bcb Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 17 Feb 2023 17:22:49 +0100 Subject: [PATCH 05/10] Fix vanilla brand check --- .../listeners/NonFabricFabricCheck.java | 22 +++++++++++-------- .../steamwar/messages/BungeeCore.properties | 2 +- .../messages/BungeeCore_de.properties | 2 +- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/de/steamwar/bungeecore/listeners/NonFabricFabricCheck.java b/src/de/steamwar/bungeecore/listeners/NonFabricFabricCheck.java index 72cbb42..43da240 100644 --- a/src/de/steamwar/bungeecore/listeners/NonFabricFabricCheck.java +++ b/src/de/steamwar/bungeecore/listeners/NonFabricFabricCheck.java @@ -25,21 +25,27 @@ import de.steamwar.bungeecore.Storage; import net.md_5.bungee.BungeeCord; import net.md_5.bungee.api.connection.Connection; import net.md_5.bungee.api.connection.ProxiedPlayer; +import net.md_5.bungee.api.event.LoginEvent; import net.md_5.bungee.api.event.PlayerDisconnectEvent; import net.md_5.bungee.api.event.PluginMessageEvent; -import net.md_5.bungee.api.event.PostLoginEvent; import net.md_5.bungee.event.EventHandler; import java.util.HashSet; +import java.util.Locale; import java.util.Set; +import java.util.UUID; import java.util.concurrent.TimeUnit; public class NonFabricFabricCheck extends BasicListener { - private Set usingFabric = new HashSet<>(); + private Set usingFabric = new HashSet<>(); private Set checking = new HashSet<>(); + { + BungeeCord.getInstance().getScheduler().schedule(BungeeCore.get(), usingFabric::clear, 0, 15, TimeUnit.MINUTES); + } + @EventHandler public void pluginMessageEvent(PluginMessageEvent e) { Connection sender = e.getSender(); @@ -65,18 +71,16 @@ public class NonFabricFabricCheck extends BasicListener { } @EventHandler - public void onPlayerPreLogin(PostLoginEvent e) { - if (usingFabric.contains(e.getPlayer())) { - e.getPlayer().disconnect(Message.parse("MOD_USE_MODSENDER", e.getPlayer())); - usingFabric.remove(e.getPlayer()); + public void onPlayerPreLogin(LoginEvent e) { + if (usingFabric.remove(e.getConnection().getUniqueId())) { + e.getConnection().disconnect(Message.parse("MOD_USE_MODSENDER", Locale.getDefault())); } } @EventHandler public void onPlayerDisconnect(PlayerDisconnectEvent e) { - if (checking.contains(e.getPlayer())) { - usingFabric.add(e.getPlayer()); + if (checking.remove(e.getPlayer())) { + usingFabric.add(e.getPlayer().getUniqueId()); } - checking.remove(e.getPlayer()); } } diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index 5725c9b..926b255 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -116,7 +116,7 @@ MOD_RED_PLUR=Attempted use of mods:\n{0} MOD_YELLOW_SING=§7Deactivate the mod §e{0}§7 to continue playing on §eSteam§8War§7. MOD_YELLOW_PLUR=§7Deactivate the mods\n§e{0}\n§7to continue playing on §eSteam§8War§7. -MOD_USE_MODSENDER=§cPlease use the §c§lSteamWarModSender§c. +MOD_USE_MODSENDER=§cPlease use the §c§lSteamWarModSender§c or say that you are using fabric. #Various commands ALERT=§f{0} diff --git a/src/de/steamwar/messages/BungeeCore_de.properties b/src/de/steamwar/messages/BungeeCore_de.properties index 6111018..5a81745 100644 --- a/src/de/steamwar/messages/BungeeCore_de.properties +++ b/src/de/steamwar/messages/BungeeCore_de.properties @@ -102,7 +102,7 @@ MOD_RED_PLUR=Versuchte Benutzung der Mods:\n{0} MOD_YELLOW_SING=§7Deaktiviere den Mod §e{0}§7, um weiter auf §eSteam§8War §7spielen zu können. MOD_YELLOW_PLUR=§7Deaktiviere die Mods\n§e{0}\n§7um weiter auf §eSteam§8War §7spielen zu können. -MOD_USE_MODSENDER=§cBitte nutze den §c§lSteamWarModSender§c. +MOD_USE_MODSENDER=§cBitte nutze den §c§lSteamWarModSender§c oder sag uns das du Fabric nutzt. #Various commands STAT_SERVER=§7Server §e{0}§8: §7Startfähig §e{1} §7Serveranzahl §e{2} From 91e73eab25b5abd65d0b136628a4a2ad14f891e0 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 17 Feb 2023 17:24:49 +0100 Subject: [PATCH 06/10] Update messages --- src/de/steamwar/messages/BungeeCore.properties | 2 +- src/de/steamwar/messages/BungeeCore_de.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index 926b255..f5b03dd 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -116,7 +116,7 @@ MOD_RED_PLUR=Attempted use of mods:\n{0} MOD_YELLOW_SING=§7Deactivate the mod §e{0}§7 to continue playing on §eSteam§8War§7. MOD_YELLOW_PLUR=§7Deactivate the mods\n§e{0}\n§7to continue playing on §eSteam§8War§7. -MOD_USE_MODSENDER=§cPlease use the §c§lSteamWarModSender§c or say that you are using fabric. +MOD_USE_MODSENDER=§cPlease use the §c§lSteamWarModSender§c or remove the mod that is rebranding your installation. #Various commands ALERT=§f{0} diff --git a/src/de/steamwar/messages/BungeeCore_de.properties b/src/de/steamwar/messages/BungeeCore_de.properties index 5a81745..98b6a76 100644 --- a/src/de/steamwar/messages/BungeeCore_de.properties +++ b/src/de/steamwar/messages/BungeeCore_de.properties @@ -102,7 +102,7 @@ MOD_RED_PLUR=Versuchte Benutzung der Mods:\n{0} MOD_YELLOW_SING=§7Deaktiviere den Mod §e{0}§7, um weiter auf §eSteam§8War §7spielen zu können. MOD_YELLOW_PLUR=§7Deaktiviere die Mods\n§e{0}\n§7um weiter auf §eSteam§8War §7spielen zu können. -MOD_USE_MODSENDER=§cBitte nutze den §c§lSteamWarModSender§c oder sag uns das du Fabric nutzt. +MOD_USE_MODSENDER=§cBitte nutze den §c§lSteamWarModSender§c oder entfernen Sie den Mod, der Ihre Installation umbenennt. #Various commands STAT_SERVER=§7Server §e{0}§8: §7Startfähig §e{1} §7Serveranzahl §e{2} From 5d70cc4185ed9c46d82c988a504300ef28718eb5 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 17 Feb 2023 17:25:58 +0100 Subject: [PATCH 07/10] Update messages --- src/de/steamwar/messages/BungeeCore.properties | 2 +- src/de/steamwar/messages/BungeeCore_de.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index f5b03dd..b4256b2 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -116,7 +116,7 @@ MOD_RED_PLUR=Attempted use of mods:\n{0} MOD_YELLOW_SING=§7Deactivate the mod §e{0}§7 to continue playing on §eSteam§8War§7. MOD_YELLOW_PLUR=§7Deactivate the mods\n§e{0}\n§7to continue playing on §eSteam§8War§7. -MOD_USE_MODSENDER=§cPlease use the §c§lSteamWarModSender§c or remove the mod that is rebranding your installation. +MOD_USE_MODSENDER=§cPlease use the §c§lFabricModSender§c (https://steamwar.de/downloads/) or remove the mod that is rebranding your installation. #Various commands ALERT=§f{0} diff --git a/src/de/steamwar/messages/BungeeCore_de.properties b/src/de/steamwar/messages/BungeeCore_de.properties index 98b6a76..d5c5c54 100644 --- a/src/de/steamwar/messages/BungeeCore_de.properties +++ b/src/de/steamwar/messages/BungeeCore_de.properties @@ -102,7 +102,7 @@ MOD_RED_PLUR=Versuchte Benutzung der Mods:\n{0} MOD_YELLOW_SING=§7Deaktiviere den Mod §e{0}§7, um weiter auf §eSteam§8War §7spielen zu können. MOD_YELLOW_PLUR=§7Deaktiviere die Mods\n§e{0}\n§7um weiter auf §eSteam§8War §7spielen zu können. -MOD_USE_MODSENDER=§cBitte nutze den §c§lSteamWarModSender§c oder entfernen Sie den Mod, der Ihre Installation umbenennt. +MOD_USE_MODSENDER=§cBitte nutze den §c§lFabricModSender§c (https://steamwar.de/downloads/) oder entfernen Sie den Mod, der Ihre Installation umbenennt. #Various commands STAT_SERVER=§7Server §e{0}§8: §7Startfähig §e{1} §7Serveranzahl §e{2} From 68a2f78e04b4b3c4efb56650f45b418619f73f41 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 17 Feb 2023 17:33:56 +0100 Subject: [PATCH 08/10] Update messages --- .../steamwar/bungeecore/listeners/NonFabricFabricCheck.java | 4 ++-- src/de/steamwar/messages/BungeeCore_de.properties | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/de/steamwar/bungeecore/listeners/NonFabricFabricCheck.java b/src/de/steamwar/bungeecore/listeners/NonFabricFabricCheck.java index 43da240..b903b9c 100644 --- a/src/de/steamwar/bungeecore/listeners/NonFabricFabricCheck.java +++ b/src/de/steamwar/bungeecore/listeners/NonFabricFabricCheck.java @@ -38,9 +38,9 @@ import java.util.concurrent.TimeUnit; public class NonFabricFabricCheck extends BasicListener { - private Set usingFabric = new HashSet<>(); + private final Set usingFabric = new HashSet<>(); - private Set checking = new HashSet<>(); + private final Set checking = new HashSet<>(); { BungeeCord.getInstance().getScheduler().schedule(BungeeCore.get(), usingFabric::clear, 0, 15, TimeUnit.MINUTES); diff --git a/src/de/steamwar/messages/BungeeCore_de.properties b/src/de/steamwar/messages/BungeeCore_de.properties index d5c5c54..83de9f6 100644 --- a/src/de/steamwar/messages/BungeeCore_de.properties +++ b/src/de/steamwar/messages/BungeeCore_de.properties @@ -102,7 +102,7 @@ MOD_RED_PLUR=Versuchte Benutzung der Mods:\n{0} MOD_YELLOW_SING=§7Deaktiviere den Mod §e{0}§7, um weiter auf §eSteam§8War §7spielen zu können. MOD_YELLOW_PLUR=§7Deaktiviere die Mods\n§e{0}\n§7um weiter auf §eSteam§8War §7spielen zu können. -MOD_USE_MODSENDER=§cBitte nutze den §c§lFabricModSender§c (https://steamwar.de/downloads/) oder entfernen Sie den Mod, der Ihre Installation umbenennt. +MOD_USE_MODSENDER=§cBitte nutze den §c§lFabricModSender§c (https://steamwar.de/downloads/) oder entfernen den Mod, der die Installation umbenennt. #Various commands STAT_SERVER=§7Server §e{0}§8: §7Startfähig §e{1} §7Serveranzahl §e{2} From 978fd1abe07008d3ef562e3dd36b8fa7d692182c Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sun, 19 Feb 2023 22:46:58 +0100 Subject: [PATCH 09/10] Fix Quilt FabricModSender requirement Signed-off-by: Lixfel --- CommonCore | 2 +- .../steamwar/bungeecore/listeners/mods/ModLoaderBlocker.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CommonCore b/CommonCore index 89b0c14..aa70f42 160000 --- a/CommonCore +++ b/CommonCore @@ -1 +1 @@ -Subproject commit 89b0c14da664589a7c9699d73bf72028cdf9dd0d +Subproject commit aa70f423d87e9f6534ad2dd1f20a5122179c423f diff --git a/src/de/steamwar/bungeecore/listeners/mods/ModLoaderBlocker.java b/src/de/steamwar/bungeecore/listeners/mods/ModLoaderBlocker.java index 71f8220..d8ae90c 100644 --- a/src/de/steamwar/bungeecore/listeners/mods/ModLoaderBlocker.java +++ b/src/de/steamwar/bungeecore/listeners/mods/ModLoaderBlocker.java @@ -44,13 +44,14 @@ public class ModLoaderBlocker extends BasicListener { if(!e.getTag().equals("minecraft:brand")) return; - if(new String(e.getData()).contains("fabric")){ + String brand = new String(e.getData()); + if(brand.contains("fabric") || brand.contains("quilt")){ ProxiedPlayer p = (ProxiedPlayer) sender; if (!Storage.fabricCheckedPlayers.containsKey(p) && !Storage.fabricPlayers.contains(p)) { Storage.fabricPlayers.add(p); Message.send("MODLOADER_INSTALLED_FABRIC", p, "Fabric"); } - }else if(new String(e.getData()).contains("LiteLoader")) { + }else if(brand.contains("LiteLoader")) { ProxiedPlayer p = (ProxiedPlayer) sender; if (!Storage.fabricPlayers.contains(p)) { Storage.fabricPlayers.add(p); From 8a20d41f950d88d723d6c7f9e833982ecd938458 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Mon, 20 Feb 2023 17:05:44 +0100 Subject: [PATCH 10/10] Hotfix LoginResult Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/tablist/TablistPart.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/de/steamwar/bungeecore/tablist/TablistPart.java b/src/de/steamwar/bungeecore/tablist/TablistPart.java index e784d78..30c848f 100644 --- a/src/de/steamwar/bungeecore/tablist/TablistPart.java +++ b/src/de/steamwar/bungeecore/tablist/TablistPart.java @@ -26,6 +26,7 @@ import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.chat.ComponentSerializer; import net.md_5.bungee.connection.InitialHandler; +import net.md_5.bungee.connection.LoginResult; import net.md_5.bungee.protocol.Property; import java.util.List; @@ -38,11 +39,11 @@ interface TablistPart { class Item { public static Property[] playerProperties(ProxiedPlayer player) { - InitialHandler handler = (InitialHandler) player.getPendingConnection(); - if(handler == null) + LoginResult loginResult = ((InitialHandler) player.getPendingConnection()).getLoginProfile(); + if(loginResult == null) return new Property[0]; - return handler.getLoginProfile().getProperties(); + return loginResult.getProperties(); } private final UUID uuid;