From 9f9eca6faecca060004dbc5327ef9ea014b26232 Mon Sep 17 00:00:00 2001 From: Shevchik Date: Thu, 6 Mar 2014 21:50:59 +0400 Subject: [PATCH] Format source --- .../chairs/commands/ChairsIgnoreList.java | 5 +---- src/com/cnaude/chairs/core/Chairs.java | 2 +- .../chairs/sitaddons/CommandRestrict.java | 18 ++++++------------ .../cnaude/chairs/vehiclearrow/NMSAccess.java | 16 ++++++++-------- 4 files changed, 16 insertions(+), 25 deletions(-) diff --git a/src/com/cnaude/chairs/commands/ChairsIgnoreList.java b/src/com/cnaude/chairs/commands/ChairsIgnoreList.java index a0c2123..89f3b81 100644 --- a/src/com/cnaude/chairs/commands/ChairsIgnoreList.java +++ b/src/com/cnaude/chairs/commands/ChairsIgnoreList.java @@ -24,8 +24,7 @@ public class ChairsIgnoreList implements Serializable{ private static final String IGNORE_FILE = "plugins/Chairs/ignores.ser"; private Chairs plugin; - public ChairsIgnoreList(Chairs plugin) - { + public ChairsIgnoreList(Chairs plugin) { this.plugin = plugin; } @@ -66,12 +65,10 @@ public class ChairsIgnoreList implements Serializable{ if (ignoreList.contains(s)) { return; } - //Chairs.get().logInfo("Adding " + s + " to ignore list."); ignoreList.add(s); } public void removePlayer(String s) { - //Chairs.get().logInfo("Removing " + s + " from ignore list."); ignoreList.remove(s); } diff --git a/src/com/cnaude/chairs/core/Chairs.java b/src/com/cnaude/chairs/core/Chairs.java index ec2b9f4..be72769 100644 --- a/src/com/cnaude/chairs/core/Chairs.java +++ b/src/com/cnaude/chairs/core/Chairs.java @@ -25,6 +25,7 @@ import com.cnaude.chairs.sitaddons.CommandRestrict; import com.cnaude.chairs.vehiclearrow.NMSAccess; public class Chairs extends JavaPlugin { + public ChairEffects chairEffects; public List allowedBlocks; public List validSigns; @@ -45,7 +46,6 @@ public class Chairs extends JavaPlugin { public String msgSitting, msgStanding, msgOccupied, msgNoPerm, msgReloaded, msgDisabled, msgEnabled, msgCommandRestricted; - private PlayerSitData psitdata; public PlayerSitData getPlayerSitData() { return psitdata; diff --git a/src/com/cnaude/chairs/sitaddons/CommandRestrict.java b/src/com/cnaude/chairs/sitaddons/CommandRestrict.java index 53ebea4..8ca98e5 100644 --- a/src/com/cnaude/chairs/sitaddons/CommandRestrict.java +++ b/src/com/cnaude/chairs/sitaddons/CommandRestrict.java @@ -16,25 +16,19 @@ public class CommandRestrict implements Listener { } @EventHandler(priority=EventPriority.LOWEST) - public void onPlayerCommand(PlayerCommandPreprocessEvent event) - { + public void onPlayerCommand(PlayerCommandPreprocessEvent event) { Player player = event.getPlayer(); String playercommand = event.getMessage().toLowerCase(); - if (plugin.getPlayerSitData().isSitting(player)) - { - if (plugin.sitDisableAllCommands) - { + if (plugin.getPlayerSitData().isSitting(player)) { + if (plugin.sitDisableAllCommands) { event.setCancelled(true); player.sendMessage(plugin.msgCommandRestricted); return; } - for (String disabledCommand : plugin.sitDisabledCommands) - { - if (disabledCommand.startsWith(playercommand)) - { + for (String disabledCommand : plugin.sitDisabledCommands) { + if (disabledCommand.startsWith(playercommand)) { String therest = playercommand.replace(disabledCommand, ""); - if (therest.isEmpty() || therest.startsWith(" ")) - { + if (therest.isEmpty() || therest.startsWith(" ")) { event.setCancelled(true); player.sendMessage(plugin.msgCommandRestricted); return; diff --git a/src/com/cnaude/chairs/vehiclearrow/NMSAccess.java b/src/com/cnaude/chairs/vehiclearrow/NMSAccess.java index e800037..b3ee385 100644 --- a/src/com/cnaude/chairs/vehiclearrow/NMSAccess.java +++ b/src/com/cnaude/chairs/vehiclearrow/NMSAccess.java @@ -18,14 +18,14 @@ public class NMSAccess { String packageName = Bukkit.getServer().getClass().getPackage().getName(); String nmspackageversion = packageName.substring(packageName.lastIndexOf('.') + 1); switch (nmspackageversion) { - case "v1_7_R1": { - nmsArrowClass = Class.forName(pkgname+"."+"nms172"+".NMSChairsArrow"); - return; - } - case "v1_6_R3": { - nmsArrowClass = Class.forName(pkgname+"."+"nms164"+".NMSChairsArrow"); - return; - } + case "v1_7_R1": { + nmsArrowClass = Class.forName(pkgname+"."+"nms172"+".NMSChairsArrow"); + return; + } + case "v1_6_R3": { + nmsArrowClass = Class.forName(pkgname+"."+"nms164"+".NMSChairsArrow"); + return; + } } throw new Exception("ChairsReloaded is not compatible with your server version"); }