From 35bee2d9e8fd5911c416f24150a108a0de9e87ef Mon Sep 17 00:00:00 2001 From: business-goose Date: Mon, 21 Mar 2022 21:19:39 +0000 Subject: [PATCH] Kick players on TFM update --- .../TotalFreedomMod/commands/Command_updatetfm.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/me/StevenLawson/TotalFreedomMod/commands/Command_updatetfm.java b/src/main/java/me/StevenLawson/TotalFreedomMod/commands/Command_updatetfm.java index 4ef3d44..65c6be0 100644 --- a/src/main/java/me/StevenLawson/TotalFreedomMod/commands/Command_updatetfm.java +++ b/src/main/java/me/StevenLawson/TotalFreedomMod/commands/Command_updatetfm.java @@ -2,11 +2,13 @@ package me.StevenLawson.TotalFreedomMod.commands; import me.StevenLawson.TotalFreedomMod.config.ConfigurationEntry; import me.StevenLawson.TotalFreedomMod.config.MainConfig; +import me.StevenLawson.TotalFreedomMod.util.SynchronousUtil; import me.StevenLawson.TotalFreedomMod.util.Utilities; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; import java.io.File; @@ -28,6 +30,10 @@ public class Command_updatetfm extends FreedomCommand { process.waitFor(); playerMsg("Updated TFM! Reloading..."); Utilities.adminAction(sender.getName(), "Update successful, reloading TFM...", false); + for (Player onlinePlayer : Bukkit.getOnlinePlayers()) { + SynchronousUtil.playerKick(onlinePlayer, "Reloading TFM, please rejoin."); + } + Bukkit.dispatchCommand(sender, "plugman reload TotalFreedomMod"); } catch (Exception e) { playerMsg("Failed to update TFM! Check the logs for more details.");