From bca534473e4fb585ad3bff43ad30646f6877ce7a Mon Sep 17 00:00:00 2001 From: Lixfel Date: Tue, 25 Aug 2020 19:18:21 +0200 Subject: [PATCH] Fix indentation and line endings Signed-off-by: Lixfel --- .../bungeecore/commands/IgnoreCommand.java | 36 +++++++------- .../bungeecore/commands/UnIgnoreCommand.java | 48 +++++++++---------- .../steamwar/bungeecore/sql/IgnoreSystem.java | 38 +++++++-------- 3 files changed, 61 insertions(+), 61 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/IgnoreCommand.java b/src/de/steamwar/bungeecore/commands/IgnoreCommand.java index 7f7d541..ae9e089 100644 --- a/src/de/steamwar/bungeecore/commands/IgnoreCommand.java +++ b/src/de/steamwar/bungeecore/commands/IgnoreCommand.java @@ -8,23 +8,23 @@ import net.md_5.bungee.api.connection.ProxiedPlayer; public class IgnoreCommand extends BasicCommand { - public IgnoreCommand() { - super("ignore", null); - } + public IgnoreCommand() { + super("ignore", null); + } - @Override - public void execute(CommandSender sender, String[] args) { - if(args.length < 1) { - BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§8/§eignore §8[§7Spieler§8]"); - return; - } + @Override + public void execute(CommandSender sender, String[] args) { + if(args.length < 1) { + BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§8/§eignore §8[§7Spieler§8]"); + return; + } - if (!(sender instanceof ProxiedPlayer)) - return; - ProxiedPlayer p = (ProxiedPlayer) sender; - SteamwarUser user = SteamwarUser.get(p.getUniqueId()); + if (!(sender instanceof ProxiedPlayer)) + return; + ProxiedPlayer p = (ProxiedPlayer) sender; + SteamwarUser user = SteamwarUser.get(p.getUniqueId()); - SteamwarUser target = SteamwarUser.get(args[0]); + SteamwarUser target = SteamwarUser.get(args[0]); if(target == null){ BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDiesen Spieler gibt es nicht."); return; @@ -32,11 +32,11 @@ public class IgnoreCommand extends BasicCommand { BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cWie willst du dich selber ignorieren?"); return; }else if(IgnoreSystem.isIgnored(user, target)){ - BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDu ignorierst diesen Spieler bereits."); - return; - } + BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDu ignorierst diesen Spieler bereits."); + return; + } IgnoreSystem.ignore(user, target); BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§7Du ignorierst nun §e" + target.getUserName() + "§8."); - } + } } diff --git a/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java b/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java index 94ffa76..e5d7401 100644 --- a/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java +++ b/src/de/steamwar/bungeecore/commands/UnIgnoreCommand.java @@ -8,33 +8,33 @@ import net.md_5.bungee.api.connection.ProxiedPlayer; public class UnIgnoreCommand extends BasicCommand { - public UnIgnoreCommand() { - super("unignore", null); - } + public UnIgnoreCommand() { + super("unignore", null); + } - @Override - public void execute(CommandSender sender, String[] args) { - if(args.length < 1) { - BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§8/§eunignore §8[§7Spieler§8]"); - return; - } + @Override + public void execute(CommandSender sender, String[] args) { + if(args.length < 1) { + BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§8/§eunignore §8[§7Spieler§8]"); + return; + } - if (!(sender instanceof ProxiedPlayer)) - return; - ProxiedPlayer p = (ProxiedPlayer) sender; - SteamwarUser user = SteamwarUser.get(p.getUniqueId()); + if (!(sender instanceof ProxiedPlayer)) + return; + ProxiedPlayer p = (ProxiedPlayer) sender; + SteamwarUser user = SteamwarUser.get(p.getUniqueId()); - SteamwarUser target = SteamwarUser.get(args[0]); - if(target == null){ - BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDiesen Spieler gibt es nicht!"); - return; - }else if(!IgnoreSystem.isIgnored(user, target)){ - BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDu ignorierst diesen Spieler nicht."); - return; - } + SteamwarUser target = SteamwarUser.get(args[0]); + if(target == null){ + BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDiesen Spieler gibt es nicht!"); + return; + }else if(!IgnoreSystem.isIgnored(user, target)){ + BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDu ignorierst diesen Spieler nicht."); + return; + } - IgnoreSystem.unIgnore(user, target); - BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§7Du empfängst nun wieder Nachrichten von §e" + target.getUserName() + "§8."); - } + IgnoreSystem.unIgnore(user, target); + BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§7Du empfängst nun wieder Nachrichten von §e" + target.getUserName() + "§8."); + } } \ No newline at end of file diff --git a/src/de/steamwar/bungeecore/sql/IgnoreSystem.java b/src/de/steamwar/bungeecore/sql/IgnoreSystem.java index 85d3682..faf5df7 100644 --- a/src/de/steamwar/bungeecore/sql/IgnoreSystem.java +++ b/src/de/steamwar/bungeecore/sql/IgnoreSystem.java @@ -5,27 +5,27 @@ import net.md_5.bungee.api.connection.ProxiedPlayer; import java.sql.SQLException; public class IgnoreSystem{ - private IgnoreSystem(){} + private IgnoreSystem(){} - public static boolean isIgnored(ProxiedPlayer ignorer, ProxiedPlayer ignored){ - SteamwarUser user = SteamwarUser.get(ignorer.getUniqueId()); - SteamwarUser target = SteamwarUser.get(ignored.getUniqueId()); - return isIgnored(user, target); - } + public static boolean isIgnored(ProxiedPlayer ignorer, ProxiedPlayer ignored){ + SteamwarUser user = SteamwarUser.get(ignorer.getUniqueId()); + SteamwarUser target = SteamwarUser.get(ignored.getUniqueId()); + return isIgnored(user, target); + } - public static boolean isIgnored(SteamwarUser ignorer, SteamwarUser ignored) { - try { - return !SQL.select("SELECT * FROM Ignore WHERE Ignorer = ? AND Ignored = ?", ignorer.getId(), ignored.getId()).next(); - } catch (SQLException e) { - throw new SecurityException("Could not check if ignored", e); - } - } + public static boolean isIgnored(SteamwarUser ignorer, SteamwarUser ignored) { + try { + return !SQL.select("SELECT * FROM Ignore WHERE Ignorer = ? AND Ignored = ?", ignorer.getId(), ignored.getId()).next(); + } catch (SQLException e) { + throw new SecurityException("Could not check if ignored", e); + } + } - public static void ignore(SteamwarUser ignorer, SteamwarUser ignored) { - SQL.update("INSERT INTO Ignore (Ignorer, Ignored) VALUES (?, ?)", ignorer.getId(), ignored.getId()); - } + public static void ignore(SteamwarUser ignorer, SteamwarUser ignored) { + SQL.update("INSERT INTO Ignore (Ignorer, Ignored) VALUES (?, ?)", ignorer.getId(), ignored.getId()); + } - public static void unIgnore(SteamwarUser ignorer, SteamwarUser ignored) { - SQL.update("DELETE FROM Ignore WHERE Ignorer = ? AND Ignored = ?", ignorer.getId(), ignored.getId()); - } + public static void unIgnore(SteamwarUser ignorer, SteamwarUser ignored) { + SQL.update("DELETE FROM Ignore WHERE Ignorer = ? AND Ignored = ?", ignorer.getId(), ignored.getId()); + } } \ No newline at end of file