From c2a9abb61e904967053ad7b3039ccb274f075c53 Mon Sep 17 00:00:00 2001 From: Timongcraft Date: Sat, 6 May 2023 22:06:13 +0200 Subject: [PATCH 1/6] Fixed some small errors Changed some messages slightly Made players with the tgc-system.team permission able to use colorcodes in chat Changed left forEach to for loops for a minimal better performance --- .gitignore | 113 ++++++++++++++++++ pom.xml | 2 +- src/main/java/timongcraft/Main.java | 9 +- .../commands/MaintenanceCommand.java | 10 +- .../commands/PermissionManagerCommand.java | 3 +- .../timongcraft/commands/PluginCommand.java | 6 +- .../commands/ReloadConfigsCommand.java | 2 +- .../commands/ResourcePackCommand.java | 1 + .../listeners/BlockCommandsListeners.java | 5 +- .../listeners/ConnectionListeners.java | 34 +++--- .../timongcraft/listeners/OtherListeners.java | 7 +- .../listeners/SpawnElytraListeners.java | 27 ++--- src/main/resources/config.yml | 2 +- 13 files changed, 167 insertions(+), 54 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..351b428 --- /dev/null +++ b/.gitignore @@ -0,0 +1,113 @@ +# User-specific stuff +#.idea/ + +#*.iml +*.ipr +*.iws + +# IntelliJ +out/ + +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Package Files # +#*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +target/ + +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next + +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +.mvn/wrapper/maven-wrapper.jar +.flattened-pom.xml + +# Common working directory +run/ \ No newline at end of file diff --git a/pom.xml b/pom.xml index e6db25b..a8bfd30 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ timongcraft Tgc-System - 1.4 + 1.41 jar Tgc-System diff --git a/src/main/java/timongcraft/Main.java b/src/main/java/timongcraft/Main.java index 28a99ee..19a62bc 100644 --- a/src/main/java/timongcraft/Main.java +++ b/src/main/java/timongcraft/Main.java @@ -3,7 +3,6 @@ import dev.jorel.commandapi.CommandAPI; import dev.jorel.commandapi.CommandAPIBukkitConfig; import org.bukkit.Bukkit; -import org.bukkit.ChatColor; import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.java.JavaPlugin; import timongcraft.commands.*; @@ -39,9 +38,9 @@ public void onEnable() { double configVersion = getConfig().getDouble("version"); double version = Double.parseDouble(getDescription().getVersion()); if(configVersion != version) { - getLogger().info(ChatColor.RED + "The version of the config.yml does not match with the current plugin version!"); - getLogger().info(ChatColor.RED + "Unless you delete the config and restart the server the plugin will be stopped!"); - getLogger().info(ChatColor.RED + "Do not edit the version in the config.yml or things will break!"); + getLogger().info("§cThe version of the config.yml does not match with the current plugin version!"); + getLogger().info("§cUnless you delete the config and restart the server the plugin will be stopped!"); + getLogger().info("§cDo not edit the version in the config.yml or things will break!"); Bukkit.getPluginManager().disablePlugin(this); return; } @@ -54,7 +53,7 @@ public void onEnable() { registerEvents(); - if(getConfig().getBoolean("Maintenance.icon")) { + if(getConfig().getBoolean("maintenance.icon")) { File maintenanceicon = new File(getDataFolder(), "maintenance-icon.png"); if(!maintenanceicon.exists()) { saveResource("maintenance-icon.png", false); }} diff --git a/src/main/java/timongcraft/commands/MaintenanceCommand.java b/src/main/java/timongcraft/commands/MaintenanceCommand.java index 1a95554..f6a3962 100644 --- a/src/main/java/timongcraft/commands/MaintenanceCommand.java +++ b/src/main/java/timongcraft/commands/MaintenanceCommand.java @@ -27,7 +27,7 @@ public static void register() { .toArray(String[]::new))) .executes(new MaintenanceAddExecutor()))) .then(new LiteralArgument("remove") - .then(new StringArgument("target") + .then(new EntitySelectorArgument.OnePlayer("target") .replaceSuggestions(ArgumentSuggestions.strings(info -> MaintenanceList())) .executes(new MaintenanceRemoveExecutor()))) .then(new LiteralArgument("list") @@ -95,14 +95,14 @@ private static class MaintenanceAddExecutor implements CommandExecutor { public void run(CommandSender sender, CommandArguments args) throws WrapperCommandSyntaxException { Player target = (Player) args.get("target"); if(isAllowed(target)) { - sender.sendMessage(Main.get().getPrefix() + target + " is already on the maintenance list."); + sender.sendMessage(Main.get().getPrefix() + target.getName() + " is already on the maintenance list"); return; } Main.get().getDataConfig().set("players." + target.getUniqueId() + ".maintenanceAllowed", true); Main.get().getDataConfig().save(); - sender.sendMessage(Main.get().getPrefix() + target + " has been added to the maintenance list."); + sender.sendMessage(Main.get().getPrefix() + target.getName() + " has been added to the maintenance list"); } } @@ -111,14 +111,14 @@ private static class MaintenanceRemoveExecutor implements CommandExecutor { public void run(CommandSender sender, CommandArguments args) throws WrapperCommandSyntaxException { Player target = (Player) args.get("target"); if(!isAllowed(target)) { - sender.sendMessage(Main.get().getPrefix() + target + " isn't on the maintenance list."); + sender.sendMessage(Main.get().getPrefix() + target.getName() + " isn't on the maintenance list"); return; } Main.get().getDataConfig().set("players." + target.getUniqueId() + ".maintenanceAllowed", false); Main.get().getDataConfig().save(); - sender.sendMessage(Main.get().getPrefix() + target + " has been removed from the maintenance list."); + sender.sendMessage(Main.get().getPrefix() + target.getName() + " has been removed from the maintenance list"); } } diff --git a/src/main/java/timongcraft/commands/PermissionManagerCommand.java b/src/main/java/timongcraft/commands/PermissionManagerCommand.java index 3afdbf2..79289bd 100644 --- a/src/main/java/timongcraft/commands/PermissionManagerCommand.java +++ b/src/main/java/timongcraft/commands/PermissionManagerCommand.java @@ -6,7 +6,6 @@ import dev.jorel.commandapi.executors.CommandArguments; import dev.jorel.commandapi.executors.CommandExecutor; import org.bukkit.Bukkit; -import org.bukkit.ChatColor; import org.bukkit.OfflinePlayer; import org.bukkit.command.CommandSender; import org.bukkit.configuration.ConfigurationSection; @@ -139,7 +138,7 @@ public void run(CommandSender sender, CommandArguments args) throws WrapperComma String group = (String) args.get("group"); if(targetPlayer == null) { - sender.sendMessage(Main.get().getPrefix() + ChatColor.RED + "Player not found"); + sender.sendMessage(Main.get().getPrefix() + "§cPlayer not found"); return; } diff --git a/src/main/java/timongcraft/commands/PluginCommand.java b/src/main/java/timongcraft/commands/PluginCommand.java index 85b8b90..c2503ac 100644 --- a/src/main/java/timongcraft/commands/PluginCommand.java +++ b/src/main/java/timongcraft/commands/PluginCommand.java @@ -64,12 +64,12 @@ public void run(CommandSender sender, CommandArguments args) throws WrapperComma Plugin targetPlugin = Main.get().getServer().getPluginManager().getPlugin(pluginName); if(targetPlugin == null) { - sender.sendMessage(Main.get().getPrefix() + "§cPlugin " + pluginName + " not found."); + sender.sendMessage(Main.get().getPrefix() + "§c" + pluginName + " not found."); return; } if(!Main.get().getDataConfig().isSet("disabledPlugins")) { - sender.sendMessage(Main.get().getPrefix() + "§cPlugin " + pluginName + " can't be enabled."); + sender.sendMessage(Main.get().getPrefix() + "§c" + pluginName + " can't be enabled."); return; } @@ -93,7 +93,7 @@ public void run(CommandSender sender, CommandArguments args) throws WrapperComma Plugin targetPlugin = Main.get().getServer().getPluginManager().getPlugin(pluginName); if(targetPlugin == null) { - sender.sendMessage(Main.get().getPrefix() + "§cPlugin " + pluginName + " not found."); + sender.sendMessage(Main.get().getPrefix() + "§c" + pluginName + " not found."); return; } if(targetPlugin.getName().equalsIgnoreCase(Main.get().getName())) { diff --git a/src/main/java/timongcraft/commands/ReloadConfigsCommand.java b/src/main/java/timongcraft/commands/ReloadConfigsCommand.java index 47f6edb..2ae1cac 100644 --- a/src/main/java/timongcraft/commands/ReloadConfigsCommand.java +++ b/src/main/java/timongcraft/commands/ReloadConfigsCommand.java @@ -23,7 +23,7 @@ public void run(CommandSender sender, CommandArguments args) throws WrapperComma Main.get().reloadConfig(); Main.get().getDataConfig().load(); sender.sendMessage(Main.get().getPrefix() + "The Configs have been reloaded!"); - TeamUtils.sendToTeam(sender.getName(), null, false, "Reloaded the Tgc-System's configs"); + TeamUtils.sendToTeam(sender.getName(), null, false, "Reloaded the plugins's configs"); } } } \ No newline at end of file diff --git a/src/main/java/timongcraft/commands/ResourcePackCommand.java b/src/main/java/timongcraft/commands/ResourcePackCommand.java index 9b6a093..b52c338 100644 --- a/src/main/java/timongcraft/commands/ResourcePackCommand.java +++ b/src/main/java/timongcraft/commands/ResourcePackCommand.java @@ -10,6 +10,7 @@ public class ResourcePackCommand { public static void register() { new CommandTree("resourcepack") + .withFullDescription("With this you can toggle the resource pack on/off") .withRequirement(sender -> (Main.get().getConfig().isSet("resourcePack.url") && !Main.get().getConfig().getString("resourcePack.url").isEmpty()) && (Main.get().getConfig().isSet("resourcePack.hash") && !Main.get().getConfig().getString("resourcePack.hash").isEmpty())) .withPermission("tgc-system.team") .executesPlayer(new ResourcePackExecutor()) diff --git a/src/main/java/timongcraft/listeners/BlockCommandsListeners.java b/src/main/java/timongcraft/listeners/BlockCommandsListeners.java index 2258ac4..282c6b1 100644 --- a/src/main/java/timongcraft/listeners/BlockCommandsListeners.java +++ b/src/main/java/timongcraft/listeners/BlockCommandsListeners.java @@ -1,6 +1,5 @@ package timongcraft.listeners; -import org.bukkit.ChatColor; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; @@ -20,7 +19,7 @@ public void blockPrefixes(PlayerCommandPreprocessEvent event) { for (String blockedPrefixes : Main.get().getConfig().getStringList("blockedPrefixes")) { if(event.getMessage().toLowerCase().startsWith("/" + blockedPrefixes)) { event.setCancelled(true); - player.sendMessage(Main.get().getPrefix() + ChatColor.RED + "The '" + blockedPrefixes + "' prefix is blocked!"); + player.sendMessage(Main.get().getPrefix() + "§cThe '" + blockedPrefixes + "' prefix is blocked!"); break; } } @@ -48,7 +47,7 @@ public void blockCommands(PlayerCommandPreprocessEvent event) { if(player.hasPermission("tgc-system.team") || Main.get().getConfig().getStringList("blockedCommands").isEmpty()) return; String command = event.getMessage().substring(1).toLowerCase().split("\\s+")[0]; if(!Main.get().getConfig().getStringList("blockedCommands").contains(command)) return; - player.sendMessage(Main.get().getPrefix() + ChatColor.RED + "The '" + command + "' command is blocked!"); + player.sendMessage(Main.get().getPrefix() + "§cThe '" + command + "' command is blocked!"); event.setCancelled(true); } diff --git a/src/main/java/timongcraft/listeners/ConnectionListeners.java b/src/main/java/timongcraft/listeners/ConnectionListeners.java index e2206b1..66b3349 100644 --- a/src/main/java/timongcraft/listeners/ConnectionListeners.java +++ b/src/main/java/timongcraft/listeners/ConnectionListeners.java @@ -1,7 +1,6 @@ package timongcraft.listeners; import org.bukkit.Bukkit; -import org.bukkit.ChatColor; import org.bukkit.GameMode; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -66,13 +65,13 @@ public void onQuit(PlayerQuitEvent event) { private void motdsHandler(ServerListPingEvent event) { if(Main.get().getConfig().getBoolean("motds.enabled") && !Main.get().getConfig().getStringList("motds.list").isEmpty()) { String motd = Main.get().getConfig().getStringList("motds.list").get(new Random().nextInt(Main.get().getConfig().getStringList("motds.list").size())); - event.setMotd(ChatColor.translateAlternateColorCodes('&', motd)); + event.setMotd(motd.replaceAll("&", "§")); } } private void maintenanceServerPingHandler(ServerListPingEvent event) { if(Main.get().getDataConfig().getBoolean("maintenance.enabled")) { - event.setMotd(Main.get().getConfig().getString("Maintenance.motd")); + event.setMotd(Main.get().getConfig().getString("maintenance.motd")); event.setMaxPlayers(0); if(Main.get().getConfig().getBoolean("maintenance.icon")) { File maintenanceIcon = new File(Main.get().getDataFolder(), "maintenance-icon.png"); @@ -140,17 +139,19 @@ private void resourcePackJoinHandler(Player player) { private void teamJoinHandler(PlayerJoinEvent event, Player player) { if(player.hasPermission("tgc-system.team")) { - Bukkit.getOnlinePlayers().forEach(players -> { - if(players.hasPermission("tgc-system.team") && players.getGameMode().equals(GameMode.SPECTATOR)) player.hidePlayer(Main.get(), players); - }); + for(Player onlinePlayer : Bukkit.getOnlinePlayers()) { + if(onlinePlayer.hasPermission("tgc-system.team") && onlinePlayer.getGameMode().equals(GameMode.SPECTATOR)) player.hidePlayer(Main.get(), onlinePlayer); + + } if(player.getGameMode().equals(GameMode.SPECTATOR) && Bukkit.getOnlinePlayers().size() > 1) { event.setJoinMessage(null); - Bukkit.getOnlinePlayers().forEach(players -> { - if(players.hasPermission("tgc-system.team")) { - players.sendMessage(Main.get().getConfig().getString("joinQuitMessage.joinMessage").replaceAll("%Player%",player.getName().replaceAll("&", "§"))); + + for(Player onlinePlayer : Bukkit.getOnlinePlayers()) { + if(onlinePlayer.hasPermission("tgc-system.team")) { + onlinePlayer.sendMessage(Main.get().getConfig().getString("joinQuitMessage.joinMessage").replaceAll("%Player%",player.getName().replaceAll("&", "§"))); } - }); + } } } } @@ -158,11 +159,12 @@ private void teamJoinHandler(PlayerJoinEvent event, Player player) { private void teamQuitHandler(PlayerQuitEvent event, Player player) { if(player.hasPermission("tgc-system.team") && player.getGameMode().equals(GameMode.SPECTATOR) && Bukkit.getOnlinePlayers().size() > 1) { event.setQuitMessage(null); - Bukkit.getOnlinePlayers().forEach(players -> { - if(players.hasPermission("tgc-system.team")) { - players.sendMessage(Main.get().getConfig().getString("joinQuitMessage.quitMessage").replaceAll("%Player%",player.getName().replaceAll("&", "§"))); + + for(Player onlinePlayer : Bukkit.getOnlinePlayers()) { + if(onlinePlayer.hasPermission("tgc-system.team")) { + onlinePlayer.sendMessage(Main.get().getConfig().getString("joinQuitMessage.quitMessage").replaceAll("%Player%",player.getName().replaceAll("&", "§"))); } - }); + } } } @@ -173,14 +175,14 @@ private void playerJoinMessageJoinHandler(Player player, PlayerJoinEvent event) if(Main.get().getConfig().getBoolean("onJoin.enabled")){ if(Main.get().getConfig().getString("onJoin.message") != null) { - player.sendMessage(ChatColor.translateAlternateColorCodes('&', Main.get().getConfig().getString("onJoin.message")).replaceAll("%AlertPrefix%", Main.get().getConfig().getString("prefix.alertPrefix"))); + player.sendMessage(Main.get().getConfig().getString("onJoin.message").replaceAll("%AlertPrefix%", Main.get().getConfig().getString("prefix.alertPrefix").replaceAll("&", "§"))); } } String status = StatusHandler.getStatus(player); if(Main.get().getConfig().getBoolean("onJoin.status")){ if(status != null) { - player.sendMessage(ChatColor.translateAlternateColorCodes('&', Main.get().getPrefix() + "&aYour status is set to: " + status)); + player.sendMessage(Main.get().getPrefix() + "§aYour status is set to: " + status.replaceAll("&", "§")); } } } diff --git a/src/main/java/timongcraft/listeners/OtherListeners.java b/src/main/java/timongcraft/listeners/OtherListeners.java index 90d6f37..10866c8 100644 --- a/src/main/java/timongcraft/listeners/OtherListeners.java +++ b/src/main/java/timongcraft/listeners/OtherListeners.java @@ -35,6 +35,7 @@ public void onPlayerChat(AsyncPlayerChatEvent event) { } else { if(player.hasPermission("tgc-system.team")) { playerChatName = "§4<§c" + player.getName() + "§4>§f"; + message = message.replaceAll("&", "§"); } else playerChatName = "§8<§7" + player.getName() + "§8>§7"; } @@ -43,7 +44,7 @@ public void onPlayerChat(AsyncPlayerChatEvent event) { for (String messagePart : message.split("\\s+")) { Matcher matcher = urlPattern.matcher(messagePart); if (matcher.matches()) { - player.sendMessage(Main.get().getPrefix() + ChatColor.RED + "You don't have the permission to send links!"); + player.sendMessage(Main.get().getPrefix() + "§cYou don't have the permission to send links!"); event.setCancelled(true); return; } @@ -51,7 +52,7 @@ public void onPlayerChat(AsyncPlayerChatEvent event) { } final String[] highlightedMessage = {message}; - Bukkit.getOnlinePlayers().forEach(onlinePlayer -> { + for(Player onlinePlayer : Bukkit.getOnlinePlayers()) { if(highlightedMessage[0].contains(onlinePlayer.getName())) { ChatColor highlightColor = (onlinePlayer.hasPermission("tgc-system.team") && (player.hasPermission("tgc-system.team"))) ? ChatColor.YELLOW : ChatColor.GRAY; highlightedMessage[0] = highlightedMessage[0].replaceAll(onlinePlayer.getName(), highlightColor + onlinePlayer.getName() + ChatColor.RESET); @@ -63,7 +64,7 @@ public void onPlayerChat(AsyncPlayerChatEvent event) { onlinePlayer.sendMessage(null, (Main.get().getConfig().getBoolean("chatSystem.timeStampInChat.enabled") ? "§7[" + DateTimeFormatter.ofPattern(Main.get().getConfig().getString("chatSystem.timeStampInChat.format")).format(ZonedDateTime.now(ZoneId.of(Main.get().getConfig().getString("chatSystem.timeStampInChat.timeZone")))) + "] §f" : "") + playerChatName + " " + highlightedMessage[0]); Bukkit.getLogger().info("Chat: " + playerChatName + " " + highlightedMessage[0]); - }); + } event.setCancelled(true); } diff --git a/src/main/java/timongcraft/listeners/SpawnElytraListeners.java b/src/main/java/timongcraft/listeners/SpawnElytraListeners.java index db05585..7b03751 100644 --- a/src/main/java/timongcraft/listeners/SpawnElytraListeners.java +++ b/src/main/java/timongcraft/listeners/SpawnElytraListeners.java @@ -25,20 +25,19 @@ public class SpawnElytraListeners implements Listener { public SpawnElytraListeners() { Bukkit.getScheduler().runTaskTimer(Main.get(), () -> { - Bukkit.getWorld(String.valueOf(Main.get().getConfig().getString("spawnElytra.worldName"))).getPlayers().forEach(player -> { - if(player.getGameMode() == GameMode.SPECTATOR) return; - if(player.getGameMode() == GameMode.CREATIVE) return; - player.setAllowFlight(isInSpawnRadius(player)); - if(flying.contains(player) && !player.getLocation().getBlock().getRelative(BlockFace.DOWN).getType().isAir()) { - player.setAllowFlight(false); - player.setFlying(false); - player.setGliding(false); - boosted.remove(player); + for(Player playerInWorld : Bukkit.getWorld(String.valueOf(Main.get().getConfig().getString("spawnElytra.worldName"))).getPlayers()) { + if(playerInWorld.getGameMode() == GameMode.SPECTATOR || playerInWorld.getGameMode() == GameMode.CREATIVE) return; + playerInWorld.setAllowFlight(isInSpawnRadius(playerInWorld)); + if(flying.contains(playerInWorld) && !playerInWorld.getLocation().getBlock().getRelative(BlockFace.DOWN).getType().isAir()) { + playerInWorld.setAllowFlight(false); + playerInWorld.setFlying(false); + playerInWorld.setGliding(false); + boosted.remove(playerInWorld); Bukkit.getScheduler().runTaskLater(Main.get(), () -> { - flying.remove(player); + flying.remove(playerInWorld); },5); } - }); + } }, 0, 3); } @@ -73,9 +72,9 @@ public void onSwapItem(PlayerSwapHandItemsEvent event) { event.setCancelled(true); boosted.add(player); - Bukkit.getWorld(String.valueOf(Main.get().getConfig().getString("spawnElytra.worldName"))).getPlayers().forEach(playersInWorld -> { - if(flying.contains(playersInWorld) && playersInWorld.getLocation().getBlock().getRelative(BlockFace.DOWN).getType().isAir()) player.setVelocity(player.getLocation().getDirection().multiply(Main.get().getConfig().getInt("spawnElytra.boost.enabled.multiplyValue"))); - }); + for(Player playerInWorld : Bukkit.getWorld(String.valueOf(Main.get().getConfig().getString("spawnElytra.worldName"))).getPlayers()) { + if(flying.contains(playerInWorld) && playerInWorld.getLocation().getBlock().getRelative(BlockFace.DOWN).getType().isAir()) player.setVelocity(player.getLocation().getDirection().multiply(Main.get().getConfig().getInt("spawnElytra.boost.enabled.multiplyValue"))); + } } @EventHandler diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index aac9978..3d6b542 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -64,7 +64,7 @@ motds: list: [] maintenance: - motd: "§4Server is in Maintenance" + motd: "§cServer is in Maintenance" kickMessage: "This server is now in maintenance mode" #You can add a 64x64 png file to the Plugin directory and that will be set as you maintenance icon icon: false From 1b64c58a51ad89c9893294171071f36c8db0cc33 Mon Sep 17 00:00:00 2001 From: Timongcraft Date: Mon, 8 May 2023 12:58:01 +0200 Subject: [PATCH 2/6] Fixed some small errors Fixed MaintenanceCommand Fixed AutoSave and made it use BukkitRunnable Changed some messages slightly Made players with the tgc-system.team permission able to use colorcodes in chat Changed left forEach to for loops for a minimal better performance Removed default maintenance-icon Differentiated plugin version and config version Simplified sendToTeam methode Added modrinth link while it is not even on there (at the moment) --- .idea/inspectionProfiles/Project_Default.xml | 10 +++ .idea/vcs.xml | 6 ++ .idea/workspace.xml | 66 ++++++++++++++----- src/main/java/timongcraft/Main.java | 23 +++---- .../timongcraft/commands/AlertCommand.java | 4 +- .../commands/ColorCodesCommand.java | 27 ++++---- .../timongcraft/commands/FlySpeedCommand.java | 29 +++++--- .../commands/MaintenanceCommand.java | 26 +++++--- .../java/timongcraft/commands/MsgCommand.java | 24 +++---- .../commands/PermissionManagerCommand.java | 12 ++-- .../timongcraft/commands/RebootCommand.java | 8 ++- .../commands/ReloadConfigsCommand.java | 2 +- .../timongcraft/commands/ReplyCommand.java | 8 +-- .../timongcraft/commands/StatusCommand.java | 13 ++-- .../listeners/ConnectionListeners.java | 2 +- .../timongcraft/listeners/OtherListeners.java | 2 +- src/main/java/timongcraft/util/AutoSave.java | 26 -------- .../timongcraft/util/AutoSaveHandler.java | 24 +++++++ src/main/java/timongcraft/util/TeamUtils.java | 6 +- src/main/resources/config.yml | 6 +- src/main/resources/plugin.yml | 1 + 21 files changed, 200 insertions(+), 125 deletions(-) create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/vcs.xml delete mode 100644 src/main/java/timongcraft/util/AutoSave.java create mode 100644 src/main/java/timongcraft/util/AutoSaveHandler.java diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..6f67cf7 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2973566..baf6fd2 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,8 +4,20 @@