From 0c24e245f07484d338466479c96da03d3e1b62fc Mon Sep 17 00:00:00 2001 From: Niilyx _ Date: Fri, 28 Oct 2022 20:49:10 +0200 Subject: [PATCH 1/9] fix issue ECATUP #14 --- src/main/java/fr/efreicraft/ecatup/Main.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/fr/efreicraft/ecatup/Main.java b/src/main/java/fr/efreicraft/ecatup/Main.java index 77ef9a6..adeb44d 100644 --- a/src/main/java/fr/efreicraft/ecatup/Main.java +++ b/src/main/java/fr/efreicraft/ecatup/Main.java @@ -130,6 +130,11 @@ public void onDisable() { .setColor(java.awt.Color.decode("#ffffff")) .setFooter("Efrei Craft", "https://efreicraft.fr/img/favicon.png") ); + + for (Player player : Bukkit.getOnlinePlayers()) { + sendPlayerToServer(player, "lobby"); + } + try { webhook.execute(); } catch (IOException ignored) {} From 73ba9ff124753549b51f2a368f0e450a1d6cbfdb Mon Sep 17 00:00:00 2001 From: Niilyx _ Date: Fri, 28 Oct 2022 21:30:52 +0200 Subject: [PATCH 2/9] Update Main.java --- src/main/java/fr/efreicraft/ecatup/Main.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/fr/efreicraft/ecatup/Main.java b/src/main/java/fr/efreicraft/ecatup/Main.java index adeb44d..0b3dac9 100644 --- a/src/main/java/fr/efreicraft/ecatup/Main.java +++ b/src/main/java/fr/efreicraft/ecatup/Main.java @@ -76,8 +76,8 @@ public void onEnable() { Bukkit.getPluginManager().registerEvents(new LuckPermsListener((Main) INSTANCE, LP), INSTANCE); // Register commands - if (Bukkit.getPluginManager().getPlugin("ECLobby") == null) { - registerCommand("lobby", new Lobby()); // Only register /lobby if ECLobby is not installed + if (!config.getString("server_name").equals("lobby")) { + registerCommand("lobby", new Lobby()); // Only register /lobby if the server's name is "lobby" } registerCommand("chat", new fr.efreicraft.ecatup.commands.Chat()); From bcc449d8234f3ce920934d9bc953d0556a8fe901 Mon Sep 17 00:00:00 2001 From: Niilyx _ Date: Fri, 28 Oct 2022 22:45:33 +0200 Subject: [PATCH 3/9] =?UTF-8?q?pr=20=C3=AAtre=20sync=20avec=20stable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/fr/efreicraft/ecatup/commands/Skull.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/fr/efreicraft/ecatup/commands/Skull.java b/src/main/java/fr/efreicraft/ecatup/commands/Skull.java index e6263f1..6e14bf1 100644 --- a/src/main/java/fr/efreicraft/ecatup/commands/Skull.java +++ b/src/main/java/fr/efreicraft/ecatup/commands/Skull.java @@ -39,6 +39,6 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command @Override public @Nullable List onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) { - return args.length == 1 ? Main.getPlayersForTabList(args, 1) : null; + return args.length == 1 ? Main.getPlayersForTabList(args, 0) : null; } } From 99955d68d8ad5eae34ed09d695c058eab90a7031 Mon Sep 17 00:00:00 2001 From: Niilyx _ Date: Fri, 28 Oct 2022 22:47:40 +0200 Subject: [PATCH 4/9] plus simple --- src/main/java/fr/efreicraft/ecatup/Main.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/fr/efreicraft/ecatup/Main.java b/src/main/java/fr/efreicraft/ecatup/Main.java index 0b3dac9..5826be0 100644 --- a/src/main/java/fr/efreicraft/ecatup/Main.java +++ b/src/main/java/fr/efreicraft/ecatup/Main.java @@ -20,6 +20,7 @@ import org.bukkit.plugin.java.JavaPlugin; import javax.annotation.Nullable; +import java.awt.*; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.IOException; @@ -99,7 +100,7 @@ public void onEnable() { webhook.addEmbed(new DiscordWebhook.EmbedObject() .setTitle("Serveur") .setDescription("Le serveur a démarré !") - .setColor(java.awt.Color.decode("#ffffff")) + .setColor(Color.white) .setFooter("Efrei Craft", "https://efreicraft.fr/img/favicon.png") ); try { From 7ba6ac5d42073ed80cb0ed78f593e1e31a1e5c9c Mon Sep 17 00:00:00 2001 From: Niilyx _ Date: Sat, 29 Oct 2022 00:28:55 +0200 Subject: [PATCH 5/9] tablist --- src/main/java/fr/efreicraft/ecatup/listeners/Join.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/fr/efreicraft/ecatup/listeners/Join.java b/src/main/java/fr/efreicraft/ecatup/listeners/Join.java index 934c013..b3d5c29 100644 --- a/src/main/java/fr/efreicraft/ecatup/listeners/Join.java +++ b/src/main/java/fr/efreicraft/ecatup/listeners/Join.java @@ -1,5 +1,6 @@ package fr.efreicraft.ecatup.listeners; +import com.destroystokyo.paper.event.server.PaperServerListPingEvent; import fr.efreicraft.ecatup.Main; import fr.efreicraft.ecatup.PreferenceCache; import fr.efreicraft.ecatup.utils.DiscordWebhook; @@ -128,4 +129,9 @@ public void onJoin(org.bukkit.event.player.PlayerJoinEvent event) throws IOExcep webhook.execute(); } + + @EventHandler + public void onServerListPing(PaperServerListPingEvent e) { + e.setServerIcon(Bukkit.getServerIcon()); + } } From 2a26ecda62a70861bcb5722a5f5c4bbd9ac7f92e Mon Sep 17 00:00:00 2001 From: Niilyx _ Date: Sat, 29 Oct 2022 01:27:28 +0200 Subject: [PATCH 6/9] fuck luckperms --- .../fr/efreicraft/ecatup/listeners/LuckPermsListener.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/fr/efreicraft/ecatup/listeners/LuckPermsListener.java b/src/main/java/fr/efreicraft/ecatup/listeners/LuckPermsListener.java index ab2034e..505d756 100644 --- a/src/main/java/fr/efreicraft/ecatup/listeners/LuckPermsListener.java +++ b/src/main/java/fr/efreicraft/ecatup/listeners/LuckPermsListener.java @@ -5,6 +5,7 @@ import net.luckperms.api.LuckPerms; import net.luckperms.api.event.EventBus; import net.luckperms.api.event.user.UserDataRecalculateEvent; +import net.luckperms.api.model.user.User; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.event.Listener; @@ -25,6 +26,9 @@ private void onUserDataRecalculate(UserDataRecalculateEvent event) { if (player != null) { player.displayName(Component.text(colorize(event.getUser().getCachedData().getMetaData().getPrefix()) + player.getName())); player.playerListName(player.displayName()); + User user = Main.LP.getUserManager().getUser(event.getUser().getUsername()); + if (user != null) + user.getCachedData().invalidate(); } } } From 2169ef1c22ab30fecb0fe650c9caa5b1130bc0ef Mon Sep 17 00:00:00 2001 From: Niilyx _ Date: Sat, 29 Oct 2022 01:27:41 +0200 Subject: [PATCH 7/9] =?UTF-8?q?nouveaux=20r=C3=B4les?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/fr/efreicraft/ecatup/listeners/Join.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/fr/efreicraft/ecatup/listeners/Join.java b/src/main/java/fr/efreicraft/ecatup/listeners/Join.java index b3d5c29..0634e86 100644 --- a/src/main/java/fr/efreicraft/ecatup/listeners/Join.java +++ b/src/main/java/fr/efreicraft/ecatup/listeners/Join.java @@ -53,6 +53,10 @@ public void onJoin(org.bukkit.event.player.PlayerJoinEvent event) throws IOExcep case "Beta Tester" -> LP.getUserManager().getUser(event.getPlayer().getUniqueId()).data().add(Node.builder("group.beta").build()); + case "Builder" -> LP.getUserManager().getUser(event.getPlayer().getUniqueId()).data().add(Node.builder("group.builder").build()); + + case "Responsable 1P" -> LP.getUserManager().getUser(event.getPlayer().getUniqueId()).data().add(Node.builder("group.respo1p").build()); + case "Responsable Event", "Responsable Dev", "Responsable Infra", "Responsable Comm", "Responsable Build", "Responsable Design" -> { LP.getUserManager().getUser(event.getPlayer().getUniqueId()).data().add(Node.builder("group.be").build()); LP.getUserManager().getUser(event.getPlayer().getUniqueId()).data().add(Node.builder("prefix.10.&c&l[" + rank + "] &c").build()); From 6bfc0b09a61d054073afad7ff9cada040c1d1645 Mon Sep 17 00:00:00 2001 From: Niilyx _ Date: Sat, 29 Oct 2022 01:40:25 +0200 Subject: [PATCH 8/9] bump -> 1.0.7 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 8d8d798..c635ead 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ plugins { } group = 'fr.efreicraft' -version = '1.0.6' +version = '1.0.7' compileJava.options.encoding "UTF-8" From 667bd124ae0c352838eae0002f7cfa4d5565d760 Mon Sep 17 00:00:00 2001 From: Niilyx _ Date: Sat, 29 Oct 2022 01:46:01 +0200 Subject: [PATCH 9/9] =?UTF-8?q?ca=20d=C3=A9gage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/fr/efreicraft/ecatup/listeners/Join.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main/java/fr/efreicraft/ecatup/listeners/Join.java b/src/main/java/fr/efreicraft/ecatup/listeners/Join.java index 0634e86..9cc9105 100644 --- a/src/main/java/fr/efreicraft/ecatup/listeners/Join.java +++ b/src/main/java/fr/efreicraft/ecatup/listeners/Join.java @@ -134,8 +134,4 @@ public void onJoin(org.bukkit.event.player.PlayerJoinEvent event) throws IOExcep } - @EventHandler - public void onServerListPing(PaperServerListPingEvent e) { - e.setServerIcon(Bukkit.getServerIcon()); - } }